|
|
|
@ -10,6 +10,7 @@ |
|
|
|
highlight-current-row |
|
|
|
style="width: 100%;" |
|
|
|
height="calc(100vh - 418px)" |
|
|
|
:default-sort="{ prop: '', order: '' }" |
|
|
|
:row-class-name="tableRowClassName" |
|
|
|
:row-key="rowKey" |
|
|
|
@select-all="selectAll" |
|
|
|
@ -19,6 +20,7 @@ |
|
|
|
@select="handleCurrentChange" |
|
|
|
@mousedown.native="onMouseDown" |
|
|
|
@mouseup.native="onMouseUp" |
|
|
|
@sort-change="handleSortChange" |
|
|
|
> |
|
|
|
<el-table-column type="selection" :reserve-selection="true" width="55" align="center" /> |
|
|
|
<el-table-column label="序号" width="55" align="center" show-overflow-tooltip> |
|
|
|
@ -27,12 +29,12 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column type="index" label="序号" width="55" align="center" /> --> |
|
|
|
<el-table-column :label="selectedCategory.arrangeType === 1 || (selectedCategory.arrangeType !==1 && activeIndex===1) ? '原文':'卷内'" prop="child" width="55" align="center"> |
|
|
|
<el-table-column :label="selectedCategory.arrangeType === 1 || (selectedCategory.arrangeType !==1 && activeIndex===1) ? '原文':'卷内'" prop="child" width="80" align="center" sortable> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.child === '' ? 0 : scope.row.child }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-for="field in tableDisplayFields" :key="field.id" :label="field.fieldCnName" :align="field.displayformatType" :width="field.displayLength" show-overflow-tooltip> |
|
|
|
<el-table-column v-for="field in tableDisplayFields" :key="field.id" :sort-orders="['ascending', 'descending', null]" sortable :label="field.fieldCnName" :align="field.displayformatType" :prop="field.fieldName" :width="field.displayLength" show-overflow-tooltip> |
|
|
|
<template slot="header"> |
|
|
|
<el-tooltip |
|
|
|
class="item" |
|
|
|
@ -130,11 +132,15 @@ export default { |
|
|
|
currentPage: 1, |
|
|
|
mousedownTime: 0, |
|
|
|
mousedownX: 0, |
|
|
|
mousedownY: 0 |
|
|
|
mousedownY: 0, |
|
|
|
sortMap: {}, |
|
|
|
handOrder: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
selectedCategory: function(newValue, oldValue) { |
|
|
|
this.sortMap = {} |
|
|
|
this.handOrder = '' |
|
|
|
this.selections = [] |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
if (newValue.arrangeType !== 1) { |
|
|
|
@ -158,6 +164,8 @@ export default { |
|
|
|
this.getCommonData(2, null) |
|
|
|
} |
|
|
|
} |
|
|
|
this.sortMap = {} |
|
|
|
this.handOrder = '' |
|
|
|
this.selections = [] |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
} |
|
|
|
@ -272,6 +280,67 @@ export default { |
|
|
|
}, 300) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 多列排序(支持多列显示箭头) |
|
|
|
handleSortChange({ column, prop }) { |
|
|
|
const field = prop || column.property |
|
|
|
if (!field) return |
|
|
|
|
|
|
|
// 清除父组件 smartQuery 中选中的筛选条件(保留 fonds_no) |
|
|
|
// 使用 Vue.set 逐个修改属性,保持响应式追踪 |
|
|
|
const smartQuery = this.parentsData.smartQuery |
|
|
|
this.$set(smartQuery, 'retention', null) |
|
|
|
this.$set(smartQuery, 'security_class', null) |
|
|
|
this.$set(smartQuery, 'doc_type', null) |
|
|
|
this.$set(smartQuery, 'medium_type', null) |
|
|
|
this.$set(smartQuery, 'archive_year', null) |
|
|
|
this.$set(smartQuery, 'organ_or_function', null) |
|
|
|
|
|
|
|
// 循环切换排序 |
|
|
|
const current = this.sortMap[field] |
|
|
|
if (!current) { |
|
|
|
this.sortMap[field] = 'asc' |
|
|
|
} else if (current === 'asc') { |
|
|
|
this.sortMap[field] = 'desc' |
|
|
|
} else { |
|
|
|
delete this.sortMap[field] |
|
|
|
} |
|
|
|
|
|
|
|
// 拼接 handOrder |
|
|
|
this.handOrder = Object.entries(this.sortMap) |
|
|
|
.map(([k, v]) => `${k}:${v}`) |
|
|
|
.join(',') |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
const table = this.$refs.table |
|
|
|
table.columns.forEach(col => { |
|
|
|
const order = this.sortMap[col.property] |
|
|
|
if (order === 'asc') { |
|
|
|
col.order = 'ascending' |
|
|
|
} else if (order === 'desc') { |
|
|
|
col.order = 'descending' |
|
|
|
} else { |
|
|
|
col.order = null |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.page.page = 0 |
|
|
|
this.currentPage = 1 |
|
|
|
this.loadTableData() |
|
|
|
}, |
|
|
|
loadTableData() { |
|
|
|
if (this.activeIndex === 1) { |
|
|
|
this.getViewTableList(3, null, '') |
|
|
|
} else { |
|
|
|
if (this.selectedCategory.arrangeType === 3) { |
|
|
|
this.getViewTableList(2, this.parentsData.parentsProjectId, '') |
|
|
|
} else if (this.selectedCategory.arrangeType === 1) { |
|
|
|
this.getViewTableList(3, null, '') |
|
|
|
} else { |
|
|
|
this.getViewTableList(2, null, '') |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
// 触发单选 |
|
|
|
handleCurrentChange(selection, row) { |
|
|
|
this.selections = selection |
|
|
|
@ -281,33 +350,13 @@ export default { |
|
|
|
this.page.size = size |
|
|
|
this.page.page = 0 |
|
|
|
localStorage.setItem('currentPageSize', size) |
|
|
|
if (this.activeIndex === 1) { |
|
|
|
this.getViewTable(3, null) |
|
|
|
} else { |
|
|
|
if (this.selectedCategory.arrangeType === 3) { |
|
|
|
this.getViewTable(2, this.parentsData.parentsProjectId) |
|
|
|
} else if (this.selectedCategory.arrangeType === 1) { |
|
|
|
this.getViewTable(3, null) |
|
|
|
} else { |
|
|
|
this.getViewTable(2, null) |
|
|
|
} |
|
|
|
} |
|
|
|
this.loadTableData() |
|
|
|
}, |
|
|
|
handleCurrentPage(pageVal) { |
|
|
|
this.currentPage = pageVal |
|
|
|
this.page.page = pageVal - 1 |
|
|
|
localStorage.setItem('currentPage', JSON.stringify(this.page.page)) |
|
|
|
if (this.activeIndex === 1) { |
|
|
|
this.getViewTable(3, null) |
|
|
|
} else { |
|
|
|
if (this.selectedCategory.arrangeType === 3) { |
|
|
|
this.getViewTable(2, this.parentsData.parentsProjectId) |
|
|
|
} else if (this.selectedCategory.arrangeType === 1) { |
|
|
|
this.getViewTable(3, null) |
|
|
|
} else { |
|
|
|
this.getViewTable(2, null) |
|
|
|
} |
|
|
|
} |
|
|
|
this.loadTableData() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|