From affd52588af38660a72a501cc402cf93c291bc4e Mon Sep 17 00:00:00 2001 From: lixg Date: Thu, 24 Nov 2022 15:10:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=A0=91=E5=8F=8A=E9=A1=B9=E7=9B=AE=E5=BD=92=E5=B1=9E=E6=9D=83?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 40 ++- src/api/index1.js | 16 +- src/components/drawers/ProjCheckPower.vue | 16 +- src/components/drawers/ProjectOwn.vue | 307 +++++++++++++--------- src/store/index.js | 15 +- src/views/projectcenter/ProjectManage.vue | 20 +- 6 files changed, 263 insertions(+), 151 deletions(-) diff --git a/src/App.vue b/src/App.vue index f3620e3e..63fa31ce 100644 --- a/src/App.vue +++ b/src/App.vue @@ -42,18 +42,50 @@ export default defineComponent({ }); const currentRouteName = computed(() => route.name); + //获取组织树 const orgTree = () => { + let obj = { + id: 0, + keyWord: "", + pageNo: 0, + pageSize: 20, + }; api - .orgtree() + .getOrgInfo(obj) .then((res) => { - console.log("获取集团组织成功", res); if (res.status === 200) { - store.commit("getOrgtreeList", res.data.data); + // console.log("获取组织树成功", res.data.data); + // state.orgtreeList = res.data.data; + if (res.status === 200) { + let arr = res.data.data.rows; + for (let i = 0; i < arr.length; i++) { + let object = { + keyWord: "", + id: arr[i].id, + pageNo: 1, + pageSize: 20, + }; + api + .getOrgInfo(object) + .then((res) => { + // console.log("获取子元素", res); + if (res.status === 200) { + arr[i].treeChildList = res.data.data.rows; + if (i === arr.length - 1) { + store.commit("getOrgtreeList", arr); + } + } + }) + .catch((err) => { + console.log("获取子元素失败", err); + }); + } + } } }) .catch((err) => { - console.log("获取集团组织失败", err); + console.log("获取组织树失败", err); }); }; orgTree(); diff --git a/src/api/index1.js b/src/api/index1.js index bc2d71bd..ee7bd0df 100644 --- a/src/api/index1.js +++ b/src/api/index1.js @@ -2,7 +2,7 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2022-11-04 22:45:31 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2022-11-22 18:04:47 + * @LastEditTime: 2022-11-24 10:59:33 * @FilePath: /fe-manage/src/api/index1.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -87,9 +87,21 @@ export const billboard = (obj) => http.post('/admin/project/billboard', obj); //获取字典信息 export const getDict = (obj) => http.post('/dict/getList', obj) -//获取组织树 +//获取组织树一级列表 export const getOrgTree = (obj) => http.post('/admin/router/orgList', obj) +//根据id获取组织树一级元素下所有子元素 +export const orgTreeList = (obj) => http.post('/admin/router/orgTreeList', obj) +//根据id获取部门下学员 +export const searchUsersByOrgId = (obj) => http.post('/admin/router/searchUsersByOrgId', obj) +//获取组织信息(修改版) +export const getOrgInfo = (obj) => http.post('/admin/orgStruct/getOrgInfo', obj) +//获取员工(修改版) +export const getMemberInfo = (obj) => http.post('/admin/orgStruct/getMemberInfo', obj) +//获取受众(修改版) +export const getAudienceInfo = (obj) => http.post('/admin/orgStruct/getAudienceInfo', obj) +//获取授权(修改版) +export const optionAuthPerm = (obj) => http.post('/admin/AuthPerm/optionAuthPerm', obj) // 获取组织结构树 export const orgtree = () => http.get('/org/tree'); diff --git a/src/components/drawers/ProjCheckPower.vue b/src/components/drawers/ProjCheckPower.vue index 40c3f78d..db4e9b53 100644 --- a/src/components/drawers/ProjCheckPower.vue +++ b/src/components/drawers/ProjCheckPower.vue @@ -493,7 +493,7 @@ - +