From 749768b9d076d02fb151ad94fff6a7ce45dff55d Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期四, 05 十二月 2024 11:30:31 +0800 Subject: [PATCH] 修改UI定义表单传值 --- Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-form.vue | 11 +++++++++-- Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue | 29 +++++++++++++++-------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue index 3a28de4..dc51274 100644 --- a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue +++ b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue @@ -187,11 +187,11 @@ ...item, label: item.text, prop: item.prop || item.field, - showProp:item.showProp || item.showField, + showProp: item.showProp || item.showField, type: type, - labelWidth:item.labelWidth || this.labelWidth || (item.text.length >= 6 ? 115 : 90), + labelWidth: item.labelWidth || this.labelWidth || (item.text.length >= 6 ? 115 : 90), disabled: item.disabled || this.disabled, - readonly:item.readonly || item.readOnly, + readonly: item.readonly || item.readOnly, span: item.span ? item.span : item.type === "textarea" @@ -202,27 +202,28 @@ labelSuffix: item.labelSuffix || item.suffix, tip: item.tip || item.tooltips, dictCode: item.dictCode || item.comboxKey, - valueFormat: item.valueFormat ||item.dateFormate , + valueFormat: item.valueFormat || item.dateFormate, format: item.format || item.dateFormate, - rules: this.isEdit?(type=="select" || type=="refer" || type=="date" || type=="datetime"?[{ + }; + if(!item.rules || item.rules.length==0){ + col.rules=this.isEdit ? (type == "select" || type == "refer" || type == "date" || type == "datetime" ? [{ required: item.required || false, message: `璇烽�夋嫨${item.text}!`, trigger: "change" - },{ - required: item.required|| false, + }, { + required: item.required || false, message: `璇烽�夋嫨${item.text}!`, trigger: "submit" - }]:[{ - required: item.required|| false, + }] : [{ + required: item.required || false, message: `璇疯緭鍏�${item.text}!`, trigger: "blur" - },{ - required: item.required|| false, + }, { + required: item.required || false, message: `璇疯緭鍏�${item.text}!`, trigger: "submit" - }]):[], - - }; + }]) : [] + } if(!this.isEdit){ col.placeholder=col.label; col.disabled=true; diff --git a/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-form.vue b/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-form.vue index 48a8ad9..81f8707 100644 --- a/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-form.vue +++ b/Source/plt-web/plt-web-ui/src/components/dynamic-components/dynamic-form.vue @@ -104,7 +104,14 @@ }, deep: true, immediate: true - } + }, + isShow: { + handler(newval) { + if(newval){ + this.handleRefresh(); + } + } + }, }, created() { this.getParams(); @@ -157,7 +164,7 @@ btmName: this.currentDefineVO.btmType, btmType: this.currentDefineVO.btmType, formDefineId: this.currentDefineVO.id, - oid: this.currentDefineVO.oid + formDefineOid: this.currentDefineVO.oid }; if (this.dataStore[0] && this.dataStore[0].oid) { formParams.oid = this.dataStore[0].oid; -- Gitblit v1.9.3