@chase-shao/vue-component-lib 1.2.28 → 1.2.29

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.es.js CHANGED
@@ -1,18 +1,18 @@
1
- import { ref as V, defineComponent as R, mergeModels as W, useModel as ne, resolveComponent as N, createBlock as A, openBlock as g, onMounted as J, computed as j, withCtx as x, createElementBlock as C, Fragment as E, renderList as O, createVNode as M, nextTick as He, createTextVNode as te, useTemplateRef as ge, createElementVNode as w, createCommentVNode as Y, toDisplayString as F, resolveDynamicComponent as ve, renderSlot as z, inject as re, getCurrentInstance as Ve, reactive as _e, unref as Re, onActivated as De } from "vue";
2
- import Fe from "axios";
3
- import { defineStore as Pe } from "pinia";
4
- import { useRouter as Ee } from "vue-router";
5
- const Be = Pe("main", () => ({
6
- token: V(void 0)
7
- })), Oe = async (e) => new Promise((a) => setTimeout(a, e)), je = async (e, a, r, t = void 0) => {
1
+ import { ref as k, defineComponent as D, mergeModels as G, useModel as oe, resolveComponent as N, createBlock as x, openBlock as g, onMounted as Q, computed as z, withCtx as U, createElementBlock as I, Fragment as P, renderList as j, createVNode as H, nextTick as De, createTextVNode as ae, useTemplateRef as fe, createElementVNode as h, createCommentVNode as J, toDisplayString as E, resolveDynamicComponent as ge, renderSlot as K, inject as ie, getCurrentInstance as Ve, reactive as ve, unref as Re, onActivated as Fe } from "vue";
2
+ import Ee from "axios";
3
+ import { defineStore as Be } from "pinia";
4
+ import { useRouter as Pe } from "vue-router";
5
+ const Oe = Be("main", () => ({
6
+ token: k(void 0)
7
+ })), je = async (e) => new Promise((a) => setTimeout(a, e)), ze = async (e, a, o, t = void 0) => {
8
8
  if (e[a] === void 0)
9
9
  try {
10
- e[a] = null, e[a] = await r() || t;
10
+ e[a] = null, e[a] = await o() || t;
11
11
  } catch (n) {
12
12
  console.error(n), e[a] = void 0;
13
13
  }
14
14
  for (; e[a] === null; )
15
- await Oe(100);
15
+ await je(100);
16
16
  return e[a];
17
17
  };
18
18
  function Se() {
@@ -24,7 +24,7 @@ function Se() {
24
24
  }
25
25
  function Ce() {
26
26
  const { apiBase: e } = Se();
27
- return Fe.create({
27
+ return Ee.create({
28
28
  baseURL: e,
29
29
  timeout: 1e4,
30
30
  // 10s
@@ -32,16 +32,16 @@ function Ce() {
32
32
  withCredentials: !0
33
33
  });
34
34
  }
35
- const ze = async () => {
36
- const { apiBase: e, appSecret: a } = Se(), r = Ce(), t = Be();
37
- return await je(t, "token", async () => (await r.get(`${e}/GenerateToken`, {
35
+ const Ke = async () => {
36
+ const { apiBase: e, appSecret: a } = Se(), o = Ce(), t = Oe();
37
+ return await ze(t, "token", async () => (await o.get(`${e}/GenerateToken`, {
38
38
  params: {
39
39
  appid: "bpm",
40
40
  appsecret: a
41
41
  }
42
42
  }))?.data?.token);
43
43
  }, q = async () => {
44
- const e = await ze(), a = Ce();
44
+ const e = await Ke(), a = Ce();
45
45
  return a.defaults.headers.common.Authorization = `Bearer ${e}`, a;
46
46
  }, we = {
47
47
  CurrentUserEmail: (e) => e()?.userInfo?.email_address ?? "test.email@dataGetter.ts",
@@ -50,34 +50,34 @@ const ze = async () => {
50
50
  ApproverEmail: (e) => e()?.userInfo?.email_address ?? "test.email@dataGetter.ts",
51
51
  ApproverPositionCode: (e) => e()?.userInfo?.position_code ?? 999,
52
52
  RejectReason: () => "Test Reject Reason"
53
- }, T = [];
53
+ }, M = [];
54
54
  for (let e = 0; e < 256; ++e)
55
- T.push((e + 256).toString(16).slice(1));
56
- function Ke(e, a = 0) {
57
- return (T[e[a + 0]] + T[e[a + 1]] + T[e[a + 2]] + T[e[a + 3]] + "-" + T[e[a + 4]] + T[e[a + 5]] + "-" + T[e[a + 6]] + T[e[a + 7]] + "-" + T[e[a + 8]] + T[e[a + 9]] + "-" + T[e[a + 10]] + T[e[a + 11]] + T[e[a + 12]] + T[e[a + 13]] + T[e[a + 14]] + T[e[a + 15]]).toLowerCase();
55
+ M.push((e + 256).toString(16).slice(1));
56
+ function We(e, a = 0) {
57
+ return (M[e[a + 0]] + M[e[a + 1]] + M[e[a + 2]] + M[e[a + 3]] + "-" + M[e[a + 4]] + M[e[a + 5]] + "-" + M[e[a + 6]] + M[e[a + 7]] + "-" + M[e[a + 8]] + M[e[a + 9]] + "-" + M[e[a + 10]] + M[e[a + 11]] + M[e[a + 12]] + M[e[a + 13]] + M[e[a + 14]] + M[e[a + 15]]).toLowerCase();
58
58
  }
59
- let me;
60
- const We = new Uint8Array(16);
61
- function Ge() {
62
- if (!me) {
59
+ let pe;
60
+ const Ge = new Uint8Array(16);
61
+ function qe() {
62
+ if (!pe) {
63
63
  if (typeof crypto > "u" || !crypto.getRandomValues)
64
64
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
65
- me = crypto.getRandomValues.bind(crypto);
65
+ pe = crypto.getRandomValues.bind(crypto);
66
66
  }
67
- return me(We);
67
+ return pe(Ge);
68
68
  }
69
- const qe = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ye = { randomUUID: qe };
70
- function Ye(e, a, r) {
69
+ const Ye = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ye = { randomUUID: Ye };
70
+ function Je(e, a, o) {
71
71
  if (ye.randomUUID && !e)
72
72
  return ye.randomUUID();
73
73
  e = e || {};
74
- const t = e.random ?? e.rng?.() ?? Ge();
74
+ const t = e.random ?? e.rng?.() ?? qe();
75
75
  if (t.length < 16)
76
76
  throw new Error("Random bytes length must be >= 16");
77
- return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, Ke(t);
77
+ return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, We(t);
78
78
  }
79
- var B = /* @__PURE__ */ ((e) => (e[e.Submit = 0] = "Submit", e[e.Link = 1] = "Link", e))(B || {}), le = /* @__PURE__ */ ((e) => (e[e.Create = 0] = "Create", e[e.Update = 1] = "Update", e[e.Details = 2] = "Details", e[e.list = 3] = "list", e))(le || {});
80
- function Je(e, a, r) {
79
+ var O = /* @__PURE__ */ ((e) => (e[e.Submit = 0] = "Submit", e[e.Link = 1] = "Link", e))(O || {}), X = /* @__PURE__ */ ((e) => (e[e.Create = 0] = "Create", e[e.Update = 1] = "Update", e[e.Details = 2] = "Details", e[e.list = 3] = "list", e))(X || {});
80
+ function Qe(e, a, o) {
81
81
  const t = {
82
82
  pageType: "",
83
83
  fields: {},
@@ -96,7 +96,7 @@ function Je(e, a, r) {
96
96
  else if (n.attributeType === "UIControl") {
97
97
  if (n.widget === "Tab") {
98
98
  t.tabs || (t.tabs = []), t.tabs.unshift({
99
- key: Ye(),
99
+ key: Je(),
100
100
  title: n.title,
101
101
  filters: n.filters ? JSON.parse(n.filters) : []
102
102
  });
@@ -108,51 +108,51 @@ function Je(e, a, r) {
108
108
  redirectUrl: n.redirectUrl,
109
109
  redirectType: n.redirectType,
110
110
  title: n.title,
111
- widget: n.widget === "Link" ? B.Link : B.Submit,
111
+ widget: n.widget === "Link" ? O.Link : O.Submit,
112
112
  location: n.location,
113
113
  attributeType: n.attributeType,
114
114
  readonly: n.readonly
115
115
  });
116
116
  }
117
- }), Object.entries(e).forEach(([n, o]) => {
117
+ }), Object.entries(e).forEach(([n, r]) => {
118
118
  if (n === "__ClassAttributes" || n === "className" || n === "id" || n === "deleteFlag" || n === "status" || n === "workflowId" || n === "workFlowReason")
119
119
  return;
120
- const i = {
120
+ const u = {
121
121
  validations: [],
122
122
  triggers: [],
123
123
  isFiltered: !1,
124
124
  dependent: ""
125
- }, { attributes: f, propertyValue: l } = o;
126
- switch (l) {
125
+ }, { attributes: d, propertyValue: i } = r;
126
+ switch (i) {
127
127
  case null:
128
- i.modelValue = "";
128
+ u.modelValue = "";
129
129
  break;
130
130
  case void 0:
131
- i.modelValue = "";
131
+ u.modelValue = "";
132
132
  break;
133
133
  default:
134
- i.modelValue = l;
134
+ u.modelValue = i;
135
135
  break;
136
136
  }
137
- f?.forEach((s) => {
138
- s.order || s.Order ? i.order = s.order ?? s.Order : s.attributeType === "UIControl" ? i.widget = {
137
+ d?.forEach((s) => {
138
+ s.order || s.Order ? u.order = s.order ?? s.Order : s.attributeType === "UIControl" ? u.widget = {
139
139
  ...s,
140
140
  column: !0
141
- } : s.attributeType === "UIValidationControl" && a !== 3 ? i.widget?.widget !== "CheckBox" && i.validations.push(s) : s.attributeType === "UIListed" ? i.widget = {
141
+ } : s.attributeType === "UIValidationControl" && a !== 3 ? u.widget?.widget !== "CheckBox" && u.validations.push(s) : s.attributeType === "UIListed" ? u.widget = {
142
142
  ...s,
143
143
  column: !0
144
- } : s.attributeType === "UIFiltered" ? i.isFiltered = !0 : s.dependentType ? i.dependent = we[s.dependentType] ? we[s.dependentType](r) : "" : s.eventType === "Change" && i.triggers?.push({
144
+ } : s.attributeType === "UIFiltered" ? u.isFiltered = !0 : s.dependentType ? u.dependent = we[s.dependentType] ? we[s.dependentType](o) : "" : s.eventType === "Change" && u.triggers?.push({
145
145
  event: "change",
146
146
  handlerName: s.eventName
147
147
  });
148
- }), t.fields[n] = i;
148
+ }), t.fields[n] = u;
149
149
  }), t;
150
150
  }
151
- const ie = async (e, a, r, t) => {
152
- const o = await (await q()).get(`/General/${a}/${e}/page`, { params: t });
153
- return Je(o?.data, e, r);
154
- };
155
- async function Qe(e, a) {
151
+ const ce = async (e, a, o, t) => {
152
+ const r = await (await q()).get(`/General/${a}/${e}/page`, { params: t });
153
+ return Qe(r?.data, e, o);
154
+ }, Ie = async (e, a, o) => (await (await q()).post(`/General/${a}/${e}/button/List`, null, { params: o }))?.data;
155
+ async function Xe(e, a) {
156
156
  const t = await (await q()).post(`/General/${e}/list`, a);
157
157
  return {
158
158
  data: t.data.data,
@@ -172,75 +172,75 @@ async function Qe(e, a) {
172
172
  // ),
173
173
  };
174
174
  }
175
- async function Xe(e, a, r) {
176
- const n = await (await q()).post(r, a, {
175
+ async function Ze(e, a, o) {
176
+ const n = await (await q()).post(o, a, {
177
177
  params: {
178
178
  className: e
179
179
  }
180
180
  });
181
181
  return n.data.length > 0 ? n.data[0] : 0;
182
182
  }
183
- function Ze(e, a) {
183
+ function et(e, a) {
184
184
  return e.replace(/{workflowId}/g, a);
185
185
  }
186
- async function et(e, a, r, t) {
187
- const n = await q(), o = Ze(t, a);
188
- return (await n.put(o, r, {
186
+ async function tt(e, a, o, t) {
187
+ const n = await q(), r = et(t, a);
188
+ return (await n.put(r, o, {
189
189
  params: {
190
190
  className: e
191
191
  }
192
192
  }))?.data;
193
193
  }
194
- function tt(e, a) {
194
+ function at(e, a) {
195
195
  return e.replace(/{WorkflowId}/g, a);
196
196
  }
197
- function at(e, a) {
197
+ function nt(e, a) {
198
198
  return e.replace(/{ApproverEmail}/g, a);
199
199
  }
200
- function nt(e, a) {
200
+ function st(e, a) {
201
201
  return e.replace(/{WorkFlowReason}/g, a);
202
202
  }
203
- function st(e, a) {
203
+ function ot(e, a) {
204
204
  return e.replace(/{Status}/g, a);
205
205
  }
206
- function ot(e, a) {
206
+ function rt(e, a) {
207
207
  return e.replace(/{IfTriggerGlobal_RandP_Approval}/g, a);
208
208
  }
209
- async function rt(e, a, r, t, n, o, i, f) {
210
- const l = await q();
211
- let s = tt(o, a);
212
- return s = at(s, r), s = nt(s, t), s = st(s, i), s = ot(s, f), (await l.put(s, n, {
209
+ async function lt(e, a, o, t, n, r, u, d) {
210
+ const i = await q();
211
+ let s = at(r, a);
212
+ return s = nt(s, o), s = st(s, t), s = ot(s, u), s = rt(s, d), (await i.put(s, n, {
213
213
  params: {
214
214
  className: e,
215
215
  reason: t
216
216
  }
217
217
  }))?.data;
218
218
  }
219
- async function lt(e, a) {
219
+ async function it(e, a) {
220
220
  const n = (await (await q()).get(e, { params: { value: a } }))?.data;
221
- return Object.entries(n).map(([o, i]) => ({
222
- value: o,
223
- label: i
221
+ return Object.entries(n).map(([r, u]) => ({
222
+ value: r,
223
+ label: u
224
224
  }));
225
225
  }
226
- async function it(e, a) {
226
+ async function ct(e, a) {
227
227
  return (await (await q()).get(`/General/${e}/${a}/process`))?.data;
228
228
  }
229
- const X = (e, a) => {
230
- let r = "";
229
+ const Z = (e, a) => {
230
+ let o = "";
231
231
  return { res: e.every((n) => {
232
- const o = ct(n, a);
233
- return o || (r = n.errorMessage), o;
234
- }), errorMessages: r };
235
- }, ct = (e, a) => {
236
- const { ruleName: r, ruleParameter: t } = e;
237
- return dt[r](t, a);
232
+ const r = ut(n, a);
233
+ return r || (o = n.errorMessage), r;
234
+ }), errorMessages: o };
235
+ }, ut = (e, a) => {
236
+ const { ruleName: o, ruleParameter: t } = e;
237
+ return dt[o](t, a);
238
238
  }, dt = {
239
239
  Regex: (e, a) => new RegExp(e).test(a),
240
240
  Required: (e, a) => !!a
241
- }, be = /* @__PURE__ */ R({
241
+ }, be = /* @__PURE__ */ D({
242
242
  __name: "InputText",
243
- props: /* @__PURE__ */ W({
243
+ props: /* @__PURE__ */ G({
244
244
  modelValue: {},
245
245
  config: {},
246
246
  readonly: { type: Boolean },
@@ -250,36 +250,36 @@ const X = (e, a) => {
250
250
  modelValue: {},
251
251
  modelModifiers: {}
252
252
  }),
253
- emits: /* @__PURE__ */ W(["update:modelValue", "change", "error", "input"], ["update:modelValue"]),
254
- setup(e, { expose: a, emit: r }) {
255
- const t = e, n = r, o = ne(e, "modelValue"), i = (s) => X(t.validations, s), f = (s) => {
253
+ emits: /* @__PURE__ */ G(["update:modelValue", "change", "error", "input"], ["update:modelValue"]),
254
+ setup(e, { expose: a, emit: o }) {
255
+ const t = e, n = o, r = oe(e, "modelValue"), u = (s) => Z(t.validations, s), d = (s) => {
256
256
  n("input", s);
257
- }, l = (s) => {
258
- const _ = i(s);
259
- n("error", _.res ? "" : _.errorMessages), t.triggers && t.triggers.length > 0 && t.triggers.forEach((p) => {
257
+ }, i = (s) => {
258
+ const v = u(s);
259
+ n("error", v.res ? "" : v.errorMessages), t.triggers && t.triggers.length > 0 && t.triggers.forEach((p) => {
260
260
  p.event === "change" && n(p.event, p.handlerName, s);
261
261
  });
262
262
  };
263
263
  return a({
264
264
  validate() {
265
- const s = i(t.modelValue);
265
+ const s = u(t.modelValue);
266
266
  return n("error", s.res ? "" : s.errorMessages), s.res;
267
267
  }
268
- }), (s, _) => {
268
+ }), (s, v) => {
269
269
  const p = N("AInput");
270
- return g(), A(p, {
271
- modelValue: o.value,
272
- "onUpdate:modelValue": _[0] || (_[0] = (h) => o.value = h),
270
+ return g(), x(p, {
271
+ modelValue: r.value,
272
+ "onUpdate:modelValue": v[0] || (v[0] = (w) => r.value = w),
273
273
  "allow-clear": "",
274
274
  disabled: t.readonly || t.config.Readonly,
275
- onInput: f,
276
- onChange: l
275
+ onInput: d,
276
+ onChange: i
277
277
  }, null, 8, ["modelValue", "disabled"]);
278
278
  };
279
279
  }
280
- }), ut = /* @__PURE__ */ R({
280
+ }), pt = /* @__PURE__ */ D({
281
281
  __name: "InputNumber",
282
- props: /* @__PURE__ */ W({
282
+ props: /* @__PURE__ */ G({
283
283
  modelValue: {},
284
284
  config: {},
285
285
  readonly: { type: Boolean },
@@ -289,44 +289,44 @@ const X = (e, a) => {
289
289
  modelValue: {},
290
290
  modelModifiers: {}
291
291
  }),
292
- emits: /* @__PURE__ */ W(["update:modelValue", "change", "error", "input"], ["update:modelValue"]),
293
- setup(e, { expose: a, emit: r }) {
294
- const t = e, n = r, o = ne(e, "modelValue"), i = V(100), f = V(0);
295
- J(() => {
292
+ emits: /* @__PURE__ */ G(["update:modelValue", "change", "error", "input"], ["update:modelValue"]),
293
+ setup(e, { expose: a, emit: o }) {
294
+ const t = e, n = o, r = oe(e, "modelValue"), u = k(100), d = k(0);
295
+ Q(() => {
296
296
  t.validations && t.validations.forEach((p) => {
297
- p.ruleName === "Max" && (i.value = p.ruleParameter), p.ruleName === "Min" && (f.value = p.ruleParameter);
297
+ p.ruleName === "Max" && (u.value = p.ruleParameter), p.ruleName === "Min" && (d.value = p.ruleParameter);
298
298
  });
299
299
  });
300
- const l = (p) => X(t.validations, p), s = (p) => {
300
+ const i = (p) => Z(t.validations, p), s = (p) => {
301
301
  n("input", p);
302
- }, _ = (p) => {
303
- const h = l(p);
304
- n("error", h.res ? "" : h.errorMessages), t.triggers && t.triggers.length > 0 && t.triggers.forEach((m) => {
305
- m.event === "change" && n(m.event, m.handlerName, p);
302
+ }, v = (p) => {
303
+ const w = i(p);
304
+ n("error", w.res ? "" : w.errorMessages), t.triggers && t.triggers.length > 0 && t.triggers.forEach((f) => {
305
+ f.event === "change" && n(f.event, f.handlerName, p);
306
306
  });
307
307
  };
308
308
  return a({
309
309
  validate() {
310
- const p = l(t.modelValue);
310
+ const p = i(t.modelValue);
311
311
  return n("error", p.res ? "" : p.errorMessages), p.res;
312
312
  }
313
- }), (p, h) => {
314
- const m = N("AInputNumber");
315
- return g(), A(m, {
316
- modelValue: o.value,
317
- "onUpdate:modelValue": h[0] || (h[0] = (y) => o.value = y),
313
+ }), (p, w) => {
314
+ const f = N("AInputNumber");
315
+ return g(), x(f, {
316
+ modelValue: r.value,
317
+ "onUpdate:modelValue": w[0] || (w[0] = (y) => r.value = y),
318
318
  clearable: "",
319
319
  disabled: t.readonly,
320
- min: f.value,
321
- max: i.value,
320
+ min: d.value,
321
+ max: u.value,
322
322
  onInput: s,
323
- onChange: _
323
+ onChange: v
324
324
  }, null, 8, ["modelValue", "disabled", "min", "max"]);
325
325
  };
326
326
  }
327
- }), ke = /* @__PURE__ */ R({
327
+ }), ke = /* @__PURE__ */ D({
328
328
  __name: "SelectList",
329
- props: /* @__PURE__ */ W({
329
+ props: /* @__PURE__ */ G({
330
330
  modelValue: {},
331
331
  config: {},
332
332
  readonly: { type: Boolean },
@@ -336,46 +336,46 @@ const X = (e, a) => {
336
336
  modelValue: {},
337
337
  modelModifiers: {}
338
338
  }),
339
- emits: /* @__PURE__ */ W(["update:modelValue", "change"], ["update:modelValue"]),
340
- setup(e, { expose: a, emit: r }) {
341
- const t = e, n = r, o = V(!1), i = V(t.config.options ?? []), f = ne(e, "modelValue"), l = (p) => X(t.validations, p);
342
- j(() => {
339
+ emits: /* @__PURE__ */ G(["update:modelValue", "change"], ["update:modelValue"]),
340
+ setup(e, { expose: a, emit: o }) {
341
+ const t = e, n = o, r = k(!1), u = k(t.config.options ?? []), d = oe(e, "modelValue"), i = (p) => Z(t.validations, p);
342
+ z(() => {
343
343
  const p = {};
344
- return t.triggers && t.triggers.length > 0 && t.triggers.forEach((h) => {
345
- p[h.event] = (m) => {
346
- n(h.event, h.handlerName, m);
347
- const y = l(m);
344
+ return t.triggers && t.triggers.length > 0 && t.triggers.forEach((w) => {
345
+ p[w.event] = (f) => {
346
+ n(w.event, w.handlerName, f);
347
+ const y = i(f);
348
348
  n("error", y.res ? "" : y.errorMessages);
349
349
  };
350
350
  }), p;
351
- }), J(async () => {
352
- t.config.dataSourceProvider && (i.value = await lt(t.config.dataSourceProvider));
351
+ }), Q(async () => {
352
+ t.config.dataSourceProvider && (u.value = await it(t.config.dataSourceProvider));
353
353
  });
354
- const _ = (p) => {
354
+ const v = (p) => {
355
355
  n("update:modelValue", p);
356
- const h = l(p);
357
- n("error", h.res ? "" : h.errorMessages), t.triggers && t.triggers.length > 0 && t.triggers.forEach((m) => {
358
- m.event === "change" && n(m.event, m.handlerName, p);
356
+ const w = i(p);
357
+ n("error", w.res ? "" : w.errorMessages), t.triggers && t.triggers.length > 0 && t.triggers.forEach((f) => {
358
+ f.event === "change" && n(f.event, f.handlerName, p);
359
359
  });
360
360
  };
361
361
  return a({
362
362
  validate() {
363
- const p = l(t.modelValue);
363
+ const p = i(t.modelValue);
364
364
  return n("error", p.res ? "" : p.errorMessages), p.res;
365
365
  }
366
- }), (p, h) => {
367
- const m = N("AOption"), y = N("ASelect");
368
- return g(), A(y, {
366
+ }), (p, w) => {
367
+ const f = N("AOption"), y = N("ASelect");
368
+ return g(), x(y, {
369
369
  "allow-clear": "",
370
- modelValue: f.value,
371
- "onUpdate:modelValue": h[0] || (h[0] = (L) => f.value = L),
372
- loading: o.value,
370
+ modelValue: d.value,
371
+ "onUpdate:modelValue": w[0] || (w[0] = (L) => d.value = L),
372
+ loading: r.value,
373
373
  "filter-option": !0,
374
374
  "allow-search": !0,
375
- onChange: _
375
+ onChange: v
376
376
  }, {
377
- default: x(() => [
378
- (g(!0), C(E, null, O(i.value, (L) => (g(), A(m, {
377
+ default: U(() => [
378
+ (g(!0), I(P, null, j(u.value, (L) => (g(), x(f, {
379
379
  key: L.value,
380
380
  value: L.value,
381
381
  label: L.label
@@ -385,52 +385,52 @@ const X = (e, a) => {
385
385
  }, 8, ["modelValue", "loading"]);
386
386
  };
387
387
  }
388
- }), pt = /* @__PURE__ */ R({
388
+ }), mt = /* @__PURE__ */ D({
389
389
  __name: "Cascader",
390
390
  props: {
391
391
  modelValue: {},
392
392
  config: {}
393
393
  },
394
394
  emits: ["update:modelValue", "change"],
395
- setup(e, { expose: a, emit: r }) {
396
- const t = e, n = r, o = V(t.config.options ?? []), i = (l) => {
397
- n("update:modelValue", l), n("change", l);
395
+ setup(e, { expose: a, emit: o }) {
396
+ const t = e, n = o, r = k(t.config.options ?? []), u = (i) => {
397
+ n("update:modelValue", i), n("change", i);
398
398
  };
399
- J(async () => {
399
+ Q(async () => {
400
400
  if (t.config) {
401
- const l = t.config.dataSourceProvider;
402
- if (l) {
403
- const _ = await (await q()).get(l);
404
- o.value = _.data;
401
+ const i = t.config.dataSourceProvider;
402
+ if (i) {
403
+ const v = await (await q()).get(i);
404
+ r.value = v.data;
405
405
  }
406
406
  }
407
407
  });
408
- const f = { value: "key", label: "value" };
408
+ const d = { value: "key", label: "value" };
409
409
  return a({
410
410
  validate() {
411
411
  return !0;
412
412
  }
413
- }), (l, s) => {
414
- const _ = N("ACascader"), p = N("ASpace");
415
- return g(), A(p, {
413
+ }), (i, s) => {
414
+ const v = N("ACascader"), p = N("ASpace");
415
+ return g(), x(p, {
416
416
  direction: "vertical",
417
417
  size: "large"
418
418
  }, {
419
- default: x(() => [
420
- M(_, {
421
- "field-names": f,
422
- "model-value": l.modelValue,
423
- options: o.value,
419
+ default: U(() => [
420
+ H(v, {
421
+ "field-names": d,
422
+ "model-value": i.modelValue,
423
+ options: r.value,
424
424
  style: { width: "320px" },
425
425
  placeholder: "Please select ...",
426
- onChange: i
426
+ onChange: u
427
427
  }, null, 8, ["model-value", "options"])
428
428
  ]),
429
429
  _: 1
430
430
  });
431
431
  };
432
432
  }
433
- }), mt = /* @__PURE__ */ R({
433
+ }), ft = /* @__PURE__ */ D({
434
434
  __name: "FileUpload",
435
435
  props: {
436
436
  className: {},
@@ -441,50 +441,50 @@ const X = (e, a) => {
441
441
  triggers: {}
442
442
  },
443
443
  emits: ["update:modelValue", "change", "error", "input"],
444
- setup(e, { expose: a, emit: r }) {
445
- const t = e, n = r, o = (m) => X(t.validations, m), i = "", f = V(null), l = V(0), s = V([]);
446
- function _(m, y, L) {
447
- return m.replace(/{WorkflowId}/g, y).replace(/{ClassName}/g, L);
444
+ setup(e, { expose: a, emit: o }) {
445
+ const t = e, n = o, r = (f) => Z(t.validations, f), u = "", d = k(null), i = k(0), s = k([]);
446
+ function v(f, y, L) {
447
+ return f.replace(/{WorkflowId}/g, y).replace(/{ClassName}/g, L);
448
448
  }
449
- const p = j(() => {
449
+ const p = z(() => {
450
450
  if (t.config.uploadURL) {
451
- const m = i + t.config.uploadURL;
452
- return _(m, l.value.toString(), t.className);
451
+ const f = u + t.config.uploadURL;
452
+ return v(f, i.value.toString(), t.className);
453
453
  }
454
454
  return "";
455
- }), h = (m) => {
456
- n("change", m), t.triggers && t.triggers.length > 0 && t.triggers.forEach((y) => {
457
- y.event === "change" && n(y.event, y.handlerName, m);
455
+ }), w = (f) => {
456
+ n("change", f), t.triggers && t.triggers.length > 0 && t.triggers.forEach((y) => {
457
+ y.event === "change" && n(y.event, y.handlerName, f);
458
458
  });
459
459
  };
460
460
  return a({
461
- submit(m) {
462
- f.value && (t.config.uploadURL && (l.value = m), He(() => {
463
- f.value.submit();
461
+ submit(f) {
462
+ d.value && (t.config.uploadURL && (i.value = f), De(() => {
463
+ d.value.submit();
464
464
  }));
465
465
  },
466
466
  validate() {
467
- const m = o(t.modelValue);
468
- return n("error", m.res ? "" : m.errorMessages), m.res;
467
+ const f = r(t.modelValue);
468
+ return n("error", f.res ? "" : f.errorMessages), f.res;
469
469
  }
470
- }), (m, y) => {
470
+ }), (f, y) => {
471
471
  const L = N("a-upload");
472
- return g(), A(L, {
472
+ return g(), x(L, {
473
473
  ref_key: "uploadRef",
474
- ref: f,
474
+ ref: d,
475
475
  modelValue: s.value,
476
- "onUpdate:modelValue": y[0] || (y[0] = (G) => s.value = G),
476
+ "onUpdate:modelValue": y[0] || (y[0] = (Y) => s.value = Y),
477
477
  "auto-upload": !1,
478
478
  action: p.value,
479
479
  limit: t.config.allowedNumber,
480
- onChange: h
480
+ onChange: w
481
481
  }, {
482
- "start-icon": x(() => y[1] || (y[1] = [])),
482
+ "start-icon": U(() => y[1] || (y[1] = [])),
483
483
  _: 1
484
484
  }, 8, ["modelValue", "action", "limit"]);
485
485
  };
486
486
  }
487
- }), ft = /* @__PURE__ */ R({
487
+ }), gt = /* @__PURE__ */ D({
488
488
  __name: "TextArea",
489
489
  props: {
490
490
  modelValue: {},
@@ -494,36 +494,36 @@ const X = (e, a) => {
494
494
  triggers: {}
495
495
  },
496
496
  emits: ["update:modelValue", "change", "error", "input"],
497
- setup(e, { expose: a, emit: r }) {
498
- const t = e, n = r, o = (l) => X(t.validations, l), i = (l) => {
499
- n("update:modelValue", l), n("input", l);
500
- }, f = (l) => {
501
- n("update:modelValue", l);
502
- const s = o(l);
503
- n("error", s.res ? "" : s.errorMessages), t.triggers && t.triggers.length > 0 && t.triggers.forEach((_) => {
504
- _.event === "change" && n(_.event, _.handlerName, l);
497
+ setup(e, { expose: a, emit: o }) {
498
+ const t = e, n = o, r = (i) => Z(t.validations, i), u = (i) => {
499
+ n("update:modelValue", i), n("input", i);
500
+ }, d = (i) => {
501
+ n("update:modelValue", i);
502
+ const s = r(i);
503
+ n("error", s.res ? "" : s.errorMessages), t.triggers && t.triggers.length > 0 && t.triggers.forEach((v) => {
504
+ v.event === "change" && n(v.event, v.handlerName, i);
505
505
  });
506
506
  };
507
507
  return a({
508
508
  validate() {
509
- const l = o(t.modelValue);
510
- return n("error", l.res ? "" : l.errorMessages), l.res;
509
+ const i = r(t.modelValue);
510
+ return n("error", i.res ? "" : i.errorMessages), i.res;
511
511
  }
512
- }), (l, s) => {
513
- const _ = N("ATextarea");
514
- return g(), A(_, {
512
+ }), (i, s) => {
513
+ const v = N("ATextarea");
514
+ return g(), x(v, {
515
515
  "model-value": t.modelValue,
516
516
  placeholder: "Please enter something",
517
517
  "allow-clear": "",
518
518
  disabled: t.readonly,
519
- onInput: i,
520
- onChange: f
519
+ onInput: u,
520
+ onChange: d
521
521
  }, null, 8, ["model-value", "disabled"]);
522
522
  };
523
523
  }
524
- }), gt = /* @__PURE__ */ R({
524
+ }), vt = /* @__PURE__ */ D({
525
525
  __name: "CheckBox",
526
- props: /* @__PURE__ */ W({
526
+ props: /* @__PURE__ */ G({
527
527
  modelValue: {},
528
528
  config: {},
529
529
  readonly: { type: Boolean },
@@ -533,45 +533,45 @@ const X = (e, a) => {
533
533
  modelValue: {},
534
534
  modelModifiers: {}
535
535
  }),
536
- emits: /* @__PURE__ */ W(["update:modelValue", "change", "error", "input"], ["update:modelValue"]),
537
- setup(e, { expose: a, emit: r }) {
538
- const t = e, n = r, o = ne(e, "modelValue"), i = (l) => X(t.validations, l), f = (l) => {
539
- const s = i(l);
540
- n("error", s.res ? "" : s.errorMessages), t.triggers && t.triggers.length > 0 && t.triggers.forEach((_) => {
541
- _.event === "change" && n(_.event, _.handlerName, l);
536
+ emits: /* @__PURE__ */ G(["update:modelValue", "change", "error", "input"], ["update:modelValue"]),
537
+ setup(e, { expose: a, emit: o }) {
538
+ const t = e, n = o, r = oe(e, "modelValue"), u = (i) => Z(t.validations, i), d = (i) => {
539
+ const s = u(i);
540
+ n("error", s.res ? "" : s.errorMessages), t.triggers && t.triggers.length > 0 && t.triggers.forEach((v) => {
541
+ v.event === "change" && n(v.event, v.handlerName, i);
542
542
  });
543
543
  };
544
544
  return a({
545
545
  validate() {
546
- const l = i(t.modelValue);
547
- return n("error", l.res ? "" : l.errorMessages), l.res;
546
+ const i = u(t.modelValue);
547
+ return n("error", i.res ? "" : i.errorMessages), i.res;
548
548
  }
549
- }), (l, s) => {
550
- const _ = N("ACheckbox");
551
- return g(), A(_, {
552
- modelValue: o.value,
553
- "onUpdate:modelValue": s[0] || (s[0] = (p) => o.value = p),
549
+ }), (i, s) => {
550
+ const v = N("ACheckbox");
551
+ return g(), x(v, {
552
+ modelValue: r.value,
553
+ "onUpdate:modelValue": s[0] || (s[0] = (p) => r.value = p),
554
554
  clearable: "",
555
555
  disabled: t.readonly || t.config.Readonly,
556
- onChange: f
556
+ onChange: d
557
557
  }, {
558
- default: x(() => s[1] || (s[1] = [
559
- te("Yes", -1)
558
+ default: U(() => s[1] || (s[1] = [
559
+ ae("Yes", -1)
560
560
  ])),
561
561
  _: 1,
562
562
  __: [1]
563
563
  }, 8, ["modelValue", "disabled"]);
564
564
  };
565
565
  }
566
- }), vt = { class: "widget-wrapper" }, _t = { class: "title mb-1.5" }, ht = {
566
+ }), _t = { class: "widget-wrapper" }, ht = { class: "title mb-1.5" }, wt = {
567
567
  key: 0,
568
568
  class: "required"
569
- }, wt = { class: "form-widget" }, yt = { class: "widget" }, bt = {
569
+ }, yt = { class: "form-widget" }, bt = { class: "widget" }, kt = {
570
570
  key: 0,
571
571
  class: "err-msg"
572
- }, kt = /* @__PURE__ */ R({
572
+ }, Vt = /* @__PURE__ */ D({
573
573
  __name: "index",
574
- props: /* @__PURE__ */ W({
574
+ props: /* @__PURE__ */ G({
575
575
  config: {},
576
576
  className: {},
577
577
  modelValue: {},
@@ -582,33 +582,33 @@ const X = (e, a) => {
582
582
  modelValue: {},
583
583
  modelModifiers: {}
584
584
  }),
585
- emits: /* @__PURE__ */ W(["update:modelValue", "change", "error"], ["update:modelValue"]),
586
- setup(e, { expose: a, emit: r }) {
587
- const t = e, n = r, o = ne(e, "modelValue"), i = ge("widgetRef"), f = j(() => {
585
+ emits: /* @__PURE__ */ G(["update:modelValue", "change", "error"], ["update:modelValue"]),
586
+ setup(e, { expose: a, emit: o }) {
587
+ const t = e, n = o, r = oe(e, "modelValue"), u = fe("widgetRef"), d = z(() => {
588
588
  switch (t.config?.widget?.widget) {
589
589
  case "TextBox":
590
590
  return be;
591
591
  case "Number":
592
- return ut;
592
+ return pt;
593
593
  case "SelectList":
594
594
  return ke;
595
595
  case "Cascade":
596
- return pt;
597
- case "File":
598
596
  return mt;
599
- case "TextArea":
597
+ case "File":
600
598
  return ft;
599
+ case "TextArea":
600
+ return gt;
601
601
  case "DropDown":
602
602
  return ke;
603
603
  case "CheckBox":
604
- return gt;
604
+ return vt;
605
605
  default:
606
606
  return be;
607
607
  }
608
- }), l = V(""), s = (h) => {
609
- l.value = h;
610
- }, _ = (h, m) => {
611
- n("change", h, m);
608
+ }), i = k(""), s = (w) => {
609
+ i.value = w;
610
+ }, v = (w, f) => {
611
+ n("change", w, f);
612
612
  };
613
613
  function p() {
614
614
  return t.config?.widget?.widget === "File";
@@ -617,45 +617,45 @@ const X = (e, a) => {
617
617
  isFileUpload() {
618
618
  return t.config?.widget?.widget === "File";
619
619
  },
620
- submit(h) {
621
- p() && i.value.submit(h);
620
+ submit(w) {
621
+ p() && u.value.submit(w);
622
622
  },
623
623
  validate() {
624
- return i.value?.validate();
624
+ return u.value?.validate();
625
625
  },
626
626
  getCompName() {
627
627
  return t?.config?.widget?.title;
628
628
  }
629
- }), (h, m) => (g(), C("div", vt, [
630
- w("div", _t, [
631
- te(F(t?.config?.widget?.title), 1),
632
- t.config.validations.length ? (g(), C("span", ht, "*")) : Y("", !0)
629
+ }), (w, f) => (g(), I("div", _t, [
630
+ h("div", ht, [
631
+ ae(E(t?.config?.widget?.title), 1),
632
+ t.config.validations.length ? (g(), I("span", wt, "*")) : J("", !0)
633
633
  ]),
634
- w("div", wt, [
635
- w("div", yt, [
636
- (g(), A(ve(f.value), {
634
+ h("div", yt, [
635
+ h("div", bt, [
636
+ (g(), x(ge(d.value), {
637
637
  ref_key: "widgetRef",
638
- ref: i,
639
- modelValue: o.value,
640
- "onUpdate:modelValue": m[0] || (m[0] = (y) => o.value = y),
638
+ ref: u,
639
+ modelValue: r.value,
640
+ "onUpdate:modelValue": f[0] || (f[0] = (y) => r.value = y),
641
641
  config: t.config.widget,
642
642
  validations: t.config.validations,
643
643
  triggers: t.config.triggers,
644
644
  "class-name": t.className,
645
645
  onError: s,
646
- onChange: _
646
+ onChange: v
647
647
  }, null, 40, ["modelValue", "config", "validations", "triggers", "class-name"]))
648
648
  ]),
649
- l.value.length > 0 ? (g(), C("div", bt, F(l.value), 1)) : Y("", !0)
649
+ i.value.length > 0 ? (g(), I("div", kt, E(i.value), 1)) : J("", !0)
650
650
  ])
651
651
  ]));
652
652
  }
653
- }), se = (e, a) => {
654
- const r = e.__vccOpts || e;
653
+ }), re = (e, a) => {
654
+ const o = e.__vccOpts || e;
655
655
  for (const [t, n] of a)
656
- r[t] = n;
657
- return r;
658
- }, ce = /* @__PURE__ */ se(kt, [["__scopeId", "data-v-18c3fe02"]]), Vt = /* @__PURE__ */ R({
656
+ o[t] = n;
657
+ return o;
658
+ }, _e = /* @__PURE__ */ re(Vt, [["__scopeId", "data-v-18c3fe02"]]), St = /* @__PURE__ */ D({
659
659
  __name: "SubmitButton",
660
660
  props: {
661
661
  url: {},
@@ -663,24 +663,24 @@ const X = (e, a) => {
663
663
  },
664
664
  emits: ["click"],
665
665
  setup(e, { emit: a }) {
666
- const r = e, t = a;
666
+ const o = e, t = a;
667
667
  function n() {
668
- t("click", r.url, r.redirectType);
668
+ t("click", o.url, o.redirectType);
669
669
  }
670
- return (o, i) => {
671
- const f = N("AButton");
672
- return g(), A(f, {
670
+ return (r, u) => {
671
+ const d = N("AButton");
672
+ return g(), x(d, {
673
673
  type: "primary",
674
674
  onClick: n
675
675
  }, {
676
- default: x(() => [
677
- z(o.$slots, "default")
676
+ default: U(() => [
677
+ K(r.$slots, "default")
678
678
  ]),
679
679
  _: 3
680
680
  });
681
681
  };
682
682
  }
683
- }), St = /* @__PURE__ */ R({
683
+ }), Ct = /* @__PURE__ */ D({
684
684
  __name: "DetailLink",
685
685
  props: {
686
686
  url: {},
@@ -688,172 +688,172 @@ const X = (e, a) => {
688
688
  },
689
689
  emits: ["click"],
690
690
  setup(e, { emit: a }) {
691
- const r = e, t = a;
691
+ const o = e, t = a;
692
692
  function n() {
693
- t("click", r.url, r.redirectType);
693
+ t("click", o.url, o.redirectType);
694
694
  }
695
- return (o, i) => {
696
- const f = N("ALink");
697
- return g(), A(f, { onClick: n }, {
698
- default: x(() => [
699
- z(o.$slots, "default")
695
+ return (r, u) => {
696
+ const d = N("ALink");
697
+ return g(), x(d, { onClick: n }, {
698
+ default: U(() => [
699
+ K(r.$slots, "default")
700
700
  ]),
701
701
  _: 3
702
702
  });
703
703
  };
704
704
  }
705
- }), ae = /* @__PURE__ */ R({
705
+ }), ne = /* @__PURE__ */ D({
706
706
  __name: "index",
707
707
  props: {
708
708
  config: {}
709
709
  },
710
710
  emits: ["click"],
711
711
  setup(e, { emit: a }) {
712
- const r = e, t = a;
713
- function n(l, s) {
714
- t("click", r.config.widget, l, s, r.config.title);
712
+ const o = e, t = a;
713
+ function n(i, s) {
714
+ t("click", o.config.widget, i, s, o.config.title);
715
715
  }
716
- const o = j(() => {
717
- switch (r.config.location) {
716
+ const r = z(() => {
717
+ switch (o.config.location) {
718
718
  case "InOperation":
719
- return Vt;
719
+ return St;
720
720
  case "InTable":
721
721
  default:
722
- return St;
722
+ return Ct;
723
723
  }
724
- }), i = j(() => r.config.widget === B.Submit ? r.config.requestUrl ?? "" : r.config.widget === B.Link ? r.config.redirectUrl ?? "" : ""), f = j(() => r.config.redirectType ?? "Details");
725
- return (l, s) => (g(), A(ve(o.value), {
726
- url: i.value,
727
- "redirect-type": f.value,
724
+ }), u = z(() => o.config.widget === O.Submit ? o.config.requestUrl ?? "" : o.config.widget === O.Link ? o.config.redirectUrl ?? "" : ""), d = z(() => o.config.redirectType ?? "Details");
725
+ return (i, s) => (g(), x(ge(r.value), {
726
+ url: u.value,
727
+ "redirect-type": d.value,
728
728
  onClick: n
729
729
  }, {
730
- default: x(() => [
731
- te(F(r.config.title), 1)
730
+ default: U(() => [
731
+ ae(E(o.config.title), 1)
732
732
  ]),
733
733
  _: 1
734
734
  }, 8, ["url", "redirect-type"]));
735
735
  }
736
736
  }), $e = Symbol("library-router");
737
- function de() {
738
- const e = re($e, null);
739
- return e || Ee();
737
+ function ue() {
738
+ const e = ie($e, null);
739
+ return e || Pe();
740
740
  }
741
- const Ie = Symbol("library-triggers");
741
+ const Ne = Symbol("library-triggers");
742
742
  function he() {
743
- const e = re(Ie, null);
743
+ const e = ie(Ne, null);
744
744
  return e || {};
745
745
  }
746
- const Ct = Symbol("library-pinia"), $t = Symbol("library-bpmStore"), Ne = Symbol("library-svrStore");
747
- function ue() {
748
- return re(Ne, null);
746
+ const It = Symbol("library-pinia"), $t = Symbol("library-bpmStore"), Ue = Symbol("library-svrStore");
747
+ function se() {
748
+ return ie(Ue, null);
749
749
  }
750
- const It = { class: "page-container" }, Nt = { class: "page-header" }, Ut = { class: "page-title" }, xt = { class: "page-subtitle" }, At = { class: "page-body" }, Tt = { class: "form-card" }, Mt = { class: "form-fields" }, Lt = {
750
+ const Nt = { class: "page-container" }, Ut = { class: "page-header" }, xt = { class: "page-title" }, At = { class: "page-subtitle" }, Lt = { class: "page-body" }, Tt = { class: "form-card" }, Mt = { class: "form-fields" }, Ht = {
751
751
  key: 0,
752
752
  class: "form-content"
753
- }, Ht = { class: "page-footer" }, Rt = { class: "action-container" }, Dt = { class: "action-buttons" }, Ft = /* @__PURE__ */ R({
753
+ }, Dt = { class: "page-footer" }, Rt = { class: "action-container" }, Ft = { class: "action-buttons" }, Et = /* @__PURE__ */ D({
754
754
  __name: "CreateView",
755
755
  props: {
756
756
  className: {}
757
757
  },
758
758
  setup(e) {
759
- const a = ue(), r = de(), t = he(), n = ge("dataWidgets"), o = Ve(), i = e, f = V(), l = V([]), s = V({});
760
- function _(d) {
761
- return d ? Object.entries(d).map(([v, u]) => ({
762
- fieldKey: v,
763
- ...u
764
- })).filter((v) => v.widget && v.widget.widget !== "Hidden").filter((v) => !k.value.includes(v.fieldKey)) : [];
759
+ const a = se(), o = ue(), t = he(), n = fe("dataWidgets"), r = Ve(), u = e, d = k(), i = k([]), s = k({});
760
+ function v(m) {
761
+ return m ? Object.entries(m).map(([_, l]) => ({
762
+ fieldKey: _,
763
+ ...l
764
+ })).filter((_) => _.widget && _.widget.widget !== "Hidden").filter((_) => !S.value.includes(_.fieldKey)) : [];
765
765
  }
766
- function p(d) {
767
- return d ? Object.entries(d).filter(([v, u]) => u.dependent).reduce((v, [u, U]) => (v[u] = U.dependent, v), {}) : [];
766
+ function p(m) {
767
+ return m ? Object.entries(m).filter(([_, l]) => l.dependent).reduce((_, [l, b]) => (_[l] = b.dependent, _), {}) : [];
768
768
  }
769
- const h = j(() => f.value?.actions ? [...f.value.actions].reverse() : []), m = _e({}), y = V(!1);
770
- J(async () => {
771
- y.value = !0, f.value = await ie(le.Create, i.className, a), l.value = _(f.value.fields), s.value = p(f.value.fields);
772
- for (const d in f.value.fields)
773
- m[d] = f.value.fields[d].modelValue;
769
+ const w = z(() => d.value?.actions ? [...d.value.actions].reverse() : []), f = ve({}), y = k(!1);
770
+ Q(async () => {
771
+ y.value = !0, d.value = await ce(X.Create, u.className, a), i.value = v(d.value.fields), s.value = p(d.value.fields);
772
+ for (const m in d.value.fields)
773
+ f[m] = d.value.fields[m].modelValue;
774
774
  y.value = !1;
775
775
  });
776
- async function L(d, c, v) {
777
- switch (d) {
778
- case B.Submit:
779
- let u = !0;
780
- if (n.value?.forEach((H) => {
781
- H?.validate && (H.validate() || (u = !1));
782
- }), !u) {
783
- o?.appContext.config.globalProperties.$message.error("表单验证未通过,请检查输入项");
776
+ async function L(m, c, _) {
777
+ switch (m) {
778
+ case O.Submit:
779
+ let l = !0;
780
+ if (n.value?.forEach((A) => {
781
+ A?.validate && (A.validate() || (l = !1));
782
+ }), !l) {
783
+ r?.appContext.config.globalProperties.$message.error("表单验证未通过,请检查输入项");
784
784
  return;
785
785
  }
786
- const U = await Xe(i.className, { ...m, ...s.value }, c);
787
- n.value?.forEach((H) => {
788
- H?.submit && H.submit(U);
789
- }), r.push({ name: "List", params: { className: i.className } });
786
+ const b = await Ze(u.className, { ...f, ...s.value }, c);
787
+ n.value?.forEach((A) => {
788
+ A?.submit && A.submit(b);
789
+ }), o.push({ name: "List", params: { className: u.className } });
790
790
  break;
791
- case B.Link:
792
- v === "List" && r.push({ name: "List", params: { className: i.className } });
791
+ case O.Link:
792
+ _ === "List" && o.push({ name: "List", params: { className: u.className } });
793
793
  break;
794
794
  default:
795
- console.warn("Unknown action type:", d);
795
+ console.warn("Unknown action type:", m);
796
796
  }
797
797
  }
798
- const k = V([
798
+ const S = k([
799
799
  "jobScpope",
800
800
  "currentWorkdayId",
801
801
  "originalGrade",
802
802
  "jobTitlePrevious",
803
803
  "positionId"
804
804
  ]);
805
- function b(d, c) {
806
- t[d]?.(c, k), f.value && (l.value = _(f.value.fields));
805
+ function T(m, c) {
806
+ t[m]?.(c, S), d.value && (i.value = v(d.value.fields));
807
807
  }
808
- return (d, c) => {
809
- const v = N("a-spin");
810
- return g(), C("div", It, [
811
- w("div", Nt, [
812
- z(d.$slots, "title", {}, () => [
813
- w("h1", Ut, "创建 " + F(d.className), 1),
814
- w("p", xt, "请填写以下信息创建新的 " + F(d.className) + " 记录", 1)
808
+ return (m, c) => {
809
+ const _ = N("a-spin");
810
+ return g(), I("div", Nt, [
811
+ h("div", Ut, [
812
+ K(m.$slots, "title", {}, () => [
813
+ h("h1", xt, "创建 " + E(m.className), 1),
814
+ h("p", At, "请填写以下信息创建新的 " + E(m.className) + " 记录", 1)
815
815
  ], !0)
816
816
  ]),
817
- w("div", At, [
818
- M(v, {
817
+ h("div", Lt, [
818
+ H(_, {
819
819
  loading: y.value,
820
820
  class: "form-container"
821
821
  }, {
822
- default: x(() => [
823
- w("div", Tt, [
824
- w("div", Mt, [
825
- (g(!0), C(E, null, O(l.value, (u, U) => (g(), C("div", {
826
- key: u.fieldKey,
822
+ default: U(() => [
823
+ h("div", Tt, [
824
+ h("div", Mt, [
825
+ (g(!0), I(P, null, j(i.value, (l, b) => (g(), I("div", {
826
+ key: l.fieldKey,
827
827
  class: "form-field-wrapper"
828
828
  }, [
829
- M(ce, {
829
+ H(_e, {
830
830
  ref_for: !0,
831
831
  ref: "dataWidgets",
832
- name: U,
833
- config: u,
834
- "class-name": d.className,
835
- modelValue: m[u.fieldKey],
836
- "onUpdate:modelValue": (H) => m[u.fieldKey] = H,
832
+ name: b,
833
+ config: l,
834
+ "class-name": m.className,
835
+ modelValue: f[l.fieldKey],
836
+ "onUpdate:modelValue": (A) => f[l.fieldKey] = A,
837
837
  class: "form-field",
838
- onChange: b
838
+ onChange: T
839
839
  }, null, 8, ["name", "config", "class-name", "modelValue", "onUpdate:modelValue"])
840
840
  ]))), 128))
841
841
  ]),
842
- d.$slots.content ? (g(), C("div", Lt, [
843
- z(d.$slots, "content", {}, void 0, !0)
844
- ])) : Y("", !0)
842
+ m.$slots.content ? (g(), I("div", Ht, [
843
+ K(m.$slots, "content", {}, void 0, !0)
844
+ ])) : J("", !0)
845
845
  ])
846
846
  ]),
847
847
  _: 3
848
848
  }, 8, ["loading"])
849
849
  ]),
850
- w("div", Ht, [
851
- w("div", Rt, [
852
- z(d.$slots, "action", {}, void 0, !0),
853
- w("div", Dt, [
854
- (g(!0), C(E, null, O(h.value, (u) => (g(), A(ae, {
855
- key: u.Title,
856
- config: u,
850
+ h("div", Dt, [
851
+ h("div", Rt, [
852
+ K(m.$slots, "action", {}, void 0, !0),
853
+ h("div", Ft, [
854
+ (g(!0), I(P, null, j(w.value, (l) => (g(), x(ne, {
855
+ key: l.Title,
856
+ config: l,
857
857
  class: "action-button",
858
858
  onClick: L
859
859
  }, null, 8, ["config"]))), 128))
@@ -863,117 +863,125 @@ const It = { class: "page-container" }, Nt = { class: "page-header" }, Ut = { cl
863
863
  ]);
864
864
  };
865
865
  }
866
- }), Pt = /* @__PURE__ */ se(Ft, [["__scopeId", "data-v-350bdd05"]]), Et = { class: "page-container" }, Bt = { class: "page-header" }, Ot = { class: "page-title" }, jt = { class: "page-subtitle" }, zt = { class: "page-body" }, Kt = { class: "form-card" }, Wt = { class: "form-fields" }, Gt = {
866
+ }), Bt = /* @__PURE__ */ re(Et, [["__scopeId", "data-v-350bdd05"]]), Pt = { class: "page-container" }, Ot = { class: "page-header" }, jt = { class: "page-title" }, zt = { class: "page-subtitle" }, Kt = { class: "page-body" }, Wt = { class: "form-card" }, Gt = { class: "form-fields" }, qt = {
867
867
  key: 0,
868
868
  class: "form-content"
869
- }, qt = { class: "page-footer" }, Yt = { class: "action-container" }, Jt = { class: "action-buttons" }, Qt = /* @__PURE__ */ R({
869
+ }, Yt = { class: "page-footer" }, Jt = { class: "action-container" }, Qt = { class: "action-buttons" }, Xt = /* @__PURE__ */ D({
870
870
  __name: "UpdateView",
871
871
  props: {
872
872
  className: {},
873
873
  workflowId: {}
874
874
  },
875
875
  setup(e) {
876
- const a = de(), r = he(), t = ge("dataWidgets"), n = Ve(), o = e, i = V(), f = V([]), l = V({});
877
- function s(b) {
878
- return b ? Object.entries(b).map(([c, v]) => ({
879
- fieldKey: c,
880
- ...v
881
- })).filter((c) => c.widget && c.widget.widget !== "Hidden").filter((c) => !G.value.includes(c.fieldKey)) : [];
876
+ const a = ue(), o = he(), t = se(), n = fe("dataWidgets"), r = Ve(), u = e, d = k(), i = k([]), s = k({});
877
+ function v(c) {
878
+ return c ? Object.entries(c).map(([l, b]) => ({
879
+ fieldKey: l,
880
+ ...b
881
+ })).filter((l) => l.widget && l.widget.widget !== "Hidden").filter((l) => !T.value.includes(l.fieldKey)) : [];
882
882
  }
883
- function _(b) {
884
- return b ? Object.entries(b).filter(([c, v]) => v.dependent).reduce((c, [v, u]) => (c[v] = u.dependent, c), {}) : [];
883
+ function p(c) {
884
+ return c ? Object.entries(c).filter(([l, b]) => b.dependent).reduce((l, [b, A]) => (l[b] = A.dependent, l), {}) : [];
885
885
  }
886
- const p = j(() => i.value?.actions ? [...i.value.actions].reverse() : []), h = _e({}), m = V(!1);
887
- J(async () => {
888
- m.value = !0, i.value = await ie(le.Update, o.className, ue, {
889
- workflowId: o.workflowId
890
- }), f.value = s(i.value.fields), l.value = _(i.value.fields);
891
- for (const b in i.value.fields)
892
- h[b] = i.value.fields[b].modelValue;
893
- m.value = !1;
886
+ const w = z(() => d.value?.actions ? [...d.value.actions].reverse() : []), f = ve({}), y = k(!1);
887
+ Q(async () => {
888
+ y.value = !0, d.value = await ce(X.Update, u.className, se, {
889
+ workflowId: u.workflowId
890
+ });
891
+ const c = await Ie(X.Update, u.className, { workflowId: u.workflowId, email: L() });
892
+ d.value.actions = d.value.actions?.filter((_) => {
893
+ const l = c.find((b) => b.button === _.title);
894
+ return l ? l.isShow : !0;
895
+ }), i.value = v(d.value.fields), s.value = p(d.value.fields);
896
+ for (const _ in d.value.fields)
897
+ f[_] = d.value.fields[_].modelValue;
898
+ y.value = !1;
894
899
  });
895
- async function y(b, d, c) {
896
- switch (console.log("🚀 ~ clickHandler ~ redirectType:", c), b) {
897
- case B.Submit:
898
- let v = !0;
899
- if (t.value?.forEach((U) => {
900
- U?.validate && (U.validate() || (v = !1));
901
- }), !v) {
902
- n?.appContext.config.globalProperties.$message.error("表单验证未通过,请检查输入项");
900
+ function L() {
901
+ return t()?.userInfo?.email_address ?? "";
902
+ }
903
+ async function Y(c, _, l) {
904
+ switch (c) {
905
+ case O.Submit:
906
+ let b = !0;
907
+ if (n.value?.forEach((R) => {
908
+ R?.validate && (R.validate() || (b = !1));
909
+ }), !b) {
910
+ r?.appContext.config.globalProperties.$message.error("表单验证未通过,请检查输入项");
903
911
  return;
904
912
  }
905
- const u = await et(o.className, o.workflowId, { ...h, ...l.value }, d);
906
- t.value?.forEach((U) => {
907
- U?.submit && U.submit(u);
908
- }), a.push({ name: "List", params: { className: o.className } });
913
+ const A = await tt(u.className, u.workflowId, { ...f, ...s.value }, _);
914
+ n.value?.forEach((R) => {
915
+ R?.submit && R.submit(A);
916
+ }), a.push({ name: "List", params: { className: u.className } });
909
917
  break;
910
- case B.Link:
911
- a.push({ name: c, params: { className: o.className } });
918
+ case O.Link:
919
+ a.push({ name: l, params: { className: u.className } });
912
920
  break;
913
921
  default:
914
- console.warn("Unknown action type:", b);
922
+ console.warn("Unknown action type:", c);
915
923
  }
916
924
  }
917
- const G = V([
925
+ const T = k([
918
926
  "jobScpope",
919
927
  "currentWorkdayId",
920
928
  "originalGrade",
921
929
  "jobTitlePrevious",
922
930
  "positionId"
923
931
  ]);
924
- function k(b, d) {
925
- r[b]?.(d, G), i.value && (f.value = s(i.value.fields));
932
+ function m(c, _) {
933
+ o[c]?.(_, T), d.value && (i.value = v(d.value.fields));
926
934
  }
927
- return (b, d) => {
928
- const c = N("a-spin");
929
- return g(), C("div", Et, [
930
- w("div", Bt, [
931
- z(b.$slots, "title", {}, () => [
932
- w("h1", Ot, "编辑 " + F(b.className), 1),
933
- w("p", jt, "修改以下信息来更新 " + F(b.className) + " 记录 (ID: " + F(b.workflowId) + ")", 1)
935
+ return (c, _) => {
936
+ const l = N("a-spin");
937
+ return g(), I("div", Pt, [
938
+ h("div", Ot, [
939
+ K(c.$slots, "title", {}, () => [
940
+ h("h1", jt, "编辑 " + E(c.className), 1),
941
+ h("p", zt, "修改以下信息来更新 " + E(c.className) + " 记录 (ID: " + E(c.workflowId) + ")", 1)
934
942
  ], !0)
935
943
  ]),
936
- w("div", zt, [
937
- M(c, {
938
- loading: m.value,
944
+ h("div", Kt, [
945
+ H(l, {
946
+ loading: y.value,
939
947
  class: "form-container"
940
948
  }, {
941
- default: x(() => [
942
- w("div", Kt, [
943
- w("div", Wt, [
944
- (g(!0), C(E, null, O(f.value, (v, u) => (g(), C("div", {
945
- key: v.fieldKey,
949
+ default: U(() => [
950
+ h("div", Wt, [
951
+ h("div", Gt, [
952
+ (g(!0), I(P, null, j(i.value, (b, A) => (g(), I("div", {
953
+ key: b.fieldKey,
946
954
  class: "form-field-wrapper"
947
955
  }, [
948
- M(ce, {
956
+ H(_e, {
949
957
  ref_for: !0,
950
958
  ref: "dataWidgets",
951
- name: u,
952
- config: v,
953
- modelValue: h[v.fieldKey],
954
- "onUpdate:modelValue": (U) => h[v.fieldKey] = U,
959
+ name: A,
960
+ config: b,
961
+ modelValue: f[b.fieldKey],
962
+ "onUpdate:modelValue": (R) => f[b.fieldKey] = R,
955
963
  class: "form-field",
956
- onChange: k
964
+ onChange: m
957
965
  }, null, 8, ["name", "config", "modelValue", "onUpdate:modelValue"])
958
966
  ]))), 128))
959
967
  ]),
960
- b.$slots.content ? (g(), C("div", Gt, [
961
- z(b.$slots, "content", {}, void 0, !0)
962
- ])) : Y("", !0)
968
+ c.$slots.content ? (g(), I("div", qt, [
969
+ K(c.$slots, "content", {}, void 0, !0)
970
+ ])) : J("", !0)
963
971
  ])
964
972
  ]),
965
973
  _: 3
966
974
  }, 8, ["loading"])
967
975
  ]),
968
- w("div", qt, [
969
- w("div", Yt, [
970
- z(b.$slots, "action", {}, void 0, !0),
971
- w("div", Jt, [
972
- (g(!0), C(E, null, O(p.value, (v) => (g(), A(ae, {
973
- key: v.Title,
974
- config: v,
976
+ h("div", Yt, [
977
+ h("div", Jt, [
978
+ K(c.$slots, "action", {}, void 0, !0),
979
+ h("div", Qt, [
980
+ (g(!0), I(P, null, j(w.value, (b) => (g(), x(ne, {
981
+ key: b.Title,
982
+ config: b,
975
983
  class: "action-button",
976
- onClick: y
984
+ onClick: Y
977
985
  }, null, 8, ["config"]))), 128))
978
986
  ])
979
987
  ])
@@ -981,63 +989,57 @@ const It = { class: "page-container" }, Nt = { class: "page-header" }, Ut = { cl
981
989
  ]);
982
990
  };
983
991
  }
984
- }), Xt = /* @__PURE__ */ se(Qt, [["__scopeId", "data-v-4d5beff9"]]), Ue = Symbol("library-custom-comp");
985
- function Zt() {
986
- return re(Ue, null);
992
+ }), Zt = /* @__PURE__ */ re(Xt, [["__scopeId", "data-v-b2f440b4"]]), xe = Symbol("library-custom-comp");
993
+ function ea() {
994
+ return ie(xe, null);
987
995
  }
988
- const ea = { class: "page-container" }, ta = { class: "page-header" }, aa = { class: "page-title" }, na = { class: "page-subtitle" }, sa = { class: "page-body" }, oa = { class: "detail-card" }, ra = { class: "detail-fields" }, la = {
989
- key: 0,
990
- class: "detail-field"
991
- }, ia = {
992
- key: 1,
993
- class: "detail-field"
994
- }, ca = { class: "field-label" }, da = { class: "field-value" }, ua = {
996
+ const ta = { class: "page-container" }, aa = { class: "page-header" }, na = { class: "page-title" }, sa = { class: "page-subtitle" }, oa = { class: "page-body" }, ra = { class: "detail-card" }, la = { class: "detail-fields" }, ia = { class: "detail-field" }, ca = { class: "field-label" }, ua = { class: "field-value" }, da = {
995
997
  key: 0,
996
998
  class: "detail-content"
997
- }, pa = { class: "page-footer" }, ma = { class: "action-container" }, fa = { class: "action-buttons" }, ga = /* @__PURE__ */ R({
999
+ }, pa = { class: "page-footer" }, ma = { class: "action-container" }, fa = { class: "action-buttons" }, ga = /* @__PURE__ */ D({
998
1000
  __name: "DetailView",
999
1001
  props: {
1000
1002
  className: {},
1001
1003
  workflowId: {}
1002
1004
  },
1003
1005
  setup(e) {
1004
- const a = ue(), r = he(), t = de(), n = Zt();
1006
+ const a = se(), o = he(), t = ue(), n = ea();
1005
1007
  console.log("🚀 ~ customComps:", n.Steps);
1006
- const o = e, i = V(), f = V([]);
1007
- function l(k) {
1008
- return k ? Object.entries(k).map(([d, c]) => (typeof c.modelValue == "boolean" ? c.fieldValue = c.modelValue ? "Yes" : "No" : c.fieldValue = c.modelValue, {
1009
- fieldKey: d,
1008
+ const r = e, u = k(), d = k([]);
1009
+ function i(S) {
1010
+ return S ? Object.entries(S).map(([m, c]) => (typeof c.modelValue == "boolean" ? c.fieldValue = c.modelValue ? "Yes" : "No" : c.fieldValue = c.modelValue, {
1011
+ fieldKey: m,
1010
1012
  ...c
1011
- })).filter((d) => d.widget && d.widget.widget !== "Hidden") : [];
1013
+ })).filter((m) => m.widget && m.widget.widget !== "Hidden") : [];
1012
1014
  }
1013
- const s = j(() => i.value?.actions ? [...i.value.actions].reverse() : []), _ = V(!0), p = (k, b = "yyyy-MM-dd hh:mm:ss.fff") => {
1014
- const d = new Date(k);
1015
- if (isNaN(d.getTime()))
1016
- return k;
1015
+ const s = z(() => u.value?.actions ? [...u.value.actions].reverse() : []), v = k(!0), p = (S, T = "yyyy-MM-dd hh:mm:ss.fff") => {
1016
+ const m = new Date(S);
1017
+ if (isNaN(m.getTime()))
1018
+ return S;
1017
1019
  const c = {
1018
- yyyy: d.getFullYear(),
1019
- yy: d.getFullYear().toString().substring(2),
1020
- MM: (d.getMonth() + 1).toString().padStart(2, "0"),
1021
- M: d.getMonth() + 1,
1022
- dd: d.getDate().toString().padStart(2, "0"),
1023
- d: d.getDate(),
1024
- hh: d.getHours().toString().padStart(2, "0"),
1025
- h: d.getHours(),
1026
- mm: d.getMinutes().toString().padStart(2, "0"),
1027
- m: d.getMinutes(),
1028
- ss: d.getSeconds().toString().padStart(2, "0"),
1029
- s: d.getSeconds(),
1030
- fff: d.getMilliseconds().toString().padStart(3, "0"),
1031
- f: d.getMilliseconds()
1020
+ yyyy: m.getFullYear(),
1021
+ yy: m.getFullYear().toString().substring(2),
1022
+ MM: (m.getMonth() + 1).toString().padStart(2, "0"),
1023
+ M: m.getMonth() + 1,
1024
+ dd: m.getDate().toString().padStart(2, "0"),
1025
+ d: m.getDate(),
1026
+ hh: m.getHours().toString().padStart(2, "0"),
1027
+ h: m.getHours(),
1028
+ mm: m.getMinutes().toString().padStart(2, "0"),
1029
+ m: m.getMinutes(),
1030
+ ss: m.getSeconds().toString().padStart(2, "0"),
1031
+ s: m.getSeconds(),
1032
+ fff: m.getMilliseconds().toString().padStart(3, "0"),
1033
+ f: m.getMilliseconds()
1032
1034
  };
1033
- let v = b;
1034
- for (const u of Object.keys(c))
1035
- v = v.replace(u, c[u]);
1036
- return v;
1037
- }, h = (k, b) => {
1038
- const d = k.findIndex((c) => c.isCurrent);
1039
- return k.map((c, v) => {
1040
- const u = {
1035
+ let _ = T;
1036
+ for (const l of Object.keys(c))
1037
+ _ = _.replace(l, c[l]);
1038
+ return _;
1039
+ }, w = (S, T) => {
1040
+ const m = S.findIndex((c) => c.isCurrent);
1041
+ return S.map((c, _) => {
1042
+ const l = {
1041
1043
  id: c.id,
1042
1044
  title: "",
1043
1045
  proxy: "",
@@ -1046,114 +1048,108 @@ const ea = { class: "page-container" }, ta = { class: "page-header" }, aa = { cl
1046
1048
  status: 1,
1047
1049
  time: ""
1048
1050
  };
1049
- u.title = c.workflowProcessApprovers[0]?.name;
1050
- const U = c.workflowProcessApprovers[c.workflowProcessApprovers.length - 1], H = c.workflowHistorys[c.workflowHistorys.length - 1], Q = H?.workflowHistoryApprovers[H?.workflowHistoryApprovers?.length - 1];
1051
- if (U && Q && U?.email?.toLowerCase() !== Q?.approverEmail?.toLowerCase() && (u.title = `${Q.name}`, u.proxy = `代理: ${U.name}`), c.sort > 1 ? u.sub = "审批角色:" + c.nodeName.replace("Submit", "").replace("Approve", "") : u.sub = "提交申请", c.isCurrent && b !== -1)
1052
- u.desc = "审批中", u.status = 1;
1051
+ l.title = c.workflowProcessApprovers[0]?.name;
1052
+ const b = c.workflowProcessApprovers[c.workflowProcessApprovers.length - 1], A = c.workflowHistorys[c.workflowHistorys.length - 1], R = A?.workflowHistoryApprovers[A?.workflowHistoryApprovers?.length - 1];
1053
+ if (b && R && b?.email?.toLowerCase() !== R?.approverEmail?.toLowerCase() && (l.title = `${R.name}`, l.proxy = `代理: ${b.name}`), c.sort > 1 ? l.sub = "审批角色:" + c.nodeName.replace("Submit", "").replace("Approve", "") : l.sub = "提交申请", c.isCurrent && T !== -1)
1054
+ l.desc = "审批中", l.status = 1;
1053
1055
  else {
1054
- const P = c.workflowHistorys[c.workflowHistorys.length - 1];
1055
- if (P && P.status === 100)
1056
- u.time = p(P.takeActionAt, "yyyy-MM-dd hh:mm:ss"), u.status = 2, u.desc = "已审批";
1057
- else if (P && P.status === 999)
1058
- u.time = p(P.takeActionAt, "yyyy-MM-dd hh:mm:ss"), u.status = 0, u.desc = "已跳过";
1059
- else if (P)
1060
- if (u.time = p(P.takeActionAt, "yyyy-MM-dd hh:mm:ss"), c.sort === 1)
1061
- u.status = 2, u.desc = "";
1056
+ const B = c.workflowHistorys[c.workflowHistorys.length - 1];
1057
+ if (B && B.status === 100)
1058
+ l.time = p(B.takeActionAt, "yyyy-MM-dd hh:mm:ss"), l.status = 2, l.desc = "已审批";
1059
+ else if (B && B.status === 999)
1060
+ l.time = p(B.takeActionAt, "yyyy-MM-dd hh:mm:ss"), l.status = 0, l.desc = "已跳过";
1061
+ else if (B)
1062
+ if (l.time = p(B.takeActionAt, "yyyy-MM-dd hh:mm:ss"), c.sort === 1)
1063
+ l.status = 2, l.desc = "";
1062
1064
  else {
1063
- const oe = P.workflowHistoryApprovers[0];
1064
- u.status = 3, u.desc = oe?.reason ? `拒绝原因:${oe.reason}` : "已拒绝";
1065
+ const le = B.workflowHistoryApprovers[0];
1066
+ l.status = 3, l.desc = le?.reason ? `拒绝原因:${le.reason}` : "已拒绝";
1065
1067
  }
1066
- else v < d || d === -1 ? (u.status = 0, u.desc = "已跳过") : (u.status = 0, u.desc = "待审批");
1067
- P && P.status;
1068
+ else _ < m || m === -1 ? (l.status = 0, l.desc = "已跳过") : (l.status = 0, l.desc = "待审批");
1069
+ B && B.status;
1068
1070
  }
1069
- return u;
1071
+ return l;
1072
+ });
1073
+ }, f = k([]);
1074
+ Q(async () => {
1075
+ v.value = !0, u.value = await ce(X.Details, r.className, a, {
1076
+ workflowId: r.workflowId
1070
1077
  });
1071
- }, m = V([]);
1072
- J(async () => {
1073
- _.value = !0, i.value = await ie(le.Details, o.className, a, {
1074
- workflowId: o.workflowId
1075
- }), f.value = l(i.value.fields);
1076
- const k = await it(o.className, o.workflowId);
1077
- console.log("🚀 ~ process:", k), m.value = h(k, 0), _.value = !1;
1078
+ const S = await Ie(X.Details, r.className, { workflowId: r.workflowId, email: L() });
1079
+ u.value.actions = u.value.actions?.filter((m) => {
1080
+ const c = S.find((_) => _.button === m.title);
1081
+ return c ? c.isShow : !0;
1082
+ }), d.value = i(u.value.fields);
1083
+ const T = await ct(r.className, r.workflowId);
1084
+ console.log("🚀 ~ process:", T), f.value = w(T, 0), v.value = !1;
1078
1085
  });
1079
- async function y(k) {
1080
- return r[k]?.();
1086
+ async function y(S) {
1087
+ return o[S]?.();
1081
1088
  }
1082
1089
  function L() {
1083
1090
  return a()?.userInfo?.email_address ?? "";
1084
1091
  }
1085
- async function G(k, b, d, c) {
1092
+ async function Y(S, T, m, c) {
1086
1093
  try {
1087
- switch (k) {
1088
- case B.Submit:
1089
- const v = await y(c), u = c === "Approve" ? "100" : "-1", U = f.value.find((H) => H.fieldKey === "ifTriggerGlobal_RandP_Approval")?.modelValue.toString();
1090
- await rt(o.className, o.workflowId, L(), v, [o.workflowId], b, u, U), t.push({ name: "List", params: { className: o.className } });
1094
+ switch (S) {
1095
+ case O.Submit:
1096
+ const { reason: _, ifGlobal: l } = await y(c), b = c === "Approve" ? "100" : "-1";
1097
+ await lt(r.className, r.workflowId, L(), _, [r.workflowId], T, b, l), t.push({ name: "List", params: { className: r.className } });
1091
1098
  break;
1092
- case B.Link:
1093
- d === "List" && t.push({ name: "List", params: { className: o.className } });
1099
+ case O.Link:
1100
+ m === "List" && t.push({ name: "List", params: { className: r.className } });
1094
1101
  break;
1095
1102
  default:
1096
- console.warn("Unknown action type:", k);
1103
+ console.warn("Unknown action type:", S);
1097
1104
  }
1098
1105
  } catch {
1099
1106
  }
1100
1107
  }
1101
- return (k, b) => {
1102
- const d = N("a-spin");
1103
- return g(), C("div", ea, [
1104
- w("div", ta, [
1105
- z(k.$slots, "title", {}, () => [
1106
- w("h1", aa, F(k.className) + " 详情", 1),
1107
- w("p", na, "查看 " + F(k.className) + " 记录详细信息 (ID: " + F(k.workflowId) + ")", 1)
1108
+ return (S, T) => {
1109
+ const m = N("a-spin");
1110
+ return g(), I("div", ta, [
1111
+ h("div", aa, [
1112
+ K(S.$slots, "title", {}, () => [
1113
+ h("h1", na, E(S.className) + " 详情", 1),
1114
+ h("p", sa, "查看 " + E(S.className) + " 记录详细信息 (ID: " + E(S.workflowId) + ")", 1)
1108
1115
  ], !0)
1109
1116
  ]),
1110
- w("div", sa, [
1111
- M(d, {
1112
- loading: _.value,
1117
+ h("div", oa, [
1118
+ H(m, {
1119
+ loading: v.value,
1113
1120
  class: "detail-container"
1114
1121
  }, {
1115
- default: x(() => [
1116
- w("div", oa, [
1117
- (g(), A(ve(Re(n).Steps), { steps: m.value }, null, 8, ["steps"])),
1118
- w("div", ra, [
1119
- (g(!0), C(E, null, O(f.value, (c) => (g(), C("div", {
1122
+ default: U(() => [
1123
+ h("div", ra, [
1124
+ (g(), x(ge(Re(n).Steps), { steps: f.value }, null, 8, ["steps"])),
1125
+ h("div", la, [
1126
+ (g(!0), I(P, null, j(d.value, (c) => (g(), I("div", {
1120
1127
  key: c.fieldKey,
1121
1128
  class: "detail-field-wrapper"
1122
1129
  }, [
1123
- ["ifTriggerGlobal_RandP_Approval"].includes(c.fieldKey) ? (g(), C("div", la, [
1124
- M(ce, {
1125
- ref_for: !0,
1126
- ref: "dataWidgets",
1127
- name: c.fieldKey,
1128
- config: c,
1129
- "class-name": k.className,
1130
- modelValue: c.modelValue,
1131
- "onUpdate:modelValue": (v) => c.modelValue = v,
1132
- class: "form-field"
1133
- }, null, 8, ["name", "config", "class-name", "modelValue", "onUpdate:modelValue"])
1134
- ])) : (g(), C("div", ia, [
1135
- w("div", ca, F(c.widget?.title), 1),
1136
- w("div", da, F(c.fieldValue), 1)
1137
- ]))
1130
+ h("div", ia, [
1131
+ h("div", ca, E(c.widget?.title), 1),
1132
+ h("div", ua, E(c.fieldValue), 1)
1133
+ ])
1138
1134
  ]))), 128))
1139
1135
  ]),
1140
- k.$slots.content ? (g(), C("div", ua, [
1141
- z(k.$slots, "content", {}, void 0, !0)
1142
- ])) : Y("", !0)
1136
+ S.$slots.content ? (g(), I("div", da, [
1137
+ K(S.$slots, "content", {}, void 0, !0)
1138
+ ])) : J("", !0)
1143
1139
  ])
1144
1140
  ]),
1145
1141
  _: 3
1146
1142
  }, 8, ["loading"])
1147
1143
  ]),
1148
- w("div", pa, [
1149
- w("div", ma, [
1150
- z(k.$slots, "action", {}, void 0, !0),
1151
- w("div", fa, [
1152
- (g(!0), C(E, null, O(s.value, (c) => (g(), A(ae, {
1144
+ h("div", pa, [
1145
+ h("div", ma, [
1146
+ K(S.$slots, "action", {}, void 0, !0),
1147
+ h("div", fa, [
1148
+ (g(!0), I(P, null, j(s.value, (c) => (g(), x(ne, {
1153
1149
  key: c.Title,
1154
1150
  config: c,
1155
1151
  class: "action-button",
1156
- onClick: G
1152
+ onClick: Y
1157
1153
  }, null, 8, ["config"]))), 128))
1158
1154
  ])
1159
1155
  ])
@@ -1161,14 +1157,14 @@ const ea = { class: "page-container" }, ta = { class: "page-header" }, aa = { cl
1161
1157
  ]);
1162
1158
  };
1163
1159
  }
1164
- }), va = /* @__PURE__ */ se(ga, [["__scopeId", "data-v-2a57167c"]]), _a = { class: "list-container" }, ha = { class: "page-title" }, wa = { class: "query-title" }, ya = { class: "field-wrapper" }, ba = /* @__PURE__ */ R({
1160
+ }), va = /* @__PURE__ */ re(ga, [["__scopeId", "data-v-7b72b433"]]), _a = { class: "list-container" }, ha = { class: "page-title" }, wa = { class: "query-title" }, ya = { class: "field-wrapper" }, ba = /* @__PURE__ */ D({
1165
1161
  name: "ListView",
1166
1162
  __name: "ListView",
1167
1163
  props: {
1168
1164
  className: {}
1169
1165
  },
1170
1166
  setup(e) {
1171
- const a = ue(), r = de(), t = e, n = V(), o = _e({
1167
+ const a = se(), o = ue(), t = e, n = k(), r = ve({
1172
1168
  current: 1,
1173
1169
  total: 0,
1174
1170
  pageSize: 10,
@@ -1177,31 +1173,31 @@ const ea = { class: "page-container" }, ta = { class: "page-header" }, aa = { cl
1177
1173
  showPageSize: !0,
1178
1174
  filters: []
1179
1175
  });
1180
- function i() {
1181
- const S = Object.entries(u.value).filter(([, $]) => $ && $ !== "").map(([$, I]) => ({
1182
- key: $,
1183
- value: I
1176
+ function u() {
1177
+ const V = Object.entries(l.value).filter(([, C]) => C && C !== "").map(([C, $]) => ({
1178
+ key: C,
1179
+ value: $
1184
1180
  // operator: 'like' // 根据实际需要调整操作符
1185
1181
  }));
1186
1182
  return {
1187
- pageNumber: o.current,
1188
- pageSize: o.pageSize,
1189
- filters: [...o.filters, ...S],
1183
+ pageNumber: r.current,
1184
+ pageSize: r.pageSize,
1185
+ filters: [...r.filters, ...V],
1190
1186
  sorts: [{
1191
1187
  key: "status",
1192
1188
  type: 0
1193
1189
  }]
1194
1190
  };
1195
1191
  }
1196
- const f = j(() => ({
1197
- x: _.value.length * 150 + 250
1192
+ const d = z(() => ({
1193
+ x: v.value.length * 150 + 250
1198
1194
  // 只设置横向滚动
1199
1195
  // 移除 y 属性,让表格高度自适应
1200
- })), l = (S) => {
1201
- const $ = Object.entries(S).filter(([, I]) => I.widget?.column).map(([I, K], Z) => ({
1202
- title: K.widget.title,
1203
- dataIndex: I.charAt(0).toLowerCase() + I.slice(1),
1204
- order: K.order,
1196
+ })), i = (V) => {
1197
+ const C = Object.entries(V).filter(([, $]) => $.widget?.column).map(([$, W], ee) => ({
1198
+ title: W.widget.title,
1199
+ dataIndex: $.charAt(0).toLowerCase() + $.slice(1),
1200
+ order: W.order,
1205
1201
  ellipsis: !0,
1206
1202
  tooltip: !0,
1207
1203
  width: 150,
@@ -1209,8 +1205,8 @@ const ea = { class: "page-container" }, ta = { class: "page-header" }, aa = { cl
1209
1205
  // 启用最小宽度
1210
1206
  resizable: !0
1211
1207
  // 启用列宽调整
1212
- })).sort((I, K) => I.order - K.order);
1213
- $.push({
1208
+ })).sort(($, W) => $.order - W.order);
1209
+ C.push({
1214
1210
  title: "Actions",
1215
1211
  slotName: "optional",
1216
1212
  align: "center",
@@ -1218,132 +1214,132 @@ const ea = { class: "page-container" }, ta = { class: "page-header" }, aa = { cl
1218
1214
  minWidth: 200,
1219
1215
  fixed: "right",
1220
1216
  resizable: !1
1221
- }), _.value = $;
1222
- }, s = V([]), _ = V([]), p = V(!0), h = V(!0), m = V(), y = async () => {
1223
- h.value = !0;
1224
- const S = await Qe(t.className, i());
1225
- s.value = S.data, o.total = S.totalCount, h.value = !1;
1217
+ }), v.value = C;
1218
+ }, s = k([]), v = k([]), p = k(!0), w = k(!0), f = k(), y = async () => {
1219
+ w.value = !0;
1220
+ const V = await Xe(t.className, u());
1221
+ s.value = V.data, r.total = V.totalCount, w.value = !1;
1226
1222
  };
1227
- J(async () => {
1228
- p.value = !0, n.value = await ie(3, t.className, a), l(n.value.fields), H(n.value.fields), y(), m.value = n.value.actions, p.value = !1;
1229
- }), De(() => {
1223
+ Q(async () => {
1224
+ p.value = !0, n.value = await ce(3, t.className, a), i(n.value.fields), A(n.value.fields), y(), f.value = n.value.actions, p.value = !1;
1225
+ }), Fe(() => {
1230
1226
  y();
1231
1227
  });
1232
- const L = (S) => {
1233
- o.current = S, y();
1234
- }, G = (S) => {
1235
- o.pageSize = S, y();
1228
+ const L = (V) => {
1229
+ r.current = V, y();
1230
+ }, Y = (V) => {
1231
+ r.pageSize = V, y();
1236
1232
  };
1237
- function k(S, $, I, K, Z) {
1238
- switch (S) {
1239
- case B.Link:
1240
- r.push({ name: I, params: { workflowId: Z } });
1233
+ function S(V, C, $, W, ee) {
1234
+ switch (V) {
1235
+ case O.Link:
1236
+ o.push({ name: $, params: { workflowId: ee } });
1241
1237
  break;
1242
1238
  default:
1243
- console.warn("Unknown action type:", S);
1239
+ console.warn("Unknown action type:", V);
1244
1240
  }
1245
1241
  }
1246
- function b(S, $, I) {
1247
- switch (S) {
1248
- case B.Link:
1249
- r.push({ name: I });
1242
+ function T(V, C, $) {
1243
+ switch (V) {
1244
+ case O.Link:
1245
+ o.push({ name: $ });
1250
1246
  break;
1251
1247
  default:
1252
- console.warn("Unknown action type:", S);
1248
+ console.warn("Unknown action type:", V);
1253
1249
  }
1254
1250
  }
1255
- function d() {
1251
+ function m() {
1256
1252
  return a()?.userInfo?.email_address ?? "";
1257
1253
  }
1258
- function c(S, $) {
1259
- return S.replace(/{currentUserEmail}/g, $);
1254
+ function c(V, C) {
1255
+ return V.replace(/{currentUserEmail}/g, C);
1260
1256
  }
1261
- function v(S) {
1262
- const $ = n.value?.tabs?.find((I) => I.key === S)?.filters;
1263
- o.filters = $?.map((I) => ({
1264
- ...I,
1265
- value: c(I.value, d())
1257
+ function _(V) {
1258
+ const C = n.value?.tabs?.find(($) => $.key === V)?.filters;
1259
+ r.filters = C?.map(($) => ({
1260
+ ...$,
1261
+ value: c($.value, m())
1266
1262
  })) || [], y();
1267
1263
  }
1268
- const u = V({}), U = j(() => n.value?.fields ? Object.entries(n.value.fields).filter(([, S]) => S.isFiltered) : []), H = (S) => {
1269
- const $ = {};
1270
- Object.entries(S).forEach(([I, K]) => {
1271
- $[I] = K.modelValue;
1272
- }), u.value = $;
1273
- }, Q = () => {
1274
- o.current = 1, y();
1275
- }, P = () => {
1276
- n.value && H(n.value.fields), Q();
1264
+ const l = k({}), b = z(() => n.value?.fields ? Object.entries(n.value.fields).filter(([, V]) => V.isFiltered) : []), A = (V) => {
1265
+ const C = {};
1266
+ Object.entries(V).forEach(([$, W]) => {
1267
+ C[$] = W.modelValue;
1268
+ }), l.value = C;
1269
+ }, R = () => {
1270
+ r.current = 1, y();
1271
+ }, B = () => {
1272
+ n.value && A(n.value.fields), R();
1277
1273
  };
1278
- function oe(S, $) {
1279
- return !(S.location !== "InTable" || $.status === 100 && S.title === "Update");
1274
+ function le(V, C) {
1275
+ return !(V.location !== "InTable" || C.status === 100 && V.title === "Update");
1280
1276
  }
1281
- return (S, $) => {
1282
- const I = N("a-col"), K = N("a-button"), Z = N("a-space"), xe = N("a-row"), Ae = N("a-card"), Te = N("a-tab-pane"), Me = N("a-tabs"), Le = N("a-table");
1283
- return g(), C("div", _a, [
1284
- w("div", ha, F(S.className) + " : List", 1),
1285
- M(Ae, null, {
1286
- default: x(() => [
1287
- w("div", wa, [
1288
- $[0] || ($[0] = w("h3", null, "查询条件", -1)),
1289
- w("div", null, [
1290
- (g(!0), C(E, null, O(m.value, (D) => (g(), C(E, {
1291
- key: D.title
1277
+ return (V, C) => {
1278
+ const $ = N("a-col"), W = N("a-button"), ee = N("a-space"), Ae = N("a-row"), Le = N("a-card"), Te = N("a-tab-pane"), Me = N("a-tabs"), He = N("a-table");
1279
+ return g(), I("div", _a, [
1280
+ h("div", ha, E(V.className) + " : List", 1),
1281
+ H(Le, null, {
1282
+ default: U(() => [
1283
+ h("div", wa, [
1284
+ C[0] || (C[0] = h("h3", null, "查询条件", -1)),
1285
+ h("div", null, [
1286
+ (g(!0), I(P, null, j(f.value, (F) => (g(), I(P, {
1287
+ key: F.title
1292
1288
  }, [
1293
- D.location === "InOperation" ? (g(), A(ae, {
1289
+ F.location === "InOperation" ? (g(), x(ne, {
1294
1290
  key: 0,
1295
- config: D,
1296
- onClick: b
1297
- }, null, 8, ["config"])) : Y("", !0)
1291
+ config: F,
1292
+ onClick: T
1293
+ }, null, 8, ["config"])) : J("", !0)
1298
1294
  ], 64))), 128))
1299
1295
  ])
1300
1296
  ]),
1301
- M(xe, {
1297
+ H(Ae, {
1302
1298
  gutter: [24, 20],
1303
1299
  class: "search-row"
1304
1300
  }, {
1305
- default: x(() => [
1306
- (g(!0), C(E, null, O(U.value, ([D, ee]) => (g(), A(I, {
1307
- key: D,
1301
+ default: U(() => [
1302
+ (g(!0), I(P, null, j(b.value, ([F, te]) => (g(), x($, {
1303
+ key: F,
1308
1304
  span: 6,
1309
1305
  class: "search-col"
1310
1306
  }, {
1311
- default: x(() => [
1312
- M(ce, {
1313
- name: D,
1314
- config: ee,
1315
- modelValue: u.value[D],
1316
- "onUpdate:modelValue": (pe) => u.value[D] = pe,
1307
+ default: U(() => [
1308
+ H(_e, {
1309
+ name: F,
1310
+ config: te,
1311
+ modelValue: l.value[F],
1312
+ "onUpdate:modelValue": (de) => l.value[F] = de,
1317
1313
  class: "form-field"
1318
1314
  }, null, 8, ["name", "config", "modelValue", "onUpdate:modelValue"])
1319
1315
  ]),
1320
1316
  _: 2
1321
1317
  }, 1024))), 128)),
1322
- M(I, {
1318
+ H($, {
1323
1319
  span: 6,
1324
1320
  class: "search-col"
1325
1321
  }, {
1326
- default: x(() => [
1327
- w("div", ya, [
1328
- M(Z, { size: "medium" }, {
1329
- default: x(() => [
1330
- M(K, {
1322
+ default: U(() => [
1323
+ h("div", ya, [
1324
+ H(ee, { size: "medium" }, {
1325
+ default: U(() => [
1326
+ H(W, {
1331
1327
  type: "primary",
1332
1328
  size: "medium",
1333
- onClick: Q
1329
+ onClick: R
1334
1330
  }, {
1335
- default: x(() => $[1] || ($[1] = [
1336
- te(" 查询 ", -1)
1331
+ default: U(() => C[1] || (C[1] = [
1332
+ ae(" 查询 ", -1)
1337
1333
  ])),
1338
1334
  _: 1,
1339
1335
  __: [1]
1340
1336
  }),
1341
- M(K, {
1337
+ H(W, {
1342
1338
  size: "medium",
1343
- onClick: P
1339
+ onClick: B
1344
1340
  }, {
1345
- default: x(() => $[2] || ($[2] = [
1346
- te(" 重置 ", -1)
1341
+ default: U(() => C[2] || (C[2] = [
1342
+ ae(" 重置 ", -1)
1347
1343
  ])),
1348
1344
  _: 1,
1349
1345
  __: [2]
@@ -1361,50 +1357,50 @@ const ea = { class: "page-container" }, ta = { class: "page-header" }, aa = { cl
1361
1357
  ]),
1362
1358
  _: 1
1363
1359
  }),
1364
- M(Me, {
1360
+ H(Me, {
1365
1361
  size: "large",
1366
- onTabClick: v
1362
+ onTabClick: _
1367
1363
  }, {
1368
- default: x(() => [
1369
- (g(!0), C(E, null, O(n.value?.tabs, (D) => (g(), A(Te, {
1370
- key: D.key,
1371
- title: D.title
1364
+ default: U(() => [
1365
+ (g(!0), I(P, null, j(n.value?.tabs, (F) => (g(), x(Te, {
1366
+ key: F.key,
1367
+ title: F.title
1372
1368
  }, null, 8, ["title"]))), 128))
1373
1369
  ]),
1374
1370
  _: 1
1375
1371
  }),
1376
- M(Le, {
1377
- columns: _.value,
1372
+ H(He, {
1373
+ columns: v.value,
1378
1374
  data: s.value,
1379
1375
  stripe: "",
1380
1376
  border: "",
1381
1377
  pagination: {
1382
- current: o.current,
1383
- total: o.total,
1384
- pageSize: o.pageSize,
1385
- showTotal: o.showTotal,
1386
- showPageSize: o.showPageSize,
1378
+ current: r.current,
1379
+ total: r.total,
1380
+ pageSize: r.pageSize,
1381
+ showTotal: r.showTotal,
1382
+ showPageSize: r.showPageSize,
1387
1383
  showJumper: !0,
1388
1384
  pageSizeOptions: [10, 20, 50, 100]
1389
1385
  },
1390
- loading: h.value,
1386
+ loading: w.value,
1391
1387
  size: "medium",
1392
- scroll: f.value,
1388
+ scroll: d.value,
1393
1389
  onPageChange: L,
1394
- onPageSizeChange: G
1390
+ onPageSizeChange: Y
1395
1391
  }, {
1396
- optional: x(({ record: D }) => [
1397
- M(Z, { size: "small" }, {
1398
- default: x(() => [
1399
- (g(!0), C(E, null, O(m.value, (ee) => (g(), C(E, {
1400
- key: ee.title
1392
+ optional: U(({ record: F }) => [
1393
+ H(ee, { size: "small" }, {
1394
+ default: U(() => [
1395
+ (g(!0), I(P, null, j(f.value, (te) => (g(), I(P, {
1396
+ key: te.title
1401
1397
  }, [
1402
- oe(ee, D) ? (g(), A(ae, {
1398
+ le(te, F) ? (g(), x(ne, {
1403
1399
  key: 0,
1404
- config: ee,
1400
+ config: te,
1405
1401
  size: "small",
1406
- onClick: (...pe) => k(...pe, D.workflowId)
1407
- }, null, 8, ["config", "onClick"])) : Y("", !0)
1402
+ onClick: (...de) => S(...de, F.workflowId)
1403
+ }, null, 8, ["config", "onClick"])) : J("", !0)
1408
1404
  ], 64))), 128))
1409
1405
  ]),
1410
1406
  _: 2
@@ -1415,26 +1411,26 @@ const ea = { class: "page-container" }, ta = { class: "page-header" }, aa = { cl
1415
1411
  ]);
1416
1412
  };
1417
1413
  }
1418
- }), ka = /* @__PURE__ */ se(ba, [["__scopeId", "data-v-03c430a9"]]);
1419
- let fe = {};
1414
+ }), ka = /* @__PURE__ */ re(ba, [["__scopeId", "data-v-03c430a9"]]);
1415
+ let me = {};
1420
1416
  function Va(e) {
1421
- fe = { ...fe, ...e };
1417
+ me = { ...me, ...e };
1422
1418
  }
1423
1419
  function Sa() {
1424
- return fe;
1420
+ return me;
1425
1421
  }
1426
1422
  const Ua = {
1427
1423
  install(e, a = {}) {
1428
- a.config && Va(a.config), a.router && e.provide($e, a.router), a.pinia && e.provide(Ct, a.pinia), a.useBpmStore && e.provide($t, a.useBpmStore), a.useSvrStore && e.provide(Ne, a.useSvrStore), a.triggers && e.provide(Ie, a.triggers), a.customComps && e.provide(Ue, a.customComps), e.component("CreateView", Pt), e.component("UpdateView", Xt), e.component("DetailView", va), e.component("ListView", ka);
1424
+ a.config && Va(a.config), a.router && e.provide($e, a.router), a.pinia && e.provide(It, a.pinia), a.useBpmStore && e.provide($t, a.useBpmStore), a.useSvrStore && e.provide(Ue, a.useSvrStore), a.triggers && e.provide(Ne, a.triggers), a.customComps && e.provide(xe, a.customComps), e.component("CreateView", Bt), e.component("UpdateView", Zt), e.component("DetailView", va), e.component("ListView", ka);
1429
1425
  }
1430
1426
  };
1431
1427
  export {
1432
- Pt as CreateView,
1428
+ Bt as CreateView,
1433
1429
  va as DetailView,
1434
1430
  ka as ListView,
1435
- Ct as PiniaKey,
1431
+ It as PiniaKey,
1436
1432
  $e as RouterKey,
1437
- Xt as UpdateView,
1433
+ Zt as UpdateView,
1438
1434
  Ua as default,
1439
1435
  Sa as getLibraryConfig,
1440
1436
  Va as setLibraryConfig