Browse Source

对应字段管理

master
xuhuajiao 1 year ago
parent
commit
2f7d254097
  1. 11
      src/api/system/category/category.js
  2. 11
      src/api/system/fieldMate.js
  3. 13
      src/api/system/fileLibrary/fileLibrary.js
  4. 10
      src/views/system/archivesCategory/index.vue
  5. 207
      src/views/system/fieldCorresManage/index.vue
  6. 22
      src/views/system/fieldCorresManage/module/data.json
  7. 89
      src/views/system/fieldCorresManage/module/detail.vue
  8. 52
      src/views/system/fieldCorresManage/module/form.vue
  9. 4
      src/views/system/fileLibraryManage/descriptionPreview/index.vue
  10. 4
      src/views/system/fileLibraryManage/listBrowsing/index.vue

11
src/api/system/category/category.js

@ -105,4 +105,13 @@ export function FetchUpardicSort(data) {
}) })
} }
export default { add, edit, del, FetchCategoryMenu, FetchInitCategoryField, FetchUpardicSort }
// 著录界面排序
export function FetchInitCategoryFieldByPid(params) {
return request({
url: 'api/category/initCategoryFieldByPid',
method: 'get',
params
})
}
export default { add, edit, del, FetchCategoryMenu, FetchInitCategoryField, FetchUpardicSort, FetchInitCategoryFieldByPid }

11
src/api/system/fieldMate.js

@ -8,6 +8,15 @@ export function FetchInitFieldMateList(params) {
}) })
} }
// 检测源分类是否与门类关联
export function FetchCheckRepeat(params) {
return request({
url: 'api/fieldMate/checkRepeat',
method: 'get',
params
})
}
export function add(data) { export function add(data) {
return request({ return request({
url: 'api/fieldMate/editFieldMate', url: 'api/fieldMate/editFieldMate',
@ -41,4 +50,4 @@ export function FetchInitFieldMate(params) {
}) })
} }
export default { add, edit, del, FetchInitFieldMateList, FetchInitFieldMate }
export default { add, edit, del, FetchInitFieldMateList, FetchCheckRepeat, FetchInitFieldMate }

13
src/api/system/fileLibrary/fileLibrary.js

@ -44,7 +44,7 @@ export function sort(data) {
} }
// 门类下得字段 // 门类下得字段
export function FetchInitCategoryField(params) {
export function FetchInitDocumentField(params) {
return request({ return request({
url: 'api/document/initDocumentField', url: 'api/document/initDocumentField',
method: 'get', method: 'get',
@ -61,4 +61,13 @@ export function FetchUpardicSort(data) {
}) })
} }
export default { add, edit, del, sort, FetchDocumentMenu }
// 根据父级门类id获取门类字段
export function FetchInitDocumentFieldByPid(params) {
return request({
url: 'api/document/initDocumentFieldByPid',
method: 'get',
params
})
}
export default { add, edit, del, sort, FetchDocumentMenu, FetchInitDocumentFieldByPid }

10
src/views/system/archivesCategory/index.vue

@ -53,11 +53,11 @@
<span class="left-bottom-line" /> <span class="left-bottom-line" />
<ul class="tab-nav"> <ul class="tab-nav">
<li :class="{'active-tab-nav': activeIndex == 0}" @click="changeActiveTab(0)">基本信息<i /></li> <li :class="{'active-tab-nav': activeIndex == 0}" @click="changeActiveTab(0)">基本信息<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType === 3" :class="{'active-tab-nav': activeIndex == 1}" @click="changeActiveTab(1)">门类字段管理<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType === 3" :class="{'active-tab-nav': activeIndex == 2}" @click="changeActiveTab(2)">著录界面管理<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType === 3" :class="{'active-tab-nav': activeIndex == 3}" @click="changeActiveTab(3)">列表界面浏览设置<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType === 3" :class="{'active-tab-nav': activeIndex == 4}" @click="changeActiveTab(4)">浏览排序规则设置<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType === 3" :class="{'active-tab-nav': activeIndex == 5}" @click="changeActiveTab(5)">档号规则设置<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType === 3 && selectedCategory.cnName !== '电子原文表'" :class="{'active-tab-nav': activeIndex == 1}" @click="changeActiveTab(1)">门类字段管理<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType === 3 && selectedCategory.cnName !== '电子原文表'" :class="{'active-tab-nav': activeIndex == 2}" @click="changeActiveTab(2)">著录界面管理<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType === 3 && selectedCategory.cnName !== '电子原文表'" :class="{'active-tab-nav': activeIndex == 3}" @click="changeActiveTab(3)">列表界面浏览设置<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType === 3 && selectedCategory.cnName !== '电子原文表'" :class="{'active-tab-nav': activeIndex == 4}" @click="changeActiveTab(4)">浏览排序规则设置<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType === 3 && selectedCategory.cnName !== '电子原文表'" :class="{'active-tab-nav': activeIndex == 5}" @click="changeActiveTab(5)">档号规则设置<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType !== 1 && selectedCategory.isType !== 3" :class="{'active-tab-nav': activeIndex == 6}" @click="changeActiveTab(6)">归档章设置<i /></li> <li v-if="selectedCategory.isType && selectedCategory.isType !== 1 && selectedCategory.isType !== 3" :class="{'active-tab-nav': activeIndex == 6}" @click="changeActiveTab(6)">归档章设置<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType !== 1 && selectedCategory.isType !== 3" :class="{'active-tab-nav': activeIndex == 7}" @click="changeActiveTab(7)">公共筛选<i /></li> <li v-if="selectedCategory.isType && selectedCategory.isType !== 1 && selectedCategory.isType !== 3" :class="{'active-tab-nav': activeIndex == 7}" @click="changeActiveTab(7)">公共筛选<i /></li>
<li v-if="selectedCategory.isType && selectedCategory.isType !== 1 && selectedCategory.isType !== 3" :class="{'active-tab-nav': activeIndex == 8}" @click="changeActiveTab(8)">流程管理<i /></li> <li v-if="selectedCategory.isType && selectedCategory.isType !== 1 && selectedCategory.isType !== 3" :class="{'active-tab-nav': activeIndex == 8}" @click="changeActiveTab(8)">流程管理<i /></li>

207
src/views/system/fieldCorresManage/index.vue

@ -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'
// crudpresenter // crudpresenter
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 // isType3
})
},
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>

