@chase-shao/vue-component-lib 1.2.78 → 1.2.79

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,11 +1,11 @@
1
- import { ref as m, getCurrentInstance as pe, defineComponent as q, mergeModels as ie, useModel as ye, resolveComponent as S, createBlock as P, openBlock as d, onMounted as ce, computed as Z, withCtx as v, createElementBlock as C, Fragment as j, renderList as $, createVNode as D, nextTick as ot, createTextVNode as J, useTemplateRef as Ne, createElementVNode as A, createCommentVNode as se, toDisplayString as Q, resolveDynamicComponent as He, renderSlot as le, inject as me, reactive as Fe, normalizeStyle as at, normalizeClass as rt, onActivated as st } from "vue";
2
- import it from "axios";
3
- import { defineStore as lt } from "pinia";
4
- import { Modal as ct } from "@arco-design/web-vue";
5
- import { useRouter as dt } from "vue-router";
6
- const ut = lt("main", () => ({
7
- token: m(void 0)
8
- })), ft = async (t) => new Promise((n) => setTimeout(n, t)), pt = async (t, n, a, e = void 0) => {
1
+ import { ref as g, getCurrentInstance as pe, defineComponent as Y, mergeModels as ie, useModel as ye, resolveComponent as A, createBlock as P, openBlock as d, onMounted as ue, computed as Z, withCtx as _, createElementBlock as S, Fragment as O, renderList as K, createVNode as N, nextTick as nt, createTextVNode as J, useTemplateRef as He, createElementVNode as x, createCommentVNode as re, toDisplayString as Q, resolveDynamicComponent as Fe, renderSlot as de, inject as me, reactive as Le, normalizeStyle as ot, normalizeClass as at, onActivated as rt } from "vue";
2
+ import st from "axios";
3
+ import { defineStore as it } from "pinia";
4
+ import { Modal as lt } from "@arco-design/web-vue";
5
+ import { useRouter as ct } from "vue-router";
6
+ const dt = it("main", () => ({
7
+ token: g(void 0)
8
+ })), ut = async (t) => new Promise((n) => setTimeout(n, t)), ft = async (t, n, a, e = void 0) => {
9
9
  if (t[n] === void 0)
10
10
  try {
11
11
  t[n] = null, t[n] = await a() || e;
@@ -13,12 +13,12 @@ const ut = lt("main", () => ({
13
13
  console.error(o), t[n] = void 0;
14
14
  }
15
15
  for (; t[n] === null; )
16
- await ft(100);
16
+ await ut(100);
17
17
  return t[n];
18
18
  }, be = (t) => {
19
19
  const n = `0${t}`;
20
20
  return n.substring(n.length - 2);
21
- }, he = (t, n = "yyyy-MM-dd hh:mm:ss") => {
21
+ }, ke = (t, n = "yyyy-MM-dd hh:mm:ss") => {
22
22
  if (!t || typeof t == "string" && t.length === 0)
23
23
  return "";
24
24
  try {
@@ -42,28 +42,28 @@ const ut = lt("main", () => ({
42
42
  } catch {
43
43
  return t.toLocaleString();
44
44
  }
45
- }, mt = (t, n) => {
45
+ }, pt = (t, n) => {
46
46
  let a;
47
47
  t instanceof Blob ? a = t : a = new Blob([t]);
48
48
  const e = document.createElement("a"), o = window.URL.createObjectURL(a);
49
49
  e.href = o, e.download = n, e.click(), window.URL.revokeObjectURL(o);
50
50
  };
51
51
  let De = {};
52
- function gt(t) {
52
+ function mt(t) {
53
53
  De = { ...De, ...t };
54
54
  }
55
- function Le() {
55
+ function Re() {
56
56
  return De;
57
57
  }
58
- const _t = pe();
58
+ const gt = pe();
59
59
  function Ge() {
60
- const t = Le();
60
+ const t = Re();
61
61
  return {
62
62
  apiBase: t.apiBase || void 0 || "",
63
63
  appSecret: t.appSecret || void 0 || ""
64
64
  };
65
65
  }
66
- function vt(t) {
66
+ function _t(t) {
67
67
  if (!t?.data?.statusCode)
68
68
  return t;
69
69
  switch (t.data.statusCode) {
@@ -71,22 +71,22 @@ function vt(t) {
71
71
  return t.data.data = t.data.result, t.data;
72
72
  case 0:
73
73
  default:
74
- return _t?.appContext.config.globalProperties.$notification.error(t.data.msg), null;
74
+ return gt?.appContext.config.globalProperties.$notification.error(t.data.msg), null;
75
75
  }
76
76
  }
77
- function We() {
78
- const { apiBase: t } = Ge(), n = it.create({
77
+ function qe() {
78
+ const { apiBase: t } = Ge(), n = st.create({
79
79
  baseURL: t,
80
80
  timeout: 20 * 1e3,
81
81
  // 20s
82
82
  // headers: { 'Content-Type': 'application/json' },
83
83
  withCredentials: !0
84
84
  });
85
- return n.interceptors.response.use(vt), n;
85
+ return n.interceptors.response.use(_t), n;
86
86
  }
87
- const qe = async () => {
88
- const { apiBase: t, appSecret: n } = Ge(), a = We(), e = ut();
89
- return await pt(e, "token", async () => {
87
+ const Ye = async () => {
88
+ const { apiBase: t, appSecret: n } = Ge(), a = qe(), e = dt();
89
+ return await ft(e, "token", async () => {
90
90
  const o = await a.get(`${t}/GenerateToken`, {
91
91
  params: {
92
92
  appid: "bpm",
@@ -97,44 +97,44 @@ const qe = async () => {
97
97
  e.token = void 0;
98
98
  }, (o.data?.expireSeconds ?? 3600) * 1e3), o?.data?.token;
99
99
  });
100
- }, K = async () => {
101
- const t = await qe(), n = We();
100
+ }, z = async () => {
101
+ const t = await Ye(), n = qe();
102
102
  return n.defaults.headers.common.Authorization = `Bearer ${t}`, n;
103
- }, Ie = {
103
+ }, Pe = {
104
104
  CurrentUserEmail: (t) => t.svrStore()?.userInfo?.email_address ?? "test.email@dataGetter.ts",
105
105
  CurrentUserPositionCode: (t) => t.bpmStore()?.positionCode ?? 888,
106
106
  CurrentDatetime: () => (/* @__PURE__ */ new Date()).toISOString(),
107
107
  ApproverEmail: (t) => t.svrStore()?.userInfo?.email_address ?? "test.email@dataGetter.ts",
108
108
  ApproverPositionCode: (t) => t.bpmStore()?.positionCode ?? 999,
109
109
  RejectReason: () => "Test Reject Reason"
110
- }, W = [];
110
+ }, q = [];
111
111
  for (let t = 0; t < 256; ++t)
112
- W.push((t + 256).toString(16).slice(1));
113
- function bt(t, n = 0) {
114
- return (W[t[n + 0]] + W[t[n + 1]] + W[t[n + 2]] + W[t[n + 3]] + "-" + W[t[n + 4]] + W[t[n + 5]] + "-" + W[t[n + 6]] + W[t[n + 7]] + "-" + W[t[n + 8]] + W[t[n + 9]] + "-" + W[t[n + 10]] + W[t[n + 11]] + W[t[n + 12]] + W[t[n + 13]] + W[t[n + 14]] + W[t[n + 15]]).toLowerCase();
112
+ q.push((t + 256).toString(16).slice(1));
113
+ function vt(t, n = 0) {
114
+ return (q[t[n + 0]] + q[t[n + 1]] + q[t[n + 2]] + q[t[n + 3]] + "-" + q[t[n + 4]] + q[t[n + 5]] + "-" + q[t[n + 6]] + q[t[n + 7]] + "-" + q[t[n + 8]] + q[t[n + 9]] + "-" + q[t[n + 10]] + q[t[n + 11]] + q[t[n + 12]] + q[t[n + 13]] + q[t[n + 14]] + q[t[n + 15]]).toLowerCase();
115
115
  }
116
- let Te;
117
- const yt = new Uint8Array(16);
118
- function wt() {
119
- if (!Te) {
116
+ let Ne;
117
+ const bt = new Uint8Array(16);
118
+ function yt() {
119
+ if (!Ne) {
120
120
  if (typeof crypto > "u" || !crypto.getRandomValues)
121
121
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
122
- Te = crypto.getRandomValues.bind(crypto);
122
+ Ne = crypto.getRandomValues.bind(crypto);
123
123
  }
124
- return Te(yt);
124
+ return Ne(bt);
125
125
  }
126
- const ht = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ee = { randomUUID: ht };
127
- function Ye(t, n, a) {
128
- if (Ee.randomUUID && !t)
129
- return Ee.randomUUID();
126
+ const ht = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), $e = { randomUUID: ht };
127
+ function Je(t, n, a) {
128
+ if ($e.randomUUID && !t)
129
+ return $e.randomUUID();
130
130
  t = t || {};
131
- const e = t.random ?? t.rng?.() ?? wt();
131
+ const e = t.random ?? t.rng?.() ?? yt();
132
132
  if (e.length < 16)
133
133
  throw new Error("Random bytes length must be >= 16");
134
- return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, bt(e);
134
+ return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, vt(e);
135
135
  }
136
- var ee = /* @__PURE__ */ ((t) => (t[t.Submit = 0] = "Submit", t[t.Link = 1] = "Link", t))(ee || {}), fe = /* @__PURE__ */ ((t) => (t[t.Create = 0] = "Create", t[t.Update = 1] = "Update", t[t.Details = 2] = "Details", t[t.List = 3] = "List", t))(fe || {});
137
- function kt(t, n, a) {
136
+ var ee = /* @__PURE__ */ ((t) => (t[t.Submit = 0] = "Submit", t[t.Link = 1] = "Link", t))(ee || {}), fe = /* @__PURE__ */ ((t) => (t[t.Create = 0] = "Create", t[t.Update = 1] = "Update", t[t.Details = 2] = "Details", t[t.List = 3] = "List", t[t.ReCreate = 5] = "ReCreate", t))(fe || {});
137
+ function wt(t, n, a) {
138
138
  const e = {
139
139
  pageType: "",
140
140
  fields: {},
@@ -158,7 +158,7 @@ function kt(t, n, a) {
158
158
  const l = o.showToRoles.split(",").map((c) => c.trim()), s = a.bpmStore().employeeInfo.roleList.some((c) => l.includes(c.name)) || o.showToRoles === "";
159
159
  if (o.widget === "Tab") {
160
160
  e.tabs || (e.tabs = []), s && e.tabs.push({
161
- key: Ye(),
161
+ key: Je(),
162
162
  title: o.title,
163
163
  filters: o.filters ? JSON.parse(o.filters) : [],
164
164
  order: o.order
@@ -177,7 +177,7 @@ function kt(t, n, a) {
177
177
  readonly: o.readonly,
178
178
  eventName: o.eventName
179
179
  });
180
- } else o.attributeType === "Banner" && (e.banner.title = o.title, e.banner.subTitle = n === 0 ? o.subTitle : Re(o.subTitle, t.workflowId.propertyValue));
180
+ } else o.attributeType === "Banner" && (e.banner.title = o.title, n === 0 || n === 5 ? e.banner.subTitle = o.subTitle : e.banner.subTitle = Be(o.subTitle, t.workflowId.propertyValue));
181
181
  }), e.tabs && (e.tabs = e.tabs.sort((o, l) => o.order - l.order)), Object.entries(t).forEach(([o, l]) => {
182
182
  if (o === "__ClassAttributes" || o === "className" || o === "id" || o === "deleteFlag" || o === "status" || o === "workFlowReason" || n !== 3 && o === "workflowId")
183
183
  return;
@@ -199,26 +199,26 @@ function kt(t, n, a) {
199
199
  s.modelValue = i;
200
200
  break;
201
201
  }
202
- o === "onBehalf" && n === 0 && (s.modelValue = Ie.CurrentUserEmail(a)), n === 1 && (o === "directReports" || o === "employeesInTheTeam") && s.modelValue && (s.modelValue = Number(s.modelValue)), c?.forEach((r) => {
202
+ o === "onBehalf" && n === 0 && (s.modelValue = Pe.CurrentUserEmail(a)), n === 1 && (o === "directReports" || o === "employeesInTheTeam") && s.modelValue && (s.modelValue = Number(s.modelValue)), c?.forEach((r) => {
203
203
  r.order || r.Order ? s.order = r.order ?? r.Order : r.attributeType === "UIControl" ? s.widget = {
204
204
  ...r,
205
205
  column: !0
206
206
  } : r.attributeType === "UIValidationControl" && n !== 3 ? s.widget?.widget !== "CheckBox" && s.validations.push(r) : r.attributeType === "UIListed" ? s.widget = {
207
207
  ...r,
208
208
  column: !0
209
- } : r.attributeType === "UIFiltered" ? (s.isFiltered = !0, s.operator = r.operatorType) : r.dependentType ? s.dependent = Ie[r.dependentType] ? Ie[r.dependentType](a) : "" : r.eventType === "Change" && s.triggers?.push({
209
+ } : r.attributeType === "UIFiltered" ? (s.isFiltered = !0, s.operator = r.operatorType) : r.dependentType ? s.dependent = Pe[r.dependentType] ? Pe[r.dependentType](a) : "" : r.eventType === "Change" && s.triggers?.push({
210
210
  event: "change",
211
211
  handlerName: r.eventName
212
212
  });
213
213
  }), e.fields[o] = s;
214
214
  }), e;
215
215
  }
216
- const ke = async (t, n, a, e) => {
217
- const l = await (await K()).get(`/General/${n}/${t}/page`, { params: e });
218
- return kt(l?.data, t, a);
219
- }, Je = async (t, n, a) => (await (await K()).post(`/${n}/${t}/button/List`, null, { params: a }))?.data;
216
+ const Ke = async (t, n, a, e) => {
217
+ const l = await (await z()).get(`/General/${n}/${t}/page`, { params: e });
218
+ return wt(l?.data, t, a);
219
+ }, kt = async (t, n, a) => (await (await z()).post(`/${n}/${t}/button/List`, null, { params: a }))?.data;
220
220
  async function Ct(t, n) {
221
- const e = await (await K()).post(`/General/${t}/list`, n);
221
+ const e = await (await z()).post(`/General/${t}/list`, n);
222
222
  return {
223
223
  data: e.data.data,
224
224
  totalCount: e.data.totalCount
@@ -238,108 +238,108 @@ async function Ct(t, n) {
238
238
  };
239
239
  }
240
240
  async function St(t, n, a) {
241
- return (await (await K()).post(a, n, {
241
+ return (await (await z()).post(a, n, {
242
242
  params: {
243
243
  className: t
244
244
  }
245
245
  })).data;
246
246
  }
247
- async function xt(t, n, a, e) {
248
- const o = await K(), l = Re(e, n);
247
+ async function At(t, n, a, e) {
248
+ const o = await z(), l = Be(e, n);
249
249
  return (await o.put(l, a))?.data;
250
250
  }
251
- function Re(t, n) {
251
+ function Be(t, n) {
252
252
  return t.replace(/{WorkflowId}/g, n);
253
253
  }
254
- function Vt(t, n) {
254
+ function xt(t, n) {
255
255
  return t.replace(/{ApproverEmail}/g, encodeURIComponent(n));
256
256
  }
257
- function At(t, n) {
257
+ function Vt(t, n) {
258
258
  return t.replace(/{WorkFlowReason}/g, encodeURIComponent(n));
259
259
  }
260
- function It(t, n) {
260
+ function Tt(t, n) {
261
261
  return t.replace(/{Status}/g, n);
262
262
  }
263
- function Tt(t, n) {
263
+ function It(t, n) {
264
264
  return t.replace(/{IfTriggerGlobal_RandP_Approval}/g, n);
265
265
  }
266
- function Ut(t, n) {
266
+ function Pt(t, n) {
267
267
  return t.replace(/{ClassName}/g, encodeURIComponent(n));
268
268
  }
269
- async function Pt(t, n, a, e, o, l, s, c) {
270
- const i = await K();
271
- let r = Re(l, n);
272
- return r = Vt(r, a), r = At(r, e), r = It(r, s), r = Tt(r, c), r = Ut(r, t), (await i.put(r, o))?.data;
269
+ async function Nt(t, n, a, e, o, l, s, c) {
270
+ const i = await z();
271
+ let r = Be(l, n);
272
+ return r = xt(r, a), r = Vt(r, e), r = Tt(r, s), r = It(r, c), r = Pt(r, t), (await i.put(r, o))?.data;
273
273
  }
274
- async function Dt(t, n) {
275
- const o = (await (await K()).get(t, { params: { value: n } }))?.data;
274
+ async function Ut(t, n) {
275
+ const o = (await (await z()).get(t, { params: { value: n } }))?.data;
276
276
  return Object.entries(o).map(([l, s]) => ({
277
277
  value: l,
278
278
  label: s
279
279
  }));
280
280
  }
281
- async function Nt(t, n) {
282
- return (await (await K()).get(`/General/${t}/${n}/process`))?.data;
281
+ async function Dt(t, n) {
282
+ return (await (await z()).get(`/General/${t}/${n}/process`))?.data;
283
283
  }
284
284
  function Ht(t) {
285
285
  return {
286
- uid: t.id ?? Ye(),
286
+ uid: t.id ?? Je(),
287
287
  name: t.attachmentName ?? "unknown",
288
288
  url: t.attachmentKey ?? ""
289
289
  };
290
290
  }
291
- async function Xe(t, n) {
292
- return (await (await K()).get(`/General/${t}/${n}/upload/get`))?.data.reduce((l, s) => {
291
+ async function Ft(t, n) {
292
+ return (await (await z()).get(`/General/${t}/${n}/upload/get`))?.data.reduce((l, s) => {
293
293
  const { category: c } = s;
294
294
  return l[c] || (l[c] = []), l[c].push(Ht(s)), l;
295
295
  }, {});
296
296
  }
297
- async function Ft(t, n) {
298
- return (await K()).post(`/General/${t}/${n}/delete/attachment`);
297
+ async function Lt(t, n) {
298
+ return (await z()).post(`/General/${t}/${n}/delete/attachment`);
299
299
  }
300
- async function Lt() {
301
- const n = await (await K()).get("/Grading/dropdown/approvers");
300
+ async function Rt() {
301
+ const n = await (await z()).get("/Grading/dropdown/approvers");
302
302
  return Object.entries(n?.data).map(([a, e]) => ({
303
303
  label: a,
304
304
  value: e
305
305
  }));
306
306
  }
307
- async function Rt(t, n) {
308
- return await (await K()).post(`Grading/AssignComments/${t}/${encodeURIComponent(n)}`);
307
+ async function Bt(t, n) {
308
+ return await (await z()).post(`Grading/AssignComments/${t}/${encodeURIComponent(n)}`);
309
309
  }
310
- async function Bt(t, n, a) {
311
- return await (await K()).post(`Grading/AddComments/${t}/${encodeURIComponent(n)}`, a, {
310
+ async function jt(t, n, a) {
311
+ return await (await z()).post(`Grading/AddComments/${t}/${encodeURIComponent(n)}`, a, {
312
312
  headers: { "Content-Type": "application/json;charset=UTF-8" }
313
313
  });
314
314
  }
315
- async function $e(t) {
316
- return (await (await K()).get(`Grading/GetComments/${t}`))?.data;
315
+ async function Mt(t) {
316
+ return (await (await z()).get(`Grading/GetComments/${t}`))?.data;
317
317
  }
318
- async function Ue(t) {
319
- return (await (await K()).get(`Grading/GetAssociator/${t}`))?.data;
318
+ async function Ot(t) {
319
+ return (await (await z()).get(`Grading/GetAssociator/${t}`))?.data;
320
320
  }
321
- async function jt(t) {
322
- return await (await K()).delete(`Grading/DeleteAssociator/${t}`);
321
+ async function Et(t) {
322
+ return await (await z()).delete(`Grading/DeleteAssociator/${t}`);
323
323
  }
324
- async function Mt(t, n = null) {
325
- const e = await (await K()).post(t, n, {
324
+ async function $t(t, n = null) {
325
+ const e = await (await z()).post(t, n, {
326
326
  responseType: "blob"
327
327
  });
328
- mt(e?.data, "WorkflowData.xlsx");
328
+ pt(e?.data, "WorkflowData.xlsx");
329
329
  }
330
330
  const ge = (t, n) => {
331
331
  let a = "";
332
332
  return { res: t.every((o) => {
333
- const l = Ot(o, n);
333
+ const l = Kt(o, n);
334
334
  return l || (a = o.errorMessage), l;
335
335
  }), errorMessages: a };
336
- }, Ot = (t, n) => {
336
+ }, Kt = (t, n) => {
337
337
  const { ruleName: a, ruleParameter: e } = t;
338
- return Et[a](e, n);
339
- }, Et = {
338
+ return zt[a](e, n);
339
+ }, zt = {
340
340
  Regex: (t, n) => new RegExp(t).test(n),
341
341
  Required: (t, n) => !!n
342
- }, $t = /* @__PURE__ */ q({
342
+ }, Wt = /* @__PURE__ */ Y({
343
343
  __name: "InputText",
344
344
  props: /* @__PURE__ */ ie({
345
345
  fieldKey: {},
@@ -357,9 +357,9 @@ const ge = (t, n) => {
357
357
  const e = t, o = a, l = ye(t, "modelValue"), s = (u) => ge(e.validations, u), c = (u) => {
358
358
  o("input", u);
359
359
  }, i = (u) => {
360
- const g = s(u);
361
- o("error", g.res ? "" : g.errorMessages), e.triggers && e.triggers.length > 0 && e.triggers.forEach((_) => {
362
- _.event === "change" && o(_.event, _.handlerName, u);
360
+ const p = s(u);
361
+ o("error", p.res ? "" : p.errorMessages), e.triggers && e.triggers.length > 0 && e.triggers.forEach((m) => {
362
+ m.event === "change" && o(m.event, m.handlerName, u);
363
363
  });
364
364
  };
365
365
  n({
@@ -377,8 +377,8 @@ const ge = (t, n) => {
377
377
  a[e] = o;
378
378
  return a;
379
379
  };
380
- function Kt(t, n, a, e, o, l) {
381
- const s = S("AInput");
380
+ function Gt(t, n, a, e, o, l) {
381
+ const s = A("AInput");
382
382
  return d(), P(s, {
383
383
  modelValue: e.model,
384
384
  "onUpdate:modelValue": n[0] || (n[0] = (c) => e.model = c),
@@ -388,7 +388,7 @@ function Kt(t, n, a, e, o, l) {
388
388
  onChange: e.changeHandler
389
389
  }, null, 8, ["modelValue", "disabled"]);
390
390
  }
391
- const Ke = /* @__PURE__ */ X($t, [["render", Kt], ["__file", "InputText.vue"]]), zt = /* @__PURE__ */ q({
391
+ const ze = /* @__PURE__ */ X(Wt, [["render", Gt], ["__file", "InputText.vue"]]), qt = /* @__PURE__ */ Y({
392
392
  __name: "InputNumber",
393
393
  props: /* @__PURE__ */ ie({
394
394
  fieldKey: {},
@@ -403,32 +403,32 @@ const Ke = /* @__PURE__ */ X($t, [["render", Kt], ["__file", "InputText.vue"]]),
403
403
  }),
404
404
  emits: /* @__PURE__ */ ie(["update:modelValue", "change", "error", "input"], ["update:modelValue"]),
405
405
  setup(t, { expose: n, emit: a }) {
406
- const e = t, o = a, l = ye(t, "modelValue"), s = m(100), c = m(1);
407
- ce(() => {
408
- e.validations && e.validations.forEach((_) => {
409
- _.ruleName === "Max" && (s.value = _.ruleParameter), _.ruleName === "Min" && (c.value = _.ruleParameter);
406
+ const e = t, o = a, l = ye(t, "modelValue"), s = g(100), c = g(1);
407
+ ue(() => {
408
+ e.validations && e.validations.forEach((m) => {
409
+ m.ruleName === "Max" && (s.value = m.ruleParameter), m.ruleName === "Min" && (c.value = m.ruleParameter);
410
410
  });
411
411
  });
412
- const i = (_) => ge(e.validations, _), r = (_) => {
413
- o("input", _);
414
- }, u = (_) => {
415
- const b = i(_);
416
- o("error", b.res ? "" : b.errorMessages), e.triggers && e.triggers.length > 0 && e.triggers.forEach((p) => {
417
- p.event === "change" && o(p.event, p.handlerName, _);
412
+ const i = (m) => ge(e.validations, m), r = (m) => {
413
+ o("input", m);
414
+ }, u = (m) => {
415
+ const y = i(m);
416
+ o("error", y.res ? "" : y.errorMessages), e.triggers && e.triggers.length > 0 && e.triggers.forEach((v) => {
417
+ v.event === "change" && o(v.event, v.handlerName, m);
418
418
  });
419
419
  };
420
420
  n({
421
421
  validate() {
422
- const _ = i(e.modelValue);
423
- return o("error", _.res ? "" : _.errorMessages), _.res;
422
+ const m = i(e.modelValue);
423
+ return o("error", m.res ? "" : m.errorMessages), m.res;
424
424
  }
425
425
  });
426
- const g = { props: e, emits: o, model: l, max: s, min: c, validate: i, inputHandler: r, changeHandler: u };
427
- return Object.defineProperty(g, "__isScriptSetup", { enumerable: !1, value: !0 }), g;
426
+ const p = { props: e, emits: o, model: l, max: s, min: c, validate: i, inputHandler: r, changeHandler: u };
427
+ return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
428
428
  }
429
429
  });
430
- function Gt(t, n, a, e, o, l) {
431
- const s = S("AInputNumber");
430
+ function Yt(t, n, a, e, o, l) {
431
+ const s = A("AInputNumber");
432
432
  return d(), P(s, {
433
433
  modelValue: e.model,
434
434
  "onUpdate:modelValue": n[0] || (n[0] = (c) => e.model = c),
@@ -439,7 +439,7 @@ function Gt(t, n, a, e, o, l) {
439
439
  onChange: e.changeHandler
440
440
  }, null, 8, ["modelValue", "disabled", "min"]);
441
441
  }
442
- const Wt = /* @__PURE__ */ X(zt, [["render", Gt], ["__file", "InputNumber.vue"]]), qt = /* @__PURE__ */ q({
442
+ const Jt = /* @__PURE__ */ X(qt, [["render", Yt], ["__file", "InputNumber.vue"]]), Xt = /* @__PURE__ */ Y({
443
443
  __name: "SelectList",
444
444
  props: /* @__PURE__ */ ie({
445
445
  fieldKey: {},
@@ -454,38 +454,38 @@ const Wt = /* @__PURE__ */ X(zt, [["render", Gt], ["__file", "InputNumber.vue"]]
454
454
  }),
455
455
  emits: /* @__PURE__ */ ie(["update:modelValue", "change"], ["update:modelValue"]),
456
456
  setup(t, { expose: n, emit: a }) {
457
- const e = t, o = a, l = m(!1), s = m(e.config.options ?? []), c = ye(t, "modelValue"), i = (b) => ge(e.validations, b), r = Z(() => {
458
- const b = {};
459
- return e.triggers && e.triggers.length > 0 && e.triggers.forEach((p) => {
460
- b[p.event] = (w) => {
461
- o(p.event, p.handlerName, w);
462
- const f = i(w);
457
+ const e = t, o = a, l = g(!1), s = g(e.config.options ?? []), c = ye(t, "modelValue"), i = (y) => ge(e.validations, y), r = Z(() => {
458
+ const y = {};
459
+ return e.triggers && e.triggers.length > 0 && e.triggers.forEach((v) => {
460
+ y[v.event] = (h) => {
461
+ o(v.event, v.handlerName, h);
462
+ const f = i(h);
463
463
  o("error", f.res ? "" : f.errorMessages);
464
464
  };
465
- }), b;
465
+ }), y;
466
466
  }), u = async () => {
467
- e.config.dataSourceProvider && (s.value = await Dt(e.config.dataSourceProvider));
467
+ e.config.dataSourceProvider && (s.value = await Ut(e.config.dataSourceProvider));
468
468
  };
469
- ce(u);
470
- const g = (b) => {
471
- o("update:modelValue", b);
472
- const p = i(b);
473
- o("error", p.res ? "" : p.errorMessages), e.triggers && e.triggers.length > 0 && e.triggers.forEach((w) => {
474
- w.event === "change" && o(w.event, w.handlerName, b);
469
+ ue(u);
470
+ const p = (y) => {
471
+ o("update:modelValue", y);
472
+ const v = i(y);
473
+ o("error", v.res ? "" : v.errorMessages), e.triggers && e.triggers.length > 0 && e.triggers.forEach((h) => {
474
+ h.event === "change" && o(h.event, h.handlerName, y);
475
475
  });
476
476
  };
477
477
  n({
478
478
  validate() {
479
- const b = i(e.modelValue);
480
- return o("error", b.res ? "" : b.errorMessages), b.res;
479
+ const y = i(e.modelValue);
480
+ return o("error", y.res ? "" : y.errorMessages), y.res;
481
481
  }
482
482
  });
483
- const _ = { props: e, emits: o, loading: l, _options: s, model: c, validate: i, eventHandlers: r, loadOptions: u, changeHandler: g };
484
- return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
483
+ const m = { props: e, emits: o, loading: l, _options: s, model: c, validate: i, eventHandlers: r, loadOptions: u, changeHandler: p };
484
+ return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
485
485
  }
486
486
  });
487
- function Yt(t, n, a, e, o, l) {
488
- const s = S("AOption"), c = S("ASelect");
487
+ function Qt(t, n, a, e, o, l) {
488
+ const s = A("AOption"), c = A("ASelect");
489
489
  return d(), P(c, {
490
490
  "allow-clear": "",
491
491
  modelValue: e.model,
@@ -496,8 +496,8 @@ function Yt(t, n, a, e, o, l) {
496
496
  disabled: e.props.config.readonly,
497
497
  onChange: e.changeHandler
498
498
  }, {
499
- default: v(() => [
500
- (d(!0), C(j, null, $(e._options, (i) => (d(), P(s, {
499
+ default: _(() => [
500
+ (d(!0), S(O, null, K(e._options, (i) => (d(), P(s, {
501
501
  key: i.value,
502
502
  value: i.value,
503
503
  label: i.label
@@ -506,7 +506,7 @@ function Yt(t, n, a, e, o, l) {
506
506
  _: 1
507
507
  }, 8, ["modelValue", "loading", "disabled"]);
508
508
  }
509
- const ze = /* @__PURE__ */ X(qt, [["render", Yt], ["__file", "SelectList.vue"]]), Jt = /* @__PURE__ */ q({
509
+ const We = /* @__PURE__ */ X(Xt, [["render", Qt], ["__file", "SelectList.vue"]]), Zt = /* @__PURE__ */ Y({
510
510
  __name: "Cascader",
511
511
  props: {
512
512
  modelValue: {},
@@ -514,15 +514,15 @@ const ze = /* @__PURE__ */ X(qt, [["render", Yt], ["__file", "SelectList.vue"]])
514
514
  },
515
515
  emits: ["update:modelValue", "change"],
516
516
  setup(t, { expose: n, emit: a }) {
517
- const e = t, o = a, l = m(e.config.options ?? []), s = (r) => {
517
+ const e = t, o = a, l = g(e.config.options ?? []), s = (r) => {
518
518
  o("update:modelValue", r), o("change", r);
519
519
  };
520
- ce(async () => {
520
+ ue(async () => {
521
521
  if (e.config) {
522
522
  const r = e.config.dataSourceProvider;
523
523
  if (r) {
524
- const g = await (await K()).get(r);
525
- l.value = g.data;
524
+ const p = await (await z()).get(r);
525
+ l.value = p.data;
526
526
  }
527
527
  }
528
528
  });
@@ -536,14 +536,14 @@ const ze = /* @__PURE__ */ X(qt, [["render", Yt], ["__file", "SelectList.vue"]])
536
536
  return Object.defineProperty(i, "__isScriptSetup", { enumerable: !1, value: !0 }), i;
537
537
  }
538
538
  });
539
- function Xt(t, n, a, e, o, l) {
540
- const s = S("ACascader"), c = S("ASpace");
539
+ function en(t, n, a, e, o, l) {
540
+ const s = A("ACascader"), c = A("ASpace");
541
541
  return d(), P(c, {
542
542
  direction: "vertical",
543
543
  size: "large"
544
544
  }, {
545
- default: v(() => [
546
- D(s, {
545
+ default: _(() => [
546
+ N(s, {
547
547
  "field-names": e.fieldNames,
548
548
  "model-value": a.modelValue,
549
549
  options: e._options,
@@ -555,7 +555,7 @@ function Xt(t, n, a, e, o, l) {
555
555
  _: 1
556
556
  });
557
557
  }
558
- const Qt = /* @__PURE__ */ X(Jt, [["render", Xt], ["__file", "Cascader.vue"]]), Zt = /* @__PURE__ */ q({
558
+ const tn = /* @__PURE__ */ X(Zt, [["render", en], ["__file", "Cascader.vue"]]), nn = /* @__PURE__ */ Y({
559
559
  __name: "FileUpload",
560
560
  props: {
561
561
  className: {},
@@ -568,67 +568,67 @@ const Qt = /* @__PURE__ */ X(Jt, [["render", Xt], ["__file", "Cascader.vue"]]),
568
568
  },
569
569
  emits: ["update:modelValue", "change", "error", "input"],
570
570
  setup(t, { expose: n, emit: a }) {
571
- const e = t, o = a, l = m({});
572
- ce(async () => {
573
- const h = await qe();
571
+ const e = t, o = a, l = g({});
572
+ ue(async () => {
573
+ const w = await Ye();
574
574
  l.value = {
575
- Authorization: `Bearer ${h}`
575
+ Authorization: `Bearer ${w}`
576
576
  };
577
577
  });
578
- const s = (h) => ge(e.validations, h), c = Le(), i = c.apiBase, r = m(null), u = m("");
579
- function g(h, I, x) {
580
- return h.replace(/{WorkflowId}/g, I).replace(/{ClassName}/g, x);
578
+ const s = (w) => ge(e.validations, w), c = Re(), i = c.apiBase, r = g(null), u = g("");
579
+ function p(w, k, T) {
580
+ return w.replace(/{WorkflowId}/g, k).replace(/{ClassName}/g, T);
581
581
  }
582
- const _ = Z(() => {
582
+ const m = Z(() => {
583
583
  if (e.config.uploadURL) {
584
- const h = i + e.config.uploadURL;
585
- return g(h, u.value, e.className);
584
+ const w = i + e.config.uploadURL;
585
+ return p(w, u.value, e.className);
586
586
  }
587
587
  return "";
588
- }), b = (h) => {
589
- h.stopPropagation(), r.value.submit();
588
+ }), y = (w) => {
589
+ w.stopPropagation(), r.value.submit();
590
590
  };
591
- function p(h) {
592
- const { file: I, name: x } = h, V = x ?? I.name;
593
- return new Promise((y, N) => {
594
- ct.confirm({
591
+ function v(w) {
592
+ const { file: k, name: T } = w, V = T ?? k.name;
593
+ return new Promise((C, U) => {
594
+ lt.confirm({
595
595
  title: "Confirm Delete",
596
596
  content: `Are you sure you want to delete ${V}?`,
597
597
  async onOk() {
598
- if (h.status !== "init" && e.config.removeFile)
599
- return await e.config.removeFile(h.uid), y(!0);
600
- y(!0);
598
+ if (w.status !== "init" && e.config.removeFile)
599
+ return await e.config.removeFile(w.uid), C(!0);
600
+ C(!0);
601
601
  },
602
- onCancel: () => N("cancel")
602
+ onCancel: () => U("cancel")
603
603
  });
604
604
  });
605
605
  }
606
- const w = m(null), f = m(null), L = (h) => {
607
- w.value && (w.value(h), w.value = null, f.value = null);
608
- }, Y = (h) => {
609
- f.value && (f.value(h), w.value = null, f.value = null);
610
- }, z = m([]), te = (h) => {
611
- z.value = h.filter((I) => I.status === "init");
606
+ const h = g(null), f = g(null), L = (w) => {
607
+ h.value && (h.value(w), h.value = null, f.value = null);
608
+ }, W = (w) => {
609
+ f.value && (f.value(w), h.value = null, f.value = null);
610
+ }, G = g([]), te = (w) => {
611
+ G.value = w.filter((k) => k.status === "init");
612
612
  };
613
613
  n({
614
- submit(h) {
615
- return new Promise((I, x) => {
616
- r.value ? (e.config.uploadURL && (u.value = h), w.value = I, f.value = x, z.value.length ? ot(() => {
614
+ submit(w) {
615
+ return new Promise((k, T) => {
616
+ r.value ? (e.config.uploadURL && (u.value = w), h.value = k, f.value = T, G.value.length ? nt(() => {
617
617
  r.value?.submit();
618
- }) : I(h)) : I(h);
618
+ }) : k(w)) : k(w);
619
619
  });
620
620
  },
621
621
  validate() {
622
- const h = s(e.modelValue);
623
- return o("error", h.res ? "" : h.errorMessages), h.res;
622
+ const w = s(e.modelValue);
623
+ return o("error", w.res ? "" : w.errorMessages), w.res;
624
624
  }
625
625
  });
626
- const oe = { props: e, emits: o, headers: l, validate: s, config: c, ApiBase: i, uploadRef: r, id: u, replaceIdAndClassName: g, action: _, submit: b, onBeforeRemove: p, uploadPromiseResolve: w, uploadPromiseReject: f, handleUploadSuccess: L, handleUploadError: Y, readyFiles: z, onChange: te };
626
+ const oe = { props: e, emits: o, headers: l, validate: s, config: c, ApiBase: i, uploadRef: r, id: u, replaceIdAndClassName: p, action: m, submit: y, onBeforeRemove: v, uploadPromiseResolve: h, uploadPromiseReject: f, handleUploadSuccess: L, handleUploadError: W, readyFiles: G, onChange: te };
627
627
  return Object.defineProperty(oe, "__isScriptSetup", { enumerable: !1, value: !0 }), oe;
628
628
  }
629
629
  });
630
- function en(t, n, a, e, o, l) {
631
- const s = S("a-button"), c = S("a-upload");
630
+ function on(t, n, a, e, o, l) {
631
+ const s = A("a-button"), c = A("a-upload");
632
632
  return d(), P(c, {
633
633
  ref: "uploadRef",
634
634
  "default-file-list": e.props.config.files,
@@ -642,10 +642,10 @@ function en(t, n, a, e, o, l) {
642
642
  onSuccess: e.handleUploadSuccess,
643
643
  onError: e.handleUploadError
644
644
  }, {
645
- "start-icon": v(() => n[0] || (n[0] = [])),
646
- "upload-button": v(() => [
647
- D(s, { type: "primary" }, {
648
- default: v(() => n[1] || (n[1] = [
645
+ "start-icon": _(() => n[0] || (n[0] = [])),
646
+ "upload-button": _(() => [
647
+ N(s, { type: "primary" }, {
648
+ default: _(() => n[1] || (n[1] = [
649
649
  J("Select File", -1)
650
650
  ])),
651
651
  _: 1,
@@ -655,7 +655,7 @@ function en(t, n, a, e, o, l) {
655
655
  _: 1
656
656
  }, 8, ["default-file-list", "action", "limit", "headers"]);
657
657
  }
658
- const tn = /* @__PURE__ */ X(Zt, [["render", en], ["__file", "FileUpload.vue"]]), nn = /* @__PURE__ */ q({
658
+ const an = /* @__PURE__ */ X(nn, [["render", on], ["__file", "FileUpload.vue"]]), rn = /* @__PURE__ */ Y({
659
659
  __name: "TextArea",
660
660
  props: {
661
661
  fieldKey: {},
@@ -672,8 +672,8 @@ const tn = /* @__PURE__ */ X(Zt, [["render", en], ["__file", "FileUpload.vue"]])
672
672
  }, c = (r) => {
673
673
  o("update:modelValue", r);
674
674
  const u = l(r);
675
- o("error", u.res ? "" : u.errorMessages), e.triggers && e.triggers.length > 0 && e.triggers.forEach((g) => {
676
- g.event === "change" && o(g.event, g.handlerName, r);
675
+ o("error", u.res ? "" : u.errorMessages), e.triggers && e.triggers.length > 0 && e.triggers.forEach((p) => {
676
+ p.event === "change" && o(p.event, p.handlerName, r);
677
677
  });
678
678
  };
679
679
  n({
@@ -686,8 +686,8 @@ const tn = /* @__PURE__ */ X(Zt, [["render", en], ["__file", "FileUpload.vue"]])
686
686
  return Object.defineProperty(i, "__isScriptSetup", { enumerable: !1, value: !0 }), i;
687
687
  }
688
688
  });
689
- function on(t, n, a, e, o, l) {
690
- const s = S("ATextarea");
689
+ function sn(t, n, a, e, o, l) {
690
+ const s = A("ATextarea");
691
691
  return d(), P(s, {
692
692
  "model-value": e.props.modelValue,
693
693
  placeholder: "Please enter something",
@@ -697,7 +697,7 @@ function on(t, n, a, e, o, l) {
697
697
  onChange: e.changeHandler
698
698
  }, null, 8, ["model-value", "disabled"]);
699
699
  }
700
- const an = /* @__PURE__ */ X(nn, [["render", on], ["__file", "TextArea.vue"]]), rn = /* @__PURE__ */ q({
700
+ const ln = /* @__PURE__ */ X(rn, [["render", sn], ["__file", "TextArea.vue"]]), cn = /* @__PURE__ */ Y({
701
701
  __name: "CheckBox",
702
702
  props: /* @__PURE__ */ ie({
703
703
  fieldKey: {},
@@ -714,8 +714,8 @@ const an = /* @__PURE__ */ X(nn, [["render", on], ["__file", "TextArea.vue"]]),
714
714
  setup(t, { expose: n, emit: a }) {
715
715
  const e = t, o = a, l = ye(t, "modelValue"), s = (r) => ge(e.validations, r), c = (r) => {
716
716
  const u = s(r);
717
- o("error", u.res ? "" : u.errorMessages), e.triggers && e.triggers.length > 0 && e.triggers.forEach((g) => {
718
- g.event === "change" && o(g.event, g.handlerName, r);
717
+ o("error", u.res ? "" : u.errorMessages), e.triggers && e.triggers.length > 0 && e.triggers.forEach((p) => {
718
+ p.event === "change" && o(p.event, p.handlerName, r);
719
719
  });
720
720
  };
721
721
  n({
@@ -728,8 +728,8 @@ const an = /* @__PURE__ */ X(nn, [["render", on], ["__file", "TextArea.vue"]]),
728
728
  return Object.defineProperty(i, "__isScriptSetup", { enumerable: !1, value: !0 }), i;
729
729
  }
730
730
  });
731
- function sn(t, n, a, e, o, l) {
732
- const s = S("ACheckbox");
731
+ function dn(t, n, a, e, o, l) {
732
+ const s = A("ACheckbox");
733
733
  return d(), P(s, {
734
734
  modelValue: e.model,
735
735
  "onUpdate:modelValue": n[0] || (n[0] = (c) => e.model = c),
@@ -737,14 +737,14 @@ function sn(t, n, a, e, o, l) {
737
737
  disabled: e.props.readonly || e.props.config.Readonly,
738
738
  onChange: e.changeHandler
739
739
  }, {
740
- default: v(() => n[1] || (n[1] = [
740
+ default: _(() => n[1] || (n[1] = [
741
741
  J("Yes", -1)
742
742
  ])),
743
743
  _: 1,
744
744
  __: [1]
745
745
  }, 8, ["modelValue", "disabled"]);
746
746
  }
747
- const ln = /* @__PURE__ */ X(rn, [["render", sn], ["__file", "CheckBox.vue"]]), cn = /* @__PURE__ */ q({
747
+ const un = /* @__PURE__ */ X(cn, [["render", dn], ["__file", "CheckBox.vue"]]), fn = /* @__PURE__ */ Y({
748
748
  __name: "index",
749
749
  props: /* @__PURE__ */ ie({
750
750
  config: {},
@@ -760,41 +760,41 @@ const ln = /* @__PURE__ */ X(rn, [["render", sn], ["__file", "CheckBox.vue"]]),
760
760
  }),
761
761
  emits: /* @__PURE__ */ ie(["update:modelValue", "change", "error"], ["update:modelValue"]),
762
762
  setup(t, { expose: n, emit: a }) {
763
- const e = t, o = a, l = ye(t, "modelValue"), s = Ne("widgetRef"), c = Z(() => {
763
+ const e = t, o = a, l = ye(t, "modelValue"), s = He("widgetRef"), c = Z(() => {
764
764
  switch (e.config?.widget?.widget) {
765
765
  case "TextBox":
766
- return Ke;
766
+ return ze;
767
767
  case "Number":
768
- return Wt;
768
+ return Jt;
769
769
  case "SelectList":
770
- return ze;
770
+ return We;
771
771
  case "Cascade":
772
- return Qt;
773
- case "File":
774
772
  return tn;
775
- case "TextArea":
773
+ case "File":
776
774
  return an;
775
+ case "TextArea":
776
+ return ln;
777
777
  case "DropDown":
778
- return ze;
778
+ return We;
779
779
  case "CheckBox":
780
- return ln;
780
+ return un;
781
781
  default:
782
- return Ke;
782
+ return ze;
783
783
  }
784
- }), i = m(""), r = (b) => {
785
- i.value = b;
786
- }, u = (b, p) => {
787
- o("change", b, p);
784
+ }), i = g(""), r = (y) => {
785
+ i.value = y;
786
+ }, u = (y, v) => {
787
+ o("change", y, v);
788
788
  };
789
- function g() {
789
+ function p() {
790
790
  return e.config?.widget?.widget === "File";
791
791
  }
792
792
  n({
793
793
  isFileUpload() {
794
794
  return e.config?.widget?.widget === "File";
795
795
  },
796
- submit(b) {
797
- return g() ? s.value.submit(b) : Promise.resolve(b);
796
+ submit(y) {
797
+ return p() ? s.value.submit(y) : Promise.resolve(y);
798
798
  },
799
799
  validate() {
800
800
  return s.value?.validate();
@@ -803,24 +803,24 @@ const ln = /* @__PURE__ */ X(rn, [["render", sn], ["__file", "CheckBox.vue"]]),
803
803
  return e?.config?.widget?.title;
804
804
  }
805
805
  });
806
- const _ = { props: e, emits: o, model: l, widgetRef: s, curComp: c, errMsg: i, errHandler: r, changeHandler: u, isFileUpload: g };
807
- return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
806
+ const m = { props: e, emits: o, model: l, widgetRef: s, curComp: c, errMsg: i, errHandler: r, changeHandler: u, isFileUpload: p };
807
+ return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
808
808
  }
809
- }), dn = { class: "title" }, un = {
809
+ }), pn = { class: "title" }, mn = {
810
810
  key: 0,
811
811
  class: "required"
812
- }, fn = {
812
+ }, gn = {
813
813
  key: 0,
814
814
  class: "err-msg"
815
815
  };
816
- function pn(t, n, a, e, o, l) {
817
- return d(), C("div", null, [
818
- A("div", dn, [
816
+ function _n(t, n, a, e, o, l) {
817
+ return d(), S("div", null, [
818
+ x("div", pn, [
819
819
  J(Q(e.props?.config?.widget?.title) + " ", 1),
820
- e.props.config.validations.length ? (d(), C("span", un, "*")) : se("", !0)
820
+ e.props.config.validations.length ? (d(), S("span", mn, "*")) : re("", !0)
821
821
  ]),
822
- A("div", null, [
823
- (d(), P(He(e.curComp), {
822
+ x("div", null, [
823
+ (d(), P(Fe(e.curComp), {
824
824
  ref: "widgetRef",
825
825
  modelValue: e.model,
826
826
  "onUpdate:modelValue": n[0] || (n[0] = (s) => e.model = s),
@@ -832,11 +832,11 @@ function pn(t, n, a, e, o, l) {
832
832
  onError: e.errHandler,
833
833
  onChange: e.changeHandler
834
834
  }, null, 40, ["modelValue", "field-key", "config", "validations", "triggers", "class-name"])),
835
- e.errMsg.length > 0 ? (d(), C("div", fn, Q(e.errMsg), 1)) : se("", !0)
835
+ e.errMsg.length > 0 ? (d(), S("div", gn, Q(e.errMsg), 1)) : re("", !0)
836
836
  ])
837
837
  ]);
838
838
  }
839
- const Be = /* @__PURE__ */ X(cn, [["render", pn], ["__scopeId", "data-v-4bc9e33b"], ["__file", "index.vue"]]), mn = /* @__PURE__ */ q({
839
+ const je = /* @__PURE__ */ X(fn, [["render", _n], ["__scopeId", "data-v-4bc9e33b"], ["__file", "index.vue"]]), vn = /* @__PURE__ */ Y({
840
840
  __name: "SubmitButton",
841
841
  props: {
842
842
  url: {},
@@ -854,20 +854,20 @@ const Be = /* @__PURE__ */ X(cn, [["render", pn], ["__scopeId", "data-v-4bc9e33b
854
854
  return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
855
855
  }
856
856
  });
857
- function gn(t, n, a, e, o, l) {
858
- const s = S("AButton");
857
+ function bn(t, n, a, e, o, l) {
858
+ const s = A("AButton");
859
859
  return d(), P(s, {
860
860
  loading: a.loading,
861
861
  type: "primary",
862
862
  onClick: e.clickHandler
863
863
  }, {
864
- default: v(() => [
865
- le(t.$slots, "default")
864
+ default: _(() => [
865
+ de(t.$slots, "default")
866
866
  ]),
867
867
  _: 3
868
868
  }, 8, ["loading"]);
869
869
  }
870
- const _n = /* @__PURE__ */ X(mn, [["render", gn], ["__file", "SubmitButton.vue"]]), vn = /* @__PURE__ */ q({
870
+ const yn = /* @__PURE__ */ X(vn, [["render", bn], ["__file", "SubmitButton.vue"]]), hn = /* @__PURE__ */ Y({
871
871
  __name: "DetailLink",
872
872
  props: {
873
873
  url: {},
@@ -885,16 +885,16 @@ const _n = /* @__PURE__ */ X(mn, [["render", gn], ["__file", "SubmitButton.vue"]
885
885
  return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
886
886
  }
887
887
  });
888
- function bn(t, n, a, e, o, l) {
889
- const s = S("ALink");
888
+ function wn(t, n, a, e, o, l) {
889
+ const s = A("ALink");
890
890
  return d(), P(s, { onClick: e.clickHandler }, {
891
- default: v(() => [
892
- le(t.$slots, "default")
891
+ default: _(() => [
892
+ de(t.$slots, "default")
893
893
  ]),
894
894
  _: 3
895
895
  });
896
896
  }
897
- const yn = /* @__PURE__ */ X(vn, [["render", bn], ["__file", "DetailLink.vue"]]), wn = /* @__PURE__ */ q({
897
+ const kn = /* @__PURE__ */ X(hn, [["render", wn], ["__file", "DetailLink.vue"]]), Cn = /* @__PURE__ */ Y({
898
898
  __name: "index",
899
899
  props: {
900
900
  config: {},
@@ -904,52 +904,52 @@ const yn = /* @__PURE__ */ X(vn, [["render", bn], ["__file", "DetailLink.vue"]])
904
904
  setup(t, { expose: n, emit: a }) {
905
905
  n();
906
906
  const e = t, o = a;
907
- function l(u, g) {
908
- o("click", e.config.widget, u, g, e.config.title);
907
+ function l(u, p) {
908
+ o("click", e.config.widget, u, p, e.config.title);
909
909
  }
910
910
  const s = Z(() => {
911
911
  switch (e.config.location) {
912
912
  case "InOperation":
913
- return _n;
913
+ return yn;
914
914
  case "InTable":
915
915
  default:
916
- return yn;
916
+ return kn;
917
917
  }
918
918
  }), c = Z(() => e.config.widget === ee.Submit ? e.config.requestUrl ?? "" : e.config.widget === ee.Link ? e.config.redirectUrl ?? "" : ""), i = Z(() => e.config.redirectType ?? "Details"), r = { props: e, emits: o, clickHandler: l, curComp: s, curUrl: c, redirectType: i };
919
919
  return Object.defineProperty(r, "__isScriptSetup", { enumerable: !1, value: !0 }), r;
920
920
  }
921
921
  });
922
- function hn(t, n, a, e, o, l) {
923
- return d(), P(He(e.curComp), {
922
+ function Sn(t, n, a, e, o, l) {
923
+ return d(), P(Fe(e.curComp), {
924
924
  url: e.curUrl,
925
925
  "redirect-type": e.redirectType,
926
926
  loading: a.loading,
927
927
  onClick: e.clickHandler
928
928
  }, {
929
- default: v(() => [
929
+ default: _(() => [
930
930
  J(Q(e.props.config.title), 1)
931
931
  ]),
932
932
  _: 1
933
933
  }, 8, ["url", "redirect-type", "loading"]);
934
934
  }
935
- const Ce = /* @__PURE__ */ X(wn, [["render", hn], ["__file", "index.vue"]]), Qe = Symbol("library-router");
936
- function Se() {
937
- const t = me(Qe, null);
938
- return t || dt();
935
+ const Se = /* @__PURE__ */ X(Cn, [["render", Sn], ["__file", "index.vue"]]), Xe = Symbol("library-router");
936
+ function Ae() {
937
+ const t = me(Xe, null);
938
+ return t || ct();
939
939
  }
940
- const Ze = Symbol("library-triggers");
941
- function je() {
942
- const t = me(Ze, null);
940
+ const Qe = Symbol("library-triggers");
941
+ function Me() {
942
+ const t = me(Qe, null);
943
943
  return t || {};
944
944
  }
945
- const kn = Symbol("library-pinia"), et = Symbol("library-bpmStore"), tt = Symbol("library-svrStore");
945
+ const An = Symbol("library-pinia"), Ze = Symbol("library-bpmStore"), et = Symbol("library-svrStore");
946
946
  function xe() {
947
- return me(et, null);
947
+ return me(Ze, null);
948
948
  }
949
949
  function Ve() {
950
- return me(tt, null);
950
+ return me(et, null);
951
951
  }
952
- const Cn = /* @__PURE__ */ q({
952
+ const xn = /* @__PURE__ */ Y({
953
953
  __name: "TopBar",
954
954
  props: {
955
955
  title: {},
@@ -961,26 +961,26 @@ const Cn = /* @__PURE__ */ q({
961
961
  const a = {};
962
962
  return Object.defineProperty(a, "__isScriptSetup", { enumerable: !1, value: !0 }), a;
963
963
  }
964
- }), Sn = { class: "top-bar" }, xn = { class: "banner-info" }, Vn = { class: "page-title" }, An = { class: "page-subtitle" }, In = { class: "avatar-wrapper" }, Tn = { class: "user-email" };
965
- function Un(t, n, a, e, o, l) {
966
- const s = S("a-avatar"), c = S("a-popover");
967
- return d(), C("div", Sn, [
968
- A("div", xn, [
969
- A("div", Vn, Q(a.title), 1),
970
- A("div", An, Q(a.subTitle), 1)
964
+ }), Vn = { class: "top-bar" }, Tn = { class: "banner-info" }, In = { class: "page-title" }, Pn = { class: "page-subtitle" }, Nn = { class: "avatar-wrapper" }, Un = { class: "user-email" };
965
+ function Dn(t, n, a, e, o, l) {
966
+ const s = A("a-avatar"), c = A("a-popover");
967
+ return d(), S("div", Vn, [
968
+ x("div", Tn, [
969
+ x("div", In, Q(a.title), 1),
970
+ x("div", Pn, Q(a.subTitle), 1)
971
971
  ]),
972
- A("div", In, [
973
- D(c, { trigger: "click" }, {
974
- content: v(() => [
975
- A("div", Tn, Q(a.email), 1)
972
+ x("div", Nn, [
973
+ N(c, { trigger: "click" }, {
974
+ content: _(() => [
975
+ x("div", Un, Q(a.email), 1)
976
976
  ]),
977
- default: v(() => [
978
- D(s, {
977
+ default: _(() => [
978
+ N(s, {
979
979
  size: 48,
980
980
  autoFixFontSize: "",
981
981
  style: { cursor: "pointer", background: "#165DFF", color: "#fff" }
982
982
  }, {
983
- default: v(() => [
983
+ default: _(() => [
984
984
  J(Q(a.email.charAt(0).toUpperCase()), 1)
985
985
  ]),
986
986
  _: 1
@@ -991,9 +991,9 @@ function Un(t, n, a, e, o, l) {
991
991
  ])
992
992
  ]);
993
993
  }
994
- const Ae = /* @__PURE__ */ X(Cn, [["render", Un], ["__scopeId", "data-v-c0457235"], ["__file", "TopBar.vue"]]);
995
- function Me(t) {
996
- const n = Le(), a = [];
994
+ const Te = /* @__PURE__ */ X(xn, [["render", Dn], ["__scopeId", "data-v-c0457235"], ["__file", "TopBar.vue"]]);
995
+ function Oe(t) {
996
+ const n = Re(), a = [];
997
997
  if (n.fieldsGroup) {
998
998
  n.fieldsGroup.forEach((l) => {
999
999
  const s = l.keys.map((c) => t.find((i) => i.fieldKey === c)).filter(Boolean);
@@ -1003,14 +1003,87 @@ function Me(t) {
1003
1003
  return o.length && a.push({ name: "Previous Grading (if applicable)", fields: o }), a;
1004
1004
  }
1005
1005
  }
1006
- const Pn = /* @__PURE__ */ q({
1006
+ class Ie {
1007
+ pageActionType;
1008
+ className = "";
1009
+ store = { svrStore: {}, bpmStore: {} };
1010
+ opt = { workflowId: "" };
1011
+ setWorkflowId(n) {
1012
+ return n ? (this.opt.workflowId = n, this) : this;
1013
+ }
1014
+ setPageActionType(n) {
1015
+ return this.pageActionType = n, this;
1016
+ }
1017
+ setClassName(n) {
1018
+ return this.className = n, this;
1019
+ }
1020
+ setStore(n) {
1021
+ return this.store = n, this;
1022
+ }
1023
+ setOpt(n) {
1024
+ return this.opt = n, this;
1025
+ }
1026
+ build() {
1027
+ return this.pageActionType ? this.opt.workflowId ? new Ce(this.pageActionType, this.className, this.store, this.opt) : new Ce(this.pageActionType, this.className, this.store) : this.opt.workflowId ? new Ce(fe.ReCreate, this.className, this.store, this.opt) : new Ce(fe.Create, this.className, this.store);
1028
+ }
1029
+ }
1030
+ class Ce {
1031
+ pageActionType;
1032
+ className;
1033
+ store;
1034
+ opt;
1035
+ getApproverEmail() {
1036
+ return this.store.svrStore()?.userInfo?.email_address ?? "";
1037
+ }
1038
+ getWorkflowId() {
1039
+ return this.opt?.workflowId ?? "";
1040
+ }
1041
+ constructor(n, a, e, o) {
1042
+ this.pageActionType = n, this.className = a, this.store = e, o && (this.opt = o);
1043
+ }
1044
+ getPageData() {
1045
+ return this.opt ? Ke(this.pageActionType, this.className, this.store, this.opt) : Ke(this.pageActionType, this.className, this.store);
1046
+ }
1047
+ getBtnList() {
1048
+ return kt(this.pageActionType, this.className, { workflowId: this.getWorkflowId(), email: this.getApproverEmail() });
1049
+ }
1050
+ getFiles() {
1051
+ return Ft(this.className, this.getWorkflowId());
1052
+ }
1053
+ removeFile(n) {
1054
+ return Lt(this.className, n);
1055
+ }
1056
+ getProcess() {
1057
+ return Dt(this.className, this.getWorkflowId());
1058
+ }
1059
+ getCommentsHistory() {
1060
+ return Mt(this.getWorkflowId());
1061
+ }
1062
+ getAssociator() {
1063
+ return Ot(this.getWorkflowId());
1064
+ }
1065
+ getApprovers() {
1066
+ return Rt();
1067
+ }
1068
+ assignApprover(n) {
1069
+ return Bt(this.getWorkflowId(), n);
1070
+ }
1071
+ addComments(n) {
1072
+ return jt(this.getWorkflowId(), this.getApproverEmail(), n);
1073
+ }
1074
+ deleteAssociator(n) {
1075
+ return Et(n);
1076
+ }
1077
+ }
1078
+ const Hn = /* @__PURE__ */ Y({
1007
1079
  __name: "CreateView",
1008
1080
  props: {
1009
- className: {}
1081
+ className: {},
1082
+ workflowId: {}
1010
1083
  },
1011
1084
  setup(t, { expose: n }) {
1012
1085
  n();
1013
- const a = xe(), e = Ve(), o = Se(), l = je(), s = Ne("dataWidgets"), c = pe(), i = t, r = m({
1086
+ const a = xe(), e = Ve(), o = Ae(), l = Me(), s = He("dataWidgets"), c = pe(), i = t, r = g({
1014
1087
  pageType: "",
1015
1088
  fields: {},
1016
1089
  globalValidations: [],
@@ -1018,105 +1091,104 @@ const Pn = /* @__PURE__ */ q({
1018
1091
  title: "",
1019
1092
  subTitle: ""
1020
1093
  }
1021
- }), u = m([]), g = m({});
1022
- function _(x) {
1023
- return x ? Object.entries(x).map(([y, N]) => ({
1024
- fieldKey: y,
1025
- ...N
1026
- })).filter((y) => y.widget && y.widget.widget !== "Hidden").filter((y) => !te.value.includes(y.fieldKey)) : [];
1094
+ }), u = g([]), p = g({});
1095
+ function m(T) {
1096
+ return T ? Object.entries(T).map(([C, U]) => ({
1097
+ fieldKey: C,
1098
+ ...U
1099
+ })).filter((C) => C.widget && C.widget.widget !== "Hidden").filter((C) => !te.value.includes(C.fieldKey)) : [];
1027
1100
  }
1028
- function b(x) {
1029
- return x ? Object.entries(x).filter(([y, N]) => N.dependent).reduce((y, [N, M]) => (y[N] = M.dependent, y), {}) : [];
1101
+ function y(T) {
1102
+ return T ? Object.entries(T).filter(([C, U]) => U.dependent).reduce((C, [U, M]) => (C[U] = M.dependent, C), {}) : [];
1030
1103
  }
1031
- const p = Z(() => r.value?.actions ? [...r.value.actions].reverse() : []), w = Fe({}), f = m(!1);
1032
- ce(async () => {
1033
- f.value = !0, r.value = await ke(fe.Create, i.className, {
1034
- svrStore: e,
1035
- bpmStore: a
1036
- }), u.value = _(r.value.fields), g.value = b(r.value.fields);
1037
- for (const x in r.value.fields) {
1038
- if (r.value.fields[x].widget?.widget === "File") {
1039
- const V = u.value.find((y) => y.fieldKey === x);
1040
- V && V.widget && (V.widget.files = []);
1104
+ const v = Z(() => r.value?.actions ? [...r.value.actions].reverse() : []), h = Le({}), f = g(!1);
1105
+ ue(async () => {
1106
+ f.value = !0;
1107
+ const T = new Ie().setWorkflowId(i.workflowId).setClassName(i.className).setStore({ svrStore: e, bpmStore: a }).build();
1108
+ r.value = await T.getPageData(), u.value = m(r.value.fields), p.value = y(r.value.fields);
1109
+ for (const V in r.value.fields) {
1110
+ if (r.value.fields[V].widget?.widget === "File") {
1111
+ const C = u.value.find((U) => U.fieldKey === V);
1112
+ C && C.widget && (C.widget.files = []);
1041
1113
  }
1042
- w[x] = r.value.fields[x].modelValue;
1114
+ h[V] = r.value.fields[V].modelValue;
1043
1115
  }
1044
1116
  f.value = !1;
1045
1117
  });
1046
1118
  function L() {
1047
1119
  return e()?.userInfo?.email_address ?? "";
1048
1120
  }
1049
- async function Y(x, V, y, N, M) {
1121
+ async function W(T, V, C, U, M) {
1050
1122
  switch (V) {
1051
1123
  case ee.Submit:
1052
- let O = !0;
1053
- if (s.value?.forEach((G) => {
1054
- G?.validate && (G.validate() || (O = !1));
1055
- }), !O) {
1124
+ let R = !0;
1125
+ if (s.value?.forEach((E) => {
1126
+ E?.validate && (E.validate() || (R = !1));
1127
+ }), !R) {
1056
1128
  c?.appContext.config.globalProperties.$message.error("form validation failed, please check the input fields");
1057
1129
  return;
1058
1130
  }
1059
1131
  f.value = !0;
1060
1132
  try {
1061
- const G = await St(i.className, { ...w, ...g.value }, y), ae = s.value?.map((de) => de?.submit ? de.submit(G.toString()) : Promise.resolve()) || [];
1062
- await Promise.all(ae), f.value = !1, c?.appContext.config.globalProperties.$notification.success(`Your grading request has been submitted, ID is ${G.toString()}.`), o.push({ name: "Details", params: { workflowId: G.toString() } });
1133
+ const E = await St(i.className, { ...h, ...p.value }, C), le = s.value?.map((ce) => ce?.submit ? ce.submit(E.toString()) : Promise.resolve()) || [];
1134
+ await Promise.all(le), f.value = !1, c?.appContext.config.globalProperties.$notification.success(`Your grading request has been submitted, ID is ${E.toString()}.`), o.push({ name: "Details", params: { workflowId: E.toString() } });
1063
1135
  } catch {
1064
1136
  c?.appContext.config.globalProperties.$notification.error("Failed to submit your grading request"), f.value = !1;
1065
1137
  }
1066
1138
  break;
1067
1139
  case ee.Link:
1068
1140
  try {
1069
- await l[x.eventName || ""]?.(w, te), o.push({ name: N, params: { className: i.className } });
1070
- } catch (G) {
1071
- console.error("Error in link action trigger:", G);
1141
+ await l[T.eventName || ""]?.(h, te), o.push({ name: U, params: { className: i.className } });
1142
+ } catch (E) {
1143
+ console.error("Error in link action trigger:", E);
1072
1144
  }
1073
1145
  break;
1074
1146
  default:
1075
1147
  console.warn("Unknown action type:", V);
1076
1148
  }
1077
1149
  }
1078
- const z = [
1150
+ const G = [
1079
1151
  "jobScpope",
1080
1152
  "currentWorkdayId",
1081
1153
  "originalGrade",
1082
1154
  "jobTitlePrevious",
1083
1155
  "jobAttachmentPrevious",
1084
1156
  "positionId"
1085
- ], te = m(z);
1086
- function oe(x, V) {
1087
- l[x]?.(V, te), r.value && (u.value = _(r.value.fields));
1157
+ ], te = g(G);
1158
+ function oe(T, V) {
1159
+ l[T]?.(V, te), r.value && (u.value = m(r.value.fields));
1088
1160
  }
1089
- const h = Z(() => Me(u.value)), I = { bpmStore: a, svrStore: e, router: o, triggers: l, dataWidgetsRefs: s, instance: c, props: i, pageData: r, _fields: u, _dependent: g, genField: _, genDependentField: b, reversedActions: p, _data: w, loading: f, getApproverEmail: L, clickHandler: Y, newHiddenFields: z, hiddenFields: te, changeHandler: oe, groupedFields: h, DataWidgets: Be, ActionButton: Ce, TopBar: Ae };
1090
- return Object.defineProperty(I, "__isScriptSetup", { enumerable: !1, value: !0 }), I;
1161
+ const w = Z(() => Oe(u.value)), k = { bpmStore: a, svrStore: e, router: o, triggers: l, dataWidgetsRefs: s, instance: c, props: i, pageData: r, _fields: u, _dependent: p, genField: m, genDependentField: y, reversedActions: v, _data: h, loading: f, getApproverEmail: L, clickHandler: W, newHiddenFields: G, hiddenFields: te, changeHandler: oe, groupedFields: w, DataWidgets: je, ActionButton: Se, TopBar: Te };
1162
+ return Object.defineProperty(k, "__isScriptSetup", { enumerable: !1, value: !0 }), k;
1091
1163
  }
1092
- }), Dn = { class: "page-container" }, Nn = { class: "page-body" }, Hn = { class: "form-card" }, Fn = { class: "form-fields-vertical" }, Ln = { class: "form-fields" }, Rn = {
1164
+ }), Fn = { class: "page-container" }, Ln = { class: "page-body" }, Rn = { class: "form-card" }, Bn = { class: "form-fields-vertical" }, jn = { class: "form-fields" }, Mn = {
1093
1165
  key: 0,
1094
1166
  class: "form-content"
1095
- }, Bn = { class: "page-footer" }, jn = { class: "action-container" }, Mn = { class: "action-buttons" };
1096
- function On(t, n, a, e, o, l) {
1097
- const s = S("a-card"), c = S("a-spin");
1098
- return d(), C("div", Dn, [
1099
- D(e.TopBar, {
1167
+ }, On = { class: "page-footer" }, En = { class: "action-container" }, $n = { class: "action-buttons" };
1168
+ function Kn(t, n, a, e, o, l) {
1169
+ const s = A("a-card"), c = A("a-spin");
1170
+ return d(), S("div", Fn, [
1171
+ N(e.TopBar, {
1100
1172
  title: e.pageData.banner.title,
1101
1173
  subTitle: e.pageData.banner.subTitle,
1102
1174
  email: e.getApproverEmail()
1103
1175
  }, null, 8, ["title", "subTitle", "email"]),
1104
- A("div", Nn, [
1105
- D(c, {
1176
+ x("div", Ln, [
1177
+ N(c, {
1106
1178
  loading: e.loading,
1107
1179
  class: "form-container"
1108
1180
  }, {
1109
- default: v(() => [
1110
- A("div", Hn, [
1111
- A("div", Fn, [
1112
- (d(!0), C(j, null, $(e.groupedFields, (i) => (d(), P(s, {
1181
+ default: _(() => [
1182
+ x("div", Rn, [
1183
+ x("div", Bn, [
1184
+ (d(!0), S(O, null, K(e.groupedFields, (i) => (d(), P(s, {
1113
1185
  key: i.name,
1114
1186
  title: i.name,
1115
1187
  style: { "margin-bottom": "24px" }
1116
1188
  }, {
1117
- default: v(() => [
1118
- A("div", Ln, [
1119
- (d(!0), C(j, null, $(i.fields, (r) => (d(), P(e.DataWidgets, {
1189
+ default: _(() => [
1190
+ x("div", jn, [
1191
+ (d(!0), S(O, null, K(i.fields, (r) => (d(), P(e.DataWidgets, {
1120
1192
  key: r.fieldKey,
1121
1193
  ref_for: !0,
1122
1194
  ref: "dataWidgets",
@@ -1133,19 +1205,19 @@ function On(t, n, a, e, o, l) {
1133
1205
  _: 2
1134
1206
  }, 1032, ["title"]))), 128))
1135
1207
  ]),
1136
- t.$slots.content ? (d(), C("div", Rn, [
1137
- le(t.$slots, "content", {}, void 0, !0)
1138
- ])) : se("", !0)
1208
+ t.$slots.content ? (d(), S("div", Mn, [
1209
+ de(t.$slots, "content", {}, void 0, !0)
1210
+ ])) : re("", !0)
1139
1211
  ])
1140
1212
  ]),
1141
1213
  _: 3
1142
1214
  }, 8, ["loading"])
1143
1215
  ]),
1144
- A("div", Bn, [
1145
- A("div", jn, [
1146
- le(t.$slots, "action", {}, void 0, !0),
1147
- A("div", Mn, [
1148
- (d(!0), C(j, null, $(e.reversedActions, (i) => (d(), P(e.ActionButton, {
1216
+ x("div", On, [
1217
+ x("div", En, [
1218
+ de(t.$slots, "action", {}, void 0, !0),
1219
+ x("div", $n, [
1220
+ (d(!0), S(O, null, K(e.reversedActions, (i) => (d(), P(e.ActionButton, {
1149
1221
  key: i.Title,
1150
1222
  loading: e.loading,
1151
1223
  config: i,
@@ -1157,7 +1229,7 @@ function On(t, n, a, e, o, l) {
1157
1229
  ])
1158
1230
  ]);
1159
1231
  }
1160
- const En = /* @__PURE__ */ X(Pn, [["render", On], ["__scopeId", "data-v-7b45a965"], ["__file", "CreateView.vue"]]), $n = /* @__PURE__ */ q({
1232
+ const zn = /* @__PURE__ */ X(Hn, [["render", Kn], ["__scopeId", "data-v-c33c4a8c"], ["__file", "CreateView.vue"]]), Wn = /* @__PURE__ */ Y({
1161
1233
  __name: "UpdateView",
1162
1234
  props: {
1163
1235
  className: {},
@@ -1165,7 +1237,7 @@ const En = /* @__PURE__ */ X(Pn, [["render", On], ["__scopeId", "data-v-7b45a965
1165
1237
  },
1166
1238
  setup(t, { expose: n }) {
1167
1239
  n();
1168
- const a = Se(), e = je(), o = Ve(), l = xe(), s = Ne("dataWidgets"), c = pe(), i = t, r = m({
1240
+ const a = Ae(), e = Me(), o = Ve(), l = xe(), s = He("dataWidgets"), c = pe(), i = t, r = g({
1169
1241
  pageType: "",
1170
1242
  fields: {},
1171
1243
  globalValidations: [],
@@ -1173,106 +1245,103 @@ const En = /* @__PURE__ */ X(Pn, [["render", On], ["__scopeId", "data-v-7b45a965
1173
1245
  title: "",
1174
1246
  subTitle: ""
1175
1247
  }
1176
- }), u = m([]), g = m({});
1177
- function _(I) {
1178
- return I ? Object.entries(I).map(([V, y]) => ({
1248
+ }), u = g([]), p = g({});
1249
+ function m(k) {
1250
+ return k ? Object.entries(k).map(([V, C]) => ({
1179
1251
  fieldKey: V,
1180
- ...y
1181
- })).filter((V) => V.widget && V.widget.widget !== "Hidden").filter((V) => !z.value.includes(V.fieldKey)) : [];
1252
+ ...C
1253
+ })).filter((V) => V.widget && V.widget.widget !== "Hidden").filter((V) => !G.value.includes(V.fieldKey)) : [];
1182
1254
  }
1183
- function b(I) {
1184
- return I ? Object.entries(I).filter(([V, y]) => y.dependent).reduce((V, [y, N]) => (V[y] = N.dependent, V), {}) : [];
1255
+ function y(k) {
1256
+ return k ? Object.entries(k).filter(([V, C]) => C.dependent).reduce((V, [C, U]) => (V[C] = U.dependent, V), {}) : [];
1185
1257
  }
1186
- const p = Z(() => r.value?.actions ? [...r.value.actions].reverse() : []), w = Fe({}), f = m(!1);
1187
- ce(async () => {
1188
- f.value = !0, r.value = await ke(fe.Update, i.className, {
1189
- svrStore: o,
1190
- bpmStore: l
1191
- }, {
1192
- workflowId: i.workflowId
1193
- });
1194
- const I = await Je(fe.Update, i.className, { workflowId: i.workflowId, email: L() }), x = await Xe(i.className, i.workflowId);
1195
- r.value.actions = r.value.actions?.filter((y) => {
1196
- const N = I.find((M) => M.button === y.title);
1197
- return N ? N.isShow : !0;
1258
+ const v = Z(() => r.value?.actions ? [...r.value.actions].reverse() : []), h = Le({}), f = g(!1);
1259
+ ue(async () => {
1260
+ f.value = !0;
1261
+ const k = new Ie().setPageActionType(fe.Update).setClassName(i.className).setStore({ svrStore: o, bpmStore: l }).setWorkflowId(i.workflowId).build();
1262
+ r.value = await k.getPageData();
1263
+ const T = await k.getBtnList(), V = await k.getFiles();
1264
+ r.value.actions = r.value.actions?.filter((U) => {
1265
+ const M = T.find((R) => R.button === U.title);
1266
+ return M ? M.isShow : !0;
1198
1267
  });
1199
- const V = r.value.fields.requestType.modelValue;
1200
- e.Test?.(V, z), u.value = _(r.value.fields), g.value = b(r.value.fields);
1201
- for (const y in r.value.fields) {
1202
- if (r.value.fields[y].widget?.widget === "File") {
1203
- const N = u.value.find((M) => M.fieldKey === y);
1204
- N && N.widget && (N.widget.files = x[y] ?? [], N.widget.removeFile = (M) => Ft(i.className, M));
1268
+ const C = r.value.fields.requestType.modelValue;
1269
+ e.Test?.(C, G), u.value = m(r.value.fields), p.value = y(r.value.fields);
1270
+ for (const U in r.value.fields) {
1271
+ if (r.value.fields[U].widget?.widget === "File") {
1272
+ const M = u.value.find((R) => R.fieldKey === U);
1273
+ M && M.widget && (M.widget.files = V[U] ?? [], M.widget.removeFile = (R) => k.removeFile(R));
1205
1274
  }
1206
- w[y] = r.value.fields[y].modelValue;
1275
+ h[U] = r.value.fields[U].modelValue;
1207
1276
  }
1208
1277
  f.value = !1;
1209
1278
  });
1210
1279
  function L() {
1211
1280
  return o()?.userInfo?.email_address ?? "";
1212
1281
  }
1213
- async function Y(I, x, V, y, N) {
1214
- switch (x) {
1282
+ async function W(k, T, V, C, U) {
1283
+ switch (T) {
1215
1284
  case ee.Submit:
1216
1285
  let M = !0;
1217
- if (s.value?.forEach((O) => {
1218
- O?.validate && (O.validate() || (M = !1));
1286
+ if (s.value?.forEach((R) => {
1287
+ R?.validate && (R.validate() || (M = !1));
1219
1288
  }), !M) {
1220
1289
  c?.appContext.config.globalProperties.$message.error("form validation failed, please check the input fields");
1221
1290
  return;
1222
1291
  }
1223
1292
  f.value = !0;
1224
1293
  try {
1225
- const O = await xt(i.className, i.workflowId, { ...w, ...g.value }, V), G = s.value?.map((ae) => ae?.submit ? ae.submit(O.toString()) : Promise.resolve()) || [];
1226
- await Promise.all(G), f.value = !1, c?.appContext.config.globalProperties.$notification.success(`Your grading request has been submitted, ID is ${O.toString()}.`);
1294
+ const R = await At(i.className, i.workflowId, { ...h, ...p.value }, V), E = s.value?.map((le) => le?.submit ? le.submit(R.toString()) : Promise.resolve()) || [];
1295
+ await Promise.all(E), f.value = !1, c?.appContext.config.globalProperties.$notification.success(`Your grading request has been submitted, ID is ${R.toString()}.`);
1227
1296
  } catch {
1228
1297
  c?.appContext.config.globalProperties.$notification.error("Failed to submit your grading request"), f.value = !1;
1229
1298
  }
1230
1299
  break;
1231
1300
  case ee.Link:
1232
1301
  try {
1233
- await e[I.eventName || ""]?.(w, z), a.push({ name: y, params: { className: i.className } });
1302
+ await e[k.eventName || ""]?.(h, G), a.push({ name: C, params: { className: i.className } });
1234
1303
  } catch {
1235
1304
  }
1236
1305
  break;
1237
1306
  default:
1238
- console.warn("Unknown action type:", x);
1307
+ console.warn("Unknown action type:", T);
1239
1308
  }
1240
1309
  }
1241
- const z = m([]);
1242
- function te(I, x) {
1243
- e[I]?.(x, z), r.value && (u.value = _(r.value.fields));
1310
+ const G = g([]);
1311
+ function te(k, T) {
1312
+ e[k]?.(T, G), r.value && (u.value = m(r.value.fields));
1244
1313
  }
1245
- const oe = Z(() => Me(u.value)), h = { router: a, triggers: e, svrStore: o, bpmStore: l, dataWidgetsRefs: s, instance: c, props: i, pageData: r, _fields: u, _dependent: g, genField: _, genDependentField: b, reversedActions: p, _data: w, loading: f, getApproverEmail: L, clickHandler: Y, hiddenFields: z, changeHandler: te, groupedFields: oe, DataWidgets: Be, ActionButton: Ce, TopBar: Ae };
1246
- return Object.defineProperty(h, "__isScriptSetup", { enumerable: !1, value: !0 }), h;
1314
+ const oe = Z(() => Oe(u.value)), w = { router: a, triggers: e, svrStore: o, bpmStore: l, dataWidgetsRefs: s, instance: c, props: i, pageData: r, _fields: u, _dependent: p, genField: m, genDependentField: y, reversedActions: v, _data: h, loading: f, getApproverEmail: L, clickHandler: W, hiddenFields: G, changeHandler: te, groupedFields: oe, DataWidgets: je, ActionButton: Se, TopBar: Te };
1315
+ return Object.defineProperty(w, "__isScriptSetup", { enumerable: !1, value: !0 }), w;
1247
1316
  }
1248
- }), Kn = { class: "page-container" }, zn = { class: "page-body" }, Gn = { class: "form-card" }, Wn = { class: "form-fields-vertical" }, qn = { class: "form-fields" }, Yn = {
1317
+ }), Gn = { class: "page-container" }, qn = { class: "page-body" }, Yn = { class: "form-card" }, Jn = { class: "form-fields-vertical" }, Xn = { class: "form-fields" }, Qn = {
1249
1318
  key: 0,
1250
1319
  class: "form-content"
1251
- }, Jn = { class: "page-footer" }, Xn = { class: "action-container" }, Qn = { class: "action-buttons" };
1252
- function Zn(t, n, a, e, o, l) {
1253
- const s = S("a-card"), c = S("a-spin");
1254
- return d(), C("div", Kn, [
1255
- D(e.TopBar, {
1320
+ }, Zn = { class: "page-footer" }, eo = { class: "action-container" }, to = { class: "action-buttons" };
1321
+ function no(t, n, a, e, o, l) {
1322
+ const s = A("a-card"), c = A("a-spin");
1323
+ return d(), S("div", Gn, [
1324
+ N(e.TopBar, {
1256
1325
  title: e.pageData.banner.title,
1257
1326
  subTitle: e.pageData.banner.subTitle,
1258
1327
  email: e.getApproverEmail()
1259
1328
  }, null, 8, ["title", "subTitle", "email"]),
1260
- A("div", zn, [
1261
- D(c, {
1329
+ x("div", qn, [
1330
+ N(c, {
1262
1331
  loading: e.loading,
1263
1332
  class: "form-container"
1264
1333
  }, {
1265
- default: v(() => [
1266
- A("div", Gn, [
1267
- A("div", Wn, [
1268
- (d(!0), C(j, null, $(e.groupedFields, (i) => (d(), P(s, {
1334
+ default: _(() => [
1335
+ x("div", Yn, [
1336
+ x("div", Jn, [
1337
+ (d(!0), S(O, null, K(e.groupedFields, (i) => (d(), P(s, {
1269
1338
  key: i.name,
1270
1339
  title: i.name,
1271
1340
  style: { "margin-bottom": "24px" }
1272
1341
  }, {
1273
- default: v(() => [
1274
- A("div", qn, [
1275
- (d(!0), C(j, null, $(i.fields, (r) => (d(), P(e.DataWidgets, {
1342
+ default: _(() => [
1343
+ x("div", Xn, [
1344
+ (d(!0), S(O, null, K(i.fields, (r) => (d(), P(e.DataWidgets, {
1276
1345
  key: r.fieldKey,
1277
1346
  ref_for: !0,
1278
1347
  ref: "dataWidgets",
@@ -1289,19 +1358,19 @@ function Zn(t, n, a, e, o, l) {
1289
1358
  _: 2
1290
1359
  }, 1032, ["title"]))), 128))
1291
1360
  ]),
1292
- t.$slots.content ? (d(), C("div", Yn, [
1293
- le(t.$slots, "content", {}, void 0, !0)
1294
- ])) : se("", !0)
1361
+ t.$slots.content ? (d(), S("div", Qn, [
1362
+ de(t.$slots, "content", {}, void 0, !0)
1363
+ ])) : re("", !0)
1295
1364
  ])
1296
1365
  ]),
1297
1366
  _: 3
1298
1367
  }, 8, ["loading"])
1299
1368
  ]),
1300
- A("div", Jn, [
1301
- A("div", Xn, [
1302
- le(t.$slots, "action", {}, void 0, !0),
1303
- A("div", Qn, [
1304
- (d(!0), C(j, null, $(e.reversedActions, (i) => (d(), P(e.ActionButton, {
1369
+ x("div", Zn, [
1370
+ x("div", eo, [
1371
+ de(t.$slots, "action", {}, void 0, !0),
1372
+ x("div", to, [
1373
+ (d(!0), S(O, null, K(e.reversedActions, (i) => (d(), P(e.ActionButton, {
1305
1374
  key: i.Title,
1306
1375
  loading: e.loading,
1307
1376
  config: i,
@@ -1313,24 +1382,24 @@ function Zn(t, n, a, e, o, l) {
1313
1382
  ])
1314
1383
  ]);
1315
1384
  }
1316
- const eo = /* @__PURE__ */ X($n, [["render", Zn], ["__scopeId", "data-v-72d4c7ff"], ["__file", "UpdateView.vue"]]), nt = Symbol("library-custom-comp");
1317
- function to() {
1318
- return me(nt, null);
1385
+ const oo = /* @__PURE__ */ X(Wn, [["render", no], ["__scopeId", "data-v-a3a1735a"], ["__file", "UpdateView.vue"]]), tt = Symbol("library-custom-comp");
1386
+ function ao() {
1387
+ return me(tt, null);
1319
1388
  }
1320
- const no = Symbol("ArcoConfigProvider"), oo = "arco", ao = "$arco", ro = (t) => {
1389
+ const ro = Symbol("ArcoConfigProvider"), so = "arco", io = "$arco", lo = (t) => {
1321
1390
  var n, a, e;
1322
- const o = pe(), l = me(no, void 0);
1323
- return `${(e = (a = l?.prefixCls) != null ? a : (n = o?.appContext.config.globalProperties[ao]) == null ? void 0 : n.classPrefix) != null ? e : oo}-${t}`;
1324
- }, so = Object.prototype.toString;
1325
- function io(t) {
1326
- return so.call(t) === "[object Number]" && t === t;
1391
+ const o = pe(), l = me(ro, void 0);
1392
+ return `${(e = (a = l?.prefixCls) != null ? a : (n = o?.appContext.config.globalProperties[io]) == null ? void 0 : n.classPrefix) != null ? e : so}-${t}`;
1393
+ }, co = Object.prototype.toString;
1394
+ function uo(t) {
1395
+ return co.call(t) === "[object Number]" && t === t;
1327
1396
  }
1328
- var lo = (t, n) => {
1397
+ var fo = (t, n) => {
1329
1398
  for (const [a, e] of n)
1330
1399
  t[a] = e;
1331
1400
  return t;
1332
1401
  };
1333
- const co = q({
1402
+ const po = Y({
1334
1403
  name: "IconDownload",
1335
1404
  props: {
1336
1405
  size: {
@@ -1357,9 +1426,9 @@ const co = q({
1357
1426
  click: (t) => !0
1358
1427
  },
1359
1428
  setup(t, { emit: n }) {
1360
- const a = ro("icon"), e = Z(() => [a, `${a}-download`, { [`${a}-spin`]: t.spin }]), o = Z(() => {
1429
+ const a = lo("icon"), e = Z(() => [a, `${a}-download`, { [`${a}-spin`]: t.spin }]), o = Z(() => {
1361
1430
  const s = {};
1362
- return t.size && (s.fontSize = io(t.size) ? `${t.size}px` : t.size), t.rotate && (s.transform = `rotate(${t.rotate}deg)`), s;
1431
+ return t.size && (s.fontSize = uo(t.size) ? `${t.size}px` : t.size), t.rotate && (s.transform = `rotate(${t.rotate}deg)`), s;
1363
1432
  });
1364
1433
  return {
1365
1434
  cls: e,
@@ -1369,31 +1438,31 @@ const co = q({
1369
1438
  }
1370
1439
  };
1371
1440
  }
1372
- }), uo = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
1373
- function fo(t, n, a, e, o, l) {
1374
- return d(), C("svg", {
1441
+ }), mo = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
1442
+ function go(t, n, a, e, o, l) {
1443
+ return d(), S("svg", {
1375
1444
  viewBox: "0 0 48 48",
1376
1445
  fill: "none",
1377
1446
  xmlns: "http://www.w3.org/2000/svg",
1378
1447
  stroke: "currentColor",
1379
- class: rt(t.cls),
1380
- style: at(t.innerStyle),
1448
+ class: at(t.cls),
1449
+ style: ot(t.innerStyle),
1381
1450
  "stroke-width": t.strokeWidth,
1382
1451
  "stroke-linecap": t.strokeLinecap,
1383
1452
  "stroke-linejoin": t.strokeLinejoin,
1384
1453
  onClick: n[0] || (n[0] = (...s) => t.onClick && t.onClick(...s))
1385
1454
  }, n[1] || (n[1] = [
1386
- A("path", { d: "m33.072 22.071-9.07 9.071-9.072-9.07M24 5v26m16 4v6H8v-6" }, null, -1)
1387
- ]), 14, uo);
1455
+ x("path", { d: "m33.072 22.071-9.07 9.071-9.072-9.07M24 5v26m16 4v6H8v-6" }, null, -1)
1456
+ ]), 14, mo);
1388
1457
  }
1389
- var Pe = /* @__PURE__ */ lo(co, [["render", fo]]);
1390
- const po = Object.assign(Pe, {
1458
+ var Ue = /* @__PURE__ */ fo(po, [["render", go]]);
1459
+ const _o = Object.assign(Ue, {
1391
1460
  install: (t, n) => {
1392
1461
  var a;
1393
1462
  const e = (a = n?.iconPrefix) != null ? a : "";
1394
- t.component(e + Pe.name, Pe);
1463
+ t.component(e + Ue.name, Ue);
1395
1464
  }
1396
- }), mo = /* @__PURE__ */ q({
1465
+ }), vo = /* @__PURE__ */ Y({
1397
1466
  __name: "DetailView",
1398
1467
  props: {
1399
1468
  className: {},
@@ -1401,7 +1470,9 @@ const po = Object.assign(Pe, {
1401
1470
  },
1402
1471
  setup(t, { expose: n }) {
1403
1472
  n();
1404
- const a = Ve(), e = xe(), o = je(), l = Se(), s = to(), c = pe(), i = t, r = m({
1473
+ const a = Ve(), e = xe(), o = Me(), l = Ae(), s = ao(), c = pe(), i = t;
1474
+ let r;
1475
+ const u = g({
1405
1476
  pageType: "",
1406
1477
  fields: {},
1407
1478
  globalValidations: [],
@@ -1409,18 +1480,18 @@ const po = Object.assign(Pe, {
1409
1480
  title: "",
1410
1481
  subTitle: ""
1411
1482
  }
1412
- }), u = m([]);
1413
- function g(T) {
1414
- return T ? Object.entries(T).map(([E, U]) => (typeof U.modelValue == "boolean" ? U.fieldValue = U.modelValue ? "Yes" : "No" : U.fieldValue = U.modelValue, {
1415
- fieldKey: E,
1416
- ...U
1417
- })).filter((E) => E.widget && E.widget.widget !== "Hidden").filter((E) => !h.value.includes(E.fieldKey)) : [];
1483
+ }), p = g([]);
1484
+ function m(H) {
1485
+ return H ? Object.entries(H).map(([$, I]) => (typeof I.modelValue == "boolean" ? I.fieldValue = I.modelValue ? "Yes" : "No" : I.fieldValue = I.modelValue, {
1486
+ fieldKey: $,
1487
+ ...I
1488
+ })).filter(($) => $.widget && $.widget.widget !== "Hidden").filter(($) => !k.value.includes($.fieldKey)) : [];
1418
1489
  }
1419
- const _ = Z(() => Me(u.value)), b = Z(() => r.value?.actions ? [...r.value.actions].reverse() : []), p = m(!0), w = (T, R) => {
1420
- const E = T.findIndex((U) => U.isCurrent);
1421
- return T.map((U, re) => {
1490
+ const y = Z(() => Oe(p.value)), v = Z(() => u.value?.actions ? [...u.value.actions].reverse() : []), h = g(!0), f = (H, j) => {
1491
+ const $ = H.findIndex((I) => I.isCurrent);
1492
+ return H.map((I, ae) => {
1422
1493
  const F = {
1423
- id: U.id,
1494
+ id: I.id,
1424
1495
  title: "",
1425
1496
  proxy: "",
1426
1497
  sub: "",
@@ -1428,203 +1499,202 @@ const po = Object.assign(Pe, {
1428
1499
  status: 1,
1429
1500
  time: ""
1430
1501
  };
1431
- F.title = U.workflowProcessApprovers[0]?.name;
1432
- const _e = U.workflowProcessApprovers[U.workflowProcessApprovers.length - 1], we = U.workflowHistorys[U.workflowHistorys.length - 1], ve = we?.workflowHistoryApprovers[we?.workflowHistoryApprovers?.length - 1];
1433
- if (_e && ve && _e?.email?.toLowerCase() !== ve?.approverEmail?.toLowerCase() && (F.title = `${ve.name}`, F.proxy = `Proxy: ${_e.name}`), U.sort > 1 ? F.sub = "Approver Role: " + U.nodeName.replace("Submit", "").replace("Approve", "") : F.sub = "Submit Application", U.isCurrent && R !== -1)
1502
+ F.title = I.workflowProcessApprovers[0]?.name;
1503
+ const _e = I.workflowProcessApprovers[I.workflowProcessApprovers.length - 1], we = I.workflowHistorys[I.workflowHistorys.length - 1], ve = we?.workflowHistoryApprovers[we?.workflowHistoryApprovers?.length - 1];
1504
+ if (_e && ve && _e?.email?.toLowerCase() !== ve?.approverEmail?.toLowerCase() && (F.title = `${ve.name}`, F.proxy = `Proxy: ${_e.name}`), I.sort > 1 ? F.sub = "Approver Role: " + I.nodeName.replace("Submit", "").replace("Approve", "") : F.sub = "Submit Application", I.isCurrent && j !== -1)
1434
1505
  F.desc = "In Approval", F.status = 1;
1435
1506
  else {
1436
- const ne = U.workflowHistorys[U.workflowHistorys.length - 1];
1507
+ const ne = I.workflowHistorys[I.workflowHistorys.length - 1];
1437
1508
  if (ne && ne.status === 100)
1438
- F.time = he(ne.takeActionAt, "yyyy-MM-dd hh:mm:ss"), F.status = 2, F.desc = "approve success!";
1509
+ F.time = ke(ne.takeActionAt, "yyyy-MM-dd hh:mm:ss"), F.status = 2, F.desc = "approve success!";
1439
1510
  else if (ne && ne.status === 999)
1440
- F.time = he(ne.takeActionAt, "yyyy-MM-dd hh:mm:ss"), F.status = 0, F.desc = "approve reject!";
1511
+ F.time = ke(ne.takeActionAt, "yyyy-MM-dd hh:mm:ss"), F.status = 0, F.desc = "approve reject!";
1441
1512
  else if (ne)
1442
- if (F.time = he(ne.takeActionAt, "yyyy-MM-dd hh:mm:ss"), U.sort === 1)
1513
+ if (F.time = ke(ne.takeActionAt, "yyyy-MM-dd hh:mm:ss"), I.sort === 1)
1443
1514
  F.status = 2, F.desc = "";
1444
1515
  else {
1445
- const Oe = ne.workflowHistoryApprovers[0];
1446
- F.status = 3, F.desc = Oe?.reason ? `Rejected reason: ${Oe.reason}` : "Rejected";
1516
+ const Ee = ne.workflowHistoryApprovers[0];
1517
+ F.status = 3, F.desc = Ee?.reason ? `Rejected reason: ${Ee.reason}` : "Rejected";
1447
1518
  }
1448
- else re < E || E === -1 ? (F.status = 0, F.desc = "Skipped") : (F.status = 0, F.desc = "Pending Approval");
1519
+ else ae < $ || $ === -1 ? (F.status = 0, F.desc = "Skipped") : (F.status = 0, F.desc = "Pending Approval");
1449
1520
  ne && ne.status;
1450
1521
  }
1451
1522
  return F;
1452
1523
  });
1453
- }, f = m([]), L = m(!1), Y = m(!1), z = m(!1), te = m(!1);
1454
- async function oe() {
1455
- const T = await Je(fe.Details, i.className, { workflowId: i.workflowId, email: V() });
1456
- r.value.actions = r.value.actions?.filter((R) => {
1457
- const E = T.find((U) => U.button === R.title);
1458
- return E ? E.isShow : !0;
1459
- }), L.value = T.find((R) => R.button === "IsGlobal")?.isShow ?? !1, Y.value = T.find((R) => R.button === "AssignButton")?.isShow ?? !1, z.value = T.find((R) => R.button === "AssignList")?.isShow ?? !1, te.value = T.find((R) => R.button === "AddCommentsButton")?.isShow ?? !1;
1524
+ }, L = g([]), W = g(!1), G = g(!1), te = g(!1), oe = g(!1);
1525
+ async function w() {
1526
+ const H = await r.getBtnList();
1527
+ u.value.actions = u.value.actions?.filter((j) => {
1528
+ const $ = H.find((I) => I.button === j.title);
1529
+ return $ ? $.isShow : !0;
1530
+ }), W.value = H.find((j) => j.button === "IsGlobal")?.isShow ?? !1, G.value = H.find((j) => j.button === "AssignButton")?.isShow ?? !1, te.value = H.find((j) => j.button === "AssignList")?.isShow ?? !1, oe.value = H.find((j) => j.button === "AddCommentsButton")?.isShow ?? !1;
1460
1531
  }
1461
- const h = m([]);
1462
- async function I() {
1463
- p.value = !0, r.value = await ke(fe.Details, i.className, {
1464
- svrStore: a,
1465
- bpmStore: e
1466
- }, {
1467
- workflowId: i.workflowId
1468
- });
1469
- const T = await Xe(i.className, i.workflowId);
1470
- G.value = await Lt(), M.value = await $e(i.workflowId), ae.value = await Ue(i.workflowId), oe();
1471
- const R = r.value.fields.requestType.modelValue;
1472
- o.Test?.(R, h), u.value = g(r.value.fields);
1473
- for (const U in r.value.fields)
1474
- if (r.value.fields[U].widget?.widget === "File") {
1475
- const re = u.value.find((F) => F.fieldKey === U);
1476
- re && re.widget && (re.widget.files = T[U] ?? []);
1532
+ const k = g([]);
1533
+ async function T() {
1534
+ h.value = !0, r = new Ie().setPageActionType(fe.Details).setClassName(i.className).setStore({ svrStore: a, bpmStore: e }).setWorkflowId(i.workflowId).build(), u.value = await r.getPageData();
1535
+ const H = await r.getFiles();
1536
+ le.value = await r.getApprovers(), R.value = await r.getCommentsHistory(), ce.value = await r.getAssociator(), w();
1537
+ const j = u.value.fields.requestType.modelValue;
1538
+ o.Test?.(j, k), p.value = m(u.value.fields);
1539
+ for (const I in u.value.fields)
1540
+ if (u.value.fields[I].widget?.widget === "File") {
1541
+ const ae = p.value.find((F) => F.fieldKey === I);
1542
+ ae && ae.widget && (ae.widget.files = H[I] ?? []);
1477
1543
  }
1478
- const E = await Nt(i.className, i.workflowId);
1479
- f.value = w(E, 0), p.value = !1;
1544
+ const $ = await r.getProcess();
1545
+ L.value = f($, 0), h.value = !1;
1480
1546
  }
1481
- ce(I);
1482
- async function x(T, R) {
1483
- return o[T]?.(R);
1547
+ ue(T);
1548
+ async function V(H, j) {
1549
+ return o[H]?.(j);
1484
1550
  }
1485
- function V() {
1551
+ function C() {
1486
1552
  return a()?.userInfo?.email_address ?? "";
1487
1553
  }
1488
- async function y(T, R, E, U, re) {
1554
+ async function U(H, j, $, I, ae) {
1489
1555
  try {
1490
- switch (R) {
1556
+ switch (j) {
1491
1557
  case ee.Submit:
1492
- const { reason: F, ifGlobal: _e } = await x(re, { isGlobal: L.value });
1493
- p.value = !0;
1494
- const we = re === "Approve" ? "100" : "-1";
1495
- await Pt(i.className, i.workflowId, V(), F, [Number(i.workflowId)], E, we, _e), p.value = !1;
1496
- const ve = re === "Approve" ? `Request ID ${i.workflowId} has been approved.` : `Request ID ${i.workflowId} has been rejected.`;
1497
- c?.appContext.config.globalProperties.$notification.success(ve), I();
1558
+ const { reason: F, ifGlobal: _e } = await V(ae, { isGlobal: W.value });
1559
+ h.value = !0;
1560
+ const we = ae === "Approve" ? "100" : "-1";
1561
+ await Nt(i.className, i.workflowId, C(), F, [Number(i.workflowId)], $, we, _e), h.value = !1;
1562
+ const ve = ae === "Approve" ? `Request ID ${i.workflowId} has been approved.` : `Request ID ${i.workflowId} has been rejected.`;
1563
+ c?.appContext.config.globalProperties.$notification.success(ve), T();
1498
1564
  break;
1499
1565
  case ee.Link:
1500
1566
  try {
1501
- await o[T.eventName || ""]?.(), l.push({ name: U, params: { className: i.className } });
1567
+ await o[H.eventName || ""]?.(), l.push({ name: I, params: { className: i.className, workflowId: i.workflowId } });
1502
1568
  } catch (ne) {
1503
1569
  console.error("Error in link action trigger:", ne);
1504
1570
  }
1505
1571
  break;
1506
1572
  default:
1507
- console.warn("Unknown action type:", R);
1573
+ console.warn("Unknown action type:", j);
1508
1574
  }
1509
1575
  } catch {
1510
1576
  }
1511
1577
  }
1512
- const N = m(""), M = m([]), O = m(""), G = m([]), ae = m([]);
1513
- async function de() {
1514
- if (!O.value) {
1578
+ const M = g(""), R = g([]), E = g(""), le = g([]), ce = g([]);
1579
+ async function he() {
1580
+ if (!E.value) {
1515
1581
  c?.appContext.config.globalProperties.$message.error("Please select an approver");
1516
1582
  return;
1517
1583
  }
1518
- await ue("Confirm Assign Approver", "Do you want to assign the selected approver?");
1584
+ await b("Confirm Assign Approver", "Do you want to assign the selected approver?");
1519
1585
  try {
1520
- await Rt(i.workflowId, O.value), ae.value = await Ue(i.workflowId), oe(), c?.appContext.config.globalProperties.$notification.success("Assign Approver clicked!");
1521
- } catch (T) {
1522
- if (T.status === 409) {
1586
+ await r.assignApprover(E.value), ce.value = await r.getAssociator(), w(), c?.appContext.config.globalProperties.$notification.success("Assign Approver clicked!");
1587
+ } catch (H) {
1588
+ if (H.status === 409) {
1523
1589
  c?.appContext.config.globalProperties.$notification.error("This user is already an associator");
1524
1590
  return;
1525
1591
  }
1526
1592
  c?.appContext.config.globalProperties.$notification.error("Failed to assign approver");
1527
1593
  }
1528
1594
  }
1529
- async function ue(T, R) {
1530
- const { Modal: E } = await import("@arco-design/web-vue");
1531
- return new Promise((U, re) => {
1532
- E.confirm({
1533
- title: T,
1534
- content: R,
1595
+ async function b(H, j) {
1596
+ const { Modal: $ } = await import("@arco-design/web-vue");
1597
+ return new Promise((I, ae) => {
1598
+ $.confirm({
1599
+ title: H,
1600
+ content: j,
1535
1601
  okText: "OK",
1536
1602
  cancelText: "Cancel",
1537
- onOk: () => U(!0),
1538
- onCancel: () => re()
1603
+ onOk: () => I(!0),
1604
+ onCancel: () => ae()
1539
1605
  });
1540
1606
  });
1541
1607
  }
1542
- async function k(T) {
1608
+ async function D(H) {
1543
1609
  try {
1544
- await ue("Confirm Delete Associator", "Do you want to delete this associator?");
1610
+ await b("Confirm Delete Associator", "Do you want to delete this associator?");
1545
1611
  } catch {
1546
1612
  return;
1547
1613
  }
1548
1614
  try {
1549
- await jt(String(T)), ae.value = await Ue(i.workflowId), c?.appContext.config.globalProperties.$notification.success("Associator deleted successfully!");
1615
+ await r.deleteAssociator(H.toString()), ce.value = await r.getAssociator(), c?.appContext.config.globalProperties.$notification.success("Associator deleted successfully!");
1550
1616
  } catch {
1551
1617
  c?.appContext.config.globalProperties.$notification.error("Failed to delete associator");
1552
1618
  }
1553
1619
  }
1554
- async function H() {
1555
- if (!N.value.trim()) {
1620
+ async function B() {
1621
+ if (!M.value.trim()) {
1556
1622
  c?.appContext.config.globalProperties.$message.error("Comment cannot be empty");
1557
1623
  return;
1558
1624
  }
1559
- await Bt(i.workflowId, V(), N.value), N.value = "", M.value = await $e(i.workflowId), c?.appContext.config.globalProperties.$notification.success("Add Comment clicked!");
1625
+ await r.addComments(M.value.trim()), M.value = "", R.value = await r.getCommentsHistory(), c?.appContext.config.globalProperties.$notification.success("Add Comment clicked!");
1560
1626
  }
1561
- const B = { svrStore: a, bpmStore: e, triggers: o, router: l, customComps: s, instance: c, props: i, pageData: r, _fields: u, genField: g, groupedFields: _, reversedActions: b, loading: p, mapWorkflowSteps: w, steps: f, isGlobal: L, isShowAssignSelect: Y, isShowAssignList: z, isShowCommentTextArea: te, reloadButtonList: oe, hiddenFields: h, load: I, triggerFn: x, getApproverEmail: V, clickHandler: y, comment: N, commentsHistory: M, selectedApprover: O, approvers: G, associators: ae, onAssignApprover: de, confirmDialog: ue, onDeleteAssociator: k, onAddComment: H, ActionButton: Ce, get IconDownload() {
1562
- return po;
1563
- }, TopBar: Ae, get formatDate() {
1564
- return he;
1627
+ const se = { svrStore: a, bpmStore: e, triggers: o, router: l, customComps: s, instance: c, props: i, get page() {
1628
+ return r;
1629
+ }, set page(H) {
1630
+ r = H;
1631
+ }, pageData: u, _fields: p, genField: m, groupedFields: y, reversedActions: v, loading: h, mapWorkflowSteps: f, steps: L, isGlobal: W, isShowAssignSelect: G, isShowAssignList: te, isShowCommentTextArea: oe, reloadButtonList: w, hiddenFields: k, load: T, triggerFn: V, getApproverEmail: C, clickHandler: U, comment: M, commentsHistory: R, selectedApprover: E, approvers: le, associators: ce, onAssignApprover: he, confirmDialog: b, onDeleteAssociator: D, onAddComment: B, ActionButton: Se, get IconDownload() {
1632
+ return _o;
1633
+ }, TopBar: Te, get formatDate() {
1634
+ return ke;
1565
1635
  } };
1566
- return Object.defineProperty(B, "__isScriptSetup", { enumerable: !1, value: !0 }), B;
1636
+ return Object.defineProperty(se, "__isScriptSetup", { enumerable: !1, value: !0 }), se;
1567
1637
  }
1568
- }), go = { class: "page-container" }, _o = { class: "page-body" }, vo = { class: "detail-card" }, bo = { class: "form-fields-vertical" }, yo = { class: "detail-fields" }, wo = { class: "detail-field" }, ho = { class: "field-label" }, ko = {
1638
+ }), bo = { class: "page-container" }, yo = { class: "page-body" }, ho = { class: "detail-card" }, wo = { class: "form-fields-vertical" }, ko = { class: "detail-fields" }, Co = { class: "detail-field" }, So = { class: "field-label" }, Ao = {
1569
1639
  key: 1,
1570
1640
  class: "field-value"
1571
- }, Co = {
1641
+ }, xo = {
1572
1642
  key: 2,
1573
1643
  class: "detail-field-wrapper"
1574
- }, So = { class: "detail-field" }, xo = {
1644
+ }, Vo = { class: "detail-field" }, To = {
1575
1645
  key: 0,
1576
1646
  class: "detail-content"
1577
- }, Vo = { class: "page-footer" }, Ao = { class: "action-container" }, Io = { class: "action-buttons" };
1578
- function To(t, n, a, e, o, l) {
1579
- const s = S("a-link"), c = S("a-space"), i = S("a-card"), r = S("a-option"), u = S("a-select"), g = S("a-button"), _ = S("a-list-item"), b = S("a-list"), p = S("a-textarea"), w = S("a-spin");
1580
- return d(), C("div", go, [
1581
- D(e.TopBar, {
1647
+ }, Io = { class: "page-footer" }, Po = { class: "action-container" }, No = { class: "action-buttons" };
1648
+ function Uo(t, n, a, e, o, l) {
1649
+ const s = A("a-link"), c = A("a-space"), i = A("a-card"), r = A("a-option"), u = A("a-select"), p = A("a-button"), m = A("a-list-item"), y = A("a-list"), v = A("a-textarea"), h = A("a-spin");
1650
+ return d(), S("div", bo, [
1651
+ N(e.TopBar, {
1582
1652
  title: e.pageData.banner.title,
1583
1653
  subTitle: e.pageData.banner.subTitle,
1584
1654
  email: e.getApproverEmail()
1585
1655
  }, null, 8, ["title", "subTitle", "email"]),
1586
- A("div", _o, [
1587
- D(w, {
1656
+ x("div", yo, [
1657
+ N(h, {
1588
1658
  loading: e.loading,
1589
1659
  class: "detail-container"
1590
1660
  }, {
1591
- default: v(() => [
1592
- A("div", vo, [
1593
- (d(), P(He(e.customComps.Steps), { steps: e.steps }, null, 8, ["steps"])),
1594
- A("div", bo, [
1595
- (d(!0), C(j, null, $(e.groupedFields, (f) => (d(), P(i, {
1661
+ default: _(() => [
1662
+ x("div", ho, [
1663
+ (d(), P(Fe(e.customComps.Steps), { steps: e.steps }, null, 8, ["steps"])),
1664
+ x("div", wo, [
1665
+ (d(!0), S(O, null, K(e.groupedFields, (f) => (d(), P(i, {
1596
1666
  key: f.name,
1597
1667
  title: f.name,
1598
1668
  style: { "margin-bottom": "24px" }
1599
1669
  }, {
1600
- default: v(() => [
1601
- A("div", yo, [
1602
- (d(!0), C(j, null, $(f.fields, (L) => (d(), C("div", {
1670
+ default: _(() => [
1671
+ x("div", ko, [
1672
+ (d(!0), S(O, null, K(f.fields, (L) => (d(), S("div", {
1603
1673
  key: L.fieldKey,
1604
1674
  class: "detail-field-wrapper"
1605
1675
  }, [
1606
- A("div", wo, [
1607
- A("div", ho, Q(L.widget?.title), 1),
1608
- L.widget?.widget === "File" ? (d(!0), C(j, { key: 0 }, $(L.widget.files, (Y) => (d(), C("div", {
1676
+ x("div", Co, [
1677
+ x("div", So, Q(L.widget?.title), 1),
1678
+ L.widget?.widget === "File" ? (d(!0), S(O, { key: 0 }, K(L.widget.files, (W) => (d(), S("div", {
1609
1679
  class: "field-value",
1610
- key: Y.id
1680
+ key: W.id
1611
1681
  }, [
1612
- D(c, null, {
1613
- default: v(() => [
1614
- J(Q(Y.name) + " ", 1),
1615
- D(s, {
1616
- href: Y.url,
1682
+ N(c, null, {
1683
+ default: _(() => [
1684
+ J(Q(W.name) + " ", 1),
1685
+ N(s, {
1686
+ href: W.url,
1617
1687
  target: "_blank"
1618
1688
  }, {
1619
- default: v(() => [
1620
- D(e.IconDownload, { style: { color: "#7A00E6" } })
1689
+ default: _(() => [
1690
+ N(e.IconDownload, { style: { color: "#7A00E6" } })
1621
1691
  ]),
1622
1692
  _: 2
1623
1693
  }, 1032, ["href"])
1624
1694
  ]),
1625
1695
  _: 2
1626
1696
  }, 1024)
1627
- ]))), 128)) : (d(), C("div", ko, Q(L.fieldValue), 1))
1697
+ ]))), 128)) : (d(), S("div", Ao, Q(L.fieldValue), 1))
1628
1698
  ])
1629
1699
  ]))), 128))
1630
1700
  ])
@@ -1632,17 +1702,17 @@ function To(t, n, a, e, o, l) {
1632
1702
  _: 2
1633
1703
  }, 1032, ["title"]))), 128)),
1634
1704
  e.isShowAssignSelect ? (d(), P(c, { key: 0 }, {
1635
- default: v(() => [
1636
- D(u, {
1705
+ default: _(() => [
1706
+ N(u, {
1637
1707
  modelValue: e.selectedApprover,
1638
1708
  "onUpdate:modelValue": n[0] || (n[0] = (f) => e.selectedApprover = f)
1639
1709
  }, {
1640
- default: v(() => [
1641
- (d(!0), C(j, null, $(e.approvers, (f) => (d(), P(r, {
1710
+ default: _(() => [
1711
+ (d(!0), S(O, null, K(e.approvers, (f) => (d(), P(r, {
1642
1712
  key: f.value,
1643
1713
  value: f.value
1644
1714
  }, {
1645
- default: v(() => [
1715
+ default: _(() => [
1646
1716
  J(Q(f.label), 1)
1647
1717
  ]),
1648
1718
  _: 2
@@ -1650,11 +1720,11 @@ function To(t, n, a, e, o, l) {
1650
1720
  ]),
1651
1721
  _: 1
1652
1722
  }, 8, ["modelValue"]),
1653
- D(g, {
1723
+ N(p, {
1654
1724
  type: "primary",
1655
1725
  onClick: e.onAssignApprover
1656
1726
  }, {
1657
- default: v(() => n[2] || (n[2] = [
1727
+ default: _(() => n[2] || (n[2] = [
1658
1728
  J("Assign for comment", -1)
1659
1729
  ])),
1660
1730
  _: 1,
@@ -1662,85 +1732,85 @@ function To(t, n, a, e, o, l) {
1662
1732
  })
1663
1733
  ]),
1664
1734
  _: 1
1665
- })) : se("", !0),
1666
- e.isShowAssignList ? (d(), P(b, { key: 1 }, {
1667
- header: v(() => n[3] || (n[3] = [
1735
+ })) : re("", !0),
1736
+ e.isShowAssignList ? (d(), P(y, { key: 1 }, {
1737
+ header: _(() => n[3] || (n[3] = [
1668
1738
  J(" Associators ", -1)
1669
1739
  ])),
1670
- default: v(() => [
1671
- (d(!0), C(j, null, $(e.associators, (f) => (d(), P(_, {
1740
+ default: _(() => [
1741
+ (d(!0), S(O, null, K(e.associators, (f) => (d(), P(m, {
1672
1742
  key: f.id
1673
1743
  }, {
1674
- actions: v(() => [
1675
- D(g, {
1744
+ actions: _(() => [
1745
+ N(p, {
1676
1746
  type: "text",
1677
1747
  status: "danger",
1678
1748
  onClick: (L) => e.onDeleteAssociator(f.id)
1679
1749
  }, {
1680
- default: v(() => n[4] || (n[4] = [
1750
+ default: _(() => n[4] || (n[4] = [
1681
1751
  J(" Delete ", -1)
1682
1752
  ])),
1683
1753
  _: 2,
1684
1754
  __: [4]
1685
1755
  }, 1032, ["onClick"])
1686
1756
  ]),
1687
- default: v(() => [
1757
+ default: _(() => [
1688
1758
  J(" " + Q(f.associator), 1)
1689
1759
  ]),
1690
1760
  _: 2
1691
1761
  }, 1024))), 128))
1692
1762
  ]),
1693
1763
  _: 1
1694
- })) : se("", !0),
1695
- e.isShowCommentTextArea ? (d(), C("div", Co, [
1696
- A("div", So, [
1697
- n[6] || (n[6] = A("div", { class: "field-label" }, "Comment", -1)),
1698
- D(p, {
1764
+ })) : re("", !0),
1765
+ e.isShowCommentTextArea ? (d(), S("div", xo, [
1766
+ x("div", Vo, [
1767
+ n[6] || (n[6] = x("div", { class: "field-label" }, "Comment", -1)),
1768
+ N(v, {
1699
1769
  modelValue: e.comment,
1700
1770
  "onUpdate:modelValue": n[1] || (n[1] = (f) => e.comment = f)
1701
1771
  }, null, 8, ["modelValue"]),
1702
- D(g, {
1772
+ N(p, {
1703
1773
  type: "primary",
1704
1774
  onClick: e.onAddComment
1705
1775
  }, {
1706
- default: v(() => n[5] || (n[5] = [
1776
+ default: _(() => n[5] || (n[5] = [
1707
1777
  J("Add Comment", -1)
1708
1778
  ])),
1709
1779
  _: 1,
1710
1780
  __: [5]
1711
1781
  })
1712
1782
  ])
1713
- ])) : se("", !0),
1714
- e.commentsHistory.length ? (d(), P(b, { key: 3 }, {
1715
- header: v(() => n[7] || (n[7] = [
1783
+ ])) : re("", !0),
1784
+ e.commentsHistory.length ? (d(), P(y, { key: 3 }, {
1785
+ header: _(() => n[7] || (n[7] = [
1716
1786
  J(" Comments History ", -1)
1717
1787
  ])),
1718
- default: v(() => [
1719
- (d(!0), C(j, null, $(e.commentsHistory, (f) => (d(), P(_, {
1788
+ default: _(() => [
1789
+ (d(!0), S(O, null, K(e.commentsHistory, (f) => (d(), P(m, {
1720
1790
  key: f.associator
1721
1791
  }, {
1722
- default: v(() => [
1792
+ default: _(() => [
1723
1793
  J(Q(f.associator) + ": " + Q(f.comments) + " (" + Q(e.formatDate(f.createdAt)) + ") ", 1)
1724
1794
  ]),
1725
1795
  _: 2
1726
1796
  }, 1024))), 128))
1727
1797
  ]),
1728
1798
  _: 1
1729
- })) : se("", !0)
1799
+ })) : re("", !0)
1730
1800
  ]),
1731
- t.$slots.content ? (d(), C("div", xo, [
1732
- le(t.$slots, "content", {}, void 0, !0)
1733
- ])) : se("", !0)
1801
+ t.$slots.content ? (d(), S("div", To, [
1802
+ de(t.$slots, "content", {}, void 0, !0)
1803
+ ])) : re("", !0)
1734
1804
  ])
1735
1805
  ]),
1736
1806
  _: 3
1737
1807
  }, 8, ["loading"])
1738
1808
  ]),
1739
- A("div", Vo, [
1740
- A("div", Ao, [
1741
- le(t.$slots, "action", {}, void 0, !0),
1742
- A("div", Io, [
1743
- (d(!0), C(j, null, $(e.reversedActions, (f) => (d(), P(e.ActionButton, {
1809
+ x("div", Io, [
1810
+ x("div", Po, [
1811
+ de(t.$slots, "action", {}, void 0, !0),
1812
+ x("div", No, [
1813
+ (d(!0), S(O, null, K(e.reversedActions, (f) => (d(), P(e.ActionButton, {
1744
1814
  key: f.Title,
1745
1815
  loading: e.loading,
1746
1816
  config: f,
@@ -1752,7 +1822,7 @@ function To(t, n, a, e, o, l) {
1752
1822
  ])
1753
1823
  ]);
1754
1824
  }
1755
- const Uo = /* @__PURE__ */ X(mo, [["render", To], ["__scopeId", "data-v-07443410"], ["__file", "DetailView.vue"]]), Po = /* @__PURE__ */ q({
1825
+ const Do = /* @__PURE__ */ X(vo, [["render", Uo], ["__scopeId", "data-v-9672f7d3"], ["__file", "DetailView.vue"]]), Ho = /* @__PURE__ */ Y({
1756
1826
  name: "ListView",
1757
1827
  __name: "ListView",
1758
1828
  props: {
@@ -1760,7 +1830,7 @@ const Uo = /* @__PURE__ */ X(mo, [["render", To], ["__scopeId", "data-v-07443410
1760
1830
  },
1761
1831
  setup(t, { expose: n }) {
1762
1832
  n();
1763
- const a = Ve(), e = xe(), o = Se(), l = pe(), s = t, c = m(), i = Fe({
1833
+ const a = Ve(), e = xe(), o = Ae(), l = pe(), s = t, c = g(), i = Le({
1764
1834
  current: 1,
1765
1835
  total: 0,
1766
1836
  pageSize: 10,
@@ -1770,16 +1840,16 @@ const Uo = /* @__PURE__ */ X(mo, [["render", To], ["__scopeId", "data-v-07443410
1770
1840
  filters: []
1771
1841
  });
1772
1842
  function r() {
1773
- const k = Object.entries(y.value).filter(([, { value: H }]) => H && H !== "").map(([H, { value: B, operator: T }]) => ({
1774
- key: H,
1843
+ const b = Object.entries(C.value).filter(([, { value: D }]) => D && D !== "").map(([D, { value: B, operator: se }]) => ({
1844
+ key: D,
1775
1845
  value: B,
1776
- operator: T
1846
+ operator: se
1777
1847
  // 根据实际需要调整操作符
1778
1848
  }));
1779
1849
  return {
1780
1850
  pageNumber: i.current,
1781
1851
  pageSize: i.pageSize,
1782
- filters: [...i.filters, ...k],
1852
+ filters: [...i.filters, ...b],
1783
1853
  sorts: [{
1784
1854
  key: "workflowId",
1785
1855
  type: 1
@@ -1787,14 +1857,14 @@ const Uo = /* @__PURE__ */ X(mo, [["render", To], ["__scopeId", "data-v-07443410
1787
1857
  };
1788
1858
  }
1789
1859
  const u = Z(() => ({
1790
- x: b.value.length * 150 + 250
1860
+ x: y.value.length * 150 + 250
1791
1861
  // 只设置横向滚动
1792
1862
  // 移除 y 属性,让表格高度自适应
1793
- })), g = (k) => {
1794
- const H = Object.entries(k).filter(([, B]) => B.widget?.column).map(([B, T], R) => ({
1795
- title: T.widget.title,
1863
+ })), p = (b) => {
1864
+ const D = Object.entries(b).filter(([, B]) => B.widget?.column).map(([B, se], H) => ({
1865
+ title: se.widget.title,
1796
1866
  dataIndex: B.charAt(0).toLowerCase() + B.slice(1),
1797
- order: T.order,
1867
+ order: se.order,
1798
1868
  ellipsis: !0,
1799
1869
  tooltip: !0,
1800
1870
  width: 150,
@@ -1802,8 +1872,8 @@ const Uo = /* @__PURE__ */ X(mo, [["render", To], ["__scopeId", "data-v-07443410
1802
1872
  // 启用最小宽度
1803
1873
  resizable: !0
1804
1874
  // 启用列宽调整
1805
- })).sort((B, T) => B.order - T.order);
1806
- H.push({
1875
+ })).sort((B, se) => B.order - se.order);
1876
+ D.push({
1807
1877
  title: "Actions",
1808
1878
  slotName: "optional",
1809
1879
  align: "center",
@@ -1811,149 +1881,148 @@ const Uo = /* @__PURE__ */ X(mo, [["render", To], ["__scopeId", "data-v-07443410
1811
1881
  minWidth: 200,
1812
1882
  fixed: "right",
1813
1883
  resizable: !1
1814
- }), b.value = H;
1815
- }, _ = m([]), b = m([]), p = m(!0), w = m(!0), f = m(), L = async () => {
1816
- w.value = !0;
1817
- const k = await Ct(s.className, r());
1818
- _.value = k.data, i.total = k.totalCount, w.value = !1;
1819
- }, Y = m(!1);
1820
- ce(async () => {
1821
- p.value = !0, c.value = await ke(3, s.className, {
1822
- svrStore: a,
1823
- bpmStore: e
1824
- }), g(c.value.fields), M(c.value.fields), O(), V(c.value?.tabs?.[0]?.key || ""), f.value = c.value.actions, p.value = !1, Y.value = !0;
1825
- }), st(() => {
1826
- Y.value && L();
1884
+ }), y.value = D;
1885
+ }, m = g([]), y = g([]), v = g(!0), h = g(!0), f = g(), L = async () => {
1886
+ h.value = !0;
1887
+ const b = await Ct(s.className, r());
1888
+ m.value = b.data, i.total = b.totalCount, h.value = !1;
1889
+ }, W = g(!1);
1890
+ ue(async () => {
1891
+ v.value = !0;
1892
+ const b = new Ie().setPageActionType(fe.List).setClassName(s.className).setStore({ svrStore: a, bpmStore: e }).build();
1893
+ c.value = await b.getPageData(), p(c.value.fields), M(c.value.fields), R(), V(c.value?.tabs?.[0]?.key || ""), f.value = c.value.actions, v.value = !1, W.value = !0;
1894
+ }), rt(() => {
1895
+ W.value && L();
1827
1896
  });
1828
- const z = (k) => {
1829
- i.current = k, L();
1830
- }, te = (k) => {
1831
- i.pageSize = k, L();
1897
+ const G = (b) => {
1898
+ i.current = b, L();
1899
+ }, te = (b) => {
1900
+ i.pageSize = b, L();
1832
1901
  };
1833
- function oe(k, H, B, T, R) {
1834
- switch (k) {
1902
+ function oe(b, D, B, se, H) {
1903
+ switch (b) {
1835
1904
  case ee.Link:
1836
- o.push({ name: B, params: { workflowId: R } });
1905
+ o.push({ name: B, params: { workflowId: H } });
1837
1906
  break;
1838
1907
  default:
1839
- console.warn("Unknown action type:", k);
1908
+ console.warn("Unknown action type:", b);
1840
1909
  }
1841
1910
  }
1842
- function h(k, H, B) {
1843
- switch (k) {
1911
+ function w(b, D, B) {
1912
+ switch (b) {
1844
1913
  case ee.Submit:
1845
- Mt(H, { filters: [{ key: "approverList", value: I(), operator: 2 }] }), l?.appContext.config.globalProperties.$notification.success("submit success!");
1914
+ $t(D, { filters: [{ key: "approverList", value: k(), operator: 2 }] }), l?.appContext.config.globalProperties.$notification.success("submit success!");
1846
1915
  break;
1847
1916
  case ee.Link:
1848
1917
  o.push({ name: B });
1849
1918
  break;
1850
1919
  default:
1851
- console.warn("Unknown action type:", k);
1920
+ console.warn("Unknown action type:", b);
1852
1921
  }
1853
1922
  }
1854
- function I() {
1923
+ function k() {
1855
1924
  return a()?.userInfo?.email_address ?? "";
1856
1925
  }
1857
- function x(k, H) {
1858
- return typeof k != "string" || k.indexOf("{currentUserEmail}") === -1 ? k : k.replace(/{currentUserEmail}/g, H);
1926
+ function T(b, D) {
1927
+ return typeof b != "string" || b.indexOf("{currentUserEmail}") === -1 ? b : b.replace(/{currentUserEmail}/g, D);
1859
1928
  }
1860
- function V(k) {
1861
- const H = c.value?.tabs?.find((B) => B.key === k)?.filters;
1862
- i.filters = H?.map((B) => ({
1929
+ function V(b) {
1930
+ const D = c.value?.tabs?.find((B) => B.key === b)?.filters;
1931
+ i.filters = D?.map((B) => ({
1863
1932
  ...B,
1864
- value: x(B.value, I())
1933
+ value: T(B.value, k())
1865
1934
  })) || [], i.current = 1, L();
1866
1935
  }
1867
- const y = m({}), N = m([]);
1868
- function M(k) {
1869
- if (!k) return [];
1870
- N.value = Object.entries(k).filter(([, H]) => H.isFiltered).map(([H, B]) => ({ fieldKey: H, fieldConfig: B }));
1936
+ const C = g({}), U = g([]);
1937
+ function M(b) {
1938
+ if (!b) return [];
1939
+ U.value = Object.entries(b).filter(([, D]) => D.isFiltered).map(([D, B]) => ({ fieldKey: D, fieldConfig: B }));
1871
1940
  }
1872
- const O = () => {
1873
- const k = {};
1874
- N.value.forEach(({ fieldKey: H, fieldConfig: B }) => {
1875
- k[H] = {}, k[H].value = B.modelValue, k[H].operator = B.operator;
1876
- }), y.value = k;
1877
- }, G = () => {
1941
+ const R = () => {
1942
+ const b = {};
1943
+ U.value.forEach(({ fieldKey: D, fieldConfig: B }) => {
1944
+ b[D] = {}, b[D].value = B.modelValue, b[D].operator = B.operator;
1945
+ }), C.value = b;
1946
+ }, E = () => {
1878
1947
  i.current = 1, L();
1879
- }, ae = () => {
1880
- c.value && O(), G();
1948
+ }, le = () => {
1949
+ c.value && R(), E();
1881
1950
  };
1882
- function de(k, H) {
1883
- return !(k.location !== "InTable" || k.title === "Update" && (H.status === 100 || H.status === -1));
1951
+ function ce(b, D) {
1952
+ return !(b.location !== "InTable" || b.title === "Update" && (D.status === 100 || D.status === -1));
1884
1953
  }
1885
- const ue = { svrStore: a, bpmStore: e, router: o, instance: l, props: s, pageData: c, paging: i, createListParams: r, scroll: u, mapColumns: g, _data: _, _columns: b, loadingPage: p, loadingTable: w, actions: f, loadData: L, mounted: Y, pageChangeHandler: z, pageSizeChangeHandler: te, clickHandler: oe, createHandler: h, getApproverEmail: I, replaceEmail: x, tabHandler: V, searchForm: y, searchableFields: N, mapSearchableFields: M, initSearchForm: O, handleSearch: G, handleReset: ae, judgeHiddenActions: de, ActionButton: Ce, DataWidgets: Be, TopBar: Ae };
1886
- return Object.defineProperty(ue, "__isScriptSetup", { enumerable: !1, value: !0 }), ue;
1954
+ const he = { svrStore: a, bpmStore: e, router: o, instance: l, props: s, pageData: c, paging: i, createListParams: r, scroll: u, mapColumns: p, _data: m, _columns: y, loadingPage: v, loadingTable: h, actions: f, loadData: L, mounted: W, pageChangeHandler: G, pageSizeChangeHandler: te, clickHandler: oe, createHandler: w, getApproverEmail: k, replaceEmail: T, tabHandler: V, searchForm: C, searchableFields: U, mapSearchableFields: M, initSearchForm: R, handleSearch: E, handleReset: le, judgeHiddenActions: ce, ActionButton: Se, DataWidgets: je, TopBar: Te };
1955
+ return Object.defineProperty(he, "__isScriptSetup", { enumerable: !1, value: !0 }), he;
1887
1956
  }
1888
- }), Do = { class: "list-container" }, No = { class: "query-title" };
1889
- function Ho(t, n, a, e, o, l) {
1890
- const s = S("a-space"), c = S("a-col"), i = S("a-button"), r = S("a-row"), u = S("a-card"), g = S("a-tab-pane"), _ = S("a-tabs"), b = S("a-table");
1891
- return d(), C("div", Do, [
1892
- D(e.TopBar, {
1957
+ }), Fo = { class: "list-container" }, Lo = { class: "query-title" };
1958
+ function Ro(t, n, a, e, o, l) {
1959
+ const s = A("a-space"), c = A("a-col"), i = A("a-button"), r = A("a-row"), u = A("a-card"), p = A("a-tab-pane"), m = A("a-tabs"), y = A("a-table");
1960
+ return d(), S("div", Fo, [
1961
+ N(e.TopBar, {
1893
1962
  title: e.pageData?.banner.title ?? "",
1894
1963
  subTitle: e.pageData?.banner.subTitle ?? "",
1895
1964
  email: e.getApproverEmail()
1896
1965
  }, null, 8, ["title", "subTitle", "email"]),
1897
- D(u, null, {
1898
- default: v(() => [
1899
- A("div", No, [
1900
- n[0] || (n[0] = A("h3", null, "Search Conditions", -1)),
1901
- D(s, { size: "medium" }, {
1902
- default: v(() => [
1903
- (d(!0), C(j, null, $(e.actions, (p) => (d(), C(j, {
1904
- key: p.title
1966
+ N(u, null, {
1967
+ default: _(() => [
1968
+ x("div", Lo, [
1969
+ n[0] || (n[0] = x("h3", null, "Search Conditions", -1)),
1970
+ N(s, { size: "medium" }, {
1971
+ default: _(() => [
1972
+ (d(!0), S(O, null, K(e.actions, (v) => (d(), S(O, {
1973
+ key: v.title
1905
1974
  }, [
1906
- p.location === "InOperation" ? (d(), P(e.ActionButton, {
1975
+ v.location === "InOperation" ? (d(), P(e.ActionButton, {
1907
1976
  key: 0,
1908
- config: p,
1977
+ config: v,
1909
1978
  onClick: e.createHandler
1910
- }, null, 8, ["config"])) : se("", !0)
1979
+ }, null, 8, ["config"])) : re("", !0)
1911
1980
  ], 64))), 128))
1912
1981
  ]),
1913
1982
  _: 1
1914
1983
  })
1915
1984
  ]),
1916
- D(r, { gutter: [24, 20] }, {
1917
- default: v(() => [
1918
- (d(!0), C(j, null, $(e.searchableFields, (p) => (d(), P(c, {
1919
- key: p.fieldKey,
1985
+ N(r, { gutter: [24, 20] }, {
1986
+ default: _(() => [
1987
+ (d(!0), S(O, null, K(e.searchableFields, (v) => (d(), P(c, {
1988
+ key: v.fieldKey,
1920
1989
  span: 6,
1921
1990
  class: "search-col"
1922
1991
  }, {
1923
- default: v(() => [
1924
- D(e.DataWidgets, {
1925
- name: p.fieldKey,
1926
- config: p.fieldConfig,
1927
- modelValue: e.searchForm[p.fieldKey].value,
1928
- "onUpdate:modelValue": (w) => e.searchForm[p.fieldKey].value = w,
1992
+ default: _(() => [
1993
+ N(e.DataWidgets, {
1994
+ name: v.fieldKey,
1995
+ config: v.fieldConfig,
1996
+ modelValue: e.searchForm[v.fieldKey].value,
1997
+ "onUpdate:modelValue": (h) => e.searchForm[v.fieldKey].value = h,
1929
1998
  class: "form-field"
1930
1999
  }, null, 8, ["name", "config", "modelValue", "onUpdate:modelValue"])
1931
2000
  ]),
1932
2001
  _: 2
1933
2002
  }, 1024))), 128)),
1934
- D(c, {
2003
+ N(c, {
1935
2004
  span: 6,
1936
2005
  class: "search-col form-buttons"
1937
2006
  }, {
1938
- default: v(() => [
1939
- D(s, { size: "medium" }, {
1940
- default: v(() => [
1941
- D(i, {
2007
+ default: _(() => [
2008
+ N(s, { size: "medium" }, {
2009
+ default: _(() => [
2010
+ N(i, {
1942
2011
  type: "primary",
1943
2012
  size: "medium",
1944
2013
  onClick: e.handleSearch
1945
2014
  }, {
1946
- default: v(() => n[1] || (n[1] = [
2015
+ default: _(() => n[1] || (n[1] = [
1947
2016
  J(" Search ", -1)
1948
2017
  ])),
1949
2018
  _: 1,
1950
2019
  __: [1]
1951
2020
  }),
1952
- D(i, {
2021
+ N(i, {
1953
2022
  size: "medium",
1954
2023
  onClick: e.handleReset
1955
2024
  }, {
1956
- default: v(() => n[2] || (n[2] = [
2025
+ default: _(() => n[2] || (n[2] = [
1957
2026
  J(" Reset ", -1)
1958
2027
  ])),
1959
2028
  _: 1,
@@ -1971,19 +2040,19 @@ function Ho(t, n, a, e, o, l) {
1971
2040
  ]),
1972
2041
  _: 1
1973
2042
  }),
1974
- D(_, {
2043
+ N(m, {
1975
2044
  size: "large",
1976
2045
  onTabClick: e.tabHandler
1977
2046
  }, {
1978
- default: v(() => [
1979
- (d(!0), C(j, null, $(e.pageData?.tabs, (p) => (d(), P(g, {
1980
- key: p.key,
1981
- title: p.title
2047
+ default: _(() => [
2048
+ (d(!0), S(O, null, K(e.pageData?.tabs, (v) => (d(), P(p, {
2049
+ key: v.key,
2050
+ title: v.title
1982
2051
  }, null, 8, ["title"]))), 128))
1983
2052
  ]),
1984
2053
  _: 1
1985
2054
  }),
1986
- D(b, {
2055
+ N(y, {
1987
2056
  columns: e._columns,
1988
2057
  data: e._data,
1989
2058
  stripe: "",
@@ -2002,18 +2071,18 @@ function Ho(t, n, a, e, o, l) {
2002
2071
  onPageChange: e.pageChangeHandler,
2003
2072
  onPageSizeChange: e.pageSizeChangeHandler
2004
2073
  }, {
2005
- optional: v(({ record: p }) => [
2006
- D(s, { size: "small" }, {
2007
- default: v(() => [
2008
- (d(!0), C(j, null, $(e.actions, (w) => (d(), C(j, {
2009
- key: w.title
2074
+ optional: _(({ record: v }) => [
2075
+ N(s, { size: "small" }, {
2076
+ default: _(() => [
2077
+ (d(!0), S(O, null, K(e.actions, (h) => (d(), S(O, {
2078
+ key: h.title
2010
2079
  }, [
2011
- e.judgeHiddenActions(w, p) ? (d(), P(e.ActionButton, {
2080
+ e.judgeHiddenActions(h, v) ? (d(), P(e.ActionButton, {
2012
2081
  key: 0,
2013
- config: w,
2082
+ config: h,
2014
2083
  size: "small",
2015
- onClick: (...f) => e.clickHandler(...f, p.workflowId)
2016
- }, null, 8, ["config", "onClick"])) : se("", !0)
2084
+ onClick: (...f) => e.clickHandler(...f, v.workflowId)
2085
+ }, null, 8, ["config", "onClick"])) : re("", !0)
2017
2086
  ], 64))), 128))
2018
2087
  ]),
2019
2088
  _: 2
@@ -2023,12 +2092,12 @@ function Ho(t, n, a, e, o, l) {
2023
2092
  }, 8, ["columns", "data", "pagination", "loading", "scroll"])
2024
2093
  ]);
2025
2094
  }
2026
- const Fo = /* @__PURE__ */ X(Po, [["render", Ho], ["__scopeId", "data-v-a82f2228"], ["__file", "ListView.vue"]]), Oo = {
2095
+ const Bo = /* @__PURE__ */ X(Ho, [["render", Ro], ["__scopeId", "data-v-639f4f42"], ["__file", "ListView.vue"]]), Ko = {
2027
2096
  install(t, n = {}) {
2028
- n.config && gt(n.config), n.router && t.provide(Qe, n.router), n.pinia && t.provide(kn, n.pinia), n.useBpmStore && t.provide(et, n.useBpmStore), n.useSvrStore && t.provide(tt, n.useSvrStore), n.triggers && t.provide(Ze, n.triggers), n.customComps && t.provide(nt, n.customComps), t.component("CreateView", En), t.component("UpdateView", eo), t.component("DetailView", Uo), t.component("ListView", Fo);
2097
+ n.config && mt(n.config), n.router && t.provide(Xe, n.router), n.pinia && t.provide(An, n.pinia), n.useBpmStore && t.provide(Ze, n.useBpmStore), n.useSvrStore && t.provide(et, n.useSvrStore), n.triggers && t.provide(Qe, n.triggers), n.customComps && t.provide(tt, n.customComps), t.component("CreateView", zn), t.component("UpdateView", oo), t.component("DetailView", Do), t.component("ListView", Bo);
2029
2098
  }
2030
2099
  };
2031
2100
  export {
2032
- Oo as default
2101
+ Ko as default
2033
2102
  };
2034
2103
  //# sourceMappingURL=index.es.js.map