@chase-shao/vue-component-lib 1.2.40 → 1.2.41

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