From d11a39951bc5646fbb0f433601fea74fdb94543a Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Tue, 24 Oct 2023 10:22:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflow/drwer/conditionDrawer.vue | 143 ++++++++++++++---- src/utils/workflow/const.ts | 10 +- 2 files changed, 118 insertions(+), 35 deletions(-) diff --git a/src/components/workflow/drwer/conditionDrawer.vue b/src/components/workflow/drwer/conditionDrawer.vue index 74c56cb2e..191f8edde 100644 --- a/src/components/workflow/drwer/conditionDrawer.vue +++ b/src/components/workflow/drwer/conditionDrawer.vue @@ -23,7 +23,7 @@ let props = defineProps({ }, }); - +let copyerVisible = ref(false) const flowFactorList = ref([]); let conditionVisible = ref(false) @@ -63,14 +63,14 @@ watch(visible,(val:any)=>{ if(flowFactor.length>0){ flowFactor.forEach(ites=>{ flowFactorList.value.push({ - id:ites.id, - name:ites.name, - keyid:ites.keyid, - type:ites.type, - isok:ites.isok, - isCheckbox:ites.isCheckbox, - options:ites.options - }) + id:ites.id, + name:ites.name, + keyid:ites.keyid, + type:ites.type, + isok:ites.isok, + isCheckbox:ites.isCheckbox, + options:ites.options + }) }) } if(props.isFormFlow){ @@ -103,11 +103,6 @@ watch(visible,(val:any)=>{ }) - - - - - const closeDrawer = (val?:any) => { initFactor() setCondition(false) @@ -157,7 +152,7 @@ const pickFactor = (val:any) => { const addFactorCondition = () => { let currLent = tableList.value.length if(currLent < flowFactorList.value.length){ - tableList.value.push({id:currLent+1,factorid:"",type:0}) + tableList.value.push({id:currLent+1,factorid:"",type:0,isok:false,isCheckbox:true,options:[],answers:[],customFields:[]}) if(currLent+1 >= flowFactorList.value.length){ maxFactor.value = true }else{ @@ -211,8 +206,8 @@ const delTiaoJian = (val:any) => { } const saveCondition = () => { - conditionConfig.conditionList = tableList.value - console.log("conditionConfig.conditionList--->",conditionConfig.conditionList,tableList); + conditionConfig.conditionList.value = tableList.value + console.log("conditionConfig.conditionList--->",conditionConfig.conditionList.value,tableList.value); // var a = conditionsConfig.value.conditionNodes.splice(PriorityLevel.value - 1, 1)//截取旧下标 // conditionsConfig.value.conditionNodes.splice(conditionConfig.value.priorityLevel - 1, 0, a[0])//填充新下标 // conditionsConfig.value.conditionNodes.map((item, index) => { @@ -228,6 +223,43 @@ const saveCondition = () => { // }) closeDrawer() } +//选择成员或角色 +const addOrEditUser = (val:any) => { + copyerVisible.value = true; + checkedList.value = val +} +//保存选中得数据 +const sureCopyer = (data) => { + // console.log("保存选中人",data) + // copyerConfig.value.nodeUserList = data; + copyerVisible.value = false; + if(tableList.value.length > 0){ + tableList.value.forEach(item=>{ + if(item.factorid == "applicant" && item.type == 1){ + item.nodeUserList = data + } + }) + } +} +//添加自定义条件 +const addCustomFields = () =>{ + if(tableList.value.length > 0){ + tableList.value.forEach(item=>{ + if(item.factorid == "customFields" && item.type == 2){ + item.customFields.push({ + wordfield:"", + optType:"1", + leftval:"" + }) + } + }) + } + console.log("添加自定义条件",tableList) +} +//自定义字段改变选项 +const myoptChhange = (val:any) =>{ + console.log("添加自定义条件",val) +}