xuhuajiao
1 year ago
10 changed files with 520 additions and 232 deletions
-
52src/api/prearchiveLibrary/prearchiveLibrary.js
-
5src/components/Crud/crud.js
-
21src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
-
151src/views/collectReorganizi/collectionLibrary/module/fileSeqAdjustment/index.vue
-
27src/views/components/category/PreviewForm.vue
-
196src/views/prearchiveLibrary/index.vue
-
19src/views/prearchiveLibrary/module/form.vue
-
46src/views/prearchiveLibrary/table.json
-
109src/views/prearchiveLibrary/treeList.vue
-
8src/views/system/fileLibraryManage/index.vue
@ -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 } |
@ -0,0 +1,151 @@ |
|||||
|
<template> |
||||
|
<!-- 卷内顺序调整 --> |
||||
|
<div> |
||||
|
<el-dialog class="adjust-dialog" title="卷内顺序调整" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="adjustmentVisible" @opened="opened"> |
||||
|
<div class="setting-dialog"> |
||||
|
<div class="base-info"> |
||||
|
<p>案卷档号:YXK-2022-JJ-001</p> |
||||
|
<p>案卷题名:案卷名称123</p> |
||||
|
</div> |
||||
|
<i class="drag-tip">提示:请通过拖动鼠标来调整当前顺序</i> |
||||
|
<el-table :data="sortTableData" :tree-props="{children: 'childrens'}" class="category-sort" style="width: 100%;" row-key="id"> |
||||
|
<el-table-column type="index" label="序号" width="100" align="center" /> |
||||
|
<el-table-column prop="archive_no" label="字段名称" /> |
||||
|
</el-table> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button @click="adjustmentVisible = false">取消</el-button> |
||||
|
<el-button type="primary" @click.native="handleSort">确定</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import Sortable from 'sortablejs' |
||||
|
export default { |
||||
|
name: 'FileSeqAdjustment', |
||||
|
components: { }, |
||||
|
mixins: [], |
||||
|
props: { |
||||
|
selectedCategory: { |
||||
|
type: Object, |
||||
|
default: function() { |
||||
|
return {} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
adjustmentVisible: false, |
||||
|
sortTableData: [ |
||||
|
{ |
||||
|
'case_no': '746DF968E7E629CAEFF889', |
||||
|
'responsibleby': '发文机关003', |
||||
|
'children_num': 0, |
||||
|
'tid': '', |
||||
|
'medium_qty': '1', |
||||
|
'maintitle': '发文标题003', |
||||
|
'security_class': '秘密', |
||||
|
'archive_year': 2023, |
||||
|
'archive_no': 'AA001-Y-WS.W-2023-001-001', |
||||
|
'created_date': '2023-07-02', |
||||
|
'id': '17D5B3A9B0A0092CA96DAE', |
||||
|
'is_storage': 2, |
||||
|
'is_borrow': 3 |
||||
|
}, |
||||
|
{ |
||||
|
'case_no': '746DF968E7E629CAEFF889', |
||||
|
'responsibleby': '', |
||||
|
'children_num': 0, |
||||
|
'tid': '', |
||||
|
'medium_qty': '0', |
||||
|
'maintitle': '卷册01002', |
||||
|
'security_class': '秘密', |
||||
|
'archive_year': 2023, |
||||
|
'archive_no': 'AA001-Y-WS.W-2023-001-002', |
||||
|
'created_date': '', |
||||
|
'id': '8B7D6D926100324DFCCDA5', |
||||
|
'is_storage': 2, |
||||
|
'is_borrow': 3 |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
selectedCategory: function(newValue, oldValue) { |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
}, |
||||
|
mounted() { |
||||
|
}, |
||||
|
methods: { |
||||
|
// 行拖拽 |
||||
|
rowDrop(className, targetName) { |
||||
|
// 此时找到的元素是要拖拽元素的父容器 |
||||
|
const tbody = document.querySelector('.' + className + ' .el-table__body-wrapper tbody') |
||||
|
const that = this |
||||
|
Sortable.create(tbody, { |
||||
|
// 指定父元素下可被拖拽的子元素 |
||||
|
draggable: '.el-table__row', |
||||
|
onEnd({ newIndex, oldIndex }) { |
||||
|
if (newIndex === oldIndex) return |
||||
|
that[targetName].splice(newIndex, 0, that[targetName].splice(oldIndex, 1)[0]) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
opened() { |
||||
|
this.rowDrop('category-sort', 'sortTableData') |
||||
|
}, |
||||
|
handleSort() { |
||||
|
const data = this.sortTableData.map((value, index) => { |
||||
|
return { id: value.id, sort: index + 1 } |
||||
|
}) |
||||
|
this.sortTableData.forEach((item, index) => { |
||||
|
item.categorySeq = index + 1 |
||||
|
}) |
||||
|
console.log(data) |
||||
|
// sort(data).then(() => { |
||||
|
// this.sortVisible = false |
||||
|
// this.$message({ |
||||
|
// message: '保存成功', |
||||
|
// type: 'success', |
||||
|
// duration: 2500 |
||||
|
// }) |
||||
|
// this.$emit('treeNodeSort', this.sortTableData) |
||||
|
// }) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang='scss' scoped> |
||||
|
.adjust-dialog{ |
||||
|
::v-deep .el-dialog{ |
||||
|
width: 815px; |
||||
|
.el-dialog__body{ |
||||
|
padding: 16px 0 30px 0; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
.base-info{ |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
color: #0c0e1e; |
||||
|
padding: 0 20px 30px 20px; |
||||
|
p{ |
||||
|
flex: 1; |
||||
|
} |
||||
|
} |
||||
|
.drag-tip { |
||||
|
display: block; |
||||
|
padding-left: 20px; |
||||
|
padding-bottom: 10px; |
||||
|
font-style: normal; |
||||
|
font-weight: bold; |
||||
|
font-size: 12px; |
||||
|
} |
||||
|
</style> |
@ -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": "永久" |
|
||||
} |
|
||||
] |
|
@ -0,0 +1,109 @@ |
|||||
|
<template> |
||||
|
|
||||
|
<div class="container-left"> |
||||
|
<span class="right-top-line" /> |
||||
|
<span class="left-bottom-line" /> |
||||
|
<!--门类树状结构--> |
||||
|
<div class="tree-scroll"> |
||||
|
<el-tree ref="tree" v-loading="crud.loading" :data="crud.data" :props="defaultProps" node-key="id" :expand-on-click-node="false" highlight-current @node-click="handleNodeClick"> |
||||
|
<span slot-scope="{ node, data }" class="custom-tree-node"> |
||||
|
<span v-if="data.isType === 1 " class="iconFolder"> |
||||
|
{{ data.cnName }} |
||||
|
</span> |
||||
|
<span v-if="data.isType === 2" class="iconFile"> |
||||
|
{{ data.cnName }} |
||||
|
</span> |
||||
|
</span> |
||||
|
</el-tree> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import CRUD, { presenter, header } from '@crud/crud' |
||||
|
import { preLibraryCrud } from './mixins/index' |
||||
|
|
||||
|
export default { |
||||
|
name: 'PrearchiveTree', |
||||
|
components: { }, |
||||
|
cruds() { |
||||
|
return [ |
||||
|
CRUD({ |
||||
|
title: '预归档库', url: 'api/document/menu', |
||||
|
crudMethod: { }, |
||||
|
optShow: { |
||||
|
add: false, |
||||
|
edit: false, |
||||
|
del: false, |
||||
|
download: true, |
||||
|
group: false, |
||||
|
reset: true |
||||
|
} |
||||
|
}) |
||||
|
] |
||||
|
}, |
||||
|
mixins: [presenter(), header(), preLibraryCrud], |
||||
|
data() { |
||||
|
return { |
||||
|
permission: { |
||||
|
add: ['admin', 'prearchiveLibrary:add'], |
||||
|
edit: ['admin', 'prearchiveLibrary:edit'], |
||||
|
del: ['admin', 'prearchiveLibrary:del'], |
||||
|
sort: ['admin', 'prearchiveLibrary:sort'] |
||||
|
}, |
||||
|
defaultProps: { |
||||
|
children: 'children', |
||||
|
label: 'cnName' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
}, |
||||
|
created() { |
||||
|
}, |
||||
|
methods: { |
||||
|
[CRUD.HOOK.beforeToAdd](crud, form, btn) { |
||||
|
}, |
||||
|
[CRUD.HOOK.afterRefresh]() { |
||||
|
this.crud.data = this.filterData(this.crud.data) |
||||
|
this.$nextTick(() => { |
||||
|
let currentKey |
||||
|
if (this.crud.data[0].isType === 1) { |
||||
|
currentKey = this.findNode(this.crud.data[0].children, (node) => { |
||||
|
return node.isType !== 1 |
||||
|
}) |
||||
|
} 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.$emit('nodeClick', val) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang='scss' scoped> |
||||
|
[data-theme=dark] .elect-cont-left .container-left { |
||||
|
min-height: calc(100vh - 158px); |
||||
|
} |
||||
|
.tree-scroll{ |
||||
|
font-size: 14px; |
||||
|
} |
||||
|
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue