--fix 内容分类 改成从字典取值

This commit is contained in:
yuping
2023-01-13 18:37:10 +08:00
parent cab56cbc70
commit 4e4655f378

View File

@@ -2381,11 +2381,9 @@ const columns1 = [
title: "内容分类", title: "内容分类",
width: 130, width: 130,
dataIndex: "contentTxt", dataIndex: "contentTxt",
ellipsis: true,
key: "1", key: "1",
align: "center", align: "center",
customRender: ({ text }) => {
return text ? text : "-";
},
}, },
{ {
title: "课程形式", title: "课程形式",
@@ -3278,14 +3276,14 @@ export default defineComponent({
corpowerlistvisible: false, corpowerlistvisible: false,
lookCourseModal: false, lookCourseModal: false,
faceDetailObj: null, faceDetailObj: {},
offcourseId: null, offcourseId: null,
projectName: "", projectName: "",
name: "", name: "",
createName: "", createName: "",
auditStatus: null, auditStatus: null,
categoryId: null, categoryId: '',
projectTime: "", projectTime: "",
//列表 //列表
@@ -3765,70 +3763,19 @@ export default defineComponent({
true true
); );
// datas.forEach((itm) => {
// itm.pageNo = pageNo;
// for (let item of options2.value) {
// if (String(item.value) === String(itm.content)) {
// itm.contentTxt = item.label;
// return false;
// }
// }
// });
datas.forEach((itm) => { datas.forEach((itm) => {
itm.pageNo = pageNo; itm.pageNo = pageNo;
console.log(itm); itm.contentTxt = findClassFullName(sysTypeOptions.value,itm.categoryId) || '-'
for (let i = 0; i < options2.value.length; i++) {
for (let j = 0; j < options2.value[i].children.length; j++) {
itm.contentTxt = changeTreeSelectValue(itm.categoryId);
// if (
// String(options2.value[i].children[j].value) ===
// String(itm.categoryId)
// ) {
// console.log();
// itm.contentTxt = options2.value[i].children[j].title;
// return false;
// }
}
}
}); });
console.log(datas, options2.value);
state.tableData1 = datas; state.tableData1 = datas;
}; };
// 格式化树型结构选择数据
const changeTreeSelectValue = (values) => { function findClassFullName(list,classify, name = '') {
let data = state.options2222; return list && list.length && list
console.log(values, data); .map(e => classify == e.dictCode ? name ? name + '-' + e.dictName : e.dictName : findClassFullName(e.children, classify,name ? name + '-' + e.dictName : e.dictName))
let str = ""; .filter(name => name)
for (let i = 0; i < data.length; i++) { .join('') || ''
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;
};
getTableDate(); getTableDate();
const handelChangePage1 = (page, pageSize) => { const handelChangePage1 = (page, pageSize) => {