|
|
|
@ -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<dataList.value.length;i++){ |
|
|
|
if(dataList.value[i].type=="associatedForms"){ |
|
|
|
asfs.push(dataList.value[i]) |
|
|
|
}else if(dataList.value[i].type=="card"||dataList.value[i].type=="flex"||dataList.value[i].type=="div"||dataList.value[i].type=="table"){ |
|
|
|
|
|
|
|
if(dataList.value[i].type=="table"){ |
|
|
|
tables.push(dataList.value[i]) |
|
|
|
} |
|
|
|
|
|
|
|
dataList.value[i].list.forEach((element:any) => { |
|
|
|
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;z<columns.length;z++){ |
|
|
|
for(let x = 0; x<columns[z].list.length;x++){ |
|
|
|
let a = JSON.parse(JSON.stringify(columns[z].list[x])); |
|
|
|
//console.log(a) |
|
|
|
if(a.type=="associatedForms"){ |
|
|
|
asfs.push(a) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else if(dataList.value[i].type=="tabs"){//tabs标签页有可能再嵌套一层flex或者table |
|
|
|
let columns = JSON.parse(JSON.stringify(dataList.value[i].columns)); |
|
|
|
if(columns.length>0){ |
|
|
|
for(let z = 0;z<columns.length;z++){ |
|
|
|
for(let x = 0; x<columns[z].list.length;x++){ |
|
|
|
let a = JSON.parse(JSON.stringify(columns[z].list[x])); |
|
|
|
//console.log(a) |
|
|
|
if(a.type=="associatedForms"){ |
|
|
|
asfs.push(a) |
|
|
|
}else if(a.type=="flex"||a.type=="table"){ |
|
|
|
|
|
|
|
if(a.type=="table"){ |
|
|
|
tables.push(dataList.value[i]) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(a.list.length>0){ |
|
|
|
for(let m = 0;m<a.list.length;m++){ |
|
|
|
let q = JSON.parse(JSON.stringify(a.list[m])) |
|
|
|
//console.log(q) |
|
|
|
if(q.type=="associatedForms"){ |
|
|
|
asfs.push(q) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/* if(asfs.length>0){ |
|
|
|
console.log(asfs) |
|
|
|
} |
|
|
|
if(tables.length>0){ |
|
|
|
console.log(tables) |
|
|
|
} */ |
|
|
|
} |
|
|
|
},500) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1575,6 +1687,7 @@ onMounted(() => { |
|
|
|
appendRemoveStyle(true) |
|
|
|
}) |
|
|
|
showOrHide("kong") |
|
|
|
getAsfs() |
|
|
|
}) |
|
|
|
onUnmounted(() => { |
|
|
|
if (eventName) { |
|
|
|
|