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) {