lyflowchart 1.0.177 → 1.0.181

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.
@@ -1,4 +1,4 @@
1
- import { t as e } from "./core-IDB064AQ.js";
1
+ import { t as e } from "./core-Ba3X7LpD.js";
2
2
  import { createBlock as t, createCommentVNode as n, defineComponent as r, mergeModels as i, openBlock as a, resolveComponent as o, useModel as s, withCtx as c } from "vue";
3
3
  //#endregion
4
4
  //#region src/components/approval/ApprovalEditorModal.vue
@@ -0,0 +1,183 @@
1
+ import { b as e, o as t } from "./init-plugin-CpYzRii0.js";
2
+ import { computed as n, createBlock as r, createCommentVNode as i, createVNode as a, defineComponent as o, h as s, mergeModels as c, openBlock as l, reactive as u, ref as d, resolveComponent as f, useModel as p, watch as m, withCtx as h } from "vue";
3
+ import { message as g } from "ant-design-vue";
4
+ //#endregion
5
+ //#region src/components/approval/components/CancelModal.vue
6
+ var _ = /* @__PURE__ */ e(/* @__PURE__ */ o({
7
+ name: "ApprovalCancelModal",
8
+ __name: "CancelModal",
9
+ props: /* @__PURE__ */ c({
10
+ id: { default: null },
11
+ eventBus: { default: null }
12
+ }, {
13
+ cancelModalShow: {},
14
+ cancelModalShowModifiers: {}
15
+ }),
16
+ emits: /* @__PURE__ */ c(["done"], ["update:cancelModalShow"]),
17
+ setup(e, { emit: o }) {
18
+ let c = e, _ = o, v = p(e, "cancelModalShow"), y = u({ bz: "" }), b = d(null), x = d(!1), S = n(() => Array.isArray(c.id) ? c.id.length : +!!c.id), C = n(() => S.value - T.value.length), w = n(() => S.value ? Math.round(C.value / S.value * 100) : 0), T = d([]), E = d([]), D = d([]), O = d(!1), k = n(() => D.value.filter((e) => e.invalid_reason).length), A = n(() => S.value - k.value), j = n(() => `请确认是否删除以下 ${S.value} 条审批数据,其中可删除 ${A.value} 条、状态不符将忽略 ${k.value} 条`), M = [
19
+ {
20
+ title: "流水号",
21
+ dataIndex: "number",
22
+ width: 150,
23
+ ellipsis: !0,
24
+ customRender: ({ text: e, record: t }) => e || `#${t.id}`
25
+ },
26
+ {
27
+ title: "流程主题",
28
+ dataIndex: "context",
29
+ ellipsis: !0,
30
+ customRender: ({ text: e }) => e || "(无流程主题)"
31
+ },
32
+ {
33
+ title: "状态",
34
+ dataIndex: "invalid_reason",
35
+ width: 70,
36
+ customRender: ({ record: e }) => e.invalid_reason ? s("span", { style: "color: #faad14" }, "忽略") : s("span", { style: "color: #52c41a" }, "可删除")
37
+ },
38
+ {
39
+ title: "校验结果",
40
+ dataIndex: "invalid_reason",
41
+ width: 190,
42
+ ellipsis: !0,
43
+ customRender: ({ text: e }) => e ? s("span", { style: "color: #ff4d4f" }, e) : s("span", { style: "color: #52c41a" }, "可删除")
44
+ }
45
+ ], N = 0;
46
+ m([() => c.id, v], async ([e, n]) => {
47
+ if (!n) return;
48
+ let r = Array.isArray(e) ? [...e] : e ? [e] : [];
49
+ T.value = r, E.value = [];
50
+ let i = ++N;
51
+ D.value = [], O.value = !0;
52
+ try {
53
+ let e = (await t({
54
+ current: 1,
55
+ pageSize: r.length,
56
+ conditions: [[{
57
+ class_name: "int",
58
+ field_name: "id",
59
+ format: "input",
60
+ operator: "in",
61
+ value: r
62
+ }]],
63
+ column_fields: [
64
+ "id",
65
+ "number",
66
+ "context",
67
+ "process_status",
68
+ "result_status",
69
+ "modify_status"
70
+ ]
71
+ }, "/approve/query_approve_record_list"))?.data || [], n = new Map(e.map((e) => [e.id, e])), a = r.map((e) => n.get(e)).filter(Boolean);
72
+ for (let e of a) e.process_status !== "approved" || e.result_status !== "pass" ? e.invalid_reason = "仅能删除已通过的提交" : e.modify_status === "已修改" || e.modify_status === "已删除" ? e.invalid_reason = "已修改或已删除的记录禁止再次删除" : e.invalid_reason = "";
73
+ i === N && (D.value = a, O.value = !1);
74
+ } catch (e) {
75
+ console.error("CancelModal 查询审批记录内容失败", e), i === N && (O.value = !1);
76
+ }
77
+ }, { immediate: !0 });
78
+ let P = async () => {
79
+ if (!T.value.length) {
80
+ g.error("未获取到要作废的审批记录");
81
+ return;
82
+ }
83
+ await b.value.validate(), x.value = !0;
84
+ try {
85
+ for (let e of [...T.value]) {
86
+ let n = D.value.find((t) => t.id === e);
87
+ if (n?.invalid_reason) {
88
+ let t = {
89
+ id: e,
90
+ number: n.number || `#${e}`,
91
+ reason: n.invalid_reason
92
+ };
93
+ E.value.push(t), T.value.shift();
94
+ continue;
95
+ }
96
+ await t({
97
+ approve_record_id: e,
98
+ bz: y.bz
99
+ }, "/approve/cancel_agree_approve_record"), T.value.shift();
100
+ }
101
+ } catch {
102
+ return;
103
+ } finally {
104
+ x.value = !1;
105
+ }
106
+ c.eventBus?.emit("reload_table"), _("done");
107
+ let e = E.value;
108
+ if (e.length) {
109
+ let t = e.slice(0, 3).map((e) => `${e.number}(${e.reason})`), n = e.length - t.length;
110
+ g.warning(`已跳过 ${e.length} 条状态不符的记录:${t.join(";")}${n > 0 ? " 等" : ""}`);
111
+ }
112
+ let n = S.value - e.length;
113
+ n > 0 && g.success(S.value > 1 ? `删除成功(共 ${n} 条)` : "删除成功"), v.value = !1;
114
+ };
115
+ return (e, t) => {
116
+ let n = f("a-alert"), o = f("a-progress"), s = f("a-spin"), c = f("a-table"), u = f("a-textarea"), d = f("a-form-item"), p = f("a-form"), m = f("a-modal");
117
+ return l(), r(m, {
118
+ open: v.value,
119
+ "onUpdate:open": t[1] ||= (e) => v.value = e,
120
+ title: "删除审批记录",
121
+ width: "640px",
122
+ "confirm-loading": x.value,
123
+ onOk: P
124
+ }, {
125
+ default: h(() => [
126
+ a(n, {
127
+ type: "warning",
128
+ "show-icon": "",
129
+ message: j.value,
130
+ style: { "margin-bottom": "12px" }
131
+ }, null, 8, ["message"]),
132
+ S.value > 1 && (x.value || C.value > 0) ? (l(), r(o, {
133
+ key: 0,
134
+ percent: w.value,
135
+ format: () => `${C.value}/${S.value}`,
136
+ size: "small",
137
+ style: { "margin-bottom": "12px" }
138
+ }, null, 8, ["percent", "format"])) : i("", !0),
139
+ O.value ? (l(), r(s, {
140
+ key: 1,
141
+ size: "small",
142
+ style: {
143
+ display: "block",
144
+ "margin-bottom": "12px"
145
+ }
146
+ })) : D.value.length ? (l(), r(c, {
147
+ key: 2,
148
+ class: "record-table",
149
+ "row-key": "id",
150
+ size: "small",
151
+ columns: M,
152
+ "data-source": D.value,
153
+ pagination: !1,
154
+ scroll: { y: 180 },
155
+ style: { "margin-bottom": "12px" }
156
+ }, null, 8, ["data-source"])) : i("", !0),
157
+ a(p, {
158
+ model: y,
159
+ ref_key: "formRef",
160
+ ref: b
161
+ }, {
162
+ default: h(() => [a(d, {
163
+ name: "bz",
164
+ rules: [{ required: !0 }],
165
+ label: "删除原因"
166
+ }, {
167
+ default: h(() => [a(u, {
168
+ placeholder: "请输入删除原因",
169
+ value: y.bz,
170
+ "onUpdate:value": t[0] ||= (e) => y.bz = e
171
+ }, null, 8, ["value"])]),
172
+ _: 1
173
+ })]),
174
+ _: 1
175
+ }, 8, ["model"])
176
+ ]),
177
+ _: 1
178
+ }, 8, ["open", "confirm-loading"]);
179
+ };
180
+ }
181
+ }), [["__scopeId", "data-v-0b92bb85"]]);
182
+ //#endregion
183
+ export { _ as t };
@@ -1,6 +1,6 @@
1
1
  import { c as e, o as t, y as n } from "./init-plugin-CpYzRii0.js";
