|
|
@ -40,6 +40,12 @@ const props = defineProps({ |
|
|
return {} |
|
|
return {} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
currentForm:{ |
|
|
|
|
|
type: String, |
|
|
|
|
|
default(){ |
|
|
|
|
|
return {} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
let $emit = defineEmits(["textChange","gongshiChange"]); |
|
|
let $emit = defineEmits(["textChange","gongshiChange"]); |
|
|
@ -74,16 +80,45 @@ watch(()=>tinymceHtml.value, (val:any) => { |
|
|
mathsString:tinymceBox.value.innerText, |
|
|
mathsString:tinymceBox.value.innerText, |
|
|
mathsFormula:suanShitwo, |
|
|
mathsFormula:suanShitwo, |
|
|
} |
|
|
} |
|
|
|
|
|
/* |
|
|
|
|
|
console.log(props.currentForm) |
|
|
|
|
|
console.log(countSpanTags(gongShi.formulaHtml)) */ |
|
|
$emit('gongshiChange',gongShi); |
|
|
$emit('gongshiChange',gongShi); |
|
|
if(containsNewline(gongShi.mathsString)){ |
|
|
if(containsNewline(gongShi.mathsString)){ |
|
|
errorCondition("条件不允许换行") |
|
|
errorCondition("条件不允许换行") |
|
|
}else if(!gongShi.formulaHtml.startsWith("<p><span")){ |
|
|
}else if(!gongShi.formulaHtml.startsWith("<p><span")){ |
|
|
errorCondition("条件需以蓝色块开头") |
|
|
errorCondition("条件需以蓝色块开头") |
|
|
}else if(gongShi.formulaHtml.endsWith("</span></p>")){ |
|
|
}else if(countSpanTags(gongShi.formulaHtml)>=2){ |
|
|
errorCondition("条件不能以蓝色块结尾") |
|
|
if(countSpanTags(gongShi.formulaHtml)>2){ |
|
|
}else if(countSpanTags(gongShi.formulaHtml)>1){ |
|
|
errorCondition("不允许超过2个蓝色块") |
|
|
errorCondition("不允许出现多个蓝色块") |
|
|
}else{ |
|
|
|
|
|
if(!gongShi.formulaHtml.endsWith("</span></p>")){ |
|
|
|
|
|
errorCondition("请检查您的条件") |
|
|
|
|
|
}else{ |
|
|
|
|
|
/* console.log(gongShi) |
|
|
|
|
|
console.log(props.currentForm) */ |
|
|
|
|
|
const parts = gongShi.formulaHtml.split(':'); |
|
|
|
|
|
if (parts.length >= 2) { |
|
|
|
|
|
const result = parts[parts.length - 2]; |
|
|
|
|
|
//console.log(result); |
|
|
|
|
|
if(result.startsWith("table")){ |
|
|
|
|
|
errorCondition("第二个蓝色块不支持选择子表中的字段") |
|
|
|
|
|
}else{ |
|
|
|
|
|
if(props.currentForm+""==result){ |
|
|
|
|
|
//console.log(result) |
|
|
|
|
|
succCondition() |
|
|
|
|
|
}else{ |
|
|
|
|
|
//errorCondition("若要设置两个蓝色块,请按照: 关联的表单.字段A==当前表单.字段B的形式设置条件") |
|
|
|
|
|
errorCondition("请对调这两个蓝色块") |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
console.log("输入的字符串不符合预期格式"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}else if(!containsSingleComparator(gongShi.mathsFormula)&&!gongShi.mathsFormula.includes("包含")&&!gongShi.mathsFormula.includes("不包含")){ |
|
|
}else if(!containsSingleComparator(gongShi.mathsFormula)&&!gongShi.mathsFormula.includes("包含")&&!gongShi.mathsFormula.includes("不包含")){ |
|
|
|
|
|
|
|
|
errorCondition("不存在有效符号或关键字") |
|
|
errorCondition("不存在有效符号或关键字") |
|
|
|