Browse Source

搜索筛选

master
xuhuajiao 12 months ago
parent
commit
c1e4b71268
  1. 5
      .env.production
  2. 34
      src/api/archiveUtilize/archiveUtilize.js
  3. 8
      src/api/login.js
  4. 49
      src/views/archiveUtilize/archiveSearch/index.vue
  5. 188
      src/views/archiveUtilize/archiveSearch/module/resultList.vue
  6. 17
      src/views/archivesManage/managementLibrary/mixins/index.js
  7. 11
      src/views/collectReorganizi/collectionLibrary/index.vue
  8. 18
      src/views/collectReorganizi/collectionLibrary/mixins/index.js

5
.env.production

@ -4,7 +4,8 @@ ENV = 'production'
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
# VUE_APP_BASE_API = 'https://openapitest.aiyxlib.com' # VUE_APP_BASE_API = 'https://openapitest.aiyxlib.com'
# VUE_APP_BASE_API = 'http://192.168.99.107:11100' # VUE_APP_BASE_API = 'http://192.168.99.107:11100'
VUE_APP_BASE_API = 'http://27.19.215.77:11100'
# VUE_APP_BASE_API = 'http://27.19.215.77:11100'
VUE_APP_BASE_API = 'http://27.16.219.156:11100'
# 如果接口是 http 形式, wss 需要改为 ws # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws://27.19.215.77:11100'
VUE_APP_WS_API = 'ws://27.16.219.156:11101'
VUE_APP_CAMERA_API = '192.168.99.107:3000' VUE_APP_CAMERA_API = '192.168.99.107:3000'

34
src/api/archiveUtilize/archiveUtilize.js

