@kayak-sj/design 1.0.61 → 1.0.62
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/assets/KEditor-BVdumcqg.css +1 -0
- package/dist/assets/componentRegistry-Dzfoc0H0.css +1 -0
- package/dist/chunks/{Complex-DgYsYf9M.js → Complex-3T8gKp0T.js} +1 -1
- package/dist/chunks/{Editor-utc9yN52.js → Editor-b3kc29BU.js} +1 -1
- package/dist/chunks/{KEditor-BvqT2vzm.js → KEditor-C1BHDgFx.js} +2 -2
- package/dist/chunks/{componentRegistry-zdRt3Slb.js → componentRegistry-03Qq9Fqk.js} +5 -5
- package/dist/components/k-editor/index.js +1 -1
- package/dist/components/k-form/composables/useFormGridCols.d.ts +0 -4
- package/dist/index.js +589 -595
- package/package.json +1 -1
- package/src/styles/components/_k-form.scss +0 -7
- package/dist/assets/KEditor-BspWs59E.css +0 -1
- package/dist/assets/componentRegistry-BGWEgJcx.css +0 -1
package/dist/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./chunks/componentRegistry-
|
|
1
|
+
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./chunks/componentRegistry-03Qq9Fqk.js";
|
|
2
2
|
import { t as _ } from "./chunks/_plugin-vue_export-helper-B3ysoDQm.js";
|
|
3
|
-
import { a as v, d as y, i as
|
|
4
|
-
import { Fragment as S, Transition as re, computed as C, createBlock as w, createCommentVNode as T, createElementBlock as E, createElementVNode as D, createSlots as O, createTextVNode as k, createVNode as A, defineComponent as j, guardReactiveProps as ie, h as
|
|
5
|
-
import { ElButton as
|
|
6
|
-
import
|
|
7
|
-
import { useLocalStorage as
|
|
8
|
-
import { cloneDeep as
|
|
9
|
-
import { Loading as
|
|
10
|
-
import * as
|
|
11
|
-
import
|
|
3
|
+
import { a as v, d as y, i as b, l as ee, n as te, r as ne, u as x } from "./chunks/editorValue-DSKvW8ty.js";
|
|
4
|
+
import { Fragment as S, Transition as re, computed as C, createBlock as w, createCommentVNode as T, createElementBlock as E, createElementVNode as D, createSlots as O, createTextVNode as k, createVNode as A, defineComponent as j, guardReactiveProps as ie, h as M, inject as ae, mergeDefaults as oe, mergeProps as N, nextTick as P, normalizeClass as F, normalizeProps as se, normalizeStyle as ce, onBeforeUnmount as le, onMounted as ue, openBlock as I, provide as de, reactive as L, ref as R, renderList as z, renderSlot as B, resolveComponent as fe, resolveDirective as pe, resolveDynamicComponent as me, shallowRef as he, toDisplayString as V, toRef as H, toValue as U, unref as W, useAttrs as ge, useSlots as G, useTemplateRef as _e, watch as K, withCtx as q, withDirectives as ve, withModifiers as ye } from "vue";
|
|
5
|
+
import { ElButton as be, ElCard as xe, ElCheckbox as Se, ElCollapse as Ce, ElCollapseItem as we, ElDivider as Te, ElForm as Ee, ElFormItem as De, ElIcon as Oe, ElMessage as ke, ElPagination as Ae, ElPopover as je, ElRadio as Me, ElTable as Ne, ElTableColumn as J, ElTooltip as Pe } from "element-plus";
|
|
6
|
+
import Fe from "dayjs";
|
|
7
|
+
import { useLocalStorage as Ie, useResizeObserver as Le } from "@vueuse/core";
|
|
8
|
+
import { cloneDeep as Y } from "lodash-es";
|
|
9
|
+
import { Loading as Re, Plus as ze } from "@element-plus/icons-vue";
|
|
10
|
+
import * as Be from "lucide-vue-next";
|
|
11
|
+
import Ve from "sortablejs";
|
|
12
12
|
import './assets/index-Biv6Btn_.css';//#region \0rolldown/runtime.js
|
|
13
|
-
var
|
|
13
|
+
var He = Object.defineProperty, Ue = (e, t) => {
|
|
14
14
|
let n = {};
|
|
15
|
-
for (var r in e)
|
|
15
|
+
for (var r in e) He(n, r, {
|
|
16
16
|
get: e[r],
|
|
17
17
|
enumerable: !0
|
|
18
18
|
});
|
|
19
|
-
return t ||
|
|
19
|
+
return t || He(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
20
20
|
};
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/utils/createStubComponent.ts
|
|
23
|
-
function
|
|
23
|
+
function We(e) {
|
|
24
24
|
return j({
|
|
25
25
|
name: e,
|
|
26
26
|
inheritAttrs: !0,
|
|
27
27
|
setup(t, { attrs: n, slots: r }) {
|
|
28
|
-
return () =>
|
|
28
|
+
return () => M("div", {
|
|
29
29
|
class: "k-design-stub",
|
|
30
30
|
"data-component": e,
|
|
31
31
|
...n
|
|
@@ -33,12 +33,12 @@ function Ge(e) {
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Ge(e) {
|
|
37
37
|
return j({
|
|
38
38
|
name: `LucideStub_${e}`,
|
|
39
39
|
inheritAttrs: !0,
|
|
40
40
|
setup(t, { attrs: n }) {
|
|
41
|
-
return () =>
|
|
41
|
+
return () => M("span", {
|
|
42
42
|
class: "k-icon k-icon--stub",
|
|
43
43
|
style: {
|
|
44
44
|
display: "inline-flex",
|
|
@@ -61,60 +61,47 @@ function Ke(e) {
|
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/components/k-form/composables/useFormGridCols.ts
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (!e) return t;
|
|
67
|
-
let n = Number.parseFloat(e.trim());
|
|
64
|
+
function Ke(e, t) {
|
|
65
|
+
let n = Number.parseFloat(e ?? "");
|
|
68
66
|
return Number.isFinite(n) ? n : t;
|
|
69
67
|
}
|
|
70
|
-
function
|
|
68
|
+
function qe(e) {
|
|
71
69
|
return e.value?.$el ?? null;
|
|
72
70
|
}
|
|
73
|
-
function
|
|
74
|
-
let t =
|
|
75
|
-
function
|
|
71
|
+
function Je(e) {
|
|
72
|
+
let t = R(Math.max(1, e.colLength.value)), n = C(() => qe(e.formRef));
|
|
73
|
+
function r() {
|
|
76
74
|
if (!e.enabled.value) {
|
|
77
75
|
t.value = Math.max(1, e.colLength.value);
|
|
78
76
|
return;
|
|
79
77
|
}
|
|
80
|
-
let
|
|
81
|
-
if (!
|
|
82
|
-
let
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
for (let e = p; e >= 1; --e) if (h >= e * m + (e - 1) * u) {
|
|
86
|
-
g = e;
|
|
78
|
+
let r = n.value;
|
|
79
|
+
if (!r) return;
|
|
80
|
+
let i = getComputedStyle(r), a = Ke(i.getPropertyValue("--k-form-control-min-width"), 200), o = Ke(i.getPropertyValue("--k-form-grid-gap-x"), 24), s = Ke(i.getPropertyValue("--k-form-padding-x"), 24), c = Ke(e.labelWidth.value, 110), l = Math.max(1, e.colLength.value), u = c + a, d = Math.max(0, r.clientWidth - s * 2), f = 1;
|
|
81
|
+
for (let e = l; e >= 1; --e) if (d >= e * u + (e - 1) * o) {
|
|
82
|
+
f = e;
|
|
87
83
|
break;
|
|
88
84
|
}
|
|
89
|
-
t.value =
|
|
85
|
+
t.value = f;
|
|
90
86
|
}
|
|
91
|
-
return
|
|
92
|
-
o();
|
|
93
|
-
}), G([
|
|
87
|
+
return Le(n, r), K([
|
|
94
88
|
e.colLength,
|
|
95
89
|
e.labelWidth,
|
|
96
90
|
e.enabled,
|
|
97
|
-
|
|
91
|
+
n
|
|
98
92
|
], async () => {
|
|
99
|
-
await
|
|
100
|
-
}, { immediate: !0 }),
|
|
101
|
-
await N(), o();
|
|
102
|
-
}), {
|
|
103
|
-
effectiveCols: t,
|
|
104
|
-
gridMinColPx: C(() => `${Y(e.labelWidth.value, Ze) + n.value}px`),
|
|
105
|
-
formMinWidthPx: C(() => `${Y(e.labelWidth.value, Ze) + r.value + i.value * 2}px`),
|
|
106
|
-
updateEffectiveCols: o
|
|
107
|
-
};
|
|
93
|
+
await P(), r();
|
|
94
|
+
}, { immediate: !0 }), { effectiveCols: t };
|
|
108
95
|
}
|
|
109
96
|
//#endregion
|
|
110
97
|
//#region src/components/k-form/utils/formRules.ts
|
|
111
|
-
var
|
|
98
|
+
var Ye = {
|
|
112
99
|
number: /^\d+$/,
|
|
113
100
|
phone: /^1\d{10}$/,
|
|
114
101
|
money: /^(0|[1-9]\d*)(\.\d{1,2})?$/,
|
|
115
102
|
percentage: /^(?!0(?:\.00?)?$)(?:100(?:\.00?)?|\d{0,2}(?:\.\d{1,2})?)$/
|
|
116
103
|
};
|
|
117
|
-
function
|
|
104
|
+
function Xe(e, t) {
|
|
118
105
|
return {
|
|
119
106
|
validator: (n, r, i) => {
|
|
120
107
|
if (r === "" || r == null) {
|
|
@@ -126,7 +113,7 @@ function tt(e, t) {
|
|
|
126
113
|
trigger: "blur"
|
|
127
114
|
};
|
|
128
115
|
}
|
|
129
|
-
function
|
|
116
|
+
function Ze(e) {
|
|
130
117
|
return {
|
|
131
118
|
validator: (t, n, r) => {
|
|
132
119
|
let i = Array.isArray(n) ? n : [], a = String(i[0] ?? "").trim(), o = String(i[1] ?? "").trim();
|
|
@@ -139,21 +126,21 @@ function nt(e) {
|
|
|
139
126
|
trigger: ["change", "blur"]
|
|
140
127
|
};
|
|
141
128
|
}
|
|
142
|
-
function
|
|
129
|
+
function Qe(e) {
|
|
143
130
|
let t = [...e.rules ?? []];
|
|
144
131
|
if (typeof e.component != "string") return t;
|
|
145
132
|
let n = e.componentProps?.type;
|
|
146
|
-
if (e.component === "Input" && n === "number" && t.push(
|
|
133
|
+
if (e.component === "Input" && n === "number" && t.push(Xe(Ye.number, "请输入合法的正整数")), e.component === "Input" && n === "phone" && t.push(Xe(Ye.phone, "请输入正常的手机号")), e.component === "Input" && n === "money" && t.push(Xe(Ye.money, "请输入正确金额数值")), e.component === "Input" && n === "percentage" && t.push(Xe(Ye.percentage, "请输入正确的数据范围:0.01 ~ 100")), e.component === "InputMixInput") {
|
|
147
134
|
let e = t.find((e) => e.required);
|
|
148
|
-
e && t.push(
|
|
135
|
+
e && t.push(Ze(String(e.message || "请完整填写")));
|
|
149
136
|
}
|
|
150
137
|
return t;
|
|
151
138
|
}
|
|
152
139
|
//#endregion
|
|
153
140
|
//#region src/components/k-form/composables/useKFormFields.ts
|
|
154
|
-
function
|
|
155
|
-
let t =
|
|
156
|
-
let t =
|
|
141
|
+
function $e(e) {
|
|
142
|
+
let t = ae(l, null), n = C(() => e.formConfigs.value.filter((e) => e.display === void 0 || e.display)), r = C(() => e.layout.value.hideLabel ? n.value.map((e) => {
|
|
143
|
+
let t = Y(e);
|
|
157
144
|
return t.componentProps ||= {}, typeof t.component == "string" && [
|
|
158
145
|
"Input",
|
|
159
146
|
"Select",
|
|
@@ -170,7 +157,7 @@ function it(e) {
|
|
|
170
157
|
}));
|
|
171
158
|
}
|
|
172
159
|
function a(t) {
|
|
173
|
-
return t.display === !1 || t.readonly === !0 || e.formReadonly?.value ? [] :
|
|
160
|
+
return t.display === !1 || t.readonly === !0 || e.formReadonly?.value ? [] : Qe(t);
|
|
174
161
|
}
|
|
175
162
|
function o(e) {
|
|
176
163
|
return e.componentProps?.style;
|
|
@@ -196,9 +183,9 @@ function it(e) {
|
|
|
196
183
|
}
|
|
197
184
|
//#endregion
|
|
198
185
|
//#region src/components/k-form/composables/useKFormModel.ts
|
|
199
|
-
function
|
|
186
|
+
function et(e) {
|
|
200
187
|
let { componentProps: t = {}, component: n } = e, r = t.value, i = t.type ?? "";
|
|
201
|
-
if (r !== void 0) return
|
|
188
|
+
if (r !== void 0) return Y(r);
|
|
202
189
|
if (t.multiple === !0 || n === "Checkbox" || n === "SelectMultiple" || n === "InputMixInput") return [];
|
|
203
190
|
if (n === "InputMixSelect") return {};
|
|
204
191
|
if (n === "DatePicker" && [
|
|
@@ -208,7 +195,7 @@ function at(e) {
|
|
|
208
195
|
].includes(i)) return [];
|
|
209
196
|
if (n !== "DatePicker") return n === "Upload" || n === "TimePicker" && i === "timerange" ? [] : "";
|
|
210
197
|
}
|
|
211
|
-
function
|
|
198
|
+
function tt(e, t, n) {
|
|
212
199
|
return Z(t);
|
|
213
200
|
}
|
|
214
201
|
function X(e) {
|
|
@@ -222,18 +209,18 @@ function Z(e) {
|
|
|
222
209
|
for (let e of Object.keys(t)) n[e] = Z(t[e]);
|
|
223
210
|
return n;
|
|
224
211
|
}
|
|
225
|
-
function
|
|
212
|
+
function nt(e) {
|
|
226
213
|
let t = {};
|
|
227
214
|
return Object.keys(e).forEach((n) => {
|
|
228
215
|
t[n] = Z(e[n]);
|
|
229
216
|
}), t;
|
|
230
217
|
}
|
|
231
|
-
function
|
|
218
|
+
function rt(e, t) {
|
|
232
219
|
let n = t[e.id];
|
|
233
|
-
return n == null ?
|
|
220
|
+
return n == null ? et(e) : tt(e, n, t);
|
|
234
221
|
}
|
|
235
|
-
function
|
|
236
|
-
let t =
|
|
222
|
+
function it(e) {
|
|
223
|
+
let t = L({}), n = {}, r = null, i = C(() => {
|
|
237
224
|
let t = /* @__PURE__ */ new Map();
|
|
238
225
|
return e.formConfigs.value.forEach((e) => t.set(e.id, e)), t;
|
|
239
226
|
});
|
|
@@ -258,18 +245,18 @@ function lt(e) {
|
|
|
258
245
|
function c() {
|
|
259
246
|
return {
|
|
260
247
|
...s(),
|
|
261
|
-
...
|
|
248
|
+
...nt(t)
|
|
262
249
|
};
|
|
263
250
|
}
|
|
264
251
|
function l() {
|
|
265
|
-
let n = X(e) ? c() :
|
|
252
|
+
let n = X(e) ? c() : nt(t);
|
|
266
253
|
return r = n, e.onChange?.(n), n;
|
|
267
254
|
}
|
|
268
255
|
function u(r) {
|
|
269
256
|
let i = s(), a = X(e), o = {};
|
|
270
257
|
r.forEach((e) => {
|
|
271
258
|
if (e.display !== !1) {
|
|
272
|
-
o[e.id] =
|
|
259
|
+
o[e.id] = rt(e, i);
|
|
273
260
|
return;
|
|
274
261
|
}
|
|
275
262
|
if (a) {
|
|
@@ -278,7 +265,7 @@ function lt(e) {
|
|
|
278
265
|
}
|
|
279
266
|
}), Object.keys(t).forEach((e) => {
|
|
280
267
|
e in o || delete t[e];
|
|
281
|
-
}), Object.assign(t, o), n =
|
|
268
|
+
}), Object.assign(t, o), n = Y(t);
|
|
282
269
|
}
|
|
283
270
|
function d(e, n) {
|
|
284
271
|
let r = n?.preserveFieldIds, o = r?.length ? new Set(r) : null;
|
|
@@ -286,16 +273,16 @@ function lt(e) {
|
|
|
286
273
|
if (o?.has(r) || !(r in e)) return;
|
|
287
274
|
let i = e[r];
|
|
288
275
|
if (i == null) {
|
|
289
|
-
t[r] =
|
|
276
|
+
t[r] = et(a(r));
|
|
290
277
|
return;
|
|
291
278
|
}
|
|
292
|
-
t[r] =
|
|
279
|
+
t[r] = tt(n, i, e);
|
|
293
280
|
});
|
|
294
281
|
}
|
|
295
282
|
function f(n) {
|
|
296
283
|
let i = s(), a = [];
|
|
297
284
|
if (n.forEach((e) => {
|
|
298
|
-
e.display !== !1 && t[e.id] === void 0 && (t[e.id] =
|
|
285
|
+
e.display !== !1 && t[e.id] === void 0 && (t[e.id] = rt(e, i), a.push(e.id));
|
|
299
286
|
}), a.length) {
|
|
300
287
|
if (X(e)) {
|
|
301
288
|
let n = {};
|
|
@@ -319,10 +306,10 @@ function lt(e) {
|
|
|
319
306
|
if (!i.value.has(t)) return;
|
|
320
307
|
let o = a(t), s = e[t];
|
|
321
308
|
if (s == null) {
|
|
322
|
-
n[t] =
|
|
309
|
+
n[t] = et(o);
|
|
323
310
|
return;
|
|
324
311
|
}
|
|
325
|
-
n[t] =
|
|
312
|
+
n[t] = tt(o, s, {
|
|
326
313
|
...r,
|
|
327
314
|
...e
|
|
328
315
|
});
|
|
@@ -349,26 +336,26 @@ function lt(e) {
|
|
|
349
336
|
function _() {
|
|
350
337
|
Object.keys(t).forEach((e) => {
|
|
351
338
|
e in n || delete t[e];
|
|
352
|
-
}), Object.assign(t,
|
|
339
|
+
}), Object.assign(t, Y(n)), l();
|
|
353
340
|
}
|
|
354
341
|
function v() {
|
|
355
|
-
n =
|
|
342
|
+
n = Y(t);
|
|
356
343
|
}
|
|
357
344
|
function y(r) {
|
|
358
345
|
r.forEach((r) => {
|
|
359
|
-
let i = X(e) ?
|
|
346
|
+
let i = X(e) ? et(a(r)) : n[r] ?? "";
|
|
360
347
|
t[r] = Z(i);
|
|
361
348
|
}), l();
|
|
362
349
|
}
|
|
363
|
-
return
|
|
350
|
+
return K(o, (t, n) => {
|
|
364
351
|
if (!n || t.fieldSignature !== n.fieldSignature) {
|
|
365
352
|
u(e.formConfigs.value);
|
|
366
353
|
return;
|
|
367
354
|
}
|
|
368
355
|
t.displaySignature !== n.displaySignature && f(e.formConfigs.value);
|
|
369
|
-
}, { immediate: !0 }),
|
|
356
|
+
}, { immediate: !0 }), K(() => e.data?.value, (t) => {
|
|
370
357
|
X(e) || t && Object.keys(t).length && p(t);
|
|
371
|
-
}, { deep: !0 }),
|
|
358
|
+
}, { deep: !0 }), K(() => e.modelValue?.value, (t) => {
|
|
372
359
|
!X(e) || !t || t !== r && d(t);
|
|
373
360
|
}, {
|
|
374
361
|
deep: !0,
|
|
@@ -387,18 +374,18 @@ function lt(e) {
|
|
|
387
374
|
}
|
|
388
375
|
//#endregion
|
|
389
376
|
//#region src/components/k-form/utils/resolveFormFieldComponent.ts
|
|
390
|
-
function
|
|
377
|
+
function at(e) {
|
|
391
378
|
return typeof e == "string";
|
|
392
379
|
}
|
|
393
|
-
function
|
|
380
|
+
function ot(e) {
|
|
394
381
|
return typeof e == "object" || typeof e == "function";
|
|
395
382
|
}
|
|
396
|
-
function
|
|
397
|
-
return
|
|
383
|
+
function st(e) {
|
|
384
|
+
return ot(e) ? e : u(e);
|
|
398
385
|
}
|
|
399
386
|
//#endregion
|
|
400
387
|
//#region src/components/k-form/KFormField.vue
|
|
401
|
-
var
|
|
388
|
+
var ct = /* @__PURE__ */ j({
|
|
402
389
|
name: "KFormField",
|
|
403
390
|
__name: "KFormField",
|
|
404
391
|
props: {
|
|
@@ -410,7 +397,7 @@ var pt = /* @__PURE__ */ j({
|
|
|
410
397
|
},
|
|
411
398
|
emits: ["update:modelValue"],
|
|
412
399
|
setup(e, { emit: t }) {
|
|
413
|
-
let n = e, r = t, i = C(() =>
|
|
400
|
+
let n = e, r = t, i = C(() => st(n.item.component)), a = C(() => at(n.item.component) ? n.item.component : ""), o = C(() => {
|
|
414
401
|
let e = { ...n.item.componentProps ?? {} };
|
|
415
402
|
return delete e.value, delete e.onChange, delete e.style, delete e.readonly, delete e.disabled, [
|
|
416
403
|
"Complex",
|
|
@@ -430,7 +417,7 @@ var pt = /* @__PURE__ */ j({
|
|
|
430
417
|
function c(e) {
|
|
431
418
|
r("update:modelValue", e);
|
|
432
419
|
}
|
|
433
|
-
return (t, n) => (I(), w(
|
|
420
|
+
return (t, n) => (I(), w(me(i.value), N({
|
|
434
421
|
"model-value": e.modelValue,
|
|
435
422
|
options: s.value,
|
|
436
423
|
readonly: e.readonly,
|
|
@@ -442,11 +429,11 @@ var pt = /* @__PURE__ */ j({
|
|
|
442
429
|
"disabled"
|
|
443
430
|
]));
|
|
444
431
|
}
|
|
445
|
-
}),
|
|
432
|
+
}), lt = ["innerHTML"], ut = {
|
|
446
433
|
key: 0,
|
|
447
434
|
class: "k-form__row-fill",
|
|
448
435
|
"aria-hidden": "true"
|
|
449
|
-
},
|
|
436
|
+
}, dt = /* @__PURE__ */ j({
|
|
450
437
|
name: "KForm",
|
|
451
438
|
inheritAttrs: !1,
|
|
452
439
|
__name: "KForm",
|
|
@@ -480,7 +467,7 @@ var pt = /* @__PURE__ */ j({
|
|
|
480
467
|
},
|
|
481
468
|
emits: ["update:modelValue", "change"],
|
|
482
469
|
setup(e, { expose: t, emit: n }) {
|
|
483
|
-
let i =
|
|
470
|
+
let i = G(), a = e, o = n, s = ge(), c = R(), l = R({});
|
|
484
471
|
de(r, l);
|
|
485
472
|
function u(e) {
|
|
486
473
|
if (e == null || e === "") return;
|
|
@@ -489,7 +476,7 @@ var pt = /* @__PURE__ */ j({
|
|
|
489
476
|
let t = e[0];
|
|
490
477
|
return t ? u(t) : void 0;
|
|
491
478
|
}
|
|
492
|
-
let t =
|
|
479
|
+
let t = Fe(e);
|
|
493
480
|
return t.isValid() ? t.toDate() : void 0;
|
|
494
481
|
}
|
|
495
482
|
function d(e, t) {
|
|
@@ -499,7 +486,7 @@ var pt = /* @__PURE__ */ j({
|
|
|
499
486
|
};
|
|
500
487
|
}
|
|
501
488
|
function f(e) {
|
|
502
|
-
return
|
|
489
|
+
return at(e.component) && e.component === "DatePicker";
|
|
503
490
|
}
|
|
504
491
|
let p = C(() => a.labelWidth ? a.labelWidth : a.autoLayout ? "120px" : "110px"), m = C(() => ({
|
|
505
492
|
colLength: a.colLength,
|
|
@@ -512,49 +499,49 @@ var pt = /* @__PURE__ */ j({
|
|
|
512
499
|
"k-form--inline-layout": a.inline,
|
|
513
500
|
"k-form--query-layout": a.autoLayout,
|
|
514
501
|
"k-form--grid-layout": !a.autoLayout && !a.inline
|
|
515
|
-
})), g = C(() => !a.autoLayout && !a.inline), { effectiveCols: _
|
|
502
|
+
})), g = C(() => !a.autoLayout && !a.inline), { effectiveCols: _ } = Je({
|
|
516
503
|
formRef: c,
|
|
517
504
|
colLength: C(() => a.colLength),
|
|
518
505
|
labelWidth: p,
|
|
519
506
|
enabled: g
|
|
520
|
-
}),
|
|
507
|
+
}), v = C(() => ({
|
|
521
508
|
"--k-form-cols": String(a.colLength),
|
|
522
509
|
"--k-form-effective-cols": String(_.value),
|
|
523
510
|
"--k-form-label-width": p.value,
|
|
524
|
-
"--k-form-grid-min-col":
|
|
525
|
-
"--k-form-min-width":
|
|
526
|
-
})),
|
|
527
|
-
formConfigs:
|
|
528
|
-
data:
|
|
529
|
-
modelValue:
|
|
530
|
-
controlled:
|
|
511
|
+
"--k-form-grid-min-col": "calc(var(--k-form-label-width) + var(--k-form-control-min-width))",
|
|
512
|
+
"--k-form-min-width": "calc(var(--k-form-label-width) + var(--k-form-control-max-width) + var(--k-form-padding-x) * 2)"
|
|
513
|
+
})), y = C(() => a.modelValue !== void 0), b = it({
|
|
514
|
+
formConfigs: H(a, "formConfigs"),
|
|
515
|
+
data: H(a, "data"),
|
|
516
|
+
modelValue: H(a, "modelValue"),
|
|
517
|
+
controlled: y,
|
|
531
518
|
onChange: (e) => {
|
|
532
|
-
o("change", e),
|
|
519
|
+
o("change", e), y.value && o("update:modelValue", e);
|
|
533
520
|
}
|
|
534
521
|
});
|
|
535
|
-
function
|
|
522
|
+
function ee() {
|
|
536
523
|
let e = {};
|
|
537
524
|
a.formConfigs.forEach((t) => {
|
|
538
525
|
f(t) && (e[`kitDate-${t.id}`] = u(b.formModel[t.id]));
|
|
539
526
|
}), l.value = e;
|
|
540
527
|
}
|
|
541
|
-
let { normalizedConfigs:
|
|
542
|
-
formConfigs:
|
|
528
|
+
let { normalizedConfigs: te, getFieldOptions: ne, resolveItemRules: x, itemStyle: re, itemDisplay: j, isItemReadonly: ie, isItemDisabled: M } = $e({
|
|
529
|
+
formConfigs: H(a, "formConfigs"),
|
|
543
530
|
layout: m,
|
|
544
|
-
formReadonly:
|
|
531
|
+
formReadonly: H(a, "readonly")
|
|
545
532
|
});
|
|
546
|
-
|
|
533
|
+
K(() => a.formConfigs, () => ee(), {
|
|
547
534
|
immediate: !0,
|
|
548
535
|
deep: !0
|
|
549
|
-
}),
|
|
550
|
-
function
|
|
551
|
-
let t =
|
|
536
|
+
}), K(() => b.formModel, () => ee(), { deep: !0 });
|
|
537
|
+
function ae(e) {
|
|
538
|
+
let t = j(e);
|
|
552
539
|
return {
|
|
553
|
-
...
|
|
540
|
+
...re(e),
|
|
554
541
|
...t ? { display: t } : {}
|
|
555
542
|
};
|
|
556
543
|
}
|
|
557
|
-
let
|
|
544
|
+
let oe = C(() => {
|
|
558
545
|
let e = { ...s };
|
|
559
546
|
return delete e.readonly, {
|
|
560
547
|
inline: a.inline && !a.autoLayout,
|
|
@@ -563,98 +550,105 @@ var pt = /* @__PURE__ */ j({
|
|
|
563
550
|
...e
|
|
564
551
|
};
|
|
565
552
|
});
|
|
566
|
-
function
|
|
567
|
-
b.updateFieldValue(e, t), f(e) && d(e.id, t),
|
|
553
|
+
function se(e, t) {
|
|
554
|
+
b.updateFieldValue(e, t), f(e) && d(e.id, t), le(e);
|
|
568
555
|
}
|
|
569
|
-
function
|
|
556
|
+
function le(e) {
|
|
570
557
|
if (!c.value) return;
|
|
571
|
-
let t = e.validatePeers ?? [], n =
|
|
572
|
-
!n && !t.length ||
|
|
558
|
+
let t = e.validatePeers ?? [], n = x(e).length > 0;
|
|
559
|
+
!n && !t.length || P(() => {
|
|
573
560
|
n && c.value?.validateField(e.id).catch(() => {});
|
|
574
561
|
for (let e of t) c.value?.validateField(e).catch(() => {});
|
|
575
562
|
});
|
|
576
563
|
}
|
|
577
|
-
async function
|
|
564
|
+
async function ue() {
|
|
578
565
|
let e = b.getVisibleFieldsValue();
|
|
579
566
|
if (!c.value) return e;
|
|
580
567
|
try {
|
|
581
|
-
return await c.value.validate() === !1 ? a.ignoreValidate ? (c.value.clearValidate(), e) : (
|
|
568
|
+
return await c.value.validate() === !1 ? a.ignoreValidate ? (c.value.clearValidate(), e) : (L(), null) : e;
|
|
582
569
|
} catch {
|
|
583
|
-
return a.ignoreValidate ? (c.value.clearValidate(), e) : (
|
|
570
|
+
return a.ignoreValidate ? (c.value.clearValidate(), e) : (L(), null);
|
|
584
571
|
}
|
|
585
572
|
}
|
|
586
|
-
function
|
|
573
|
+
function L() {
|
|
587
574
|
((c.value?.$el)?.querySelector(".el-form-item.is-error") ?? document.querySelector(".k-form .el-form-item.is-error"))?.scrollIntoView({
|
|
588
575
|
block: "center",
|
|
589
576
|
behavior: "smooth"
|
|
590
577
|
});
|
|
591
578
|
}
|
|
592
|
-
function
|
|
579
|
+
function fe(e) {
|
|
593
580
|
return b.getFieldsValue(e);
|
|
594
581
|
}
|
|
595
|
-
function
|
|
582
|
+
function pe() {
|
|
596
583
|
return b.getVisibleFieldsValue();
|
|
597
584
|
}
|
|
598
|
-
function
|
|
585
|
+
function me(e) {
|
|
599
586
|
b.setFieldsValue(e);
|
|
600
587
|
}
|
|
601
|
-
function
|
|
588
|
+
function he() {
|
|
602
589
|
c.value?.resetFields(), b.resetFormModel();
|
|
603
590
|
}
|
|
604
|
-
function
|
|
591
|
+
function U(e) {
|
|
605
592
|
b.resetFieldsValue(e), e.forEach((e) => c.value?.clearValidate(e));
|
|
606
593
|
}
|
|
607
|
-
function
|
|
594
|
+
function _e() {
|
|
608
595
|
c.value?.clearValidate();
|
|
609
596
|
}
|
|
610
|
-
function
|
|
597
|
+
function ve() {
|
|
611
598
|
return c.value;
|
|
612
599
|
}
|
|
613
|
-
|
|
614
|
-
|
|
600
|
+
let be = /* @__PURE__ */ new Set([
|
|
601
|
+
"Editor",
|
|
602
|
+
"Upload",
|
|
603
|
+
"Radio",
|
|
604
|
+
"Checkbox",
|
|
605
|
+
"Tag"
|
|
606
|
+
]);
|
|
607
|
+
function xe(e) {
|
|
608
|
+
return e.newLineStart ? !at(e.component) || be.has(e.component) ? !0 : e.component === "DatePicker" && String(e.componentProps?.type ?? "").includes("range") : !1;
|
|
615
609
|
}
|
|
616
|
-
function
|
|
617
|
-
return !!e.newLineStart && !
|
|
610
|
+
function Se(e) {
|
|
611
|
+
return !!e.newLineStart && !xe(e);
|
|
618
612
|
}
|
|
619
613
|
return t({
|
|
620
|
-
validateFields:
|
|
621
|
-
getFieldsValue:
|
|
622
|
-
getParams:
|
|
623
|
-
setFieldsValue:
|
|
624
|
-
resetForm:
|
|
625
|
-
resetFieldsValue:
|
|
626
|
-
getFormRef:
|
|
627
|
-
clearValidate:
|
|
628
|
-
}), (e, t) => (I(), w(
|
|
614
|
+
validateFields: ue,
|
|
615
|
+
getFieldsValue: fe,
|
|
616
|
+
getParams: pe,
|
|
617
|
+
setFieldsValue: me,
|
|
618
|
+
resetForm: he,
|
|
619
|
+
resetFieldsValue: U,
|
|
620
|
+
getFormRef: ve,
|
|
621
|
+
clearValidate: _e
|
|
622
|
+
}), (e, t) => (I(), w(W(Ee), N({
|
|
629
623
|
ref_key: "formRef",
|
|
630
624
|
ref: c,
|
|
631
625
|
class: ["k-form", h.value],
|
|
632
|
-
style:
|
|
633
|
-
model:
|
|
634
|
-
},
|
|
635
|
-
default:
|
|
626
|
+
style: v.value,
|
|
627
|
+
model: W(b).formModel
|
|
628
|
+
}, oe.value, { onSubmit: t[0] ||= ye(() => {}, ["prevent"]) }), {
|
|
629
|
+
default: q(() => [(I(!0), E(S, null, z(W(te), (n) => (I(), E(S, { key: n.id }, [A(W(De), {
|
|
636
630
|
"data-label": n.label || "",
|
|
637
631
|
"data-field-id": n.id,
|
|
638
632
|
label: n.label ? `${n.label}:` : void 0,
|
|
639
633
|
prop: n.id,
|
|
640
|
-
rules:
|
|
641
|
-
class:
|
|
642
|
-
"k-form__item--readonly":
|
|
643
|
-
"k-form__item--disabled":
|
|
644
|
-
"k-form__item--full-row":
|
|
645
|
-
"k-form__item--row-start":
|
|
646
|
-
"k-form__item--choice":
|
|
634
|
+
rules: W(x)(n),
|
|
635
|
+
class: F(["k-form__item", [n.class, {
|
|
636
|
+
"k-form__item--readonly": W(ie)(n),
|
|
637
|
+
"k-form__item--disabled": W(M)(n),
|
|
638
|
+
"k-form__item--full-row": xe(n),
|
|
639
|
+
"k-form__item--row-start": Se(n),
|
|
640
|
+
"k-form__item--choice": W(at)(n.component) && (n.component === "Radio" || n.component === "Checkbox" || n.component === "Tag")
|
|
647
641
|
}]]),
|
|
648
|
-
style:
|
|
642
|
+
style: ce(ae(n))
|
|
649
643
|
}, O({
|
|
650
|
-
default:
|
|
644
|
+
default: q(() => [!n.slot || !W(i)[n.id] ? (I(), w(ct, {
|
|
651
645
|
key: 0,
|
|
652
646
|
item: n,
|
|
653
|
-
"model-value":
|
|
654
|
-
options:
|
|
655
|
-
readonly:
|
|
656
|
-
disabled:
|
|
657
|
-
"onUpdate:modelValue": (e) =>
|
|
647
|
+
"model-value": W(b).formModel[n.id],
|
|
648
|
+
options: W(ne)(n),
|
|
649
|
+
readonly: W(ie)(n),
|
|
650
|
+
disabled: W(M)(n),
|
|
651
|
+
"onUpdate:modelValue": (e) => se(n, e)
|
|
658
652
|
}, null, 8, [
|
|
659
653
|
"item",
|
|
660
654
|
"model-value",
|
|
@@ -662,26 +656,26 @@ var pt = /* @__PURE__ */ j({
|
|
|
662
656
|
"readonly",
|
|
663
657
|
"disabled",
|
|
664
658
|
"onUpdate:modelValue"
|
|
665
|
-
])) :
|
|
659
|
+
])) : B(e.$slots, n.id, {
|
|
666
660
|
item: n,
|
|
667
|
-
value:
|
|
668
|
-
updateValue: (e) =>
|
|
661
|
+
value: W(b).formModel[n.id],
|
|
662
|
+
updateValue: (e) => se(n, e)
|
|
669
663
|
}, void 0, void 0, 1)]),
|
|
670
664
|
_: 2
|
|
671
665
|
}, [n.toolTip ? {
|
|
672
666
|
name: "label",
|
|
673
|
-
fn:
|
|
667
|
+
fn: q(() => [A(W(Pe), {
|
|
674
668
|
effect: "dark",
|
|
675
669
|
placement: "bottom",
|
|
676
670
|
"popper-class": "k-form__tooltip"
|
|
677
671
|
}, {
|
|
678
|
-
content:
|
|
679
|
-
default:
|
|
672
|
+
content: q(() => [D("span", { innerHTML: n.toolTip }, null, 8, lt)]),
|
|
673
|
+
default: q(() => [t[1] ||= D("span", {
|
|
680
674
|
class: "k-form__tip-icon",
|
|
681
675
|
"aria-hidden": "true"
|
|
682
676
|
}, "i", -1)]),
|
|
683
677
|
_: 2
|
|
684
|
-
}, 1024), k(" " +
|
|
678
|
+
}, 1024), k(" " + V(n.label ? `${n.label}:` : ""), 1)]),
|
|
685
679
|
key: "0"
|
|
686
680
|
} : void 0]), 1032, [
|
|
687
681
|
"data-label",
|
|
@@ -691,7 +685,7 @@ var pt = /* @__PURE__ */ j({
|
|
|
691
685
|
"rules",
|
|
692
686
|
"class",
|
|
693
687
|
"style"
|
|
694
|
-
]),
|
|
688
|
+
]), Se(n) && W(_) > 1 ? (I(), E("div", ut)) : T("", !0)], 64))), 128)), B(e.$slots, "default")]),
|
|
695
689
|
_: 3
|
|
696
690
|
}, 16, [
|
|
697
691
|
"class",
|
|
@@ -702,12 +696,12 @@ var pt = /* @__PURE__ */ j({
|
|
|
702
696
|
});
|
|
703
697
|
//#endregion
|
|
704
698
|
//#region src/components/k-form/composables/useKFormTemplateRef.ts
|
|
705
|
-
function
|
|
706
|
-
return
|
|
699
|
+
function ft(e) {
|
|
700
|
+
return _e(e);
|
|
707
701
|
}
|
|
708
702
|
//#endregion
|
|
709
703
|
//#region src/components/k-form/composables/useFormSchema.ts
|
|
710
|
-
function
|
|
704
|
+
function pt(e, t) {
|
|
711
705
|
let { visibleWhen: n, readonlyWhen: r, disabledWhen: i, optionsFromModel: a, rulesFromModel: o, ...s } = e, c = {
|
|
712
706
|
...s,
|
|
713
707
|
rules: s.rules ? [...s.rules] : s.rules,
|
|
@@ -722,14 +716,14 @@ function vt(e, t) {
|
|
|
722
716
|
}
|
|
723
717
|
return c;
|
|
724
718
|
}
|
|
725
|
-
function
|
|
719
|
+
function mt(e, t, n = {}) {
|
|
726
720
|
let { excludeHidden: r = !1 } = n;
|
|
727
721
|
return C(() => {
|
|
728
|
-
let n =
|
|
722
|
+
let n = U(t), i = U(e).map((e) => pt(e, n));
|
|
729
723
|
return r ? i.filter((e) => e.display !== !1) : i;
|
|
730
724
|
});
|
|
731
725
|
}
|
|
732
|
-
function
|
|
726
|
+
function ht(e, t) {
|
|
733
727
|
return e.map((e) => {
|
|
734
728
|
if (!(e.id in t)) return e;
|
|
735
729
|
let n = t[e.id] ?? !0;
|
|
@@ -741,20 +735,20 @@ function bt(e, t) {
|
|
|
741
735
|
}
|
|
742
736
|
//#endregion
|
|
743
737
|
//#region src/components/k-handle-page/KHandlePage.vue?vue&type=script&setup=true&lang.ts
|
|
744
|
-
var
|
|
738
|
+
var gt = { class: "k-handle-page" }, _t = {
|
|
745
739
|
key: 0,
|
|
746
740
|
class: "k-handle-page__header"
|
|
747
|
-
},
|
|
741
|
+
}, vt = { class: "k-handle-page__body" }, yt = {
|
|
748
742
|
key: 0,
|
|
749
743
|
class: "k-handle-page__loading",
|
|
750
744
|
role: "status",
|
|
751
745
|
"aria-live": "polite",
|
|
752
746
|
"aria-busy": "true",
|
|
753
747
|
"aria-label": "加载中"
|
|
754
|
-
},
|
|
748
|
+
}, bt = { class: "k-handle-page__loading-inner" }, xt = {
|
|
755
749
|
key: 1,
|
|
756
750
|
class: "k-handle-page__footer"
|
|
757
|
-
},
|
|
751
|
+
}, St = /* @__PURE__ */ j({
|
|
758
752
|
name: "KHandlePage",
|
|
759
753
|
inheritAttrs: !1,
|
|
760
754
|
__name: "KHandlePage",
|
|
@@ -791,7 +785,7 @@ var xt = { class: "k-handle-page" }, St = {
|
|
|
791
785
|
},
|
|
792
786
|
emits: ["cancel", "submit"],
|
|
793
787
|
setup(t, { emit: n }) {
|
|
794
|
-
let r = t, i = n, a =
|
|
788
|
+
let r = t, i = n, a = G(), o = R(!1), s = C(() => ({ gap: typeof r.gap == "number" ? `${r.gap}px` : r.gap })), c = C(() => r.cancelText === !1 ? "" : r.cancelText || "取消"), l = C(() => r.submitText === !1 ? "" : r.submitText || "确定"), u = C(() => r.cancelText !== !1), d = C(() => r.showSubmit && r.submitText !== !1), f = C(() => r.submitLoading || r.loading || o.value), p = C(() => !!a.header);
|
|
795
789
|
async function m() {
|
|
796
790
|
if (!f.value) {
|
|
797
791
|
if (r.onSubmit) {
|
|
@@ -806,26 +800,26 @@ var xt = { class: "k-handle-page" }, St = {
|
|
|
806
800
|
i("submit");
|
|
807
801
|
}
|
|
808
802
|
}
|
|
809
|
-
return (n, r) => (I(), E("div",
|
|
810
|
-
p.value ? (I(), E("header",
|
|
811
|
-
D("div",
|
|
812
|
-
default:
|
|
803
|
+
return (n, r) => (I(), E("div", gt, [
|
|
804
|
+
p.value ? (I(), E("header", _t, [B(n.$slots, "header")])) : T("", !0),
|
|
805
|
+
D("div", vt, [A(re, { name: "k-handle-page-loading" }, {
|
|
806
|
+
default: q(() => [t.loading ? (I(), E("div", yt, [D("div", bt, [A(W(Oe), {
|
|
813
807
|
class: "k-handle-page__loading-icon is-loading",
|
|
814
808
|
size: 32
|
|
815
809
|
}, {
|
|
816
|
-
default:
|
|
810
|
+
default: q(() => [A(W(Re))]),
|
|
817
811
|
_: 1
|
|
818
812
|
}), r[1] ||= D("span", { class: "k-handle-page__loading-text" }, "加载中...", -1)])])) : T("", !0)]),
|
|
819
813
|
_: 1
|
|
820
814
|
}), D("div", {
|
|
821
|
-
class:
|
|
822
|
-
style:
|
|
823
|
-
}, [
|
|
824
|
-
t.showFooter ? (I(), E("footer",
|
|
815
|
+
class: F(["k-handle-page__content", { "k-handle-page__content--loading": t.loading }]),
|
|
816
|
+
style: ce(s.value)
|
|
817
|
+
}, [B(n.$slots, "default")], 6)]),
|
|
818
|
+
t.showFooter ? (I(), E("footer", xt, [B(n.$slots, "footer", {}, () => [u.value ? (I(), w(e, {
|
|
825
819
|
key: 0,
|
|
826
820
|
onClick: r[0] ||= (e) => i("cancel")
|
|
827
821
|
}, {
|
|
828
|
-
default:
|
|
822
|
+
default: q(() => [k(V(c.value), 1)]),
|
|
829
823
|
_: 1
|
|
830
824
|
})) : T("", !0), d.value ? (I(), w(e, {
|
|
831
825
|
key: 1,
|
|
@@ -833,7 +827,7 @@ var xt = { class: "k-handle-page" }, St = {
|
|
|
833
827
|
loading: f.value,
|
|
834
828
|
onClick: m
|
|
835
829
|
}, {
|
|
836
|
-
default:
|
|
830
|
+
default: q(() => [k(V(l.value), 1)]),
|
|
837
831
|
_: 1
|
|
838
832
|
}, 8, ["loading"])) : T("", !0)])])) : T("", !0)
|
|
839
833
|
]));
|
|
@@ -841,17 +835,17 @@ var xt = { class: "k-handle-page" }, St = {
|
|
|
841
835
|
});
|
|
842
836
|
//#endregion
|
|
843
837
|
//#region src/components/k-handle-page/useHandlePageInit.ts
|
|
844
|
-
function
|
|
845
|
-
let n =
|
|
838
|
+
function Ct(e, t) {
|
|
839
|
+
let n = R(!1);
|
|
846
840
|
async function r() {
|
|
847
|
-
(
|
|
841
|
+
(U(t?.skipLoading) ?? !1) || (n.value = !0);
|
|
848
842
|
try {
|
|
849
843
|
await e();
|
|
850
844
|
} finally {
|
|
851
845
|
n.value = !1;
|
|
852
846
|
}
|
|
853
847
|
}
|
|
854
|
-
return t?.immediate !== !1 &&
|
|
848
|
+
return t?.immediate !== !1 && ue(() => {
|
|
855
849
|
r();
|
|
856
850
|
}), {
|
|
857
851
|
pageLoading: n,
|
|
@@ -860,30 +854,30 @@ function Ot(e, t) {
|
|
|
860
854
|
}
|
|
861
855
|
//#endregion
|
|
862
856
|
//#region src/components/k-icon/resolveLucideIcon.ts
|
|
863
|
-
var
|
|
864
|
-
function
|
|
857
|
+
var wt = /* @__PURE__ */ new Map();
|
|
858
|
+
function Tt(e) {
|
|
865
859
|
return e.split("-").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
866
860
|
}
|
|
867
|
-
function
|
|
861
|
+
function Et(e) {
|
|
868
862
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
|
|
869
863
|
}
|
|
870
|
-
function
|
|
871
|
-
if (!e || e === "#") return
|
|
864
|
+
function Dt(e) {
|
|
865
|
+
if (!e || e === "#") return Ge(e);
|
|
872
866
|
let t = e.trim();
|
|
873
|
-
if (
|
|
874
|
-
let n =
|
|
875
|
-
return
|
|
867
|
+
if (wt.has(t)) return wt.get(t) ?? Ge(e);
|
|
868
|
+
let n = Be[Tt(t)], r = typeof n == "function" ? n : null;
|
|
869
|
+
return wt.set(t, r), r ?? Ge(e);
|
|
876
870
|
}
|
|
877
|
-
var
|
|
878
|
-
function
|
|
879
|
-
if (
|
|
871
|
+
var Ot = /* @__PURE__ */ new Set(["createLucideIcon"]), kt = null;
|
|
872
|
+
function At() {
|
|
873
|
+
if (kt) return kt;
|
|
880
874
|
let e = /* @__PURE__ */ new Set(), t = [];
|
|
881
|
-
for (let [n, r] of Object.entries(
|
|
882
|
-
return
|
|
875
|
+
for (let [n, r] of Object.entries(Be)) Ot.has(n) || n.endsWith("Icon") || typeof r == "function" && (e.has(r) || (e.add(r), t.push(Et(n))));
|
|
876
|
+
return kt = t.sort((e, t) => e.localeCompare(t)), kt;
|
|
883
877
|
}
|
|
884
878
|
//#endregion
|
|
885
879
|
//#region src/components/k-icon/KIcon.vue
|
|
886
|
-
var
|
|
880
|
+
var jt = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
887
881
|
name: "KIcon",
|
|
888
882
|
__name: "KIcon",
|
|
889
883
|
props: {
|
|
@@ -892,18 +886,18 @@ var It = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
892
886
|
strokeWidth: { default: 2 }
|
|
893
887
|
},
|
|
894
888
|
setup(e) {
|
|
895
|
-
let t = e, n = C(() =>
|
|
896
|
-
return (t, r) => n.value ? (I(), w(
|
|
889
|
+
let t = e, n = C(() => Dt(t.name));
|
|
890
|
+
return (t, r) => n.value ? (I(), w(me(n.value), {
|
|
897
891
|
key: 0,
|
|
898
892
|
class: "k-icon",
|
|
899
893
|
size: e.size,
|
|
900
894
|
"stroke-width": e.strokeWidth
|
|
901
895
|
}, null, 8, ["size", "stroke-width"])) : T("", !0);
|
|
902
896
|
}
|
|
903
|
-
}), [["__scopeId", "data-v-6fd081ab"]]),
|
|
897
|
+
}), [["__scopeId", "data-v-6fd081ab"]]), Mt = { class: "k-link-button__item" }, Nt = {
|
|
904
898
|
key: 0,
|
|
905
899
|
class: "k-link-button__divider"
|
|
906
|
-
},
|
|
900
|
+
}, Pt = ["onClick"], Ft = /* @__PURE__ */ j({
|
|
907
901
|
name: "KLinkButton",
|
|
908
902
|
__name: "KLinkButton",
|
|
909
903
|
props: {
|
|
@@ -938,21 +932,21 @@ var It = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
938
932
|
}
|
|
939
933
|
return (t, n) => (I(), E("div", {
|
|
940
934
|
class: "k-link-button",
|
|
941
|
-
style:
|
|
942
|
-
}, [(I(!0), E(S, null,
|
|
935
|
+
style: ce({ justifyContent: e.align })
|
|
936
|
+
}, [(I(!0), E(S, null, z(i.value, (e, n) => (I(), w(W(Pe), {
|
|
943
937
|
key: `${e.label}-${n}`,
|
|
944
938
|
content: e.tooltip,
|
|
945
939
|
placement: "top",
|
|
946
940
|
disabled: !e.tooltip
|
|
947
941
|
}, {
|
|
948
|
-
default:
|
|
949
|
-
class:
|
|
950
|
-
onClick:
|
|
951
|
-
}, [c(e) ?
|
|
942
|
+
default: q(() => [D("div", Mt, [n > 0 ? (I(), E("span", Nt)) : T("", !0), D("a", {
|
|
943
|
+
class: F(["k-link-button__btn", [o(e), { "k-link-button__btn--readonly": a(e) }]]),
|
|
944
|
+
onClick: ye((t) => s(e, n), ["prevent"])
|
|
945
|
+
}, [c(e) ? B(t.$slots, l(e), { item: e }, () => [k(V(e.label), 1)], void 0, 0) : (I(), E(S, { key: 1 }, [k(V(e.label), 1)], 64))], 10, Pt)])]),
|
|
952
946
|
_: 2
|
|
953
947
|
}, 1032, ["content", "disabled"]))), 128))], 4));
|
|
954
948
|
}
|
|
955
|
-
}),
|
|
949
|
+
}), It = /* @__PURE__ */ j({
|
|
956
950
|
name: "KPagination",
|
|
957
951
|
__name: "KPagination",
|
|
958
952
|
props: {
|
|
@@ -972,7 +966,7 @@ var It = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
972
966
|
] }
|
|
973
967
|
},
|
|
974
968
|
setup(e) {
|
|
975
|
-
return (t, n) => (I(), w(
|
|
969
|
+
return (t, n) => (I(), w(W(Ae), N(t.$attrs, {
|
|
976
970
|
layout: e.layout,
|
|
977
971
|
"page-size": e.pageSize,
|
|
978
972
|
"page-sizes": e.pageSizes
|
|
@@ -982,7 +976,7 @@ var It = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
982
976
|
"page-sizes"
|
|
983
977
|
]));
|
|
984
978
|
}
|
|
985
|
-
}),
|
|
979
|
+
}), Lt = ["id"], Rt = { class: "k-long-page-panel__title" }, zt = { class: "k-long-page-panel__content" }, Bt = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
986
980
|
name: "KLongPagePanel",
|
|
987
981
|
__name: "KLongPagePanel",
|
|
988
982
|
props: {
|
|
@@ -993,15 +987,15 @@ var It = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
993
987
|
return (t, n) => (I(), E("div", {
|
|
994
988
|
id: e.panelId || void 0,
|
|
995
989
|
class: "k-long-page-panel"
|
|
996
|
-
}, [D("div",
|
|
990
|
+
}, [D("div", Rt, V(e.title), 1), D("div", zt, [B(t.$slots, "default", {}, void 0, !0)])], 8, Lt));
|
|
997
991
|
}
|
|
998
|
-
}), [["__scopeId", "data-v-9d6e7832"]]),
|
|
999
|
-
function
|
|
992
|
+
}), [["__scopeId", "data-v-9d6e7832"]]), Vt = 4;
|
|
993
|
+
function Ht(e) {
|
|
1000
994
|
let t = 0, n = 0, r = !1, i = !1, a = null;
|
|
1001
995
|
function o(o) {
|
|
1002
996
|
if (!r || !e.value || o.pointerId !== a) return;
|
|
1003
997
|
let s = o.clientY - t;
|
|
1004
|
-
if (!i && Math.abs(s) <
|
|
998
|
+
if (!i && Math.abs(s) < Vt) return;
|
|
1005
999
|
i = !0, o.preventDefault();
|
|
1006
1000
|
let c = Math.min(Math.max(n + s, 0), window.innerHeight - e.value.offsetHeight);
|
|
1007
1001
|
e.value.style.top = `${c}px`;
|
|
@@ -1018,26 +1012,26 @@ function qt(e) {
|
|
|
1018
1012
|
function u() {
|
|
1019
1013
|
return i ? (i = !1, !0) : !1;
|
|
1020
1014
|
}
|
|
1021
|
-
return
|
|
1015
|
+
return le(s), {
|
|
1022
1016
|
onPointerDown: l,
|
|
1023
1017
|
consumeClickIfDragged: u
|
|
1024
1018
|
};
|
|
1025
1019
|
}
|
|
1026
1020
|
//#endregion
|
|
1027
1021
|
//#region src/components/k-long-page/icons/icon-base.png?no-inline
|
|
1028
|
-
var
|
|
1029
|
-
base: [
|
|
1030
|
-
price: [
|
|
1031
|
-
notice: [
|
|
1032
|
-
setup: [
|
|
1033
|
-
restrict: [
|
|
1022
|
+
var Ut = "" + new URL("assets/icon-base-pYrXWQZO.png", import.meta.url).href, Wt = "" + new URL("assets/icon-base-2-CcPa4bmO.png", import.meta.url).href, Gt = "" + new URL("assets/icon-notice-DNvEYor3.png", import.meta.url).href, Kt = "" + new URL("assets/icon-notice-2-JVyxpYo9.png", import.meta.url).href, qt = "" + new URL("assets/icon-price-4iIa0b5D.png", import.meta.url).href, Jt = "" + new URL("assets/icon-price-2-DMmEoFbh.png", import.meta.url).href, Yt = "" + new URL("assets/icon-restrict-BWJ7LA9s.png", import.meta.url).href, Xt = "" + new URL("assets/icon-restrict-2-BjWtoOXX.png", import.meta.url).href, Zt = "" + new URL("assets/icon-setup-DXpIP63L.png", import.meta.url).href, Qt = "" + new URL("assets/icon-setup-2-BO6uKRX4.png", import.meta.url).href, $t = {
|
|
1023
|
+
base: [Ut, Wt],
|
|
1024
|
+
price: [qt, Jt],
|
|
1025
|
+
notice: [Gt, Kt],
|
|
1026
|
+
setup: [Zt, Qt],
|
|
1027
|
+
restrict: [Yt, Xt]
|
|
1034
1028
|
};
|
|
1035
|
-
function
|
|
1036
|
-
return
|
|
1029
|
+
function en(e) {
|
|
1030
|
+
return $t[e] ?? $t.base;
|
|
1037
1031
|
}
|
|
1038
1032
|
//#endregion
|
|
1039
1033
|
//#region src/components/k-long-page/KLongPage.vue?vue&type=script&setup=true&lang.ts
|
|
1040
|
-
var
|
|
1034
|
+
var tn = ["onClick"], nn = ["src", "alt"], rn = ["src", "alt"], an = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
1041
1035
|
name: "KLongPage",
|
|
1042
1036
|
__name: "KLongPage",
|
|
1043
1037
|
props: { panels: { default: () => [{
|
|
@@ -1045,13 +1039,13 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1045
1039
|
label: "面板一"
|
|
1046
1040
|
}] } },
|
|
1047
1041
|
setup(e) {
|
|
1048
|
-
let t =
|
|
1042
|
+
let t = _e("rootRef"), n = _e("navRef"), { onPointerDown: r, consumeClickIfDragged: i } = Ht(n);
|
|
1049
1043
|
function a(e) {
|
|
1050
|
-
return
|
|
1044
|
+
return en(e);
|
|
1051
1045
|
}
|
|
1052
1046
|
async function o(e) {
|
|
1053
1047
|
if (i()) return;
|
|
1054
|
-
await
|
|
1048
|
+
await P();
|
|
1055
1049
|
let n = t.value?.querySelector(`#${CSS.escape(e)}`);
|
|
1056
1050
|
(n?.querySelector(".k-long-page-panel__title") ?? n)?.scrollIntoView({
|
|
1057
1051
|
block: "start",
|
|
@@ -1062,20 +1056,20 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1062
1056
|
ref_key: "rootRef",
|
|
1063
1057
|
ref: t,
|
|
1064
1058
|
class: "k-long-page"
|
|
1065
|
-
}, [(I(!0), E(S, null,
|
|
1059
|
+
}, [(I(!0), E(S, null, z(e.panels, (e) => (I(), w(Bt, {
|
|
1066
1060
|
key: e.name,
|
|
1067
1061
|
class: "k-long-page__panel",
|
|
1068
1062
|
"panel-id": e.name,
|
|
1069
1063
|
title: e.label
|
|
1070
1064
|
}, {
|
|
1071
|
-
default:
|
|
1065
|
+
default: q(() => [B(i.$slots, e.name, {}, void 0, !0)]),
|
|
1072
1066
|
_: 2
|
|
1073
1067
|
}, 1032, ["panel-id", "title"]))), 128)), D("div", {
|
|
1074
1068
|
ref_key: "navRef",
|
|
1075
1069
|
ref: n,
|
|
1076
1070
|
class: "k-long-page__nav",
|
|
1077
|
-
onPointerdown: s[0] ||= (...e) =>
|
|
1078
|
-
}, [(I(!0), E(S, null,
|
|
1071
|
+
onPointerdown: s[0] ||= (...e) => W(r) && W(r)(...e)
|
|
1072
|
+
}, [(I(!0), E(S, null, z(e.panels, (e) => (I(), E("div", {
|
|
1079
1073
|
key: e.name,
|
|
1080
1074
|
class: "k-long-page__nav-item",
|
|
1081
1075
|
role: "button",
|
|
@@ -1089,7 +1083,7 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1089
1083
|
width: "28",
|
|
1090
1084
|
height: "28",
|
|
1091
1085
|
draggable: "false"
|
|
1092
|
-
}, null, 8,
|
|
1086
|
+
}, null, 8, nn),
|
|
1093
1087
|
D("img", {
|
|
1094
1088
|
class: "k-long-page__nav-item-icon k-long-page__nav-item-icon--active",
|
|
1095
1089
|
src: a(e.name)[1],
|
|
@@ -1097,31 +1091,31 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1097
1091
|
width: "28",
|
|
1098
1092
|
height: "28",
|
|
1099
1093
|
draggable: "false"
|
|
1100
|
-
}, null, 8,
|
|
1101
|
-
D("span", null,
|
|
1102
|
-
], 8,
|
|
1094
|
+
}, null, 8, rn),
|
|
1095
|
+
D("span", null, V(e.label), 1)
|
|
1096
|
+
], 8, tn))), 128))], 544)], 512));
|
|
1103
1097
|
}
|
|
1104
|
-
}), [["__scopeId", "data-v-ac934c5d"]]),
|
|
1098
|
+
}), [["__scopeId", "data-v-ac934c5d"]]), on = /* @__PURE__ */ j({
|
|
1105
1099
|
name: "KCard",
|
|
1106
1100
|
__name: "KCard",
|
|
1107
1101
|
setup(e) {
|
|
1108
|
-
return (e, t) => (I(), w(
|
|
1109
|
-
default:
|
|
1102
|
+
return (e, t) => (I(), w(W(xe), se(ie(e.$attrs)), O({
|
|
1103
|
+
default: q(() => [B(e.$slots, "default")]),
|
|
1110
1104
|
_: 2
|
|
1111
1105
|
}, [e.$slots.header ? {
|
|
1112
1106
|
name: "header",
|
|
1113
|
-
fn:
|
|
1107
|
+
fn: q(() => [B(e.$slots, "header")]),
|
|
1114
1108
|
key: "0"
|
|
1115
1109
|
} : void 0, e.$slots.footer ? {
|
|
1116
1110
|
name: "footer",
|
|
1117
|
-
fn:
|
|
1111
|
+
fn: q(() => [B(e.$slots, "footer")]),
|
|
1118
1112
|
key: "1"
|
|
1119
1113
|
} : void 0]), 1040));
|
|
1120
1114
|
}
|
|
1121
|
-
}),
|
|
1115
|
+
}), sn = {
|
|
1122
1116
|
key: 0,
|
|
1123
1117
|
class: "panel-head"
|
|
1124
|
-
},
|
|
1118
|
+
}, cn = { class: "panel-head_left" }, ln = { class: "panel-content" }, un = /* @__PURE__ */ j({
|
|
1125
1119
|
name: "KPanel",
|
|
1126
1120
|
__name: "KPanel",
|
|
1127
1121
|
props: {
|
|
@@ -1140,29 +1134,29 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1140
1134
|
}
|
|
1141
1135
|
},
|
|
1142
1136
|
setup(e) {
|
|
1143
|
-
let t = e, n =
|
|
1137
|
+
let t = e, n = R(t.unfold ? ["content"] : []), r = C(() => ({
|
|
1144
1138
|
panel: !0,
|
|
1145
1139
|
"panel-hover": t.hover
|
|
1146
1140
|
}));
|
|
1147
|
-
return (t, i) => (I(), E("div", { class:
|
|
1141
|
+
return (t, i) => (I(), E("div", { class: F(r.value) }, [e.isFold ? (I(), w(W(Ce), {
|
|
1148
1142
|
key: 0,
|
|
1149
1143
|
modelValue: n.value,
|
|
1150
1144
|
"onUpdate:modelValue": i[0] ||= (e) => n.value = e
|
|
1151
1145
|
}, {
|
|
1152
|
-
default:
|
|
1146
|
+
default: q(() => [A(W(we), {
|
|
1153
1147
|
name: "content",
|
|
1154
1148
|
title: e.title
|
|
1155
1149
|
}, {
|
|
1156
|
-
default:
|
|
1150
|
+
default: q(() => [B(t.$slots, "default")]),
|
|
1157
1151
|
_: 3
|
|
1158
1152
|
}, 8, ["title"])]),
|
|
1159
1153
|
_: 3
|
|
1160
|
-
}, 8, ["modelValue"])) : (I(), E(S, { key: 1 }, [e.title || t.$slots.title ? (I(), E("div",
|
|
1154
|
+
}, 8, ["modelValue"])) : (I(), E(S, { key: 1 }, [e.title || t.$slots.title ? (I(), E("div", sn, [D("div", cn, [B(t.$slots, "title", {}, () => [k(V(e.title), 1)])])])) : T("", !0), D("div", ln, [B(t.$slots, "default")])], 64))], 2));
|
|
1161
1155
|
}
|
|
1162
|
-
}),
|
|
1156
|
+
}), dn = {
|
|
1163
1157
|
key: 0,
|
|
1164
1158
|
class: "k-panel-query__footer"
|
|
1165
|
-
},
|
|
1159
|
+
}, fn = /* @__PURE__ */ j({
|
|
1166
1160
|
name: "KPanelQueryActions",
|
|
1167
1161
|
__name: "KPanelQueryActions",
|
|
1168
1162
|
props: { footer: {
|
|
@@ -1172,33 +1166,33 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1172
1166
|
emits: ["query", "reset"],
|
|
1173
1167
|
setup(t, { emit: n }) {
|
|
1174
1168
|
let r = n;
|
|
1175
|
-
return (n, i) => t.footer ? (I(), E("div",
|
|
1169
|
+
return (n, i) => t.footer ? (I(), E("div", dn, [A(e, {
|
|
1176
1170
|
type: "primary",
|
|
1177
1171
|
onClick: i[0] ||= (e) => r("query")
|
|
1178
1172
|
}, {
|
|
1179
|
-
default:
|
|
1173
|
+
default: q(() => [...i[4] ||= [k("查询", -1)]]),
|
|
1180
1174
|
_: 1
|
|
1181
1175
|
}), A(e, {
|
|
1182
1176
|
class: "k-panel-query__btn-reset",
|
|
1183
1177
|
onClick: i[1] ||= (e) => r("reset")
|
|
1184
1178
|
}, {
|
|
1185
|
-
default:
|
|
1179
|
+
default: q(() => [...i[5] ||= [k("重置", -1)]]),
|
|
1186
1180
|
_: 1
|
|
1187
1181
|
})])) : (I(), E(S, { key: 1 }, [A(e, {
|
|
1188
1182
|
type: "primary",
|
|
1189
1183
|
onClick: i[2] ||= (e) => r("query")
|
|
1190
1184
|
}, {
|
|
1191
|
-
default:
|
|
1185
|
+
default: q(() => [...i[6] ||= [k("查询", -1)]]),
|
|
1192
1186
|
_: 1
|
|
1193
1187
|
}), A(e, {
|
|
1194
1188
|
class: "k-panel-query__btn-reset",
|
|
1195
1189
|
onClick: i[3] ||= (e) => r("reset")
|
|
1196
1190
|
}, {
|
|
1197
|
-
default:
|
|
1191
|
+
default: q(() => [...i[7] ||= [k("重置", -1)]]),
|
|
1198
1192
|
_: 1
|
|
1199
1193
|
})], 64));
|
|
1200
1194
|
}
|
|
1201
|
-
}),
|
|
1195
|
+
}), pn = /* @__PURE__ */ j({
|
|
1202
1196
|
name: "KPanelQueryForm",
|
|
1203
1197
|
__name: "KPanelQueryForm",
|
|
1204
1198
|
props: {
|
|
@@ -1220,13 +1214,13 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1220
1214
|
}
|
|
1221
1215
|
},
|
|
1222
1216
|
setup(e, { expose: t }) {
|
|
1223
|
-
let n =
|
|
1217
|
+
let n = R();
|
|
1224
1218
|
return t({
|
|
1225
1219
|
validateFields: () => n.value?.validateFields(),
|
|
1226
1220
|
getParams: () => n.value?.getParams() ?? {},
|
|
1227
1221
|
resetForm: () => n.value?.resetForm(),
|
|
1228
1222
|
getFormRef: () => n.value?.getFormRef()
|
|
1229
|
-
}), (t, r) => (I(), w(
|
|
1223
|
+
}), (t, r) => (I(), w(W(dt), {
|
|
1230
1224
|
ref_key: "formRef",
|
|
1231
1225
|
ref: n,
|
|
1232
1226
|
class: "k-panel-query-form",
|
|
@@ -1247,27 +1241,27 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1247
1241
|
"hide-label"
|
|
1248
1242
|
]));
|
|
1249
1243
|
}
|
|
1250
|
-
}),
|
|
1244
|
+
}), mn = { class: "k-items k-form" }, hn = { class: "k-items_ul" }, gn = {
|
|
1251
1245
|
key: 0,
|
|
1252
1246
|
class: "k-item_label"
|
|
1253
|
-
},
|
|
1247
|
+
}, _n = { class: "k-item_input" }, vn = {
|
|
1254
1248
|
key: 0,
|
|
1255
1249
|
class: "k-item k-panel-query__item-actions"
|
|
1256
|
-
},
|
|
1250
|
+
}, yn = /* @__PURE__ */ j({
|
|
1257
1251
|
name: "KPanelQueryItem",
|
|
1258
1252
|
__name: "KPanelQueryItem",
|
|
1259
1253
|
props: { formConfigs: {} },
|
|
1260
1254
|
setup(e, { expose: t }) {
|
|
1261
|
-
let n = e, r =
|
|
1255
|
+
let n = e, r = G(), i = C(() => ({
|
|
1262
1256
|
colLength: 1,
|
|
1263
1257
|
inline: !0,
|
|
1264
1258
|
autoLayout: !1,
|
|
1265
1259
|
hideLabel: !1
|
|
1266
|
-
})), a =
|
|
1267
|
-
formConfigs:
|
|
1260
|
+
})), a = it({
|
|
1261
|
+
formConfigs: H(n, "formConfigs"),
|
|
1268
1262
|
controlled: C(() => !1)
|
|
1269
|
-
}), { normalizedConfigs: o, getFieldOptions: s } =
|
|
1270
|
-
formConfigs:
|
|
1263
|
+
}), { normalizedConfigs: o, getFieldOptions: s } = $e({
|
|
1264
|
+
formConfigs: H(n, "formConfigs"),
|
|
1271
1265
|
layout: i
|
|
1272
1266
|
});
|
|
1273
1267
|
function c(e, t) {
|
|
@@ -1287,22 +1281,22 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1287
1281
|
getParams: u,
|
|
1288
1282
|
resetForm: d,
|
|
1289
1283
|
getFormRef: () => void 0
|
|
1290
|
-
}), (e, t) => (I(), E("div",
|
|
1284
|
+
}), (e, t) => (I(), E("div", mn, [D("ul", hn, [(I(!0), E(S, null, z(W(o), (e) => (I(), E("li", {
|
|
1291
1285
|
key: e.id,
|
|
1292
|
-
class:
|
|
1293
|
-
}, [e.label ? (I(), E("label",
|
|
1286
|
+
class: F(["k-item", { "k-item_flex": !!e.label }])
|
|
1287
|
+
}, [e.label ? (I(), E("label", gn, V(e.label), 1)) : T("", !0), D("div", _n, [A(ct, {
|
|
1294
1288
|
item: e,
|
|
1295
|
-
"model-value":
|
|
1296
|
-
options:
|
|
1289
|
+
"model-value": W(a).formModel[e.id],
|
|
1290
|
+
options: W(s)(e),
|
|
1297
1291
|
"onUpdate:modelValue": (t) => c(e, t)
|
|
1298
1292
|
}, null, 8, [
|
|
1299
1293
|
"item",
|
|
1300
1294
|
"model-value",
|
|
1301
1295
|
"options",
|
|
1302
1296
|
"onUpdate:modelValue"
|
|
1303
|
-
])])], 2))), 128)),
|
|
1297
|
+
])])], 2))), 128)), W(r).button ? (I(), E("li", vn, [B(e.$slots, "button")])) : T("", !0)])]));
|
|
1304
1298
|
}
|
|
1305
|
-
}),
|
|
1299
|
+
}), bn = /* @__PURE__ */ j({
|
|
1306
1300
|
name: "KPanelQuery",
|
|
1307
1301
|
__name: "KPanelQuery",
|
|
1308
1302
|
props: {
|
|
@@ -1336,7 +1330,7 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1336
1330
|
},
|
|
1337
1331
|
emits: ["query", "reset"],
|
|
1338
1332
|
setup(e, { expose: t, emit: n }) {
|
|
1339
|
-
let r = e, i = n, a =
|
|
1333
|
+
let r = e, i = n, a = R(), o = /* @__PURE__ */ new Set([
|
|
1340
1334
|
"Input",
|
|
1341
1335
|
"Select",
|
|
1342
1336
|
"TreeSelect",
|
|
@@ -1372,7 +1366,7 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1372
1366
|
e && i("query", e);
|
|
1373
1367
|
}
|
|
1374
1368
|
async function d() {
|
|
1375
|
-
a.value?.resetForm(), i("reset"), await
|
|
1369
|
+
a.value?.resetForm(), i("reset"), await P();
|
|
1376
1370
|
let e = await a.value?.validateFields();
|
|
1377
1371
|
e && i("query", e);
|
|
1378
1372
|
}
|
|
@@ -1387,31 +1381,31 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1387
1381
|
resetForm: p,
|
|
1388
1382
|
getFormRef: () => a.value?.getFormRef(),
|
|
1389
1383
|
submit: u
|
|
1390
|
-
}), (t, n) => (I(), E("div", { class:
|
|
1384
|
+
}), (t, n) => (I(), E("div", { class: F(["k-panel-query", {
|
|
1391
1385
|
"k-panel-query__form": e.model === "form" && !e.showPanel,
|
|
1392
1386
|
"k-panel-query__item": l.value
|
|
1393
|
-
}]) }, [e.showPanel ? (I(), w(
|
|
1387
|
+
}]) }, [e.showPanel ? (I(), w(W(un), {
|
|
1394
1388
|
key: 1,
|
|
1395
1389
|
title: e.title,
|
|
1396
1390
|
"is-fold": e.isFold,
|
|
1397
1391
|
unfold: e.unfold,
|
|
1398
1392
|
hover: e.hover
|
|
1399
1393
|
}, {
|
|
1400
|
-
default:
|
|
1394
|
+
default: q(() => [c.value ? (I(), E(S, { key: 0 }, [l.value ? (I(), w(yn, N({
|
|
1401
1395
|
key: 0,
|
|
1402
1396
|
ref_key: "formRef",
|
|
1403
1397
|
ref: a
|
|
1404
1398
|
}, c.value), O({ _: 2 }, [e.hideButton ? void 0 : {
|
|
1405
1399
|
name: "button",
|
|
1406
|
-
fn:
|
|
1400
|
+
fn: q(() => [A(fn, {
|
|
1407
1401
|
onQuery: u,
|
|
1408
1402
|
onReset: d
|
|
1409
1403
|
})]),
|
|
1410
1404
|
key: "0"
|
|
1411
|
-
}]), 1040)) : (I(), E(S, { key: 1 }, [A(
|
|
1405
|
+
}]), 1040)) : (I(), E(S, { key: 1 }, [A(pn, N({
|
|
1412
1406
|
ref_key: "formRef",
|
|
1413
1407
|
ref: a
|
|
1414
|
-
}, c.value, { "hide-label": e.hideLabel }), null, 16, ["hide-label"]), e.hideButton ? T("", !0) : (I(), w(
|
|
1408
|
+
}, c.value, { "hide-label": e.hideLabel }), null, 16, ["hide-label"]), e.hideButton ? T("", !0) : (I(), w(fn, {
|
|
1415
1409
|
key: 0,
|
|
1416
1410
|
footer: "",
|
|
1417
1411
|
onQuery: u,
|
|
@@ -1423,21 +1417,21 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1423
1417
|
"is-fold",
|
|
1424
1418
|
"unfold",
|
|
1425
1419
|
"hover"
|
|
1426
|
-
])) : (I(), E(S, { key: 0 }, [c.value ? (I(), E(S, { key: 0 }, [l.value ? (I(), w(
|
|
1420
|
+
])) : (I(), E(S, { key: 0 }, [c.value ? (I(), E(S, { key: 0 }, [l.value ? (I(), w(yn, N({
|
|
1427
1421
|
key: 0,
|
|
1428
1422
|
ref_key: "formRef",
|
|
1429
1423
|
ref: a
|
|
1430
1424
|
}, c.value), O({ _: 2 }, [e.hideButton ? void 0 : {
|
|
1431
1425
|
name: "button",
|
|
1432
|
-
fn:
|
|
1426
|
+
fn: q(() => [A(fn, {
|
|
1433
1427
|
onQuery: u,
|
|
1434
1428
|
onReset: d
|
|
1435
1429
|
})]),
|
|
1436
1430
|
key: "0"
|
|
1437
|
-
}]), 1040)) : (I(), E(S, { key: 1 }, [A(
|
|
1431
|
+
}]), 1040)) : (I(), E(S, { key: 1 }, [A(pn, N({
|
|
1438
1432
|
ref_key: "formRef",
|
|
1439
1433
|
ref: a
|
|
1440
|
-
}, c.value, { "hide-label": e.hideLabel }), null, 16, ["hide-label"]), e.hideButton ? T("", !0) : (I(), w(
|
|
1434
|
+
}, c.value, { "hide-label": e.hideLabel }), null, 16, ["hide-label"]), e.hideButton ? T("", !0) : (I(), w(fn, {
|
|
1441
1435
|
key: 0,
|
|
1442
1436
|
footer: "",
|
|
1443
1437
|
onQuery: u,
|
|
@@ -1447,43 +1441,43 @@ var sn = ["onClick"], cn = ["src", "alt"], ln = ["src", "alt"], un = /*#__PURE__
|
|
|
1447
1441
|
});
|
|
1448
1442
|
//#endregion
|
|
1449
1443
|
//#region src/components/k-table/utils/rowKey.ts
|
|
1450
|
-
function
|
|
1444
|
+
function xn(e, t) {
|
|
1451
1445
|
return e[t];
|
|
1452
1446
|
}
|
|
1453
|
-
function
|
|
1454
|
-
let n =
|
|
1447
|
+
function Sn(e, t) {
|
|
1448
|
+
let n = xn(e, t);
|
|
1455
1449
|
return typeof n == "string" || typeof n == "number" || typeof n == "boolean" ? n : n == null ? "" : String(n);
|
|
1456
1450
|
}
|
|
1457
1451
|
//#endregion
|
|
1458
1452
|
//#region src/components/k-table/utils/formatCellValue.ts
|
|
1459
|
-
function
|
|
1453
|
+
function Cn(e) {
|
|
1460
1454
|
return e === "" || e == null;
|
|
1461
1455
|
}
|
|
1462
|
-
function
|
|
1456
|
+
function wn(e) {
|
|
1463
1457
|
let t = Number(e);
|
|
1464
1458
|
return Number.isNaN(t) ? String(e ?? "") : t.toLocaleString("en-US");
|
|
1465
1459
|
}
|
|
1466
|
-
function
|
|
1460
|
+
function Tn(e) {
|
|
1467
1461
|
return e.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
|
|
1468
1462
|
}
|
|
1469
|
-
function
|
|
1470
|
-
if (
|
|
1463
|
+
function En(e, t) {
|
|
1464
|
+
if (Cn(t)) return "";
|
|
1471
1465
|
let n = String(t);
|
|
1472
1466
|
switch (e) {
|
|
1473
|
-
case "date": return
|
|
1474
|
-
case "datetime": return
|
|
1475
|
-
case "amount": return
|
|
1476
|
-
case "phone": return
|
|
1467
|
+
case "date": return Fe(n).format("YYYY-MM-DD");
|
|
1468
|
+
case "datetime": return Fe(n).format("YYYY-MM-DD HH:mm:ss");
|
|
1469
|
+
case "amount": return wn(t);
|
|
1470
|
+
case "phone": return Tn(n);
|
|
1477
1471
|
default: return n;
|
|
1478
1472
|
}
|
|
1479
1473
|
}
|
|
1480
|
-
function
|
|
1481
|
-
let a = e.prop ?
|
|
1482
|
-
return e.formatter ? e.formatter(t, e, a, n) : e.dict && i !== void 0 ? i :
|
|
1474
|
+
function Dn(e, t, n, r, i) {
|
|
1475
|
+
let a = e.prop ? xn(t, e.prop) : void 0;
|
|
1476
|
+
return e.formatter ? e.formatter(t, e, a, n) : e.dict && i !== void 0 ? i : Cn(a) ? r : e.showType ? En(e.showType, a) : String(a);
|
|
1483
1477
|
}
|
|
1484
1478
|
//#endregion
|
|
1485
1479
|
//#region src/components/k-table/composables/useTableColumns.ts
|
|
1486
|
-
var
|
|
1480
|
+
var On = [
|
|
1487
1481
|
"prop",
|
|
1488
1482
|
"label",
|
|
1489
1483
|
"width",
|
|
@@ -1506,7 +1500,7 @@ var Nn = [
|
|
|
1506
1500
|
"filterMethod",
|
|
1507
1501
|
"filteredValue"
|
|
1508
1502
|
];
|
|
1509
|
-
function
|
|
1503
|
+
function kn(e, t = !1) {
|
|
1510
1504
|
let n = e.some((e) => e.type === "selection"), r = e;
|
|
1511
1505
|
return t && !n && (r = [{
|
|
1512
1506
|
type: "selection",
|
|
@@ -1517,24 +1511,24 @@ function Pn(e, t = !1) {
|
|
|
1517
1511
|
type: "operates"
|
|
1518
1512
|
} : e);
|
|
1519
1513
|
}
|
|
1520
|
-
function
|
|
1514
|
+
function An(e) {
|
|
1521
1515
|
let t = {
|
|
1522
1516
|
minWidth: e.minWidth ?? "110",
|
|
1523
1517
|
align: e.align ?? "center",
|
|
1524
1518
|
headerAlign: e.headerAlign ?? "center"
|
|
1525
1519
|
};
|
|
1526
|
-
for (let n of
|
|
1520
|
+
for (let n of On) e[n] !== void 0 && (t[n] = e[n]);
|
|
1527
1521
|
return e.type === "index" && !t.label && (t.label = "序号"), e.type === "expand" && (t.width = e.width ?? 50, delete t.minWidth), e.type !== "selection" && e.type !== "index" && e.type !== "operates" && e.type !== "radio" && e.type !== "expand" && (t.showOverflowTooltip = e.showOverflowTooltip ?? !0), t;
|
|
1528
1522
|
}
|
|
1529
|
-
function
|
|
1530
|
-
let t =
|
|
1523
|
+
function jn(e = "--") {
|
|
1524
|
+
let t = ae(l, null);
|
|
1531
1525
|
function n(n, r, i) {
|
|
1532
|
-
let a = n.prop ?
|
|
1533
|
-
return
|
|
1526
|
+
let a = n.prop ? xn(r, n.prop) : void 0;
|
|
1527
|
+
return Dn(n, r, i, e, n.dict && t && !Mn(a) ? t.getLabel(n.dict, a) : void 0);
|
|
1534
1528
|
}
|
|
1535
1529
|
return { getCellDisplayValue: n };
|
|
1536
1530
|
}
|
|
1537
|
-
function
|
|
1531
|
+
function Mn(e) {
|
|
1538
1532
|
return e === "" || e == null;
|
|
1539
1533
|
}
|
|
1540
1534
|
//#endregion
|
|
@@ -1544,7 +1538,7 @@ function Q(e, t = 0) {
|
|
|
1544
1538
|
}
|
|
1545
1539
|
//#endregion
|
|
1546
1540
|
//#region src/components/k-table/KTableColumn.vue
|
|
1547
|
-
var
|
|
1541
|
+
var Nn = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
1548
1542
|
name: "KTableColumn",
|
|
1549
1543
|
__name: "KTableColumn",
|
|
1550
1544
|
props: {
|
|
@@ -1568,11 +1562,11 @@ var Rn = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
1568
1562
|
},
|
|
1569
1563
|
emits: ["operate-click", "radio-select"],
|
|
1570
1564
|
setup(e, { emit: t }) {
|
|
1571
|
-
let n = e, r = t, i =
|
|
1565
|
+
let n = e, r = t, i = G(), { getCellDisplayValue: a } = jn(n.nullValueFormat);
|
|
1572
1566
|
function o(e) {
|
|
1573
1567
|
return e ?? "";
|
|
1574
1568
|
}
|
|
1575
|
-
let s = C(() =>
|
|
1569
|
+
let s = C(() => An(n.column)), c = (e) => n.indexOffset + e + 1, l = C(() => {
|
|
1576
1570
|
let e = n.column.prop;
|
|
1577
1571
|
return !!(e && i[o(e)]);
|
|
1578
1572
|
}), u = C(() => n.column.type === "operates" ? i.operates ? !0 : !!(n.column.prop && i[o(n.column.prop)]) : !1);
|
|
@@ -1583,21 +1577,21 @@ var Rn = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
1583
1577
|
return typeof e.slot == "string" ? e.slot : "default";
|
|
1584
1578
|
}
|
|
1585
1579
|
function p(e) {
|
|
1586
|
-
return
|
|
1580
|
+
return Sn(e, n.rowKey);
|
|
1587
1581
|
}
|
|
1588
1582
|
return (t, n) => {
|
|
1589
|
-
let m =
|
|
1590
|
-
return e.column.type === "selection" ? (I(), w(
|
|
1591
|
-
key: `${
|
|
1583
|
+
let m = fe("KTableColumn", !0);
|
|
1584
|
+
return e.column.type === "selection" ? (I(), w(W(J), N({
|
|
1585
|
+
key: `${W(Q)(e.column, e.columnIndex)}:selection`,
|
|
1592
1586
|
type: "selection"
|
|
1593
|
-
}, s.value), null, 16)) : e.column.type === "index" ? (I(), w(
|
|
1594
|
-
default:
|
|
1587
|
+
}, s.value), null, 16)) : e.column.type === "index" ? (I(), w(W(J), N({ key: `${W(Q)(e.column, e.columnIndex)}:index` }, s.value), {
|
|
1588
|
+
default: q(({ $index: e }) => [B(t.$slots, "index", {
|
|
1595
1589
|
index: e,
|
|
1596
1590
|
displayIndex: c(e)
|
|
1597
|
-
}, () => [k(
|
|
1591
|
+
}, () => [k(V(c(e)), 1)], !0)]),
|
|
1598
1592
|
_: 3
|
|
1599
|
-
}, 16)) : e.column.type === "radio" ? (I(), w(
|
|
1600
|
-
default:
|
|
1593
|
+
}, 16)) : e.column.type === "radio" ? (I(), w(W(J), N({ key: `${W(Q)(e.column, e.columnIndex)}:radio` }, s.value), {
|
|
1594
|
+
default: q(({ row: t }) => [A(W(Me), {
|
|
1601
1595
|
class: "k-table-column__radio",
|
|
1602
1596
|
"model-value": e.radioSelected,
|
|
1603
1597
|
label: p(t),
|
|
@@ -1608,44 +1602,44 @@ var Rn = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
1608
1602
|
"onUpdate:modelValue"
|
|
1609
1603
|
])]),
|
|
1610
1604
|
_: 1
|
|
1611
|
-
}, 16)) : e.column.type === "operates" ? (I(), w(
|
|
1612
|
-
default:
|
|
1605
|
+
}, 16)) : e.column.type === "operates" ? (I(), w(W(J), N({ key: `${W(Q)(e.column, e.columnIndex)}:operates` }, s.value), {
|
|
1606
|
+
default: q(({ row: n, column: r, $index: a }) => [u.value ? B(t.$slots, W(i).operates ? "operates" : o(e.column.prop), {
|
|
1613
1607
|
row: n,
|
|
1614
1608
|
column: r,
|
|
1615
1609
|
index: a
|
|
1616
|
-
}, void 0, !0, 0) : (I(), w(
|
|
1610
|
+
}, void 0, !0, 0) : (I(), w(W(Ft), {
|
|
1617
1611
|
key: 1,
|
|
1618
1612
|
data: e.column.operates ?? [],
|
|
1619
1613
|
disabled: e.disabled,
|
|
1620
1614
|
"table-mode": "",
|
|
1621
1615
|
onClick: (e, t) => d(e, t, n)
|
|
1622
|
-
}, O({ _: 2 }, [
|
|
1616
|
+
}, O({ _: 2 }, [z(e.column.operates ?? [], (e) => ({
|
|
1623
1617
|
name: f(e),
|
|
1624
|
-
fn:
|
|
1618
|
+
fn: q(({ item: i }) => [B(t.$slots, f(e), {
|
|
1625
1619
|
row: n,
|
|
1626
1620
|
column: r,
|
|
1627
1621
|
index: a,
|
|
1628
1622
|
item: i
|
|
1629
|
-
}, () => [k(
|
|
1623
|
+
}, () => [k(V(i.label), 1)], !0)])
|
|
1630
1624
|
}))]), 1032, [
|
|
1631
1625
|
"data",
|
|
1632
1626
|
"disabled",
|
|
1633
1627
|
"onClick"
|
|
1634
1628
|
]))]),
|
|
1635
1629
|
_: 3
|
|
1636
|
-
}, 16)) : e.column.type === "expand" ? (I(), w(
|
|
1637
|
-
key: `${
|
|
1630
|
+
}, 16)) : e.column.type === "expand" ? (I(), w(W(J), N({
|
|
1631
|
+
key: `${W(Q)(e.column, e.columnIndex)}:expand`,
|
|
1638
1632
|
type: "expand"
|
|
1639
1633
|
}, s.value), {
|
|
1640
|
-
default:
|
|
1634
|
+
default: q(({ row: e, column: n, $index: r }) => [B(t.$slots, "expand", {
|
|
1641
1635
|
row: e,
|
|
1642
1636
|
column: n,
|
|
1643
1637
|
index: r
|
|
1644
1638
|
}, void 0, !0)]),
|
|
1645
1639
|
_: 3
|
|
1646
|
-
}, 16)) : e.column.children?.length ? (I(), w(
|
|
1647
|
-
default:
|
|
1648
|
-
key:
|
|
1640
|
+
}, 16)) : e.column.children?.length ? (I(), w(W(J), N({ key: `${W(Q)(e.column, e.columnIndex)}:group` }, s.value), {
|
|
1641
|
+
default: q(() => [(I(!0), E(S, null, z(e.column.children, (i, a) => (I(), w(m, {
|
|
1642
|
+
key: W(Q)(i, a),
|
|
1649
1643
|
column: i,
|
|
1650
1644
|
"column-index": a,
|
|
1651
1645
|
"index-offset": e.indexOffset,
|
|
@@ -1655,9 +1649,9 @@ var Rn = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
1655
1649
|
"radio-selected": e.radioSelected,
|
|
1656
1650
|
onOperateClick: n[0] ||= (e, t, n) => r("operate-click", e, t, n),
|
|
1657
1651
|
onRadioSelect: n[1] ||= (e) => r("radio-select", e)
|
|
1658
|
-
}, O({ _: 2 }, [
|
|
1652
|
+
}, O({ _: 2 }, [z(t.$slots, (e, n) => ({
|
|
1659
1653
|
name: n,
|
|
1660
|
-
fn:
|
|
1654
|
+
fn: q((e) => [B(t.$slots, n, N({ ref_for: !0 }, e ?? {}), void 0, !0)])
|
|
1661
1655
|
}))]), 1032, [
|
|
1662
1656
|
"column",
|
|
1663
1657
|
"column-index",
|
|
@@ -1668,40 +1662,40 @@ var Rn = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
1668
1662
|
"radio-selected"
|
|
1669
1663
|
]))), 128))]),
|
|
1670
1664
|
_: 3
|
|
1671
|
-
}, 16)) : (I(), w(
|
|
1672
|
-
default:
|
|
1665
|
+
}, 16)) : (I(), w(W(J), N({ key: `${W(Q)(e.column, e.columnIndex)}:default` }, s.value), O({
|
|
1666
|
+
default: q(({ row: n, column: r, $index: i }) => [l.value ? B(t.$slots, o(e.column.prop), {
|
|
1673
1667
|
row: n,
|
|
1674
1668
|
column: r,
|
|
1675
1669
|
index: i
|
|
1676
|
-
}, void 0, !0, 0) : (I(), E(S, { key: 1 }, [k(
|
|
1670
|
+
}, void 0, !0, 0) : (I(), E(S, { key: 1 }, [k(V(W(a)(e.column, n, i)), 1)], 64))]),
|
|
1677
1671
|
_: 2
|
|
1678
1672
|
}, [e.column.toolTip ? {
|
|
1679
1673
|
name: "header",
|
|
1680
|
-
fn:
|
|
1674
|
+
fn: q(() => [D("span", null, V(e.column.label), 1), A(W(Pe), {
|
|
1681
1675
|
content: e.column.toolTip,
|
|
1682
1676
|
placement: "top"
|
|
1683
1677
|
}, {
|
|
1684
|
-
default:
|
|
1678
|
+
default: q(() => [...n[2] ||= [D("span", { class: "k-table-column__tip" }, "i", -1)]]),
|
|
1685
1679
|
_: 1
|
|
1686
1680
|
}, 8, ["content"])]),
|
|
1687
1681
|
key: "0"
|
|
1688
1682
|
} : void 0]), 1040));
|
|
1689
1683
|
};
|
|
1690
1684
|
}
|
|
1691
|
-
}), [["__scopeId", "data-v-578909bc"]]),
|
|
1685
|
+
}), [["__scopeId", "data-v-578909bc"]]), Pn = { class: "k-table-column-selector" }, Fn = { class: "k-table-column-selector__header" }, In = { class: "k-table-column-selector__content" }, Ln = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
1692
1686
|
name: "KTableColumnSelector",
|
|
1693
1687
|
__name: "KTableColumnSelector",
|
|
1694
1688
|
props: { items: {} },
|
|
1695
1689
|
emits: ["change", "reset"],
|
|
1696
1690
|
setup(e, { emit: t }) {
|
|
1697
|
-
let n = t, r =
|
|
1691
|
+
let n = t, r = R(!1);
|
|
1698
1692
|
function i(e, t) {
|
|
1699
1693
|
n("change", e, t);
|
|
1700
1694
|
}
|
|
1701
1695
|
function a() {
|
|
1702
1696
|
n("reset");
|
|
1703
1697
|
}
|
|
1704
|
-
return (t, n) => (I(), w(
|
|
1698
|
+
return (t, n) => (I(), w(W(je), {
|
|
1705
1699
|
visible: r.value,
|
|
1706
1700
|
"onUpdate:visible": n[0] ||= (e) => r.value = e,
|
|
1707
1701
|
placement: "bottom-end",
|
|
@@ -1709,28 +1703,28 @@ var Rn = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
1709
1703
|
trigger: "click",
|
|
1710
1704
|
"popper-class": "k-table-column-selector__popover"
|
|
1711
1705
|
}, {
|
|
1712
|
-
reference:
|
|
1706
|
+
reference: q(() => [...n[1] ||= [D("button", {
|
|
1713
1707
|
type: "button",
|
|
1714
1708
|
class: "k-table-column-selector__trigger",
|
|
1715
1709
|
"aria-label": "列展示设置"
|
|
1716
1710
|
}, [D("span", { class: "k-table-column-selector__icon" })], -1)]]),
|
|
1717
|
-
default:
|
|
1718
|
-
D("div",
|
|
1711
|
+
default: q(() => [D("div", Pn, [
|
|
1712
|
+
D("div", Fn, [n[3] ||= D("span", null, "列展示", -1), A(W(be), {
|
|
1719
1713
|
type: "primary",
|
|
1720
1714
|
link: "",
|
|
1721
1715
|
onClick: a
|
|
1722
1716
|
}, {
|
|
1723
|
-
default:
|
|
1717
|
+
default: q(() => [...n[2] ||= [k("恢复默认", -1)]]),
|
|
1724
1718
|
_: 1
|
|
1725
1719
|
})]),
|
|
1726
|
-
A(
|
|
1727
|
-
D("div",
|
|
1720
|
+
A(W(Te), { class: "k-table-column-selector__divider" }),
|
|
1721
|
+
D("div", In, [(I(!0), E(S, null, z(e.items, (e) => (I(), w(W(Se), {
|
|
1728
1722
|
key: e.key,
|
|
1729
1723
|
"model-value": e.checked,
|
|
1730
1724
|
disabled: e.disabled,
|
|
1731
1725
|
onChange: (t) => i(e.key, !!t)
|
|
1732
1726
|
}, {
|
|
1733
|
-
default:
|
|
1727
|
+
default: q(() => [k(V(e.label), 1)]),
|
|
1734
1728
|
_: 2
|
|
1735
1729
|
}, 1032, [
|
|
1736
1730
|
"model-value",
|
|
@@ -1741,25 +1735,25 @@ var Rn = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
1741
1735
|
_: 1
|
|
1742
1736
|
}, 8, ["visible"]));
|
|
1743
1737
|
}
|
|
1744
|
-
}), [["__scopeId", "data-v-e0b3cf31"]]),
|
|
1738
|
+
}), [["__scopeId", "data-v-e0b3cf31"]]), Rn = {
|
|
1745
1739
|
key: 0,
|
|
1746
1740
|
class: "k-table-toolbar k-table-header"
|
|
1747
|
-
},
|
|
1741
|
+
}, zn = {
|
|
1748
1742
|
key: 0,
|
|
1749
1743
|
class: "k-table-toolbar__main"
|
|
1750
|
-
},
|
|
1744
|
+
}, Bn = {
|
|
1751
1745
|
key: 1,
|
|
1752
1746
|
class: "k-table-toolbar__header"
|
|
1753
|
-
},
|
|
1747
|
+
}, Vn = {
|
|
1754
1748
|
key: 2,
|
|
1755
1749
|
class: "k-table-toolbar__extra"
|
|
1756
|
-
},
|
|
1750
|
+
}, Hn = {
|
|
1757
1751
|
key: 1,
|
|
1758
1752
|
class: "k-table-toolbar__divider"
|
|
1759
|
-
},
|
|
1753
|
+
}, Un = {
|
|
1760
1754
|
key: 2,
|
|
1761
1755
|
class: "k-table-toolbar__selection"
|
|
1762
|
-
},
|
|
1756
|
+
}, Wn = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
1763
1757
|
name: "KTableToolbar",
|
|
1764
1758
|
__name: "KTableToolbar",
|
|
1765
1759
|
props: {
|
|
@@ -1775,41 +1769,41 @@ var Rn = /*#__PURE__*/ _(/* @__PURE__ */ j({
|
|
|
1775
1769
|
},
|
|
1776
1770
|
emits: ["add"],
|
|
1777
1771
|
setup(t, { emit: n }) {
|
|
1778
|
-
let r = t, i = n, a =
|
|
1779
|
-
return (n, r) => o.value || t.selectionShow ? (I(), E("div",
|
|
1780
|
-
o.value ? (I(), E("div",
|
|
1772
|
+
let r = t, i = n, a = G(), o = C(() => !!(r.addButton || a.header || a.extra)), s = C(() => !!(r.addButton && r.selectionShow));
|
|
1773
|
+
return (n, r) => o.value || t.selectionShow ? (I(), E("div", Rn, [
|
|
1774
|
+
o.value ? (I(), E("div", zn, [
|
|
1781
1775
|
t.addButton ? (I(), w(e, {
|
|
1782
1776
|
key: 0,
|
|
1783
1777
|
type: "primary",
|
|
1784
|
-
icon:
|
|
1778
|
+
icon: W(ze),
|
|
1785
1779
|
onClick: r[0] ||= (e) => i("add")
|
|
1786
1780
|
}, {
|
|
1787
|
-
default:
|
|
1781
|
+
default: q(() => [k(V(t.addButton === !0 ? "新建" : t.addButton), 1)]),
|
|
1788
1782
|
_: 1
|
|
1789
1783
|
}, 8, ["icon"])) : T("", !0),
|
|
1790
|
-
|
|
1791
|
-
|
|
1784
|
+
W(a).header ? (I(), E("div", Bn, [B(n.$slots, "header", {}, void 0, !0)])) : T("", !0),
|
|
1785
|
+
W(a).extra ? (I(), E("div", Vn, [B(n.$slots, "extra", {}, void 0, !0)])) : T("", !0)
|
|
1792
1786
|
])) : T("", !0),
|
|
1793
|
-
s.value ? (I(), E("div",
|
|
1794
|
-
t.selectionShow ? (I(), E("div",
|
|
1787
|
+
s.value ? (I(), E("div", Hn)) : T("", !0),
|
|
1788
|
+
t.selectionShow ? (I(), E("div", Un, "已选择" + V(t.selectedCount) + "条数据", 1)) : T("", !0)
|
|
1795
1789
|
])) : T("", !0);
|
|
1796
1790
|
}
|
|
1797
|
-
}), [["__scopeId", "data-v-bff19ed1"]]),
|
|
1798
|
-
function
|
|
1791
|
+
}), [["__scopeId", "data-v-bff19ed1"]]), Gn = "kayak_table_column_display";
|
|
1792
|
+
function Kn(e) {
|
|
1799
1793
|
return e.type === "selection" || e.type === "index" || e.type === "radio" || e.type === "expand" || e.required === !0;
|
|
1800
1794
|
}
|
|
1801
|
-
function
|
|
1795
|
+
function qn(e) {
|
|
1802
1796
|
return !(e.type === "radio" || e.type === "expand" || e.children?.length);
|
|
1803
1797
|
}
|
|
1804
|
-
function
|
|
1805
|
-
let t =
|
|
1798
|
+
function Jn(e) {
|
|
1799
|
+
let t = R({}), n = R(""), r = Ie(Gn, {}), i = C(() => !!U(e.enableColumnCache)), a = C(() => U(e.columns).filter((e) => qn(e)));
|
|
1806
1800
|
function o() {
|
|
1807
|
-
return
|
|
1801
|
+
return U(e.tableKey) || n.value;
|
|
1808
1802
|
}
|
|
1809
1803
|
function s() {
|
|
1810
1804
|
let t = {};
|
|
1811
|
-
return
|
|
1812
|
-
|
|
1805
|
+
return U(e.columns).forEach((e, n) => {
|
|
1806
|
+
qn(e) && (t[Q(e, n)] = !0);
|
|
1813
1807
|
}), t;
|
|
1814
1808
|
}
|
|
1815
1809
|
function c() {
|
|
@@ -1833,16 +1827,16 @@ function $n(e) {
|
|
|
1833
1827
|
delete t[e], r.value = t;
|
|
1834
1828
|
}
|
|
1835
1829
|
function d(t, n) {
|
|
1836
|
-
let r =
|
|
1830
|
+
let r = U(e.columns), i = r.findIndex((e) => e === t || e.prop && e.prop === t.prop && e.type === t.type);
|
|
1837
1831
|
return i >= 0 ? Q(r[i], i) : Q(t, n);
|
|
1838
1832
|
}
|
|
1839
1833
|
function f() {
|
|
1840
|
-
n.value =
|
|
1834
|
+
n.value = U(e.tableKey) || `table_${Math.random().toString(36).slice(2, 11)}`;
|
|
1841
1835
|
let r = c();
|
|
1842
|
-
t.value = r ?
|
|
1836
|
+
t.value = r ? Y(r) : s();
|
|
1843
1837
|
}
|
|
1844
1838
|
function p() {
|
|
1845
|
-
|
|
1839
|
+
P(() => e.onLayout?.());
|
|
1846
1840
|
}
|
|
1847
1841
|
function m(n, r) {
|
|
1848
1842
|
t.value = {
|
|
@@ -1857,9 +1851,9 @@ function $n(e) {
|
|
|
1857
1851
|
u(), t.value = s(), e.onDisplayChange?.(t.value), p();
|
|
1858
1852
|
}
|
|
1859
1853
|
let _ = C(() => {
|
|
1860
|
-
let n =
|
|
1854
|
+
let n = U(e.renderColumns);
|
|
1861
1855
|
return i.value ? n.filter((e, n) => {
|
|
1862
|
-
if (
|
|
1856
|
+
if (Kn(e)) return !0;
|
|
1863
1857
|
let r = d(e, n);
|
|
1864
1858
|
return t.value[r] !== !1;
|
|
1865
1859
|
}) : n;
|
|
@@ -1870,15 +1864,15 @@ function $n(e) {
|
|
|
1870
1864
|
key: r,
|
|
1871
1865
|
label: e.label || "未命名列",
|
|
1872
1866
|
checked: t.value[r] !== !1,
|
|
1873
|
-
disabled:
|
|
1867
|
+
disabled: Kn(e)
|
|
1874
1868
|
};
|
|
1875
1869
|
}));
|
|
1876
|
-
return
|
|
1870
|
+
return K(() => U(e.columns), () => {
|
|
1877
1871
|
let e = s();
|
|
1878
1872
|
Object.keys(e).forEach((e) => {
|
|
1879
1873
|
t.value[e] === void 0 && (t.value[e] = !0);
|
|
1880
1874
|
});
|
|
1881
|
-
}, { deep: !0 }),
|
|
1875
|
+
}, { deep: !0 }), ue(() => {
|
|
1882
1876
|
f();
|
|
1883
1877
|
}), {
|
|
1884
1878
|
columnDisplay: t,
|
|
@@ -1892,19 +1886,19 @@ function $n(e) {
|
|
|
1892
1886
|
}
|
|
1893
1887
|
//#endregion
|
|
1894
1888
|
//#region src/components/k-table/composables/useTableData.ts
|
|
1895
|
-
function
|
|
1896
|
-
let t =
|
|
1889
|
+
function Yn(e) {
|
|
1890
|
+
let t = R([]), n = R(e.initialLoading ?? !1), r = R(!1), i = R(!1);
|
|
1897
1891
|
function a() {
|
|
1898
1892
|
return {
|
|
1899
1893
|
...f,
|
|
1900
|
-
...
|
|
1894
|
+
...U(e.responseConfig)
|
|
1901
1895
|
};
|
|
1902
1896
|
}
|
|
1903
1897
|
function o() {
|
|
1904
1898
|
let t = a(), { currentPage: n, pageSize: r } = e.pagination.state.value;
|
|
1905
1899
|
return {
|
|
1906
|
-
...
|
|
1907
|
-
...
|
|
1900
|
+
...U(e.params) ?? {},
|
|
1901
|
+
...U(e.queryParams) ?? {},
|
|
1908
1902
|
[t.page]: String(n),
|
|
1909
1903
|
[t.limit]: String(r)
|
|
1910
1904
|
};
|
|
@@ -1936,8 +1930,8 @@ function er(e) {
|
|
|
1936
1930
|
}
|
|
1937
1931
|
//#endregion
|
|
1938
1932
|
//#region src/components/k-table/composables/useTablePagination.ts
|
|
1939
|
-
function
|
|
1940
|
-
let t =
|
|
1933
|
+
function Xn(e) {
|
|
1934
|
+
let t = U(e.pagination), n = R({
|
|
1941
1935
|
total: t?.total ?? i.total,
|
|
1942
1936
|
currentPage: t?.currentPage ?? i.currentPage,
|
|
1943
1937
|
pageSize: t?.pageSize ?? i.pageSize,
|
|
@@ -1950,8 +1944,8 @@ function tr(e) {
|
|
|
1950
1944
|
pageSizes: n.value.pageSizes,
|
|
1951
1945
|
layout: n.value.layout
|
|
1952
1946
|
})), a = C(() => (n.value.currentPage - 1) * n.value.pageSize);
|
|
1953
|
-
|
|
1954
|
-
let t =
|
|
1947
|
+
K(() => {
|
|
1948
|
+
let t = U(e.pagination);
|
|
1955
1949
|
return [
|
|
1956
1950
|
t?.total,
|
|
1957
1951
|
t?.currentPage,
|
|
@@ -1985,16 +1979,16 @@ function tr(e) {
|
|
|
1985
1979
|
}
|
|
1986
1980
|
//#endregion
|
|
1987
1981
|
//#region src/components/k-table/composables/useTableRadio.ts
|
|
1988
|
-
function
|
|
1989
|
-
let t =
|
|
1982
|
+
function Zn(e) {
|
|
1983
|
+
let t = R(""), n = C(() => U(e.columns).some((e) => e.type === "radio"));
|
|
1990
1984
|
function r(n) {
|
|
1991
|
-
return t.value = n ?
|
|
1985
|
+
return t.value = n ? Sn(n, U(e.rowKey)) : "", n;
|
|
1992
1986
|
}
|
|
1993
1987
|
function i() {
|
|
1994
1988
|
t.value = "";
|
|
1995
1989
|
}
|
|
1996
1990
|
function a(n) {
|
|
1997
|
-
t.value =
|
|
1991
|
+
t.value = Sn(n, U(e.rowKey));
|
|
1998
1992
|
}
|
|
1999
1993
|
function o() {
|
|
2000
1994
|
return t.value;
|
|
@@ -2010,16 +2004,16 @@ function nr(e) {
|
|
|
2010
2004
|
}
|
|
2011
2005
|
//#endregion
|
|
2012
2006
|
//#region src/components/k-table/composables/useTableRowSort.ts
|
|
2013
|
-
function
|
|
2007
|
+
function Qn(e) {
|
|
2014
2008
|
let t = null;
|
|
2015
2009
|
function n() {
|
|
2016
2010
|
t?.destroy(), t = null;
|
|
2017
2011
|
}
|
|
2018
2012
|
function r() {
|
|
2019
|
-
if (n(), !
|
|
2013
|
+
if (n(), !U(e.enabled)) return;
|
|
2020
2014
|
let r = e.tableRef.value?.$el?.querySelector(".el-table__body-wrapper tbody");
|
|
2021
|
-
r && (t =
|
|
2022
|
-
disabled:
|
|
2015
|
+
r && (t = Ve.create(r, {
|
|
2016
|
+
disabled: U(e.disabled),
|
|
2023
2017
|
animation: 300,
|
|
2024
2018
|
handle: ".sort-handle",
|
|
2025
2019
|
filter: ".ignore-elements",
|
|
@@ -2027,26 +2021,26 @@ function rr(e) {
|
|
|
2027
2021
|
onEnd: (t) => e.onSortEnd(t)
|
|
2028
2022
|
}));
|
|
2029
2023
|
}
|
|
2030
|
-
return
|
|
2031
|
-
|
|
2032
|
-
|
|
2024
|
+
return K(() => [
|
|
2025
|
+
U(e.enabled),
|
|
2026
|
+
U(e.rebindKey),
|
|
2033
2027
|
e.tableRef.value
|
|
2034
2028
|
], () => {
|
|
2035
|
-
|
|
2036
|
-
}, { flush: "post" }),
|
|
2029
|
+
P(r);
|
|
2030
|
+
}, { flush: "post" }), K(() => U(e.disabled), (e) => {
|
|
2037
2031
|
t && t.option("disabled", e);
|
|
2038
|
-
}),
|
|
2039
|
-
initSortable: () =>
|
|
2032
|
+
}), le(n), {
|
|
2033
|
+
initSortable: () => P(r),
|
|
2040
2034
|
destroySortable: n
|
|
2041
2035
|
};
|
|
2042
2036
|
}
|
|
2043
2037
|
//#endregion
|
|
2044
2038
|
//#region src/components/k-table/composables/useTableTreeLoad.ts
|
|
2045
|
-
function
|
|
2039
|
+
function $n(e) {
|
|
2046
2040
|
let t = /* @__PURE__ */ new Map();
|
|
2047
2041
|
function n(n) {
|
|
2048
2042
|
return (r, i, a) => {
|
|
2049
|
-
let o =
|
|
2043
|
+
let o = Sn(r, U(e.rowKey));
|
|
2050
2044
|
o != null && t.set(o, {
|
|
2051
2045
|
row: r,
|
|
2052
2046
|
treeNode: i,
|
|
@@ -2055,7 +2049,7 @@ function ir(e) {
|
|
|
2055
2049
|
};
|
|
2056
2050
|
}
|
|
2057
2051
|
function r(n) {
|
|
2058
|
-
let r =
|
|
2052
|
+
let r = U(e.load), i = t.get(n);
|
|
2059
2053
|
if (!i || !r) return;
|
|
2060
2054
|
let a = e.tableRef.value?.store?.states?.lazyTreeNodeMap;
|
|
2061
2055
|
a && n != null && (a[String(n)] = []), r(i.row, i.treeNode, i.resolve);
|
|
@@ -2071,33 +2065,33 @@ function ir(e) {
|
|
|
2071
2065
|
}
|
|
2072
2066
|
//#endregion
|
|
2073
2067
|
//#region src/components/k-table/composables/useKTable.ts
|
|
2074
|
-
function
|
|
2075
|
-
let { props: t, emit: n, attrs: r, slots: i, tableRef: a, queryRef: o } = e, s =
|
|
2068
|
+
function er(e) {
|
|
2069
|
+
let { props: t, emit: n, attrs: r, slots: i, tableRef: a, queryRef: o } = e, s = R({}), c = R(0), l = C(() => !!t.action), u = C(() => !!t.query?.form?.formConfigs?.length), d = C(() => !!i.header);
|
|
2076
2070
|
function f(e) {
|
|
2077
2071
|
let n = { ...e };
|
|
2078
2072
|
s.value = t.convertParams ? t.convertParams(n) : n;
|
|
2079
2073
|
}
|
|
2080
2074
|
let p = C(() => {
|
|
2081
|
-
let e =
|
|
2075
|
+
let e = kn(t.columns, t.selectionShow);
|
|
2082
2076
|
return t.disabled && (e = e.filter((e) => e.type !== "operates" && e.prop !== "operates")), e;
|
|
2083
|
-
}), m =
|
|
2077
|
+
}), m = Jn({
|
|
2084
2078
|
columns: () => t.columns,
|
|
2085
2079
|
renderColumns: p,
|
|
2086
2080
|
enableColumnCache: () => t.enableColumnCache,
|
|
2087
2081
|
tableKey: () => t.tableKey,
|
|
2088
2082
|
onDisplayChange: (e) => n("column-display-change", e),
|
|
2089
2083
|
onLayout: () => a.value?.doLayout()
|
|
2090
|
-
}), h =
|
|
2084
|
+
}), h = Zn({
|
|
2091
2085
|
columns: () => t.columns,
|
|
2092
2086
|
rowKey: () => t.rowKey
|
|
2093
|
-
}), g =
|
|
2087
|
+
}), g = $n({
|
|
2094
2088
|
tableRef: a,
|
|
2095
2089
|
rowKey: () => t.rowKey,
|
|
2096
2090
|
load: () => t.load
|
|
2097
|
-
}), _ =
|
|
2091
|
+
}), _ = Xn({
|
|
2098
2092
|
pagination: () => t.pagination,
|
|
2099
2093
|
hasAction: l
|
|
2100
|
-
}), v =
|
|
2094
|
+
}), v = Yn({
|
|
2101
2095
|
action: t.action,
|
|
2102
2096
|
params: () => t.params,
|
|
2103
2097
|
queryParams: s,
|
|
@@ -2105,11 +2099,11 @@ function ar(e) {
|
|
|
2105
2099
|
pagination: _,
|
|
2106
2100
|
initialLoading: !!(t.action && t.initTable),
|
|
2107
2101
|
onDataLoaded: (e, t) => n("data-loaded", e, t)
|
|
2108
|
-
}), y = C(() => t.enableColumnCache ? m.visibleColumns.value : p.value),
|
|
2102
|
+
}), y = C(() => t.enableColumnCache ? m.visibleColumns.value : p.value), b = C(() => y.value.map((e, t) => Q(e, t)).join("|")), ee = C(() => !!(t.addButton || t.selectionShow || d.value || t.enableColumnCache)), te = C(() => l.value ? v.tableData.value : t.data), ne = C(() => t.loading === void 0 ? l.value ? v.loading.value : !1 : t.loading), x = C(() => ne.value || !!(l.value && t.initTable && !v.loaded.value)), S = C(() => {
|
|
2109
2103
|
let e = { ...r };
|
|
2110
2104
|
l.value && "data" in e && delete e.data, t.load && delete e.load;
|
|
2111
2105
|
let n = {
|
|
2112
|
-
data:
|
|
2106
|
+
data: te.value,
|
|
2113
2107
|
rowKey: t.rowKey,
|
|
2114
2108
|
border: !0,
|
|
2115
2109
|
stripe: !0,
|
|
@@ -2121,13 +2115,13 @@ function ar(e) {
|
|
|
2121
2115
|
strategy: "absolute"
|
|
2122
2116
|
}), n;
|
|
2123
2117
|
});
|
|
2124
|
-
|
|
2118
|
+
Qn({
|
|
2125
2119
|
enabled: () => t.sort,
|
|
2126
2120
|
disabled: () => t.disabled,
|
|
2127
2121
|
tableRef: a,
|
|
2128
|
-
rebindKey: () =>
|
|
2122
|
+
rebindKey: () => b.value,
|
|
2129
2123
|
onSortEnd: (e) => {
|
|
2130
|
-
let t = [...
|
|
2124
|
+
let t = [...te.value];
|
|
2131
2125
|
if (e.oldIndex == null || e.newIndex == null) return;
|
|
2132
2126
|
let [r] = t.splice(e.oldIndex, 1);
|
|
2133
2127
|
t.splice(e.newIndex, 0, r), n("sort-end", e, t);
|
|
@@ -2136,7 +2130,7 @@ function ar(e) {
|
|
|
2136
2130
|
function re() {
|
|
2137
2131
|
l.value && v.fetchData();
|
|
2138
2132
|
}
|
|
2139
|
-
|
|
2133
|
+
ue(() => {
|
|
2140
2134
|
!t.initTable || !t.action || (u.value && f(o.value?.getParams() ?? {}), v.fetchData());
|
|
2141
2135
|
});
|
|
2142
2136
|
function w(e) {
|
|
@@ -2152,7 +2146,7 @@ function ar(e) {
|
|
|
2152
2146
|
f(e), _.resetPage(), t.clearCurrentRowOnQuery && E(), n("query", s.value), re();
|
|
2153
2147
|
}
|
|
2154
2148
|
function O() {
|
|
2155
|
-
n("reset"), t.selectionShow &&
|
|
2149
|
+
n("reset"), t.selectionShow && se(), t.clearCurrentRowOnReset && E();
|
|
2156
2150
|
}
|
|
2157
2151
|
function k(e) {
|
|
2158
2152
|
_.setCurrentPage(e), n("page-change", e), re();
|
|
@@ -2166,33 +2160,33 @@ function ar(e) {
|
|
|
2166
2160
|
function ie(e, t, r) {
|
|
2167
2161
|
n("operate-click", e, t, r);
|
|
2168
2162
|
}
|
|
2169
|
-
function
|
|
2163
|
+
function M(e) {
|
|
2170
2164
|
if (!h.hasRadioColumn.value) return;
|
|
2171
2165
|
let t = h.selectRow(e);
|
|
2172
2166
|
t && n("radio-change", t, h.radioSelected.value);
|
|
2173
2167
|
}
|
|
2174
|
-
function
|
|
2175
|
-
|
|
2168
|
+
function ae(e) {
|
|
2169
|
+
M(e);
|
|
2176
2170
|
}
|
|
2177
|
-
function
|
|
2171
|
+
function oe(e, t) {
|
|
2178
2172
|
m.setColumnVisibleByKey(e, t);
|
|
2179
2173
|
}
|
|
2180
|
-
function
|
|
2174
|
+
function N() {
|
|
2181
2175
|
return a.value;
|
|
2182
2176
|
}
|
|
2183
|
-
function
|
|
2177
|
+
function P() {
|
|
2184
2178
|
return o.value;
|
|
2185
2179
|
}
|
|
2186
|
-
function
|
|
2180
|
+
function F() {
|
|
2187
2181
|
return a.value?.getSelectionRows() ?? [];
|
|
2188
2182
|
}
|
|
2189
|
-
function
|
|
2183
|
+
function se() {
|
|
2190
2184
|
a.value?.clearSelection(), c.value = 0;
|
|
2191
2185
|
}
|
|
2192
|
-
function
|
|
2186
|
+
function ce(e, t) {
|
|
2193
2187
|
a.value?.toggleRowSelection(e, t);
|
|
2194
2188
|
}
|
|
2195
|
-
async function
|
|
2189
|
+
async function le(e = !1) {
|
|
2196
2190
|
l.value && await v.refresh(e);
|
|
2197
2191
|
}
|
|
2198
2192
|
function I() {
|
|
@@ -2201,20 +2195,20 @@ function ar(e) {
|
|
|
2201
2195
|
function de(e) {
|
|
2202
2196
|
h.setRadioSelection(e);
|
|
2203
2197
|
}
|
|
2204
|
-
function
|
|
2198
|
+
function L() {
|
|
2205
2199
|
return h.getRadioSelection();
|
|
2206
2200
|
}
|
|
2207
|
-
function
|
|
2201
|
+
function z(e) {
|
|
2208
2202
|
g.refreshTree(e);
|
|
2209
2203
|
}
|
|
2210
2204
|
return {
|
|
2211
2205
|
showQuery: u,
|
|
2212
|
-
showToolbar:
|
|
2206
|
+
showToolbar: ee,
|
|
2213
2207
|
hasHeaderSlot: d,
|
|
2214
2208
|
renderColumns: y,
|
|
2215
2209
|
tableProps: S,
|
|
2216
|
-
tableLoading:
|
|
2217
|
-
showLoadingEmpty:
|
|
2210
|
+
tableLoading: ne,
|
|
2211
|
+
showLoadingEmpty: x,
|
|
2218
2212
|
columnSelectorItems: m.selectorItems,
|
|
2219
2213
|
paginationBind: _.bindProps,
|
|
2220
2214
|
indexOffset: _.indexOffset,
|
|
@@ -2229,23 +2223,23 @@ function ar(e) {
|
|
|
2229
2223
|
handleSizeChange: A,
|
|
2230
2224
|
handleAdd: j,
|
|
2231
2225
|
handleOperateClick: ie,
|
|
2232
|
-
handleRowClick:
|
|
2233
|
-
handleRadioChange:
|
|
2234
|
-
handleColumnVisibleChange:
|
|
2226
|
+
handleRowClick: ae,
|
|
2227
|
+
handleRadioChange: M,
|
|
2228
|
+
handleColumnVisibleChange: oe,
|
|
2235
2229
|
resetColumnDisplay: m.resetColumnDisplay,
|
|
2236
|
-
getTableRef:
|
|
2237
|
-
getQueryRef:
|
|
2238
|
-
getSelection:
|
|
2239
|
-
clearSelection:
|
|
2240
|
-
toggleRowSelection:
|
|
2241
|
-
refresh:
|
|
2230
|
+
getTableRef: N,
|
|
2231
|
+
getQueryRef: P,
|
|
2232
|
+
getSelection: F,
|
|
2233
|
+
clearSelection: se,
|
|
2234
|
+
toggleRowSelection: ce,
|
|
2235
|
+
refresh: le,
|
|
2242
2236
|
clearRadioSelection: I,
|
|
2243
2237
|
setRadioSelection: de,
|
|
2244
|
-
getRadioSelection:
|
|
2245
|
-
refreshTree:
|
|
2238
|
+
getRadioSelection: L,
|
|
2239
|
+
refreshTree: z
|
|
2246
2240
|
};
|
|
2247
2241
|
}
|
|
2248
|
-
var
|
|
2242
|
+
var tr = {
|
|
2249
2243
|
hidePagination: !1,
|
|
2250
2244
|
initTable: !0,
|
|
2251
2245
|
nullValueFormat: "--",
|
|
@@ -2259,14 +2253,14 @@ var or = {
|
|
|
2259
2253
|
sort: !1,
|
|
2260
2254
|
data: () => [],
|
|
2261
2255
|
sortFilter: () => []
|
|
2262
|
-
},
|
|
2256
|
+
}, nr = { class: "k-table__box" }, rr = { class: "k-table" }, ir = {
|
|
2263
2257
|
key: 0,
|
|
2264
2258
|
class: "k-table__loading-empty"
|
|
2265
|
-
},
|
|
2259
|
+
}, ar = { class: "k-table-footer" }, or = /*@__PURE__*/ j({
|
|
2266
2260
|
name: "KTable",
|
|
2267
2261
|
inheritAttrs: !0,
|
|
2268
2262
|
__name: "KTable",
|
|
2269
|
-
props: /*@__PURE__*/
|
|
2263
|
+
props: /*@__PURE__*/ oe({
|
|
2270
2264
|
columns: {},
|
|
2271
2265
|
data: {},
|
|
2272
2266
|
action: { type: Function },
|
|
@@ -2292,7 +2286,7 @@ var or = {
|
|
|
2292
2286
|
sortFilter: {},
|
|
2293
2287
|
load: { type: Function }
|
|
2294
2288
|
}, {
|
|
2295
|
-
...
|
|
2289
|
+
...tr,
|
|
2296
2290
|
data: () => []
|
|
2297
2291
|
}),
|
|
2298
2292
|
emits: [
|
|
@@ -2310,10 +2304,10 @@ var or = {
|
|
|
2310
2304
|
"sort-change"
|
|
2311
2305
|
],
|
|
2312
2306
|
setup(e, { expose: t, emit: n }) {
|
|
2313
|
-
let r = e, i = n, a =
|
|
2307
|
+
let r = e, i = n, a = G(), o = R(), s = R(), c = L(er({
|
|
2314
2308
|
props: r,
|
|
2315
2309
|
emit: i,
|
|
2316
|
-
attrs:
|
|
2310
|
+
attrs: ge(),
|
|
2317
2311
|
slots: a,
|
|
2318
2312
|
tableRef: o,
|
|
2319
2313
|
queryRef: s
|
|
@@ -2338,8 +2332,8 @@ var or = {
|
|
|
2338
2332
|
getRadioSelection: c.getRadioSelection,
|
|
2339
2333
|
refreshTree: c.refreshTree
|
|
2340
2334
|
}), (t, n) => {
|
|
2341
|
-
let r =
|
|
2342
|
-
return I(), E("div",
|
|
2335
|
+
let r = pe("loading");
|
|
2336
|
+
return I(), E("div", nr, [c.showQuery ? (I(), w(W(bn), N({
|
|
2343
2337
|
key: 0,
|
|
2344
2338
|
ref_key: "queryRef",
|
|
2345
2339
|
ref: s,
|
|
@@ -2347,8 +2341,8 @@ var or = {
|
|
|
2347
2341
|
}, e.query, {
|
|
2348
2342
|
onQuery: c.handleQuery,
|
|
2349
2343
|
onReset: c.handleQueryReset
|
|
2350
|
-
}), null, 16, ["onQuery", "onReset"])) : T("", !0), D("div",
|
|
2351
|
-
c.showToolbar ? (I(), w(
|
|
2344
|
+
}), null, 16, ["onQuery", "onReset"])) : T("", !0), D("div", rr, [
|
|
2345
|
+
c.showToolbar ? (I(), w(Wn, {
|
|
2352
2346
|
key: 0,
|
|
2353
2347
|
"add-button": e.addButton,
|
|
2354
2348
|
"selection-show": e.selectionShow,
|
|
@@ -2356,11 +2350,11 @@ var or = {
|
|
|
2356
2350
|
onAdd: c.handleAdd
|
|
2357
2351
|
}, O({ _: 2 }, [c.hasHeaderSlot ? {
|
|
2358
2352
|
name: "header",
|
|
2359
|
-
fn:
|
|
2353
|
+
fn: q(() => [B(t.$slots, "header", {}, void 0, !0)]),
|
|
2360
2354
|
key: "0"
|
|
2361
2355
|
} : void 0, e.enableColumnCache ? {
|
|
2362
2356
|
name: "extra",
|
|
2363
|
-
fn:
|
|
2357
|
+
fn: q(() => [A(Ln, {
|
|
2364
2358
|
items: c.columnSelectorItems,
|
|
2365
2359
|
onChange: c.handleColumnVisibleChange,
|
|
2366
2360
|
onReset: c.resetColumnDisplay
|
|
@@ -2376,7 +2370,7 @@ var or = {
|
|
|
2376
2370
|
"selected-count",
|
|
2377
2371
|
"onAdd"
|
|
2378
2372
|
])) : T("", !0),
|
|
2379
|
-
|
|
2373
|
+
ve((I(), w(W(Ne), N({
|
|
2380
2374
|
ref_key: "tableRef",
|
|
2381
2375
|
ref: o,
|
|
2382
2376
|
class: "k-table__main"
|
|
@@ -2385,23 +2379,23 @@ var or = {
|
|
|
2385
2379
|
onSortChange: c.handleSortChange,
|
|
2386
2380
|
onRowClick: c.handleRowClick
|
|
2387
2381
|
}), {
|
|
2388
|
-
empty:
|
|
2389
|
-
default:
|
|
2382
|
+
empty: q(() => [c.showLoadingEmpty ? ve((I(), E("span", ir, null, 512)), [[r, c.showLoadingEmpty]]) : B(t.$slots, "empty", {}, () => [k(V(t.$attrs.emptyText ?? t.$attrs["empty-text"] ?? "暂无数据"), 1)], !0, 1)]),
|
|
2383
|
+
default: q(() => [e.sort ? (I(), w(W(J), {
|
|
2390
2384
|
key: 0,
|
|
2391
2385
|
label: "拖拽排序",
|
|
2392
2386
|
align: "center",
|
|
2393
2387
|
width: "100"
|
|
2394
2388
|
}, {
|
|
2395
|
-
default:
|
|
2389
|
+
default: q(({ row: n, column: r, $index: i }) => [B(t.$slots, "sort", {
|
|
2396
2390
|
row: n,
|
|
2397
2391
|
column: r,
|
|
2398
2392
|
index: i
|
|
2399
2393
|
}, () => [D("span", {
|
|
2400
|
-
class:
|
|
2394
|
+
class: F(e.sortFilter.includes(i) ? "ignore-elements" : "sort-handle k-table__sort-handle"),
|
|
2401
2395
|
"aria-hidden": "true"
|
|
2402
2396
|
}, "⋮⋮", 2)], !0)]),
|
|
2403
2397
|
_: 3
|
|
2404
|
-
})) : T("", !0), (I(!0), E(S, null,
|
|
2398
|
+
})) : T("", !0), (I(!0), E(S, null, z(c.renderColumns, (n, r) => (I(), w(Nn, {
|
|
2405
2399
|
key: c.getColumnIdentity(n, r),
|
|
2406
2400
|
column: n,
|
|
2407
2401
|
"column-index": r,
|
|
@@ -2412,9 +2406,9 @@ var or = {
|
|
|
2412
2406
|
"radio-selected": c.radioSelected,
|
|
2413
2407
|
onOperateClick: c.handleOperateClick,
|
|
2414
2408
|
onRadioSelect: c.handleRadioChange
|
|
2415
|
-
}, O({ _: 2 }, [
|
|
2409
|
+
}, O({ _: 2 }, [z(l.value, (e) => ({
|
|
2416
2410
|
name: e,
|
|
2417
|
-
fn:
|
|
2411
|
+
fn: q((n) => [B(t.$slots, e, N({ ref_for: !0 }, n ?? {}), void 0, !0)])
|
|
2418
2412
|
}))]), 1032, [
|
|
2419
2413
|
"column",
|
|
2420
2414
|
"column-index",
|
|
@@ -2432,20 +2426,20 @@ var or = {
|
|
|
2432
2426
|
"onSortChange",
|
|
2433
2427
|
"onRowClick"
|
|
2434
2428
|
])), [[r, c.tableLoading]]),
|
|
2435
|
-
D("div",
|
|
2429
|
+
D("div", ar, [e.hidePagination ? T("", !0) : (I(), w(W(It), N({
|
|
2436
2430
|
key: 0,
|
|
2437
2431
|
class: "pagination"
|
|
2438
2432
|
}, c.paginationBind, {
|
|
2439
2433
|
onCurrentChange: c.handlePageChange,
|
|
2440
2434
|
onSizeChange: c.handleSizeChange
|
|
2441
|
-
}), null, 16, ["onCurrentChange", "onSizeChange"])),
|
|
2435
|
+
}), null, 16, ["onCurrentChange", "onSizeChange"])), B(t.$slots, "footer", {}, void 0, !0)])
|
|
2442
2436
|
])]);
|
|
2443
2437
|
};
|
|
2444
2438
|
}
|
|
2445
|
-
}),
|
|
2439
|
+
}), sr = /*#__PURE__*/ _(or, [["__scopeId", "data-v-ccb6f7c6"]]);
|
|
2446
2440
|
//#endregion
|
|
2447
2441
|
//#region src/components/k-table/dictOptions.ts
|
|
2448
|
-
function
|
|
2442
|
+
function cr(e) {
|
|
2449
2443
|
return e.map((e) => ({
|
|
2450
2444
|
value: String(e.item_key ?? ""),
|
|
2451
2445
|
label: String(e.item_value ?? e.item_key ?? "")
|
|
@@ -2453,7 +2447,7 @@ function pr(e) {
|
|
|
2453
2447
|
}
|
|
2454
2448
|
//#endregion
|
|
2455
2449
|
//#region src/components/k-table/utils/mergeQueryConfig.ts
|
|
2456
|
-
function
|
|
2450
|
+
function lr(e, t) {
|
|
2457
2451
|
return e.map((e) => {
|
|
2458
2452
|
let n = t[e.id];
|
|
2459
2453
|
return n ? {
|
|
@@ -2465,36 +2459,36 @@ function mr(e, t) {
|
|
|
2465
2459
|
} : e;
|
|
2466
2460
|
});
|
|
2467
2461
|
}
|
|
2468
|
-
function
|
|
2462
|
+
function ur(e, t) {
|
|
2469
2463
|
let n = e.form;
|
|
2470
2464
|
return n ? {
|
|
2471
2465
|
...e,
|
|
2472
2466
|
form: {
|
|
2473
2467
|
...n,
|
|
2474
|
-
formConfigs:
|
|
2468
|
+
formConfigs: lr(n.formConfigs ?? [], t)
|
|
2475
2469
|
}
|
|
2476
2470
|
} : e;
|
|
2477
2471
|
}
|
|
2478
|
-
function
|
|
2472
|
+
function dr(e, t) {
|
|
2479
2473
|
return e.query ? {
|
|
2480
2474
|
...e,
|
|
2481
|
-
query:
|
|
2475
|
+
query: ur(e.query, t)
|
|
2482
2476
|
} : e;
|
|
2483
2477
|
}
|
|
2484
2478
|
//#endregion
|
|
2485
2479
|
//#region src/components/k-table/composables/useKTableTemplateRef.ts
|
|
2486
|
-
function
|
|
2487
|
-
return
|
|
2480
|
+
function fr(e) {
|
|
2481
|
+
return _e(e);
|
|
2488
2482
|
}
|
|
2489
2483
|
//#endregion
|
|
2490
2484
|
//#region src/components/k-table/composables/useKTableCrossPageSelection.ts
|
|
2491
|
-
function
|
|
2492
|
-
let t =
|
|
2485
|
+
function pr(e) {
|
|
2486
|
+
let t = he([]), n = he([]), r = he(!1), i = fr(e.tableRefKey ?? "tableRef");
|
|
2493
2487
|
function a() {
|
|
2494
|
-
return e.tableRef == null ? i.value :
|
|
2488
|
+
return e.tableRef == null ? i.value : U(e.tableRef);
|
|
2495
2489
|
}
|
|
2496
2490
|
function o(t) {
|
|
2497
|
-
return String(
|
|
2491
|
+
return String(Sn(t, U(e.rowKey)));
|
|
2498
2492
|
}
|
|
2499
2493
|
function s(e) {
|
|
2500
2494
|
t.value = [...e];
|
|
@@ -2508,16 +2502,16 @@ function vr(e) {
|
|
|
2508
2502
|
function u(i) {
|
|
2509
2503
|
n.value = i;
|
|
2510
2504
|
let s = new Set(t.value.map(o));
|
|
2511
|
-
if (
|
|
2505
|
+
if (U(e.mode) === "single") {
|
|
2512
2506
|
let e = i.find((e) => s.has(o(e)));
|
|
2513
2507
|
e && a()?.setRadioSelection(e);
|
|
2514
2508
|
return;
|
|
2515
2509
|
}
|
|
2516
|
-
r.value = !0,
|
|
2510
|
+
r.value = !0, P(async () => {
|
|
2517
2511
|
let e = a();
|
|
2518
2512
|
i.forEach((t) => {
|
|
2519
2513
|
s.has(o(t)) && e?.toggleRowSelection(t, !0);
|
|
2520
|
-
}), await
|
|
2514
|
+
}), await P(), r.value = !1;
|
|
2521
2515
|
});
|
|
2522
2516
|
}
|
|
2523
2517
|
function d(e) {
|
|
@@ -2542,7 +2536,7 @@ function vr(e) {
|
|
|
2542
2536
|
}
|
|
2543
2537
|
//#endregion
|
|
2544
2538
|
//#region src/components/k-table/report/convertDownloadCol.ts
|
|
2545
|
-
function
|
|
2539
|
+
function mr(e) {
|
|
2546
2540
|
return e.filter((e) => e.type !== "expand").map((e) => ({
|
|
2547
2541
|
sTitle: e.label ?? "",
|
|
2548
2542
|
mDataProp: e.prop ?? "",
|
|
@@ -2552,44 +2546,44 @@ function yr(e) {
|
|
|
2552
2546
|
}
|
|
2553
2547
|
//#endregion
|
|
2554
2548
|
//#region src/components/k-table/report/pickExportColumns.ts
|
|
2555
|
-
function
|
|
2549
|
+
function hr(e, t) {
|
|
2556
2550
|
let n = e;
|
|
2557
2551
|
return t?.excludeLast && (n = n.slice(0, -1)), t?.excludeOperates && (n = n.filter((e) => e.type !== "operates" && e.prop !== "operates")), n.filter((e) => e.type !== "expand" && e.type !== "index" && e.type !== "selection" && e.type !== "radio");
|
|
2558
2552
|
}
|
|
2559
2553
|
//#endregion
|
|
2560
2554
|
//#region src/components/k-table/report/exportKTableReport.ts
|
|
2561
|
-
function
|
|
2562
|
-
let t = e.tableRef.value?.getQueryRef()?.getParams() ?? {}, n = e.convertParams ? e.convertParams(t) : t, r =
|
|
2555
|
+
function gr(e) {
|
|
2556
|
+
let t = e.tableRef.value?.getQueryRef()?.getParams() ?? {}, n = e.convertParams ? e.convertParams(t) : t, r = hr(e.columns, e);
|
|
2563
2557
|
return e.exportApi({
|
|
2564
|
-
globColumnlist:
|
|
2558
|
+
globColumnlist: mr(r),
|
|
2565
2559
|
jsondata: n
|
|
2566
2560
|
});
|
|
2567
2561
|
}
|
|
2568
|
-
function
|
|
2569
|
-
let t =
|
|
2562
|
+
function _r(e) {
|
|
2563
|
+
let t = hr(e.columns, e);
|
|
2570
2564
|
return e.exportApi({
|
|
2571
|
-
globColumnlist:
|
|
2565
|
+
globColumnlist: mr(t),
|
|
2572
2566
|
jsondata: e.jsondata
|
|
2573
2567
|
});
|
|
2574
2568
|
}
|
|
2575
2569
|
//#endregion
|
|
2576
2570
|
//#region src/components/k-table/report/useExportKTableReport.ts
|
|
2577
|
-
function
|
|
2578
|
-
let t =
|
|
2571
|
+
function vr(e) {
|
|
2572
|
+
let t = R(!1);
|
|
2579
2573
|
async function n() {
|
|
2580
2574
|
if (!t.value) {
|
|
2581
2575
|
t.value = !0;
|
|
2582
2576
|
try {
|
|
2583
|
-
await
|
|
2577
|
+
await gr({
|
|
2584
2578
|
tableRef: e.tableRef,
|
|
2585
|
-
columns:
|
|
2579
|
+
columns: U(e.columns),
|
|
2586
2580
|
exportApi: e.exportApi,
|
|
2587
2581
|
convertParams: e.convertParams,
|
|
2588
|
-
excludeOperates:
|
|
2589
|
-
excludeLast:
|
|
2582
|
+
excludeOperates: U(e.excludeOperates),
|
|
2583
|
+
excludeLast: U(e.excludeLast)
|
|
2590
2584
|
});
|
|
2591
2585
|
} catch {
|
|
2592
|
-
|
|
2586
|
+
ke.error("导出失败");
|
|
2593
2587
|
} finally {
|
|
2594
2588
|
t.value = !1;
|
|
2595
2589
|
}
|
|
@@ -2602,7 +2596,7 @@ function Cr(e) {
|
|
|
2602
2596
|
}
|
|
2603
2597
|
//#endregion
|
|
2604
2598
|
//#region src/components/k-upload/utils/uploadFileValue.ts
|
|
2605
|
-
function
|
|
2599
|
+
function yr(e, t, n = {}) {
|
|
2606
2600
|
let r = `${s(n.listType ?? "text")}${e}`;
|
|
2607
2601
|
return [{
|
|
2608
2602
|
uid: e,
|
|
@@ -2613,10 +2607,10 @@ function wr(e, t, n = {}) {
|
|
|
2613
2607
|
url: r
|
|
2614
2608
|
}];
|
|
2615
2609
|
}
|
|
2616
|
-
function
|
|
2617
|
-
return Array.isArray(e) ? e : typeof e != "string" || !e ? [] :
|
|
2610
|
+
function br(e, t = {}) {
|
|
2611
|
+
return Array.isArray(e) ? e : typeof e != "string" || !e ? [] : yr(e, t.fileName ?? e, { listType: t.listType });
|
|
2618
2612
|
}
|
|
2619
|
-
function
|
|
2613
|
+
function xr(e, t = {}) {
|
|
2620
2614
|
if (typeof e == "string") return e ? {
|
|
2621
2615
|
resource_id: e,
|
|
2622
2616
|
file_name: t.fileName
|
|
@@ -2630,8 +2624,8 @@ function Er(e, t = {}) {
|
|
|
2630
2624
|
imp_count: n.imp_count
|
|
2631
2625
|
};
|
|
2632
2626
|
}
|
|
2633
|
-
function
|
|
2634
|
-
let n =
|
|
2627
|
+
function Sr(e, t = {}) {
|
|
2628
|
+
let n = xr(e, t);
|
|
2635
2629
|
return {
|
|
2636
2630
|
resource_id: n?.resource_id ?? "",
|
|
2637
2631
|
file_name: n?.file_name ?? t.fileName ?? "",
|
|
@@ -2639,84 +2633,84 @@ function Dr(e, t = {}) {
|
|
|
2639
2633
|
imp_count: n?.imp_count
|
|
2640
2634
|
};
|
|
2641
2635
|
}
|
|
2642
|
-
function
|
|
2636
|
+
function Cr(e) {
|
|
2643
2637
|
return !!(e.resource_id || e.imp_id);
|
|
2644
2638
|
}
|
|
2645
2639
|
//#endregion
|
|
2646
2640
|
//#region src/components/index.ts
|
|
2647
|
-
var
|
|
2641
|
+
var wr = /* @__PURE__ */ Ue({
|
|
2648
2642
|
DICT_KEY: () => l,
|
|
2649
|
-
KAffix: () =>
|
|
2650
|
-
KBreadcrumb: () =>
|
|
2643
|
+
KAffix: () => Tr,
|
|
2644
|
+
KBreadcrumb: () => Er,
|
|
2651
2645
|
KButton: () => e,
|
|
2652
|
-
KCard: () =>
|
|
2653
|
-
KCascader: () =>
|
|
2646
|
+
KCard: () => on,
|
|
2647
|
+
KCascader: () => Dr,
|
|
2654
2648
|
KCheckbox: () => g,
|
|
2655
|
-
KColorPicker: () =>
|
|
2649
|
+
KColorPicker: () => Or,
|
|
2656
2650
|
KDatePicker: () => c,
|
|
2657
2651
|
KDialog: () => o,
|
|
2658
2652
|
KDialogHeader: () => a,
|
|
2659
|
-
KForm: () =>
|
|
2660
|
-
KHandlePage: () =>
|
|
2661
|
-
KIcon: () =>
|
|
2653
|
+
KForm: () => dt,
|
|
2654
|
+
KHandlePage: () => St,
|
|
2655
|
+
KIcon: () => jt,
|
|
2662
2656
|
KInput: () => n,
|
|
2663
|
-
KLinkButton: () =>
|
|
2664
|
-
KLongPage: () =>
|
|
2665
|
-
KPagination: () =>
|
|
2666
|
-
KPanel: () =>
|
|
2667
|
-
KPanelQuery: () =>
|
|
2657
|
+
KLinkButton: () => Ft,
|
|
2658
|
+
KLongPage: () => an,
|
|
2659
|
+
KPagination: () => It,
|
|
2660
|
+
KPanel: () => un,
|
|
2661
|
+
KPanelQuery: () => bn,
|
|
2668
2662
|
KRadio: () => d,
|
|
2669
2663
|
KSelect: () => m,
|
|
2670
|
-
KTable: () =>
|
|
2664
|
+
KTable: () => sr,
|
|
2671
2665
|
KTimePicker: () => t,
|
|
2672
2666
|
KUpload: () => p,
|
|
2673
|
-
countEditorHtmlWords: () =>
|
|
2674
|
-
countEditorWords: () =>
|
|
2675
|
-
createUploadFileItem: () =>
|
|
2676
|
-
exportKTableReport: () =>
|
|
2677
|
-
exportKTableReportData: () =>
|
|
2678
|
-
getAllLucideKebabNames: () =>
|
|
2679
|
-
getEditorHtml: () =>
|
|
2667
|
+
countEditorHtmlWords: () => te,
|
|
2668
|
+
countEditorWords: () => ne,
|
|
2669
|
+
createUploadFileItem: () => yr,
|
|
2670
|
+
exportKTableReport: () => gr,
|
|
2671
|
+
exportKTableReportData: () => _r,
|
|
2672
|
+
getAllLucideKebabNames: () => At,
|
|
2673
|
+
getEditorHtml: () => b,
|
|
2680
2674
|
getEditorWordCount: () => v,
|
|
2681
|
-
getUploadConfig: () =>
|
|
2682
|
-
hasUploadSubmitFields: () =>
|
|
2683
|
-
mapGroupDictToOptions: () =>
|
|
2684
|
-
pascalToKebab: () =>
|
|
2675
|
+
getUploadConfig: () => x,
|
|
2676
|
+
hasUploadSubmitFields: () => Cr,
|
|
2677
|
+
mapGroupDictToOptions: () => cr,
|
|
2678
|
+
pascalToKebab: () => Et,
|
|
2685
2679
|
registerFormComponents: () => h,
|
|
2686
|
-
resolveLucideIcon: () =>
|
|
2687
|
-
toKEditorValue: () =>
|
|
2688
|
-
toLucidePascalName: () =>
|
|
2689
|
-
toUploadFiles: () =>
|
|
2690
|
-
toUploadSubmitFields: () =>
|
|
2680
|
+
resolveLucideIcon: () => Dt,
|
|
2681
|
+
toKEditorValue: () => ee,
|
|
2682
|
+
toLucidePascalName: () => Tt,
|
|
2683
|
+
toUploadFiles: () => br,
|
|
2684
|
+
toUploadSubmitFields: () => Sr,
|
|
2691
2685
|
updateUploadConfig: () => y,
|
|
2692
|
-
useExportKTableReport: () =>
|
|
2693
|
-
useHandlePageInit: () =>
|
|
2694
|
-
useKFormTemplateRef: () =>
|
|
2695
|
-
useKTableCrossPageSelection: () =>
|
|
2696
|
-
useKTableTemplateRef: () =>
|
|
2697
|
-
withQueryFieldOptions: () =>
|
|
2698
|
-
}),
|
|
2699
|
-
function
|
|
2700
|
-
let e = document.documentElement.getAttribute(
|
|
2686
|
+
useExportKTableReport: () => vr,
|
|
2687
|
+
useHandlePageInit: () => Ct,
|
|
2688
|
+
useKFormTemplateRef: () => ft,
|
|
2689
|
+
useKTableCrossPageSelection: () => pr,
|
|
2690
|
+
useKTableTemplateRef: () => fr,
|
|
2691
|
+
withQueryFieldOptions: () => dr
|
|
2692
|
+
}), Tr = We("KAffix"), Er = We("KBreadcrumb"), Dr = We("KCascader"), Or = We("KColorPicker"), kr = "data-theme", Ar = "kayak-design-theme";
|
|
2693
|
+
function jr() {
|
|
2694
|
+
let e = document.documentElement.getAttribute(kr);
|
|
2701
2695
|
return e === "blue-pro" || e === "dark" ? e : "kayak";
|
|
2702
2696
|
}
|
|
2703
|
-
function
|
|
2704
|
-
document.documentElement.setAttribute(
|
|
2697
|
+
function Mr(e) {
|
|
2698
|
+
document.documentElement.setAttribute(kr, e);
|
|
2705
2699
|
try {
|
|
2706
|
-
localStorage.setItem(
|
|
2700
|
+
localStorage.setItem(Ar, e);
|
|
2707
2701
|
} catch {}
|
|
2708
2702
|
}
|
|
2709
|
-
function
|
|
2703
|
+
function Nr() {
|
|
2710
2704
|
let e = "kayak";
|
|
2711
2705
|
try {
|
|
2712
|
-
let t = localStorage.getItem(
|
|
2706
|
+
let t = localStorage.getItem(Ar);
|
|
2713
2707
|
(t === "kayak" || t === "blue-pro" || t === "dark") && (e = t);
|
|
2714
2708
|
} catch {}
|
|
2715
|
-
|
|
2709
|
+
Mr(e);
|
|
2716
2710
|
}
|
|
2717
2711
|
//#endregion
|
|
2718
2712
|
//#region src/utils/validators.ts
|
|
2719
|
-
var
|
|
2713
|
+
var Pr = /^1[3-9]\d{9}$/, Fr = /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/, Ir = /^\d{1,20}$/, Lr = /^(https?:\/\/).+/i, Rr = /^[1-9]\d*$/, zr = /^(0|[1-9][0-9]*)$/, Br = /^(|[1-9][0-9]*)$/, Vr = /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/, Hr = /(^[0-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
|
|
2720
2714
|
function $(e, t, n = !1) {
|
|
2721
2715
|
return (r, i, a) => {
|
|
2722
2716
|
if (!n && (i === "" || i == null)) {
|
|
@@ -2730,10 +2724,10 @@ function $(e, t, n = !1) {
|
|
|
2730
2724
|
a();
|
|
2731
2725
|
};
|
|
2732
2726
|
}
|
|
2733
|
-
function
|
|
2727
|
+
function Ur(e) {
|
|
2734
2728
|
return RegExp(`^(?!00.*)(\\d{0,${e}}(\\.\\d{1,2})?)$`);
|
|
2735
2729
|
}
|
|
2736
|
-
function
|
|
2730
|
+
function Wr(e, t, n = !0) {
|
|
2737
2731
|
return {
|
|
2738
2732
|
required: n,
|
|
2739
2733
|
validator: (r, i, a) => {
|
|
@@ -2750,69 +2744,69 @@ function Yr(e, t, n = !0) {
|
|
|
2750
2744
|
trigger: "change"
|
|
2751
2745
|
};
|
|
2752
2746
|
}
|
|
2753
|
-
function
|
|
2747
|
+
function Gr(e, t, n = !0) {
|
|
2754
2748
|
return {
|
|
2755
2749
|
validator: $(RegExp(`^([\\u4e00-\\u9fa5]|\\w*|\\W*){1,${e}}$`), `请输入正确的${t}`, n),
|
|
2756
2750
|
trigger: "change"
|
|
2757
2751
|
};
|
|
2758
2752
|
}
|
|
2759
|
-
function
|
|
2753
|
+
function Kr(e, t, n = !0) {
|
|
2760
2754
|
return {
|
|
2761
2755
|
validator: $(RegExp(`^\\w{1,${e}}$`), `请输入正确的${t}`, n),
|
|
2762
2756
|
trigger: "change"
|
|
2763
2757
|
};
|
|
2764
2758
|
}
|
|
2765
|
-
function
|
|
2759
|
+
function qr(e = "请输入11位手机号") {
|
|
2766
2760
|
return {
|
|
2767
|
-
validator: $(
|
|
2761
|
+
validator: $(Pr, e, !0),
|
|
2768
2762
|
trigger: "change"
|
|
2769
2763
|
};
|
|
2770
2764
|
}
|
|
2771
|
-
function
|
|
2765
|
+
function Jr(e = "请输入正确的统一社会信用代码") {
|
|
2772
2766
|
return {
|
|
2773
|
-
validator: $(
|
|
2767
|
+
validator: $(Fr, e, !0),
|
|
2774
2768
|
trigger: "change"
|
|
2775
2769
|
};
|
|
2776
2770
|
}
|
|
2777
|
-
function
|
|
2771
|
+
function Yr(e = "请输入正确的打款账号") {
|
|
2778
2772
|
return {
|
|
2779
|
-
validator: $(
|
|
2773
|
+
validator: $(Ir, e, !0),
|
|
2780
2774
|
trigger: "change"
|
|
2781
2775
|
};
|
|
2782
2776
|
}
|
|
2783
|
-
function
|
|
2777
|
+
function Xr(e = "请输入正确的链接地址", t = !1) {
|
|
2784
2778
|
return {
|
|
2785
|
-
validator: $(
|
|
2779
|
+
validator: $(Lr, e, t),
|
|
2786
2780
|
trigger: "change"
|
|
2787
2781
|
};
|
|
2788
2782
|
}
|
|
2789
|
-
function
|
|
2783
|
+
function Zr(e = "请输入正确的数字", t = !1) {
|
|
2790
2784
|
return {
|
|
2791
|
-
validator: $(
|
|
2785
|
+
validator: $(Rr, e, t),
|
|
2792
2786
|
trigger: "change"
|
|
2793
2787
|
};
|
|
2794
2788
|
}
|
|
2795
|
-
function
|
|
2789
|
+
function Qr(e) {
|
|
2796
2790
|
return {
|
|
2797
|
-
validator: $(
|
|
2791
|
+
validator: $(zr, e, !1),
|
|
2798
2792
|
trigger: "change"
|
|
2799
2793
|
};
|
|
2800
2794
|
}
|
|
2801
|
-
function
|
|
2795
|
+
function $r(e) {
|
|
2802
2796
|
return {
|
|
2803
|
-
validator: $(
|
|
2797
|
+
validator: $(Br, e, !1),
|
|
2804
2798
|
trigger: "change"
|
|
2805
2799
|
};
|
|
2806
2800
|
}
|
|
2807
|
-
function
|
|
2801
|
+
function ei(e = !0) {
|
|
2808
2802
|
return {
|
|
2809
2803
|
required: e,
|
|
2810
|
-
validator: $(
|
|
2804
|
+
validator: $(Vr, "请输入正确格式的证件号码", !0),
|
|
2811
2805
|
trigger: "change"
|
|
2812
2806
|
};
|
|
2813
2807
|
}
|
|
2814
|
-
function
|
|
2815
|
-
let { required: n = !0, maxInt: r = 11 } = t, i =
|
|
2808
|
+
function ti(e, t = {}) {
|
|
2809
|
+
let { required: n = !0, maxInt: r = 11 } = t, i = Ur(r);
|
|
2816
2810
|
return [{
|
|
2817
2811
|
required: n,
|
|
2818
2812
|
message: `请输入${e}`
|
|
@@ -2831,7 +2825,7 @@ function oi(e, t = {}) {
|
|
|
2831
2825
|
trigger: "change"
|
|
2832
2826
|
}];
|
|
2833
2827
|
}
|
|
2834
|
-
function
|
|
2828
|
+
function ni(e, t) {
|
|
2835
2829
|
if (t === "number") {
|
|
2836
2830
|
let t = Number(e);
|
|
2837
2831
|
return Number.isFinite(t) ? t : null;
|
|
@@ -2847,7 +2841,7 @@ function si(e, t) {
|
|
|
2847
2841
|
let n = Date.parse(String(e));
|
|
2848
2842
|
return Number.isFinite(n) ? n : null;
|
|
2849
2843
|
}
|
|
2850
|
-
function
|
|
2844
|
+
function ri(e, t, n) {
|
|
2851
2845
|
let { op: r, message: i, skipEmpty: a = !0, type: o = "number" } = n;
|
|
2852
2846
|
return {
|
|
2853
2847
|
validator: (n, s, c) => {
|
|
@@ -2855,7 +2849,7 @@ function ci(e, t, n) {
|
|
|
2855
2849
|
c();
|
|
2856
2850
|
return;
|
|
2857
2851
|
}
|
|
2858
|
-
let l =
|
|
2852
|
+
let l = ni(e, o), u = ni(t, o);
|
|
2859
2853
|
if (l == null || u == null) {
|
|
2860
2854
|
c();
|
|
2861
2855
|
return;
|
|
@@ -2867,10 +2861,10 @@ function ci(e, t, n) {
|
|
|
2867
2861
|
}
|
|
2868
2862
|
//#endregion
|
|
2869
2863
|
//#region src/index.ts
|
|
2870
|
-
function
|
|
2871
|
-
Object.entries(
|
|
2864
|
+
function ii(e) {
|
|
2865
|
+
Object.entries(wr).forEach(([t, n]) => {
|
|
2872
2866
|
e.component(t, n);
|
|
2873
2867
|
});
|
|
2874
2868
|
}
|
|
2875
2869
|
//#endregion
|
|
2876
|
-
export {
|
|
2870
|
+
export { Ir as BANK_ACCOUNT_PATTERN, Hr as DECIMAL_MONEY_PATTERN, l as DICT_KEY, Lr as HTTP_URL_PATTERN, Vr as ID_CODE_PATTERN, Tr as KAffix, Er as KBreadcrumb, e as KButton, on as KCard, Dr as KCascader, g as KCheckbox, Or as KColorPicker, c as KDatePicker, o as KDialog, a as KDialogHeader, dt as KForm, St as KHandlePage, jt as KIcon, n as KInput, Ft as KLinkButton, an as KLongPage, It as KPagination, un as KPanel, bn as KPanelQuery, d as KRadio, m as KSelect, sr as KTable, t as KTimePicker, p as KUpload, zr as NON_NEGATIVE_INT_PATTERN, Br as OPTIONAL_NON_NEGATIVE_INT_PATTERN, Pr as PHONE_PATTERN, Rr as POSITIVE_INT_PATTERN, Fr as USC_CODE_PATTERN, Kr as alphaNumCodeRule, Yr as bankAccountRule, Wr as cnAlphaNumRule, ri as compareRule, te as countEditorHtmlWords, ne as countEditorWords, $ as createPatternValidator, yr as createUploadFileItem, gr as exportKTableReport, _r as exportKTableReportData, At as getAllLucideKebabNames, jr as getDesignTheme, b as getEditorHtml, v as getEditorWordCount, x as getUploadConfig, Cr as hasUploadSubmitFields, Xr as httpUrlRule, ei as idCodeRule, Nr as initDesignTheme, ht as mapFieldVisibility, cr as mapGroupDictToOptions, Gr as mixedNameRule, ti as moneyRule, Qr as nonNegativeIntRule, $r as optionalNonNegativeIntRule, Et as pascalToKebab, qr as phoneRule, Zr as positiveIntRule, h as registerFormComponents, Dt as resolveLucideIcon, pt as resolveSchemaField, Mr as setDesignTheme, ii as setupDesign, ee as toKEditorValue, Tt as toLucidePascalName, br as toUploadFiles, Sr as toUploadSubmitFields, y as updateUploadConfig, Jr as uscCodeRule, vr as useExportKTableReport, mt as useFormSchema, Ct as useHandlePageInit, ft as useKFormTemplateRef, pr as useKTableCrossPageSelection, fr as useKTableTemplateRef, dr as withQueryFieldOptions };
|