mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-09 17:02:43 +08:00
fix: 代码审查修改
This commit is contained in:
parent
357955ce24
commit
9c9f09fbed
@ -1 +0,0 @@
|
||||
<svg t="1740116978908" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1356" width="200" height="200"><path d="M860.544 633.856c-82.368 0-152.128 69.632-158.464 152h-354.88c-31.616 0-63.296-31.68-63.296-63.296V437.376c12.608 0 25.344 6.4 44.288 6.4h380.16c12.672 69.696 76.032 126.656 152.128 126.656 88.704 0 158.336-69.696 158.336-158.4s-69.632-158.4-158.336-158.4c-76.096 0-139.456 57.024-152.128 126.656h-361.216c-31.616 0-63.296-31.68-63.296-63.296v-133.12h164.736c31.68 0 63.296-22.848 63.296-54.528a55.04 55.04 0 0 0-56-56h-380.16c-31.68 0-70.72 17.984-70.72 56s31.68 54.528 63.36 54.528h133.056v538.624c0 69.696 57.088 126.656 126.72 126.656h386.56c25.344 57.088 82.368 101.376 145.728 101.376a156.8 156.8 0 0 0 158.336-158.4 156.608 156.608 0 0 0-158.208-158.272z m0-316.8c50.624 0 94.912 44.288 94.912 94.976s-44.288 94.976-94.912 94.976c-50.752 0-95.104-44.288-95.104-94.976s44.352-94.976 95.104-94.976z m0 570.24c-50.752 0-95.104-44.352-95.104-95.04s44.352-95.04 95.104-95.04c50.624 0 94.912 44.352 94.912 95.04s-44.288 95.04-94.912 95.04z" p-id="1357" fill="#ffffff"></path></svg>
|
Before Width: | Height: | Size: 1.1 KiB |
@ -69,12 +69,6 @@
|
||||
</div>
|
||||
<div class="handler-item-text">子流程</div>
|
||||
</div>
|
||||
<div class="handler-item" @click="addNode(NodeType.ASYNC_CHILD_PROCESS_NODE)">
|
||||
<div class="handler-item-icon async-child-process">
|
||||
<span class="iconfont icon-size icon-async-child-process"></span>
|
||||
</div>
|
||||
<div class="handler-item-text">异步子流程</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #reference>
|
||||
<div class="add-icon"><Icon icon="ep:plus" /></div>
|
||||
@ -303,8 +297,8 @@ const addNode = (type: number) => {
|
||||
type: NodeType.CHILD_PROCESS_NODE,
|
||||
childNode: props.childNode,
|
||||
childProcessSetting: {
|
||||
calledElement: '',
|
||||
calledElementName: '',
|
||||
calledProcessDefinitionKey: '',
|
||||
calledProcessDefinitionName: '',
|
||||
async: false,
|
||||
skipStartUserNode: false,
|
||||
startUserSetting: {
|
||||
|
@ -39,15 +39,10 @@ export enum NodeType {
|
||||
TRIGGER_NODE = 15,
|
||||
|
||||
/**
|
||||
* 触发器节点
|
||||
* 子流程节点
|
||||
*/
|
||||
CHILD_PROCESS_NODE = 20,
|
||||
|
||||
/**
|
||||
* 触发器节点
|
||||
*/
|
||||
ASYNC_CHILD_PROCESS_NODE = 21,
|
||||
|
||||
/**
|
||||
* 条件节点
|
||||
*/
|
||||
@ -804,11 +799,11 @@ export const TRIGGER_TYPES: DictDataVO[] = [
|
||||
* 子流程节点结构定义
|
||||
*/
|
||||
export type ChildProcessSetting = {
|
||||
calledElement: string
|
||||
calledElementName: string
|
||||
calledProcessDefinitionKey: string
|
||||
calledProcessDefinitionName: string
|
||||
async: boolean,
|
||||
inVariable?: IOParameter[],
|
||||
outVariable?: IOParameter[],
|
||||
inVariables?: IOParameter[],
|
||||
outVariables?: IOParameter[],
|
||||
skipStartUserNode: boolean,
|
||||
startUserSetting: StartUserSetting,
|
||||
}
|
||||
@ -823,5 +818,5 @@ export type IOParameter = {
|
||||
export type StartUserSetting = {
|
||||
type: number
|
||||
formField?: string
|
||||
emptyHandleType?: number
|
||||
emptyType?: number
|
||||
}
|
||||
|
@ -27,9 +27,16 @@
|
||||
<el-tab-pane label="子流程" name="child">
|
||||
<div>
|
||||
<el-form ref="formRef" :model="configForm" label-position="top" :rules="formRules">
|
||||
<el-form-item label="选择子流程" prop="calledElement">
|
||||
<el-form-item label="是否异步" prop="async">
|
||||
<el-switch
|
||||
v-model="configForm.async"
|
||||
active-text="异步"
|
||||
inactive-text="不异步"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择子流程" prop="calledProcessDefinitionKey">
|
||||
<el-select
|
||||
v-model="configForm.calledElement"
|
||||
v-model="configForm.calledProcessDefinitionKey"
|
||||
clearable
|
||||
@change="handleCalledElementChange"
|
||||
>
|
||||
@ -48,11 +55,11 @@
|
||||
inactive-text="不跳过"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主→子变量传递" prop="inVariable">
|
||||
<div class="flex pt-2" v-for="(item, index) in configForm.inVariable" :key="index">
|
||||
<el-form-item label="主→子变量传递" prop="inVariables">
|
||||
<div class="flex pt-2" v-for="(item, index) in configForm.inVariables" :key="index">
|
||||
<div class="mr-2">
|
||||
<el-form-item
|
||||
:prop="`inVariable.${index}.source`"
|
||||
:prop="`inVariables.${index}.source`"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '变量不能为空',
|
||||
@ -71,7 +78,7 @@
|
||||
</div>
|
||||
<div class="mr-2">
|
||||
<el-form-item
|
||||
:prop="`inVariable.${index}.target`"
|
||||
:prop="`inVariables.${index}.target`"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '变量不能为空',
|
||||
@ -92,23 +99,23 @@
|
||||
<Icon
|
||||
icon="ep:delete"
|
||||
:size="18"
|
||||
@click="deleteVariable(configForm.inVariable, index)"
|
||||
@click="deleteVariable(configForm.inVariables, index)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="primary" text @click="addVariable(configForm.inVariable)">
|
||||
<el-button type="primary" text @click="addVariable(configForm.inVariables)">
|
||||
<Icon icon="ep:plus" class="mr-5px" />添加一行
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="currentNode.childProcessSetting?.async === false"
|
||||
v-if="configForm.async === false"
|
||||
label="子→主变量传递"
|
||||
prop="outVariable"
|
||||
prop="outVariables"
|
||||
>
|
||||
<div class="flex pt-2" v-for="(item, index) in configForm.outVariable" :key="index">
|
||||
<div class="flex pt-2" v-for="(item, index) in configForm.outVariables" :key="index">
|
||||
<div class="mr-2">
|
||||
<el-form-item
|
||||
:prop="`outVariable.${index}.source`"
|
||||
:prop="`outVariables.${index}.source`"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '变量不能为空',
|
||||
@ -127,7 +134,7 @@
|
||||
</div>
|
||||
<div class="mr-2">
|
||||
<el-form-item
|
||||
:prop="`outVariable.${index}.target`"
|
||||
:prop="`outVariables.${index}.target`"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '变量不能为空',
|
||||
@ -148,11 +155,11 @@
|
||||
<Icon
|
||||
icon="ep:delete"
|
||||
:size="18"
|
||||
@click="deleteVariable(configForm.outVariable, index)"
|
||||
@click="deleteVariable(configForm.outVariables, index)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="primary" text @click="addVariable(configForm.outVariable)">
|
||||
<el-button type="primary" text @click="addVariable(configForm.outVariables)">
|
||||
<Icon icon="ep:plus" class="mr-5px" />添加一行
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
@ -227,7 +234,8 @@ const activeTabName = ref('child')
|
||||
const formRef = ref() // 表单 Ref
|
||||
// 表单校验规则
|
||||
const formRules = reactive({
|
||||
calledElement: [{ required: true, message: '子流程不能为空', trigger: 'change' }],
|
||||
async: [{ required: true, message: '是否异步不能为空', trigger: 'change' }],
|
||||
calledProcessDefinitionKey: [{ required: true, message: '子流程不能为空', trigger: 'change' }],
|
||||
skipStartUserNode: [
|
||||
{ required: true, message: '是否自动跳过子流程发起节点不能为空', trigger: 'change' }
|
||||
],
|
||||
@ -238,10 +246,10 @@ const formRules = reactive({
|
||||
startUserFormField: [{ required: true, message: '发起人表单不能为空', trigger: 'change' }]
|
||||
})
|
||||
const configForm = ref({
|
||||
calledElement: '',
|
||||
calledProcessDefinitionKey: '',
|
||||
skipStartUserNode: false,
|
||||
inVariable: [],
|
||||
outVariable: [],
|
||||
inVariables: [],
|
||||
outVariables: [],
|
||||
startUserType: 1,
|
||||
startUserEmptyType: 1,
|
||||
startUserFormField: ''
|
||||
@ -257,17 +265,18 @@ const saveConfig = async () => {
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return false
|
||||
const childInfo = childProcessOptions.value.find(
|
||||
(option) => option.key === configForm.value.calledElement
|
||||
(option) => option.key === configForm.value.calledProcessDefinitionKey
|
||||
)
|
||||
currentNode.value.name = nodeName.value!
|
||||
if (currentNode.value.childProcessSetting) {
|
||||
currentNode.value.childProcessSetting.calledElement = childInfo.key
|
||||
currentNode.value.childProcessSetting.calledElementName = childInfo.name
|
||||
currentNode.value.childProcessSetting.async = configForm.value.async
|
||||
currentNode.value.childProcessSetting.calledProcessDefinitionKey = childInfo.key
|
||||
currentNode.value.childProcessSetting.calledProcessDefinitionName = childInfo.name
|
||||
currentNode.value.childProcessSetting.skipStartUserNode = configForm.value.skipStartUserNode
|
||||
currentNode.value.childProcessSetting.inVariable = configForm.value.inVariable
|
||||
currentNode.value.childProcessSetting.outVariable = configForm.value.outVariable
|
||||
currentNode.value.childProcessSetting.inVariables = configForm.value.inVariables
|
||||
currentNode.value.childProcessSetting.outVariables = configForm.value.outVariables
|
||||
currentNode.value.childProcessSetting.startUserSetting.type = configForm.value.startUserType
|
||||
currentNode.value.childProcessSetting.startUserSetting.emptyHandleType =
|
||||
currentNode.value.childProcessSetting.startUserSetting.emptyType =
|
||||
configForm.value.startUserEmptyType
|
||||
currentNode.value.childProcessSetting.startUserSetting.formField =
|
||||
configForm.value.startUserFormField
|
||||
@ -280,13 +289,15 @@ const saveConfig = async () => {
|
||||
const showChildProcessNodeConfig = (node: SimpleFlowNode) => {
|
||||
nodeName.value = node.name
|
||||
if (node.childProcessSetting) {
|
||||
configForm.value.calledElement = node.childProcessSetting.calledElement
|
||||
configForm.value.async =
|
||||
node.childProcessSetting.async
|
||||
configForm.value.calledProcessDefinitionKey =
|
||||
node.childProcessSetting.calledProcessDefinitionKey
|
||||
configForm.value.skipStartUserNode = node.childProcessSetting.skipStartUserNode
|
||||
configForm.value.inVariable = node.childProcessSetting.inVariable
|
||||
configForm.value.outVariable = node.childProcessSetting.outVariable
|
||||
configForm.value.inVariables = node.childProcessSetting.inVariables
|
||||
configForm.value.outVariables = node.childProcessSetting.outVariables
|
||||
configForm.value.startUserType = node.childProcessSetting.startUserSetting.type
|
||||
configForm.value.startUserEmptyType =
|
||||
node.childProcessSetting.startUserSetting.emptyHandleType ?? 1
|
||||
configForm.value.startUserEmptyType = node.childProcessSetting.startUserSetting.emptyType ?? 1
|
||||
configForm.value.startUserFormField = node.childProcessSetting.startUserSetting.formField ?? ''
|
||||
}
|
||||
loadFormInfo()
|
||||
@ -304,13 +315,13 @@ const deleteVariable = (arr, index: number) => {
|
||||
arr.splice(index, 1)
|
||||
}
|
||||
const handleCalledElementChange = () => {
|
||||
configForm.value.inVariable = []
|
||||
configForm.value.outVariable = []
|
||||
configForm.value.inVariables = []
|
||||
configForm.value.outVariables = []
|
||||
loadFormInfo()
|
||||
}
|
||||
const loadFormInfo = async () => {
|
||||
const childInfo = childProcessOptions.value.find(
|
||||
(option) => option.key === configForm.value.calledElement
|
||||
(option) => option.key === configForm.value.calledProcessDefinitionKey
|
||||
)
|
||||
const formInfo = await getForm(childInfo.formId)
|
||||
childFormFieldOptions.value = []
|
||||
|
@ -86,8 +86,7 @@ const setSimpleModelNodeTaskStatus = (
|
||||
simpleModel.type === NodeType.START_USER_NODE ||
|
||||
simpleModel.type === NodeType.USER_TASK_NODE ||
|
||||
simpleModel.type === NodeType.TRANSACTOR_NODE ||
|
||||
simpleModel.type === NodeType.CHILD_PROCESS_NODE ||
|
||||
simpleModel.type === NodeType.ASYNC_CHILD_PROCESS_NODE
|
||||
simpleModel.type === NodeType.CHILD_PROCESS_NODE
|
||||
) {
|
||||
simpleModel.activityStatus = TaskStatusEnum.NOT_START
|
||||
if (rejectedTaskActivityIds.includes(simpleModel.id)) {
|
||||
|
@ -182,7 +182,6 @@ import parallelSvg from '@/assets/svgs/bpm/parallel.svg'
|
||||
import finishSvg from '@/assets/svgs/bpm/finish.svg'
|
||||
import transactorSvg from '@/assets/svgs/bpm/transactor.svg'
|
||||
import childProcessSvg from '@/assets/svgs/bpm/child-process.svg'
|
||||
import asyncChildProcessSvg from '@/assets/svgs/bpm/async-child-process.svg'
|
||||
|
||||
defineOptions({ name: 'BpmProcessInstanceTimeline' })
|
||||
withDefaults(
|
||||
@ -254,8 +253,6 @@ const nodeTypeSvgMap = {
|
||||
[NodeType.PARALLEL_BRANCH_NODE]: { color: '#14bb83', svg: parallelSvg },
|
||||
// 子流程节点
|
||||
[NodeType.CHILD_PROCESS_NODE]: { color: '#14bb83', svg: childProcessSvg },
|
||||
// 异步子流程节点
|
||||
[NodeType.ASYNC_CHILD_PROCESS_NODE]: { color: '#14bb83', svg: asyncChildProcessSvg }
|
||||
}
|
||||
|
||||
// 只有只有状态是 -1、0、1 才展示头像右小角状态小icon
|
||||
@ -276,7 +273,6 @@ const getApprovalNodeIcon = (taskStatus: number, nodeType: NodeType) => {
|
||||
nodeType === NodeType.USER_TASK_NODE ||
|
||||
nodeType === NodeType.TRANSACTOR_NODE ||
|
||||
nodeType === NodeType.CHILD_PROCESS_NODE ||
|
||||
nodeType === NodeType.ASYNC_CHILD_PROCESS_NODE ||
|
||||
nodeType === NodeType.END_EVENT_NODE
|
||||
) {
|
||||
return statusIconMap[taskStatus]?.icon
|
||||
|
Loading…
x
Reference in New Issue
Block a user