fix:在线课列表不显示问题,添加面授课分类问题

This commit is contained in:
wyx
2023-01-17 16:55:09 +08:00
parent 20500ff393
commit baba241476
3 changed files with 55 additions and 37 deletions

View File

@@ -120,6 +120,8 @@ import { reactive, toRefs, computed } from "vue";
// import { planList } from "../../api/indexTaskadd"; // import { planList } from "../../api/indexTaskadd";
//import {detail} from "../../api/indexCourse"; //import {detail} from "../../api/indexCourse";
import { list } from "../../api/indexTaskadd"; import { list } from "../../api/indexTaskadd";
import {useStore} from "vuex";
const columns1 = [ const columns1 = [
@@ -194,6 +196,7 @@ export default {
}, },
}, },
setup(props, ctx) { setup(props, ctx) {
const store = useStore();
const state = reactive({ const state = reactive({
classTableData: [ 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) => { const getClassData = (tabledata) => {
let data = tabledata; let data = tabledata;
let array = []; let array = [];
@@ -429,8 +443,8 @@ export default {
teacher: value.teacher || "-", teacher: value.teacher || "-",
creator: value.createName || "-", creator: value.createName || "-",
time: value.publishTime, time: value.publishTime,
categoryId: value.categoryId, categoryId: value.sysTypeId,
category: changeTreeSelectValue(String(value.categoryId)), category: value.sysTypeId,
//需要判断content //需要判断content
}; };
console.log("obj", obj); console.log("obj", obj);
@@ -455,43 +469,48 @@ export default {
// break; // break;
// } // }
// } // }
if (!obj.category) { // if (!obj.category) {
obj.category = "-"; // obj.category = "-";
} // }
console.log("obj. obj.category22 ", obj.category); // console.log("obj. obj.category22 ", obj.category);
array.push(obj); array.push(obj);
}); });
array.forEach((itm) => {
itm.category = findClassFullName(sysTypeOptions.value,itm.categoryId) || '-'
});
console.log(array)
state.classTableData = array; state.classTableData = array;
}; };
// 格式化树型结构选择数据 // 格式化树型结构选择数据
const changeTreeSelectValue = (values) => { // const changeTreeSelectValue = (values) => {
let data = state.options2222; // let data = state.options2222;
console.log(values, data) // console.log(values, data)
let str = '' // let str = ''
for (let i = 0; i < data.length; i++) { // for (let i = 0; i < data.length; i++) {
if (data[i].value == values) { // if (data[i].value == values) {
str = data[i].title // str = data[i].title
} else { // } else {
for (let j = 0; j < data[i].children.length; j++) { // for (let j = 0; j < data[i].children.length; j++) {
if (data[i].children[j].value == values) { // if (data[i].children[j].value == values) {
str = data[i].title + '/' + data[i].children[j].title // str = data[i].title + '/' + data[i].children[j].title
} else { // } else {
if (data[i].children[j].children) { // if (data[i].children[j].children) {
for (let k = 0; k < data[i].children[j].children.length; k++) { // for (let k = 0; k < data[i].children[j].children.length; k++) {
if (data[i].children[j].children[k].value == values) { // 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 // str = data[i].title + '/' + data[i].children[j].title + '/' + data[i].children[j].children[k].title
} // }
} // }
} // }
} // }
} // }
} // }
} // }
console.log('str-str-str-str', str) // console.log('str-str-str-str', str)
state.fen_lei1 = str; // state.fen_lei1 = str;
return str; // return str;
} // }

View File

@@ -388,13 +388,12 @@ export default {
"thirdId": props.datasource.targetId, "thirdId": props.datasource.targetId,
"type": 1 "type": 1
}); });
{/* "chapterId": props.datasource.stageId=="0"?"":props.datasource.stageId, */}
api.QueryOnlineManagementDetail({ api.QueryOnlineManagementDetail({
"chapterId": props.datasource.stageId=="0"?"":props.datasource.stageId,
"status": state.projectName, "status": state.projectName,
"studentName": state.name, "studentName": state.name,
"targetId":props.datasource.projectId, "targetId":props.datasource.projectId,
"taskId": props.datasource.projectTaskId, "taskId": props.datasource.courseId,
"thirdId": props.datasource.targetId, "thirdId": props.datasource.targetId,
"type": 1 "type": 1
}).then(res=>{ }).then(res=>{

View File

@@ -397,7 +397,7 @@ export default {
"status": state.projectName, "status": state.projectName,
"studentName": state.name, "studentName": state.name,
"targetId":props.datasource.routerId, "targetId":props.datasource.routerId,
"taskId": props.datasource.routerTaskId, "taskId": props.datasource.courseId,
"thirdId": props.datasource.targetId, "thirdId": props.datasource.targetId,
"type": 1 "type": 1
}).then(res=>{ }).then(res=>{