Browse Source

工作流条件设置完成

local_v3_liwenxuan
超级管理员 2 years ago
parent
commit
d11a39951b
  1. 143
      src/components/workflow/drwer/conditionDrawer.vue
  2. 10
      src/utils/workflow/const.ts

143
src/components/workflow/drwer/conditionDrawer.vue

@ -23,7 +23,7 @@ let props = defineProps({
},
});
let copyerVisible = ref(false)
const flowFactorList = ref<any[]>([]);
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)
}
</script>
<template>
<el-drawer v-model="visible" :append-to-body="true" title="条件设置" class="condition_copyer" :show-close="false" :size="550" :before-close="saveCondition">
@ -259,33 +291,66 @@ const saveCondition = () => {
</el-col>
<el-col :span="16">
<template v-if="itemw.type==1">
<el-button type="primary" style="margin-bottom:0px" >添加/修改成员</el-button>
<el-button type="primary" style="margin-bottom:0px" @click="addOrEditUser(itemw.nodeUserList)">添加/修改成员</el-button>
<p class="selected_list">
<el-tag closable type="info" effect="plain" class="tag_us">演员1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">1</el-tag>
<el-tag v-for="(item_us,index_us) in itemw.nodeUserList" :key="index_us" closable type="info" effect="plain" class="tag_us" @close="$func.removeEle(itemw.nodeUserList,item_us,'targetId')">{{item_us.name}}</el-tag>
</p>
</template>
<template v-if="itemw.type==2">
<el-row v-for="(itemCustomFields,index) in itemw" :key="index" :gutter="5">
<el-col :span="6">
<el-input v-model="itemCustomFields.wordfield" placeholder="判断关键字"></el-input>
</el-col>
<el-col :span="itemCustomFields.optType != 6?7:16">
<el-select v-model="itemCustomFields.optType" class="selectInfo" @change="myoptChhange($event,itemCustomFields)">
<el-row v-for="(itemCustomFields,index) in itemw.customFields" :key="index" style="margin-bottom:10px" :gutter="5">
<el-col :span="7">
<el-input v-model="itemCustomFields.wordfield" placeholder="判断关键字"></el-input>
</el-col>
<el-col :span="itemCustomFields.optType != 6?8:17">
<el-select v-model="itemCustomFields.optType" class="selectInfo" style="width:100%">
<el-option
v-for="itemSel in optTypes"
:key="itemSel.value"
:label="itemSel.label"
:value="itemSel.value"
>
>
</el-option>
</el-select>
</el-col>
</el-select>
</el-col>
<el-col v-if="itemCustomFields.optType != 6" :span="9">
<el-input v-model="itemCustomFields.leftval" placeholder="请输入值"></el-input>
</el-col>
<el-input v-model="itemCustomFields.leftval" type="text" placeholder="请输入" />
</el-col>
<el-col v-if="itemCustomFields.optType == 6" :span="24">
<el-row :gutter="5" style="margin-top:10px">
<el-col :span="5">
<el-input v-model="itemCustomFields.leftval" type="text" placeholder="请输入" />
</el-col>
<el-col :span="5">
<el-select v-model="itemCustomFields.leftoptType">
<el-option
v-for="itemSel in opt1s"
:key="itemSel.value"
:label="itemSel.label"
:value="itemSel.value"
/>
</el-select>
</el-col>
<el-col :span="4" class="cuiZhi_junZhong">
<span>{{ itemCustomFields.wordfield }}</span>
</el-col>
<el-col :span="5">
<el-select v-model="itemCustomFields.rightoptType">
<el-option
v-for="itemSel in opt1s"
:key="itemSel.value"
:label="itemSel.label"
:value="itemSel.value"
/>
</el-select>
</el-col>
<el-col :span="5">
<el-input v-model="itemCustomFields.rightval" type="text" placeholder="请输入" />
</el-col>
</el-row>
</el-col>
</el-row>
<el-button type="warning" style="margin-top:10px" >添加条件</el-button>
<el-button type="warning" style="margin-top:0px" @click="addCustomFields">添加条件</el-button>
</template>
<template v-if="itemw.type==3">
<el-radio-group v-if="!itemw.isCheckbox" v-model="itemw.answers">
@ -308,6 +373,14 @@ const saveCondition = () => {
<el-button @click="closeDrawer"> </el-button>
</div>
</div>
<employees-role-dialog
v-model:visible="copyerVisible"
:data="checkedList"
@change="sureCopyer"
/>
</el-drawer>
</template>
<style lang="less">
@ -444,4 +517,12 @@ const saveCondition = () => {
margin:5px 5px 4px 0px;
}
}
.cuiZhi_junZhong {
text-align:center;
display: flex;
justify-content: space-between;
align-items: center;
margin: auto;
overflow:hidden;
}
</style>

10
src/utils/workflow/const.ts

@ -33,14 +33,16 @@ export let optTypes = [
{value: '4', label: '等于'},
{value: '5', label: '大于等于'},
{value: '6', label: '介于两个数之间'},
{value: '7', label: '包含'},
{value: '8', label: '不包含'},
]
export let opt1s = [
{value: '<', label: '<'},
{value: '', label: '≤'},
{value: '1', label: '<'},
{value: '3', label: '≤'},
]
//工作流判断条件(类型:1、申请人;2、自定义字段;3、单选;4、多选;5、开关)
export let flowFactor = [
{id:1,name:"申请人",keyid:"applicant",type:1,isok:false,isCheckbox:true,options:[]},
{id:2,name:"自定义字段",keyid:"customFields",type:2,isok:false,isCheckbox:false,options:[]}
{id:1,name:"申请人",keyid:"applicant",type:1,isok:false,isCheckbox:true,options:[],customFields:[]},
{id:2,name:"自定义字段",keyid:"customFields",type:2,isok:false,isCheckbox:false,options:[],customFields:[]}
]

Loading…
Cancel
Save