From 1f3668a6431c641be50f9ebd02071155a8689daf Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Tue, 3 Dec 2024 11:41:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94=E8=A1=A8=E5=8D=95=E5=A4=9A?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E6=95=B0=E6=8D=AE=E5=A1=AB=E5=85=85=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6---=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/app/formPage.vue | 119 +++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/src/components/DesignForm/app/formPage.vue b/src/components/DesignForm/app/formPage.vue index 5a9bef8..7c72b31 100644 --- a/src/components/DesignForm/app/formPage.vue +++ b/src/components/DesignForm/app/formPage.vue @@ -292,6 +292,7 @@ onMounted(() => { } }) + getAsfs() }) /** @ 作者: 秦东 @@ -1063,6 +1064,124 @@ function optionsValue3Get2(data: any,fieldName: string){ } +const asfs: any[] = [] +const tables: any[] = [] +function getAsfs(){ + setTimeout(()=>{ + let dataList = ref({}) + dataList.value = props.formData.list + + if(dataList&&Array.isArray(dataList.value)&&dataList.value.length>0){ + for(let i = 0;i { + if(element.type=="associatedForms"){ + asfs.push(element) + } + }); + }else if(dataList.value[i].type=="grid"){ + let columns = JSON.parse(JSON.stringify(dataList.value[i].columns)); + + if(columns.length>0){ + for(let z = 0;z0){ + for(let z = 0;z0){ + for(let m = 0;m model.value,(newVal) => { + let currentChangeKey = "" + const newModelStr = JSON.stringify(newVal); + let oldModelStr1 = oldModelStr + if (newModelStr!== oldModelStr1&&oldModelStr1!="") { + let oldVal = JSON.parse(oldModelStr1); + for (const key in newVal) { + if (JSON.stringify(newVal[key])!== JSON.stringify(oldVal[key])) { + currentChangeKey = key + } + } + } + let rangeFormulaArr = [] + if(asfs.length>0){ + asfs.forEach((element:any) => { + + let asfName = element.name + + if(element.control.dataRangeGongShi&&element.control.dataRangeGongShi.mathsFormula&&element.control.dataRangeGongShi.mathsFormula.length>0){ + let asfRangeDoubleCondi = element.control.dataRangeGongShi.mathsFormula + + if(currentChangeKey!=""){ + + let a = asfRangeDoubleCondi.split(":") + let field = a[a.length-1] + if(currentChangeKey==field){ + let toShowDoubleCondiValVal = model.value[currentChangeKey] + //console.log("关联表单"+asfName+"应该更新其选项,只显示doubleCondiVal为"+toShowDoubleCondiValVal+"的选项") + let obj = { + asfName:asfName, + toShowDoubleCondiValVal:toShowDoubleCondiValVal + } + asfRangeDoubleCondiChangeObj.value = obj + + } + } + + } + }); + } + oldModelStr = newModelStr +},{deep: true}) +