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 {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;
// }

View File

@@ -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=>{

View File

@@ -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=>{