diff --git a/src/api/archiveUtilize/archiveUtilize.js b/src/api/archiveUtilize/archiveUtilize.js new file mode 100644 index 0000000..50e466d --- /dev/null +++ b/src/api/archiveUtilize/archiveUtilize.js @@ -0,0 +1,12 @@ +import request from '@/utils/request' +import qs from 'qs' + +// 档案检索 +export function FetchResearch(params) { + return request({ + url: 'api/archivesUtilize/search' + '?' + qs.stringify(params, { indices: false }), + method: 'get' + }) +} + +export default { FetchResearch } diff --git a/src/assets/icons/svg/sr-ly.svg b/src/assets/icons/svg/sr-ly.svg new file mode 100644 index 0000000..aa1fb81 --- /dev/null +++ b/src/assets/icons/svg/sr-ly.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/views/archiveUtilize/archiveSearch/index.vue b/src/views/archiveUtilize/archiveSearch/index.vue index 80c62a7..1d2b05c 100644 --- a/src/views/archiveUtilize/archiveSearch/index.vue +++ b/src/views/archiveUtilize/archiveSearch/index.vue @@ -366,6 +366,7 @@ export default { }, handleSearch() { this.isResult = true + localStorage.setItem('searchKeywords', this.keywords) }, closeResult() { this.isResult = false diff --git a/src/views/archiveUtilize/archiveSearch/module/resultList.vue b/src/views/archiveUtilize/archiveSearch/module/resultList.vue index da0e4e8..3dd0db3 100644 --- a/src/views/archiveUtilize/archiveSearch/module/resultList.vue +++ b/src/views/archiveUtilize/archiveSearch/module/resultList.vue @@ -45,6 +45,9 @@ placeholder="快速检索" suffix-icon="el-icon-search" /> +
+ 全部选择 +
-->
- - 搜索 + + 搜索
高级检索
-
检索 “合同” 成功获得30条结果
-
检索成功获得30条结果

高级检索 点击查看检索条件

+
检索 “{{ keywords }}” 成功获得{{ page.total }}条结果
+
检索成功获得{{ page.total }}条结果

高级检索 点击查看检索条件

-
-
案卷

档案题名

-

+

+
案卷

{{ item.maintitle }}

+

-

档号:WS-2022-001

-

全宗:全宗A

-

档案门类:文书档案(案卷)

-

档案分类:文书档案(案卷)

+

档号:{{ item.archiveNo }}

+

全宗:{{ item.fondsName }}

+

档案门类:{{ item.categoryName }}

+

档案分类:{{ item.archivesClassName }}

