From e9af798abf00e2160b0a76301e7f41adda0dfd07 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Tue, 30 Jul 2024 11:43:58 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=97=A0=E6=95=88=E8=AF=B7=E6=B1=82getFieldRecord?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignForm/public/form/formItem.vue | 18 +++++----- .../sysworkflow/lowcodepage/appCardPage.vue | 21 ++++++----- .../sysworkflow/lowcodepage/appFormList.vue | 21 ++++++----- .../sysworkflow/lowcodepage/appListPage.vue | 21 ++++++----- .../appPage/appPageForm/openAppFormPage.vue | 36 ++++++++++++++----- .../lowcodepage/runApp/runAppForm.vue | 22 ++++++------ 6 files changed, 85 insertions(+), 54 deletions(-) diff --git a/src/components/DesignForm/public/form/formItem.vue b/src/components/DesignForm/public/form/formItem.vue index 68fec19..aff7989 100644 --- a/src/components/DesignForm/public/form/formItem.vue +++ b/src/components/DesignForm/public/form/formItem.vue @@ -288,14 +288,16 @@ const getAxiosOptions = debounce((data?: any) => { /* 在这里请求后台获取字段 */ - getFieldRecord(props.data.control.optionsValue3Field).then(({ data }) => { - - let fieldName = props.data.name - - emits('optionsValue3Get1',data,fieldName) - - }) - + console.log("formItem---291",props.data.control.optionsValue3Field) + if(props.data.control.optionsValue3Field && props.data.control.optionsValue3Field != "" && props.data.control.optionsValue3Field != null && props.data.control.optionsValue3Field != "undefined"){ + getFieldRecord(props.data.control.optionsValue3Field).then(({ data }) => { + + let fieldName = props.data.name + + emits('optionsValue3Get1',data,fieldName) + + }) + } } setFormDict(formProps.value.dict) // 表格里新增时行时需要重新设一次 diff --git a/src/views/sysworkflow/lowcodepage/appCardPage.vue b/src/views/sysworkflow/lowcodepage/appCardPage.vue index b6014c4..7edd69e 100644 --- a/src/views/sysworkflow/lowcodepage/appCardPage.vue +++ b/src/views/sysworkflow/lowcodepage/appCardPage.vue @@ -295,17 +295,20 @@ const lookFormList = (val:any) => { /* 在这里请求后台获取字段 */ - getFieldRecord(paramx).then(({ data }) => { - stateData.tableData.columns[i].options = data - if(stateData.searchData.length>0){ - for(let j = 0;j { + stateData.tableData.columns[i].options = data + if(stateData.searchData.length>0){ + for(let j = 0;j { /* 在这里请求后台获取字段 */ - getFieldRecord(paramx).then(({ data }) => { - stateData.tableData.columns[i].options = data - if(stateData.searchData.length>0){ - for(let j = 0;j { + stateData.tableData.columns[i].options = data + if(stateData.searchData.length>0){ + for(let j = 0;j { /* 在这里请求后台获取字段 */ - getFieldRecord(paramx).then(({ data }) => { - stateData.tableData.columns[i].options = data - if(stateData.searchData.length>0){ - for(let j = 0;j { + stateData.tableData.columns[i].options = data + if(stateData.searchData.length>0){ + for(let j = 0;j{ let paramx:string = ""+stateData.tableData.columns[i].control.optionsValue3Field /* 在这里请求后台获取字段 + let kkk = { + key:111, + age:2 + controll:{ + l + } + } + let ary = [........] + ary.incouldes(3) + if(kkk.controll && kkk.controll.l && ) + try{ + + } */ - getFieldRecord(paramx).then(({ data }) => { - stateData.tableData.columns[i].options = data - if(stateData.searchData.length>0){ - for(let j = 0;j { + stateData.tableData.columns[i].options = data + if(stateData.searchData.length>0){ + for(let j = 0;j0){ for(let j = 0;j { /* 在这里请求后台获取字段 */ - getFieldRecord(paramx).then(({ data }) => { - stateData.tableData.columns[i].options = data - if(stateData.searchData.length>0){ - for(let j = 0;j { + stateData.tableData.columns[i].options = data + if(stateData.searchData.length>0){ + for(let j = 0;j0){ for(let j = 0;j Date: Tue, 30 Jul 2024 14:08:58 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=85=B3=E8=81=94=E8=A1=A8=E4=BD=86?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E8=AE=BE=E7=BD=AE=E5=B8=AE=E5=8A=A9=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/formControlAttr.vue | 20 +++++++++---------- .../DesignForm/formControlPropertiNew.vue | 13 ++++++------ .../associatedFormsTinyace.vue | 4 ++-- .../associatedFormsTinyaceRange.vue | 4 ++-- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/components/DesignForm/formControlAttr.vue b/src/components/DesignForm/formControlAttr.vue index 1e629eb..07c8737 100644 --- a/src/components/DesignForm/formControlAttr.vue +++ b/src/components/DesignForm/formControlAttr.vue @@ -3868,11 +3868,11 @@ const disabledIstrue = (val:string) => {
  • 请从左侧面板右击选择字段或选项
  • -
  • 支持英文模式下运算符
  • -
  • 支持"包含"关键字,用于组织机构条件
  • -
  • 支持"当前用户"关键字,用于角色条件
  • -
  • 参考场景:
  • - 年龄控件输入的值大于10时,需要隐藏当前控件,则可将隐藏条件设置为:年龄>10 +
  • 支持的符号:'==', '>=', '>', '<=', '<', '!='
  • +
  • 支持"包含,不包含,当前用户"关键字,用于组织机构条件和角色条件
  • +
  • 参考举例:
  • + 年龄>10
    + 企管部包含当前用户
@@ -3980,11 +3980,11 @@ const disabledIstrue = (val:string) => {
  • 请从左侧面板右击选择字段或选项
  • -
  • 支持英文模式下运算符
  • -
  • 支持"包含"关键字,用于组织机构条件
  • -
  • 支持"当前用户"关键字,用于角色条件
  • -
  • 参考场景:
  • - 仅可选择关联表单中年龄大于10的数据,则可将数据范围设置为:年龄>10 +
  • 支持的符号:'==', '>=', '>', '<=', '<', '!='
  • +
  • 支持"包含,不包含,当前用户"关键字,用于组织机构条件和角色条件
  • +
  • 参考举例:
  • + 年龄>10
    + 企管部包含当前用户
diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index e6c2155..8930b93 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -3923,11 +3923,11 @@ const disabledIstrue = (val:string) => {
  • 请从左侧面板右击选择字段或选项
  • -
  • 支持英文模式下运算符
  • -
  • 支持"包含"关键字,用于组织机构条件
  • -
  • 支持"当前用户"关键字,用于角色条件
  • -
  • 参考场景:
  • - 年龄控件输入的值大于10时,需要隐藏当前控件,则可将隐藏条件设置为:年龄>10 +
  • 支持的符号:'==', '>=', '>', '<=', '<', '!='
  • +
  • 支持"包含,不包含,当前用户"关键字,用于组织机构条件和角色条件
  • +
  • 参考举例:
  • + 年龄>10
    + 企管部包含当前用户
@@ -4036,7 +4036,8 @@ const disabledIstrue = (val:string) => {
  • 请从左侧面板右击选择字段或选项
  • 支持英文模式下运算符
  • -
  • 支持"包含"关键字,用于组织机构条件
  • + +
  • 支持"包含,不包含"关键字,用于组织机构条件和角色条件
  • 支持"当前用户"关键字,用于角色条件
  • 参考场景:
  • 仅可选择关联表单中年龄大于10的数据,则可将数据范围设置为:年龄>10 diff --git a/src/widget/associatedforms/associatedFormsTinyace.vue b/src/widget/associatedforms/associatedFormsTinyace.vue index 4606fea..471642e 100644 --- a/src/widget/associatedforms/associatedFormsTinyace.vue +++ b/src/widget/associatedforms/associatedFormsTinyace.vue @@ -85,7 +85,7 @@ watch(()=>tinymceHtml.value, (val:any) => { errorCondition("条件不能以蓝色块结尾") }else if(countSpanTags(gongShi.formulaHtml)>1){ errorCondition("不允许出现多个蓝色块") - }else if(!containsSingleComparator(gongShi.mathsFormula)&&!gongShi.mathsFormula.includes("包含")){ + }else if(!containsSingleComparator(gongShi.mathsFormula)&&!gongShi.mathsFormula.includes("包含")&&!gongShi.mathsFormula.includes("不包含")){ errorCondition("不存在有效符号") @@ -100,7 +100,7 @@ watch(()=>tinymceHtml.value, (val:any) => { { deep: true } ) function checkEnding(str: string) { - const symbols = ['==', '>=', '>', '<=', '<', '!=', '=']; + const symbols = ['==', '>=', '>', '<=', '<', '!=', '=','包含','不包含']; const trimmedStr = str.trim(); for (let symbol of symbols) { if (trimmedStr.endsWith(symbol)) { diff --git a/src/widget/associatedforms/associatedFormsTinyaceRange.vue b/src/widget/associatedforms/associatedFormsTinyaceRange.vue index 4ce83e9..e73b9c5 100644 --- a/src/widget/associatedforms/associatedFormsTinyaceRange.vue +++ b/src/widget/associatedforms/associatedFormsTinyaceRange.vue @@ -84,7 +84,7 @@ watch(()=>tinymceHtml.value, (val:any) => { errorCondition("条件不能以蓝色块结尾") }else if(countSpanTags(gongShi.formulaHtml)>1){ errorCondition("不允许出现多个蓝色块") - }else if(!containsSingleComparator(gongShi.mathsFormula)&&!gongShi.mathsFormula.includes("包含")){ + }else if(!containsSingleComparator(gongShi.mathsFormula)&&!gongShi.mathsFormula.includes("包含")&&!gongShi.mathsFormula.includes("不包含")){ errorCondition("不存在有效符号") @@ -126,7 +126,7 @@ function containsSingleComparator(str: string) { return found; } function checkEnding(str: string) { - const symbols = ['==', '>=', '>', '<=', '<', '!=', '=']; + const symbols = ['==', '>=', '>', '<=', '<', '!=', '=','包含','不包含']; const trimmedStr = str.trim(); for (let symbol of symbols) { if (trimmedStr.endsWith(symbol)) { From 97b588d364fb119ccf19b58be6fb8191d11162fa Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Fri, 2 Aug 2024 14:58:30 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=85=B3=E8=81=94=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=95=88=E6=9E=9C-=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/formControlAttr.vue | 16 +- .../DesignForm/formControlPropertiNew.vue | 25 +-- .../DesignForm/public/form/form.vue | 183 ++++++++++++++++-- .../associatedFormsTinyace.vue | 8 +- .../associatedFormsTinyaceRange.vue | 6 +- 5 files changed, 197 insertions(+), 41 deletions(-) diff --git a/src/components/DesignForm/formControlAttr.vue b/src/components/DesignForm/formControlAttr.vue index 07c8737..f538c99 100644 --- a/src/components/DesignForm/formControlAttr.vue +++ b/src/components/DesignForm/formControlAttr.vue @@ -3858,21 +3858,23 @@ const disabledIstrue = (val:string) => {
    当满足以下条件时此控件隐藏
    -
    +
    -
    +
    • 请从左侧面板右击选择字段或选项
    • 支持的符号:'==', '>=', '>', '<=', '<', '!='
    • 支持"包含,不包含,当前用户"关键字,用于组织机构条件和角色条件
    • 参考举例:
    • 年龄>10
      - 企管部包含当前用户 + 企管部包含当前用户
      + 绩效考核执行人包含当前用户
      + 张三!=当前用户
    @@ -3970,21 +3972,23 @@ const disabledIstrue = (val:string) => {
    仅可选择符合以下条件的数据
    -
    +
    -
    +
    • 请从左侧面板右击选择字段或选项
    • 支持的符号:'==', '>=', '>', '<=', '<', '!='
    • 支持"包含,不包含,当前用户"关键字,用于组织机构条件和角色条件
    • 参考举例:
    • 年龄>10
      - 企管部包含当前用户 + 企管部包含当前用户
      + 绩效考核执行人包含当前用户
      + 张三!=当前用户
    diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index 8930b93..84c7f19 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -3913,21 +3913,23 @@ const disabledIstrue = (val:string) => {
    当满足以下条件时此控件隐藏
    -
    +
    -
    +
    • 请从左侧面板右击选择字段或选项
    • 支持的符号:'==', '>=', '>', '<=', '<', '!='
    • 支持"包含,不包含,当前用户"关键字,用于组织机构条件和角色条件
    • 参考举例:
    • 年龄>10
      - 企管部包含当前用户 + 企管部包含当前用户
      + 绩效考核执行人包含当前用户
      + 张三!=当前用户
    @@ -4025,22 +4027,23 @@ const disabledIstrue = (val:string) => {
    仅可选择符合以下条件的数据
    -
    +
    -
    +
    • 请从左侧面板右击选择字段或选项
    • -
    • 支持英文模式下运算符
    • - -
    • 支持"包含,不包含"关键字,用于组织机构条件和角色条件
    • -
    • 支持"当前用户"关键字,用于角色条件
    • -
    • 参考场景:
    • - 仅可选择关联表单中年龄大于10的数据,则可将数据范围设置为:年龄>10 +
    • 支持的符号:'==', '>=', '>', '<=', '<', '!='
    • +
    • 支持"包含,不包含,当前用户"关键字,用于组织机构条件和角色条件
    • +
    • 参考举例:
    • + 年龄>10
      + 企管部包含当前用户
      + 绩效考核执行人包含当前用户
      + 张三!=当前用户
    diff --git a/src/components/DesignForm/public/form/form.vue b/src/components/DesignForm/public/form/form.vue index 197d0aa..2ddf3db 100644 --- a/src/components/DesignForm/public/form/form.vue +++ b/src/components/DesignForm/public/form/form.vue @@ -11,6 +11,7 @@ import FormGroup from '@/components/DesignForm/public/form/formGroup.vue' import { FormData,FormList,FormDataStyle } from '@/api/DesignForm/types' import { getRequest } from '@/api/DesignForm' +import request from '@/utils/request'; import { useRoute, useRouter } from 'vue-router' import { constGetControlByName, @@ -177,7 +178,7 @@ const forEachGetFormModel = (list: FormList[], obj: any) => { } } }) - showOrHide() + showOrHide("onMounted") } function arrayEqual(a: string[], b: any[]) { @@ -407,6 +408,10 @@ const recursionToGetFinallyHideFields = (hideFieldArr: any[],radioSelectArr3: st if(formProps.value.type!=5){ //console.log(hideFieldArr) props.formData.config.hideField?.push(...hideFieldArr)//实际造成隐藏效果 + + + + } }); @@ -418,16 +423,17 @@ if(formProps.value.type!=5){ } + // 表单组件值改变事件 tProp为子表格相关 provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any) => { - // console.log("表单组件值改变事件----------1--------->",key) - // console.log("表单组件值改变事件----------2--------->",value) - // console.log("表单组件值改变事件----------3--------->",data) - // console.log("表单组件值改变事件----------4--------->",tProp) - // console.log("表单组件值改变事件----------5--------->",type) - // console.log("表单组件值改变事件----------6--------->",attribute) - // console.log("表单组件值改变事件----------11--------->",model.value) + /* console.log("表单组件值改变事件----------1--------->",key) + console.log("表单组件值改变事件----------2--------->",value) + console.log("表单组件值改变事件----------3--------->",data) + console.log("表单组件值改变事件----------4--------->",tProp) + console.log("表单组件值改变事件----------5--------->",type) + console.log("表单组件值改变事件----------6--------->",attribute) + console.log("表单组件值改变事件----------11--------->",model.value) */ let fieldVal = {} for(let i in model.value){ if(i == key){ @@ -493,7 +499,7 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any) } // }) - showOrHide() + showOrHide(data) if (typeof props.changeKeyVal === 'function') { props.changeKeyVal(key, value,type,attribute) @@ -524,8 +530,114 @@ provide(constControlChange, ({ key, value, data, tProp, type, attribute }: any) */ }) +let mustBeHidden: any = [] +function showOrHide (data:any){ + //console.log(data) + + /* + 企管部有当前用户, + 当前用户是什么权限角色. + 某表单某字段值大于等于小于不等于某个值 + + 所需接口 + 接口1:当前用户是不是指定的权限角色 + 接口2:当前用户是否在指定的机构下或机构的祖先机构下 + 接口3:本表单(关联关联表单的表单)的某字段的当前值大于等于小于不等于指定的值???也许不需要接口呢? + + */ + + //关联表单隐藏条件判定 start + for(let i = 0; i < props.formData.list.length; i++){ + if(props.formData.list[i].type=="associatedForms"&&formProps.value.type!=5){ + //console.log(props.formData.list[i].name) + let asfHideCondition = props.formData.list[i].control.hideGongShi.mathsFormula + const leftOperatorsAndRight = splitString(asfHideCondition) + + if(leftOperatorsAndRight){ + + + let leftArr = leftOperatorsAndRight.left.split(":") + //console.log(leftArr) + if(data=="onMounted"||(leftArr[0]=="formField"&&leftArr.length==3)){ + if(data=="onMounted"||(data!="kong"&&data.name==leftArr[2])){//关联表单隐藏相关的值发生了变化 + + if(leftOperatorsAndRight.operator=="包含"){ + + if(leftOperatorsAndRight.right=="当前用户"){ + + if(leftOperatorsAndRight.left.startsWith("orgOrPerson")){ + //接口2 + + queryIfOrgOrPerson(leftOperatorsAndRight).then(({ data }) => { + if(data==true){ + props.formData.config.hideField = addStringIfNotExists(props.formData.config.hideField,props.formData.list[i].name) + mustBeHidden.push(props.formData.list[i].name) + } + }); + + }else if(leftOperatorsAndRight.left.startsWith("roleid")){ + //接口1 + } + } + }else if(leftOperatorsAndRight.operator=="不包含"){ + + if(leftOperatorsAndRight.right=="当前用户"){ + + if(leftOperatorsAndRight.left.startsWith("orgOrPerson")){ + + //接口2 + queryIfOrgOrPerson(leftOperatorsAndRight).then(({ data }) => { + if(data==false){ + props.formData.config.hideField = addStringIfNotExists(props.formData.config.hideField,props.formData.list[i].name) + mustBeHidden.push(props.formData.list[i].name) + } + }); + }else if(leftOperatorsAndRight.left.startsWith("roleid")){ + //接口1 + } + } + }else{ + //console.log(leftOperatorsAndRight) + if(leftOperatorsAndRight.right=="当前用户"){ + + if(leftOperatorsAndRight.operator=="=="){ + //接口2 + queryIfOrgOrPerson(leftOperatorsAndRight).then(({ data }) => { + if(data==true){ + props.formData.config.hideField = addStringIfNotExists(props.formData.config.hideField,props.formData.list[i].name) + mustBeHidden.push(props.formData.list[i].name) + } + }); + }else if(leftOperatorsAndRight.operator=="!="){ + //接口2 + queryIfOrgOrPerson(leftOperatorsAndRight).then(({ data }) => { + if(data==true){ + props.formData.config.hideField = addStringIfNotExists(props.formData.config.hideField,props.formData.list[i].name) + mustBeHidden.push(props.formData.list[i].name) + } + }); + } + }else{ + //接口3 + console.log(1) + } + } + } + } + + + + + + + } + } + } + + //关联表单隐藏条件判定 end + + -function showOrHide (){ //liwenxuan 关联选项设置效果实现 start /* console.log("监听表单-1-constControlChange-->",props.formData) console.log("监听表单-2-constControlChange-->",key) @@ -766,14 +878,11 @@ function showOrHide (){ hideFieldArr = recursionToGetFinallyHideFields(hideFieldArr,radioSelectArr3,defaultHideFields) } hideFieldArr = recursionToGetFinallyHideFields(hideFieldArr,radioSelectArr3,defaultHideFields) - - - - - - + props.formData.config.hideField?.push(...mustBeHidden) + + @@ -785,6 +894,46 @@ function showOrHide (){ //console.log("监听表单--constControlChange-->",key, value, data, tProp,type,attribute)//liwenxuan } + +function removeDuplicates(arr:any) { + //alert(1) + return arr.reduce((accumulator: any[], currentValue: any) => { + if (!accumulator.includes(currentValue)) { + accumulator.push(currentValue); + } + return accumulator; + }, []); +} + +function addStringIfNotExists(arr: string[], str: string) { + if (!arr.includes(str)) { + arr.push(str); + } + return arr; +} + +function queryIfOrgOrPerson(obj: { left: string; operator: string; right: string }) { + + return request({ + url: '/javasys/lowCode/AssociatedForms/queryIfOrgOrPerson', + method: 'post', + data: obj, + }); +} + +function splitString(str:string) { + const operators = ['==', '>', '>=', '<', '<=', '!=', '不包含' ,'包含']; + for (let operator of operators) { + if (str.includes(operator)) { + let index = str.indexOf(operator); + let left = str.slice(0, index).trim(); + let right = str.slice(index + operator.length).trim(); + return { left,operator, right }; + } + } + //return { left: str, right: '' }; +} + const dictForm = computed(() => { const storage = window.localStorage.getItem('akFormDict') let storageDict = {} @@ -1238,7 +1387,7 @@ onMounted(() => { nextTick(() => { appendRemoveStyle(true) }) - showOrHide() + showOrHide("kong") }) onUnmounted(() => { if (eventName) { diff --git a/src/widget/associatedforms/associatedFormsTinyace.vue b/src/widget/associatedforms/associatedFormsTinyace.vue index 471642e..b24d7fd 100644 --- a/src/widget/associatedforms/associatedFormsTinyace.vue +++ b/src/widget/associatedforms/associatedFormsTinyace.vue @@ -18,7 +18,7 @@ const tinymceInit = { language_url: "/tinymce/langs/zh-Hans.js", // 引入语言包(该语言包在public下,注意文件名称) language: "zh-Hans", // 这里名称根据 zh-Hans.js 里面写的名称而定 skin_url: "/tinymce/skins/ui/oxide", // 这里引入的样式 - height: 174, // 限制高度 + height: 164, // 限制高度 statusbar:false, toolbar:false, branding: false, //是否禁用“Powered by TinyMCE” @@ -87,10 +87,10 @@ watch(()=>tinymceHtml.value, (val:any) => { errorCondition("不允许出现多个蓝色块") }else if(!containsSingleComparator(gongShi.mathsFormula)&&!gongShi.mathsFormula.includes("包含")&&!gongShi.mathsFormula.includes("不包含")){ - errorCondition("不存在有效符号") + errorCondition("不存在有效符号或关键字") }else if(checkEnding(gongShi.mathsFormula)){ - errorCondition("不能以符号为结尾") + errorCondition("不能以符号或关键字为结尾") }else{ succCondition() } @@ -169,7 +169,7 @@ function errorCondition(str:string){ ElMessage.closeAll() ElMessage({ showClose: true, - message: '条件格式错误 : '+str+' , 正确条件格式如 : 年龄==10', + message: '条件格式错误 : '+str/* +' , 正确条件格式如 : 年龄==10' */, type: 'error', duration:3500, }) diff --git a/src/widget/associatedforms/associatedFormsTinyaceRange.vue b/src/widget/associatedforms/associatedFormsTinyaceRange.vue index e73b9c5..00708fb 100644 --- a/src/widget/associatedforms/associatedFormsTinyaceRange.vue +++ b/src/widget/associatedforms/associatedFormsTinyaceRange.vue @@ -17,7 +17,7 @@ const tinymceInit = { language_url: "/tinymce/langs/zh-Hans.js", // 引入语言包(该语言包在public下,注意文件名称) language: "zh-Hans", // 这里名称根据 zh-Hans.js 里面写的名称而定 skin_url: "/tinymce/skins/ui/oxide", // 这里引入的样式 - height: 174, // 限制高度 + height: 164, // 限制高度 statusbar:false, toolbar:false, branding: false, //是否禁用“Powered by TinyMCE” @@ -86,10 +86,10 @@ watch(()=>tinymceHtml.value, (val:any) => { errorCondition("不允许出现多个蓝色块") }else if(!containsSingleComparator(gongShi.mathsFormula)&&!gongShi.mathsFormula.includes("包含")&&!gongShi.mathsFormula.includes("不包含")){ - errorCondition("不存在有效符号") + errorCondition("不存在有效符号或关键字") }else if(checkEnding(gongShi.mathsFormula)){ - errorCondition("不能以符号为结尾") + errorCondition("不能以符号或关键字为结尾") }else{ succCondition() } From 2d2c06de435ef9352d7fe95157f9ff1b24bdda27 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Fri, 2 Aug 2024 15:57:29 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=85=B3=E8=81=94=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=95=88=E6=9E=9C-=E6=9C=AC=E8=A1=A8?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=8F=96=E5=80=BC=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignForm/public/form/form.vue | 67 ++++++++++++++----- 1 file changed, 51 insertions(+), 16 deletions(-) diff --git a/src/components/DesignForm/public/form/form.vue b/src/components/DesignForm/public/form/form.vue index 2ddf3db..3692222 100644 --- a/src/components/DesignForm/public/form/form.vue +++ b/src/components/DesignForm/public/form/form.vue @@ -619,7 +619,43 @@ function showOrHide (data:any){ } }else{ //接口3 - console.log(1) + console.log(leftOperatorsAndRight) + console.log(data) + if(data.name==leftArr[2]){ + console.log("ghasdhasdfhhsadhasd") + console.log(props.formData.list[i].name) + nextTick(()=>{ + console.log(model.value[leftArr[2]]) + if(leftOperatorsAndRight.operator == "=="){ + if(model.value[leftArr[2]]==leftOperatorsAndRight.right){ + props.formData.config.hideField = addStringIfNotExists(props.formData.config.hideField,props.formData.list[i].name) + } + }else if(leftOperatorsAndRight.operator == "!="){ + if(model.value[leftArr[2]]!=leftOperatorsAndRight.right){ + props.formData.config.hideField = addStringIfNotExists(props.formData.config.hideField,props.formData.list[i].name) + } + }else if(leftOperatorsAndRight.operator == ">="){ + if(model.value[leftArr[2]]>=leftOperatorsAndRight.right){ + props.formData.config.hideField = addStringIfNotExists(props.formData.config.hideField,props.formData.list[i].name) + } + }else if(leftOperatorsAndRight.operator == ">"){ + if(model.value[leftArr[2]]>leftOperatorsAndRight.right){ + props.formData.config.hideField = addStringIfNotExists(props.formData.config.hideField,props.formData.list[i].name) + } + }else if(leftOperatorsAndRight.operator == "<"){ + if(model.value[leftArr[2]] { + if(data==true){ + //alert(data) + props.formData.config.hideField = addStringIfNotExists(props.formData.config.hideField,props.formData.list[i].name) + mustBeHidden.push(props.formData.list[i].name) + } + }); } } }else if(leftOperatorsAndRight.operator=="不包含"){ @@ -594,6 +601,13 @@ function showOrHide (data:any){ }); }else if(leftOperatorsAndRight.left.startsWith("roleid")){ //接口1 + queryHideRoleCondition(leftOperatorsAndRight).then(({ data }) => { + if(data==false){ + //alert(data) + props.formData.config.hideField = addStringIfNotExists(props.formData.config.hideField,props.formData.list[i].name) + mustBeHidden.push(props.formData.list[i].name) + } + }); } } }else{ @@ -948,14 +962,14 @@ function queryIfOrgOrPerson(obj: { left: string; operator: string; right: string }); } -/* function queryHideFieldCondition(obj: { left: string; operator: string; right: string }) { +function queryHideRoleCondition(obj: { left: string; operator: string; right: string }) { return request({ - url: '/javasys/lowCode/AssociatedForms/queryHideFieldCondition', + url: '/javasys/lowCode/AssociatedForms/queryHideRoleCondition', method: 'post', data: obj, }); -} */ +} function splitString(str:string) { const operators = ['==', '>', '>=', '<', '<=', '!=', '不包含' ,'包含']; From 76afb23cc2fd1b12730ce1f3b5ac7aca074ecdf3 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Mon, 5 Aug 2024 11:42:18 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=A5=91=E5=90=88=E5=BA=A6=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/formControlAttr.vue | 18 +++++++++--------- .../DesignForm/formControlPropertiNew.vue | 18 +++++++++--------- .../DesignForm/formControlProperties.vue | 16 ++++++++++------ 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/components/DesignForm/formControlAttr.vue b/src/components/DesignForm/formControlAttr.vue index f538c99..555bcf8 100644 --- a/src/components/DesignForm/formControlAttr.vue +++ b/src/components/DesignForm/formControlAttr.vue @@ -2903,7 +2903,7 @@ const disabledIstrue = (val:string) => { { { { { {
    • 请从左侧面板右击选择字段或选项
    • 支持的符号:'==', '>=', '>', '<=', '<', '!='
    • -
    • 支持"包含,不包含,当前用户"关键字,用于组织机构条件和角色条件
    • +
    • 支持"包含,不包含,数据拥有者,数据所属部门"关键字,用于组织机构条件,角色条件,==运算符和!=运算符
    • 参考举例:
    • 年龄>10
      - 企管部包含当前用户
      - 绩效考核执行人包含当前用户
      - 张三!=当前用户 + 企管部==数据所属部门
      + 绩效考核执行人包含数据拥有者
      + 生产部包含数据所属部门
    diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index 84c7f19..697a118 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -2947,7 +2947,7 @@ const disabledIstrue = (val:string) => { { { { { {
    • 请从左侧面板右击选择字段或选项
    • 支持的符号:'==', '>=', '>', '<=', '<', '!='
    • -
    • 支持"包含,不包含,当前用户"关键字,用于组织机构条件和角色条件
    • +
    • 支持"包含,不包含,数据拥有者,数据所属部门"关键字,用于组织机构条件,角色条件,==运算符和!=运算符
    • 参考举例:
    • 年龄>10
      - 企管部包含当前用户
      - 绩效考核执行人包含当前用户
      - 张三!=当前用户 + 企管部==数据所属部门
      + 绩效考核执行人包含数据拥有者
      + 生产部包含数据所属部门
    diff --git a/src/components/DesignForm/formControlProperties.vue b/src/components/DesignForm/formControlProperties.vue index 76e1a4a..4bf54a2 100644 --- a/src/components/DesignForm/formControlProperties.vue +++ b/src/components/DesignForm/formControlProperties.vue @@ -1701,7 +1701,7 @@ const disabledIstrue = (val:string) => { { fill + { { { - + + + { scale-down + From c91303fa2dd9a283783a6baca526871c59a80dda Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Mon, 5 Aug 2024 11:48:12 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=A5=91=E5=90=88=E5=BA=A6=E5=90=8D=E7=A7=B02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/formControlAttr.vue | 12 ++++++------ src/components/DesignForm/formControlPropertiNew.vue | 12 ++++++------ src/components/DesignForm/formControlProperties.vue | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/DesignForm/formControlAttr.vue b/src/components/DesignForm/formControlAttr.vue index 555bcf8..70753a5 100644 --- a/src/components/DesignForm/formControlAttr.vue +++ b/src/components/DesignForm/formControlAttr.vue @@ -2909,7 +2909,7 @@ const disabledIstrue = (val:string) => { content="默认值。调整替换后的内容大小,以填充元素的内容框。如有必要,将拉伸或挤压物体以适应该对象。" > @@ -2921,19 +2921,19 @@ const disabledIstrue = (val:string) => { content="缩放替换后的内容以保持其纵横比,同时将其放入元素的内容框。" > @@ -2945,7 +2945,7 @@ const disabledIstrue = (val:string) => { content="不对替换的内容调整大小。" > @@ -2958,7 +2958,7 @@ const disabledIstrue = (val:string) => { content="调整内容大小就像没有指定内容或包含内容一样(将导致较小的具体对象尺寸)" > diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index 697a118..87b19fe 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -2953,7 +2953,7 @@ const disabledIstrue = (val:string) => { content="默认值。调整替换后的内容大小,以填充元素的内容框。如有必要,将拉伸或挤压物体以适应该对象。" > @@ -2965,19 +2965,19 @@ const disabledIstrue = (val:string) => { content="缩放替换后的内容以保持其纵横比,同时将其放入元素的内容框。" > @@ -2989,7 +2989,7 @@ const disabledIstrue = (val:string) => { content="不对替换的内容调整大小。" > @@ -3002,7 +3002,7 @@ const disabledIstrue = (val:string) => { content="调整内容大小就像没有指定内容或包含内容一样(将导致较小的具体对象尺寸)" > diff --git a/src/components/DesignForm/formControlProperties.vue b/src/components/DesignForm/formControlProperties.vue index 4bf54a2..1adaae7 100644 --- a/src/components/DesignForm/formControlProperties.vue +++ b/src/components/DesignForm/formControlProperties.vue @@ -1707,7 +1707,7 @@ const disabledIstrue = (val:string) => { content="默认值。调整替换后的内容大小,以填充元素的内容框。如有必要,将拉伸或挤压物体以适应该对象。" > @@ -1719,19 +1719,19 @@ const disabledIstrue = (val:string) => { content="缩放替换后的内容以保持其纵横比,同时将其放入元素的内容框。" > @@ -1743,7 +1743,7 @@ const disabledIstrue = (val:string) => { content="不对替换的内容调整大小。" > @@ -1756,7 +1756,7 @@ const disabledIstrue = (val:string) => { content="调整内容大小就像没有指定内容或包含内容一样(将导致较小的具体对象尺寸)" >