[update] 调文档库的搜索,表头,新增

This commit is contained in:
lideqin
2023-08-25 17:53:44 +08:00
parent 59e68f795b
commit c4caed0e3f
9 changed files with 596 additions and 592 deletions
+306 -337
View File
@@ -1,233 +1,213 @@
<template>
<a-form-model :model="formInline" v-if="isFormInline" class="form-add" :rules="rules" ref="ruleForm">
<div v-for="(val,index) in dataList" :key="index">
<div v-for="(ol, index) in Object.keys(val)" :key="index">
<div class="header-text">
&nbsp;{{ol}}
<div v-if="val && val.length > 0" class="header-text">{{ index }}</div>
<a-row v-if="val && val.length > 0" :gutter="24">
<div v-for="(item, index) in val" :key="index">
<!-- 1, 日期单选 -->
<a-col :span="12" v-if="item.fieldShowType === FieldType.DATE_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<a-date-picker class="box-input"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
v-model="formInline[item.dbFieldName]"
:disabled="disabled"
style="width: 100%"/>
</a-form-model-item>
</div>
</a-col>
<!-- 2, 单选用户 -->
<a-col :span="12" v-if="item.fieldShowType === FieldType.USER_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<user-or-organ-selection :placeholder="$t('pleaseSelect')+item.dbFieldTxt"
v-model="formInline[item.dbFieldName]"
type="radio"
selectType="user"
:disabled="disabled"/>
</a-form-model-item>
</div>
</a-col>
<!-- 3, 单选组织机构 -->
<a-col :span="12" v-if="item.fieldShowType === FieldType.ORGAN_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<user-or-organ-selection :placeholder="$t('pleaseSelect')+item.dbFieldTxt"
v-model="formInline[item.dbFieldName]"
selectType="organ"
type="radio"
:disabled="disabled"/>
</a-form-model-item>
</div>
</a-col>
<!-- 4, 日期多选 -->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.DATE_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<j-multiple-date-picker class="box-input" v-model="formInline[item.dbFieldName]"
:disabled="disabled"/>
</a-form-model-item>
</div>
</a-col>
<!-- 5, 多行文本 -->
<a-col :span="24" v-else-if="item.fieldShowType === FieldType.TEXTAREA.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model-textarea" :prop="item.dbFieldName">
<a-textarea
:placeholder="$t('pleaseEnter')+item.dbFieldTxt"
:disabled="disabled"
:maxLength="500"
v-model="formInline[item.dbFieldName]" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
<!-- 6, 标准多选 -->
<a-col :span="24" v-else-if="item.fieldShowType === FieldType.STANDARD_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<standard-selection :query="item"
:disabled="disabled"
:standard="formInline"
@change="standardSelectionChange"
v-model="formInline[item.dbFieldName]"/>
</a-form-model-item>
</div>
</a-col>
<!-- 7, 多选组织机构 -->
<a-col :span="12" v-if="item.fieldShowType === FieldType.ORGAN_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<user-or-organ-selection :placeholder="$t('pleaseSelect')+item.dbFieldTxt"
v-model="formInline[item.dbFieldName]"
selectType="organ"
type="checkbox"
:disabled="disabled"/>
</a-form-model-item>
</div>
</a-col>
<!-- 8, 上传文件 -->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.FILE_UP.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload(item)">
{{
(formInline[item.dbFieldName] === 'null' || formInline[item.dbFieldName] === ''
|| formInline[item.dbFieldName] === null || formInline[item.dbFieldName] === undefined)
? $t('uploadFile.clickUpload')
: $t('uploadFile.viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
<!-- 9, 文本框 -->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.TEXT_BOX.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<a-input class="box-input"
:disabled="disabled"
v-model="formInline[item.dbFieldName]"
:maxLength="50"
:placeholder="$t('pleaseEnter')+item.dbFieldTxt"/>
</a-form-model-item>
</div>
</a-col>
<!-- 10, 下拉单选 -->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<j-dict-select-tag class="box-input" v-model="formInline[item.dbFieldName]"
:disabled="disabled"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<!-- 11, 下拉多选 -->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{item.dbFieldTxt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<j-multi-select-tag class="box-input" v-model="formInline[item.dbFieldName]"
:disabled="disabled"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<!-- 树选择 -->
<!-- <a-col :span="12" v-else-if="item.fieldShowType === FieldType.TREE.value">-->
<!-- <div class="box-title-text" :title="item.dbFieldTxt">-->
<!-- <div class="title-text">-->
<!-- <span class="required" v-if="item.fieldMustInput === '1'">*</span>-->
<!-- <span class="title-text-text">{{item.dbFieldTxt}}</span>-->
<!-- </div>-->
<!-- <a-form-model-item class="item-model" :prop="item.dbFieldName">-->
<!-- <a-tree-select-->
<!-- tree-node-filter-prop="title"-->
<!-- v-model="formInline[item.dbFieldName]"-->
<!-- :maxTagCount="1"-->
<!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"-->
<!-- style="width: 100%"-->
<!-- :tree-data="item.tree"-->
<!-- tree-checkable-->
<!-- :placeholder="$t('PleaseSelect')+item.dbFieldTxt"-->
<!-- />-->
<!-- </a-form-model-item>-->
<!-- </div>-->
<!-- </a-col>-->
</div>
<a-row :gutter="24">
<div v-for="(item, index) in val[ol]" :key="index">
<a-col :span="12" v-if="item.field_show_type === FieldType.TEXT_STRING.value || item.field_show_type === FieldType.TEXT_LINK.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-input class="box-input"
:disabled="disabled"
v-model="formInline[item.db_field_name]"
:maxLength="50"
:placeholder="$t('pleaseEnter')+item.db_field_txt"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.TEXT_NUMBER.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-input-number class="box-input"
:placeholder="$t('pleaseEnter')+item.db_field_txt"
:disabled="disabled"
v-model="formInline[item.db_field_name]" :min="1" :max="99999999"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.PULL_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<j-dict-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
@input="handleInput(item.db_field_name)"
:placeholder="$t('pleaseSelect')+item.db_field_txt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.PULL_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model-multi" :prop="item.db_field_name">
<j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('pleaseSelect')+item.db_field_txt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.DATE_SINGLE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-date-picker class="box-input"
:placeholder="$t('pleaseSelect')+item.db_field_txt"
@change="dateChange(item)"
:getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD"
v-model="formInline[item.db_field_name]"
:disabled="disabled"
style="width: 100%"/>
<!-- :disabledDate="disabledDate"-->
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.DATE_MORE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-range-picker class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:getCalendarContainer="(trigger) => trigger.parentNode"
@change="onChange(item.db_field_name)"></a-range-picker>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.FILE.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload(item)">
{{
(formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === ''
|| formInline[item.db_field_name] === null || formInline[item.db_field_name] === undefined)
? $t('uploadFile.clickUpload')
: $t('uploadFile.viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.field_show_type === FieldType.TEXT.value || item.field_show_type === 'text'">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model-textarea" :prop="item.db_field_name">
<a-textarea
:placeholder="$t('pleaseEnter')+item.db_field_txt"
:disabled="disabled"
:maxLength="500"
v-model="formInline[item.db_field_name]" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.field_show_type === FieldType.PERSON.value || item.field_show_type == 'sel_user'">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<personnel-selection :query="item"
v-if="isFormInline"
:personneQuery="formInline"
@change="personnelSelectionChange"
:disabled="disabled"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.field_show_type === FieldType.STANDARD.value">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<standard-selection :query="item"
:disabled="disabled"
:standard="formInline"
@change="standardSelectionChange"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'RADIO'">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<j-dict-select-tag v-model="formInline[item.db_field_name]"
:disabled="disabled"
@input="handleInput(item.db_field_name)"
:placeholder="$t('selectStatus')"
:type="'radio'" :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === FieldType.TREE.value">
<div class="box-title-text" :title="item.db_field_txt">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model" :prop="item.db_field_name">
<a-tree-select
tree-node-filter-prop="title"
v-model="formInline[item.db_field_name]"
:maxTagCount="1"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
style="width: 100%"
:tree-data="item.tree"
tree-checkable
:placeholder="$t('PleaseSelect')+item.db_field_txt"
/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'CHECKBOX'">
<div class="box-title-text">
<div class="title-text">
<span class="required" v-if="item.field_must_input === 1">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="item-model-multi" :prop="item.db_field_name">
<j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('selectStatus')" :type="'checkbox'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
</div>
</a-row>
</div>
</a-row>
</div>
<upload-file ref="uploadFile" @change="uploadFileChange" :return-url="false"></upload-file>
</a-form-model>
@@ -240,11 +220,14 @@ import JMultiSelectTag from '../dict/JMultiSelectTag'
import UploadFile from '../UploadFile'
// 选择标准选择器
import StandardSelection from '../selection/StandardSelection'
// 选择用户或组织机构
import UserOrOrganSelection from '../selection/UserOrOrganSelection'
import { FieldType } from '../../enums/commonEnums'
import JMultipleDatePicker from '../JMultipleDatePicker'
export default {
name: 'AddForm',
components: { StandardSelection, JDictSelectTag, JMultiSelectTag, UploadFile },
components: { JMultipleDatePicker, StandardSelection, JDictSelectTag, JMultiSelectTag, UploadFile, UserOrOrganSelection },
props: {
url: {
type: Object,
@@ -285,81 +268,81 @@ export default {
add () {
this.formInline = {}
this.type = 'add'
// this.getForm()
this.dataList = [
{
基本信息: [
{
area: '基本信息',
db_field_name: 'serial_number',
db_field_txt: '编号',
db_length: 200,
dict_field: '',
field_must_input: '1',
field_show_type: '1',
tree: []
},
{
area: '基本信息',
db_field_name: 'state',
db_field_txt: '状态',
db_length: 36,
dict_field: 'state',
field_must_input: '1',
field_show_type: '3',
tree: []
},
{
area: '基本信息',
db_field_name: 'standard_system',
db_field_txt: '标准体系',
db_length: 100,
dict_field: 'standard_system',
field_must_input: '0',
field_show_type: '3',
tree: []
},
{
area: '基本信息',
db_field_name: 'corresponding_standard',
db_field_txt: '对应标准',
db_length: 200,
dict_field: '',
field_must_input: '0',
field_show_type: '10',
tree: []
}
]
},
{
文本信息: [
{
area: '文本信息',
db_field_name: 'release_draft',
db_field_txt: '发言稿(必读)',
db_length: 3000,
dict_field: '',
field_must_input: '0',
field_show_type: '7',
flag: 1,
tree: []
},
{
area: '文本信息',
db_field_name: 'release_draft',
db_field_txt: '发言稿(必读)',
db_length: 3000,
dict_field: '',
field_must_input: '0',
field_show_type: '7',
flag: 1,
tree: []
}
]
}
]
this.ruleList = this.dataList
this.integrateData()
this.getForm()
// this.dataList = [
// {
// 基本信息: [
// {
// area: '基本信息',
// dbFieldName: 'serial_number',
// dbFieldTxt: '编号',
// db_length: 200,
// dict_field: '',
// fieldMustInput: '1',
// fieldShowType: '1',
// tree: []
// },
// {
// area: '基本信息',
// dbFieldName: 'state',
// dbFieldTxt: '状态',
// db_length: 36,
// dict_field: 'state',
// fieldMustInput: '1',
// fieldShowType: '3',
// tree: []
// },
// {
// area: '基本信息',
// dbFieldName: 'standard_system',
// dbFieldTxt: '标准体系',
// db_length: 100,
// dict_field: 'standard_system',
// fieldMustInput: '0',
// fieldShowType: '3',
// tree: []
// },
// {
// area: '基本信息',
// dbFieldName: 'corresponding_standard',
// dbFieldTxt: '对应标准',
// db_length: 200,
// dict_field: '',
// fieldMustInput: '0',
// fieldShowType: '10',
// tree: []
// }
// ]
// },
// {
// 文本信息: [
// {
// area: '文本信息',
// dbFieldName: 'release_draft',
// dbFieldTxt: '发言稿(必读)',
// db_length: 3000,
// dict_field: '',
// fieldMustInput: '0',
// fieldShowType: '7',
// flag: 1,
// tree: []
// },
// {
// area: '文本信息',
// dbFieldName: 'release_draft',
// dbFieldTxt: '发言稿(必读)',
// db_length: 3000,
// dict_field: '',
// fieldMustInput: '0',
// fieldShowType: '7',
// flag: 1,
// tree: []
// }
// ]
// }
// ]
// this.ruleList = this.dataList
// this.integrateData()
},
edit (item) {
this.type = 'edit'
@@ -379,7 +362,7 @@ export default {
getForm (callBack) {
this.confirmLoading = true
const params = {
flag: this.flag,
module: this.flag,
type: this.type
}
getAction(this.url.getAddForm, params).then((res) => {
@@ -395,61 +378,52 @@ export default {
integrateData () {
this.isFormInline = false
const ruleList = []
this.ruleList.forEach(res => {
Object.keys(res).forEach(val => {
res[val].forEach(ol => {
ruleList.push(ol)
})
console.log(this.ruleList)
for (const item in this.ruleList) {
this.ruleList[item].forEach(ol => {
ruleList.push(ol)
})
})
}
const rules = {}
ruleList.forEach((res, index) => {
const rule = []
if (res.field_must_input === 1) {
if (res.field_show_type === '1') {
if (res.fieldMustInput === '1') {
if (res.fieldShowType === '1') {
rule.push({
required: true,
message: res.db_field_txt + this.$t('cannotEmpty'),
message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '4' || res.field_show_type === '6' ||
res.field_show_type === '5' || res.field_show_type === '7'
} else if (res.fieldShowType === '4' || res.fieldShowType === '6' ||
res.fieldShowType === '5' || res.fieldShowType === '7'
) {
rule.push({
required: true,
message: res.db_field_txt + this.$t('cannotEmpty'),
message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'change'
})
} else if (res.field_show_type === '2') {
} else if (res.fieldShowType === '2') {
rule.push({
required: true,
message: res.db_field_txt + this.$t('cannotEmpty'),
message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10' || res.field_show_type === '11') {
} else if (res.fieldShowType === '8' || res.fieldShowType === '9' || res.fieldShowType === '10' || res.fieldShowType === '11') {
rule.push({
required: true,
message: res.db_field_txt + this.$t('cannotEmpty'),
message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '3') {
} else if (res.fieldShowType === '3') {
rule.push({
required: true,
message: res.db_field_txt + this.$t('cannotEmpty'),
message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'change'
})
}
}
if (res.field_show_type === '1' || res.field_show_type === '8' || res.field_show_type === '9' ||
res.field_show_type === '10' || res.field_show_type === '11') {
rule.push({
max: res.db_length,
message: res.db_field_txt + this.$t('cannotExceed') + res.db_length + this.$t('characters'),
trigger: 'blur'
})
}
if (rule.length > 0) {
rules[res.db_field_name] = rule
rules[res.dbFieldName] = rule
}
})
this.rules = rules
@@ -458,8 +432,8 @@ export default {
},
// 点击点击上传按钮
clickButtonToUpload (item) {
this.$refs.uploadFile.open(this.formInline[item.db_field_name])
this.uploadName = item.db_field_name
this.$refs.uploadFile.open(this.formInline[item.dbFieldName])
this.uploadName = item.dbFieldName
},
// 文件上传改变后的回调
uploadFileChange (data) {
@@ -478,11 +452,6 @@ export default {
this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }
},
// 人员选择变化
personnelSelectionChange (value, id) {
this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }
},
submit () {
this.$refs.ruleForm.validate(valid => {
if (valid) {