From 1e67982e6d7ef031f2d520ec704b00641996a23d Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Wed, 18 Mar 2026 15:18:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=B3=E8=81=94=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E9=9A=90=E8=97=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignForm/public/form/newForm.vue | 103 +++++++++++++----- 1 file changed, 74 insertions(+), 29 deletions(-) diff --git a/src/components/DesignForm/public/form/newForm.vue b/src/components/DesignForm/public/form/newForm.vue index 56789d0..f2bba6b 100644 --- a/src/components/DesignForm/public/form/newForm.vue +++ b/src/components/DesignForm/public/form/newForm.vue @@ -249,6 +249,45 @@ interface hideFieldConditionArritem { conditions: any[]; } +function funWait(trueValue,conditionFieldValueArr,x,hideFieldsFromCheckbox,toshow){ + if(trueValue){ + if (trueValue.length > 0 && arrayEqual(trueValue, conditionFieldValueArr)) { + //此时满足了条件,但是必须看一下conditionField有没有被隐藏.如果被隐藏了,则x不能增加. + //alert("多选条件成功触发") + /* console.log(conditionField) + console.log(toshow) */ + let flag = false; //其依赖的选项的父字段是否被隐藏.默认没被隐藏, + //如果此时的conditionField有可能被隐藏且已被隐藏,x不能++ + /* for(let a = 0;a1说明时多选,=1说明是单选. + for(let b = 0;b item!=hideFieldsFromCheckbox[i]) + //emits('refresh') + } */ + } + } + }else{ + setTimeout(()=>{ + funWait(trueValue,conditionFieldValueArr,x,hideFieldsFromCheckbox,toshow) + },100) + } + +} + const recursionToGetFinallyHideFields = ( hideFieldArr: any[], radioSelectArr3: string | any[], @@ -354,35 +393,41 @@ const recursionToGetFinallyHideFields = ( if (modelKeyArr[n] == conditionField) { //let count_1 = 0; let trueValue = model.value[modelKeyArr[n]]; - if (trueValue.length > 0 && arrayEqual(trueValue, conditionFieldValueArr)) { - //此时满足了条件,但是必须看一下conditionField有没有被隐藏.如果被隐藏了,则x不能增加. - //alert("多选条件成功触发") - /* console.log(conditionField) - console.log(toshow) */ - let flag = false; //其依赖的选项的父字段是否被隐藏.默认没被隐藏, - //如果此时的conditionField有可能被隐藏且已被隐藏,x不能++ - /* for(let a = 0;a1说明时多选,=1说明是单选. - for(let b = 0;b item!=hideFieldsFromCheckbox[i]) - //emits('refresh') - } */ - } - } + + funWait(trueValue,conditionFieldValueArr,x,hideFieldsFromCheckbox,toshow) + + + // if (trueValue.length > 0 && arrayEqual(trueValue, conditionFieldValueArr)) { + // //此时满足了条件,但是必须看一下conditionField有没有被隐藏.如果被隐藏了,则x不能增加. + // //alert("多选条件成功触发") + // /* console.log(conditionField) + // console.log(toshow) */ + // let flag = false; //其依赖的选项的父字段是否被隐藏.默认没被隐藏, + // //如果此时的conditionField有可能被隐藏且已被隐藏,x不能++ + // /* for(let a = 0;a1说明时多选,=1说明是单选. + // for(let b = 0;b item!=hideFieldsFromCheckbox[i]) + // //emits('refresh') + // } */ + // } + // } + + } } } else {