-
-
-
-
-
-
-
-
- {{ data.cnName }}
-
-
- {{ data.cnName }}
-
-
-
-
-
+
-
+
@@ -55,24 +39,30 @@
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ field.fieldCnName }}
+
+
+
+ {{ scope.row[field.fieldName] }}
+
+
-
+
@@ -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 @@
+
+
+
+
+
+
+
+
+
+
+ {{ data.cnName }}
+
+
+ {{ data.cnName }}
+
+
+
+
+
+
+
+
+
+
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 @@
- 基本信息
- - 字段管理
- - 著录界面设置
- - 列表界面设置
- - 排序规则设置
+ - 字段管理
+ - 著录界面设置
+ - 列表界面设置
+ - 排序规则设置