|
@ -8,23 +8,27 @@ |
|
|
<!-- @input="changePid" --> |
|
|
<!-- @input="changePid" --> |
|
|
<treeselect |
|
|
<treeselect |
|
|
v-model="query.documentId" |
|
|
v-model="query.documentId" |
|
|
:options="sourceOptions" |
|
|
|
|
|
:load-options="loadSource" |
|
|
|
|
|
|
|
|
:options="documentTree" |
|
|
style="width: 320px;" |
|
|
style="width: 320px;" |
|
|
|
|
|
flat |
|
|
|
|
|
:multiple="false" |
|
|
|
|
|
:normalizer="normalizer" |
|
|
placeholder="请选择源分类(文件库分类)" |
|
|
placeholder="请选择源分类(文件库分类)" |
|
|
/> |
|
|
/> |
|
|
<treeselect |
|
|
<treeselect |
|
|
v-model="query.categoryId" |
|
|
v-model="query.categoryId" |
|
|
:options="targetOptions" |
|
|
|
|
|
:load-options="loadSource" |
|
|
|
|
|
|
|
|
:options="categoryTree" |
|
|
style="width: 320px;" |
|
|
style="width: 320px;" |
|
|
|
|
|
flat |
|
|
|
|
|
:multiple="false" |
|
|
|
|
|
:normalizer="normalizer" |
|
|
placeholder="请选择目标门类(整理库/管理库门类)" |
|
|
placeholder="请选择目标门类(整理库/管理库门类)" |
|
|
/> |
|
|
/> |
|
|
<rrOperation /> |
|
|
<rrOperation /> |
|
|
</div> |
|
|
</div> |
|
|
<crudOperation :permission="permission"> |
|
|
<crudOperation :permission="permission"> |
|
|
<template v-slot:middle> |
|
|
<template v-slot:middle> |
|
|
<el-button v-permission="permission.edit" size="mini" :disabled="crud.selections.length !== 1" @click="toEdit(crud.selections[0])"> |
|
|
|
|
|
|
|
|
<el-button size="mini" :disabled="crud.selections.length !== 1" @click="toEdit(crud.selections[0])"> |
|
|
<i class="iconfont icon-bianji" /> |
|
|
<i class="iconfont icon-bianji" /> |
|
|
编辑 |
|
|
编辑 |
|
|
</el-button> |
|
|
</el-button> |
|
@ -35,32 +39,39 @@ |
|
|
<el-dialog class="dialog-middle" append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" title="新增对应"> |
|
|
<el-dialog class="dialog-middle" append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" title="新增对应"> |
|
|
<div class="setting-dialog"> |
|
|
<div class="setting-dialog"> |
|
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px"> |
|
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px"> |
|
|
<el-form-item label="源分类" prop="source"> |
|
|
|
|
|
|
|
|
<el-form-item label="源分类" prop="documentId"> |
|
|
<treeselect |
|
|
<treeselect |
|
|
v-model="form.source" |
|
|
|
|
|
:options="sourceOptions" |
|
|
|
|
|
:load-options="loadSource" |
|
|
|
|
|
|
|
|
v-model="form.documentId" |
|
|
|
|
|
:options="documentTree" |
|
|
style="width: 400px;" |
|
|
style="width: 400px;" |
|
|
|
|
|
flat |
|
|
|
|
|
:multiple="false" |
|
|
|
|
|
:normalizer="normalizer" |
|
|
placeholder="请选择源分类(文件库分类)" |
|
|
placeholder="请选择源分类(文件库分类)" |
|
|
|
|
|
@select="handleSelectDocument" |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="目标门类" prop="target"> |
|
|
|
|
|
|
|
|
<el-form-item label="目标门类" prop="categoryId"> |
|
|
<treeselect |
|
|
<treeselect |
|
|
v-model="form.target" |
|
|
|
|
|
:options="targetOptions" |
|
|
|
|
|
:load-options="loadSource" |
|
|
|
|
|
|
|
|
v-model="form.categoryId" |
|
|
|
|
|
:options="categoryTree" |
|
|
style="width: 400px;" |
|
|
style="width: 400px;" |
|
|
|
|
|
flat |
|
|
|
|
|
:multiple="false" |
|
|
|
|
|
:normalizer="normalizer" |
|
|
placeholder="请选择目标门类(整理库/管理库门类)" |
|
|
placeholder="请选择目标门类(整理库/管理库门类)" |
|
|
|
|
|
@select="handleSelectCategory" |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button type="text" @click="crud.cancelCU">取消</el-button> |
|
|
<el-button type="text" @click="crud.cancelCU">取消</el-button> |
|
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="toCorresForm">确定</el-button> |
|
|
|
|
|
|
|
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="toCorresForm('form')">确定</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
<eForm ref="corresForm" /> |
|
|
<eForm ref="corresForm" /> |
|
|
|
|
|
<DetailModule ref="detail" /> |
|
|
<!--表格渲染--> |
|
|
<!--表格渲染--> |
|
|
<div class="container-wrap"> |
|
|
<div class="container-wrap"> |
|
|
<span class="right-top-line" /> |
|
|
<span class="right-top-line" /> |
|
@ -76,13 +87,13 @@ |
|
|
@cell-dblclick="tableDoubleClick" |
|
|
@cell-dblclick="tableDoubleClick" |
|
|
> |
|
|
> |
|
|
<el-table-column type="selection" width="55" /> |
|
|
<el-table-column type="selection" width="55" /> |
|
|
<el-table-column :show-overflow-tooltip="true" prop="name" label="规则名称" /> |
|
|
|
|
|
<el-table-column :show-overflow-tooltip="true" prop="sourceClassify" label="源分类(文件库-文件表)" /> |
|
|
|
|
|
<el-table-column :show-overflow-tooltip="true" prop="target" label=" 目标门类(整理库/管理库-文件表)" /> |
|
|
|
|
|
<el-table-column :show-overflow-tooltip="true" prop="number" label="已对应字段数量" /> |
|
|
|
|
|
<el-table-column prop="createTime" label="创建日期" width="200px"> |
|
|
|
|
|
|
|
|
<el-table-column :show-overflow-tooltip="true" prop="rule_name" label="规则名称" /> |
|
|
|
|
|
<el-table-column :show-overflow-tooltip="true" prop="documentName" label="源分类(文件库-文件表)" /> |
|
|
|
|
|
<el-table-column :show-overflow-tooltip="true" prop="categoryName" label=" 目标门类(整理库/管理库-文件表)" /> |
|
|
|
|
|
<el-table-column :show-overflow-tooltip="true" prop="mate_num" label="已对应字段数量" /> |
|
|
|
|
|
<el-table-column prop="create_time" label="创建日期" width="200px"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<div>{{ scope.row.createTime | parseTime }}</div> |
|
|
|
|
|
|
|
|
<div>{{ scope.row.create_time | parseTime }}</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
@ -91,20 +102,25 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
// 获取文件库树 |
|
|
|
|
|
import { FetchDocumentMenu, FetchInitDocumentFieldByPid } from '@/api/system/fileLibrary/fileLibrary' |
|
|
|
|
|
// 获取档案门类树 |
|
|
|
|
|
import { FetchCategoryMenu, FetchInitCategoryFieldByPid } from '@/api/system/category/category' |
|
|
import crudFieldMate from '@/api/system/fieldMate' |
|
|
import crudFieldMate from '@/api/system/fieldMate' |
|
|
import Treeselect from '@riophae/vue-treeselect' |
|
|
import Treeselect from '@riophae/vue-treeselect' |
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
|
|
import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect' |
|
|
|
|
|
|
|
|
// import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect' |
|
|
import CRUD, { presenter, header, form, crud } from '@crud/crud' |
|
|
import CRUD, { presenter, header, form, crud } from '@crud/crud' |
|
|
import rrOperation from '@crud/RR.operation' |
|
|
import rrOperation from '@crud/RR.operation' |
|
|
import crudOperation from '@crud/CRUD.operation' |
|
|
import crudOperation from '@crud/CRUD.operation' |
|
|
import eForm from './module/form.vue' |
|
|
|
|
|
|
|
|
import eForm from './module/form' |
|
|
|
|
|
import DetailModule from './module/detail' |
|
|
|
|
|
|
|
|
// crud交由presenter持有 |
|
|
// crud交由presenter持有 |
|
|
const defaultForm = { id: null, target: null, source: null } |
|
|
|
|
|
|
|
|
const defaultForm = { documentId: null, categoryId: null } |
|
|
export default { |
|
|
export default { |
|
|
name: 'FieldCorresManage', |
|
|
name: 'FieldCorresManage', |
|
|
components: { crudOperation, rrOperation, Treeselect, eForm }, |
|
|
|
|
|
|
|
|
components: { crudOperation, rrOperation, Treeselect, eForm, DetailModule }, |
|
|
cruds() { |
|
|
cruds() { |
|
|
return CRUD({ |
|
|
return CRUD({ |
|
|
title: '对应关系', |
|
|
title: '对应关系', |
|
@ -123,49 +139,145 @@ export default { |
|
|
mixins: [presenter(), header(), form(defaultForm), crud()], |
|
|
mixins: [presenter(), header(), form(defaultForm), crud()], |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
sourceOptions: [], |
|
|
|
|
|
targetOptions: [], |
|
|
|
|
|
permission: { |
|
|
permission: { |
|
|
|
|
|
add: ['admin', 'fieldMate:add'], |
|
|
|
|
|
edit: ['admin', 'fieldMate:edit'], |
|
|
|
|
|
del: ['admin', 'fieldMate:del'] |
|
|
}, |
|
|
}, |
|
|
|
|
|
categoryTree: [], |
|
|
|
|
|
documentTree: [], |
|
|
|
|
|
selectedCategoryName: null, |
|
|
|
|
|
selectedDocumentName: null, |
|
|
rules: { |
|
|
rules: { |
|
|
source: [ |
|
|
|
|
|
|
|
|
documentId: [ |
|
|
{ required: true, message: '请选择源分类(文件库分类)', trigger: 'input' } |
|
|
{ required: true, message: '请选择源分类(文件库分类)', trigger: 'input' } |
|
|
], |
|
|
], |
|
|
target: [ |
|
|
|
|
|
|
|
|
categoryId: [ |
|
|
{ required: true, message: '请选择目标门类(整理库/管理库门类)', trigger: 'input' } |
|
|
{ required: true, message: '请选择目标门类(整理库/管理库门类)', trigger: 'input' } |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
created() { |
|
|
|
|
|
this.getCategoryDataTree() |
|
|
|
|
|
this.getDocumentDataTree() |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 新增与编辑前做的操作 |
|
|
// 新增与编辑前做的操作 |
|
|
[CRUD.HOOK.afterToCU](crud, form) { |
|
|
[CRUD.HOOK.afterToCU](crud, form) { |
|
|
}, |
|
|
}, |
|
|
toCorresForm() { |
|
|
|
|
|
this.$refs.corresForm.corresVisible = true |
|
|
|
|
|
|
|
|
filterData(data) { |
|
|
|
|
|
return data.filter(node => { |
|
|
|
|
|
if (node.children && node.children.length > 0) { |
|
|
|
|
|
node.children = this.filterData(node.children) // 递归处理子节点 |
|
|
|
|
|
} |
|
|
|
|
|
return node.isType !== 3 // 过滤掉isType为3的节点 |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
getCategoryDataTree() { |
|
|
|
|
|
FetchCategoryMenu().then(res => { |
|
|
|
|
|
this.categoryTree = this.filterData(res) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
getDocumentDataTree() { |
|
|
|
|
|
FetchDocumentMenu().then(res => { |
|
|
|
|
|
this.documentTree = this.filterData(res) |
|
|
|
|
|
// this.documentTree = res |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// getDisplayFieldData(id) { |
|
|
|
|
|
// FetchInitDocumentField({ documentId: id, isType: 2 }).then((res) => { |
|
|
|
|
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
// }, |
|
|
|
|
|
handleSelectCategory(val) { |
|
|
|
|
|
console.log(val) |
|
|
|
|
|
this.selectedCategoryName = val.cnName |
|
|
|
|
|
}, |
|
|
|
|
|
handleSelectDocument(val) { |
|
|
|
|
|
console.log(val) |
|
|
|
|
|
this.selectedDocumentName = val.cnName |
|
|
|
|
|
}, |
|
|
|
|
|
toCorresForm(formName) { |
|
|
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
|
|
if (valid) { |
|
|
|
|
|
console.log(this.form) |
|
|
|
|
|
crudFieldMate.FetchCheckRepeat(this.form).then((res) => { |
|
|
|
|
|
this.$refs.corresForm.corresVisible = true |
|
|
|
|
|
if (res) { |
|
|
|
|
|
this.$refs.corresForm.isHasCorres = 0 |
|
|
|
|
|
this.$refs.corresForm.documentName = this.selectedDocumentName |
|
|
|
|
|
this.$refs.corresForm.categoryName = this.selectedCategoryName |
|
|
|
|
|
FetchInitDocumentFieldByPid({ documentId: this.form.documentId }).then((res) => { |
|
|
|
|
|
console.log('field', res) |
|
|
|
|
|
this.$refs.corresForm.options = res |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
FetchInitCategoryFieldByPid({ categoryId: this.form.categoryId }).then((res) => { |
|
|
|
|
|
console.log('field2', res) |
|
|
|
|
|
this.$refs.corresForm.targetData = res |
|
|
|
|
|
res.forEach((item, index) => { |
|
|
|
|
|
console.log('dd', item.isDisplay) |
|
|
|
|
|
this.$refs.corresForm.selectStatus.push({ mode: true, value: '', isDisplay: item.isDisplay }) |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
// FetchInitDocumentField({ documentId: this.form.documentId, isType: 2 }).then((res) => { |
|
|
|
|
|
// console.log('field', res) |
|
|
|
|
|
// }).catch(err => { |
|
|
|
|
|
// console.log(err) |
|
|
|
|
|
// }) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$refs.corresForm.isHasCorres = 1 |
|
|
|
|
|
// const params = { |
|
|
|
|
|
// 'id': '1' |
|
|
|
|
|
// } |
|
|
|
|
|
// crudFieldMate.FetchInitFieldMate(params).then((res) => { |
|
|
|
|
|
// this.$refs.corresForm.cuform = res |
|
|
|
|
|
// this.$refs.corresForm.targetData = res |
|
|
|
|
|
// }).catch(err => { |
|
|
|
|
|
// console.log(err) |
|
|
|
|
|
// }) |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
console.log('error submit!!') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// table - 双击查看详情 |
|
|
// table - 双击查看详情 |
|
|
tableDoubleClick(row) { |
|
|
tableDoubleClick(row) { |
|
|
this.$refs.corresForm.title = '对应关系' |
|
|
|
|
|
this.$refs.corresForm.corresVisible = true |
|
|
|
|
|
|
|
|
const params = { |
|
|
|
|
|
'id': row.id |
|
|
|
|
|
} |
|
|
|
|
|
this.getInitDetail(params) |
|
|
|
|
|
}, |
|
|
|
|
|
getInitDetail(params) { |
|
|
|
|
|
crudFieldMate.FetchInitFieldMate(params).then((res) => { |
|
|
|
|
|
this.$refs.detail.detailVisible = true |
|
|
|
|
|
this.$refs.detail.detailData = res |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
toEdit() { |
|
|
toEdit() { |
|
|
this.$refs.corresForm.title = '编辑对应关系' |
|
|
this.$refs.corresForm.title = '编辑对应关系' |
|
|
this.$refs.corresForm.corresVisible = true |
|
|
this.$refs.corresForm.corresVisible = true |
|
|
}, |
|
|
}, |
|
|
loadSource({ action, parentNode, callback }) { |
|
|
|
|
|
if (action === LOAD_CHILDREN_OPTIONS) { |
|
|
|
|
|
// crudMenu.getMenusTree(parentNode.id).then(res => { |
|
|
|
|
|
// parentNode.children = res.map(function(obj) { |
|
|
|
|
|
// if (!obj.leaf) { |
|
|
|
|
|
// obj.children = null |
|
|
|
|
|
// } |
|
|
|
|
|
// return obj |
|
|
|
|
|
// }) |
|
|
|
|
|
// setTimeout(() => { |
|
|
|
|
|
// callback() |
|
|
|
|
|
// }, 100) |
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
normalizer(node) { |
|
|
|
|
|
if (node.children && !node.children.length) { |
|
|
|
|
|
delete node.children |
|
|
|
|
|
} |
|
|
|
|
|
return { |
|
|
|
|
|
id: node.id, |
|
|
|
|
|
label: node.cnName, |
|
|
|
|
|
children: node.children, |
|
|
|
|
|
isDisabled: node.isType !== 2 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -173,4 +285,9 @@ export default { |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
|
|
|
.head-search{ |
|
|
|
|
|
.vue-treeselect{ |
|
|
|
|
|
font-size: 12px; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |