Browse Source

配置外部api修改入口/搜索

master
xuhuajiao 12 months ago
parent
commit
44a9317faa
  1. 4
      .env.production
  2. 1
      package.json
  3. 2
      public/index.html
  4. 10
      src/api/archiveUtilize/archiveUtilize.js
  5. 10
      src/utils/request.js
  6. 28
      src/views/archiveUtilize/archiveSearch/index.vue
  7. 209
      src/views/archiveUtilize/archiveSearch/module/resultList.vue
  8. 9
      src/views/archivesManage/managementLibrary/index.vue
  9. 20
      src/views/collectReorganizi/collectionLibrary/index.vue
  10. 11
      src/views/components/archivesDetail/detail.vue
  11. 21
      vue.config.js

4
.env.production

@ -5,7 +5,7 @@ ENV = 'production'
# 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'
VUE_APP_BASE_API = 'http://27.16.212.58:11100'
# 如果接口是 http 形式, wss 需要改为 ws # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws://27.16.219.156:11101'
VUE_APP_WS_API = 'ws://27.16.212.58:11100'
VUE_APP_CAMERA_API = '192.168.99.107:3000' VUE_APP_CAMERA_API = '192.168.99.107:3000'

1
package.json

@ -94,6 +94,7 @@
"connect": "3.6.6", "connect": "3.6.6",
"eslint": "5.15.3", "eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2", "eslint-plugin-vue": "5.2.2",
"generate-asset-webpack-plugin": "^0.3.0",
"http-proxy-middleware": "^0.19.1", "http-proxy-middleware": "^0.19.1",
"husky": "1.3.1", "husky": "1.3.1",
"lint-staged": "8.1.5", "lint-staged": "8.1.5",

2
public/index.html

@ -7,9 +7,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.svg" type="image/svg+xml"> <link rel="icon" href="<%= BASE_URL %>favicon.svg" type="image/svg+xml">
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
<!-- <script type="text/javascript" src="/static/config.js"></script> -->
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
</body> </body>
</html> </html>

10
src/api/archiveUtilize/archiveUtilize.js

@ -41,4 +41,12 @@ export function FetchSearchHistory(params) {
}) })
} }
export default { FetchInitSearchFonds, FetchInitSearchCategory, FetchInitSearchArchiveCtgNo, FetchResearch, FetchSearchHistory }
// 档案高级检索
export function FetchSeniorSearch(params) {
return request({
url: 'api/archivesUtilize/seniorSearch' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default { FetchInitSearchFonds, FetchInitSearchCategory, FetchInitSearchArchiveCtgNo, FetchResearch, FetchSearchHistory, FetchSeniorSearch }

10
src/utils/request.js

@ -8,10 +8,16 @@ import Config from '@/settings'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import { reject } from 'core-js/fn/promise' import { reject } from 'core-js/fn/promise'
const setAxiosBaseUrl = async() => {
const res = await axios.get('server-config.json')
const { BASE_URL } = res.data
service.defaults.baseURL = BASE_URL || ''// 这里的service为自己二次封装的请求,根据项目实际情况修改
}
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
baseURL: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_API : '/', // api 的 base_url
// baseURL: process.env.NODE_ENV === 'production' ? 'http://192.168.99.84:7070' : '/', // api 的 base_url
baseURL: process.env.NODE_ENV === 'production' ? setAxiosBaseUrl() : '/', // api 的 base_url
// baseURL: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_API : '/', // api 的 base_url
timeout: Config.timeout // 请求超时时间 timeout: Config.timeout // 请求超时时间
}) })

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

