From 29d3c8a8a15ea135a2c301226776014f515f84f7 Mon Sep 17 00:00:00 2001 From: lixg Date: Wed, 30 Nov 2022 14:38:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 +- src/views/learningpath/LearningPath.vue | 77 ++++++++++++++++--------- src/views/projectcenter/TaskPage.vue | 30 +++++----- 3 files changed, 68 insertions(+), 41 deletions(-) diff --git a/src/App.vue b/src/App.vue index ea45c79e..2e7b0db5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,7 +41,7 @@ export default defineComponent({ const store = useStore(); const isLogin = ref(false); // console.log("router", router.getRoutes(), route); - console.log("版本0.05------------"); + console.log("版本0.06------------"); const routes = computed(() => { return router.getRoutes().filter((e) => e.meta?.isLink); }); diff --git a/src/views/learningpath/LearningPath.vue b/src/views/learningpath/LearningPath.vue index 16780b38..549e1e36 100644 --- a/src/views/learningpath/LearningPath.vue +++ b/src/views/learningpath/LearningPath.vue @@ -210,7 +210,7 @@ class="learnBgItem" :style="{ border: - learnPathBg === item.dictCode + pathBgId === item.dictCode ? '2px solid rgba(78, 166, 255, 1)' : '1px solid #C7CBD2', 'background-image': 'url(' + item.dictValue + ')', @@ -344,7 +344,7 @@ class="learnBgItem" :style="{ border: - learnPathBg2 === item.dictCode + pathBgId === item.dictCode ? '2px solid rgba(78, 166, 255, 1)' : '1px solid #ccc', 'background-image': 'url(' + item.dictValue + ')', @@ -670,7 +670,7 @@ class="learnBgItem" :style="{ border: - learnPathBg2 === item.id + pathBgId === item.id ? '2px solid rgba(78, 166, 255, 1)' : '1px solid #ccc', 'background-image': 'url(' + item.source + ')', @@ -749,8 +749,8 @@ export default { // source: require("../../assets/images/leveladd/1.png"), // }, ], - learnPathBg: null, //创建路径选择的路径图背景 - learnPathBg2: null, //编辑路径选择的路径图背景 + // learnPathBg: null, //创建路径选择的路径图背景 + // learnPathBg2: null, //编辑路径选择的路径图背景 pub: false, //发布弹窗 checked: false, //发布弹窗switch checkedTeacher: false, //发布弹窗勾选 @@ -784,7 +784,8 @@ export default { ], //归属组织 organizationSelectName: null, //归属组织选择名称 organizationSelectId: null, //归属组织选择id - pathBg: "", //路径图选择背景 + pathBg: null, //路径图选择背景 + pathBgId: null, //路径图选择id pathIntro: "", //路径说明 createLoading: false, //创建路径loading deletePathId: null, //删除路径id @@ -849,6 +850,7 @@ export default { // console.log("打开创建路径弹窗"); state.pathName = ""; state.pathBg = ""; + state.pathBgId = ""; state.organizationSelectName = null; state.organizationSelectId = null; state.pathIntro = ""; @@ -857,6 +859,7 @@ export default { const handleOut1 = () => { state.pathName = ""; state.pathBg = ""; + state.pathBgId = ""; state.organizationSelectName = null; state.organizationSelectId = null; state.pathIntro = ""; @@ -865,11 +868,13 @@ export default { }; const chooseImg = (item) => { // console.log(item); - state.learnPathBg = item.dictCode; + state.pathBgId = item.dictCode; + state.pathBg = item.dictValue; }; const chooseImg2 = (item) => { // console.log(item); - state.learnPathBg2 = item.dictCode; + state.pathBgId = item.dictCode; + state.pathBg = item.dictValue; }; //发布弹窗 const showPub = (routerId) => { @@ -1141,14 +1146,9 @@ export default {
{ - console.log("text.record", text.record); - state.out1 = true; - state.pathName = text.record.manager; - // state.pathBg = ""; - // state.organizationSelectName = null; - // state.organizationSelectId = null; - state.pathIntro = text.record.remark; - state.editPathId = text.record.id; + // console.log("text.record", text.record); + + getLearnPathInfo(text.record); }} > 编辑 @@ -1418,11 +1418,14 @@ export default { message.destroy(); return message.warning("请输入路径图名称"); } - - // if (!state.organizationSelectName){ - // message.destroy(); - // return message.warning("请选择归属组织"); - // } + if (!state.organizationSelectName) { + message.destroy(); + return message.warning("请选择归属组织"); + } + if (!state.pathBg) { + message.destroy(); + return message.warning("请选择背景图"); + } state.lpLoading = true; let obj = { name: state.pathName, @@ -1520,17 +1523,39 @@ export default { console.log("删除失败", err); }); }; + + //获取路径图详细信息 + const getLearnPathInfo = (item) => { + state.out1 = true; + state.pathName = item.manager; + state.pathBg = ""; + state.pathBgId = ""; + state.organizationSelectName = null; + state.organizationSelectId = null; + state.pathIntro = item.remark; + state.editPathId = item.id; + console.log("state.imgData", state.imgData); + let arr = state.imgData; + for (let i = 0; i < arr.length; i++) { + if (arr[i].dictCode === state.pathBgId) { + state.pathBgId = arr[i].dictValue; + } + } + }; //编辑学习路径图 const editLearnPath = () => { if (!state.pathName) { message.destroy(); return message.warning("请输入路径图名称"); } - - // if (!state.organizationSelectName){ - // message.destroy(); - // return message.warning("请选择归属组织"); - // } + if (!state.organizationSelectName) { + message.destroy(); + return message.warning("请选择归属组织"); + } + if (!state.pathBgId) { + message.destroy(); + return message.warning("请选择背景图"); + } // state.createLoading = true; let obj = { routerId: state.editPathId, diff --git a/src/views/projectcenter/TaskPage.vue b/src/views/projectcenter/TaskPage.vue index 25398a26..c7fe51a2 100644 --- a/src/views/projectcenter/TaskPage.vue +++ b/src/views/projectcenter/TaskPage.vue @@ -3199,20 +3199,22 @@ export default { projectId: state.projectId, topFlag: "", }; - getProjStu(objf).then((res) => { - console.log(res.data, "获取学员列表"); - if (res.data.code === 200) { - let leng = res.data.data.rows.length; - state.total = res.data.data.total; - if (leng > 0) { - let arr = res.data.data.rows; - getTableDataList(arr); - // studentData(); + getProjStu(objf) + .then((res) => { + console.log(res.data, "获取学员列表"); + if (res.data.code === 200) { + let leng = res.data.data.rows.length; + state.total = res.data.data.total; + if (leng > 0) { + let arr = res.data.data.rows; + getTableDataList(arr); + // studentData(); + } } - } - }).catch(err=>{ - console.log('获取学员列表失败',err) - }); + }) + .catch((err) => { + console.log("获取学员列表失败", err); + }); }; //获取项目信息 const getTaskInfo = () => { @@ -3277,7 +3279,7 @@ export default { : "-"; // state.fileList=info.attach.split(",") let d = info.attach.indexOf(","); - console.log(info.attach, "xgo", info.attach.length); + // console.log(info.attach, "xgo", info.attach.length); if (info.attach.length == 0) { return; } else if (info.attach.length !== 0 && d == -1) {