[uodate]
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-spin :spinning="confirmLoading">
|
<a-spin :spinning="confirmLoading">
|
||||||
<!-- <j-form-container :disabled="formDisabled">-->
|
<!-- <j-form-container :disabled="formDisabled">-->
|
||||||
<div class="form-tag">
|
<div class="form-tag">
|
||||||
<a-form>
|
<a-form>
|
||||||
<a-form-model
|
<a-form-model
|
||||||
class="tag-content"
|
class="tag-content"
|
||||||
@@ -11,498 +11,492 @@
|
|||||||
:label-col="labelCol"
|
:label-col="labelCol"
|
||||||
:wrapper-col="wrapperCol"
|
:wrapper-col="wrapperCol"
|
||||||
>
|
>
|
||||||
<a-row>
|
<a-row>
|
||||||
<p class="tag-info">{{$t('essentialInformation')}}</p>
|
<p class="tag-info">{{$t('essentialInformation')}}</p>
|
||||||
<a-divider dashed />
|
<a-divider dashed />
|
||||||
<!-- 所属模块-->
|
<!-- 所属模块-->
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-model-item :label="$t('Module')" prop="isModel">
|
<a-form-model-item :label="$t('Module')" prop="isModel">
|
||||||
<!-- <j-dict-select-tag type="list" v-model="form.isModel" dictCode="module" :placeholder="$t('PleaseSelectModule')" />-->
|
<!-- <j-dict-select-tag type="list" v-model="form.isModel" dictCode="module" :placeholder="$t('PleaseSelectModule')" />-->
|
||||||
<a-select :placeholder="$t('PleaseSelectModule')" v-model="form.isModel" @change="handleChange" :disabled="disableEdit">
|
<a-select :placeholder="$t('PleaseSelectModule')" v-model="form.isModel" @change="handleChange" :disabled="disableEdit">
|
||||||
<a-select-option :key="'1'" :value="'1'">
|
<a-select-option :key="'1'" :value="'1'">
|
||||||
{{$t('DocumentLibrary')}}
|
{{$t('DocumentLibrary')}}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
<a-select-option :key="'0'" :value="'0'">
|
<a-select-option :key="'0'" :value="'0'">
|
||||||
{{$t('DocumentSplitting')}}
|
{{$t('DocumentSplitting')}}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<!-- 属性名称-->
|
<!-- 属性名称-->
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-model-item :label="$t('AttributeName')" prop="dbFieldTxt">
|
<a-form-model-item :label="$t('AttributeName')" prop="dbFieldTxt">
|
||||||
<a-input v-model="form.dbFieldTxt" :placeholder="$t('PleaseEnterPropertyName')" :maxLength="120" ></a-input>
|
<a-input v-model="form.dbFieldTxt" :placeholder="$t('PleaseEnterPropertyName')" :maxLength="120" ></a-input>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<!-- 英文名称-->
|
<!-- 英文名称-->
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-model-item :label="$t('enName')" prop="dbFieldEnName">
|
<a-form-model-item :label="$t('enName')" prop="dbFieldEnName">
|
||||||
<a-input v-model="form.dbFieldEnName" :placeholder="$t('PleaseEnterYourEnglishName')" :maxLength="120" ></a-input>
|
<a-input v-model="form.dbFieldEnName" :placeholder="$t('PleaseEnterYourEnglishName')" :maxLength="120" ></a-input>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<!-- 属性类型-->
|
<!-- 属性类型-->
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-model-item :label="$t('AttributeType')" prop="fieldShowType" >
|
<a-form-model-item :label="$t('AttributeType')" prop="fieldShowType" >
|
||||||
<j-dict-select-tag type="list" v-model="form.fieldShowType" dictCode="field_show_type" :placeholder="$t('PleaseSelectAttributeType')" :disabled="disabledEdit" />
|
<j-dict-select-tag type="list" v-model="form.fieldShowType" dictCode="field_show_type" :placeholder="$t('PleaseSelectAttributeType')" :disabled="disabledEdit" />
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" v-if="isTagContent">
|
<a-col :span="24" v-if="isTagContent">
|
||||||
<a-form-model-item :label="$t('OptionContent')" prop="dictId">
|
<a-form-model-item :label="$t('OptionContent')" prop="dictId">
|
||||||
<template>
|
<template>
|
||||||
<a-select :placeholder="$t('PleaseSelectOptionContent')" v-model="form.dictId" @change="handleChange">
|
<a-select :placeholder="$t('PleaseSelectOptionContent')" v-model="form.dictId" @change="handleChange">
|
||||||
<a-select-option v-for="(item,index) in contentOption" :key="item.id" :value="item.id">
|
<a-select-option v-for="(item,index) in contentOption" :key="item.id" :value="item.id">
|
||||||
{{item.dictName}}
|
{{item.dictName}}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</template>
|
</template>
|
||||||
<!-- <j-dict-select-tag type="list" v-model="form.dictName" dictCode="" placeholder="请选择选项内容" />-->
|
<!-- <j-dict-select-tag type="list" v-model="form.dictName" dictCode="" placeholder="请选择选项内容" />-->
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" v-if="isLength">
|
<a-col :span="24" v-if="isLength">
|
||||||
<a-form-model-item :label="$t('FieldLength')" prop="dbLength">
|
<a-form-model-item :label="$t('FieldLength')" prop="dbLength">
|
||||||
<a-input-number v-model="form.dbLength" :min="1" :max="200" :placeholder="$t('PleaseEnterFieldLength')" style="width: 100%" :formatter="limitNumber" :parser="limitNumber" />
|
<a-input-number v-model="form.dbLength" :min="1" :max="200" :placeholder="$t('PleaseEnterFieldLength')" style="width: 100%" :formatter="limitNumber" :parser="limitNumber" />
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-model-item :label="$t('DisplayOrder')" prop="orderNum">
|
<a-form-model-item :label="$t('DisplayOrder')" prop="orderNum">
|
||||||
<a-input-number v-model="form.orderNum" :placeholder="$t('PleaseEnterDisplayOrder')" style="width: 100%" :min="1" :formatter="limitNumber" :parser="limitNumber" />
|
<a-input-number v-model="form.orderNum" :placeholder="$t('PleaseEnterDisplayOrder')" style="width: 100%" :min="1" :formatter="limitNumber" :parser="limitNumber" />
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-model-item :label="$t('Required')" prop="fieldMustInput">
|
<a-form-model-item :label="$t('Required')" prop="fieldMustInput">
|
||||||
<j-dict-select-tag type="list" v-model="form.fieldMustInput" dictCode="yn" :placeholder="$t('selectWhetherRequired')" />
|
<j-dict-select-tag type="list" v-model="form.fieldMustInput" dictCode="yn" :placeholder="$t('selectWhetherRequired')" />
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<p class="tag-info">{{submitKey == 1 ? $t('DocumentLibraryModuleDisplay'):$t('documentSplitDisplay')}}</p>
|
<p class="tag-info">{{submitKey == 1?$t('DocumentLibraryModuleDisplay'):$t('documentSplitDisplay')}}</p>
|
||||||
<a-divider dashed />
|
<a-divider dashed />
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<!-- 文档库列表展示-->
|
<a-form-model-item :label="$t('DocumentLibraryListDisplay')" prop="isShowList" v-if="submitKey == 1">
|
||||||
<a-form-model-item :label="$t('DocumentLibraryListDisplay')" prop="isShowList" v-if="submitKey == 1">
|
<j-dict-select-tag type="list" v-model="form.isShowList" dictCode="yn"
|
||||||
<j-dict-select-tag type="list" v-model="form.isShowList" dictCode="yn"
|
:placeholder="$t('selectDisplayList')" />
|
||||||
:placeholder="$t('selectDisplayList')" />
|
|
||||||
|
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<!-- 文档拆分列表展示-->
|
<a-form-model-item :label="$t('documentSplitList')" prop="isShowList" v-if="submitKey == 2">
|
||||||
<a-form-model-item :label="$t('documentSplitList')" prop="isShowList" v-if="submitKey == 2">
|
<j-dict-select-tag type="list" v-model="form.isShowList" dictCode="yn"
|
||||||
<j-dict-select-tag type="list" v-model="form.isShowList" dictCode="yn"
|
:placeholder="$t('selectDisplayList')" />
|
||||||
:placeholder="$t('selectDisplayList')" />
|
</a-form-model-item>
|
||||||
</a-form-model-item>
|
</a-col>
|
||||||
</a-col>
|
<a-col :span="24" v-if="moduleShow">
|
||||||
<a-col :span="24" v-if="moduleShow">
|
<a-form-model-item :label="$t('DisplayArea')" prop="showArea">
|
||||||
<!-- 展示区域-->
|
<a-select :placeholder="$t('SelectDisplayArea')" v-model="form.showArea" @change="handleChange">
|
||||||
<a-form-model-item :label="$t('DisplayArea')" prop="showArea">
|
<a-select-option v-for="(item,index) in areaOptions" :key="item.id" :value="item.id">
|
||||||
<a-select :placeholder="$t('SelectDisplayArea')" v-model="form.showArea" @change="handleChange">
|
{{item.showArea}}
|
||||||
<a-select-option v-for="(item,index) in areaOptions" :key="item.id" :value="item.id">
|
</a-select-option>
|
||||||
{{item.showArea}}
|
</a-select>
|
||||||
</a-select-option>
|
<!-- <j-dict-select-tag type="list" v-model="form.showArea" dictCode="" placeholder="请选择展示区域" />-->
|
||||||
</a-select>
|
</a-form-model-item>
|
||||||
<!-- <j-dict-select-tag type="list" v-model="form.showArea" dictCode="" placeholder="请选择展示区域" />-->
|
</a-col>
|
||||||
</a-form-model-item>
|
<a-col :span="24" v-if="isSearch">
|
||||||
</a-col>
|
<a-form-model-item :label="$t('Search')" prop="isQuery">
|
||||||
<a-col :span="24" v-if="isSearch">
|
<j-dict-select-tag type="list" v-model="form.isQuery" dictCode="yn" :placeholder="$t('SelectWhetherToSearch')" />
|
||||||
<a-form-model-item :label="$t('Search')" prop="isQuery">
|
</a-form-model-item>
|
||||||
<j-dict-select-tag type="list" v-model="form.isQuery" dictCode="yn" :placeholder="$t('SelectWhetherToSearch')" />
|
</a-col>
|
||||||
</a-form-model-item>
|
|
||||||
</a-col>
|
|
||||||
|
|
||||||
<p class="tag-info" v-if="moduleShow">{{$t('DisplayOtherModules')}}</p>
|
<p class="tag-info" v-if="moduleShow">{{$t('DisplayOtherModules')}}</p>
|
||||||
<a-divider dashed v-if="moduleShow" />
|
<a-divider dashed v-if="moduleShow" />
|
||||||
<a-col :span="24" v-if="moduleShow">
|
<a-col :span="24" v-if="moduleShow">
|
||||||
<a-form-model-item :label="$t('RegulationsListDisplay')" prop="isShowLawsList">
|
<a-form-model-item :label="$t('RegulationsListDisplay')" prop="isShowLawsList">
|
||||||
<j-dict-select-tag type="list" v-model="form.isShowLawsList" dictCode="yn" :placeholder="$t('selectDisplayListRegulations')" />
|
<j-dict-select-tag type="list" v-model="form.isShowLawsList" dictCode="yn" :placeholder="$t('selectDisplayListRegulations')" />
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" v-if="moduleShow">
|
<a-col :span="24" v-if="moduleShow">
|
||||||
<a-form-model-item :label="$t('SearchCenterDisplay')" prop="isShowSearch">
|
<a-form-model-item :label="$t('SearchCenterDisplay')" prop="isShowSearch">
|
||||||
<j-dict-select-tag type="list" v-model="form.isShowSearch" dictCode="yn" :placeholder="$t('selectSearchCenterDisplayed')" />
|
<j-dict-select-tag type="list" v-model="form.isShowSearch" dictCode="yn" :placeholder="$t('selectSearchCenterDisplayed')" />
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<!-- <a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">-->
|
<!-- <a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">-->
|
||||||
<!-- <a-button @click="submitForm">提 交</a-button>-->
|
<!-- <a-button @click="submitForm">提 交</a-button>-->
|
||||||
<!-- </a-col>-->
|
<!-- </a-col>-->
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form-model>
|
</a-form-model>
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
<!-- </j-form-container>-->
|
<!-- </j-form-container>-->
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { httpAction, getAction, postAction } from '@/api/manage'
|
import { httpAction, getAction, postAction } from '@/api/manage'
|
||||||
import pick from 'lodash.pick'
|
import pick from 'lodash.pick'
|
||||||
import { validateDuplicateValue } from '@/utils/util'
|
import { validateDuplicateValue } from '@/utils/util'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TagForm',
|
name: 'TagForm',
|
||||||
components: {
|
components: {
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
//流程表单data
|
||||||
|
formData: {
|
||||||
|
type: Object,
|
||||||
|
default: ()=>{},
|
||||||
|
required: false
|
||||||
},
|
},
|
||||||
props: {
|
//表单模式:true流程表单 false普通表单
|
||||||
//流程表单data
|
formBpm: {
|
||||||
formData: {
|
type: Boolean,
|
||||||
type: Object,
|
default: false,
|
||||||
default: ()=>{},
|
required: false
|
||||||
required: false
|
},
|
||||||
|
//表单禁用
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
drawerVisible:{
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
editData:{
|
||||||
|
type: Object,
|
||||||
|
default:{}
|
||||||
|
},
|
||||||
|
editId:{
|
||||||
|
type:String,
|
||||||
|
default:''
|
||||||
|
},
|
||||||
|
submitEdit:{
|
||||||
|
type:String,
|
||||||
|
default:''
|
||||||
|
},
|
||||||
|
disableEdit:{
|
||||||
|
type:Boolean,
|
||||||
|
default:false
|
||||||
|
},
|
||||||
|
submitKey:{
|
||||||
|
type:String,
|
||||||
|
default:'1'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
form: {},
|
||||||
|
model: {},
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 6 },
|
||||||
},
|
},
|
||||||
//表单模式:true流程表单 false普通表单
|
wrapperCol: {
|
||||||
formBpm: {
|
xs: { span: 24 },
|
||||||
type: Boolean,
|
sm: { span: 16 },
|
||||||
default: false,
|
|
||||||
required: false
|
|
||||||
},
|
},
|
||||||
//表单禁用
|
confirmLoading: false,
|
||||||
disabled: {
|
validatorRules: {
|
||||||
type: Boolean,
|
isModel: [
|
||||||
default: false,
|
{ required: true, message: this.$t('PleaseSelectModule'),trigger: 'change'},
|
||||||
required: false
|
],
|
||||||
|
dbFieldTxt: [
|
||||||
|
{ required: true, message: this.$t('PleaseEnterPropertyName'),trigger: 'blur'},
|
||||||
|
{ min:1, max: 20, message: this.$t('cantExeed')+'20'+this.$t('characters'), trigger: 'blur' },
|
||||||
|
],
|
||||||
|
dbFieldName: [
|
||||||
|
{ required: true, message: this.$t('PleaseEnterYourEnglishName'),trigger: 'blur'},
|
||||||
|
{ min:1, max: 20, message: this.$t('cantExeed')+'20'+this.$t('characters'), trigger: 'blur' },
|
||||||
|
],
|
||||||
|
dbFieldEnName:[
|
||||||
|
{ max: 50, message: this.$t('cantExeed')+'50'+this.$t('characters'), trigger: 'blur' },
|
||||||
|
],
|
||||||
|
fieldShowType: [
|
||||||
|
{ required: true, message: this.$t('PleaseSelectAttributeType'),trigger: 'change'},
|
||||||
|
],
|
||||||
|
dictId: [
|
||||||
|
{ required: true, message: this.$t('PleaseSelectOptionContent'),trigger: 'change'},
|
||||||
|
],
|
||||||
|
dbLength: [
|
||||||
|
{ required: true, message: this.$t('PleaseEnterFieldLength'),trigger: 'blur'},
|
||||||
|
],
|
||||||
|
orderNum: [
|
||||||
|
{ required: true, message: this.$t('PleaseEnterDisplayOrder'),trigger: 'blur'},
|
||||||
|
],
|
||||||
|
fieldMustInput: [
|
||||||
|
{ required: true, message: this.$t('selectWhetherRequired'),trigger: 'change'},
|
||||||
|
],
|
||||||
|
isShowList: [
|
||||||
|
{ required: true, message: this.$t('selectDisplayList'),trigger: 'change'},
|
||||||
|
],
|
||||||
|
showArea: [
|
||||||
|
{ required: true, message: this.$t('SelectDisplayArea'),trigger: 'change'},
|
||||||
|
],
|
||||||
|
isQuery: [
|
||||||
|
{ required: true, message: this.$t('SelectWhetherToSearch'),trigger: 'change'},
|
||||||
|
],
|
||||||
|
isShowLawsList: [
|
||||||
|
{ required: true, message: this.$t('selectDisplayListRegulations'),trigger: 'change'},
|
||||||
|
],
|
||||||
|
isShowSearch: [
|
||||||
|
{ required: true, message: this.$t('selectSearchCenterDisplayed'),trigger: 'change'},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
drawerVisible:{
|
addVisible:false,
|
||||||
type: Boolean,
|
url: {
|
||||||
default: false,
|
add: "tag/onlCgformTag/add",
|
||||||
|
edit: "tag/onlCgformTag/edit",
|
||||||
|
queryById: "tag/onlCgformTag/queryById"
|
||||||
},
|
},
|
||||||
editData:{
|
//展示区域选项内容
|
||||||
type: Object,
|
areaOptions:[],
|
||||||
default:{}
|
//选项内容选项
|
||||||
},
|
contentOption:[],
|
||||||
editId:{
|
contentFlag:3,
|
||||||
type:String,
|
contentOption1:[],
|
||||||
default:''
|
contentOption2:[],
|
||||||
},
|
isTagContent:false,
|
||||||
submitEdit:{
|
isSearch:true,
|
||||||
type:String,
|
isLength:true,
|
||||||
default:''
|
flag:false, //表单提交标识
|
||||||
},
|
disabledEdit:false,
|
||||||
disableEdit:{
|
moduleShow:true
|
||||||
type:Boolean,
|
}
|
||||||
default:false
|
},
|
||||||
},
|
watch:{
|
||||||
submitKey:{
|
'form.fieldShowType'(val){
|
||||||
type:String,
|
// this.contentFlag=val
|
||||||
default:'1'
|
if(val==0){
|
||||||
|
this.contentOption=[...this.contentOption2]
|
||||||
|
this.isTagContent=true
|
||||||
|
}else if(val==3||val==4){
|
||||||
|
this.contentOption=[...this.contentOption1]
|
||||||
|
this.isTagContent=true
|
||||||
|
}else{
|
||||||
|
this.isTagContent=false
|
||||||
|
}
|
||||||
|
if(val==7){
|
||||||
|
this.isSearch=false
|
||||||
|
this.form.isQuery=0
|
||||||
|
}else{
|
||||||
|
this.isSearch=true
|
||||||
|
}
|
||||||
|
if(val==1||val==8||val==9||val==10||val==11||val=='sel_user'){
|
||||||
|
this.isLength=true
|
||||||
|
}else{
|
||||||
|
this.isLength=false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
submitEdit(){
|
||||||
return {
|
|
||||||
form: {},
|
|
||||||
model: {},
|
|
||||||
labelCol: {
|
|
||||||
xs: { span: 24 },
|
|
||||||
sm: { span: 6 },
|
|
||||||
},
|
|
||||||
wrapperCol: {
|
|
||||||
xs: { span: 24 },
|
|
||||||
sm: { span: 16 },
|
|
||||||
},
|
|
||||||
confirmLoading: false,
|
|
||||||
validatorRules: {
|
|
||||||
isModel: [
|
|
||||||
{ required: true, message: this.$t('PleaseSelectModule'),trigger: 'change'},
|
|
||||||
],
|
|
||||||
dbFieldTxt: [
|
|
||||||
{ required: true, message: this.$t('PleaseEnterPropertyName'),trigger: 'blur'},
|
|
||||||
{ min:1, max: 20, message: this.$t('cantExeed')+'20'+this.$t('characters'), trigger: 'blur' },
|
|
||||||
],
|
|
||||||
dbFieldName: [
|
|
||||||
{ required: true, message: this.$t('PleaseEnterYourEnglishName'),trigger: 'blur'},
|
|
||||||
{ min:1, max: 20, message: this.$t('cantExeed')+'20'+this.$t('characters'), trigger: 'blur' },
|
|
||||||
],
|
|
||||||
dbFieldEnName:[
|
|
||||||
{ max: 50, message: this.$t('cantExeed')+'50'+this.$t('characters'), trigger: 'blur' },
|
|
||||||
],
|
|
||||||
fieldShowType: [
|
|
||||||
{ required: true, message: this.$t('PleaseSelectAttributeType'),trigger: 'change'},
|
|
||||||
],
|
|
||||||
dictId: [
|
|
||||||
{ required: true, message: this.$t('PleaseSelectOptionContent'),trigger: 'change'},
|
|
||||||
],
|
|
||||||
dbLength: [
|
|
||||||
{ required: true, message: this.$t('PleaseEnterFieldLength'),trigger: 'blur'},
|
|
||||||
],
|
|
||||||
orderNum: [
|
|
||||||
{ required: true, message: this.$t('PleaseEnterDisplayOrder'),trigger: 'blur'},
|
|
||||||
],
|
|
||||||
fieldMustInput: [
|
|
||||||
{ required: true, message: this.$t('selectWhetherRequired'),trigger: 'change'},
|
|
||||||
],
|
|
||||||
isShowList: [
|
|
||||||
{ required: true, message: this.$t('selectDisplayList'),trigger: 'change'},
|
|
||||||
],
|
|
||||||
showArea: [
|
|
||||||
{ required: true, message: this.$t('SelectDisplayArea'),trigger: 'change'},
|
|
||||||
],
|
|
||||||
isQuery: [
|
|
||||||
{ required: true, message: this.$t('SelectWhetherToSearch'),trigger: 'change'},
|
|
||||||
],
|
|
||||||
isShowLawsList: [
|
|
||||||
{ required: true, message: this.$t('selectDisplayListRegulations'),trigger: 'change'},
|
|
||||||
],
|
|
||||||
isShowSearch: [
|
|
||||||
{ required: true, message: this.$t('selectSearchCenterDisplayed'),trigger: 'change'},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
addVisible:false,
|
|
||||||
url: {
|
|
||||||
add: "tag/onlCgformTag/add",
|
|
||||||
edit: "tag/onlCgformTag/edit",
|
|
||||||
queryById: "tag/onlCgformTag/queryById"
|
|
||||||
},
|
|
||||||
//展示区域选项内容
|
|
||||||
areaOptions:[],
|
|
||||||
//选项内容选项
|
|
||||||
contentOption:[],
|
|
||||||
contentFlag:3,
|
|
||||||
contentOption1:[],
|
|
||||||
contentOption2:[],
|
|
||||||
isTagContent:false,
|
|
||||||
isSearch:true,
|
|
||||||
isLength:true,
|
|
||||||
flag:false, //表单提交标识
|
|
||||||
disabledEdit:false,
|
|
||||||
moduleShow:true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
watch:{
|
disableEdit(){
|
||||||
'form.fieldShowType'(val){
|
|
||||||
// this.contentFlag=val
|
|
||||||
if(val==0){
|
|
||||||
this.contentOption=[...this.contentOption2]
|
|
||||||
this.isTagContent=true
|
|
||||||
}else if(val==3||val==4){
|
|
||||||
this.contentOption=[...this.contentOption1]
|
|
||||||
this.isTagContent=true
|
|
||||||
}else{
|
|
||||||
this.isTagContent=false
|
|
||||||
}
|
|
||||||
if(val==7){
|
|
||||||
this.isSearch=false
|
|
||||||
this.form.isQuery=0
|
|
||||||
}else{
|
|
||||||
this.isSearch=true
|
|
||||||
}
|
|
||||||
if(val==1||val==8||val==9||val==10||val==11||val=='sel_user'){
|
|
||||||
this.isLength=true
|
|
||||||
}else{
|
|
||||||
this.isLength=false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
submitEdit(){
|
|
||||||
|
|
||||||
},
|
|
||||||
disableEdit(){
|
|
||||||
|
|
||||||
},
|
|
||||||
'form.isModel'(val){
|
|
||||||
console.log(form.isModel,'form.isModelform.isModel')
|
|
||||||
console.log('val',val)
|
|
||||||
if(val=='1'){
|
|
||||||
this.moduleShow=true
|
|
||||||
}else if(val=='0'){
|
|
||||||
this.moduleShow=false
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
'form.isModel'(val){
|
||||||
changeType(val){
|
console.log('val',val)
|
||||||
// console.log('changtType',val)
|
if(val=='1'){
|
||||||
},
|
this.moduleShow=true
|
||||||
formDisabled(){
|
}else if(val=='0'){
|
||||||
if(this.formBpm===true){
|
this.moduleShow=false
|
||||||
if(this.formData.disabled===false){
|
|
||||||
return false
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
changeType(val){
|
||||||
|
// console.log('changtType',val)
|
||||||
|
},
|
||||||
|
formDisabled(){
|
||||||
|
if(this.formBpm===true){
|
||||||
|
if(this.formData.disabled===false){
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return this.disabled
|
||||||
|
},
|
||||||
|
showFlowSubmitButton(){
|
||||||
|
if(this.formBpm===true){
|
||||||
|
if(this.formData.disabled===false){
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return this.disabled
|
}
|
||||||
},
|
return false
|
||||||
showFlowSubmitButton(){
|
}
|
||||||
if(this.formBpm===true){
|
},
|
||||||
if(this.formData.disabled===false){
|
created () {
|
||||||
return true
|
//如果是流程中表单,则需要加载流程表单data
|
||||||
|
this.showFlowData();
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// console.log('disableEdit',this.disableEdit)
|
||||||
|
this.loadContent()
|
||||||
|
this.loadShowArea()
|
||||||
|
// console.log('edit',this.submitEdit)
|
||||||
|
if(this.submitEdit==='add'){
|
||||||
|
if(this.submitKey==='1'){
|
||||||
|
this.form.isModel='1'
|
||||||
|
}else if(this.submitKey==='2'){
|
||||||
|
this.form.isModel='0'
|
||||||
|
}
|
||||||
|
this.disabledEdit=false
|
||||||
|
}else if(this.submitEdit==='edit'){
|
||||||
|
this.disabledEdit=true
|
||||||
|
this.form={...this.editData}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//获取选项内容
|
||||||
|
loadContent(){
|
||||||
|
let params = {};
|
||||||
|
getAction(`sys/dict/queryDictName`,params).then((res)=>{
|
||||||
|
if(res.success){
|
||||||
|
let data=[...res.result]
|
||||||
|
this.contentOption1=[]
|
||||||
|
this.contentOption2=[]
|
||||||
|
data.map(res=>{
|
||||||
|
if(res.attributeType=='1'){
|
||||||
|
this.contentOption1.push(res)
|
||||||
|
}else if(res.attributeType=='2'){
|
||||||
|
this.contentOption2.push(res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(this.form.fieldShowType==0){
|
||||||
|
this.contentOption=[...this.contentOption2]
|
||||||
|
this.isTagContent=true
|
||||||
|
}else if(this.form.fieldShowType==3||this.form.fieldShowType=='4'){
|
||||||
|
this.contentOption=[...this.contentOption1]
|
||||||
|
this.isTagContent=true
|
||||||
|
}else{
|
||||||
|
this.isTagContent=false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
});
|
||||||
}
|
|
||||||
},
|
},
|
||||||
created () {
|
//获取展示区域
|
||||||
//如果是流程中表单,则需要加载流程表单data
|
loadShowArea(){
|
||||||
this.showFlowData();
|
let params = {};
|
||||||
},
|
getAction(`tag/onlCgformArea/queryShowArea`,params).then((res)=>{
|
||||||
mounted() {
|
if(res.success){
|
||||||
// console.log('disableEdit',this.disableEdit)
|
this.areaOptions=res.result
|
||||||
this.loadContent()
|
|
||||||
this.loadShowArea()
|
|
||||||
// console.log('edit',this.submitEdit)
|
|
||||||
if(this.submitEdit==='add'){
|
|
||||||
console.log(this.submitKey,'this.submitKeythis.submitKey')
|
|
||||||
if(this.submitKey==='1'){
|
|
||||||
console.log(this.submitKey,'this.submitKeythis.submitKey')
|
|
||||||
this.form.isModel='1'
|
|
||||||
}else if(this.submitKey==='2'){
|
|
||||||
this.form.isModel='0'
|
|
||||||
}
|
}
|
||||||
this.disabledEdit=false
|
});
|
||||||
}else if(this.submitEdit==='edit'){
|
},
|
||||||
this.disabledEdit=true
|
add () {
|
||||||
this.form={...this.editData}
|
this.edit({});
|
||||||
|
|
||||||
|
},
|
||||||
|
edit (record) {
|
||||||
|
this.form.resetFields();
|
||||||
|
this.model = Object.assign({}, record);
|
||||||
|
this.visible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
// this.form.setFieldsValue(pick(this.model,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowList','showArea','isQuery','isShowLawsList','isShowSearch'))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//渲染流程表单数据
|
||||||
|
showFlowData(){
|
||||||
|
if(this.formBpm === true){
|
||||||
|
let params = {id:this.formData.dataId};
|
||||||
|
getAction(this.url.queryById,params).then((res)=>{
|
||||||
|
if(res.success){
|
||||||
|
this.edit (res.result);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
submitForm () {
|
||||||
//获取选项内容
|
// const that = this;
|
||||||
loadContent(){
|
// 触发表单验证
|
||||||
let params = {};
|
// console.log(this.$refs.tagform)
|
||||||
getAction(`sys/dict/queryDictName`,params).then((res)=>{
|
this.$refs.tagEditForm.validate((valid)=>{
|
||||||
if(res.success){
|
// console.log('valid',valid)
|
||||||
let data=[...res.result]
|
if (valid) {
|
||||||
this.contentOption1=[]
|
if(!this.flag){
|
||||||
this.contentOption2=[]
|
this.flag=true
|
||||||
data.map(res=>{
|
this.confirmLoading = true;
|
||||||
if(res.attributeType=='1'){
|
let httpurl = '';
|
||||||
this.contentOption1.push(res)
|
let method = '';
|
||||||
}else if(res.attributeType=='2'){
|
// console.log('this.editId',this.editId)
|
||||||
this.contentOption2.push(res)
|
if(this.submitEdit=='add'){
|
||||||
|
httpurl+=this.url.add;
|
||||||
|
method = 'post';
|
||||||
|
this.form.id=''
|
||||||
|
this.form.isReadOnly=0
|
||||||
|
}else if(this.submitEdit=='edit'){
|
||||||
|
httpurl+=this.url.edit;
|
||||||
|
method = 'put';
|
||||||
|
this.form.id=this.editId
|
||||||
|
|
||||||
|
}
|
||||||
|
this.form.dbIsKey='0'
|
||||||
|
this.form.dbIsNull='1'
|
||||||
|
this.form.dbPointLength='0'
|
||||||
|
this.form.isShowForm='1'
|
||||||
|
this.form.dbFieldName=this.form.dbFieldTxt
|
||||||
|
this.contentOption.forEach(item=>{
|
||||||
|
if(item.id==this.form.dictId){
|
||||||
|
// console.log('11111')
|
||||||
|
this.form.dictField=item.dictCode
|
||||||
|
this.form.dictText=item.dictName
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if(this.form.fieldShowType==0){
|
// console.log('form',this.form)
|
||||||
this.contentOption=[...this.contentOption2]
|
console.log('model',this.form.isModel)
|
||||||
this.isTagContent=true
|
let onlineId=''
|
||||||
}else if(this.form.fieldShowType==3||this.form.fieldShowType=='4'){
|
let url=''
|
||||||
this.contentOption=[...this.contentOption1]
|
if(this.form.isModel=='1'){
|
||||||
this.isTagContent=true
|
onlineId='48308196e7b04761b533dc31bc899707'
|
||||||
}else{
|
}else if(this.form.isModel=='0'){
|
||||||
this.isTagContent=false
|
onlineId='c998a34ea4b84089932197ed0705c757'
|
||||||
}
|
}
|
||||||
}
|
httpAction(httpurl,this.form,method).then((res)=>{
|
||||||
});
|
if(res.success){
|
||||||
},
|
this.$message.success(this.$t('OperationSuccessful'));
|
||||||
//获取展示区域
|
postAction(`online/cgform/api/doDbSynch/${onlineId}/normal
|
||||||
loadShowArea(){
|
|
||||||
let params = {};
|
|
||||||
getAction(`tag/onlCgformArea/queryShowArea`,params).then((res)=>{
|
|
||||||
if(res.success){
|
|
||||||
this.areaOptions=res.result
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
add () {
|
|
||||||
this.edit({});
|
|
||||||
|
|
||||||
},
|
|
||||||
edit (record) {
|
|
||||||
this.form.resetFields();
|
|
||||||
this.model = Object.assign({}, record);
|
|
||||||
this.visible = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
// this.form.setFieldsValue(pick(this.model,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowList','showArea','isQuery','isShowLawsList','isShowSearch'))
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//渲染流程表单数据
|
|
||||||
showFlowData(){
|
|
||||||
if(this.formBpm === true){
|
|
||||||
let params = {id:this.formData.dataId};
|
|
||||||
getAction(this.url.queryById,params).then((res)=>{
|
|
||||||
if(res.success){
|
|
||||||
this.edit (res.result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
submitForm () {
|
|
||||||
// const that = this;
|
|
||||||
// 触发表单验证
|
|
||||||
// console.log(this.$refs.tagform)
|
|
||||||
this.$refs.tagEditForm.validate((valid)=>{
|
|
||||||
// console.log('valid',valid)
|
|
||||||
if (valid) {
|
|
||||||
if(!this.flag){
|
|
||||||
this.flag=true
|
|
||||||
this.confirmLoading = true;
|
|
||||||
let httpurl = '';
|
|
||||||
let method = '';
|
|
||||||
// console.log('this.editId',this.editId)
|
|
||||||
if(this.submitEdit=='add'){
|
|
||||||
httpurl+=this.url.add;
|
|
||||||
method = 'post';
|
|
||||||
this.form.id=''
|
|
||||||
this.form.isReadOnly=0
|
|
||||||
}else if(this.submitEdit=='edit'){
|
|
||||||
httpurl+=this.url.edit;
|
|
||||||
method = 'put';
|
|
||||||
this.form.id=this.editId
|
|
||||||
|
|
||||||
}
|
|
||||||
this.form.dbIsKey='0'
|
|
||||||
this.form.dbIsNull='1'
|
|
||||||
this.form.dbPointLength='0'
|
|
||||||
this.form.isShowForm='1'
|
|
||||||
this.form.dbFieldName=this.form.dbFieldTxt
|
|
||||||
this.contentOption.forEach(item=>{
|
|
||||||
if(item.id==this.form.dictId){
|
|
||||||
// console.log('11111')
|
|
||||||
this.form.dictField=item.dictCode
|
|
||||||
this.form.dictText=item.dictName
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// console.log('form',this.form)
|
|
||||||
console.log('model',this.form.isModel)
|
|
||||||
let onlineId=''
|
|
||||||
let url=''
|
|
||||||
if(this.form.isModel=='1'){
|
|
||||||
onlineId='48308196e7b04761b533dc31bc899707'
|
|
||||||
}else if(this.form.isModel=='0'){
|
|
||||||
onlineId='c998a34ea4b84089932197ed0705c757'
|
|
||||||
}
|
|
||||||
httpAction(httpurl,this.form,method).then((res)=>{
|
|
||||||
if(res.success){
|
|
||||||
this.$message.success(this.$t('OperationSuccessful'));
|
|
||||||
postAction(`online/cgform/api/doDbSynch/${onlineId}/normal
|
|
||||||
`,{}).then(res=>{
|
`,{}).then(res=>{
|
||||||
})
|
})
|
||||||
this.$emit('ok',false);
|
this.$emit('ok',false);
|
||||||
}else{
|
}else{
|
||||||
this.$message.warning(res.message);
|
this.$message.warning(res.message);
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.confirmLoading = false;
|
this.confirmLoading = false;
|
||||||
this.flag=false
|
this.flag=false
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
},
|
|
||||||
popupCallback(row){
|
|
||||||
this.form.setFieldsValue(pick(row,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowForm','areaId','isQuery','isShowLawsList','isShowSearch'))
|
|
||||||
},
|
|
||||||
//正则替换小数点
|
|
||||||
limitNumber(value) {
|
|
||||||
if (typeof value === 'string') {
|
|
||||||
return !isNaN(Number(value)) ? value.replace(/\./g, '') : 0
|
|
||||||
} else if (typeof value === 'number') {
|
|
||||||
return !isNaN(value) ? String(value).replace(/\./g, '') : 0
|
|
||||||
} else {
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
handleChange(value) {
|
},
|
||||||
// console.log(`selected ${value}`);
|
popupCallback(row){
|
||||||
},
|
this.form.setFieldsValue(pick(row,'isModel','dbFieldTxt','dbFieldName','fieldShowType','dictName','dbLength','orderNum','fieldMustInput','isShowForm','areaId','isQuery','isShowLawsList','isShowSearch'))
|
||||||
}
|
},
|
||||||
|
//正则替换小数点
|
||||||
|
limitNumber(value) {
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
return !isNaN(Number(value)) ? value.replace(/\./g, '') : 0
|
||||||
|
} else if (typeof value === 'number') {
|
||||||
|
return !isNaN(value) ? String(value).replace(/\./g, '') : 0
|
||||||
|
} else {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleChange(value) {
|
||||||
|
// console.log(`selected ${value}`);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.form-tag{
|
.form-tag{
|
||||||
.tag-content{
|
.tag-content{
|
||||||
}
|
|
||||||
}
|
|
||||||
.tag-info{
|
|
||||||
margin-left: 30px;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.tag-info{
|
||||||
|
margin-left: 30px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.tag-content{
|
.tag-content{
|
||||||
.ant-select-selection-selected-value{
|
.ant-select-selection-selected-value{
|
||||||
color:rgba(0, 0, 0, 0.65);
|
color:rgba(0, 0, 0, 0.65);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user