Browse Source

收集库

master
xuhuajiao 1 year ago
parent
commit
49037e3b7d
  1. 11
      src/api/collect/collect.js
  2. 6
      src/assets/styles/archives-manage.scss
  3. 2
      src/utils/upload.js
  4. 1
      src/views/archivesManage/archivesList/index.vue
  5. 8
      src/views/collectReorganizi/collectionLibrary/anjuan/content.vue
  6. 10
      src/views/collectReorganizi/collectionLibrary/anjuan/index.vue
  7. 12
      src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue
  8. 19
      src/views/collectReorganizi/collectionLibrary/file/index.vue
  9. 146
      src/views/collectReorganizi/collectionLibrary/index.vue
  10. 12
      src/views/collectReorganizi/collectionLibrary/juannei/index.vue
  11. 114
      src/views/collectReorganizi/collectionLibrary/mixins/index.js
  12. 45
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  13. 138
      src/views/collectReorganizi/collectionLibrary/module/uploadOriginal/index.vue
  14. 10
      src/views/collectReorganizi/collectionLibrary/project/index.vue

11
src/api/collect/collect.js

@ -63,4 +63,13 @@ export function FetchRemoveArchivesSingle(data) {
}) })
} }
export default { collectAdd, collectEdit, collectDel, FetchInitCategoryViewTable, FetchInitCategoryView, FetchDetailsById, FetchRemoveArchivesSingle }
// 添加电子原文
export function FetchAddArchivesFile(data) {
return request({
url: 'api/collect/addArchivesFile',
method: 'post',
data
})
}
export default { collectAdd, collectEdit, collectDel, FetchInitCategoryViewTable, FetchInitCategoryView, FetchDetailsById, FetchRemoveArchivesSingle, FetchAddArchivesFile }

6
src/assets/styles/archives-manage.scss

@ -6,12 +6,18 @@
&:hover{ &:hover{
@include btn_blue_hover; @include btn_blue_hover;
} }
&:focus{
@include btn_blue_style;
}
} }
.filter-refresh{ .filter-refresh{
@include btn_white_style; @include btn_white_style;
&:hover{ &:hover{
@include btn_white_hover; @include btn_white_hover;
} }
&:focus{
@include btn_white_style;
}
} }
.head-archives{ .head-archives{

2
src/utils/upload.js

@ -21,7 +21,7 @@ export function archivesUpload(api, file, categoryId) {
return axios.post(api, data, config) return axios.post(api, data, config)
} }
// 档案上传附件
// 预归档档案上传附件
export function reDocumentUpload(api, file, documentId) { export function reDocumentUpload(api, file, documentId) {
var data = new FormData() var data = new FormData()
data.append('file', file) data.append('file', file)

1
src/views/archivesManage/archivesList/index.vue

@ -272,7 +272,6 @@ export default {
this.isHasProject = false this.isHasProject = false
} }
this.handleTableList() this.handleTableList()
// //
localStorage.setItem('currentArchivesKey', JSON.stringify(val)) localStorage.setItem('currentArchivesKey', JSON.stringify(val))
} }

8
src/views/collectReorganizi/collectionLibrary/anjuan/content.vue