@ -96,7 +96,7 @@
</div> </div>
</div> </div>
</div> </div>
<ResultList v-else ref="resultListRef" :is-common="isCommon" @close-result="closeResult" />
<ResultList v-else ref="resultListRef" :is-common="isCommon" @close-result="closeResult" @common-search="commonSearch" />
</div> </div>
</template> </template>
@ -125,7 +125,7 @@ export default {
}, },
{ {
label: '不包含', label: '不包含',
value: 'not like'
value: 'not like'
}, },
{ {
label: '等于', label: '等于',
@ -137,11 +137,11 @@ export default {
}, },
{ {
label: '为空', label: '为空',
value: 'is null'
value: 'is null'
}, },
{ {
label: '不为空', label: '不为空',
value: 'is not null'
value: 'is not null'
}, },
{ {
label: '大于', label: '大于',
@ -172,7 +172,12 @@ export default {
currentIndex: null, currentIndex: null,
connectorList: ['并且', '或者', '(', ')'], connectorList: ['并且', '或者', '(', ')'],
historyKeyword: null, historyKeyword: null,
tagIndex: 0
tagIndex: 0,
page: {
page: 1,
size: 10,
total: 0
}
} }
}, },
computed: { computed: {
@ -358,7 +363,13 @@ export default {
} }
}).join(' ') }).join(' ')
console.log('wheresql', wheresql) console.log('wheresql', wheresql)
this.isResult = true
if (wheresql) {
this.isResult = true
this.$nextTick(() => {
this.$refs.resultListRef.condition = wheresql
this.$refs.resultListRef.getSeniorSearch(wheresql)
})
}
} else { } else {
this.$message({ message: '条件之间缺少或且连接符', type: 'error', offset: 8 }) this.$message({ message: '条件之间缺少或且连接符', type: 'error', offset: 8 })
return false return false
@ -389,10 +400,13 @@ export default {
this.tagIndex = index this.tagIndex = index
}, },
getSearchHistory() { getSearchHistory() {
FetchSearchHistory({ pagesize: 10 }).then(res => {
FetchSearchHistory({ pagesize: 50 }).then(res => {
this.historyKeyword = res this.historyKeyword = res
}) })
}, },
commonSearch() {
this.isCommon = true
},
closeResult() { closeResult() {
this.isResult = false this.isResult = false
this.isCommon = false this.isCommon = false

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

@ -45,9 +45,9 @@
placeholder="快速检索" placeholder="快速检索"
suffix-icon="el-icon-search" suffix-icon="el-icon-search"
/> />
<div class="propListHeader">
<!-- <div class="propListHeader">
<el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="checkAllChange">全部选择</el-checkbox> <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="checkAllChange">全部选择</el-checkbox>
</div>
</div> -->
<el-tree <el-tree
ref="treeClassify" ref="treeClassify"
v-loading="classifyLoading" v-loading="classifyLoading"
@ -97,61 +97,63 @@
/> />
</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="searchkeywords" placeholder="请输入检索关键字" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="handledResultSearch">搜索</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 v-if="tipShow" class="search-tip">
<div 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 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 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>档号{{ item.archiveNo }}</p>
<p>全宗{{ item.fondsName }}</p>
<p>档案门类{{ item.categoryName }}</p>
<p>档案分类{{ item.archivesClassName }}</p>
</div>
<div class="item-top-tag">
<span>实体</span>
<span>标签</span>
<span>装盒</span>
<span>入库</span>
<span>借阅</span>
</div>
<div class="item-bottom-handle">
<span @click.stop="handleDetail">查看详情</span>
<i class="iconfont icon-liuchengfaqi" @click.stop="initiateLending" />
<i class="iconfont icon-jiarujieyueche" @click.stop="addLending" />
<div v-loading="resultLoading">
<div v-if="resultData.length !== 0" class="result-list">
<div v-for="(item,index) in resultData" :key="index" class="result-item" @dblclick="handleDetail(item)">
<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)" />
<div class="result-item-info">
<p>档号{{ item.archiveNo }}</p>
<p>全宗{{ item.fondsName }}</p>
<p>档案门类{{ item.categoryName }}</p>
<p>档案分类{{ item.archivesClassName }}</p>
</div>
<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 !== ''">入库</span>
<span v-if="item.isBorrow">借阅</span>
</div>
<div class="item-bottom-handle">
<span @click.stop="handleDetail(item)">查看详情</span>
<i class="iconfont icon-liuchengfaqi" @click.stop="initiateLending" />
<i class="iconfont icon-jiarujieyueche" @click.stop="addLending" />
</div>
</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"
/>
<el-empty v-else description="暂无更多数据" />
</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" :category-id="categoryId" :arc-id="arcId" />
</div> </div>
</template> </template>
<script > <script >
import { FetchInitSearchFonds, FetchInitSearchCategory, FetchInitSearchArchiveCtgNo, FetchResearch } from '@/api/archiveUtilize/archiveUtilize'
import { FetchInitSearchFonds, FetchInitSearchCategory, FetchInitSearchArchiveCtgNo, FetchResearch, FetchSeniorSearch } 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 {
@ -230,12 +232,10 @@ export default {
} }
], ],
status: null, status: null,
searchkeywords: '',
keywords: '', keywords: '',
selectedCategory: {
id: 'DAAC5ED3F86D6481C3C1A5',
arrangeType: 3
},
arcId: 'E7DBAF69F1691B063A3129',
categoryId: null,
arcId: '',
page: { page: {
page: 1, page: 1,
size: 10, size: 10,
@ -250,13 +250,14 @@ export default {
resultData: [], resultData: [],
classifyLoading: false, classifyLoading: false,
resultLoading: false, resultLoading: false,
tipShow: false
condition: ''
} }
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
'user' 'user'
]) ])
}, },
watch: { watch: {
filterFondsText(val) { filterFondsText(val) {
@ -278,10 +279,23 @@ export default {
this.getArchiveCtgNo(null) this.getArchiveCtgNo(null)
console.log(localStorage.getItem('searchKeywords')) console.log(localStorage.getItem('searchKeywords'))
if (localStorage.getItem('searchKeywords')) { if (localStorage.getItem('searchKeywords')) {
this.searchkeywords = localStorage.getItem('searchKeywords')
this.keywords = localStorage.getItem('searchKeywords') this.keywords = localStorage.getItem('searchKeywords')
} }
}, },
methods: { methods: {
getFileType(categoryLevel) {
if (categoryLevel === 1) {
return '项目'
} else if (categoryLevel === 2) {
return '案卷'
} else if (categoryLevel === 3) {
return '文件'
} else if (categoryLevel === 4) {
return '电子原文'
}
return ''
},
highlightKeywords(text) { highlightKeywords(text) {
if (!text) { if (!text) {
return false return false
@ -302,11 +316,13 @@ export default {
} }
}, },
handledResultSearch() { handledResultSearch() {
if (this.keywords) {
if (this.searchkeywords) {
this.$emit('common-search')
this.resultData = []
this.resultLoading = true this.resultLoading = true
this.tipShow = true
this.keywords = this.searchkeywords
const params = { const params = {
'keywords': this.keywords,
'keywords': this.searchkeywords,
'archiveCtgNos': this.classifysKeys, // 'archiveCtgNos': this.classifysKeys, //
'categoryIds': this.categoryKeys, // 'categoryIds': this.categoryKeys, //
'categoryLevel': this.levelsKeys, // 'categoryLevel': this.levelsKeys, //
@ -327,10 +343,31 @@ export default {
console.log(err) console.log(err)
}) })
} else { } else {
this.tipShow = false
this.$message({ message: '请输入检索关键字段', type: 'error', offset: 8 }) this.$message({ message: '请输入检索关键字段', type: 'error', offset: 8 })
} }
}, },
getSeniorSearch() {
this.searchkeywords = ''
this.resultData = []
this.resultLoading = true
const params = {
'condition': this.condition,
'archiveCtgNos': this.classifysKeys, //
'categoryIds': this.categoryKeys, //
'categoryLevel': this.levelsKeys, //
'fondsNos': this.fondsKeys, //
'page': this.page.page - 1,
'size': this.page.size
}
console.log(params)
FetchSeniorSearch(params).then(res => {
this.resultData = res.content
this.page.total = res.totalElements
setTimeout(() => {
this.resultLoading = false
}, 600)
})
},
getFondsDatas() { getFondsDatas() {
FetchInitSearchFonds().then(res => { FetchInitSearchFonds().then(res => {
this.fondsOptions = res this.fondsOptions = res
@ -376,9 +413,7 @@ export default {
} }
FetchInitSearchArchiveCtgNo(params).then(res => { FetchInitSearchArchiveCtgNo(params).then(res => {
this.classifyOptions = res this.classifyOptions = res
setTimeout(() => {
this.classifyLoading = false
}, 600)
this.classifyLoading = false
}) })
}, },
handleChange(val) { handleChange(val) {
@ -408,6 +443,11 @@ export default {
this.fondsKeys = checkedKeys.map(item => item.fondsId) this.fondsKeys = checkedKeys.map(item => item.fondsId)
} }
console.log('fondsKeys', this.fondsKeys) console.log('fondsKeys', this.fondsKeys)
if (this.isCommon) {
this.handledResultSearch()
} else {
this.getSeniorSearch()
}
}, },
getCategoryCheckedKeys() { getCategoryCheckedKeys() {
const checkedKeys = this.$refs.treeCategory.getCheckedNodes() const checkedKeys = this.$refs.treeCategory.getCheckedNodes()
@ -417,6 +457,12 @@ export default {
this.categoryKeys = checkedKeys.map(item => item.id) this.categoryKeys = checkedKeys.map(item => item.id)
} }
this.getArchiveCtgNo(this.categoryKeys) this.getArchiveCtgNo(this.categoryKeys)
console.log(this.isCommon)
if (this.isCommon) {
this.handledResultSearch()
} else {
this.getSeniorSearch()
}
console.log('categoryKeys', this.categoryKeys) console.log('categoryKeys', this.categoryKeys)
}, },
checkAllChange() { checkAllChange() {
@ -440,6 +486,11 @@ export default {
this.classifysKeys = checkedKeys.map(item => item.code) this.classifysKeys = checkedKeys.map(item => item.code)
} }
console.log('classifysKeys', this.classifysKeys) console.log('classifysKeys', this.classifysKeys)
if (this.isCommon) {
this.handledResultSearch()
} else {
this.getSeniorSearch()
}
}, },
getLevelCheckedKeys() { getLevelCheckedKeys() {
const checkedKeys = this.$refs.treeLevel.getCheckedNodes() const checkedKeys = this.$refs.treeLevel.getCheckedNodes()
@ -449,44 +500,31 @@ export default {
this.levelsKeys = checkedKeys.map(item => item.value) this.levelsKeys = checkedKeys.map(item => item.value)
} }
console.log('levelsKeys', this.levelsKeys) console.log('levelsKeys', this.levelsKeys)
if (this.isCommon) {
this.handledResultSearch()
} else {
this.getSeniorSearch()
}
}, },
returnAdvanced() { returnAdvanced() {
this.$emit('close-result') this.$emit('close-result')
}, },
handleDetail() {
// this.arcId = row.id
handleDetail(row) {
this.categoryId = row.categoryId
this.arcId = row.archivesId
this.$nextTick(() => { this.$nextTick(() => {
// if (this.selectedCategory.arrangeType !== 1) {
// this.$refs.archivesInfo.isHasFile = false
// if (this.activeIndex === 1) {
// this.$refs.archivesInfo.detailTitle = ''
// this.$refs.archivesInfo.isHasFile = true
// this.$refs.archivesInfo.getDetial(3, this.arcId)
// } else {
// this.$refs.archivesInfo.detailTitle = ''
// this.$refs.archivesInfo.getDetial(2, this.arcId)
// }
// if (row.categoryLevel !== 1) {
// this.$refs.archivesInfo.detailTitle = ''
// this.$refs.archivesInfo.getDetial(2, row.archivesId)
// } else { // } else {
// this.$refs.archivesInfo.isHasFile = true // this.$refs.archivesInfo.isHasFile = true
// this.$refs.archivesInfo.detailTitle = '' // this.$refs.archivesInfo.detailTitle = ''
// this.$refs.archivesInfo.getDetial(3, this.arcId)
// this.$refs.archivesInfo.getDetial(3, row.archivesId)
// } // }
// this.$nextTick(() => {
// this.$refs.archivesInfo.isHasFile = true
// this.$refs.archivesInfo.detailTitle = ''
// this.$refs.archivesInfo.archivesInfoVisible = true
// this.$refs.archivesInfo.archivesTabIndex = 0
// this.$refs.archivesInfo.getDetial(3, this.arcId)
// })
// this.$nextTick(() => {
// this.$refs.archivesInfo.detailTitle = ''
// this.$refs.archivesInfo.archivesInfoVisible = true
// this.$refs.archivesInfo.archivesTabIndex = 0
// this.$refs.archivesInfo.getDetial(1, this.arcId)
// })
this.$refs.archivesInfo.isHasFile = true
this.$refs.archivesInfo.detailTitle = '文件详情'
this.$refs.archivesInfo.getDetial(3, row.archivesId)
this.$refs.archivesInfo.isFourTest = true
this.$refs.archivesInfo.archivesInfoVisible = true this.$refs.archivesInfo.archivesInfoVisible = true
this.$refs.archivesInfo.archivesTabIndex = 0 this.$refs.archivesInfo.archivesTabIndex = 0
}) })
@ -517,9 +555,11 @@ export default {
handleSizeChange(size) { handleSizeChange(size) {
this.page.size = size this.page.size = size
this.page.page = 1 this.page.page = 1
this.handledResultSearch()
}, },
handleCurrentPage(val) { handleCurrentPage(val) {
this.page.page = val this.page.page = val
this.handledResultSearch()
} }
} }
} }
@ -651,9 +691,9 @@ export default {
} }
} }
.result-list{ .result-list{
margin: 20px 0;
margin: 20px 0 0 0;
padding: 0 20px; padding: 0 20px;
height: calc(100vh - 259px);
height: calc(100vh - 296px);
overflow: hidden; overflow: hidden;
overflow-y: scroll; overflow-y: scroll;
.result-item{ .result-item{
@ -741,6 +781,9 @@ export default {
} }
} }
} }
.el-pagination{
margin: 10px 16px 0 10px !important;
}
::v-deep .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{ ::v-deep .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
background-color: transparent !important; background-color: transparent !important;

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

@ -73,6 +73,7 @@
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 { manageLibraryCrud } from './mixins/index' import { manageLibraryCrud } from './mixins/index'
import { FetchInitSearchFonds } from '@/api/archiveUtilize/archiveUtilize'
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'
import Project from './project/index' import Project from './project/index'
@ -396,7 +397,13 @@ export default {
// if (isFondsTop) { // if (isFondsTop) {
// this.smartQuery.fonds_no = null // this.smartQuery.fonds_no = null
const fondsGroup = res.filter(item => item.fondsId).map(item => item.fondsNo) const fondsGroup = res.filter(item => item.fondsId).map(item => item.fondsNo)
this.smartQuery.fonds_no = fondsGroup.join(',')
if (fondsGroup.length === 0) {
FetchInitSearchFonds().then(res => {
this.smartQuery.fonds_no = res.map(item => item.fondsNo).join(',')
})
} else {
this.smartQuery.fonds_no = fondsGroup.join(',')
}
// } // }
const groupedData = {} const groupedData = {}

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

@ -71,7 +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 { 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'
@ -363,15 +363,14 @@ export default {
'categoryId': categoryId 'categoryId': categoryId
} }
FetchDictionaryTreeByCategoryId(params).then((res) => { FetchDictionaryTreeByCategoryId(params).then((res) => {
console.log(res)
let fonds let fonds
if (res.length <= 1) {
if (res.fonds.length <= 1) {
fonds = [] fonds = []
} else { } else {
const parent = {} const parent = {}
parent.id = 0 parent.id = 0
parent.fondsName = '全宗' parent.fondsName = '全宗'
parent.childDictionarys = res.map(item => {
parent.childDictionarys = res.fonds.map(item => {
return { return {
...item, ...item,
id: item.fondsId id: item.fondsId
@ -379,8 +378,7 @@ export default {
}) })
fonds = parent fonds = parent
} }
this.classifyTree = res.concat(fonds)
console.log(this.classifyTree)
this.classifyTree = res.dictionarys.concat(fonds)
this.classifyLoading = false this.classifyLoading = false
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
@ -400,10 +398,14 @@ 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(',')
if (fondsGroup.length === 0) {
FetchInitSearchFonds().then(res => {
this.smartQuery.fonds_no = res.map(item => item.fondsNo).join(',')
})
} else {
this.smartQuery.fonds_no = fondsGroup.join(',')
}
// } // }
const groupedData = {} const groupedData = {}

11
src/views/components/archivesDetail/detail.vue

@ -52,6 +52,12 @@ export default {
default: function() { default: function() {
return '' return ''
} }
},
categoryId: {
type: String,
default: function() {
return ''
}
} }
}, },
data() { data() {
@ -72,9 +78,8 @@ export default {
}, },
methods: { methods: {
getDetial(collectLevel, rowId) { getDetial(collectLevel, rowId) {
console.log(this.arcId)
const params = { const params = {
'categoryId': this.selectedCategory.id,
'categoryId': this.categoryId !== '' ? this.categoryId : this.selectedCategory.id,
'categoryLevel': collectLevel, 'categoryLevel': collectLevel,
'id': rowId 'id': rowId
} }
@ -91,7 +96,7 @@ export default {
})) }))
}) })
const metaDataParams = { const metaDataParams = {
'categoryId': this.selectedCategory.id,
'categoryId': this.categoryId !== '' ? this.categoryId : this.selectedCategory.id,
'categoryLevel': collectLevel, 'categoryLevel': collectLevel,
'archivesId': rowId 'archivesId': rowId
} }

21
vue.config.js

@ -8,6 +8,16 @@ function resolve(dir) {
const name = defaultSettings.title // 网址标题 const name = defaultSettings.title // 网址标题
const port = 8013 // 端口配置 const port = 8013 // 端口配置
// All configuration item explanations can be find in https://cli.vuejs.org/config/ // All configuration item explanations can be find in https://cli.vuejs.org/config/
const GenerateAssetPlugin = require('generate-asset-webpack-plugin')
const createServerConfig = compilation => {
const serverConfig = {
BASE_URL: '' // 打包后生成的文件内容,接口地址
}
return JSON.stringify(serverConfig)
}
module.exports = { module.exports = {
// hash 模式下可使用 // hash 模式下可使用
publicPath: process.env.NODE_ENV === 'development' ? '/' : './', publicPath: process.env.NODE_ENV === 'development' ? '/' : './',
@ -54,7 +64,16 @@ module.exports = {
maxEntrypointSize: 50000000, maxEntrypointSize: 50000000,
// 生成文件的最大体积 // 生成文件的最大体积
maxAssetSize: 30000000 maxAssetSize: 30000000
}
},
plugins: [
new GenerateAssetPlugin({
filename: 'server-config.json',
fn: (compilation, cb) => {
cb(null, createServerConfig(compilation))
},
extraFiles: []
})
]
}, },
chainWebpack(config) { chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test config.plugins.delete('preload') // TODO: need test

Loading…
Cancel
Save