面授课分类

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