@yugu-ui/flow-ui 0.1.4 → 0.1.6
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 +15 -10
- package/dist/timeline/FlowLayout.d.ts +8 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -6516,9 +6516,13 @@ var FlowLayout_default = /* @__PURE__ */ defineComponent({
|
|
|
6516
6516
|
loading: { type: Boolean },
|
|
6517
6517
|
flowId: {},
|
|
6518
6518
|
mode: {},
|
|
6519
|
-
beforeSubmit: {
|
|
6520
|
-
getFormData: {
|
|
6521
|
-
timelineData: {}
|
|
6519
|
+
beforeSubmit: {},
|
|
6520
|
+
getFormData: {},
|
|
6521
|
+
timelineData: {},
|
|
6522
|
+
approval: {
|
|
6523
|
+
type: Boolean,
|
|
6524
|
+
default: true
|
|
6525
|
+
}
|
|
6522
6526
|
},
|
|
6523
6527
|
emits: [
|
|
6524
6528
|
"success",
|
|
@@ -6530,10 +6534,10 @@ var FlowLayout_default = /* @__PURE__ */ defineComponent({
|
|
|
6530
6534
|
const emit = __emit;
|
|
6531
6535
|
/** 页面加载状态(透传给 BaseCard,控制内容区 loading 遮罩);flowId=流程 ID(display 模式传流程实例 ID 仅作标识,同意/驳回接口入参为详情返回的 undo_id;form 模式作为提交数据 flow_id) */
|
|
6532
6536
|
const props = __props;
|
|
6533
|
-
/** 是否展示操作按钮:form 模式恒展示;display
|
|
6534
|
-
const canOperate = computed(() => props.mode === "form" || props.timelineData?.undo_finished === 0);
|
|
6535
|
-
/** 是否展示驳回操作:仅 display
|
|
6536
|
-
const canReject = computed(() => props.mode !== "form" && props.timelineData?.undo_finished === 0);
|
|
6537
|
+
/** 是否展示操作按钮:form 模式恒展示;display 模式审批模式且 undo_finished=0(未处理)才展示,详情未加载/已处理/纯查看均隐藏 */
|
|
6538
|
+
const canOperate = computed(() => props.mode === "form" || props.approval !== false && props.timelineData?.undo_finished === 0);
|
|
6539
|
+
/** 是否展示驳回操作:仅 display 模式审批模式(approval 未传或 true)且 undo_finished=0(未处理);form 发起模式/纯查看无驳回 */
|
|
6540
|
+
const canReject = computed(() => props.mode !== "form" && props.approval !== false && props.timelineData?.undo_finished === 0);
|
|
6537
6541
|
/** 折叠面板标题流程状态标签:仅 display 模式展示,颜色映射 已同意=success / 已拒绝=error / 进行中=warning */
|
|
6538
6542
|
const flowStatusTag = computed(() => getFlowStatusTag(props.mode, props.timelineData));
|
|
6539
6543
|
/** 关闭:通知消费页(display=关闭详情页,form=取消发起);页签关闭逻辑由消费页承担 */
|
|
@@ -6735,15 +6739,16 @@ var FlowLayout_default = /* @__PURE__ */ defineComponent({
|
|
|
6735
6739
|
])) : createCommentVNode("", true)
|
|
6736
6740
|
]),
|
|
6737
6741
|
_: 2
|
|
6738
|
-
}, [canReject.value ? {
|
|
6742
|
+
}, [canReject.value || _ctx.$slots["footer-center"] ? {
|
|
6739
6743
|
name: "footer-center",
|
|
6740
|
-
fn: withCtx(() => [
|
|
6744
|
+
fn: withCtx(() => [canReject.value ? (openBlock(), createBlock(_component_NButton, {
|
|
6745
|
+
key: 0,
|
|
6741
6746
|
type: "error",
|
|
6742
6747
|
onClick: handleReject
|
|
6743
6748
|
}, {
|
|
6744
6749
|
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode("驳回", -1)])]),
|
|
6745
6750
|
_: 1
|
|
6746
|
-
})]),
|
|
6751
|
+
})) : createCommentVNode("", true), renderSlot(_ctx.$slots, "footer-center")]),
|
|
6747
6752
|
key: "0"
|
|
6748
6753
|
} : void 0]), 1032, ["loading", "confirm-config"]);
|
|
6749
6754
|
};
|
|
@@ -11,14 +11,18 @@ type __VLS_Props = {
|
|
|
11
11
|
getFormData?: () => Record<string, unknown>;
|
|
12
12
|
/** display 模式原始数据:流程实例详情(节点快照自带任务状态与每人处理结果 + status/finished 实例状态 + undo_id 待办审批记录 ID + undo_finished 处理状态),组件内部映射为审批时间线并对接同意/驳回接口,页面无需转换;nodes 为空时节点区展示空态提示 */
|
|
13
13
|
timelineData?: Pick<WflowTodoDetail, 'nodes' | 'finished' | 'status' | 'undo_id' | 'undo_finished'>;
|
|
14
|
+
/** 是否审批处理模式(仅 display 模式生效,默认 true):按 undo_finished 判断展示同意/驳回;false=纯查看,仅展示流程节点与关闭按钮 */
|
|
15
|
+
approval?: boolean;
|
|
14
16
|
};
|
|
15
17
|
/** 条件字段是否全部填写完成:条件字段值取自父组件表单数据(数组非空 / 非 null / 非空串;流程无条件字段时视为填齐),暴露给父组件提交校验调用 */
|
|
16
18
|
declare function isConditionsFilled(): boolean;
|
|
17
19
|
/** 请求流程节点(暴露给父组件在表单变化防抖后调用):先等待流程配置就绪(条件字段提取完成)再校验条件字段填齐,随后携带整份表单数据 + 流程 ID 请求,后端按表单值匹配条件分支;条件字段未填齐/请求失败/返回为空时节点链保持不变(节点区空态提示) */
|
|
18
20
|
declare function fetchFlowNodes(): Promise<void>;
|
|
19
|
-
declare var __VLS_10: {};
|
|
21
|
+
declare var __VLS_10: {}, __VLS_26: {};
|
|
20
22
|
type __VLS_Slots = {} & {
|
|
21
23
|
default?: (props: typeof __VLS_10) => any;
|
|
24
|
+
} & {
|
|
25
|
+
'footer-center'?: (props: typeof __VLS_26) => any;
|
|
22
26
|
};
|
|
23
27
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
24
28
|
fetchFlowNodes: typeof fetchFlowNodes;
|
|
@@ -31,7 +35,9 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
|
31
35
|
onSuccess?: (() => any) | undefined;
|
|
32
36
|
onClose?: (() => any) | undefined;
|
|
33
37
|
onSubmitted?: (() => any) | undefined;
|
|
34
|
-
}>, {
|
|
38
|
+
}>, {
|
|
39
|
+
approval: boolean;
|
|
40
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
35
41
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
42
|
declare const _default: typeof __VLS_export;
|
|
37
43
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yugu-ui/flow-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "堉古商城流程组件库:流程设计器(config)/ 审批时间线(timeline)/ 流程列表(FlowList)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
"./style.css": "./dist/style.css"
|
|
22
22
|
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "vite build --config vite.lib.config.ts",
|
|
25
|
+
"typecheck": "vue-tsc --noEmit --skipLibCheck"
|
|
26
|
+
},
|
|
23
27
|
"peerDependencies": {
|
|
24
28
|
"naive-ui": ">=2.40.0",
|
|
25
29
|
"vue": ">=3.3.0"
|
|
@@ -50,9 +54,5 @@
|
|
|
50
54
|
"publishConfig": {
|
|
51
55
|
"access": "public",
|
|
52
56
|
"registry": "https://registry.npmjs.org/"
|
|
53
|
-
},
|
|
54
|
-
"scripts": {
|
|
55
|
-
"build": "vite build --config vite.lib.config.ts",
|
|
56
|
-
"typecheck": "vue-tsc --noEmit --skipLibCheck"
|
|
57
57
|
}
|
|
58
|
-
}
|
|
58
|
+
}
|