实体 @@ -129,7 +132,7 @@
import { FetchFondsAll } from '@/api/system/fonds' import { FetchCategoryMenu } from '@/api/system/category/category' +import { FetchResearch } from '@/api/archiveUtilize/archiveUtilize' import ArchivesInfo from '@/views/components/archivesDetail/detail.vue' +import { mapGetters } from 'vuex' export default { name: 'ResultList', components: { ArchivesInfo }, @@ -225,8 +230,7 @@ export default { } ], status: null, - keyword: '合同', - listData: [], + keywords: '', str: '《福建省电力零售市场购售电合同》(以下简称《合同文本》)适用于福建省电力市场零售用户与售电公司之间签订的零售市场购售电合同...在本合同履行期限届满之前,因一方原因导致合同不能继续履行,另一方可在履行期限届满前解除合同并要求其承担相应的违约责任...9.2 本合同部分条款的无效,不影响其他条款及本合同的效力。...七、争议的解决方式凡因执行本合同所发生的与本合同有关的一切争议...九、合同生效及其他9.1 本合同范本在福建省电力交易中心平台上公示...', selectedCategory: { id: 'DAAC5ED3F86D6481C3C1A5', @@ -237,16 +241,20 @@ export default { page: 1, size: 10, total: 0 - } + }, + checkAll: false, + isIndeterminate: false, + fondsKeys: null, + categoryKeys: null, + classifysKeys: null, + levelsKeys: null, + resultData: [] } }, computed: { - highlightedText() { - return this.str.replace( - new RegExp(this.keyword, 'g'), - `${this.keyword}` - ) - } + ...mapGetters([ + 'user' + ]) }, watch: { filterFondsText(val) { @@ -265,8 +273,48 @@ export default { mounted() { this.getFondsDatas() this.getCategoryDataTree() + console.log(localStorage.getItem('searchKeywords')) + if (localStorage.getItem('searchKeywords')) { + this.keywords = localStorage.getItem('searchKeywords') + } }, methods: { + highlightKeywords(text) { + const cleanedText = text.replace(/,/g, ' ') // 将逗号替换为空格 + if (this.keywords.includes(' ')) { + // 包含多个关键字时,使用正则表达式匹配并标红 + const highlightedText = cleanedText.replace(new RegExp(this.keywords.split(' ').join('|'), 'gi'), match => { + return "" + match + '' + }) + return highlightedText + } else { + // 只包含一个关键字时,直接标红 + const highlightedText = cleanedText.replace(new RegExp(this.keywords, 'gi'), match => { + return "" + match + '' + }) + return highlightedText + } + }, + handleSearch() { + const params = { + 'keywords': this.keywords, + 'archiveCtgNos': this.classifysKeys, // 档案分类 + 'categoryIds': this.categoryKeys, // 档案门类 + 'categoryLevel': this.levelsKeys, // 档案层级 + 'fondsNos': this.fondsKeys, // 全宗 + 'searchFondsId': this.user.fonds.id, + 'page': this.page.page - 1, + 'size': this.page.size + } + console.log(params) + FetchResearch(params).then((res) => { + console.log(res) + this.resultData = res.content + this.page.total = res.totalElements + }).catch(err => { + console.log(err) + }) + }, getFondsDatas() { FetchFondsAll().then(res => { this.fondsOptions = res @@ -325,19 +373,36 @@ export default { }, getFondsCheckedKeys() { const checkedKeys = this.$refs.tree.getCheckedNodes() - console.log('fondsKeys', checkedKeys) + this.fondsKeys = checkedKeys.map(item => item.id) + console.log('fondsKeys', this.fondsKeys) }, getCategoryCheckedKeys() { const checkedKeys = this.$refs.treeCategory.getCheckedNodes() - console.log('categoryKeys', checkedKeys) + this.categoryKeys = checkedKeys.map(item => item.id) + console.log('categoryKeys', this.categoryKeys) + }, + checkAllChange() { + this.isIndeterminate = false// 设置全选按钮样式不为半选 + if (this.checkAll) { // 全选 + this.$nextTick(() => { // 这个如果要默认全选就必须加,否则会报错“setCheckedNodes”未定义 + this.$refs.treeClassify.setCheckedNodes(this.classifyOptions) + }) + // this. + } else { // 取消选中 + this.$nextTick(() => { + this.$refs.treeClassify.setCheckedKeys([]) + }) + } }, getClassifyCheckedKeys() { const checkedKeys = this.$refs.treeClassify.getCheckedNodes() - console.log('classifysKeys', checkedKeys) + this.classifysKeys = checkedKeys.map(item => item.code) + console.log('classifysKeys', this.classifysKeys) }, getLevelCheckedKeys() { const checkedKeys = this.$refs.treeLevel.getCheckedNodes() - console.log('levelsKeys', checkedKeys) + this.levelsKeys = checkedKeys.map(item => item.value) + console.log('levelsKeys', this.levelsKeys) }, returnAdvanced() { this.$emit('close-result') @@ -540,7 +605,11 @@ export default { } } .result-list{ - padding: 20px; + margin: 20px 0; + padding: 0 20px; + height: calc(100vh - 259px); + overflow: hidden; + overflow-y: scroll; .result-item{ position: relative; padding: 16px 16px 10px 16px; diff --git a/src/views/archivesManage/managementLibrary/index.vue b/src/views/archivesManage/managementLibrary/index.vue index 50dba0f..2d1b3c2 100644 --- a/src/views/archivesManage/managementLibrary/index.vue +++ b/src/views/archivesManage/managementLibrary/index.vue @@ -40,7 +40,7 @@ :expand-on-click-node="false" highlight-current show-checkbox - @check-change="handleCheckChange" + @check="handleCheckChange" > @@ -254,15 +254,15 @@ export default { }) }, handleNodeClick(val) { - this.smartQuery = { - 'retention': null, // 保管期限 - 'security_class': null, // 密级 - 'doc_type': null, // 文种 - 'medium_type': null, // 载体类型 - 'archive_year': null, // 年度 - 'organ_or_function': null, // 机构与类型 - 'fonds_no': null // 全宗 - } + // this.smartQuery = { + // 'retention': null, // 保管期限 + // 'security_class': null, // 密级 + // 'doc_type': null, // 文种 + // 'medium_type': null, // 载体类型 + // 'archive_year': null, // 年度 + // 'organ_or_function': null, // 机构与类型 + // 'fonds_no': null // 全宗 + // } this.parentsProjectId = null this.parentsAnjuanId = null this.parentsJuanneiId = null @@ -277,8 +277,32 @@ export default { this.classifyTree = [] } this.$nextTick(() => { - this.handlePageList() this.getDictsList() + Promise.all(this.user.roles.map(item => this.getRole(item.id))) + .then(roles => { + const allFondsIds = [] + const fondsObj = {} + roles.forEach(role => { + role.fonds.forEach(fond => { + if (!fondsObj[fond.id]) { + fondsObj[fond.id] = fond + allFondsIds.push(fond.id) + } + }) + }) + this.$refs.classifyTree.setCheckedKeys(allFondsIds) + if (allFondsIds.length !== 0) { + const defaultChecked = this.$refs.classifyTree.getCheckedNodes() + const fondsGroup = defaultChecked.filter(item => item.fondsId).map(item => item.fondsNo) + this.smartQuery.fonds_no = fondsGroup.join(',') + } else { + this.smartQuery.fonds_no = null + } + this.handlePageList() + }) + .catch(error => { + console.error(error) + }) }) }, handlePageList(isQuickFilter) { @@ -352,99 +376,10 @@ export default { } this.classifyTree = res.dictionarys.concat(fonds) this.classifyLoading = false - - this.$nextTick(() => { - Promise.all(this.user.roles.map(item => this.getRole(item.id))) - .then(roles => { - // 去重取fonds合集 - // const allFonds = [] - // roles.forEach(role => { - // role.fonds.forEach(fond => { - // const existingIndex = allFonds.findIndex(item => item.id === fond.id) - // if (existingIndex !== -1) { - // allFonds[existingIndex] = fond - // } else { - // allFonds.push(fond) - // } - // }) - // }) - const allFondsIds = [] - const fondsObj = {} - - roles.forEach(role => { - role.fonds.forEach(fond => { - if (!fondsObj[fond.id]) { - fondsObj[fond.id] = fond - allFondsIds.push(fond.id) - } - }) - }) - this.$refs.classifyTree.setCheckedKeys(allFondsIds) - }) - .catch(error => { - console.error('Error fetching roles:', error) - }) - }) }).catch(err => { console.log(err) }) }, - handleClassifyFilter(data, node, ele) { - this.smartQuery = { - 'retention': null, // 保管期限 - 'security_class': null, // 密级 - 'doc_type': null, // 文种 - 'medium_type': null, // 载体类型 - 'archive_year': null, // 年度 - 'fonds_no': null // 全宗 - } - if (data) { - if (node.childNodes.length === 0) { - const selectedKey = this.$refs.classifyTree.getCurrentNode() - this.treeCurrentNode = ele.$el - if (ele.$el.classList.contains('is-current')) { - this.treeCurrentNode.classList.remove('is-current') - } else { - this.treeCurrentNode.classList.add('is-current') - if (Object.keys(selectedKey).includes('fondsId')) { - this.smartQuery.fonds_no = selectedKey.fondsNo - console.log(this.smartQuery.fonds_no) - } else { - const selectedParentVal = this.$refs.classifyTree.getNode(selectedKey).parent.data.dictionaryCode - switch (selectedParentVal) { - case 'security_class': - if (selectedKey.dictionaryCode !== 'security_class') { - this.smartQuery.security_class = selectedKey.dictionaryName - } - break - case 'retention': - if (selectedKey.dictionaryCode !== 'retention') { - this.smartQuery.retention = selectedKey.dictionaryName - } - break - case 'doc_type': - if (selectedKey.dictionaryCode !== 'doc_type') { - this.smartQuery.doc_type = selectedKey.dictionaryName - } - break - case 'medium_type': - if (selectedKey.dictionaryCode !== 'medium_type') { - this.smartQuery.medium_type = selectedKey.dictionaryName - } - break - default: - if (selectedKey.dicCode !== 'archive_year') { - this.smartQuery.archive_year = selectedKey.dictionaryName - } - } - } - } - this.$nextTick(() => { - this.handlePageList('quickFilter') - }) - } - } - }, getIdByCode(dictionaryCode) { for (const dictionary of this.classifyTree) { if (dictionary.dictionaryCode === dictionaryCode) { diff --git a/src/views/archivesManage/managementLibrary/mixins/index.js b/src/views/archivesManage/managementLibrary/mixins/index.js index 69d2b74..25333c8 100644 --- a/src/views/archivesManage/managementLibrary/mixins/index.js +++ b/src/views/archivesManage/managementLibrary/mixins/index.js @@ -109,6 +109,7 @@ export const manageLibraryCrud = { }) }, getViewTableList(categoryLevel, parentsId, type) { + // console.log('888', this.smartQuery.fonds_no) const params = { 'parentId': parentsId, 'categoryId': this.selectedCategory.id, diff --git a/src/views/collectReorganizi/collectionLibrary/index.vue b/src/views/collectReorganizi/collectionLibrary/index.vue index bf6a5ae..843deea 100644 --- a/src/views/collectReorganizi/collectionLibrary/index.vue +++ b/src/views/collectReorganizi/collectionLibrary/index.vue @@ -29,7 +29,6 @@

快速筛选

- @@ -174,7 +173,6 @@ export default { this.classifyTree = this.classifyTree.slice(1) } if (this.yearChildData.length !== 0) { - console.log('this.yearChildData', this.yearChildData) const newYearArr = this.yearChildData.map((item, index) => { const json = {} json.id = item @@ -184,7 +182,6 @@ export default { return json }) this.classifyTree.unshift({ id: -1, dictionaryName: '年度', dictionaryCode: 'archive_year', childDictionarys: newYearArr }) - console.log('this.classifyTree', this.classifyTree) } this.classifyLoading = false }, 500) @@ -259,15 +256,15 @@ export default { }) }, handleNodeClick(val) { - this.smartQuery = { - 'retention': null, // 保管期限 - 'security_class': null, // 密级 - 'doc_type': null, // 文种 - 'medium_type': null, // 载体类型 - 'archive_year': null, // 年度 - 'organ_or_function': null, // 机构与类型 - 'fonds_no': null // 全宗 - } + // this.smartQuery = { + // 'retention': null, // 保管期限 + // 'security_class': null, // 密级 + // 'doc_type': null, // 文种 + // 'medium_type': null, // 载体类型 + // 'archive_year': null, // 年度 + // 'organ_or_function': null, // 机构与类型 + // 'fonds_no': null // 全宗 + // } this.parentsProjectId = null this.parentsAnjuanId = null this.parentsJuanneiId = null @@ -283,8 +280,32 @@ export default { this.classifyTree = [] } this.$nextTick(() => { - this.handlePageList() this.getDictsList() + Promise.all(this.user.roles.map(item => this.getRole(item.id))) + .then(roles => { + const allFondsIds = [] + const fondsObj = {} + roles.forEach(role => { + role.fonds.forEach(fond => { + if (!fondsObj[fond.id]) { + fondsObj[fond.id] = fond + allFondsIds.push(fond.id) + } + }) + }) + this.$refs.classifyTree.setCheckedKeys(allFondsIds) + if (allFondsIds.length !== 0) { + const defaultChecked = this.$refs.classifyTree.getCheckedNodes() + const fondsGroup = defaultChecked.filter(item => item.fondsId).map(item => item.fondsNo) + this.smartQuery.fonds_no = fondsGroup.join(',') + } else { + this.smartQuery.fonds_no = null + } + this.handlePageList() + }) + .catch(error => { + console.error(error) + }) }) }, handlePageList(isQuickFilter) { @@ -358,98 +379,10 @@ export default { } this.classifyTree = res.dictionarys.concat(fonds) this.classifyLoading = false - - this.$nextTick(() => { - Promise.all(this.user.roles.map(item => this.getRole(item.id))) - .then(roles => { - // 去重取fonds合集 - // const allFonds = [] - // roles.forEach(role => { - // role.fonds.forEach(fond => { - // const existingIndex = allFonds.findIndex(item => item.id === fond.id) - // if (existingIndex !== -1) { - // allFonds[existingIndex] = fond - // } else { - // allFonds.push(fond) - // } - // }) - // }) - const allFondsIds = [] - const fondsObj = {} - - roles.forEach(role => { - role.fonds.forEach(fond => { - if (!fondsObj[fond.id]) { - fondsObj[fond.id] = fond - allFondsIds.push(fond.id) - } - }) - }) - this.$refs.classifyTree.setCheckedKeys(allFondsIds) - }) - .catch(error => { - console.error('Error fetching roles:', error) - }) - }) }).catch(err => { console.log(err) }) }, - handleClassifyFilter(data, node, ele) { - this.smartQuery = { - 'retention': null, // 保管期限 - 'security_class': null, // 密级 - 'doc_type': null, // 文种 - 'medium_type': null, // 载体类型 - 'archive_year': null, // 年度 - 'fonds_no': null // 全宗 - } - if (data) { - if (node.childNodes.length === 0) { - const selectedKey = this.$refs.classifyTree.getCurrentNode() - this.treeCurrentNode = ele.$el - if (ele.$el.classList.contains('is-current')) { - this.treeCurrentNode.classList.remove('is-current') - } else { - this.treeCurrentNode.classList.add('is-current') - if (Object.keys(selectedKey).includes('fondsId')) { - this.smartQuery.fonds_no = selectedKey.fondsNo - } else { - const selectedParentVal = this.$refs.classifyTree.getNode(selectedKey).parent.data.dictionaryCode - switch (selectedParentVal) { - case 'security_class': - if (selectedKey.dictionaryCode !== 'security_class') { - this.smartQuery.security_class = selectedKey.dictionaryName - } - break - case 'retention': - if (selectedKey.dictionaryCode !== 'retention') { - this.smartQuery.retention = selectedKey.dictionaryName - } - break - case 'doc_type': - if (selectedKey.dictionaryCode !== 'doc_type') { - this.smartQuery.doc_type = selectedKey.dictionaryName - } - break - case 'medium_type': - if (selectedKey.dictionaryCode !== 'medium_type') { - this.smartQuery.medium_type = selectedKey.dictionaryName - } - break - default: - if (selectedKey.dicCode !== 'archive_year') { - this.smartQuery.archive_year = selectedKey.dictionaryName - } - } - } - } - this.$nextTick(() => { - this.handlePageList('quickFilter') - }) - } - } - }, getIdByCode(dictionaryCode) { for (const dictionary of this.classifyTree) { if (dictionary.dictionaryCode === dictionaryCode) {