@@ -1,12 +1,13 @@
< template >
< div v-for = "(group, index) in selectedNode.props.groups" :key="index + '_g'" class="group" >
< div class = "group-header" >
< span class = "group-name" > 条件组 { { groupNames [ index ] } } < / span >
<!-- < span class = "group-name" > 条件组 { { groupNames [ index ] } } < / span > -- >
< span class = "group-name" > 条件 < / span >
< div class = "group-cp" >
< span > 组内条件关系 : < / span >
< el-switch v-model = "group.groupType" active-color="#409EFF"
inactive- color =" # c1c1c1 " active- value =" AND " inactive- value =" OR "
active- text =" 且 " inactive- text =" 或 " / >
<!-- < span > 组内条件关系 : < / span > -- >
<!-- < el-switch v-model = "group.groupType" active -color= " # 409EFF " - - >
<!-- inactive- color ="# c1c1c1" active- value =" AND" inactive- value ="OR" -- >
<!-- active- text ="且 " inactive- text ="或 " /> -- >
< / div >
< div class = "group-operation" >
@@ -24,13 +25,13 @@
< / el -checkbox >
< / el-checkbox-group >
< / el-popover >
< el-icon :size = "18" class = "group-icon" @click ="delGroup(index)" >
< Close / >
< / el-icon >
<!-- < el-icon :size = "18" class = "group-icon" @click ="delGroup(index)" > - - >
<!-- < Close / > -- >
<!-- < / el-icon > -- >
< / div >
< / div >
< div class = "group-content" >
< p v-if = "group.conditions.length === 0" > 点击右上角 + 为本条件组 添加条件< / p >
< p v-if = "group.conditions.length === 0" > 点击右上角 + 添加条件 < / p >
< div v-else >
< el -form ref = "condition-form" >
<!-- 构建表达式 -- >
@@ -44,7 +45,7 @@
< / el-select >
< span v-if = "isSelect(condition.id)" style="margin-left: 10px" >
< el -select v-if = "condition.compare === 'IN'" style="width: 280px;" clearable multiple size="small"
v-model = "condition.value" placeholder="选择值" filterable >
v-model = "condition.value" placeholder="选择值" filterable >
< el-option v-for = "(option, oi) in getOptions(condition.id)" :key="oi" :label="option"
:value = "option" > < / el-option >
< / el-select >
@@ -62,7 +63,8 @@
< / span >
< / span >
< span v-else-if = "condition.valueType === ValueType.number" >
< el -select size = "small" placeholder = "判断符" style = "width: 120px;" v-model = "condition.compare" filterable clearable >
< el -select size = "small" placeholder = "判断符" style = "width: 120px;" v-model = "condition.compare" filterable
clearable >
< el-option :label = "exp.label" :value = "exp.value" :key = "exp.value" v-for = "exp in explains" > < / el -option >
< / el-select >
< span style = "margin-left: 10px" >
@@ -81,19 +83,22 @@
< / span >
< / span >
< / span >
< span v-else-if = "condition.valueType === ValueType.user " >
< span class = "item-desc" style = "margin-right: 20px" > 属于某部门 / 为某些人其中之一 < / span >
< el-button size = "mini" :icon = "Plus " typ e = "primary" @click ="selectUser(condition.value, 'user')"
round > 选择人员 / 部门 < / el-butt on >
< org-items :modelValue = "users" / >
< span v-else-if = "condition.valueType === ValueType.company " >
< span class = "item-desc" style = "margin-right: 20px" > 公司 < / span >
< el-select placeholder = "判断符 " s tyl e= "width: 120px;" v-model = "condition.compare" filterable clearable >
< el-option label = "等于" value = "=" > < / el-opti on >
< el-option label = "不等于" value = "!=" > < / el-option >
< / el-select >
< el-tree-select
v-model = "condition.value[0]"
@ node -click = " ( data ) = > {
condition . value [ 1 ] = data . label
} "
:data=" companyList "
check-strictly
style=" width : 240 px "
/>
</span>
< span v-else-if = "condition.valueType === ValueType.dept" >
< span class = "item-desc" style = "margin-right: 20px" > 为某部门 / 某部门下的部门 < / span >
< el-button size = "mini" :icon = "Plus" type = "primary" @click ="selectUser(condition.value, 'dept')"
round > 选择部门 < / el-button >
< org-items :modelValue = "users" / >
< / span >
< span v-else-if = "condition.valueType === ValueType.date" > < / span >
<el-icon class=" delete - icon " @click=" delSubCondition ( group , cindex ) ">
<Minus/>
</el-icon>
@@ -102,22 +107,20 @@
</div>
</div>
</div>
< org-picker title = "请选择人员/部门" multiple ref = "orgPicker" :v-model = "users" @ok ="selected" > < / org -picker >
</template>
<script setup>
import OrgPicker from "../common/UserPicker.vue" ;
import OrgItems from "../common/RoleItems.vue" ;
import {ValueType} from '@/views/workflow/form/ComponentsConfigExport.js'
import {computed, ref} from 'vue'
import {useProcessStore} from '@/stores/processStore.js'
import Ellipsis from '../common/Ellipsis.vue'
import { Plus , Minus } from '@element-plus/icons-vue'
import {getSubCompOpt} from '@/api/user/user.js';
const processStore = useProcessStore()
const orgPicker = ref ( )
const users = ref([])
const companyList = ref([])
// const orgType = ref('user')
const showOrgSelect = ref(false)
const groupNames = ref(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'])
@@ -186,19 +189,19 @@ const conditionValType = (type) => {
}
}
const selectUser = ( value , orgType ) => {
//选择用户,倒开组织选择器
// orgType.value = orgType
users . value = value
orgPicker . value . showUserPicker ( )
}
const filterConditionMosr = (list) => {
console.log(processFromPerms.value)
processFromPerms.value.forEach((item) => {
// console.log(item)
if ( item . required && supportTypes . value . indexOf ( item . valueType ) > - 1 ) {
if (item.required && supportTypes.value.indexOf(item.valueType) > -1) {
list.push({title: item.title, id: item.id, valueType: item.valueType})
}
})
list.push({
title: '发起人公司',
id: 'subCompanyId',
valueType: ValueType.company
})
}
const filterCondition = (item, list) => {
@@ -255,6 +258,16 @@ const conditionChange = (index, group) => {
}
}
}
const getCompanyList = () => {
getSubCompOpt().then(res => {
companyList.value = res.data
})
}
getCompanyList()
</script>
<style lang=" scss " scoped >