From 52c8aa536cb1ccf9468ece3a6e4ca92e5a00204c Mon Sep 17 00:00:00 2001 From: zzq <15064940501@163.com> Date: Fri, 7 Jun 2024 17:16:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=9F=A5=E8=AF=A2=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/onlineform/formCall/CallModal.vue | 21 +++++++++++++--- src/views/demo/onlineform/formCall/index.vue | 24 ++++++++++++++----- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/views/demo/onlineform/formCall/CallModal.vue b/src/views/demo/onlineform/formCall/CallModal.vue index ad9558bb..4f73780d 100644 --- a/src/views/demo/onlineform/formCall/CallModal.vue +++ b/src/views/demo/onlineform/formCall/CallModal.vue @@ -224,6 +224,11 @@ } itemColumnChild.colProps.span = itemColumn.span; arr.push(itemColumnChild); + // arr.push({ + // parentValue: index, + // ...itemColumnChild, + // show: index == 0 ? true : false, + // }); val.children.push(itemColumnChild); }); }); @@ -235,6 +240,11 @@ } if (opt.ptype !== 'gridlayout') { arr.push(opt); + // arr.push({ + // parentValue: index, + // ...opt, + // show: index == 0 ? true : false, + // }); } formColumns.value = arr; @@ -388,7 +398,7 @@ } }); - function tabsChange(e) { + async function tabsChange(e) { const columns: FormSchema[] = []; tabsColumns.value.forEach((item) => { item.children.forEach((val) => { @@ -398,13 +408,18 @@ tabsColumns.value[e].children.forEach((item) => { item.itemProps.hidden = false; }); + // formColumns.value.forEach((element) => { + // element.show = false; + // if (element.parentValue == e) { + // element.show = true; + // } + // }); tabsColumns.value.forEach((item) => { item.children.forEach((val) => { columns.push(val); }); }); - const obj = getFieldsValue(); - + const obj = await validate(); setTimeout(() => { updateSchema(columns); resetFields(); diff --git a/src/views/demo/onlineform/formCall/index.vue b/src/views/demo/onlineform/formCall/index.vue index b1a45165..09ee7215 100644 --- a/src/views/demo/onlineform/formCall/index.vue +++ b/src/views/demo/onlineform/formCall/index.vue @@ -616,12 +616,24 @@ } if (columnObj.table.querys) { columnObj.table.querys.forEach((item) => { - searchFormSchema.push({ - field: item.key, - component: item.type || 'Input', - label: item.label, - colProps: { span: 6 }, - }); + if (item.options) { + searchFormSchema.push({ + field: item.key, + component: item.type || 'Input', + label: item.label, + colProps: { span: 6 }, + componentProps: { + options: item.options, + }, + }); + } else { + searchFormSchema.push({ + field: item.key, + component: item.type || 'Input', + label: item.label, + colProps: { span: 6 }, + }); + } }); } callColumns.forEach((item) => {