Browse Source

优化智能表单

master
陈裕财 2 years ago
parent
commit
6d98fc1197
  1. 2
      src/components/mdp-ui-ext/mdp-expand/FormDataItem.vue
  2. 9
      src/views/mdp/lcode/formDef/Form.vue

2
src/components/mdp-ui-ext/mdp-expand/FormDataItem.vue

@ -1,5 +1,5 @@
<template> <template>
<section>
<section v-if="field.hidden!='1'">
<el-row> <el-row>
<el-row v-if="field.extType=='row'" :gutter="gutter"> <el-row v-if="field.extType=='row'" :gutter="gutter">
<el-col v-for="child,idx in field.children" :key="idx" :span="calcSpan(child,field)"> <el-col v-for="child,idx in field.children" :key="idx" :span="calcSpan(child,field)">

9
src/views/mdp/lcode/formDef/Form.vue

@ -262,11 +262,11 @@ export default {
this.load.edit=false this.load.edit=false
var tips=res.data.tips; var tips=res.data.tips;
if(tips.isOk){ if(tips.isOk){
this.$mdp.removeFormFieldsCache(formDef.id)
this.currOpType='edit'
var data=res.data.data var data=res.data.data
Object.assign(this.editForm,data.formDef) Object.assign(this.editForm,data.formDef)
this.formFields=data.formFields this.formFields=data.formFields
this.$mdp.removeFormFieldsCache(this.editForm.id)
this.currOpType='edit'
this.afterSubmit(res,tips.isOk,this.currOpType); this.afterSubmit(res,tips.isOk,this.currOpType);
} }
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' });
@ -315,11 +315,12 @@ export default {
this.load.edit=false this.load.edit=false
var tips=res.data.tips; var tips=res.data.tips;
if(tips.isOk){ if(tips.isOk){
this.$mdp.removeFormFieldsCache(formDef.id)
this.currOpType='edit'
var data=res.data.data var data=res.data.data
Object.assign(this.editForm,data.formDef) Object.assign(this.editForm,data.formDef)
this.formFields=data.formFields this.formFields=data.formFields
this.$mdp.removeFormFieldsCache(this.editForm.id)
this.currOpType='edit'
this.afterSubmit(res,tips.isOk,this.currOpType); this.afterSubmit(res,tips.isOk,this.currOpType);
} }
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' });

Loading…
Cancel
Save