mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-08 08:22:41 +08:00
【功能修复】BPM:创建流程-SIMPLE设计器-多个条件时-最新的条件会覆盖上层所有的条件
This commit is contained in:
parent
a186806456
commit
7508eb5998
@ -91,6 +91,7 @@ import {
|
||||
DEFAULT_CONDITION_GROUP_VALUE
|
||||
} from './consts'
|
||||
import { generateUUID } from '@/utils'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
|
||||
defineOptions({
|
||||
name: 'NodeHandler'
|
||||
@ -184,7 +185,7 @@ const addNode = (type: number) => {
|
||||
conditionSetting: {
|
||||
defaultFlow: false,
|
||||
conditionType: ConditionType.RULE,
|
||||
conditionGroups: DEFAULT_CONDITION_GROUP_VALUE
|
||||
conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE)
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -242,7 +243,7 @@ const addNode = (type: number) => {
|
||||
conditionSetting: {
|
||||
defaultFlow: false,
|
||||
conditionType: ConditionType.RULE,
|
||||
conditionGroups: DEFAULT_CONDITION_GROUP_VALUE
|
||||
conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE)
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -254,6 +254,7 @@ import {
|
||||
import { useWatchNode, useDrawer, useNodeName, useFormFields, getConditionShowText } from '../node'
|
||||
import HttpRequestSetting from './components/HttpRequestSetting.vue'
|
||||
import ConditionDialog from './components/ConditionDialog.vue'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
const { proxy } = getCurrentInstance() as any
|
||||
|
||||
defineOptions({
|
||||
@ -290,7 +291,7 @@ const configForm = ref<TriggerSetting>({
|
||||
},
|
||||
formSettings: [
|
||||
{
|
||||
conditionGroups: DEFAULT_CONDITION_GROUP_VALUE,
|
||||
conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE),
|
||||
updateFormFields: {},
|
||||
deleteFields: []
|
||||
}
|
||||
@ -346,7 +347,7 @@ const changeTriggerType = () => {
|
||||
? originalSetting.formSettings
|
||||
: [
|
||||
{
|
||||
conditionGroups: DEFAULT_CONDITION_GROUP_VALUE,
|
||||
conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE),
|
||||
updateFormFields: {},
|
||||
deleteFields: []
|
||||
}
|
||||
@ -361,7 +362,7 @@ const changeTriggerType = () => {
|
||||
? originalSetting.formSettings
|
||||
: [
|
||||
{
|
||||
conditionGroups: DEFAULT_CONDITION_GROUP_VALUE,
|
||||
conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE),
|
||||
updateFormFields: undefined,
|
||||
deleteFields: []
|
||||
}
|
||||
@ -374,7 +375,7 @@ const changeTriggerType = () => {
|
||||
/** 添加新的修改表单设置 */
|
||||
const addFormSetting = () => {
|
||||
configForm.value.formSettings!.push({
|
||||
conditionGroups: DEFAULT_CONDITION_GROUP_VALUE,
|
||||
conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE),
|
||||
updateFormFields: {},
|
||||
deleteFields: []
|
||||
})
|
||||
@ -509,7 +510,7 @@ const showTriggerNodeConfig = (node: SimpleFlowNode) => {
|
||||
},
|
||||
formSettings: node.triggerSetting.formSettings || [
|
||||
{
|
||||
conditionGroups: DEFAULT_CONDITION_GROUP_VALUE,
|
||||
conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE),
|
||||
updateFormFields: {},
|
||||
deleteFields: []
|
||||
}
|
||||
|
@ -154,6 +154,7 @@ import {
|
||||
} from '../../consts'
|
||||
import { BpmModelFormType } from '@/utils/constants'
|
||||
import { useFormFieldsAndStartUser } from '../../node'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
@ -196,7 +197,7 @@ const formRef = ref() // 表单 Ref
|
||||
const changeConditionType = () => {
|
||||
if (condition.value.conditionType === ConditionType.RULE) {
|
||||
if (!condition.value.conditionGroups) {
|
||||
condition.value.conditionGroups = DEFAULT_CONDITION_GROUP_VALUE
|
||||
condition.value.conditionGroups = cloneDeep(DEFAULT_CONDITION_GROUP_VALUE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -165,6 +165,7 @@ import {
|
||||
} from '../../consts'
|
||||
import { BpmModelFormType } from '@/utils/constants'
|
||||
import { useFormFieldsAndStartUser } from '../../node'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
defineOptions({
|
||||
name: 'ConditionDialog'
|
||||
})
|
||||
@ -175,7 +176,7 @@ const condition = ref<{
|
||||
conditionGroups?: ConditionGroup
|
||||
}>({
|
||||
conditionType: ConditionType.RULE,
|
||||
conditionGroups: DEFAULT_CONDITION_GROUP_VALUE
|
||||
conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE)
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
@ -210,7 +211,7 @@ const formRef = ref() // 表单 Ref
|
||||
const changeConditionType = () => {
|
||||
if (condition.value.conditionType === ConditionType.RULE) {
|
||||
if (!condition.value.conditionGroups) {
|
||||
condition.value.conditionGroups = DEFAULT_CONDITION_GROUP_VALUE
|
||||
condition.value.conditionGroups = cloneDeep(DEFAULT_CONDITION_GROUP_VALUE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -108,11 +108,18 @@
|
||||
<script setup lang="ts">
|
||||
import NodeHandler from '../NodeHandler.vue'
|
||||
import ProcessNodeTree from '../ProcessNodeTree.vue'
|
||||
import { SimpleFlowNode, NodeType, ConditionType, DEFAULT_CONDITION_GROUP_VALUE, NODE_DEFAULT_TEXT } from '../consts'
|
||||
import {
|
||||
SimpleFlowNode,
|
||||
NodeType,
|
||||
ConditionType,
|
||||
DEFAULT_CONDITION_GROUP_VALUE,
|
||||
NODE_DEFAULT_TEXT
|
||||
} from '../consts'
|
||||
import { getDefaultConditionNodeName } from '../utils'
|
||||
import { useTaskStatusClass } from '../node'
|
||||
import { generateUUID } from '@/utils'
|
||||
import ConditionNodeConfig from '../nodes-config/ConditionNodeConfig.vue'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
const { proxy } = getCurrentInstance() as any
|
||||
defineOptions({
|
||||
name: 'ExclusiveNode'
|
||||
@ -149,7 +156,8 @@ const blurEvent = (index: number) => {
|
||||
showInputs.value[index] = false
|
||||
const conditionNode = currentNode.value.conditionNodes?.at(index) as SimpleFlowNode
|
||||
conditionNode.name =
|
||||
conditionNode.name || getDefaultConditionNodeName(index, conditionNode.conditionSetting?.defaultFlow)
|
||||
conditionNode.name ||
|
||||
getDefaultConditionNodeName(index, conditionNode.conditionSetting?.defaultFlow)
|
||||
}
|
||||
|
||||
// 点击条件名称
|
||||
@ -181,7 +189,7 @@ const addCondition = () => {
|
||||
conditionSetting: {
|
||||
defaultFlow: false,
|
||||
conditionType: ConditionType.RULE,
|
||||
conditionGroups: DEFAULT_CONDITION_GROUP_VALUE
|
||||
conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE)
|
||||
}
|
||||
}
|
||||
conditionNodes.splice(lastIndex, 0, conditionData)
|
||||
|
@ -110,11 +110,18 @@
|
||||
<script setup lang="ts">
|
||||
import NodeHandler from '../NodeHandler.vue'
|
||||
import ProcessNodeTree from '../ProcessNodeTree.vue'
|
||||
import { SimpleFlowNode, NodeType, ConditionType, DEFAULT_CONDITION_GROUP_VALUE, NODE_DEFAULT_TEXT } from '../consts'
|
||||
import {
|
||||
SimpleFlowNode,
|
||||
NodeType,
|
||||
ConditionType,
|
||||
DEFAULT_CONDITION_GROUP_VALUE,
|
||||
NODE_DEFAULT_TEXT
|
||||
} from '../consts'
|
||||
import { useTaskStatusClass } from '../node'
|
||||
import { getDefaultInclusiveConditionNodeName } from '../utils'
|
||||
import { generateUUID } from '@/utils'
|
||||
import ConditionNodeConfig from '../nodes-config/ConditionNodeConfig.vue'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
const { proxy } = getCurrentInstance() as any
|
||||
defineOptions({
|
||||
name: 'InclusiveNode'
|
||||
@ -153,7 +160,8 @@ const blurEvent = (index: number) => {
|
||||
showInputs.value[index] = false
|
||||
const conditionNode = currentNode.value.conditionNodes?.at(index) as SimpleFlowNode
|
||||
conditionNode.name =
|
||||
conditionNode.name || getDefaultInclusiveConditionNodeName(index, conditionNode.conditionSetting?.defaultFlow)
|
||||
conditionNode.name ||
|
||||
getDefaultInclusiveConditionNodeName(index, conditionNode.conditionSetting?.defaultFlow)
|
||||
}
|
||||
|
||||
// 点击条件名称
|
||||
@ -185,7 +193,7 @@ const addCondition = () => {
|
||||
conditionSetting: {
|
||||
defaultFlow: false,
|
||||
conditionType: ConditionType.RULE,
|
||||
conditionGroups: DEFAULT_CONDITION_GROUP_VALUE
|
||||
conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE)
|
||||
}
|
||||
}
|
||||
conditionNodes.splice(lastIndex, 0, conditionData)
|
||||
|
Loading…
x
Reference in New Issue
Block a user