查询条件优化

This commit is contained in:
caoqianming 2021-04-01 10:33:28 +08:00
parent 0f8c5d6485
commit d3e4aaf778
1 changed files with 30 additions and 5 deletions

View File

@ -4,7 +4,7 @@
<div>
<el-input
v-model="listQuery.search"
placeholder="搜索"
placeholder="任务名/材料名"
style="width: 140px"
@keyup.enter.native="handleFilter"
/>
@ -112,10 +112,11 @@
highlight-current-row
max-height="600"
@sort-change="changeTableSort"
:span-method="objectSpanMethod"
>
<el-table-column type="index" width="50" />
<el-table-column width="150px" label="任务标题">
<el-table-column width="150px" label="任务标题" prop="task" sortable='custom'>
<template slot-scope="scope" >
<span v-if="scope.row.task">{{
scope.row.task_.name
@ -383,8 +384,8 @@ export default {
});
},
getOrgList() {
getOrgList({ pid: 1 }).then((res) => {
this.orgData = genTree(res.data);
getOrgList({ can_supervision: true }).then((res) => {
this.orgData = res.data;
});
},
@ -447,6 +448,30 @@ export default {
this.$message.error("请选择清单!");
}
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
// if (columnIndex === 1 || columnIndex === 0) {
// // 当前行与上一行内容相同时 返回0 0 意味消除
// if(rowIndex > 0 && row[column.property] === this.recordList[rowIndex - 1][column.property]){
// return {
// rowspan: 0,
// colspan: 0
// };
// }else{
// let rows = 1;
// // 反之 查询相同的内容有多少行 进行合并
// for(let i = rowIndex; i < this.recordList.length - 1; i++){
// if (row[column.property] === this.recordList[i + 1][column.property]) {
// rows++;
// }
// }
// // 返回相同内容的行数
// return {
// rowspan: rows,
// colspan: 1
// };
// }
// }
}
},
};
</script>