Commit 42f90057 authored by liwei's avatar liwei

liwei

parent 766a2373
...@@ -212,6 +212,7 @@ export default { ...@@ -212,6 +212,7 @@ export default {
teacher_id: "", teacher_id: "",
periods_title: "" periods_title: ""
}, },
propertyList: [],
watchList: [ watchList: [
{ id: 0, title: 5 }, { id: 0, title: 5 },
{ id: 1, title: 6 }, { id: 1, title: 6 },
...@@ -220,6 +221,12 @@ export default { ...@@ -220,6 +221,12 @@ export default {
] ]
}; };
}, },
watch: {
propertyList() {
console.log("test======", this.list);
}
},
components: { page }, components: { page },
methods: { methods: {
exportDataTable() { exportDataTable() {
...@@ -246,37 +253,46 @@ export default { ...@@ -246,37 +253,46 @@ export default {
if (this.searchFrom.watch_num) { if (this.searchFrom.watch_num) {
json.watch_num = this.searchFrom.watch_num; json.watch_num = this.searchFrom.watch_num;
} }
console.log("json======", json);
exportExcelApi("/api/admin/channel/class/list/export", json); exportExcelApi("/api/admin/channel/class/list/export", json);
}, },
objectSpanMethod(data) { objectSpanMethod(data) {
if (this.propertyList.indexOf(data.column.property) > -1) { // if (this.propertyList.indexOf(data.column.property) > -1) {
if ( // if (
data.rowIndex === 0 || // data.rowIndex === 0 ||
data.row.cur_date !== this.list[data.rowIndex - 1].cur_date // data.row.cur_date !== this.list[data.rowIndex - 1].cur_date
) { // ) {
let rowspan = 1; // let rowspan = 1;
for (let i = data.rowIndex + 1; i < this.list.length; i++) { // for (let i = data.rowIndex + 1; i < this.list.length; i++) {
if (data.row.cur_date === this.list[i].cur_date) { // if (data.row.cur_date === this.list[i].cur_date) {
rowspan++; // rowspan++;
} else { // } else {
break; // break;
} // }
} // }
return { // return {
rowspan: rowspan, // rowspan: rowspan,
colspan: 1 // colspan: 1
}; // };
} else { // } else {
return { // return {
rowspan: 0, // rowspan: 0,
colspan: 0 // colspan: 0
}; // };
} // }
} else { // } else {
// return {
// rowspan: 1,
// colspan: 1
// };
// }
console.log("=====================", data);
if (data.columnIndex === 0) {
//用于设置要合并的列
const _row = this.spanArr[data.rowIndex];
const _col = _row > 0 ? 1 : 0;
return { return {
rowspan: 1, rowspan: _row, //合并的行数
colspan: 1 colspan: _col //合并的列数
}; };
} }
}, },
...@@ -404,6 +420,7 @@ export default { ...@@ -404,6 +420,7 @@ export default {
if (res) { if (res) {
if (res.list && res.list.length > 0) { if (res.list && res.list.length > 0) {
this.total = res.total; this.total = res.total;
this.list = [];
this.list = res.list.map((item, index) => { this.list = res.list.map((item, index) => {
item.index = index; item.index = index;
if (index == 0) { if (index == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment