面授课分类

This commit is contained in:
zhangyc
2022-12-14 08:39:46 +08:00
parent 03d9cce131
commit aef73624d6

View File

@@ -117,7 +117,7 @@
:loading="tableDataTotal === -1 ? true : false"
:pagination="false"
/>
<div class="tableBox" style="margin-top: 85px;">
<div class="tableBox" style="margin-top:85px;">
<div class="pa" style="display:flex;justify-content:center;">
<a-pagination
v-if="tableDataTotal > 10"
@@ -162,6 +162,7 @@ const columns1 = [
width: "30%",
dataIndex: "name",
key: "name",
ellipsis: true,
},
{
@@ -170,6 +171,7 @@ const columns1 = [
dataIndex: "category",
key: "category",
align: "center",
ellipsis: true,
},
{
title: "授课教师",
@@ -177,6 +179,7 @@ const columns1 = [
dataIndex: "teacher",
key: "teacher",
align: "center",
ellipsis: true,
},
{
title: "创建人",
@@ -184,6 +187,7 @@ const columns1 = [
dataIndex: "creator",
key: "creator",
align: "center",
ellipsis: true,
},
{
title: "发布时间",
@@ -191,6 +195,7 @@ const columns1 = [
dataIndex: "time",
key: "time",
align: "center",
ellipsis: true,
},
];
@@ -216,6 +221,17 @@ export default {
},
setup(props, ctx) {
const state = reactive({
classTableData: [
// {
// key: "1",
// num: "JDF2022071100001",
// name: "时间管理课程",
// content: "通用力",
// teacher: "BOE教师",
// creator: "管理员",
// time: "2022-10-31 23:12:00",
// }
],
options2222: [
{
title: "领导力",
@@ -339,17 +355,6 @@ export default {
],
},
],
classTableData: [
// {
// key: "1",
// num: "JDF2022071100001",
// name: "时间管理课程",
// content: "通用力",
// teacher: "BOE教师",
// creator: "管理员",
// time: "2022-10-31 23:12:00",
// }
],
currentPage: 1,
tableDataTotal: null,
pageSize: 10,
@@ -433,8 +438,8 @@ export default {
const getClassData = (tabledata) => {
let data = tabledata;
let tData =[];
let array = [];
let options = state.options2222;
data.map((value) => {
let obj = {
key: value.offcourseId,
@@ -447,43 +452,60 @@ export default {
category:"",
//需要判断content
};
let options = state.options2222;
console.log("obj",obj);
var breaked = false;
for (let i = 0; i < options.length; i++) {
for (let j = 0; j < options[i].children.length; j++) {
if (
String(options[i].children[j].value) ===
String(obj.categoryId)
) {
console.log("obj.categoryId",obj.categoryId);
obj.category = options[i].children[j].title;
console.log("obj. obj.category ", obj.category );
breaked = true;
break;
}
}
if(breaked){
break;
}
}
if(!obj.category ){
obj.category ="-";
}
console.log("obj. obj.category22 ", obj.category );
array.push(obj);
});
state.classTableData = array;
};
/**
const getCategory=(id)=>{
console.log("进来了");
let category="";
let options = state.options2222;
for (let i = 0; i < options.value.length; i++) {
for (let j = 0; j < options.value[i].children.length; j++) {
if (
String(options.value[i].children[j].value) ===
String(value.categoryId)
String(id)
) {
console.log();
value.category = options.value[i].children[j].title;
category = options.value[i].children[j].title;
return false;
return category;
}
}
}
array.push(obj);
});
array.forEach((itm) => {
let options = state.options2222;
for (let i = 0; i < options.value.length; i++) {
for (let j = 0; j < options.value[i].children.length; j++) {
if (
String(options.value[i].children[j].value) ===
String(itm.categoryId)
) {
console.log("找到了",i);
itm.category = options.value[i].children[j].title;
tData.push(itm);
return false;
}
}
}
});
console.log("结果",tData);
state.classTableData = tData;
};
/**
return category;
}
const options1 = ref([
{
value: 0,
@@ -526,7 +548,6 @@ export default {
afterVisibleChange,
closeDrawer,
columns1,
getClassData,
handleChange,
@@ -536,6 +557,7 @@ export default {
rowSelection,
search,
submitCourse,
// change,
};
},