|
|
@ -10,7 +10,7 @@ |
|
|
|
v-if="item.isInputClass === 'select'" |
|
|
|
v-model="addOrUpdateForm[item.fieldName]" |
|
|
|
:options="item.options" |
|
|
|
:normalizer="normalizer" |
|
|
|
:normalizer=" isTableType === 1 ? normalizerFonds : (isTableType === 2 ? normalizerClassify : normalizer)" |
|
|
|
:clearable="false" |
|
|
|
placeholder="" |
|
|
|
:style="{ width: item.editLength+'px'}" |
|
|
@ -37,7 +37,7 @@ |
|
|
|
@input="autoAddZero(item.isFilling, item.fieldName, addOrUpdateForm[item.fieldName], item.fillingDigit)" |
|
|
|
@blur="isRepeatHandle(item)" |
|
|
|
> |
|
|
|
<i v-if="item.isInputClass === 'popover'" slot="suffix" class="el-input__icon iconfont icon-weibiaoti-2" @click="handleCurrentFieldName(item)" /> |
|
|
|
<i v-if="item.isInputClass === 'popover'" slot="suffix" class="el-input__icon iconfont icon-gengduo1" @click="handleCurrentFieldName(item)" /> |
|
|
|
</el-input> |
|
|
|
<!-- date --> |
|
|
|
<el-date-picker v-if="item.isInputClass === 'date'" v-model="addOrUpdateForm[item.fieldName]" type="date" align="right" format="yyyy-MM-dd" placeholder="" :clearable="false" :style="{ width: item.editLength+'px'}" :disabled="isDisabled" :validate-event="!isDisabled" /> |
|
|
@ -71,15 +71,28 @@ |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<!-- 弹框形式的内容展示 --> |
|
|
|
<el-dialog class="edit-form-dialog" :append-to-body="true" :visible="popoverVisible" :before-close="handleClose" :close-on-click-modal="false" title="字典列表"> |
|
|
|
<el-dialog class="edit-form-dialog" :append-to-body="true" :visible="popoverVisible" :before-close="handleClose" :close-on-click-modal="false" :title="tableTitle"> |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<el-table ref="popoverTable" :data="popoverTableData" highlight-current-row row-key="id" :tree-props="{children: 'childMenus', hasChildren: 'hasChildren'}" style="width: 100%;" @selection-change="handleSelectionChange" @row-click="clickRowHandler"> |
|
|
|
<el-table v-if="isTableType === 1" ref="popoverTable" :data="popoverTableData" highlight-current-row row-key="id" :tree-props="{children: 'childMenus', hasChildren: 'hasChildren'}" style="width: 100%;" @selection-change="handleSelectionChange" @row-click="clickRowHandler"> |
|
|
|
<el-table-column type="selection" width="55" /> |
|
|
|
<el-table-column prop="dicName" label="字典名称" /> |
|
|
|
<el-table-column prop="dicCode" label="字典代码" /> |
|
|
|
<el-table-column prop="dicExplain" label="内容说明" /> |
|
|
|
<el-table-column prop="fondsNo" label="全宗号" /> |
|
|
|
<el-table-column prop="fondsName" label="全宗名称" /> |
|
|
|
<el-table-column prop="fondsOrders" label="排序" width="60" /> |
|
|
|
</el-table> |
|
|
|
<el-table v-if="isTableType === 2" ref="popoverTable" :data="popoverTableData" highlight-current-row row-key="id" :tree-props="{children: 'childArchivesClass', hasChildren: 'hasChildren'}" style="width: 100%;" @selection-change="handleSelectionChange" @row-click="clickRowHandler"> |
|
|
|
<el-table-column type="selection" width="55" /> |
|
|
|
<el-table-column label="分类名称" prop="name" width="130" /> |
|
|
|
<el-table-column label="分类编号" prop="code" /> |
|
|
|
<el-table-column label="排序" prop="classSeq" /> |
|
|
|
<el-table-column label="所属门类" prop="categoryName" /> |
|
|
|
</el-table> |
|
|
|
<el-table v-if="isTableType === 3" ref="popoverTable" :data="popoverTableData" highlight-current-row row-key="dictionaryId" :tree-props="{children: 'childMenus', hasChildren: 'hasChildren'}" style="width: 100%;" @selection-change="handleSelectionChange" @row-click="clickRowHandler"> |
|
|
|
<el-table-column type="selection" width="55" /> |
|
|
|
<el-table-column prop="dictionaryName" label="字典名称" /> |
|
|
|
<el-table-column prop="dictionaryCode" label="字典代码" /> |
|
|
|
<el-table-column prop="dictionaryRemarks" label="内容说明" /> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
@ -94,7 +107,10 @@ import { getNoFormatField } from '@/api/system/category/fileNoFormat' |
|
|
|
import draggable from 'vuedraggable' |
|
|
|
import Treeselect from '@riophae/vue-treeselect' |
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
|
|
|
import { FetchFindAllSubsetById } from '@/api/archivesConfig/dictDetail' |
|
|
|
// import { FetchFindAllSubsetById } from '@/api/archivesConfig/dictDetail' |
|
|
|
import { FetchSonDictionaryList } from '@/api/system/dict' |
|
|
|
import { FetchFondsAll } from '@/api/system/fonds' |
|
|
|
import { FetchArchivesClassTree, FetchSonArchivesClass } from '@/api/system/archivesClass' |
|
|
|
import { parseTime, getCurrentTime } from '@/utils/index' |
|
|
|
|
|
|
|
export default { |
|
|
@ -144,6 +160,8 @@ export default { |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
}, |
|
|
|
isTableType: 1, |
|
|
|
tableTitle: '字典列表', |
|
|
|
popoverTableData: [], // popover - popoverTableData |
|
|
|
popoverVisible: false, // popover - visible |
|
|
|
currentFieldName: null, // popover 当前fieldName |
|
|
@ -153,16 +171,7 @@ export default { |
|
|
|
result: null, |
|
|
|
autoMatic: null, |
|
|
|
// isType: 'category', |
|
|
|
normalizer(node) { |
|
|
|
if (node.childMenus == null || node.childMenus === 'null') { |
|
|
|
delete node.childMenus |
|
|
|
} |
|
|
|
return { |
|
|
|
id: node.dicName, |
|
|
|
label: node.dicName, |
|
|
|
children: node.childMenus |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
file: null, // 附件 change |
|
|
|
fileNames: '', // 附件 - name |
|
|
|
formatType: '', // 附件 - type |
|
|
@ -200,6 +209,36 @@ export default { |
|
|
|
// } |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
normalizer(node) { |
|
|
|
if (node.childMenus == null || node.childMenus === 'null') { |
|
|
|
delete node.childMenus |
|
|
|
} |
|
|
|
return { |
|
|
|
id: node.dictionaryId, |
|
|
|
label: node.dictionaryName, |
|
|
|
children: node.childMenus |
|
|
|
} |
|
|
|
}, |
|
|
|
normalizerClassify(node) { |
|
|
|
if (node.childArchivesClass && !node.childArchivesClass.length) { |
|
|
|
delete node.childArchivesClass |
|
|
|
} |
|
|
|
return { |
|
|
|
id: node.id, |
|
|
|
label: node.name, |
|
|
|
children: node.childArchivesClass |
|
|
|
} |
|
|
|
}, |
|
|
|
normalizerFonds(node) { |
|
|
|
if (node.childMenus == null || node.childMenus === 'null') { |
|
|
|
delete node.childMenus |
|
|
|
} |
|
|
|
return { |
|
|
|
id: node.id, |
|
|
|
label: node.fondsName, |
|
|
|
children: node.childMenus |
|
|
|
} |
|
|
|
}, |
|
|
|
// 递归查询字典名称对应的字典代码 |
|
|
|
// getNode(tree, dicName) { |
|
|
|
// for (let i = 0; i < tree.length; i++) { |
|
|
@ -245,12 +284,15 @@ export default { |
|
|
|
} else { |
|
|
|
const fieldInfo = this.formPreviewData.find(element => element.fieldName === val.fieldName) |
|
|
|
if (fieldInfo.isInputClass === 'select' || fieldInfo.isInputClass === 'popover') { |
|
|
|
await FetchFindAllSubsetById({ id: fieldInfo.dictionaryConfigId.id }).then(res => { |
|
|
|
const params = { |
|
|
|
'pid': fieldInfo.dictionaryId.id |
|
|
|
} |
|
|
|
await FetchSonDictionaryList(params).then(res => { |
|
|
|
const option = this.getNode(res, this.addOrUpdateForm[val.fieldName]) |
|
|
|
if (option) { |
|
|
|
const obj = {} |
|
|
|
obj.name = val.fieldName |
|
|
|
obj.val = option[0].dicCode + val.connector |
|
|
|
obj.val = option[0].dictionaryCode + val.connector |
|
|
|
obj.sequence = val.sequence |
|
|
|
// string += '' + option[0].dicCode + val.connector |
|
|
|
getAutoFiledVal.push(obj) |
|
|
@ -293,16 +335,83 @@ export default { |
|
|
|
}, |
|
|
|
// 获取对应字典子集数据 |
|
|
|
getAllSubset(item) { |
|
|
|
if (item.dictionaryConfigId) { |
|
|
|
FetchFindAllSubsetById({ id: item.dictionaryConfigId.id }).then(res => { |
|
|
|
if (item.isInputClass === 'select') { |
|
|
|
this.$set(item, 'options', res) |
|
|
|
} else if (item.isInputClass === 'popover') { |
|
|
|
this.popoverTableData = res |
|
|
|
console.log('item', item) |
|
|
|
if (item.mateData === 1) { |
|
|
|
this.getFondsDatas(item) |
|
|
|
} else if (item.mateData === 2) { |
|
|
|
if (item.categoryId) { |
|
|
|
this.getClassifyTree(item) |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (item.dictionaryId) { |
|
|
|
const params = { |
|
|
|
'pid': item.dictionaryId.id |
|
|
|
} |
|
|
|
}) |
|
|
|
this.isTableType = 3 |
|
|
|
this.tableTitle = '字典列表' |
|
|
|
FetchSonDictionaryList(params).then(res => { |
|
|
|
if (item.isInputClass === 'select') { |
|
|
|
this.$set(item, 'options', res) |
|
|
|
} else if (item.isInputClass === 'popover') { |
|
|
|
this.popoverTableData = res |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
getFondsDatas(item) { |
|
|
|
const parent = {} |
|
|
|
parent.id = 0 |
|
|
|
parent.fondsName = '全宗选择' |
|
|
|
this.isTableType = 1 |
|
|
|
this.tableTitle = '全宗列表' |
|
|
|
FetchFondsAll().then(res => { |
|
|
|
if (item.isInputClass === 'select') { |
|
|
|
this.$set(item, 'options', res) |
|
|
|
} else if (item.isInputClass === 'popover') { |
|
|
|
this.popoverTableData = res |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getClassifyTree(item) { |
|
|
|
console.log('666', this.selectedCategory) |
|
|
|
this.isTableType = 2 |
|
|
|
this.tableTitle = '分类列表' |
|
|
|
FetchArchivesClassTree({ 'categoryId': this.selectedCategory.pid }).then(res => { |
|
|
|
if (item.isInputClass === 'select') { |
|
|
|
const classifyOptions = res.map(function(obj) { |
|
|
|
if (obj.childArchivesClass !== null) { |
|
|
|
obj.hasChildren = true |
|
|
|
} else { |
|
|
|
obj.hasChildren = false |
|
|
|
} |
|
|
|
if (obj.hasChildren) { |
|
|
|
obj.children = null |
|
|
|
} |
|
|
|
return obj |
|
|
|
}) |
|
|
|
this.$set(item, 'options', classifyOptions) |
|
|
|
} else if (item.isInputClass === 'popover') { |
|
|
|
this.popoverTableData = res |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getSonClass(tree, treeNode, resolve) { |
|
|
|
setTimeout(() => { |
|
|
|
FetchSonArchivesClass({ pid: tree.id }).then(res => { |
|
|
|
const data = res.map(function(obj) { |
|
|
|
if (obj.sonNum !== 0 && obj.sonNum) { |
|
|
|
obj.hasChildren = true |
|
|
|
obj.children = null |
|
|
|
} else { |
|
|
|
obj.hasChildren = false |
|
|
|
} |
|
|
|
return obj |
|
|
|
}) |
|
|
|
resolve(data) |
|
|
|
}) |
|
|
|
}, 100) |
|
|
|
}, |
|
|
|
// 判断重复api |
|
|
|
handlerIsRepeat(params, item) { |
|
|
|
if (this.isDesFormType !== 'prearchiveLibrary') { |
|
|
@ -381,9 +490,11 @@ export default { |
|
|
|
} |
|
|
|
this.handlerIsRepeat(params, this.treeCurrentFiled) |
|
|
|
} |
|
|
|
const index = this.autoMatic.findIndex(i => this.treeCurrentFiled.fieldName === i.fieldName) |
|
|
|
if (index !== -1) { |
|
|
|
this.handleAuto() |
|
|
|
if (this.isDesFormType !== 'prearchiveLibrary') { |
|
|
|
const index = this.autoMatic.findIndex(i => this.treeCurrentFiled.fieldName === i.fieldName) |
|
|
|
if (index !== -1) { |
|
|
|
this.handleAuto() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
// popover - table 单选 |
|
|
@ -394,14 +505,22 @@ export default { |
|
|
|
// popover - table 选中得项 |
|
|
|
handleSelectionChange(val) { |
|
|
|
if (val.length > 0) { |
|
|
|
this.addOrUpdateForm[this.currentFieldName] = val[0].dicName |
|
|
|
if (this.isTableType === 1) { |
|
|
|
this.addOrUpdateForm[this.currentFieldName] = val[0].fondsName |
|
|
|
} else if (this.isTableType === 2 && this.isDesFormType !== 'prearchiveLibrary') { |
|
|
|
this.addOrUpdateForm[this.currentFieldName] = val[0].name |
|
|
|
} else { |
|
|
|
this.addOrUpdateForm[this.currentFieldName] = val[0].dictionaryName |
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs.popoverTable.clearSelection() |
|
|
|
this.popoverVisible = false |
|
|
|
|
|
|
|
const index = this.autoMatic.findIndex(i => this.currentFieldName === i.fieldName) |
|
|
|
if (index !== -1) { |
|
|
|
this.handleAuto() |
|
|
|
if (this.isDesFormType !== 'prearchiveLibrary') { |
|
|
|
const index = this.autoMatic.findIndex(i => this.currentFieldName === i.fieldName) |
|
|
|
if (index !== -1) { |
|
|
|
this.handleAuto() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
// popover - 当前选中得 |
|
|
|