|
|
|
@ -3,29 +3,37 @@ |
|
|
|
|
|
|
|
<el-form v-model="field" :rules="fieldRules" ref="field" label-width="80px" style="width:350px;"> |
|
|
|
<el-form-item v-if="(field.typ=='select' || (field.typ=='checkbox') || (field.typ=='radio')) && !field.extType" label="数据" prop="isDict"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-input v-model="field.dict" @focus="$refs['itemDialog'].open(field)" placeholder="点击关联基础数据"> </el-input> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-input v-model="field.dict" @focus="$refs['itemDialog'].open(field)" placeholder="点击关联基础数据"> |
|
|
|
<template slot="append"> |
|
|
|
<el-button type="primary" icon="el-icon-delete" @click="deleteBaseData"></el-button> |
|
|
|
</el-col> |
|
|
|
</template> |
|
|
|
|
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="名称" prop="title"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-input v-model="field.title" label="属性名称" auto-complete="off" placeholder="请输入内容" > </el-input> |
|
|
|
</el-col> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="编码" prop="id"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-input v-model="field.id" auto-complete="off" placeholder="请输入内容" > </el-input> |
|
|
|
</el-col> |
|
|
|
<el-form-item label="编码" prop="id" > |
|
|
|
<el-popover |
|
|
|
placement="top-start" |
|
|
|
width="400" |
|
|
|
:open-delay="700" |
|
|
|
trigger="hover"> |
|
|
|
<div> |
|
|
|
编码规则: 支持两种编码格式:假设有字段 客户姓名 cust_name <br> |
|
|
|
1. ext_infos.cust_name, 此编码方式的字段,用户录入的客户姓名将存储在【ext_infos.cust_name】中<br> |
|
|
|
2. cust_name 不带【ext_infos.】,此编码方式的字段,用户录入的客户姓名将存储在 【cust_name】中<br> |
|
|
|
</div> |
|
|
|
<el-input slot="reference" v-model="field.id" auto-complete="off" placeholder="请输入内容" @change="onIdChange" @click.native="oldId=field.id"> |
|
|
|
<template slot="append"> |
|
|
|
<el-button class="el-icon-question"></el-button> |
|
|
|
</template> |
|
|
|
</el-input> |
|
|
|
|
|
|
|
</el-popover> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="主键" prop="bkey" v-if=" (field.typ!='checkbox') && (field.typ!='radio') && field.mul!='1' && field.typ!='textarea'" > |
|
|
|
|
|
|
|
<el-select v-model="primaryKeys" multiple label="" clearable placeholder="请选择"> |
|
|
|
<el-option label="创建人" key="cuserid" value="cuserid">创建人 </el-option> |
|
|
|
<el-option label="创建部门" key="deptid" value="deptid">创建部门 </el-option> |
|
|
|
</el-select> |
|
|
|
<el-checkbox v-model="field.bkey" true-label="1" false-label="0" @change="onBkeyChange">是否主键</el-checkbox> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="必需" prop="req" > |
|
|
|
<el-checkbox v-model="field.req" :disabled="field.bkey=='1'" true-label="1" false-label="0">是否必输</el-checkbox> |
|
|
|
@ -155,6 +163,13 @@ |
|
|
|
return {} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
hasChild:{ |
|
|
|
type:Function, |
|
|
|
default:function(){ |
|
|
|
return null; |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
value:{ |
|
|
|
@ -167,6 +182,7 @@ |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
oldId:'', |
|
|
|
field:{}, |
|
|
|
primaryKeys:[], |
|
|
|
|
|
|
|
@ -196,6 +212,33 @@ |
|
|
|
onQxSetChange(){ |
|
|
|
this.handleConfirm() |
|
|
|
this.$refs['qxDialog'].close(); |
|
|
|
}, |
|
|
|
onBkeyChange(v){ |
|
|
|
this.$emit('bkey-change',this.field) |
|
|
|
}, |
|
|
|
onIdChange(v){ |
|
|
|
|
|
|
|
if(!v||v.length==0){ |
|
|
|
this.$notify.error('编码不能为空') |
|
|
|
return; |
|
|
|
} |
|
|
|
if(v.indexOf(".")>=0){ |
|
|
|
if(v.indexOf('ext_info.')!=0){ |
|
|
|
this.$notify.error('编码格式错误,前缀只支持【空前缀、ext_info.】两种') |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
var id=v.toLocaleLowerCase(); |
|
|
|
this.field.isNewAdd=true |
|
|
|
if(this.hasChild(id)){ |
|
|
|
this.field.id=this.oldId |
|
|
|
this.$notify.error('编码【'+id+'】已存在,请换个编码') |
|
|
|
return; |
|
|
|
} |
|
|
|
this.field.isNewAdd=false |
|
|
|
this.field.id=id; |
|
|
|
this.field.idCamel=this.$mdp.toCamel(this.field.id) |
|
|
|
this.$emit('id-change',this.field) |
|
|
|
} |
|
|
|
/**end 在上面加自定义方法**/ |
|
|
|
|
|
|
|
|