From 9fd63fe63596a361f4c954f1f0732a323aadeaa1 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Mon, 9 Dec 2024 16:56:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=80=89=E9=A1=B9=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=98=BE=E7=A4=BA=E9=9A=90=E8=97=8F=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liwenxuan <1298531568@qq.com> --- src/components/formTable/index.vue | 60 ++++++++++-------------------- 1 file changed, 19 insertions(+), 41 deletions(-) diff --git a/src/components/formTable/index.vue b/src/components/formTable/index.vue index fce125e..af69e2b 100644 --- a/src/components/formTable/index.vue +++ b/src/components/formTable/index.vue @@ -1029,15 +1029,15 @@ function showOrHide(data: any) { //console.log(data) /* - 企管部有当前用户, - 当前用户是什么权限角色. - 某表单某字段值大于等于小于不等于某个值 - - 所需接口 - 接口1:当前用户是不是指定的权限角色 - 接口2:当前用户是否在指定的机构下或机构的祖先机构下 - 接口3:本表单(关联关联表单的表单)的某字段的当前值大于等于小于不等于指定的值???也许不需要接口呢? - + 企管部有当前用户, + 当前用户是什么权限角色. + 某表单某字段值大于等于小于不等于某个值 + + 所需接口 + 接口1:当前用户是不是指定的权限角色 + 接口2:当前用户是否在指定的机构下或机构的祖先机构下 + 接口3:本表单(关联关联表单的表单)的某字段的当前值大于等于小于不等于指定的值???也许不需要接口呢? + */ //关联表单隐藏条件判定 start @@ -1231,11 +1231,11 @@ function showOrHide(data: any) { //liwenxuan 关联选项设置效果实现 start /* console.log("监听表单-1-constControlChange-->",props.formData) - console.log("监听表单-2-constControlChange-->",key) - console.log("监听表单-3-constControlChange-->", value) - console.log("监听表单-4-constControlChange-->",data) - console.log("监听表单-5-constControlChange-->",type) - console.log("监听表单-6-constControlChange-->",attribute) */ + console.log("监听表单-2-constControlChange-->",key) + console.log("监听表单-3-constControlChange-->", value) + console.log("监听表单-4-constControlChange-->",data) + console.log("监听表单-5-constControlChange-->",type) + console.log("监听表单-6-constControlChange-->",attribute) */ //得到当前表单各选项的值 //props.formData.config.hideField.push("nin2yuan4yi4wei4wo3menda3fen1ma101939") @@ -1615,9 +1615,7 @@ const recursionToGetFinallyHideFields = ( for (let i = 0; i < radioSelectArr3.length; i++) { for (let j = 0; j < radioSelectArr3[i].toShowFieldKey.length; j++) { for (let n = 0; n < hideFieldConditionArr.length; n++) { - /* console.log(i) - console.log(j) - console.log(n) */ + if (radioSelectArr3[i].toShowFieldKey[j] == hideFieldConditionArr[n].toShow) { if (Array.isArray(radioSelectArr3[i].conditionFieldValue)) { let valStr = ""; @@ -1694,11 +1692,7 @@ const recursionToGetFinallyHideFields = ( if (flag == false) { x++; hideFieldsFromCheckbox.push(toshow); - //console.log(hideFieldArr) - /* for(let i = 0;i item!=hideFieldsFromCheckbox[i]) - //emits('refresh') - } */ + } } } @@ -1710,27 +1704,11 @@ const recursionToGetFinallyHideFields = ( if (modelKeyArr[n] == conditionField) { //let count_1 = 0; let trueValue = model.value[modelKeyArr[n]]; - //console.log(modelKeyArr[n]) - /* console.log("conditionField====="+conditionField) - console.log("trueValue====="+trueValue) - console.log("conditionFieldValue-----"+conditionFieldValue) */ - + if (trueValue == conditionFieldValue) { - //此时满足了条件,但是必须看一下conditionField有没有被隐藏.如果被隐藏了,则x不能增加. + let flag = false; //其依赖的选项的父字段是否被隐藏.默认没被隐藏, - //如果此时的conditionField有可能被隐藏且已被隐藏,x不能++ - /* for(let a = 0;a1说明时多选,=1说明是单选. - for(let b = 0;b