|
|
|
@ -206,18 +206,18 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
|
|
|
|
|
|
|
|
nextTick(() => { |
|
|
|
console.log("以showFields的处理过冒号的每个元素为key,其对应的optionValue为value,新建的数组radioselectArr3 --- 内容为完整显示隐藏条件") |
|
|
|
/* console.log("以showFields的处理过冒号的每个元素为key,其对应的optionValue为value,新建的数组radioselectArr3 --- 内容为完整显示隐藏条件") |
|
|
|
console.log(radioSelectArr3) |
|
|
|
console.log("当前表单的值-------------------") |
|
|
|
console.log(model.value) |
|
|
|
console.log("默认隐藏的字段-----------------") |
|
|
|
console.log(defaultHideFields) |
|
|
|
console.log(defaultHideFields) */ |
|
|
|
let modelKeyArr = [];//所有字段 |
|
|
|
for(let i= 0;i<props.formData.list.length;i++){ |
|
|
|
modelKeyArr.push(props.formData.list[i].name+"") |
|
|
|
} |
|
|
|
console.log("所有字段modelKeyArr^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^") |
|
|
|
console.log(modelKeyArr) |
|
|
|
/* console.log("所有字段modelKeyArr^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^") |
|
|
|
console.log(modelKeyArr) */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -242,7 +242,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
conditions:[], |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log(hideFieldConditionArr) |
|
|
|
//console.log(hideFieldConditionArr) |
|
|
|
//遍历所有配置条件数组radioSelectArr3,当radioSelectArr3 [ i ] . toshowFieldKey 【i】==hideFieldArr【i】时 |
|
|
|
for(let i = 0;i < radioSelectArr3.length;i++){ |
|
|
|
for(let j = 0;j < radioSelectArr3[i].toShowFieldKey.length;j++){ |
|
|
|
@ -276,7 +276,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(hideFieldConditionArr); |
|
|
|
//console.log(hideFieldConditionArr); |
|
|
|
//要显示的和其满足显示条件的个数. |
|
|
|
//let showfieldsCountX = []; |
|
|
|
for(let i = 0;i<hideFieldConditionArr.length;i++){ |
|
|
|
@ -287,12 +287,12 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
for(let j = 0;j<conditions.length;j++){ |
|
|
|
let conditionField = conditions[j].condition[0].conditionField |
|
|
|
let conditionFieldValue = conditions[j].condition[0].conditionFieldValue |
|
|
|
console.log(conditionField) |
|
|
|
//console.log(conditionField) |
|
|
|
if(conditionFieldValue.includes(",")){//来自多选 |
|
|
|
let conditionFieldValueArr = conditionFieldValue.split(",") |
|
|
|
conditionFieldValueArr = conditionFieldValueArr.slice(0, -1); |
|
|
|
console.log(conditionFieldValueArr) |
|
|
|
console.log(conditionFieldValue) |
|
|
|
/* console.log(conditionFieldValueArr) |
|
|
|
console.log(conditionFieldValue) */ |
|
|
|
for(let n = 0; n< modelKeyArr.length;n++){ |
|
|
|
if(modelKeyArr[n]==conditionField){ |
|
|
|
let count_1 = 0; |
|
|
|
@ -300,8 +300,8 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
if(trueValue.length>0&&arrayEqual(trueValue,conditionFieldValueArr)){ |
|
|
|
//此时满足了条件,但是必须看一下conditionField有没有被隐藏.如果被隐藏了,则x不能增加. |
|
|
|
//alert("多选条件成功触发") |
|
|
|
console.log(conditionField) |
|
|
|
console.log(toshow) |
|
|
|
/* console.log(conditionField) |
|
|
|
console.log(toshow) */ |
|
|
|
let flag = false//其依赖的选项的父字段是否被隐藏.默认没被隐藏, |
|
|
|
//如果此时的conditionField有可能被隐藏且已被隐藏,x不能++ |
|
|
|
for(let a = 0;a<hideFieldConditionArr.length;a++){ |
|
|
|
@ -310,7 +310,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
for(let c = 0;c<hideFieldConditionArr[a].conditions[b].condition.length;c++){ |
|
|
|
if(hideFieldConditionArr[a].conditions[b].condition[c]==conditionField){ |
|
|
|
//暂时写到这里,先去组装多选条件数组. |
|
|
|
console.log(1) |
|
|
|
//console.log(1) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -319,7 +319,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
if(flag==false){ |
|
|
|
x++ |
|
|
|
hideFieldsFromCheckbox.push(toshow) |
|
|
|
console.log(hideFieldArr) |
|
|
|
//console.log(hideFieldArr) |
|
|
|
/* for(let i = 0;i<hideFieldsFromCheckbox.length;i++){ |
|
|
|
hideFieldArr = hideFieldArr.filter((item: string) => item!=hideFieldsFromCheckbox[i]) |
|
|
|
//emits('refresh') |
|
|
|
@ -329,7 +329,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
} |
|
|
|
} |
|
|
|
}else{//来自单选下拉 |
|
|
|
console.log(conditionFieldValue) |
|
|
|
//console.log(conditionFieldValue) |
|
|
|
for(let n = 0; n< modelKeyArr.length;n++){ |
|
|
|
if(modelKeyArr[n]==conditionField){ |
|
|
|
let count_1 = 0; |
|
|
|
@ -340,7 +340,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
//此时满足了条件,但是必须看一下conditionField有没有被隐藏.如果被隐藏了,则x不能增加. |
|
|
|
let flag = false//其依赖的选项的父字段是否被隐藏.默认没被隐藏, |
|
|
|
//如果此时的conditionField有可能被隐藏且已被隐藏,x不能++ |
|
|
|
for(let a = 0;a<hideFieldConditionArr.length;a++){ |
|
|
|
/* for(let a = 0;a<hideFieldConditionArr.length;a++){ |
|
|
|
if(hideFieldConditionArr[a].toShow==conditionField){//当conditions.length>1说明时多选,=1说明是单选. |
|
|
|
for(let b = 0;b<hideFieldConditionArr[a].conditions.length;b++){ |
|
|
|
for(let c = 0;c<hideFieldConditionArr[a].conditions[b].condition.length;c++){ |
|
|
|
@ -351,7 +351,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} */ |
|
|
|
if(flag==false){ |
|
|
|
x++ |
|
|
|
} |
|
|
|
@ -375,8 +375,8 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
} |
|
|
|
//默认隐藏的字段中目前被显示出来的 |
|
|
|
nowShowingDefaultHideFieldArr = defaultHideFields.filter(a => !hideFieldArr.includes(a)) |
|
|
|
console.log("(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))") |
|
|
|
console.log(nowShowingDefaultHideFieldArr) |
|
|
|
/* console.log("(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))") |
|
|
|
console.log(nowShowingDefaultHideFieldArr) */ |
|
|
|
/* for(let i = 0;i< nowShowingDefaultHideFieldArr.length; i++){ |
|
|
|
//当被显示出来的字段涉及到的conditionfield已经被隐藏了时,其x应-1,如果x-1后造成该field被隐藏,应递归重新敲定hideFieldArr |
|
|
|
if() |
|
|
|
@ -387,7 +387,7 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log("条件筛选过后最终要隐藏的字段-----"+hideFieldArr) |
|
|
|
//console.log("条件筛选过后最终要隐藏的字段-----"+hideFieldArr) |
|
|
|
|
|
|
|
|
|
|
|
//编辑表单页不隐藏任何字段。 |
|
|
|
@ -474,12 +474,12 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any) |
|
|
|
// }) |
|
|
|
|
|
|
|
//liwenxuan 关联选项设置效果实现 start |
|
|
|
console.log("监听表单-1-constControlChange-->",props.formData) |
|
|
|
/* 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("监听表单-6-constControlChange-->",attribute) */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -513,8 +513,8 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any) |
|
|
|
//数组深拷贝 |
|
|
|
const radioSelectShowConfigArr2 = JSON.parse(JSON.stringify(radioSelectShowConfigArr)); |
|
|
|
const checkboxShowConfigArr2 = JSON.parse(JSON.stringify(checkboxShowConfigArr)); |
|
|
|
console.log(radioSelectShowConfigArr2) |
|
|
|
console.log(checkboxShowConfigArr2) |
|
|
|
/* console.log(radioSelectShowConfigArr2) |
|
|
|
console.log(checkboxShowConfigArr2) */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -606,7 +606,7 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(radioSelectArr3) |
|
|
|
//console.log(radioSelectArr3) |
|
|
|
//将多选配置也放入radioSelectArr3 |
|
|
|
if(checkboxShowConfigArr2.length>0){ |
|
|
|
for(let i = 0;i<checkboxShowConfigArr2.length;i++){ |
|
|
|
@ -645,7 +645,7 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(radioSelectArr3) |
|
|
|
//console.log(radioSelectArr3) |
|
|
|
|
|
|
|
|
|
|
|
//暂时使用的隐藏数组,数据敲定后赋给props.formData.config.hideField |
|
|
|
|