Browse Source

快速筛选/搜索

master
xuhuajiao 12 months ago
parent
commit
c0c4e8f266
  1. 12
      src/api/archiveUtilize/archiveUtilize.js
  2. 2
      src/assets/icons/svg/sr-ly.svg
  3. 1
      src/views/archiveUtilize/archiveSearch/index.vue
  4. 121
      src/views/archiveUtilize/archiveSearch/module/resultList.vue
  5. 135
      src/views/archivesManage/managementLibrary/index.vue
  6. 1
      src/views/archivesManage/managementLibrary/mixins/index.js
  7. 137
      src/views/collectReorganizi/collectionLibrary/index.vue

12
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 }

2
src/assets/icons/svg/sr-ly.svg

@ -0,0 +1,2 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1708479094547" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14453" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); .st0{ fill: currentColor; color:#339CFF; }}
</style></defs><path d="M504.685714 958.171429H168.228571c-58.514286 0-109.714286-51.2-109.714285-109.714286V138.971429C58.514286 80.457143 109.714286 29.257143 168.228571 29.257143h702.171429c58.514286 0 109.714286 51.2 109.714286 109.714286v204.8c0 21.942857-21.942857 43.885714-43.885715 43.885714s-43.885714-21.942857-43.885714-51.2V138.971429c0-7.314286-7.314286-21.942857-21.942857-21.942858H168.228571c-7.314286 0-21.942857 7.314286-21.942857 21.942858v716.8c0 7.314286 7.314286 21.942857 21.942857 21.942857h343.771429c21.942857 0 43.885714 21.942857 43.885714 43.885714s-21.942857 36.571429-51.2 36.571429z" p-id="14454"></path><path d="M782.628571 373.028571H248.685714c-21.942857 0-43.885714-21.942857-43.885714-43.885714s21.942857-43.885714 43.885714-43.885714h533.942857c21.942857 0 43.885714 21.942857 43.885715 43.885714s-21.942857 43.885714-43.885715 43.885714zM416.914286 585.142857H248.685714c-29.257143 0-51.2-21.942857-51.2-43.885714s21.942857-43.885714 43.885715-43.885714h175.542857c21.942857 0 43.885714 21.942857 43.885714 43.885714s-14.628571 43.885714-43.885714 43.885714zM336.457143 797.257143H248.685714c-21.942857 0-43.885714-21.942857-43.885714-43.885714s21.942857-43.885714 43.885714-43.885715h95.085715c21.942857 0 43.885714 21.942857 43.885714 43.885715s-21.942857 43.885714-51.2 43.885714zM702.171429 870.4C577.828571 870.4 475.428571 768 475.428571 636.342857 475.428571 512 577.828571 409.6 702.171429 409.6s234.057143 102.4 234.057142 234.057143c0 124.342857-102.4 226.742857-234.057142 226.742857z m0-373.028571c-80.457143 0-138.971429 65.828571-138.971429 138.971428 0 80.457143 65.828571 138.971429 138.971429 138.971429S841.142857 716.8 841.142857 636.342857c0-73.142857-58.514286-138.971429-138.971428-138.971428z" p-id="14455"></path><path d="M936.228571 994.742857c-14.628571 0-29.257143-7.314286-43.885714-21.942857l-102.4-138.971429c-14.628571-21.942857-7.314286-51.2 7.314286-65.828571 21.942857-14.628571 51.2-7.314286 65.828571 7.314286l102.4 138.971428c14.628571 21.942857 14.628571 51.2 0 65.828572-14.628571 14.628571-21.942857 14.628571-29.257143 14.628571z" p-id="14456"></path></svg>

1
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

121
src/views/archiveUtilize/archiveSearch/module/resultList.vue

@ -45,6 +45,9 @@
placeholder="快速检索"
suffix-icon="el-icon-search"
/>
<div class="propListHeader">
<el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="checkAllChange">全部选择</el-checkbox>
</div>
<el-tree
ref="treeClassify"
:data="classifyOptions"
@ -93,26 +96,26 @@
/>
</el-select> -->
<div class="search-input">
<el-input v-model="keyword" placeholder="请输入检索关键字" class="input-with-select">
<el-button slot="append" icon="el-icon-search">搜索</el-button>
<el-input v-model="keywords" placeholder="请输入检索关键字" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="handleSearch">搜索</el-button>
</el-input>
</div>
<span class="change-search" @click="returnAdvanced">高级检索</span>
</div>
<div class="search-tip">
<div v-if="isCommon">检索 <span>合同</span> 成功获得<i>30</i>条结果</div>
<div v-else>检索成功获得<i>30</i>条结果<p>高级检索 点击查看检索条件</p></div>
<div v-if="isCommon">检索 <span>{{ keywords }}</span> 成功获得<i>{{ page.total }}</i>条结果</div>
<div v-else>检索成功获得<i>{{ page.total }}</i>条结果<p>高级检索 点击查看检索条件</p></div>
</div>
</div>
<div class="result-list">
<div class="result-item" @dblclick="handleDetail">
<div class="result-item-title"><span>案卷</span><p>档案题名</p></div>
<p class="result-item-content" v-html="highlightedText" />
<div v-for="(item,index) in resultData" :key="index" class="result-item" @dblclick="handleDetail">
<div class="result-item-title"><span>案卷</span><p>{{ item.maintitle }}</p></div>
<p class="result-item-content" v-html="highlightKeywords(item.matekey)" />
<div class="result-item-info">
<p>档号WS-2022-001</p>
<p>全宗全宗A</p>
<p>档案门类文书档案案卷</p>
<p>档案分类文书档案案卷</p>
<p>档号{{ item.archiveNo }}</p>
<p>全宗{{ item.fondsName }}</p>
<p>档案门类{{ item.categoryName }}</p>
<p>档案分类{{ item.archivesClassName }}</p>
</div>
<div class="item-top-tag">
<span>实体</span>
@ -129,7 +132,7 @@
</div>
<!--分页组件-->
<el-pagination
v-if="listData.length !== 0"
v-if="resultData.length !== 0"
:current-page="page.page"
:total="page.total"
:page-size="page.size"
@ -148,7 +151,9 @@
<script >
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'),
`<span style="color: #ED4A41">${this.keyword}</span>`
)
}
...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 "<span style='color: red'>" + match + '</span>'
})
return highlightedText
} else {
//
const highlightedText = cleanedText.replace(new RegExp(this.keywords, 'gi'), match => {
return "<span style='color: red'>" + match + '</span>'
})
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;

135
src/views/archivesManage/managementLibrary/index.vue

@ -40,7 +40,7 @@
:expand-on-click-node="false"
highlight-current
show-checkbox
@check-change="handleCheckChange"
@check="handleCheckChange"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span v-if="data.childDictionarys || data.fondsName" class="iconClassify">
@ -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) {

1
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,

137
src/views/collectReorganizi/collectionLibrary/index.vue

@ -29,7 +29,6 @@
</el-tree>
</div>
<h3 class="arc-title arc-title-bottom">快速筛选</h3>
<!-- @node-click="handleClassifyFilter" -->
<el-tree
ref="classifyTree"
v-loading="classifyLoading"
@ -40,7 +39,7 @@
:expand-on-click-node="false"
highlight-current
show-checkbox
@check-change="handleCheckChange"
@check="handleCheckChange"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<span v-if="data.childDictionarys || data.fondsName" class="iconClassify">
@ -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) {

Loading…
Cancel
Save