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