22
src/views/system/fieldCorresManage/module/data.json

@ -1,22 +0,0 @@
[
{
"id": 1,
"label": "字段A",
"isType": 1
},
{
"id": 2,
"label": "字段B",
"isType": 0
},
{
"id": 3,
"label": "字段C",
"isType": 1
},
{
"id": 4,
"label": "字段D",
"isType": 1
}
]

89
src/views/system/fieldCorresManage/module/detail.vue

@ -0,0 +1,89 @@
<template>
<el-dialog
append-to-body
:close-on-click-modal="false"
:before-close="handleClose"
:visible="detailVisible"
title="对应关系"
>
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<div class="detail-top">
<span>规则名称</span>
<p>{{ detailData.ruleName }}</p>
</div>
<div class="corres-field-main">
<div class="corres-field-list corres-field-middle">
<div class="corres-field-title">
<p>源分类文件库-文件表</p>
<span>{{ detailData.documentName }}</span>
</div>
<div class="field-list">
<div v-for="(item, index) in detailData.fieldMateDetails" :key="index" class="field-item">
<p>
{{ item.documentFieldId.fieldCnName }}
</p>
<div class="field-state"><span :class=" item.isDisplay ? 'is-select' : 'is-hide'">{{ item.isDisplay ? '显示': '隐藏' }}</span></div>
</div>
</div>
</div>
<div class="corres-field-list corres-field-right">
<div class="corres-field-title">
<p>目标门类整理库/管理库-文件表</p>
<span>{{ detailData.categoryName }}</span>
</div>
<div class="field-list">
<div v-for="(item,index) in detailData.fieldMateDetails" :key="index" class="field-item">
<p>{{ item.categoryFieldId.fieldCnName }}</p>
<div class="field-state"><span :class=" item.isDisplay ? 'is-select' : 'is-hide'">{{ item.isDisplay ? '显示': '隐藏' }}</span></div>
</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="detailVisible = falseS"> 确定 </el-button>
</div>
</div>
</el-dialog>
</template>
<script>
import { crud } from '@crud/crud'
export default {
mixins: [crud()],
props: {
},
data() {
return {
title: '对应关系',
detailVisible: false,
detailData: {}
}
},
created() {
},
mounted() {
},
methods: {
handleClose() {
this.detailVisible = false
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .el-dialog {
width: 829px;
.el-dialog__body{
.detail-top{
display: flex;
justify-content: center;
margin-bottom: 30px;
color: #0c0e1e;
font-weight: bold;
}
}
}
</style>

52
src/views/system/fieldCorresManage/module/form.vue

@ -10,42 +10,43 @@
<span class="dialog-left-bottom" /> <span class="dialog-left-bottom" />
<div class="setting-dialog"> <div class="setting-dialog">
<el-form ref="cuForm" :model="cuform" :rules="rules" inline size="small" label-width="100px"> <el-form ref="cuForm" :model="cuform" :rules="rules" inline size="small" label-width="100px">
<el-form-item label="规则名称:" prop="name">
<el-input v-model="cuform.name" disabled />
<el-form-item label="规则名称:" prop="ruleName">
<!-- :disabled="isHasCorres" -->
<el-input v-model="cuform.ruleName" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="corres-field-main"> <div class="corres-field-main">
<div class="corres-field-list corres-field-middle"> <div class="corres-field-list corres-field-middle">
<div class="corres-field-title"> <div class="corres-field-title">
<p>源分类文件库-文件表</p> <p>源分类文件库-文件表</p>
<span>文件库分类A</span>
<span>{{ documentName }}</span>
</div> </div>
<div class="field-list"> <div class="field-list">
<div v-for="(item, index) in selectStatus" :key="index" class="field-item"> <div v-for="(item, index) in selectStatus" :key="index" class="field-item">
<el-select v-if="item.mode" :key="index" v-model="item.value" @change="selectChange(index)"> <el-select v-if="item.mode" :key="index" v-model="item.value" @change="selectChange(index)">
<el-option <el-option
v-for="v in options" v-for="v in options"
:key="v.value"
:label="v.label"
:value="v.value"
:key="v.id"
:label="v.fieldCnName"
:value="v.fieldCnName"
/> />
</el-select> </el-select>
<p v-if="!item.mode" @click="textMode(index)"> <p v-if="!item.mode" @click="textMode(index)">
{{ item.value }} {{ item.value }}
</p> </p>
<div v-if="!item.mode" class="field-state"><span :class=" item.isType === 1 ? 'is-select' : 'is-hide'">{{ item.isType === 1 ? '显示': '隐藏' }}</span></div>
<div v-if="!item.mode" class="field-state"><span :class="item.isDisplay ? 'is-select' : 'is-hide'">{{ item.isDisplay !== null ? '显示': '隐藏' }}</span></div>
</div> </div>
</div> </div>
</div> </div>
<div class="corres-field-list corres-field-right"> <div class="corres-field-list corres-field-right">
<div class="corres-field-title"> <div class="corres-field-title">
<p>目标门类整理库/管理库-文件表</p> <p>目标门类整理库/管理库-文件表</p>
<span>文书档案文件</span>
<span>{{ categoryName }}</span>
</div> </div>
<div class="field-list"> <div class="field-list">
<div v-for="(item,index) in targetData" :key="index" class="field-item"> <div v-for="(item,index) in targetData" :key="index" class="field-item">
<p>{{ item.label }}</p>
<div class="field-state"><span :class=" item.isType === 1 ? 'is-select' : 'is-hide'">{{ item.isType === 1 ? '显示': '隐藏' }}</span></div>
<p>{{ item.fieldCnName }}</p>
<div class="field-state"><span :class=" item.isDisplay ? 'is-select' : 'is-hide'">{{ item.isDisplay ? '显示': '隐藏' }}</span></div>
</div> </div>
</div> </div>
</div> </div>
@ -60,51 +61,52 @@
<script> <script>
import { crud } from '@crud/crud' import { crud } from '@crud/crud'
import fieldData from './data.json'
export default { export default {
mixins: [crud()], mixins: [crud()],
props: { props: {
}, },
data() { data() {
return { return {
isHasCorres: 0,
title: '新增对应关系', title: '新增对应关系',
documentName: null,
categoryName: null,
corresVisible: false, corresVisible: false,
cuform: { cuform: {
id: null, id: null,
name: 'ddddd'
ruleName: ''
}, },
options: [
{ label: '字段A', value: '字段A', isType: 1 },
{ label: '字段B', value: '字段B', isType: 1 },
{ label: '字段C', value: '字段C', isType: 0 },
{ label: '字段D', value: '字段D', isType: 1 }
],
options: [],
selectStatus: [], selectStatus: [],
targetData: [],
rules: { rules: {
name: [
ruleName: [
{ required: true, message: '规则名称不可为空', trigger: 'blur' } { required: true, message: '规则名称不可为空', trigger: 'blur' }
] ]
} }
} }
}, },
created() { created() {
this.targetData = fieldData
this.targetData.forEach((item, index) => {
this.selectStatus.push({ mode: true, value: '' })
})
}, },
mounted() { mounted() {
this.$nextTick(() => {
console.log(this.targetData)
})
// this.targetData.forEach((item, index) => {
// this.selectStatus.push({ mode: true, value: '' })
// })
}, },
methods: { methods: {
selectChange(index) { selectChange(index) {
this.options.forEach((item) => { this.options.forEach((item) => {
if (item.value === this.selectStatus[index].value) { if (item.value === this.selectStatus[index].value) {
this.selectStatus.splice(index, 1, { mode: false, value: this.selectStatus[index].value, isType: item.isType })
this.selectStatus.splice(index, 1, { mode: false, value: this.selectStatus[index].value, isDisplay: item.isDisplay })
} }
}) })
}, },
textMode(index) { textMode(index) {
this.selectStatus.splice(index, 1, { mode: true, value: this.selectStatus[index].value })
this.selectStatus.splice(index, 1, { mode: true, value: this.selectStatus[index].value, isDisplay: this.selectStatus[index].isDisplay })
}, },
doSubmit() { doSubmit() {
this.$refs['cuForm'].validate((valid) => { this.$refs['cuForm'].validate((valid) => {

4
src/views/system/fileLibraryManage/descriptionPreview/index.vue

@ -64,7 +64,7 @@
<script> <script>
import PreviewForm from '@/views/components/category/PreviewForm' import PreviewForm from '@/views/components/category/PreviewForm'
import SettingForm from '@/views/components/category/SettingForm' import SettingForm from '@/views/components/category/SettingForm'
import { FetchInitCategoryField } from '@/api/system/fileLibrary/fileLibrary'
import { FetchInitDocumentField } from '@/api/system/fileLibrary/fileLibrary'
import { edit } from '@/api/system/fileLibrary/fieldManage' import { edit } from '@/api/system/fileLibrary/fieldManage'
import { FetchUpardicSort } from '@/api/system/fileLibrary/fileLibrary' import { FetchUpardicSort } from '@/api/system/fileLibrary/fileLibrary'
export default { export default {
@ -107,7 +107,7 @@ export default {
getArchivesType(setField) { getArchivesType(setField) {
// //
this.$refs.previewForm1.$refs['addOrUpdateForm'].clearValidate() this.$refs.previewForm1.$refs['addOrUpdateForm'].clearValidate()
FetchInitCategoryField({ documentId: this.selectedCategory.id, isType: 2 }).then(res => {
FetchInitDocumentField({ documentId: this.selectedCategory.id, isType: 2 }).then(res => {
this.allFieldsData.splice(0, this.allFieldsData.length) this.allFieldsData.splice(0, this.allFieldsData.length)
this.isInputFields.splice(0, this.isInputFields.length) this.isInputFields.splice(0, this.isInputFields.length)
if (!setField) { if (!setField) {

4
src/views/system/fileLibraryManage/listBrowsing/index.vue

@ -73,7 +73,7 @@
</div> </div>
</template> </template>
<script> <script>
import { FetchInitCategoryField } from '@/api/system/fileLibrary/fileLibrary'
import { FetchInitDocumentField } from '@/api/system/fileLibrary/fileLibrary'
import { FetchInitArchivesView } from '@/api/archivesManage/archivesList' import { FetchInitArchivesView } from '@/api/archivesManage/archivesList'
import { add } from '@/api/system/fileLibrary/listBrowsing' import { add } from '@/api/system/fileLibrary/listBrowsing'
import eForm from './module/form' import eForm from './module/form'
@ -135,7 +135,7 @@ export default {
this.getBottomTableData() this.getBottomTableData()
}, },
getDisplayFieldData() { getDisplayFieldData() {
FetchInitCategoryField({ documentId: this.selectedCategory.id, isType: 2 }).then((res) => {
FetchInitDocumentField({ documentId: this.selectedCategory.id, isType: 2 }).then((res) => {
this.table.right.data.splice(0, this.table.right.data.length) this.table.right.data.splice(0, this.table.right.data.length)
this.table.left.data.splice(0, this.table.left.data.length) this.table.left.data.splice(0, this.table.left.data.length)
res.sort((item1, item2) => { return item1.displayOrder - item2.displayOrder }).forEach((item) => { res.sort((item1, item2) => { return item1.displayOrder - item2.displayOrder }).forEach((item) => {

Loading…
Cancel
Save