feat : workflow适配
This commit is contained in:
@@ -94,7 +94,9 @@
|
||||
<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>
|
||||
<el-icon class="delete-icon" @click="delSubCondition(group, cindex)">
|
||||
<Minus/>
|
||||
</el-icon>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -140,14 +142,20 @@ const selectedNode = computed(() => {
|
||||
return processStore.getSelectedNode()
|
||||
})
|
||||
|
||||
const processFromPerms = computed(() => {
|
||||
return processStore.getDesign().processFromPerms;
|
||||
});
|
||||
|
||||
const conditionList = computed(() => {
|
||||
//条件数组
|
||||
//构造可用条件选项
|
||||
const conditionItems = []
|
||||
processStore.getDesign().formItems.forEach(item => filterCondition(item, conditionItems))
|
||||
if (conditionItems.length === 0 || conditionItems[0].id !== 'root') {
|
||||
conditionItems.unshift({id: 'root', title: '发起人', valueType: 'User'})
|
||||
}
|
||||
filterConditionMosr(conditionItems)
|
||||
// processStore.getDesign().formItems.forEach(item => filterCondition(item, conditionItems))
|
||||
// if (conditionItems.length === 0 || conditionItems[0].id !== 'root') {
|
||||
// conditionItems.unshift({id: 'root', title: '发起人', valueType: 'User'})
|
||||
// }
|
||||
conditionItems.unshift({id: 'root', title: '发起人', valueType: 'User'})
|
||||
return conditionItems
|
||||
})
|
||||
|
||||
@@ -184,6 +192,14 @@ const selectUser = (value, orgType) => {
|
||||
users.value = value
|
||||
orgPicker.value.showUserPicker()
|
||||
}
|
||||
const filterConditionMosr = (list) => {
|
||||
processFromPerms.value.forEach((item) => {
|
||||
console.log(item)
|
||||
if (item.required){
|
||||
list.push({title: item.title, id: item.id, valueType: item.valueType})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const filterCondition = (item, list) => {
|
||||
//从表单中过滤出可以选择的条件
|
||||
@@ -206,8 +222,7 @@ const selected = (selected) => {
|
||||
users.value = userInfoList
|
||||
//组织选择器的选中回调函数
|
||||
// users.value.length = 0
|
||||
// console.log('processStore.getAssignedUser()',processStore.getAssignedUser())
|
||||
processStore.getAssignedUser().forEach(u => users.value=userInfoList)
|
||||
processStore.getAssignedUser().forEach(u => users.value = userInfoList)
|
||||
}
|
||||
|
||||
const delGroup = (index) => {
|
||||
@@ -228,7 +243,6 @@ const conditionChange = (index, group) => {
|
||||
if (0 > group.conditions.findIndex(cd => cd.id === cid)) {
|
||||
//新增条件
|
||||
let condition = {...conditionList.value[index]}
|
||||
console.log('fs', condition, conditionList.value, index)
|
||||
condition.compare = '';
|
||||
condition.value = []
|
||||
group.conditions.push(condition)
|
||||
|
||||
@@ -66,7 +66,30 @@ const init = () => {
|
||||
}
|
||||
}
|
||||
processStore.getSelectedNode().props.formPerms = [];
|
||||
formPermsLoad(oldPermMap, processStore.getDesign().formItems);
|
||||
//todo 项目字段测试
|
||||
let perms = [{
|
||||
id: "projectName",
|
||||
title: "项目名称",
|
||||
required: true,
|
||||
perm: "R"
|
||||
}, {
|
||||
id: "projectType",
|
||||
title: "项目类型",
|
||||
required: true,
|
||||
perm: "R"
|
||||
}, {
|
||||
id: "projectDesc",
|
||||
title: "项目描述",
|
||||
required: true,
|
||||
perm: "R"
|
||||
}, {
|
||||
id: "projectManager",
|
||||
title: "项目经理",
|
||||
required: true,
|
||||
perm: "R"
|
||||
}];
|
||||
// formPermsLoad(oldPermMap, processStore.getDesign().formItems);
|
||||
formPermsLoadMosr(oldPermMap, processFromPerms.value);
|
||||
};
|
||||
|
||||
const formPerms = computed(() => {
|
||||
@@ -81,12 +104,40 @@ const formItems = computed(() => {
|
||||
return processStore.getDesign().formItems;
|
||||
});
|
||||
|
||||
const processFromPerms = computed(() => {
|
||||
return processStore.getDesign().processFromPerms;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const allSelect = (type) => {
|
||||
permSelect.value = type;
|
||||
formPerms.value.forEach(f => f.perm = type);
|
||||
};
|
||||
const formPermsLoadMosr = (oldPermMap, perms) => {
|
||||
|
||||
perms.forEach(perm =>{
|
||||
console.log(perm)
|
||||
//刷新名称
|
||||
let old = oldPermMap.get(perm.id)
|
||||
if (old) {
|
||||
old.title = perm.title;
|
||||
old.required = perm.required;
|
||||
formPerms.value.push(old);
|
||||
} else {
|
||||
formPerms.value.push({
|
||||
id: perm.id, //todo ,id 就是字段名称
|
||||
title: perm.title,
|
||||
required: perm.required,
|
||||
perm: nowNode.type === "ROOT" ? "E" : "R"
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//todo 初始化表单权限的位置,表单字段信息放在config配置中心
|
||||
const formPermsLoad = (oldPermMap, forms) => {
|
||||
forms.forEach(form => {
|
||||
if (form.name === "SpanLayout") {
|
||||
@@ -100,7 +151,7 @@ const formPermsLoad = (oldPermMap, forms) => {
|
||||
formPerms.value.push(old);
|
||||
} else {
|
||||
formPerms.value.push({
|
||||
id: form.id,
|
||||
id: form.id, //todo ,id 就是字段名称
|
||||
title: form.title,
|
||||
required: form.props.required,
|
||||
perm: nowNode.type === "ROOT" ? "E" : "R"
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<template>
|
||||
<el-tabs v-model="active" v-if="visible && name && formConfig.length > 0">
|
||||
<el-tab-pane :label="name" name="properties">
|
||||
<component :is="com" :config="selectNode.props" @initRender="emit('initRender')"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="表单权限设置" name="permissions">
|
||||
<form-authority-config :node-type="selectNode.type"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div v-else>
|
||||
<!-- <el-tabs v-model="active" v-if="visible && name && formConfig.length > 0">-->
|
||||
<el-tabs v-model="active" v-if="visible && name">
|
||||
<el-tab-pane :label="name" name="properties">
|
||||
<component :is="com" :config="selectNode.props" @initRender="emit('initRender')"/>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="表单权限设置" name="permissions">
|
||||
<form-authority-config :node-type="selectNode.type"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div v-else>
|
||||
<component :is="com" :config="selectNode.props" @initRender="emit('initRender')"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -21,7 +22,8 @@ import CcNode from './CcNodeConfig.vue'
|
||||
import Condition from './ConditionNodeConfig.vue'
|
||||
import Trigger from './TriggerNodeConfig.vue'
|
||||
import {useProcessStore} from '@/stores/processStore.js'
|
||||
import {computed,defineEmits} from 'vue'
|
||||
import {computed, defineEmits} from 'vue'
|
||||
|
||||
const emit = defineEmits()
|
||||
|
||||
const processStore = useProcessStore()
|
||||
@@ -31,9 +33,9 @@ const selectNode = computed(() => {
|
||||
})
|
||||
|
||||
|
||||
const formConfig = computed(() => {
|
||||
return processStore.getDesign().formItems
|
||||
})
|
||||
// const formConfig = computed(() => {
|
||||
// return processStore.getDesign().formItems
|
||||
// })
|
||||
|
||||
|
||||
const com = ref()
|
||||
@@ -41,7 +43,7 @@ const active = ref('properties')
|
||||
const visible = ref(false)
|
||||
|
||||
|
||||
const name = computed(()=>{
|
||||
const name = computed(() => {
|
||||
switch (processStore.getSelectedNode().type) {
|
||||
case 'ROOT':
|
||||
return '设置发起人';
|
||||
@@ -56,7 +58,6 @@ const name = computed(()=>{
|
||||
|
||||
|
||||
const init = () => {
|
||||
console.log(processStore.getSelectedNode().type)
|
||||
switch (processStore.getSelectedNode().type) {
|
||||
case 'APPROVAL' :
|
||||
com.value = Approval;
|
||||
|
||||
Reference in New Issue
Block a user