From 540af2bc2397742447f6311bb621f1a49bd59fb4 Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Fri, 13 Oct 2023 17:23:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E5=BD=92=E6=A1=A3api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../prearchiveLibrary/prearchiveLibrary.js | 52 +++++ src/components/Crud/crud.js | 9 +- .../module/collectHeader.vue | 21 +- .../module/fileSeqAdjustment/index.vue | 151 ++++++++++++ src/views/components/category/PreviewForm.vue | 57 +++-- src/views/prearchiveLibrary/index.vue | 216 ++++++++---------- src/views/prearchiveLibrary/module/form.vue | 83 +++---- src/views/prearchiveLibrary/table.json | 46 ---- src/views/prearchiveLibrary/treeList.vue | 109 +++++++++ src/views/system/fileLibraryManage/index.vue | 8 +- 10 files changed, 520 insertions(+), 232 deletions(-) create mode 100644 src/api/prearchiveLibrary/prearchiveLibrary.js create mode 100644 src/views/collectReorganizi/collectionLibrary/module/fileSeqAdjustment/index.vue delete mode 100644 src/views/prearchiveLibrary/table.json create mode 100644 src/views/prearchiveLibrary/treeList.vue diff --git a/src/api/prearchiveLibrary/prearchiveLibrary.js b/src/api/prearchiveLibrary/prearchiveLibrary.js new file mode 100644 index 0000000..16909cb --- /dev/null +++ b/src/api/prearchiveLibrary/prearchiveLibrary.js @@ -0,0 +1,52 @@ +import request from '@/utils/request' +import qs from 'qs' + +export function FetchInitPreDocument(params) { + return request({ + url: 'api/re-document/initPreDocument' + '?' + qs.stringify(params, { indices: false }), + method: 'get' + }) +} + +export function FetchInitDocumentsViewTable(params) { + return request({ + url: 'api/re-document/initDocumentsViewTable', + method: 'get', + params + }) +} + +export function add(data) { + return request({ + url: 'api/re-document/editDocument', + method: 'post', + data + }) +} + +export function edit(data) { + return request({ + url: 'api/re-document/editDocument', + method: 'post', + data + }) +} + +export function del(ids) { + const params = { id: ids[0] } + return request({ + url: 'api/re-document/deleteDocument', + method: 'delete', + params + }) +} + +export function FetchDoeditDocument(params) { + return request({ + url: 'api/re-document/doeditDocument', + method: 'get', + params + }) +} + +export default { add, edit, del, FetchInitPreDocument, FetchInitDocumentsViewTable, FetchDoeditDocument } diff --git a/src/components/Crud/crud.js b/src/components/Crud/crud.js index 3807871..8cea1ba 100644 --- a/src/components/Crud/crud.js +++ b/src/components/Crud/crud.js @@ -139,8 +139,13 @@ function CRUD(options) { table.store.states.treeData = {} table.store.states.lazyTreeNodeMap = {} } - crud.page.total = data.totalElements !== null ? data.totalElements : data.length - crud.data = data.content ? data.content : data + if (Array.isArray(data)) { + crud.page.total = data.totalElements !== null ? data.totalElements : data.length + crud.data = data.content ? data.content : data + } else { + crud.page.total = data.list.totalElements + crud.data = data.list.content + } crud.resetDataStatus() // time 毫秒后显示表格 setTimeout(() => { diff --git a/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue b/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue index 1f5becc..3560a75 100644 --- a/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue +++ b/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue @@ -43,6 +43,7 @@ 档号更新 卷内档号更新 + 卷内顺序调整 拆卷 合卷 插件 @@ -148,6 +149,9 @@ + + +
@@ -270,6 +274,7 @@ import UploadOriginal from './uploadOriginal/index' import BlukImport from './bulkImport/index' import BlukEditing from './blukEditing/index' import FileNumberAdjustment from './fileNumberAdjustment/index' +import FileSeqAdjustment from './fileSeqAdjustment/index' import CombineFile from './combineFile/index' import InsertFile from './insertFile/index' import CollectMoveFile from './collectMoveFile/index' @@ -280,7 +285,7 @@ import QuickPaper from './quickPaper/index' import { mapGetters } from 'vuex' export default { name: 'CollectHeader', - components: { PreviewForm, UploadOriginal, BlukImport, BlukEditing, FileNumberAdjustment, CombineFile, InsertFile, CollectMoveFile, Print, FourTest, QuickPaper }, + components: { PreviewForm, UploadOriginal, BlukImport, BlukEditing, FileNumberAdjustment, FileSeqAdjustment, CombineFile, InsertFile, CollectMoveFile, Print, FourTest, QuickPaper }, mixins: [], props: { selectedCategory: { @@ -465,7 +470,7 @@ export default { return false } if (this.selections.length > 1) { - this.$message('编辑操作只可勾选唯一目标条目,请先确认!') + this.$message('上传操作只可勾选唯一目标条目,请先确认!') return false } } @@ -513,6 +518,18 @@ export default { handleUpdateConfirm() { this.updateVisible = false }, + // 卷内顺序调整 + handleFileSeqAdjustment() { + if (this.selections.length === 0) { + this.$message('您还未勾选需要操作的条目,请先确认!') + return false + } + if (this.selections.length > 1) { + this.$message('顺序调整操作只可勾选唯一目标条目,请先确认!') + return false + } + this.$refs.fileSeqAdjustmentRef.adjustmentVisible = true + }, // 拆卷 handleUncoil() { if (this.selections.length === 0) { diff --git a/src/views/collectReorganizi/collectionLibrary/module/fileSeqAdjustment/index.vue b/src/views/collectReorganizi/collectionLibrary/module/fileSeqAdjustment/index.vue new file mode 100644 index 0000000..dc4860d --- /dev/null +++ b/src/views/collectReorganizi/collectionLibrary/module/fileSeqAdjustment/index.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/src/views/components/category/PreviewForm.vue b/src/views/components/category/PreviewForm.vue index 94d5fc9..14b0710 100644 --- a/src/views/components/category/PreviewForm.vue +++ b/src/views/components/category/PreviewForm.vue @@ -45,14 +45,16 @@ - + + + - + import { crud } from '@crud/crud' import { edit, FetchDoeditIsRepeat } from '@/api/archivesManage/archivesList' +import { prearchEdit } from '@/api/prearchiveLibrary/prearchiveLibrary' import { getNoFormatField } from '@/api/system/category/fileNoFormat' import draggable from 'vuedraggable' import Treeselect from '@riophae/vue-treeselect' @@ -387,6 +390,7 @@ export default { // 动态生成表单 editFormRow() { this.rules = {} + console.log(this.formPreviewData) this.formPreviewData.map(item => { if (item.isInputClass === 'select') { this.$set(item, 'options', []) @@ -450,22 +454,41 @@ export default { delete this.addOrUpdateForm.id this.$refs[formName].validate((valid) => { if (valid) { - const params = { - 'id': this.arcId, - 'categoryId': categoryId, - 'parentsId': this.setParentsId, - 'jsonString': JSON.stringify(this.addOrUpdateForm) - } - console.log(this.addOrUpdateForm) - edit(params).then(res => { - if (res) { - this.$message.success(res) - this.$emit('emitTableList') - this.crud.refresh() - localStorage.setItem('isForm', true) - localStorage.removeItem('isDelt') + if (this.isDesFormType === 'prearchiveLibrary') { + const params = { + 'id': null, + 'documentId': categoryId, + 'delMan': null, + 'fileJsonString': JSON.stringify(this.addOrUpdateForm) } - }) + console.log(this.addOrUpdateForm) + prearchEdit(params).then(res => { + if (res) { + this.$message.success(res) + this.$emit('emitTableList') + this.crud.refresh() + localStorage.setItem('isForm', true) + localStorage.removeItem('isDelt') + } + }) + } else { + const params = { + 'id': this.arcId, + 'categoryId': categoryId, + 'parentsId': this.setParentsId, + 'jsonString': JSON.stringify(this.addOrUpdateForm) + } + console.log(this.addOrUpdateForm) + edit(params).then(res => { + if (res) { + this.$message.success(res) + this.$emit('emitTableList') + this.crud.refresh() + localStorage.setItem('isForm', true) + localStorage.removeItem('isDelt') + } + }) + } } else { console.log('error submit!!') return false diff --git a/src/views/prearchiveLibrary/index.vue b/src/views/prearchiveLibrary/index.vue index e99157c..740eb58 100644 --- a/src/views/prearchiveLibrary/index.vue +++ b/src/views/prearchiveLibrary/index.vue @@ -3,30 +3,14 @@
-
- - - -
- - - - {{ data.cnName }} - - - {{ data.cnName }} - - - -
-
+
@@ -55,24 +39,30 @@ - - - - - - - - - + + + + - +
@@ -125,26 +115,25 @@ import CRUD, { presenter, header } from '@crud/crud' import { preLibraryCrud } from './mixins/index' import { FetchCategoryMenu } from '@/api/system/category/category' +import PrearchiveCrud from '@/api/prearchiveLibrary/prearchiveLibrary' import rrOperation from '@crud/RR.operation' import crudOperation from '@crud/CRUD.operation' import pagination from '@crud/Pagination' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' -// import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect' -import tableJson from './table.json' +import TreeList from './treeList' import eForm from './module/form' import batchFile from './module/batchFile' import moveFile from './module/moveFile' -import Vue from 'vue' export default { name: 'PrearchiveLibrary', - components: { eForm, batchFile, moveFile, Treeselect, rrOperation, crudOperation, pagination }, + components: { TreeList, eForm, batchFile, moveFile, Treeselect, rrOperation, crudOperation, pagination }, cruds() { return [ CRUD({ - title: '预归档库', url: 'api/document/menu', - crudMethod: { }, + title: '预归档库', url: 'api/re-document/initPreDocument', + crudMethod: { ...PrearchiveCrud }, optShow: { add: false, edit: false, @@ -152,7 +141,8 @@ export default { download: true, group: false, reset: true - } + }, + queryOnPresenterCreated: false }) ] }, @@ -165,11 +155,10 @@ export default { del: ['admin', 'prearchiveLibrary:del'], sort: ['admin', 'prearchiveLibrary:sort'] }, - defaultProps: { - children: 'children', - label: 'cnName' - }, - table: [], + tableDisplayFields: [], // table-list-title字段 + arrySort: [], + selectedDocument: {}, + formPreviewData: [], deleteVisible: false, mergeVisible: false, categoryTree: [], @@ -185,68 +174,55 @@ export default { computed: { }, created() { - this.table = tableJson }, methods: { - [CRUD.HOOK.beforeToAdd](crud, form, btn) { + [CRUD.HOOK.beforeRefresh]() { + this.crud.query.documentId = this.selectedDocument.id + this.crud.query.sort = this.arrySort }, - [CRUD.HOOK.afterRefresh]() { - this.crud.data = this.filterData(this.crud.data) - let currentKey - if (localStorage.getItem('documentCategoryKey')) { - currentKey = JSON.parse(localStorage.getItem('documentCategoryKey')) - } else { - if (this.crud.data[0].isType === 1) { - currentKey = this.findNode(this.crud.data[0].children, (node) => { - return node.isType !== 1 + handleNodeClick(data) { + this.selectedDocument = data + this.getInitDocumentsViewTable() + }, + getInitDocumentsViewTable() { + PrearchiveCrud.FetchInitDocumentsViewTable({ documentId: this.selectedDocument.id }).then(data => { + if (data) { + this.arrySort = [] + this.tableDisplayFields = data + const orderSortArry = this.tableDisplayFields.filter(item => item.displayOrder).sort((a, b) => a.displayOrder - b.displayOrder) + orderSortArry.forEach(item => { + if (item.displayOrderBy) { + this.arrySort.push(item.fieldName + ',' + item.displayOrderBy) + } + }) + this.$nextTick(() => { + if (this.tableDisplayFields.length !== 0) { + this.crud.toQuery() + } }) - } else { - currentKey = this.crud.data[0] - } - } - // 设置某个节点的当前选中状态 - this.$refs.tree.setCurrentKey(currentKey.id) - this.$nextTick(() => { - // 设置某个节点的父级展开 - const selectedKey = this.$refs.tree.getCurrentNode() - if (this.$refs.tree.getNode(selectedKey) && this.$refs.tree.getNode(selectedKey).parent) { - this.expandParents(this.$refs.tree.getNode(selectedKey).parent) } - // 选中节点的门类详情 - this.handleNodeClick(selectedKey) }) }, - // 选中门类后 - handleNodeClick(val) { - if (val) { - this.crud.selectionChangeHandler([val]) - this.$refs.eform.pid = val.id - this.selectedCategory = val - if (val.pid !== '0') { - Vue.set(this.selectedCategory, 'parentName', this.$refs.tree.getNode(val.pid).data.cnName) - } - // 缓存当前的选中的 - localStorage.setItem('documentCategoryKey', JSON.stringify(val)) - // if (this.$refs.tree.getNode(val.pid) && this.$refs.tree.getNode(val.pid).childNodes) { - // this.brotherNodeNum = this.$refs.tree.getNode(val.pid).childNodes.length - // } - } - }, // 著录界面-form/详情-api handleForm(type) { this.mergeVisible = false - this.$refs.eform.formVisible = true + + this.$refs.eform.selectedCategory = this.selectedDocument + let params if (type === 'add') { this.$refs.eform.formTitle = '新增文件' + params = { + documentId: this.selectedDocument.id, + archivesId: null + } } else if (type === 'edit') { this.$refs.eform.formTitle = '编辑文件' + params = { + documentId: this.selectedDocument.id, + archivesId: this.crud.selections[0].id + } } - // 档案预编辑获取字段 - const params = { - categoryId: this.categoryId, - archivesId: this.arcId - } - this.getFormInfo(params, type) + this.getFormInfo(params) }, // 选择删除 toDelete(data) { @@ -272,34 +248,36 @@ export default { // this.crud.refresh() // }) }, - getFormInfo(params, type, isAnOrJuan) { - // FetchFormDisplayFields(params).then(data => { - // this.formPreviewData = data.showFiled - // this.$nextTick(() => { - // if (type === 'edit') { - // this.$refs.previewForm.addOrUpdateForm = data.echo - // } else { - // if (this.recycleMain.selectedCategory.isType !== 5) { - // // 新增时拿到项目和案卷的相同的字段的值 - // this.formPreviewData.forEach(item => { - // if (isAnOrJuan === 1) { - // if (this.recycleMain.selectedCategory.isType !== 3) { - // if (this.recycleMain.projectSelection[item.fieldName]) { - // this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.projectSelection)) - // } - // } - // } else if (isAnOrJuan === 2) { - // if (this.recycleMain.anjuanSelection[item.fieldName]) { - // this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.anjuanSelection)) - // } - // } - // }) - // } - // } - // this.isDesFormType = 'arcives' - // this.$refs.previewForm.FetchNoFormatField(this.categoryId) - // }) - // }) + getFormInfo(params) { + PrearchiveCrud.FetchDoeditDocument(params).then(data => { + const showFiledAll = data.showFiled.filter(item => item.displayOrder).sort((a, b) => a.displayOrder - b.displayOrder) + this.$nextTick(() => { + this.$refs.eform.formPreviewData = showFiledAll + this.$refs.eform.formVisible = true + // if (type === 'edit') { + // this.$refs.previewForm.addOrUpdateForm = data.echo + // } else { + // // if (this.recycleMain.selectedDocument.isType !== 5) { + // // // 新增时拿到项目和案卷的相同的字段的值 + // // this.formPreviewData.forEach(item => { + // // if (isAnOrJuan === 1) { + // // if (this.recycleMain.selectedDocument.isType !== 3) { + // // if (this.recycleMain.projectSelection[item.fieldName]) { + // // this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.projectSelection)) + // // } + // // } + // // } else if (isAnOrJuan === 2) { + // // if (this.recycleMain.anjuanSelection[item.fieldName]) { + // // this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.anjuanSelection)) + // // } + // // } + // // }) + // // } + // } + // this.isDesFormType = 'arcives' + // this.$refs.previewForm.FetchNoFormatField(this.categoryId) + }) + }) }, handleBatch() { this.$refs.batchForm.batchVisible = true @@ -339,10 +317,4 @@ export default { diff --git a/src/views/prearchiveLibrary/module/form.vue b/src/views/prearchiveLibrary/module/form.vue index 280a01f..cfebdc3 100644 --- a/src/views/prearchiveLibrary/module/form.vue +++ b/src/views/prearchiveLibrary/module/form.vue @@ -10,7 +10,7 @@
@@ -18,7 +18,8 @@ diff --git a/src/views/prearchiveLibrary/table.json b/src/views/prearchiveLibrary/table.json deleted file mode 100644 index b3d42c1..0000000 --- a/src/views/prearchiveLibrary/table.json +++ /dev/null @@ -1,46 +0,0 @@ -[ - { - "id": 1, - "title": "归档文件标题1", - "number": "[2020] 1号", - "date": "2020-10-01", - "problem": "档案室", - "officialIdent": "-", - "recordType": "决议", - "seClassification": "机密", - "period": "永久" - }, - { - "id": 2, - "title": "归档文件标题2", - "number": "[2020] 2号", - "date": "2020-10-01", - "problem": "档案室", - "officialIdent": "-", - "recordType": "决议", - "seClassification": "机密", - "period": "永久" - }, - { - "id": 3, - "title": "归档文件标题3", - "number": "[2020] 3号", - "date": "2020-10-01", - "problem": "档案室", - "officialIdent": "-", - "recordType": "决议", - "seClassification": "机密", - "period": "永久" - }, - { - "id": 4, - "title": "归档文件标题4", - "number": "[2020] 4号", - "date": "2020-10-01", - "problem": "档案室", - "officialIdent": "-", - "recordType": "决议", - "seClassification": "机密", - "period": "永久" - } -] diff --git a/src/views/prearchiveLibrary/treeList.vue b/src/views/prearchiveLibrary/treeList.vue new file mode 100644 index 0000000..fa6cf20 --- /dev/null +++ b/src/views/prearchiveLibrary/treeList.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/src/views/system/fileLibraryManage/index.vue b/src/views/system/fileLibraryManage/index.vue index 42c5b5c..7e69e52 100644 --- a/src/views/system/fileLibraryManage/index.vue +++ b/src/views/system/fileLibraryManage/index.vue @@ -52,10 +52,10 @@
  • 基本信息
  • -
  • 字段管理
  • -
  • 著录界面设置
  • -
  • 列表界面设置
  • -
  • 排序规则设置
  • +
  • 字段管理
  • +
  • 著录界面设置
  • +
  • 列表界面设置
  • +
  • 排序规则设置