@chase-shao/vue-component-lib 1.2.4 → 1.2.5
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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +131 -109
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/main.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ref as g, defineComponent as y, resolveComponent as h, createBlock as b, openBlock as p, onMounted as
|
|
2
|
-
import
|
|
3
|
-
import { defineStore as
|
|
4
|
-
import { useRouter as
|
|
5
|
-
const
|
|
1
|
+
import { ref as g, defineComponent as y, resolveComponent as h, createBlock as b, openBlock as p, onMounted as A, withCtx as $, createElementBlock as v, Fragment as T, renderList as L, createVNode as I, computed as V, nextTick as oe, useTemplateRef as Q, watch as se, createElementVNode as w, toDisplayString as x, createCommentVNode as F, resolveDynamicComponent as X, renderSlot as k, createTextVNode as le, inject as ie, reactive as O } from "vue";
|
|
2
|
+
import re from "axios";
|
|
3
|
+
import { defineStore as ce } from "pinia";
|
|
4
|
+
import { useRouter as ue } from "vue-router";
|
|
5
|
+
const de = ce("main", () => ({
|
|
6
6
|
token: g(void 0)
|
|
7
|
-
})),
|
|
7
|
+
})), pe = async (e) => new Promise((n) => setTimeout(n, e)), me = async (e, n, t, a = void 0) => {
|
|
8
8
|
if (e[n] === void 0)
|
|
9
9
|
try {
|
|
10
10
|
e[n] = null, e[n] = await t() || a;
|
|
@@ -12,25 +12,37 @@ const ue = re("main", () => ({
|
|
|
12
12
|
console.error(o), e[n] = void 0;
|
|
13
13
|
}
|
|
14
14
|
for (; e[n] === null; )
|
|
15
|
-
await
|
|
15
|
+
await pe(100);
|
|
16
16
|
return e[n];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
};
|
|
18
|
+
function Y() {
|
|
19
|
+
const e = mt();
|
|
20
|
+
return {
|
|
21
|
+
apiBase: e.apiBase || void 0 || "",
|
|
22
|
+
appSecret: e.appSecret || void 0 || ""
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function Z() {
|
|
26
|
+
const { apiBase: e } = Y();
|
|
27
|
+
return re.create({
|
|
28
|
+
baseURL: e,
|
|
29
|
+
timeout: 1e4,
|
|
30
|
+
// 10s
|
|
31
|
+
headers: { "Content-Type": "application/json" }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const fe = async () => {
|
|
35
|
+
const { apiBase: e, appSecret: n } = Y(), t = Z(), a = de();
|
|
36
|
+
return await me(a, "token", async () => (await t.get(`${e}/GenerateToken`, {
|
|
25
37
|
params: {
|
|
26
38
|
appid: "bpm",
|
|
27
|
-
appsecret:
|
|
39
|
+
appsecret: n
|
|
28
40
|
}
|
|
29
41
|
}))?.data?.token);
|
|
30
42
|
}, N = async () => {
|
|
31
|
-
const e = await fe();
|
|
32
|
-
return
|
|
33
|
-
},
|
|
43
|
+
const e = await fe(), n = Z();
|
|
44
|
+
return n.defaults.headers.common.Authorization = `Bearer ${e}`, n;
|
|
45
|
+
}, M = {
|
|
34
46
|
CurrentUserEmail: () => "test.email@dataGetter.ts",
|
|
35
47
|
CurrentUserPositionCode: () => 888,
|
|
36
48
|
CurrentDatetime: () => (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -38,7 +50,7 @@ const ue = re("main", () => ({
|
|
|
38
50
|
ApproverPositionCode: () => 999,
|
|
39
51
|
RejectReason: () => "Test Reject Reason"
|
|
40
52
|
};
|
|
41
|
-
var
|
|
53
|
+
var W = /* @__PURE__ */ ((e) => (e[e.Create = 0] = "Create", e[e.Update = 1] = "Update", e[e.Details = 2] = "Details", e[e.list = 3] = "list", e))(W || {});
|
|
42
54
|
function ge(e) {
|
|
43
55
|
const n = {
|
|
44
56
|
pageType: "",
|
|
@@ -81,11 +93,11 @@ function ge(e) {
|
|
|
81
93
|
} : s.AttributeType === "UIValidationControl" ? o.validations.push(s) : s.AttributeType === "UIListed" ? o.widget = {
|
|
82
94
|
...s,
|
|
83
95
|
column: !0
|
|
84
|
-
} : s.DependentType && (o.value =
|
|
96
|
+
} : s.DependentType && (o.value = M[s.DependentType] ? M[s.DependentType]() : "");
|
|
85
97
|
}), n.fields[t] = o;
|
|
86
98
|
}), n;
|
|
87
99
|
}
|
|
88
|
-
const
|
|
100
|
+
const j = async (e, n) => {
|
|
89
101
|
const a = await (await N()).get(`/General/${e}/page`, { params: n });
|
|
90
102
|
return ge(a?.data);
|
|
91
103
|
};
|
|
@@ -153,8 +165,8 @@ async function Ce(e, n) {
|
|
|
153
165
|
}
|
|
154
166
|
const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
155
167
|
const { RuleName: t, RuleParameter: a } = e;
|
|
156
|
-
return
|
|
157
|
-
},
|
|
168
|
+
return Se[t](a, n);
|
|
169
|
+
}, Se = {
|
|
158
170
|
Regex: (e, n) => new RegExp(e).test(n)
|
|
159
171
|
}, q = /* @__PURE__ */ y({
|
|
160
172
|
__name: "InputText",
|
|
@@ -183,7 +195,7 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
183
195
|
}, null, 8, ["model-value", "disabled"]);
|
|
184
196
|
};
|
|
185
197
|
}
|
|
186
|
-
}),
|
|
198
|
+
}), Re = /* @__PURE__ */ y({
|
|
187
199
|
__name: "InputNumber",
|
|
188
200
|
props: {
|
|
189
201
|
modelValue: {},
|
|
@@ -194,7 +206,7 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
194
206
|
emits: ["update:modelValue", "change", "error", "input"],
|
|
195
207
|
setup(e, { emit: n }) {
|
|
196
208
|
const t = e, a = n, o = g(100), u = g(0);
|
|
197
|
-
|
|
209
|
+
A(() => {
|
|
198
210
|
t.validations && t.validations.forEach((l) => {
|
|
199
211
|
l.RuleName === "Max" && (o.value = l.RuleParameter), l.RuleName === "Min" && (u.value = l.RuleParameter);
|
|
200
212
|
});
|
|
@@ -226,7 +238,7 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
226
238
|
emits: ["update:modelValue", "change"],
|
|
227
239
|
setup(e, { emit: n }) {
|
|
228
240
|
const t = e, a = n, o = g(!1), u = g(t.config.options ?? []);
|
|
229
|
-
|
|
241
|
+
A(async () => {
|
|
230
242
|
u.value = await Ce(t.config.DataSourceProvider);
|
|
231
243
|
});
|
|
232
244
|
const s = (l) => {
|
|
@@ -242,7 +254,7 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
242
254
|
onChange: s
|
|
243
255
|
}, {
|
|
244
256
|
default: $(() => [
|
|
245
|
-
(p(!0), v(
|
|
257
|
+
(p(!0), v(T, null, L(u.value, (d) => (p(), b(r, {
|
|
246
258
|
key: d.value,
|
|
247
259
|
value: d.value,
|
|
248
260
|
label: d.label
|
|
@@ -252,7 +264,7 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
252
264
|
}, 8, ["model-value", "loading"]);
|
|
253
265
|
};
|
|
254
266
|
}
|
|
255
|
-
}),
|
|
267
|
+
}), Te = /* @__PURE__ */ y({
|
|
256
268
|
__name: "Cascader",
|
|
257
269
|
props: {
|
|
258
270
|
modelValue: {},
|
|
@@ -263,7 +275,7 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
263
275
|
const t = e, a = n, o = g(t.config.options ?? []), u = (s) => {
|
|
264
276
|
a("update:modelValue", s), a("change", s);
|
|
265
277
|
};
|
|
266
|
-
|
|
278
|
+
A(async () => {
|
|
267
279
|
if (t.config) {
|
|
268
280
|
const s = t.config.DataSourceProvider;
|
|
269
281
|
if (s) {
|
|
@@ -315,7 +327,7 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
315
327
|
};
|
|
316
328
|
return n({
|
|
317
329
|
submit(d) {
|
|
318
|
-
console.log("🚀 ~ submit ~ workflowId:", d), i.value && (a.config.UploadURL && (s.value = d),
|
|
330
|
+
console.log("🚀 ~ submit ~ workflowId:", d), i.value && (a.config.UploadURL && (s.value = d), oe(() => {
|
|
319
331
|
i.value.submit();
|
|
320
332
|
}));
|
|
321
333
|
}
|
|
@@ -362,10 +374,10 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
362
374
|
}, null, 8, ["model-value", "disabled"]);
|
|
363
375
|
};
|
|
364
376
|
}
|
|
365
|
-
}),
|
|
377
|
+
}), xe = { class: "widget-wrapper" }, Ae = { class: "title mb-1.5" }, Ne = { class: "form-widget" }, De = { class: "widget" }, He = {
|
|
366
378
|
key: 0,
|
|
367
379
|
class: "err-msg"
|
|
368
|
-
},
|
|
380
|
+
}, Be = /* @__PURE__ */ y({
|
|
369
381
|
__name: "index",
|
|
370
382
|
props: {
|
|
371
383
|
config: {},
|
|
@@ -376,7 +388,7 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
376
388
|
emits: ["update:modelValue", "change", "error"],
|
|
377
389
|
setup(e, { expose: n, emit: t }) {
|
|
378
390
|
const a = e, o = t, u = Q("widgetRef"), i = g(a.modelValue || a.config?.value);
|
|
379
|
-
|
|
391
|
+
se(i, (m) => {
|
|
380
392
|
o("update:modelValue", m);
|
|
381
393
|
});
|
|
382
394
|
const s = V(() => {
|
|
@@ -384,11 +396,11 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
384
396
|
case "TextBox":
|
|
385
397
|
return q;
|
|
386
398
|
case "Number":
|
|
387
|
-
return
|
|
399
|
+
return Re;
|
|
388
400
|
case "SelectList":
|
|
389
401
|
return J;
|
|
390
402
|
case "Cascade":
|
|
391
|
-
return
|
|
403
|
+
return Te;
|
|
392
404
|
case "File":
|
|
393
405
|
return Ie;
|
|
394
406
|
case "TextArea":
|
|
@@ -411,8 +423,8 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
411
423
|
submit(m) {
|
|
412
424
|
d() && u.value.submit(m);
|
|
413
425
|
}
|
|
414
|
-
}), (m, C) => (p(), v("div",
|
|
415
|
-
w("div",
|
|
426
|
+
}), (m, C) => (p(), v("div", xe, [
|
|
427
|
+
w("div", Ae, x(a?.config?.widget?.Title), 1),
|
|
416
428
|
w("div", Ne, [
|
|
417
429
|
w("div", De, [
|
|
418
430
|
(p(), b(X(s.value), {
|
|
@@ -426,7 +438,7 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
426
438
|
"onUpdate:modelValue": f
|
|
427
439
|
}, null, 40, ["model-value", "config", "validations"]))
|
|
428
440
|
]),
|
|
429
|
-
l.value.length > 0 ? (p(), v("div", He,
|
|
441
|
+
l.value.length > 0 ? (p(), v("div", He, x(l.value), 1)) : F("", !0)
|
|
430
442
|
])
|
|
431
443
|
]));
|
|
432
444
|
}
|
|
@@ -435,9 +447,9 @@ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
|
435
447
|
for (const [a, o] of n)
|
|
436
448
|
t[a] = o;
|
|
437
449
|
return t;
|
|
438
|
-
},
|
|
439
|
-
var
|
|
440
|
-
const
|
|
450
|
+
}, ee = /* @__PURE__ */ E(Be, [["__scopeId", "data-v-bc0a480b"]]);
|
|
451
|
+
var S = /* @__PURE__ */ ((e) => (e[e.Submit = 0] = "Submit", e[e.Link = 1] = "Link", e))(S || {});
|
|
452
|
+
const Pe = /* @__PURE__ */ y({
|
|
441
453
|
__name: "SubmitButton",
|
|
442
454
|
props: {
|
|
443
455
|
url: {},
|
|
@@ -447,7 +459,7 @@ const Oe = /* @__PURE__ */ y({
|
|
|
447
459
|
setup(e, { emit: n }) {
|
|
448
460
|
const t = e, a = n;
|
|
449
461
|
function o() {
|
|
450
|
-
a("click",
|
|
462
|
+
a("click", S.Submit, t.url, t.redirectType);
|
|
451
463
|
}
|
|
452
464
|
return (u, i) => {
|
|
453
465
|
const s = h("AButton");
|
|
@@ -459,7 +471,7 @@ const Oe = /* @__PURE__ */ y({
|
|
|
459
471
|
});
|
|
460
472
|
};
|
|
461
473
|
}
|
|
462
|
-
}),
|
|
474
|
+
}), Oe = /* @__PURE__ */ y({
|
|
463
475
|
__name: "DetailLink",
|
|
464
476
|
props: {
|
|
465
477
|
url: {},
|
|
@@ -469,7 +481,7 @@ const Oe = /* @__PURE__ */ y({
|
|
|
469
481
|
setup(e, { emit: n }) {
|
|
470
482
|
const t = e, a = n;
|
|
471
483
|
function o() {
|
|
472
|
-
a("click",
|
|
484
|
+
a("click", S.Link, t.url, t.redirectType);
|
|
473
485
|
}
|
|
474
486
|
return (u, i) => {
|
|
475
487
|
const s = h("ALink");
|
|
@@ -481,7 +493,7 @@ const Oe = /* @__PURE__ */ y({
|
|
|
481
493
|
});
|
|
482
494
|
};
|
|
483
495
|
}
|
|
484
|
-
}),
|
|
496
|
+
}), P = /* @__PURE__ */ y({
|
|
485
497
|
__name: "index",
|
|
486
498
|
props: {
|
|
487
499
|
config: {}
|
|
@@ -495,10 +507,10 @@ const Oe = /* @__PURE__ */ y({
|
|
|
495
507
|
const u = V(() => {
|
|
496
508
|
switch (t.config.widget) {
|
|
497
509
|
case "Submit":
|
|
498
|
-
return
|
|
510
|
+
return Pe;
|
|
499
511
|
case "Link":
|
|
500
512
|
default:
|
|
501
|
-
return
|
|
513
|
+
return Oe;
|
|
502
514
|
}
|
|
503
515
|
}), i = V(() => t.config.widget === "Submit" ? t.config.requestUrl ?? "" : t.config.widget === "Link" ? t.config.redirectUrl ?? "" : ""), s = V(() => t.config.redirectType ?? "Details");
|
|
504
516
|
return (l, c) => (p(), b(X(u.value), {
|
|
@@ -507,17 +519,17 @@ const Oe = /* @__PURE__ */ y({
|
|
|
507
519
|
onClick: o
|
|
508
520
|
}, {
|
|
509
521
|
default: $(() => [
|
|
510
|
-
|
|
522
|
+
le(x(t.config.title), 1)
|
|
511
523
|
]),
|
|
512
524
|
_: 1
|
|
513
525
|
}, 8, ["url", "redirect-type"]));
|
|
514
526
|
}
|
|
515
|
-
}),
|
|
527
|
+
}), te = Symbol("library-router");
|
|
516
528
|
function K() {
|
|
517
|
-
const e =
|
|
518
|
-
return e ||
|
|
529
|
+
const e = ie(te, null);
|
|
530
|
+
return e || ue();
|
|
519
531
|
}
|
|
520
|
-
const
|
|
532
|
+
const We = { class: "page-container relative h-full" }, je = { class: "page-title p-4 bg-white" }, Ee = { class: "title" }, Ke = { class: "fields grid grid-cols-3 gap-8 bg-white p-4" }, ze = { class: "action-row absolute bottom-0 left-0 w-full bg-white p-4 flex justify-end" }, Fe = /* @__PURE__ */ y({
|
|
521
533
|
__name: "CreateView",
|
|
522
534
|
props: {
|
|
523
535
|
className: {}
|
|
@@ -526,9 +538,9 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
526
538
|
const n = K(), t = e, a = g(), o = V(() => a.value?.fields ? Object.entries(a.value.fields).map(([f, d]) => ({
|
|
527
539
|
fieldKey: f,
|
|
528
540
|
...d
|
|
529
|
-
})).filter((f) => f.widget && f.widget.Widget !== "Hidden").sort((f, d) => (f.order ?? 0) - (d.order ?? 0)) : []), u = V(() => a.value?.actions ? [...a.value.actions].reverse() : []), i =
|
|
530
|
-
|
|
531
|
-
s.value = !0, a.value = await
|
|
541
|
+
})).filter((f) => f.widget && f.widget.Widget !== "Hidden").sort((f, d) => (f.order ?? 0) - (d.order ?? 0)) : []), u = V(() => a.value?.actions ? [...a.value.actions].reverse() : []), i = O({}), s = g(!1), l = Q("dataWidgetsRef");
|
|
542
|
+
A(async () => {
|
|
543
|
+
s.value = !0, a.value = await j(W.Create, {
|
|
532
544
|
className: t.className
|
|
533
545
|
});
|
|
534
546
|
for (const r in a.value.fields)
|
|
@@ -537,13 +549,13 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
537
549
|
});
|
|
538
550
|
async function c(r, f, d) {
|
|
539
551
|
switch (r) {
|
|
540
|
-
case
|
|
552
|
+
case S.Submit:
|
|
541
553
|
const m = await ve(t.className, i, f);
|
|
542
554
|
l.value?.filter((C) => {
|
|
543
555
|
C?.submit && C.submit(m);
|
|
544
556
|
}), n.push({ name: "List" });
|
|
545
557
|
break;
|
|
546
|
-
case
|
|
558
|
+
case S.Link:
|
|
547
559
|
d === "List" && n.push({ name: "List" });
|
|
548
560
|
break;
|
|
549
561
|
default:
|
|
@@ -552,10 +564,10 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
552
564
|
}
|
|
553
565
|
return (r, f) => {
|
|
554
566
|
const d = h("a-spin");
|
|
555
|
-
return p(), v("div",
|
|
556
|
-
w("div",
|
|
567
|
+
return p(), v("div", We, [
|
|
568
|
+
w("div", je, [
|
|
557
569
|
k(r.$slots, "title", {}, () => [
|
|
558
|
-
w("div", Ee,
|
|
570
|
+
w("div", Ee, x(r.className) + " : Create", 1)
|
|
559
571
|
], !0)
|
|
560
572
|
]),
|
|
561
573
|
I(d, {
|
|
@@ -564,11 +576,11 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
564
576
|
}, {
|
|
565
577
|
default: $(() => [
|
|
566
578
|
w("div", Ke, [
|
|
567
|
-
(p(!0), v(
|
|
579
|
+
(p(!0), v(T, null, L(o.value, (m, C) => (p(), v("div", {
|
|
568
580
|
key: m.fieldKey,
|
|
569
581
|
class: "field"
|
|
570
582
|
}, [
|
|
571
|
-
I(
|
|
583
|
+
I(ee, {
|
|
572
584
|
ref_for: !0,
|
|
573
585
|
ref_key: "dataWidgetsRef",
|
|
574
586
|
ref: l,
|
|
@@ -585,7 +597,7 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
585
597
|
}, 8, ["loading"]),
|
|
586
598
|
w("div", ze, [
|
|
587
599
|
k(r.$slots, "action", {}, void 0, !0),
|
|
588
|
-
(p(!0), v(
|
|
600
|
+
(p(!0), v(T, null, L(u.value, (m) => (p(), b(P, {
|
|
589
601
|
key: m.Title,
|
|
590
602
|
config: m,
|
|
591
603
|
class: "action",
|
|
@@ -605,9 +617,9 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
605
617
|
const n = K(), t = e, a = g(), o = V(() => a.value?.fields ? Object.entries(a.value.fields).map(([r, f]) => ({
|
|
606
618
|
fieldKey: r,
|
|
607
619
|
...f
|
|
608
|
-
})).filter((r) => r.widget && r.widget.Widget !== "Hidden").sort((r, f) => (r.order ?? 0) - (f.order ?? 0)) : []), u = V(() => a.value?.actions ? [...a.value.actions].reverse() : []), i =
|
|
609
|
-
|
|
610
|
-
s.value = !0, a.value = await
|
|
620
|
+
})).filter((r) => r.widget && r.widget.Widget !== "Hidden").sort((r, f) => (r.order ?? 0) - (f.order ?? 0)) : []), u = V(() => a.value?.actions ? [...a.value.actions].reverse() : []), i = O({}), s = g(!0);
|
|
621
|
+
A(async () => {
|
|
622
|
+
s.value = !0, a.value = await j(W.Update, {
|
|
611
623
|
workflowId: t.workflowId,
|
|
612
624
|
className: t.className
|
|
613
625
|
});
|
|
@@ -617,10 +629,10 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
617
629
|
});
|
|
618
630
|
async function l(c, r, f) {
|
|
619
631
|
switch (c) {
|
|
620
|
-
case
|
|
632
|
+
case S.Submit:
|
|
621
633
|
await he(t.className, t.workflowId, i, r), n.push({ name: "List" });
|
|
622
634
|
break;
|
|
623
|
-
case
|
|
635
|
+
case S.Link:
|
|
624
636
|
f === "List" && n.push({ name: "List" });
|
|
625
637
|
break;
|
|
626
638
|
default:
|
|
@@ -632,7 +644,7 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
632
644
|
return p(), v("div", Ge, [
|
|
633
645
|
w("div", qe, [
|
|
634
646
|
k(c.$slots, "title", {}, () => [
|
|
635
|
-
w("div", Je,
|
|
647
|
+
w("div", Je, x(c.className) + " : Update", 1)
|
|
636
648
|
], !0)
|
|
637
649
|
]),
|
|
638
650
|
I(f, {
|
|
@@ -641,11 +653,11 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
641
653
|
}, {
|
|
642
654
|
default: $(() => [
|
|
643
655
|
w("div", Qe, [
|
|
644
|
-
(p(!0), v(
|
|
656
|
+
(p(!0), v(T, null, L(o.value, (d, m) => (p(), v("div", {
|
|
645
657
|
key: d.fieldKey,
|
|
646
658
|
class: "field"
|
|
647
659
|
}, [
|
|
648
|
-
I(
|
|
660
|
+
I(ee, {
|
|
649
661
|
name: m,
|
|
650
662
|
config: d,
|
|
651
663
|
modelValue: i[d.fieldKey],
|
|
@@ -659,7 +671,7 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
659
671
|
}, 8, ["loading"]),
|
|
660
672
|
w("div", Xe, [
|
|
661
673
|
k(c.$slots, "action", {}, void 0, !0),
|
|
662
|
-
(p(!0), v(
|
|
674
|
+
(p(!0), v(T, null, L(u.value, (d) => (p(), b(P, {
|
|
663
675
|
key: d.Title,
|
|
664
676
|
config: d,
|
|
665
677
|
data: i,
|
|
@@ -682,9 +694,9 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
682
694
|
fieldKey: c,
|
|
683
695
|
...r
|
|
684
696
|
})).filter((c) => c.widget && c.widget.Widget !== "Hidden").sort((c, r) => (c.order ?? 0) - (r.order ?? 0)) : []);
|
|
685
|
-
const o = V(() => a.value?.actions ? [...a.value.actions].reverse() : []), u =
|
|
686
|
-
|
|
687
|
-
i.value = !0, a.value = await
|
|
697
|
+
const o = V(() => a.value?.actions ? [...a.value.actions].reverse() : []), u = O([]), i = g(!0);
|
|
698
|
+
A(async () => {
|
|
699
|
+
i.value = !0, a.value = await j(W.Details, {
|
|
688
700
|
workflowId: t.workflowId,
|
|
689
701
|
className: t.className
|
|
690
702
|
});
|
|
@@ -697,10 +709,10 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
697
709
|
});
|
|
698
710
|
function s(l, c, r) {
|
|
699
711
|
switch (l) {
|
|
700
|
-
case
|
|
701
|
-
Ve(t.className, t.workflowId,
|
|
712
|
+
case S.Submit:
|
|
713
|
+
Ve(t.className, t.workflowId, M.ApproverEmail(), "", u, c), n.push({ name: "List" });
|
|
702
714
|
break;
|
|
703
|
-
case
|
|
715
|
+
case S.Link:
|
|
704
716
|
r === "List" && n.push({ name: "List" });
|
|
705
717
|
break;
|
|
706
718
|
default:
|
|
@@ -712,7 +724,7 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
712
724
|
return p(), v("div", et, [
|
|
713
725
|
w("div", tt, [
|
|
714
726
|
k(l.$slots, "title", {}, () => [
|
|
715
|
-
w("div", at,
|
|
727
|
+
w("div", at, x(l.className) + " : Approve", 1)
|
|
716
728
|
], !0)
|
|
717
729
|
]),
|
|
718
730
|
I(f, {
|
|
@@ -732,7 +744,7 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
732
744
|
}, 8, ["loading"]),
|
|
733
745
|
w("div", ot, [
|
|
734
746
|
k(l.$slots, "action", {}, void 0, !0),
|
|
735
|
-
(p(!0), v(
|
|
747
|
+
(p(!0), v(T, null, L(o.value, (d) => (p(), b(P, {
|
|
736
748
|
key: d.Title,
|
|
737
749
|
config: d,
|
|
738
750
|
data: u,
|
|
@@ -749,7 +761,7 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
749
761
|
className: {}
|
|
750
762
|
},
|
|
751
763
|
setup(e) {
|
|
752
|
-
const n = K(), t = e, a = g(), o =
|
|
764
|
+
const n = K(), t = e, a = g(), o = O({
|
|
753
765
|
current: 1,
|
|
754
766
|
total: 0,
|
|
755
767
|
pageSize: 20,
|
|
@@ -762,11 +774,11 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
762
774
|
Filters: [],
|
|
763
775
|
Sorts: []
|
|
764
776
|
})), i = g([]), s = g([]), l = g(!0), c = g(!0), r = g(), f = (_) => {
|
|
765
|
-
console.log(_), i.value = Object.entries(_).filter(([, U]) => U.widget?.column).map(([U,
|
|
766
|
-
title:
|
|
777
|
+
console.log(_), i.value = Object.entries(_).filter(([, U]) => U.widget?.column).map(([U, R]) => ({
|
|
778
|
+
title: R.widget.Title,
|
|
767
779
|
dataIndex: U.charAt(0).toLowerCase() + U.slice(1),
|
|
768
|
-
order:
|
|
769
|
-
})).sort((U,
|
|
780
|
+
order: R.order
|
|
781
|
+
})).sort((U, R) => U.order - R.order), i.value.push({
|
|
770
782
|
title: "Actions",
|
|
771
783
|
slotName: "optional"
|
|
772
784
|
});
|
|
@@ -775,8 +787,8 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
775
787
|
const _ = await _e(t.className, u.value);
|
|
776
788
|
s.value = _.data, o.total = _.totalCount, r.value = _.actions, c.value = !1;
|
|
777
789
|
};
|
|
778
|
-
|
|
779
|
-
l.value = !0, a.value = await
|
|
790
|
+
A(async () => {
|
|
791
|
+
l.value = !0, a.value = await j(3, {
|
|
780
792
|
className: t.className
|
|
781
793
|
}), f(a.value.fields), l.value = !1, d();
|
|
782
794
|
});
|
|
@@ -785,38 +797,38 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
785
797
|
}, C = (_) => {
|
|
786
798
|
o.pageSize = _, d();
|
|
787
799
|
};
|
|
788
|
-
function D(_, U,
|
|
800
|
+
function D(_, U, R, z) {
|
|
789
801
|
switch (_) {
|
|
790
|
-
case
|
|
791
|
-
n.push({ name:
|
|
802
|
+
case S.Link:
|
|
803
|
+
n.push({ name: R, params: { workflowId: z } });
|
|
792
804
|
break;
|
|
793
805
|
default:
|
|
794
806
|
console.warn("Unknown action type:", _);
|
|
795
807
|
}
|
|
796
808
|
}
|
|
797
|
-
function
|
|
809
|
+
function ae(_, U, R) {
|
|
798
810
|
switch (_) {
|
|
799
|
-
case
|
|
800
|
-
n.push({ name:
|
|
811
|
+
case S.Link:
|
|
812
|
+
n.push({ name: R });
|
|
801
813
|
break;
|
|
802
814
|
default:
|
|
803
815
|
console.warn("Unknown action type:", _);
|
|
804
816
|
}
|
|
805
817
|
}
|
|
806
818
|
return (_, U) => {
|
|
807
|
-
const
|
|
819
|
+
const R = h("ATable"), z = h("a-spin");
|
|
808
820
|
return p(), v("div", it, [
|
|
809
821
|
w("div", rt, [
|
|
810
822
|
k(_.$slots, "title", {}, () => [
|
|
811
|
-
w("div", ct,
|
|
812
|
-
(p(!0), v(
|
|
823
|
+
w("div", ct, x(_.className) + " : List", 1),
|
|
824
|
+
(p(!0), v(T, null, L(r.value, (H) => (p(), v(T, {
|
|
813
825
|
key: H.title
|
|
814
826
|
}, [
|
|
815
|
-
H.location === "InOperation" ? (p(), b(
|
|
827
|
+
H.location === "InOperation" ? (p(), b(P, {
|
|
816
828
|
key: 0,
|
|
817
829
|
config: H,
|
|
818
830
|
class: "action",
|
|
819
|
-
onClick: U[0] || (U[0] = (...
|
|
831
|
+
onClick: U[0] || (U[0] = (...B) => ae(...B))
|
|
820
832
|
}, null, 8, ["config"])) : F("", !0)
|
|
821
833
|
], 64))), 128))
|
|
822
834
|
])
|
|
@@ -827,7 +839,7 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
827
839
|
}, {
|
|
828
840
|
default: $(() => [
|
|
829
841
|
k(_.$slots, "content", {}, () => [
|
|
830
|
-
I(
|
|
842
|
+
I(R, {
|
|
831
843
|
columns: i.value,
|
|
832
844
|
data: s.value,
|
|
833
845
|
stripe: "",
|
|
@@ -839,14 +851,14 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
839
851
|
onPageSizeChange: C
|
|
840
852
|
}, {
|
|
841
853
|
optional: $(({ record: H }) => [
|
|
842
|
-
(p(!0), v(
|
|
843
|
-
key:
|
|
854
|
+
(p(!0), v(T, null, L(r.value, (B) => (p(), v(T, {
|
|
855
|
+
key: B.title
|
|
844
856
|
}, [
|
|
845
|
-
|
|
857
|
+
B.location === "InTable" ? (p(), b(P, {
|
|
846
858
|
key: 0,
|
|
847
|
-
config:
|
|
859
|
+
config: B,
|
|
848
860
|
class: "action",
|
|
849
|
-
onClick: (...
|
|
861
|
+
onClick: (...ne) => D(...ne, H.workflowId)
|
|
850
862
|
}, null, 8, ["config", "onClick"])) : F("", !0)
|
|
851
863
|
], 64))), 128))
|
|
852
864
|
]),
|
|
@@ -859,9 +871,17 @@ const je = { class: "page-container relative h-full" }, Be = { class: "page-titl
|
|
|
859
871
|
]);
|
|
860
872
|
};
|
|
861
873
|
}
|
|
862
|
-
}), dt = Symbol("library-pinia")
|
|
874
|
+
}), dt = Symbol("library-pinia");
|
|
875
|
+
let G = {};
|
|
876
|
+
function pt(e) {
|
|
877
|
+
G = { ...G, ...e };
|
|
878
|
+
}
|
|
879
|
+
function mt() {
|
|
880
|
+
return G;
|
|
881
|
+
}
|
|
882
|
+
const wt = {
|
|
863
883
|
install(e, n = {}) {
|
|
864
|
-
n.router && e.provide(
|
|
884
|
+
n.config && pt(n.config), n.router && e.provide(te, n.router), n.pinia && e.provide(dt, n.pinia), e.component("CreateView", Me), e.component("UpdateView", Ze), e.component("DetailView", lt), e.component("ListView", ut);
|
|
865
885
|
}
|
|
866
886
|
};
|
|
867
887
|
export {
|
|
@@ -869,8 +889,10 @@ export {
|
|
|
869
889
|
lt as DetailView,
|
|
870
890
|
ut as ListView,
|
|
871
891
|
dt as PiniaKey,
|
|
872
|
-
|
|
892
|
+
te as RouterKey,
|
|
873
893
|
Ze as UpdateView,
|
|
874
|
-
|
|
894
|
+
wt as default,
|
|
895
|
+
mt as getLibraryConfig,
|
|
896
|
+
pt as setLibraryConfig
|
|
875
897
|
};
|
|
876
898
|
//# sourceMappingURL=index.es.js.map
|