Browse Source

公文检索

master
xuhuajiao 4 weeks ago
parent
commit
e15c0da5e0
  1. 39
      src/api/system/documentArchives.js
  2. 2
      src/views/archivesMIOD/miodLibrary/index.vue
  3. 75
      src/views/archivesMIOD/miodLibrary/module/detail.vue
  4. 148
      src/views/archivesMIOD/miodLibrary/treeList.vue
  5. 12
      src/views/archivesMIOD/miodSearch/index.vue
  6. 268
      src/views/archivesMIOD/miodSearch/module/resultList.vue
  7. 8
      src/views/components/category/PreviewForm.vue

39
src/api/system/documentArchives.js

@ -194,6 +194,39 @@ export function FetchDocumentByDocDepartment(params) {
}) })
} }
// 档案检索
export function FetchDocumentArchivesSearch(params) {
return request({
url: 'api/documentArchives/search' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
// 档案检索历史
export function FetchSearchHistory(params) {
return request({
url: 'api/documentArchives/searchHistory' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
// 档案高级检索
export function FetchSeniorSearch(params) {
return request({
url: 'api/documentArchives/seniorSearch' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
// 分类查询字段表
export function FetchFindGroupType(params) {
return request({
url: 'api/documentField/findGroupType' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default { export default {
FetchInitDocumentParam, FetchInitDocumentParam,
updateDocumentParam, updateDocumentParam,
@ -215,5 +248,9 @@ export default {
FetchBingdingLabel, FetchBingdingLabel,
FetchUnbindTag, FetchUnbindTag,
FetchInitStatisBase, FetchInitStatisBase,
FetchDocumentByDocDepartment
FetchDocumentByDocDepartment,
FetchDocumentArchivesSearch,
FetchSearchHistory,
FetchSeniorSearch,
FetchFindGroupType
} }

2
src/views/archivesMIOD/miodLibrary/index.vue

@ -406,7 +406,7 @@ export default {
this.$refs.archivesInfo.archivesInfoVisible = true this.$refs.archivesInfo.archivesInfoVisible = true
this.$refs.archivesInfo.archivesTabIndex = 0 this.$refs.archivesInfo.archivesTabIndex = 0
this.$refs.archivesInfo.parentInfo = row this.$refs.archivesInfo.parentInfo = row
this.$refs.archivesInfo.getDetial(row.id)
this.$refs.archivesInfo.getDetial(row)
}, },
// //
toDelete(datas) { toDelete(datas) {

75
src/views/archivesMIOD/miodLibrary/module/detail.vue

@ -118,13 +118,14 @@
/> />
</div> </div>
</div> </div>
<binding-tag-dlg ref="bindingTag" :selected-document="selectedDocument" :binding-id="crud.selections[0] && crud.selections[0].id" :binding-type="1" binding-txt="公文" @refresh="crud.refresh" />
<!-- :binding-id="crud.selections[0] && crud.selections[0].id" @refresh="crud.refresh" -->
<binding-tag-dlg ref="bindingTag" :selected-document="selectedDocument" :binding-id="selections[0] && selections[0].id" :binding-type="1" binding-txt="公文" />
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { form } from '@crud/crud'
// import { crud } from '@crud/crud'
// , FetchUnbindTag // , FetchUnbindTag
import { FetchArchivesDetails, FetchInitDocumentDetailsList, FetchAddDocumentDetails, FetchDeleteDocumentDetails, FetchInitDistributorByDocumentId, FetchInitOperate } from '@/api/system/documentArchives' import { FetchArchivesDetails, FetchInitDocumentDetailsList, FetchAddDocumentDetails, FetchDeleteDocumentDetails, FetchInitDistributorByDocumentId, FetchInitOperate } from '@/api/system/documentArchives'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
@ -139,7 +140,7 @@ export default {
}, },
components: { BindingTagDlg }, components: { BindingTagDlg },
mixins: [ mixins: [
form({})
// crud()
], ],
props: { props: {
selectedDocument: { selectedDocument: {
@ -163,7 +164,9 @@ export default {
tableData: [], tableData: [],
parentInfo: null, parentInfo: null,
handleTableData: [], handleTableData: [],
currentArchives: null,
currentArchivesId: null, currentArchivesId: null,
pageType: null,
archivesFiledataLoading: false, archivesFiledataLoading: false,
borrowerList: [], borrowerList: [],
page: { page: {
@ -232,15 +235,22 @@ export default {
getOperateTypeText(type) { getOperateTypeText(type) {
return this.operateTypeMap[type] || '-' return this.operateTypeMap[type] || '-'
}, },
getDetial(rowId) {
this.currentArchivesId = rowId
const documentId = this.selectedDocument.isType === 2
? this.selectedDocument.id
: this.selectedDocument.documentId
getDetial(row, pageType) {
this.pageType = pageType
this.currentArchives = row
this.currentArchivesId = row.id
let documentId
if (pageType && pageType === 'search') {
documentId = row.document_id
} else {
documentId = this.selectedDocument.isType === 2
? this.selectedDocument.id
: this.selectedDocument.documentId
}
const commonParams = { const commonParams = {
documentId, documentId,
archivesId: rowId
archivesId: row.id
} }
Promise.all([ Promise.all([
@ -261,9 +271,15 @@ export default {
getInitDocumentDetailsList() { getInitDocumentDetailsList() {
this.archivesFiledataLoading = true this.archivesFiledataLoading = true
const documentId = this.selectedDocument.isType === 2
? this.selectedDocument.id
: this.selectedDocument.documentId
let documentId
if (this.pageType && this.pageType === 'search') {
documentId = this.currentArchives.document_id
} else {
documentId = this.selectedDocument.isType === 2
? this.selectedDocument.id
: this.selectedDocument.documentId
}
const params = { const params = {
documentId, documentId,
@ -297,10 +313,12 @@ export default {
}, },
handleAddDocDetails() { handleAddDocDetails() {
let documentId let documentId
if (this.selectedDocument.isType === 2) {
documentId = this.selectedDocument.id
if (this.pageType && this.pageType === 'search') {
documentId = this.currentArchives.document_id
} else { } else {
documentId = this.selectedDocument.documentId
documentId = this.selectedDocument.isType === 2
? this.selectedDocument.id
: this.selectedDocument.documentId
} }
const params = { const params = {
documentId: documentId, documentId: documentId,
@ -320,10 +338,12 @@ export default {
// //
getInitOperate() { getInitOperate() {
let documentId let documentId
if (this.selectedDocument.isType === 2) {
documentId = this.selectedDocument.id
if (this.pageType && this.pageType === 'search') {
documentId = this.currentArchives.document_id
} else { } else {
documentId = this.selectedDocument.documentId
documentId = this.selectedDocument.isType === 2
? this.selectedDocument.id
: this.selectedDocument.documentId
} }
const params = { const params = {
documentId: documentId, documentId: documentId,
@ -355,9 +375,14 @@ export default {
dangerouslyUseHTMLString: true dangerouslyUseHTMLString: true
}).then(() => { }).then(() => {
this.unbindBtnLoading = true this.unbindBtnLoading = true
const documentId = this.selectedDocument.isType === 2
? this.selectedDocument.id
: this.selectedDocument.documentId
let documentId
if (this.pageType && this.pageType === 'search') {
documentId = this.currentArchives.document_id
} else {
documentId = this.selectedDocument.isType === 2
? this.selectedDocument.id
: this.selectedDocument.documentId
}
const unbindData = { const unbindData = {
labelType: data.details_type, labelType: data.details_type,
tid: data.tid, tid: data.tid,
@ -381,10 +406,12 @@ export default {
dangerouslyUseHTMLString: true dangerouslyUseHTMLString: true
}).then(() => { }).then(() => {
let documentId let documentId
if (this.selectedDocument.isType === 2) {
documentId = this.selectedDocument.id
if (this.pageType && this.pageType === 'search') {
documentId = this.currentArchives.document_id
} else { } else {
documentId = this.selectedDocument.documentId
documentId = this.selectedDocument.isType === 2
? this.selectedDocument.id
: this.selectedDocument.documentId
} }
const params = { const params = {
documentId: documentId, documentId: documentId,

148
src/views/archivesMIOD/miodLibrary/treeList.vue

@ -55,7 +55,9 @@ export default {
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'cnName' label: 'cnName'
}
},
currentTreeVal: null,
nodeToSelect: null
} }
}, },
computed: { computed: {
@ -67,6 +69,18 @@ export default {
}, },
methods: { methods: {
refreshData() { refreshData() {
console.log('refreshTreeList', this.currentTreeVal)
//
if (this.currentTreeVal) {
this.nodeToSelect = {
...this.currentTreeVal,
timestamp: Date.now() //
}
} else {
this.nodeToSelect = null
}
this.crud.toQuery() this.crud.toQuery()
}, },
[CRUD.HOOK.beforeRefresh](crud) { [CRUD.HOOK.beforeRefresh](crud) {
@ -109,14 +123,137 @@ export default {
})) }))
console.log(' this.crud.data', this.crud.data) console.log(' this.crud.data', this.crud.data)
// document // document
// this.$nextTick(() => {
// const defaultSelectedNode = this.findFirstIsType2Node(this.crud.data)
// if (defaultSelectedNode) {
// this.$refs.tree.setCurrentKey(defaultSelectedNode.id)
// this.handleNodeClick(defaultSelectedNode)
// }
// })
//
this.$nextTick(() => { this.$nextTick(() => {
const defaultSelectedNode = this.findFirstIsType2Node(this.crud.data)
if (defaultSelectedNode) {
this.$refs.tree.setCurrentKey(defaultSelectedNode.id)
this.handleNodeClick(defaultSelectedNode)
let targetNode = null
//
console.log('this.nodeToSelect', this.nodeToSelect)
if (this.nodeToSelect) {
console.log('this.nodeToSelect.isType', this.nodeToSelect.isType)
switch (this.nodeToSelect.isType) {
case 4: //
targetNode = this.findNodeByDocumentIdAndDictionaryName(
this.crud.data,
this.nodeToSelect.documentId,
this.nodeToSelect.dictionaryName,
this.nodeToSelect.id //
)
break
case 3: //
targetNode = this.findNodeByDictionaryIdAndDocumentId(
this.crud.data,
this.nodeToSelect.dictionaryId,
this.nodeToSelect.documentId
)
break
case 2: //
targetNode = this.findNodeById(
this.crud.data,
this.nodeToSelect.id
)
break
case 1: // -
targetNode = this.findFirstIsType2Node(this.crud.data)
break
}
}
console.log('targetNode', targetNode)
//
if (!targetNode) {
targetNode = this.findFirstIsType2Node(this.crud.data)
} }
//
if (targetNode) {
this.$refs.tree.setCurrentKey(targetNode.id)
this.handleNodeClick(targetNode)
}
//
this.nodeToSelect = null
}) })
}, },
//
findNodeById(nodes, id) {
if (!nodes || nodes.length === 0) return null
for (const node of nodes) {
if (node.id === id) return node
if (node.children && node.children.length > 0) {
const found = this.findNodeById(node.children, id)
if (found) return found
}
}
return null
},
findNodeByDictionaryIdAndDocumentId(nodes, dictionaryId, documentId) {
if (!nodes || nodes.length === 0) return null
for (const node of nodes) {
//
if (node.isType === 3 &&
node.dictionaryId === dictionaryId &&
node.documentId === documentId) {
return node
}
//
if (node.children && node.children.length > 0) {
const found = this.findNodeByDictionaryIdAndDocumentId(
node.children,
dictionaryId,
documentId
)
if (found) return found
}
}
return null
},
findNodeByDocumentIdAndDictionaryName(nodes, documentId, dictionaryName, year) {
if (!nodes || nodes.length === 0) return null
for (const node of nodes) {
// isType=3
if (node.isType === 3 &&
node.documentId === documentId &&
node.label === dictionaryName) { // 使 label
// isType=4
if (node.children && node.children.length > 0) {
return node.children.find(child => child.isType === 4 && child.id === year)
}
}
//
if (node.children && node.children.length > 0) {
const found = this.findNodeByDocumentIdAndDictionaryName(
node.children,
documentId,
dictionaryName,
year
)
if (found) return found
}
}
return null
},
findFirstIsType2Node(nodes) { findFirstIsType2Node(nodes) {
if (!nodes || nodes.length === 0) return null if (!nodes || nodes.length === 0) return null
@ -137,6 +274,7 @@ export default {
handleNodeClick(val) { handleNodeClick(val) {
console.log('val', val) console.log('val', val)
if (val) { if (val) {
this.currentTreeVal = val
this.$emit('nodeClick', val) this.$emit('nodeClick', val)
} }
} }

12
src/views/archivesMIOD/miodSearch/index.vue

@ -41,12 +41,12 @@
<div v-else class="advanced-search"> <div v-else class="advanced-search">
<div class="advanced-search-main"> <div class="advanced-search-main">
<el-form ref="form" inline :model="form" :rules="rules" size="small" label-width="70px"> <el-form ref="form" inline :model="form" :rules="rules" size="small" label-width="70px">
<el-form-item label="字段名" prop="field">
<el-form-item label="字段名" prop="field" style="margin-right: 20px !important;">
<el-select v-model="form.field" value-key="id"> <el-select v-model="form.field" value-key="id">
<el-option v-for="item in fieldOptions" :key="item.id" :label="item.label" :value="item" /> <el-option v-for="item in fieldOptions" :key="item.id" :label="item.label" :value="item" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="运算符" prop="symbol">
<el-form-item label="运算符" prop="symbol" style="margin-right: 20px !important;">
<el-select v-model="form.symbol" value-key="value" placeholder="请选择"> <el-select v-model="form.symbol" value-key="value" placeholder="请选择">
<el-option <el-option
v-for="item in symbolOptions" v-for="item in symbolOptions"
@ -56,7 +56,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="检索值" prop="keyWord" :rules="getKeywordRules">
<el-form-item label="检索值" prop="keyWord" :rules="getKeywordRules" style="margin-right: 20px !important;">
<el-input v-model="form.keyWord" :type="inputType" /> <el-input v-model="form.keyWord" :type="inputType" />
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -101,8 +101,7 @@
</template> </template>
<script > <script >
import { FetchFindGroupType } from '@/api/system/field'
import { FetchSearchHistory } from '@/api/archiveUtilize/archiveUtilize'
import { FetchSearchHistory, FetchFindGroupType } from '@/api/system/documentArchives'
import ResultList from './module/resultList' import ResultList from './module/resultList'
export default { export default {
name: 'MiodSearch', name: 'MiodSearch',
@ -209,6 +208,9 @@ export default {
methods: { methods: {
resetQuery() { resetQuery() {
this.$refs.form.resetFields() this.$refs.form.resetFields()
this.form.field = null
this.form.symbol = null
this.form.keyWord = null
}, },
addConditionData() { addConditionData() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {

268
src/views/archivesMIOD/miodSearch/module/resultList.vue

@ -15,7 +15,7 @@
show-checkbox show-checkbox
default-expand-all default-expand-all
node-key="id" node-key="id"
:props="{children: 'children', label: 'fondsName'}"
:props="{children: 'childDictionarys', label: 'dictionaryName'}"
:filter-node-method="filterFondsNode" :filter-node-method="filterFondsNode"
@check-change="getFondsCheckedKeys" @check-change="getFondsCheckedKeys"
/> />
@ -38,43 +38,6 @@
@check-change="getCategoryCheckedKeys" @check-change="getCategoryCheckedKeys"
/> />
</el-collapse-item> </el-collapse-item>
<!-- <el-collapse-item title="档案分类" name="3">
<el-input
v-model="filterClassifyText"
class="quick-search"
placeholder="快速检索"
suffix-icon="el-icon-search"
/>
<el-tree
ref="treeClassify"
v-loading="classifyLoading"
:data="classifyOptions"
show-checkbox
default-expand-all
node-key="id"
:props="{children: 'children', label: 'name'}"
:filter-node-method="filterClassifyNode"
@check-change="getClassifyCheckedKeys"
/>
</el-collapse-item>
<el-collapse-item title="档案层级" name="4">
<el-input
v-model="filterLevelText"
class="quick-search"
placeholder="快速检索"
suffix-icon="el-icon-search"
/>
<el-tree
ref="treeLevel"
:data="levelOptions"
show-checkbox
default-expand-all
node-key="value"
:props="{children: 'children', label: 'label'}"
:filter-node-method="filterLevelNode"
@check-change="getLevelCheckedKeys"
/>
</el-collapse-item> -->
</el-collapse> </el-collapse>
</div> </div>
<div class="result-right"> <div class="result-right">
@ -109,26 +72,28 @@
<div v-if="resultData.length !== 0" class="result-list"> <div v-if="resultData.length !== 0" class="result-list">
<el-row v-for="(item,index) in resultData" :key="index" class="result-item" @dblclick.native="handleDetail(item)"> <el-row v-for="(item,index) in resultData" :key="index" class="result-item" @dblclick.native="handleDetail(item)">
<div class="result-item-title"><span>{{ getFileType(item.categoryLevel) }}</span><p>{{ item.maintitle }}</p></div> <div class="result-item-title"><span>{{ getFileType(item.categoryLevel) }}</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)" /> -->
<div class="result-item-info"> <div class="result-item-info">
<p>档号{{ item.archiveNo }}</p>
<p>全宗{{ item.fondsName }}</p>
<p>档案门类{{ item.categoryName }}</p>
<p>档案分类{{ item.archivesClassName }}</p>
<p>所属文件{{ item.doc_department }}</p>
<p>收文号{{ item.reg_no }}</p>
<p>来文字号{{ item.doc_no }}</p>
</div> </div>
<div class="item-top-tag"> <div class="item-top-tag">
<span v-if="item.isEntity === 1">实体</span>
<span v-if="item.tid !== null">标签</span>
<span v-if="item.caseNo !== null">装盒</span>
<span v-if="item.folderLocation !== '' && item.folderLocation !== null">入库</span>
<span v-if="item.isBorrow">借阅</span>
<span v-if="item.processStatus > 1" style="color: #ff8329;border-color: #febd98;background-color: #fff3e5;">审批锁定</span>
<span v-else style="color: #a6adb6;border: 1px solid #e6e8ed;background-color: #f3f5f9;">空闲</span>
<span v-if="item.isEntity && item.isEntity === 1">实体</span>
<span v-if="item.tid && item.tid !== null">标签</span>
<span v-if="item.caseNo && item.caseNo !== null">装盒</span>
<span v-if="item.folderLocation && item.folderLocation !== '' && item.folderLocation !== null">入库</span>
<span v-if="item.isBorrow && item.isBorrow">借阅</span>
<span v-if="item.read_type && item.read_type === '未传阅'" style="color: #a6adb6;border: 1px solid #e6e8ed;background-color: #f3f5f9;">{{ item.read_type }}</span>
<span v-if="item.read_type && item.read_type === '传阅中'" style="color: #FF8329;border: 1px solid #FEBD98;background-color: #FFF3E5;">{{ item.read_type }}</span>
<span v-if="item.read_type && item.read_type === '已完成'" style="color: #2ECAAC;border: 1px solid #B1EBDF;background-color: #E8F8F5;">{{ item.read_type }}</span>
<!-- <span v-if="item.processStatus > 1" style="color: #ff8329;border-color: #febd98;background-color: #fff3e5;">审批锁定</span>
<span v-else style="color: #a6adb6;border: 1px solid #e6e8ed;background-color: #f3f5f9;">空闲</span> -->
</div> </div>
<div class="item-bottom-handle"> <div class="item-bottom-handle">
<span @click.stop="handleDetail(item)">查看详情</span> <span @click.stop="handleDetail(item)">查看详情</span>
<i v-if="item.categoryLevel === 3" class="iconfont icon-liuchengfaqi" @click.stop="initiateLending(item)" />
<i v-if="item.categoryLevel === 3" class="iconfont icon-jiarujieyueche" @click.stop="addLending(item)" />
<!-- <i v-if="item.categoryLevel === 3" class="iconfont icon-liuchengfaqi" @click.stop="initiateLending(item)" />
<i v-if="item.categoryLevel === 3" class="iconfont icon-jiarujieyueche" @click.stop="addLending(item)" /> -->
</div> </div>
</el-row> </el-row>
</div> </div>
@ -147,23 +112,26 @@
</div> </div>
</div> </div>
<!-- 档案详情 --> <!-- 档案详情 -->
<ArchivesInfo ref="archivesInfo" :category-id="categoryId" :arc-id="arcId" :is-title-type="isTitleType" />
<LendForm ref="lendFormRef" />
<detail ref="archivesInfo" />
<!-- <LendForm ref="lendFormRef" /> -->
</div> </div>
</template> </template>
<script > <script >
import { crud } from '@crud/crud'
import { FetchInitSearchFonds, FetchInitSearchCategory, FetchInitSearchArchiveCtgNo, FetchResearch, FetchSeniorSearch } from '@/api/archiveUtilize/archiveUtilize'
// import { crud } from '@crud/crud'
// FetchResearch
import { FetchDictionaryTree } from '@/api/system/dict'
import { FetchInitSearchCategory } from '@/api/archiveUtilize/archiveUtilize'
import { FetchDocumentArchivesSearch, FetchSeniorSearch } from '@/api/system/documentArchives'
import { FetchAddBorrowCar } from '@/api/archiveUtilize/cart' import { FetchAddBorrowCar } from '@/api/archiveUtilize/cart'
import ArchivesInfo from '@/views/components/archivesDetail/detail'
import LendForm from './utilizationProcess'
import detail from '../../miodLibrary/module/detail'
// import LendForm from './utilizationProcess'
import store from '@/store' import store from '@/store'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
name: 'ResultList', name: 'ResultList',
components: { ArchivesInfo, LendForm },
mixins: [crud()],
components: { detail },
// mixins: [crud()],
props: { props: {
isCommon: { isCommon: {
type: Boolean, type: Boolean,
@ -199,45 +167,6 @@ export default {
], ],
filterClassifyText: '', filterClassifyText: '',
classifyOptions: [], classifyOptions: [],
// statusOptions: [
// {
// label: '',
// value: ''
// },
// {
// label: '',
// value: ''
// },
// {
// label: '',
// value: ''
// },
// {
// label: '',
// value: ''
// },
// {
// label: '',
// value: ''
// },
// {
// label: '',
// value: ''
// },
// {
// label: '',
// value: ''
// },
// {
// label: '',
// value: ''
// },
// {
// label: '',
// value: ''
// }
// ],
// status: null,
searchkeywords: '', searchkeywords: '',
keywords: '', keywords: '',
categoryId: null, categoryId: null,
@ -270,18 +199,11 @@ export default {
}, },
filterCategoryText(val) { filterCategoryText(val) {
this.$refs.treeCategory.filter(val) this.$refs.treeCategory.filter(val)
},
filterLevelText(val) {
this.$refs.treeLevel.filter(val)
},
filterClassifyText(val) {
this.$refs.treeClassify.filter(val)
} }
}, },
mounted() { mounted() {
this.getFondsDatas()
this.getCategoryDataTree()
this.getArchiveCtgNo(null)
// this.getDictsList()
// this.getCategoryDataTree()
if (localStorage.getItem('searchKeywords')) { if (localStorage.getItem('searchKeywords')) {
this.searchkeywords = localStorage.getItem('searchKeywords') this.searchkeywords = localStorage.getItem('searchKeywords')
this.keywords = localStorage.getItem('searchKeywords') this.keywords = localStorage.getItem('searchKeywords')
@ -298,7 +220,7 @@ export default {
} else if (categoryLevel === 4) { } else if (categoryLevel === 4) {
return '电子原文' return '电子原文'
} }
return ''
return '公文'
}, },
highlightKeywords(text) { highlightKeywords(text) {
if (!text) { if (!text) {
@ -319,6 +241,27 @@ export default {
return highlightedText return highlightedText
} }
}, },
//
formatFondsData(data) {
return data.map((item, index) => {
return {
id: index + 1,
dictionaryName: item,
childDictionarys: []
}
})
},
//
formatCategoryData(data) {
return data.map((item, index) => {
return {
id: index + 1,
cnName: item,
children: []
}
})
},
handledResultSearch(type) { handledResultSearch(type) {
if (this.searchkeywords) { if (this.searchkeywords) {
if (type === 'search') { if (type === 'search') {
@ -331,17 +274,21 @@ export default {
this.keywords = this.searchkeywords this.keywords = this.searchkeywords
const params = { const params = {
'keywords': this.searchkeywords, 'keywords': this.searchkeywords,
'archiveCtgNos': this.classifysKeys, //
'categoryIds': this.categoryKeys, //
'categoryLevel': this.levelsKeys, //
'fondsNos': this.fondsKeys, //
// 'archiveCtgNos': this.classifysKeys, //
// 'categoryIds': this.categoryKeys, //
// 'categoryLevel': this.levelsKeys, //
// 'fondsNos': this.fondsKeys, //
'archiveYear': this.categoryKeys,
'docDepartment': this.fondsKeys,
'searchFondsId': this.user.fonds.id, 'searchFondsId': this.user.fonds.id,
'page': this.page.page - 1, 'page': this.page.page - 1,
'size': this.page.size 'size': this.page.size
} }
FetchResearch(params).then((res) => {
this.resultData = res.content
this.page.total = res.totalElements
FetchDocumentArchivesSearch(params).then((res) => {
this.resultData = res.list.content
this.page.total = res.list.totalElements
this.fondsOptions = this.formatFondsData(res.docGroup)
this.categoryOptions = this.formatCategoryData(res.yearGroup)
setTimeout(() => { setTimeout(() => {
this.resultLoading = false this.resultLoading = false
}, 600) }, 600)
@ -358,24 +305,28 @@ export default {
this.resultLoading = true this.resultLoading = true
const params = { const params = {
'condition': this.condition, 'condition': this.condition,
'archiveCtgNos': this.classifysKeys, //
'categoryIds': this.categoryKeys, //
'categoryLevel': this.levelsKeys, //
'fondsNos': this.fondsKeys, //
// 'archiveCtgNos': this.classifysKeys, //
// 'categoryIds': this.categoryKeys, //
// 'categoryLevel': this.levelsKeys, //
// 'fondsNos': this.fondsKeys, //
'page': this.page.page - 1, 'page': this.page.page - 1,
'size': this.page.size 'size': this.page.size
} }
FetchSeniorSearch(params).then(res => { FetchSeniorSearch(params).then(res => {
this.resultData = res.content
this.page.total = res.totalElements
this.resultData = res.list.content
this.page.total = res.list.totalElements
setTimeout(() => { setTimeout(() => {
this.resultLoading = false this.resultLoading = false
}, 600) }, 600)
}) })
}, },
getFondsDatas() {
FetchInitSearchFonds().then(res => {
this.fondsOptions = res
getDictsList() {
FetchDictionaryTree().then((res) => {
const filterCodes = ['doc_department']
const filteredItems = JSON.parse(JSON.stringify(res)).filter(item => filterCodes.includes(item.dictionaryCode))
this.fondsOptions = filteredItems[0].childDictionarys
}).catch(err => {
console.log(err)
}) })
}, },
getCategoryDataTree() { getCategoryDataTree() {
@ -383,43 +334,23 @@ export default {
this.categoryOptions = res this.categoryOptions = res
}) })
}, },
getArchiveCtgNo(categoryIds) {
this.classifyOptions = []
this.classifyLoading = true
const params = {
'categoryIds': categoryIds,
'search': null
}
FetchInitSearchArchiveCtgNo(params).then(res => {
this.classifyOptions = res
this.classifyLoading = false
})
},
handleChange(val) { handleChange(val) {
console.log(val) console.log(val)
}, },
filterFondsNode(value, data) { filterFondsNode(value, data) {
if (!value) return true if (!value) return true
return data.fondsName.indexOf(value) !== -1
return data.dictionaryName.indexOf(value) !== -1
}, },
filterCategoryNode(value, data) { filterCategoryNode(value, data) {
if (!value) return true if (!value) return true
return data.cnName.indexOf(value) !== -1 return data.cnName.indexOf(value) !== -1
}, },
filterLevelNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
filterClassifyNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
getFondsCheckedKeys() { getFondsCheckedKeys() {
const checkedKeys = this.$refs.tree.getCheckedNodes() const checkedKeys = this.$refs.tree.getCheckedNodes()
if (checkedKeys.length === 0) { if (checkedKeys.length === 0) {
this.fondsKeys = null this.fondsKeys = null
} else { } else {
this.fondsKeys = checkedKeys.map(item => item.fondsId)
this.fondsKeys = checkedKeys.map(item => item.dictionaryName)
} }
if (this.isCommon) { if (this.isCommon) {
this.handledResultSearch('search') this.handledResultSearch('search')
@ -434,7 +365,6 @@ export default {
} else { } else {
this.categoryKeys = checkedKeys.map(item => item.id) this.categoryKeys = checkedKeys.map(item => item.id)
} }
this.getArchiveCtgNo(this.categoryKeys)
if (this.isCommon) { if (this.isCommon) {
this.handledResultSearch('search') this.handledResultSearch('search')
} else { } else {
@ -454,52 +384,16 @@ export default {
}) })
} }
}, },
getClassifyCheckedKeys() {
const checkedKeys = this.$refs.treeClassify.getCheckedNodes()
if (checkedKeys.length === 0) {
this.classifysKeys = null
} else {
this.classifysKeys = checkedKeys.map(item => item.code)
}
if (this.isCommon) {
this.handledResultSearch('search')
} else {
this.getSeniorSearch()
}
},
getLevelCheckedKeys() {
const checkedKeys = this.$refs.treeLevel.getCheckedNodes()
if (checkedKeys.length === 0) {
this.levelsKeys = null
} else {
this.levelsKeys = checkedKeys.map(item => item.value)
}
if (this.isCommon) {
this.handledResultSearch('search')
} else {
this.getSeniorSearch()
}
},
returnAdvanced() { returnAdvanced() {
this.$emit('close-result') this.$emit('close-result')
}, },
handleDetail(row) { handleDetail(row) {
this.categoryId = row.categoryPid
this.arcId = row.archivesId
console.log('this.$refs.archivesInfo', this.$refs.archivesInfo)
this.$nextTick(() => { this.$nextTick(() => {
console.log('this.$refs.archivesInfo', this.$refs.archivesInfo)
this.$refs.archivesInfo.archivesInfoVisible = true this.$refs.archivesInfo.archivesInfoVisible = true
this.$refs.archivesInfo.archivesTabIndex = 0 this.$refs.archivesInfo.archivesTabIndex = 0
this.$refs.archivesInfo.isFourTest = true
if (row.categoryLevel === 2) {
this.$refs.archivesInfo.isHasFile = false
this.$refs.archivesInfo.detailTitle = '案卷详情'
this.$refs.archivesInfo.getDetial(2, row.archivesId)
} else {
this.$refs.archivesInfo.isHasFile = true
this.$refs.archivesInfo.detailTitle = '文件详情'
this.$refs.archivesInfo.getDetial(3, row.archivesId)
}
this.$refs.archivesInfo.parentInfo = row
this.$refs.archivesInfo.getDetial(row, 'search')
}) })
}, },
initiateLending(item) { initiateLending(item) {

8
src/views/components/category/PreviewForm.vue

@ -513,13 +513,13 @@ export default {
// return row.level ? row.level === 3 : true // return row.level ? row.level === 3 : true
// }, // },
normalizer(node) { normalizer(node) {
if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null) {
if ((node.childDictionarys && !node.childDictionarys.length) || node.childDictionarys === null || node.childDictionarys === undefined) {
delete node.childDictionarys delete node.childDictionarys
} }
return { return {
id: node.dictionaryName || null,
label: node.dictionaryName || '',
children: node.childDictionarys || [],
id: node.dictionaryName,
label: node.dictionaryName,
children: node.childDictionarys,
isDisabled: node.level && node.level !== 3 isDisabled: node.level && node.level !== 3
} }
}, },

Loading…
Cancel
Save