@ -6,7 +6,7 @@
<!-- 最右侧装饰img --> <!-- 最右侧装饰img -->
<span class="tab-right-img" /> <span class="tab-right-img" />
</ul> </ul>
<TableListMoudle ref="tableList" :is-title-type="isTitleType" :selected-category="selectedCategory" :active-index="activeIndex" :test="test" :is-recycle="isRecycle" />
<TableListMoudle ref="tableList" :is-title-type="isTitleType" :selected-category="selectedCategory" :active-index="activeIndex" :test="test" :is-recycle="isRecycle" :smart-query="smartQuery" />
</div> </div>
</template> </template>
@ -29,6 +29,12 @@ export default {
isRecycle: { isRecycle: {
type: Boolean, type: Boolean,
default: false default: false
},
smartQuery: {
type: Object,
default: function() {
return {}
}
} }
}, },
data() { data() {

10
src/views/collectReorganizi/collectionLibrary/anjuan/index.vue

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<AnjuanContent v-if="selectedCategory.arrangeType === 1 || selectedCategory.arrangeType === 2" ref="ajContent" class="ajContent" :selected-category="selectedCategory" :is-recycle="isRecycle" />
<AnjuanContent v-if="selectedCategory.arrangeType === 1 || selectedCategory.arrangeType === 2" ref="ajContent" class="ajContent" :selected-category="selectedCategory" :is-recycle="isRecycle" :smart-query="smartQuery" />
<el-drawer <el-drawer
v-else v-else
class="anjuan-drawer" class="anjuan-drawer"
@ -12,7 +12,7 @@
direction="rtl" direction="rtl"
size="90%" size="90%"
> >
<AnjuanContent ref="ajContent" :selected-category="selectedCategory" :is-recycle="isRecycle" />
<AnjuanContent ref="ajContent" :selected-category="selectedCategory" :is-recycle="isRecycle" :smart-query="smartQuery" />
<span class="closed-btn" @click="closeDrawer" /> <span class="closed-btn" @click="closeDrawer" />
</el-drawer> </el-drawer>
</div> </div>
@ -37,6 +37,12 @@ export default {
isRecycle: { isRecycle: {
type: Boolean, type: Boolean,
default: false default: false
},
smartQuery: {
type: Object,
default: function() {
return {}
}
} }
}, },
data() { data() {

12
src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<CollectHeader :is-title-type="isTitleType" :selected-category="selectedCategory" :arc-id="arcId" :selections="selections" :active-index="activeIndex" :test="test" :is-recycle="isRecycle" />
<CollectHeader ref="collectHeaderRef" :is-title-type="isTitleType" :selected-category="selectedCategory" :arc-id="arcId" :selections="selections" :active-index="activeIndex" :test="test" :is-recycle="isRecycle" />
<div class="collect-table"> <div class="collect-table">
<el-table <el-table
ref="table" ref="table"
@ -88,6 +88,12 @@ export default {
isRecycle: { isRecycle: {
type: Boolean, type: Boolean,
default: false default: false
},
smartQuery: {
type: Object,
default: function() {
return {}
}
} }
}, },
inject: ['parentsData'], inject: ['parentsData'],
@ -139,8 +145,8 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
getCommonData(type, parentId) {
this.getViewTable(type, parentId)
getCommonData(categoryLevel, parentId, type) {
this.getViewTable(categoryLevel, parentId, type)
}, },
rowKey(row) { rowKey(row) {
return row.id return row.id

19
src/views/collectReorganizi/collectionLibrary/file/index.vue

@ -8,7 +8,7 @@
direction="rtl" direction="rtl"
:size="((selectedCategory.arrangeType === 2 && isAjNo === 0) || (selectedCategory.arrangeType === 3 && isAjNo === 1)) ? '80%' : (isAjNo === 1) ? '90%' : (selectedCategory.arrangeType === 1) ? '90%' : '70%'" :size="((selectedCategory.arrangeType === 2 && isAjNo === 0) || (selectedCategory.arrangeType === 3 && isAjNo === 1)) ? '80%' : (isAjNo === 1) ? '90%' : (selectedCategory.arrangeType === 1) ? '90%' : '70%'"
> >
<CollectHeader :is-title-type="isTitleType" :selected-category="selectedCategory" :selections="selections" :test="test" :is-recycle="isRecycle" />
<CollectHeader ref="collectHeaderRef" :is-title-type="isTitleType" :selected-category="selectedCategory" :selections="selections" :test="test" :is-recycle="isRecycle" />
<span class="closed-btn" @click="closeDrawer" /> <span class="closed-btn" @click="closeDrawer" />
<div class="collect-table"> <div class="collect-table">
<el-table <el-table
@ -72,6 +72,7 @@
import { collectionLibraryCrud } from '../mixins/index' import { collectionLibraryCrud } from '../mixins/index'
import { header, form } from '@crud/crud' import { header, form } from '@crud/crud'
import CollectHeader from '../module/collectHeader.vue' import CollectHeader from '../module/collectHeader.vue'
import { mapGetters } from 'vuex'
export default { export default {
name: 'File', name: 'File',
components: { CollectHeader }, components: { CollectHeader },
@ -90,11 +91,18 @@ export default {
isRecycle: { isRecycle: {
type: Boolean, type: Boolean,
default: false default: false
},
smartQuery: {
type: Object,
default: function() {
return {}
}
} }
}, },
inject: ['parentsData'], inject: ['parentsData'],
data() { data() {
return { return {
defaultImg: 'this.src="' + require('@/assets/images/cover-bg.png') + '"',
isTitleType: 6, isTitleType: 6,
fileDrawer: false, fileDrawer: false,
test: '', test: '',
@ -102,6 +110,11 @@ export default {
selections: [] selections: []
} }
}, },
computed: {
...mapGetters([
'baseApi'
])
},
watch: { watch: {
selectedCategory: function(newValue, oldValue) { selectedCategory: function(newValue, oldValue) {
} }
@ -111,8 +124,8 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
getCommonData(type, parentId) {
this.getViewTable(type, parentId)
getCommonData(categoryLevel, parentId, type) {
this.getViewTable(categoryLevel, parentId, type)
}, },
closeDrawer() { closeDrawer() {
this.fileDrawer = false this.fileDrawer = false

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

@ -32,7 +32,7 @@
node-key="id" node-key="id"
:expand-on-click-node="false" :expand-on-click-node="false"
highlight-current highlight-current
@node-click="handleNodeFilter"
@node-click="handleClassifyFilter"
> >
<span slot-scope="{ node, data }" class="custom-tree-node"> <span slot-scope="{ node, data }" class="custom-tree-node">
<span v-if="data.childDictionarys || data.fondsName" class="iconClassify"> <span v-if="data.childDictionarys || data.fondsName" class="iconClassify">
@ -51,10 +51,10 @@
<div class="container-right tab-content"> <div class="container-right tab-content">
<span class="right-top-line" /> <span class="right-top-line" />
<span class="left-bottom-line" /> <span class="left-bottom-line" />
<Project v-if="selectedCategory.arrangeType === 3" ref="projectEle" :selected-category="selectedCategory" :data="sharedData" :is-recycle="isRecycle" @openAnjuan="handleOpenAnjuan" @myYearEvent="handleYearData" />
<Anjuan v-if="selectedCategory.arrangeType === 1 || selectedCategory.arrangeType === 2 || selectedCategory.arrangeType === 3" ref="anjuanEle" :selected-category="selectedCategory" :data="sharedData" :is-recycle="isRecycle" @openJuannei="handleOpenJuannei" @myYearEvent="handleYearData" />
<Juannei v-if="selectedCategory.arrangeType === 2 || selectedCategory.arrangeType === 3" ref="juanneiEle" :data="sharedData" :selected-category="selectedCategory" :is-recycle="isRecycle" @openFile="handleOpenFile" />
<File v-if="selectedCategory.arrangeType === 1 || selectedCategory.arrangeType === 2 || selectedCategory.arrangeType === 3" ref="fileEle" :is-recycle="isRecycle" :selected-category="selectedCategory" />
<Project v-if="selectedCategory.arrangeType === 3" ref="projectEle" :selected-category="selectedCategory" :data="sharedData" :is-recycle="isRecycle" :smart-query="smartQuery" @openAnjuan="handleOpenAnjuan" @myYearEvent="handleYearData" />
<Anjuan v-if="selectedCategory.arrangeType === 1 || selectedCategory.arrangeType === 2 || selectedCategory.arrangeType === 3" ref="anjuanEle" :selected-category="selectedCategory" :data="sharedData" :is-recycle="isRecycle" :smart-query="smartQuery" @openJuannei="handleOpenJuannei" @myYearEvent="handleYearData" />
<Juannei v-if="selectedCategory.arrangeType === 2 || selectedCategory.arrangeType === 3" ref="juanneiEle" :data="sharedData" :selected-category="selectedCategory" :is-recycle="isRecycle" :smart-query="smartQuery" @openFile="handleOpenFile" />
<File v-if="selectedCategory.arrangeType === 1 || selectedCategory.arrangeType === 2 || selectedCategory.arrangeType === 3" ref="fileEle" :is-recycle="isRecycle" :selected-category="selectedCategory" :smart-query="smartQuery" />
</div> </div>
</div> </div>
</div> </div>
@ -120,7 +120,15 @@ export default {
yearChildData: '', yearChildData: '',
parentsProjectId: null, parentsProjectId: null,
parentsAnjuanId: null, parentsAnjuanId: null,
parentsJuanneiId: null
parentsJuanneiId: null,
smartQuery: {
'retention': null, //
'security_class': null, //
'doc_type': null, //
'medium_type': null, //
'archive_year': null, //
'fonds_no': null //
}
} }
}, },
watch: { watch: {
@ -147,7 +155,7 @@ export default {
json.childDictionarys = [] json.childDictionarys = []
return json return json
}) })
this.classifyTree.unshift({ id: -1, dictionaryName: '年度', dicCode: 'Search_year', childDictionarys: newYearArr })
this.classifyTree.unshift({ id: -1, dictionaryName: '年度', dictionaryCode: 'archive_year', childDictionarys: newYearArr })
} }
this.classifyLoading = false this.classifyLoading = false
}, 500) }, 500)
@ -222,6 +230,14 @@ export default {
}) })
}, },
handleNodeClick(val) { handleNodeClick(val) {
this.smartQuery = {
'retention': null, //
'security_class': null, //
'doc_type': null, //
'medium_type': null, //
'archive_year': null, //
'fonds_no': null //
}
// //
localStorage.setItem('currentArchivesKey', JSON.stringify(val)) localStorage.setItem('currentArchivesKey', JSON.stringify(val))
this.selectedCategory = val this.selectedCategory = val
@ -232,29 +248,53 @@ export default {
this.classifyTree = [] this.classifyTree = []
} }
this.$nextTick(() => { this.$nextTick(() => {
if (this.selectedCategory.arrangeType === 3) {
//
this.handlePageList()
})
},
handlePageList(isQuickFilter) {
if (this.selectedCategory.arrangeType === 3) {
const tablistEle = this.$refs.projectEle
//
if (isQuickFilter) {
tablistEle.$refs.collectHeaderRef.getInitArchivesClass()
tablistEle.getTableDisplayFieldsLoading = true
tablistEle.getViewTableList(1, null, isQuickFilter)
} else {
this.$refs.projectEle.getCommonData(1) this.$refs.projectEle.getCommonData(1)
} else if (this.selectedCategory.arrangeType === 2) {
//
this.$refs.anjuanEle.$refs.ajContent.$refs.tableList.getCommonData(2)
} else if (this.selectedCategory.arrangeType === 1) {
//
this.$refs.anjuanEle.$refs.ajContent.$refs.tableList.getCommonData(3)
} }
if (this.$refs.anjuanEle) {
this.$refs.anjuanEle.anjuanDrawer = false
if (this.$refs.anjuanEle.$refs.ajContent) {
this.$refs.anjuanEle.$refs.ajContent.activeIndex = 0
}
} else if (this.selectedCategory.arrangeType === 2) {
const tablistEle = this.$refs.anjuanEle.$refs.ajContent.$refs.tableList
//
if (isQuickFilter) {
tablistEle.$refs.collectHeaderRef.getInitArchivesClass()
tablistEle.getTableDisplayFieldsLoading = true
tablistEle.getViewTableList(2, null, isQuickFilter)
} else {
tablistEle.getCommonData(2)
} }
if (this.$refs.juanneiEle) {
this.$refs.juanneiEle.juanneiDrawer = false
} else if (this.selectedCategory.arrangeType === 1) {
const tablistEle = this.$refs.anjuanEle.$refs.ajContent.$refs.tableList
//
if (isQuickFilter) {
tablistEle.$refs.collectHeaderRef.getInitArchivesClass()
tablistEle.getTableDisplayFieldsLoading = true
tablistEle.getViewTableList(3, null, isQuickFilter)
} else {
tablistEle.getCommonData(3)
} }
if (this.$refs.fileEle) {
this.$refs.fileEle.fileDrawer = false
}
if (this.$refs.anjuanEle) {
this.$refs.anjuanEle.anjuanDrawer = false
if (this.$refs.anjuanEle.$refs.ajContent) {
this.$refs.anjuanEle.$refs.ajContent.activeIndex = 0
} }
})
}
if (this.$refs.juanneiEle) {
this.$refs.juanneiEle.juanneiDrawer = false
}
if (this.$refs.fileEle) {
this.$refs.fileEle.fileDrawer = false
}
}, },
getDictionaryTreeByCategoryId(categoryId) { getDictionaryTreeByCategoryId(categoryId) {
this.classifyLoading = true this.classifyLoading = true
@ -274,8 +314,60 @@ export default {
console.log(err) console.log(err)
}) })
}, },
handleNodeFilter(val) {
// console.log('val', val)
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')
})
}
}
}, },
handleOpenAnjuan(data, parentId) { handleOpenAnjuan(data, parentId) {
this.parentsProjectId = parentId this.parentsProjectId = parentId

12
src/views/collectReorganizi/collectionLibrary/juannei/index.vue

@ -8,7 +8,7 @@
direction="rtl" direction="rtl"
:size="selectedCategory.arrangeType === 2 ? '90%' :'80%'" :size="selectedCategory.arrangeType === 2 ? '90%' :'80%'"
> >
<CollectHeader :is-title-type="isTitleType" :selected-category="selectedCategory" :selections="selections" :test="test" :is-recycle="isRecycle" />
<CollectHeader ref="collectHeaderRef" :is-title-type="isTitleType" :selected-category="selectedCategory" :selections="selections" :test="test" :is-recycle="isRecycle" />
<div class="collect-table"> <div class="collect-table">
<el-table <el-table
ref="table" ref="table"
@ -85,6 +85,12 @@ export default {
isRecycle: { isRecycle: {
type: Boolean, type: Boolean,
default: false default: false
},
smartQuery: {
type: Object,
default: function() {
return {}
}
} }
}, },
inject: ['parentsData'], inject: ['parentsData'],
@ -111,8 +117,8 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
getCommonData(type, parentId) {
this.getViewTable(type, parentId)
getCommonData(categoryLevel, parentId, type) {
this.getViewTable(categoryLevel, parentId, type)
}, },
openFile(data, parentId) { openFile(data, parentId) {
// this.$emit('openFile', '') // this.$emit('openFile', '')

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

@ -21,7 +21,9 @@ export const collectionLibraryCrud = {
}, },
timer: null, timer: null,
query: { query: {
search: null
search: null,
project_class: null,
archive_ctg_no: null
}, },
classifyTree: [], classifyTree: [],
classifyLoading: false, classifyLoading: false,
@ -34,32 +36,41 @@ export const collectionLibraryCrud = {
// 组件共用方法 // 组件共用方法
methods: { methods: {
handleSearch(categoryLevel) { handleSearch(categoryLevel) {
let parentsId = 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
}
// 2 项目 3 案卷 /文件 4 卷内 6 文件 // 2 项目 3 案卷 /文件 4 卷内 6 文件
if (this.isTitleType === 2) { if (this.isTitleType === 2) {
parentsId = null
this.parentsId = null
this.$parent.getTableDisplayFieldsLoading = true
} else if (this.isTitleType === 3) { } else if (this.isTitleType === 3) {
console.log('this.isTitleType', this.isTitleType)
if (this.selectedCategory.arrangeType === 1) { if (this.selectedCategory.arrangeType === 1) {
parentsId = null
this.parentsId = null
this.$parent.getTableDisplayFieldsLoading = true
} else { } else {
parentsId = this.parentsData.parentsProjectId
this.parentsId = this.parentsData.parentsProjectId
this.$parent.getTableDisplayFieldsLoading = true this.$parent.getTableDisplayFieldsLoading = true
} }
} else if (this.isTitleType === 4) { } else if (this.isTitleType === 4) {
// 卷内 // 卷内
this.$parent.$parent.getTableDisplayFieldsLoading = true this.$parent.$parent.getTableDisplayFieldsLoading = true
parentsId = this.parentsData.parentsAnjuanId
this.parentsId = this.parentsData.parentsAnjuanId
} else if (this.isTitleType === 6) { } else if (this.isTitleType === 6) {
// 原文 // 原文
this.$parent.$parent.getTableDisplayFieldsLoading = true this.$parent.$parent.getTableDisplayFieldsLoading = true
parentsId = this.parentsData.parentsJuanneiId
this.parentsId = this.parentsData.parentsJuanneiId
} }
setTimeout(() => { setTimeout(() => {
this.getViewTableList(categoryLevel, 'search', parentsId)
this.getViewTableList(categoryLevel, this.parentsId, 'search')
}, 200) }, 200)
}, },
getViewTable(categoryLevel, parentsId) {
getViewTable(categoryLevel, parentsId, type) {
this.getTableDisplayFieldsLoading = true this.getTableDisplayFieldsLoading = true
this.tableDisplayFields = [] this.tableDisplayFields = []
FetchInitCategoryViewTable({ categoryId: this.selectedCategory.id, categoryLevel: categoryLevel }).then((res) => { FetchInitCategoryViewTable({ categoryId: this.selectedCategory.id, categoryLevel: categoryLevel }).then((res) => {
@ -73,76 +84,103 @@ export const collectionLibraryCrud = {
} }
}) })
this.$nextTick(() => { this.$nextTick(() => {
this.getViewTableList(categoryLevel, null, parentsId)
this.getViewTableList(categoryLevel, parentsId, type)
}) })
} }
}) })
}, },
getViewTableList(categoryLevel, type, parentsId) {
getViewTableList(categoryLevel, parentsId, type) {
console.log('list', parentsId) console.log('list', parentsId)
const params = { const params = {
'parentId': parentsId, 'parentId': parentsId,
'categoryId': this.selectedCategory.id, 'categoryId': this.selectedCategory.id,
'categoryLevel': categoryLevel, 'categoryLevel': categoryLevel,
'search': this.query.search, 'search': this.query.search,
'retention': this.smartQuery.retention,
'security_class': this.smartQuery.security_class,
'medium_type': this.smartQuery.medium_type,
'doc_type': this.smartQuery.doc_type,
'archive_year': this.smartQuery.archive_year,
'fonds_no': this.smartQuery.fonds_no,
'project_class': this.query.project_class,
'archive_ctg_no': this.query.archive_ctg_no,
'page': this.page.page - 1, 'page': this.page.page - 1,
'size': this.page.size 'size': this.page.size
} }
FetchInitCategoryView(params).then((res) => { FetchInitCategoryView(params).then((res) => {
if (res.code !== 500) { if (res.code !== 500) {
if (categoryLevel === 1) { if (categoryLevel === 1) {
// 项目
this.projectData = res.list.content this.projectData = res.list.content
this.page.total = res.list.totalElements
this.yearData = res.yearGroup this.yearData = res.yearGroup
if (this.yearData) {
if (this.yearData && type !== 'quickFilter') {
this.$emit('myYearEvent', this.yearData) this.$emit('myYearEvent', this.yearData)
} }
if (type === 'search') { if (type === 'search') {
this.$parent.projectData = res.list.content this.$parent.projectData = res.list.content
this.$parent.page.total = res.list.totalElements
this.$parent.getTableDisplayFieldsLoading = false this.$parent.getTableDisplayFieldsLoading = false
} }
} else if (categoryLevel === 2) { } else if (categoryLevel === 2) {
// 案卷
const anjuanObj = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList
this.anjuanData = res.list.content this.anjuanData = res.list.content
this.page.total = res.list.totalElements
this.yearData = res.yearGroup this.yearData = res.yearGroup
if (this.yearData) {
if (this.yearData && type !== 'quickFilter') {
this.$parent.$parent.$emit('myYearEvent', this.yearData) this.$parent.$parent.$emit('myYearEvent', this.yearData)
} }
// 搜索/新增/编辑 非 案卷是主页的时候
if (type === 'search') { if (type === 'search') {
this.$parent.anjuanData = res.list.content
this.$parent.getTableDisplayFieldsLoading = false
anjuanObj.anjuanData = res.list.content
anjuanObj.page.total = res.list.totalElements
anjuanObj.getTableDisplayFieldsLoading = false
} }
} else if (categoryLevel === 3) { } else if (categoryLevel === 3) {
if (this.isTitleType === 6) {
this.fileData = res.list.content
} else if (this.isTitleType === 3) {
if (this.isTitleType === 3) {
console.log('2222')
// 案卷下的未整理 / 文件为主页时
const wjObj = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList
this.anjuanData = res.list.content this.anjuanData = res.list.content
this.page.total = res.list.totalElements
this.yearData = res.yearGroup this.yearData = res.yearGroup
if (this.yearData) {
if (this.yearData && type !== 'quickFilter') {
this.$parent.$parent.$emit('myYearEvent', this.yearData) this.$parent.$parent.$emit('myYearEvent', this.yearData)
} }
if (type === 'search') {
wjObj.anjuanData = res.list.content
wjObj.page.total = res.list.totalElements
wjObj.getTableDisplayFieldsLoading = false
}
} else { } else {
if (this.selectedCategory.arrangeType === 1) {
this.anjuanData = res.list.content
this.yearData = res.yearGroup
if (this.yearData) {
this.$parent.$parent.$emit('myYearEvent', this.yearData)
}
if (type === 'search') {
this.$parent.anjuanData = res.list.content
this.$parent.getTableDisplayFieldsLoading = false
}
} else {
this.junneiData = res.list.content
if (type === 'search') {
this.$parent.$parent.junneiData = res.list.content
this.$parent.$parent.getTableDisplayFieldsLoading = false
}
// 卷内
console.log('5555')
this.junneiData = res.list.content
this.page.total = res.list.totalElements
if (type === 'search') {
this.parentsData.$refs.juanneiEle.junneiData = res.list.content
this.parentsData.$refs.juanneiEle.page.total = res.list.totalElements
this.parentsData.$refs.juanneiEle.getTableDisplayFieldsLoading = false
} }
} }
} else {
// 原文
this.fileData = res.list.content
this.page.total = res.list.totalElements
if (type === 'search') {
this.parentsData.$refs.fileEle.fileData = res.list.content
this.parentsData.$refs.fileEle.page.total = res.list.totalElements
this.parentsData.$refs.fileEle.getTableDisplayFieldsLoading = false
}
} }
this.page.total = res.list.totalElements
} }
this.getTableDisplayFieldsLoading = false this.getTableDisplayFieldsLoading = false
this.$parent.$parent.$refs.table.clearSelection()
if (!parentsId) {
this.selections = []
this.crud.selections = []
this.$refs.table.clearSelection()
}
}) })
}, },

