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: () => (
{ - props.formData.preProcess? - {props.formData.preProcess.requestName} : - {'--'} + props.formData.preProcess ? props.formData.preProcess.map(item => { + return {item.requestName} + }) : {'--'} }
) @@ -138,9 +140,10 @@ const schema = computed(() => { component: () => (
{ - props.formData.preProcess? - {props.formData.preProcess.requestName} : - {'--'} + props.formData.preProcess ? props.formData.preProcess.map(item => { + return {item.requestName} + }) : {'--'} }
) 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 @@ 搜索 - 全选 - 不全选 - - - - - - - - - - - + + + + + + + + + + + + +
@@ -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') } +