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