From baba2414761643a68f19518fdcebc1a11e377b68 Mon Sep 17 00:00:00 2001 From: wyx Date: Tue, 17 Jan 2023 16:55:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=9C=A8=E7=BA=BF=E8=AF=BE=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=9D=A2=E6=8E=88=E8=AF=BE=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/drawers/SelFacet.vue | 85 ++++++++++++------- .../drawers/project/ProjectOnlineManage.vue | 5 +- .../drawers/router/RouterCommonManage.vue | 2 +- 3 files changed, 55 insertions(+), 37 deletions(-) diff --git a/src/components/drawers/SelFacet.vue b/src/components/drawers/SelFacet.vue index 7638f33c..7367a80c 100644 --- a/src/components/drawers/SelFacet.vue +++ b/src/components/drawers/SelFacet.vue @@ -120,6 +120,8 @@ import { reactive, toRefs, computed } from "vue"; // import { planList } from "../../api/indexTaskadd"; //import {detail} from "../../api/indexCourse"; import { list } from "../../api/indexTaskadd"; +import {useStore} from "vuex"; + const columns1 = [ @@ -194,6 +196,7 @@ export default { }, }, setup(props, ctx) { + const store = useStore(); const state = reactive({ classTableData: [ // { @@ -417,6 +420,17 @@ export default { }); }; + const sysTypeOptions = computed(() => store.state.sysType); + + function findClassFullName(list,classify, name = '') { + console.log(list,classify) + return list && list.length && list + .map(e => classify == e.dictCode ? name ? name + '-' + e.dictName : e.dictName : findClassFullName(e.children, classify,name ? name + '-' + e.dictName : e.dictName)) + .filter(name => name) + .join('') || '' + } + + const getClassData = (tabledata) => { let data = tabledata; let array = []; @@ -429,8 +443,8 @@ export default { teacher: value.teacher || "-", creator: value.createName || "-", time: value.publishTime, - categoryId: value.categoryId, - category: changeTreeSelectValue(String(value.categoryId)), + categoryId: value.sysTypeId, + category: value.sysTypeId, //需要判断content }; console.log("obj", obj); @@ -455,43 +469,48 @@ export default { // break; // } // } - if (!obj.category) { - obj.category = "-"; - } - console.log("obj. obj.category22 ", obj.category); + // if (!obj.category) { + // obj.category = "-"; + // } + // console.log("obj. obj.category22 ", obj.category); array.push(obj); }); + + array.forEach((itm) => { + itm.category = findClassFullName(sysTypeOptions.value,itm.categoryId) || '-' + }); + console.log(array) state.classTableData = array; }; // 格式化树型结构选择数据 - const changeTreeSelectValue = (values) => { - let data = state.options2222; - console.log(values, data) - let str = '' - for (let i = 0; i < data.length; i++) { - if (data[i].value == values) { - str = data[i].title - } else { - for (let j = 0; j < data[i].children.length; j++) { - if (data[i].children[j].value == values) { - str = data[i].title + '/' + data[i].children[j].title - } else { - if (data[i].children[j].children) { - for (let k = 0; k < data[i].children[j].children.length; k++) { - if (data[i].children[j].children[k].value == values) { - str = data[i].title + '/' + data[i].children[j].title + '/' + data[i].children[j].children[k].title - } - } - } - } - } - } - } - console.log('str-str-str-str', str) - state.fen_lei1 = str; - return str; - } + // const changeTreeSelectValue = (values) => { + // let data = state.options2222; + // console.log(values, data) + // let str = '' + // for (let i = 0; i < data.length; i++) { + // if (data[i].value == values) { + // str = data[i].title + // } else { + // for (let j = 0; j < data[i].children.length; j++) { + // if (data[i].children[j].value == values) { + // str = data[i].title + '/' + data[i].children[j].title + // } else { + // if (data[i].children[j].children) { + // for (let k = 0; k < data[i].children[j].children.length; k++) { + // if (data[i].children[j].children[k].value == values) { + // str = data[i].title + '/' + data[i].children[j].title + '/' + data[i].children[j].children[k].title + // } + // } + // } + // } + // } + // } + // } + // console.log('str-str-str-str', str) + // state.fen_lei1 = str; + // return str; + // } diff --git a/src/components/drawers/project/ProjectOnlineManage.vue b/src/components/drawers/project/ProjectOnlineManage.vue index 63cd9666..59caaee0 100644 --- a/src/components/drawers/project/ProjectOnlineManage.vue +++ b/src/components/drawers/project/ProjectOnlineManage.vue @@ -388,13 +388,12 @@ export default { "thirdId": props.datasource.targetId, "type": 1 }); - + {/* "chapterId": props.datasource.stageId=="0"?"":props.datasource.stageId, */} api.QueryOnlineManagementDetail({ - "chapterId": props.datasource.stageId=="0"?"":props.datasource.stageId, "status": state.projectName, "studentName": state.name, "targetId":props.datasource.projectId, - "taskId": props.datasource.projectTaskId, + "taskId": props.datasource.courseId, "thirdId": props.datasource.targetId, "type": 1 }).then(res=>{ diff --git a/src/components/drawers/router/RouterCommonManage.vue b/src/components/drawers/router/RouterCommonManage.vue index 84f11ede..40cba7dc 100644 --- a/src/components/drawers/router/RouterCommonManage.vue +++ b/src/components/drawers/router/RouterCommonManage.vue @@ -397,7 +397,7 @@ export default { "status": state.projectName, "studentName": state.name, "targetId":props.datasource.routerId, - "taskId": props.datasource.routerTaskId, + "taskId": props.datasource.courseId, "thirdId": props.datasource.targetId, "type": 1 }).then(res=>{