pull/724/head
Lemon 2025-03-12 10:16:41 +08:00
parent f44dca25c9
commit 4cb7549e12
2 changed files with 26 additions and 24 deletions

View File

@ -4,7 +4,7 @@ NODE_ENV=development
VITE_DEV=true VITE_DEV=true
# 请求路径 # 请求路径
VITE_BASE_URL='http://localhost:48080' VITE_BASE_URL='http://192.168.3.9:48080'
# 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务 # 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务
VITE_UPLOAD_TYPE=server VITE_UPLOAD_TYPE=server

View File

@ -42,7 +42,7 @@ export const getApproveTypeText = (approveType: ApproveType): string => {
} }
/** /**
* *
* @param currentNode * @param currentNode
* @param rootNode * @param rootNode
* @returns boolean * @returns boolean
@ -53,32 +53,34 @@ export function isNodeInParallelBranch(
): boolean { ): boolean {
const path = findNodePath(currentNode, rootNode) const path = findNodePath(currentNode, rootNode)
// 找到最近的包容分支节点和并行分支节点的位置 // 检查当前节点是否在并行分支的条件节点内
let inclusiveIndex = -1 for (let i = 0; i < path.length; i++) {
let parallelIndex = -1 const node = path[i]
path.forEach((node, index) => {
if (node.type === NodeType.INCLUSIVE_BRANCH_NODE) {
inclusiveIndex = index
}
if (node.type === NodeType.PARALLEL_BRANCH_NODE) { if (node.type === NodeType.PARALLEL_BRANCH_NODE) {
parallelIndex = index // 如果找到并行分支节点,检查当前节点是否在其条件节点内
} if (node.conditionNodes?.some(conditionNode => {
}) // 检查当前节点是否在这个条件分支的子树中
const subPath = findNodePath(currentNode, conditionNode)
// 如果没有并行分支,直接返回 false if (subPath.length > 0) {
if (parallelIndex === -1) { // 如果在条件分支内,检查是否在包容节点内
// 从当前节点向上查找最近的包容节点
for (const pathNode of subPath) {
if (pathNode.type === NodeType.INCLUSIVE_BRANCH_NODE) {
// 如果在包容节点内,允许创建条件分支
return false return false
} }
// 如果有包容分支,且包容分支在并行分支之后,则允许添加条件分支
// 即:包容分支是并行分支的子节点
if (inclusiveIndex > parallelIndex) {
return false
} }
// 其他情况(在并行分支内且不在包容分支下)不允许添加条件分支
return true return true
}
return false
})) {
return true
}
}
}
// 不在任何并行分支的条件节点内
return false
} }
/** /**