Browse Source

优化

master
陈裕财 2 years ago
parent
commit
8201f1c8fc
  1. 5
      src/components/mdp-ui/mixin/MdpTableMixin.js
  2. 9
      src/views/mdp/form/formData/Index.vue
  3. 8
      src/views/mdp/form/formDef/Form.vue
  4. 4
      src/views/mdp/form/formField/FieldCfg.vue
  5. 4
      src/views/mdp/form/formField/Index.vue

5
src/components/mdp-ui/mixin/MdpTableMixin.js

@ -516,6 +516,11 @@ export const MdpTableMixin = {
if(d[expandFieldName] && d[expandFieldName] instanceof String){ if(d[expandFieldName] && d[expandFieldName] instanceof String){
d[expandFieldName]=JSON.parse(d[expandFieldName]) d[expandFieldName]=JSON.parse(d[expandFieldName])
} }
if(d[expandFieldName] instanceof Array){
d[expandFieldName].forEach(k=>{
d[expandFieldName+"."+k.id]=k.value
})
}
}) })
} }
}, },

9
src/views/mdp/form/formData/Index.vue

@ -255,9 +255,16 @@ export default {
if(datas){ if(datas){
datas.forEach(d=>{ datas.forEach(d=>{
if(d.extInfos){ if(d.extInfos){
d.extInfos=JSON.parse(d.extInfos)
var extInfos=JSON.parse(d.extInfos)
var extInfos2={}
extInfos.forEach(e=>{
extInfos2[e.id]=e.value
d['extInfos.'+e.id]=e.value
})
d.extInfos=extInfos2
} }
}) })
} }
}, },

8
src/views/mdp/form/formDef/Form.vue

@ -33,7 +33,7 @@
<mdp-select item-code="form_data_type" show-style="tag" v-model="editForm.dataType"></mdp-select> <mdp-select item-code="form_data_type" show-style="tag" v-model="editForm.dataType"></mdp-select>
</el-form-item> </el-form-item>
<el-form-item label="主键" prop="pks"> <el-form-item label="主键" prop="pks">
<mdp-select show-style="tag" :multiple="true" @click.native="oldPks=editForm.pks" v-model="editForm.pks" :plus-options="pkOptions" :props="{id:'id',name:'title'}" split="," @change2="onPksChange"></mdp-select>
<mdp-select show-style="tag" :multiple="true" v-model="editForm.pks" :plus-options="pkOptions" :props="{id:'id',name:'title'}" split="," @change2="onPksChange"></mdp-select>
</el-form-item> </el-form-item>
<span v-if="['2','3'].some(k=>k==editForm.dataType)"> <span v-if="['2','3'].some(k=>k==editForm.dataType)">
<el-form-item label="表名"> <el-form-item label="表名">
@ -128,7 +128,6 @@ export default {
formFields:[], formFields:[],
editable:false,// editable:false,//
formFieldsVisible:false, formFieldsVisible:false,
oldPks:'',//
} }
}, },
methods: { methods: {
@ -148,12 +147,14 @@ export default {
this.formFields=data.formFields this.formFields=data.formFields
this.currOpType='edit' this.currOpType='edit'
this.formFieldsVisible=true; this.formFieldsVisible=true;
this.dataBak={...this.editForm}
}else{ }else{
this.editForm.id=this.formId this.editForm.id=this.formId
this.formFields=[] this.formFields=[]
this.currOpType='add' this.currOpType='add'
this.formFieldsVisible=true; this.formFieldsVisible=true;
this.editForm.dataField='extInfos' this.editForm.dataField='extInfos'
this.dataBak={...this.editForm}
} }
}else{ }else{
this.$notify.error(tips.msg) this.$notify.error(tips.msg)
@ -244,7 +245,8 @@ export default {
onPksChange(pks){ onPksChange(pks){
var pksCtimeList=pks.filter(k=>k.id.indexOf('ctime')>=0) var pksCtimeList=pks.filter(k=>k.id.indexOf('ctime')>=0)
if(pksCtimeList && pksCtimeList.length>1){ if(pksCtimeList && pksCtimeList.length>1){
this.editForm.pks=this.oldPks;
debugger
this.editForm.pks=this.dataBak.pks;
this.$notify.error("创建日期最多只能选一个作为主键") this.$notify.error("创建日期最多只能选一个作为主键")
} }
} }

4
src/views/mdp/form/formField/FieldCfg.vue

@ -248,8 +248,8 @@
return; return;
} }
if(v.indexOf(".")>=0){ if(v.indexOf(".")>=0){
if(v.indexOf('ext_info.')!=0){
this.$notify.error('编码格式错误,前缀只支持【空前缀、ext_info.】两种')
if(v.indexOf('ext_infos.')!=0){
this.$notify.error('编码格式错误,前缀只支持【空前缀、ext_infos.】两种')
return; return;
} }
} }

4
src/views/mdp/form/formField/Index.vue

@ -602,6 +602,10 @@ export default {
getMyFieldList(list,children){ getMyFieldList(list,children){
if(children && children.length>0){ if(children && children.length>0){
children.forEach(k=>{ children.forEach(k=>{
if(['card','tabs','row'].some(t=>t==k.extType)){
k.req='0'
k.bkey='0'
}
if(k.children && k.children.length>0){ if(k.children && k.children.length>0){
var childs=k.children var childs=k.children
childs.forEach(c=>c.pid=k.id) childs.forEach(c=>c.pid=k.id)

Loading…
Cancel
Save