--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: "内容分类",
width: 130,
dataIndex: "contentTxt",
ellipsis: true,
key: "1",
align: "center",
customRender: ({ text }) => {
return text ? text : "-";
},
},
{
title: "课程形式",
@@ -3278,14 +3276,14 @@ export default defineComponent({
corpowerlistvisible: false,
lookCourseModal: false,
faceDetailObj: null,
faceDetailObj: {},
offcourseId: null,
projectName: "",
name: "",
createName: "",
auditStatus: null,
categoryId: null,
categoryId: '',
projectTime: "",
//列表
@@ -3765,70 +3763,19 @@ export default defineComponent({
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) => {
itm.pageNo = pageNo;
console.log(itm);
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;
// }
}
}
itm.contentTxt = findClassFullName(sysTypeOptions.value,itm.categoryId) || '-'
});
console.log(datas, options2.value);
state.tableData1 = datas;
};
// 格式化树型结构选择数据
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;
};
function findClassFullName(list,classify, name = '') {
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('') || ''
}
getTableDate();
const handelChangePage1 = (page, pageSize) => {