@yugu-ui/flow-ui 0.1.23 → 0.1.25

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.
@@ -8,17 +8,22 @@ interface Props {
8
8
  clickable?: boolean;
9
9
  /** 是否显示「编辑」按钮(配置按钮不受影响),默认显示 */
10
10
  showEdit?: boolean;
11
+ /** 是否显示「删除」按钮(默认不显示,仅需要删除入口的页面开启),点击触发 delete 事件 */
12
+ showDelete?: boolean;
11
13
  }
12
14
  declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
+ delete: (item: FlowItem) => any;
13
16
  itemClick: (item: FlowItem) => any;
14
17
  design: (item: FlowItem) => any;
15
18
  }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
19
+ onDelete?: ((item: FlowItem) => any) | undefined;
16
20
  onItemClick?: ((item: FlowItem) => any) | undefined;
17
21
  onDesign?: ((item: FlowItem) => any) | undefined;
18
22
  }>, {
19
23
  showActions: boolean;
20
24
  clickable: boolean;
21
25
  showEdit: boolean;
26
+ showDelete: boolean;
22
27
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
23
28
  declare const _default: typeof __VLS_export;
24
29
  export default _default;
@@ -8,17 +8,22 @@ type __VLS_Props = {
8
8
  clickable?: boolean;
9
9
  /** 是否显示「编辑」按钮(配置按钮不受影响),默认显示 */
10
10
  showEdit?: boolean;
11
+ /** 是否显示「删除」按钮(默认不显示,仅需要删除入口的页面开启) */
12
+ showDelete?: boolean;
11
13
  };
12
14
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
+ delete: (item: FlowItem) => any;
13
16
  itemClick: (item: FlowItem) => any;
14
17
  design: (item: FlowItem) => any;
15
18
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
19
+ onDelete?: ((item: FlowItem) => any) | undefined;
16
20
  onItemClick?: ((item: FlowItem) => any) | undefined;
17
21
  onDesign?: ((item: FlowItem) => any) | undefined;
18
22
  }>, {
19
23
  showActions: boolean;
20
24
  clickable: boolean;
21
25
  showEdit: boolean;
26
+ showDelete: boolean;
22
27
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
23
28
  declare const _default: typeof __VLS_export;
24
29
  export default _default;
@@ -8,17 +8,22 @@ type __VLS_Props = {
8
8
  clickable?: boolean;
9
9
  /** 是否显示「编辑」按钮(配置按钮不受影响),默认显示 */
10
10
  showEdit?: boolean;
11
+ /** 是否显示「删除」按钮(默认不显示,仅需要删除入口的页面开启),点击触发 delete 事件 */
12
+ showDelete?: boolean;
11
13
  };
12
14
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
15
+ delete: (item: FlowItem) => any;
13
16
  itemClick: (item: FlowItem) => any;
14
17
  design: (item: FlowItem) => any;
15
18
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
19
+ onDelete?: ((item: FlowItem) => any) | undefined;
16
20
  onItemClick?: ((item: FlowItem) => any) | undefined;
17
21
  onDesign?: ((item: FlowItem) => any) | undefined;
18
22
  }>, {
19
23
  showActions: boolean;
20
24
  clickable: boolean;
21
25
  showEdit: boolean;
26
+ showDelete: boolean;
22
27
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
23
28
  declare const _default: typeof __VLS_export;
24
29
  export default _default;
package/dist/index.d.ts CHANGED
@@ -3,8 +3,8 @@ export { default as FlowConfigField } from './config/FlowConfigField';
3
3
  export { default as FlowConfigMore } from './config/FlowConfigMore';
4
4
  export { default as FlowNodesPanel } from './timeline/FlowNodesPanel';
5
5
  export { default as FlowActions } from './timeline/FlowActions';
6
- export type { FlowTimelineData, FlowStatusTag, FlowApprovalData, FlowStatusInfo, FlowStatusType } from './timeline/timeline-mapping';
7
- export { FLOW_STATUS_MAP, FLOW_STATUS_OPTIONS, getFlowStatusInfo } from './timeline/timeline-mapping';
6
+ export type { FlowTimelineData, FlowStatusTag, FlowApprovalData } from './timeline/timeline-mapping';
7
+ export { FlowStatus, FLOW_STATUS_LABEL, FLOW_STATUS_OPTIONS, resolveFlowStatus } from './timeline/timeline-mapping';
8
8
  export { default as FlowNode } from './timeline/FlowNode';
9
9
  export { default as FlowAvatar } from './timeline/FlowAvatar';
10
10
  export { default as ApprovalModal } from './timeline/ApprovalModal';
package/dist/index.js CHANGED
@@ -6016,42 +6016,45 @@ function formatTime(value, format = "YYYY-MM-DD HH:mm:ss") {
6016
6016
  }
6017
6017
  //#endregion
6018
6018
  //#region src/timeline/timeline-mapping.ts
6019
- /** 流程状态字典(单一来源,key=接口 status:-1 已驳回 / 0 已撤销 / 1 审批中 / 2 已通过) */
6020
- var FLOW_STATUS_MAP = {
6021
- [-1]: {
6022
- label: "已驳回",
6023
- type: "rejected"
6024
- },
6025
- 0: {
6026
- label: "已撤销",
6027
- type: "cancelled"
6028
- },
6029
- 1: {
6030
- label: "审批中",
6031
- type: "processing"
6032
- },
6033
- 2: {
6034
- label: "已通过",
6035
- type: "success"
6036
- }
6019
+ /** 流程状态枚举(接口 status:-1 已驳回 / 0 已撤销 / 1 审批中 / 2 已通过) */
6020
+ var FlowStatus = /* @__PURE__ */ function(FlowStatus) {
6021
+ FlowStatus[FlowStatus["Rejected"] = -1] = "Rejected";
6022
+ FlowStatus[FlowStatus["Cancelled"] = 0] = "Cancelled";
6023
+ FlowStatus[FlowStatus["Processing"] = 1] = "Processing";
6024
+ FlowStatus[FlowStatus["Approved"] = 2] = "Approved";
6025
+ return FlowStatus;
6026
+ }({});
6027
+ /** 流程状态文案字典(项目侧渲染文案统一取此,标签样式由项目自行决定) */
6028
+ var FLOW_STATUS_LABEL = {
6029
+ [FlowStatus.Rejected]: "已驳回",
6030
+ [FlowStatus.Cancelled]: "已撤销",
6031
+ [FlowStatus.Processing]: "审批中",
6032
+ [FlowStatus.Approved]: "已通过"
6037
6033
  };
6038
6034
  /** 流程状态下拉选项(筛选表单直接用,value 对齐接口 status) */
6039
- var FLOW_STATUS_OPTIONS = Object.entries(FLOW_STATUS_MAP).map(([value, info]) => ({
6040
- label: info.label,
6041
- value: Number(value)
6035
+ var FLOW_STATUS_OPTIONS = Object.keys(FLOW_STATUS_LABEL).map((key) => ({
6036
+ label: FLOW_STATUS_LABEL[Number(key)],
6037
+ value: Number(key)
6042
6038
  }));
6043
6039
  /**
6044
- * 解析流程状态展示信息:
6045
- * - status 明确为 -1/0/2 时直接取字典(已驳回/已撤销/已通过);
6046
- * - status=1 或缺失时结合 finished 判断——已结束按已通过兜底,未结束=审批中;
6040
+ * 解析流程状态枚举(status 与 finished 联合判断):
6041
+ * - status 明确为 -1/0/2 时直接返回(已驳回/已撤销/已通过);
6042
+ * - status=1 或缺失时结合 finished——已结束按已通过兜底,未结束=审批中;
6047
6043
  * - 无数据时默认审批中。
6048
6044
  */
6049
- function getFlowStatusInfo(data) {
6050
- if (!data) return FLOW_STATUS_MAP[1];
6045
+ function resolveFlowStatus(data) {
6046
+ if (!data) return FlowStatus.Processing;
6051
6047
  const status = Number(data.status);
6052
- if (status === -1 || status === 0 || status === 2) return FLOW_STATUS_MAP[status];
6053
- return data.finished === 1 ? FLOW_STATUS_MAP[2] : FLOW_STATUS_MAP[1];
6048
+ if (status === FlowStatus.Rejected || status === FlowStatus.Cancelled || status === FlowStatus.Approved) return status;
6049
+ return data.finished === 1 ? FlowStatus.Approved : FlowStatus.Processing;
6054
6050
  }
6051
+ /** 状态枚举 → NTag 配色(仅 FlowNodesPanel 内部使用) */
6052
+ var FLOW_STATUS_N_TAG_TYPE = {
6053
+ [FlowStatus.Rejected]: "error",
6054
+ [FlowStatus.Cancelled]: "default",
6055
+ [FlowStatus.Processing]: "warning",
6056
+ [FlowStatus.Approved]: "success"
6057
+ };
6055
6058
  /** 固定尾节点:节点有数据时渲染追加(display 下状态按流程是否走完覆盖),接口返回与提交数据均不包含 */
6056
6059
  var END_NODE = {
6057
6060
  type: "end",
@@ -6152,10 +6155,10 @@ function withEndNode(baseNodes, mode) {
6152
6155
  /** 折叠面板标题流程状态标签:仅 display 模式且有详情数据时推导(判断口径见 getFlowStatusInfo);form 发起模式无实例状态不展示,数据未返回前隐藏避免先展示「审批中」再跳变 */
6153
6156
  function getFlowStatusTag(mode, data) {
6154
6157
  if (mode === "form" || !data) return void 0;
6155
- const info = getFlowStatusInfo(data);
6158
+ const status = resolveFlowStatus(data);
6156
6159
  return {
6157
- text: info.label,
6158
- type: info.type
6160
+ text: FLOW_STATUS_LABEL[status],
6161
+ type: FLOW_STATUS_N_TAG_TYPE[status]
6159
6162
  };
6160
6163
  }
6161
6164
  //#endregion
@@ -6191,14 +6194,6 @@ var FlowNodesPanel_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
6191
6194
  if (props.mode === "form") return withEndNode(props.nodes ?? [], "form");
6192
6195
  return withEndNode(props.data ? mapTimelineNodes(props.data) : props.nodes ?? [], "display");
6193
6196
  });
6194
- /** 语义状态 → NTag 配色(仅组件内部渲染适配,业务侧统一用 StatusTag 等宿主状态标签组件) */
6195
- const N_TAG_TYPE_MAP = {
6196
- pending: "warning",
6197
- processing: "info",
6198
- success: "success",
6199
- cancelled: "default",
6200
- rejected: "error"
6201
- };
6202
6197
  /** 折叠面板标题流程状态标签 */
6203
6198
  const panelStatusTag = computed(() => props.data ? getFlowStatusTag(props.mode, props.data) : props.statusTag);
6204
6199
  return (_ctx, _cache) => {
@@ -6216,7 +6211,7 @@ var FlowNodesPanel_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
6216
6211
  default: withCtx(() => [createVNode(_component_NCollapseItem, { name: "flow" }, {
6217
6212
  header: withCtx(() => [createElementVNode("span", _hoisted_1$3, [createTextVNode(toDisplayString(__props.title) + " ", 1), panelStatusTag.value ? (openBlock(), createBlock(_component_NTag, {
6218
6213
  key: 0,
6219
- type: N_TAG_TYPE_MAP[panelStatusTag.value.type],
6214
+ type: panelStatusTag.value.type,
6220
6215
  size: "small"
6221
6216
  }, {
6222
6217
  default: withCtx(() => [createTextVNode(toDisplayString(panelStatusTag.value.text), 1)]),
@@ -6253,7 +6248,7 @@ var FlowNodesPanel_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
6253
6248
  });
6254
6249
  };
6255
6250
  }
6256
- }), [["__scopeId", "data-v-45c00590"]]);
6251
+ }), [["__scopeId", "data-v-25e5146e"]]);
6257
6252
  //#endregion
6258
6253
  //#region src/composables/form.ts
6259
6254
  var invalidLiterals = [
@@ -6665,9 +6660,17 @@ var FlowListItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/*
6665
6660
  showEdit: {
6666
6661
  type: Boolean,
6667
6662
  default: true
6663
+ },
6664
+ showDelete: {
6665
+ type: Boolean,
6666
+ default: false
6668
6667
  }
6669
6668
  },
6670
- emits: ["itemClick", "design"],
6669
+ emits: [
6670
+ "itemClick",
6671
+ "design",
6672
+ "delete"
6673
+ ],
6671
6674
  setup(__props, { emit: __emit }) {
6672
6675
  const props = __props;
6673
6676
  const emit = __emit;
@@ -6685,7 +6688,7 @@ var FlowListItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/*
6685
6688
  const _component_NButton = NButton;
6686
6689
  return openBlock(), createElementBlock("div", {
6687
6690
  class: normalizeClass(["flow-item", { "flow-item--clickable": __props.clickable }]),
6688
- onClick: _cache[3] || (_cache[3] = ($event) => __props.clickable && emit("itemClick", __props.item))
6691
+ onClick: _cache[4] || (_cache[4] = ($event) => __props.clickable && emit("itemClick", __props.item))
6689
6692
  }, [
6690
6693
  createVNode(_component_NAvatar, {
6691
6694
  class: "flow-item__avatar",
@@ -6703,30 +6706,44 @@ var FlowListItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/*
6703
6706
  class: "flow-item__label",
6704
6707
  title: __props.item.name
6705
6708
  }, toDisplayString(__props.item.name), 9, _hoisted_3$1),
6706
- __props.showActions ? (openBlock(), createElementBlock("div", _hoisted_4$1, [__props.showEdit ? (openBlock(), createBlock(_component_NButton, {
6707
- key: 0,
6708
- class: "flow-item__btn",
6709
- size: "small",
6710
- quaternary: "",
6711
- type: "primary",
6712
- onClick: _cache[1] || (_cache[1] = ($event) => emit("itemClick", __props.item))
6713
- }, {
6714
- default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode(" 编辑 ", -1)])]),
6715
- _: 1
6716
- })) : createCommentVNode("", true), createVNode(_component_NButton, {
6717
- class: "flow-item__btn",
6718
- size: "small",
6719
- secondary: "",
6720
- type: "primary",
6721
- onClick: _cache[2] || (_cache[2] = ($event) => emit("design", __props.item))
6722
- }, {
6723
- default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode("配置", -1)])]),
6724
- _: 1
6725
- })])) : createCommentVNode("", true)
6709
+ __props.showActions ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
6710
+ __props.showEdit ? (openBlock(), createBlock(_component_NButton, {
6711
+ key: 0,
6712
+ class: "flow-item__btn",
6713
+ size: "small",
6714
+ quaternary: "",
6715
+ type: "primary",
6716
+ onClick: _cache[1] || (_cache[1] = ($event) => emit("itemClick", __props.item))
6717
+ }, {
6718
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode(" 编辑 ", -1)])]),
6719
+ _: 1
6720
+ })) : createCommentVNode("", true),
6721
+ __props.showDelete ? (openBlock(), createBlock(_component_NButton, {
6722
+ key: 1,
6723
+ class: "flow-item__btn",
6724
+ size: "small",
6725
+ quaternary: "",
6726
+ type: "error",
6727
+ onClick: _cache[2] || (_cache[2] = ($event) => emit("delete", __props.item))
6728
+ }, {
6729
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode(" 删除 ", -1)])]),
6730
+ _: 1
6731
+ })) : createCommentVNode("", true),
6732
+ createVNode(_component_NButton, {
6733
+ class: "flow-item__btn",
6734
+ size: "small",
6735
+ secondary: "",
6736
+ type: "primary",
6737
+ onClick: _cache[3] || (_cache[3] = ($event) => emit("design", __props.item))
6738
+ }, {
6739
+ default: withCtx(() => [..._cache[7] || (_cache[7] = [createTextVNode("配置", -1)])]),
6740
+ _: 1
6741
+ })
6742
+ ])) : createCommentVNode("", true)
6726
6743
  ], 2);
6727
6744
  };
6728
6745
  }
6729
- }), [["__scopeId", "data-v-315b70f6"]]);
6746
+ }), [["__scopeId", "data-v-0c9de524"]]);
6730
6747
  //#endregion
6731
6748
  //#region src/flow-list/modules/FlowListGroup.vue?vue&type=script&setup=true&lang.ts
6732
6749
  var _hoisted_1 = { class: "flow-group" };
@@ -6758,9 +6775,17 @@ var FlowListGroup_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/*
6758
6775
  showEdit: {
6759
6776
  type: Boolean,
6760
6777
  default: true
6778
+ },
6779
+ showDelete: {
6780
+ type: Boolean,
6781
+ default: false
6761
6782
  }
6762
6783
  },
6763
- emits: ["itemClick", "design"],
6784
+ emits: [
6785
+ "itemClick",
6786
+ "design",
6787
+ "delete"
6788
+ ],
6764
6789
  setup(__props, { emit: __emit }) {
6765
6790
  const emit = __emit;
6766
6791
  return (_ctx, _cache) => {
@@ -6778,7 +6803,7 @@ var FlowListGroup_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/*
6778
6803
  "aria-hidden": "true",
6779
6804
  viewBox: "0 0 512 512",
6780
6805
  class: normalizeClass(["flow-group__chevron", { "flow-group__chevron--collapsed": collapsed }])
6781
- }, [..._cache[2] || (_cache[2] = [createElementVNode("path", {
6806
+ }, [..._cache[3] || (_cache[3] = [createElementVNode("path", {
6782
6807
  fill: "none",
6783
6808
  stroke: "currentColor",
6784
6809
  "stroke-linecap": "square",
@@ -6793,13 +6818,16 @@ var FlowListGroup_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/*
6793
6818
  "show-actions": __props.showActions,
6794
6819
  clickable: __props.clickable,
6795
6820
  "show-edit": __props.showEdit,
6821
+ "show-delete": __props.showDelete,
6796
6822
  onItemClick: _cache[0] || (_cache[0] = ($event) => emit("itemClick", $event)),
6797
- onDesign: _cache[1] || (_cache[1] = ($event) => emit("design", $event))
6823
+ onDesign: _cache[1] || (_cache[1] = ($event) => emit("design", $event)),
6824
+ onDelete: _cache[2] || (_cache[2] = ($event) => emit("delete", $event))
6798
6825
  }, null, 8, [
6799
6826
  "item",
6800
6827
  "show-actions",
6801
6828
  "clickable",
6802
- "show-edit"
6829
+ "show-edit",
6830
+ "show-delete"
6803
6831
  ]);
6804
6832
  }), 128))])) : (openBlock(), createElementBlock("div", _hoisted_5, [createVNode(_component_NEmpty, {
6805
6833
  size: "small",
@@ -6811,7 +6839,7 @@ var FlowListGroup_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/*
6811
6839
  }, 8, ["default-expanded-names"])]);
6812
6840
  };
6813
6841
  }
6814
- }), [["__scopeId", "data-v-4bf10196"]]);
6842
+ }), [["__scopeId", "data-v-0587937e"]]);
6815
6843
  //#endregion
6816
6844
  //#region src/flow-list/index.vue
6817
6845
  var flow_list_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -6830,9 +6858,17 @@ var flow_list_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__
6830
6858
  showEdit: {
6831
6859
  type: Boolean,
6832
6860
  default: true
6861
+ },
6862
+ showDelete: {
6863
+ type: Boolean,
6864
+ default: false
6833
6865
  }
6834
6866
  },
6835
- emits: ["itemClick", "design"],
6867
+ emits: [
6868
+ "itemClick",
6869
+ "design",
6870
+ "delete"
6871
+ ],
6836
6872
  setup(__props, { emit: __emit }) {
6837
6873
  const emit = __emit;
6838
6874
  const themeVars = useThemeVars();
@@ -6857,17 +6893,20 @@ var flow_list_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__
6857
6893
  "show-actions": __props.showActions,
6858
6894
  clickable: __props.clickable,
6859
6895
  "show-edit": __props.showEdit,
6896
+ "show-delete": __props.showDelete,
6860
6897
  onItemClick: _cache[0] || (_cache[0] = (item) => emit("itemClick", item)),
6861
- onDesign: _cache[1] || (_cache[1] = (item) => emit("design", item))
6898
+ onDesign: _cache[1] || (_cache[1] = (item) => emit("design", item)),
6899
+ onDelete: _cache[2] || (_cache[2] = (item) => emit("delete", item))
6862
6900
  }, null, 8, [
6863
6901
  "group",
6864
6902
  "show-actions",
6865
6903
  "clickable",
6866
- "show-edit"
6904
+ "show-edit",
6905
+ "show-delete"
6867
6906
  ]);
6868
6907
  }), 128))], 4);
6869
6908
  };
6870
6909
  }
6871
- }), [["__scopeId", "data-v-56ed3cd3"]]);
6910
+ }), [["__scopeId", "data-v-f35421fd"]]);
6872
6911
  //#endregion
6873
- export { ApprovalModal_default as ApprovalModal, FLOW_STATUS_MAP, FLOW_STATUS_OPTIONS, FLOW_UI_KEY, FlowActions_default as FlowActions, FlowAvatar_default as FlowAvatar, FlowConfig_default as FlowConfig, FlowConfigField_default as FlowConfigField, FlowConfigMore_default as FlowConfigMore, flow_list_default as FlowList, FlowNode_default as FlowNode, FlowNodesPanel_default as FlowNodesPanel, person_selector_default as PersonSelector, createFlowUI, fetchGetWflowConfigDetail, fetchGetWflowFlowNodes, fetchLaunchWflowFlow, fetchWflowUndoApprove, fetchWflowUndoReject, getFlowStatusInfo, getRemoteOptions, isRemoteField, useFlowUI };
6912
+ export { ApprovalModal_default as ApprovalModal, FLOW_STATUS_LABEL, FLOW_STATUS_OPTIONS, FLOW_UI_KEY, FlowActions_default as FlowActions, FlowAvatar_default as FlowAvatar, FlowConfig_default as FlowConfig, FlowConfigField_default as FlowConfigField, FlowConfigMore_default as FlowConfigMore, flow_list_default as FlowList, FlowNode_default as FlowNode, FlowNodesPanel_default as FlowNodesPanel, FlowStatus, person_selector_default as PersonSelector, createFlowUI, fetchGetWflowConfigDetail, fetchGetWflowFlowNodes, fetchLaunchWflowFlow, fetchWflowUndoApprove, fetchWflowUndoReject, getRemoteOptions, isRemoteField, resolveFlowStatus, useFlowUI };
package/dist/style.css CHANGED
@@ -2262,39 +2262,39 @@ to {
2262
2262
  }
2263
2263
 
2264
2264
  /* Developed collaboratively with vscode - 改动代码行数: 31行(折叠面板样式自 FlowLayout.vue 迁入:单个折叠项间距/标题行布局/标题字号与底边框/内容区留白) */
2265
- .flow-node[data-v-45c00590] {
2265
+ .flow-node[data-v-25e5146e] {
2266
2266
  /* 单个折叠项:去掉默认上外边距,上下间距统一由 header 内边距控制 */
2267
2267
  }
2268
- .flow-node[data-v-45c00590] .n-collapse-item {
2268
+ .flow-node[data-v-25e5146e] .n-collapse-item {
2269
2269
  margin: 0;
2270
2270
  }
2271
- .flow-node[data-v-45c00590] {
2271
+ .flow-node[data-v-25e5146e] {
2272
2272
  /* 标题行:文字左对齐、箭头右对齐;左右留白放在 header-main 上,保证 header 底边框顶满两侧 */
2273
2273
  }
2274
- .flow-node[data-v-45c00590] .n-collapse-item__header-main {
2274
+ .flow-node[data-v-25e5146e] .n-collapse-item__header-main {
2275
2275
  justify-content: space-between;
2276
2276
  padding: 0 16px;
2277
2277
  }
2278
- .flow-node[data-v-45c00590] {
2278
+ .flow-node[data-v-25e5146e] {
2279
2279
  /* 标题插槽包装:标题文案与状态标签横向排列、垂直居中;自身为 header-main 单一 flex 项,不参与 space-between 分离 */
2280
2280
  }
2281
- .flow-node .flow-node__title[data-v-45c00590] {
2281
+ .flow-node .flow-node__title[data-v-25e5146e] {
2282
2282
  display: inline-flex;
2283
2283
  align-items: center;
2284
2284
  gap: 8px;
2285
2285
  }
2286
- .flow-node[data-v-45c00590] {
2286
+ .flow-node[data-v-25e5146e] {
2287
2287
  /* 标题字号增大,上下等距内边距 + 底部分隔边框;用 first-child 提高优先级,覆盖 naive-ui 对首个折叠项 header 强制的 padding-top: 0 */
2288
2288
  }
2289
- .flow-node[data-v-45c00590] .n-collapse-item:first-child > .n-collapse-item__header {
2289
+ .flow-node[data-v-25e5146e] .n-collapse-item:first-child > .n-collapse-item__header {
2290
2290
  padding: 16px 0;
2291
2291
  font-size: 16px;
2292
2292
  border-bottom: 1px solid var(--n-divider-color, rgba(0, 0, 0, 0.09));
2293
2293
  }
2294
- .flow-node[data-v-45c00590] {
2294
+ .flow-node[data-v-25e5146e] {
2295
2295
  /* 内容区留白与标题行对齐 */
2296
2296
  }
2297
- .flow-node[data-v-45c00590] .n-collapse-item__content-wrapper {
2297
+ .flow-node[data-v-25e5146e] .n-collapse-item__content-wrapper {
2298
2298
  padding: 0 16px 16px;
2299
2299
  }
2300
2300
  /* Developed collaboratively with vscode - 改动代码行数: 3行 */
@@ -2302,7 +2302,7 @@ to {
2302
2302
  width: 100%;
2303
2303
  }
2304
2304
 
2305
- .flow-item[data-v-315b70f6] {
2305
+ .flow-item[data-v-0c9de524] {
2306
2306
  display: flex;
2307
2307
  align-items: center;
2308
2308
  gap: 12px;
@@ -2316,32 +2316,32 @@ to {
2316
2316
  user-select: none;
2317
2317
  transition: transform 0.2s ease, box-shadow 0.2s ease;
2318
2318
  }
2319
- .flow-item[data-v-315b70f6]:hover {
2319
+ .flow-item[data-v-0c9de524]:hover {
2320
2320
  transform: translateY(-2px);
2321
2321
  /* Developed collaboratively with vscode - 改动代码行数: 1行(阴影色改用全局文本色变量) */
2322
2322
  box-shadow: rgb(var(--base-text-color)/0.25) 0 12px 28px;
2323
2323
  }
2324
- .flow-item[data-v-315b70f6]:active {
2324
+ .flow-item[data-v-0c9de524]:active {
2325
2325
  transform: translateY(0);
2326
2326
  /* Developed collaboratively with vscode - 改动代码行数: 1行(阴影色改用全局文本色变量) */
2327
2327
  box-shadow: rgb(var(--base-text-color)/0.15) 0 4px 12px;
2328
2328
  transition-duration: 0.08s;
2329
2329
  }
2330
- .flow-item[data-v-315b70f6] {
2330
+ .flow-item[data-v-0c9de524] {
2331
2331
  /* Developed collaboratively with vscode - 改动代码行数: 1行(clickable 卡片:pointer 光标明示可点击,hover 上浮动效沿用通用样式) */
2332
2332
  }
2333
- .flow-item--clickable[data-v-315b70f6] {
2333
+ .flow-item--clickable[data-v-0c9de524] {
2334
2334
  cursor: pointer;
2335
2335
  }
2336
- .flow-item__avatar[data-v-315b70f6] {
2336
+ .flow-item__avatar[data-v-0c9de524] {
2337
2337
  flex-shrink: 0;
2338
2338
  }
2339
- .flow-item__avatar-text[data-v-315b70f6] {
2339
+ .flow-item__avatar-text[data-v-0c9de524] {
2340
2340
  font-size: 15px;
2341
2341
  font-weight: 600;
2342
2342
  color: var(--fl-primary);
2343
2343
  }
2344
- .flow-item__label[data-v-315b70f6] {
2344
+ .flow-item__label[data-v-0c9de524] {
2345
2345
  display: -webkit-box;
2346
2346
  flex-grow: 1;
2347
2347
  /* Developed collaboratively with vscode - 改动代码行数: 3行(中英混排按字符接排换行:不整体掉词填满行宽,防止收缩被内容撑破) */
@@ -2355,54 +2355,54 @@ to {
2355
2355
  -webkit-box-orient: vertical;
2356
2356
  -webkit-line-clamp: 2;
2357
2357
  }
2358
- .flow-item__actions[data-v-315b70f6] {
2358
+ .flow-item__actions[data-v-0c9de524] {
2359
2359
  display: flex;
2360
2360
  flex-shrink: 0;
2361
2361
  gap: 6px;
2362
2362
  }
2363
- .flow-group[data-v-4bf10196] {
2363
+ .flow-group[data-v-0587937e] {
2364
2364
  padding: 0 20px;
2365
2365
  background: var(--fl-card-color);
2366
2366
  border: 1px solid var(--fl-border-color);
2367
2367
  border-radius: 12px;
2368
2368
  /* Developed collaboratively with vscode - 改动代码行数: 20行(面板头修复:负 margin 让分隔线通到卡片两端、仅展开时显示;补回首项 padding-top;锁定箭头容器旋转,方向由自定义 chevron 控制) */
2369
2369
  }
2370
- .flow-group[data-v-4bf10196] .n-collapse-item__header {
2370
+ .flow-group[data-v-0587937e] .n-collapse-item__header {
2371
2371
  padding: 16px 20px 12px;
2372
2372
  margin: 0 -20px;
2373
2373
  border-bottom: 1px solid transparent;
2374
2374
  }
2375
- .flow-group[data-v-4bf10196] .n-collapse-item--active .n-collapse-item__header {
2375
+ .flow-group[data-v-0587937e] .n-collapse-item--active .n-collapse-item__header {
2376
2376
  border-bottom-color: var(--fl-divider-color);
2377
2377
  }
2378
- .flow-group[data-v-4bf10196] .n-collapse-item:first-child > .n-collapse-item__header {
2378
+ .flow-group[data-v-0587937e] .n-collapse-item:first-child > .n-collapse-item__header {
2379
2379
  padding-top: 16px;
2380
2380
  }
2381
- .flow-group[data-v-4bf10196] .n-collapse-item__content-inner {
2381
+ .flow-group[data-v-0587937e] .n-collapse-item__content-inner {
2382
2382
  padding: 16px 0 20px;
2383
2383
  }
2384
- .flow-group[data-v-4bf10196] {
2384
+ .flow-group[data-v-0587937e] {
2385
2385
  /* Developed collaboratively with vscode - 改动代码行数: 11行(header-main 设 flex;箭头 margin-left:auto 提权,压过 naive 运行时注入的 4px 间距,推到最右侧) */
2386
2386
  }
2387
- .flow-group[data-v-4bf10196] .n-collapse-item__header-main {
2387
+ .flow-group[data-v-0587937e] .n-collapse-item__header-main {
2388
2388
  display: flex;
2389
2389
  align-items: center;
2390
2390
  }
2391
- .flow-group[data-v-4bf10196] .n-collapse-item__header-main .n-collapse-item-arrow {
2391
+ .flow-group[data-v-0587937e] .n-collapse-item__header-main .n-collapse-item-arrow {
2392
2392
  margin-left: auto !important;
2393
2393
  transform: none !important;
2394
2394
  }
2395
- .flow-group__title[data-v-4bf10196] {
2395
+ .flow-group__title[data-v-0587937e] {
2396
2396
  font-size: 17px;
2397
2397
  font-weight: 600;
2398
2398
  color: var(--fl-text-1);
2399
2399
  letter-spacing: 0.2px;
2400
2400
  transition: color 0.2s ease;
2401
2401
  }
2402
- .flow-group[data-v-4bf10196] {
2402
+ .flow-group[data-v-0587937e] {
2403
2403
  /* Developed collaboratively with vscode - 改动代码行数: 4行(数量徽标改胶囊形,紧跟标题同侧排列) */
2404
2404
  }
2405
- .flow-group__count[data-v-4bf10196] {
2405
+ .flow-group__count[data-v-0587937e] {
2406
2406
  display: flex;
2407
2407
  align-items: center;
2408
2408
  height: 20px;
@@ -2416,53 +2416,53 @@ to {
2416
2416
  border-radius: 999px;
2417
2417
  background: color-mix(in srgb, var(--fl-primary) 12%, transparent);
2418
2418
  }
2419
- .flow-group[data-v-4bf10196] {
2419
+ .flow-group[data-v-0587937e] {
2420
2420
  /* Developed collaboratively with vscode - 改动代码行数: 15行(自定义箭头+旋转动画;头部悬停时标题/箭头高亮主题色) */
2421
2421
  }
2422
- .flow-group__chevron[data-v-4bf10196] {
2422
+ .flow-group__chevron[data-v-0587937e] {
2423
2423
  width: 16px;
2424
2424
  height: 16px;
2425
2425
  color: var(--fl-text-3);
2426
2426
  transition: transform 0.2s ease;
2427
2427
  transform: rotate(-180deg);
2428
2428
  }
2429
- .flow-group__chevron--collapsed[data-v-4bf10196] {
2429
+ .flow-group__chevron--collapsed[data-v-0587937e] {
2430
2430
  transform: rotate(0deg);
2431
2431
  }
2432
- [data-v-4bf10196] .n-collapse-item__header:hover .flow-group__title,[data-v-4bf10196] .n-collapse-item__header:hover .flow-group__chevron {
2432
+ [data-v-0587937e] .n-collapse-item__header:hover .flow-group__title,[data-v-0587937e] .n-collapse-item__header:hover .flow-group__chevron {
2433
2433
  color: var(--fl-primary);
2434
2434
  }
2435
- .flow-group__grid[data-v-4bf10196] {
2435
+ .flow-group__grid[data-v-0587937e] {
2436
2436
  display: grid;
2437
2437
  grid-template-columns: repeat(1, 1fr);
2438
2438
  gap: 12px;
2439
2439
  }
2440
2440
  @media (min-width: 576px) {
2441
- .flow-group__grid[data-v-4bf10196] {
2441
+ .flow-group__grid[data-v-0587937e] {
2442
2442
  grid-template-columns: repeat(2, 1fr);
2443
2443
  }
2444
2444
  }
2445
2445
  @media (min-width: 992px) {
2446
- .flow-group__grid[data-v-4bf10196] {
2446
+ .flow-group__grid[data-v-0587937e] {
2447
2447
  grid-template-columns: repeat(3, 1fr);
2448
2448
  }
2449
2449
  }
2450
2450
  @media (min-width: 1200px) {
2451
- .flow-group__grid[data-v-4bf10196] {
2451
+ .flow-group__grid[data-v-0587937e] {
2452
2452
  grid-template-columns: repeat(4, 1fr);
2453
2453
  }
2454
2454
  }
2455
2455
  @media (min-width: 1600px) {
2456
- .flow-group__grid[data-v-4bf10196] {
2456
+ .flow-group__grid[data-v-0587937e] {
2457
2457
  grid-template-columns: repeat(5, 1fr);
2458
2458
  }
2459
2459
  }
2460
- .flow-group[data-v-4bf10196] {
2460
+ .flow-group[data-v-0587937e] {
2461
2461
  /* Developed collaboratively with vscode - 改动代码行数: 3行(空态样式:仅保留上下留白,无外框) */
2462
2462
  }
2463
- .flow-group__empty[data-v-4bf10196] {
2463
+ .flow-group__empty[data-v-0587937e] {
2464
2464
  padding: 8px 0;
2465
- }.flow-list[data-v-56ed3cd3] {
2465
+ }.flow-list[data-v-f35421fd] {
2466
2466
  display: flex;
2467
2467
  flex-direction: column;
2468
2468
  gap: 20px;
@@ -4,35 +4,35 @@ 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
- /** 流程状态语义类型(对齐全系统 UI「列表枚举值标签样式规范」的 5 类语义:待处理/进行中/成功/取消/拒绝) */
8
- export type FlowStatusType = 'pending' | 'processing' | 'success' | 'cancelled' | 'rejected';
9
- /** 流程状态展示信息:文案 + 语义类型(宿主状态标签组件按语义类型统一配色) */
10
- export interface FlowStatusInfo {
11
- label: string;
12
- type: FlowStatusType;
13
- }
14
- /** 流程状态标签(getFlowStatusTag 返回):颜色由语义类型决定,审批中=processing / 已通过=success / 已驳回=rejected / 已撤销=cancelled */
15
- export interface FlowStatusTag {
16
- text: string;
17
- type: FlowStatusType;
7
+ /** 流程状态枚举(接口 status:-1 已驳回 / 0 已撤销 / 1 审批中 / 2 已通过) */
8
+ export declare enum FlowStatus {
9
+ Rejected = -1,
10
+ Cancelled = 0,
11
+ Processing = 1,
12
+ Approved = 2
18
13
  }
19
- /** 流程状态字典(单一来源,key=接口 status:-1 已驳回 / 0 已撤销 / 1 审批中 / 2 已通过) */
20
- export declare const FLOW_STATUS_MAP: Record<number, FlowStatusInfo>;
14
+ /** 流程状态文案字典(项目侧渲染文案统一取此,标签样式由项目自行决定) */
15
+ export declare const FLOW_STATUS_LABEL: Record<FlowStatus, string>;
21
16
  /** 流程状态下拉选项(筛选表单直接用,value 对齐接口 status) */
22
17
  export declare const FLOW_STATUS_OPTIONS: {
23
18
  label: string;
24
19
  value: number;
25
20
  }[];
26
21
  /**
27
- * 解析流程状态展示信息:
28
- * - status 明确为 -1/0/2 时直接取字典(已驳回/已撤销/已通过);
29
- * - status=1 或缺失时结合 finished 判断——已结束按已通过兜底,未结束=审批中;
22
+ * 解析流程状态枚举(status 与 finished 联合判断):
23
+ * - status 明确为 -1/0/2 时直接返回(已驳回/已撤销/已通过);
24
+ * - status=1 或缺失时结合 finished——已结束按已通过兜底,未结束=审批中;
30
25
  * - 无数据时默认审批中。
31
26
  */
32
- export declare function getFlowStatusInfo(data?: {
27
+ export declare function resolveFlowStatus(data?: {
33
28
  status?: number;
34
29
  finished?: number;
35
- }): FlowStatusInfo;
30
+ }): FlowStatus;
31
+ /** 节点面板标题状态标签(组件内部渲染用):仅文案 + NTag 配色,非业务状态枚举 */
32
+ export interface FlowStatusTag {
33
+ text: string;
34
+ type: 'success' | 'error' | 'warning' | 'default';
35
+ }
36
36
  /** 固定尾节点:节点有数据时渲染追加(display 下状态按流程是否走完覆盖),接口返回与提交数据均不包含 */
37
37
  export declare const END_NODE: FlowNodeItem;
38
38
  /** 人员处理记录映射:一行 records 对应一条展示记录(finished=0 未完成行过滤)——result 优先:result=2 同意;result=3 或 is_reject=1 驳回行按记录操作人判定方向(record.user_id=挂载人员 id 主动驳回「驳回到 rejecters.name」、否则被驳回「被 user_name 驳回」、名字均缺且 flowRejected=true 展示「驳回到 发起人」、否则「驳回」);result=0 不展示 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yugu-ui/flow-ui",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "堉古商城流程组件库:流程设计器(config)/ 审批时间线(timeline)/ 流程列表(FlowList)",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",