From 46c673f0bf4a22ae108e90cfcf1bdeb4f0b6a45c Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期二, 07 五月 2024 17:48:19 +0800 Subject: [PATCH] 添加action,数据联动 --- Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue | 42 +++++++++++++++++++++++++++++++++--------- 1 files changed, 33 insertions(+), 9 deletions(-) diff --git a/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue b/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue index 0ae6114..1792005 100644 --- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue +++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue @@ -1,13 +1,16 @@ <template> <div :id="'UI-dynamic-'+areasName+componentVO.oid" class="UI-dynamic"> <dynamic-button v-if="componentVO && componentVO.buttons" :key="areasName+'buttons-'+componentVO.oid" - :componentVO="componentVO" :butttonList="componentVO.buttons" :dataStore="[form]" :sourceData="sourceData" type="form"></dynamic-button> + :componentVO="componentVO" :butttonList="componentVO.buttons" :dataStore="[form]" :sourceData="sourceData" + @afterMethod="handleRefresh" type="form"></dynamic-button> <basic-form :key="areasName+'basicForm-'+componentVO.oid" :span="this.componentVO.formDefineVO.columnOneRow?(24/this.componentVO.formDefineVO.columnOneRow) : 12" :formItems="this.componentVO.formDefineVO && this.componentVO.formDefineVO.items" :disabled="!inDialog" - :isEdit="inDialog" - :formData="form"> + :isEdit="canEdit" + :formData="form" + :initValue="paramVOS.initvalue" + @getFormData="getFormData"> </basic-form> </div> </template> @@ -33,6 +36,11 @@ inDialog: { type: Boolean, default: false + }, + canEdit:{ + //鍐呭鏄惁鍙紪杈� + type:Boolean, + default:false }, areasName: { type: String, @@ -79,11 +87,19 @@ this.$emit("setDataStore", { area: this.areasName, type:this.componentVO.uiComponentType, - btmType:this.componentVO.treeDefineVO.btmType, + btmType:this.currentDefineVO.btmType, dataStore:[newval] }); + this.$emit("setData", { + area: this.areasName, + type:this.componentVO.uiComponentType, + currentDefineVO:this.currentDefineVO, + data:newval + }); } - } + }, + deep: true, + immediate: true }, sourceData: { handler(newval) { @@ -91,7 +107,9 @@ this.sourceDataMapParams=this.sourceDataMap(); this.getParams(); this.handleRefresh(); - } + }, + deep: true, + immediate: true } }, created() { @@ -139,9 +157,11 @@ const sourceDataMapList = this.sourceDataMapParams; this.params = Object.assign({},formParams, sourceDataMapList); - console.log(this.params) }, onLoad:function () { + if (this.paramVOS.initvalue) { + this.form=this.paramVOS.initvalue; + } if (Object.keys(this.sourceData).length>0 && this.isShow) { this.loading = true; dataForm(this.params).then(res => { @@ -153,8 +173,12 @@ }); } }, - handleRefresh(){ - + handleRefresh() { + this.form={} + this.onLoad(); + }, + getFormData(form) { + this.form = form; } } } -- Gitblit v1.9.3