From 6de809bebacae8fe14b15d2fc6de4a02b07d2e60 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Mon, 28 Oct 2024 17:36:20 +0800 Subject: [PATCH] 1 --- src/utils/formBuilder.js | 3 ++- src/views/flow/DesktopForm.vue | 4 ++++ src/views/flow/create.vue | 42 ++++++++++++++++++++++++++++++---- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/utils/formBuilder.js b/src/utils/formBuilder.js index 26968e6..dfcd38f 100644 --- a/src/utils/formBuilder.js +++ b/src/utils/formBuilder.js @@ -563,6 +563,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab "keep-source": true, "column-config": { resizable: true }, "show-overflow": true, + "edit-rules": info._writeable ? this.subRules[`${info.name}_rules`] : {}, "edit-config": info._writeable ? { trigger: "click", @@ -854,7 +855,7 @@ export default function formBuilder(device, info, h, row, pWrite = false,pReadab props: { prop: info.name, label: info.label_show ? info.label : '', - 'label-width': !info.label_show ? '0': '' + 'label-width': !info.label_show ? '0': '', }, style: { "grid-column-start": info.gs_x + 1, diff --git a/src/views/flow/DesktopForm.vue b/src/views/flow/DesktopForm.vue index 1cc2452..f6a729b 100644 --- a/src/views/flow/DesktopForm.vue +++ b/src/views/flow/DesktopForm.vue @@ -54,6 +54,10 @@ export default { type: Object, default: () => ({}), }, + subRules: { + type: Object, + default: () => ({}), + }, }, data() { return { diff --git a/src/views/flow/create.vue b/src/views/flow/create.vue index 027445c..1243444 100644 --- a/src/views/flow/create.vue +++ b/src/views/flow/create.vue @@ -55,6 +55,7 @@ :script-content="scriptContent" :writeable="writeableFields" :rules="rules" + :sub-rules="subRules" >