disguise-ui 0.3.0 → 0.3.1
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/disguise-ui.js +674 -650
- package/dist/style.css +1 -1
- package/dist/types/components/schema-form/schema-form.vue.d.ts +2 -0
- package/dist/types/components/search-form/index.vue.d.ts +2 -1
- package/dist/types/components/table-entity/cells/price-cell.vue.d.ts +10 -2
- package/package.json +1 -1
package/dist/disguise-ui.js
CHANGED
|
@@ -9,7 +9,7 @@ import { t as h } from "./use-file-type-rNstoxXw.js";
|
|
|
9
9
|
import { t as g } from "./file-upload-D7N0tsLF.js";
|
|
10
10
|
import { r as _ } from "./use-multiple-file-upload-Cv2dfA07.js";
|
|
11
11
|
import { t as v } from "./picture-upload-BrrTtaCc.js";
|
|
12
|
-
import { Fragment as y, computed as b, createBlock as x, createCommentVNode as S, createElementBlock as C, createElementVNode as w, createSlots as T, createTextVNode as E, createVNode as D, defineAsyncComponent as O, defineComponent as k, guardReactiveProps as A, h as j, isRef as M, mergeModels as N, mergeProps as P, nextTick as
|
|
12
|
+
import { Fragment as y, computed as b, createBlock as x, createCommentVNode as S, createElementBlock as C, createElementVNode as w, createSlots as T, createTextVNode as E, createVNode as D, defineAsyncComponent as O, defineComponent as k, guardReactiveProps as A, h as j, isRef as M, mergeModels as N, mergeProps as P, nextTick as F, normalizeClass as I, normalizeProps as L, normalizeStyle as R, onUnmounted as ee, openBlock as z, reactive as te, ref as B, renderList as V, renderSlot as H, resolveComponent as U, resolveDirective as ne, resolveDynamicComponent as re, shallowReactive as ie, toDisplayString as W, toHandlers as ae, toValue as G, unref as K, useModel as oe, useSlots as se, vModelSelect as ce, vModelText as le, watch as q, withCtx as J, withDirectives as ue, withKeys as de, withModifiers as fe } from "vue";
|
|
13
13
|
import { ElButton as Y, ElCard as X, ElCascader as pe, ElCheckbox as me, ElCheckboxGroup as he, ElCol as ge, ElDatePicker as _e, ElDrawer as ve, ElDropdown as ye, ElDropdownItem as be, ElDropdownMenu as xe, ElForm as Se, ElFormItem as Ce, ElIcon as Z, ElImageViewer as we, ElInput as Te, ElInputNumber as Ee, ElMessage as Q, ElMessageBox as De, ElOption as $, ElPagination as Oe, ElPopover as ke, ElProgress as Ae, ElRadio as je, ElRadioGroup as Me, ElRow as Ne, ElSelect as Pe, ElSelectV2 as Fe, ElSwitch as Ie, ElTabPane as Le, ElTable as Re, ElTableColumn as ze, ElTableV2 as Be, ElTabs as Ve, ElTooltip as He, ElUpload as Ue, TableV2FixedDir as We } from "element-plus";
|
|
14
14
|
import Ge from "dayjs";
|
|
15
15
|
import Ke from "dayjs/plugin/timezone.js";
|
|
@@ -142,19 +142,19 @@ var Sn = {
|
|
|
142
142
|
setup(e, { emit: t }) {
|
|
143
143
|
let n = e, i = t, [a, o] = r({ onOpenChange: (e) => {
|
|
144
144
|
e !== n.modelValue && i("update:modelValue", e);
|
|
145
|
-
} }), s =
|
|
145
|
+
} }), s = B(), c = B("upload"), l = B(n.defaultMode), u = B(null), f = B(""), p = B([]), m = B(""), h = B([]), g = B([]), _ = B(0), v = B([]), T = B(!1), O = B(!1), k = B(!1), A = B(0), j = B(""), M = B(null), N = B(0), P = b(() => n.title || d("components.importDialog.title")), F = b(() => !!n.api), L = b(() => n.modes?.length ? n.modes : [{
|
|
146
146
|
label: d("components.importDialog.modeCreate"),
|
|
147
147
|
value: "create"
|
|
148
148
|
}, {
|
|
149
149
|
label: d("components.importDialog.modeUpdate"),
|
|
150
150
|
value: "update"
|
|
151
|
-
}]),
|
|
151
|
+
}]), R = b(() => n.tips?.length ? n.tips : [
|
|
152
152
|
d("components.importDialog.tipSize", { size: n.maxSize }),
|
|
153
153
|
d("components.importDialog.tipHeader"),
|
|
154
154
|
d("components.importDialog.tipFormula"),
|
|
155
155
|
d("components.importDialog.tipArea"),
|
|
156
156
|
d("components.importDialog.tipRelation")
|
|
157
|
-
]),
|
|
157
|
+
]), ee = b(() => n.accept.join(",")), te = b(() => n.accept.map((e) => e.replace(/^\./, "").toUpperCase()).join("、")), H = b(() => M.value !== null), U = b(() => !H.value && !F.value), re = b(() => d("components.importDialog.previewSummary", {
|
|
158
158
|
total: _.value,
|
|
159
159
|
count: Math.min(g.value.length, n.maxPreviewCount)
|
|
160
160
|
})), ie = b(() => f.value || u.value?.name || ""), ae = b(() => h.value.map((e) => ({
|
|
@@ -176,7 +176,7 @@ var Sn = {
|
|
|
176
176
|
p.value = [], m.value = "", h.value = [], g.value = [], _.value = 0, v.value = [], M.value = null;
|
|
177
177
|
}
|
|
178
178
|
function fe() {
|
|
179
|
-
|
|
179
|
+
H.value || i("cancel"), i("update:modelValue", !1);
|
|
180
180
|
}
|
|
181
181
|
function X() {
|
|
182
182
|
k.value = !k.value, o.setState({ fullscreen: k.value });
|
|
@@ -223,7 +223,7 @@ var Sn = {
|
|
|
223
223
|
return n.accept.some((e) => {
|
|
224
224
|
let n = e.toLowerCase();
|
|
225
225
|
return n.startsWith(".") ? t.endsWith(n) : r === n;
|
|
226
|
-
}) ? !0 : (Q.error(d("components.importDialog.fileTypeInvalid", { types:
|
|
226
|
+
}) ? !0 : (Q.error(d("components.importDialog.fileTypeInvalid", { types: te.value })), !1);
|
|
227
227
|
}
|
|
228
228
|
function be(e) {
|
|
229
229
|
let t = new Map((e ?? []).map((e) => [e.targetField, e]));
|
|
@@ -291,7 +291,7 @@ var Sn = {
|
|
|
291
291
|
}
|
|
292
292
|
async function ke() {
|
|
293
293
|
if (c.value === "upload") {
|
|
294
|
-
if (
|
|
294
|
+
if (F.value) {
|
|
295
295
|
await Ne();
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
@@ -355,8 +355,8 @@ var Sn = {
|
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
return (e, t) => {
|
|
358
|
-
let n =
|
|
359
|
-
return
|
|
358
|
+
let n = ne("loading");
|
|
359
|
+
return z(), x(K(a), {
|
|
360
360
|
title: P.value,
|
|
361
361
|
class: "import-dialog__dialog w-[600px]",
|
|
362
362
|
closable: !1,
|
|
@@ -371,7 +371,7 @@ var Sn = {
|
|
|
371
371
|
onClick: X
|
|
372
372
|
}, {
|
|
373
373
|
default: J(() => [D(K(Z), { size: 16 }, {
|
|
374
|
-
default: J(() => [k.value ? (
|
|
374
|
+
default: J(() => [k.value ? (z(), x(K(ut), { key: 0 })) : (z(), x(K(rt), { key: 1 }))]),
|
|
375
375
|
_: 1
|
|
376
376
|
})]),
|
|
377
377
|
_: 1
|
|
@@ -387,7 +387,7 @@ var Sn = {
|
|
|
387
387
|
})]),
|
|
388
388
|
_: 1
|
|
389
389
|
})])])]),
|
|
390
|
-
footer: J(() => [w("div", ir, [c.value === "preview" || c.value === "mapping" ? (
|
|
390
|
+
footer: J(() => [w("div", ir, [c.value === "preview" || c.value === "mapping" ? (z(), C(y, { key: 0 }, [D(K(Y), { onClick: Fe }, {
|
|
391
391
|
default: J(() => [E(W(K(d)("components.importDialog.previous")), 1)]),
|
|
392
392
|
_: 1
|
|
393
393
|
}), D(K(Y), {
|
|
@@ -397,38 +397,38 @@ var Sn = {
|
|
|
397
397
|
}, {
|
|
398
398
|
default: J(() => [E(W(c.value === "mapping" ? K(d)("components.importDialog.startImport") : K(d)("components.importDialog.next")), 1)]),
|
|
399
399
|
_: 1
|
|
400
|
-
}, 8, ["loading"])], 64)) : c.value === "upload" ? (
|
|
400
|
+
}, 8, ["loading"])], 64)) : c.value === "upload" ? (z(), x(K(Y), {
|
|
401
401
|
key: 1,
|
|
402
402
|
type: "primary",
|
|
403
403
|
loading: T.value || O.value,
|
|
404
404
|
onClick: ke
|
|
405
405
|
}, {
|
|
406
|
-
default: J(() => [E(W(
|
|
406
|
+
default: J(() => [E(W(F.value ? K(d)("components.importDialog.startImport") : K(d)("components.importDialog.next")), 1)]),
|
|
407
407
|
_: 1
|
|
408
|
-
}, 8, ["loading"])) : (
|
|
408
|
+
}, 8, ["loading"])) : (z(), x(K(Y), {
|
|
409
409
|
key: 2,
|
|
410
410
|
onClick: fe
|
|
411
411
|
}, {
|
|
412
412
|
default: J(() => [E(W(K(d)("common.close")), 1)]),
|
|
413
413
|
_: 1
|
|
414
414
|
}))])]),
|
|
415
|
-
default: J(() => [w("div", En, [
|
|
415
|
+
default: J(() => [w("div", En, [U.value ? (z(), C("div", Dn, [(z(!0), C(y, null, V(ce.value, (e, t) => (z(), C("div", {
|
|
416
416
|
key: e,
|
|
417
417
|
class: "import-dialog__step"
|
|
418
418
|
}, [
|
|
419
|
-
w("div", { class:
|
|
419
|
+
w("div", { class: I(["import-dialog__step-node", {
|
|
420
420
|
"is-active": c.value === "upload" && t === 0 || c.value === "preview" && t === 1 || c.value === "mapping" && t === 2 || c.value === "importing" && t === 3,
|
|
421
421
|
"is-done": c.value === "preview" && t === 0 || c.value === "mapping" && t <= 1 || c.value === "importing" && t <= 2
|
|
422
|
-
}]) }, [c.value === "preview" && t === 0 || c.value === "mapping" && t <= 1 || c.value === "importing" && t <= 2 ? (
|
|
422
|
+
}]) }, [c.value === "preview" && t === 0 || c.value === "mapping" && t <= 1 || c.value === "importing" && t <= 2 ? (z(), x(K(Z), { key: 0 }, {
|
|
423
423
|
default: J(() => [D(K(Qe))]),
|
|
424
424
|
_: 1
|
|
425
|
-
})) : (
|
|
425
|
+
})) : (z(), C("span", On, W(t + 1), 1))], 2),
|
|
426
426
|
w("div", kn, W(e), 1),
|
|
427
|
-
t === ce.value.length - 1 ? S("", !0) : (
|
|
427
|
+
t === ce.value.length - 1 ? S("", !0) : (z(), C("div", {
|
|
428
428
|
key: 0,
|
|
429
|
-
class:
|
|
429
|
+
class: I(["import-dialog__step-line", { "is-active": c.value === "preview" && t === 0 || c.value === "mapping" && t <= 1 || c.value === "importing" && t <= 2 }])
|
|
430
430
|
}, null, 2))
|
|
431
|
-
]))), 128))])) : S("", !0), c.value === "upload" ? (
|
|
431
|
+
]))), 128))])) : S("", !0), c.value === "upload" ? (z(), C(y, { key: 1 }, [
|
|
432
432
|
w("div", An, [w("span", null, W(K(d)("components.importDialog.modeLabel")), 1), D(K(He), { content: K(d)("components.importDialog.modeHelp") }, {
|
|
433
433
|
default: J(() => [D(K(Z), { class: "import-dialog__info" }, {
|
|
434
434
|
default: J(() => [D(K(it))]),
|
|
@@ -441,7 +441,7 @@ var Sn = {
|
|
|
441
441
|
class: "import-dialog__mode-group",
|
|
442
442
|
"onUpdate:modelValue": Ee
|
|
443
443
|
}, {
|
|
444
|
-
default: J(() => [(
|
|
444
|
+
default: J(() => [(z(!0), C(y, null, V(L.value, (e) => (z(), x(K(je), {
|
|
445
445
|
key: e.value,
|
|
446
446
|
label: e.value,
|
|
447
447
|
disabled: e.disabled
|
|
@@ -458,7 +458,7 @@ var Sn = {
|
|
|
458
458
|
drag: "",
|
|
459
459
|
"auto-upload": !1,
|
|
460
460
|
"show-file-list": !1,
|
|
461
|
-
accept:
|
|
461
|
+
accept: ee.value,
|
|
462
462
|
"on-change": we
|
|
463
463
|
}, {
|
|
464
464
|
default: J(() => [w("div", jn, [
|
|
@@ -467,8 +467,8 @@ var Sn = {
|
|
|
467
467
|
_: 1
|
|
468
468
|
})]),
|
|
469
469
|
w("div", Nn, [E(W(K(d)("components.importDialog.uploadPlaceholder")) + " ", 1), w("span", Pn, W(K(d)("components.importDialog.selectUpload")), 1)]),
|
|
470
|
-
w("div", Fn, W(K(d)("components.importDialog.supportedTypes", { types:
|
|
471
|
-
ie.value ? (
|
|
470
|
+
w("div", Fn, W(K(d)("components.importDialog.supportedTypes", { types: te.value })), 1),
|
|
471
|
+
ie.value ? (z(), C("div", In, W(ie.value), 1)) : S("", !0)
|
|
472
472
|
])]),
|
|
473
473
|
_: 1
|
|
474
474
|
}, 8, ["accept"]),
|
|
@@ -484,11 +484,11 @@ var Sn = {
|
|
|
484
484
|
onClick: pe
|
|
485
485
|
}, W(K(d)("components.importDialog.downloadTemplate")), 1)
|
|
486
486
|
]),
|
|
487
|
-
w("div", Rn, [(
|
|
487
|
+
w("div", Rn, [(z(!0), C(y, null, V(R.value, (e) => (z(), C("div", {
|
|
488
488
|
key: e,
|
|
489
489
|
class: "import-dialog__tip-item"
|
|
490
490
|
}, W(e), 1))), 128))])
|
|
491
|
-
], 64)) : c.value === "preview" ? (
|
|
491
|
+
], 64)) : c.value === "preview" ? (z(), C(y, { key: 2 }, [
|
|
492
492
|
w("div", zn, [w("div", Bn, [w("div", Vn, W(K(d)("components.importDialog.fileLabel")), 1), D(K(Te), {
|
|
493
493
|
"model-value": ie.value,
|
|
494
494
|
readonly: ""
|
|
@@ -499,20 +499,20 @@ var Sn = {
|
|
|
499
499
|
disabled: T.value,
|
|
500
500
|
onChange: De
|
|
501
501
|
}, {
|
|
502
|
-
default: J(() => [(
|
|
502
|
+
default: J(() => [(z(!0), C(y, null, V(p.value, (e) => (z(), x(K($), {
|
|
503
503
|
key: e.value,
|
|
504
504
|
label: e.label,
|
|
505
505
|
value: e.value
|
|
506
506
|
}, null, 8, ["label", "value"]))), 128))]),
|
|
507
507
|
_: 1
|
|
508
508
|
}, 8, ["modelValue", "disabled"])])]),
|
|
509
|
-
ue((
|
|
509
|
+
ue((z(), x(K(Re), {
|
|
510
510
|
data: g.value,
|
|
511
511
|
border: "",
|
|
512
512
|
height: "352",
|
|
513
513
|
class: "import-dialog__table"
|
|
514
514
|
}, {
|
|
515
|
-
default: J(() => [(
|
|
515
|
+
default: J(() => [(z(!0), C(y, null, V(h.value, (e) => (z(), x(K(ze), {
|
|
516
516
|
key: e.prop,
|
|
517
517
|
prop: e.prop,
|
|
518
518
|
label: e.label,
|
|
@@ -527,13 +527,13 @@ var Sn = {
|
|
|
527
527
|
]))), 128))]),
|
|
528
528
|
_: 1
|
|
529
529
|
}, 8, ["data"])), [[n, T.value]]),
|
|
530
|
-
w("div", Wn, W(
|
|
531
|
-
], 64)) : c.value === "mapping" ? (
|
|
530
|
+
w("div", Wn, W(re.value), 1)
|
|
531
|
+
], 64)) : c.value === "mapping" ? (z(), C(y, { key: 3 }, [w("div", Gn, [
|
|
532
532
|
w("div", null, W(K(d)("components.importDialog.mappingExcelColumn")), 1),
|
|
533
533
|
t[1] ||= w("div", null, null, -1),
|
|
534
534
|
w("div", null, W(K(d)("components.importDialog.mappingTargetField")), 1),
|
|
535
535
|
w("div", null, W(K(d)("components.importDialog.mappingDuplicateLabel")), 1)
|
|
536
|
-
]), w("div", Kn, [(
|
|
536
|
+
]), w("div", Kn, [(z(!0), C(y, null, V(v.value, (e) => (z(), C("div", {
|
|
537
537
|
key: e.targetField,
|
|
538
538
|
class: "import-dialog__mapping-row"
|
|
539
539
|
}, [
|
|
@@ -543,7 +543,7 @@ var Sn = {
|
|
|
543
543
|
clearable: "",
|
|
544
544
|
placeholder: K(d)("common.pleaseSelect")
|
|
545
545
|
}, {
|
|
546
|
-
default: J(() => [(
|
|
546
|
+
default: J(() => [(z(!0), C(y, null, V(ae.value, (e) => (z(), x(K($), {
|
|
547
547
|
key: e.value,
|
|
548
548
|
label: e.label,
|
|
549
549
|
value: e.value
|
|
@@ -558,7 +558,7 @@ var Sn = {
|
|
|
558
558
|
default: J(() => [D(K(Ye))]),
|
|
559
559
|
_: 1
|
|
560
560
|
})]),
|
|
561
|
-
w("div", { class:
|
|
561
|
+
w("div", { class: I(["import-dialog__mapping-target", { "is-required": e.required }]) }, W(e.targetLabel), 3),
|
|
562
562
|
w("div", Jn, [D(K(me), {
|
|
563
563
|
modelValue: e.duplicateCheck,
|
|
564
564
|
"onUpdate:modelValue": (t) => e.duplicateCheck = t,
|
|
@@ -568,21 +568,21 @@ var Sn = {
|
|
|
568
568
|
"onUpdate:modelValue",
|
|
569
569
|
"disabled"
|
|
570
570
|
])])
|
|
571
|
-
]))), 128))])], 64)) :
|
|
572
|
-
w("div", { class:
|
|
571
|
+
]))), 128))])], 64)) : H.value ? (z(), C(y, { key: 4 }, [
|
|
572
|
+
w("div", { class: I(["import-dialog__result-illustration", {
|
|
573
573
|
"is-success": M.value?.success,
|
|
574
574
|
"is-error": !M.value?.success
|
|
575
|
-
}]) }, [t[2] ||= w("div", { class: "import-dialog__result-card" }, [w("div", { class: "import-dialog__result-layer" }), w("div", { class: "import-dialog__result-layer is-front" })], -1), w("div", Yn, [M.value?.success ? (
|
|
575
|
+
}]) }, [t[2] ||= w("div", { class: "import-dialog__result-card" }, [w("div", { class: "import-dialog__result-layer" }), w("div", { class: "import-dialog__result-layer is-front" })], -1), w("div", Yn, [M.value?.success ? (z(), x(K(Z), { key: 0 }, {
|
|
576
576
|
default: J(() => [D(K(pt))]),
|
|
577
577
|
_: 1
|
|
578
|
-
})) : (
|
|
578
|
+
})) : (z(), x(K(Z), { key: 1 }, {
|
|
579
579
|
default: J(() => [D(K(mt))]),
|
|
580
580
|
_: 1
|
|
581
581
|
}))])], 2),
|
|
582
582
|
w("div", Xn, W(oe.value), 1),
|
|
583
583
|
w("div", Zn, W(se.value), 1),
|
|
584
|
-
M.value?.detail ? (
|
|
585
|
-
], 64)) : c.value === "importing" ? (
|
|
584
|
+
M.value?.detail ? (z(), C("div", Qn, W(M.value.detail), 1)) : S("", !0)
|
|
585
|
+
], 64)) : c.value === "importing" ? (z(), C(y, { key: 5 }, [
|
|
586
586
|
w("div", $n, [D(K(Ae), {
|
|
587
587
|
percentage: A.value,
|
|
588
588
|
"stroke-width": 10,
|
|
@@ -616,7 +616,7 @@ var Sn = {
|
|
|
616
616
|
"reset"
|
|
617
617
|
],
|
|
618
618
|
setup(e, { emit: t }) {
|
|
619
|
-
let n = e, r = t, i =
|
|
619
|
+
let n = e, r = t, i = B([...n.settings]);
|
|
620
620
|
q(() => n.settings, (e) => {
|
|
621
621
|
i.value = e.map((e) => ({ ...e }));
|
|
622
622
|
}, { deep: !0 });
|
|
@@ -633,7 +633,7 @@ var Sn = {
|
|
|
633
633
|
function l(e) {
|
|
634
634
|
return n.fixedItems.find((t) => t.key === e)?.fixed ?? !1;
|
|
635
635
|
}
|
|
636
|
-
return (e, t) => (
|
|
636
|
+
return (e, t) => (z(), C("div", or, [
|
|
637
637
|
w("div", sr, [w("span", cr, W(K(d)("components.tableEntity.columnSettings")), 1), D(K(Y), {
|
|
638
638
|
type: "primary",
|
|
639
639
|
link: "",
|
|
@@ -659,9 +659,9 @@ var Sn = {
|
|
|
659
659
|
"ghost-class": "column-settings-panel__ghost",
|
|
660
660
|
onUpdate: o
|
|
661
661
|
}, {
|
|
662
|
-
default: J(() => [(
|
|
662
|
+
default: J(() => [(z(!0), C(y, null, V(i.value, (e) => (z(), C("div", {
|
|
663
663
|
key: e.key,
|
|
664
|
-
class:
|
|
664
|
+
class: I(["column-settings-panel__item", { "column-settings-panel__item--hidden": !e.visible }])
|
|
665
665
|
}, [
|
|
666
666
|
w("span", dr, [D(K(Z), null, {
|
|
667
667
|
default: J(() => [D(K(ot))]),
|
|
@@ -760,7 +760,7 @@ var Sn = {
|
|
|
760
760
|
}), [["__scopeId", "data-v-a07ab19c"]]);
|
|
761
761
|
// src/components/table-entity/composables/use-column-fixed.ts
|
|
762
762
|
function gr(e) {
|
|
763
|
-
let t =
|
|
763
|
+
let t = B({});
|
|
764
764
|
function n(e) {
|
|
765
765
|
return e.fixed === !0 || e.fixed === "left" ? "left" : e.fixed === "right" && "right";
|
|
766
766
|
}
|
|
@@ -831,7 +831,7 @@ function _r(e) {
|
|
|
831
831
|
}
|
|
832
832
|
// src/components/table-entity/composables/use-column-resize.ts
|
|
833
833
|
function vr(e = 50) {
|
|
834
|
-
let t =
|
|
834
|
+
let t = te({}), n = te({
|
|
835
835
|
active: !1,
|
|
836
836
|
colKey: null,
|
|
837
837
|
startX: 0,
|
|
@@ -872,7 +872,7 @@ function vr(e = 50) {
|
|
|
872
872
|
display: n.active ? "block" : "none",
|
|
873
873
|
left: `${n.currentX}px`
|
|
874
874
|
}));
|
|
875
|
-
return
|
|
875
|
+
return ee(() => {
|
|
876
876
|
n.active && (n.active = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "");
|
|
877
877
|
}), {
|
|
878
878
|
widthOverrides: t,
|
|
@@ -884,7 +884,7 @@ function vr(e = 50) {
|
|
|
884
884
|
}
|
|
885
885
|
// src/components/table-entity/composables/use-column-settings.ts
|
|
886
886
|
function yr(e) {
|
|
887
|
-
let t =
|
|
887
|
+
let t = B([]), n = B(/* @__PURE__ */ new Set()), r = B({}), i = B({}), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = {};
|
|
888
888
|
function c(e) {
|
|
889
889
|
return e.filter((e) => !!e).filter((e) => !!xr(e)).map((e) => xr(e));
|
|
890
890
|
}
|
|
@@ -1019,7 +1019,7 @@ function Tr(e, t, n) {
|
|
|
1019
1019
|
return i === void 0 ? e : (r.splice(n, 0, i), r);
|
|
1020
1020
|
}
|
|
1021
1021
|
function Er(e) {
|
|
1022
|
-
let t =
|
|
1022
|
+
let t = B(null), n = B(null), r = 0, i = 0, a = !1, o = "", s = "";
|
|
1023
1023
|
function c(t, n, r) {
|
|
1024
1024
|
let i = e.getRows();
|
|
1025
1025
|
if (t < 0 || t >= i.length) return null;
|
|
@@ -1106,7 +1106,7 @@ function Er(e) {
|
|
|
1106
1106
|
let p = c[r], m = c[i];
|
|
1107
1107
|
if (!p || !m) return;
|
|
1108
1108
|
let h = e.moveRows(p, m, r, i);
|
|
1109
|
-
h && (e.onSort(h), await
|
|
1109
|
+
h && (e.onSort(h), await F(), d(s, l));
|
|
1110
1110
|
}
|
|
1111
1111
|
function h(c) {
|
|
1112
1112
|
if (!e.isEnabled() || c.button !== 0) return;
|
|
@@ -1119,7 +1119,7 @@ function Er(e) {
|
|
|
1119
1119
|
let h = Sr(f, e.getRowHeight()), g = h == null ? void 0 : e.getRows()[h];
|
|
1120
1120
|
h != null && g && !e.isRowDisabled(g) && (c.preventDefault(), r = c.clientX, i = c.clientY, a = !1, t.value = h, n.value = h, o = document.body.style.cursor, s = document.body.style.userSelect, document.body.style.cursor = "grabbing", document.body.style.userSelect = "none", document.addEventListener("pointermove", p), document.addEventListener("pointerup", m));
|
|
1121
1121
|
}
|
|
1122
|
-
return
|
|
1122
|
+
return ee(f), {
|
|
1123
1123
|
draggingIndex: t,
|
|
1124
1124
|
onPointerDown: h,
|
|
1125
1125
|
overIndex: n
|
|
@@ -1128,7 +1128,7 @@ function Er(e) {
|
|
|
1128
1128
|
// src/components/table-entity/composables/use-table-selection.ts
|
|
1129
1129
|
var Dr = 40;
|
|
1130
1130
|
function Or(e, t, n, r = n) {
|
|
1131
|
-
let i =
|
|
1131
|
+
let i = B(/* @__PURE__ */ new Set()), a = B(/* @__PURE__ */ new Map()), o = B(-1), s = () => e.rowKey ?? "id";
|
|
1132
1132
|
q(() => e.selectedKeys, (e) => {
|
|
1133
1133
|
i.value = new Set(e ?? []);
|
|
1134
1134
|
}, { immediate: !0 }), q(() => r.value, (e) => {
|
|
@@ -1296,9 +1296,9 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1296
1296
|
let e = t.color ?? i.value?.color ?? i.value?.cssClass;
|
|
1297
1297
|
return typeof e == "string" && e ? e : void 0;
|
|
1298
1298
|
}), s = b(() => o.value ? n[o.value] ?? "dict-tag--colored" : ""), c = b(() => o.value && !n[o.value] ? { "--dict-tag-color": o.value } : {});
|
|
1299
|
-
return (e, t) => (
|
|
1300
|
-
class:
|
|
1301
|
-
style:
|
|
1299
|
+
return (e, t) => (z(), C("span", {
|
|
1300
|
+
class: I(["dict-tag", s.value]),
|
|
1301
|
+
style: R(c.value)
|
|
1302
1302
|
}, W(a.value), 7));
|
|
1303
1303
|
}
|
|
1304
1304
|
}), [["__scopeId", "data-v-0d76da83"]]), Lr = { class: "file-cell flex items-center" }, Rr = {
|
|
@@ -1372,15 +1372,15 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1372
1372
|
})), m = b(() => f.value.slice(0, t.maxPreviewCount)), g = b(() => Math.max(0, f.value.length - m.value.length)), _ = (e) => {
|
|
1373
1373
|
e.fileUrl && window.open(e.fileUrl, "_blank");
|
|
1374
1374
|
}, v = (e) => !e || e <= 0 ? "" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(2)} MB`;
|
|
1375
|
-
return (t, r) => (
|
|
1376
|
-
d.value.length > 0 ? (
|
|
1375
|
+
return (t, r) => (z(), C("div", Lr, [d.value.length > 0 || m.value.length > 0 ? (z(), C("div", Rr, [
|
|
1376
|
+
d.value.length > 0 ? (z(), x(n, {
|
|
1377
1377
|
key: 0,
|
|
1378
1378
|
urls: d.value,
|
|
1379
1379
|
"max-preview-count": e.maxPreviewCount,
|
|
1380
1380
|
size: 26,
|
|
1381
1381
|
"image-list-props": {}
|
|
1382
1382
|
}, null, 8, ["urls", "max-preview-count"])) : S("", !0),
|
|
1383
|
-
(
|
|
1383
|
+
(z(!0), C(y, null, V(m.value, (e) => (z(), x(K(He), {
|
|
1384
1384
|
key: e.fileUrl,
|
|
1385
1385
|
placement: "top",
|
|
1386
1386
|
effect: "light",
|
|
@@ -1388,7 +1388,7 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1388
1388
|
teleported: !0,
|
|
1389
1389
|
"z-index": 3e3
|
|
1390
1390
|
}, {
|
|
1391
|
-
content: J(() => [e.kind === "pdf" ? (
|
|
1391
|
+
content: J(() => [e.kind === "pdf" ? (z(), C("iframe", {
|
|
1392
1392
|
key: 0,
|
|
1393
1393
|
src: e.fileUrl,
|
|
1394
1394
|
style: {
|
|
@@ -1397,16 +1397,16 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1397
1397
|
height: "500px",
|
|
1398
1398
|
border: "none"
|
|
1399
1399
|
}
|
|
1400
|
-
}, null, 8, zr)) : (
|
|
1400
|
+
}, null, 8, zr)) : (z(), C("div", Br, [
|
|
1401
1401
|
w("div", Vr, W(e.fileOriginName), 1),
|
|
1402
1402
|
w("div", Hr, "类型:" + W(e.kindLabel), 1),
|
|
1403
|
-
v(e.size) ? (
|
|
1403
|
+
v(e.size) ? (z(), C("div", Ur, " 大小:" + W(v(e.size)), 1)) : S("", !0),
|
|
1404
1404
|
r[0] ||= w("div", { style: { color: "#909399" } }, "点击打开 / 下载", -1)
|
|
1405
1405
|
]))]),
|
|
1406
1406
|
default: J(() => [w("div", {
|
|
1407
1407
|
class: "file-cell__item",
|
|
1408
1408
|
onClick: fe((t) => _(e), ["stop"])
|
|
1409
|
-
}, [w("div", Gr, [e.iconSvg ? (
|
|
1409
|
+
}, [w("div", Gr, [e.iconSvg ? (z(), C("img", {
|
|
1410
1410
|
key: 0,
|
|
1411
1411
|
src: e.iconSvg,
|
|
1412
1412
|
alt: "",
|
|
@@ -1414,8 +1414,8 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1414
1414
|
}, null, 8, Kr)) : S("", !0)])], 8, Wr)]),
|
|
1415
1415
|
_: 2
|
|
1416
1416
|
}, 1024))), 128)),
|
|
1417
|
-
g.value > 0 ? (
|
|
1418
|
-
])) : (
|
|
1417
|
+
g.value > 0 ? (z(), C("span", qr, " +" + W(g.value), 1)) : S("", !0)
|
|
1418
|
+
])) : (z(), C("span", Jr, "-"))]));
|
|
1419
1419
|
}
|
|
1420
1420
|
}), Xr = /* @__PURE__ */ e({ default: () => Zr }), Zr = /*#__PURE__*/ f(Yr, [["__scopeId", "data-v-b8fd048b"]]), Qr = {
|
|
1421
1421
|
key: 0,
|
|
@@ -1441,13 +1441,13 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1441
1441
|
function c(e) {
|
|
1442
1442
|
e.stopPropagation(), r("toggle");
|
|
1443
1443
|
}
|
|
1444
|
-
return (t, n) => e.items.length > 0 ? (
|
|
1444
|
+
return (t, n) => e.items.length > 0 ? (z(), C("div", Qr, [(z(!0), C(y, null, V(o.value, (t, n) => (z(), C("div", {
|
|
1445
1445
|
key: `${n}-${t}`,
|
|
1446
1446
|
class: "list-expand-cell__item"
|
|
1447
|
-
}, [w("span", null, W(n + 1) + ".", 1), e.html ? (
|
|
1447
|
+
}, [w("span", null, W(n + 1) + ".", 1), e.html ? (z(), C("span", {
|
|
1448
1448
|
key: 0,
|
|
1449
1449
|
innerHTML: t
|
|
1450
|
-
}, null, 8, $r)) : (
|
|
1450
|
+
}, null, 8, $r)) : (z(), C("span", ei, W(t), 1))]))), 128)), a.value ? (z(), C("button", {
|
|
1451
1451
|
key: 0,
|
|
1452
1452
|
class: "list-expand-cell__toggle",
|
|
1453
1453
|
type: "button",
|
|
@@ -1456,64 +1456,72 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1456
1456
|
count: e.items.length,
|
|
1457
1457
|
unit: s.value
|
|
1458
1458
|
})), 1), D(K(Z), { class: "list-expand-cell__icon" }, {
|
|
1459
|
-
default: J(() => [e.expanded ? (
|
|
1459
|
+
default: J(() => [e.expanded ? (z(), x(K(Xe), { key: 0 })) : (z(), x(K(Je), { key: 1 }))]),
|
|
1460
1460
|
_: 1
|
|
1461
|
-
})])) : S("", !0)])) : (
|
|
1461
|
+
})])) : S("", !0)])) : (z(), C("span", ti, "-"));
|
|
1462
1462
|
}
|
|
1463
|
-
}), [["__scopeId", "data-v-284ac7ae"]]), ri = { class: "price-cell" }, ii =
|
|
1464
|
-
key: 0,
|
|
1465
|
-
class: "ml-1 line-through"
|
|
1466
|
-
}, oi = /* @__PURE__ */ k({
|
|
1463
|
+
}), [["__scopeId", "data-v-284ac7ae"]]), ri = { class: "price-cell" }, ii = /* @__PURE__ */ k({
|
|
1467
1464
|
__name: "price-cell",
|
|
1468
1465
|
props: {
|
|
1469
1466
|
price: { default: "" },
|
|
1470
|
-
|
|
1467
|
+
oldPrice: { default: "" },
|
|
1468
|
+
unit: { default: "$" },
|
|
1469
|
+
toFixed: { default: 2 },
|
|
1470
|
+
style: { default: () => ({}) },
|
|
1471
|
+
oldPriceStyle: { default: () => ({}) }
|
|
1471
1472
|
},
|
|
1472
1473
|
setup(e) {
|
|
1473
|
-
let t = (e) => {
|
|
1474
|
-
let
|
|
1475
|
-
return
|
|
1474
|
+
let t = e, n = (e) => {
|
|
1475
|
+
let n = String(e ?? "").replace(/[^0-9.-]/g, ""), r = parseFloat(n), i = isNaN(r) ? "0.00" : r.toFixed(t.toFixed);
|
|
1476
|
+
return `${t.unit}${i}`;
|
|
1476
1477
|
};
|
|
1477
|
-
return (
|
|
1478
|
+
return (r, i) => (z(), C("div", ri, [w("span", {
|
|
1479
|
+
class: "text-[red]",
|
|
1480
|
+
style: R(t.style)
|
|
1481
|
+
}, W(n(e.price)), 5), e.oldPrice ? (z(), C("span", {
|
|
1482
|
+
key: 0,
|
|
1483
|
+
class: "ml-1 line-through",
|
|
1484
|
+
style: R(t.oldPriceStyle)
|
|
1485
|
+
}, W(n(e.oldPrice)), 5)) : S("", !0)]));
|
|
1478
1486
|
}
|
|
1479
1487
|
});
|
|
1480
1488
|
// src/components/table-entity/utils/column-utils.ts
|
|
1481
|
-
function
|
|
1489
|
+
function ai(e) {
|
|
1482
1490
|
return `${e}Col`;
|
|
1483
1491
|
}
|
|
1484
|
-
var
|
|
1492
|
+
var oi = [
|
|
1485
1493
|
"create_time",
|
|
1486
1494
|
"createTime",
|
|
1487
1495
|
"created_at",
|
|
1488
1496
|
"createdAt",
|
|
1489
1497
|
"created_time"
|
|
1490
|
-
],
|
|
1498
|
+
], si = [
|
|
1491
1499
|
"update_time",
|
|
1492
1500
|
"updateTime",
|
|
1493
1501
|
"updated_at",
|
|
1494
1502
|
"updatedAt",
|
|
1495
1503
|
"updated_time"
|
|
1496
1504
|
];
|
|
1497
|
-
function
|
|
1505
|
+
function ci(e) {
|
|
1498
1506
|
return e == null || e === "";
|
|
1499
1507
|
}
|
|
1500
|
-
function
|
|
1501
|
-
return
|
|
1508
|
+
function li(e) {
|
|
1509
|
+
return oi.includes(e) ? oi : si.includes(e) ? si : [];
|
|
1502
1510
|
}
|
|
1503
|
-
function
|
|
1511
|
+
function ui(e, t, n) {
|
|
1504
1512
|
let r = n === void 0 ? e?.[t] : n;
|
|
1505
|
-
if (!
|
|
1506
|
-
for (let n of
|
|
1513
|
+
if (!ci(r) || !e) return r;
|
|
1514
|
+
for (let n of li(t)) {
|
|
1507
1515
|
if (n === t) continue;
|
|
1508
1516
|
let r = e[n];
|
|
1509
|
-
if (!
|
|
1517
|
+
if (!ci(r)) return r;
|
|
1510
1518
|
}
|
|
1511
1519
|
return r;
|
|
1512
1520
|
}
|
|
1513
|
-
function
|
|
1514
|
-
return
|
|
1521
|
+
function di(e, t) {
|
|
1522
|
+
return ci(e) ? "--" : t === "datetime" ? yn(e) : t === "date" ? vn(e) : fi(e);
|
|
1515
1523
|
}
|
|
1516
|
-
function
|
|
1524
|
+
function fi(e) {
|
|
1517
1525
|
if (e == null || e === "") return "--";
|
|
1518
1526
|
if (typeof e == "object") try {
|
|
1519
1527
|
return JSON.stringify(e);
|
|
@@ -1523,13 +1531,13 @@ function mi(e) {
|
|
|
1523
1531
|
return String(e);
|
|
1524
1532
|
}
|
|
1525
1533
|
// src/components/table-entity/utils/list-expand.ts
|
|
1526
|
-
function
|
|
1534
|
+
function pi(e) {
|
|
1527
1535
|
return String(e.key ?? e.dataKey ?? e.dataIndex ?? "");
|
|
1528
1536
|
}
|
|
1529
|
-
function
|
|
1537
|
+
function mi(e, t) {
|
|
1530
1538
|
return `${String(e)}::${t}`;
|
|
1531
1539
|
}
|
|
1532
|
-
function
|
|
1540
|
+
function hi(e, t = "name") {
|
|
1533
1541
|
return (Array.isArray(e) ? e : typeof e == "string" ? e.split(/\r?\n/).map((e) => e.trim()).filter(Boolean) : e == null || e === "" ? [] : [e]).map((e) => {
|
|
1534
1542
|
if (e == null || e === "") return "";
|
|
1535
1543
|
if (typeof e != "object") return String(e);
|
|
@@ -1538,37 +1546,39 @@ function _i(e, t = "name") {
|
|
|
1538
1546
|
}).filter(Boolean);
|
|
1539
1547
|
}
|
|
1540
1548
|
// src/components/table-entity/utils/column-slots.ts
|
|
1541
|
-
var
|
|
1542
|
-
function
|
|
1543
|
-
return e == null || e === "" ? [] : (Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : [e]).map((e) => e && typeof e == "object" ? e.fileUrl ?? e.url : e).map((e) =>
|
|
1549
|
+
var gi = O(() => Promise.resolve().then(() => Xr)), _i = O(() => import("./picture-cell-BhKqFZUx.js").then((e) => e.n)), vi = O(() => import("./avatar-cell-CSanGG5Y.js")), { resolveImageUrl: yi } = p();
|
|
1550
|
+
function bi(e) {
|
|
1551
|
+
return e == null || e === "" ? [] : (Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : [e]).map((e) => e && typeof e == "object" ? e.fileUrl ?? e.url : e).map((e) => yi(e)).filter(Boolean);
|
|
1544
1552
|
}
|
|
1545
|
-
var
|
|
1546
|
-
function
|
|
1553
|
+
var xi = (e) => Array.isArray(e) ? e.map((e) => ({ fileUrl: e })) : { fileUrl: e };
|
|
1554
|
+
function Si(e, t, n, r) {
|
|
1547
1555
|
let i = e.maxPreviewCount ?? 3, a = e.cellProps ?? e.props ?? {};
|
|
1548
1556
|
switch (e.type) {
|
|
1549
|
-
case "avatar": return j(
|
|
1557
|
+
case "avatar": return j(vi, {
|
|
1550
1558
|
row: t,
|
|
1551
1559
|
value: n
|
|
1552
1560
|
});
|
|
1553
|
-
case "file": return j(
|
|
1561
|
+
case "file": return j(gi, {
|
|
1554
1562
|
...a,
|
|
1555
|
-
attachments:
|
|
1563
|
+
attachments: xi(n),
|
|
1556
1564
|
maxPreviewCount: i
|
|
1557
1565
|
});
|
|
1558
|
-
case "picture": return j(
|
|
1566
|
+
case "picture": return j(_i, {
|
|
1559
1567
|
...a,
|
|
1560
|
-
urls:
|
|
1568
|
+
urls: bi(n),
|
|
1561
1569
|
maxPreviewCount: i
|
|
1562
1570
|
});
|
|
1563
|
-
case "price": return j(
|
|
1571
|
+
case "price": return j(ii, {
|
|
1564
1572
|
...a,
|
|
1565
1573
|
price: String(n || "0"),
|
|
1566
|
-
|
|
1574
|
+
oldPrice: t[a?.oldPrice] ?? null,
|
|
1575
|
+
style: a?.style ?? (() => ({})),
|
|
1576
|
+
oldPriceStyle: a?.oldPriceStyle ?? (() => ({}))
|
|
1567
1577
|
});
|
|
1568
1578
|
case "listExpand": {
|
|
1569
|
-
let i =
|
|
1579
|
+
let i = mi(t?.[r?.rowKey ?? "id"], pi(e));
|
|
1570
1580
|
return j(ni, {
|
|
1571
|
-
items:
|
|
1581
|
+
items: hi(n, a.labelKey),
|
|
1572
1582
|
max: a.max,
|
|
1573
1583
|
unit: a.unit,
|
|
1574
1584
|
expanded: r?.expandedKeys.has(i) ?? !1,
|
|
@@ -1579,7 +1589,7 @@ function wi(e, t, n, r) {
|
|
|
1579
1589
|
default: return;
|
|
1580
1590
|
}
|
|
1581
1591
|
}
|
|
1582
|
-
function
|
|
1592
|
+
function Ci(e) {
|
|
1583
1593
|
let t = {
|
|
1584
1594
|
bottom: "flex-end",
|
|
1585
1595
|
center: "center",
|
|
@@ -1590,11 +1600,11 @@ function Ti(e) {
|
|
|
1590
1600
|
width: "100%"
|
|
1591
1601
|
} : void 0;
|
|
1592
1602
|
}
|
|
1593
|
-
function
|
|
1603
|
+
function wi(e, t, n) {
|
|
1594
1604
|
return e.map((e) => {
|
|
1595
1605
|
if (e.key === "__sel__" || e.key === "__fill__") return e;
|
|
1596
1606
|
if (e.cellRenderer) {
|
|
1597
|
-
let t = e.cellRenderer, n =
|
|
1607
|
+
let t = e.cellRenderer, n = Ci(e);
|
|
1598
1608
|
return n ? {
|
|
1599
1609
|
...e,
|
|
1600
1610
|
cellRenderer: (e) => j("div", {
|
|
@@ -1605,11 +1615,11 @@ function Ei(e, t, n) {
|
|
|
1605
1615
|
}
|
|
1606
1616
|
let r = e.dataKey;
|
|
1607
1617
|
if (r == null || r === "") return e;
|
|
1608
|
-
let i =
|
|
1618
|
+
let i = ai(String(r));
|
|
1609
1619
|
return {
|
|
1610
1620
|
...e,
|
|
1611
1621
|
cellRenderer: (a) => {
|
|
1612
|
-
let { rowData: o, rowIndex: s, cellData: c } = a, l = a.column ?? e, u = l.align ?? e.align ?? "left", d =
|
|
1622
|
+
let { rowData: o, rowIndex: s, cellData: c } = a, l = a.column ?? e, u = l.align ?? e.align ?? "left", d = Ci(l), f = l.valueType ?? e.valueType, p = f === "date" || f === "datetime" ? ui(o, String(r), c) : c === void 0 ? o?.[r] : c, m = di(p, f), h = typeof p == "object" && p ? void 0 : m, g = t[i];
|
|
1613
1623
|
if (g) return j("div", {
|
|
1614
1624
|
class: "table-entity__col-slot",
|
|
1615
1625
|
title: h,
|
|
@@ -1624,7 +1634,7 @@ function Ei(e, t, n) {
|
|
|
1624
1634
|
column: l,
|
|
1625
1635
|
rowIndex: s
|
|
1626
1636
|
}));
|
|
1627
|
-
let _ =
|
|
1637
|
+
let _ = Si(l, o, p, n);
|
|
1628
1638
|
if (_) {
|
|
1629
1639
|
let t = l.type === "picture" || e.type === "picture", n = l.type === "listExpand" || e.type === "listExpand";
|
|
1630
1640
|
return j("div", {
|
|
@@ -1675,13 +1685,13 @@ function Ei(e, t, n) {
|
|
|
1675
1685
|
});
|
|
1676
1686
|
}
|
|
1677
1687
|
// src/components/table-entity/index.vue?vue&type=script&setup=true&lang.ts
|
|
1678
|
-
var
|
|
1688
|
+
var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di = {
|
|
1679
1689
|
key: 0,
|
|
1680
1690
|
class: "table-entity__toolbar-left"
|
|
1681
|
-
},
|
|
1691
|
+
}, Oi = {
|
|
1682
1692
|
key: 1,
|
|
1683
1693
|
class: "table-entity__pagination"
|
|
1684
|
-
},
|
|
1694
|
+
}, ki = "__actions__", Ai = "__drag__", ji = "table-entity__drag-handle", Mi = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
1685
1695
|
__name: "index",
|
|
1686
1696
|
props: {
|
|
1687
1697
|
columns: { default: () => [] },
|
|
@@ -1769,7 +1779,7 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
1769
1779
|
"rowSort"
|
|
1770
1780
|
],
|
|
1771
1781
|
setup(e, { expose: t, emit: n }) {
|
|
1772
|
-
let r = e, i = n, a =
|
|
1782
|
+
let r = e, i = n, a = B(!1), s = B(!1), c = {
|
|
1773
1783
|
view: {
|
|
1774
1784
|
label: d("components.tableEntity.view"),
|
|
1775
1785
|
type: "primary"
|
|
@@ -1786,7 +1796,7 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
1786
1796
|
label: d("components.tableEntity.delete"),
|
|
1787
1797
|
type: "danger"
|
|
1788
1798
|
}
|
|
1789
|
-
}, l =
|
|
1799
|
+
}, l = B(0), u = o(), f = b(() => {
|
|
1790
1800
|
let e = (u.value.pageSizes ?? []).map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0);
|
|
1791
1801
|
return e.length > 0 ? e : [
|
|
1792
1802
|
10,
|
|
@@ -1794,7 +1804,7 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
1794
1804
|
50,
|
|
1795
1805
|
100
|
|
1796
1806
|
];
|
|
1797
|
-
}), p = se(), { hasAccessByCodes: m } = pn(), h =
|
|
1807
|
+
}), p = se(), { hasAccessByCodes: m } = pn(), h = B([]), g = B(/* @__PURE__ */ new Set()), _ = B(!1), v = B([...r.defaultExpandedRowKeys ?? []]), y = B(), { width: T } = _t(y), E = te({
|
|
1798
1808
|
current_page: r.current_page,
|
|
1799
1809
|
per_page: r.per_page
|
|
1800
1810
|
}), O = b(() => Math.max(1, Math.floor(r.width ?? T.value))), k = b(() => r.total == null ? l.value : Number(r.total)), A = b(() => r.showColumnSettings || typeof r.data == "function");
|
|
@@ -1804,18 +1814,18 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
1804
1814
|
let N = b(() => r.columns.filter(Boolean).map((e) => ({
|
|
1805
1815
|
...e,
|
|
1806
1816
|
dataKey: e.dataKey ?? e.dataIndex
|
|
1807
|
-
}))),
|
|
1808
|
-
function
|
|
1817
|
+
}))), F = b(() => N.value.filter((e) => e.type === "listExpand")), L = b(() => !r.tree && F.value.length > 0);
|
|
1818
|
+
function ee(e) {
|
|
1809
1819
|
let t = new Set(g.value);
|
|
1810
1820
|
t.has(e) ? t.delete(e) : t.add(e), g.value = t;
|
|
1811
1821
|
}
|
|
1812
|
-
let
|
|
1822
|
+
let V = b(() => wi(N.value, p, {
|
|
1813
1823
|
expandedKeys: g.value,
|
|
1814
|
-
onToggle:
|
|
1824
|
+
onToggle: ee,
|
|
1815
1825
|
rowKey: r.rowKey ?? "id"
|
|
1816
|
-
})),
|
|
1817
|
-
field:
|
|
1818
|
-
order:
|
|
1826
|
+
})), U = r.columns.find((e) => e.sortOrder), re = B({
|
|
1827
|
+
field: U && String(U.dataKey ?? U.dataIndex ?? U.key ?? "") || void 0,
|
|
1828
|
+
order: U?.sortOrder
|
|
1819
1829
|
});
|
|
1820
1830
|
function ie(e) {
|
|
1821
1831
|
let t = e.dataKey ?? e.dataIndex ?? e.key;
|
|
@@ -1825,8 +1835,8 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
1825
1835
|
if (!e.sortable && !e.sortOrder) return;
|
|
1826
1836
|
let t = ie(e);
|
|
1827
1837
|
if (!t) return;
|
|
1828
|
-
let n =
|
|
1829
|
-
|
|
1838
|
+
let n = re.value.field === t && re.value.order === "asc" ? "desc" : "asc";
|
|
1839
|
+
re.value = {
|
|
1830
1840
|
field: t,
|
|
1831
1841
|
order: n
|
|
1832
1842
|
}, E.current_page === 1 ? (ae(), typeof r.data == "function" && $e()) : (E.current_page = 1, i("update:current_page", 1), i("update:page", 1), ae());
|
|
@@ -1836,37 +1846,37 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
1836
1846
|
current_page: E.current_page,
|
|
1837
1847
|
page: E.current_page,
|
|
1838
1848
|
per_page: E.per_page,
|
|
1839
|
-
sortField:
|
|
1840
|
-
sortOrder:
|
|
1849
|
+
sortField: re.value.field,
|
|
1850
|
+
sortOrder: re.value.order
|
|
1841
1851
|
});
|
|
1842
1852
|
}
|
|
1843
|
-
let G = yr(
|
|
1853
|
+
let G = yr(V), oe = gr(V);
|
|
1844
1854
|
function ce() {
|
|
1845
1855
|
G.reset(), oe.reset();
|
|
1846
1856
|
}
|
|
1847
1857
|
let { applyColumnWidths: le, resizeLineStyle: de, onViewportMouseDown: fe } = vr(r.minColumnWidth), X = b(() => {
|
|
1848
|
-
let e = r.showColumnSettings ? G.visibleColumns.value :
|
|
1858
|
+
let e = r.showColumnSettings ? G.visibleColumns.value : V.value;
|
|
1849
1859
|
return oe.applyFixed(G.applyAlign(le(e)));
|
|
1850
1860
|
}), pe = b(() => {
|
|
1851
1861
|
if (!r.tree) return;
|
|
1852
1862
|
if (r.expandColumnKey) return r.expandColumnKey;
|
|
1853
|
-
let e =
|
|
1863
|
+
let e = V.value.find((e) => {
|
|
1854
1864
|
let t = e.key ?? e.dataKey;
|
|
1855
1865
|
return t != null && String(t) !== "";
|
|
1856
1866
|
}), t = e?.key ?? e?.dataKey;
|
|
1857
1867
|
return t == null ? void 0 : String(t);
|
|
1858
1868
|
}), me = b(() => r.expandedRowKeys ?? v.value), he = b(() => !r.tree || r.treeChildrenKey === "children" ? h.value : tt(h.value, r.treeChildrenKey));
|
|
1859
1869
|
function ge(e) {
|
|
1860
|
-
let t = r.rowKey ?? "id", n = r.treeChildrenKey ?? "children", i =
|
|
1870
|
+
let t = r.rowKey ?? "id", n = r.treeChildrenKey ?? "children", i = F.value.map((e) => pi(e));
|
|
1861
1871
|
return e.map((e) => {
|
|
1862
|
-
let r = i.map((n) => g.value.has(
|
|
1872
|
+
let r = i.map((n) => g.value.has(mi(e[t], n)) ? "1" : "0").join(""), a = {
|
|
1863
1873
|
...e,
|
|
1864
1874
|
__measureKey: `${e[t]}:${r}`
|
|
1865
1875
|
};
|
|
1866
1876
|
return Array.isArray(e[n]) && (a[n] = ge(e[n])), a;
|
|
1867
1877
|
});
|
|
1868
1878
|
}
|
|
1869
|
-
let _e = b(() =>
|
|
1879
|
+
let _e = b(() => L.value ? ge(he.value) : he.value), Se = b(() => r.tree ? nt(he.value, me.value) : h.value), Ce = b(() => r.tree ? nt(he.value) : h.value);
|
|
1870
1880
|
q(() => r.current_page, (e) => {
|
|
1871
1881
|
E.current_page = e;
|
|
1872
1882
|
}), q(() => r.per_page, (e) => {
|
|
@@ -1931,7 +1941,7 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
1931
1941
|
let n = r.rowKey ?? "id", i = Fe.value, a = e[n], o = t[n];
|
|
1932
1942
|
return a != null && o != null && i.has(a) && i.has(o) && i.get(a) === i.get(o);
|
|
1933
1943
|
},
|
|
1934
|
-
getHandle: () => r.rowDragHandle || `.${
|
|
1944
|
+
getHandle: () => r.rowDragHandle || `.${ji}`,
|
|
1935
1945
|
getRoot: () => y.value,
|
|
1936
1946
|
getRowHeight: () => r.rowHeight,
|
|
1937
1947
|
getRows: () => Pe.value,
|
|
@@ -1966,12 +1976,12 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
1966
1976
|
};
|
|
1967
1977
|
}
|
|
1968
1978
|
let We = b(() => ({
|
|
1969
|
-
key:
|
|
1970
|
-
dataKey:
|
|
1979
|
+
key: Ai,
|
|
1980
|
+
dataKey: Ai,
|
|
1971
1981
|
title: "",
|
|
1972
1982
|
width: 40,
|
|
1973
1983
|
cellRenderer: ({ rowData: e }) => r.rowDragDisabled?.(e) ? null : j("span", {
|
|
1974
|
-
class:
|
|
1984
|
+
class: ji,
|
|
1975
1985
|
title: "拖拽排序"
|
|
1976
1986
|
}, j(Z, { size: 16 }, () => j(ct)))
|
|
1977
1987
|
}));
|
|
@@ -1991,15 +2001,15 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
1991
2001
|
return e;
|
|
1992
2002
|
});
|
|
1993
2003
|
function Je(e, t) {
|
|
1994
|
-
let n = Ge(t), r =
|
|
2004
|
+
let n = Ge(t), r = ne("access");
|
|
1995
2005
|
return !n || !r ? e : ue(e, [[r, [n]]]);
|
|
1996
2006
|
}
|
|
1997
2007
|
let Ye = b(() => 50), Xe = b(() => {
|
|
1998
2008
|
if (!r.showActions) return null;
|
|
1999
2009
|
let e = qe.value;
|
|
2000
2010
|
return {
|
|
2001
|
-
key:
|
|
2002
|
-
dataKey:
|
|
2011
|
+
key: ki,
|
|
2012
|
+
dataKey: ki,
|
|
2003
2013
|
title: r.actionColumnTitle || d("components.tableEntity.action"),
|
|
2004
2014
|
width: Ye.value,
|
|
2005
2015
|
fixed: "right",
|
|
@@ -2077,7 +2087,7 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2077
2087
|
});
|
|
2078
2088
|
function Qe(e) {
|
|
2079
2089
|
return e.map((e) => {
|
|
2080
|
-
let t = e.headerCellRenderer, n = ie(e), r =
|
|
2090
|
+
let t = e.headerCellRenderer, n = ie(e), r = re.value.field === n, i = !!(e.sortable || e.sortOrder), a = i && r ? j("span", { class: ["table-entity__sort-arrow", re.value.order === "desc" ? "table-entity__sort-arrow--desc" : "table-entity__sort-arrow--asc"] }) : i ? j("span", { class: "table-entity__sort-icons" }, [j("span", { class: "table-entity__sort-arrow--asc" }), j("span", { class: "table-entity__sort-arrow--desc" })]) : null;
|
|
2081
2091
|
return {
|
|
2082
2092
|
...e,
|
|
2083
2093
|
width: e.width ?? 120,
|
|
@@ -2109,8 +2119,8 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2109
2119
|
page: E.current_page,
|
|
2110
2120
|
per_page: E.per_page,
|
|
2111
2121
|
query: r.query,
|
|
2112
|
-
sortField:
|
|
2113
|
-
sortOrder:
|
|
2122
|
+
sortField: re.value.field,
|
|
2123
|
+
sortOrder: re.value.order
|
|
2114
2124
|
});
|
|
2115
2125
|
h.value = e.rows, l.value = e.total;
|
|
2116
2126
|
} finally {
|
|
@@ -2125,11 +2135,11 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2125
2135
|
width: Number(e.width ?? 120)
|
|
2126
2136
|
})), r = n.reduce((e, t) => e + Number(t.width ?? 0), 0);
|
|
2127
2137
|
if (r >= t) return n;
|
|
2128
|
-
let i = n.filter((e) => e.dataKey !==
|
|
2138
|
+
let i = n.filter((e) => e.dataKey !== ki && e.dataKey !== "__sel__" && e.dataKey !== Ai);
|
|
2129
2139
|
if (i.length === 0) return n;
|
|
2130
2140
|
let a = t - r, o = i.reduce((e, t) => e + Number(t.width ?? 0), 0);
|
|
2131
2141
|
return n.map((e) => {
|
|
2132
|
-
if (e.dataKey ===
|
|
2142
|
+
if (e.dataKey === ki || e.dataKey === "__sel__" || e.dataKey === Ai) return e;
|
|
2133
2143
|
let t = Number(e.width ?? 120);
|
|
2134
2144
|
return {
|
|
2135
2145
|
...e,
|
|
@@ -2186,16 +2196,16 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2186
2196
|
openImport: ke,
|
|
2187
2197
|
reload: dt
|
|
2188
2198
|
}), (t, n) => {
|
|
2189
|
-
let i =
|
|
2190
|
-
return
|
|
2199
|
+
let i = ne("loading");
|
|
2200
|
+
return z(), C("div", { class: I(["table-entity", {
|
|
2191
2201
|
"table-entity--large-row": r.rowHeight > 40,
|
|
2192
|
-
"table-entity--dynamic-row":
|
|
2202
|
+
"table-entity--dynamic-row": L.value
|
|
2193
2203
|
}]) }, [
|
|
2194
2204
|
n[5] ||= w("div", { class: "flex justify-between mb-1" }, null, -1),
|
|
2195
2205
|
w("div", {
|
|
2196
2206
|
class: "table-entity__toolbar",
|
|
2197
|
-
style:
|
|
2198
|
-
}, [w("div",
|
|
2207
|
+
style: R({ width: `${e.width}px` })
|
|
2208
|
+
}, [w("div", Ti, [w("div", Ei, [H(t.$slots, "buttons", {}, void 0, !0)])]), A.value ? (z(), C("div", Di, [
|
|
2199
2209
|
D(K(He), {
|
|
2200
2210
|
content: K(d)("components.tableEntity.refresh"),
|
|
2201
2211
|
placement: "top"
|
|
@@ -2222,7 +2232,7 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2222
2232
|
}, null, 8, ["icon"])]),
|
|
2223
2233
|
_: 1
|
|
2224
2234
|
}, 8, ["content"])]),
|
|
2225
|
-
r.showColumnSettings ? (
|
|
2235
|
+
r.showColumnSettings ? (z(), x(K(ve), {
|
|
2226
2236
|
key: 0,
|
|
2227
2237
|
modelValue: s.value,
|
|
2228
2238
|
"onUpdate:modelValue": n[1] ||= (e) => s.value = e,
|
|
@@ -2254,7 +2264,7 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2254
2264
|
}, 8, ["modelValue", "title"])) : S("", !0),
|
|
2255
2265
|
S("", !0)
|
|
2256
2266
|
])) : S("", !0)], 4),
|
|
2257
|
-
ue((
|
|
2267
|
+
ue((z(), C("div", {
|
|
2258
2268
|
ref_key: "tableViewportRef",
|
|
2259
2269
|
ref: y,
|
|
2260
2270
|
class: "table-entity__viewport",
|
|
@@ -2269,8 +2279,8 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2269
2279
|
"row-class": Ve,
|
|
2270
2280
|
"row-props": Ue,
|
|
2271
2281
|
cache: r.cache,
|
|
2272
|
-
"estimated-row-height":
|
|
2273
|
-
"row-key":
|
|
2282
|
+
"estimated-row-height": L.value ? r.rowHeight : void 0,
|
|
2283
|
+
"row-key": L.value ? "__measureKey" : r.rowKey,
|
|
2274
2284
|
"expand-column-key": pe.value,
|
|
2275
2285
|
"expanded-row-keys": me.value,
|
|
2276
2286
|
"default-expanded-row-keys": r.defaultExpandedRowKeys,
|
|
@@ -2297,12 +2307,12 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2297
2307
|
"icon-size",
|
|
2298
2308
|
"row-event-handlers"
|
|
2299
2309
|
])], 32)), [[i, _.value]]),
|
|
2300
|
-
r.resizable ? (
|
|
2310
|
+
r.resizable ? (z(), C("div", {
|
|
2301
2311
|
key: 0,
|
|
2302
2312
|
class: "table-entity__resize-line",
|
|
2303
|
-
style:
|
|
2313
|
+
style: R(K(de))
|
|
2304
2314
|
}, null, 4)) : S("", !0),
|
|
2305
|
-
r.showPagination ? (
|
|
2315
|
+
r.showPagination ? (z(), C("div", Oi, [D(K(Oe), P({
|
|
2306
2316
|
"current-page": E.current_page,
|
|
2307
2317
|
"page-size": E.per_page,
|
|
2308
2318
|
total: k.value
|
|
@@ -2316,7 +2326,7 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2316
2326
|
"total",
|
|
2317
2327
|
"page-sizes"
|
|
2318
2328
|
])])) : S("", !0),
|
|
2319
|
-
r.importDialog ? (
|
|
2329
|
+
r.importDialog ? (z(), x(K(ar), {
|
|
2320
2330
|
key: 2,
|
|
2321
2331
|
modelValue: a.value,
|
|
2322
2332
|
"onUpdate:modelValue": n[4] ||= (e) => a.value = e,
|
|
@@ -2356,10 +2366,10 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2356
2366
|
], 2);
|
|
2357
2367
|
};
|
|
2358
2368
|
}
|
|
2359
|
-
}), [["__scopeId", "data-v-68eaf1f6"]]),
|
|
2369
|
+
}), [["__scopeId", "data-v-68eaf1f6"]]), Ni = { class: "dialog-list" }, Pi = { class: "dialog-list__bar" }, Fi = {
|
|
2360
2370
|
key: 0,
|
|
2361
2371
|
class: "dialog-list__count"
|
|
2362
|
-
},
|
|
2372
|
+
}, Ii = { class: "dialog-list__table" }, Li = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
2363
2373
|
__name: "index",
|
|
2364
2374
|
props: {
|
|
2365
2375
|
visible: { type: Boolean },
|
|
@@ -2391,7 +2401,7 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2391
2401
|
onOpenChange: (e) => {
|
|
2392
2402
|
e !== i.visible && a("update:visible", e);
|
|
2393
2403
|
}
|
|
2394
|
-
}), c =
|
|
2404
|
+
}), c = B(), l = B(""), u = B(1), f = B(i.perPage), p = B([]), m = b(() => [
|
|
2395
2405
|
"__dialog-list__",
|
|
2396
2406
|
i.rowKey,
|
|
2397
2407
|
u.value,
|
|
@@ -2444,14 +2454,14 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2444
2454
|
a("update:modelValue", t), a("confirm", e), s.close();
|
|
2445
2455
|
}
|
|
2446
2456
|
return t({ tableRef: c }), (t, n) => {
|
|
2447
|
-
let r =
|
|
2448
|
-
return
|
|
2457
|
+
let r = U("el-button"), i = U("el-input"), a = ne("loading");
|
|
2458
|
+
return z(), x(K(o), {
|
|
2449
2459
|
title: e.dialogTitle || K(d)("components.asyncSelect.placeholder"),
|
|
2450
|
-
class:
|
|
2460
|
+
class: I(`dialog-list__modal w-[${e.dialogWidth}]`),
|
|
2451
2461
|
"cancel-text": K(d)("components.dialogList.cancel"),
|
|
2452
2462
|
"confirm-text": K(d)("components.dialogList.confirm")
|
|
2453
2463
|
}, {
|
|
2454
|
-
default: J(() => [w("div",
|
|
2464
|
+
default: J(() => [w("div", Ni, [w("div", Pi, [D(i, {
|
|
2455
2465
|
modelValue: l.value,
|
|
2456
2466
|
"onUpdate:modelValue": n[0] ||= (e) => l.value = e,
|
|
2457
2467
|
placeholder: K(d)("components.dialogList.placeholder"),
|
|
@@ -2465,7 +2475,7 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2465
2475
|
onClick: y
|
|
2466
2476
|
}, null, 8, ["icon"])]),
|
|
2467
2477
|
_: 1
|
|
2468
|
-
}, 8, ["modelValue", "placeholder"]), O.value > 0 ? (
|
|
2478
|
+
}, 8, ["modelValue", "placeholder"]), O.value > 0 ? (z(), C("span", Fi, W(K(d)("components.dialogList.selectedCount", { count: O.value })), 1)) : S("", !0)]), ue((z(), C("div", Ii, [D(Mi, {
|
|
2469
2479
|
ref_key: "tableRef",
|
|
2470
2480
|
ref: c,
|
|
2471
2481
|
columns: e.columns,
|
|
@@ -2506,7 +2516,7 @@ var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki
|
|
|
2506
2516
|
}
|
|
2507
2517
|
}), [["__scopeId", "data-v-34113a12"]]);
|
|
2508
2518
|
// src/components/async-select/async-select.utils.ts
|
|
2509
|
-
async function
|
|
2519
|
+
async function Ri({ activeValues: e, selectedValues: t, loadRows: n, resolveValue: r, toOption: i }) {
|
|
2510
2520
|
let a = e.filter((e) => !t.some((t) => String(t) === String(e)));
|
|
2511
2521
|
if (a.length === 0) return [];
|
|
2512
2522
|
let o = new Set(a.map(String)), s = await n(a), c = [];
|
|
@@ -2519,13 +2529,13 @@ async function Bi({ activeValues: e, selectedValues: t, loadRows: n, resolveValu
|
|
|
2519
2529
|
return c;
|
|
2520
2530
|
}
|
|
2521
2531
|
// src/components/async-select/async-select.vue?vue&type=script&setup=true&lang.ts
|
|
2522
|
-
var
|
|
2532
|
+
var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi = ["src"], Hi = { class: "async-select__value-text" }, Ui = {
|
|
2523
2533
|
key: 0,
|
|
2524
2534
|
class: "async-select__option"
|
|
2525
|
-
},
|
|
2535
|
+
}, Wi = { class: "async-select__option-label" }, Gi = ["src"], Ki = { class: "async-select__option-text" }, qi = {
|
|
2526
2536
|
key: 0,
|
|
2527
2537
|
class: "async-select__option-desc"
|
|
2528
|
-
},
|
|
2538
|
+
}, Ji = ["title"], Yi = ["src", "alt"], Xi = /*@__PURE__*/ k({
|
|
2529
2539
|
__name: "async-select",
|
|
2530
2540
|
props: {
|
|
2531
2541
|
modelValue: {},
|
|
@@ -2557,7 +2567,7 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2557
2567
|
if (r.labelKey) return r.labelKey;
|
|
2558
2568
|
let e = r.columns?.[0];
|
|
2559
2569
|
return e?.dataKey ? e.dataKey : "label";
|
|
2560
|
-
}), c =
|
|
2570
|
+
}), c = B([]), l = B([]), u = B(0), f = B(!1), p = B(!0), m = B(""), h = B(!1), g = b(() => typeof r.fetcher == "function"), _ = /* @__PURE__ */ new Map(), v = null, y = b({
|
|
2561
2571
|
get: () => r.modelValue,
|
|
2562
2572
|
set: (e) => i("update:modelValue", e)
|
|
2563
2573
|
}), T = b(() => Array.isArray(r.modelValue) ? r.modelValue.filter((e) => e != null) : r.modelValue == null ? [] : [r.modelValue]);
|
|
@@ -2589,7 +2599,7 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2589
2599
|
function N(e) {
|
|
2590
2600
|
return T.value.find((t) => j(t, e)) ?? e;
|
|
2591
2601
|
}
|
|
2592
|
-
function
|
|
2602
|
+
function F(e) {
|
|
2593
2603
|
for (let t of e) {
|
|
2594
2604
|
let e = {
|
|
2595
2605
|
...t,
|
|
@@ -2598,7 +2608,7 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2598
2608
|
l.value.find((t) => j(t.value, e.value)) || l.value.push(e);
|
|
2599
2609
|
}
|
|
2600
2610
|
}
|
|
2601
|
-
let
|
|
2611
|
+
let L = b(() => {
|
|
2602
2612
|
let e = c.value.map((e) => {
|
|
2603
2613
|
let t = A(e);
|
|
2604
2614
|
return {
|
|
@@ -2614,7 +2624,7 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2614
2624
|
q(o, (e) => {
|
|
2615
2625
|
g.value || (c.value = e ?? [], p.value = !1);
|
|
2616
2626
|
}, { immediate: !0 });
|
|
2617
|
-
async function
|
|
2627
|
+
async function R(e = !1) {
|
|
2618
2628
|
let t = m.value || void 0, n = t ?? "";
|
|
2619
2629
|
if (!e && v === n) return;
|
|
2620
2630
|
let r = _.get(n);
|
|
@@ -2623,7 +2633,7 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2623
2633
|
return;
|
|
2624
2634
|
}
|
|
2625
2635
|
u.value = 1, c.value = [], p.value = !0;
|
|
2626
|
-
let i =
|
|
2636
|
+
let i = te(1, t);
|
|
2627
2637
|
_.set(n, i);
|
|
2628
2638
|
try {
|
|
2629
2639
|
await i, (m.value || void 0) === t && (v = n);
|
|
@@ -2631,10 +2641,10 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2631
2641
|
_.get(n) === i && _.delete(n);
|
|
2632
2642
|
}
|
|
2633
2643
|
}
|
|
2634
|
-
async function
|
|
2635
|
-
!f.value && p.value && await
|
|
2644
|
+
async function ee() {
|
|
2645
|
+
!f.value && p.value && await te(u.value + 1);
|
|
2636
2646
|
}
|
|
2637
|
-
async function
|
|
2647
|
+
async function te(e, t = m.value || void 0) {
|
|
2638
2648
|
if (r.fetcher) {
|
|
2639
2649
|
f.value = !0;
|
|
2640
2650
|
try {
|
|
@@ -2651,11 +2661,11 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2651
2661
|
}
|
|
2652
2662
|
}
|
|
2653
2663
|
}
|
|
2654
|
-
async function
|
|
2655
|
-
h.value = e, e && g.value && c.value.length === 0 && await
|
|
2664
|
+
async function V(e) {
|
|
2665
|
+
h.value = e, e && g.value && c.value.length === 0 && await R();
|
|
2656
2666
|
}
|
|
2657
2667
|
q([T, o], async ([e, t]) => {
|
|
2658
|
-
e.length === 0 ? l.value = [] : (
|
|
2668
|
+
e.length === 0 ? l.value = [] : (F(t.filter((t) => e.some((e) => j(e, E(t)))).map(A)), g.value && r.fetcher && F(await Ri({
|
|
2659
2669
|
activeValues: e,
|
|
2660
2670
|
selectedValues: l.value.map((e) => e.value),
|
|
2661
2671
|
loadRows: (e) => r.fetcher({
|
|
@@ -2667,16 +2677,16 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2667
2677
|
toOption: A
|
|
2668
2678
|
})));
|
|
2669
2679
|
}, { immediate: !0 });
|
|
2670
|
-
let
|
|
2671
|
-
function
|
|
2672
|
-
r.disabled || (
|
|
2680
|
+
let H = B(!1);
|
|
2681
|
+
function U() {
|
|
2682
|
+
r.disabled || (H.value = !0);
|
|
2673
2683
|
}
|
|
2674
|
-
function
|
|
2675
|
-
|
|
2684
|
+
function ne(e) {
|
|
2685
|
+
F(e.map(A));
|
|
2676
2686
|
let t = r.multiple ? e.map((e) => E(e)) : e[0] ? E(e[0]) : null;
|
|
2677
2687
|
i("update:modelValue", t), i("change", t, e);
|
|
2678
2688
|
}
|
|
2679
|
-
async function
|
|
2689
|
+
async function re(e) {
|
|
2680
2690
|
if (r.fetcher) {
|
|
2681
2691
|
let t = await r.fetcher(e);
|
|
2682
2692
|
return {
|
|
@@ -2692,14 +2702,14 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2692
2702
|
}
|
|
2693
2703
|
let ie = b(() => r.placeholder || d("components.asyncSelect.placeholder")), ae = b(() => r.dialogTitle || d("components.asyncSelect.placeholder"));
|
|
2694
2704
|
return t({
|
|
2695
|
-
reload: () =>
|
|
2705
|
+
reload: () => R(!0),
|
|
2696
2706
|
allItems: c
|
|
2697
|
-
}), (t, n) => (
|
|
2707
|
+
}), (t, n) => (z(), C("div", zi, [
|
|
2698
2708
|
D(K(Fe), P({
|
|
2699
2709
|
modelValue: y.value,
|
|
2700
2710
|
"onUpdate:modelValue": n[0] ||= (e) => y.value = e,
|
|
2701
2711
|
class: "async-select__select",
|
|
2702
|
-
options:
|
|
2712
|
+
options: L.value,
|
|
2703
2713
|
loading: f.value,
|
|
2704
2714
|
multiple: e.multiple,
|
|
2705
2715
|
filterable: "",
|
|
@@ -2707,26 +2717,26 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2707
2717
|
remote: g.value,
|
|
2708
2718
|
"remote-show-suffix": "",
|
|
2709
2719
|
"remote-method": g.value ? (e) => {
|
|
2710
|
-
m.value !== e && (m.value = e, M(v) ? v.value = null : v = null),
|
|
2720
|
+
m.value !== e && (m.value = e, M(v) ? v.value = null : v = null), R();
|
|
2711
2721
|
} : void 0,
|
|
2712
2722
|
placeholder: ie.value,
|
|
2713
2723
|
disabled: e.disabled
|
|
2714
2724
|
}, t.$attrs, {
|
|
2715
|
-
onVisibleChange:
|
|
2716
|
-
onEndReached:
|
|
2725
|
+
onVisibleChange: V,
|
|
2726
|
+
onEndReached: ee
|
|
2717
2727
|
}), {
|
|
2718
|
-
label: J((e) => [w("span",
|
|
2728
|
+
label: J((e) => [w("span", Bi, [e?.label?.flag ? (z(), C("img", {
|
|
2719
2729
|
key: 0,
|
|
2720
2730
|
class: "async-select__flag",
|
|
2721
2731
|
src: e.label.flag,
|
|
2722
2732
|
alt: ""
|
|
2723
|
-
}, null, 8,
|
|
2724
|
-
default: J((e) => [e?.item ? (
|
|
2733
|
+
}, null, 8, Vi)) : S("", !0), w("span", Hi, W(e?.label?.label ?? ""), 1)])]),
|
|
2734
|
+
default: J((e) => [e?.item ? (z(), C("div", Ui, [w("p", Wi, [e.item.label.flag ? (z(), C("img", {
|
|
2725
2735
|
key: 0,
|
|
2726
2736
|
class: "async-select__flag",
|
|
2727
2737
|
src: e.item.label.flag,
|
|
2728
2738
|
alt: ""
|
|
2729
|
-
}, null, 8,
|
|
2739
|
+
}, null, 8, Gi)) : S("", !0), w("span", Ki, W(e.item.label.label), 1)]), e.item.label.subtitle ? (z(), C("p", qi, W(e.item.label.subtitle), 1)) : S("", !0)])) : S("", !0)]),
|
|
2730
2740
|
_: 1
|
|
2731
2741
|
}, 16, [
|
|
2732
2742
|
"modelValue",
|
|
@@ -2738,32 +2748,32 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2738
2748
|
"placeholder",
|
|
2739
2749
|
"disabled"
|
|
2740
2750
|
]),
|
|
2741
|
-
e.columns.length > 0 ? (
|
|
2751
|
+
e.columns.length > 0 ? (z(), C("button", {
|
|
2742
2752
|
key: 0,
|
|
2743
2753
|
type: "button",
|
|
2744
|
-
class:
|
|
2754
|
+
class: I(["async-select__inner-trigger", { "is-disabled": e.disabled }]),
|
|
2745
2755
|
title: K(d)("components.asyncSelect.dialogSelect"),
|
|
2746
2756
|
onMousedown: n[1] ||= fe(() => {}, ["prevent"]),
|
|
2747
|
-
onClick: fe(
|
|
2757
|
+
onClick: fe(U, ["stop"])
|
|
2748
2758
|
}, [D(K(Z), null, {
|
|
2749
2759
|
default: J(() => [w("img", {
|
|
2750
2760
|
src: K(fn),
|
|
2751
2761
|
alt: K(d)("components.asyncSelect.more")
|
|
2752
|
-
}, null, 8,
|
|
2762
|
+
}, null, 8, Yi)]),
|
|
2753
2763
|
_: 1
|
|
2754
|
-
})], 42,
|
|
2755
|
-
e.columns.length > 0 ? (
|
|
2764
|
+
})], 42, Ji)) : S("", !0),
|
|
2765
|
+
e.columns.length > 0 ? (z(), x(Li, {
|
|
2756
2766
|
key: 1,
|
|
2757
|
-
visible:
|
|
2767
|
+
visible: H.value,
|
|
2758
2768
|
columns: e.columns,
|
|
2759
2769
|
"model-value": e.modelValue,
|
|
2760
2770
|
multiple: e.multiple,
|
|
2761
|
-
fetcher: (e) =>
|
|
2771
|
+
fetcher: (e) => re(e),
|
|
2762
2772
|
"row-key": e.valueKey,
|
|
2763
2773
|
"dialog-title": ae.value,
|
|
2764
2774
|
"per-page": e.perPage,
|
|
2765
|
-
"onUpdate:visible": n[2] ||= (e) =>
|
|
2766
|
-
onConfirm:
|
|
2775
|
+
"onUpdate:visible": n[2] ||= (e) => H.value = e,
|
|
2776
|
+
onConfirm: ne
|
|
2767
2777
|
}, null, 8, [
|
|
2768
2778
|
"visible",
|
|
2769
2779
|
"columns",
|
|
@@ -2776,26 +2786,26 @@ var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui =
|
|
|
2776
2786
|
])) : S("", !0)
|
|
2777
2787
|
]));
|
|
2778
2788
|
}
|
|
2779
|
-
}),
|
|
2789
|
+
}), Zi = /* @__PURE__ */ e({ default: () => Qi }), Qi = /*#__PURE__*/ f(Xi, [["__scopeId", "data-v-f23a4e1b"]]), $i = { theme: { get cardShadow() {
|
|
2780
2790
|
return a().value;
|
|
2781
|
-
} } },
|
|
2791
|
+
} } }, ea = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
2782
2792
|
inheritAttrs: !1,
|
|
2783
2793
|
__name: "index",
|
|
2784
2794
|
setup(e) {
|
|
2785
|
-
let t = b(() =>
|
|
2786
|
-
return (e, n) => (
|
|
2795
|
+
let t = b(() => $i.theme.cardShadow);
|
|
2796
|
+
return (e, n) => (z(), x(K(X), P({ class: "box-card" }, e.$attrs, { shadow: t.value }), T({ _: 2 }, [V(e.$slots, (t, n) => ({
|
|
2787
2797
|
name: n,
|
|
2788
|
-
fn: J((t) => [
|
|
2798
|
+
fn: J((t) => [H(e.$slots, n, L(A(t ?? {})), void 0, !0)])
|
|
2789
2799
|
}))]), 1040, ["shadow"]));
|
|
2790
2800
|
}
|
|
2791
|
-
}), [["__scopeId", "data-v-ed977a22"]]),
|
|
2792
|
-
function
|
|
2793
|
-
|
|
2801
|
+
}), [["__scopeId", "data-v-ed977a22"]]), ta = /* @__PURE__ */ new Map();
|
|
2802
|
+
function na(e) {
|
|
2803
|
+
ta.set(e.key, e);
|
|
2794
2804
|
}
|
|
2795
|
-
function
|
|
2796
|
-
return
|
|
2805
|
+
function ra(e) {
|
|
2806
|
+
return ta.get(e);
|
|
2797
2807
|
}
|
|
2798
|
-
function
|
|
2808
|
+
function ia(e, { keyword: t, page: n, per_page: r }, i) {
|
|
2799
2809
|
let a = t?.trim().toLowerCase(), o = a ? e.filter((e) => i.some((t) => String(e[t] ?? "").toLowerCase().includes(a))) : e;
|
|
2800
2810
|
return {
|
|
2801
2811
|
items: o.slice((n - 1) * r, n * r),
|
|
@@ -2803,13 +2813,13 @@ function oa(e, { keyword: t, page: n, per_page: r }, i) {
|
|
|
2803
2813
|
};
|
|
2804
2814
|
}
|
|
2805
2815
|
// src/components/schema-form/readonly-text.vue?vue&type=script&setup=true&lang.ts
|
|
2806
|
-
var
|
|
2816
|
+
var aa = { class: "readonly-text" }, oa = {
|
|
2807
2817
|
key: 0,
|
|
2808
2818
|
class: "readonly-text__value"
|
|
2809
|
-
},
|
|
2819
|
+
}, sa = {
|
|
2810
2820
|
key: 1,
|
|
2811
2821
|
class: "readonly-text__empty"
|
|
2812
|
-
},
|
|
2822
|
+
}, ca = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
2813
2823
|
__name: "readonly-text",
|
|
2814
2824
|
props: {
|
|
2815
2825
|
copyable: { type: Boolean },
|
|
@@ -2823,7 +2833,7 @@ var sa = { class: "readonly-text" }, ca = {
|
|
|
2823
2833
|
async function o() {
|
|
2824
2834
|
await n(i.value), Q.success(d("schemaForm.copied"));
|
|
2825
2835
|
}
|
|
2826
|
-
return (e, t) => (
|
|
2836
|
+
return (e, t) => (z(), C("div", aa, [i.value ? (z(), C("span", oa, W(i.value), 1)) : (z(), C("span", sa, W(K(d)("schemaForm.empty")), 1)), a.value ? (z(), x(K(Z), {
|
|
2827
2837
|
key: 2,
|
|
2828
2838
|
class: "readonly-text__copy",
|
|
2829
2839
|
title: K(d)("schemaForm.copy"),
|
|
@@ -2833,21 +2843,21 @@ var sa = { class: "readonly-text" }, ca = {
|
|
|
2833
2843
|
_: 1
|
|
2834
2844
|
}, 8, ["title"])) : S("", !0)]));
|
|
2835
2845
|
}
|
|
2836
|
-
}), [["__scopeId", "data-v-1f95eeac"]]),
|
|
2837
|
-
function
|
|
2846
|
+
}), [["__scopeId", "data-v-1f95eeac"]]), la = ie({});
|
|
2847
|
+
function ua(e) {
|
|
2838
2848
|
return typeof e == "object" && e && "component" in e && e.component ? e : { component: e };
|
|
2839
2849
|
}
|
|
2840
|
-
function
|
|
2841
|
-
for (let [t, n] of Object.entries(e)) n && (
|
|
2850
|
+
function da(e) {
|
|
2851
|
+
for (let [t, n] of Object.entries(e)) n && (la[t] = n);
|
|
2842
2852
|
}
|
|
2843
|
-
function
|
|
2853
|
+
function fa(e) {
|
|
2844
2854
|
if (!e) return;
|
|
2845
|
-
if (typeof e != "string") return
|
|
2846
|
-
let t =
|
|
2847
|
-
return t ?
|
|
2855
|
+
if (typeof e != "string") return ua(e);
|
|
2856
|
+
let t = la[e];
|
|
2857
|
+
return t ? ua(t) : void 0;
|
|
2848
2858
|
}
|
|
2849
2859
|
// src/components/schema-form/schema-form.util.ts
|
|
2850
|
-
var
|
|
2860
|
+
var pa = /* @__PURE__ */ new Set([
|
|
2851
2861
|
"async-select",
|
|
2852
2862
|
"cascader",
|
|
2853
2863
|
"checkbox",
|
|
@@ -2861,43 +2871,43 @@ var ha = /* @__PURE__ */ new Set([
|
|
|
2861
2871
|
"switch",
|
|
2862
2872
|
"upload"
|
|
2863
2873
|
]);
|
|
2864
|
-
function
|
|
2865
|
-
return
|
|
2874
|
+
function ma(e) {
|
|
2875
|
+
return pa.has(e.type);
|
|
2866
2876
|
}
|
|
2867
|
-
function
|
|
2877
|
+
function ha(e) {
|
|
2868
2878
|
return e.type === "group";
|
|
2869
2879
|
}
|
|
2870
|
-
function
|
|
2871
|
-
return e.flatMap((e) =>
|
|
2880
|
+
function ga(e) {
|
|
2881
|
+
return e.flatMap((e) => ha(e) ? e.children : [e]);
|
|
2872
2882
|
}
|
|
2873
|
-
function
|
|
2883
|
+
function _a(e, t) {
|
|
2874
2884
|
return typeof e == "function" ? e(t) : e === !0;
|
|
2875
2885
|
}
|
|
2876
|
-
function
|
|
2877
|
-
return t.mode === "create" && e.hideOnCreate || t.mode === "edit" && e.hideOnEdit ? !0 :
|
|
2886
|
+
function va(e, t) {
|
|
2887
|
+
return t.mode === "create" && e.hideOnCreate || t.mode === "edit" && e.hideOnEdit ? !0 : _a(e.hidden, t);
|
|
2878
2888
|
}
|
|
2879
|
-
function
|
|
2889
|
+
function ya(e) {
|
|
2880
2890
|
if (e.placeholder) return e.placeholder;
|
|
2881
2891
|
let t = e.label || e.prop;
|
|
2882
|
-
return
|
|
2892
|
+
return ma(e) ? d("validation.selectField", { field: t }) : d("validation.enterField", { field: t });
|
|
2883
2893
|
}
|
|
2884
|
-
function
|
|
2894
|
+
function ba(e, t) {
|
|
2885
2895
|
let n = e.rules ? [...e.rules] : [];
|
|
2886
|
-
return
|
|
2896
|
+
return _a(e.required, t) && n.unshift(e.translateConfig && [
|
|
2887
2897
|
"rich-text",
|
|
2888
2898
|
"text",
|
|
2889
2899
|
"textarea"
|
|
2890
2900
|
].includes(e.type) ? {
|
|
2891
|
-
message:
|
|
2901
|
+
message: ya(e),
|
|
2892
2902
|
trigger: "change",
|
|
2893
2903
|
validator: (t, n) => {
|
|
2894
2904
|
let r = (e) => typeof e == "string" ? e.trim().length > 0 : typeof e == "number" || typeof e == "boolean" ? !0 : Array.isArray(e) ? e.some((e) => r(e)) : e && typeof e == "object" ? Object.values(e).some((e) => r(e)) : !1;
|
|
2895
|
-
return n && typeof n == "object" && Object.values(n).some((e) => r(e)) || Error(
|
|
2905
|
+
return n && typeof n == "object" && Object.values(n).some((e) => r(e)) || Error(ya(e));
|
|
2896
2906
|
}
|
|
2897
2907
|
} : {
|
|
2898
2908
|
required: !0,
|
|
2899
|
-
message:
|
|
2900
|
-
trigger:
|
|
2909
|
+
message: ya(e),
|
|
2910
|
+
trigger: ma(e) ? "change" : "blur"
|
|
2901
2911
|
}), n.map((e) => {
|
|
2902
2912
|
if (e.asyncValidator) {
|
|
2903
2913
|
let n = e.asyncValidator;
|
|
@@ -2917,11 +2927,11 @@ function Sa(e, t) {
|
|
|
2917
2927
|
});
|
|
2918
2928
|
}
|
|
2919
2929
|
// src/components/rich-text-editor/index.vue?vue&type=script&setup=true&lang.ts
|
|
2920
|
-
var
|
|
2930
|
+
var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disabled"], Ea = { value: "" }, Da = ["title"], Oa = ["title"], ka = ["title"], Aa = ["title"], ja = ["title"], Ma = ["title"], Na = ["disabled"], Pa = ["value"], Fa = ["disabled"], Ia = ["value"], La = ["disabled"], Ra = { value: "paragraph" }, za = { value: "h1" }, Ba = { value: "h2" }, Va = { value: "h3" }, Ha = { value: "blockquote" }, Ua = ["title"], Wa = ["title"], Ga = ["title"], Ka = ["title"], qa = ["title"], Ja = ["title"], Ya = ["title"], Xa = ["title"], Za = ["title"], Qa = ["title"], $a = ["title"], eo = ["disabled"], to = { value: "" }, no = { value: "insertTable" }, ro = { value: "addColumnBefore" }, io = { value: "addColumnAfter" }, ao = { value: "deleteColumn" }, oo = { value: "addRowBefore" }, so = { value: "addRowAfter" }, co = { value: "deleteRow" }, lo = { value: "deleteTable" }, uo = ["title"], fo = ["title"], po = ["title"], mo = ["title"], ho = ["title"], go = [
|
|
2921
2931
|
"title",
|
|
2922
2932
|
"disabled",
|
|
2923
2933
|
"onClick"
|
|
2924
|
-
],
|
|
2934
|
+
], _o = { key: 1 }, vo = ["readonly"], yo = /*@__PURE__*/ k({
|
|
2925
2935
|
__name: "index",
|
|
2926
2936
|
props: {
|
|
2927
2937
|
editable: {
|
|
@@ -2965,7 +2975,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
2965
2975
|
"20px",
|
|
2966
2976
|
"24px",
|
|
2967
2977
|
"32px"
|
|
2968
|
-
], s =
|
|
2978
|
+
], s = B(r.modelValue), c = B(!1), l = B(!1), u = B(0), f = b(() => r.placeholder || d("components.richTextEditor.placeholder")), p = dn({
|
|
2969
2979
|
content: r.modelValue,
|
|
2970
2980
|
editable: r.editable,
|
|
2971
2981
|
extensions: [
|
|
@@ -3044,7 +3054,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3044
3054
|
return u.value, p.value?.isActive("heading", { level: 1 }) ? "h1" : p.value?.isActive("heading", { level: 2 }) ? "h2" : p.value?.isActive("heading", { level: 3 }) ? "h3" : p.value?.isActive("blockquote") ? "blockquote" : "paragraph";
|
|
3045
3055
|
},
|
|
3046
3056
|
set(e) {
|
|
3047
|
-
|
|
3057
|
+
F(e);
|
|
3048
3058
|
}
|
|
3049
3059
|
}), j = b({
|
|
3050
3060
|
get() {
|
|
@@ -3074,31 +3084,31 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3074
3084
|
function N(e) {
|
|
3075
3085
|
p.value && !m.value && (e(p.value), u.value += 1);
|
|
3076
3086
|
}
|
|
3077
|
-
function
|
|
3087
|
+
function F(e) {
|
|
3078
3088
|
N((t) => {
|
|
3079
3089
|
let n = t.chain().focus();
|
|
3080
3090
|
e === "paragraph" && n.setParagraph().run(), e === "h1" && n.toggleHeading({ level: 1 }).run(), e === "h2" && n.toggleHeading({ level: 2 }).run(), e === "h3" && n.toggleHeading({ level: 3 }).run(), e === "blockquote" && n.toggleBlockquote().run();
|
|
3081
3091
|
});
|
|
3082
3092
|
}
|
|
3083
|
-
function
|
|
3093
|
+
function L() {
|
|
3084
3094
|
p.value && p.value.getHTML() !== s.value && p.value.commands.setContent(s.value, { emitUpdate: !0 });
|
|
3085
3095
|
}
|
|
3086
|
-
function
|
|
3087
|
-
c.value ?
|
|
3096
|
+
function ee() {
|
|
3097
|
+
c.value ? L() : s.value = p.value?.getHTML() ?? r.modelValue, c.value = !c.value;
|
|
3088
3098
|
}
|
|
3089
|
-
function
|
|
3099
|
+
function te() {
|
|
3090
3100
|
if (m.value) return;
|
|
3091
3101
|
let e = p.value?.getAttributes("link").href, t = window.prompt(d("components.richTextEditor.linkPrompt"), e ?? "");
|
|
3092
3102
|
if (t === null) return;
|
|
3093
3103
|
let n = t.trim();
|
|
3094
|
-
n ? p.value?.chain().focus().extendMarkRange("link").setLink({ href:
|
|
3104
|
+
n ? p.value?.chain().focus().extendMarkRange("link").setLink({ href: ne(n) }).run() : p.value?.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
3095
3105
|
}
|
|
3096
|
-
function
|
|
3106
|
+
function U() {
|
|
3097
3107
|
if (m.value) return;
|
|
3098
3108
|
let e = window.prompt(d("components.richTextEditor.imagePrompt"));
|
|
3099
3109
|
e && p.value?.chain().focus().setImage({ src: e.trim() }).run();
|
|
3100
3110
|
}
|
|
3101
|
-
function
|
|
3111
|
+
function ne(e) {
|
|
3102
3112
|
return /^(https?:|mailto:|tel:)/i.test(e) ? e : "https://" + e;
|
|
3103
3113
|
}
|
|
3104
3114
|
function ie(e) {
|
|
@@ -3146,9 +3156,9 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3146
3156
|
return t({
|
|
3147
3157
|
editor: p,
|
|
3148
3158
|
clearFormat: Y
|
|
3149
|
-
}), (t, n) => K(p) ? (
|
|
3159
|
+
}), (t, n) => K(p) ? (z(), C("div", {
|
|
3150
3160
|
key: 0,
|
|
3151
|
-
class:
|
|
3161
|
+
class: I(["rich-text-editor", {
|
|
3152
3162
|
"is-fullscreen": l.value,
|
|
3153
3163
|
"is-source": c.value
|
|
3154
3164
|
}])
|
|
@@ -3160,18 +3170,18 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3160
3170
|
type: "button",
|
|
3161
3171
|
title: K(d)("components.richTextEditor.undo"),
|
|
3162
3172
|
onClick: n[0] ||= (e) => K(p).chain().focus().undo().run()
|
|
3163
|
-
}, [D(K(Gt), { size: 17 })], 8,
|
|
3173
|
+
}, [D(K(Gt), { size: 17 })], 8, xa),
|
|
3164
3174
|
w("button", {
|
|
3165
3175
|
type: "button",
|
|
3166
3176
|
title: K(d)("components.richTextEditor.redo"),
|
|
3167
3177
|
onClick: n[1] ||= (e) => K(p).chain().focus().redo().run()
|
|
3168
|
-
}, [D(K(Vt), { size: 17 })], 8,
|
|
3178
|
+
}, [D(K(Vt), { size: 17 })], 8, Sa),
|
|
3169
3179
|
n[27] ||= w("span", { class: "rich-text-separator" }, null, -1),
|
|
3170
3180
|
w("button", {
|
|
3171
3181
|
type: "button",
|
|
3172
3182
|
title: K(d)("components.richTextEditor.insertImage"),
|
|
3173
|
-
onClick:
|
|
3174
|
-
}, [D(K(kt), { size: 17 })], 8,
|
|
3183
|
+
onClick: U
|
|
3184
|
+
}, [D(K(kt), { size: 17 })], 8, Ca),
|
|
3175
3185
|
w("label", {
|
|
3176
3186
|
class: "rich-text-select-wrap rich-text-select-wrap--line",
|
|
3177
3187
|
title: K(d)("components.richTextEditor.lineHeight")
|
|
@@ -3179,37 +3189,37 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3179
3189
|
disabled: m.value,
|
|
3180
3190
|
onChange: oe
|
|
3181
3191
|
}, [
|
|
3182
|
-
w("option",
|
|
3192
|
+
w("option", Ea, W(K(d)("components.richTextEditor.lineHeight")), 1),
|
|
3183
3193
|
n[22] ||= w("option", { value: "1.2" }, "1.2", -1),
|
|
3184
3194
|
n[23] ||= w("option", { value: "1.5" }, "1.5", -1),
|
|
3185
3195
|
n[24] ||= w("option", { value: "1.75" }, "1.75", -1),
|
|
3186
3196
|
n[25] ||= w("option", { value: "2" }, "2", -1)
|
|
3187
|
-
], 40,
|
|
3197
|
+
], 40, Ta)], 8, wa),
|
|
3188
3198
|
n[28] ||= w("span", { class: "rich-text-separator" }, null, -1),
|
|
3189
3199
|
w("button", {
|
|
3190
3200
|
type: "button",
|
|
3191
|
-
class:
|
|
3201
|
+
class: I({ "is-active": X("bold") }),
|
|
3192
3202
|
title: K(d)("components.richTextEditor.bold"),
|
|
3193
3203
|
onClick: n[2] ||= (e) => K(p).chain().focus().toggleBold().run()
|
|
3194
|
-
}, [D(K(Tt), { size: 17 })], 10,
|
|
3204
|
+
}, [D(K(Tt), { size: 17 })], 10, Da),
|
|
3195
3205
|
w("button", {
|
|
3196
3206
|
type: "button",
|
|
3197
|
-
class:
|
|
3207
|
+
class: I({ "is-active": X("italic") }),
|
|
3198
3208
|
title: K(d)("components.richTextEditor.italic"),
|
|
3199
3209
|
onClick: n[3] ||= (e) => K(p).chain().focus().toggleItalic().run()
|
|
3200
|
-
}, [D(K(Mt), { size: 17 })], 10,
|
|
3210
|
+
}, [D(K(Mt), { size: 17 })], 10, Oa),
|
|
3201
3211
|
w("button", {
|
|
3202
3212
|
type: "button",
|
|
3203
|
-
class:
|
|
3213
|
+
class: I({ "is-active": X("underline") }),
|
|
3204
3214
|
title: K(d)("components.richTextEditor.underline"),
|
|
3205
3215
|
onClick: n[4] ||= (e) => K(p).chain().focus().toggleUnderline().run()
|
|
3206
|
-
}, [D(K(Wt), { size: 17 })], 10,
|
|
3216
|
+
}, [D(K(Wt), { size: 17 })], 10, ka),
|
|
3207
3217
|
w("button", {
|
|
3208
3218
|
type: "button",
|
|
3209
|
-
class:
|
|
3219
|
+
class: I({ "is-active": X("strike") }),
|
|
3210
3220
|
title: K(d)("components.richTextEditor.strike"),
|
|
3211
3221
|
onClick: n[5] ||= (e) => K(p).chain().focus().toggleStrike().run()
|
|
3212
|
-
}, [D(K(Ht), { size: 17 })], 10,
|
|
3222
|
+
}, [D(K(Ht), { size: 17 })], 10, Aa),
|
|
3213
3223
|
w("label", {
|
|
3214
3224
|
class: "rich-text-color",
|
|
3215
3225
|
title: K(d)("components.richTextEditor.textColor")
|
|
@@ -3217,7 +3227,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3217
3227
|
type: "color",
|
|
3218
3228
|
value: "#111827",
|
|
3219
3229
|
onInput: ie
|
|
3220
|
-
}, null, 32)], 8,
|
|
3230
|
+
}, null, 32)], 8, ja),
|
|
3221
3231
|
w("label", {
|
|
3222
3232
|
class: "rich-text-color",
|
|
3223
3233
|
title: K(d)("components.richTextEditor.highlight")
|
|
@@ -3225,94 +3235,94 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3225
3235
|
type: "color",
|
|
3226
3236
|
value: "#fff3bf",
|
|
3227
3237
|
onInput: ae
|
|
3228
|
-
}, null, 32)], 8,
|
|
3238
|
+
}, null, 32)], 8, Ma),
|
|
3229
3239
|
n[29] ||= w("span", { class: "rich-text-separator" }, null, -1),
|
|
3230
3240
|
ue(w("select", {
|
|
3231
3241
|
"onUpdate:modelValue": n[6] ||= (e) => j.value = e,
|
|
3232
3242
|
class: "rich-text-select rich-text-select--font",
|
|
3233
3243
|
disabled: m.value
|
|
3234
|
-
}, [(
|
|
3244
|
+
}, [(z(), C(y, null, V(a, (e) => w("option", {
|
|
3235
3245
|
key: e.label,
|
|
3236
3246
|
value: e.value
|
|
3237
|
-
}, W(e.label), 9,
|
|
3247
|
+
}, W(e.label), 9, Pa)), 64))], 8, Na), [[ce, j.value]]),
|
|
3238
3248
|
ue(w("select", {
|
|
3239
3249
|
"onUpdate:modelValue": n[7] ||= (e) => M.value = e,
|
|
3240
3250
|
class: "rich-text-select rich-text-select--size",
|
|
3241
3251
|
disabled: m.value
|
|
3242
|
-
}, [(
|
|
3252
|
+
}, [(z(), C(y, null, V(o, (e) => w("option", {
|
|
3243
3253
|
key: e,
|
|
3244
3254
|
value: e
|
|
3245
|
-
}, W(e), 9,
|
|
3255
|
+
}, W(e), 9, Ia)), 64))], 8, Fa), [[ce, M.value]]),
|
|
3246
3256
|
ue(w("select", {
|
|
3247
3257
|
"onUpdate:modelValue": n[8] ||= (e) => A.value = e,
|
|
3248
3258
|
class: "rich-text-select rich-text-select--block",
|
|
3249
3259
|
disabled: m.value
|
|
3250
3260
|
}, [
|
|
3251
|
-
w("option",
|
|
3252
|
-
w("option",
|
|
3253
|
-
w("option",
|
|
3254
|
-
w("option",
|
|
3255
|
-
w("option",
|
|
3256
|
-
], 8,
|
|
3261
|
+
w("option", Ra, W(K(d)("components.richTextEditor.paragraph")), 1),
|
|
3262
|
+
w("option", za, W(K(d)("components.richTextEditor.heading1")), 1),
|
|
3263
|
+
w("option", Ba, W(K(d)("components.richTextEditor.heading2")), 1),
|
|
3264
|
+
w("option", Va, W(K(d)("components.richTextEditor.heading3")), 1),
|
|
3265
|
+
w("option", Ha, W(K(d)("components.richTextEditor.blockquote")), 1)
|
|
3266
|
+
], 8, La), [[ce, A.value]]),
|
|
3257
3267
|
n[30] ||= w("span", { class: "rich-text-separator" }, null, -1),
|
|
3258
3268
|
w("button", {
|
|
3259
3269
|
type: "button",
|
|
3260
|
-
class:
|
|
3270
|
+
class: I({ "is-active": pe("left") }),
|
|
3261
3271
|
title: K(d)("components.richTextEditor.alignLeft"),
|
|
3262
3272
|
onClick: n[9] ||= (e) => G("left")
|
|
3263
|
-
}, [D(K(Ct), { size: 17 })], 10,
|
|
3273
|
+
}, [D(K(Ct), { size: 17 })], 10, Ua),
|
|
3264
3274
|
w("button", {
|
|
3265
3275
|
type: "button",
|
|
3266
|
-
class:
|
|
3276
|
+
class: I({ "is-active": pe("center") }),
|
|
3267
3277
|
title: K(d)("components.richTextEditor.alignCenter"),
|
|
3268
3278
|
onClick: n[10] ||= (e) => G("center")
|
|
3269
|
-
}, [D(K(xt), { size: 17 })], 10,
|
|
3279
|
+
}, [D(K(xt), { size: 17 })], 10, Wa),
|
|
3270
3280
|
w("button", {
|
|
3271
3281
|
type: "button",
|
|
3272
|
-
class:
|
|
3282
|
+
class: I({ "is-active": pe("right") }),
|
|
3273
3283
|
title: K(d)("components.richTextEditor.alignRight"),
|
|
3274
3284
|
onClick: n[11] ||= (e) => G("right")
|
|
3275
|
-
}, [D(K(wt), { size: 17 })], 10,
|
|
3285
|
+
}, [D(K(wt), { size: 17 })], 10, Ga),
|
|
3276
3286
|
w("button", {
|
|
3277
3287
|
type: "button",
|
|
3278
|
-
class:
|
|
3288
|
+
class: I({ "is-active": pe("justify") }),
|
|
3279
3289
|
title: K(d)("components.richTextEditor.alignJustify"),
|
|
3280
3290
|
onClick: n[12] ||= (e) => G("justify")
|
|
3281
|
-
}, [D(K(St), { size: 17 })], 10,
|
|
3291
|
+
}, [D(K(St), { size: 17 })], 10, Ka),
|
|
3282
3292
|
n[31] ||= w("span", { class: "rich-text-break" }, null, -1),
|
|
3283
3293
|
w("button", {
|
|
3284
3294
|
type: "button",
|
|
3285
3295
|
title: K(d)("components.richTextEditor.decreaseIndent"),
|
|
3286
3296
|
onClick: de
|
|
3287
|
-
}, [D(K(At), { size: 17 })], 8,
|
|
3297
|
+
}, [D(K(At), { size: 17 })], 8, qa),
|
|
3288
3298
|
w("button", {
|
|
3289
3299
|
type: "button",
|
|
3290
3300
|
title: K(d)("components.richTextEditor.increaseIndent"),
|
|
3291
3301
|
onClick: J
|
|
3292
|
-
}, [D(K(jt), { size: 17 })], 8,
|
|
3302
|
+
}, [D(K(jt), { size: 17 })], 8, Ja),
|
|
3293
3303
|
w("button", {
|
|
3294
3304
|
type: "button",
|
|
3295
|
-
class:
|
|
3305
|
+
class: I({ "is-active": X("orderedList") }),
|
|
3296
3306
|
title: K(d)("components.richTextEditor.orderedList"),
|
|
3297
3307
|
onClick: n[13] ||= (e) => K(p).chain().focus().toggleOrderedList().run()
|
|
3298
|
-
}, [D(K(It), { size: 17 })], 10,
|
|
3308
|
+
}, [D(K(It), { size: 17 })], 10, Ya),
|
|
3299
3309
|
w("button", {
|
|
3300
3310
|
type: "button",
|
|
3301
|
-
class:
|
|
3311
|
+
class: I({ "is-active": X("bulletList") }),
|
|
3302
3312
|
title: K(d)("components.richTextEditor.bulletList"),
|
|
3303
3313
|
onClick: n[14] ||= (e) => K(p).chain().focus().toggleBulletList().run()
|
|
3304
|
-
}, [D(K(Ft), { size: 17 })], 10,
|
|
3314
|
+
}, [D(K(Ft), { size: 17 })], 10, Xa),
|
|
3305
3315
|
w("button", {
|
|
3306
3316
|
type: "button",
|
|
3307
|
-
class:
|
|
3317
|
+
class: I({ "is-active": X("code") }),
|
|
3308
3318
|
title: K(d)("components.richTextEditor.code"),
|
|
3309
3319
|
onClick: n[15] ||= (e) => K(p).chain().focus().toggleCode().run()
|
|
3310
|
-
}, [...n[26] ||= [w("span", { class: "rich-text-tx" }, [E("T"), w("sub", null, "x")], -1)]], 10,
|
|
3320
|
+
}, [...n[26] ||= [w("span", { class: "rich-text-tx" }, [E("T"), w("sub", null, "x")], -1)]], 10, Za),
|
|
3311
3321
|
w("button", {
|
|
3312
3322
|
type: "button",
|
|
3313
3323
|
title: K(d)("components.richTextEditor.insertLink"),
|
|
3314
|
-
onClick:
|
|
3315
|
-
}, [D(K(Pt), { size: 17 })], 8,
|
|
3324
|
+
onClick: te
|
|
3325
|
+
}, [D(K(Pt), { size: 17 })], 8, Qa),
|
|
3316
3326
|
w("label", {
|
|
3317
3327
|
class: "rich-text-select-wrap rich-text-select-wrap--table",
|
|
3318
3328
|
title: K(d)("components.richTextEditor.table")
|
|
@@ -3320,82 +3330,82 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3320
3330
|
disabled: m.value,
|
|
3321
3331
|
onChange: se
|
|
3322
3332
|
}, [
|
|
3323
|
-
w("option",
|
|
3324
|
-
w("option",
|
|
3325
|
-
w("option",
|
|
3326
|
-
w("option",
|
|
3327
|
-
w("option",
|
|
3328
|
-
w("option",
|
|
3329
|
-
w("option",
|
|
3330
|
-
w("option",
|
|
3331
|
-
w("option",
|
|
3332
|
-
], 40,
|
|
3333
|
+
w("option", to, W(K(d)("components.richTextEditor.table")), 1),
|
|
3334
|
+
w("option", no, W(K(d)("components.richTextEditor.insertTable")), 1),
|
|
3335
|
+
w("option", ro, W(K(d)("components.richTextEditor.addColumnBefore")), 1),
|
|
3336
|
+
w("option", io, W(K(d)("components.richTextEditor.addColumnAfter")), 1),
|
|
3337
|
+
w("option", ao, W(K(d)("components.richTextEditor.deleteColumn")), 1),
|
|
3338
|
+
w("option", oo, W(K(d)("components.richTextEditor.addRowBefore")), 1),
|
|
3339
|
+
w("option", so, W(K(d)("components.richTextEditor.addRowAfter")), 1),
|
|
3340
|
+
w("option", co, W(K(d)("components.richTextEditor.deleteRow")), 1),
|
|
3341
|
+
w("option", lo, W(K(d)("components.richTextEditor.deleteTable")), 1)
|
|
3342
|
+
], 40, eo)], 8, $a),
|
|
3333
3343
|
n[32] ||= w("span", { class: "rich-text-separator" }, null, -1),
|
|
3334
3344
|
w("button", {
|
|
3335
3345
|
type: "button",
|
|
3336
3346
|
title: K(d)("components.richTextEditor.fullscreen"),
|
|
3337
3347
|
onClick: n[16] ||= (e) => l.value = !l.value
|
|
3338
|
-
}, [l.value ? (
|
|
3348
|
+
}, [l.value ? (z(), x(K(Rt), {
|
|
3339
3349
|
key: 0,
|
|
3340
3350
|
size: 17
|
|
3341
|
-
})) : (
|
|
3351
|
+
})) : (z(), x(K(Lt), {
|
|
3342
3352
|
key: 1,
|
|
3343
3353
|
size: 17
|
|
3344
|
-
}))], 8,
|
|
3354
|
+
}))], 8, uo),
|
|
3345
3355
|
w("button", {
|
|
3346
3356
|
type: "button",
|
|
3347
|
-
class:
|
|
3357
|
+
class: I({ "is-active": c.value }),
|
|
3348
3358
|
title: K(d)("components.richTextEditor.sourceCode"),
|
|
3349
|
-
onClick:
|
|
3350
|
-
}, [D(K(Et), { size: 17 })], 10,
|
|
3359
|
+
onClick: ee
|
|
3360
|
+
}, [D(K(Et), { size: 17 })], 10, fo),
|
|
3351
3361
|
w("button", {
|
|
3352
3362
|
type: "button",
|
|
3353
3363
|
title: K(d)("components.richTextEditor.clearFormat"),
|
|
3354
3364
|
onClick: Y
|
|
3355
|
-
}, [D(K(Dt), { size: 17 })], 8,
|
|
3365
|
+
}, [D(K(Dt), { size: 17 })], 8, po),
|
|
3356
3366
|
w("button", {
|
|
3357
3367
|
type: "button",
|
|
3358
|
-
class:
|
|
3368
|
+
class: I({ "is-active": X("blockquote") }),
|
|
3359
3369
|
title: K(d)("components.richTextEditor.blockquote"),
|
|
3360
3370
|
onClick: n[17] ||= (e) => K(p).chain().focus().toggleBlockquote().run()
|
|
3361
|
-
}, [D(K(Bt), { size: 17 })], 10,
|
|
3362
|
-
t.$slots["toolbar-append"] ? (
|
|
3371
|
+
}, [D(K(Bt), { size: 17 })], 10, mo),
|
|
3372
|
+
t.$slots["toolbar-append"] ? (z(), C("div", {
|
|
3363
3373
|
key: 0,
|
|
3364
3374
|
class: "rich-text-toolbar-extension",
|
|
3365
3375
|
onMousedown: n[18] ||= fe(() => {}, ["stop"])
|
|
3366
|
-
}, [
|
|
3367
|
-
(
|
|
3376
|
+
}, [H(t.$slots, "toolbar-append", {}, void 0, !0)], 32)) : S("", !0),
|
|
3377
|
+
(z(!0), C(y, null, V(T.value, (e) => (z(), C(y, { key: e.key }, [e.component ? (z(), C("div", {
|
|
3368
3378
|
key: 0,
|
|
3369
3379
|
class: "rich-text-toolbar-extension",
|
|
3370
3380
|
title: e.label,
|
|
3371
3381
|
onMousedown: n[19] ||= fe(() => {}, ["stop"])
|
|
3372
|
-
}, [(
|
|
3382
|
+
}, [(z(), x(re(e.component), P({ ref_for: !0 }, e.props, {
|
|
3373
3383
|
context: _.value,
|
|
3374
3384
|
disabled: O(e)
|
|
3375
|
-
}), null, 16, ["context", "disabled"]))], 40,
|
|
3385
|
+
}), null, 16, ["context", "disabled"]))], 40, ho)) : (z(), C("button", {
|
|
3376
3386
|
key: 1,
|
|
3377
3387
|
type: "button",
|
|
3378
3388
|
title: e.label,
|
|
3379
3389
|
disabled: O(e),
|
|
3380
3390
|
onClick: (t) => k(e)
|
|
3381
|
-
}, [e.icon ? (
|
|
3391
|
+
}, [e.icon ? (z(), x(re(e.icon), {
|
|
3382
3392
|
key: 0,
|
|
3383
3393
|
size: 17
|
|
3384
|
-
})) : (
|
|
3385
|
-
], 32), c.value ? ue((
|
|
3394
|
+
})) : (z(), C("span", _o, W(e.label), 1))], 8, go))], 64))), 128))
|
|
3395
|
+
], 32), c.value ? ue((z(), C("textarea", {
|
|
3386
3396
|
key: 0,
|
|
3387
3397
|
"onUpdate:modelValue": n[21] ||= (e) => s.value = e,
|
|
3388
3398
|
class: "rich-text-source",
|
|
3389
3399
|
readonly: m.value,
|
|
3390
|
-
style:
|
|
3391
|
-
onBlur:
|
|
3392
|
-
}, null, 44,
|
|
3400
|
+
style: R({ "--rich-text-max-height": e.maxHeight }),
|
|
3401
|
+
onBlur: L
|
|
3402
|
+
}, null, 44, vo)), [[le, s.value]]) : (z(), x(K(un), {
|
|
3393
3403
|
key: 1,
|
|
3394
3404
|
editor: K(p),
|
|
3395
|
-
style:
|
|
3405
|
+
style: R({ "--rich-text-max-height": e.maxHeight })
|
|
3396
3406
|
}, null, 8, ["editor", "style"]))], 2)) : S("", !0);
|
|
3397
3407
|
}
|
|
3398
|
-
}),
|
|
3408
|
+
}), bo = /* @__PURE__ */ e({ default: () => xo }), xo = /*#__PURE__*/ f(yo, [["__scopeId", "data-v-b8951950"]]), So = [
|
|
3399
3409
|
{
|
|
3400
3410
|
code: "en",
|
|
3401
3411
|
label: "English"
|
|
@@ -3444,10 +3454,10 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3444
3454
|
code: "fr",
|
|
3445
3455
|
label: "French"
|
|
3446
3456
|
}
|
|
3447
|
-
],
|
|
3457
|
+
], Co = {
|
|
3448
3458
|
key: 0,
|
|
3449
3459
|
class: "translate-toolbar__inline"
|
|
3450
|
-
},
|
|
3460
|
+
}, wo = { class: "translate-toolbar__label" }, To = { class: "translate-toolbar__controls" }, Eo = { class: "translate-toolbar__row" }, Do = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
3451
3461
|
__name: "translate-toolbar",
|
|
3452
3462
|
props: {
|
|
3453
3463
|
disabled: {
|
|
@@ -3479,12 +3489,12 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3479
3489
|
function a(e) {
|
|
3480
3490
|
(e === "translate" || e === "polish") && r("translate", e);
|
|
3481
3491
|
}
|
|
3482
|
-
return (t, n) => e.inline ? (
|
|
3492
|
+
return (t, n) => e.inline ? (z(), C("div", Co, [w("span", wo, [D(K(Nt), {
|
|
3483
3493
|
class: "translate-toolbar__label-icon",
|
|
3484
3494
|
size: 16,
|
|
3485
3495
|
color: "#8994BC",
|
|
3486
3496
|
"stroke-width": 2
|
|
3487
|
-
}), E(" " + W(K(d)("product-management.attribute.translation.label")), 1)]), w("div",
|
|
3497
|
+
}), E(" " + W(K(d)("product-management.attribute.translation.label")), 1)]), w("div", To, [
|
|
3488
3498
|
D(K(Pe), {
|
|
3489
3499
|
"model-value": e.sourceLanguage,
|
|
3490
3500
|
disabled: e.disabled || e.loading,
|
|
@@ -3492,7 +3502,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3492
3502
|
class: "translate-toolbar__language-select",
|
|
3493
3503
|
"onUpdate:modelValue": n[0] ||= (e) => r("update:sourceLanguage", String(e))
|
|
3494
3504
|
}, {
|
|
3495
|
-
default: J(() => [(
|
|
3505
|
+
default: J(() => [(z(!0), C(y, null, V(e.languages, (e) => (z(), x(K($), {
|
|
3496
3506
|
key: e.code,
|
|
3497
3507
|
label: e.label,
|
|
3498
3508
|
value: e.code
|
|
@@ -3514,7 +3524,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3514
3524
|
class: "translate-toolbar__language-select",
|
|
3515
3525
|
"onUpdate:modelValue": n[1] ||= (e) => r("update:targetLanguage", String(e))
|
|
3516
3526
|
}, {
|
|
3517
|
-
default: J(() => [(
|
|
3527
|
+
default: J(() => [(z(!0), C(y, null, V(i.value, (e) => (z(), x(K($), {
|
|
3518
3528
|
key: e.code,
|
|
3519
3529
|
label: e.label,
|
|
3520
3530
|
value: e.code
|
|
@@ -3546,7 +3556,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3546
3556
|
default: J(() => [E(W(K(d)("product-management.attribute.translation.translate")) + " ", 1)]),
|
|
3547
3557
|
_: 1
|
|
3548
3558
|
}, 8, ["disabled"])
|
|
3549
|
-
])])) : (
|
|
3559
|
+
])])) : (z(), x(K(ke), {
|
|
3550
3560
|
key: 1,
|
|
3551
3561
|
width: 390,
|
|
3552
3562
|
placement: "bottom-end",
|
|
@@ -3566,7 +3576,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3566
3576
|
"title",
|
|
3567
3577
|
"aria-label"
|
|
3568
3578
|
])]),
|
|
3569
|
-
default: J(() => [w("div",
|
|
3579
|
+
default: J(() => [w("div", Eo, [
|
|
3570
3580
|
D(K(Pe), {
|
|
3571
3581
|
"model-value": e.sourceLanguage,
|
|
3572
3582
|
disabled: e.disabled || e.loading,
|
|
@@ -3574,7 +3584,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3574
3584
|
class: "translate-toolbar__language-select",
|
|
3575
3585
|
"onUpdate:modelValue": n[3] ||= (e) => r("update:sourceLanguage", String(e))
|
|
3576
3586
|
}, {
|
|
3577
|
-
default: J(() => [(
|
|
3587
|
+
default: J(() => [(z(!0), C(y, null, V(e.languages, (e) => (z(), x(K($), {
|
|
3578
3588
|
key: e.code,
|
|
3579
3589
|
label: e.label,
|
|
3580
3590
|
value: e.code
|
|
@@ -3596,7 +3606,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3596
3606
|
class: "translate-toolbar__language-select",
|
|
3597
3607
|
"onUpdate:modelValue": n[4] ||= (e) => r("update:targetLanguage", String(e))
|
|
3598
3608
|
}, {
|
|
3599
|
-
default: J(() => [(
|
|
3609
|
+
default: J(() => [(z(!0), C(y, null, V(i.value, (e) => (z(), x(K($), {
|
|
3600
3610
|
key: e.code,
|
|
3601
3611
|
label: e.label,
|
|
3602
3612
|
value: e.code
|
|
@@ -3632,10 +3642,10 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3632
3642
|
_: 1
|
|
3633
3643
|
}, 8, ["disabled"]));
|
|
3634
3644
|
}
|
|
3635
|
-
}), [["__scopeId", "data-v-df9539f3"]]),
|
|
3645
|
+
}), [["__scopeId", "data-v-df9539f3"]]), Oo = ["element-loading-text"], ko = {
|
|
3636
3646
|
key: 1,
|
|
3637
3647
|
class: "translate-field__grid"
|
|
3638
|
-
},
|
|
3648
|
+
}, Ao = ["for"], jo = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
3639
3649
|
__name: "translate-field",
|
|
3640
3650
|
props: {
|
|
3641
3651
|
config: { default: void 0 },
|
|
@@ -3656,11 +3666,11 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3656
3666
|
},
|
|
3657
3667
|
emits: ["update:modelValue"],
|
|
3658
3668
|
setup(e, { emit: t }) {
|
|
3659
|
-
let n = e, r = t, i = b(() => n.config?.language?.length ? n.config.language :
|
|
3669
|
+
let n = e, r = t, i = b(() => n.config?.language?.length ? n.config.language : So), a = b(() => i.value.map(({ code: e }) => e)), o = b(() => n.config?.layout ?? ([
|
|
3660
3670
|
"rich-text",
|
|
3661
3671
|
"text",
|
|
3662
3672
|
"textarea"
|
|
3663
|
-
].includes(n.field.type) ? "tabs" : "grid")), s = b(() => i.value.find(({ code: e }) => e === l.value)?.label ?? ""), c = b(() => n.modelValue && typeof n.modelValue == "object" && !Array.isArray(n.modelValue) ? n.modelValue : typeof n.modelValue == "string" ? { [i.value[0]?.code ?? "en"]: n.modelValue } : {}), l =
|
|
3673
|
+
].includes(n.field.type) ? "tabs" : "grid")), s = b(() => i.value.find(({ code: e }) => e === l.value)?.label ?? ""), c = b(() => n.modelValue && typeof n.modelValue == "object" && !Array.isArray(n.modelValue) ? n.modelValue : typeof n.modelValue == "string" ? { [i.value[0]?.code ?? "en"]: n.modelValue } : {}), l = B("en"), u = B("en"), f = B("all"), p = B(!1), m = b(() => n.disabled || n.readonly || p.value);
|
|
3664
3674
|
q(a, (e) => {
|
|
3665
3675
|
e.includes(l.value) || (l.value = e.includes("en") ? "en" : e[0] ?? ""), e.includes(u.value) || (u.value = e.includes("en") ? "en" : e[0] ?? ""), f.value === "all" || e.includes(f.value) && f.value !== u.value || (f.value = "all");
|
|
3666
3676
|
}, { immediate: !0 });
|
|
@@ -3719,22 +3729,22 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3719
3729
|
}
|
|
3720
3730
|
}
|
|
3721
3731
|
return (t, n) => {
|
|
3722
|
-
let r =
|
|
3723
|
-
return ue((
|
|
3724
|
-
class:
|
|
3732
|
+
let r = ne("loading");
|
|
3733
|
+
return ue((z(), C("div", {
|
|
3734
|
+
class: I(["translate-field", [`translate-field--label-${e.labelPosition}`, { "translate-field--plain-input": e.field.type === "text" || e.field.type === "textarea" }]]),
|
|
3725
3735
|
"element-loading-text": K(d)("product-management.attribute.translation.loading")
|
|
3726
|
-
}, [o.value === "tabs" ? (
|
|
3736
|
+
}, [o.value === "tabs" ? (z(), C(y, { key: 0 }, [D(K(Ve), {
|
|
3727
3737
|
modelValue: l.value,
|
|
3728
3738
|
"onUpdate:modelValue": n[0] ||= (e) => l.value = e,
|
|
3729
3739
|
class: "translate-field__tabs"
|
|
3730
3740
|
}, {
|
|
3731
|
-
default: J(() => [(
|
|
3741
|
+
default: J(() => [(z(!0), C(y, null, V(i.value, (e) => (z(), x(K(Le), {
|
|
3732
3742
|
key: e.code,
|
|
3733
3743
|
label: e.label,
|
|
3734
3744
|
name: e.code
|
|
3735
3745
|
}, null, 8, ["label", "name"]))), 128))]),
|
|
3736
3746
|
_: 1
|
|
3737
|
-
}, 8, ["modelValue"]), e.field.type === "rich-text" ? (
|
|
3747
|
+
}, 8, ["modelValue"]), e.field.type === "rich-text" ? (z(), x(xo, P({ key: 0 }, e.inputProps, {
|
|
3738
3748
|
id: `${e.field.prop}-${l.value}`,
|
|
3739
3749
|
"model-value": String(c.value[l.value] ?? ""),
|
|
3740
3750
|
placeholder: e.placeholder || s.value,
|
|
@@ -3743,7 +3753,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3743
3753
|
"tool-context": _(l.value),
|
|
3744
3754
|
"onUpdate:modelValue": n[3] ||= (e) => h(l.value, e)
|
|
3745
3755
|
}), {
|
|
3746
|
-
"toolbar-append": J(() => [D(
|
|
3756
|
+
"toolbar-append": J(() => [D(Do, {
|
|
3747
3757
|
languages: i.value,
|
|
3748
3758
|
"source-language": u.value,
|
|
3749
3759
|
"target-language": f.value,
|
|
@@ -3767,7 +3777,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3767
3777
|
"editable",
|
|
3768
3778
|
"max-height",
|
|
3769
3779
|
"tool-context"
|
|
3770
|
-
])) : (
|
|
3780
|
+
])) : (z(), x(K(Te), P({ key: 1 }, e.inputProps, {
|
|
3771
3781
|
id: `${e.field.prop}-${l.value}`,
|
|
3772
3782
|
"model-value": g(l.value),
|
|
3773
3783
|
type: e.field.type === "textarea" ? "textarea" : "text",
|
|
@@ -3782,13 +3792,13 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3782
3792
|
"rows",
|
|
3783
3793
|
"placeholder",
|
|
3784
3794
|
"disabled"
|
|
3785
|
-
]))], 64)) : (
|
|
3795
|
+
]))], 64)) : (z(), C("div", ko, [(z(!0), C(y, null, V(i.value, (t) => (z(), C("div", {
|
|
3786
3796
|
key: t.code,
|
|
3787
3797
|
class: "translate-field__entry"
|
|
3788
3798
|
}, [w("label", {
|
|
3789
3799
|
class: "translate-field__label",
|
|
3790
3800
|
for: `${e.field.prop}-${t.code}`
|
|
3791
|
-
}, W(t.label), 9,
|
|
3801
|
+
}, W(t.label), 9, Ao), e.field.type === "rich-text" ? (z(), x(xo, P({
|
|
3792
3802
|
key: 0,
|
|
3793
3803
|
ref_for: !0
|
|
3794
3804
|
}, e.inputProps, {
|
|
@@ -3807,7 +3817,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3807
3817
|
"max-height",
|
|
3808
3818
|
"tool-context",
|
|
3809
3819
|
"onUpdate:modelValue"
|
|
3810
|
-
])) : (
|
|
3820
|
+
])) : (z(), x(K(Te), P({
|
|
3811
3821
|
key: 1,
|
|
3812
3822
|
ref_for: !0
|
|
3813
3823
|
}, e.inputProps, {
|
|
@@ -3826,7 +3836,7 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3826
3836
|
"placeholder",
|
|
3827
3837
|
"disabled",
|
|
3828
3838
|
"onUpdate:modelValue"
|
|
3829
|
-
]))]))), 128))])), o.value !== "tabs" || e.field.type !== "rich-text" ? (
|
|
3839
|
+
]))]))), 128))])), o.value !== "tabs" || e.field.type !== "rich-text" ? (z(), x(Do, {
|
|
3830
3840
|
key: 2,
|
|
3831
3841
|
inline: e.field.type === "text" || e.field.type === "textarea",
|
|
3832
3842
|
languages: i.value,
|
|
@@ -3845,12 +3855,12 @@ var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disab
|
|
|
3845
3855
|
"target-language",
|
|
3846
3856
|
"disabled",
|
|
3847
3857
|
"loading"
|
|
3848
|
-
])) : S("", !0)], 10,
|
|
3858
|
+
])) : S("", !0)], 10, Oo)), [[r, p.value]]);
|
|
3849
3859
|
};
|
|
3850
3860
|
}
|
|
3851
3861
|
}), [["__scopeId", "data-v-51b67e99"]]);
|
|
3852
3862
|
// src/components/schema-form/use-field-options.ts
|
|
3853
|
-
function
|
|
3863
|
+
function Mo(e, t) {
|
|
3854
3864
|
let { options: n } = Fr(() => {
|
|
3855
3865
|
let t = e();
|
|
3856
3866
|
return t.optionSource === "dict" ? t.dictCode : "";
|
|
@@ -3861,13 +3871,13 @@ function Po(e, t) {
|
|
|
3861
3871
|
});
|
|
3862
3872
|
}
|
|
3863
3873
|
// src/components/schema-form/schema-form-item.vue?vue&type=script&setup=true&lang.ts
|
|
3864
|
-
var
|
|
3874
|
+
var No = {
|
|
3865
3875
|
key: 2,
|
|
3866
3876
|
class: "schema-form-item__dict-tag"
|
|
3867
|
-
},
|
|
3877
|
+
}, Po = {
|
|
3868
3878
|
key: 23,
|
|
3869
3879
|
class: "schema-form-item__tip"
|
|
3870
|
-
},
|
|
3880
|
+
}, Fo = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
3871
3881
|
__name: "schema-form-item",
|
|
3872
3882
|
props: {
|
|
3873
3883
|
disabled: { type: Boolean },
|
|
@@ -3880,13 +3890,13 @@ var Fo = {
|
|
|
3880
3890
|
},
|
|
3881
3891
|
emits: ["update:modelValue"],
|
|
3882
3892
|
setup(e, { emit: t }) {
|
|
3883
|
-
let r = e, i = t, a = O(() => Promise.resolve().then(() =>
|
|
3893
|
+
let r = e, i = t, a = O(() => Promise.resolve().then(() => Zi)), o = O(() => import("./file-upload-ClPojHbE.js")), s = O(() => import("./picture-upload-VK7YOAr4.js")), c = O(() => Promise.resolve().then(() => bo)), l = b(() => r.context ?? {
|
|
3884
3894
|
mode: "create",
|
|
3885
3895
|
values: {}
|
|
3886
|
-
}), u =
|
|
3896
|
+
}), u = Mo(() => r.field, l), d = b(() => ({
|
|
3887
3897
|
...l.value,
|
|
3888
|
-
updateValue:
|
|
3889
|
-
})), f = b(() => typeof r.field.props == "function" ? r.field.props(d.value) : r.field.props), p = b(() =>
|
|
3898
|
+
updateValue: U
|
|
3899
|
+
})), f = b(() => typeof r.field.props == "function" ? r.field.props(d.value) : r.field.props), p = b(() => ba(r.field, l.value)), m = b(() => ya(r.field)), h = b(() => r.field.copyable ?? !!r.field.readonly), g = b(() => !!r.field.translateConfig && [
|
|
3890
3900
|
"rich-text",
|
|
3891
3901
|
"text",
|
|
3892
3902
|
"textarea"
|
|
@@ -3937,7 +3947,7 @@ var Fo = {
|
|
|
3937
3947
|
fileOriginName: t.fileOriginName ?? t.name ?? t.url ?? t.fileUrl
|
|
3938
3948
|
};
|
|
3939
3949
|
}).filter((e) => !!e);
|
|
3940
|
-
}), A = b(() => f.value?.maxPreviewCount ?? f.value?.maxCount ?? 3), j = b(() =>
|
|
3950
|
+
}), A = b(() => f.value?.maxPreviewCount ?? f.value?.maxCount ?? 3), j = b(() => fa(r.field.component)), M = b(() => {
|
|
3941
3951
|
let e = j.value;
|
|
3942
3952
|
return e ? {
|
|
3943
3953
|
...f.value,
|
|
@@ -3946,8 +3956,8 @@ var Fo = {
|
|
|
3946
3956
|
} : {};
|
|
3947
3957
|
}), N = b(() => {
|
|
3948
3958
|
let e = j.value;
|
|
3949
|
-
return e ? { [e.updateEvent ?? `update:${e.modelProp ?? "modelValue"}`]: (t) =>
|
|
3950
|
-
}),
|
|
3959
|
+
return e ? { [e.updateEvent ?? `update:${e.modelProp ?? "modelValue"}`]: (t) => U(e.valueExtractor?.(t) ?? t) } : {};
|
|
3960
|
+
}), F = b(() => ({
|
|
3951
3961
|
...f.value,
|
|
3952
3962
|
editable: !r.disabled && !r.readonly && f.value?.editable !== !1,
|
|
3953
3963
|
toolContext: {
|
|
@@ -3956,11 +3966,11 @@ var Fo = {
|
|
|
3956
3966
|
getFormData: () => l.value.values,
|
|
3957
3967
|
mode: l.value.mode
|
|
3958
3968
|
}
|
|
3959
|
-
})),
|
|
3960
|
-
let e =
|
|
3969
|
+
})), L = b(() => r.field.apiOptions), R = b(() => L.value ? ra(L.value.entityKey) : void 0), ee = b(() => {
|
|
3970
|
+
let e = L.value?.params;
|
|
3961
3971
|
return typeof e == "function" ? e(l.value) : e;
|
|
3962
|
-
}),
|
|
3963
|
-
let e =
|
|
3972
|
+
}), te = b(() => JSON.stringify(ee.value ?? {})), B = b(() => {
|
|
3973
|
+
let e = R.value, t = L.value;
|
|
3964
3974
|
return !e || !t ? null : {
|
|
3965
3975
|
columns: e.columns ?? [],
|
|
3966
3976
|
dialogTitle: e.dialogTitle,
|
|
@@ -3970,14 +3980,14 @@ var Fo = {
|
|
|
3970
3980
|
valueKey: t.valueKey ?? e.valueKey
|
|
3971
3981
|
};
|
|
3972
3982
|
});
|
|
3973
|
-
function
|
|
3983
|
+
function U(e) {
|
|
3974
3984
|
i("update:modelValue", e);
|
|
3975
3985
|
}
|
|
3976
|
-
function
|
|
3977
|
-
let t =
|
|
3986
|
+
function ne(e) {
|
|
3987
|
+
let t = R.value;
|
|
3978
3988
|
return t ? t.fetch({
|
|
3979
3989
|
...e,
|
|
3980
|
-
params:
|
|
3990
|
+
params: ee.value
|
|
3981
3991
|
}) : Promise.resolve({
|
|
3982
3992
|
items: [],
|
|
3983
3993
|
total: 0
|
|
@@ -3999,14 +4009,14 @@ var Fo = {
|
|
|
3999
4009
|
total: t.length
|
|
4000
4010
|
});
|
|
4001
4011
|
}
|
|
4002
|
-
return (t, r) => (
|
|
4003
|
-
class:
|
|
4012
|
+
return (t, r) => (z(), x(K(Ce), {
|
|
4013
|
+
class: I(["schema-form-item", { "schema-form-item--bare": e.hideLabel }]),
|
|
4004
4014
|
label: e.hideLabel ? void 0 : e.field.label,
|
|
4005
4015
|
"label-width": e.hideLabel ? "0" : void 0,
|
|
4006
4016
|
prop: e.field.prop,
|
|
4007
4017
|
rules: p.value
|
|
4008
4018
|
}, {
|
|
4009
|
-
default: J(() => [g.value ? (
|
|
4019
|
+
default: J(() => [g.value ? (z(), x(jo, {
|
|
4010
4020
|
key: 0,
|
|
4011
4021
|
config: e.field.translateConfig,
|
|
4012
4022
|
context: l.value,
|
|
@@ -4017,7 +4027,7 @@ var Fo = {
|
|
|
4017
4027
|
"model-value": e.modelValue,
|
|
4018
4028
|
placeholder: m.value,
|
|
4019
4029
|
readonly: e.readonly,
|
|
4020
|
-
"onUpdate:modelValue":
|
|
4030
|
+
"onUpdate:modelValue": U
|
|
4021
4031
|
}, null, 8, [
|
|
4022
4032
|
"config",
|
|
4023
4033
|
"context",
|
|
@@ -4028,107 +4038,107 @@ var Fo = {
|
|
|
4028
4038
|
"model-value",
|
|
4029
4039
|
"placeholder",
|
|
4030
4040
|
"readonly"
|
|
4031
|
-
])) : e.readonly && e.field.type === "rich-text" ? (
|
|
4041
|
+
])) : e.readonly && e.field.type === "rich-text" ? (z(), x(K(c), P({
|
|
4032
4042
|
key: 1,
|
|
4033
4043
|
"model-value": e.modelValue,
|
|
4034
4044
|
placeholder: m.value
|
|
4035
|
-
},
|
|
4045
|
+
}, F.value), null, 16, ["model-value", "placeholder"])) : e.readonly && e.field.optionSource === "dict" && e.field.dictCode ? (z(), C("span", No, [(z(!0), C(y, null, V(T.value, (t, n) => (z(), x(Ir, {
|
|
4036
4046
|
key: `${e.field.prop}-${n}`,
|
|
4037
4047
|
code: e.field.dictCode,
|
|
4038
4048
|
value: t
|
|
4039
|
-
}, null, 8, ["code", "value"]))), 128))])) : e.readonly && e.field.type === "picture" ? (
|
|
4049
|
+
}, null, 8, ["code", "value"]))), 128))])) : e.readonly && e.field.type === "picture" ? (z(), x(n, {
|
|
4040
4050
|
key: 3,
|
|
4041
4051
|
urls: D.value,
|
|
4042
4052
|
"max-preview-count": A.value
|
|
4043
|
-
}, null, 8, ["urls", "max-preview-count"])) : e.readonly && (e.field.type === "file" || e.field.type === "upload") ? (
|
|
4053
|
+
}, null, 8, ["urls", "max-preview-count"])) : e.readonly && (e.field.type === "file" || e.field.type === "upload") ? (z(), x(Zr, {
|
|
4044
4054
|
key: 4,
|
|
4045
4055
|
attachments: k.value,
|
|
4046
4056
|
"max-preview-count": A.value
|
|
4047
|
-
}, null, 8, ["attachments", "max-preview-count"])) : e.readonly ? (
|
|
4057
|
+
}, null, 8, ["attachments", "max-preview-count"])) : e.readonly ? (z(), x(ca, {
|
|
4048
4058
|
key: 5,
|
|
4049
4059
|
value: w.value,
|
|
4050
4060
|
copyable: h.value
|
|
4051
|
-
}, null, 8, ["value", "copyable"])) : j.value ? (
|
|
4061
|
+
}, null, 8, ["value", "copyable"])) : j.value ? (z(), x(re(j.value.component), P({ key: 6 }, M.value, ae(N.value)), null, 16)) : e.field.type === "upload" ? (z(), x(K(o), P({
|
|
4052
4062
|
key: 7,
|
|
4053
4063
|
"model-value": e.modelValue,
|
|
4054
4064
|
placeholder: e.field.placeholder,
|
|
4055
4065
|
disabled: e.disabled || e.readonly,
|
|
4056
4066
|
"show-remove": !e.readonly
|
|
4057
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4067
|
+
}, f.value, { "onUpdate:modelValue": U }), null, 16, [
|
|
4058
4068
|
"model-value",
|
|
4059
4069
|
"placeholder",
|
|
4060
4070
|
"disabled",
|
|
4061
4071
|
"show-remove"
|
|
4062
|
-
])) : e.field.type === "picture" ? (
|
|
4072
|
+
])) : e.field.type === "picture" ? (z(), x(K(s), P({
|
|
4063
4073
|
key: 8,
|
|
4064
4074
|
"model-value": e.modelValue,
|
|
4065
4075
|
disabled: e.disabled || e.readonly,
|
|
4066
4076
|
"show-remove": !e.readonly
|
|
4067
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4077
|
+
}, f.value, { "onUpdate:modelValue": U }), null, 16, [
|
|
4068
4078
|
"model-value",
|
|
4069
4079
|
"disabled",
|
|
4070
4080
|
"show-remove"
|
|
4071
|
-
])) : e.field.type === "file" ? (
|
|
4081
|
+
])) : e.field.type === "file" ? (z(), x(K(o), P({
|
|
4072
4082
|
key: 9,
|
|
4073
4083
|
"model-value": e.modelValue,
|
|
4074
4084
|
placeholder: e.field.placeholder,
|
|
4075
4085
|
disabled: e.disabled || e.readonly,
|
|
4076
4086
|
"show-remove": !e.readonly
|
|
4077
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4087
|
+
}, f.value, { "onUpdate:modelValue": U }), null, 16, [
|
|
4078
4088
|
"model-value",
|
|
4079
4089
|
"placeholder",
|
|
4080
4090
|
"disabled",
|
|
4081
4091
|
"show-remove"
|
|
4082
|
-
])) : e.field.type === "slot" ?
|
|
4092
|
+
])) : e.field.type === "slot" ? H(t.$slots, "default", {
|
|
4083
4093
|
field: e.field,
|
|
4084
4094
|
value: e.modelValue,
|
|
4085
4095
|
disabled: e.disabled,
|
|
4086
|
-
updateValue:
|
|
4087
|
-
}, void 0, !0, 10) : e.field.type === "text" ? (
|
|
4096
|
+
updateValue: U
|
|
4097
|
+
}, void 0, !0, 10) : e.field.type === "text" ? (z(), x(K(Te), P({
|
|
4088
4098
|
key: 11,
|
|
4089
4099
|
"model-value": e.modelValue,
|
|
4090
4100
|
placeholder: m.value,
|
|
4091
4101
|
disabled: e.disabled,
|
|
4092
4102
|
clearable: ""
|
|
4093
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4103
|
+
}, f.value, { "onUpdate:modelValue": U }), null, 16, [
|
|
4094
4104
|
"model-value",
|
|
4095
4105
|
"placeholder",
|
|
4096
4106
|
"disabled"
|
|
4097
|
-
])) : e.field.type === "textarea" ? (
|
|
4107
|
+
])) : e.field.type === "textarea" ? (z(), x(K(Te), P({
|
|
4098
4108
|
key: 12,
|
|
4099
4109
|
type: "textarea",
|
|
4100
4110
|
rows: 4,
|
|
4101
4111
|
"model-value": e.modelValue,
|
|
4102
4112
|
placeholder: m.value,
|
|
4103
4113
|
disabled: e.disabled
|
|
4104
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4114
|
+
}, f.value, { "onUpdate:modelValue": U }), null, 16, [
|
|
4105
4115
|
"model-value",
|
|
4106
4116
|
"placeholder",
|
|
4107
4117
|
"disabled"
|
|
4108
|
-
])) : e.field.type === "rich-text" ? (
|
|
4118
|
+
])) : e.field.type === "rich-text" ? (z(), x(K(c), P({
|
|
4109
4119
|
key: 13,
|
|
4110
4120
|
"model-value": e.modelValue,
|
|
4111
4121
|
placeholder: m.value
|
|
4112
|
-
},
|
|
4122
|
+
}, F.value, { "onUpdate:modelValue": U }), null, 16, ["model-value", "placeholder"])) : e.field.type === "number" ? (z(), x(K(Ee), P({
|
|
4113
4123
|
key: 14,
|
|
4114
4124
|
"model-value": e.modelValue,
|
|
4115
4125
|
placeholder: m.value,
|
|
4116
4126
|
disabled: e.disabled
|
|
4117
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4127
|
+
}, f.value, { "onUpdate:modelValue": U }), null, 16, [
|
|
4118
4128
|
"model-value",
|
|
4119
4129
|
"placeholder",
|
|
4120
4130
|
"disabled"
|
|
4121
|
-
])) : e.field.type === "cascader" ? (
|
|
4131
|
+
])) : e.field.type === "cascader" ? (z(), x(K(pe), P({
|
|
4122
4132
|
key: 15,
|
|
4123
4133
|
"model-value": e.modelValue,
|
|
4124
4134
|
placeholder: m.value,
|
|
4125
4135
|
disabled: e.disabled,
|
|
4126
4136
|
filterable: ""
|
|
4127
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4137
|
+
}, f.value, { "onUpdate:modelValue": U }), null, 16, [
|
|
4128
4138
|
"model-value",
|
|
4129
4139
|
"placeholder",
|
|
4130
4140
|
"disabled"
|
|
4131
|
-
])) : e.field.type === "select" ? (
|
|
4141
|
+
])) : e.field.type === "select" ? (z(), x(K(a), P({
|
|
4132
4142
|
key: 16,
|
|
4133
4143
|
"model-value": e.modelValue,
|
|
4134
4144
|
placeholder: m.value,
|
|
@@ -4136,16 +4146,16 @@ var Fo = {
|
|
|
4136
4146
|
fetcher: ie,
|
|
4137
4147
|
"label-key": "label",
|
|
4138
4148
|
"value-key": "value"
|
|
4139
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4149
|
+
}, f.value, { "onUpdate:modelValue": U }), null, 16, [
|
|
4140
4150
|
"model-value",
|
|
4141
4151
|
"placeholder",
|
|
4142
4152
|
"disabled"
|
|
4143
|
-
])) : e.field.type === "radio" ? (
|
|
4153
|
+
])) : e.field.type === "radio" ? (z(), x(K(Me), P({
|
|
4144
4154
|
key: 17,
|
|
4145
4155
|
"model-value": e.modelValue,
|
|
4146
4156
|
disabled: e.disabled
|
|
4147
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4148
|
-
default: J(() => [(
|
|
4157
|
+
}, f.value, { "onUpdate:modelValue": U }), {
|
|
4158
|
+
default: J(() => [(z(!0), C(y, null, V(K(u), (e) => (z(), x(K(je), {
|
|
4149
4159
|
key: e.value,
|
|
4150
4160
|
value: e.value
|
|
4151
4161
|
}, {
|
|
@@ -4153,12 +4163,12 @@ var Fo = {
|
|
|
4153
4163
|
_: 2
|
|
4154
4164
|
}, 1032, ["value"]))), 128))]),
|
|
4155
4165
|
_: 1
|
|
4156
|
-
}, 16, ["model-value", "disabled"])) : e.field.type === "checkbox" ? (
|
|
4166
|
+
}, 16, ["model-value", "disabled"])) : e.field.type === "checkbox" ? (z(), x(K(he), P({
|
|
4157
4167
|
key: 18,
|
|
4158
4168
|
"model-value": e.modelValue,
|
|
4159
4169
|
disabled: e.disabled
|
|
4160
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4161
|
-
default: J(() => [(
|
|
4170
|
+
}, f.value, { "onUpdate:modelValue": U }), {
|
|
4171
|
+
default: J(() => [(z(!0), C(y, null, V(K(u), (e) => (z(), x(K(me), {
|
|
4162
4172
|
key: e.value,
|
|
4163
4173
|
value: e.value
|
|
4164
4174
|
}, {
|
|
@@ -4166,43 +4176,43 @@ var Fo = {
|
|
|
4166
4176
|
_: 2
|
|
4167
4177
|
}, 1032, ["value"]))), 128))]),
|
|
4168
4178
|
_: 1
|
|
4169
|
-
}, 16, ["model-value", "disabled"])) : e.field.type === "switch" ? (
|
|
4179
|
+
}, 16, ["model-value", "disabled"])) : e.field.type === "switch" ? (z(), x(K(Ie), P({
|
|
4170
4180
|
key: 19,
|
|
4171
4181
|
"model-value": e.modelValue,
|
|
4172
4182
|
disabled: e.disabled
|
|
4173
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4183
|
+
}, f.value, { "onUpdate:modelValue": U }), null, 16, ["model-value", "disabled"])) : e.field.type === "date" || e.field.type === "datetime" ? (z(), x(K(_e), P({
|
|
4174
4184
|
key: 20,
|
|
4175
4185
|
type: e.field.type,
|
|
4176
4186
|
"model-value": e.modelValue,
|
|
4177
4187
|
placeholder: m.value,
|
|
4178
4188
|
disabled: e.disabled,
|
|
4179
4189
|
"value-format": e.field.type === "date" ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss"
|
|
4180
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4190
|
+
}, f.value, { "onUpdate:modelValue": U }), null, 16, [
|
|
4181
4191
|
"type",
|
|
4182
4192
|
"model-value",
|
|
4183
4193
|
"placeholder",
|
|
4184
4194
|
"disabled",
|
|
4185
4195
|
"value-format"
|
|
4186
|
-
])) : e.field.type === "async-select" && (
|
|
4187
|
-
key:
|
|
4196
|
+
])) : e.field.type === "async-select" && (B.value || e.field.optionSource === "dict") ? (z(), x(K(a), P({
|
|
4197
|
+
key: te.value,
|
|
4188
4198
|
"model-value": e.modelValue,
|
|
4189
4199
|
placeholder: m.value,
|
|
4190
4200
|
disabled: e.disabled,
|
|
4191
|
-
fetcher:
|
|
4192
|
-
options:
|
|
4201
|
+
fetcher: R.value ? ne : void 0,
|
|
4202
|
+
options: R.value ? void 0 : K(u)
|
|
4193
4203
|
}, {
|
|
4194
|
-
...
|
|
4204
|
+
...B.value,
|
|
4195
4205
|
...f.value
|
|
4196
|
-
}, { "onUpdate:modelValue":
|
|
4206
|
+
}, { "onUpdate:modelValue": U }), null, 16, [
|
|
4197
4207
|
"model-value",
|
|
4198
4208
|
"placeholder",
|
|
4199
4209
|
"disabled",
|
|
4200
4210
|
"fetcher",
|
|
4201
4211
|
"options"
|
|
4202
|
-
])) : (
|
|
4212
|
+
])) : (z(), x(ca, {
|
|
4203
4213
|
key: 22,
|
|
4204
4214
|
value: e.modelValue
|
|
4205
|
-
}, null, 8, ["value"])), e.field.tip ? (
|
|
4215
|
+
}, null, 8, ["value"])), e.field.tip ? (z(), C("div", Po, W(e.field.tip), 1)) : S("", !0)]),
|
|
4206
4216
|
_: 3
|
|
4207
4217
|
}, 8, [
|
|
4208
4218
|
"class",
|
|
@@ -4212,20 +4222,20 @@ var Fo = {
|
|
|
4212
4222
|
"rules"
|
|
4213
4223
|
]));
|
|
4214
4224
|
}
|
|
4215
|
-
}), [["__scopeId", "data-v-e1d8b24d"]]),
|
|
4225
|
+
}), [["__scopeId", "data-v-e1d8b24d"]]), Io = { class: "schema-form-root" }, Lo = {
|
|
4216
4226
|
key: 0,
|
|
4217
4227
|
class: "schema-form__row-break",
|
|
4218
4228
|
"aria-hidden": "true"
|
|
4219
|
-
},
|
|
4229
|
+
}, Ro = {
|
|
4220
4230
|
key: 0,
|
|
4221
4231
|
class: "schema-form-group__header"
|
|
4222
|
-
},
|
|
4232
|
+
}, zo = { class: "schema-form-group__index" }, Bo = { class: "schema-form-group__heading" }, Vo = { key: 0 }, Ho = {
|
|
4223
4233
|
key: 0,
|
|
4224
4234
|
class: "schema-form-group__required-note"
|
|
4225
|
-
},
|
|
4235
|
+
}, Uo = { key: 1 }, Wo = {
|
|
4226
4236
|
key: 0,
|
|
4227
4237
|
class: "schema-form-group__tip"
|
|
4228
|
-
},
|
|
4238
|
+
}, Go = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
4229
4239
|
__name: "schema-form",
|
|
4230
4240
|
props: /*@__PURE__*/ N({
|
|
4231
4241
|
columns: { default: 1 },
|
|
@@ -4253,121 +4263,121 @@ var Fo = {
|
|
|
4253
4263
|
modelValue: { default: () => ({}) },
|
|
4254
4264
|
modelModifiers: {}
|
|
4255
4265
|
}),
|
|
4256
|
-
emits: ["update:modelValue"],
|
|
4257
|
-
setup(e, { expose: t }) {
|
|
4258
|
-
let
|
|
4266
|
+
emits: /*@__PURE__*/ N(["field-change"], ["update:modelValue"]),
|
|
4267
|
+
setup(e, { expose: t, emit: n }) {
|
|
4268
|
+
let r = e, i = n, a = oe(e, "modelValue"), o = B(), s = {
|
|
4259
4269
|
behavior: "smooth",
|
|
4260
4270
|
block: "center"
|
|
4261
|
-
},
|
|
4262
|
-
mode:
|
|
4263
|
-
values:
|
|
4264
|
-
})),
|
|
4265
|
-
function
|
|
4266
|
-
return e.children.filter((e) => !
|
|
4267
|
-
}
|
|
4268
|
-
let
|
|
4269
|
-
[`schema-form--label-align-${
|
|
4270
|
-
"schema-form--underline":
|
|
4271
|
-
})),
|
|
4272
|
-
function
|
|
4271
|
+
}, c = b(() => r.schema), l = b(() => ({
|
|
4272
|
+
mode: r.mode,
|
|
4273
|
+
values: a.value ?? {}
|
|
4274
|
+
})), u = b(() => c.value.filter((e) => va(e, l.value) ? !1 : !ha(e) || d(e).length > 0));
|
|
4275
|
+
function d(e) {
|
|
4276
|
+
return e.children.filter((e) => !va(e, l.value));
|
|
4277
|
+
}
|
|
4278
|
+
let f = b(() => u.value.flatMap((e) => ha(e) ? d(e) : [e])), p = b(() => Math.floor(24 / r.columns)), m = b(() => ({
|
|
4279
|
+
[`schema-form--label-align-${r.labelAlign}`]: !!r.labelAlign,
|
|
4280
|
+
"schema-form--underline": r.underline
|
|
4281
|
+
})), h = b(() => r.mode === "view" ? "left" : r.labelPosition);
|
|
4282
|
+
function g(e) {
|
|
4273
4283
|
return typeof e == "number" ? `${e}px` : e;
|
|
4274
4284
|
}
|
|
4275
|
-
let
|
|
4276
|
-
"--schema-form-group-gap":
|
|
4277
|
-
"--schema-form-item-gap":
|
|
4278
|
-
"--schema-form-label-gap":
|
|
4285
|
+
let _ = b(() => ({
|
|
4286
|
+
"--schema-form-group-gap": g(r.groupGap),
|
|
4287
|
+
"--schema-form-item-gap": g(r.itemGap),
|
|
4288
|
+
"--schema-form-label-gap": g(r.labelGap)
|
|
4279
4289
|
}));
|
|
4280
|
-
function
|
|
4281
|
-
return
|
|
4282
|
-
}
|
|
4283
|
-
function _(e, t = !1) {
|
|
4284
|
-
return t ? { gridColumn: e.newRow ? "1 / -1" : `span ${e.span ?? d.value}` } : { flex: `${e.span ?? 1} 1 0` };
|
|
4290
|
+
function v(e, t) {
|
|
4291
|
+
return ha(e) ? `group-${t}-${e.label}` : e.prop;
|
|
4285
4292
|
}
|
|
4286
|
-
function
|
|
4287
|
-
return
|
|
4293
|
+
function T(e, t = !1) {
|
|
4294
|
+
return t ? { gridColumn: e.newRow ? "1 / -1" : `span ${e.span ?? p.value}` } : { flex: `${e.span ?? 1} 1 0` };
|
|
4288
4295
|
}
|
|
4289
|
-
function
|
|
4290
|
-
|
|
4291
|
-
return String(t.indexOf(e) + 1).padStart(2, "0");
|
|
4292
|
-
}
|
|
4293
|
-
function E(e, t) {
|
|
4294
|
-
return n.disabled || ya(t?.disabled, s.value) || ya(e.disabled, s.value);
|
|
4296
|
+
function E(e) {
|
|
4297
|
+
return d(e).some((e) => _a(e.required, l.value));
|
|
4295
4298
|
}
|
|
4296
4299
|
function O(e) {
|
|
4297
|
-
|
|
4300
|
+
let t = u.value.filter((e) => ha(e) && !!e.anchor);
|
|
4301
|
+
return String(t.indexOf(e) + 1).padStart(2, "0");
|
|
4298
4302
|
}
|
|
4299
4303
|
function k(e, t) {
|
|
4300
|
-
r.value
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
+
return r.disabled || _a(t?.disabled, l.value) || _a(e.disabled, l.value);
|
|
4305
|
+
}
|
|
4306
|
+
function A(e) {
|
|
4307
|
+
return r.mode === "view" || !!e.readonly;
|
|
4304
4308
|
}
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
+
function j(e, t) {
|
|
4310
|
+
a.value = {
|
|
4311
|
+
...a.value,
|
|
4312
|
+
[e.prop]: t
|
|
4313
|
+
}, i("field-change", e, t);
|
|
4314
|
+
}
|
|
4315
|
+
q([c, a], () => {
|
|
4316
|
+
let e = a.value ?? {}, t = {};
|
|
4317
|
+
for (let n of ga(c.value)) n.defaultValue !== void 0 && !(n.prop in e) && (t[n.prop] = n.defaultValue);
|
|
4318
|
+
Object.keys(t).length > 0 && (a.value = {
|
|
4309
4319
|
...e,
|
|
4310
4320
|
...t
|
|
4311
4321
|
});
|
|
4312
4322
|
}, { immediate: !0 });
|
|
4313
|
-
async function
|
|
4314
|
-
if (!
|
|
4323
|
+
async function M() {
|
|
4324
|
+
if (!o.value) return !1;
|
|
4315
4325
|
try {
|
|
4316
|
-
return await
|
|
4326
|
+
return await o.value.validate(), !0;
|
|
4317
4327
|
} catch (e) {
|
|
4318
|
-
let t = new Set(e && typeof e == "object" ? Object.keys(e) : []), n =
|
|
4319
|
-
return n && (await
|
|
4328
|
+
let t = new Set(e && typeof e == "object" ? Object.keys(e) : []), n = f.value.find((e) => t.has(e.prop))?.prop ?? t.values().next().value;
|
|
4329
|
+
return n && (await F(), o.value?.scrollToField(n)), !1;
|
|
4320
4330
|
}
|
|
4321
4331
|
}
|
|
4322
4332
|
return t({
|
|
4323
|
-
validate:
|
|
4324
|
-
clearValidate: () =>
|
|
4325
|
-
resetFields: () =>
|
|
4326
|
-
getValues: () => Object.fromEntries(
|
|
4333
|
+
validate: M,
|
|
4334
|
+
clearValidate: () => o.value?.clearValidate(),
|
|
4335
|
+
resetFields: () => o.value?.resetFields(),
|
|
4336
|
+
getValues: () => Object.fromEntries(f.value.map((e) => [e.prop, a.value?.[e.prop]]))
|
|
4327
4337
|
}), (t, n) => {
|
|
4328
|
-
let
|
|
4329
|
-
return
|
|
4338
|
+
let r = ne("loading");
|
|
4339
|
+
return z(), C("div", Io, [ue((z(), x(K(Se), {
|
|
4330
4340
|
ref_key: "formRef",
|
|
4331
|
-
ref:
|
|
4332
|
-
class:
|
|
4333
|
-
style:
|
|
4334
|
-
model:
|
|
4341
|
+
ref: o,
|
|
4342
|
+
class: I(["schema-form", m.value]),
|
|
4343
|
+
style: R(_.value),
|
|
4344
|
+
model: a.value,
|
|
4335
4345
|
"label-width": e.labelWidth,
|
|
4336
|
-
"label-position":
|
|
4337
|
-
"scroll-into-view-options":
|
|
4346
|
+
"label-position": h.value,
|
|
4347
|
+
"scroll-into-view-options": s
|
|
4338
4348
|
}, {
|
|
4339
4349
|
default: J(() => [D(K(Ne), { gutter: 16 }, {
|
|
4340
|
-
default: J(() => [(
|
|
4341
|
-
span: e.span ?? (e.type === "group" ? 24 :
|
|
4342
|
-
class:
|
|
4350
|
+
default: J(() => [(z(!0), C(y, null, V(u.value, (e, n) => (z(), C(y, { key: v(e, n) }, [e.newRow ? (z(), C("div", Lo)) : S("", !0), D(K(ge), {
|
|
4351
|
+
span: e.span ?? (e.type === "group" ? 24 : p.value),
|
|
4352
|
+
class: I({
|
|
4343
4353
|
"schema-form-col--anchor-group": e.type === "group" && e.anchor,
|
|
4344
4354
|
"schema-form-col--group-divider": e.type === "group" && n > 0
|
|
4345
4355
|
})
|
|
4346
4356
|
}, {
|
|
4347
|
-
default: J(() => [e.type === "group" ? (
|
|
4357
|
+
default: J(() => [e.type === "group" ? (z(), x(K(Ce), {
|
|
4348
4358
|
key: 0,
|
|
4349
|
-
class:
|
|
4350
|
-
"data-form-anchor": e.anchor ?
|
|
4359
|
+
class: I(["schema-form-group", { "schema-form-group--anchor": e.anchor }]),
|
|
4360
|
+
"data-form-anchor": e.anchor ? c.value.indexOf(e) : void 0,
|
|
4351
4361
|
label: e.label
|
|
4352
4362
|
}, {
|
|
4353
|
-
label: J(() => [e.anchor ? (
|
|
4354
|
-
w("span",
|
|
4355
|
-
w("span",
|
|
4356
|
-
|
|
4357
|
-
])) : (
|
|
4358
|
-
default: J(() => [w("div", { class:
|
|
4363
|
+
label: J(() => [e.anchor ? (z(), C("div", Ro, [
|
|
4364
|
+
w("span", zo, W(O(e)), 1),
|
|
4365
|
+
w("span", Bo, [w("strong", null, W(e.label), 1), e.description ? (z(), C("small", Vo, W(e.description), 1)) : S("", !0)]),
|
|
4366
|
+
E(e) ? (z(), C("span", Ho, " 为必填项 ")) : S("", !0)
|
|
4367
|
+
])) : (z(), C("span", Uo, W(e.label), 1))]),
|
|
4368
|
+
default: J(() => [w("div", { class: I(["schema-form-group__body", { "schema-form-group__body--grid": e.anchor }]) }, [(z(!0), C(y, null, V(d(e), (n) => (z(), x(Fo, {
|
|
4359
4369
|
key: n.prop,
|
|
4360
|
-
style:
|
|
4370
|
+
style: R(T(n, e.anchor)),
|
|
4361
4371
|
"hide-label": !e.anchor,
|
|
4362
4372
|
field: n,
|
|
4363
|
-
context:
|
|
4364
|
-
"label-position":
|
|
4365
|
-
"model-value":
|
|
4366
|
-
disabled:
|
|
4367
|
-
readonly:
|
|
4368
|
-
"onUpdate:modelValue": (e) =>
|
|
4373
|
+
context: l.value,
|
|
4374
|
+
"label-position": h.value,
|
|
4375
|
+
"model-value": a.value[n.prop],
|
|
4376
|
+
disabled: k(n, e),
|
|
4377
|
+
readonly: A(n),
|
|
4378
|
+
"onUpdate:modelValue": (e) => j(n, e)
|
|
4369
4379
|
}, {
|
|
4370
|
-
default: J((e) => [
|
|
4380
|
+
default: J((e) => [H(t.$slots, n.prop, P({ ref_for: !0 }, e), void 0, !0)]),
|
|
4371
4381
|
_: 2
|
|
4372
4382
|
}, 1032, [
|
|
4373
4383
|
"style",
|
|
@@ -4379,23 +4389,23 @@ var Fo = {
|
|
|
4379
4389
|
"disabled",
|
|
4380
4390
|
"readonly",
|
|
4381
4391
|
"onUpdate:modelValue"
|
|
4382
|
-
]))), 128))], 2), e.tip ? (
|
|
4392
|
+
]))), 128))], 2), e.tip ? (z(), C("div", Wo, W(e.tip), 1)) : S("", !0)]),
|
|
4383
4393
|
_: 2
|
|
4384
4394
|
}, 1032, [
|
|
4385
4395
|
"class",
|
|
4386
4396
|
"data-form-anchor",
|
|
4387
4397
|
"label"
|
|
4388
|
-
])) : (
|
|
4398
|
+
])) : (z(), x(Fo, {
|
|
4389
4399
|
key: 1,
|
|
4390
4400
|
field: e,
|
|
4391
|
-
context:
|
|
4392
|
-
"label-position":
|
|
4393
|
-
"model-value":
|
|
4394
|
-
disabled:
|
|
4395
|
-
readonly:
|
|
4396
|
-
"onUpdate:modelValue": (t) =>
|
|
4401
|
+
context: l.value,
|
|
4402
|
+
"label-position": h.value,
|
|
4403
|
+
"model-value": a.value[e.prop],
|
|
4404
|
+
disabled: k(e),
|
|
4405
|
+
readonly: A(e),
|
|
4406
|
+
"onUpdate:modelValue": (t) => j(e, t)
|
|
4397
4407
|
}, {
|
|
4398
|
-
default: J((n) => [
|
|
4408
|
+
default: J((n) => [H(t.$slots, e.prop, P({ ref_for: !0 }, n), void 0, !0)]),
|
|
4399
4409
|
_: 2
|
|
4400
4410
|
}, 1032, [
|
|
4401
4411
|
"field",
|
|
@@ -4417,14 +4427,14 @@ var Fo = {
|
|
|
4417
4427
|
"model",
|
|
4418
4428
|
"label-width",
|
|
4419
4429
|
"label-position"
|
|
4420
|
-
])), [[
|
|
4430
|
+
])), [[r, e.loading]])]);
|
|
4421
4431
|
};
|
|
4422
4432
|
}
|
|
4423
|
-
}), [["__scopeId", "data-v-
|
|
4433
|
+
}), [["__scopeId", "data-v-4f20fff4"]]), Ko = { class: "drawer-form-page__header" }, qo = { class: "drawer-form-page__header-main" }, Jo = { class: "drawer-form-page__title-stack" }, Yo = { class: "drawer-form-page__title" }, Xo = { class: "drawer-form-page__header-actions" }, Zo = { class: "drawer-form-page__status" }, Qo = {
|
|
4424
4434
|
key: 0,
|
|
4425
4435
|
class: "drawer-form-page__anchors",
|
|
4426
4436
|
"aria-label": "表单分区"
|
|
4427
|
-
},
|
|
4437
|
+
}, $o = ["onClick"], es = { class: "drawer-form-page__footer" }, ts = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
4428
4438
|
__name: "index",
|
|
4429
4439
|
props: {
|
|
4430
4440
|
modelValue: {
|
|
@@ -4508,7 +4518,7 @@ var Fo = {
|
|
|
4508
4518
|
"closed"
|
|
4509
4519
|
],
|
|
4510
4520
|
setup(e, { expose: t, emit: n }) {
|
|
4511
|
-
let r = e, i = n, a =
|
|
4521
|
+
let r = e, i = n, a = B(0), o = se(), s = B(), c = B(), l = B(r.fullscreen), u = b({
|
|
4512
4522
|
get: () => r.modelValue,
|
|
4513
4523
|
set: (e) => i("update:modelValue", e)
|
|
4514
4524
|
}), d = b({
|
|
@@ -4533,7 +4543,7 @@ var Fo = {
|
|
|
4533
4543
|
l.value = !l.value, i("update:fullscreen", l.value);
|
|
4534
4544
|
}
|
|
4535
4545
|
async function k(e) {
|
|
4536
|
-
await
|
|
4546
|
+
await F(), (c.value?.querySelector(`[data-form-anchor="${e}"]`))?.scrollIntoView({
|
|
4537
4547
|
behavior: "smooth",
|
|
4538
4548
|
block: "start"
|
|
4539
4549
|
});
|
|
@@ -4547,19 +4557,19 @@ var Fo = {
|
|
|
4547
4557
|
async function N() {
|
|
4548
4558
|
return await s.value?.validate() ?? !1;
|
|
4549
4559
|
}
|
|
4550
|
-
function
|
|
4560
|
+
function R() {
|
|
4551
4561
|
return s.value?.getValues() ?? {};
|
|
4552
4562
|
}
|
|
4553
|
-
async function
|
|
4554
|
-
return r.mode === "view" || r.submitting || r.loading || !await N() ? !1 : (i("submit",
|
|
4563
|
+
async function ee() {
|
|
4564
|
+
return r.mode === "view" || r.submitting || r.loading || !await N() ? !1 : (i("submit", R()), !0);
|
|
4555
4565
|
}
|
|
4556
|
-
function
|
|
4566
|
+
function te() {
|
|
4557
4567
|
s.value?.resetFields();
|
|
4558
4568
|
}
|
|
4559
|
-
function
|
|
4569
|
+
function U() {
|
|
4560
4570
|
i("closed");
|
|
4561
4571
|
}
|
|
4562
|
-
function
|
|
4572
|
+
function re() {
|
|
4563
4573
|
a.value = v.value[0]?.index ?? 0, i("open");
|
|
4564
4574
|
}
|
|
4565
4575
|
function ie() {
|
|
@@ -4574,14 +4584,14 @@ var Fo = {
|
|
|
4574
4584
|
}
|
|
4575
4585
|
return t({
|
|
4576
4586
|
close: j,
|
|
4577
|
-
getValues:
|
|
4578
|
-
resetFields:
|
|
4579
|
-
submit:
|
|
4587
|
+
getValues: R,
|
|
4588
|
+
resetFields: te,
|
|
4589
|
+
submit: ee,
|
|
4580
4590
|
toggleFullscreen: O,
|
|
4581
4591
|
validate: N
|
|
4582
4592
|
}), (e, t) => {
|
|
4583
|
-
let n =
|
|
4584
|
-
return
|
|
4593
|
+
let n = ne("loading");
|
|
4594
|
+
return z(), x(K(ve), P({
|
|
4585
4595
|
modelValue: u.value,
|
|
4586
4596
|
"onUpdate:modelValue": t[1] ||= (e) => u.value = e
|
|
4587
4597
|
}, r.drawerProps, {
|
|
@@ -4594,18 +4604,18 @@ var Fo = {
|
|
|
4594
4604
|
"append-to-body": r.appendToBody,
|
|
4595
4605
|
"lock-scroll": r.lockScroll,
|
|
4596
4606
|
class: ["drawer-form-page", { "drawer-form-page--fullscreen": f.value }],
|
|
4597
|
-
onOpen:
|
|
4598
|
-
onClosed:
|
|
4607
|
+
onOpen: re,
|
|
4608
|
+
onClosed: U
|
|
4599
4609
|
}), T({
|
|
4600
|
-
header: J(() => [
|
|
4610
|
+
header: J(() => [H(e.$slots, "header", {
|
|
4601
4611
|
fullscreen: f.value,
|
|
4602
4612
|
title: r.title,
|
|
4603
4613
|
toggleFullscreen: O
|
|
4604
|
-
}, () => [w("div",
|
|
4605
|
-
w("div",
|
|
4606
|
-
w("div",
|
|
4607
|
-
w("span",
|
|
4608
|
-
r.fullscreenButton ? (
|
|
4614
|
+
}, () => [w("div", Ko, [
|
|
4615
|
+
w("div", qo, [w("div", Jo, [w("span", Yo, W(r.title), 1)])]),
|
|
4616
|
+
w("div", Xo, [
|
|
4617
|
+
w("span", Zo, [t[2] ||= w("i", { "aria-hidden": "true" }, null, -1), E(" " + W(g.value), 1)]),
|
|
4618
|
+
r.fullscreenButton ? (z(), x(K(He), {
|
|
4609
4619
|
key: 0,
|
|
4610
4620
|
content: f.value ? "退出全屏" : "全屏",
|
|
4611
4621
|
placement: "bottom"
|
|
@@ -4632,21 +4642,21 @@ var Fo = {
|
|
|
4632
4642
|
_: 1
|
|
4633
4643
|
})
|
|
4634
4644
|
]),
|
|
4635
|
-
v.value.length ? (
|
|
4645
|
+
v.value.length ? (z(), C("nav", Qo, [(z(!0), C(y, null, V(v.value, ({ entry: e, index: t }) => (z(), C("button", {
|
|
4636
4646
|
key: t,
|
|
4637
4647
|
type: "button",
|
|
4638
|
-
class:
|
|
4648
|
+
class: I(["drawer-form-page__anchor", { "is-active": a.value === t }]),
|
|
4639
4649
|
onClick: (e) => {
|
|
4640
4650
|
a.value = t, k(t);
|
|
4641
4651
|
}
|
|
4642
|
-
}, W(e.label), 11,
|
|
4652
|
+
}, W(e.label), 11, $o))), 128))])) : S("", !0)
|
|
4643
4653
|
])], !0)]),
|
|
4644
|
-
default: J(() => [ue((
|
|
4654
|
+
default: J(() => [ue((z(), C("div", {
|
|
4645
4655
|
ref_key: "contentRef",
|
|
4646
4656
|
ref: c,
|
|
4647
4657
|
class: "drawer-form-page__content",
|
|
4648
4658
|
onScrollPassive: ie
|
|
4649
|
-
}, [D(
|
|
4659
|
+
}, [D(Go, P({
|
|
4650
4660
|
ref_key: "formRef",
|
|
4651
4661
|
ref: s
|
|
4652
4662
|
}, r.schemaFormProps, {
|
|
@@ -4657,9 +4667,9 @@ var Fo = {
|
|
|
4657
4667
|
columns: m.value,
|
|
4658
4668
|
disabled: r.disabled,
|
|
4659
4669
|
loading: r.loading
|
|
4660
|
-
}), T({ _: 2 }, [
|
|
4670
|
+
}), T({ _: 2 }, [V(_.value, (t) => ({
|
|
4661
4671
|
name: t,
|
|
4662
|
-
fn: J((n) => [
|
|
4672
|
+
fn: J((n) => [H(e.$slots, t, L(A(n)), void 0, !0)])
|
|
4663
4673
|
}))]), 1040, [
|
|
4664
4674
|
"modelValue",
|
|
4665
4675
|
"schema",
|
|
@@ -4667,27 +4677,27 @@ var Fo = {
|
|
|
4667
4677
|
"columns",
|
|
4668
4678
|
"disabled",
|
|
4669
4679
|
"loading"
|
|
4670
|
-
]),
|
|
4680
|
+
]), H(e.$slots, "default", {}, void 0, !0)], 32)), [[n, r.loading]])]),
|
|
4671
4681
|
_: 2
|
|
4672
4682
|
}, [r.showFooter ? {
|
|
4673
4683
|
name: "footer",
|
|
4674
|
-
fn: J(() => [
|
|
4684
|
+
fn: J(() => [H(e.$slots, "footer", {
|
|
4675
4685
|
cancel: M,
|
|
4676
|
-
submit:
|
|
4686
|
+
submit: ee,
|
|
4677
4687
|
submitting: r.submitting
|
|
4678
|
-
}, () => [w("div",
|
|
4688
|
+
}, () => [w("div", es, [r.showCancelButton ? (z(), x(K(Y), {
|
|
4679
4689
|
key: 0,
|
|
4680
4690
|
disabled: r.submitting,
|
|
4681
4691
|
onClick: M
|
|
4682
4692
|
}, {
|
|
4683
4693
|
default: J(() => [E(W(r.cancelText), 1)]),
|
|
4684
4694
|
_: 1
|
|
4685
|
-
}, 8, ["disabled"])) : S("", !0), h.value ? (
|
|
4695
|
+
}, 8, ["disabled"])) : S("", !0), h.value ? (z(), x(K(Y), {
|
|
4686
4696
|
key: 1,
|
|
4687
4697
|
type: "primary",
|
|
4688
4698
|
disabled: r.loading,
|
|
4689
4699
|
loading: r.submitting,
|
|
4690
|
-
onClick:
|
|
4700
|
+
onClick: ee
|
|
4691
4701
|
}, {
|
|
4692
4702
|
default: J(() => [E(W(r.submitText), 1)]),
|
|
4693
4703
|
_: 1
|
|
@@ -4706,13 +4716,13 @@ var Fo = {
|
|
|
4706
4716
|
]);
|
|
4707
4717
|
};
|
|
4708
4718
|
}
|
|
4709
|
-
}), [["__scopeId", "data-v-
|
|
4719
|
+
}), [["__scopeId", "data-v-41961167"]]);
|
|
4710
4720
|
// src/components/drawer-form-page/use-drawer-form-page.ts
|
|
4711
|
-
function
|
|
4712
|
-
let { closeOnSubmit: t = !0, initialValues: n, onCancel: r, onOpenChange: i, onSubmit: a, values: o, ...s } = e, c =
|
|
4721
|
+
function ns(e = {}) {
|
|
4722
|
+
let { closeOnSubmit: t = !0, initialValues: n, onCancel: r, onOpenChange: i, onSubmit: a, values: o, ...s } = e, c = B(!1), l = B(rs(o ?? n ?? {})), u = te({ ...s }), d = B(), f;
|
|
4713
4723
|
function p(e = {}) {
|
|
4714
4724
|
let { values: t, ...r } = e;
|
|
4715
|
-
Object.assign(u, r), l.value =
|
|
4725
|
+
Object.assign(u, r), l.value = rs(t ?? n ?? {}), c.value = !0;
|
|
4716
4726
|
}
|
|
4717
4727
|
function m() {
|
|
4718
4728
|
c.value = !1;
|
|
@@ -4740,7 +4750,7 @@ function is(e = {}) {
|
|
|
4740
4750
|
}
|
|
4741
4751
|
function x(e) {
|
|
4742
4752
|
let { values: t, ...n } = e;
|
|
4743
|
-
Object.assign(u, n), t !== void 0 && (l.value =
|
|
4753
|
+
Object.assign(u, n), t !== void 0 && (l.value = rs(t));
|
|
4744
4754
|
}
|
|
4745
4755
|
return f = {
|
|
4746
4756
|
close: m,
|
|
@@ -4758,7 +4768,7 @@ function is(e = {}) {
|
|
|
4758
4768
|
name: "DrawerFormPageProvider",
|
|
4759
4769
|
inheritAttrs: !1,
|
|
4760
4770
|
setup(e, { attrs: n, slots: i }) {
|
|
4761
|
-
return () => j(
|
|
4771
|
+
return () => j(ts, {
|
|
4762
4772
|
...n,
|
|
4763
4773
|
...u,
|
|
4764
4774
|
ref: d,
|
|
@@ -4783,14 +4793,14 @@ function is(e = {}) {
|
|
|
4783
4793
|
}
|
|
4784
4794
|
}), f];
|
|
4785
4795
|
}
|
|
4786
|
-
function
|
|
4796
|
+
function rs(e) {
|
|
4787
4797
|
return { ...e };
|
|
4788
4798
|
}
|
|
4789
4799
|
// src/components/search-form/index.vue?vue&type=script&setup=true&lang.ts
|
|
4790
|
-
var
|
|
4800
|
+
var is = {
|
|
4791
4801
|
key: 0,
|
|
4792
4802
|
class: "search-form__actions"
|
|
4793
|
-
},
|
|
4803
|
+
}, as = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
4794
4804
|
__name: "index",
|
|
4795
4805
|
props: /*@__PURE__*/ N({
|
|
4796
4806
|
collapsedRows: { default: 2 },
|
|
@@ -4814,42 +4824,55 @@ var os = {
|
|
|
4814
4824
|
}),
|
|
4815
4825
|
emits: /*@__PURE__*/ N(["reset", "search"], ["update:modelValue"]),
|
|
4816
4826
|
setup(e, { expose: t, emit: n }) {
|
|
4817
|
-
let r = e, i = n, a = oe(e, "modelValue"), o = se(), s =
|
|
4827
|
+
let r = e, i = n, a = oe(e, "modelValue"), o = se(), s = B(!1), c = B(), l = /* @__PURE__ */ new Set([
|
|
4828
|
+
"async-select",
|
|
4829
|
+
"cascader",
|
|
4830
|
+
"select"
|
|
4831
|
+
]), u = b(() => r.schema), d = b(() => ({
|
|
4818
4832
|
mode: r.mode,
|
|
4819
4833
|
values: a.value ?? {}
|
|
4820
|
-
})),
|
|
4821
|
-
function
|
|
4822
|
-
return e.children.filter((e) => !
|
|
4823
|
-
}
|
|
4824
|
-
function _() {
|
|
4825
|
-
return va(l.value);
|
|
4834
|
+
})), f = b(() => u.value.filter((e) => va(e, d.value) ? !1 : !ha(e) || _(e).length > 0)), p = b(() => Math.max(r.columns * r.collapsedRows, r.columns)), m = b(() => r.showActions && f.value.length > p.value), h = b(() => !m.value || s.value ? f.value : f.value.slice(0, p.value)), g = b(() => Object.keys(o));
|
|
4835
|
+
function _(e) {
|
|
4836
|
+
return e.children.filter((e) => !va(e, d.value));
|
|
4826
4837
|
}
|
|
4827
4838
|
function v() {
|
|
4828
|
-
return
|
|
4839
|
+
return ga(u.value);
|
|
4829
4840
|
}
|
|
4830
4841
|
function y() {
|
|
4831
|
-
return
|
|
4842
|
+
return Object.fromEntries(v().map((e) => [e.prop, e.defaultValue]));
|
|
4832
4843
|
}
|
|
4833
4844
|
function w() {
|
|
4834
|
-
|
|
4845
|
+
return { ...a.value ?? {} };
|
|
4835
4846
|
}
|
|
4836
4847
|
function O() {
|
|
4837
|
-
|
|
4848
|
+
i("search", w());
|
|
4838
4849
|
}
|
|
4839
|
-
|
|
4850
|
+
function k(e) {
|
|
4851
|
+
if (e.isComposing) return;
|
|
4852
|
+
let t = e.target;
|
|
4853
|
+
t?.tagName === "INPUT" && (t.closest(".async-select, .el-select, .el-cascader, .el-date-editor") || (e.preventDefault(), O()));
|
|
4854
|
+
}
|
|
4855
|
+
async function j(e) {
|
|
4856
|
+
l.has(e.type) && (await F(), O());
|
|
4857
|
+
}
|
|
4858
|
+
function M() {
|
|
4859
|
+
a.value = y(), i("reset", w());
|
|
4860
|
+
}
|
|
4861
|
+
async function N() {
|
|
4840
4862
|
return await c.value?.validate() ?? !1;
|
|
4841
4863
|
}
|
|
4842
|
-
return q(
|
|
4864
|
+
return q(m, (e) => {
|
|
4843
4865
|
e || (s.value = !1);
|
|
4844
4866
|
}), t({
|
|
4845
|
-
getValues:
|
|
4846
|
-
validate:
|
|
4847
|
-
reset:
|
|
4848
|
-
search:
|
|
4849
|
-
}), (t, n) => (
|
|
4867
|
+
getValues: w,
|
|
4868
|
+
validate: N,
|
|
4869
|
+
reset: M,
|
|
4870
|
+
search: O
|
|
4871
|
+
}), (t, n) => (z(), C("form", {
|
|
4850
4872
|
class: "search-form",
|
|
4851
|
-
|
|
4852
|
-
|
|
4873
|
+
onKeydown: de(k, ["enter"]),
|
|
4874
|
+
onSubmit: fe(O, ["prevent"])
|
|
4875
|
+
}, [D(Go, {
|
|
4853
4876
|
ref_key: "schemaFormRef",
|
|
4854
4877
|
ref: c,
|
|
4855
4878
|
modelValue: a.value,
|
|
@@ -4857,15 +4880,16 @@ var os = {
|
|
|
4857
4880
|
class: "search-form__schema",
|
|
4858
4881
|
columns: e.columns,
|
|
4859
4882
|
disabled: e.disabled,
|
|
4860
|
-
schema:
|
|
4883
|
+
schema: h.value,
|
|
4861
4884
|
mode: e.mode,
|
|
4862
4885
|
"label-align": "left",
|
|
4863
4886
|
"label-position": "left",
|
|
4864
4887
|
"label-width": e.labelWidth,
|
|
4865
|
-
"item-gap": 12
|
|
4866
|
-
|
|
4888
|
+
"item-gap": 12,
|
|
4889
|
+
onFieldChange: j
|
|
4890
|
+
}, T({ _: 2 }, [V(g.value, (e) => ({
|
|
4867
4891
|
name: e,
|
|
4868
|
-
fn: J((n) => [
|
|
4892
|
+
fn: J((n) => [H(t.$slots, e, L(A(n)), void 0, !0)])
|
|
4869
4893
|
}))]), 1032, [
|
|
4870
4894
|
"modelValue",
|
|
4871
4895
|
"columns",
|
|
@@ -4873,7 +4897,7 @@ var os = {
|
|
|
4873
4897
|
"schema",
|
|
4874
4898
|
"mode",
|
|
4875
4899
|
"label-width"
|
|
4876
|
-
]), e.showActions ? (
|
|
4900
|
+
]), e.showActions ? (z(), C("div", is, [
|
|
4877
4901
|
D(K(Y), {
|
|
4878
4902
|
type: "primary",
|
|
4879
4903
|
"native-type": "submit"
|
|
@@ -4883,12 +4907,12 @@ var os = {
|
|
|
4883
4907
|
}),
|
|
4884
4908
|
D(K(Y), {
|
|
4885
4909
|
"native-type": "button",
|
|
4886
|
-
onClick:
|
|
4910
|
+
onClick: M
|
|
4887
4911
|
}, {
|
|
4888
4912
|
default: J(() => [...n[3] ||= [E("重置", -1)]]),
|
|
4889
4913
|
_: 1
|
|
4890
4914
|
}),
|
|
4891
|
-
|
|
4915
|
+
m.value ? (z(), x(K(Y), {
|
|
4892
4916
|
key: 0,
|
|
4893
4917
|
link: "",
|
|
4894
4918
|
type: "primary",
|
|
@@ -4901,7 +4925,7 @@ var os = {
|
|
|
4901
4925
|
}, 8, ["icon"])) : S("", !0)
|
|
4902
4926
|
])) : S("", !0)], 32));
|
|
4903
4927
|
}
|
|
4904
|
-
}), [["__scopeId", "data-v-
|
|
4928
|
+
}), [["__scopeId", "data-v-7ced1f3b"]]), os = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
4905
4929
|
__name: "index",
|
|
4906
4930
|
props: {
|
|
4907
4931
|
fields: { default: () => [] },
|
|
@@ -4967,9 +4991,9 @@ var os = {
|
|
|
4967
4991
|
"toolbarAction"
|
|
4968
4992
|
],
|
|
4969
4993
|
setup(e, { expose: t, emit: n }) {
|
|
4970
|
-
let r = e, i = n, a = se(), o =
|
|
4994
|
+
let r = e, i = n, a = se(), o = B(), s = B("create"), c = B({}), l = B(0), u = B([]), f = B({}), p = B({}), m = b(() => r.fields.filter((e) => e.form !== !1)), h = b(() => {
|
|
4971
4995
|
let e = r.searchFormProps?.schema;
|
|
4972
|
-
return e?.length ? e : r.fields.filter((e) => e.search).map((e) =>
|
|
4996
|
+
return e?.length ? e : r.fields.filter((e) => e.search).map((e) => te(e)).filter((e) => !!e);
|
|
4973
4997
|
}), g = b(() => h.value.length > 0), _ = b(() => r.fields.filter((e) => e.table !== !1).filter((e) => e.type !== "group").map((e) => {
|
|
4974
4998
|
let t = typeof e.table == "object" ? e.table : {}, n = t.type ?? (e.type === "picture" || e.type === "file" ? e.type : void 0), r = t.valueType ?? (e.type === "date" || e.type === "datetime" ? e.type : void 0);
|
|
4975
4999
|
return {
|
|
@@ -4992,7 +5016,7 @@ var os = {
|
|
|
4992
5016
|
if (r.actions) return r.actions;
|
|
4993
5017
|
let e = [];
|
|
4994
5018
|
return r.onUpdate && e.push("edit"), r.onDelete && e.push("delete"), e;
|
|
4995
|
-
}), M = b(() => r.tableProps?.showActions ?? O.value.length > 0), N = b(() => r.permissionCode ?? r.tableProps?.permissionCode ?? ""),
|
|
5019
|
+
}), M = b(() => r.tableProps?.showActions ?? O.value.length > 0), N = b(() => r.permissionCode ?? r.tableProps?.permissionCode ?? ""), I = b(() => {
|
|
4996
5020
|
let e = r.tableProps ?? {}, t = e.importDialog;
|
|
4997
5021
|
return !r.importUrl && !t ? e : {
|
|
4998
5022
|
...e,
|
|
@@ -5001,10 +5025,10 @@ var os = {
|
|
|
5001
5025
|
...typeof r.importUrl == "string" ? { api: r.importUrl } : r.importUrl ?? {}
|
|
5002
5026
|
}
|
|
5003
5027
|
};
|
|
5004
|
-
}),
|
|
5028
|
+
}), R = b(() => {
|
|
5005
5029
|
let { schema: e, ...t } = r.searchFormProps ?? {};
|
|
5006
5030
|
return t;
|
|
5007
|
-
}),
|
|
5031
|
+
}), ee = /* @__PURE__ */ new Set([
|
|
5008
5032
|
"apiOptions",
|
|
5009
5033
|
"component",
|
|
5010
5034
|
"copyable",
|
|
@@ -5027,10 +5051,10 @@ var os = {
|
|
|
5027
5051
|
"tip",
|
|
5028
5052
|
"type"
|
|
5029
5053
|
]);
|
|
5030
|
-
function
|
|
5031
|
-
return e.type === "group" ?
|
|
5054
|
+
function te(e) {
|
|
5055
|
+
return e.type === "group" ? U(e) : re(e);
|
|
5032
5056
|
}
|
|
5033
|
-
function
|
|
5057
|
+
function U(e) {
|
|
5034
5058
|
let t = e.search;
|
|
5035
5059
|
if (!t) return null;
|
|
5036
5060
|
let n = typeof t == "object" ? t : {}, r = Array.isArray(n.children) ? n.children : e.children;
|
|
@@ -5041,7 +5065,7 @@ var os = {
|
|
|
5041
5065
|
hidden: n.hidden ?? !1
|
|
5042
5066
|
};
|
|
5043
5067
|
}
|
|
5044
|
-
function
|
|
5068
|
+
function re(e) {
|
|
5045
5069
|
let t = e.search;
|
|
5046
5070
|
if (!t) return null;
|
|
5047
5071
|
let n = typeof t == "object" ? t : {}, r = ae(n), i = G(e.props, r);
|
|
@@ -5056,10 +5080,10 @@ var os = {
|
|
|
5056
5080
|
};
|
|
5057
5081
|
}
|
|
5058
5082
|
function ie(e) {
|
|
5059
|
-
return Object.fromEntries(Object.entries(e).filter(([e]) =>
|
|
5083
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => ee.has(e)));
|
|
5060
5084
|
}
|
|
5061
5085
|
function ae(e) {
|
|
5062
|
-
return Object.fromEntries(Object.entries(e).filter(([e]) => !
|
|
5086
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => !ee.has(e)));
|
|
5063
5087
|
}
|
|
5064
5088
|
function G(e, t) {
|
|
5065
5089
|
return Object.keys(t).length === 0 ? e : typeof e == "function" ? ((n) => ({
|
|
@@ -5071,7 +5095,7 @@ var os = {
|
|
|
5071
5095
|
};
|
|
5072
5096
|
}
|
|
5073
5097
|
async function oe(e) {
|
|
5074
|
-
p.value = { ...e }, await
|
|
5098
|
+
p.value = { ...e }, await F(), await ke();
|
|
5075
5099
|
}
|
|
5076
5100
|
function ce(e) {
|
|
5077
5101
|
oe(e);
|
|
@@ -5085,7 +5109,7 @@ var os = {
|
|
|
5085
5109
|
function de(e = {}) {
|
|
5086
5110
|
f.value = { ...e }, oe(f.value);
|
|
5087
5111
|
}
|
|
5088
|
-
let [fe, X] =
|
|
5112
|
+
let [fe, X] = ns({
|
|
5089
5113
|
...r.drawerProps,
|
|
5090
5114
|
schema: m.value,
|
|
5091
5115
|
schemaFormProps: {
|
|
@@ -5262,31 +5286,31 @@ var os = {
|
|
|
5262
5286
|
openView: (e) => ge("view", e),
|
|
5263
5287
|
reload: ke
|
|
5264
5288
|
}), (e, t) => {
|
|
5265
|
-
let n =
|
|
5266
|
-
return
|
|
5289
|
+
let n = ne("access");
|
|
5290
|
+
return z(), C(y, null, [D(ea, null, {
|
|
5267
5291
|
default: J(() => [
|
|
5268
|
-
|
|
5269
|
-
e.$slots.search ?
|
|
5292
|
+
H(e.$slots, "prepend", {}, void 0, !0),
|
|
5293
|
+
e.$slots.search ? H(e.$slots, "search", {
|
|
5270
5294
|
values: f.value,
|
|
5271
5295
|
search: q,
|
|
5272
5296
|
reset: de
|
|
5273
|
-
}, void 0, !0, 0) : g.value ? (
|
|
5297
|
+
}, void 0, !0, 0) : g.value ? (z(), x(as, P({
|
|
5274
5298
|
key: 1,
|
|
5275
5299
|
modelValue: f.value,
|
|
5276
5300
|
"onUpdate:modelValue": t[0] ||= (e) => f.value = e,
|
|
5277
5301
|
class: "crud-page__search"
|
|
5278
|
-
},
|
|
5302
|
+
}, R.value, {
|
|
5279
5303
|
schema: h.value,
|
|
5280
5304
|
onSearch: ce,
|
|
5281
5305
|
onReset: le
|
|
5282
|
-
}), T({ _: 2 }, [
|
|
5306
|
+
}), T({ _: 2 }, [V(w.value, (t) => ({
|
|
5283
5307
|
name: t,
|
|
5284
|
-
fn: J((n) => [
|
|
5308
|
+
fn: J((n) => [H(e.$slots, t, L(A(n)), void 0, !0)])
|
|
5285
5309
|
}))]), 1040, ["modelValue", "schema"])) : S("", !0),
|
|
5286
|
-
D(
|
|
5310
|
+
D(Mi, P({
|
|
5287
5311
|
ref_key: "tableRef",
|
|
5288
5312
|
ref: o
|
|
5289
|
-
},
|
|
5313
|
+
}, I.value, {
|
|
5290
5314
|
"row-key": r.rowKey,
|
|
5291
5315
|
columns: _.value,
|
|
5292
5316
|
data: r.data,
|
|
@@ -5298,8 +5322,8 @@ var os = {
|
|
|
5298
5322
|
onHandleAction: Oe,
|
|
5299
5323
|
onRowSort: t[2] ||= (e) => i("rowSort", e)
|
|
5300
5324
|
}), T({
|
|
5301
|
-
buttons: J(() => [
|
|
5302
|
-
r.onCreate ? ue((
|
|
5325
|
+
buttons: J(() => [H(e.$slots, "buttons", { selectedRows: u.value }, () => [
|
|
5326
|
+
r.onCreate ? ue((z(), x(K(Y), {
|
|
5303
5327
|
key: 0,
|
|
5304
5328
|
type: "primary",
|
|
5305
5329
|
onClick: _e
|
|
@@ -5307,7 +5331,7 @@ var os = {
|
|
|
5307
5331
|
default: J(() => [E(W(r.addButtonText), 1)]),
|
|
5308
5332
|
_: 1
|
|
5309
5333
|
})), [[n, [`${N.value}:add`]]]) : S("", !0),
|
|
5310
|
-
r.onDelete || r.onBatchDelete ? ue((
|
|
5334
|
+
r.onDelete || r.onBatchDelete ? ue((z(), x(K(Y), {
|
|
5311
5335
|
key: 1,
|
|
5312
5336
|
type: "danger",
|
|
5313
5337
|
disabled: u.value.length === 0,
|
|
@@ -5316,14 +5340,14 @@ var os = {
|
|
|
5316
5340
|
default: J(() => [E(W(K(d)("components.tableEntity.batchDelete")), 1)]),
|
|
5317
5341
|
_: 1
|
|
5318
5342
|
}, 8, ["disabled"])), [[n, [`${N.value}:remove`]]]) : S("", !0),
|
|
5319
|
-
r.showImport ? ue((
|
|
5343
|
+
r.showImport ? ue((z(), x(K(Y), {
|
|
5320
5344
|
key: 2,
|
|
5321
5345
|
onClick: xe
|
|
5322
5346
|
}, {
|
|
5323
5347
|
default: J(() => [E(W(K(d)("components.tableEntity.import")), 1)]),
|
|
5324
5348
|
_: 1
|
|
5325
5349
|
})), [[n, [`${N.value}:import`]]]) : S("", !0),
|
|
5326
|
-
r.exportConfig ? ue((
|
|
5350
|
+
r.exportConfig ? ue((z(), x(K(Y), {
|
|
5327
5351
|
key: 3,
|
|
5328
5352
|
onClick: Se
|
|
5329
5353
|
}, {
|
|
@@ -5333,9 +5357,9 @@ var os = {
|
|
|
5333
5357
|
D(K($))
|
|
5334
5358
|
], !0)]),
|
|
5335
5359
|
_: 2
|
|
5336
|
-
}, [
|
|
5360
|
+
}, [V(v.value, (t) => ({
|
|
5337
5361
|
name: t,
|
|
5338
|
-
fn: J((n) => [
|
|
5362
|
+
fn: J((n) => [H(e.$slots, t, L(A(n)), void 0, !0)])
|
|
5339
5363
|
}))]), 1040, [
|
|
5340
5364
|
"row-key",
|
|
5341
5365
|
"columns",
|
|
@@ -5348,27 +5372,27 @@ var os = {
|
|
|
5348
5372
|
]),
|
|
5349
5373
|
_: 3
|
|
5350
5374
|
}), D(K(fe), null, T({
|
|
5351
|
-
default: J(() => [e.$slots.default ?
|
|
5375
|
+
default: J(() => [e.$slots.default ? H(e.$slots, "default", {}, void 0, !0, 0) : S("", !0)]),
|
|
5352
5376
|
_: 2
|
|
5353
5377
|
}, [
|
|
5354
|
-
|
|
5378
|
+
V(w.value, (t) => ({
|
|
5355
5379
|
name: t,
|
|
5356
|
-
fn: J((n) => [
|
|
5380
|
+
fn: J((n) => [H(e.$slots, t, L(A(n)), void 0, !0)])
|
|
5357
5381
|
})),
|
|
5358
5382
|
e.$slots.header ? {
|
|
5359
5383
|
name: "header",
|
|
5360
|
-
fn: J((t) => [
|
|
5384
|
+
fn: J((t) => [H(e.$slots, "header", L(A(t)), void 0, !0)]),
|
|
5361
5385
|
key: "0"
|
|
5362
5386
|
} : void 0,
|
|
5363
5387
|
e.$slots.footer ? {
|
|
5364
5388
|
name: "footer",
|
|
5365
|
-
fn: J((t) => [
|
|
5389
|
+
fn: J((t) => [H(e.$slots, "footer", L(A(t)), void 0, !0)]),
|
|
5366
5390
|
key: "1"
|
|
5367
5391
|
} : void 0
|
|
5368
5392
|
]), 1024)], 64);
|
|
5369
5393
|
};
|
|
5370
5394
|
}
|
|
5371
|
-
}), [["__scopeId", "data-v-d344d607"]]),
|
|
5395
|
+
}), [["__scopeId", "data-v-d344d607"]]), ss = /* @__PURE__ */ k({
|
|
5372
5396
|
__name: "index",
|
|
5373
5397
|
props: {
|
|
5374
5398
|
className: { default: "disguiseicon" },
|
|
@@ -5376,9 +5400,9 @@ var os = {
|
|
|
5376
5400
|
},
|
|
5377
5401
|
setup(e) {
|
|
5378
5402
|
let t = e;
|
|
5379
|
-
return (e, n) => (
|
|
5403
|
+
return (e, n) => (z(), x(K(Z), P(e.$attrs, { class: ["disguise iconfont", t.icon ? `${t.className}-${t.icon}` : void 0] }), null, 16, ["class"]));
|
|
5380
5404
|
}
|
|
5381
|
-
}),
|
|
5405
|
+
}), cs = ["src"], ls = { class: "image-upload__mask" }, us = { class: "image-upload__text" }, ds = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
5382
5406
|
__name: "index",
|
|
5383
5407
|
props: /*@__PURE__*/ N({
|
|
5384
5408
|
accept: { default: () => [
|
|
@@ -5400,7 +5424,7 @@ var os = {
|
|
|
5400
5424
|
}),
|
|
5401
5425
|
emits: ["update:modelValue"],
|
|
5402
5426
|
setup(e) {
|
|
5403
|
-
let t = e, n = oe(e, "modelValue"), { resolveImageUrl: r } = p(), i =
|
|
5427
|
+
let t = e, n = oe(e, "modelValue"), { resolveImageUrl: r } = p(), i = B(!1), a = B(!1), o = b(() => r(n.value)), s = b(() => ({
|
|
5404
5428
|
width: `${t.width}px`,
|
|
5405
5429
|
height: `${t.height}px`
|
|
5406
5430
|
}));
|
|
@@ -5423,22 +5447,22 @@ var os = {
|
|
|
5423
5447
|
function u() {
|
|
5424
5448
|
n.value = "";
|
|
5425
5449
|
}
|
|
5426
|
-
return (t, n) => (
|
|
5450
|
+
return (t, n) => (z(), C("div", { class: I(["image-upload", { "is-disabled": e.disabled }]) }, [o.value ? (z(), C("div", {
|
|
5427
5451
|
key: 0,
|
|
5428
5452
|
class: "image-upload__box",
|
|
5429
|
-
style:
|
|
5453
|
+
style: R(s.value)
|
|
5430
5454
|
}, [w("img", {
|
|
5431
5455
|
src: o.value,
|
|
5432
5456
|
alt: "",
|
|
5433
5457
|
class: "image-upload__img"
|
|
5434
|
-
}, null, 8,
|
|
5458
|
+
}, null, 8, cs), w("div", ls, [D(K(Z), {
|
|
5435
5459
|
class: "image-upload__action",
|
|
5436
5460
|
title: K(d)("components.imageUpload.preview"),
|
|
5437
5461
|
onClick: n[0] ||= (e) => a.value = !0
|
|
5438
5462
|
}, {
|
|
5439
5463
|
default: J(() => [D(K(ht))]),
|
|
5440
5464
|
_: 1
|
|
5441
|
-
}, 8, ["title"]), e.disabled ? S("", !0) : (
|
|
5465
|
+
}, 8, ["title"]), e.disabled ? S("", !0) : (z(), x(K(Z), {
|
|
5442
5466
|
key: 0,
|
|
5443
5467
|
class: "image-upload__action",
|
|
5444
5468
|
title: K(d)("components.imageUpload.remove"),
|
|
@@ -5446,7 +5470,7 @@ var os = {
|
|
|
5446
5470
|
}, {
|
|
5447
5471
|
default: J(() => [D(K(tt))]),
|
|
5448
5472
|
_: 1
|
|
5449
|
-
}, 8, ["title"]))])], 4)) : (
|
|
5473
|
+
}, 8, ["title"]))])], 4)) : (z(), x(K(Ue), {
|
|
5450
5474
|
key: 1,
|
|
5451
5475
|
accept: e.accept.join(","),
|
|
5452
5476
|
"before-upload": c,
|
|
@@ -5456,13 +5480,13 @@ var os = {
|
|
|
5456
5480
|
}, {
|
|
5457
5481
|
default: J(() => [w("div", {
|
|
5458
5482
|
class: "image-upload__box is-empty",
|
|
5459
|
-
style:
|
|
5460
|
-
}, [D(K(Z), { class:
|
|
5461
|
-
default: J(() => [i.value ? (
|
|
5483
|
+
style: R(s.value)
|
|
5484
|
+
}, [D(K(Z), { class: I(["image-upload__icon", { "is-loading": i.value }]) }, {
|
|
5485
|
+
default: J(() => [i.value ? (z(), x(K(at), { key: 0 })) : (z(), x(K(st), { key: 1 }))]),
|
|
5462
5486
|
_: 1
|
|
5463
|
-
}, 8, ["class"]), w("span",
|
|
5487
|
+
}, 8, ["class"]), w("span", us, W(i.value ? K(d)("components.imageUpload.uploading") : K(d)("components.imageUpload.upload")), 1)], 4)]),
|
|
5464
5488
|
_: 1
|
|
5465
|
-
}, 8, ["accept", "disabled"])), a.value ? (
|
|
5489
|
+
}, 8, ["accept", "disabled"])), a.value ? (z(), x(K(we), {
|
|
5466
5490
|
key: 2,
|
|
5467
5491
|
"url-list": [o.value],
|
|
5468
5492
|
teleported: "",
|
|
@@ -5471,7 +5495,7 @@ var os = {
|
|
|
5471
5495
|
}
|
|
5472
5496
|
}), [["__scopeId", "data-v-c6aeef2e"]]);
|
|
5473
5497
|
// src/setup.ts
|
|
5474
|
-
function
|
|
5498
|
+
function fs(e = {}) {
|
|
5475
5499
|
l(e);
|
|
5476
5500
|
}
|
|
5477
|
-
export {
|
|
5501
|
+
export { Qi as AsyncSelect, ea as BaseCard, os as CrudPage, Li as DialogList, Ir as DictTag, ss as DisguiseIcon, ts as DrawerFormPage, g as FileUpload, ds as ImageUpload, t as ImagesView, ar as ImportDialog, v as PictureUpload, xo as RichTextEditor, Go as SchemaForm, as as SearchForm, Mi as TableEntity, m as UserAvatarInfo, ra as getEntity, ia as paginateLocally, na as registerEntity, da as registerSchemaFormComponents, fs as setupDisguise, ns as useDrawerFormPage };
|