@lumal/core 0.0.5-beta → 0.0.6-beta
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/CHANGELOG.md +9 -0
- package/README.md +13 -0
- package/dist/components-DFOgL7dc.cjs +2 -0
- package/dist/{components-Bk7eEpWu.js → components-DOLh1veJ.js} +498 -477
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/core.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/{layout-zJLDCf1c.cjs → layout-7oFqNDTu.cjs} +1 -1
- package/dist/{layout-DQzFKvly.js → layout-CUlVQXlG.js} +101 -96
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/request.cjs +1 -1
- package/dist/request.js +110 -84
- package/dist/src/components/crud-table/LumalCrudTable.vue.d.ts.map +1 -1
- package/dist/src/components/crud-table/types.d.ts +3 -3
- package/dist/src/components/crud-table/types.d.ts.map +1 -1
- package/dist/src/components/schema-table/LumalSchemaTable.vue.d.ts.map +1 -1
- package/dist/src/components/schema-table/cell.d.ts.map +1 -1
- package/dist/src/components/schema-table/index.d.ts +1 -1
- package/dist/src/components/schema-table/index.d.ts.map +1 -1
- package/dist/src/components/schema-table/normalize.d.ts.map +1 -1
- package/dist/src/components/schema-table/types.d.ts +12 -3
- package/dist/src/components/schema-table/types.d.ts.map +1 -1
- package/dist/src/exports/components.d.ts +1 -1
- package/dist/src/exports/components.d.ts.map +1 -1
- package/dist/src/layout/LumalLayout.vue.d.ts +4 -4
- package/dist/src/layout/LumalLayout.vue.d.ts.map +1 -1
- package/dist/src/request/client.d.ts.map +1 -1
- package/dist/src/request/types.d.ts +2 -2
- package/dist/src/request/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/theme-chalk/index.scss +0 -4
- package/dist/components-CxUJo-ux.cjs +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { f as e, i as t, p as n } from "./composables-BxZG0_RZ.js";
|
|
2
2
|
import { t as r } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
3
|
-
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, openBlock as C, reactive as
|
|
4
|
-
import { LumalIcon as
|
|
5
|
-
import { ElButton as R, ElCheckbox as
|
|
3
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, openBlock as C, reactive as ee, renderList as w, renderSlot as T, shallowRef as E, toDisplayString as D, toRaw as te, unref as O, useModel as k, useSlots as A, useTemplateRef as j, vShow as M, watch as N, withCtx as P, withDirectives as ne, withKeys as F, withModifiers as re } from "vue";
|
|
4
|
+
import { LumalIcon as I, LumalIcon as L, LumalIconPicker as ie, LumalIconPickerDialog as ae } from "@lumal/icons-vue";
|
|
5
|
+
import { ElButton as R, ElCheckbox as oe, ElCheckboxGroup as z, ElCol as se, ElDatePicker as B, ElDialog as V, ElDrawer as H, ElForm as ce, ElFormItem as le, ElInput as ue, ElInputNumber as de, ElLoading as fe, ElMessageBox as pe, ElOption as me, ElPagination as he, ElPopover as ge, ElRadio as _e, ElRadioGroup as ve, ElRow as ye, ElSelect as be, ElSwitch as xe, ElTable as Se, ElTableColumn as Ce, ElTreeSelect as we, ElUpload as Te } from "element-plus";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/components/pagination/LumalPagination.vue
|
|
8
|
-
var
|
|
8
|
+
var Ee = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
9
9
|
__name: "LumalPagination",
|
|
10
10
|
props: /*@__PURE__*/ h({
|
|
11
11
|
total: {},
|
|
@@ -27,7 +27,7 @@ var De = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
|
27
27
|
}),
|
|
28
28
|
emits: /*@__PURE__*/ h(["change"], ["update:page", "update:pageSize"]),
|
|
29
29
|
setup(e, { expose: t, emit: n }) {
|
|
30
|
-
let r = e, i = n, s =
|
|
30
|
+
let r = e, i = n, s = k(e, "page"), c = k(e, "pageSize"), l = j("paginationRef"), u = a(() => Math.max(1, Math.ceil(r.total / c.value)));
|
|
31
31
|
function d(e, t) {
|
|
32
32
|
i("change", {
|
|
33
33
|
page: e,
|
|
@@ -45,7 +45,7 @@ var De = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
|
45
45
|
return t({
|
|
46
46
|
getPaginationElement: () => l.value?.$el,
|
|
47
47
|
getPaginationInstance: () => l.value
|
|
48
|
-
}), (t, n) => (C(), o(
|
|
48
|
+
}), (t, n) => (C(), o(O(he), {
|
|
49
49
|
ref_key: "paginationRef",
|
|
50
50
|
ref: l,
|
|
51
51
|
class: "lumal-pagination",
|
|
@@ -69,19 +69,19 @@ var De = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
|
69
69
|
}), [["__scopeId", "data-v-d546f46b"]]);
|
|
70
70
|
//#endregion
|
|
71
71
|
//#region src/components/schema-form/normalize.ts
|
|
72
|
-
function
|
|
72
|
+
function De(e) {
|
|
73
73
|
return `lumal-schema-form-${e.replace(/[^\w-]/g, "-")}`;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function U(e, t) {
|
|
76
76
|
return typeof e == "function" ? !!e(t) : !!e;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function W(e, t, n) {
|
|
79
79
|
return typeof e == "function" ? e(t) : e ?? n;
|
|
80
80
|
}
|
|
81
81
|
function Oe(e, t) {
|
|
82
82
|
return !e.authority || t.canAccess?.(e.authority) !== !1;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function G(e = [], t = {}) {
|
|
85
85
|
let n = t.model ?? {};
|
|
86
86
|
return e.filter((e) => e.field.trim()).map((e) => {
|
|
87
87
|
let r = {
|
|
@@ -91,39 +91,39 @@ function W(e = [], t = {}) {
|
|
|
91
91
|
model: n,
|
|
92
92
|
setFieldValue: t.setFieldValue ?? (() => void 0),
|
|
93
93
|
value: n[e.field]
|
|
94
|
-
}, i = e.component ?? (e.dictionary || e.dictType ? "select" : "input"), a =
|
|
94
|
+
}, i = e.component ?? (e.dictionary || e.dictType ? "select" : "input"), a = U(e.hidden, r), o = U(e.disabled, r), s = e.readonlyAuthority ? t.canAccess?.(e.readonlyAuthority) === !1 : !1, c = r.mode === "view" || s || U(e.readonly, r), l = !a && i !== "hidden" && Oe(e, t), u = W(e.componentProps, r, {}), d = typeof e.options == "function" ? e.options(r) : O(e.options);
|
|
95
95
|
return {
|
|
96
96
|
...e,
|
|
97
|
-
id:
|
|
97
|
+
id: De(e.field),
|
|
98
98
|
component: i,
|
|
99
99
|
componentProps: { ...u },
|
|
100
|
-
description:
|
|
100
|
+
description: W(e.description, r, ""),
|
|
101
101
|
disabled: o,
|
|
102
|
-
help:
|
|
102
|
+
help: W(e.help, r, ""),
|
|
103
103
|
options: d ?? [],
|
|
104
|
-
required:
|
|
104
|
+
required: U(e.required, r),
|
|
105
105
|
readonly: c,
|
|
106
106
|
renderable: l,
|
|
107
|
-
visible: e.visible === void 0 ||
|
|
108
|
-
rules:
|
|
107
|
+
visible: e.visible === void 0 || U(e.visible, r),
|
|
108
|
+
rules: W(e.rules, r, [])
|
|
109
109
|
};
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function K(e, t = {}) {
|
|
113
113
|
return e.reduce((e, t) => (!(t.field in e) && t.defaultValue !== void 0 && (e[t.field] = t.defaultValue), e), { ...t });
|
|
114
114
|
}
|
|
115
115
|
//#endregion
|
|
116
116
|
//#region src/components/schema-form/LumalSchemaForm.vue?vue&type=script&setup=true&lang.ts
|
|
117
|
-
var
|
|
117
|
+
var ke = {
|
|
118
118
|
key: 0,
|
|
119
119
|
class: "lumal-schema-form__readonly-value"
|
|
120
|
-
},
|
|
120
|
+
}, q = {
|
|
121
121
|
key: 0,
|
|
122
122
|
class: "lumal-schema-form__description"
|
|
123
|
-
},
|
|
123
|
+
}, Ae = {
|
|
124
124
|
key: 1,
|
|
125
125
|
class: "lumal-schema-form__help"
|
|
126
|
-
},
|
|
126
|
+
}, J = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
127
127
|
__name: "LumalSchemaForm",
|
|
128
128
|
props: /*@__PURE__*/ h({
|
|
129
129
|
canAccess: {},
|
|
@@ -183,24 +183,24 @@ var K = {
|
|
|
183
183
|
"valuesChange"
|
|
184
184
|
], ["update:modelValue"]),
|
|
185
185
|
setup(e, { expose: n, emit: r }) {
|
|
186
|
-
let l = e, p = r, m =
|
|
186
|
+
let l = e, p = r, m = k(e, "modelValue"), h = j("formRef"), _ = fe.directive, y = E(l.mode);
|
|
187
187
|
N(() => l.mode, (e) => {
|
|
188
188
|
y.value = e;
|
|
189
189
|
});
|
|
190
|
-
let b =
|
|
190
|
+
let b = E({ ...m.value }), x = ee(K(G(l.schemas, {
|
|
191
191
|
canAccess: l.canAccess,
|
|
192
192
|
mode: y.value,
|
|
193
193
|
model: m.value,
|
|
194
194
|
setFieldValue: Me
|
|
195
|
-
}), m.value)), S = a(() => x),
|
|
196
|
-
function
|
|
197
|
-
|
|
195
|
+
}), m.value)), S = a(() => x), te = E([]);
|
|
196
|
+
function A() {
|
|
197
|
+
te.value = l.schemas.map((e) => a(() => G([e], {
|
|
198
198
|
canAccess: l.canAccess,
|
|
199
199
|
mode: y.value,
|
|
200
200
|
model: x,
|
|
201
201
|
setFieldValue: Me
|
|
202
202
|
})[0]));
|
|
203
|
-
let e = G(
|
|
203
|
+
let e = K(G(l.schemas, {
|
|
204
204
|
canAccess: l.canAccess,
|
|
205
205
|
mode: y.value,
|
|
206
206
|
model: x,
|
|
@@ -210,61 +210,61 @@ var K = {
|
|
|
210
210
|
Object.hasOwn(x, t) || (x[t] = e[t]);
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
|
-
N(() => l.schemas,
|
|
213
|
+
N(() => l.schemas, A, {
|
|
214
214
|
deep: !0,
|
|
215
215
|
immediate: !0
|
|
216
216
|
});
|
|
217
|
-
let I = a(() =>
|
|
218
|
-
function
|
|
217
|
+
let I = a(() => te.value.map((e) => e.value).filter((e) => !!e)), L = a(() => I.value.filter((e) => e.renderable));
|
|
218
|
+
function ie(e) {
|
|
219
219
|
let t = x, n = e;
|
|
220
220
|
Object.keys(t).forEach((e) => {
|
|
221
221
|
Object.hasOwn(n, e) || delete t[e];
|
|
222
222
|
}), Object.assign(t, n);
|
|
223
223
|
}
|
|
224
|
-
N(() => m.value,
|
|
225
|
-
let { dictionaryMap:
|
|
226
|
-
function
|
|
224
|
+
N(() => m.value, ie, { deep: !0 });
|
|
225
|
+
let { dictionaryMap: ae } = t(() => I.value.map((e) => e.dictionary ?? e.dictType));
|
|
226
|
+
function V(e) {
|
|
227
227
|
let t = S.value[e];
|
|
228
228
|
return typeof t == "number" || typeof t == "string" ? t : t == null ? "" : String(t);
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function H(e) {
|
|
231
231
|
let t = S.value[e];
|
|
232
232
|
return Array.isArray(t) ? t.filter((e) => typeof e == "boolean" || typeof e == "number" || typeof e == "string") : typeof t == "boolean" || typeof t == "number" || typeof t == "string" ? t : "";
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
let t =
|
|
234
|
+
function pe(e) {
|
|
235
|
+
let t = H(e);
|
|
236
236
|
return Array.isArray(t) ? t[0] ?? "" : t;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function he(e) {
|
|
239
239
|
let t = S.value[e];
|
|
240
240
|
if (typeof t == "number") return t;
|
|
241
241
|
if (typeof t == "string" && t.trim()) return Number(t);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function ge(e) {
|
|
244
244
|
return !!S.value[e];
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function Se(e) {
|
|
247
247
|
let t = S.value[e];
|
|
248
248
|
return Array.isArray(t) ? t.filter((e) => typeof e == "number" || typeof e == "string") : [];
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Ce(e) {
|
|
251
251
|
let t = S.value[e];
|
|
252
252
|
if (t instanceof Date || typeof t == "number" || typeof t == "string" || Array.isArray(t) && t.every((e) => e instanceof Date || typeof e == "number" || typeof e == "string")) return t;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Ee(e) {
|
|
255
255
|
return e.component === "datetime" ? "datetime" : e.component === "daterange" ? "daterange" : "date";
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function De(e) {
|
|
258
258
|
let t = S.value[e];
|
|
259
259
|
if (typeof t == "boolean" || typeof t == "number" || typeof t == "string" || t && typeof t == "object") return t;
|
|
260
260
|
}
|
|
261
261
|
function U(e) {
|
|
262
262
|
return String(e.componentProps.type ?? "text");
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function W(e) {
|
|
265
265
|
return e.component === "daterange" ? [`${e.id}-start`, `${e.id}-end`] : e.id;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function Oe(e) {
|
|
268
268
|
return e.component === "daterange" ? [`${e.field}-start`, `${e.field}-end`] : e.field;
|
|
269
269
|
}
|
|
270
270
|
function J(e) {
|
|
@@ -275,7 +275,7 @@ var K = {
|
|
|
275
275
|
}
|
|
276
276
|
function X(e) {
|
|
277
277
|
let t = e.dictionary ?? e.dictType;
|
|
278
|
-
return t ?
|
|
278
|
+
return t ? ae.value[t] ?? [] : e.options;
|
|
279
279
|
}
|
|
280
280
|
function Z(e) {
|
|
281
281
|
return e.componentProps;
|
|
@@ -327,7 +327,7 @@ var K = {
|
|
|
327
327
|
...x,
|
|
328
328
|
...e
|
|
329
329
|
};
|
|
330
|
-
|
|
330
|
+
ie(t), m.value = t;
|
|
331
331
|
}
|
|
332
332
|
function Be(e) {
|
|
333
333
|
y.value = e;
|
|
@@ -345,8 +345,8 @@ var K = {
|
|
|
345
345
|
}
|
|
346
346
|
function He() {
|
|
347
347
|
h.value?.resetFields?.();
|
|
348
|
-
let e =
|
|
349
|
-
|
|
348
|
+
let e = K(I.value, b.value);
|
|
349
|
+
ie(e), m.value = e;
|
|
350
350
|
}
|
|
351
351
|
function Ue(e) {
|
|
352
352
|
h.value?.clearValidate?.(e);
|
|
@@ -369,7 +369,7 @@ var K = {
|
|
|
369
369
|
setMode: Be,
|
|
370
370
|
setValues: ze,
|
|
371
371
|
validate: Ve
|
|
372
|
-
}), (t, n) =>
|
|
372
|
+
}), (t, n) => ne((C(), o(O(ce), {
|
|
373
373
|
ref_key: "formRef",
|
|
374
374
|
ref: h,
|
|
375
375
|
novalidate: "",
|
|
@@ -378,20 +378,20 @@ var K = {
|
|
|
378
378
|
"label-position": l.labelPosition,
|
|
379
379
|
"label-width": l.labelWidth,
|
|
380
380
|
model: S.value,
|
|
381
|
-
onKeydown:
|
|
382
|
-
onSubmit:
|
|
381
|
+
onKeydown: F(Pe, ["enter"]),
|
|
382
|
+
onSubmit: re(Ne, ["prevent"])
|
|
383
383
|
}, {
|
|
384
|
-
default: P(() => [f(
|
|
384
|
+
default: P(() => [f(O(ye), {
|
|
385
385
|
class: "lumal-schema-form__row",
|
|
386
386
|
gutter: l.gutter,
|
|
387
387
|
"data-columns": l.columns
|
|
388
388
|
}, {
|
|
389
|
-
default: P(() => [(C(!0), c(i, null,
|
|
389
|
+
default: P(() => [(C(!0), c(i, null, w(L.value, (e) => ne((C(), o(O(se), {
|
|
390
390
|
key: e.field,
|
|
391
391
|
span: Y(e),
|
|
392
392
|
class: v({ "is-full-span": Y(e) === 24 })
|
|
393
393
|
}, {
|
|
394
|
-
default: P(() => [f(
|
|
394
|
+
default: P(() => [f(O(le), {
|
|
395
395
|
class: "lumal-schema-form__item",
|
|
396
396
|
label: e.label,
|
|
397
397
|
prop: e.field,
|
|
@@ -400,21 +400,21 @@ var K = {
|
|
|
400
400
|
"data-field": e.field
|
|
401
401
|
}, {
|
|
402
402
|
default: P(() => [
|
|
403
|
-
|
|
403
|
+
T(t.$slots, Le(e), {
|
|
404
404
|
model: S.value,
|
|
405
405
|
schema: e,
|
|
406
406
|
value: S.value[e.field]
|
|
407
407
|
}, void 0, !0),
|
|
408
|
-
|
|
408
|
+
T(t.$slots, Ie(e), {
|
|
409
409
|
model: S.value,
|
|
410
410
|
schema: e,
|
|
411
411
|
value: S.value[e.field]
|
|
412
|
-
}, () => [y.value === "view" ? (C(), c("span",
|
|
412
|
+
}, () => [y.value === "view" ? (C(), c("span", ke, D(Q(e)), 1)) : e.component === "textarea" ? (C(), o(O(ue), g({
|
|
413
413
|
key: 1,
|
|
414
414
|
ref_for: !0
|
|
415
415
|
}, Z(e), {
|
|
416
416
|
id: e.id,
|
|
417
|
-
"model-value":
|
|
417
|
+
"model-value": V(e.field),
|
|
418
418
|
name: e.field,
|
|
419
419
|
placeholder: e.placeholder,
|
|
420
420
|
disabled: J(e),
|
|
@@ -429,19 +429,19 @@ var K = {
|
|
|
429
429
|
"disabled",
|
|
430
430
|
"required",
|
|
431
431
|
"onUpdate:modelValue"
|
|
432
|
-
])) : e.component === "select" ? (C(), o(
|
|
432
|
+
])) : e.component === "select" ? (C(), o(O(be), g({
|
|
433
433
|
key: 2,
|
|
434
434
|
ref_for: !0
|
|
435
435
|
}, Z(e), {
|
|
436
436
|
id: e.id,
|
|
437
|
-
"model-value":
|
|
437
|
+
"model-value": H(e.field),
|
|
438
438
|
name: e.field,
|
|
439
439
|
placeholder: e.placeholder,
|
|
440
440
|
disabled: J(e),
|
|
441
441
|
required: e.required,
|
|
442
442
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
443
443
|
}), {
|
|
444
|
-
default: P(() => [(C(!0), c(i, null,
|
|
444
|
+
default: P(() => [(C(!0), c(i, null, w(X(e), (e) => (C(), o(O(me), {
|
|
445
445
|
key: String(e.value),
|
|
446
446
|
label: e.label,
|
|
447
447
|
value: e.value,
|
|
@@ -460,23 +460,23 @@ var K = {
|
|
|
460
460
|
"disabled",
|
|
461
461
|
"required",
|
|
462
462
|
"onUpdate:modelValue"
|
|
463
|
-
])) : e.component === "number" ? (C(), o(
|
|
463
|
+
])) : e.component === "number" ? (C(), o(O(de), g({
|
|
464
464
|
key: 3,
|
|
465
465
|
ref_for: !0
|
|
466
466
|
}, Z(e), {
|
|
467
467
|
id: e.id,
|
|
468
|
-
"model-value":
|
|
468
|
+
"model-value": he(e.field),
|
|
469
469
|
name: e.field,
|
|
470
470
|
placeholder: e.placeholder,
|
|
471
471
|
disabled: J(e),
|
|
472
472
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
473
473
|
}), u({ _: 2 }, [e.prefix ? {
|
|
474
474
|
name: "prefix",
|
|
475
|
-
fn: P(() => [d(
|
|
475
|
+
fn: P(() => [d(D(e.prefix), 1)]),
|
|
476
476
|
key: "0"
|
|
477
477
|
} : void 0, e.suffix ? {
|
|
478
478
|
name: "suffix",
|
|
479
|
-
fn: P(() => [d(
|
|
479
|
+
fn: P(() => [d(D(e.suffix), 1)]),
|
|
480
480
|
key: "1"
|
|
481
481
|
} : void 0]), 1040, [
|
|
482
482
|
"id",
|
|
@@ -485,11 +485,11 @@ var K = {
|
|
|
485
485
|
"placeholder",
|
|
486
486
|
"disabled",
|
|
487
487
|
"onUpdate:modelValue"
|
|
488
|
-
])) : e.component === "switch" ? (C(), o(
|
|
488
|
+
])) : e.component === "switch" ? (C(), o(O(xe), g({
|
|
489
489
|
key: 4,
|
|
490
490
|
ref_for: !0
|
|
491
491
|
}, Z(e), {
|
|
492
|
-
"model-value":
|
|
492
|
+
"model-value": ge(e.field),
|
|
493
493
|
name: e.field,
|
|
494
494
|
disabled: J(e),
|
|
495
495
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
@@ -498,16 +498,16 @@ var K = {
|
|
|
498
498
|
"name",
|
|
499
499
|
"disabled",
|
|
500
500
|
"onUpdate:modelValue"
|
|
501
|
-
])) : e.component === "date" || e.component === "datetime" || e.component === "daterange" ? (C(), o(
|
|
501
|
+
])) : e.component === "date" || e.component === "datetime" || e.component === "daterange" ? (C(), o(O(B), g({
|
|
502
502
|
key: 5,
|
|
503
503
|
ref_for: !0
|
|
504
504
|
}, Z(e), {
|
|
505
|
-
id:
|
|
506
|
-
"model-value":
|
|
507
|
-
name:
|
|
505
|
+
id: W(e),
|
|
506
|
+
"model-value": Ce(e.field),
|
|
507
|
+
name: Oe(e),
|
|
508
508
|
placeholder: e.placeholder,
|
|
509
509
|
disabled: J(e),
|
|
510
|
-
type:
|
|
510
|
+
type: Ee(e),
|
|
511
511
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
512
512
|
}), null, 16, [
|
|
513
513
|
"id",
|
|
@@ -517,21 +517,21 @@ var K = {
|
|
|
517
517
|
"disabled",
|
|
518
518
|
"type",
|
|
519
519
|
"onUpdate:modelValue"
|
|
520
|
-
])) : e.component === "radio" ? (C(), o(
|
|
520
|
+
])) : e.component === "radio" ? (C(), o(O(ve), g({
|
|
521
521
|
key: 6,
|
|
522
522
|
ref_for: !0
|
|
523
523
|
}, Z(e), {
|
|
524
|
-
"model-value":
|
|
524
|
+
"model-value": pe(e.field),
|
|
525
525
|
name: e.field,
|
|
526
526
|
disabled: J(e),
|
|
527
527
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
528
528
|
}), {
|
|
529
|
-
default: P(() => [(C(!0), c(i, null,
|
|
529
|
+
default: P(() => [(C(!0), c(i, null, w(X(e), (e) => (C(), o(O(_e), {
|
|
530
530
|
key: String(e.value),
|
|
531
531
|
value: e.value,
|
|
532
532
|
disabled: e.disabled
|
|
533
533
|
}, {
|
|
534
|
-
default: P(() => [d(
|
|
534
|
+
default: P(() => [d(D(e.label), 1)]),
|
|
535
535
|
_: 2
|
|
536
536
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
537
537
|
_: 2
|
|
@@ -540,21 +540,21 @@ var K = {
|
|
|
540
540
|
"name",
|
|
541
541
|
"disabled",
|
|
542
542
|
"onUpdate:modelValue"
|
|
543
|
-
])) : e.component === "checkbox" ? (C(), o(
|
|
543
|
+
])) : e.component === "checkbox" ? (C(), o(O(z), g({
|
|
544
544
|
key: 7,
|
|
545
545
|
ref_for: !0
|
|
546
546
|
}, Z(e), {
|
|
547
|
-
"model-value":
|
|
547
|
+
"model-value": Se(e.field),
|
|
548
548
|
name: e.field,
|
|
549
549
|
disabled: J(e),
|
|
550
550
|
"onUpdate:modelValue": (t) => $(e.field, t)
|
|
551
551
|
}), {
|
|
552
|
-
default: P(() => [(C(!0), c(i, null,
|
|
552
|
+
default: P(() => [(C(!0), c(i, null, w(X(e), (e) => (C(), o(O(oe), {
|
|
553
553
|
key: String(e.value),
|
|
554
554
|
value: e.value,
|
|
555
555
|
disabled: e.disabled
|
|
556
556
|
}, {
|
|
557
|
-
default: P(() => [d(
|
|
557
|
+
default: P(() => [d(D(e.label), 1)]),
|
|
558
558
|
_: 2
|
|
559
559
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
560
560
|
_: 2
|
|
@@ -563,12 +563,12 @@ var K = {
|
|
|
563
563
|
"name",
|
|
564
564
|
"disabled",
|
|
565
565
|
"onUpdate:modelValue"
|
|
566
|
-
])) : e.component === "tree-select" ? (C(), o(
|
|
566
|
+
])) : e.component === "tree-select" ? (C(), o(O(we), g({
|
|
567
567
|
key: 8,
|
|
568
568
|
ref_for: !0
|
|
569
569
|
}, Z(e), {
|
|
570
570
|
id: e.id,
|
|
571
|
-
"model-value":
|
|
571
|
+
"model-value": De(e.field),
|
|
572
572
|
name: e.field,
|
|
573
573
|
placeholder: e.placeholder,
|
|
574
574
|
disabled: J(e),
|
|
@@ -580,21 +580,21 @@ var K = {
|
|
|
580
580
|
"placeholder",
|
|
581
581
|
"disabled",
|
|
582
582
|
"onUpdate:modelValue"
|
|
583
|
-
])) : e.component === "upload" ? (C(), o(
|
|
583
|
+
])) : e.component === "upload" ? (C(), o(O(Te), g({
|
|
584
584
|
key: 9,
|
|
585
585
|
ref_for: !0
|
|
586
586
|
}, Z(e), { disabled: J(e) }), {
|
|
587
|
-
default: P(() => [f(
|
|
587
|
+
default: P(() => [f(O(R), { type: "primary" }, {
|
|
588
588
|
default: P(() => [...n[0] ||= [d(" 上传 ", -1)]]),
|
|
589
589
|
_: 1
|
|
590
590
|
})]),
|
|
591
591
|
_: 1
|
|
592
|
-
}, 16, ["disabled"])) : (C(), o(
|
|
592
|
+
}, 16, ["disabled"])) : (C(), o(O(ue), g({
|
|
593
593
|
key: 10,
|
|
594
594
|
ref_for: !0
|
|
595
595
|
}, Z(e), {
|
|
596
596
|
id: e.id,
|
|
597
|
-
"model-value":
|
|
597
|
+
"model-value": V(e.field),
|
|
598
598
|
name: e.field,
|
|
599
599
|
type: U(e),
|
|
600
600
|
placeholder: e.placeholder,
|
|
@@ -604,22 +604,22 @@ var K = {
|
|
|
604
604
|
}), u({ _: 2 }, [
|
|
605
605
|
e.prepend ? {
|
|
606
606
|
name: "prepend",
|
|
607
|
-
fn: P(() => [d(
|
|
607
|
+
fn: P(() => [d(D(e.prepend), 1)]),
|
|
608
608
|
key: "0"
|
|
609
609
|
} : void 0,
|
|
610
610
|
e.append ? {
|
|
611
611
|
name: "append",
|
|
612
|
-
fn: P(() => [d(
|
|
612
|
+
fn: P(() => [d(D(e.append), 1)]),
|
|
613
613
|
key: "1"
|
|
614
614
|
} : void 0,
|
|
615
615
|
e.prefix ? {
|
|
616
616
|
name: "prefix",
|
|
617
|
-
fn: P(() => [d(
|
|
617
|
+
fn: P(() => [d(D(e.prefix), 1)]),
|
|
618
618
|
key: "2"
|
|
619
619
|
} : void 0,
|
|
620
620
|
e.suffix ? {
|
|
621
621
|
name: "suffix",
|
|
622
|
-
fn: P(() => [d(
|
|
622
|
+
fn: P(() => [d(D(e.suffix), 1)]),
|
|
623
623
|
key: "3"
|
|
624
624
|
} : void 0
|
|
625
625
|
]), 1040, [
|
|
@@ -632,13 +632,13 @@ var K = {
|
|
|
632
632
|
"required",
|
|
633
633
|
"onUpdate:modelValue"
|
|
634
634
|
]))], !0),
|
|
635
|
-
|
|
635
|
+
T(t.$slots, Re(e), {
|
|
636
636
|
model: S.value,
|
|
637
637
|
schema: e,
|
|
638
638
|
value: S.value[e.field]
|
|
639
639
|
}, void 0, !0),
|
|
640
|
-
e.description ? (C(), c("p",
|
|
641
|
-
e.help ? (C(), c("p",
|
|
640
|
+
e.description ? (C(), c("p", q, D(e.description), 1)) : s("", !0),
|
|
641
|
+
e.help ? (C(), c("p", Ae, D(e.help), 1)) : s("", !0)
|
|
642
642
|
]),
|
|
643
643
|
_: 2
|
|
644
644
|
}, 1032, [
|
|
@@ -654,21 +654,21 @@ var K = {
|
|
|
654
654
|
}, 8, ["gutter", "data-columns"]), e.showActions && y.value !== "view" ? (C(), c("div", {
|
|
655
655
|
key: 0,
|
|
656
656
|
class: v(["lumal-schema-form__actions", [`is-${e.actionLayout}`, `is-${e.actionPosition}`]])
|
|
657
|
-
}, [e.showReset ? (C(), o(
|
|
657
|
+
}, [e.showReset ? (C(), o(O(R), {
|
|
658
658
|
key: 0,
|
|
659
659
|
"native-type": "button",
|
|
660
660
|
disabled: e.submitLoading,
|
|
661
661
|
onClick: Fe
|
|
662
662
|
}, {
|
|
663
|
-
default: P(() => [d(
|
|
663
|
+
default: P(() => [d(D(e.resetText), 1)]),
|
|
664
664
|
_: 1
|
|
665
|
-
}, 8, ["disabled"])) : s("", !0), f(
|
|
665
|
+
}, 8, ["disabled"])) : s("", !0), f(O(R), {
|
|
666
666
|
type: "primary",
|
|
667
667
|
"native-type": "submit",
|
|
668
668
|
loading: e.submitLoading,
|
|
669
669
|
disabled: e.submitLoading || e.submitDisabled
|
|
670
670
|
}, {
|
|
671
|
-
default: P(() => [d(
|
|
671
|
+
default: P(() => [d(D(e.submitText), 1)]),
|
|
672
672
|
_: 1
|
|
673
673
|
}, 8, ["loading", "disabled"])], 2)) : s("", !0)]),
|
|
674
674
|
_: 3
|
|
@@ -678,15 +678,15 @@ var K = {
|
|
|
678
678
|
"label-position",
|
|
679
679
|
"label-width",
|
|
680
680
|
"model"
|
|
681
|
-
])), [[
|
|
681
|
+
])), [[O(_), l.loading]]);
|
|
682
682
|
}
|
|
683
683
|
}), [["__scopeId", "data-v-06645e2b"]]);
|
|
684
684
|
//#endregion
|
|
685
685
|
//#region src/components/schema-table/cell.ts
|
|
686
|
-
function
|
|
686
|
+
function Y(e) {
|
|
687
687
|
return e == null || typeof e == "boolean" || typeof e == "number" || typeof e == "string" || Array.isArray(e) && e.every((e) => typeof e == "boolean" || typeof e == "number" || typeof e == "string");
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function X(t, n, r = e(t)) {
|
|
690
690
|
let i = (Array.isArray(n) ? n : [n]).map((e, t) => {
|
|
691
691
|
let n = r.get(String(e));
|
|
692
692
|
return {
|
|
@@ -697,7 +697,11 @@ function Y(t, n, r = e(t)) {
|
|
|
697
697
|
});
|
|
698
698
|
return i.some((e) => e.color) ? i : [];
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function Z(e, t, r, i = [], a) {
|
|
701
|
+
if (t.type === "index") return {
|
|
702
|
+
tags: [],
|
|
703
|
+
text: String(r + 1)
|
|
704
|
+
};
|
|
701
705
|
let o = e[t.field], s = t.formatter?.(o, e, r) ?? o;
|
|
702
706
|
return s == null || s === "" || Array.isArray(s) && s.length === 0 ? {
|
|
703
707
|
tags: [],
|
|
@@ -705,8 +709,8 @@ function X(e, t, r, i = [], a) {
|
|
|
705
709
|
} : t.formatter ? {
|
|
706
710
|
tags: [],
|
|
707
711
|
text: String(s)
|
|
708
|
-
} : i.length > 0 &&
|
|
709
|
-
tags:
|
|
712
|
+
} : i.length > 0 && Y(s) ? {
|
|
713
|
+
tags: X(i, s, a),
|
|
710
714
|
text: n(i, s, a)
|
|
711
715
|
} : {
|
|
712
716
|
tags: [],
|
|
@@ -715,101 +719,101 @@ function X(e, t, r, i = [], a) {
|
|
|
715
719
|
}
|
|
716
720
|
//#endregion
|
|
717
721
|
//#region src/components/schema-table/LumalSchemaTableCell.vue?vue&type=script&setup=true&lang.ts
|
|
718
|
-
var
|
|
722
|
+
var Q = {
|
|
719
723
|
key: 0,
|
|
720
724
|
class: "lumal-schema-table__dictionary-tags"
|
|
721
|
-
},
|
|
725
|
+
}, je = {
|
|
722
726
|
key: 0,
|
|
723
727
|
class: "lumal-schema-table__dictionary-dot",
|
|
724
728
|
"aria-hidden": "true"
|
|
725
|
-
},
|
|
729
|
+
}, Me = { key: 1 }, $ = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
726
730
|
__name: "LumalSchemaTableCell",
|
|
727
731
|
props: { display: {} },
|
|
728
732
|
setup(e) {
|
|
729
733
|
function t(e) {
|
|
730
734
|
return e.color ? { "--lumal-dictionary-color": e.color } : void 0;
|
|
731
735
|
}
|
|
732
|
-
return (n, r) => e.display.tags.length ? (C(), c("div",
|
|
736
|
+
return (n, r) => e.display.tags.length ? (C(), c("div", Q, [(C(!0), c(i, null, w(e.display.tags, (e) => (C(), c("span", {
|
|
733
737
|
key: e.key,
|
|
734
738
|
class: "lumal-schema-table__dictionary-tag",
|
|
735
739
|
style: b(t(e))
|
|
736
|
-
}, [e.color ? (C(), c("span",
|
|
740
|
+
}, [e.color ? (C(), c("span", je)) : s("", !0), l("span", null, D(e.label), 1)], 4))), 128))])) : (C(), c("span", Me, D(e.display.text), 1));
|
|
737
741
|
}
|
|
738
742
|
}), [["__scopeId", "data-v-1569bd9d"]]);
|
|
739
743
|
//#endregion
|
|
740
744
|
//#region src/components/schema-table/normalize.ts
|
|
741
|
-
function
|
|
745
|
+
function Ne(e, t) {
|
|
742
746
|
return typeof e == "function" ? !!e(t) : !!e;
|
|
743
747
|
}
|
|
744
|
-
function
|
|
748
|
+
function Pe(e, t) {
|
|
745
749
|
return !e.authority || t.canAccess?.(e.authority) !== !1;
|
|
746
750
|
}
|
|
747
|
-
function
|
|
751
|
+
function Fe(e = [], t = {}) {
|
|
748
752
|
let n = { rows: t.rows ?? [] };
|
|
749
|
-
return e.map((e) => ({
|
|
753
|
+
return e.map((e, t) => ({
|
|
750
754
|
...e,
|
|
751
|
-
field: e.field
|
|
755
|
+
field: e.type === "index" ? `__lumal_index__${t}` : e.field?.trim()
|
|
752
756
|
})).filter((e) => e.field).map((e) => ({
|
|
753
757
|
...e,
|
|
754
758
|
align: e.align ?? "left",
|
|
755
759
|
componentProps: e.componentProps ?? {},
|
|
756
760
|
emptyText: e.emptyText ?? "-",
|
|
757
|
-
renderable: (typeof e.hidden == "function" ||
|
|
761
|
+
renderable: (typeof e.hidden == "function" || !Ne(e.hidden, n)) && Pe(e, t)
|
|
758
762
|
}));
|
|
759
763
|
}
|
|
760
764
|
//#endregion
|
|
761
765
|
//#region src/components/schema-table/LumalSchemaTable.vue?vue&type=script&setup=true&lang.ts
|
|
762
|
-
var
|
|
766
|
+
var Ie = {
|
|
763
767
|
key: 0,
|
|
764
768
|
class: "lumal-schema-table__toolbar"
|
|
765
|
-
},
|
|
769
|
+
}, Le = {
|
|
766
770
|
key: 0,
|
|
767
771
|
class: "lumal-schema-table__toolbar-title"
|
|
768
|
-
},
|
|
772
|
+
}, Re = {
|
|
769
773
|
key: 1,
|
|
770
774
|
class: "lumal-schema-table__toolbar-content"
|
|
771
|
-
},
|
|
775
|
+
}, ze = {
|
|
772
776
|
key: 2,
|
|
773
777
|
class: "lumal-schema-table__toolbar-tools"
|
|
774
|
-
},
|
|
778
|
+
}, Be = {
|
|
775
779
|
key: 0,
|
|
776
780
|
class: "lumal-schema-table__column-settings"
|
|
777
|
-
},
|
|
781
|
+
}, Ve = {
|
|
778
782
|
class: "lumal-schema-table__column-settings-trigger",
|
|
779
783
|
"aria-label": "列设置",
|
|
780
784
|
title: "列设置"
|
|
781
|
-
},
|
|
785
|
+
}, He = { class: "lumal-schema-table__column-options" }, Ue = [
|
|
782
786
|
"draggable",
|
|
783
787
|
"onDragstart",
|
|
784
788
|
"onDrop"
|
|
785
|
-
],
|
|
789
|
+
], We = {
|
|
786
790
|
key: 0,
|
|
787
791
|
class: "lumal-schema-table__column-order-actions"
|
|
788
|
-
},
|
|
792
|
+
}, Ge = [
|
|
789
793
|
"disabled",
|
|
790
794
|
"aria-label",
|
|
791
795
|
"title",
|
|
792
796
|
"onClick"
|
|
793
|
-
],
|
|
797
|
+
], Ke = [
|
|
794
798
|
"disabled",
|
|
795
799
|
"aria-label",
|
|
796
800
|
"title",
|
|
797
801
|
"onClick"
|
|
798
|
-
],
|
|
802
|
+
], qe = {
|
|
799
803
|
key: 1,
|
|
800
804
|
class: "lumal-schema-table__error",
|
|
801
805
|
role: "alert"
|
|
802
|
-
},
|
|
806
|
+
}, Je = {
|
|
803
807
|
key: 2,
|
|
804
808
|
class: "lumal-schema-table__scroll"
|
|
805
|
-
},
|
|
809
|
+
}, Ye = { class: "lumal-schema-table__actions lumal-schema-table__actions--desktop" }, Xe = [
|
|
806
810
|
"aria-expanded",
|
|
807
811
|
"onClick",
|
|
808
812
|
"onKeydown"
|
|
809
|
-
],
|
|
813
|
+
], Ze = {
|
|
810
814
|
key: 3,
|
|
811
815
|
class: "lumal-schema-table__pagination"
|
|
812
|
-
},
|
|
816
|
+
}, Qe = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
813
817
|
__name: "LumalSchemaTable",
|
|
814
818
|
props: /*@__PURE__*/ h({
|
|
815
819
|
actionLabel: { default: "操作" },
|
|
@@ -898,280 +902,291 @@ var Fe = {
|
|
|
898
902
|
"selectionChange",
|
|
899
903
|
"sortChange"
|
|
900
904
|
], ["update:page", "update:pageSize"]),
|
|
901
|
-
setup(n, { expose: r, emit:
|
|
902
|
-
let
|
|
903
|
-
let e =
|
|
904
|
-
if (e.length === 0) return
|
|
905
|
+
setup(n, { expose: r, emit: p }) {
|
|
906
|
+
let m = n, h = p, v = k(n, "page"), y = k(n, "pageSize"), b = fe.directive, ee = j("containerRef"), A = j("tableRef"), M = E(/* @__PURE__ */ new Set()), L = E([]), ie = E([]), ae = E([]), R = E(typeof window < "u" && window.innerWidth <= 768), z = E(null), se, B, V = "", H = a(() => Fe(m.columns, { canAccess: m.canAccess })), ce = a(() => {
|
|
907
|
+
let e = L.value;
|
|
908
|
+
if (e.length === 0) return H.value;
|
|
905
909
|
let t = new Map(e.map((e, t) => [e, t]));
|
|
906
|
-
return [...
|
|
907
|
-
}), le = a(() =>
|
|
908
|
-
let n =
|
|
910
|
+
return [...H.value].sort((e, n) => (t.get(String(e.field)) ?? 2 ** 53 - 1) - (t.get(String(n.field)) ?? 2 ** 53 - 1));
|
|
911
|
+
}), le = a(() => ce.value.filter((e) => e.renderable && !M.value.has(String(e.field)))), ue = a(() => ce.value.filter((e) => e.renderable && !e.fixed && e.configurable !== !1)), de = a(() => [...le.value].reverse().find((e) => !e.fixed)?.field), { dictionaryMap: pe } = t(() => H.value.filter((e) => e.type !== "index").map((e) => e.dictionary ?? e.dictType)), me = a(() => new Map(H.value.map((t) => {
|
|
912
|
+
let n = q(t);
|
|
909
913
|
return [String(t.field), e(n)];
|
|
910
|
-
}))), he = a(() => new Map(
|
|
911
|
-
if (typeof
|
|
912
|
-
let e =
|
|
914
|
+
}))), he = a(() => new Map(m.rows.map((e, t) => [e, t]))), _e = a(() => {
|
|
915
|
+
if (typeof m.rowKey != "function") return m.rowKey;
|
|
916
|
+
let e = m.rowKey, t = he.value;
|
|
913
917
|
return (n) => String(e(n, t.get(n) ?? -1));
|
|
914
|
-
}), ve = a(() =>
|
|
918
|
+
}), ve = a(() => m.pagination && m.total > 0), ye = a(() => m.showColumnSettings || m.columnSettings?.enabled), be = a(() => R.value ? m.mobileActionWidth : m.actionWidth), xe = a(() => m.error instanceof Error ? m.error.message || m.errorText : typeof m.error == "string" ? m.error : m.errorText), we = a(() => m.defaultExpandAll ?? !!m.tableProps.defaultExpandAll), Te = a(() => m.treeProps ?? m.tableProps.treeProps ?? {
|
|
915
919
|
children: "children",
|
|
916
920
|
hasChildren: "hasChildren"
|
|
917
921
|
});
|
|
918
|
-
function
|
|
919
|
-
let t = new Set(
|
|
922
|
+
function De(e) {
|
|
923
|
+
let t = new Set(M.value);
|
|
920
924
|
if (t.has(e)) t.delete(e);
|
|
921
925
|
else {
|
|
922
926
|
if (ue.value.filter((e) => !t.has(String(e.field))).length <= 1) return;
|
|
923
927
|
t.add(e);
|
|
924
928
|
}
|
|
925
|
-
|
|
929
|
+
M.value = t, K(), _(() => A.value?.doLayout?.());
|
|
926
930
|
}
|
|
927
|
-
function
|
|
928
|
-
|
|
931
|
+
function U() {
|
|
932
|
+
M.value = /* @__PURE__ */ new Set(), L.value = H.value.map((e) => String(e.field)), K(), _(() => A.value?.doLayout?.());
|
|
929
933
|
}
|
|
930
|
-
function
|
|
934
|
+
function W(e, t) {
|
|
931
935
|
let n = ue.value.map((e) => String(e.field)), r = n.indexOf(e), i = r + t;
|
|
932
936
|
if (r < 0 || i < 0 || i >= n.length) return;
|
|
933
|
-
let a = n[i], o =
|
|
934
|
-
o.splice(s, 1), o.splice(c, 0, e),
|
|
935
|
-
}
|
|
936
|
-
function U(e) {
|
|
937
|
-
ce = e;
|
|
937
|
+
let a = n[i], o = ce.value.map((e) => String(e.field)), s = o.indexOf(e), c = o.indexOf(a);
|
|
938
|
+
o.splice(s, 1), o.splice(c, 0, e), L.value = o, K(), _(() => A.value?.doLayout?.());
|
|
938
939
|
}
|
|
939
940
|
function Oe(e) {
|
|
940
|
-
|
|
941
|
-
|
|
941
|
+
V = e;
|
|
942
|
+
}
|
|
943
|
+
function G(e) {
|
|
944
|
+
if (!V || V === e) {
|
|
945
|
+
V = "";
|
|
942
946
|
return;
|
|
943
947
|
}
|
|
944
|
-
let t =
|
|
945
|
-
n >= 0 && r >= 0 && (t.splice(n, 1), t.splice(r, 0,
|
|
948
|
+
let t = ce.value.map((e) => String(e.field)), n = t.indexOf(V), r = t.indexOf(e);
|
|
949
|
+
n >= 0 && r >= 0 && (t.splice(n, 1), t.splice(r, 0, V), L.value = t, K(), _(() => A.value?.doLayout?.())), V = "";
|
|
946
950
|
}
|
|
947
|
-
function
|
|
948
|
-
let e =
|
|
951
|
+
function K() {
|
|
952
|
+
let e = m.columnSettings?.storageKey;
|
|
949
953
|
if (!(!e || typeof localStorage > "u")) try {
|
|
950
954
|
localStorage.setItem(e, JSON.stringify({
|
|
951
|
-
hidden: [...
|
|
952
|
-
order:
|
|
955
|
+
hidden: [...M.value],
|
|
956
|
+
order: L.value
|
|
953
957
|
}));
|
|
954
958
|
} catch {}
|
|
955
959
|
}
|
|
956
|
-
function
|
|
957
|
-
|
|
958
|
-
let e =
|
|
960
|
+
function ke() {
|
|
961
|
+
L.value = H.value.map((e) => String(e.field));
|
|
962
|
+
let e = m.columnSettings?.storageKey;
|
|
959
963
|
if (!(!e || typeof localStorage > "u")) try {
|
|
960
|
-
let t = JSON.parse(localStorage.getItem(e) ?? "{}"), n = new Set(
|
|
961
|
-
|
|
964
|
+
let t = JSON.parse(localStorage.getItem(e) ?? "{}"), n = new Set(H.value.map((e) => String(e.field)));
|
|
965
|
+
M.value = new Set((t.hidden ?? []).filter((e) => n.has(e))), L.value = [...(t.order ?? []).filter((e) => n.has(e)), ...[...n].filter((e) => !(t.order ?? []).includes(e))];
|
|
962
966
|
} catch {
|
|
963
|
-
|
|
967
|
+
U();
|
|
964
968
|
}
|
|
965
969
|
}
|
|
966
|
-
function
|
|
970
|
+
function q(e) {
|
|
971
|
+
if (e.type === "index") return [];
|
|
967
972
|
let t = e.dictionary ?? e.dictType;
|
|
968
|
-
return t ?
|
|
973
|
+
return t ? pe.value[t] ?? [] : O(e.options) ?? [];
|
|
969
974
|
}
|
|
970
|
-
function
|
|
975
|
+
function Ae(e, t, n) {
|
|
971
976
|
return typeof t.hidden == "function" && !!t.hidden({
|
|
972
|
-
rows:
|
|
977
|
+
rows: m.rows,
|
|
973
978
|
row: e,
|
|
974
979
|
index: n
|
|
975
980
|
});
|
|
976
981
|
}
|
|
977
|
-
function
|
|
978
|
-
return
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
+
function J(e, t, n) {
|
|
983
|
+
return t.type === "index" ? {
|
|
984
|
+
tags: [],
|
|
985
|
+
text: String(Y(n))
|
|
986
|
+
} : Z(e, t, n, q(t), me.value.get(String(t.field)));
|
|
982
987
|
}
|
|
983
|
-
let J = a(() => new Map(z.value.map((e) => [String(e.field), Ae(e)])));
|
|
984
988
|
function Y(e) {
|
|
985
|
-
return
|
|
989
|
+
return (m.pagination ? (v.value - 1) * y.value : 0) + e + 1;
|
|
986
990
|
}
|
|
987
|
-
function
|
|
988
|
-
|
|
991
|
+
function X(e) {
|
|
992
|
+
return (t, n, r, i) => Ae(t, e, i) ? "" : J(t, e, i).text;
|
|
993
|
+
}
|
|
994
|
+
let Q = a(() => new Map(H.value.map((e) => [String(e.field), X(e)])));
|
|
995
|
+
function je(e) {
|
|
996
|
+
return Q.value.get(String(e.field));
|
|
997
|
+
}
|
|
998
|
+
function Me(e) {
|
|
999
|
+
if (!m.scaleColumnWidth) return;
|
|
989
1000
|
let t = e.minWidth ?? e.componentProps.minWidth;
|
|
990
1001
|
return e.field === de.value ? t ?? e.width ?? e.componentProps.width : t;
|
|
991
1002
|
}
|
|
992
|
-
function
|
|
993
|
-
if (!(!
|
|
1003
|
+
function Ne(e) {
|
|
1004
|
+
if (!(!m.scaleColumnWidth || e.field === de.value)) return e.width;
|
|
994
1005
|
}
|
|
995
|
-
function
|
|
996
|
-
if (typeof
|
|
997
|
-
let n =
|
|
1006
|
+
function Pe(e, t) {
|
|
1007
|
+
if (typeof m.rowKey == "function") return m.rowKey(e, t);
|
|
1008
|
+
let n = m.rowKey ? e[m.rowKey] : void 0;
|
|
998
1009
|
return typeof n == "string" || typeof n == "number" ? n : void 0;
|
|
999
1010
|
}
|
|
1000
|
-
function
|
|
1001
|
-
let n =
|
|
1011
|
+
function Qe(e, t) {
|
|
1012
|
+
let n = Pe(e, t);
|
|
1002
1013
|
return n === void 0 ? `index:${t}` : `row:${typeof n}:${n}`;
|
|
1003
1014
|
}
|
|
1004
|
-
function
|
|
1005
|
-
return
|
|
1015
|
+
function $e(e, t) {
|
|
1016
|
+
return z.value === Qe(e, t);
|
|
1006
1017
|
}
|
|
1007
|
-
function
|
|
1008
|
-
let r =
|
|
1009
|
-
n ?
|
|
1018
|
+
function et(e, t, n) {
|
|
1019
|
+
let r = Qe(e, t);
|
|
1020
|
+
n ? z.value = r : z.value === r && (z.value = null);
|
|
1010
1021
|
}
|
|
1011
|
-
function
|
|
1012
|
-
let n =
|
|
1013
|
-
|
|
1022
|
+
function tt(e, t) {
|
|
1023
|
+
let n = Qe(e, t);
|
|
1024
|
+
z.value = z.value === n ? null : n;
|
|
1014
1025
|
}
|
|
1015
|
-
function
|
|
1016
|
-
|
|
1026
|
+
function nt() {
|
|
1027
|
+
z.value = null;
|
|
1017
1028
|
}
|
|
1018
|
-
function
|
|
1019
|
-
|
|
1029
|
+
function rt(e) {
|
|
1030
|
+
ie.value = e, ae.value = e.map((e) => Pe(e, he.value.get(e) ?? -1)).filter((e) => e !== void 0), h("selectionChange", e, ae.value);
|
|
1020
1031
|
}
|
|
1021
|
-
function
|
|
1022
|
-
|
|
1032
|
+
function it(e) {
|
|
1033
|
+
h("pageChange", e);
|
|
1023
1034
|
}
|
|
1024
|
-
function
|
|
1025
|
-
|
|
1035
|
+
function at(e, t, n) {
|
|
1036
|
+
h("rowClick", e, t, n);
|
|
1026
1037
|
}
|
|
1027
|
-
function
|
|
1028
|
-
|
|
1038
|
+
function ot(e, t) {
|
|
1039
|
+
h("currentChange", e, t);
|
|
1029
1040
|
}
|
|
1030
|
-
function
|
|
1031
|
-
|
|
1041
|
+
function st(e, t) {
|
|
1042
|
+
h("expandChange", e, t);
|
|
1032
1043
|
}
|
|
1033
|
-
function
|
|
1044
|
+
function ct() {
|
|
1034
1045
|
if (typeof window > "u") return;
|
|
1035
1046
|
let e = window.innerWidth <= 768;
|
|
1036
|
-
e !==
|
|
1047
|
+
e !== R.value && (R.value = e, e || nt(), _(() => A.value?.doLayout?.()));
|
|
1037
1048
|
}
|
|
1038
|
-
function
|
|
1039
|
-
e.key === "Escape" &&
|
|
1049
|
+
function lt(e) {
|
|
1050
|
+
e.key === "Escape" && nt();
|
|
1040
1051
|
}
|
|
1041
|
-
function
|
|
1042
|
-
!
|
|
1043
|
-
|
|
1044
|
-
|
|
1052
|
+
function ut() {
|
|
1053
|
+
!m.autoResize || typeof ResizeObserver > "u" || !ee.value || (se = new ResizeObserver(() => {
|
|
1054
|
+
B && clearTimeout(B), B = setTimeout(() => {
|
|
1055
|
+
B = void 0, A.value?.doLayout?.();
|
|
1045
1056
|
});
|
|
1046
|
-
}),
|
|
1057
|
+
}), se.observe(ee.value));
|
|
1047
1058
|
}
|
|
1048
|
-
function
|
|
1049
|
-
|
|
1059
|
+
function dt() {
|
|
1060
|
+
se?.disconnect(), se = void 0, B &&= (clearTimeout(B), void 0);
|
|
1050
1061
|
}
|
|
1051
|
-
return N(() =>
|
|
1052
|
-
|
|
1053
|
-
}), N(() => [
|
|
1054
|
-
typeof document > "u" || (document.removeEventListener("keydown",
|
|
1062
|
+
return N(() => m.autoResize, () => {
|
|
1063
|
+
dt(), ut();
|
|
1064
|
+
}), N(() => [H.value.map((e) => String(e.field)).join("\0"), m.columnSettings?.storageKey], ke), N(z, (e) => {
|
|
1065
|
+
typeof document > "u" || (document.removeEventListener("keydown", lt), e !== null && document.addEventListener("keydown", lt));
|
|
1055
1066
|
}), S(() => {
|
|
1056
|
-
|
|
1067
|
+
ke(), ct(), ut(), window.addEventListener("resize", ct);
|
|
1057
1068
|
}), x(() => {
|
|
1058
|
-
|
|
1069
|
+
dt(), window.removeEventListener("resize", ct), document.removeEventListener("keydown", lt);
|
|
1059
1070
|
}), r({
|
|
1060
|
-
clearSelection: () =>
|
|
1061
|
-
doLayout: () =>
|
|
1062
|
-
getSelectedRowKeys: () => [...
|
|
1063
|
-
getSelectedRows: () => [...
|
|
1064
|
-
getColumnOrder: () => [...
|
|
1065
|
-
getExportData: (e =
|
|
1066
|
-
let t = new Map(
|
|
1071
|
+
clearSelection: () => A.value?.clearSelection?.(),
|
|
1072
|
+
doLayout: () => A.value?.doLayout?.(),
|
|
1073
|
+
getSelectedRowKeys: () => [...ae.value],
|
|
1074
|
+
getSelectedRows: () => [...ie.value],
|
|
1075
|
+
getColumnOrder: () => [...L.value],
|
|
1076
|
+
getExportData: (e = m.rows) => {
|
|
1077
|
+
let t = new Map(m.rows.map((e, t) => [te(e), t]));
|
|
1067
1078
|
return {
|
|
1068
1079
|
columns: le.value.map((e) => ({
|
|
1069
1080
|
field: String(e.field),
|
|
1070
1081
|
label: e.label
|
|
1071
1082
|
})),
|
|
1072
|
-
rows: e.map((e) => le.value.map((
|
|
1083
|
+
rows: e.map((e, n) => le.value.map((r) => J(e, r, t.get(te(e)) ?? n).text))
|
|
1073
1084
|
};
|
|
1074
1085
|
},
|
|
1075
1086
|
getVisibleColumns: () => [...le.value],
|
|
1076
|
-
resetColumnSettings:
|
|
1077
|
-
getTableElement: () =>
|
|
1078
|
-
getTableInstance: () =>
|
|
1079
|
-
toggleRowSelection: (e, t) =>
|
|
1087
|
+
resetColumnSettings: U,
|
|
1088
|
+
getTableElement: () => A.value?.$el,
|
|
1089
|
+
getTableInstance: () => A.value,
|
|
1090
|
+
toggleRowSelection: (e, t) => A.value?.toggleRowSelection?.(e, t)
|
|
1080
1091
|
}), (e, t) => (C(), c("div", {
|
|
1081
1092
|
ref_key: "containerRef",
|
|
1082
|
-
ref:
|
|
1093
|
+
ref: ee,
|
|
1083
1094
|
class: "lumal-schema-table"
|
|
1084
1095
|
}, [
|
|
1085
|
-
e.$slots["toolbar-title"] || e.$slots.toolbar || e.$slots["toolbar-tools"] || ye.value ? (C(), c("div",
|
|
1086
|
-
e.$slots["toolbar-title"] ? (C(), c("div",
|
|
1087
|
-
e.$slots.toolbar ? (C(), c("div",
|
|
1088
|
-
e.$slots["toolbar-tools"] || ye.value ? (C(), c("div",
|
|
1096
|
+
e.$slots["toolbar-title"] || e.$slots.toolbar || e.$slots["toolbar-tools"] || ye.value ? (C(), c("div", Ie, [
|
|
1097
|
+
e.$slots["toolbar-title"] ? (C(), c("div", Le, [T(e.$slots, "toolbar-title", {}, void 0, !0)])) : s("", !0),
|
|
1098
|
+
e.$slots.toolbar ? (C(), c("div", Re, [T(e.$slots, "toolbar", {}, void 0, !0)])) : s("", !0),
|
|
1099
|
+
e.$slots["toolbar-tools"] || ye.value ? (C(), c("div", ze, [T(e.$slots, "toolbar-tools", {}, void 0, !0), ye.value ? (C(), c("div", Be, [l("details", null, [l("summary", Ve, [f(O(I), { name: "lumal:grid" })]), l("div", He, [l("div", { class: "lumal-schema-table__column-options-header" }, [t[6] ||= l("strong", null, "列设置", -1), l("button", {
|
|
1089
1100
|
type: "button",
|
|
1090
|
-
onClick:
|
|
1091
|
-
}, " 恢复默认 ")]), (C(!0), c(i, null,
|
|
1101
|
+
onClick: U
|
|
1102
|
+
}, " 恢复默认 ")]), (C(!0), c(i, null, w(ue.value, (e, r) => (C(), c("div", {
|
|
1092
1103
|
key: String(e.field),
|
|
1093
1104
|
class: "lumal-schema-table__column-option",
|
|
1094
1105
|
draggable: n.columnSettings?.reorderable !== !1,
|
|
1095
|
-
onDragstart: (t) =>
|
|
1096
|
-
onDragover: t[0] ||=
|
|
1097
|
-
onDrop: (t) =>
|
|
1098
|
-
}, [f(
|
|
1099
|
-
"model-value": !
|
|
1100
|
-
"onUpdate:modelValue": (t) =>
|
|
1106
|
+
onDragstart: (t) => Oe(String(e.field)),
|
|
1107
|
+
onDragover: t[0] ||= re(() => {}, ["prevent"]),
|
|
1108
|
+
onDrop: (t) => G(String(e.field))
|
|
1109
|
+
}, [f(O(oe), {
|
|
1110
|
+
"model-value": !M.value.has(String(e.field)),
|
|
1111
|
+
"onUpdate:modelValue": (t) => De(String(e.field))
|
|
1101
1112
|
}, {
|
|
1102
|
-
default: P(() => [d(
|
|
1113
|
+
default: P(() => [d(D(e.label), 1)]),
|
|
1103
1114
|
_: 2
|
|
1104
|
-
}, 1032, ["model-value", "onUpdate:modelValue"]), n.columnSettings?.reorderable === !1 ? s("", !0) : (C(), c("span",
|
|
1115
|
+
}, 1032, ["model-value", "onUpdate:modelValue"]), n.columnSettings?.reorderable === !1 ? s("", !0) : (C(), c("span", We, [l("button", {
|
|
1105
1116
|
type: "button",
|
|
1106
1117
|
disabled: r === 0,
|
|
1107
1118
|
"aria-label": `上移${e.label}`,
|
|
1108
1119
|
title: `上移${e.label}`,
|
|
1109
|
-
onClick: (t) =>
|
|
1110
|
-
}, [f(
|
|
1120
|
+
onClick: (t) => W(String(e.field), -1)
|
|
1121
|
+
}, [f(O(I), { name: "lumal:arrow-up" })], 8, Ge), l("button", {
|
|
1111
1122
|
type: "button",
|
|
1112
1123
|
disabled: r === ue.value.length - 1,
|
|
1113
1124
|
"aria-label": `下移${e.label}`,
|
|
1114
1125
|
title: `下移${e.label}`,
|
|
1115
|
-
onClick: (t) =>
|
|
1116
|
-
}, [f(
|
|
1126
|
+
onClick: (t) => W(String(e.field), 1)
|
|
1127
|
+
}, [f(O(I), { name: "lumal:arrow-down" })], 8, Ke)]))], 40, Ue))), 128))])])])) : s("", !0)])) : s("", !0)
|
|
1117
1128
|
])) : s("", !0),
|
|
1118
|
-
n.error ? (C(), c("div",
|
|
1129
|
+
n.error ? (C(), c("div", qe, [l("span", null, D(xe.value), 1), l("button", {
|
|
1119
1130
|
type: "button",
|
|
1120
|
-
onClick: t[1] ||= (e) =>
|
|
1121
|
-
},
|
|
1131
|
+
onClick: t[1] ||= (e) => h("retry")
|
|
1132
|
+
}, D(n.retryText), 1)])) : (C(), c("div", Je, [ne((C(), o(O(Se), g({
|
|
1122
1133
|
ref_key: "tableRef",
|
|
1123
|
-
ref:
|
|
1134
|
+
ref: A
|
|
1124
1135
|
}, n.tableProps, {
|
|
1125
1136
|
class: "lumal-schema-table__body",
|
|
1126
1137
|
data: n.rows,
|
|
1127
|
-
"row-key":
|
|
1138
|
+
"row-key": _e.value,
|
|
1128
1139
|
"empty-text": n.emptyText,
|
|
1129
1140
|
"row-class-name": n.rowClassName,
|
|
1130
1141
|
"cell-class-name": n.cellClassName,
|
|
1131
1142
|
"header-cell-class-name": n.headerCellClassName,
|
|
1132
|
-
"default-expand-all":
|
|
1143
|
+
"default-expand-all": we.value,
|
|
1133
1144
|
"tree-props": Te.value,
|
|
1134
1145
|
"data-loading": n.loading,
|
|
1135
|
-
onSelectionChange:
|
|
1136
|
-
onSortChange: t[2] ||= (e) =>
|
|
1137
|
-
onFilterChange: t[3] ||= (e) =>
|
|
1138
|
-
onRowClick:
|
|
1139
|
-
onCurrentChange:
|
|
1140
|
-
onExpandChange:
|
|
1146
|
+
onSelectionChange: rt,
|
|
1147
|
+
onSortChange: t[2] ||= (e) => h("sortChange", e),
|
|
1148
|
+
onFilterChange: t[3] ||= (e) => h("filterChange", e),
|
|
1149
|
+
onRowClick: at,
|
|
1150
|
+
onCurrentChange: ot,
|
|
1151
|
+
onExpandChange: st
|
|
1141
1152
|
}), {
|
|
1142
1153
|
default: P(() => [
|
|
1143
|
-
n.selection ? (C(), o(
|
|
1154
|
+
n.selection ? (C(), o(O(Ce), {
|
|
1144
1155
|
key: 0,
|
|
1145
1156
|
type: "selection",
|
|
1146
1157
|
width: "48"
|
|
1147
1158
|
})) : s("", !0),
|
|
1148
|
-
n.showIndex ? (C(), o(
|
|
1159
|
+
n.showIndex ? (C(), o(O(Ce), {
|
|
1149
1160
|
key: 1,
|
|
1150
1161
|
type: "index",
|
|
1151
1162
|
label: n.indexLabel,
|
|
1152
1163
|
width: n.indexWidth
|
|
1153
1164
|
}, null, 8, ["label", "width"])) : s("", !0),
|
|
1154
|
-
(C(!0), c(i, null,
|
|
1155
|
-
|
|
1165
|
+
(C(!0), c(i, null, w(le.value, (t) => (C(), o(O(Ce), g({ key: String(t.field) }, { ref_for: !0 }, t.componentProps, {
|
|
1166
|
+
type: t.type,
|
|
1167
|
+
index: Y,
|
|
1168
|
+
prop: t.type === "index" ? void 0 : String(t.field),
|
|
1156
1169
|
label: t.label,
|
|
1157
1170
|
align: t.align,
|
|
1158
|
-
width:
|
|
1159
|
-
"min-width":
|
|
1171
|
+
width: Ne(t),
|
|
1172
|
+
"min-width": Me(t),
|
|
1160
1173
|
fixed: t.fixed,
|
|
1161
1174
|
resizable: n.columnResizable,
|
|
1162
1175
|
"show-overflow-tooltip": t.showOverflowTooltip ?? !0,
|
|
1163
|
-
formatter:
|
|
1176
|
+
formatter: je(t),
|
|
1164
1177
|
"data-field": String(t.field)
|
|
1165
|
-
}), {
|
|
1166
|
-
|
|
1178
|
+
}), u({ _: 2 }, [t.type === "index" ? void 0 : {
|
|
1179
|
+
name: "default",
|
|
1180
|
+
fn: P(({ row: n, $index: r }) => [Ae(n, t, r) ? s("", !0) : T(e.$slots, `table-${String(t.field)}`, {
|
|
1167
1181
|
key: 0,
|
|
1168
1182
|
row: n,
|
|
1169
1183
|
index: r,
|
|
1170
1184
|
column: t,
|
|
1171
1185
|
value: n[t.field]
|
|
1172
|
-
}, () => [f(
|
|
1173
|
-
|
|
1174
|
-
}, 1040, [
|
|
1186
|
+
}, () => [f($, { display: J(n, t, r) }, null, 8, ["display"])], !0)]),
|
|
1187
|
+
key: "0"
|
|
1188
|
+
}]), 1040, [
|
|
1189
|
+
"type",
|
|
1175
1190
|
"prop",
|
|
1176
1191
|
"label",
|
|
1177
1192
|
"align",
|
|
@@ -1183,38 +1198,38 @@ var Fe = {
|
|
|
1183
1198
|
"formatter",
|
|
1184
1199
|
"data-field"
|
|
1185
1200
|
]))), 128)),
|
|
1186
|
-
e.$slots.actions ? (C(), o(
|
|
1201
|
+
e.$slots.actions ? (C(), o(O(Ce), {
|
|
1187
1202
|
key: 2,
|
|
1188
1203
|
fixed: "right",
|
|
1189
1204
|
label: n.actionLabel,
|
|
1190
1205
|
width: be.value,
|
|
1191
1206
|
"data-field": "actions"
|
|
1192
1207
|
}, {
|
|
1193
|
-
default: P(({ row: t, $index: r }) => [l("div",
|
|
1208
|
+
default: P(({ row: t, $index: r }) => [l("div", Ye, [T(e.$slots, "actions", {
|
|
1194
1209
|
row: t,
|
|
1195
1210
|
index: r
|
|
1196
|
-
}, void 0, !0)]), f(
|
|
1197
|
-
visible:
|
|
1211
|
+
}, void 0, !0)]), f(O(ge), {
|
|
1212
|
+
visible: $e(t, r),
|
|
1198
1213
|
teleported: !0,
|
|
1199
1214
|
role: "menu",
|
|
1200
1215
|
trigger: "click",
|
|
1201
1216
|
placement: "bottom-end",
|
|
1202
1217
|
"popper-class": "lumal-schema-table__mobile-actions-popper",
|
|
1203
|
-
"onUpdate:visible": (e) =>
|
|
1218
|
+
"onUpdate:visible": (e) => et(t, r, e)
|
|
1204
1219
|
}, {
|
|
1205
1220
|
reference: P(() => [l("button", {
|
|
1206
1221
|
type: "button",
|
|
1207
1222
|
class: "lumal-schema-table__mobile-actions",
|
|
1208
1223
|
"aria-haspopup": "menu",
|
|
1209
|
-
"aria-expanded":
|
|
1210
|
-
onClick:
|
|
1211
|
-
onKeydown:
|
|
1212
|
-
},
|
|
1224
|
+
"aria-expanded": $e(t, r),
|
|
1225
|
+
onClick: re((e) => tt(t, r), ["stop"]),
|
|
1226
|
+
onKeydown: F(re(nt, ["stop", "prevent"]), ["esc"])
|
|
1227
|
+
}, D(n.mobileActionLabel), 41, Xe)]),
|
|
1213
1228
|
default: P(() => [l("div", {
|
|
1214
1229
|
class: "lumal-schema-table__mobile-actions-menu",
|
|
1215
1230
|
role: "menu",
|
|
1216
|
-
onClickCapture:
|
|
1217
|
-
}, [
|
|
1231
|
+
onClickCapture: nt
|
|
1232
|
+
}, [T(e.$slots, "actions", {
|
|
1218
1233
|
row: t,
|
|
1219
1234
|
index: r
|
|
1220
1235
|
}, void 0, !0)], 32)]),
|
|
@@ -1234,15 +1249,15 @@ var Fe = {
|
|
|
1234
1249
|
"default-expand-all",
|
|
1235
1250
|
"tree-props",
|
|
1236
1251
|
"data-loading"
|
|
1237
|
-
])), [[
|
|
1238
|
-
ve.value ? (C(), c("div",
|
|
1239
|
-
page:
|
|
1240
|
-
"onUpdate:page": t[4] ||= (e) =>
|
|
1241
|
-
"page-size":
|
|
1242
|
-
"onUpdate:pageSize": t[5] ||= (e) =>
|
|
1252
|
+
])), [[O(b), n.loading]])])),
|
|
1253
|
+
ve.value ? (C(), c("div", Ze, [f(O(Ee), {
|
|
1254
|
+
page: v.value,
|
|
1255
|
+
"onUpdate:page": t[4] ||= (e) => v.value = e,
|
|
1256
|
+
"page-size": y.value,
|
|
1257
|
+
"onUpdate:pageSize": t[5] ||= (e) => y.value = e,
|
|
1243
1258
|
total: n.total,
|
|
1244
1259
|
"page-sizes": n.pageSizes,
|
|
1245
|
-
onChange:
|
|
1260
|
+
onChange: it
|
|
1246
1261
|
}, null, 8, [
|
|
1247
1262
|
"page",
|
|
1248
1263
|
"page-size",
|
|
@@ -1251,7 +1266,7 @@ var Fe = {
|
|
|
1251
1266
|
])])) : s("", !0)
|
|
1252
1267
|
], 512));
|
|
1253
1268
|
}
|
|
1254
|
-
}), [["__scopeId", "data-v-
|
|
1269
|
+
}), [["__scopeId", "data-v-94010976"]]), $e = /* @__PURE__ */ p({
|
|
1255
1270
|
__name: "LumalCrudEditor",
|
|
1256
1271
|
props: /*@__PURE__*/ h({
|
|
1257
1272
|
beforeClose: {},
|
|
@@ -1275,8 +1290,8 @@ var Fe = {
|
|
|
1275
1290
|
}),
|
|
1276
1291
|
emits: ["update:modelValue"],
|
|
1277
1292
|
setup(e) {
|
|
1278
|
-
let t =
|
|
1279
|
-
return (n, r) => e.type === "drawer" ? (C(), o(
|
|
1293
|
+
let t = k(e, "modelValue");
|
|
1294
|
+
return (n, r) => e.type === "drawer" ? (C(), o(O(H), {
|
|
1280
1295
|
key: 0,
|
|
1281
1296
|
modelValue: t.value,
|
|
1282
1297
|
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
@@ -1287,8 +1302,8 @@ var Fe = {
|
|
|
1287
1302
|
"before-close": e.beforeClose,
|
|
1288
1303
|
class: "lumal-crud-table__drawer"
|
|
1289
1304
|
}, {
|
|
1290
|
-
footer: P(() => [
|
|
1291
|
-
default: P(() => [
|
|
1305
|
+
footer: P(() => [T(n.$slots, "footer")]),
|
|
1306
|
+
default: P(() => [T(n.$slots, "default")]),
|
|
1292
1307
|
_: 3
|
|
1293
1308
|
}, 8, [
|
|
1294
1309
|
"modelValue",
|
|
@@ -1297,7 +1312,7 @@ var Fe = {
|
|
|
1297
1312
|
"close-on-click-modal",
|
|
1298
1313
|
"destroy-on-close",
|
|
1299
1314
|
"before-close"
|
|
1300
|
-
])) : (C(), o(
|
|
1315
|
+
])) : (C(), o(O(V), {
|
|
1301
1316
|
key: 1,
|
|
1302
1317
|
modelValue: t.value,
|
|
1303
1318
|
"onUpdate:modelValue": r[1] ||= (e) => t.value = e,
|
|
@@ -1308,8 +1323,8 @@ var Fe = {
|
|
|
1308
1323
|
"before-close": e.beforeClose,
|
|
1309
1324
|
class: "lumal-crud-table__dialog"
|
|
1310
1325
|
}, {
|
|
1311
|
-
footer: P(() => [
|
|
1312
|
-
default: P(() => [
|
|
1326
|
+
footer: P(() => [T(n.$slots, "footer")]),
|
|
1327
|
+
default: P(() => [T(n.$slots, "default")]),
|
|
1313
1328
|
_: 3
|
|
1314
1329
|
}, 8, [
|
|
1315
1330
|
"modelValue",
|
|
@@ -1323,8 +1338,8 @@ var Fe = {
|
|
|
1323
1338
|
});
|
|
1324
1339
|
//#endregion
|
|
1325
1340
|
//#region src/components/crud-table/schema.ts
|
|
1326
|
-
function
|
|
1327
|
-
return t.length > 0 ? [...t] : e.filter((e) => e.showInForm !== !1 && e.field !== "action").map((e) => ({
|
|
1341
|
+
function et(e = [], t = []) {
|
|
1342
|
+
return t.length > 0 ? [...t] : e.filter((e) => e.type !== "index" && e.showInForm !== !1 && e.field !== "action").map((e) => ({
|
|
1328
1343
|
append: e.append,
|
|
1329
1344
|
component: e.component ?? (e.dictionary || e.dictType ? "select" : "input"),
|
|
1330
1345
|
componentProps: e.formComponentProps,
|
|
@@ -1346,14 +1361,14 @@ function $e(e = [], t = []) {
|
|
|
1346
1361
|
}
|
|
1347
1362
|
//#endregion
|
|
1348
1363
|
//#region src/components/crud-table/useCrudData.ts
|
|
1349
|
-
function
|
|
1364
|
+
function tt(e) {
|
|
1350
1365
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1351
1366
|
}
|
|
1352
|
-
function
|
|
1353
|
-
let t =
|
|
1367
|
+
function nt(e) {
|
|
1368
|
+
let t = E([]), n = E(0), r = E(!1), i = E(""), o = 0, s = a(() => e.dataSource.value ? t.value : e.rows.value), c = a(() => e.dataSource.value ? n.value : e.total.value), l = a(() => e.loading.value || r.value);
|
|
1354
1369
|
function u(t) {
|
|
1355
1370
|
let n = e.dataSource.value;
|
|
1356
|
-
return n?.parseResponse ? n.parseResponse(t) : !
|
|
1371
|
+
return n?.parseResponse ? n.parseResponse(t) : !tt(t) || !Array.isArray(t.items) || typeof t.total != "number" ? {
|
|
1357
1372
|
items: [],
|
|
1358
1373
|
total: 0
|
|
1359
1374
|
} : {
|
|
@@ -1391,25 +1406,25 @@ function tt(e) {
|
|
|
1391
1406
|
}
|
|
1392
1407
|
//#endregion
|
|
1393
1408
|
//#region src/components/crud-table/useCrudDialog.ts
|
|
1394
|
-
function
|
|
1409
|
+
function rt(e) {
|
|
1395
1410
|
try {
|
|
1396
1411
|
return JSON.stringify(e);
|
|
1397
1412
|
} catch {
|
|
1398
1413
|
return String(e);
|
|
1399
1414
|
}
|
|
1400
1415
|
}
|
|
1401
|
-
function
|
|
1416
|
+
function it(e) {
|
|
1402
1417
|
try {
|
|
1403
1418
|
return structuredClone(e);
|
|
1404
1419
|
} catch {
|
|
1405
1420
|
return JSON.parse(JSON.stringify(e));
|
|
1406
1421
|
}
|
|
1407
1422
|
}
|
|
1408
|
-
function
|
|
1409
|
-
let t =
|
|
1423
|
+
function at(e) {
|
|
1424
|
+
let t = E(!1), n = E("create"), r = E({}), i = E("{}"), o = E(), s = E(!1), c = E(""), l = a(() => n.value !== "view" && rt(r.value) !== i.value);
|
|
1410
1425
|
function u(e, a) {
|
|
1411
|
-
let s = a ?
|
|
1412
|
-
n.value = e, o.value = a, r.value = s, i.value =
|
|
1426
|
+
let s = a ? it(a) : {};
|
|
1427
|
+
n.value = e, o.value = a, r.value = s, i.value = rt(s), c.value = "", t.value = !0;
|
|
1413
1428
|
}
|
|
1414
1429
|
async function d(r, a) {
|
|
1415
1430
|
if (s.value) return !1;
|
|
@@ -1417,7 +1432,7 @@ function it(e) {
|
|
|
1417
1432
|
if (!l) return t.value = !1, !0;
|
|
1418
1433
|
s.value = !0, c.value = "";
|
|
1419
1434
|
try {
|
|
1420
|
-
return a && !await a() ? !1 : (n.value === "edit" && o.value ? await l.update?.(o.value, r) : await l.create?.(r), i.value =
|
|
1435
|
+
return a && !await a() ? !1 : (n.value === "edit" && o.value ? await l.update?.(o.value, r) : await l.create?.(r), i.value = rt(r), t.value = !1, s.value = !1, await e.afterSave(), !0);
|
|
1421
1436
|
} catch (e) {
|
|
1422
1437
|
return c.value = e instanceof Error ? e.message : String(e), !1;
|
|
1423
1438
|
} finally {
|
|
@@ -1438,8 +1453,8 @@ function it(e) {
|
|
|
1438
1453
|
}
|
|
1439
1454
|
//#endregion
|
|
1440
1455
|
//#region src/components/crud-table/useCrudQuery.ts
|
|
1441
|
-
function
|
|
1442
|
-
let t =
|
|
1456
|
+
function ot(e) {
|
|
1457
|
+
let t = E(e.defaultCollapsed.value), n = a(() => K(G(e.schemas.value))), r = a(() => {
|
|
1443
1458
|
if (!e.collapsible.value || !t.value) return e.schemas.value;
|
|
1444
1459
|
let n = 24 / e.columns.value, r = e.columns.value * e.collapsedRows.value, i = 0;
|
|
1445
1460
|
return e.schemas.value.filter((e) => {
|
|
@@ -1465,8 +1480,8 @@ function at(e) {
|
|
|
1465
1480
|
}
|
|
1466
1481
|
//#endregion
|
|
1467
1482
|
//#region src/components/crud-table/useCrudSelection.ts
|
|
1468
|
-
function
|
|
1469
|
-
let e =
|
|
1483
|
+
function st() {
|
|
1484
|
+
let e = E([]), t = E([]);
|
|
1470
1485
|
function n() {
|
|
1471
1486
|
e.value = [], t.value = [];
|
|
1472
1487
|
}
|
|
@@ -1482,21 +1497,21 @@ function ot() {
|
|
|
1482
1497
|
}
|
|
1483
1498
|
//#endregion
|
|
1484
1499
|
//#region src/components/crud-table/LumalCrudTable.vue?vue&type=script&setup=true&lang.ts
|
|
1485
|
-
var
|
|
1500
|
+
var ct = { class: "lumal-crud-table__query-actions" }, lt = {
|
|
1486
1501
|
key: 1,
|
|
1487
1502
|
class: "lumal-crud-table__error",
|
|
1488
1503
|
role: "alert"
|
|
1489
|
-
},
|
|
1504
|
+
}, ut = { class: "lumal-crud-table__table-panel" }, dt = { class: "lumal-crud-table__body" }, ft = { class: "lumal-crud-table__toolbar-tools" }, pt = {
|
|
1490
1505
|
key: 0,
|
|
1491
1506
|
class: "lumal-crud-table__extra"
|
|
1492
|
-
},
|
|
1507
|
+
}, mt = {
|
|
1493
1508
|
key: 1,
|
|
1494
1509
|
class: "lumal-crud-table__pagination"
|
|
1495
|
-
},
|
|
1510
|
+
}, ht = {
|
|
1496
1511
|
key: 0,
|
|
1497
1512
|
class: "lumal-crud-table__dialog-error",
|
|
1498
1513
|
role: "alert"
|
|
1499
|
-
},
|
|
1514
|
+
}, gt = { class: "lumal-crud-table__dialog-footer" }, _t = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
1500
1515
|
__name: "LumalCrudTable",
|
|
1501
1516
|
props: /*@__PURE__*/ h({
|
|
1502
1517
|
title: {},
|
|
@@ -1555,28 +1570,28 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1555
1570
|
"update:pageSize"
|
|
1556
1571
|
]),
|
|
1557
1572
|
setup(e, { expose: t, emit: n }) {
|
|
1558
|
-
let r = e, i = n, p =
|
|
1573
|
+
let r = e, i = n, p = k(e, "queryModel"), h = k(e, "page"), g = k(e, "pageSize"), b = j("crudRef"), ee = j("queryRef"), te = j("queryFormRef"), A = j("dialogFormRef"), F = j("tableRef"), re = a(() => r.query?.schemas ?? r.querySchemas), L = a(() => r.table?.columns ?? r.columns), ie = a(() => L.value.filter((e) => e.showInTable !== !1)), ae = a(() => et(L.value, r.formSchemas)), oe = a(() => r.table?.rowKey ?? r.rowKey), z = a(() => r.table?.selection ?? r.selection), se = a(() => r.table?.emptyText ?? r.emptyText), B = E(3), V = a(() => Math.max(1, r.query?.columns ?? B.value)), H = a(() => r.query?.collapsible ?? !1), ce = a(() => r.query?.defaultCollapsed ?? !0), le = a(() => Math.max(1, r.query?.collapsedRows ?? 1)), ue = a(() => typeof r.pagination == "object" ? r.pagination.enabled !== !1 : r.pagination), de = a(() => typeof r.pagination == "object" ? r.pagination.pageSizes ?? r.pageSizes : r.pageSizes), fe = a(() => re.value.length > 0), me = a(() => ae.value.length > 0), he = a(() => me.value && r.toolbar?.create !== !1), ge = a(() => z.value && r.toolbar?.batchDelete !== !1), _e = a(() => !!r.dataSource && r.toolbar?.refresh !== !1), ve = a(() => !!r.toolbar?.export), ye = a(() => r.toolbar?.fullscreen !== !1), be = a(() => fe.value && r.toolbar?.queryToggle !== !1), xe = a(() => he.value || ge.value || ve.value), Se = a(() => be.value || _e.value || ye.value), Ce = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(max-width: 768px)").matches, we = {
|
|
1559
1574
|
desktop: r.query?.defaultVisible ?? !0,
|
|
1560
1575
|
mobile: r.query?.mobileDefaultVisible ?? r.query?.defaultVisible ?? !0
|
|
1561
|
-
},
|
|
1562
|
-
dataSource:
|
|
1576
|
+
}, Te = a(() => r.dataSource), De = E(!1), U = E(!1), W = E(Ce), Oe = a(() => W.value ? "mobile" : "desktop"), G = E(we), K = E(we[Ce ? "mobile" : "desktop"]), ke, q, Ae, Y = nt({
|
|
1577
|
+
dataSource: Te,
|
|
1563
1578
|
loading: a(() => r.loading),
|
|
1564
1579
|
page: h,
|
|
1565
1580
|
pageSize: g,
|
|
1566
1581
|
queryModel: p,
|
|
1567
1582
|
rows: a(() => r.rows),
|
|
1568
1583
|
total: a(() => r.total)
|
|
1569
|
-
}), X =
|
|
1570
|
-
collapsedRows:
|
|
1571
|
-
collapsible:
|
|
1572
|
-
columns:
|
|
1573
|
-
defaultCollapsed:
|
|
1584
|
+
}), X = ot({
|
|
1585
|
+
collapsedRows: le,
|
|
1586
|
+
collapsible: H,
|
|
1587
|
+
columns: V,
|
|
1588
|
+
defaultCollapsed: ce,
|
|
1574
1589
|
model: p,
|
|
1575
|
-
schemas:
|
|
1576
|
-
}), Z =
|
|
1577
|
-
dataSource:
|
|
1590
|
+
schemas: re
|
|
1591
|
+
}), Z = st(), Q = at({
|
|
1592
|
+
dataSource: Te,
|
|
1578
1593
|
afterSave: Y.load
|
|
1579
|
-
}), je = a(() => Y.currentLoading.value ||
|
|
1594
|
+
}), je = a(() => Y.currentLoading.value || De.value), Me = a(() => ue.value && Y.currentTotal.value > 0), $ = a(() => ({
|
|
1580
1595
|
create: r.editor?.createTitle ?? r.toolbar?.createText ?? r.createText,
|
|
1581
1596
|
edit: r.editor?.editTitle ?? "编辑",
|
|
1582
1597
|
view: r.editor?.viewTitle ?? "查看"
|
|
@@ -1588,13 +1603,13 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1588
1603
|
function Pe(e) {
|
|
1589
1604
|
if (r.query?.columns !== void 0 || e <= 0) return;
|
|
1590
1605
|
let t = e >= 1280 ? 4 : e >= 960 ? 3 : e >= 640 ? 2 : 1;
|
|
1591
|
-
|
|
1606
|
+
B.value !== t && (B.value = t);
|
|
1592
1607
|
}
|
|
1593
1608
|
function Fe() {
|
|
1594
|
-
q?.disconnect(), q = void 0,
|
|
1609
|
+
q?.disconnect(), q = void 0, ee.value && (Pe(ee.value.clientWidth), !(typeof ResizeObserver > "u") && (q = new ResizeObserver((e) => Pe(e[0]?.contentRect.width ?? 0)), q.observe(ee.value)));
|
|
1595
1610
|
}
|
|
1596
1611
|
function Ie(e) {
|
|
1597
|
-
|
|
1612
|
+
W.value !== e && (W.value = e, K.value = G.value[Oe.value], _(() => {
|
|
1598
1613
|
K.value ? Fe() : q?.disconnect(), F.value?.doLayout();
|
|
1599
1614
|
}));
|
|
1600
1615
|
}
|
|
@@ -1602,30 +1617,30 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1602
1617
|
Ie(e.matches);
|
|
1603
1618
|
}
|
|
1604
1619
|
S(() => {
|
|
1605
|
-
typeof document < "u" && document.addEventListener("fullscreenchange", Ne), typeof window < "u" && typeof window.matchMedia == "function" && (
|
|
1620
|
+
typeof document < "u" && document.addEventListener("fullscreenchange", Ne), typeof window < "u" && typeof window.matchMedia == "function" && (Ae = window.matchMedia("(max-width: 768px)"), Ie(Ae.matches), Ae.addEventListener?.("change", Le)), Fe();
|
|
1606
1621
|
}), x(() => {
|
|
1607
|
-
typeof document < "u" && document.removeEventListener("fullscreenchange", Ne),
|
|
1622
|
+
typeof document < "u" && document.removeEventListener("fullscreenchange", Ne), Ae?.removeEventListener?.("change", Le), q?.disconnect(), ke && clearTimeout(ke);
|
|
1608
1623
|
}), N(() => r.query?.columns, (e) => {
|
|
1609
|
-
e === void 0 && Pe(
|
|
1624
|
+
e === void 0 && Pe(ee.value?.clientWidth ?? 0);
|
|
1610
1625
|
}), N([() => r.query?.defaultVisible, () => r.query?.mobileDefaultVisible], ([e, t]) => {
|
|
1611
1626
|
G.value = {
|
|
1612
1627
|
desktop: e ?? !0,
|
|
1613
1628
|
mobile: t ?? e ?? !0
|
|
1614
|
-
}, K.value = G.value[
|
|
1629
|
+
}, K.value = G.value[Oe.value];
|
|
1615
1630
|
});
|
|
1616
1631
|
function Re() {
|
|
1617
1632
|
i("search", { ...p.value }), h.value === 1 ? Y.load() : h.value = 1;
|
|
1618
1633
|
}
|
|
1619
1634
|
function ze() {
|
|
1620
1635
|
let e = X.reset();
|
|
1621
|
-
|
|
1636
|
+
te.value?.resetFields(), i("reset", e), h.value === 1 ? Y.load() : h.value = 1;
|
|
1622
1637
|
}
|
|
1623
1638
|
function Be() {
|
|
1624
1639
|
r.query?.submitOnChange && (ke && clearTimeout(ke), ke = setTimeout(Re, Math.max(0, r.query.submitDebounce ?? 300)));
|
|
1625
1640
|
}
|
|
1626
1641
|
async function Ve() {
|
|
1627
1642
|
let e = [...Z.selectedRows.value], t = e.length > 0 ? e : Y.currentRows.value, n = {
|
|
1628
|
-
columns:
|
|
1643
|
+
columns: ie.value,
|
|
1629
1644
|
query: { ...p.value },
|
|
1630
1645
|
rows: t,
|
|
1631
1646
|
selectedRows: e
|
|
@@ -1657,7 +1672,7 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1657
1672
|
function We() {
|
|
1658
1673
|
if (K.value = !K.value, G.value = {
|
|
1659
1674
|
...G.value,
|
|
1660
|
-
[
|
|
1675
|
+
[Oe.value]: K.value
|
|
1661
1676
|
}, K.value) {
|
|
1662
1677
|
_(() => {
|
|
1663
1678
|
Fe(), F.value?.doLayout();
|
|
@@ -1679,7 +1694,7 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1679
1694
|
Q.open("view", e);
|
|
1680
1695
|
}
|
|
1681
1696
|
async function Ye(e) {
|
|
1682
|
-
!await Q.submit(e, async () => await
|
|
1697
|
+
!await Q.submit(e, async () => await A.value?.validate() !== !1) && Q.error.value && i("operationError", Error(Q.error.value));
|
|
1683
1698
|
}
|
|
1684
1699
|
async function Xe(e) {
|
|
1685
1700
|
let t = r.actions?.confirmRemove;
|
|
@@ -1687,7 +1702,7 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1687
1702
|
if (typeof t == "function") return t(e);
|
|
1688
1703
|
let n = typeof t?.message == "function" ? t.message(e) : t?.message ?? `确定删除选中的 ${e.length} 条数据吗?`;
|
|
1689
1704
|
try {
|
|
1690
|
-
return await
|
|
1705
|
+
return await pe.confirm(n, t?.title ?? "删除确认", {
|
|
1691
1706
|
cancelButtonText: t?.cancelButtonText ?? "取消",
|
|
1692
1707
|
confirmButtonText: t?.confirmButtonText ?? "删除",
|
|
1693
1708
|
type: "warning"
|
|
@@ -1696,25 +1711,25 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1696
1711
|
return !1;
|
|
1697
1712
|
}
|
|
1698
1713
|
}
|
|
1699
|
-
async function
|
|
1700
|
-
|
|
1714
|
+
async function Ze(e) {
|
|
1715
|
+
De.value = !0;
|
|
1701
1716
|
try {
|
|
1702
1717
|
return await e(), bt(), await Y.load(), !0;
|
|
1703
1718
|
} catch (e) {
|
|
1704
1719
|
return i("operationError", e), !1;
|
|
1705
1720
|
} finally {
|
|
1706
|
-
|
|
1721
|
+
De.value = !1;
|
|
1707
1722
|
}
|
|
1708
1723
|
}
|
|
1709
|
-
async function
|
|
1724
|
+
async function tt(e) {
|
|
1710
1725
|
let t = r.dataSource?.remove, n = !r.dataSource?.beforeRemove || await r.dataSource.beforeRemove([e]);
|
|
1711
|
-
!t || !n || !await Xe([e]) || await
|
|
1726
|
+
!t || !n || !await Xe([e]) || await Ze(() => t(e));
|
|
1712
1727
|
}
|
|
1713
1728
|
async function rt() {
|
|
1714
1729
|
let e = [...Z.selectedRows.value], t = !r.dataSource?.beforeRemove || await r.dataSource.beforeRemove(e);
|
|
1715
|
-
e.length === 0 || !t || !await Xe(e) || await
|
|
1730
|
+
e.length === 0 || !t || !await Xe(e) || await Ze(() => r.dataSource?.removeMany ? r.dataSource.removeMany(e) : Promise.all(e.map((e) => r.dataSource?.remove?.(e))));
|
|
1716
1731
|
}
|
|
1717
|
-
async function
|
|
1732
|
+
async function it() {
|
|
1718
1733
|
if (Q.saving.value) return !1;
|
|
1719
1734
|
if (!Q.dirty.value) return !0;
|
|
1720
1735
|
if (r.editor?.confirmClose) return r.editor.confirmClose({
|
|
@@ -1723,7 +1738,7 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1723
1738
|
row: Q.editingRow.value
|
|
1724
1739
|
});
|
|
1725
1740
|
try {
|
|
1726
|
-
return await
|
|
1741
|
+
return await pe.confirm("表单内容尚未保存,确定关闭吗?", "关闭确认", {
|
|
1727
1742
|
cancelButtonText: "继续编辑",
|
|
1728
1743
|
confirmButtonText: "关闭",
|
|
1729
1744
|
type: "warning"
|
|
@@ -1733,12 +1748,12 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1733
1748
|
}
|
|
1734
1749
|
}
|
|
1735
1750
|
function _t(e) {
|
|
1736
|
-
|
|
1751
|
+
it().then((t) => {
|
|
1737
1752
|
t && e();
|
|
1738
1753
|
});
|
|
1739
1754
|
}
|
|
1740
1755
|
function vt() {
|
|
1741
|
-
|
|
1756
|
+
it().then((e) => {
|
|
1742
1757
|
e && (Q.visible.value = !1);
|
|
1743
1758
|
});
|
|
1744
1759
|
}
|
|
@@ -1752,8 +1767,8 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1752
1767
|
clearSelection: bt,
|
|
1753
1768
|
getCrudElement: () => b.value,
|
|
1754
1769
|
closeEditor: vt,
|
|
1755
|
-
getEditorForm: () =>
|
|
1756
|
-
getQueryForm: () =>
|
|
1770
|
+
getEditorForm: () => A.value,
|
|
1771
|
+
getQueryForm: () => te.value,
|
|
1757
1772
|
getSelectedRowKeys: () => [...Z.selectedRowKeys.value],
|
|
1758
1773
|
getSelectedRows: () => [...Z.selectedRows.value],
|
|
1759
1774
|
getTable: () => F.value,
|
|
@@ -1764,9 +1779,9 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1764
1779
|
query: Re,
|
|
1765
1780
|
reset: ze,
|
|
1766
1781
|
reload: Y.load,
|
|
1767
|
-
removeRow:
|
|
1782
|
+
removeRow: tt,
|
|
1768
1783
|
removeSelectedRows: rt,
|
|
1769
|
-
setFormData: (e) =>
|
|
1784
|
+
setFormData: (e) => A.value?.setValues(e),
|
|
1770
1785
|
toggleFullscreen: He,
|
|
1771
1786
|
toggleQuery: X.toggle,
|
|
1772
1787
|
toggleQueryPanel: We
|
|
@@ -1775,76 +1790,79 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1775
1790
|
ref: b,
|
|
1776
1791
|
class: "lumal-crud-table"
|
|
1777
1792
|
}, [
|
|
1778
|
-
|
|
1793
|
+
fe.value ? ne((C(), c("div", {
|
|
1779
1794
|
key: 0,
|
|
1780
1795
|
ref_key: "queryRef",
|
|
1781
|
-
ref:
|
|
1782
|
-
class: v(["lumal-crud-table__query", { "is-collapsed":
|
|
1783
|
-
}, [f(
|
|
1796
|
+
ref: ee,
|
|
1797
|
+
class: v(["lumal-crud-table__query", { "is-collapsed": O(X).collapsed.value }])
|
|
1798
|
+
}, [f(O(J), {
|
|
1784
1799
|
ref_key: "queryFormRef",
|
|
1785
|
-
ref:
|
|
1800
|
+
ref: te,
|
|
1786
1801
|
modelValue: p.value,
|
|
1787
1802
|
"onUpdate:modelValue": n[0] ||= (e) => p.value = e,
|
|
1788
|
-
schemas:
|
|
1789
|
-
columns:
|
|
1803
|
+
schemas: O(X).visibleSchemas.value,
|
|
1804
|
+
columns: V.value,
|
|
1790
1805
|
"label-width": e.query?.labelWidth ?? 88,
|
|
1791
1806
|
class: "lumal-crud-table__query-form",
|
|
1792
1807
|
onValuesChange: Be
|
|
1793
|
-
}, u({ _: 2 }, [
|
|
1808
|
+
}, u({ _: 2 }, [w(O(X).visibleSchemas.value.filter((e) => t.$slots[`query-${String(e.field)}`]), (e) => ({
|
|
1794
1809
|
name: `field-${String(e.field)}`,
|
|
1795
|
-
fn: P((n) => [
|
|
1810
|
+
fn: P((n) => [T(t.$slots, `query-${String(e.field)}`, y(m(n)), void 0, !0)])
|
|
1796
1811
|
}))]), 1032, [
|
|
1797
1812
|
"modelValue",
|
|
1798
1813
|
"schemas",
|
|
1799
1814
|
"columns",
|
|
1800
1815
|
"label-width"
|
|
1801
|
-
]), l("div",
|
|
1802
|
-
f(
|
|
1816
|
+
]), l("div", ct, [
|
|
1817
|
+
f(O(R), {
|
|
1803
1818
|
type: "primary",
|
|
1804
1819
|
"native-type": "button",
|
|
1805
1820
|
"data-action": "search",
|
|
1806
1821
|
onClick: Re
|
|
1807
1822
|
}, {
|
|
1808
|
-
default: P(() => [d(
|
|
1823
|
+
default: P(() => [d(D(e.query?.searchText ?? e.searchText), 1)]),
|
|
1809
1824
|
_: 1
|
|
1810
1825
|
}),
|
|
1811
|
-
f(
|
|
1826
|
+
f(O(R), {
|
|
1812
1827
|
"native-type": "button",
|
|
1813
1828
|
"data-action": "reset",
|
|
1814
1829
|
onClick: ze
|
|
1815
1830
|
}, {
|
|
1816
|
-
default: P(() => [d(
|
|
1831
|
+
default: P(() => [d(D(e.query?.resetText ?? e.resetText), 1)]),
|
|
1817
1832
|
_: 1
|
|
1818
1833
|
}),
|
|
1819
|
-
|
|
1834
|
+
O(X).canCollapse.value ? (C(), o(O(R), {
|
|
1820
1835
|
key: 0,
|
|
1821
1836
|
"native-type": "button",
|
|
1822
1837
|
"data-action": "toggle-query",
|
|
1823
|
-
"aria-expanded": String(!
|
|
1824
|
-
onClick:
|
|
1838
|
+
"aria-expanded": String(!O(X).collapsed.value),
|
|
1839
|
+
onClick: O(X).toggle
|
|
1825
1840
|
}, {
|
|
1826
|
-
default: P(() => [d(O(
|
|
1841
|
+
default: P(() => [d(D(O(X).collapsed.value ? "展开" : "收起"), 1)]),
|
|
1827
1842
|
_: 1
|
|
1828
1843
|
}, 8, ["aria-expanded", "onClick"])) : s("", !0)
|
|
1829
1844
|
])], 2)), [[M, K.value]]) : s("", !0),
|
|
1830
|
-
|
|
1845
|
+
O(Y).error.value ? (C(), c("div", lt, [l("span", null, D(O(Y).error.value), 1), f(O(R), {
|
|
1831
1846
|
"native-type": "button",
|
|
1832
1847
|
"data-action": "retry",
|
|
1833
|
-
onClick:
|
|
1848
|
+
onClick: O(Y).load
|
|
1834
1849
|
}, {
|
|
1835
1850
|
default: P(() => [...n[5] ||= [d(" 重试 ", -1)]]),
|
|
1836
1851
|
_: 1
|
|
1837
1852
|
}, 8, ["onClick"])])) : s("", !0),
|
|
1838
|
-
l("section",
|
|
1839
|
-
l("div",
|
|
1853
|
+
l("section", ut, [
|
|
1854
|
+
l("div", dt, [f(O(Qe), {
|
|
1840
1855
|
ref_key: "tableRef",
|
|
1841
1856
|
ref: F,
|
|
1842
|
-
columns:
|
|
1843
|
-
|
|
1857
|
+
columns: ie.value,
|
|
1858
|
+
page: h.value,
|
|
1859
|
+
"page-size": g.value,
|
|
1860
|
+
pagination: ue.value,
|
|
1861
|
+
rows: O(Y).currentRows.value,
|
|
1844
1862
|
"row-key": oe.value,
|
|
1845
|
-
"empty-text":
|
|
1863
|
+
"empty-text": se.value,
|
|
1846
1864
|
loading: je.value,
|
|
1847
|
-
selection:
|
|
1865
|
+
selection: z.value,
|
|
1848
1866
|
"show-column-settings": e.table?.showColumnSettings,
|
|
1849
1867
|
"column-settings": e.table?.columnSettings,
|
|
1850
1868
|
"auto-resize": e.table?.autoResize ?? !0,
|
|
@@ -1854,66 +1872,66 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1854
1872
|
height: "100%",
|
|
1855
1873
|
border: !0
|
|
1856
1874
|
},
|
|
1857
|
-
onSelectionChange:
|
|
1875
|
+
onSelectionChange: O(Z).update
|
|
1858
1876
|
}, u({ _: 2 }, [
|
|
1859
1877
|
t.$slots["table-title"] || e.title ? {
|
|
1860
1878
|
name: "toolbar-title",
|
|
1861
|
-
fn: P(() => [
|
|
1879
|
+
fn: P(() => [T(t.$slots, "table-title", {}, () => [d(D(e.title), 1)], !0)]),
|
|
1862
1880
|
key: "0"
|
|
1863
1881
|
} : void 0,
|
|
1864
|
-
|
|
1882
|
+
xe.value || t.$slots.actions || t.$slots["toolbar-actions"] ? {
|
|
1865
1883
|
name: "toolbar",
|
|
1866
1884
|
fn: P(() => [l("div", { class: v(["lumal-crud-table__toolbar", `is-${e.toolbar?.actionsPosition ?? "right"}`]) }, [
|
|
1867
|
-
|
|
1885
|
+
he.value ? T(t.$slots, "create-action", {
|
|
1868
1886
|
key: 0,
|
|
1869
1887
|
openCreate: Ke
|
|
1870
|
-
}, () => [f(
|
|
1888
|
+
}, () => [f(O(R), {
|
|
1871
1889
|
type: "primary",
|
|
1872
1890
|
"native-type": "button",
|
|
1873
1891
|
"data-action": "create",
|
|
1874
1892
|
onClick: Ke
|
|
1875
1893
|
}, {
|
|
1876
|
-
default: P(() => [f(
|
|
1894
|
+
default: P(() => [f(O(I), { name: "lumal:plus" }), d(" " + D(e.toolbar?.createText ?? e.createText), 1)]),
|
|
1877
1895
|
_: 1
|
|
1878
1896
|
})], !0) : s("", !0),
|
|
1879
|
-
|
|
1897
|
+
ge.value ? (C(), o(O(R), {
|
|
1880
1898
|
key: 1,
|
|
1881
1899
|
"native-type": "button",
|
|
1882
1900
|
"data-action": "batch-remove",
|
|
1883
|
-
disabled:
|
|
1901
|
+
disabled: O(Z).selectedRows.value.length === 0 || De.value,
|
|
1884
1902
|
onClick: rt
|
|
1885
1903
|
}, {
|
|
1886
|
-
default: P(() => [d(
|
|
1904
|
+
default: P(() => [d(D(e.toolbar?.batchDeleteText ?? e.batchDeleteText), 1)]),
|
|
1887
1905
|
_: 1
|
|
1888
1906
|
}, 8, ["disabled"])) : s("", !0),
|
|
1889
|
-
|
|
1907
|
+
ve.value ? (C(), o(O(R), {
|
|
1890
1908
|
key: 2,
|
|
1891
1909
|
"native-type": "button",
|
|
1892
1910
|
"data-action": "export",
|
|
1893
1911
|
onClick: Ve
|
|
1894
1912
|
}, {
|
|
1895
|
-
default: P(() => [d(
|
|
1913
|
+
default: P(() => [d(D(e.toolbar?.exportText ?? "导出"), 1)]),
|
|
1896
1914
|
_: 1
|
|
1897
1915
|
})) : s("", !0),
|
|
1898
|
-
|
|
1899
|
-
reload:
|
|
1916
|
+
T(t.$slots, "toolbar-actions", {
|
|
1917
|
+
reload: O(Y).load,
|
|
1900
1918
|
openCreate: Ke,
|
|
1901
|
-
selectedRows:
|
|
1902
|
-
selectedRowKeys:
|
|
1919
|
+
selectedRows: O(Z).selectedRows.value,
|
|
1920
|
+
selectedRowKeys: O(Z).selectedRowKeys.value,
|
|
1903
1921
|
clearSelection: bt
|
|
1904
1922
|
}, void 0, !0),
|
|
1905
|
-
|
|
1923
|
+
T(t.$slots, "actions", {}, void 0, !0)
|
|
1906
1924
|
], 2)]),
|
|
1907
1925
|
key: "1"
|
|
1908
1926
|
} : void 0,
|
|
1909
|
-
|
|
1927
|
+
Se.value || t.$slots["toolbar-tools"] ? {
|
|
1910
1928
|
name: "toolbar-tools",
|
|
1911
|
-
fn: P(() => [l("div",
|
|
1912
|
-
|
|
1913
|
-
reload:
|
|
1929
|
+
fn: P(() => [l("div", ft, [
|
|
1930
|
+
T(t.$slots, "toolbar-tools", {
|
|
1931
|
+
reload: O(Y).load,
|
|
1914
1932
|
toggleFullscreen: He
|
|
1915
1933
|
}, void 0, !0),
|
|
1916
|
-
|
|
1934
|
+
be.value ? (C(), o(O(R), {
|
|
1917
1935
|
key: 0,
|
|
1918
1936
|
circle: "",
|
|
1919
1937
|
"native-type": "button",
|
|
@@ -1924,7 +1942,7 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1924
1942
|
title: K.value ? "隐藏筛选条件" : "显示筛选条件",
|
|
1925
1943
|
onClick: We
|
|
1926
1944
|
}, {
|
|
1927
|
-
default: P(() => [f(
|
|
1945
|
+
default: P(() => [f(O(I), { name: "lumal:filter" })]),
|
|
1928
1946
|
_: 1
|
|
1929
1947
|
}, 8, [
|
|
1930
1948
|
"class",
|
|
@@ -1932,23 +1950,23 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1932
1950
|
"aria-label",
|
|
1933
1951
|
"title"
|
|
1934
1952
|
])) : s("", !0),
|
|
1935
|
-
|
|
1953
|
+
_e.value ? (C(), o(O(R), {
|
|
1936
1954
|
key: 1,
|
|
1937
1955
|
circle: "",
|
|
1938
1956
|
"native-type": "button",
|
|
1939
1957
|
"data-action": "refresh",
|
|
1940
1958
|
"aria-label": e.toolbar?.refreshText ?? "刷新",
|
|
1941
1959
|
title: e.toolbar?.refreshText ?? "刷新",
|
|
1942
|
-
onClick:
|
|
1960
|
+
onClick: O(Y).load
|
|
1943
1961
|
}, {
|
|
1944
|
-
default: P(() => [f(
|
|
1962
|
+
default: P(() => [f(O(I), { name: "lumal:refresh" })]),
|
|
1945
1963
|
_: 1
|
|
1946
1964
|
}, 8, [
|
|
1947
1965
|
"aria-label",
|
|
1948
1966
|
"title",
|
|
1949
1967
|
"onClick"
|
|
1950
1968
|
])) : s("", !0),
|
|
1951
|
-
|
|
1969
|
+
ye.value ? (C(), o(O(R), {
|
|
1952
1970
|
key: 2,
|
|
1953
1971
|
circle: "",
|
|
1954
1972
|
"native-type": "button",
|
|
@@ -1957,7 +1975,7 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1957
1975
|
title: e.toolbar?.fullscreenText ?? (U.value ? "退出全屏" : "全屏"),
|
|
1958
1976
|
onClick: He
|
|
1959
1977
|
}, {
|
|
1960
|
-
default: P(() => [f(
|
|
1978
|
+
default: P(() => [f(O(I), {
|
|
1961
1979
|
name: U.value ? "lumal:fullscreen-exit" : "lumal:fullscreen",
|
|
1962
1980
|
morph: ""
|
|
1963
1981
|
}, null, 8, ["name"])]),
|
|
@@ -1966,45 +1984,45 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
1966
1984
|
])]),
|
|
1967
1985
|
key: "2"
|
|
1968
1986
|
} : void 0,
|
|
1969
|
-
|
|
1987
|
+
w(ie.value.filter((e) => t.$slots[`table-${String(e.field)}`]), (e) => ({
|
|
1970
1988
|
name: `table-${String(e.field)}`,
|
|
1971
|
-
fn: P((n) => [
|
|
1989
|
+
fn: P((n) => [T(t.$slots, `table-${String(e.field)}`, y(m(n)), void 0, !0)])
|
|
1972
1990
|
})),
|
|
1973
|
-
|
|
1991
|
+
me.value || Te.value?.remove || t.$slots["row-actions"] ? {
|
|
1974
1992
|
name: "actions",
|
|
1975
|
-
fn: P(({ row: n, index: r }) => [
|
|
1993
|
+
fn: P(({ row: n, index: r }) => [T(t.$slots, "row-actions", {
|
|
1976
1994
|
row: n,
|
|
1977
1995
|
index: r,
|
|
1978
1996
|
openView: Je,
|
|
1979
1997
|
openEdit: qe,
|
|
1980
|
-
removeRow:
|
|
1998
|
+
removeRow: tt
|
|
1981
1999
|
}, () => [
|
|
1982
|
-
Ge(e.actions?.view,
|
|
2000
|
+
Ge(e.actions?.view, me.value, n, r) ? (C(), o(O(R), {
|
|
1983
2001
|
key: 0,
|
|
1984
2002
|
"native-type": "button",
|
|
1985
2003
|
"data-action": "view",
|
|
1986
2004
|
onClick: (e) => Je(n)
|
|
1987
2005
|
}, {
|
|
1988
|
-
default: P(() => [d(
|
|
2006
|
+
default: P(() => [d(D(e.actions?.viewText ?? "查看"), 1)]),
|
|
1989
2007
|
_: 1
|
|
1990
2008
|
}, 8, ["onClick"])) : s("", !0),
|
|
1991
|
-
Ge(e.actions?.edit,
|
|
2009
|
+
Ge(e.actions?.edit, me.value, n, r) ? (C(), o(O(R), {
|
|
1992
2010
|
key: 1,
|
|
1993
2011
|
"native-type": "button",
|
|
1994
2012
|
"data-action": "edit",
|
|
1995
2013
|
onClick: (e) => qe(n)
|
|
1996
2014
|
}, {
|
|
1997
|
-
default: P(() => [d(
|
|
2015
|
+
default: P(() => [d(D(e.actions?.editText ?? "编辑"), 1)]),
|
|
1998
2016
|
_: 1
|
|
1999
2017
|
}, 8, ["onClick"])) : s("", !0),
|
|
2000
|
-
Ge(e.actions?.remove, !!
|
|
2018
|
+
Ge(e.actions?.remove, !!Te.value?.remove, n, r) ? (C(), o(O(R), {
|
|
2001
2019
|
key: 2,
|
|
2002
2020
|
type: "danger",
|
|
2003
2021
|
"native-type": "button",
|
|
2004
2022
|
"data-action": "remove",
|
|
2005
|
-
onClick: (e) =>
|
|
2023
|
+
onClick: (e) => tt(n)
|
|
2006
2024
|
}, {
|
|
2007
|
-
default: P(() => [d(
|
|
2025
|
+
default: P(() => [d(D(e.actions?.removeText ?? "删除"), 1)]),
|
|
2008
2026
|
_: 1
|
|
2009
2027
|
}, 8, ["onClick"])) : s("", !0)
|
|
2010
2028
|
], !0)]),
|
|
@@ -2012,6 +2030,9 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2012
2030
|
} : void 0
|
|
2013
2031
|
]), 1032, [
|
|
2014
2032
|
"columns",
|
|
2033
|
+
"page",
|
|
2034
|
+
"page-size",
|
|
2035
|
+
"pagination",
|
|
2015
2036
|
"rows",
|
|
2016
2037
|
"row-key",
|
|
2017
2038
|
"empty-text",
|
|
@@ -2024,14 +2045,14 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2024
2045
|
"mobile-action-width",
|
|
2025
2046
|
"onSelectionChange"
|
|
2026
2047
|
])]),
|
|
2027
|
-
t.$slots.default ? (C(), c("div",
|
|
2028
|
-
Me.value ? (C(), c("div",
|
|
2048
|
+
t.$slots.default ? (C(), c("div", pt, [T(t.$slots, "default", {}, void 0, !0)])) : s("", !0),
|
|
2049
|
+
Me.value ? (C(), c("div", mt, [f(O(Ee), {
|
|
2029
2050
|
page: h.value,
|
|
2030
2051
|
"onUpdate:page": n[1] ||= (e) => h.value = e,
|
|
2031
2052
|
"page-size": g.value,
|
|
2032
2053
|
"onUpdate:pageSize": n[2] ||= (e) => g.value = e,
|
|
2033
|
-
total:
|
|
2034
|
-
"page-sizes":
|
|
2054
|
+
total: O(Y).currentTotal.value,
|
|
2055
|
+
"page-sizes": de.value,
|
|
2035
2056
|
onChange: Ue
|
|
2036
2057
|
}, null, 8, [
|
|
2037
2058
|
"page",
|
|
@@ -2040,9 +2061,9 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2040
2061
|
"page-sizes"
|
|
2041
2062
|
])])) : s("", !0)
|
|
2042
2063
|
]),
|
|
2043
|
-
f(
|
|
2044
|
-
modelValue:
|
|
2045
|
-
"onUpdate:modelValue": n[4] ||= (e) =>
|
|
2064
|
+
f($e, {
|
|
2065
|
+
modelValue: O(Q).visible.value,
|
|
2066
|
+
"onUpdate:modelValue": n[4] ||= (e) => O(Q).visible.value = e,
|
|
2046
2067
|
title: $.value,
|
|
2047
2068
|
type: e.editor?.type ?? "dialog",
|
|
2048
2069
|
width: e.editor?.width ?? (e.editor?.type === "drawer" ? "min(720px, 92vw)" : "min(920px, calc(100vw - 32px))"),
|
|
@@ -2050,44 +2071,44 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2050
2071
|
"destroy-on-close": e.editor?.destroyOnClose ?? !0,
|
|
2051
2072
|
"before-close": _t
|
|
2052
2073
|
}, {
|
|
2053
|
-
footer: P(() => [
|
|
2054
|
-
mode:
|
|
2055
|
-
model:
|
|
2074
|
+
footer: P(() => [T(t.$slots, "footer", {
|
|
2075
|
+
mode: O(Q).mode.value,
|
|
2076
|
+
model: O(Q).model.value,
|
|
2056
2077
|
close: vt,
|
|
2057
2078
|
submit: yt
|
|
2058
|
-
}, () => [l("div",
|
|
2079
|
+
}, () => [l("div", gt, [f(O(R), {
|
|
2059
2080
|
"native-type": "button",
|
|
2060
2081
|
onClick: vt
|
|
2061
2082
|
}, {
|
|
2062
|
-
default: P(() => [d(O(
|
|
2083
|
+
default: P(() => [d(D(O(Q).mode.value === "view" ? "关闭" : "取消"), 1)]),
|
|
2063
2084
|
_: 1
|
|
2064
|
-
}),
|
|
2085
|
+
}), O(Q).mode.value === "view" ? s("", !0) : (C(), o(O(R), {
|
|
2065
2086
|
key: 0,
|
|
2066
2087
|
type: "primary",
|
|
2067
2088
|
"native-type": "button",
|
|
2068
|
-
loading:
|
|
2089
|
+
loading: O(Q).saving.value,
|
|
2069
2090
|
onClick: yt
|
|
2070
2091
|
}, {
|
|
2071
|
-
default: P(() => [d(
|
|
2092
|
+
default: P(() => [d(D(e.editor?.submitText ?? "保存"), 1)]),
|
|
2072
2093
|
_: 1
|
|
2073
2094
|
}, 8, ["loading"]))])], !0)]),
|
|
2074
|
-
default: P(() => [
|
|
2095
|
+
default: P(() => [O(Q).error.value ? (C(), c("div", ht, D(O(Q).error.value), 1)) : s("", !0), f(O(J), {
|
|
2075
2096
|
ref_key: "dialogFormRef",
|
|
2076
|
-
ref:
|
|
2077
|
-
modelValue:
|
|
2078
|
-
"onUpdate:modelValue": n[3] ||= (e) =>
|
|
2079
|
-
mode:
|
|
2097
|
+
ref: A,
|
|
2098
|
+
modelValue: O(Q).model.value,
|
|
2099
|
+
"onUpdate:modelValue": n[3] ||= (e) => O(Q).model.value = e,
|
|
2100
|
+
mode: O(Q).mode.value,
|
|
2080
2101
|
schemas: ae.value,
|
|
2081
2102
|
columns: e.editor?.columns ?? 2,
|
|
2082
2103
|
"label-width": e.editor?.labelWidth ?? 88,
|
|
2083
2104
|
loading: e.editor?.loading,
|
|
2084
|
-
disabled:
|
|
2085
|
-
"submit-loading":
|
|
2105
|
+
disabled: O(Q).saving.value || e.editor?.disabled,
|
|
2106
|
+
"submit-loading": O(Q).saving.value,
|
|
2086
2107
|
"show-actions": !1,
|
|
2087
2108
|
onSubmit: Ye
|
|
2088
|
-
}, u({ _: 2 }, [
|
|
2109
|
+
}, u({ _: 2 }, [w(ae.value.filter((e) => t.$slots[`form-${String(e.field)}`]), (e) => ({
|
|
2089
2110
|
name: `field-${String(e.field)}`,
|
|
2090
|
-
fn: P((n) => [
|
|
2111
|
+
fn: P((n) => [T(t.$slots, `form-${String(e.field)}`, y(m(n)), void 0, !0)])
|
|
2091
2112
|
}))]), 1032, [
|
|
2092
2113
|
"modelValue",
|
|
2093
2114
|
"mode",
|
|
@@ -2109,7 +2130,7 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2109
2130
|
])
|
|
2110
2131
|
], 512));
|
|
2111
2132
|
}
|
|
2112
|
-
}), [["__scopeId", "data-v-
|
|
2133
|
+
}), [["__scopeId", "data-v-8f16b57f"]]), vt = { class: "lumal-info-table__value" }, yt = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
2113
2134
|
__name: "LumalInfoTable",
|
|
2114
2135
|
props: {
|
|
2115
2136
|
items: {},
|
|
@@ -2134,31 +2155,31 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2134
2155
|
ref: r,
|
|
2135
2156
|
class: v(["lumal-info-table", { "lumal-info-table--bordered": e.bordered }]),
|
|
2136
2157
|
style: b(s.value)
|
|
2137
|
-
}, [(C(!0), c(i, null,
|
|
2158
|
+
}, [(C(!0), c(i, null, w(o.value, (e) => (C(), c("div", {
|
|
2138
2159
|
key: e.label,
|
|
2139
2160
|
class: "lumal-info-table__item",
|
|
2140
2161
|
style: b({ gridColumn: `span ${f(e)}` })
|
|
2141
2162
|
}, [l("dt", {
|
|
2142
2163
|
class: "lumal-info-table__label",
|
|
2143
2164
|
style: b(u.value)
|
|
2144
|
-
},
|
|
2165
|
+
}, D(e.label), 5), l("dd", vt, D(d(e)), 1)], 4))), 128))], 6));
|
|
2145
2166
|
}
|
|
2146
|
-
}), [["__scopeId", "data-v-3dfbcf43"]]),
|
|
2167
|
+
}), [["__scopeId", "data-v-3dfbcf43"]]), bt = {
|
|
2147
2168
|
key: 0,
|
|
2148
2169
|
class: "lumal-page__header"
|
|
2149
|
-
},
|
|
2170
|
+
}, xt = { class: "lumal-page__heading" }, St = {
|
|
2150
2171
|
key: 0,
|
|
2151
2172
|
class: "lumal-page__title"
|
|
2152
|
-
},
|
|
2173
|
+
}, Ct = {
|
|
2153
2174
|
key: 0,
|
|
2154
2175
|
class: "lumal-page__description"
|
|
2155
|
-
},
|
|
2176
|
+
}, wt = {
|
|
2156
2177
|
key: 0,
|
|
2157
2178
|
class: "lumal-page__actions"
|
|
2158
|
-
},
|
|
2179
|
+
}, Tt = {
|
|
2159
2180
|
key: 1,
|
|
2160
2181
|
class: "lumal-page__loading"
|
|
2161
|
-
},
|
|
2182
|
+
}, Et = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
2162
2183
|
__name: "LumalPage",
|
|
2163
2184
|
props: {
|
|
2164
2185
|
title: {},
|
|
@@ -2188,21 +2209,21 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2188
2209
|
"is-no-padding": e.noPadding
|
|
2189
2210
|
}])
|
|
2190
2211
|
}, [
|
|
2191
|
-
o.value ? (C(), c("header",
|
|
2192
|
-
l("div", { class: v(["lumal-page__body", e.contentClass]) }, [
|
|
2193
|
-
e.loading ? (C(), c("div",
|
|
2212
|
+
o.value ? (C(), c("header", bt, [l("div", xt, [T(t.$slots, "title", {}, () => [e.title ? (C(), c("h2", St, D(e.title), 1)) : s("", !0)], !0), e.description ? (C(), c("p", Ct, D(e.description), 1)) : s("", !0)]), t.$slots.actions ? (C(), c("div", wt, [T(t.$slots, "actions", {}, void 0, !0)])) : s("", !0)])) : s("", !0),
|
|
2213
|
+
l("div", { class: v(["lumal-page__body", e.contentClass]) }, [T(t.$slots, "default", {}, void 0, !0)], 2),
|
|
2214
|
+
e.loading ? (C(), c("div", Tt, D(e.loadingText), 1)) : s("", !0)
|
|
2194
2215
|
], 2));
|
|
2195
2216
|
}
|
|
2196
|
-
}), [["__scopeId", "data-v-c57520b6"]]),
|
|
2217
|
+
}), [["__scopeId", "data-v-c57520b6"]]), Dt = {
|
|
2197
2218
|
key: 0,
|
|
2198
2219
|
class: "lumal-page-layout__query"
|
|
2199
|
-
},
|
|
2220
|
+
}, Ot = { class: "lumal-page-layout__query-body" }, kt = { class: "lumal-page-layout__query-actions" }, At = {
|
|
2200
2221
|
key: 1,
|
|
2201
2222
|
class: "lumal-page-layout__toolbar"
|
|
2202
|
-
},
|
|
2223
|
+
}, jt = { class: "lumal-page-layout__content" }, Mt = {
|
|
2203
2224
|
key: 2,
|
|
2204
2225
|
class: "lumal-page-layout__pagination"
|
|
2205
|
-
},
|
|
2226
|
+
}, Nt = /*#__PURE__*/ r(/* @__PURE__ */ p({
|
|
2206
2227
|
__name: "LumalPageLayout",
|
|
2207
2228
|
props: {
|
|
2208
2229
|
contentScrollable: {
|
|
@@ -2242,27 +2263,27 @@ var st = { class: "lumal-crud-table__query-actions" }, ct = {
|
|
|
2242
2263
|
"is-surface": e.surface
|
|
2243
2264
|
}])
|
|
2244
2265
|
}, [
|
|
2245
|
-
p.value ? (C(), c("div",
|
|
2266
|
+
p.value ? (C(), c("div", Dt, [ne(l("div", Ot, [T(t.$slots, "query", {}, () => [T(t.$slots, "form", {}, void 0, !0)], !0)], 512), [[M, !r.queryCollapsed]]), l("div", kt, [f(O(R), {
|
|
2246
2267
|
type: "primary",
|
|
2247
2268
|
"native-type": "button",
|
|
2248
2269
|
"data-action": "search",
|
|
2249
2270
|
onClick: g
|
|
2250
2271
|
}, {
|
|
2251
|
-
default: P(() => [d(
|
|
2272
|
+
default: P(() => [d(D(r.searchText), 1)]),
|
|
2252
2273
|
_: 1
|
|
2253
|
-
}), f(
|
|
2274
|
+
}), f(O(R), {
|
|
2254
2275
|
"native-type": "button",
|
|
2255
2276
|
"data-action": "reset",
|
|
2256
2277
|
onClick: _
|
|
2257
2278
|
}, {
|
|
2258
|
-
default: P(() => [d(
|
|
2279
|
+
default: P(() => [d(D(r.resetText), 1)]),
|
|
2259
2280
|
_: 1
|
|
2260
2281
|
})])])) : s("", !0),
|
|
2261
|
-
m.value ? (C(), c("div",
|
|
2262
|
-
l("div",
|
|
2263
|
-
h.value ? (C(), c("div",
|
|
2282
|
+
m.value ? (C(), c("div", At, [T(t.$slots, "toolbar", {}, void 0, !0)])) : s("", !0),
|
|
2283
|
+
l("div", jt, [T(t.$slots, "default", {}, void 0, !0)]),
|
|
2284
|
+
h.value ? (C(), c("div", Mt, [T(t.$slots, "pagination", {}, void 0, !0)])) : s("", !0)
|
|
2264
2285
|
], 2));
|
|
2265
2286
|
}
|
|
2266
2287
|
}), [["__scopeId", "data-v-d4b9bb06"]]);
|
|
2267
2288
|
//#endregion
|
|
2268
|
-
export {
|
|
2289
|
+
export { Et as a, et as c, Ee as d, Nt as i, Qe as l, ie as n, yt as o, ae as r, _t as s, L as t, J as u };
|