@ -1,6 +1,30 @@
import request from '@/utils/request' import request from '@/utils/request'
import qs from 'qs' import qs from 'qs'
// 档案检索初始化全宗
export function FetchInitSearchFonds() {
return request({
url: 'api/archivesUtilize/initSearchFonds',
method: 'get'
})
}
// 档案检索初始化门类
export function FetchInitSearchCategory() {
return request({
url: 'api/archivesUtilize/initSearchCategory',
method: 'get'
})
}
// 档案检索初始化档案分类
export function FetchInitSearchArchiveCtgNo(params) {
return request({
url: 'api/archivesUtilize/initSearchArchiveCtgNo' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
// 档案检索 // 档案检索
export function FetchResearch(params) { export function FetchResearch(params) {
return request({ return request({
@ -9,4 +33,12 @@ export function FetchResearch(params) {
}) })
} }
export default { FetchResearch }
// 档案检索历史
export function FetchSearchHistory(params) {
return request({
url: 'api/archivesUtilize/searchHistory' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default { FetchInitSearchFonds, FetchInitSearchCategory, FetchInitSearchArchiveCtgNo, FetchResearch, FetchSearchHistory }

8
src/api/login.js

@ -2,7 +2,7 @@ import request from '@/utils/request'
export function login(username, password, code, uuid) { export function login(username, password, code, uuid) {
return request({ return request({
url: 'auth/login',
url: 'api/auth/login',
method: 'post', method: 'post',
data: { data: {
username, username,
@ -15,21 +15,21 @@ export function login(username, password, code, uuid) {
export function getInfo() { export function getInfo() {
return request({ return request({
url: 'auth/info',
url: 'api/auth/info',
method: 'get' method: 'get'
}) })
} }
export function getCodeImg() { export function getCodeImg() {
return request({ return request({
url: 'auth/code',
url: 'api/auth/code',
method: 'get' method: 'get'
}) })
} }
export function logout() { export function logout() {
return request({ return request({
url: 'auth/logout',
url: 'api/auth/logout',
method: 'delete' method: 'delete'
}) })
} }

49
src/views/archiveUtilize/archiveSearch/index.vue

@ -25,18 +25,16 @@
<div class="advanced-search-btn" @click="isCommon=!isCommon">高级检索</div> <div class="advanced-search-btn" @click="isCommon=!isCommon">高级检索</div>
</div> </div>
<div class="search-tab"> <div class="search-tab">
<span class="active">全部</span>
<span>项目</span>
<span>案卷</span>
<span>文件</span>
<span>原文</span>
<span :class="{'active' : tagIndex === 0}" @click="searchTagChange(0)">全部</span>
<span :class="{'active' : tagIndex === 1}" @click="searchTagChange(1)">项目</span>
<span :class="{'active' : tagIndex === 2}" @click="searchTagChange(2)">案卷</span>
<span :class="{'active' : tagIndex === 3}" @click="searchTagChange(3)">文件</span>
<span :class="{'active' : tagIndex === 4}" @click="searchTagChange(4)">原文</span>
</div> </div>
<div class="history-keyword"> <div class="history-keyword">
<h4>历史检索</h4> <h4>历史检索</h4>
<div class="history-tag"> <div class="history-tag">
<span>合同</span>
<span>科技</span>
<span>教育</span>
<span v-for="(item,index) in historyKeyword" :key="index">{{ item }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -98,12 +96,13 @@
</div> </div>
</div> </div>
</div> </div>
<ResultList v-else :is-common="isCommon" @close-result="closeResult" />
<ResultList v-else ref="resultListRef" :is-common="isCommon" @close-result="closeResult" />
</div> </div>
</template> </template>
<script > <script >
import { FetchFindGroupType } from '@/api/system/field' import { FetchFindGroupType } from '@/api/system/field'
import { FetchSearchHistory } from '@/api/archiveUtilize/archiveUtilize'
import ResultList from './module/resultList' import ResultList from './module/resultList'
export default { export default {
name: 'ArchiveSearch', name: 'ArchiveSearch',
@ -171,7 +170,9 @@ export default {
}, },
conditionData: [], conditionData: [],
currentIndex: null, currentIndex: null,
connectorList: ['并且', '或者', '(', ')']
connectorList: ['并且', '或者', '(', ')'],
historyKeyword: null,
tagIndex: 0
} }
}, },
computed: { computed: {
@ -198,6 +199,7 @@ export default {
}, },
mounted() { mounted() {
this.getFieldCommon() this.getFieldCommon()
this.getSearchHistory()
}, },
methods: { methods: {
resetQuery() { resetQuery() {
@ -365,8 +367,31 @@ export default {
dimSearch() { dimSearch() {
}, },
handleSearch() { handleSearch() {
this.isResult = true
localStorage.setItem('searchKeywords', this.keywords)
if (this.keywords) {
this.isResult = true
localStorage.setItem('searchKeywords', this.keywords)
this.$nextTick(() => {
if (this.tagIndex === 0) {
this.$refs.resultListRef.levelsKeys = null
} else {
this.$refs.resultListRef.levelsKeys = []
this.$refs.resultListRef.levelsKeys.push(this.tagIndex)
this.$refs.resultListRef.$refs.treeLevel.setCheckedKeys([this.tagIndex])
this.$refs.resultListRef.activeNames = ['1', '4']
}
this.$refs.resultListRef.handledResultSearch()
})
} else {
this.$message({ message: '请输入检索关键字段', type: 'error', offset: 8 })
}
},
searchTagChange(index) {
this.tagIndex = index
},
getSearchHistory() {
FetchSearchHistory({ pagesize: 10 }).then(res => {
this.historyKeyword = res
})
}, },
closeResult() { closeResult() {
this.isResult = false this.isResult = false

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

@ -50,6 +50,7 @@
</div> </div>
<el-tree <el-tree
ref="treeClassify" ref="treeClassify"
v-loading="classifyLoading"
:data="classifyOptions" :data="classifyOptions"
show-checkbox show-checkbox
default-expand-all default-expand-all
@ -71,7 +72,7 @@
:data="levelOptions" :data="levelOptions"
show-checkbox show-checkbox
default-expand-all default-expand-all
node-key="id"
node-key="value"
:props="{children: 'children', label: 'label'}" :props="{children: 'children', label: 'label'}"
:filter-node-method="filterLevelNode" :filter-node-method="filterLevelNode"
@check-change="getLevelCheckedKeys" @check-change="getLevelCheckedKeys"
@ -97,17 +98,17 @@
</el-select> --> </el-select> -->
<div class="search-input"> <div class="search-input">
<el-input v-model="keywords" placeholder="请输入检索关键字" class="input-with-select"> <el-input v-model="keywords" placeholder="请输入检索关键字" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="handleSearch">搜索</el-button>
<el-button slot="append" icon="el-icon-search" @click="handledResultSearch">搜索</el-button>
</el-input> </el-input>
</div> </div>
<span class="change-search" @click="returnAdvanced">高级检索</span> <span class="change-search" @click="returnAdvanced">高级检索</span>
</div> </div>
<div class="search-tip">
<div v-if="tipShow" class="search-tip">
<div v-if="isCommon">检索 <span>{{ keywords }}</span> 成功获得<i>{{ page.total }}</i>条结果</div> <div v-if="isCommon">检索 <span>{{ keywords }}</span> 成功获得<i>{{ page.total }}</i>条结果</div>
<div v-else>检索成功获得<i>{{ page.total }}</i>条结果<p>高级检索 点击查看检索条件</p></div> <div v-else>检索成功获得<i>{{ page.total }}</i>条结果<p>高级检索 点击查看检索条件</p></div>
</div> </div>
</div> </div>
<div class="result-list">
<div v-if="resultData.length !== 0" v-loading="resultLoading" class="result-list">
<div v-for="(item,index) in resultData" :key="index" class="result-item" @dblclick="handleDetail"> <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> <div class="result-item-title"><span>案卷</span><p>{{ item.maintitle }}</p></div>
<p class="result-item-content" v-html="highlightKeywords(item.matekey)" /> <p class="result-item-content" v-html="highlightKeywords(item.matekey)" />
@ -130,18 +131,19 @@
<i class="iconfont icon-jiarujieyueche" @click.stop="addLending" /> <i class="iconfont icon-jiarujieyueche" @click.stop="addLending" />
</div> </div>
</div> </div>
<!--分页组件-->
<el-pagination
v-if="resultData.length !== 0"
:current-page="page.page"
:total="page.total"
:page-size="page.size"
:pager-count="5"
layout="total, prev, pager, next, sizes"
@size-change="handleSizeChange"
@current-change="handleCurrentPage"
/>
</div> </div>
<!--分页组件-->
<el-pagination
v-if="resultData.length !== 0"
:current-page="page.page"
:total="page.total"
:page-size="page.size"
:pager-count="5"
layout="total, prev, pager, next, sizes"
@size-change="handleSizeChange"
@current-change="handleCurrentPage"
/>
<el-empty v-else description="暂无更多数据" />
</div> </div>
<!-- 档案详情 --> <!-- 档案详情 -->
<ArchivesInfo ref="archivesInfo" :selected-category="selectedCategory" :arc-id="arcId" /> <ArchivesInfo ref="archivesInfo" :selected-category="selectedCategory" :arc-id="arcId" />
@ -149,9 +151,7 @@
</template> </template>
<script > <script >
import { FetchFondsAll } from '@/api/system/fonds'
import { FetchCategoryMenu } from '@/api/system/category/category'
import { FetchResearch } from '@/api/archiveUtilize/archiveUtilize'
import { FetchInitSearchFonds, FetchInitSearchCategory, FetchInitSearchArchiveCtgNo, FetchResearch } from '@/api/archiveUtilize/archiveUtilize'
import ArchivesInfo from '@/views/components/archivesDetail/detail.vue' import ArchivesInfo from '@/views/components/archivesDetail/detail.vue'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
@ -231,7 +231,6 @@ export default {
], ],
status: null, status: null,
keywords: '', keywords: '',
str: '《福建省电力零售市场购售电合同》(以下简称《合同文本》)适用于福建省电力市场零售用户与售电公司之间签订的零售市场购售电合同...在本合同履行期限届满之前,因一方原因导致合同不能继续履行,另一方可在履行期限届满前解除合同并要求其承担相应的违约责任...9.2 本合同部分条款的无效,不影响其他条款及本合同的效力。...七、争议的解决方式凡因执行本合同所发生的与本合同有关的一切争议...九、合同生效及其他9.1 本合同范本在福建省电力交易中心平台上公示...',
selectedCategory: { selectedCategory: {
id: 'DAAC5ED3F86D6481C3C1A5', id: 'DAAC5ED3F86D6481C3C1A5',
arrangeType: 3 arrangeType: 3
@ -248,7 +247,10 @@ export default {
categoryKeys: null, categoryKeys: null,
classifysKeys: null, classifysKeys: null,
levelsKeys: null, levelsKeys: null,
resultData: []
resultData: [],
classifyLoading: false,
resultLoading: false,
tipShow: false
} }
}, },
computed: { computed: {
@ -273,6 +275,7 @@ export default {
mounted() { mounted() {
this.getFondsDatas() this.getFondsDatas()
this.getCategoryDataTree() this.getCategoryDataTree()
this.getArchiveCtgNo(null)
console.log(localStorage.getItem('searchKeywords')) console.log(localStorage.getItem('searchKeywords'))
if (localStorage.getItem('searchKeywords')) { if (localStorage.getItem('searchKeywords')) {
this.keywords = localStorage.getItem('searchKeywords') this.keywords = localStorage.getItem('searchKeywords')
@ -280,6 +283,9 @@ export default {
}, },
methods: { methods: {
highlightKeywords(text) { highlightKeywords(text) {
if (!text) {
return false
}
const cleanedText = text.replace(/,/g, ' ') // const cleanedText = text.replace(/,/g, ' ') //
if (this.keywords.includes(' ')) { if (this.keywords.includes(' ')) {
// 使 // 使
@ -295,61 +301,84 @@ export default {
return highlightedText 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
handledResultSearch() {
if (this.keywords) {
this.resultLoading = true
this.tipShow = true
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
setTimeout(() => {
this.resultLoading = false
}, 600)
}).catch(err => {
console.log(err)
})
} else {
this.tipShow = false
this.$message({ message: '请输入检索关键字段', type: 'error', offset: 8 })
} }
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() { getFondsDatas() {
FetchFondsAll().then(res => {
FetchInitSearchFonds().then(res => {
this.fondsOptions = res this.fondsOptions = res
}) })
}, },
filterData(data) {
const result = []
for (const node of data) {
if (node.isType === 2) {
const filteredChildren = node.children.filter(child => child.isType !== 3)
node.children = filteredChildren
result.push(node)
} else if (node.children && node.children.length > 0) {
const filteredChildren = this.filterData(node.children)
result.push(...filteredChildren)
}
}
return result
// filterData(data) {
// const result = []
// for (const node of data) {
// if (node.isType === 2) {
// const filteredChildren = node.children.filter(child => child.isType !== 3)
// node.children = filteredChildren
// result.push(node)
// } else if (node.children && node.children.length > 0) {
// const filteredChildren = this.filterData(node.children)
// result.push(...filteredChildren)
// }
// }
// return result
// },
// filterArchivesClasses(data, result = []) {
// if (data && data.length > 0) {
// for (let i = 0; i < data.length; i++) {
// const archivesClasses = data[i].archivesClasses
// if (archivesClasses && archivesClasses.length > 0) {
// result.push(...archivesClasses)
// }
// this.filterArchivesClasses(data[i].children, result)
// }
// }
// return result
// },
getCategoryDataTree() {
FetchInitSearchCategory().then(res => {
this.categoryOptions = res
})
}, },
filterArchivesClasses(data, result = []) {
if (data && data.length > 0) {
for (let i = 0; i < data.length; i++) {
const archivesClasses = data[i].archivesClasses
if (archivesClasses && archivesClasses.length > 0) {
result.push(...archivesClasses)
}
this.filterArchivesClasses(data[i].children, result)
}
getArchiveCtgNo(categoryIds) {
this.classifyOptions = []
this.classifyLoading = true
const params = {
'categoryIds': categoryIds,
'search': null
} }
return result
},
getCategoryDataTree() {
FetchCategoryMenu().then(res => {
this.categoryOptions = this.filterData(res)
this.classifyOptions = this.filterArchivesClasses(res)
FetchInitSearchArchiveCtgNo(params).then(res => {
this.classifyOptions = res
setTimeout(() => {
this.classifyLoading = false
}, 600)
}) })
}, },
handleChange(val) { handleChange(val) {
@ -373,12 +402,21 @@ export default {
}, },
getFondsCheckedKeys() { getFondsCheckedKeys() {
const checkedKeys = this.$refs.tree.getCheckedNodes() const checkedKeys = this.$refs.tree.getCheckedNodes()
this.fondsKeys = checkedKeys.map(item => item.id)
if (checkedKeys.length === 0) {
this.fondsKeys = null
} else {
this.fondsKeys = checkedKeys.map(item => item.fondsId)
}
console.log('fondsKeys', this.fondsKeys) console.log('fondsKeys', this.fondsKeys)
}, },
getCategoryCheckedKeys() { getCategoryCheckedKeys() {
const checkedKeys = this.$refs.treeCategory.getCheckedNodes() const checkedKeys = this.$refs.treeCategory.getCheckedNodes()
this.categoryKeys = checkedKeys.map(item => item.id)
if (checkedKeys.length === 0) {
this.categoryKeys = null
} else {
this.categoryKeys = checkedKeys.map(item => item.id)
}
this.getArchiveCtgNo(this.categoryKeys)
console.log('categoryKeys', this.categoryKeys) console.log('categoryKeys', this.categoryKeys)
}, },
checkAllChange() { checkAllChange() {
@ -396,12 +434,20 @@ export default {
}, },
getClassifyCheckedKeys() { getClassifyCheckedKeys() {
const checkedKeys = this.$refs.treeClassify.getCheckedNodes() const checkedKeys = this.$refs.treeClassify.getCheckedNodes()
this.classifysKeys = checkedKeys.map(item => item.code)
if (checkedKeys.length === 0) {
this.classifysKeys = null
} else {
this.classifysKeys = checkedKeys.map(item => item.code)
}
console.log('classifysKeys', this.classifysKeys) console.log('classifysKeys', this.classifysKeys)
}, },
getLevelCheckedKeys() { getLevelCheckedKeys() {
const checkedKeys = this.$refs.treeLevel.getCheckedNodes() const checkedKeys = this.$refs.treeLevel.getCheckedNodes()
this.levelsKeys = checkedKeys.map(item => item.value)
if (checkedKeys.length === 0) {
this.levelsKeys = null
} else {
this.levelsKeys = checkedKeys.map(item => item.value)
}
console.log('levelsKeys', this.levelsKeys) console.log('levelsKeys', this.levelsKeys)
}, },
returnAdvanced() { returnAdvanced() {

17
src/views/archivesManage/managementLibrary/mixins/index.js

@ -44,14 +44,15 @@ export const manageLibraryCrud = {
handleSearch(categoryLevel) { handleSearch(categoryLevel) {
console.log('selectStatus', this.selectStatus) console.log('selectStatus', this.selectStatus)
this.parentsData.$refs.classifyTree.setCurrentKey(null) this.parentsData.$refs.classifyTree.setCurrentKey(null)
this.smartQuery = {
'retention': null,
'security_class': null,
'doc_type': null,
'medium_type': null,
'archive_year': null,
'fonds_no': null
}
// this.smartQuery = {
// 'retention': null,
// 'security_class': null,
// 'doc_type': null,
// 'medium_type': null,
// 'archive_year': null,
// 'fonds_no': null
// }
this.smartQuery = this.parentsData.smartQuery
// 2 项目 3 案卷 /文件 4 卷内 6 文件 // 2 项目 3 案卷 /文件 4 卷内 6 文件
if (this.isTitleType === 2) { if (this.isTitleType === 2) {
this.parentsId = null this.parentsId = null

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

@ -71,6 +71,7 @@
<script> <script>
import crudCategory from '@/api/category/category' import crudCategory from '@/api/category/category'
import crudRoles from '@/api/system/role' import crudRoles from '@/api/system/role'
// import { FetchInitSearchFonds } from '@/api/archiveUtilize/archiveUtilize'
import { collectionLibraryCrud } from './mixins/index.js' import { collectionLibraryCrud } from './mixins/index.js'
import { FetchDictionaryTreeByCategoryId } from '@/api/system/dict' import { FetchDictionaryTreeByCategoryId } from '@/api/system/dict'
import CRUD, { presenter, header } from '@crud/crud' import CRUD, { presenter, header } from '@crud/crud'
@ -362,14 +363,15 @@ export default {
'categoryId': categoryId 'categoryId': categoryId
} }
FetchDictionaryTreeByCategoryId(params).then((res) => { FetchDictionaryTreeByCategoryId(params).then((res) => {
console.log(res)
let fonds let fonds
if (res.fonds.length <= 1) {
if (res.length <= 1) {
fonds = [] fonds = []
} else { } else {
const parent = {} const parent = {}
parent.id = 0 parent.id = 0
parent.fondsName = '全宗' parent.fondsName = '全宗'
parent.childDictionarys = res.fonds.map(item => {
parent.childDictionarys = res.map(item => {
return { return {
...item, ...item,
id: item.fondsId id: item.fondsId
@ -377,7 +379,8 @@ export default {
}) })
fonds = parent fonds = parent
} }
this.classifyTree = res.dictionarys.concat(fonds)
this.classifyTree = res.concat(fonds)
console.log(this.classifyTree)
this.classifyLoading = false this.classifyLoading = false
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
@ -397,7 +400,9 @@ export default {
// const isFondsTop = res.some(obj => obj.fondsName === '') // const isFondsTop = res.some(obj => obj.fondsName === '')
// if (isFondsTop) { // if (isFondsTop) {
// this.smartQuery.fonds_no = null // this.smartQuery.fonds_no = null
console.log(res)
const fondsGroup = res.filter(item => item.fondsId).map(item => item.fondsNo) const fondsGroup = res.filter(item => item.fondsId).map(item => item.fondsNo)
console.log('fondsGroup', fondsGroup)
this.smartQuery.fonds_no = fondsGroup.join(',') this.smartQuery.fonds_no = fondsGroup.join(',')
// } // }

18
src/views/collectReorganizi/collectionLibrary/mixins/index.js

@ -41,14 +41,16 @@ export const collectionLibraryCrud = {
}, },
handleSearch(categoryLevel) { handleSearch(categoryLevel) {
this.parentsData.$refs.classifyTree.setCurrentKey(null) this.parentsData.$refs.classifyTree.setCurrentKey(null)
this.smartQuery = {
'retention': null,
'security_class': null,
'doc_type': null,
'medium_type': null,
'archive_year': null,
'fonds_no': null
}
console.log(this.parentsData.smartQuery)
// this.smartQuery = {
// 'retention': null,
// 'security_class': null,
// 'doc_type': null,
// 'medium_type': null,
// 'archive_year': null,
// 'fonds_no': null
// }
this.smartQuery = this.parentsData.smartQuery
// 2 项目 3 案卷 /文件 4 卷内 6 文件 // 2 项目 3 案卷 /文件 4 卷内 6 文件
if (this.isTitleType === 2) { if (this.isTitleType === 2) {
this.parentsId = null this.parentsId = null

Loading…
Cancel
Save