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

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 y, defineComponent as F, mergeModels as O, useModel as ce, resolveComponent as T, createBlock as L, openBlock as v, onMounted as Y, computed as P, withCtx as U, createElementBlock as S, Fragment as H, renderList as z, createVNode as N, nextTick as qe, createTextVNode as Z, useTemplateRef as he, createElementVNode as h, createCommentVNode as ee, toDisplayString as j, resolveDynamicComponent as ke, renderSlot as q, 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: y(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 B = /* @__PURE__ */ ((e) => (e[e.Submit = 0] = "Submit", e[e.Link = 1] = "Link", e))(B || {}), 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" ? B.Link : B.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 w = l(r);
275
+ a("error", w.res ? "" : w.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, w) => {
285
+ const p = T("AInput");
286
+ return v(), L(p, {
287
+ modelValue: c.value,
288
+ "onUpdate:modelValue": w[0] || (w[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 = y(100), d = y(0);
312
+ Y(() => {
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
+ }, w = (p) => {
320
+ const b = o(p);
321
+ a("error", b.res ? "" : b.errorMessages), n.triggers && n.triggers.length > 0 && n.triggers.forEach((_) => {
322
+ _.event === "change" && a(_.event, _.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 _ = T("AInputNumber");
332
+ return v(), L(_, {
333
+ modelValue: c.value,
334
+ "onUpdate:modelValue": b[0] || (b[0] = (C) => c.value = C),
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: w
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,46 +354,46 @@ 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 = y(!1), l = y(n.config.options ?? []), d = ce(e, "modelValue"), o = (p) => ae(n.validations, p);
360
+ P(() => {
361
+ const p = {};
362
+ return n.triggers && n.triggers.length > 0 && n.triggers.forEach((b) => {
363
+ p[b.event] = (_) => {
364
+ a(b.event, b.handlerName, _);
365
+ const C = o(_);
366
+ a("error", C.res ? "" : C.errorMessages);
356
367
  };
357
- }), f;
358
- }), Z(async () => {
359
- t.config.dataSourceProvider && (i.value = await vt(t.config.dataSourceProvider));
368
+ }), p;
369
+ }), Y(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 w = (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((_) => {
376
+ _.event === "change" && a(_.event, _.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 _ = T("AOption"), C = T("ASelect");
386
+ return v(), L(C, {
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] = (I) => d.value = I),
390
+ loading: c.value,
380
391
  "filter-option": !0,
381
392
  "allow-search": !0,
382
- onChange: h
393
+ onChange: w
383
394
  }, {
384
- default: A(() => [
385
- (_(!0), $(E, null, j(i.value, (I) => (_(), M(V, {
395
+ default: U(() => [
396
+ (v(!0), S(H, null, z(l.value, (I) => (v(), L(_, {
386
397
  key: I.value,
387
398
  value: I.value,
388
399
  label: I.label
@@ -392,52 +403,52 @@ const se = (e, a) => {
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 = y(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
+ Y(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 w = await (await W()).get(o);
422
+ c.value = w.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 w = T("ACascader"), p = T("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: U(() => [
438
+ N(w, {
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,53 @@ 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 = y({});
465
+ Y(async () => {
466
+ const _ = await Ae();
467
+ c.value = {
468
+ Authorization: `Bearer ${_}`
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 = (_) => ae(n.validations, _), o = Ee().apiBase, r = y(null), w = y(0);
472
+ function p(_, C, I) {
473
+ return _.replace(/{WorkflowId}/g, C).replace(/{ClassName}/g, I);
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 = P(() => {
476
+ if (n.config.uploadURL) {
477
+ const _ = 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
+ });
482
+ return t({
483
+ submit(_) {
484
+ r.value && (n.config.uploadURL && (w.value = _), qe(() => {
485
+ r.value.submit();
527
486
  }));
528
487
  },
529
488
  validate() {
530
- const u = o(t.modelValue);
531
- return n("error", u.res ? "" : u.errorMessages), u.res;
489
+ const _ = l(n.modelValue);
490
+ return a("error", _.res ? "" : _.errorMessages), _.res;
532
491
  }
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
565
- }, {
566
- default: A(() => r[2] || (r[2] = [
567
- ee("原生上传", -1)
568
- ])),
569
- _: 1,
570
- __: [2]
571
- }, 8, ["disabled"])
572
- ])
573
- ], 64);
492
+ }), (_, C) => {
493
+ const I = T("a-upload");
494
+ return v(), L(I, {
495
+ ref_key: "uploadRef",
496
+ ref: r,
497
+ "default-file-list": n.config.files,
498
+ action: b.value,
499
+ limit: n.config.allowedNumber,
500
+ "auto-upload": !1,
501
+ name: "files",
502
+ headers: c.value
503
+ }, {
504
+ "start-icon": U(() => C[0] || (C[0] = [])),
505
+ _: 1
506
+ }, 8, ["default-file-list", "action", "limit", "headers"]);
574
507
  };
575
508
  }
576
- }), Ct = /* @__PURE__ */ H({
509
+ }), It = /* @__PURE__ */ F({
577
510
  __name: "TextArea",
578
511
  props: {
579
512
  fieldKey: {},
@@ -584,36 +517,36 @@ const se = (e, a) => {
584
517
  triggers: {}
585
518
  },
586
519
  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);
520
+ setup(e, { expose: t, emit: s }) {
521
+ const n = e, a = s, c = (o) => ae(n.validations, o), l = (o) => {
522
+ a("update:modelValue", o), a("input", o);
523
+ }, d = (o) => {
524
+ a("update:modelValue", o);
525
+ const r = c(o);
526
+ a("error", r.res ? "" : r.errorMessages), n.triggers && n.triggers.length > 0 && n.triggers.forEach((w) => {
527
+ w.event === "change" && a(w.event, w.handlerName, o);
595
528
  });
596
529
  };
597
- return a({
530
+ return t({
598
531
  validate() {
599
- const o = d(t.modelValue);
600
- return n("error", o.res ? "" : o.errorMessages), o.res;
532
+ const o = c(n.modelValue);
533
+ return a("error", o.res ? "" : o.errorMessages), o.res;
601
534
  }
602
- }), (o, l) => {
603
- const h = x("ATextarea");
604
- return _(), M(h, {
605
- "model-value": t.modelValue,
535
+ }), (o, r) => {
536
+ const w = T("ATextarea");
537
+ return v(), L(w, {
538
+ "model-value": n.modelValue,
606
539
  placeholder: "Please enter something",
607
540
  "allow-clear": "",
608
- disabled: t.readonly,
609
- onInput: i,
610
- onChange: p
541
+ disabled: n.readonly,
542
+ onInput: l,
543
+ onChange: d
611
544
  }, null, 8, ["model-value", "disabled"]);
612
545
  };
613
546
  }
614
- }), $t = /* @__PURE__ */ H({
547
+ }), xt = /* @__PURE__ */ F({
615
548
  __name: "CheckBox",
616
- props: /* @__PURE__ */ X({
549
+ props: /* @__PURE__ */ O({
617
550
  fieldKey: {},
618
551
  modelValue: {},
619
552
  config: {},
@@ -624,45 +557,45 @@ const se = (e, a) => {
624
557
  modelValue: {},
625
558
  modelModifiers: {}
626
559
  }),
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);
560
+ emits: /* @__PURE__ */ O(["update:modelValue", "change", "error", "input"], ["update:modelValue"]),
561
+ setup(e, { expose: t, emit: s }) {
562
+ const n = e, a = s, c = ce(e, "modelValue"), l = (o) => ae(n.validations, o), d = (o) => {
563
+ const r = l(o);
564
+ a("error", r.res ? "" : r.errorMessages), n.triggers && n.triggers.length > 0 && n.triggers.forEach((w) => {
565
+ w.event === "change" && a(w.event, w.handlerName, o);
633
566
  });
634
567
  };
635
- return a({
568
+ return t({
636
569
  validate() {
637
- const o = i(t.modelValue);
638
- return n("error", o.res ? "" : o.errorMessages), o.res;
570
+ const o = l(n.modelValue);
571
+ return a("error", o.res ? "" : o.errorMessages), o.res;
639
572
  }
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),
573
+ }), (o, r) => {
574
+ const w = T("ACheckbox");
575
+ return v(), L(w, {
576
+ modelValue: c.value,
577
+ "onUpdate:modelValue": r[0] || (r[0] = (p) => c.value = p),
645
578
  clearable: "",
646
- disabled: t.readonly || t.config.Readonly,
647
- onChange: p
579
+ disabled: n.readonly || n.config.Readonly,
580
+ onChange: d
648
581
  }, {
649
- default: A(() => l[1] || (l[1] = [
650
- ee("Yes", -1)
582
+ default: U(() => r[1] || (r[1] = [
583
+ Z("Yes", -1)
651
584
  ])),
652
585
  _: 1,
653
586
  __: [1]
654
587
  }, 8, ["modelValue", "disabled"]);
655
588
  };
656
589
  }
657
- }), It = { class: "widget-wrapper" }, Nt = { class: "title mb-1.5" }, xt = {
590
+ }), Tt = { class: "widget-wrapper" }, Nt = { class: "title mb-1.5" }, Ut = {
658
591
  key: 0,
659
592
  class: "required"
660
- }, Ut = { class: "form-widget" }, At = { class: "widget" }, Lt = {
593
+ }, At = { class: "form-widget" }, Lt = { class: "widget" }, Mt = {
661
594
  key: 0,
662
595
  class: "err-msg"
663
- }, Tt = /* @__PURE__ */ H({
596
+ }, Ft = /* @__PURE__ */ F({
664
597
  __name: "index",
665
- props: /* @__PURE__ */ X({
598
+ props: /* @__PURE__ */ O({
666
599
  config: {},
667
600
  className: {},
668
601
  fieldKey: {},
@@ -674,287 +607,341 @@ const se = (e, a) => {
674
607
  modelValue: {},
675
608
  modelModifiers: {}
676
609
  }),
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) {
610
+ emits: /* @__PURE__ */ O(["update:modelValue", "change", "error"], ["update:modelValue"]),
611
+ setup(e, { expose: t, emit: s }) {
612
+ const n = e, a = s, c = ce(e, "modelValue"), l = he("widgetRef"), d = P(() => {
613
+ switch (n.config?.widget?.widget) {
681
614
  case "TextBox":
682
- return Ce;
615
+ return xe;
683
616
  case "Number":
684
- return bt;
617
+ return Ct;
685
618
  case "SelectList":
686
- return $e;
619
+ return Te;
687
620
  case "Cascade":
688
- return kt;
621
+ return Vt;
689
622
  case "File":
690
- return St;
623
+ return $t;
691
624
  case "TextArea":
692
- return Ct;
625
+ return It;
693
626
  case "DropDown":
694
- return $e;
627
+ return Te;
695
628
  case "CheckBox":
696
- return $t;
629
+ return xt;
697
630
  default:
698
- return Ce;
631
+ return xe;
699
632
  }
700
- }), o = k(""), l = (b) => {
633
+ }), o = y(""), r = (b) => {
701
634
  o.value = b;
702
- }, h = (b, V) => {
703
- n("change", b, V);
635
+ }, w = (b, _) => {
636
+ a("change", b, _);
704
637
  };
705
- function f() {
706
- return t.config?.widget?.widget === "File";
638
+ function p() {
639
+ return n.config?.widget?.widget === "File";
707
640
  }
708
- return a({
641
+ return t({
709
642
  isFileUpload() {
710
- return t.config?.widget?.widget === "File";
643
+ return n.config?.widget?.widget === "File";
711
644
  },
712
645
  submit(b) {
713
- f() && i.value.submit(b);
646
+ p() && l.value.submit(b);
714
647
  },
715
648
  validate() {
716
- return i.value?.validate();
649
+ return l.value?.validate();
717
650
  },
718
651
  getCompName() {
719
- return t?.config?.widget?.title;
652
+ return n?.config?.widget?.title;
720
653
  }
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)
654
+ }), (b, _) => (v(), S("div", Tt, [
655
+ h("div", Nt, [
656
+ Z(j(n?.config?.widget?.title), 1),
657
+ n.config.validations.length ? (v(), S("span", Ut, "*")) : ee("", !0)
725
658
  ]),
726
- y("div", Ut, [
727
- y("div", At, [
728
- (_(), M(we(p.value), {
659
+ h("div", At, [
660
+ h("div", Lt, [
661
+ (v(), L(ke(d.value), {
729
662
  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
663
+ ref: l,
664
+ modelValue: c.value,
665
+ "onUpdate:modelValue": _[0] || (_[0] = (C) => c.value = C),
666
+ "field-key": n.fieldKey,
667
+ config: n.config.widget,
668
+ validations: n.config.validations,
669
+ triggers: n.config.triggers,
670
+ "class-name": n.className,
671
+ onError: r,
672
+ onChange: w
740
673
  }, null, 40, ["modelValue", "field-key", "config", "validations", "triggers", "class-name"]))
741
674
  ]),
742
- o.value.length > 0 ? (_(), $("div", Lt, B(o.value), 1)) : te("", !0)
675
+ o.value.length > 0 ? (v(), S("div", Mt, j(o.value), 1)) : ee("", !0)
743
676
  ])
744
677
  ]));
745
678
  }
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({
679
+ }), oe = (e, t) => {
680
+ const s = e.__vccOpts || e;
681
+ for (const [n, a] of t)
682
+ s[n] = a;
683
+ return s;
684
+ }, Ce = /* @__PURE__ */ oe(Ft, [["__scopeId", "data-v-3ad59bc4"]]), Dt = /* @__PURE__ */ F({
752
685
  __name: "SubmitButton",
753
686
  props: {
754
687
  url: {},
755
688
  redirectType: {}
756
689
  },
757
690
  emits: ["click"],
758
- setup(e, { emit: a }) {
759
- const c = e, t = a;
760
- function n() {
761
- t("click", c.url, c.redirectType);
691
+ setup(e, { emit: t }) {
692
+ const s = e, n = t;
693
+ function a() {
694
+ n("click", s.url, s.redirectType);
762
695
  }
763
- return (d, i) => {
764
- const p = x("AButton");
765
- return _(), M(p, {
696
+ return (c, l) => {
697
+ const d = T("AButton");
698
+ return v(), L(d, {
766
699
  type: "primary",
767
- onClick: n
700
+ onClick: a
768
701
  }, {
769
- default: A(() => [
770
- W(d.$slots, "default")
702
+ default: U(() => [
703
+ q(c.$slots, "default")
771
704
  ]),
772
705
  _: 3
773
706
  });
774
707
  };
775
708
  }
776
- }), Rt = /* @__PURE__ */ H({
709
+ }), Ht = /* @__PURE__ */ F({
777
710
  __name: "DetailLink",
778
711
  props: {
779
712
  url: {},
780
713
  redirectType: {}
781
714
  },
782
715
  emits: ["click"],
783
- setup(e, { emit: a }) {
784
- const c = e, t = a;
785
- function n() {
786
- t("click", c.url, c.redirectType);
716
+ setup(e, { emit: t }) {
717
+ const s = e, n = t;
718
+ function a() {
719
+ n("click", s.url, s.redirectType);
787
720
  }
788
- return (d, i) => {
789
- const p = x("ALink");
790
- return _(), M(p, { onClick: n }, {
791
- default: A(() => [
792
- W(d.$slots, "default")
721
+ return (c, l) => {
722
+ const d = T("ALink");
723
+ return v(), L(d, { onClick: a }, {
724
+ default: U(() => [
725
+ q(c.$slots, "default")
793
726
  ]),
794
727
  _: 3
795
728
  });
796
729
  };
797
730
  }
798
- }), le = /* @__PURE__ */ H({
731
+ }), le = /* @__PURE__ */ F({
799
732
  __name: "index",
800
733
  props: {
801
734
  config: {}
802
735
  },
803
736
  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);
737
+ setup(e, { emit: t }) {
738
+ const s = e, n = t;
739
+ function a(o, r) {
740
+ n("click", s.config.widget, o, r, s.config.title);
808
741
  }
809
- const d = z(() => {
810
- switch (c.config.location) {
742
+ const c = P(() => {
743
+ switch (s.config.location) {
811
744
  case "InOperation":
812
- return Mt;
745
+ return Dt;
813
746
  case "InTable":
814
747
  default:
815
- return Rt;
748
+ return Ht;
816
749
  }
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
750
+ }), l = P(() => s.config.widget === B.Submit ? s.config.requestUrl ?? "" : s.config.widget === B.Link ? s.config.redirectUrl ?? "" : ""), d = P(() => s.config.redirectType ?? "Details");
751
+ return (o, r) => (v(), L(ke(c.value), {
752
+ url: l.value,
753
+ "redirect-type": d.value,
754
+ onClick: a
822
755
  }, {
823
- default: A(() => [
824
- ee(B(c.config.title), 1)
756
+ default: U(() => [
757
+ Z(j(s.config.title), 1)
825
758
  ]),
826
759
  _: 1
827
760
  }, 8, ["url", "redirect-type"]));
828
761
  }
829
- }), Ae = Symbol("library-router");
830
- function de() {
831
- const e = ne(Ae, null);
832
- return e || Ye();
762
+ }), He = Symbol("library-router");
763
+ function fe() {
764
+ const e = ne(He, null);
765
+ return e || et();
833
766
  }
834
- const Le = Symbol("library-triggers");
767
+ const Re = Symbol("library-triggers");
835
768
  function Ve() {
836
- const e = ne(Le, null);
769
+ const e = ne(Re, null);
837
770
  return e || {};
838
771
  }
839
- const Dt = Symbol("library-pinia"), Te = Symbol("library-bpmStore"), Me = Symbol("library-svrStore");
772
+ const Rt = Symbol("library-pinia"), Pe = Symbol("library-bpmStore"), Be = Symbol("library-svrStore");
840
773
  function pe() {
841
- return ne(Te, null);
774
+ return ne(Pe, null);
842
775
  }
843
- function fe() {
844
- return ne(Me, null);
776
+ function me() {
777
+ return ne(Be, null);
845
778
  }
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 = {
779
+ 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({
780
+ __name: "TopBar",
781
+ props: {
782
+ title: {},
783
+ subTitle: {},
784
+ email: {}
785
+ },
786
+ setup(e) {
787
+ return (t, s) => {
788
+ const n = T("a-avatar"), a = T("a-popover");
789
+ return v(), S("div", Pt, [
790
+ h("div", Bt, [
791
+ h("div", zt, j(t.title), 1),
792
+ h("div", Et, j(t.subTitle), 1)
793
+ ]),
794
+ h("div", Kt, [
795
+ N(a, { trigger: "click" }, {
796
+ content: U(() => [
797
+ h("div", jt, j(t.email), 1)
798
+ ]),
799
+ default: U(() => [
800
+ N(n, {
801
+ size: 48,
802
+ autoFixFontSize: "",
803
+ style: { cursor: "pointer", background: "#165DFF", color: "#fff" }
804
+ }, {
805
+ default: U(() => [
806
+ Z(j(t.email.charAt(0).toUpperCase()), 1)
807
+ ]),
808
+ _: 1
809
+ })
810
+ ]),
811
+ _: 1
812
+ })
813
+ ])
814
+ ]);
815
+ };
816
+ }
817
+ }), 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
818
  key: 0,
848
819
  class: "form-content"
849
- }, zt = { class: "page-footer" }, Wt = { class: "action-container" }, Gt = { class: "action-buttons" }, qt = /* @__PURE__ */ H({
820
+ }, Xt = { class: "page-footer" }, Qt = { class: "action-container" }, Zt = { class: "action-buttons" }, en = /* @__PURE__ */ F({
850
821
  __name: "CreateView",
851
822
  props: {
852
823
  className: {}
853
824
  },
854
825
  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)) : [];
826
+ const t = pe(), s = me(), n = fe(), a = Ve(), c = he("dataWidgets"), l = ue(), d = e, o = y({
827
+ pageType: "",
828
+ fields: {},
829
+ globalValidations: [],
830
+ banner: {
831
+ title: "",
832
+ subTitle: ""
833
+ }
834
+ }), r = y([]), w = y({});
835
+ function p(m) {
836
+ return m ? Object.entries(m).map(([i, u]) => ({
837
+ fieldKey: i,
838
+ ...u
839
+ })).filter((i) => i.widget && i.widget.widget !== "Hidden").filter((i) => !G.value.includes(i.fieldKey)) : [];
861
840
  }
862
841
  function b(m) {
863
- return m ? Object.entries(m).filter(([r, s]) => s.dependent).reduce((r, [s, v]) => (r[s] = v.dependent, r), {}) : [];
842
+ return m ? Object.entries(m).filter(([i, u]) => u.dependent).reduce((i, [u, f]) => (i[u] = f.dependent, i), {}) : [];
864
843
  }
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;
844
+ const _ = P(() => o.value?.actions ? [...o.value.actions].reverse() : []), C = Se({}), I = y(!1);
845
+ Y(async () => {
846
+ I.value = !0, o.value = await de(te.Create, d.className, {
847
+ svrStore: s,
848
+ bpmStore: t
849
+ }), r.value = p(o.value.fields), w.value = b(o.value.fields);
850
+ for (const m in o.value.fields) {
851
+ if (o.value.fields[m].widget?.widget === "File") {
852
+ const g = r.value.find((i) => i.fieldKey === m);
853
+ g && g.widget && (g.widget.files = []);
854
+ continue;
855
+ }
856
+ C[m] = o.value.fields[m].modelValue;
857
+ }
873
858
  I.value = !1;
874
859
  });
875
- async function O(m, u, r) {
860
+ function E() {
861
+ return s()?.userInfo?.email_address ?? "";
862
+ }
863
+ async function J(m, g, i) {
876
864
  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("表单验证未通过,请检查输入项");
865
+ case B.Submit:
866
+ let u = !0;
867
+ if (c.value?.forEach((V) => {
868
+ V?.validate && (V.validate() || (u = !1));
869
+ }), !u) {
870
+ l?.appContext.config.globalProperties.$message.error("表单验证未通过,请检查输入项");
883
871
  return;
884
872
  }
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 } });
873
+ const f = await ut(d.className, { ...C, ...w.value }, g);
874
+ c.value?.forEach((V) => {
875
+ V?.submit && V.submit(f);
876
+ }), l?.appContext.config.globalProperties.$notification.success("创建成功!"), n.push({ name: "List", params: { className: d.className } });
889
877
  break;
890
- case K.Link:
891
- r === "List" && t.push({ name: "List", params: { className: p.className } });
878
+ case B.Link:
879
+ i === "List" && n.push({ name: "List", params: { className: d.className } });
892
880
  break;
893
881
  default:
894
882
  console.warn("Unknown action type:", m);
895
883
  }
896
884
  }
897
- const q = k([
885
+ const G = y([
898
886
  "jobScpope",
899
887
  "currentWorkdayId",
900
888
  "originalGrade",
901
889
  "jobTitlePrevious",
902
890
  "positionId"
903
891
  ]);
904
- function Y(m, u) {
905
- n[m]?.(u, q), o.value && (l.value = f(o.value.fields));
892
+ function x(m, g) {
893
+ a[m]?.(g, G), o.value && (r.value = p(o.value.fields));
906
894
  }
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, {
895
+ return (m, g) => {
896
+ const i = T("a-spin");
897
+ return v(), S("div", Wt, [
898
+ N(ge, {
899
+ title: o.value.banner.title,
900
+ subTitle: o.value.banner.subTitle,
901
+ email: E()
902
+ }, null, 8, ["title", "subTitle", "email"]),
903
+ h("div", Gt, [
904
+ N(i, {
918
905
  loading: I.value,
919
906
  class: "form-container"
920
907
  }, {
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,
908
+ default: U(() => [
909
+ h("div", qt, [
910
+ h("div", Yt, [
911
+ (v(!0), S(H, null, z(r.value, (u, f) => (v(), S("div", {
912
+ key: u.fieldKey,
926
913
  class: "form-field-wrapper"
927
914
  }, [
928
- T(ke, {
915
+ N(Ce, {
929
916
  ref_for: !0,
930
917
  ref: "dataWidgets",
931
- "field-key": s.fieldKey,
932
- config: s,
918
+ "field-key": u.fieldKey,
919
+ config: u,
933
920
  "class-name": m.className,
934
- modelValue: S[s.fieldKey],
935
- "onUpdate:modelValue": (g) => S[s.fieldKey] = g,
921
+ modelValue: C[u.fieldKey],
922
+ "onUpdate:modelValue": (V) => C[u.fieldKey] = V,
936
923
  class: "form-field",
937
- onChange: Y
924
+ onChange: x
938
925
  }, null, 8, ["field-key", "config", "class-name", "modelValue", "onUpdate:modelValue"])
939
926
  ]))), 128))
940
927
  ]),
941
- m.$slots.content ? (_(), $("div", jt, [
942
- W(m.$slots, "content", {}, void 0, !0)
943
- ])) : te("", !0)
928
+ m.$slots.content ? (v(), S("div", Jt, [
929
+ q(m.$slots, "content", {}, void 0, !0)
930
+ ])) : ee("", !0)
944
931
  ])
945
932
  ]),
946
933
  _: 3
947
934
  }, 8, ["loading"])
948
935
  ]),
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,
936
+ h("div", Xt, [
937
+ h("div", Qt, [
938
+ q(m.$slots, "action", {}, void 0, !0),
939
+ h("div", Zt, [
940
+ (v(!0), S(H, null, z(_.value, (u) => (v(), L(le, {
941
+ key: u.Title,
942
+ config: u,
956
943
  class: "action-button",
957
- onClick: O
944
+ onClick: J
958
945
  }, null, 8, ["config"]))), 128))
959
946
  ])
960
947
  ])
@@ -962,133 +949,143 @@ const Ht = { class: "page-container" }, Ft = { class: "page-header" }, Et = { cl
962
949
  ]);
963
950
  };
964
951
  }
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 = {
952
+ }), 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
953
  key: 0,
967
954
  class: "form-content"
968
- }, sa = { class: "page-footer" }, oa = { class: "action-container" }, ra = { class: "action-buttons" }, la = /* @__PURE__ */ H({
955
+ }, ln = { class: "page-footer" }, cn = { class: "action-container" }, un = { class: "action-buttons" }, dn = /* @__PURE__ */ F({
969
956
  __name: "UpdateView",
970
957
  props: {
971
958
  className: {},
972
959
  workflowId: {}
973
960
  },
974
961
  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)) : [];
962
+ const t = fe(), s = Ve(), n = me(), a = pe(), c = he("dataWidgets"), l = ue(), d = e, o = y({
963
+ pageType: "",
964
+ fields: {},
965
+ globalValidations: [],
966
+ banner: {
967
+ title: "",
968
+ subTitle: ""
969
+ }
970
+ }), r = y([]), w = y({});
971
+ function p(m) {
972
+ return m ? Object.entries(m).map(([i, u]) => ({
973
+ fieldKey: i,
974
+ ...u
975
+ })).filter((i) => i.widget && i.widget.widget !== "Hidden").filter((i) => !G.value.includes(i.fieldKey)) : [];
981
976
  }
982
- function b(u) {
983
- return u ? Object.entries(u).filter(([s, v]) => v.dependent).reduce((s, [v, g]) => (s[v] = g.dependent, s), {}) : [];
977
+ function b(m) {
978
+ return m ? Object.entries(m).filter(([i, u]) => u.dependent).reduce((i, [u, f]) => (i[u] = f.dependent, i), {}) : [];
984
979
  }
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
980
+ const _ = P(() => o.value?.actions ? [...o.value.actions].reverse() : []), C = Se({}), I = y(!1);
981
+ Y(async () => {
982
+ I.value = !0, o.value = await de(te.Update, d.className, {
983
+ svrStore: n,
984
+ bpmStore: a
990
985
  }, {
991
- workflowId: p.workflowId
986
+ workflowId: d.workflowId
992
987
  });
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;
988
+ const m = await Me(te.Update, d.className, { workflowId: d.workflowId, email: E() }), g = await De(d.className, d.workflowId);
989
+ o.value.actions = o.value.actions?.filter((i) => {
990
+ const u = m.find((f) => f.button === i.title);
991
+ return u ? u.isShow : !0;
992
+ }), r.value = p(o.value.fields), w.value = b(o.value.fields);
993
+ for (const i in o.value.fields) {
994
+ if (o.value.fields[i].widget?.widget === "File") {
995
+ const u = r.value.find((f) => f.fieldKey === i);
996
+ u && u.widget && (u.widget.files = g[i] ?? []);
997
+ continue;
998
+ }
999
+ C[i] = o.value.fields[i].modelValue;
1000
+ }
1001
+ I.value = !1;
1004
1002
  });
1005
- function O() {
1006
- return t()?.userInfo?.email_address ?? "";
1003
+ function E() {
1004
+ return n()?.userInfo?.email_address ?? "";
1007
1005
  }
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("表单验证未通过,请检查输入项");
1006
+ async function J(m, g, i) {
1007
+ switch (m) {
1008
+ case B.Submit:
1009
+ let u = !0;
1010
+ if (c.value?.forEach((V) => {
1011
+ V?.validate && (V.validate() || (u = !1));
1012
+ }), !u) {
1013
+ l?.appContext.config.globalProperties.$message.error("表单验证未通过,请检查输入项");
1016
1014
  return;
1017
1015
  }
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 } });
1016
+ const f = await ft(d.className, d.workflowId, { ...C, ...w.value }, g);
1017
+ c.value?.forEach((V) => {
1018
+ V?.submit && V.submit(f);
1019
+ }), l?.appContext.config.globalProperties.$notification.success("修改成功!"), t.push({ name: "List", params: { className: d.className } });
1022
1020
  break;
1023
- case K.Link:
1024
- a.push({ name: s, params: { className: p.className } });
1021
+ case B.Link:
1022
+ t.push({ name: i, params: { className: d.className } });
1025
1023
  break;
1026
1024
  default:
1027
- console.warn("Unknown action type:", u);
1025
+ console.warn("Unknown action type:", m);
1028
1026
  }
1029
1027
  }
1030
- const Y = k([
1028
+ const G = y([
1031
1029
  "jobScpope",
1032
1030
  "currentWorkdayId",
1033
1031
  "originalGrade",
1034
1032
  "jobTitlePrevious",
1035
1033
  "positionId"
1036
1034
  ]);
1037
- function m(u, r) {
1038
- c[u]?.(r, Y), o.value && (l.value = f(o.value.fields));
1035
+ function x(m, g) {
1036
+ s[m]?.(g, G), o.value && (r.value = p(o.value.fields));
1039
1037
  }
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, {
1038
+ return (m, g) => {
1039
+ const i = T("a-spin");
1040
+ return v(), S("div", nn, [
1041
+ N(ge, {
1042
+ title: o.value.banner.title,
1043
+ subTitle: o.value.banner.subTitle,
1044
+ email: E()
1045
+ }, null, 8, ["title", "subTitle", "email"]),
1046
+ h("div", an, [
1047
+ N(i, {
1051
1048
  loading: I.value,
1052
1049
  class: "form-container"
1053
1050
  }, {
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,
1051
+ default: U(() => [
1052
+ h("div", on, [
1053
+ h("div", sn, [
1054
+ (v(!0), S(H, null, z(r.value, (u, f) => (v(), S("div", {
1055
+ key: u.fieldKey,
1059
1056
  class: "form-field-wrapper"
1060
1057
  }, [
1061
- T(ke, {
1058
+ N(Ce, {
1062
1059
  ref_for: !0,
1063
1060
  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,
1061
+ "field-key": u.fieldKey,
1062
+ name: f,
1063
+ config: u,
1064
+ "class-name": m.className,
1065
+ modelValue: C[u.fieldKey],
1066
+ "onUpdate:modelValue": (V) => C[u.fieldKey] = V,
1070
1067
  class: "form-field",
1071
- onChange: m
1068
+ onChange: x
1072
1069
  }, null, 8, ["field-key", "name", "config", "class-name", "modelValue", "onUpdate:modelValue"])
1073
1070
  ]))), 128))
1074
1071
  ]),
1075
- u.$slots.content ? (_(), $("div", na, [
1076
- W(u.$slots, "content", {}, void 0, !0)
1077
- ])) : te("", !0)
1072
+ m.$slots.content ? (v(), S("div", rn, [
1073
+ q(m.$slots, "content", {}, void 0, !0)
1074
+ ])) : ee("", !0)
1078
1075
  ])
1079
1076
  ]),
1080
1077
  _: 3
1081
1078
  }, 8, ["loading"])
1082
1079
  ]),
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,
1080
+ h("div", ln, [
1081
+ h("div", cn, [
1082
+ q(m.$slots, "action", {}, void 0, !0),
1083
+ h("div", un, [
1084
+ (v(!0), S(H, null, z(_.value, (u) => (v(), L(le, {
1085
+ key: u.Title,
1086
+ config: u,
1090
1087
  class: "action-button",
1091
- onClick: P
1088
+ onClick: J
1092
1089
  }, null, 8, ["config"]))), 128))
1093
1090
  ])
1094
1091
  ])
@@ -1096,56 +1093,143 @@ const Ht = { class: "page-container" }, Ft = { class: "page-header" }, Et = { cl
1096
1093
  ]);
1097
1094
  };
1098
1095
  }
1099
- }), ia = /* @__PURE__ */ ce(la, [["__scopeId", "data-v-118b8121"]]), Re = Symbol("library-custom-comp");
1100
- function ca() {
1101
- return ne(Re, null);
1096
+ }), fn = /* @__PURE__ */ oe(dn, [["__scopeId", "data-v-8cfc2908"]]), ze = Symbol("library-custom-comp");
1097
+ function pn() {
1098
+ return ne(ze, null);
1102
1099
  }
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 = {
1100
+ const mn = Symbol("ArcoConfigProvider"), gn = "arco", vn = "$arco", _n = (e) => {
1101
+ var t, s, n;
1102
+ const a = ue(), c = ne(mn, void 0);
1103
+ return `${(n = (s = c?.prefixCls) != null ? s : (t = a?.appContext.config.globalProperties[vn]) == null ? void 0 : t.classPrefix) != null ? n : gn}-${e}`;
1104
+ }, wn = Object.prototype.toString;
1105
+ function bn(e) {
1106
+ return wn.call(e) === "[object Number]" && e === e;
1107
+ }
1108
+ var yn = (e, t) => {
1109
+ for (const [s, n] of t)
1110
+ e[s] = n;
1111
+ return e;
1112
+ };
1113
+ const hn = F({
1114
+ name: "IconDownload",
1115
+ props: {
1116
+ size: {
1117
+ type: [Number, String]
1118
+ },
1119
+ strokeWidth: {
1120
+ type: Number,
1121
+ default: 4
1122
+ },
1123
+ strokeLinecap: {
1124
+ type: String,
1125
+ default: "butt",
1126
+ validator: (e) => ["butt", "round", "square"].includes(e)
1127
+ },
1128
+ strokeLinejoin: {
1129
+ type: String,
1130
+ default: "miter",
1131
+ validator: (e) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(e)
1132
+ },
1133
+ rotate: Number,
1134
+ spin: Boolean
1135
+ },
1136
+ emits: {
1137
+ click: (e) => !0
1138
+ },
1139
+ setup(e, { emit: t }) {
1140
+ const s = _n("icon"), n = P(() => [s, `${s}-download`, { [`${s}-spin`]: e.spin }]), a = P(() => {
1141
+ const l = {};
1142
+ return e.size && (l.fontSize = bn(e.size) ? `${e.size}px` : e.size), e.rotate && (l.transform = `rotate(${e.rotate}deg)`), l;
1143
+ });
1144
+ return {
1145
+ cls: n,
1146
+ innerStyle: a,
1147
+ onClick: (l) => {
1148
+ t("click", l);
1149
+ }
1150
+ };
1151
+ }
1152
+ }), kn = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
1153
+ function Sn(e, t, s, n, a, c) {
1154
+ return v(), S("svg", {
1155
+ viewBox: "0 0 48 48",
1156
+ fill: "none",
1157
+ xmlns: "http://www.w3.org/2000/svg",
1158
+ stroke: "currentColor",
1159
+ class: Je(e.cls),
1160
+ style: Ye(e.innerStyle),
1161
+ "stroke-width": e.strokeWidth,
1162
+ "stroke-linecap": e.strokeLinecap,
1163
+ "stroke-linejoin": e.strokeLinejoin,
1164
+ onClick: t[0] || (t[0] = (...l) => e.onClick && e.onClick(...l))
1165
+ }, t[1] || (t[1] = [
1166
+ h("path", { d: "m33.072 22.071-9.07 9.071-9.072-9.07M24 5v26m16 4v6H8v-6" }, null, -1)
1167
+ ]), 14, kn);
1168
+ }
1169
+ var be = /* @__PURE__ */ yn(hn, [["render", Sn]]);
1170
+ const Cn = Object.assign(be, {
1171
+ install: (e, t) => {
1172
+ var s;
1173
+ const n = (s = t?.iconPrefix) != null ? s : "";
1174
+ e.component(n + be.name, be);
1175
+ }
1176
+ }), 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 = {
1177
+ key: 1,
1178
+ class: "field-value"
1179
+ }, An = {
1104
1180
  key: 0,
1105
1181
  class: "detail-content"
1106
- }, ba = { class: "page-footer" }, ka = { class: "action-container" }, Va = { class: "action-buttons" }, Sa = /* @__PURE__ */ H({
1182
+ }, Ln = { class: "page-footer" }, Mn = { class: "action-container" }, Fn = { class: "action-buttons" }, Dn = /* @__PURE__ */ F({
1107
1183
  __name: "DetailView",
1108
1184
  props: {
1109
1185
  className: {},
1110
1186
  workflowId: {}
1111
1187
  },
1112
1188
  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") : [];
1189
+ const t = me(), s = pe(), n = Ve(), a = fe(), c = pn(), l = ue(), d = e, o = y({
1190
+ pageType: "",
1191
+ fields: {},
1192
+ globalValidations: [],
1193
+ banner: {
1194
+ title: "",
1195
+ subTitle: ""
1196
+ }
1197
+ }), r = y([]);
1198
+ function w(x) {
1199
+ return x ? Object.entries(x).map(([g, i]) => (typeof i.modelValue == "boolean" ? i.fieldValue = i.modelValue ? "Yes" : "No" : i.fieldValue = i.modelValue, {
1200
+ fieldKey: g,
1201
+ ...i
1202
+ })).filter((g) => g.widget && g.widget.widget !== "Hidden") : [];
1119
1203
  }
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()
1204
+ const p = P(() => o.value?.actions ? [...o.value.actions].reverse() : []), b = y(!0), _ = (x, m = "yyyy-MM-dd hh:mm:ss.fff") => {
1205
+ const g = new Date(x);
1206
+ if (isNaN(g.getTime()))
1207
+ return x;
1208
+ const i = {
1209
+ yyyy: g.getFullYear(),
1210
+ yy: g.getFullYear().toString().substring(2),
1211
+ MM: (g.getMonth() + 1).toString().padStart(2, "0"),
1212
+ M: g.getMonth() + 1,
1213
+ dd: g.getDate().toString().padStart(2, "0"),
1214
+ d: g.getDate(),
1215
+ hh: g.getHours().toString().padStart(2, "0"),
1216
+ h: g.getHours(),
1217
+ mm: g.getMinutes().toString().padStart(2, "0"),
1218
+ m: g.getMinutes(),
1219
+ ss: g.getSeconds().toString().padStart(2, "0"),
1220
+ s: g.getSeconds(),
1221
+ fff: g.getMilliseconds().toString().padStart(3, "0"),
1222
+ f: g.getMilliseconds()
1139
1223
  };
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,
1224
+ let u = m;
1225
+ for (const f of Object.keys(i))
1226
+ u = u.replace(f, i[f]);
1227
+ return u;
1228
+ }, C = (x, m) => {
1229
+ const g = x.findIndex((i) => i.isCurrent);
1230
+ return x.map((i, u) => {
1231
+ const f = {
1232
+ id: i.id,
1149
1233
  title: "",
1150
1234
  proxy: "",
1151
1235
  sub: "",
@@ -1153,113 +1237,136 @@ const ua = { class: "page-container" }, da = { class: "page-header" }, pa = { cl
1153
1237
  status: 1,
1154
1238
  time: ""
1155
1239
  };
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;
1240
+ f.title = i.workflowProcessApprovers[0]?.name;
1241
+ const V = i.workflowProcessApprovers[i.workflowProcessApprovers.length - 1], Q = i.workflowHistorys[i.workflowHistorys.length - 1], se = Q?.workflowHistoryApprovers[Q?.workflowHistoryApprovers?.length - 1];
1242
+ if (V && se && V?.email?.toLowerCase() !== se?.approverEmail?.toLowerCase() && (f.title = `${se.name}`, f.proxy = `代理: ${V.name}`), i.sort > 1 ? f.sub = "审批角色:" + i.nodeName.replace("Submit", "").replace("Approve", "") : f.sub = "提交申请", i.isCurrent && m !== -1)
1243
+ f.desc = "审批中", f.status = 1;
1160
1244
  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 = "";
1245
+ const R = i.workflowHistorys[i.workflowHistorys.length - 1];
1246
+ if (R && R.status === 100)
1247
+ f.time = _(R.takeActionAt, "yyyy-MM-dd hh:mm:ss"), f.status = 2, f.desc = "已审批";
1248
+ else if (R && R.status === 999)
1249
+ f.time = _(R.takeActionAt, "yyyy-MM-dd hh:mm:ss"), f.status = 0, f.desc = "已跳过";
1250
+ else if (R)
1251
+ if (f.time = _(R.takeActionAt, "yyyy-MM-dd hh:mm:ss"), i.sort === 1)
1252
+ f.status = 2, f.desc = "";
1169
1253
  else {
1170
- const w = N.workflowHistoryApprovers[0];
1171
- g.status = 3, g.desc = w?.reason ? `拒绝原因:${w.reason}` : "已拒绝";
1254
+ const k = R.workflowHistoryApprovers[0];
1255
+ f.status = 3, f.desc = k?.reason ? `拒绝原因:${k.reason}` : "已拒绝";
1172
1256
  }
1173
- else v < r || r === -1 ? (g.status = 0, g.desc = "已跳过") : (g.status = 0, g.desc = "待审批");
1174
- N && N.status;
1257
+ else u < g || g === -1 ? (f.status = 0, f.desc = "已跳过") : (f.status = 0, f.desc = "待审批");
1258
+ R && R.status;
1175
1259
  }
1176
- return g;
1260
+ return f;
1177
1261
  });
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
1262
+ }, I = y([]), E = y(!1);
1263
+ Y(async () => {
1264
+ b.value = !0, o.value = await de(te.Details, d.className, {
1265
+ svrStore: t,
1266
+ bpmStore: s
1183
1267
  }, {
1184
- workflowId: p.workflowId
1268
+ workflowId: d.workflowId
1185
1269
  });
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;
1270
+ const x = await Me(te.Details, d.className, { workflowId: d.workflowId, email: X() }), m = await De(d.className, d.workflowId);
1271
+ o.value.actions = o.value.actions?.filter((i) => {
1272
+ const u = x.find((f) => f.button === i.title);
1273
+ return u ? u.isShow : !0;
1274
+ }), E.value = x.find((i) => i.button === "IsGlobal")?.isShow ?? !1, r.value = w(o.value.fields);
1275
+ for (const i in o.value.fields)
1276
+ if (o.value.fields[i].widget?.widget === "File") {
1277
+ const u = r.value.find((f) => f.fieldKey === i);
1278
+ u && u.widget && (u.widget.files = m[i] ?? []);
1279
+ }
1280
+ const g = await yt(d.className, d.workflowId);
1281
+ I.value = C(g, 0), b.value = !1;
1193
1282
  });
1194
- async function P(m, u) {
1195
- return t[m]?.(u);
1283
+ async function J(x, m) {
1284
+ return n[x]?.(m);
1196
1285
  }
1197
- function q() {
1198
- return a()?.userInfo?.email_address ?? "";
1286
+ function X() {
1287
+ return t()?.userInfo?.email_address ?? "";
1199
1288
  }
1200
- async function Y(m, u, r, s) {
1289
+ async function G(x, m, g, i) {
1201
1290
  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 } });
1291
+ switch (x) {
1292
+ case B.Submit:
1293
+ const { reason: u, ifGlobal: f } = await J(i, { isGlobal: E.value }), V = i === "Approve" ? "100" : "-1";
1294
+ await wt(d.className, d.workflowId, X(), u, [Number(d.workflowId)], m, V, f);
1295
+ const Q = i === "Approve" ? "审批已通过!" : "审批已拒绝!";
1296
+ l?.appContext.config.globalProperties.$notification.success(Q), a.push({ name: "List", params: { className: d.className } });
1208
1297
  break;
1209
- case K.Link:
1210
- r === "List" && n.push({ name: "List", params: { className: p.className } });
1298
+ case B.Link:
1299
+ g === "List" && a.push({ name: "List", params: { className: d.className } });
1211
1300
  break;
1212
1301
  default:
1213
- console.warn("Unknown action type:", m);
1302
+ console.warn("Unknown action type:", x);
1214
1303
  }
1215
1304
  } catch {
1216
1305
  }
1217
1306
  }
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, {
1307
+ return (x, m) => {
1308
+ const g = T("a-link"), i = T("a-space"), u = T("a-spin");
1309
+ return v(), S("div", Vn, [
1310
+ N(ge, {
1311
+ title: o.value.banner.title,
1312
+ subTitle: o.value.banner.subTitle,
1313
+ email: X()
1314
+ }, null, 8, ["title", "subTitle", "email"]),
1315
+ h("div", $n, [
1316
+ N(u, {
1229
1317
  loading: b.value,
1230
1318
  class: "detail-container"
1231
1319
  }, {
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,
1320
+ default: U(() => [
1321
+ h("div", In, [
1322
+ (v(), L(ke($e(c).Steps), { steps: I.value }, null, 8, ["steps"])),
1323
+ h("div", xn, [
1324
+ (v(!0), S(H, null, z(r.value, (f) => (v(), S("div", {
1325
+ key: f.fieldKey,
1238
1326
  class: "detail-field-wrapper"
1239
1327
  }, [
1240
- y("div", _a, [
1241
- y("div", ha, B(s.widget?.title), 1),
1242
- y("div", wa, B(s.fieldValue), 1)
1328
+ h("div", Tn, [
1329
+ h("div", Nn, j(f.widget?.title), 1),
1330
+ f.widget?.widget === "File" ? (v(!0), S(H, { key: 0 }, z(f.widget.files, (V) => (v(), S("div", {
1331
+ class: "field-value",
1332
+ key: V.id
1333
+ }, [
1334
+ N(i, null, {
1335
+ default: U(() => [
1336
+ Z(j(V.name), 1),
1337
+ N(g, {
1338
+ href: V.url,
1339
+ target: "_blank"
1340
+ }, {
1341
+ default: U(() => [
1342
+ N($e(Cn), { style: { color: "#7A00E6" } })
1343
+ ]),
1344
+ _: 2
1345
+ }, 1032, ["href"])
1346
+ ]),
1347
+ _: 2
1348
+ }, 1024)
1349
+ ]))), 128)) : (v(), S("div", Un, j(f.fieldValue), 1))
1243
1350
  ])
1244
1351
  ]))), 128))
1245
1352
  ]),
1246
- m.$slots.content ? (_(), $("div", ya, [
1247
- W(m.$slots, "content", {}, void 0, !0)
1248
- ])) : te("", !0)
1353
+ x.$slots.content ? (v(), S("div", An, [
1354
+ q(x.$slots, "content", {}, void 0, !0)
1355
+ ])) : ee("", !0)
1249
1356
  ])
1250
1357
  ]),
1251
1358
  _: 3
1252
1359
  }, 8, ["loading"])
1253
1360
  ]),
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,
1361
+ h("div", Ln, [
1362
+ h("div", Mn, [
1363
+ q(x.$slots, "action", {}, void 0, !0),
1364
+ h("div", Fn, [
1365
+ (v(!0), S(H, null, z(p.value, (f) => (v(), L(le, {
1366
+ key: f.Title,
1367
+ config: f,
1261
1368
  class: "action-button",
1262
- onClick: Y
1369
+ onClick: G
1263
1370
  }, null, 8, ["config"]))), 128))
1264
1371
  ])
1265
1372
  ])
@@ -1267,14 +1374,14 @@ const ua = { class: "page-container" }, da = { class: "page-header" }, pa = { cl
1267
1374
  ]);
1268
1375
  };
1269
1376
  }
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({
1377
+ }), Hn = /* @__PURE__ */ oe(Dn, [["__scopeId", "data-v-7604f8d3"]]), Rn = { class: "list-container" }, Pn = { class: "query-title" }, Bn = { class: "field-wrapper" }, zn = /* @__PURE__ */ F({
1271
1378
  name: "ListView",
1272
1379
  __name: "ListView",
1273
1380
  props: {
1274
1381
  className: {}
1275
1382
  },
1276
1383
  setup(e) {
1277
- const a = fe(), c = pe(), t = de(), n = e, d = k(), i = be({
1384
+ const t = me(), s = pe(), n = fe(), a = e, c = y(), l = Se({
1278
1385
  current: 1,
1279
1386
  total: 0,
1280
1387
  pageSize: 10,
@@ -1283,31 +1390,31 @@ const ua = { class: "page-container" }, da = { class: "page-header" }, pa = { cl
1283
1390
  showPageSize: !0,
1284
1391
  filters: []
1285
1392
  });
1286
- function p() {
1287
- const w = Object.entries(v.value).filter(([, C]) => C && C !== "").map(([C, U]) => ({
1288
- key: C,
1289
- value: U
1393
+ function d() {
1394
+ const k = Object.entries(u.value).filter(([, $]) => $ && $ !== "").map(([$, A]) => ({
1395
+ key: $,
1396
+ value: A
1290
1397
  // operator: 'like' // 根据实际需要调整操作符
1291
1398
  }));
1292
1399
  return {
1293
- pageNumber: i.current,
1294
- pageSize: i.pageSize,
1295
- filters: [...i.filters, ...w],
1400
+ pageNumber: l.current,
1401
+ pageSize: l.pageSize,
1402
+ filters: [...l.filters, ...k],
1296
1403
  sorts: [{
1297
1404
  key: "status",
1298
1405
  type: 0
1299
1406
  }]
1300
1407
  };
1301
1408
  }
1302
- const o = z(() => ({
1303
- x: f.value.length * 150 + 250
1409
+ const o = P(() => ({
1410
+ x: p.value.length * 150 + 250
1304
1411
  // 只设置横向滚动
1305
1412
  // 移除 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,
1413
+ })), r = (k) => {
1414
+ const $ = Object.entries(k).filter(([, A]) => A.widget?.column).map(([A, K], re) => ({
1415
+ title: K.widget.title,
1416
+ dataIndex: A.charAt(0).toLowerCase() + A.slice(1),
1417
+ order: K.order,
1311
1418
  ellipsis: !0,
1312
1419
  tooltip: !0,
1313
1420
  width: 150,
@@ -1315,8 +1422,8 @@ const ua = { class: "page-container" }, da = { class: "page-header" }, pa = { cl
1315
1422
  // 启用最小宽度
1316
1423
  resizable: !0
1317
1424
  // 启用列宽调整
1318
- })).sort((U, J) => U.order - J.order);
1319
- C.push({
1425
+ })).sort((A, K) => A.order - K.order);
1426
+ $.push({
1320
1427
  title: "Actions",
1321
1428
  slotName: "optional",
1322
1429
  align: "center",
@@ -1324,135 +1431,139 @@ const ua = { class: "page-container" }, da = { class: "page-header" }, pa = { cl
1324
1431
  minWidth: 200,
1325
1432
  fixed: "right",
1326
1433
  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();
1434
+ }), p.value = $;
1435
+ }, w = y([]), p = y([]), b = y(!0), _ = y(!0), C = y(), I = async () => {
1436
+ _.value = !0;
1437
+ const k = await ct(a.className, d());
1438
+ w.value = k.data, l.total = k.totalCount, _.value = !1;
1439
+ }, E = y(!1);
1440
+ Y(async () => {
1441
+ b.value = !0, c.value = await de(3, a.className, {
1442
+ svrStore: t,
1443
+ bpmStore: s
1444
+ }), r(c.value.fields), V(c.value.fields), i(c.value?.tabs?.[0]?.key || ""), C.value = c.value.actions, b.value = !1, E.value = !0;
1445
+ }), Xe(() => {
1446
+ E.value && I();
1340
1447
  });
1341
- const P = (w) => {
1342
- i.current = w, I();
1343
- }, q = (w) => {
1344
- i.pageSize = w, I();
1448
+ const J = (k) => {
1449
+ l.current = k, I();
1450
+ }, X = (k) => {
1451
+ l.pageSize = k, I();
1345
1452
  };
1346
- function Y(w, C, U, J, oe) {
1347
- switch (w) {
1348
- case K.Link:
1349
- t.push({ name: U, params: { workflowId: oe } });
1453
+ function G(k, $, A, K, re) {
1454
+ switch (k) {
1455
+ case B.Link:
1456
+ n.push({ name: A, params: { workflowId: re } });
1350
1457
  break;
1351
1458
  default:
1352
- console.warn("Unknown action type:", w);
1459
+ console.warn("Unknown action type:", k);
1353
1460
  }
1354
1461
  }
1355
- function m(w, C, U) {
1356
- switch (w) {
1357
- case K.Link:
1358
- t.push({ name: U });
1462
+ function x(k, $, A) {
1463
+ switch (k) {
1464
+ case B.Link:
1465
+ n.push({ name: A });
1359
1466
  break;
1360
1467
  default:
1361
- console.warn("Unknown action type:", w);
1468
+ console.warn("Unknown action type:", k);
1362
1469
  }
1363
1470
  }
1364
- function u() {
1365
- return a()?.userInfo?.email_address ?? "";
1471
+ function m() {
1472
+ return t()?.userInfo?.email_address ?? "";
1366
1473
  }
1367
- function r(w, C) {
1368
- return w.replace(/{currentUserEmail}/g, C);
1474
+ function g(k, $) {
1475
+ return k.replace(/{currentUserEmail}/g, $);
1369
1476
  }
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())
1477
+ function i(k) {
1478
+ const $ = c.value?.tabs?.find((A) => A.key === k)?.filters;
1479
+ l.filters = $?.map((A) => ({
1480
+ ...A,
1481
+ value: g(A.value, m())
1375
1482
  })) || [], I();
1376
1483
  }
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();
1484
+ const u = y({}), f = P(() => c.value?.fields ? Object.entries(c.value.fields).filter(([, k]) => k.isFiltered) : []), V = (k) => {
1485
+ const $ = {};
1486
+ Object.entries(k).forEach(([A, K]) => {
1487
+ $[A] = K.modelValue;
1488
+ }), u.value = $;
1384
1489
  }, Q = () => {
1385
- d.value && R(d.value.fields), L();
1490
+ l.current = 1, I();
1491
+ }, se = () => {
1492
+ c.value && V(c.value.fields), Q();
1386
1493
  };
1387
- function N(w, C) {
1388
- return !(w.location !== "InTable" || w.title === "Update" && (C.status === 100 || C.status === -1));
1494
+ function R(k, $) {
1495
+ return !(k.location !== "InTable" || k.title === "Update" && ($.status === 100 || $.status === -1));
1389
1496
  }
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
1497
+ return (k, $) => {
1498
+ const A = T("a-col"), K = T("a-button"), re = T("a-space"), Ke = T("a-row"), je = T("a-card"), Oe = T("a-tab-pane"), We = T("a-tabs"), Ge = T("a-table");
1499
+ return v(), S("div", Rn, [
1500
+ N(ge, {
1501
+ title: c.value?.banner.title ?? "",
1502
+ subTitle: c.value?.banner.subTitle ?? "",
1503
+ email: m()
1504
+ }, null, 8, ["title", "subTitle", "email"]),
1505
+ N(je, null, {
1506
+ default: U(() => [
1507
+ h("div", Pn, [
1508
+ $[0] || ($[0] = h("h3", null, "查询条件", -1)),
1509
+ h("div", null, [
1510
+ (v(!0), S(H, null, z(C.value, (D) => (v(), S(H, {
1511
+ key: D.title
1401
1512
  }, [
1402
- F.location === "InOperation" ? (_(), M(le, {
1513
+ D.location === "InOperation" ? (v(), L(le, {
1403
1514
  key: 0,
1404
- config: F,
1405
- onClick: m
1406
- }, null, 8, ["config"])) : te("", !0)
1515
+ config: D,
1516
+ onClick: x
1517
+ }, null, 8, ["config"])) : ee("", !0)
1407
1518
  ], 64))), 128))
1408
1519
  ])
1409
1520
  ]),
1410
- T(He, {
1521
+ N(Ke, {
1411
1522
  gutter: [24, 20],
1412
1523
  class: "search-row"
1413
1524
  }, {
1414
- default: A(() => [
1415
- (_(!0), $(E, null, j(g.value, ([F, re]) => (_(), M(U, {
1416
- key: F,
1525
+ default: U(() => [
1526
+ (v(!0), S(H, null, z(f.value, ([D, ie]) => (v(), L(A, {
1527
+ key: D,
1417
1528
  span: 6,
1418
1529
  class: "search-col"
1419
1530
  }, {
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,
1531
+ default: U(() => [
1532
+ N(Ce, {
1533
+ name: D,
1534
+ config: ie,
1535
+ modelValue: u.value[D],
1536
+ "onUpdate:modelValue": (ve) => u.value[D] = ve,
1426
1537
  class: "form-field"
1427
1538
  }, null, 8, ["name", "config", "modelValue", "onUpdate:modelValue"])
1428
1539
  ]),
1429
1540
  _: 2
1430
1541
  }, 1024))), 128)),
1431
- T(U, {
1542
+ N(A, {
1432
1543
  span: 6,
1433
1544
  class: "search-col"
1434
1545
  }, {
1435
- default: A(() => [
1436
- y("div", xa, [
1437
- T(oe, { size: "medium" }, {
1438
- default: A(() => [
1439
- T(J, {
1546
+ default: U(() => [
1547
+ h("div", Bn, [
1548
+ N(re, { size: "medium" }, {
1549
+ default: U(() => [
1550
+ N(K, {
1440
1551
  type: "primary",
1441
1552
  size: "medium",
1442
- onClick: L
1553
+ onClick: Q
1443
1554
  }, {
1444
- default: A(() => C[1] || (C[1] = [
1445
- ee(" 查询 ", -1)
1555
+ default: U(() => $[1] || ($[1] = [
1556
+ Z(" 查询 ", -1)
1446
1557
  ])),
1447
1558
  _: 1,
1448
1559
  __: [1]
1449
1560
  }),
1450
- T(J, {
1561
+ N(K, {
1451
1562
  size: "medium",
1452
- onClick: Q
1563
+ onClick: se
1453
1564
  }, {
1454
- default: A(() => C[2] || (C[2] = [
1455
- ee(" 重置 ", -1)
1565
+ default: U(() => $[2] || ($[2] = [
1566
+ Z(" 重置 ", -1)
1456
1567
  ])),
1457
1568
  _: 1,
1458
1569
  __: [2]
@@ -1470,50 +1581,50 @@ const ua = { class: "page-container" }, da = { class: "page-header" }, pa = { cl
1470
1581
  ]),
1471
1582
  _: 1
1472
1583
  }),
1473
- T(Be, {
1584
+ N(We, {
1474
1585
  size: "large",
1475
- onTabClick: s
1586
+ onTabClick: i
1476
1587
  }, {
1477
- default: A(() => [
1478
- (_(!0), $(E, null, j(d.value?.tabs, (F) => (_(), M(Ee, {
1479
- key: F.key,
1480
- title: F.title
1588
+ default: U(() => [
1589
+ (v(!0), S(H, null, z(c.value?.tabs, (D) => (v(), L(Oe, {
1590
+ key: D.key,
1591
+ title: D.title
1481
1592
  }, null, 8, ["title"]))), 128))
1482
1593
  ]),
1483
1594
  _: 1
1484
1595
  }),
1485
- T(Pe, {
1486
- columns: f.value,
1487
- data: h.value,
1596
+ N(Ge, {
1597
+ columns: p.value,
1598
+ data: w.value,
1488
1599
  stripe: "",
1489
1600
  border: "",
1490
1601
  pagination: {
1491
- current: i.current,
1492
- total: i.total,
1493
- pageSize: i.pageSize,
1494
- showTotal: i.showTotal,
1495
- showPageSize: i.showPageSize,
1602
+ current: l.current,
1603
+ total: l.total,
1604
+ pageSize: l.pageSize,
1605
+ showTotal: l.showTotal,
1606
+ showPageSize: l.showPageSize,
1496
1607
  showJumper: !0,
1497
1608
  pageSizeOptions: [10, 20, 50, 100]
1498
1609
  },
1499
- loading: V.value,
1610
+ loading: _.value,
1500
1611
  size: "medium",
1501
1612
  scroll: o.value,
1502
- onPageChange: P,
1503
- onPageSizeChange: q
1613
+ onPageChange: J,
1614
+ onPageSizeChange: X
1504
1615
  }, {
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
1616
+ optional: U(({ record: D }) => [
1617
+ N(re, { size: "small" }, {
1618
+ default: U(() => [
1619
+ (v(!0), S(H, null, z(C.value, (ie) => (v(), S(H, {
1620
+ key: ie.title
1510
1621
  }, [
1511
- N(re, F) ? (_(), M(le, {
1622
+ R(ie, D) ? (v(), L(le, {
1512
1623
  key: 0,
1513
- config: re,
1624
+ config: ie,
1514
1625
  size: "small",
1515
- onClick: (...me) => Y(...me, F.workflowId)
1516
- }, null, 8, ["config", "onClick"])) : te("", !0)
1626
+ onClick: (...ve) => G(...ve, D.workflowId)
1627
+ }, null, 8, ["config", "onClick"])) : ee("", !0)
1517
1628
  ], 64))), 128))
1518
1629
  ]),
1519
1630
  _: 2
@@ -1524,28 +1635,28 @@ const ua = { class: "page-container" }, da = { class: "page-header" }, pa = { cl
1524
1635
  ]);
1525
1636
  };
1526
1637
  }
1527
- }), Aa = /* @__PURE__ */ ce(Ua, [["__scopeId", "data-v-78e2b122"]]);
1528
- let _e = {};
1529
- function La(e) {
1530
- _e = { ..._e, ...e };
1638
+ }), En = /* @__PURE__ */ oe(zn, [["__scopeId", "data-v-477f539f"]]);
1639
+ let ye = {};
1640
+ function Kn(e) {
1641
+ ye = { ...ye, ...e };
1531
1642
  }
1532
- function De() {
1533
- return _e;
1643
+ function Ee() {
1644
+ return ye;
1534
1645
  }
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);
1646
+ const qn = {
1647
+ install(e, t = {}) {
1648
+ 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
1649
  }
1539
1650
  };
1540
1651
  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
1652
+ tn as CreateView,
1653
+ Hn as DetailView,
1654
+ En as ListView,
1655
+ Rt as PiniaKey,
1656
+ He as RouterKey,
1657
+ fn as UpdateView,
1658
+ qn as default,
1659
+ Ee as getLibraryConfig,
1660
+ Kn as setLibraryConfig
1550
1661
  };
1551
1662
  //# sourceMappingURL=index.es.js.map