@yugu-ui/flow-ui 0.1.20 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +16 -9
- package/dist/timeline/timeline-mapping.d.ts +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6113,18 +6113,25 @@ function withEndNode(baseNodes, mode) {
|
|
|
6113
6113
|
status: allDone ? "done" : "pending"
|
|
6114
6114
|
}];
|
|
6115
6115
|
}
|
|
6116
|
-
/** 折叠面板标题流程状态标签:仅 display 模式且有详情数据时推导——finished=1 且 status=-1
|
|
6116
|
+
/** 折叠面板标题流程状态标签:仅 display 模式且有详情数据时推导——finished=1 且 status=-1 已驳回(驳回到发起人终止)、finished=1 且 status=0 已撤销、finished=1 已通过、未结束审批中;form 发起模式无实例状态不展示,数据未返回前隐藏避免先展示「审批中」再跳变 */
|
|
6117
6117
|
function getFlowStatusTag(mode, data) {
|
|
6118
6118
|
if (mode === "form" || !data) return void 0;
|
|
6119
|
-
if (data.finished === 1)
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6119
|
+
if (data.finished === 1) {
|
|
6120
|
+
if (data.status === -1) return {
|
|
6121
|
+
text: "已驳回",
|
|
6122
|
+
type: "error"
|
|
6123
|
+
};
|
|
6124
|
+
if (data.status === 0) return {
|
|
6125
|
+
text: "已撤销",
|
|
6126
|
+
type: "default"
|
|
6127
|
+
};
|
|
6128
|
+
return {
|
|
6129
|
+
text: "已通过",
|
|
6130
|
+
type: "success"
|
|
6131
|
+
};
|
|
6132
|
+
}
|
|
6126
6133
|
return {
|
|
6127
|
-
text: "
|
|
6134
|
+
text: "审批中",
|
|
6128
6135
|
type: "warning"
|
|
6129
6136
|
};
|
|
6130
6137
|
}
|
|
@@ -4,10 +4,10 @@ import { WflowTodoDetail, WflowTodoRecord } from '../adapter/wflow';
|
|
|
4
4
|
export type FlowTimelineData = Pick<WflowTodoDetail, 'nodes' | 'finished' | 'status'>;
|
|
5
5
|
/** FlowActions 审批操作数据:FlowTimelineData 基础上补充 undo_id(同意/驳回接口入参)与 undo_finished(操作按钮显隐)——待办详情接口整份数据可直接传入 */
|
|
6
6
|
export type FlowApprovalData = FlowTimelineData & Pick<WflowTodoDetail, 'undo_id' | 'undo_finished'>;
|
|
7
|
-
/** 流程状态标签(getFlowStatusTag 返回):颜色映射
|
|
7
|
+
/** 流程状态标签(getFlowStatusTag 返回):颜色映射 已通过=success / 已驳回=error / 已撤销=default / 审批中=warning */
|
|
8
8
|
export interface FlowStatusTag {
|
|
9
9
|
text: string;
|
|
10
|
-
type: 'success' | 'error' | 'warning';
|
|
10
|
+
type: 'success' | 'error' | 'warning' | 'default';
|
|
11
11
|
}
|
|
12
12
|
/** 固定尾节点:节点有数据时渲染追加(display 下状态按流程是否走完覆盖),接口返回与提交数据均不包含 */
|
|
13
13
|
export declare const END_NODE: FlowNodeItem;
|
|
@@ -22,5 +22,5 @@ export declare function isLatestRowsReject(rows: WflowTodoRecord[]): boolean;
|
|
|
22
22
|
export declare function mapTimelineNodes(data?: FlowTimelineData): FlowNodeItem[];
|
|
23
23
|
/** 组装完整节点链:有数据统一追加 END 结束节点,无数据为空数组走空态;display(非 form)流程全部完成时 END 状态同步 done;末节点已是 end(后端快照自带 end、或调用方传入已组装过 END 的节点链,如 FlowLayout → FlowNodesPanel)时幂等跳过,防止结束节点重复渲染 */
|
|
24
24
|
export declare function withEndNode(baseNodes: FlowNodeItem[], mode?: 'display' | 'form'): FlowNodeItem[];
|
|
25
|
-
/** 折叠面板标题流程状态标签:仅 display 模式且有详情数据时推导——finished=1 且 status=-1
|
|
25
|
+
/** 折叠面板标题流程状态标签:仅 display 模式且有详情数据时推导——finished=1 且 status=-1 已驳回(驳回到发起人终止)、finished=1 且 status=0 已撤销、finished=1 已通过、未结束审批中;form 发起模式无实例状态不展示,数据未返回前隐藏避免先展示「审批中」再跳变 */
|
|
26
26
|
export declare function getFlowStatusTag(mode: 'display' | 'form' | undefined, data?: FlowTimelineData): FlowStatusTag | undefined;
|