2
2
  import { n as r, r as i } from "./useApprovalRecordActions-gkFffZvz.js";
3
- import { t as a } from "./CancelModal-dBy0HE4N.js";
3
+ import { t as a } from "./CancelModal-DF7_m2Va.js";
4
4
  import { Fragment as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineAsyncComponent as p, defineComponent as m, isRef as h, mergeProps as g, openBlock as _, reactive as v, ref as y, resolveComponent as b, toDisplayString as x, unref as S, withCtx as C } from "vue";
5
5
  import { Modal as w, message as T } from "ant-design-vue";
6
6
  //#region src/components/Cell_click_approve.vue?vue&type=script&setup=true&lang.ts
@@ -26,7 +26,7 @@ var E = { style: {
26
26
  }
27
27
  }), W = async (e) => {
28
28
  await R(e), (B.value || H.value) && (k.value = !1);
29
- }, G = p(() => import("./ApprovalEditorModal-BQlPQaZG.js")), K = async () => {
29
+ }, G = p(() => import("./ApprovalEditorModal-BWOHJ_Cg.js")), K = async () => {
30
30
  k.value = !0;
31
31
  let e = await t({
32
32
  org_id: O?.id,
@@ -1,4 +1,4 @@
1
- import { t as e } from "./core-IDB064AQ.js";
1
+ import { t as e } from "./core-Ba3X7LpD.js";
2
2
  import { computed as t, createBlock as n, defineComponent as r, openBlock as i } from "vue";
3
3
  import { useRoute as a } from "vue-router";
4
4
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as e, b as t, c as n, o as r, y as i } from "./init-plugin-CpYzRii0.js";
2
- import { t as a } from "./CancelModal-dBy0HE4N.js";
2
+ import { t as a } from "./CancelModal-DF7_m2Va.js";
3
3
  import { n as o, r as s, t as c } from "./approval-BaIlEt6M.js";
4
4
  import { c as l, d as u, l as d, p as f } from "./utils-DwIGp2_v.js";
5
5
  import { a as p, c as m, d as h, f as g, i as ee, l as _, n as v, o as te, p as ne, r as y, s as re, t as b, u as ie } from "./columnTables-Bcjih5vD.js";
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { Dn as e, t } from "./viewer-BDGXjryM.js";
2
2
  import { n, t as r } from "./MyProcess-SGZ_-9C3.js";
3
3
  import { f as i, i as a, t as o, y as s } from "./init-plugin-CpYzRii0.js";
4
4
  import { n as c, r as l, t as u } from "./useApprovalRecordActions-gkFffZvz.js";
5
- import { t as d } from "./CancelModal-dBy0HE4N.js";
5
+ import { t as d } from "./CancelModal-DF7_m2Va.js";
6
6
  import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createTextVNode as v, createVNode as y, defineAsyncComponent as b, defineComponent as x, isRef as S, mergeProps as C, onMounted as w, openBlock as T, ref as E, resolveComponent as D, toDisplayString as O, unref as k, withCtx as A } from "vue";
7
7
  (/* @__PURE__ */ e(((e, t) => {
8
8
  (function(r) {
@@ -326,7 +326,7 @@ var j = { style: {
326
326
  }
327
327
  }), J = async (e) => {
328
328
  await H(e), (W.value || K.value) && (a.value = !1);
329
- }, Y = b(() => import("./ApprovalEditorModal-BQlPQaZG.js")), X = async (e) => {
329
+ }, Y = b(() => import("./ApprovalEditorModal-BWOHJ_Cg.js")), X = async (e) => {
330
330
  let t = N.get(e);
331
331
  if (t && Date.now() - t.time < M) return t.data;
332
332
  let i = P.get(e);
@@ -532,7 +532,7 @@ var j = { style: {
532
532
  ], 64);
533
533
  };
534
534
  }
535
- }), I = b(() => import("./approval-DBP4eU5h.js")), L = b(() => import("./approvalPageConfig-BdW2hpxX.js")), R = b(() => import("./approvalHistory-BjMzTPTH.js")), z = b(() => import("./debugCode-uE8rOKz4.js")), B = b(() => import("./ApprovalEditorModal-BQlPQaZG.js")), V = b(() => import("./Cell_click_approve-CU3QChtr.js")), H = {
535
+ }), I = b(() => import("./approval-ksqh4H9S.js")), L = b(() => import("./approvalPageConfig-BdW2hpxX.js")), R = b(() => import("./approvalHistory-BjMzTPTH.js")), z = b(() => import("./debugCode-uE8rOKz4.js")), B = b(() => import("./ApprovalEditorModal-BWOHJ_Cg.js")), V = b(() => import("./Cell_click_approve-wVEkE0DE.js")), H = {
536
536
  codeHistoryViewModal: () => import("./codeHistoryViewModal-DnNI_S8C.js"),
537
537
  approvalHistoryViewModal: () => import("./approvalHistoryViewModal-D3_z9bf3.js"),
538
538
  flowHistoryViewModal: () => import("./flowHistoryViewModal-CVg7Wn7_.js")