Browse Source

1.关联表单组件数据范围条件解析效果实现

2.关联表单输入条件校验优化
lwx_v3
liwenxuan 1 year ago
parent
commit
dc91674736
  1. 2
      src/widget/associatedforms/associatedForms.vue
  2. 26
      src/widget/associatedforms/associatedFormsTinyaceRange.vue

2
src/widget/associatedforms/associatedForms.vue

@ -74,7 +74,7 @@ function getAsfDataTitles() {
rangeString:props.data.control.dataRangeGongShi.mathsString, rangeString:props.data.control.dataRangeGongShi.mathsString,
hideFormula:props.data.control.hideGongShi.mathsFormula, hideFormula:props.data.control.hideGongShi.mathsFormula,
hideString:props.data.control.hideGongShi.mathsString, hideString:props.data.control.hideGongShi.mathsString,
masterOnField:props.data.name,
}, },
}); });
} }

26
src/widget/associatedforms/associatedFormsTinyaceRange.vue

@ -90,6 +90,8 @@ watch(()=>tinymceHtml.value, (val:any) => {
}else if(checkEnding(gongShi.mathsFormula)){ }else if(checkEnding(gongShi.mathsFormula)){
errorCondition("不能以符号或关键字为结尾") errorCondition("不能以符号或关键字为结尾")
}else if(checkRoleStartAndOrgEnd(gongShi.mathsFormula)||checkFormFieldStartAndOrgEnd(gongShi.mathsFormula)||checkFormFieldStartAndOrgEnd2(gongShi.mathsFormula)){
errorCondition("此条件无无实际意义")
}else{ }else{
succCondition() succCondition()
} }
@ -98,6 +100,30 @@ watch(()=>tinymceHtml.value, (val:any) => {
}, },
{ deep: true } { deep: true }
) )
function checkRoleStartAndOrgEnd(str: string) {
if (str.startsWith('roleid:') && str.endsWith('数据所属部门')) {
return true;
} else {
return false;
}
}
function checkFormFieldStartAndOrgEnd(str: string) {
if (str.startsWith('formField:') && str.endsWith('数据所属部门')) {
return true;
} else {
return false;
}
}
function checkFormFieldStartAndOrgEnd2(str: string) {
if (str.startsWith('formField:') && str.endsWith('数据拥有者')) {
return true;
} else {
return false;
}
}
function containsSingleComparator(str: string) { function containsSingleComparator(str: string) {
// //
const comparators = ['==', '>=', '>', '<=', '<', '!=']; const comparators = ['==', '>=', '>', '<=', '<', '!='];

Loading…
Cancel
Save