Kaynağa Gözat

fix: 审批 流程图status 渲染

lanceJiang 5 ay önce
ebeveyn
işleme
f3e87e3826

+ 4 - 1
src/components/scWorkflow/index.vue

@@ -472,11 +472,14 @@ $bg_color: #f6f8f9;
 		line-height: 16px;
 	}
 	.auto-judge .title .node-title {
-		color: var(--el-color-success);
 		&.last-child-title {
 			color: #999;
 		}
 	}
+	// 已执行
+	.auto-judge.auto-judge--success .title .node-title {
+		color: var(--el-color-success);
+	}
 	.auto-judge .title .close {
 		font-size: 15px;
 		position: absolute;

+ 15 - 3
src/views/approve/components/config.ts

@@ -3,14 +3,17 @@ type ModelContentConfig = {
 	nodeName: string
 	// 0:发起人 1:审批人 2:抄送人 3:条件审批 4:条件分支 5:办理子流程 6:定时器在务 7:触发器在务 8:并行路由 9:包容路由 10:路由分支
 	type: number
-	local_status?: string // 填充自定义状态
+	// 填充自定义状态 0: 已执行(success) 1:执行中(error) // 默认未执行(info)
+	local_status?: string
 	p_nodeNames?: string[] // 填充自定义状态
 	p_nodeKeys?: string[] // 填充自定义状态
 	childNode: ModelContentConfig | null
 	// lastNode_local_status?: string // 结束标记状态标记
 	conditionNodes?: {
+		nodeKey: string
 		nodeName: string
-		local_status?: string // 填充自定义状态
+		// 填充自定义状态 0: 已执行(success) 1:执行中(error) // 默认未执行(info)
+		local_status?: string
 		conditionList: any[]
 		childNode: ModelContentConfig
 	}[]
@@ -28,7 +31,7 @@ export const package_modelContentConfig = (data: ModelContentConfig, renderNodes
 	/**local_status: 0: 已执行(success) 1:执行中(error) // 默认未执行(info)*/
 	// 通过nodeName 作为唯一值 记录 每个key(nodeName) 对应的childNode 信息
 	const nodeKeyObj: { [nodeKey: string]: ModelContentConfig } = {}
-	const fn = (data: ModelContentConfig, p_nodeKeys = []) => {
+	const fn = (data: ModelContentConfig, p_nodeKeys: string[] = []) => {
 		if (!data) return
 		data.p_nodeKeys = p_nodeKeys
 		// console.log(p_nodeKeys, 'p_nodeKeys')
@@ -105,5 +108,14 @@ export const package_modelContentConfig = (data: ModelContentConfig, renderNodes
 		if (!node.local_status) {
 			node.local_status = 'info'
 		}
+		// 如果是条件节点 进一步判断
+		if (node.conditionNodes && Array.isArray(node.conditionNodes)) {
+			node.conditionNodes.forEach(v => {
+				const local_status = local_status_obj[renderNodes[v.nodeKey]] //  || 'info'
+				if (local_status) {
+					v.local_status = local_status
+				}
+			})
+		}
 	})
 }