diff --git a/src/api/method.js b/src/api/method.js index 75c63029..f9a3eb5e 100644 --- a/src/api/method.js +++ b/src/api/method.js @@ -1,3 +1,4 @@ +import * as api from './index1' function formatNumber(n) { n = n.toString(); return n[1] ? n : "0" + n; @@ -215,7 +216,7 @@ function getCookie(name) { //滚动加载信息 const scrollLoad = (e) => { // console.log("滚动", e, b); - const {target} = e; + const { target } = e; const scrllHeight = target.scrollHeight - target.scrollTop; const clientHeight = target.clientHeight; // console.log("scrllHeight", scrllHeight, clientHeight); @@ -225,211 +226,47 @@ const scrollLoad = (e) => { return 2 } }; +//添加归属权 +function changeOwnership(classify, selectProjectId, selectPeopleArr) { + let obj = { + keyWord: "", + tag: 2, //归属权 + opt: 3, //修改 + type: + classify === "project" + ? 2 + : classify === "learnPath" + ? 1 + : classify === "course" + ? 3 + : null, + refId: selectProjectId, //项目id + // refId: 64, + pageNo: 1, + pageSize: 10, + // studentList: state.selectPeopleArr, + deptList: [], + groupList: [], + studentList: selectPeopleArr, + }; + console.log("修改归属权obj", obj); + api + .optionAuthPerm(obj) + .then((res) => { + console.log("修改授权成功", res); + // closeDrawer(); + }) + .catch((err) => { + console.log("修改授权失败", err); + }); +} //新建延迟 const commonData = { timeout: 50, } -// const organizationalTree = [ -// { -// 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: "行政部", -// }, -// ], -// }, -// ], -// }, -// ] +// const organizationalTree = [// ] //组织树 const organizationalTree = [] @@ -444,6 +281,7 @@ export { setCookie, getCookie, scrollLoad, + changeOwnership, commonData, organizationalTree, iframeUrl, diff --git a/src/components/drawers/ProjCheckPower.vue b/src/components/drawers/ProjCheckPower.vue index 509b156e..34a536d9 100644 --- a/src/components/drawers/ProjCheckPower.vue +++ b/src/components/drawers/ProjCheckPower.vue @@ -181,8 +181,34 @@
BOE组织树
+ + + { if (res.data.code === 200) { + console.log("搜索组织", res); 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; + state.treeData2 = res.data.data; } }) .catch((err) => { diff --git a/src/components/drawers/ProjPowerList.vue b/src/components/drawers/ProjPowerList.vue index f4fa7a54..5c65c17e 100644 --- a/src/components/drawers/ProjPowerList.vue +++ b/src/components/drawers/ProjPowerList.vue @@ -177,6 +177,9 @@ export default { const closeDrawer = () => { ctx.emit("update:ProjPvisible", false); state.currentPage = 1; + state.tableData = []; + state.tableDataTotal = -1; + state.name = null; }; const afterVisibleChange = (bool) => { console.log("state", bool, props); diff --git a/src/components/drawers/ProjectOwn.vue b/src/components/drawers/ProjectOwn.vue index 081c8b28..cc6a3cd4 100644 --- a/src/components/drawers/ProjectOwn.vue +++ b/src/components/drawers/ProjectOwn.vue @@ -200,6 +200,7 @@ import elementResizeDetectorMaker from "element-resize-detector"; // import { message } from "ant-design-vue"; import * as api from "../../api/index1"; import { useStore } from "vuex"; +import { message } from "ant-design-vue"; export default { name: "ProjOwnerShip", props: { @@ -407,6 +408,16 @@ export default { .optionAuthPerm(obj) .then((res) => { console.log("获取授权成功", res); + if (res.data.code === 200 && res.data.data.records.length > 0) { + state.selectedRowKeys = res.data.data.records[0].memberId; + + let obj = { + id: res.data.data.records[0].memberId, + name: res.data.data.records[0].memberName, + }; + state.choosepeople = [obj]; + state.selectPeopleArr = [obj]; + } }) .catch((err) => { console.log("获取授权失败", err); @@ -440,6 +451,7 @@ export default { .optionAuthPerm(obj) .then((res) => { console.log("修改授权成功", res); + message.success("修改归属权成功"); closeDrawer(); }) .catch((err) => { diff --git a/src/views/learningpath/LearningPath.vue b/src/views/learningpath/LearningPath.vue index 38ee96d8..455642b6 100644 --- a/src/views/learningpath/LearningPath.vue +++ b/src/views/learningpath/LearningPath.vue @@ -702,6 +702,7 @@ import { message } from "ant-design-vue"; import { toDate, commonData, + changeOwnership, // setCookie } from "../../api/method"; import { storage } from "../../api/storage"; @@ -1464,6 +1465,15 @@ export default { .catch((chapterErr) => { console.log("关卡创建失败", chapterErr); }); + //添加归属权 [id: '966735050643083264', name: '丁舟航'] + let selectPeopleArr = [ + { id: res.data.data.createId, name: res.data.data.createName }, + ]; + changeOwnership( + "learnPath", + res.data.data.routerId, + selectPeopleArr + ); } }) .catch((err) => { @@ -1471,6 +1481,7 @@ export default { // state.createLoading = false; }); }; + //获取学习路径列表 const getLearnPath = () => { let obj = {