From 33e9e1bb93fd253316444980f3179264798ff9df Mon Sep 17 00:00:00 2001 From: lixg Date: Mon, 28 Nov 2022 22:47:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E4=BB=A5=E5=8F=8A=E4=BF=AE=E6=94=B9=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 43 +- src/api/config.js | 2 +- src/api/index1.js | 7 +- src/api/method.js | 17 +- src/components/NavTop.vue | 6 +- src/components/drawers/ProjCheckPower.vue | 755 ++++++++++------------ src/components/drawers/ProjPowerList.vue | 37 +- src/components/drawers/ProjectOwn.vue | 12 +- src/components/drawers/StuAdd.vue | 45 +- src/views/learningpath/LevelAddDetail.vue | 30 +- src/views/projectcenter/ClassAdd.vue | 204 +++++- src/views/projectcenter/ProjectAdd.vue | 73 ++- src/views/projectcenter/ProjectManage.vue | 299 +++++++-- src/views/projectcenter/SonProject.vue | 206 +++++- src/views/projectcenter/TaskAdd.vue | 32 +- src/views/projectcenter/temTask.vue | 32 +- 16 files changed, 1135 insertions(+), 665 deletions(-) diff --git a/src/App.vue b/src/App.vue index f6028c22..22dab8f3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -44,51 +44,28 @@ export default defineComponent({ const currentRouteName = computed(() => route.name); //获取组织树 - const orgTree = () => { + const getOrgTree = () => { let obj = { - id: 0, keyWord: "", - pageNo: 0, + id: -1, + pageNo: 1, pageSize: 20, }; api .getOrgInfo(obj) .then((res) => { - if (res.status === 200) { - // 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); - }); - } - } + console.log("组织树获取成功", res); + if (res.data.code === 200) { + // state.treeData = res.data.data; + store.commit("getOrgtreeList", res.data.data); } }) .catch((err) => { - console.log("获取组织树失败", err); + console.log("组织树获取失败", err); }); }; - orgTree(); + + getOrgTree(); return { routes, diff --git a/src/api/config.js b/src/api/config.js index 1db87212..959a3582 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -2,7 +2,7 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2022-11-21 14:32:52 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2022-11-27 16:55:32 + * @LastEditTime: 2022-11-28 14:25:01 * @FilePath: /fe-manage/src/api/config.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ diff --git a/src/api/index1.js b/src/api/index1.js index 953a30b6..afa2b171 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-26 14:57:17 + * @LastEditTime: 2022-11-28 19:59:10 * @FilePath: /fe-manage/src/api/index1.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -102,8 +102,11 @@ 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 getUser = () => http.post('/admin/CheckUser/login', { withCredentials: true }) diff --git a/src/api/method.js b/src/api/method.js index cee18bff..90e99871 100644 --- a/src/api/method.js +++ b/src/api/method.js @@ -196,7 +196,21 @@ function getCookie(name) { } return ""; } -//最后通 + + +//滚动加载信息 +const scrollLoad = (e) => { + // console.log("滚动", e, b); + const { target } = e; + const scrllHeight = target.scrollHeight - target.scrollTop; + const clientHeight = target.clientHeight; + // console.log("scrllHeight", scrllHeight, clientHeight); + if (scrllHeight === 0 && clientHeight === 0) { + return 1 + } else if (scrllHeight - clientHeight == 0) { + return 2 + } +}; //新建延迟 @@ -414,6 +428,7 @@ export { formatNumber, setCookie, getCookie, + scrollLoad, commonData, organizationalTree, iframeUrl, diff --git a/src/components/NavTop.vue b/src/components/NavTop.vue index dca09764..6f9da3bb 100644 --- a/src/components/NavTop.vue +++ b/src/components/NavTop.vue @@ -29,7 +29,7 @@ border-radius: 15px; margin-right: 10px; " - src="../assets/images/avatar.png" + :src="avatar" />
{{ username }}
@@ -69,6 +69,7 @@ export default { const state = reactive({ selectRole: "管理员", username: "", + avatar: null, roleList: [ { id: 1, @@ -103,6 +104,9 @@ export default { console.log("获取登录信息成功", res); if (res.data.code === 200) { state.username = res.data.data.realName; + state.avatar = res.data.data.avatar + ? res.data.data.avatar + : require("../assets/images/avatar.png"); } }) .catch((err) => { diff --git a/src/components/drawers/ProjCheckPower.vue b/src/components/drawers/ProjCheckPower.vue index db4e9b53..8c0e27d3 100644 --- a/src/components/drawers/ProjCheckPower.vue +++ b/src/components/drawers/ProjCheckPower.vue @@ -9,7 +9,11 @@ >
-
查看权
+
+ {{ + authClassify === 1 ? "查看权" : authClassify === 2 ? "管理权" : "" + }} +
姓名:
-
+
搜索
-
+
@@ -131,13 +140,13 @@
组织:
-
+
搜索
-
+
@@ -216,13 +230,13 @@
受众名称:
-
+
搜索
-
+
@@ -372,7 +387,7 @@ v-for="item in chooseorganization1" :key="item.key" > -
{{ item.value }}
+
{{ item.name }}
@@ -436,7 +451,7 @@ :key="item.key" >
{{ item.name }}
-
+
@@ -488,8 +503,8 @@
- - + +
@@ -530,8 +545,14 @@ import { reactive, toRefs, onMounted, onUnmounted, computed } from "vue"; import elementResizeDetectorMaker from "element-resize-detector"; import { message } from "ant-design-vue"; -import { toDate } from "../../api/method"; +// import { toDate } from "../../api/method"; import { useStore } from "vuex"; +import { + traverseArr, + // deepClone, + // batchLoadList, +} from "../../utils/utils"; +import * as api from "../../api/index1"; export default { name: "ProjCheckShip", props: { @@ -539,20 +560,30 @@ export default { type: Boolean, default: false, }, + authClassify: { + type: Number, + default: null, + }, }, setup(props, ctx) { const store = useStore(); const state = reactive({ screenHeight: document.body.clientHeight, // 屏幕高度 + //快速选人 pageSize: 10, currentPage: 1, - tableDataTotal: 50, - pageSize1: 10, - currentPage1: 1, - tableDataTotal1: 50, + tableDataTotal: 0, + nameSearch: "", //搜索名称 + + //受众 pageSize2: 10, currentPage2: 1, - tableDataTotal2: 50, + tableDataTotal2: 0, + audienceName: "", + + pageSize1: 10, + currentPage1: 1, + tableDataTotal1: 0, selectedRowKeys1: [], @@ -562,404 +593,70 @@ export default { valueSelect: null, //树形选择 valueSelectboe2: null, //boe树形选择 - name: "", + nameadd: "", - nameaddd: "", - com: "", + + searchOrgName: "", //搜索组织 //组织树 - treeData: [ - { - title: "京东方", - value: "京东方", - children: [ - { - title: "产研部", - value: "产研部", - children: [ - { - title: "产品部", - value: "产品部", - }, - { - title: "研究部", - value: "研究部", - }, - { - title: "研究部2", - value: "研究部2", - }, - { - title: "研究3", - value: "研究3", - }, - { - title: "研究4", - value: "研究4", - }, - { - title: "研究部5", - value: "研究部5", - }, - { - title: "研究部6", - value: "研究部6", - }, - { - title: "研究部7", - value: "研究部7", - }, - { - title: "研究部8", - value: "研究部8", - }, - { - title: "研究部9", - value: "研究部9", - }, - ], - }, - { - title: "二级标题", - value: "二级标题", - children: [ - { - title: "三级标题", - value: "三级标题", - children: [ - { - title: "四级标题", - value: "四级标题", - children: [ - { - title: "五级标题", - value: "五级标题", - children: [ - { - title: "六级标题", - value: "六级标题", - children: [ - { - title: "七级标题", - value: "七级标题", - children: [ - { - title: "八级标题", - value: "八级标题", - children: [ - { - title: "九级标题", - value: "九级标题", - children: [ - { - title: "十级标题", - value: "十级标题", - children: [ - { - title: "十一级标题", - value: "十一级标题", - children: [ - { - title: "十二级标题", - value: "十二级标题", - children: [ - { - title: - "十三级标题十三级标题十三级标题十三级标题", - value: "十三级标题", - children: [ - { - title: - "十四级标题", - value: - "十四级标题", - children: [ - { - title: - "十五级标题", - value: - "十五级标题", - children: [ - { - title: - "十六级标题", - value: - "十六级标题", - children: - [ - { - title: - "十七级标题", - value: - "十七级标题", - children: - [ - { - title: - "十八级标题", - value: - "十八级标题", - children: - [ - { - title: - "十九级标题", - value: - "十九级标题", - children: - [ - { - title: - "二十级标题二十级标题", - value: - "二十级标题二十级标题", - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - ], - }, - { - title: "人力资源部", - value: "人力资源部", - children: [ - { - title: "人事部", - value: "人事部", - }, - { - title: "行政部", - value: "行政部", - }, - ], - }, - ], - }, - ], + treeData: [], //快速选人的table tabledata: [ - { - key: 1, - name: "小李小李小李", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, - { - key: 2, - name: "小刘小刘小刘", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, - { - key: 3, - name: "小李小李", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, - { - key: 4, - name: "小李", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, - { - key: 5, - name: "小李", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, - { - key: 6, - name: "小李", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, - { - key: 7, - name: "小李", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, - { - key: 8, - name: "小李", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, - { - key: 9, - name: "小小李", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, - { - key: 10, - name: "小小李", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, - { - key: 11, - name: "小小李", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, - { - key: 12, - name: "小小李", - bum: "产研部", - numb: "000000", - guishu: "产品部", - }, + // { + // key: 1, + // name: "小李小李小李", + // bum: "产研部", + // numb: "000000", + // guishu: "产品部", + // }, ], tablecolumns: [ { title: "姓名", dataIndex: "name", key: "name", - // width: 30, - align: "left", + width: 80, + align: "center", className: "h", + ellipsis: true, }, { title: "工号", dataIndex: "numb", key: "numb", - // width: 30, + width: 80, align: "center", className: "h", + ellipsis: true, }, { title: "归属组织", dataIndex: "guishu", key: "guishu", - // width: 30, + width: 80, align: "center", className: "h", + ellipsis: true, }, { title: "部门", dataIndex: "bum", key: "bum", - // width: 30, + width: 80, align: "center", className: "h", + ellipsis: true, }, ], //受众关联table数据 tabledata2: [ - { - key: 1, - name: "学习受众", - time: "1668410969", - number: "20", - type: "普通受众", - }, - { - key: 2, - name: "案例受众", - time: "1668324569", - number: "10", - type: "普通受众", - }, - { - key: 3, - name: "学习受众", - time: "1668238169", - number: "20", - type: "普通受众", - }, - { - key: 4, - name: "显示受众", - time: "1668133769", - number: "30", - type: "普通受众2", - }, - { - key: 5, - name: "惯例受众", - time: "1668047369", - number: "50", - type: "普通受众", - }, - { - key: 6, - name: "管理受众", - time: "1667960969", - number: "20", - type: "普通受众", - }, - { - key: 7, - name: "学习小组受众", - time: "1667874569", - number: "20", - type: "普通受众", - }, - { - key: 8, - name: "学习受众", - time: "1667701769", - number: "10", - type: "普通受众", - }, - { - key: 9, - name: "案例受众", - time: "1667442569", - number: "5", - type: "普通受众", - }, - { - key: 10, - name: "项目受众", - time: "1667262569", - number: "25", - type: "普通受众", - }, + // { + // key: 1, + // name: "学习受众", + // time: "1668410969", + // number: "20", + // type: "普通受众", + // }, ], tablecolumns2: [ { @@ -969,16 +666,17 @@ export default { width: 30, align: "left", className: "h", + ellipsis: true, }, { title: "创建时间", - dataIndex: "time", - key: "time", + dataIndex: "createTime", + key: "createTime", width: 35, align: "center", className: "h", sorter: { - compare: (a, b) => a.time - b.time, + compare: (a, b) => new Date(a.createTime) - new Date(b.createTime), multiple: 3, }, scopedSlots: { customRender: "action" }, //引入的插槽 @@ -986,23 +684,23 @@ export default { // console.log(text.record.checked1); return (
- {toDate(Number(text.record.time), "Y-M-D h:m:s")} + {text.record.createTime}
); }, }, { title: "人数", - dataIndex: "number", - key: "number", + dataIndex: "countNum", + key: "countNum", width: 30, align: "center", className: "h", }, { title: "类型", - dataIndex: "type", - key: "type", + dataIndex: "typeName", + key: "typeName", width: 40, align: "center", className: "h", @@ -1025,6 +723,8 @@ export default { showMore: false, //是否显示快速选人的查看更多 showHidden: false, //是否显示收回 selectedRowKeys: [], //表格选中的key + selectOrgId: null, //选中的组织id + selectOrgName: null, //选中的组织名称 //快速选人------------------------------------- //添加组织------------------------------------- @@ -1035,6 +735,9 @@ export default { showHidden1: false, //是否显示添加组织的收回 showOrgModal: false, //确认弹窗 + + isSearchOrg: false, + treeData2: [], //添加组织------------------------------------- //受众关联------------------------------------- @@ -1043,18 +746,22 @@ export default { showHidden2: false, //是否显示收回 selectedRowKeys2: [], //表格选中的key //受众关联------------------------------------- + + selectAllArr: null, //所有选中 }); - //获取组织树 - state.treeData = computed(() => { - return store.state.orgtreeList ? store.state.orgtreeList : []; - }); + const closeDrawer = () => { state.activeKey = "1"; ctx.emit("update:ProjCheckvisible", false); + deleteAll(); }; const afterVisibleChange = (bool) => { console.log("state", bool); }; + //获取组织树 + state.treeData = computed(() => { + return store.state.orgtreeList ? store.state.orgtreeList : []; + }); const getClientHeight = () => { state.screenHeight = document.body.clientHeight; @@ -1080,13 +787,70 @@ export default { //选中部门 const departmentSelect = (e, k) => { console.log("选中的部门", e, k); + state.currentPage = 1; state.selectedKeys = [k.node.key]; + state.selectOrgId = k.selectedNodes[0].id; //选中的组织id + state.selectOrgName = k.selectedNodes[0].name; //选中的组织名称 + getMember(k.selectedNodes[0].id); + }; + //获取学员 + const getMember = async (org) => { + if (!state.nameSearch && !org) { + return false; + } + console.log("org", org); + const item1 = await api + .getMemberInfo({ + pageNo: state.currentPage, + pageSize: state.pageSize, + keyWord: state.nameSearch, + org: state.nameSearch ? null : org, + }) + .then((res) => { + if (res.data.code === 200) { + console.log("获取学员", res.data); + state.tableDataTotal = res.data.data.total; + return res.data.data.rows; + } + }); + + state.tabledata = traverseArr(item1, { + key: "id", + name: "realName", + bum: "depName", + numb: "id", + guishu: "orgName", + }); + }; + //分页获取学员 + const changePagination = (page) => { + state.currentPage = page; + getMember(state.selectOrgId); + }; + //搜索学员 + const handleSearchStu = () => { + deleteDepSelect(); + state.currentPage2 = 1; + getMember(); + }; + //重置 + const resetStu = () => { + state.nameSearch = ""; + state.currentPage = 1; + state.tableDataTotal = 0; + state.tabledata = []; + }; + //清空选择部门信息 + const deleteDepSelect = () => { + state.selectedKeys = null; + state.selectOrgId = null; + state.selectOrgName = null; }; //快速选人 选中的数组 const onSelectChange = (selectedRowKeys, item) => { // console.log("selectedRowKeys changed: ", selectedRowKeys,item); - state.selectedRowKeys = selectedRowKeys; - state.choosepeople = item.reverse(); + state.selectedRowKeys.push(selectedRowKeys[selectedRowKeys.length - 1]); + state.choosepeople.unshift(item[item.length - 1]); selectedsHeight(); }; //单个删除选中的人 @@ -1159,9 +923,73 @@ export default { // 结束 快速选人------------------------------------------------------------------ // 开始 添加组织------------------------------------------------------------------ + //搜索组织 + const searchOrg = (id) => { + let obj = { + keyWord: state.searchOrgName, + id: id ? id : 0, + pageNo: 1, + pageSize: 99999, + }; + console.log("obj", obj); + api + .getOrgInfo(obj) + .then((res) => { + if (res.data.code === 200) { + state.isSearchOrg = true; + // res.data.data.rows.forEach((element) => { + // // console.log("element", element); + // element.treeChildList = []; + // }); + // console.log("组织树搜索成功", res.data.data.rows); + state.treeData2 = res.data.data.rows; + } + }) + .catch((err) => { + console.log("组织树获取失败", err); + }); + }; + //重置组织 + const resetOrg = () => { + state.isSearchOrg = false; + state.treeData2 = []; + state.searchOrgName = ""; + state.treeData = computed(() => { + return store.state.orgtreeList ? store.state.orgtreeList : []; + }); + }; + + // //搜索组织 + // const searchOrg = () => { + // let treeTitle = document + // .getElementById("ProjCheckship") + // .querySelector(".treeMain2") + // .querySelectorAll(".ant-tree-title"); + // if (state.searchOrgName) { + // for (let i = 0; i < treeTitle.length; i++) { + // if (state.searchOrgName === treeTitle[i].innerHTML) { + // document + // .getElementById("ProjCheckship") + // .querySelector(".treeMain2") + // .scrollTo(0, treeTitle[i].offsetTop + 28 * i); + // return; + // } else if (i == treeTitle.length - 1) { + // message.destroy(); + // message.warning("未找到该部门"); + // } + // } + // } else { + // message.destroy(); + // message.warning("请输入组织名称"); + // } + // }; + //选中部门 const departmentSelect1 = (e, k) => { console.log("选中的部门", e, k); + // if (state.isSearchOrg) { + // searchOrg(e[0]); + // } if (!k.node.children) { state.selectedKeys1 = e.reverse(); if (k.selected) { @@ -1189,7 +1017,7 @@ export default { //确定添加 const addOrg = () => { console.log("chooseorganization", state.chooseorganization); - state.chooseorganization1 = state.chooseorganization; + state.chooseorganization1 = Object.assign([], state.chooseorganization); //需要浅拷贝 selectedsHeight1(); state.showOrgModal = false; }; @@ -1266,39 +1094,61 @@ export default { .getElementById("ProjCheckship") .querySelector("#selectedsBox1").style.height = "160px"; }; - //搜索组织 - const searchOrg = () => { - let treeTitle = document - .getElementById("ProjCheckship") - .querySelector(".treeMain2") - .querySelectorAll(".ant-tree-title"); - if (state.com) { - for (let i = 0; i < treeTitle.length; i++) { - if (state.com === treeTitle[i].innerHTML) { - document - .getElementById("ProjCheckship") - .querySelector(".treeMain2") - .scrollTo(0, treeTitle[i].offsetTop + 28 * i); - return; - } else if (i == treeTitle.length - 1) { - message.destroy(); - message.warning("未找到该部门"); - } - } - } else { - message.destroy(); - message.warning("请输入组织名称"); - } - }; + // 结束 添加组织------------------------------------------------------------------ // 开始 受众关联------------------------------------------------------------------ + //获取受众 + const getAudienceInfo = async () => { + const item1 = await api + .getAudienceInfo({ + keyWord: state.audienceName, + id: 0, + pageNo: state.currentPage2, + pageSize: state.pageSize2, + }) + .then((res) => { + if (res.data.code === 200) { + console.log("获取学员", res.data); + state.tableDataTotal2 = res.data.data.total; + return res.data.data.rows; + } + }); + + state.tabledata2 = traverseArr(item1, { + key: "id", + name: "audienceName", + createTime: "createTime", + countNum: "countNum", + typeName: "typeName", + }); + }; + getAudienceInfo(); + //分页获取受众 + const changePagination1 = (page) => { + // console.log(page); + state.currentPage2 = page; + getAudienceInfo(); + }; + //搜索受众 + const searchAudienceInfo = () => { + state.currentPage2 = 1; + getAudienceInfo(); + }; + //重置受众 + const resetAudienceInfo = () => { + state.currentPage2 = 1; + state.audienceName = ""; + getAudienceInfo(); + }; + //受众关联 选中的数组 const onSelectChange2 = (selectedRowKeys, item) => { - // console.log("selectedRowKeys changed: ", selectedRowKeys,item); - state.selectedRowKeys2 = selectedRowKeys; - state.relationpeople = item.reverse(); + // console.log("selectedRowKeys changed: ", selectedRowKeys, item); + state.selectedRowKeys2.push(selectedRowKeys[selectedRowKeys.length - 1]); + state.relationpeople.unshift(item[item.length - 1]); + selectedsHeight2(); }; //单个删除选中的人 @@ -1317,7 +1167,6 @@ export default { } } state.selectedRowKeys2 = array; - console.log(""); }; //根据右侧快速选人高度,判断是否显示更多 const selectedsHeight2 = () => { @@ -1378,6 +1227,8 @@ export default { state.showMore = false; //是否显示快速选人的查看更多 state.showHidden = false; //是否显示收回 state.selectedRowKeys = []; //表格选中的key + state.selectOrgId = null; //选中的组织id + state.selectOrgName = null; //选中的组织名称 //快速选人------------------------------------- //添加组织------------------------------------- @@ -1396,6 +1247,42 @@ export default { state.showHidden2 = false; //是否显示收回 state.selectedRowKeys2 = []; //表格选中的key //受众关联------------------------------------- + + state.selectAllArr = null; //所有选中 + }; + + //确定添加授权 + const submitAuth = () => { + let choosepeople = []; + state.choosepeople.map((value) => { + let obj = { + id: value.key, + name: value.name, + }; + choosepeople.push(obj); + }); + + let chooseorganization1 = []; + state.chooseorganization1.map((value) => { + let obj = { + id: value.key, + name: value.name, + }; + chooseorganization1.push(obj); + }); + + let relationpeople = []; + state.relationpeople.map((value) => { + let obj = { + id: value.key, + name: value.name, + }; + relationpeople.push(obj); + }); + console.log("state", choosepeople, chooseorganization1, relationpeople); + state.selectAllArr = [choosepeople, chooseorganization1, relationpeople]; + ctx.emit("update:addAuthList", state.selectAllArr); + closeDrawer(); }; return { @@ -1428,6 +1315,18 @@ export default { deleteAll, searchOrg, + changePagination, + handleSearchStu, + resetStu, + + getAudienceInfo, + changePagination1, + searchAudienceInfo, + resetAudienceInfo, + + resetOrg, + + submitAuth, }; }, }; diff --git a/src/components/drawers/ProjPowerList.vue b/src/components/drawers/ProjPowerList.vue index 018c52ca..74265598 100644 --- a/src/components/drawers/ProjPowerList.vue +++ b/src/components/drawers/ProjPowerList.vue @@ -124,8 +124,8 @@
- - + +
@@ -167,11 +167,12 @@ export default { // state: "管理权", // }, ], - cancelAuthId: null, //取消授权id + cancelAuthInfo: null, //取消授权id }); const closeDrawer = () => { ctx.emit("update:ProjPvisible", false); + state.currentPage = 1; }; const afterVisibleChange = (bool) => { console.log("state", bool, props); @@ -183,9 +184,14 @@ export default { console.log("selectedRowKeys changed: ", selectedRowKeys); state.selectedRowKeys = selectedRowKeys; }; - const showCancelModal = (id) => { + const showCancelModal = (item) => { + console.log("item", item); state.cancelModal = true; - state.cancelAuthId = id; + let obj = { + id: item.number, + name: item.name, + }; + state.cancelAuthInfo = obj; }; const closeCancelModal = () => { state.cancelModal = false; @@ -259,7 +265,8 @@ export default {
{ - showCancelModal(text.record.id); + console.log("text.record.id", text.record.id); + showCancelModal(text.record); }} > 取消授权 @@ -299,9 +306,9 @@ export default { name: value.memberName ? value.memberName : "-", com: value.orgName ? value.orgName : "-", - gang: "产品经理", - number: "20201234", - state: "管理权", + gang: "-", + number: value.memberNo ? value.memberNo : "-", + state: "-", }; array.push(obj); }); @@ -338,18 +345,22 @@ export default { type: 2, tag: 1, opt: 4, - refId: state.cancelAuthId, + refId: props.selectProjectId, pageNo: 1, pageSize: 20, + deptList: [], + groupList: [], + studentList: [state.cancelAuthInfo], }; - console.log("获取权限名单obj", obj); + console.log("取消权限名单obj", obj); api .optionAuthPerm(obj) .then((res) => { - // console.log("获取权限名单成功", res); + console.log("取消权限名单", res); if (res.data.code === 200) { - console.log("取消授权成功", res.data.data); + // console.log("取消授权成功", res.data.data); optionAuthPerm(); + closeCancelModal(); } }) .catch((err) => { diff --git a/src/components/drawers/ProjectOwn.vue b/src/components/drawers/ProjectOwn.vue index 3a3c76c7..13f0ec30 100644 --- a/src/components/drawers/ProjectOwn.vue +++ b/src/components/drawers/ProjectOwn.vue @@ -607,8 +607,8 @@ export default { tag: 1, //归属权 opt: 1, //查询 type: 2, //项目 - // refId: props.selectProjectId, //项目id - refId: 64, + refId: props.selectProjectId, //项目id + // refId: 64, pageNo: 1, pageSize: 10, studentList: [], @@ -630,12 +630,14 @@ export default { tag: 2, //归属权 opt: 3, //修改 type: 2, //项目 - // refId: props.selectProjectId, //项目id - refId: 64, + refId: props.selectProjectId, //项目id + // refId: 64, pageNo: 1, pageSize: 10, // studentList: state.selectPeopleArr, - studentList: [{ id: "966733333637632000", name: "何丹" }], + deptList: [], + groupList: [], + studentList: state.selectPeopleArr, }; console.log("修改归属权obj", obj); api diff --git a/src/components/drawers/StuAdd.vue b/src/components/drawers/StuAdd.vue index 10455da0..674e4cc1 100644 --- a/src/components/drawers/StuAdd.vue +++ b/src/components/drawers/StuAdd.vue @@ -541,6 +541,7 @@ import { onMounted, onUnmounted, // watch + computed, } from "vue"; import elementResizeDetectorMaker from "element-resize-detector"; import { message } from "ant-design-vue"; @@ -556,7 +557,7 @@ import { // deepClone, batchLoadList, } from "../../utils/utils"; - +import { useStore } from "vuex"; export default { name: "StuAdd", props: { @@ -566,6 +567,7 @@ export default { }, }, setup(props, ctx) { + const store = useStore(); const state = reactive({ screenHeight: document.body.clientHeight, // 屏幕高度 pageSize: 10, @@ -1171,24 +1173,27 @@ export default { // state.copyTreeData = deepClone(arr); // }; //获取组织树 - const getTree = () => { - let obj = { - keyWord: "", - id: -1, - pageNo: 1, - pageSize: 20, - }; - getOrgInfoApi(obj) - .then((res) => { - console.log("组织树获取成功", res); - if (res.data.code === 200) { - state.treeData = res.data.data; - } - }) - .catch((err) => { - console.log("组织树获取失败", err); - }); - }; + // const getTree = () => { + // let obj = { + // keyWord: "", + // id: -1, + // pageNo: 1, + // pageSize: 20, + // }; + // getOrgInfoApi(obj) + // .then((res) => { + // console.log("组织树获取成功", res); + // if (res.data.code === 200) { + // state.treeData = res.data.data; + // } + // }) + // .catch((err) => { + // console.log("组织树获取失败", err); + // }); + // }; + state.treeData = computed(() => { + return store.state.orgtreeList ? store.state.orgtreeList : []; + }); //获取学员 const getMember = async (org) => { if (!state.nameSearch && !org) { @@ -1270,7 +1275,7 @@ export default { console.log("state", bool); if (bool) { // getComOnce(); - getTree(); + // getTree(); } }; const getClientHeight = () => { diff --git a/src/views/learningpath/LevelAddDetail.vue b/src/views/learningpath/LevelAddDetail.vue index 5c3b02d0..d3be222a 100644 --- a/src/views/learningpath/LevelAddDetail.vue +++ b/src/views/learningpath/LevelAddDetail.vue @@ -864,13 +864,13 @@
-
+
暂存
-
+
确定
-
+
取消
@@ -1051,7 +1051,7 @@ import draggable from "vuedraggable"; import { editTask } from "../../api/indexTaskadd"; // import { RouterEditTask } from "@/api/indexTask"; - +import { useRouter } from "vue-router"; import { toDate } from "../../api/method"; import UnlockMode from "../../components/drawers/UnlockMode.vue"; export default { @@ -1076,6 +1076,7 @@ export default { AddProject, }, setup() { + const router = useRouter(); const state = reactive({ routerId: storage.get("routerId") ? JSON.parse(storage.get("routerId")) @@ -1884,6 +1885,23 @@ export default { const showModeVisible = () => { state.unlockModeVisible = true; }; + + //暂存 + const temporaryStorage = () => { + message.success("暂存成功"); + }; + //确定 + const submitStorage = () => { + router.push({ + path: "/leveladd", + }); + }; + //取消 + const cancelStorage = () => { + router.push({ + path: "/leveladd", + }); + }; return { ...toRefs(state), // tableDataFunc, @@ -1935,6 +1953,10 @@ export default { showModeVisible, showAddface, + + temporaryStorage, + submitStorage, + cancelStorage, }; }, }; diff --git a/src/views/projectcenter/ClassAdd.vue b/src/views/projectcenter/ClassAdd.vue index 57526254..36ff6937 100644 --- a/src/views/projectcenter/ClassAdd.vue +++ b/src/views/projectcenter/ClassAdd.vue @@ -62,13 +62,17 @@ } " v-model:value="classifySelect" - placeholder="四个养成" + placeholder="请选择分类" style="width: 100%" :options="classifyList" @change="classificationChange" allowClear showSearch :disabled="viewDetail ? true : false" + :fieldNames="{ + label: 'dictName', + value: 'dictCode', + }" >
@@ -169,6 +173,7 @@ allowClear showSearch :disabled="viewDetail ? true : false" + @popupScroll="memberScroll" >
@@ -183,18 +188,26 @@
- + :tree-data="classifyList2" + :fieldNames="{ + children: 'treeChildList', + label: 'name', + value: 'id', + }" + >
@@ -252,6 +265,10 @@ @change="classificationChange3" placeholder="集团级/组织级/现地级/部门级" :disabled="viewDetail ? true : false" + :fieldNames="{ + label: 'dictName', + value: 'dictCode', + }" />
@@ -275,6 +292,10 @@ @change="classificationChange4" placeholder="集团级/组织级/现地级/部门级" :disabled="viewDetail ? true : false" + :fieldNames="{ + label: 'dictName', + value: 'dictCode', + }" />
@@ -355,6 +376,7 @@ style="width: 100%" :options="classifyList5" @change="classificationChange5" + @popupScroll="templateScroll" >
@@ -372,16 +394,18 @@