|
|
@ -172,6 +172,12 @@ export default { |
|
|
handleYearData(data) { |
|
|
handleYearData(data) { |
|
|
this.yearChildData = data |
|
|
this.yearChildData = data |
|
|
this.classifyLoading = true |
|
|
this.classifyLoading = true |
|
|
|
|
|
// 保存所有勾选叶子节点的 key,树重建后统一恢复勾选状态 |
|
|
|
|
|
const checkedKeys = this.$refs.classifyTree.getCheckedNodes(true).map(node => node.id) |
|
|
|
|
|
// 保存所有展开节点的 key,数据变化后统一恢复,避免重建后节点全部收起 |
|
|
|
|
|
const expandedKeys = this.$refs.classifyTree.store._getAllNodes() |
|
|
|
|
|
.filter(node => node.expanded && node.key != null) |
|
|
|
|
|
.map(node => node.key) |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
if (this.classifyTree.length !== 0 && this.classifyTree[0].dictionaryName === '年度') { |
|
|
if (this.classifyTree.length !== 0 && this.classifyTree[0].dictionaryName === '年度') { |
|
|
this.classifyTree = this.classifyTree.slice(1) |
|
|
this.classifyTree = this.classifyTree.slice(1) |
|
|
@ -188,6 +194,17 @@ export default { |
|
|
this.classifyTree.unshift({ id: -1, dictionaryName: '年度', dictionaryCode: 'archive_year', childDictionarys: newYearArr }) |
|
|
this.classifyTree.unshift({ id: -1, dictionaryName: '年度', dictionaryCode: 'archive_year', childDictionarys: newYearArr }) |
|
|
} |
|
|
} |
|
|
this.classifyLoading = false |
|
|
this.classifyLoading = false |
|
|
|
|
|
// el-tree 数据变化后重建内部节点会重置勾选与展开状态,需统一恢复以保持操作连续性 |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
// 恢复勾选状态 |
|
|
|
|
|
this.$refs.classifyTree.setCheckedKeys(checkedKeys) |
|
|
|
|
|
expandedKeys.forEach(key => { |
|
|
|
|
|
const node = this.$refs.classifyTree.getNode(key) |
|
|
|
|
|
if (node) { |
|
|
|
|
|
node.expanded = true |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
}, 500) |
|
|
}, 500) |
|
|
}, |
|
|
}, |
|
|
filterData(data) { |
|
|
filterData(data) { |
|
|
@ -397,13 +414,17 @@ export default { |
|
|
localStorage.removeItem('currentPageSize') |
|
|
localStorage.removeItem('currentPageSize') |
|
|
localStorage.removeItem('currentPage') |
|
|
localStorage.removeItem('currentPage') |
|
|
this.smartQuery = { |
|
|
this.smartQuery = { |
|
|
// 'retention': null, // 保管期限 |
|
|
|
|
|
// 'security_class': null, // 密级 |
|
|
|
|
|
// 'doc_type': null, // 文种 |
|
|
|
|
|
// 'medium_type': null, // 载体类型 |
|
|
|
|
|
'archive_year': null // 年度 |
|
|
|
|
|
// 'organ_or_function': null, // 机构与类型 |
|
|
|
|
|
// 'fonds_no': null // 全宗 |
|
|
|
|
|
|
|
|
'retention': null, // 保管期限 |
|
|
|
|
|
'security_class': null, // 密级 |
|
|
|
|
|
'doc_type': null, // 文种 |
|
|
|
|
|
'medium_type': null, // 载体类型 |
|
|
|
|
|
'archive_year': null, // 年度 |
|
|
|
|
|
'organ_or_function': null, // 机构与类型 |
|
|
|
|
|
'fonds_no': null // 全宗 |
|
|
|
|
|
} |
|
|
|
|
|
// 清空分类树的勾选状态 |
|
|
|
|
|
if (this.$refs.classifyTree) { |
|
|
|
|
|
this.$refs.classifyTree.setCheckedKeys([]) |
|
|
} |
|
|
} |
|
|
this.parentsProjectId = null |
|
|
this.parentsProjectId = null |
|
|
this.parentsAnjuanId = null |
|
|
this.parentsAnjuanId = null |
|
|
@ -615,72 +636,32 @@ export default { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
if (data.id) { |
|
|
|
|
|
const selectedParentVal = this.$refs.classifyTree.getNode(data.id).parent.data.dictionaryCode |
|
|
|
|
|
switch (selectedParentVal) { |
|
|
|
|
|
case 'security_class': |
|
|
|
|
|
if (res.find(obj => obj.dictionaryCode === 'security_class')) { |
|
|
|
|
|
this.smartQuery.security_class = null |
|
|
|
|
|
} else { |
|
|
|
|
|
if (groupedData.security_class) { |
|
|
|
|
|
this.smartQuery.security_class = groupedData.security_class.join(',') |
|
|
|
|
|
} else { |
|
|
|
|
|
this.smartQuery.security_class = null |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
break |
|
|
|
|
|
case 'retention': |
|
|
|
|
|
if (res.find(obj => obj.dictionaryCode === 'retention')) { |
|
|
|
|
|
this.smartQuery.retention = null |
|
|
|
|
|
} else { |
|
|
|
|
|
if (groupedData.retention) { |
|
|
|
|
|
this.smartQuery.retention = groupedData.retention.join(',') |
|
|
|
|
|
} else { |
|
|
|
|
|
this.smartQuery.retention = null |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
break |
|
|
|
|
|
case 'doc_type': |
|
|
|
|
|
if (res.find(obj => obj.dictionaryCode === 'doc_type')) { |
|
|
|
|
|
this.smartQuery.doc_type = null |
|
|
|
|
|
} else { |
|
|
|
|
|
if (groupedData.doc_type) { |
|
|
|
|
|
this.smartQuery.doc_type = groupedData.doc_type.join(',') |
|
|
|
|
|
} else { |
|
|
|
|
|
this.smartQuery.doc_type = null |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
break |
|
|
|
|
|
case 'medium_type': |
|
|
|
|
|
if (res.find(obj => obj.dictionaryCode === 'medium_type')) { |
|
|
|
|
|
this.smartQuery.medium_type = null |
|
|
|
|
|
} else { |
|
|
|
|
|
if (groupedData.medium_type) { |
|
|
|
|
|
this.smartQuery.medium_type = groupedData.medium_type.join(',') |
|
|
|
|
|
} else { |
|
|
|
|
|
this.smartQuery.medium_type = null |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 统一计算所有字段:父级被勾选(全选)则置 null,否则用子节点的值 |
|
|
|
|
|
const parentChecked = {} |
|
|
|
|
|
res.forEach(item => { |
|
|
|
|
|
if (item.dictionaryCode) { |
|
|
|
|
|
parentChecked[item.dictionaryCode] = true |
|
|
} |
|
|
} |
|
|
break |
|
|
|
|
|
case 'organ_or_function': |
|
|
|
|
|
if (res.find(obj => obj.dictionaryCode === 'organ_or_function')) { |
|
|
|
|
|
this.smartQuery.organ_or_function = null |
|
|
|
|
|
} else { |
|
|
|
|
|
if (groupedData.organ_or_function) { |
|
|
|
|
|
this.smartQuery.organ_or_function = groupedData.organ_or_function.join(',') |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
const fields = ['security_class', 'retention', 'doc_type', 'medium_type', 'organ_or_function'] |
|
|
|
|
|
fields.forEach(field => { |
|
|
|
|
|
if (parentChecked[field]) { |
|
|
|
|
|
// 父级被勾选(全选)→ 清除筛选 |
|
|
|
|
|
this.smartQuery[field] = null |
|
|
|
|
|
} else if (groupedData[field]) { |
|
|
|
|
|
this.smartQuery[field] = groupedData[field].join(',') |
|
|
} else { |
|
|
} else { |
|
|
this.smartQuery.organ_or_function = null |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.smartQuery[field] = null |
|
|
} |
|
|
} |
|
|
break |
|
|
|
|
|
default: |
|
|
|
|
|
if (groupedData.archive_year) { |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
// 年度:父级全选则置 null,否则用勾选的子节点值 |
|
|
|
|
|
if (parentChecked['archive_year']) { |
|
|
|
|
|
this.smartQuery.archive_year = null |
|
|
|
|
|
} else if (groupedData.archive_year) { |
|
|
this.smartQuery.archive_year = groupedData.archive_year.join(',') |
|
|
this.smartQuery.archive_year = groupedData.archive_year.join(',') |
|
|
} else { |
|
|
} else { |
|
|
this.smartQuery.archive_year = null |
|
|
this.smartQuery.archive_year = null |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.handlePageList('quickFilter') |
|
|
this.handlePageList('quickFilter') |
|
|
}) |
|
|
}) |
|
|
|