@chase-shao/vue-component-lib 1.2.0 → 1.2.2
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/composables/usePinia.d.ts +3 -7
- package/dist/composables/useRouter.d.ts +3 -10
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +428 -438
- 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 +5 -4
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { ref as g, defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { defineStore as
|
|
4
|
-
|
|
1
|
+
import { ref as g, defineComponent as y, resolveComponent as h, createBlock as b, openBlock as p, onMounted as x, withCtx as $, createElementBlock as v, Fragment as S, renderList as L, createVNode as I, computed as V, nextTick as ne, useTemplateRef as Q, watch as oe, createElementVNode as w, toDisplayString as A, createCommentVNode as F, resolveDynamicComponent as X, renderSlot as k, createTextVNode as se, inject as le, reactive as W } from "vue";
|
|
2
|
+
import ie from "axios";
|
|
3
|
+
import { defineStore as re } from "pinia";
|
|
4
|
+
import { useRouter as ce } from "vue-router";
|
|
5
|
+
const ue = re("main", () => ({
|
|
5
6
|
token: g(void 0)
|
|
6
|
-
})),
|
|
7
|
-
if (e[
|
|
7
|
+
})), de = async (e) => new Promise((n) => setTimeout(n, e)), pe = async (e, n, t, a = void 0) => {
|
|
8
|
+
if (e[n] === void 0)
|
|
8
9
|
try {
|
|
9
|
-
e[
|
|
10
|
-
} catch (
|
|
11
|
-
console.error(
|
|
10
|
+
e[n] = null, e[n] = await t() || a;
|
|
11
|
+
} catch (o) {
|
|
12
|
+
console.error(o), e[n] = void 0;
|
|
12
13
|
}
|
|
13
|
-
for (; e[
|
|
14
|
-
await
|
|
15
|
-
return e[
|
|
16
|
-
},
|
|
17
|
-
baseURL:
|
|
14
|
+
for (; e[n] === null; )
|
|
15
|
+
await de(100);
|
|
16
|
+
return e[n];
|
|
17
|
+
}, Y = "", me = "", M = ie.create({
|
|
18
|
+
baseURL: Y,
|
|
18
19
|
timeout: 1e4,
|
|
19
20
|
// 10s
|
|
20
21
|
headers: { "Content-Type": "application/json" }
|
|
21
|
-
}),
|
|
22
|
-
const e =
|
|
23
|
-
return await
|
|
22
|
+
}), fe = async () => {
|
|
23
|
+
const e = ue();
|
|
24
|
+
return await pe(e, "token", async () => (await M.get(`${Y}/GenerateToken`, {
|
|
24
25
|
params: {
|
|
25
26
|
appid: "bpm",
|
|
26
|
-
appsecret:
|
|
27
|
+
appsecret: me
|
|
27
28
|
}
|
|
28
29
|
}))?.data?.token);
|
|
29
|
-
},
|
|
30
|
-
const e = await
|
|
31
|
-
return
|
|
32
|
-
},
|
|
30
|
+
}, N = async () => {
|
|
31
|
+
const e = await fe();
|
|
32
|
+
return M.defaults.headers.common.Authorization = `Bearer ${e}`, M;
|
|
33
|
+
}, G = {
|
|
33
34
|
CurrentUserEmail: () => "test.email@dataGetter.ts",
|
|
34
35
|
CurrentUserPositionCode: () => 888,
|
|
35
36
|
CurrentDatetime: () => (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -38,18 +39,18 @@ const me = pe("main", () => ({
|
|
|
38
39
|
RejectReason: () => "Test Reject Reason"
|
|
39
40
|
};
|
|
40
41
|
var j = /* @__PURE__ */ ((e) => (e[e.Create = 0] = "Create", e[e.Update = 1] = "Update", e[e.Details = 2] = "Details", e[e.list = 3] = "list", e))(j || {});
|
|
41
|
-
function
|
|
42
|
-
const
|
|
42
|
+
function ge(e) {
|
|
43
|
+
const n = {
|
|
43
44
|
pageType: "",
|
|
44
45
|
fields: {},
|
|
45
46
|
globalValidations: []
|
|
46
47
|
};
|
|
47
48
|
return e.__ClassAttributes?.forEach((t) => {
|
|
48
|
-
t.AttributeType === "UIPageType" ?
|
|
49
|
+
t.AttributeType === "UIPageType" ? n.pageType = t.Type : t.AttributeType === "UIValidationControl" ? n.globalValidations.push({
|
|
49
50
|
rule: t.RuleName,
|
|
50
51
|
param: t.RuleParameter,
|
|
51
52
|
appliesTo: t.PropertyNames || ["*"]
|
|
52
|
-
}) : t.AttributeType === "UIControl" && (
|
|
53
|
+
}) : t.AttributeType === "UIControl" && (n.actions || (n.actions = []), n.actions.push({
|
|
53
54
|
isSubmit: t.IsSubmit,
|
|
54
55
|
requestUrl: t.RequestUrl,
|
|
55
56
|
redirectUrl: t.RedirectUrl,
|
|
@@ -59,103 +60,103 @@ function we(e) {
|
|
|
59
60
|
}));
|
|
60
61
|
}), Object.entries(e).forEach(([t, a]) => {
|
|
61
62
|
if (t === "__ClassAttributes" || t === "ClassName") return;
|
|
62
|
-
const
|
|
63
|
+
const o = {
|
|
63
64
|
validations: []
|
|
64
|
-
}, { attributes: u, propertyValue:
|
|
65
|
-
switch (
|
|
65
|
+
}, { attributes: u, propertyValue: i } = a;
|
|
66
|
+
switch (i) {
|
|
66
67
|
case null:
|
|
67
|
-
|
|
68
|
+
o.value = "";
|
|
68
69
|
break;
|
|
69
70
|
case void 0:
|
|
70
|
-
|
|
71
|
+
o.value = "";
|
|
71
72
|
break;
|
|
72
73
|
default:
|
|
73
|
-
|
|
74
|
+
o.value = i;
|
|
74
75
|
break;
|
|
75
76
|
}
|
|
76
77
|
u?.forEach((s) => {
|
|
77
|
-
s.order || s.Order ?
|
|
78
|
+
s.order || s.Order ? o.order = s.order ?? s.Order : s.AttributeType === "UIControl" ? o.widget = {
|
|
78
79
|
...s,
|
|
79
80
|
column: !0
|
|
80
|
-
} : s.AttributeType === "UIValidationControl" ?
|
|
81
|
+
} : s.AttributeType === "UIValidationControl" ? o.validations.push(s) : s.AttributeType === "UIListed" ? o.widget = {
|
|
81
82
|
...s,
|
|
82
83
|
column: !0
|
|
83
|
-
} : s.DependentType && (
|
|
84
|
-
}),
|
|
85
|
-
}),
|
|
84
|
+
} : s.DependentType && (o.value = G[s.DependentType] ? G[s.DependentType]() : "");
|
|
85
|
+
}), n.fields[t] = o;
|
|
86
|
+
}), n;
|
|
86
87
|
}
|
|
87
|
-
const
|
|
88
|
-
const a = await (await
|
|
89
|
-
return
|
|
88
|
+
const B = async (e, n) => {
|
|
89
|
+
const a = await (await N()).get(`/General/${e}/page`, { params: n });
|
|
90
|
+
return ge(a?.data);
|
|
90
91
|
};
|
|
91
|
-
async function
|
|
92
|
-
const a = await (await
|
|
92
|
+
async function _e(e, n) {
|
|
93
|
+
const a = await (await N()).get(`/General/${e}/list`, { params: n });
|
|
93
94
|
return {
|
|
94
95
|
data: a.data.Data.propertyValue.data,
|
|
95
96
|
totalCount: a.data.Data.propertyValue.totalCount,
|
|
96
|
-
actions: a.data.__ClassAttributes.filter((
|
|
97
|
-
(
|
|
98
|
-
redirectUrl:
|
|
99
|
-
location:
|
|
100
|
-
attributeType:
|
|
101
|
-
redirectType:
|
|
102
|
-
readonly:
|
|
103
|
-
widget:
|
|
104
|
-
title:
|
|
105
|
-
isSubmit:
|
|
97
|
+
actions: a.data.__ClassAttributes.filter((o) => o.AttributeType === "UIControl").map(
|
|
98
|
+
(o) => ({
|
|
99
|
+
redirectUrl: o.RedirectUrl,
|
|
100
|
+
location: o.Location,
|
|
101
|
+
attributeType: o.AttributeType,
|
|
102
|
+
redirectType: o.RedirectType,
|
|
103
|
+
readonly: o.Readonly,
|
|
104
|
+
widget: o.Widget,
|
|
105
|
+
title: o.Title,
|
|
106
|
+
isSubmit: o.IsSubmit
|
|
106
107
|
})
|
|
107
108
|
)
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
|
-
async function
|
|
111
|
-
const
|
|
111
|
+
async function ve(e, n, t) {
|
|
112
|
+
const o = await (await N()).post(t, n, {
|
|
112
113
|
params: {
|
|
113
114
|
className: e
|
|
114
115
|
}
|
|
115
116
|
});
|
|
116
|
-
return
|
|
117
|
+
return o.data.length > 0 ? o.data[0] : 0;
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
-
return e.replace(/{workflowId}/g,
|
|
119
|
+
function we(e, n) {
|
|
120
|
+
return e.replace(/{workflowId}/g, n);
|
|
120
121
|
}
|
|
121
|
-
async function
|
|
122
|
-
const
|
|
123
|
-
return (await
|
|
122
|
+
async function he(e, n, t, a) {
|
|
123
|
+
const o = await N(), u = we(a, n);
|
|
124
|
+
return (await o.put(u, t, {
|
|
124
125
|
params: {
|
|
125
126
|
className: e
|
|
126
127
|
}
|
|
127
128
|
}))?.data;
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
-
return e.replace(/{WorkflowId}/g,
|
|
130
|
+
function be(e, n) {
|
|
131
|
+
return e.replace(/{WorkflowId}/g, n);
|
|
131
132
|
}
|
|
132
|
-
function
|
|
133
|
-
return e.replace(/{ApproverEmail}/g,
|
|
133
|
+
function ye(e, n) {
|
|
134
|
+
return e.replace(/{ApproverEmail}/g, n);
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
-
return e.replace(/{WorkFlowReason}/g,
|
|
136
|
+
function ke(e, n) {
|
|
137
|
+
return e.replace(/{WorkFlowReason}/g, n);
|
|
137
138
|
}
|
|
138
|
-
async function
|
|
139
|
-
const
|
|
140
|
-
let s =
|
|
141
|
-
return s =
|
|
139
|
+
async function Ve(e, n, t, a, o, u) {
|
|
140
|
+
const i = await N();
|
|
141
|
+
let s = be(u, n);
|
|
142
|
+
return s = ye(s, t), s = ke(s, a), (await i.put(s, o, {
|
|
142
143
|
params: {
|
|
143
144
|
className: e
|
|
144
145
|
}
|
|
145
146
|
}))?.data;
|
|
146
147
|
}
|
|
147
|
-
async function
|
|
148
|
-
return ((await (await
|
|
148
|
+
async function Ce(e, n) {
|
|
149
|
+
return ((await (await N()).get(e, { params: { value: n } }))?.data).map((u) => ({
|
|
149
150
|
value: u.key,
|
|
150
151
|
label: u.value
|
|
151
152
|
}));
|
|
152
153
|
}
|
|
153
|
-
const
|
|
154
|
+
const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
|
|
154
155
|
const { RuleName: t, RuleParameter: a } = e;
|
|
155
|
-
return
|
|
156
|
-
},
|
|
157
|
-
Regex: (e,
|
|
158
|
-
},
|
|
156
|
+
return Re[t](a, n);
|
|
157
|
+
}, Re = {
|
|
158
|
+
Regex: (e, n) => new RegExp(e).test(n)
|
|
159
|
+
}, q = /* @__PURE__ */ y({
|
|
159
160
|
__name: "InputText",
|
|
160
161
|
props: {
|
|
161
162
|
modelValue: {},
|
|
@@ -164,25 +165,25 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
|
|
|
164
165
|
validations: {}
|
|
165
166
|
},
|
|
166
167
|
emits: ["update:modelValue", "change", "error", "input"],
|
|
167
|
-
setup(e, { emit:
|
|
168
|
-
const t = e, a =
|
|
168
|
+
setup(e, { emit: n }) {
|
|
169
|
+
const t = e, a = n, o = (s) => Ue(t.validations, s), u = (s) => {
|
|
169
170
|
a("update:modelValue", s), a("input", s);
|
|
170
|
-
},
|
|
171
|
-
const
|
|
172
|
-
a("update:modelValue", s), a("change", s), a("error",
|
|
171
|
+
}, i = (s) => {
|
|
172
|
+
const l = o(s);
|
|
173
|
+
a("update:modelValue", s), a("change", s), a("error", l ? "" : "Validation Error");
|
|
173
174
|
};
|
|
174
|
-
return (s,
|
|
175
|
-
const c =
|
|
176
|
-
return p(),
|
|
175
|
+
return (s, l) => {
|
|
176
|
+
const c = h("AInput");
|
|
177
|
+
return p(), b(c, {
|
|
177
178
|
"model-value": t.modelValue,
|
|
178
179
|
clearable: "",
|
|
179
180
|
disabled: t.readonly || t.config.Readonly,
|
|
180
181
|
onInput: u,
|
|
181
|
-
onChange:
|
|
182
|
+
onChange: i
|
|
182
183
|
}, null, 8, ["model-value", "disabled"]);
|
|
183
184
|
};
|
|
184
185
|
}
|
|
185
|
-
}),
|
|
186
|
+
}), Te = /* @__PURE__ */ y({
|
|
186
187
|
__name: "InputNumber",
|
|
187
188
|
props: {
|
|
188
189
|
modelValue: {},
|
|
@@ -191,57 +192,57 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
|
|
|
191
192
|
validations: {}
|
|
192
193
|
},
|
|
193
194
|
emits: ["update:modelValue", "change", "error", "input"],
|
|
194
|
-
setup(e, { emit:
|
|
195
|
-
const t = e, a =
|
|
196
|
-
|
|
197
|
-
t.validations && t.validations.forEach((
|
|
198
|
-
|
|
195
|
+
setup(e, { emit: n }) {
|
|
196
|
+
const t = e, a = n, o = g(100), u = g(0);
|
|
197
|
+
x(() => {
|
|
198
|
+
t.validations && t.validations.forEach((l) => {
|
|
199
|
+
l.RuleName === "Max" && (o.value = l.RuleParameter), l.RuleName === "Min" && (u.value = l.RuleParameter);
|
|
199
200
|
});
|
|
200
201
|
});
|
|
201
|
-
const
|
|
202
|
-
a("update:modelValue",
|
|
203
|
-
}, s = (
|
|
204
|
-
a("update:modelValue",
|
|
202
|
+
const i = (l) => {
|
|
203
|
+
a("update:modelValue", l), a("input", l);
|
|
204
|
+
}, s = (l) => {
|
|
205
|
+
a("update:modelValue", l), a("change", l);
|
|
205
206
|
};
|
|
206
|
-
return (
|
|
207
|
-
const r =
|
|
208
|
-
return p(),
|
|
207
|
+
return (l, c) => {
|
|
208
|
+
const r = h("AInputNumber");
|
|
209
|
+
return p(), b(r, {
|
|
209
210
|
"model-value": t.modelValue,
|
|
210
211
|
clearable: "",
|
|
211
212
|
disabled: t.readonly,
|
|
212
213
|
min: u.value,
|
|
213
|
-
max:
|
|
214
|
-
onInput:
|
|
214
|
+
max: o.value,
|
|
215
|
+
onInput: i,
|
|
215
216
|
onChange: s
|
|
216
217
|
}, null, 8, ["model-value", "disabled", "min", "max"]);
|
|
217
218
|
};
|
|
218
219
|
}
|
|
219
|
-
}),
|
|
220
|
+
}), J = /* @__PURE__ */ y({
|
|
220
221
|
__name: "SelectList",
|
|
221
222
|
props: {
|
|
222
223
|
modelValue: {},
|
|
223
224
|
config: {}
|
|
224
225
|
},
|
|
225
226
|
emits: ["update:modelValue", "change"],
|
|
226
|
-
setup(e, { emit:
|
|
227
|
-
const t = e, a =
|
|
228
|
-
|
|
229
|
-
u.value = await
|
|
227
|
+
setup(e, { emit: n }) {
|
|
228
|
+
const t = e, a = n, o = g(!1), u = g(t.config.options ?? []);
|
|
229
|
+
x(async () => {
|
|
230
|
+
u.value = await Ce(t.config.DataSourceProvider);
|
|
230
231
|
});
|
|
231
|
-
const s = (
|
|
232
|
-
a("update:modelValue",
|
|
232
|
+
const s = (l) => {
|
|
233
|
+
a("update:modelValue", l), a("change", l);
|
|
233
234
|
};
|
|
234
|
-
return (
|
|
235
|
-
const r =
|
|
236
|
-
return p(),
|
|
237
|
-
"model-value":
|
|
238
|
-
loading:
|
|
235
|
+
return (l, c) => {
|
|
236
|
+
const r = h("AOption"), f = h("ASelect");
|
|
237
|
+
return p(), b(f, {
|
|
238
|
+
"model-value": l.modelValue,
|
|
239
|
+
loading: o.value,
|
|
239
240
|
"filter-option": !0,
|
|
240
241
|
"allow-search": !0,
|
|
241
242
|
onChange: s
|
|
242
243
|
}, {
|
|
243
|
-
default:
|
|
244
|
-
(p(!0), v(
|
|
244
|
+
default: $(() => [
|
|
245
|
+
(p(!0), v(S, null, L(u.value, (d) => (p(), b(r, {
|
|
245
246
|
key: d.value,
|
|
246
247
|
value: d.value,
|
|
247
248
|
label: d.label
|
|
@@ -251,38 +252,38 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
|
|
|
251
252
|
}, 8, ["model-value", "loading"]);
|
|
252
253
|
};
|
|
253
254
|
}
|
|
254
|
-
}),
|
|
255
|
+
}), Se = /* @__PURE__ */ y({
|
|
255
256
|
__name: "Cascader",
|
|
256
257
|
props: {
|
|
257
258
|
modelValue: {},
|
|
258
259
|
config: {}
|
|
259
260
|
},
|
|
260
261
|
emits: ["update:modelValue", "change"],
|
|
261
|
-
setup(e, { emit:
|
|
262
|
-
const t = e, a =
|
|
262
|
+
setup(e, { emit: n }) {
|
|
263
|
+
const t = e, a = n, o = g(t.config.options ?? []), u = (s) => {
|
|
263
264
|
a("update:modelValue", s), a("change", s);
|
|
264
265
|
};
|
|
265
|
-
|
|
266
|
+
x(async () => {
|
|
266
267
|
if (t.config) {
|
|
267
268
|
const s = t.config.DataSourceProvider;
|
|
268
269
|
if (s) {
|
|
269
|
-
const c = await (await
|
|
270
|
-
|
|
270
|
+
const c = await (await N()).get(s);
|
|
271
|
+
o.value = c.data;
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
274
|
});
|
|
274
|
-
const
|
|
275
|
-
return (s,
|
|
276
|
-
const c =
|
|
277
|
-
return p(),
|
|
275
|
+
const i = { value: "key", label: "value" };
|
|
276
|
+
return (s, l) => {
|
|
277
|
+
const c = h("ACascader"), r = h("ASpace");
|
|
278
|
+
return p(), b(r, {
|
|
278
279
|
direction: "vertical",
|
|
279
280
|
size: "large"
|
|
280
281
|
}, {
|
|
281
|
-
default:
|
|
282
|
-
|
|
283
|
-
"field-names":
|
|
282
|
+
default: $(() => [
|
|
283
|
+
I(c, {
|
|
284
|
+
"field-names": i,
|
|
284
285
|
"model-value": s.modelValue,
|
|
285
|
-
options:
|
|
286
|
+
options: o.value,
|
|
286
287
|
style: { width: "320px" },
|
|
287
288
|
placeholder: "Please select ...",
|
|
288
289
|
onChange: u
|
|
@@ -292,49 +293,49 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
|
|
|
292
293
|
});
|
|
293
294
|
};
|
|
294
295
|
}
|
|
295
|
-
}),
|
|
296
|
+
}), Ie = /* @__PURE__ */ y({
|
|
296
297
|
__name: "FileUpload",
|
|
297
298
|
props: {
|
|
298
299
|
config: {}
|
|
299
300
|
},
|
|
300
301
|
emits: ["update:modelValue", "change"],
|
|
301
|
-
setup(e, { expose:
|
|
302
|
-
const a = e,
|
|
302
|
+
setup(e, { expose: n, emit: t }) {
|
|
303
|
+
const a = e, o = t, u = "", i = g(null), s = g(0), l = g([]);
|
|
303
304
|
function c(d, m) {
|
|
304
305
|
return d.replace(/{WorkflowId}/g, m);
|
|
305
306
|
}
|
|
306
|
-
const r =
|
|
307
|
+
const r = V(() => {
|
|
307
308
|
if (a.config.UploadURL) {
|
|
308
309
|
const d = u + a.config.UploadURL;
|
|
309
310
|
return c(d, s.value.toString());
|
|
310
311
|
}
|
|
311
312
|
return "";
|
|
312
313
|
}), f = (d) => {
|
|
313
|
-
|
|
314
|
+
o("change", d);
|
|
314
315
|
};
|
|
315
|
-
return
|
|
316
|
+
return n({
|
|
316
317
|
submit(d) {
|
|
317
|
-
console.log("🚀 ~ submit ~ workflowId:", d),
|
|
318
|
-
|
|
318
|
+
console.log("🚀 ~ submit ~ workflowId:", d), i.value && (a.config.UploadURL && (s.value = d), ne(() => {
|
|
319
|
+
i.value.submit();
|
|
319
320
|
}));
|
|
320
321
|
}
|
|
321
322
|
}), (d, m) => {
|
|
322
|
-
const C =
|
|
323
|
-
return p(),
|
|
323
|
+
const C = h("a-upload");
|
|
324
|
+
return p(), b(C, {
|
|
324
325
|
ref_key: "uploadRef",
|
|
325
|
-
ref:
|
|
326
|
-
modelValue:
|
|
327
|
-
"onUpdate:modelValue": m[0] || (m[0] = (D) =>
|
|
326
|
+
ref: i,
|
|
327
|
+
modelValue: l.value,
|
|
328
|
+
"onUpdate:modelValue": m[0] || (m[0] = (D) => l.value = D),
|
|
328
329
|
"auto-upload": !1,
|
|
329
330
|
action: r.value,
|
|
330
331
|
onChange: f
|
|
331
332
|
}, {
|
|
332
|
-
"start-icon":
|
|
333
|
+
"start-icon": $(() => m[1] || (m[1] = [])),
|
|
333
334
|
_: 1
|
|
334
335
|
}, 8, ["modelValue", "action"]);
|
|
335
336
|
};
|
|
336
337
|
}
|
|
337
|
-
}),
|
|
338
|
+
}), Le = /* @__PURE__ */ y({
|
|
338
339
|
__name: "TextArea",
|
|
339
340
|
props: {
|
|
340
341
|
modelValue: {},
|
|
@@ -343,28 +344,28 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
|
|
|
343
344
|
validations: {}
|
|
344
345
|
},
|
|
345
346
|
emits: ["update:modelValue", "change", "error", "input"],
|
|
346
|
-
setup(e, { emit:
|
|
347
|
-
const t = e, a =
|
|
348
|
-
a("update:modelValue",
|
|
349
|
-
}, u = (
|
|
350
|
-
a("update:modelValue",
|
|
347
|
+
setup(e, { emit: n }) {
|
|
348
|
+
const t = e, a = n, o = (i) => {
|
|
349
|
+
a("update:modelValue", i), a("input", i);
|
|
350
|
+
}, u = (i) => {
|
|
351
|
+
a("update:modelValue", i), a("change", i);
|
|
351
352
|
};
|
|
352
|
-
return (
|
|
353
|
-
const
|
|
354
|
-
return p(),
|
|
353
|
+
return (i, s) => {
|
|
354
|
+
const l = h("ATextarea");
|
|
355
|
+
return p(), b(l, {
|
|
355
356
|
"model-value": t.modelValue,
|
|
356
357
|
placeholder: "Please enter something",
|
|
357
358
|
"allow-clear": "",
|
|
358
359
|
disabled: t.readonly,
|
|
359
|
-
onInput:
|
|
360
|
+
onInput: o,
|
|
360
361
|
onChange: u
|
|
361
362
|
}, null, 8, ["model-value", "disabled"]);
|
|
362
363
|
};
|
|
363
364
|
}
|
|
364
|
-
}),
|
|
365
|
+
}), Ae = { class: "widget-wrapper" }, xe = { class: "title mb-1.5" }, Ne = { class: "form-widget" }, De = { class: "widget" }, He = {
|
|
365
366
|
key: 0,
|
|
366
367
|
class: "err-msg"
|
|
367
|
-
},
|
|
368
|
+
}, Pe = /* @__PURE__ */ y({
|
|
368
369
|
__name: "index",
|
|
369
370
|
props: {
|
|
370
371
|
config: {},
|
|
@@ -373,48 +374,48 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
|
|
|
373
374
|
validations: {}
|
|
374
375
|
},
|
|
375
376
|
emits: ["update:modelValue", "change", "error"],
|
|
376
|
-
setup(e, { expose:
|
|
377
|
-
const a = e,
|
|
378
|
-
|
|
379
|
-
|
|
377
|
+
setup(e, { expose: n, emit: t }) {
|
|
378
|
+
const a = e, o = t, u = Q("widgetRef"), i = g(a.modelValue || a.config?.value);
|
|
379
|
+
oe(i, (m) => {
|
|
380
|
+
o("update:modelValue", m);
|
|
380
381
|
});
|
|
381
|
-
const s =
|
|
382
|
+
const s = V(() => {
|
|
382
383
|
switch (a.config?.widget?.Widget) {
|
|
383
384
|
case "TextBox":
|
|
384
|
-
return
|
|
385
|
+
return q;
|
|
385
386
|
case "Number":
|
|
386
|
-
return
|
|
387
|
+
return Te;
|
|
387
388
|
case "SelectList":
|
|
388
|
-
return
|
|
389
|
+
return J;
|
|
389
390
|
case "Cascade":
|
|
390
|
-
return
|
|
391
|
+
return Se;
|
|
391
392
|
case "File":
|
|
392
|
-
return
|
|
393
|
+
return Ie;
|
|
393
394
|
case "TextArea":
|
|
394
|
-
return
|
|
395
|
+
return Le;
|
|
395
396
|
case "DropDown":
|
|
396
|
-
return
|
|
397
|
+
return J;
|
|
397
398
|
default:
|
|
398
|
-
return
|
|
399
|
+
return q;
|
|
399
400
|
}
|
|
400
|
-
}),
|
|
401
|
-
|
|
402
|
-
}, r = (m) =>
|
|
401
|
+
}), l = g(""), c = (m) => {
|
|
402
|
+
l.value = m;
|
|
403
|
+
}, r = (m) => o("change", m), f = (m) => o("update:modelValue", m);
|
|
403
404
|
function d() {
|
|
404
405
|
return a.config?.widget?.Widget === "File";
|
|
405
406
|
}
|
|
406
|
-
return
|
|
407
|
+
return n({
|
|
407
408
|
isFileUpload() {
|
|
408
409
|
return a.config?.widget?.Widget === "File";
|
|
409
410
|
},
|
|
410
411
|
submit(m) {
|
|
411
412
|
d() && u.value.submit(m);
|
|
412
413
|
}
|
|
413
|
-
}), (m, C) => (p(), v("div",
|
|
414
|
-
w("div",
|
|
415
|
-
w("div",
|
|
416
|
-
w("div",
|
|
417
|
-
(p(),
|
|
414
|
+
}), (m, C) => (p(), v("div", Ae, [
|
|
415
|
+
w("div", xe, A(a?.config?.widget?.Title), 1),
|
|
416
|
+
w("div", Ne, [
|
|
417
|
+
w("div", De, [
|
|
418
|
+
(p(), b(X(s.value), {
|
|
418
419
|
ref_key: "widgetRef",
|
|
419
420
|
ref: u,
|
|
420
421
|
"model-value": a.modelValue,
|
|
@@ -425,177 +426,166 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
|
|
|
425
426
|
"onUpdate:modelValue": f
|
|
426
427
|
}, null, 40, ["model-value", "config", "validations"]))
|
|
427
428
|
]),
|
|
428
|
-
|
|
429
|
+
l.value.length > 0 ? (p(), v("div", He, A(l.value), 1)) : F("", !0)
|
|
429
430
|
])
|
|
430
431
|
]));
|
|
431
432
|
}
|
|
432
|
-
}), E = (e,
|
|
433
|
+
}), E = (e, n) => {
|
|
433
434
|
const t = e.__vccOpts || e;
|
|
434
|
-
for (const [a,
|
|
435
|
-
t[a] =
|
|
435
|
+
for (const [a, o] of n)
|
|
436
|
+
t[a] = o;
|
|
436
437
|
return t;
|
|
437
|
-
},
|
|
438
|
-
var
|
|
439
|
-
const
|
|
438
|
+
}, Z = /* @__PURE__ */ E(Pe, [["__scopeId", "data-v-bc0a480b"]]);
|
|
439
|
+
var R = /* @__PURE__ */ ((e) => (e[e.Submit = 0] = "Submit", e[e.Link = 1] = "Link", e))(R || {});
|
|
440
|
+
const Oe = /* @__PURE__ */ y({
|
|
440
441
|
__name: "SubmitButton",
|
|
441
442
|
props: {
|
|
442
443
|
url: {},
|
|
443
444
|
redirectType: {}
|
|
444
445
|
},
|
|
445
446
|
emits: ["click"],
|
|
446
|
-
setup(e, { emit:
|
|
447
|
-
const t = e, a =
|
|
448
|
-
function
|
|
449
|
-
a("click",
|
|
447
|
+
setup(e, { emit: n }) {
|
|
448
|
+
const t = e, a = n;
|
|
449
|
+
function o() {
|
|
450
|
+
a("click", R.Submit, t.url, t.redirectType);
|
|
450
451
|
}
|
|
451
|
-
return (u,
|
|
452
|
-
const s =
|
|
453
|
-
return p(),
|
|
454
|
-
default:
|
|
455
|
-
|
|
452
|
+
return (u, i) => {
|
|
453
|
+
const s = h("AButton");
|
|
454
|
+
return p(), b(s, { onClick: o }, {
|
|
455
|
+
default: $(() => [
|
|
456
|
+
k(u.$slots, "default")
|
|
456
457
|
]),
|
|
457
458
|
_: 3
|
|
458
459
|
});
|
|
459
460
|
};
|
|
460
461
|
}
|
|
461
|
-
}),
|
|
462
|
+
}), We = /* @__PURE__ */ y({
|
|
462
463
|
__name: "DetailLink",
|
|
463
464
|
props: {
|
|
464
465
|
url: {},
|
|
465
466
|
redirectType: {}
|
|
466
467
|
},
|
|
467
468
|
emits: ["click"],
|
|
468
|
-
setup(e, { emit:
|
|
469
|
-
const t = e, a =
|
|
470
|
-
function
|
|
471
|
-
a("click",
|
|
469
|
+
setup(e, { emit: n }) {
|
|
470
|
+
const t = e, a = n;
|
|
471
|
+
function o() {
|
|
472
|
+
a("click", R.Link, t.url, t.redirectType);
|
|
472
473
|
}
|
|
473
|
-
return (u,
|
|
474
|
-
const s =
|
|
475
|
-
return p(),
|
|
476
|
-
default:
|
|
477
|
-
|
|
474
|
+
return (u, i) => {
|
|
475
|
+
const s = h("ALink");
|
|
476
|
+
return p(), b(s, { onClick: o }, {
|
|
477
|
+
default: $(() => [
|
|
478
|
+
k(u.$slots, "default")
|
|
478
479
|
]),
|
|
479
480
|
_: 3
|
|
480
481
|
});
|
|
481
482
|
};
|
|
482
483
|
}
|
|
483
|
-
}),
|
|
484
|
+
}), O = /* @__PURE__ */ y({
|
|
484
485
|
__name: "index",
|
|
485
486
|
props: {
|
|
486
487
|
config: {}
|
|
487
488
|
},
|
|
488
489
|
emits: ["click"],
|
|
489
|
-
setup(e, { emit:
|
|
490
|
-
const t = e, a =
|
|
491
|
-
function
|
|
492
|
-
a("click",
|
|
490
|
+
setup(e, { emit: n }) {
|
|
491
|
+
const t = e, a = n;
|
|
492
|
+
function o(l, c, r) {
|
|
493
|
+
a("click", l, c, r);
|
|
493
494
|
}
|
|
494
|
-
const u =
|
|
495
|
+
const u = V(() => {
|
|
495
496
|
switch (t.config.widget) {
|
|
496
497
|
case "Submit":
|
|
497
|
-
return
|
|
498
|
+
return Oe;
|
|
498
499
|
case "Link":
|
|
499
500
|
default:
|
|
500
|
-
return
|
|
501
|
+
return We;
|
|
501
502
|
}
|
|
502
|
-
}),
|
|
503
|
-
return (
|
|
504
|
-
url:
|
|
503
|
+
}), i = V(() => t.config.widget === "Submit" ? t.config.requestUrl ?? "" : t.config.widget === "Link" ? t.config.redirectUrl ?? "" : ""), s = V(() => t.config.redirectType ?? "Details");
|
|
504
|
+
return (l, c) => (p(), b(X(u.value), {
|
|
505
|
+
url: i.value,
|
|
505
506
|
"redirect-type": s.value,
|
|
506
|
-
onClick:
|
|
507
|
+
onClick: o
|
|
507
508
|
}, {
|
|
508
|
-
default:
|
|
509
|
-
|
|
509
|
+
default: $(() => [
|
|
510
|
+
se(A(t.config.title), 1)
|
|
510
511
|
]),
|
|
511
512
|
_: 1
|
|
512
513
|
}, 8, ["url", "redirect-type"]));
|
|
513
514
|
}
|
|
514
|
-
}),
|
|
515
|
-
function
|
|
516
|
-
const e =
|
|
517
|
-
|
|
518
|
-
return e;
|
|
519
|
-
const o = ue();
|
|
520
|
-
return o?.appContext.app.config.globalProperties.$router ? o.appContext.app.config.globalProperties.$router : (console.warn("[Vue Component Library] Router not found. Using mock router. Please provide router using app.use(MyPlugin, { router }) or app.provide(RouterKey, router)"), {
|
|
521
|
-
push: (t) => (console.warn("[Vue Component Library] Mock router.push called with:", t), Promise.resolve()),
|
|
522
|
-
replace: (t) => (console.warn("[Vue Component Library] Mock router.replace called with:", t), Promise.resolve()),
|
|
523
|
-
go: (t) => {
|
|
524
|
-
console.warn("[Vue Component Library] Mock router.go called with:", t);
|
|
525
|
-
},
|
|
526
|
-
back: () => {
|
|
527
|
-
console.warn("[Vue Component Library] Mock router.back called");
|
|
528
|
-
},
|
|
529
|
-
forward: () => {
|
|
530
|
-
console.warn("[Vue Component Library] Mock router.forward called");
|
|
531
|
-
}
|
|
532
|
-
});
|
|
515
|
+
}), ee = Symbol("library-router");
|
|
516
|
+
function K() {
|
|
517
|
+
const e = le(ee, null);
|
|
518
|
+
return e || ce();
|
|
533
519
|
}
|
|
534
|
-
const
|
|
520
|
+
const je = { class: "page-container relative h-full" }, Be = { 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({
|
|
535
521
|
__name: "CreateView",
|
|
536
522
|
props: {
|
|
537
523
|
className: {}
|
|
538
524
|
},
|
|
539
525
|
setup(e) {
|
|
540
|
-
const
|
|
526
|
+
const n = K(), t = e, a = g(), o = V(() => a.value?.fields ? Object.entries(a.value.fields).map(([f, d]) => ({
|
|
541
527
|
fieldKey: f,
|
|
542
528
|
...d
|
|
543
|
-
})).filter((f) => f.widget && f.widget.Widget !== "Hidden").sort((f, d) => (f.order ?? 0) - (d.order ?? 0)) : []), u =
|
|
544
|
-
|
|
545
|
-
s.value = !0, a.value = await
|
|
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 = W({}), s = g(!0), l = Q("dataWidgetsRef");
|
|
530
|
+
x(async () => {
|
|
531
|
+
s.value = !0, a.value = await B(j.Create, {
|
|
546
532
|
className: t.className
|
|
547
533
|
});
|
|
548
534
|
for (const r in a.value.fields)
|
|
549
|
-
|
|
535
|
+
i[r] = a.value.fields[r].value;
|
|
550
536
|
s.value = !1;
|
|
551
537
|
});
|
|
552
538
|
async function c(r, f, d) {
|
|
553
539
|
switch (r) {
|
|
554
|
-
case
|
|
555
|
-
const m = await
|
|
556
|
-
|
|
540
|
+
case R.Submit:
|
|
541
|
+
const m = await ve(t.className, i, f);
|
|
542
|
+
l.value?.filter((C) => {
|
|
557
543
|
C?.submit && C.submit(m);
|
|
558
|
-
}),
|
|
544
|
+
}), n.push({ name: "List" });
|
|
559
545
|
break;
|
|
560
|
-
case
|
|
561
|
-
d === "List" &&
|
|
546
|
+
case R.Link:
|
|
547
|
+
d === "List" && n.push({ name: "List" });
|
|
562
548
|
break;
|
|
563
549
|
default:
|
|
564
550
|
console.warn("Unknown action type:", r);
|
|
565
551
|
}
|
|
566
552
|
}
|
|
567
553
|
return (r, f) => {
|
|
568
|
-
const d =
|
|
569
|
-
return p(), v("div",
|
|
570
|
-
w("div",
|
|
571
|
-
|
|
572
|
-
w("div",
|
|
554
|
+
const d = h("a-spin");
|
|
555
|
+
return p(), v("div", je, [
|
|
556
|
+
w("div", Be, [
|
|
557
|
+
k(r.$slots, "title", {}, () => [
|
|
558
|
+
w("div", Ee, A(r.className) + " : Create", 1)
|
|
573
559
|
], !0)
|
|
574
560
|
]),
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
561
|
+
I(d, {
|
|
562
|
+
loading: s.value,
|
|
563
|
+
class: "page-content p-2"
|
|
564
|
+
}, {
|
|
565
|
+
default: $(() => [
|
|
566
|
+
w("div", Ke, [
|
|
567
|
+
(p(!0), v(S, null, L(o.value, (m, C) => (p(), v("div", {
|
|
568
|
+
key: m.fieldKey,
|
|
569
|
+
class: "field"
|
|
570
|
+
}, [
|
|
571
|
+
I(Z, {
|
|
572
|
+
ref_for: !0,
|
|
573
|
+
ref_key: "dataWidgetsRef",
|
|
574
|
+
ref: l,
|
|
575
|
+
name: C,
|
|
576
|
+
config: m,
|
|
577
|
+
modelValue: i[m.fieldKey],
|
|
578
|
+
"onUpdate:modelValue": (D) => i[m.fieldKey] = D
|
|
579
|
+
}, null, 8, ["name", "config", "modelValue", "onUpdate:modelValue"])
|
|
580
|
+
]))), 128))
|
|
581
|
+
]),
|
|
582
|
+
k(r.$slots, "content", {}, void 0, !0)
|
|
591
583
|
]),
|
|
592
|
-
|
|
593
|
-
])
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
y(r.$slots, "action", {}, void 0, !0),
|
|
598
|
-
(p(!0), v(R, null, S(u.value, (m) => (p(), h(H, {
|
|
584
|
+
_: 3
|
|
585
|
+
}, 8, ["loading"]),
|
|
586
|
+
w("div", ze, [
|
|
587
|
+
k(r.$slots, "action", {}, void 0, !0),
|
|
588
|
+
(p(!0), v(S, null, L(u.value, (m) => (p(), b(O, {
|
|
599
589
|
key: m.Title,
|
|
600
590
|
config: m,
|
|
601
591
|
class: "action",
|
|
@@ -605,136 +595,144 @@ const Ke = { class: "page-container relative h-full" }, Ee = { class: "page-titl
|
|
|
605
595
|
]);
|
|
606
596
|
};
|
|
607
597
|
}
|
|
608
|
-
}),
|
|
598
|
+
}), Me = /* @__PURE__ */ E(Fe, [["__scopeId", "data-v-48017fe8"]]), Ge = { class: "page-container relative h-full" }, qe = { class: "page-title p-4 bg-white" }, Je = { class: "title" }, Qe = { class: "fields grid grid-cols-3 gap-8 bg-white p-4" }, Xe = { class: "action-row absolute bottom-0 left-0 w-full bg-white p-4 flex justify-end" }, Ye = /* @__PURE__ */ y({
|
|
609
599
|
__name: "UpdateView",
|
|
610
600
|
props: {
|
|
611
601
|
className: {},
|
|
612
602
|
workflowId: {}
|
|
613
603
|
},
|
|
614
604
|
setup(e) {
|
|
615
|
-
const
|
|
605
|
+
const n = K(), t = e, a = g(), o = V(() => a.value?.fields ? Object.entries(a.value.fields).map(([r, f]) => ({
|
|
616
606
|
fieldKey: r,
|
|
617
607
|
...f
|
|
618
|
-
})).filter((r) => r.widget && r.widget.Widget !== "Hidden").sort((r, f) => (r.order ?? 0) - (f.order ?? 0)) : []), u =
|
|
619
|
-
|
|
620
|
-
s.value = !0, a.value = await
|
|
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 = W({}), s = g(!0);
|
|
609
|
+
x(async () => {
|
|
610
|
+
s.value = !0, a.value = await B(j.Update, {
|
|
621
611
|
workflowId: t.workflowId,
|
|
622
612
|
className: t.className
|
|
623
613
|
});
|
|
624
614
|
for (const c in a.value.fields)
|
|
625
|
-
|
|
615
|
+
i[c] = a.value.fields[c].value;
|
|
626
616
|
s.value = !1;
|
|
627
617
|
});
|
|
628
|
-
async function
|
|
618
|
+
async function l(c, r, f) {
|
|
629
619
|
switch (c) {
|
|
630
|
-
case
|
|
631
|
-
await
|
|
620
|
+
case R.Submit:
|
|
621
|
+
await he(t.className, t.workflowId, i, r), n.push({ name: "List" });
|
|
632
622
|
break;
|
|
633
|
-
case
|
|
634
|
-
f === "List" &&
|
|
623
|
+
case R.Link:
|
|
624
|
+
f === "List" && n.push({ name: "List" });
|
|
635
625
|
break;
|
|
636
626
|
default:
|
|
637
627
|
console.warn("Unknown action type:", c);
|
|
638
628
|
}
|
|
639
629
|
}
|
|
640
630
|
return (c, r) => {
|
|
641
|
-
const f =
|
|
642
|
-
return p(), v("div",
|
|
643
|
-
w("div",
|
|
644
|
-
|
|
645
|
-
w("div",
|
|
631
|
+
const f = h("a-spin");
|
|
632
|
+
return p(), v("div", Ge, [
|
|
633
|
+
w("div", qe, [
|
|
634
|
+
k(c.$slots, "title", {}, () => [
|
|
635
|
+
w("div", Je, A(c.className) + " : Update", 1)
|
|
646
636
|
], !0)
|
|
647
637
|
]),
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
638
|
+
I(f, {
|
|
639
|
+
loading: s.value,
|
|
640
|
+
class: "page-content p-2"
|
|
641
|
+
}, {
|
|
642
|
+
default: $(() => [
|
|
643
|
+
w("div", Qe, [
|
|
644
|
+
(p(!0), v(S, null, L(o.value, (d, m) => (p(), v("div", {
|
|
645
|
+
key: d.fieldKey,
|
|
646
|
+
class: "field"
|
|
647
|
+
}, [
|
|
648
|
+
I(Z, {
|
|
649
|
+
name: m,
|
|
650
|
+
config: d,
|
|
651
|
+
modelValue: i[d.fieldKey],
|
|
652
|
+
"onUpdate:modelValue": (C) => i[d.fieldKey] = C
|
|
653
|
+
}, null, 8, ["name", "config", "modelValue", "onUpdate:modelValue"])
|
|
654
|
+
]))), 128))
|
|
655
|
+
]),
|
|
656
|
+
k(c.$slots, "content", {}, void 0, !0)
|
|
661
657
|
]),
|
|
662
|
-
|
|
663
|
-
])
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
y(c.$slots, "action", {}, void 0, !0),
|
|
668
|
-
(p(!0), v(R, null, S(u.value, (d) => (p(), h(H, {
|
|
658
|
+
_: 3
|
|
659
|
+
}, 8, ["loading"]),
|
|
660
|
+
w("div", Xe, [
|
|
661
|
+
k(c.$slots, "action", {}, void 0, !0),
|
|
662
|
+
(p(!0), v(S, null, L(u.value, (d) => (p(), b(O, {
|
|
669
663
|
key: d.Title,
|
|
670
664
|
config: d,
|
|
671
|
-
data:
|
|
665
|
+
data: i,
|
|
672
666
|
class: "action",
|
|
673
|
-
onClick:
|
|
667
|
+
onClick: l
|
|
674
668
|
}, null, 8, ["config", "data"]))), 128))
|
|
675
669
|
])
|
|
676
670
|
]);
|
|
677
671
|
};
|
|
678
672
|
}
|
|
679
|
-
}),
|
|
673
|
+
}), Ze = /* @__PURE__ */ E(Ye, [["__scopeId", "data-v-73c3a6e5"]]), et = { class: "page-container relative h-full" }, tt = { class: "page-title p-4 bg-white" }, at = { class: "title" }, nt = { class: "bg-white" }, ot = { class: "action-row absolute bottom-0 left-0 w-full bg-white p-4 flex justify-end" }, st = /* @__PURE__ */ y({
|
|
680
674
|
__name: "DetailView",
|
|
681
675
|
props: {
|
|
682
676
|
className: {},
|
|
683
677
|
workflowId: {}
|
|
684
678
|
},
|
|
685
679
|
setup(e) {
|
|
686
|
-
const
|
|
687
|
-
|
|
680
|
+
const n = K(), t = e, a = g();
|
|
681
|
+
V(() => a.value?.fields ? Object.entries(a.value.fields).map(([c, r]) => ({
|
|
688
682
|
fieldKey: c,
|
|
689
683
|
...r
|
|
690
684
|
})).filter((c) => c.widget && c.widget.Widget !== "Hidden").sort((c, r) => (c.order ?? 0) - (r.order ?? 0)) : []);
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
|
|
685
|
+
const o = V(() => a.value?.actions ? [...a.value.actions].reverse() : []), u = W([]), i = g(!0);
|
|
686
|
+
x(async () => {
|
|
687
|
+
i.value = !0, a.value = await B(j.Details, {
|
|
694
688
|
workflowId: t.workflowId,
|
|
695
689
|
className: t.className
|
|
696
690
|
});
|
|
697
|
-
for (const [
|
|
691
|
+
for (const [l, c] of Object.entries(a.value.fields))
|
|
698
692
|
u.push({
|
|
699
|
-
label:
|
|
693
|
+
label: l,
|
|
700
694
|
value: c.value
|
|
701
695
|
});
|
|
702
|
-
|
|
696
|
+
i.value = !1;
|
|
703
697
|
});
|
|
704
|
-
function s(
|
|
705
|
-
switch (
|
|
706
|
-
case
|
|
707
|
-
|
|
698
|
+
function s(l, c, r) {
|
|
699
|
+
switch (l) {
|
|
700
|
+
case R.Submit:
|
|
701
|
+
Ve(t.className, t.workflowId, G.ApproverEmail(), "", u, c), n.push({ name: "List" });
|
|
708
702
|
break;
|
|
709
|
-
case
|
|
710
|
-
r === "List" &&
|
|
703
|
+
case R.Link:
|
|
704
|
+
r === "List" && n.push({ name: "List" });
|
|
711
705
|
break;
|
|
712
706
|
default:
|
|
713
|
-
console.warn("Unknown action type:",
|
|
707
|
+
console.warn("Unknown action type:", l);
|
|
714
708
|
}
|
|
715
709
|
}
|
|
716
|
-
return (
|
|
717
|
-
const r =
|
|
718
|
-
return p(), v("div",
|
|
719
|
-
w("div",
|
|
720
|
-
|
|
721
|
-
w("div",
|
|
710
|
+
return (l, c) => {
|
|
711
|
+
const r = h("a-descriptions"), f = h("a-spin");
|
|
712
|
+
return p(), v("div", et, [
|
|
713
|
+
w("div", tt, [
|
|
714
|
+
k(l.$slots, "title", {}, () => [
|
|
715
|
+
w("div", at, A(l.className) + " : Approve", 1)
|
|
722
716
|
], !0)
|
|
723
717
|
]),
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
718
|
+
I(f, {
|
|
719
|
+
loading: i.value,
|
|
720
|
+
class: "page-content p-2"
|
|
721
|
+
}, {
|
|
722
|
+
default: $(() => [
|
|
723
|
+
w("div", nt, [
|
|
724
|
+
I(r, {
|
|
725
|
+
data: u,
|
|
726
|
+
layout: "inline-vertical"
|
|
727
|
+
}, null, 8, ["data"])
|
|
728
|
+
]),
|
|
729
|
+
k(l.$slots, "content", {}, void 0, !0)
|
|
730
730
|
]),
|
|
731
|
-
|
|
732
|
-
])
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
y(i.$slots, "action", {}, void 0, !0),
|
|
737
|
-
(p(!0), v(R, null, S(n.value, (d) => (p(), h(H, {
|
|
731
|
+
_: 3
|
|
732
|
+
}, 8, ["loading"]),
|
|
733
|
+
w("div", ot, [
|
|
734
|
+
k(l.$slots, "action", {}, void 0, !0),
|
|
735
|
+
(p(!0), v(S, null, L(o.value, (d) => (p(), b(O, {
|
|
738
736
|
key: d.Title,
|
|
739
737
|
config: d,
|
|
740
738
|
data: u,
|
|
@@ -745,142 +743,134 @@ const Ke = { class: "page-container relative h-full" }, Ee = { class: "page-titl
|
|
|
745
743
|
]);
|
|
746
744
|
};
|
|
747
745
|
}
|
|
748
|
-
}),
|
|
746
|
+
}), lt = /* @__PURE__ */ E(st, [["__scopeId", "data-v-e77c8eef"]]), it = { class: "page-container relative h-full" }, rt = { class: "page-title p-4 bg-white" }, ct = { class: "title" }, ut = /* @__PURE__ */ y({
|
|
749
747
|
__name: "ListView",
|
|
750
748
|
props: {
|
|
751
749
|
className: {}
|
|
752
750
|
},
|
|
753
751
|
setup(e) {
|
|
754
|
-
const
|
|
752
|
+
const n = K(), t = e, a = g(), o = W({
|
|
755
753
|
current: 1,
|
|
756
754
|
total: 0,
|
|
757
755
|
pageSize: 20,
|
|
758
756
|
defaultPageSize: 20,
|
|
759
757
|
showTotal: !0,
|
|
760
758
|
showPageSize: !0
|
|
761
|
-
}), u =
|
|
762
|
-
PageNumber:
|
|
763
|
-
PageSize:
|
|
759
|
+
}), u = V(() => ({
|
|
760
|
+
PageNumber: o.current - 1,
|
|
761
|
+
PageSize: o.pageSize,
|
|
764
762
|
Filters: [],
|
|
765
763
|
Sorts: []
|
|
766
|
-
})),
|
|
767
|
-
console.log(_),
|
|
768
|
-
title:
|
|
769
|
-
dataIndex:
|
|
770
|
-
order:
|
|
771
|
-
})).sort((
|
|
764
|
+
})), 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, T]) => ({
|
|
766
|
+
title: T.widget.Title,
|
|
767
|
+
dataIndex: U.charAt(0).toLowerCase() + U.slice(1),
|
|
768
|
+
order: T.order
|
|
769
|
+
})).sort((U, T) => U.order - T.order), i.value.push({
|
|
772
770
|
title: "Actions",
|
|
773
771
|
slotName: "optional"
|
|
774
772
|
});
|
|
775
773
|
}, d = async () => {
|
|
776
774
|
c.value = !0;
|
|
777
|
-
const _ = await
|
|
778
|
-
s.value = _.data,
|
|
775
|
+
const _ = await _e(t.className, u.value);
|
|
776
|
+
s.value = _.data, o.total = _.totalCount, r.value = _.actions, c.value = !1;
|
|
779
777
|
};
|
|
780
|
-
|
|
781
|
-
|
|
778
|
+
x(async () => {
|
|
779
|
+
l.value = !0, a.value = await B(3, {
|
|
782
780
|
className: t.className
|
|
783
|
-
}), f(a.value.fields),
|
|
781
|
+
}), f(a.value.fields), l.value = !1, d();
|
|
784
782
|
});
|
|
785
783
|
const m = (_) => {
|
|
786
|
-
|
|
784
|
+
o.current = _, d();
|
|
787
785
|
}, C = (_) => {
|
|
788
|
-
|
|
786
|
+
o.pageSize = _, d();
|
|
789
787
|
};
|
|
790
|
-
function D(_,
|
|
788
|
+
function D(_, U, T, z) {
|
|
791
789
|
switch (_) {
|
|
792
|
-
case
|
|
793
|
-
|
|
790
|
+
case R.Link:
|
|
791
|
+
n.push({ name: T, params: { workflowId: z } });
|
|
794
792
|
break;
|
|
795
793
|
default:
|
|
796
794
|
console.warn("Unknown action type:", _);
|
|
797
795
|
}
|
|
798
796
|
}
|
|
799
|
-
function
|
|
797
|
+
function te(_, U, T) {
|
|
800
798
|
switch (_) {
|
|
801
|
-
case
|
|
802
|
-
|
|
799
|
+
case R.Link:
|
|
800
|
+
n.push({ name: T });
|
|
803
801
|
break;
|
|
804
802
|
default:
|
|
805
803
|
console.warn("Unknown action type:", _);
|
|
806
804
|
}
|
|
807
805
|
}
|
|
808
|
-
return (_,
|
|
809
|
-
const
|
|
810
|
-
return p(), v("div",
|
|
811
|
-
w("div",
|
|
812
|
-
|
|
813
|
-
w("div",
|
|
814
|
-
(p(!0), v(
|
|
815
|
-
key:
|
|
806
|
+
return (_, U) => {
|
|
807
|
+
const T = h("ATable"), z = h("a-spin");
|
|
808
|
+
return p(), v("div", it, [
|
|
809
|
+
w("div", rt, [
|
|
810
|
+
k(_.$slots, "title", {}, () => [
|
|
811
|
+
w("div", ct, A(_.className) + " : List", 1),
|
|
812
|
+
(p(!0), v(S, null, L(r.value, (H) => (p(), v(S, {
|
|
813
|
+
key: H.title
|
|
816
814
|
}, [
|
|
817
|
-
|
|
815
|
+
H.location === "InOperation" ? (p(), b(O, {
|
|
818
816
|
key: 0,
|
|
819
|
-
config:
|
|
817
|
+
config: H,
|
|
820
818
|
class: "action",
|
|
821
|
-
onClick:
|
|
822
|
-
}, null, 8, ["config"])) :
|
|
819
|
+
onClick: U[0] || (U[0] = (...P) => te(...P))
|
|
820
|
+
}, null, 8, ["config"])) : F("", !0)
|
|
823
821
|
], 64))), 128))
|
|
824
822
|
])
|
|
825
823
|
]),
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
824
|
+
I(z, {
|
|
825
|
+
loading: l.value,
|
|
826
|
+
class: "page-conteont p-2"
|
|
827
|
+
}, {
|
|
828
|
+
default: $(() => [
|
|
829
|
+
k(_.$slots, "content", {}, () => [
|
|
830
|
+
I(T, {
|
|
831
|
+
columns: i.value,
|
|
832
|
+
data: s.value,
|
|
833
|
+
stripe: "",
|
|
834
|
+
border: "",
|
|
835
|
+
"page-position": "bl",
|
|
836
|
+
pagination: o,
|
|
837
|
+
loading: c.value,
|
|
838
|
+
onPageChange: m,
|
|
839
|
+
onPageSizeChange: C
|
|
840
|
+
}, {
|
|
841
|
+
optional: $(({ record: H }) => [
|
|
842
|
+
(p(!0), v(S, null, L(r.value, (P) => (p(), v(S, {
|
|
843
|
+
key: P.title
|
|
844
|
+
}, [
|
|
845
|
+
P.location === "InTable" ? (p(), b(O, {
|
|
846
|
+
key: 0,
|
|
847
|
+
config: P,
|
|
848
|
+
class: "action",
|
|
849
|
+
onClick: (...ae) => D(...ae, H.workflowId)
|
|
850
|
+
}, null, 8, ["config", "onClick"])) : F("", !0)
|
|
851
|
+
], 64))), 128))
|
|
852
|
+
]),
|
|
853
|
+
_: 1
|
|
854
|
+
}, 8, ["columns", "data", "pagination", "loading"])
|
|
855
|
+
])
|
|
856
|
+
]),
|
|
857
|
+
_: 3
|
|
858
|
+
}, 8, ["loading"])
|
|
857
859
|
]);
|
|
858
860
|
};
|
|
859
861
|
}
|
|
860
|
-
}),
|
|
861
|
-
install(e,
|
|
862
|
-
|
|
863
|
-
e.provide(Q, o.router);
|
|
864
|
-
else {
|
|
865
|
-
const t = e.config.globalProperties.$router;
|
|
866
|
-
t ? e.provide(Q, t) : console.warn("[Vue Component Library] Router not provided. Some features may not work. Please provide router using app.use(MyPlugin, { router })");
|
|
867
|
-
}
|
|
868
|
-
if (o.pinia)
|
|
869
|
-
e.provide(Z, o.pinia);
|
|
870
|
-
else {
|
|
871
|
-
const t = e.config.globalProperties.$pinia;
|
|
872
|
-
t ? e.provide(Z, t) : console.warn("[Vue Component Library] Pinia not provided. Some features may not work. Please provide pinia using app.use(MyPlugin, { pinia })");
|
|
873
|
-
}
|
|
874
|
-
e.component("CreateView", Qe), e.component("UpdateView", nt), e.component("DetailView", pt), e.component("ListView", _t);
|
|
862
|
+
}), dt = Symbol("library-pinia"), _t = {
|
|
863
|
+
install(e, n = {}) {
|
|
864
|
+
n.router && e.provide(ee, 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);
|
|
875
865
|
}
|
|
876
866
|
};
|
|
877
867
|
export {
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
868
|
+
Me as CreateView,
|
|
869
|
+
lt as DetailView,
|
|
870
|
+
ut as ListView,
|
|
871
|
+
dt as PiniaKey,
|
|
872
|
+
ee as RouterKey,
|
|
873
|
+
Ze as UpdateView,
|
|
874
|
+
_t as default
|
|
885
875
|
};
|
|
886
876
|
//# sourceMappingURL=index.es.js.map
|