Browse Source

预归档-form

master
xuhuajiao 2 years ago
parent
commit
2d6bad090b
  1. 120
      src/views/prearchiveLibrary/index.vue
  2. 79
      src/views/prearchiveLibrary/module/form.vue
  3. 46
      src/views/prearchiveLibrary/table.json

120
src/views/prearchiveLibrary/index.vue

@ -30,13 +30,22 @@
<rrOperation />
</div>
<crudOperation :permission="permission">
<template v-slot:left>
<!-- 新增 -->
<el-button size="mini" @click="handleForm('add')"><i class="iconfont icon-xinzeng" />新增</el-button>
<!-- 修改 -->
<el-button size="mini" :disabled="crud.selections.length !== 1" @click="handleForm('edit')"><i class="iconfont icon-bianji" />编辑</el-button>
<!-- 删除btn 多选 -->
<el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"><i class="iconfont icon-shanchu" />删除</el-button>
</template>
<template v-slot:right>
<el-button size="mini">批量成件</el-button>
<el-button size="mini">合并成件</el-button>
<el-button size="mini">移动</el-button>
<el-button size="mini" :disabled="crud.selections.length === 0">批量成件</el-button>
<el-button size="mini" :disabled="crud.selections.length === 0">合并成件</el-button>
<el-button size="mini" :disabled="crud.selections.length === 0">移动</el-button>
</template>
</crudOperation>
</div>
<eForm ref="eform" />
<!--表格渲染-->
<div class="container-right">
<span class="right-top-line" />
@ -44,9 +53,7 @@
<el-table
ref="table"
v-loading="crud.loading"
lazy
:data="crud.data"
row-key="id"
:data="table"
@select="crud.selectChange"
@select-all="crud.selectAllChange"
@selection-change="crud.selectionChangeHandler"
@ -65,6 +72,19 @@
<!--分页组件-->
<pagination v-if="crud.data.length!==0" />
</div>
<!--删除对话框组件-->
<el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="deleteVisible">
<div class="setting-dialog">
<div class="tip-content">
<p class="tipMsg">此操作将删除当前所选预归档数据</p>
<span>你是否还要继续?</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="deleteVisible = false">取消</el-button>
<el-button type="primary" @click.native="handleDelConfirm">确定</el-button>
</div>
</div>
</el-dialog>
</div>
</div>
</div>
@ -75,20 +95,23 @@ import crudCategory from '@/api/category/category'
import CRUD, { presenter, header } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import dataJson from './data.json'
import tableJson from './table.json'
import eForm from './module/form.vue'
export default {
name: 'PrearchiveLibrary',
components: { rrOperation, crudOperation },
components: { eForm, rrOperation, crudOperation, pagination },
cruds() {
return [
CRUD({
title: '预归档库', url: 'api/archives-type/menu',
crudMethod: { ...crudCategory },
optShow: {
add: true,
edit: true,
del: true,
add: false,
edit: false,
del: false,
download: true,
group: false,
reset: true
@ -105,13 +128,20 @@ export default {
del: ['admin', 'prearchiveLibrary:del'],
sort: ['admin', 'prearchiveLibrary:sort']
},
treeList: []
defaultProps: {
children: 'children',
label: 'label'
},
treeList: [],
table: [],
deleteVisible: false
}
},
computed: {
},
created() {
this.treeList = dataJson
this.table = tableJson
},
methods: {
//
@ -144,6 +174,74 @@ export default {
},
//
handleNodeClick(val) {
},
// -form/-api
handleForm(type) {
this.$refs.eform.formVisible = true
if (type === 'add') {
this.$refs.eform.formTitle = '新增文件'
} else if (type === 'edit') {
this.$refs.eform.formTitle = '编辑文件'
}
//
const params = {
categoryId: this.categoryId,
archivesId: this.arcId
}
this.getFormInfo(params, type)
},
//
toDelete(data) {
this.deleteVisible = true
},
//
handleDelConfirm(data) {
this.deleteVisible = false
// const params = data.map(item => {
// return item.id
// })
// del(params).then(res => {
// if (res.doDel.length === 0) {
// this.$message.error('')
// } else {
// if (res.doDel.length === data.length) {
// this.$message.success('')
// } else {
// this.$message.success('')
// }
// }
// this.deleteVisible = false
// 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)
// })
// })
}
}
}

79
src/views/prearchiveLibrary/module/form.vue

@ -0,0 +1,79 @@
<template>
<!--新增 / 编辑 表单组件-->
<el-dialog class="preview-dialog" :modal-append-to-body="false" :close-on-click-modal="false" :before-close="handleClose" :visible="formVisible" :title="formTitle">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<!-- form -->
<!-- <PreviewForm ref="previewForm" :form-preview-data.sync="formPreviewData" :selected-category="selectedCategory" :parents-id="parentsId" :arc-id="arcId" :is-des-form-type="isDesFormType" @emitTableList="getTableList" /> -->
<div slot="footer" class="dialog-footer">
<!-- :loading="crud.status.cu === 2" -->
<el-button type="text" @click="formVisible = false">取消</el-button>
<el-button type="primary" @click="formVisible = false">确定</el-button>
</div>
</div>
</el-dialog>
</template>
<script>
// import PreviewForm from '@/views/components/category/PreviewForm'
export default {
// components: { PreviewForm },
data() {
return {
formVisible: false,
formTitle: '新增文件',
loading: false
}
},
methods: {
handleClose(done) {
done()
},
save() {
// this.loading = true
// if (this.title === '') {
// const addData = this.formData.fields.map((item) => {
// return {
// dictionaryId: item.id,
// fieldName: item.fieldName,
// fieldCnName: item.fieldCnName,
// connector: item.connector,
// categoryId: item.categoryId
// }
// })
// add(addData).then((res) => {
// this.$message({
// message: '',
// type: 'success',
// duration: 2500
// })
// this.cuDialogVisible = false
// this.loading = false
// this.$emit('refresh')
// })
// } else {
// edit(this.formData.fields).then((res) => {
// this.$message({
// message: '',
// type: 'success',
// duration: 2500
// })
// this.cuDialogVisible = false
// this.loading = false
// this.$emit('refresh')
// })
// }
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.fields-list {
max-height: calc(100vh - 312px);
overflow-x: hidden;
overflow-y: auto;
position: relative;
}
</style>

46
src/views/prearchiveLibrary/table.json

@ -0,0 +1,46 @@
[
{
"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": "永久"
}
]
Loading…
Cancel
Save