diff --git a/src/api/login.js b/src/api/login.js
index 0de6506..087173f 100644
--- a/src/api/login.js
+++ b/src/api/login.js
@@ -7,6 +7,7 @@ export const getCodeImg = () => {
})
}
+
export const login = (data) => {
return request({
url: '/auth/login',
@@ -14,6 +15,12 @@ export const login = (data) => {
data
})
}
+export const switchAccount = (userId) => {
+ return request({
+ url: `/auth/switch/account/${userId}`,
+ method: 'post',
+ })
+}
export const getUserInfo = () => {
return request({
diff --git a/src/api/system/menuman.js b/src/api/system/menuman.js
index 8d44d4b..c4db6d5 100644
--- a/src/api/system/menuman.js
+++ b/src/api/system/menuman.js
@@ -40,7 +40,7 @@ export const getMenuInfo = (menuId) => {
export const getMenuOpt = (excludeId=0) => {
return request({
- url: '/admin/menu/option/role/'+excludeId,
+ url: '/admin/menu/option/'+excludeId,
method: 'get'
})
}
diff --git a/src/api/user/user.js b/src/api/user/user.js
index b689fc4..10aec8c 100644
--- a/src/api/user/user.js
+++ b/src/api/user/user.js
@@ -15,6 +15,12 @@ export const getSubCompOpt = () => {
method: 'get'
})
}
+export const getUserAccount = () => {
+ return request({
+ url: `/admin/mosr/user/account/list`,
+ method: 'get'
+ })
+}
// 查询角色信息
export const getRolesOpt = () => {
diff --git a/src/components/DetailComponent/ApprovalDetail.vue b/src/components/DetailComponent/ApprovalDetail.vue
index 34d2dd8..322fb4b 100644
--- a/src/components/DetailComponent/ApprovalDetail.vue
+++ b/src/components/DetailComponent/ApprovalDetail.vue
@@ -29,7 +29,8 @@
@@ -97,9 +98,10 @@ const schema = computed(() => {
component: () => (
)
@@ -138,9 +140,10 @@ const schema = computed(() => {
component: () => (
)
diff --git a/src/components/DetailComponent/CompanyPicker.vue b/src/components/DetailComponent/CompanyPicker.vue
index b57686e..1474132 100644
--- a/src/components/DetailComponent/CompanyPicker.vue
+++ b/src/components/DetailComponent/CompanyPicker.vue
@@ -10,25 +10,26 @@
搜索
- 全选
- 不全选
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
handle(node,check)"
@check-change="handleChange" :filter-node-method="filterNode">
@@ -85,7 +86,7 @@ const props = defineProps({
type: Boolean
}
});
-const checkBtn=ref(1)
+const checkBtn = ref(1)
const isChooseAll = ref(true);
let selectItem = reactive({
type: -1,
@@ -117,25 +118,31 @@ const _value = computed({
watch(() => filterText.value, (newVal) => {
tree.value.filter(newVal);
});
-const matterTree=(list)=>{
- list.forEach(item=>{
- tree.value.setChecked(item,true)
- if(item.children!==undefined){
+const matterTree = (list) => {
+ list.forEach(item => {
+ tree.value.setChecked(item, true)
+ if (item.children !== undefined) {
matterTree(item.children)
}
})
}
-const cancelAll=()=>{
- isChooseAll.value=true
+const cancelAll = () => {
+ isChooseAll.value = true
tree.value.setCheckedNodes([])
}
-const chooseAll=()=>{
- isChooseAll.value=false
+const chooseAll = () => {
+ isChooseAll.value = false
matterTree(dataList.value)
}
const getList = () => {
getSubCompOpt().then(res => {
- dataList.value = res.data;
+ dataList.value = [
+ {
+ label: "全选",
+ value: -1,
+ children: res.data
+ }
+ ]
});
};
@@ -149,48 +156,50 @@ const filterNode = (value, data) => {
const show = () => {
//用于弹开部门选择
visible.value = true;
- selectList.value=_value.value
- defaultChecked.value=_value.value.map(item=>item.value)
+ selectList.value = _value.value
+ defaultChecked.value = _value.value.map(item => item.value)
getList()
};
const handleChange = (data, checked) => {
- // 左侧有选择框
- // if (props.showCheckbox) {
- // 左侧有选择框 + 多选
- if (props.multiple) {
- //不添加重复的数据到右边
- for (let i = 0; i < selectList.value.length; i++) {
- if (selectList.value[i].value === data.value) {
- selectList.value.splice(i, 1);
- break;
- }
- }
- if (checked) {
- // if (data.children === undefined) {
- selectList.value.push(data);
- // }
- } else if (data === "1") {
- tree.value.setCheckedKeys([]);
- selectList.value = [];
- }
- } else {// 左侧有选择框 + 单选
- //不添加重复的数据到右边
- for (let i = 0; i < selectList.value.length; i++) {
- if (selectList.value[i].value === data.value) {
- selectList.value.splice(i, 1);
- break;
- }
- }
- if (checked) {
- tree.value.setCheckedNodes([data]);
- // this.$refs.tree.setCheckedKeys([]);
- selectList.value = [data];
- } else if (data === "1") {
- selectList.value = [];
- tree.value.setCheckedKeys([]);
+ if(data.value==-1&&checked){
+ chooseAll()
+ }else if(data.value==-1&&!checked){
+ cancelAll()
+ }
+ // 左侧有选择框 + 多选
+ if (props.multiple) {
+ //不添加重复的数据到右边
+ for (let i = 0; i < selectList.value.length; i++) {
+ if (selectList.value[i].value === data.value) {
+ selectList.value.splice(i, 1);
+ break;
}
}
- // }
+ if (checked) {
+ // if (data.children === undefined) {
+ selectList.value.push(data);
+ // }
+ } else if (data === "1") {
+ tree.value.setCheckedKeys([]);
+ selectList.value = [];
+ }
+ } else {// 左侧有选择框 + 单选
+ //不添加重复的数据到右边
+ for (let i = 0; i < selectList.value.length; i++) {
+ if (selectList.value[i].value === data.value) {
+ selectList.value.splice(i, 1);
+ break;
+ }
+ }
+ if (checked) {
+ tree.value.setCheckedNodes([data]);
+ // this.$refs.tree.setCheckedKeys([]);
+ selectList.value = [data];
+ } else if (data === "1") {
+ selectList.value = [];
+ tree.value.setCheckedKeys([]);
+ }
+ }
};
const handle = (node, check) => {
if (check.isLeaf !== false) {
@@ -215,7 +224,7 @@ const noSelected = (selectItem) => {
//左侧无选择框时,右侧显示×
for (let i = 0; i < selectList.value.length; i++) {
if (selectList.value[i].value === selectItem.value) {
- tree.value.setChecked(selectList.value[i].value,false);
+ tree.value.setChecked(selectList.value[i].value, false);
selectList.value.splice(i, 1);
break;
}
diff --git a/src/components/DetailComponent/ProjectApply.vue b/src/components/DetailComponent/ProjectApply.vue
index b8ae84a..74e27d9 100644
--- a/src/components/DetailComponent/ProjectApply.vue
+++ b/src/components/DetailComponent/ProjectApply.vue
@@ -4,10 +4,12 @@
- {{ localFormData.preProcess?.requestName }}
+
- {{ localFormData.preProcess?.requestName ? '更改' : '请选择' }}
+ {{ localFormData.preProcess ? '更改' : '请选择' }}
@@ -32,29 +34,30 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
提交
重新提交
@@ -71,7 +74,9 @@
重置
-
+
+
@@ -81,15 +86,17 @@
-
+
+ 查看流程
+
+ 确定
+ 取消
+
@@ -163,11 +170,13 @@ const tagsViewStore = useTagsView()
const processStore = useProcessStore()
const otherFileList = ref([])
const localFormData = ref({
- preProcess: {
- requestId: null,
- requestName: '',
- baseUrl: ''
- }
+ preProcess: [
+ // {
+ // requestId: null,
+ // requestName: '',
+ // baseUrl: ''
+ // }
+ ]
})
const attachment = ref()
const deploymentData = ref({})
@@ -177,7 +186,24 @@ const loading = ref(false)
const processDiagramViewer = ref(false)
const name = ref(router.currentRoute.value.name)
const deploymentId = ref()
+const selectRows = ref([])
const projectId = ref(route.query.projectId)
+const getPreProcessUrl = (list) => {
+ // list.map(item => {
+ // item.baseUrl = getPreProcessUrl(item.preProcess)
+ // })
+ // let baseUrl=
+ // list.forEach(item => {
+ // baseUrl=item.baseUrl
+ // })
+ // return baseUrl
+}
+const handleSelect = async (selection) => {
+ selectRows.value = selection
+}
+const handleCancel = () => {
+ showPreTable.value = false
+}
const searchPreProcess = () => {
getPreProcessList()
@@ -207,12 +233,19 @@ const getPreProcessList = () => {
preProcessList.value = currentList.value.slice(0, 10)
})
}
-const chooseProProcess = (item) => {
- localFormData.value.preProcess = {
- requestId: item.requestId,
- requestName: item.requestName,
- baseUrl: item.baseUrl
- }
+const choosePreProcess = () => {
+ let preProcessObj = {}
+ let preProcessArray = []
+ selectRows.value.forEach((item) => {
+ preProcessObj = {
+ requestId: item.requestId,
+ requestName: item.requestName,
+ baseUrl: item.baseUrl
+ }
+ preProcessArray.push(preProcessObj)
+ })
+ localFormData.value.preProcess = preProcessArray
+ console.log('localFormData.value.preProcess', localFormData.value.preProcess)
showPreTable.value = false
}
@@ -252,11 +285,11 @@ const compositeParam = (item) => {
}
}
const getAttachment = (val) => {
- console.log('上传文件getAttachment', val)
+ // console.log('上传文件getAttachment', val)
localFormData.value.singleFile = compositeParam(val)
}
const getOtherFile = (val) => {
- console.log('上传文件getOtherFile', val)
+ // console.log('上传文件getOtherFile', val)
showTable.value = false
let fileObj = compositeParam(val)
otherFileList.value.push(fileObj)
@@ -271,7 +304,7 @@ const getFileParam = (item) => {
}
}
const handleSubmit = async () => {
- if(deploymentData.value.deploymentName==='重大项目立项'||deploymentData.value.deploymentName==='重大项目验收'){
+ if (deploymentData.value.deploymentName === '重大项目立项' || deploymentData.value.deploymentName === '重大项目验收') {
if (localFormData.value.preProcess === undefined) {
ElNotification({
title: '提示',
@@ -377,7 +410,7 @@ const init = async () => {
let data = res.data
deploymentId.value = data.deploymentId
deploymentData.value = data
- preProcessRequired.value = data.deploymentName === '重大项目立项'||data.deploymentName === '重大项目验收';
+ preProcessRequired.value = data.deploymentName === '重大项目立项' || data.deploymentName === '重大项目验收';
processStore.setDesign(data)
processStore.runningList.value = data.runningList;
processStore.endList.value = data.endList;
@@ -406,5 +439,9 @@ onMounted(async () => {
diff --git a/src/fvcomponents/fvTable/index.vue b/src/fvcomponents/fvTable/index.vue
index a75c5ca..75a0952 100644
--- a/src/fvcomponents/fvTable/index.vue
+++ b/src/fvcomponents/fvTable/index.vue
@@ -144,7 +144,7 @@ const localData = reactive({
checkGroup: []
})
-const emits = defineEmits(['headBtnClick', 'selectionChange', 'rowClick', 'rowDblclick', 'getBaseQuery', 'cellClick'])
+const emits = defineEmits(['headBtnClick', 'selectionChange', 'rowClick', 'rowDblclick', 'getBaseQuery', 'cellClick', 'getTotal'])
const handleClickBtns = (key) => {
emits('headBtnClick', key)
@@ -211,6 +211,7 @@ const getList = async () => {
}
if(data.total){
localData.total = data.total
+ emits('getTotal', localData.total)
}
localData.loading = false
} else {
diff --git a/src/layout/navbar/index.vue b/src/layout/navbar/index.vue
index 9dbef25..3900296 100644
--- a/src/layout/navbar/index.vue
+++ b/src/layout/navbar/index.vue
@@ -6,13 +6,47 @@
-
-
欢迎回来,{{ userInfo.userName }}
+
{{ userInfo.nickName }}
+
{{ userInfo.nickName }}
+
+
+
+
- - 个人中心
- - 退出登录
+ - 主次账号切换
+ -
+ {{ item.nickName }}
+
+
+ 主
+ {{ item.nickName }}
+ {{ item.jobActivityDesc }}
+
+
+ {{ item.companyName }}/{{ item.departmentName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+ 退出登录
+
@@ -26,13 +60,18 @@ import Breadcrumb from './Breadcrumb.vue';
import Hamburger from './Hamburger.vue';
import {useAuthStore} from '@/stores/userstore.js'
import {usePermisstionStroe} from '@/stores/permisstion'
-import { useTagsView } from '@/stores/tagsview';
+import {useTagsView} from '@/stores/tagsview';
+import {getUserAccount} from "@/api/user/user";
+import {switchAccount} from "@/api/login";
+import {setToken} from "../../utils/auth";
const authStore = useAuthStore()
const permisstionStore = usePermisstionStroe()
const tagsViewStore = useTagsView()
const userInfo = ref({})
const visitedP = ref(false)
+const accountList = ref([])
+const selectUserId = ref()
const router = useRouter()
onMounted(() => {
setUserInfo()
@@ -48,7 +87,26 @@ const nullBlockClick = () => {
visitedP.value = false
}
const handleVisitedP = () => {
- visitedP.value = !visitedP.value
+ getUserAccount().then(res => {
+ console.log(res)
+ accountList.value = res.data
+ nextTick(() => {
+ visitedP.value = !visitedP.value
+ })
+ })
+}
+
+const accountChange = (userId) => {
+ switchAccount(userId).then(res => {
+ if (res.code == 1000) {
+ visitedP.value = !visitedP.value
+ authStore.userLogout()
+ setToken(res.data)
+ router.push('/')
+ location.reload()
+ visitedP.value = false
+ }
+ })
}
const handleToAuth = () => {
@@ -63,9 +121,18 @@ const handleLogout = () => {
tagsViewStore.removeAllTagView()
router.push('/login')
}
+