From d5bd95bdbd97a63a1e04453c99604e36a38cba0b Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Thu, 21 Nov 2024 11:43:27 +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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignForm/public/form/form.vue | 115 +++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-) diff --git a/src/components/DesignForm/public/form/form.vue b/src/components/DesignForm/public/form/form.vue index 56dc831..a0c2cc8 100644 --- a/src/components/DesignForm/public/form/form.vue +++ b/src/components/DesignForm/public/form/form.vue @@ -444,6 +444,44 @@ if(formProps.value.type!=5){ return hideFieldArr } +let oldModelStr = "" +watch(() => 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) => { + //console.log(element) + let asfName = element.name + //console.log("asfName----->"+asfName) + if(element.control.dataRangeGongShi&&element.control.dataRangeGongShi.mathsFormula&&element.control.dataRangeGongShi.mathsFormula.length>0){ + let asfRangeDoubleCondi = element.control.dataRangeGongShi.mathsFormula + //console.log("数据范围条件----->"+asfRangeDoubleCondi) + if(currentChangeKey!=""){ + //console.log("currentChangeKey----->"+currentChangeKey) + let a = asfRangeDoubleCondi.split(":") + let field = a[a.length-1] + if(currentChangeKey==field){ + let toShowDoubleCondiValVal = model.value[currentChangeKey] + console.log("关联表单"+asfName+"应该更新其选项,只显示doubleCondiVal为"+toShowDoubleCondiValVal+"的选项") + //console.log(field) + } + } + //rangeFormulaArr.push() + } + }); + } + oldModelStr = newModelStr +},{deep: true}) // 表单组件值改变事件 tProp为子表格相关 @@ -1558,8 +1596,82 @@ watch( } ) // ------------------------数据处理结束------------------------ +const asfs: any[] = [] +const tables: any[] = [] +function getAsfs(){ + setTimeout(()=>{ + let dataList = ref({}) + dataList.value = props.formData.list + //props.formData.list[i].type=="associatedForms" + 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)); + //console.log(columns) + if(columns.length>0){ + for(let z = 0;z0){ + for(let z = 0;z0){ + for(let m = 0;m0){ + console.log(asfs) + } + if(tables.length>0){ + console.log(tables) + } */ + } + },500) +} @@ -1575,6 +1687,7 @@ onMounted(() => { appendRemoveStyle(true) }) showOrHide("kong") + getAsfs() }) onUnmounted(() => { if (eventName) {