45
src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue

@ -6,30 +6,34 @@
<div class="collect-filter"> <div class="collect-filter">
<treeselect <treeselect
v-if="selectedCategory.arrangeType === 3 && isTitleType !== 4 && isTitleType !== 6 && activeIndex !== 1" v-if="selectedCategory.arrangeType === 3 && isTitleType !== 4 && isTitleType !== 6 && activeIndex !== 1"
v-model="query.projectClass"
v-model="query.project_class"
:options="projectOptions" :options="projectOptions"
style="width: 180px;" style="width: 180px;"
flat flat
:multiple="false" :multiple="false"
:normalizer="normalizerProject" :normalizer="normalizerProject"
placeholder="请选择" placeholder="请选择"
@input="handleSearch(collectLevel)"
@select="handleSearch(collectLevel)"
/> />
<treeselect <treeselect
v-if="isTitleType !== 6" v-if="isTitleType !== 6"
v-model="query.classify"
v-model="query.archive_ctg_no"
:options="classifyOptions" :options="classifyOptions"
style="width: 180px;" style="width: 180px;"
flat flat
:multiple="false" :multiple="false"
:normalizer="normalizer" :normalizer="normalizer"
placeholder="请选择档案分类" placeholder="请选择档案分类"
@input="handleSearch(collectLevel)"
@select="handleSearch(collectLevel)"
/> />
</div> </div>
<div v-if="isTitleType !== 6" class="head-search"> <div v-if="isTitleType !== 6" class="head-search">
<!-- 搜索 --> <!-- 搜索 -->
<el-input v-model="query.search" clearable size="small" :placeholder="placeholderType" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="handleSearch(collectLevel)" @clear="handleSearch(collectLevel)" /> <el-input v-model="query.search" clearable size="small" :placeholder="placeholderType" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="handleSearch(collectLevel)" @clear="handleSearch(collectLevel)" />
<el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch(collectLevel)">搜索</el-button> <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch(collectLevel)">搜索</el-button>
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left">重置</el-button>
<el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
</div> </div>
<div v-if="!isRecycle" class="collect-menu"> <div v-if="!isRecycle" class="collect-menu">
<el-menu <el-menu
@ -164,7 +168,7 @@
</el-dialog> </el-dialog>
<!-- 原文上传 --> <!-- 原文上传 -->
<UploadOriginal ref="uploadOriginalRef" />
<UploadOriginal ref="uploadOriginalRef" :selected-category="selectedCategory" :arc-id="arcId" @close-dialog="closeDialog" />
<!-- 批量导入 --> <!-- 批量导入 -->
<BlukImport ref="blukImportRef" /> <BlukImport ref="blukImportRef" />
<!-- 批量修改 --> <!-- 批量修改 -->
@ -372,10 +376,6 @@ export default {
formVisible: false, formVisible: false,
formTitle: '项目', formTitle: '项目',
formPreviewData: [], // data formPreviewData: [], // data
query: {
projectClass: null,
classify: null
},
projectOptions: [], projectOptions: [],
classifyOptions: [], classifyOptions: [],
delAllLoading: false, delAllLoading: false,
@ -476,9 +476,22 @@ export default {
this.getDictsList() this.getDictsList()
}, },
methods: { methods: {
resetQuery() {
this.query = {
'search': null,
'project_class': null,
'archive_ctg_no': null
}
this.handleSearch(this.collectLevel)
},
// - // -
getInitArchivesClass() { getInitArchivesClass() {
this.classifyOptions = [] this.classifyOptions = []
this.query = {
'search': null,
'project_class': null,
'archive_ctg_no': null
}
const params = { const params = {
'categoryId': this.selectedCategory.id 'categoryId': this.selectedCategory.id
} }
@ -542,7 +555,7 @@ export default {
delete node.childDictionarys delete node.childDictionarys
} }
return { return {
id: node.dictionaryCode,
id: node.dictionaryName,
label: node.dictionaryName, label: node.dictionaryName,
children: node.childDictionarys, children: node.childDictionarys,
isDisabled: this.isTitleType === 3 ? node.level !== 3 : node.level === 1 isDisabled: this.isTitleType === 3 ? node.level !== 3 : node.level === 1
@ -651,7 +664,7 @@ export default {
collectDel(params).then(() => { collectDel(params).then(() => {
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS) this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.deleteVisible = false this.deleteVisible = false
this.crud.refresh()
this.handleSearch(this.collectLevel)
this.delAllLoading = false this.delAllLoading = false
}).catch(err => { }).catch(err => {
this.delAllLoading = false this.delAllLoading = false
@ -695,8 +708,14 @@ export default {
this.$message('上传操作只可勾选唯一目标条目,请先确认!') this.$message('上传操作只可勾选唯一目标条目,请先确认!')
return false return false
} }
this.arcId = this.selections[0].id
} else {
if (this.selectedCategory.arrangeType === 1) {
this.arcId = this.parentsData.parentsAnjuanId
} else {
this.arcId = this.parentsData.parentsJuanneiId
}
} }
if (uploadType === 0) { if (uploadType === 0) {
this.$refs.uploadOriginalRef.uploadTitle = '普通上传' this.$refs.uploadOriginalRef.uploadTitle = '普通上传'
} else if (uploadType === 1) { } else if (uploadType === 1) {
@ -901,9 +920,9 @@ export default {
}, },
closeDialog(data) { closeDialog(data) {
this.formVisible = false this.formVisible = false
this.$parent.$parent.getTableDisplayFieldsLoading = true
// this.$parent.$parent.getTableDisplayFieldsLoading = true
setTimeout(() => { setTimeout(() => {
this.getViewTableList(this.collectLevel, 'search', data)
this.handleSearch(this.collectLevel)
}) })
console.log('this', this) console.log('this', this)
} }

138
src/views/collectReorganizi/collectionLibrary/module/uploadOriginal/index.vue

@ -57,33 +57,47 @@
</template> </template>
<script> <script>
import { FetchAddArchivesFile } from '@/api/collect/collect'
import { getCurrentTime } from '@/utils/index'
import { archivesUpload } from '@/utils/upload'
import { mapGetters } from 'vuex'
export default { export default {
name: 'UploadOriginal', name: 'UploadOriginal',
components: {}, components: {},
mixins: [],
props: {
selectedCategory: {
type: Object,
default: function() {
return {}
}
},
arcId: {
type: String,
default: function() {
return ''
}
}
},
data() { data() {
return { return {
//
uploadVisible: false, uploadVisible: false,
uploadTitle: '普通上传', uploadTitle: '普通上传',
detailUploadTitle: '上传详情', detailUploadTitle: '上传详情',
key: 0, key: 0,
file: null,
file: null, // change
fileNames: '', // - name
formatType: '', // - type
postfix: '', // -
fileSize: '', // -
filePath: '', // - path
px: '', // -
nowDate: '', //
fileList: [], fileList: [],
uploadType: 0, uploadType: 0,
// //
uploadDetialVisible: false, uploadDetialVisible: false,
uploadDetailData: [
{
number: '上传编号001 ',
operator: 'admin',
operationType: '原文目录上传',
file: ' xxxxx目录.zip',
createDate: '2016-09-21 08:50:08',
successNumber: '6',
failNumber: '4'
}
],
uploadDetailData: [],
page: { page: {
page: 1, page: 1,
size: 10, size: 10,
@ -91,14 +105,19 @@ export default {
} }
} }
}, },
computed: {
...mapGetters([
'baseApi'
])
},
created() { created() {
}, },
mounted() { mounted() {
}, },
methods: { methods: {
// input-upload change // input-upload change
handleFileChange(event) {
const files = event.target.files
async handleFileChange(e) {
const files = e.target.files
this.file = files[0] this.file = files[0]
this.key++ this.key++
let maxMessage let maxMessage
@ -113,7 +132,7 @@ export default {
if (this.file && this.file.size > maxSize) { if (this.file && this.file.size > maxSize) {
this.$message.warning(maxMessage) this.$message.warning(maxMessage)
this.fileList = [] this.fileList = []
event.target.value = ''
e.target.value = ''
return false return false
} }
if (this.fileList.length !== 0) { if (this.fileList.length !== 0) {
@ -127,6 +146,28 @@ export default {
// this.fileList = [] // this.fileList = []
this.fileList.push(files[i]) this.fileList.push(files[i])
} }
this.fileSize = this.file.size
this.formatType = this.file.type.substring(0, this.file.type.indexOf('/'))
this.fileNames = this.file.name
this.postfix = this.file.name.substring(
this.fileNames.lastIndexOf('.') + 1,
this.fileNames.length
)
if (this.formatType === 'image') {
const fileBase64 = await this.getBase64(this.file)
const res = await this.getImgPx(fileBase64)
this.px = res.width + 'px*' + res.height + 'px'
} else {
this.px = ''
}
//
archivesUpload(this.baseApi + '/api/collect/uploadFile', this.file, this.selectedCategory.id).then(res => {
if (res.data.code === 200) {
this.filePath = res.data.data
}
})
}, },
// delt file // delt file
deleteFile(file) { deleteFile(file) {
@ -152,13 +193,64 @@ export default {
// }) // })
}, },
handleUploadConfirm() { handleUploadConfirm() {
this.uploadVisible = false
this.uploadDetialVisible = true
if (this.uploadType === 2) {
this.detailUploadTitle = '原文目录上传详情'
} else {
this.detailUploadTitle = '上传详情'
this.nowDate = getCurrentTime()
const json = {
'file_name': this.fileNames,
'file_size': this.fileSize,
'file_type': this.postfix,
'file_path': this.filePath,
'sequence': null,
'archive_id': this.arcId,
'file_dpi': this.px,
'file_thumbnail': '',
'create_time': this.nowDate,
'id': null
}
const arrayUpload = []
arrayUpload.push(json)
const params = {
'archivesId': this.arcId,
'categoryId': this.selectedCategory.id,
'fileJsonString': JSON.stringify(arrayUpload)
} }
console.log(params)
FetchAddArchivesFile(params).then(res => {
if (res.code !== 500) {
this.$message.success('上传附件成功!')
this.uploadVisible = false
// this.uploadDetialVisible = true
// if (this.uploadType === 2) {
// this.detailUploadTitle = ''
// } else {
// this.detailUploadTitle = ''
// }
this.$emit('close-dialog', this.arcId)
} else {
this.$message.error('上传附件失败!')
}
})
},
// base64
getBase64(file) {
const reader = new FileReader()
reader.readAsDataURL(file)
return new Promise((resolve) => {
reader.onload = () => {
resolve(reader.result)
}
})
},
//
getImgPx(img) {
const image = new Image()
image.src = img
return new Promise((resolve) => {
image.onload = () => {
const width = image.width
const height = image.height
resolve({ width, height })
}
})
}, },
handleSizeChange(size) { handleSizeChange(size) {
this.page.size = size this.page.size = size

10
src/views/collectReorganizi/collectionLibrary/project/index.vue

@ -82,6 +82,12 @@ export default {
isRecycle: { isRecycle: {
type: Boolean, type: Boolean,
default: false default: false
},
smartQuery: {
type: Object,
default: function() {
return {}
}
} }
}, },
data() { data() {
@ -107,8 +113,8 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
getCommonData(type, parentId) {
this.getViewTable(type, parentId)
getCommonData(categoryLevel, parentId, type) {
this.getViewTable(categoryLevel, parentId, type)
}, },
sendYearDataToParent() { sendYearDataToParent() {
this.$emit('myYearEvent', this.yearData) this.$emit('myYearEvent', this.yearData)

Loading…
Cancel
Save