mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-08 16:32:43 +08:00
【代码评审】BPM:触发器,修改节点的评审
This commit is contained in:
parent
78d8782b5d
commit
1de17cadb5
@ -551,21 +551,21 @@ export function useTaskStatusClass(taskStatus: TaskStatusEnum | undefined): stri
|
|||||||
|
|
||||||
/** 条件组件文字展示 */
|
/** 条件组件文字展示 */
|
||||||
export function getConditionShowText(
|
export function getConditionShowText(
|
||||||
conditonType: ConditionType | undefined,
|
conditionType: ConditionType | undefined,
|
||||||
conditionExpression: string | undefined,
|
conditionExpression: string | undefined,
|
||||||
conditionGroups: ConditionGroup | undefined,
|
conditionGroups: ConditionGroup | undefined,
|
||||||
fieldOptions: Array<Record<string, any>>
|
fieldOptions: Array<Record<string, any>>
|
||||||
) {
|
) {
|
||||||
let showText = ''
|
let showText = ''
|
||||||
if (conditonType === ConditionType.EXPRESSION) {
|
if (conditionType === ConditionType.EXPRESSION) {
|
||||||
if (conditionExpression) {
|
if (conditionExpression) {
|
||||||
showText = `表达式:${conditionExpression}`
|
showText = `表达式:${conditionExpression}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (conditonType === ConditionType.RULE) {
|
if (conditionType === ConditionType.RULE) {
|
||||||
// 条件组是否为与关系
|
// 条件组是否为与关系
|
||||||
const groupAnd = conditionGroups?.and
|
const groupAnd = conditionGroups?.and
|
||||||
let warningMesg: undefined | string = undefined
|
let warningMessage: undefined | string = undefined
|
||||||
const conditionGroup = conditionGroups?.conditions.map((item) => {
|
const conditionGroup = conditionGroups?.conditions.map((item) => {
|
||||||
return (
|
return (
|
||||||
'(' +
|
'(' +
|
||||||
@ -581,7 +581,7 @@ export function getConditionShowText(
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// 有一条规则不完善。提示错误
|
// 有一条规则不完善。提示错误
|
||||||
warningMesg = '请完善条件规则'
|
warningMessage = '请完善条件规则'
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -589,7 +589,7 @@ export function getConditionShowText(
|
|||||||
' ) '
|
' ) '
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
if (warningMesg) {
|
if (warningMessage) {
|
||||||
showText = ''
|
showText = ''
|
||||||
} else {
|
} else {
|
||||||
showText = conditionGroup!.join(groupAnd ? ' 且 ' : ' 或 ')
|
showText = conditionGroup!.join(groupAnd ? ' 且 ' : ' 或 ')
|
||||||
|
@ -104,11 +104,10 @@ const handleClose = async (done: (cancel?: boolean) => void) => {
|
|||||||
done()
|
done()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 流程表单字段和发起人字段
|
|
||||||
const fieldOptions = useFormFieldsAndStartUser()
|
|
||||||
|
|
||||||
|
/** 保存配置 */
|
||||||
|
const fieldOptions = useFormFieldsAndStartUser() // 流程表单字段和发起人字段
|
||||||
const conditionRef = ref()
|
const conditionRef = ref()
|
||||||
// 保存配置
|
|
||||||
const saveConfig = async () => {
|
const saveConfig = async () => {
|
||||||
if (!currentNode.value.conditionSetting?.defaultFlow) {
|
if (!currentNode.value.conditionSetting?.defaultFlow) {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
|
@ -252,17 +252,11 @@ import {
|
|||||||
FormTriggerSetting,
|
FormTriggerSetting,
|
||||||
DEFAULT_CONDITION_GROUP_VALUE
|
DEFAULT_CONDITION_GROUP_VALUE
|
||||||
} from '../consts'
|
} from '../consts'
|
||||||
import {
|
import { useWatchNode, useDrawer, useNodeName, useFormFields, getConditionShowText } from '../node'
|
||||||
useWatchNode,
|
|
||||||
useDrawer,
|
|
||||||
useNodeName,
|
|
||||||
useFormFields,
|
|
||||||
useFormFieldsAndStartUser,
|
|
||||||
getConditionShowText
|
|
||||||
} from '../node'
|
|
||||||
import HttpRequestParamSetting from './components/HttpRequestParamSetting.vue'
|
import HttpRequestParamSetting from './components/HttpRequestParamSetting.vue'
|
||||||
import ConditionDialog from './components/ConditionDialog.vue'
|
import ConditionDialog from './components/ConditionDialog.vue'
|
||||||
const { proxy } = getCurrentInstance() as any
|
const { proxy } = getCurrentInstance() as any
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'TriggerNodeConfig'
|
name: 'TriggerNodeConfig'
|
||||||
})
|
})
|
||||||
@ -314,7 +308,7 @@ const optionalUpdateFormFields = computed(() => {
|
|||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 添加 HTTP 请求返回值设置项*/
|
/** 添加 HTTP 请求返回值设置项 */
|
||||||
const addHttpResponseSetting = (responseSetting: Record<string, string>[]) => {
|
const addHttpResponseSetting = (responseSetting: Record<string, string>[]) => {
|
||||||
responseSetting.push({
|
responseSetting.push({
|
||||||
key: '',
|
key: '',
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
<!-- TODO @jason:有可能,它里面套 Condition 么? -->
|
||||||
<template>
|
<template>
|
||||||
<Dialog v-model="dialogVisible" title="条件配置" width="600px" :fullscreen="false">
|
<Dialog v-model="dialogVisible" title="条件配置" width="600px" :fullscreen="false">
|
||||||
<div class="h-410px">
|
<div class="h-410px">
|
||||||
@ -106,7 +107,10 @@
|
|||||||
<el-input v-model="rule.rightSide" style="width: 160px" />
|
<el-input v-model="rule.rightSide" style="width: 160px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="cursor-pointer mr-1 flex items-center" v-if="equation.rules.length > 1">
|
<div
|
||||||
|
class="cursor-pointer mr-1 flex items-center"
|
||||||
|
v-if="equation.rules.length > 1"
|
||||||
|
>
|
||||||
<Icon
|
<Icon
|
||||||
icon="ep:delete"
|
icon="ep:delete"
|
||||||
:size="18"
|
:size="18"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user