disguise-ui 0.3.1 → 0.3.3
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/README.md +1 -21
- package/dist/{avatar-cell-CSanGG5Y.js → avatar-cell-B0Pvug8d.js} +1 -1
- package/dist/disguise-ui.js +1145 -1130
- package/dist/{file-upload-ClPojHbE.js → file-upload-C1cpwWWY.js} +1 -1
- package/dist/{file-upload-D7N0tsLF.js → file-upload-n4pZizh3.js} +3 -3
- package/dist/{i18n-_x6RCAst.js → i18n-D9LSb_U5.js} +170 -40
- package/dist/picture-cell-C6BLbwEb.js +121 -0
- package/dist/{picture-upload-BrrTtaCc.js → picture-upload-C_10NZsL.js} +5 -5
- package/dist/{picture-upload-VK7YOAr4.js → picture-upload-DFIHyqTp.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/table-entity/index.type.d.ts +16 -3
- package/dist/types/components/user-avatar-info/index.vue.d.ts +0 -24
- package/dist/types/composables/use-dict-data.d.ts +22 -22
- package/dist/types/index.d.ts +1 -1
- package/dist/types/runtime/context.d.ts +1 -1
- package/dist/types/runtime/dict.d.ts +1 -1
- package/dist/{use-image-url-Bs5WMZ6L.js → use-image-url-Df54pSFh.js} +1 -1
- package/dist/{use-multiple-file-upload-Cv2dfA07.js → use-multiple-file-upload-CBOycBu3.js} +55 -56
- package/dist/user-avatar-info-DDby9_5X.js +295 -0
- package/package.json +6 -1
- package/dist/context-DqlD6qDJ.js +0 -50
- package/dist/picture-cell-BhKqFZUx.js +0 -120
- package/dist/user-avatar-info-BruEfYy4.js +0 -276
package/dist/disguise-ui.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { i as e, r as t, t as n } from "./picture-cell-
|
|
1
|
+
import { i as e, r as t, t as n } from "./picture-cell-C6BLbwEb.js";
|
|
2
2
|
import { t as r } from "./modal-CHOpDVLd.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as d } from "./i18n-_x6RCAst.js";
|
|
3
|
+
import { a as i, d as a, i as o, l as s, o as c, r as l, t as u, u as d } from "./i18n-D9LSb_U5.js";
|
|
5
4
|
import { t as f } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
6
|
-
import { t as p } from "./use-image-url-
|
|
7
|
-
import { t as m } from "./user-avatar-info-
|
|
5
|
+
import { t as p } from "./use-image-url-Df54pSFh.js";
|
|
6
|
+
import { t as m } from "./user-avatar-info-DDby9_5X.js";
|
|
8
7
|
import { t as h } from "./use-file-type-rNstoxXw.js";
|
|
9
|
-
import { t as g } from "./file-upload-
|
|
10
|
-
import { r as _ } from "./use-multiple-file-upload-
|
|
11
|
-
import { t as v } from "./picture-upload-
|
|
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
|
|
8
|
+
import { t as g } from "./file-upload-n4pZizh3.js";
|
|
9
|
+
import { r as _ } from "./use-multiple-file-upload-CBOycBu3.js";
|
|
10
|
+
import { t as v } from "./picture-upload-C_10NZsL.js";
|
|
11
|
+
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 ee, normalizeClass as F, normalizeProps as I, normalizeStyle as L, onUnmounted as te, openBlock as R, reactive as ne, ref as z, renderList as B, renderSlot as V, resolveComponent as re, resolveDirective as H, resolveDynamicComponent as U, shallowReactive as ie, toDisplayString as W, toHandlers as ae, toValue as oe, unref as G, useModel as K, 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
12
|
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
13
|
import Ge from "dayjs";
|
|
15
14
|
import Ke from "dayjs/plugin/timezone.js";
|
|
@@ -39,12 +38,12 @@ var fn = "data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%
|
|
|
39
38
|
// src/runtime/access.ts
|
|
40
39
|
function pn() {
|
|
41
40
|
return { hasAccessByCodes(e) {
|
|
42
|
-
return
|
|
41
|
+
return o().value(e);
|
|
43
42
|
} };
|
|
44
43
|
}
|
|
45
44
|
function mn() {
|
|
46
45
|
return { get accessToken() {
|
|
47
|
-
return
|
|
46
|
+
return i();
|
|
48
47
|
} };
|
|
49
48
|
}
|
|
50
49
|
Ge.extend(qe), Ge.extend(Ke), Ge.tz.setDefault(Ge.tz.guess());
|
|
@@ -76,13 +75,13 @@ function bn({ fileName: e = "download", source: t }) {
|
|
|
76
75
|
}
|
|
77
76
|
// src/runtime/request.ts
|
|
78
77
|
function xn() {
|
|
79
|
-
let e =
|
|
78
|
+
let e = d();
|
|
80
79
|
if (!e) throw Error("请先调用 setupDisguise,并传入 request");
|
|
81
80
|
return e;
|
|
82
81
|
}
|
|
83
82
|
var Sn = {
|
|
84
83
|
getBaseUrl() {
|
|
85
|
-
return
|
|
84
|
+
return d()?.getBaseUrl() ?? "";
|
|
86
85
|
},
|
|
87
86
|
download(e, t) {
|
|
88
87
|
return xn().download(e, t);
|
|
@@ -142,41 +141,41 @@ var Sn = {
|
|
|
142
141
|
setup(e, { emit: t }) {
|
|
143
142
|
let n = e, i = t, [a, o] = r({ onOpenChange: (e) => {
|
|
144
143
|
e !== n.modelValue && i("update:modelValue", e);
|
|
145
|
-
} }), s =
|
|
146
|
-
label:
|
|
144
|
+
} }), s = z(), c = z("upload"), l = z(n.defaultMode), d = z(null), f = z(""), p = z([]), m = z(""), h = z([]), g = z([]), _ = z(0), v = z([]), T = z(!1), O = z(!1), k = z(!1), A = z(0), j = z(""), M = z(null), N = z(0), P = b(() => n.title || u("components.importDialog.title")), ee = b(() => !!n.api), I = b(() => n.modes?.length ? n.modes : [{
|
|
145
|
+
label: u("components.importDialog.modeCreate"),
|
|
147
146
|
value: "create"
|
|
148
147
|
}, {
|
|
149
|
-
label:
|
|
148
|
+
label: u("components.importDialog.modeUpdate"),
|
|
150
149
|
value: "update"
|
|
151
|
-
}]),
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
]),
|
|
150
|
+
}]), L = b(() => n.tips?.length ? n.tips : [
|
|
151
|
+
u("components.importDialog.tipSize", { size: n.maxSize }),
|
|
152
|
+
u("components.importDialog.tipHeader"),
|
|
153
|
+
u("components.importDialog.tipFormula"),
|
|
154
|
+
u("components.importDialog.tipArea"),
|
|
155
|
+
u("components.importDialog.tipRelation")
|
|
156
|
+
]), te = b(() => n.accept.join(",")), ne = b(() => n.accept.map((e) => e.replace(/^\./, "").toUpperCase()).join("、")), V = b(() => M.value !== null), re = b(() => !V.value && !ee.value), U = b(() => u("components.importDialog.previewSummary", {
|
|
158
157
|
total: _.value,
|
|
159
158
|
count: Math.min(g.value.length, n.maxPreviewCount)
|
|
160
|
-
})), ie = b(() => f.value ||
|
|
159
|
+
})), ie = b(() => f.value || d.value?.name || ""), ae = b(() => h.value.map((e) => ({
|
|
161
160
|
label: e.label,
|
|
162
161
|
value: e.label
|
|
163
|
-
}))),
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
}))), oe = b(() => j.value || u("components.importDialog.importingProgress", { progress: A.value })), K = b(() => M.value ? M.value.title ? M.value.title : M.value.success ? u("components.importDialog.successTitle") : u("components.importDialog.errorTitle") : ""), se = b(() => M.value ? M.value.description ? M.value.description : M.value.success ? u("components.importDialog.successDescription") : u("components.importDialog.errorDescription") : ""), ce = b(() => [
|
|
163
|
+
u("components.importDialog.stepUpload"),
|
|
164
|
+
u("components.importDialog.stepPreview"),
|
|
165
|
+
u("components.importDialog.stepMapping"),
|
|
166
|
+
u("components.importDialog.stepImport")
|
|
168
167
|
]);
|
|
169
168
|
q(() => n.modelValue, (e, t) => {
|
|
170
169
|
e ? (l.value = n.defaultMode, o.open()) : (o.close(), k.value = !1, o.setState({ fullscreen: !1 }), t && n.resetOnClose && le());
|
|
171
170
|
}, { immediate: !0 });
|
|
172
171
|
function le() {
|
|
173
|
-
N.value += 1, c.value = "upload",
|
|
172
|
+
N.value += 1, c.value = "upload", d.value = null, f.value = "", p.value = [], m.value = "", h.value = [], g.value = [], _.value = 0, v.value = [], T.value = !1, O.value = !1, A.value = 0, j.value = "", M.value = null, s.value?.clearFiles();
|
|
174
173
|
}
|
|
175
174
|
function de() {
|
|
176
175
|
p.value = [], m.value = "", h.value = [], g.value = [], _.value = 0, v.value = [], M.value = null;
|
|
177
176
|
}
|
|
178
177
|
function fe() {
|
|
179
|
-
|
|
178
|
+
V.value || i("cancel"), i("update:modelValue", !1);
|
|
180
179
|
}
|
|
181
180
|
function X() {
|
|
182
181
|
k.value = !k.value, o.setState({ fullscreen: k.value });
|
|
@@ -193,7 +192,7 @@ var Sn = {
|
|
|
193
192
|
source: e.data
|
|
194
193
|
});
|
|
195
194
|
} catch (e) {
|
|
196
|
-
Q.error(ve(e, "
|
|
195
|
+
Q.error(ve(e, u("components.importDialog.templateDownloadError")));
|
|
197
196
|
}
|
|
198
197
|
}
|
|
199
198
|
function he(e) {
|
|
@@ -217,13 +216,13 @@ var Sn = {
|
|
|
217
216
|
return e instanceof Error && e.message ? e.message : t;
|
|
218
217
|
}
|
|
219
218
|
function ye(e) {
|
|
220
|
-
if (e.size / 1024 / 1024 > n.maxSize) return Q.error(
|
|
219
|
+
if (e.size / 1024 / 1024 > n.maxSize) return Q.error(u("components.importDialog.fileSizeExceeded", { size: n.maxSize })), !1;
|
|
221
220
|
if (!n.accept.length) return !0;
|
|
222
221
|
let t = e.name.toLowerCase(), r = e.type.toLowerCase();
|
|
223
222
|
return n.accept.some((e) => {
|
|
224
223
|
let n = e.toLowerCase();
|
|
225
224
|
return n.startsWith(".") ? t.endsWith(n) : r === n;
|
|
226
|
-
}) ? !0 : (Q.error(
|
|
225
|
+
}) ? !0 : (Q.error(u("components.importDialog.fileTypeInvalid", { types: ne.value })), !1);
|
|
227
226
|
}
|
|
228
227
|
function be(e) {
|
|
229
228
|
let t = new Map((e ?? []).map((e) => [e.targetField, e]));
|
|
@@ -244,22 +243,22 @@ var Sn = {
|
|
|
244
243
|
return typeof n.title == "string" && (r.title = n.title), typeof n.description == "string" && (r.description = n.description), typeof n.detail == "string" ? r.detail = n.detail : typeof n.message == "string" ? r.detail = n.message : typeof n.msg == "string" && (r.detail = n.msg), typeof n.successCount == "number" && (r.successCount = n.successCount), typeof n.failureCount == "number" && (r.failureCount = n.failureCount), r;
|
|
245
244
|
}
|
|
246
245
|
function Se(e) {
|
|
247
|
-
f.value = e.fileName ||
|
|
246
|
+
f.value = e.fileName || d.value?.name || "", p.value = e.sheets, m.value = e.currentSheet || e.sheets[0]?.value || "", h.value = e.previewColumns, g.value = e.previewRows, _.value = e.total, v.value = be(e.mappings);
|
|
248
247
|
}
|
|
249
248
|
async function Ce(e) {
|
|
250
|
-
if (!
|
|
251
|
-
Q.warning(
|
|
249
|
+
if (!d.value) {
|
|
250
|
+
Q.warning(u("components.importDialog.fileRequired"));
|
|
252
251
|
return;
|
|
253
252
|
}
|
|
254
253
|
if (!n.parseFile) {
|
|
255
|
-
Q.error("
|
|
254
|
+
Q.error(u("components.importDialog.parseFileMissing"));
|
|
256
255
|
return;
|
|
257
256
|
}
|
|
258
257
|
let t = ++N.value;
|
|
259
258
|
T.value = !0;
|
|
260
259
|
try {
|
|
261
260
|
let r = await n.parseFile({
|
|
262
|
-
file:
|
|
261
|
+
file: d.value,
|
|
263
262
|
mode: l.value,
|
|
264
263
|
sheet: e
|
|
265
264
|
});
|
|
@@ -267,7 +266,7 @@ var Sn = {
|
|
|
267
266
|
Se(r), c.value = "preview";
|
|
268
267
|
} catch (e) {
|
|
269
268
|
if (t !== N.value) return;
|
|
270
|
-
let n = e instanceof Error ? e.message :
|
|
269
|
+
let n = e instanceof Error ? e.message : u("components.importDialog.parseError");
|
|
271
270
|
Q.error(n);
|
|
272
271
|
} finally {
|
|
273
272
|
t === N.value && (T.value = !1);
|
|
@@ -275,23 +274,23 @@ var Sn = {
|
|
|
275
274
|
}
|
|
276
275
|
function we(e) {
|
|
277
276
|
let t = e.raw;
|
|
278
|
-
s.value?.clearFiles(), t && ye(t) && (
|
|
277
|
+
s.value?.clearFiles(), t && ye(t) && (d.value = t, f.value = t.name, c.value = "upload", de(), i("fileChange", t));
|
|
279
278
|
}
|
|
280
279
|
function Ee(e) {
|
|
281
280
|
typeof e == "string" && (l.value = e, de(), c.value = "upload");
|
|
282
281
|
}
|
|
283
282
|
async function De(e) {
|
|
284
|
-
e &&
|
|
283
|
+
e && d.value && await Ce(e);
|
|
285
284
|
}
|
|
286
285
|
function Oe() {
|
|
287
286
|
let e = v.value.find((e) => e.required && !e.sourceColumn);
|
|
288
|
-
if (e) return Q.warning(
|
|
287
|
+
if (e) return Q.warning(u("components.importDialog.mappingRequired", { field: e.targetLabel })), !1;
|
|
289
288
|
let t = v.value.map((e) => e.sourceColumn).filter(Boolean);
|
|
290
|
-
return new Set(t).size === t.length || (Q.warning(
|
|
289
|
+
return new Set(t).size === t.length || (Q.warning(u("components.importDialog.mappingDuplicate")), !1);
|
|
291
290
|
}
|
|
292
291
|
async function ke() {
|
|
293
292
|
if (c.value === "upload") {
|
|
294
|
-
if (
|
|
293
|
+
if (ee.value) {
|
|
295
294
|
await Ne();
|
|
296
295
|
return;
|
|
297
296
|
}
|
|
@@ -299,13 +298,13 @@ var Sn = {
|
|
|
299
298
|
} else c.value === "preview" ? c.value = "mapping" : c.value === "mapping" && await Le();
|
|
300
299
|
}
|
|
301
300
|
async function Ne() {
|
|
302
|
-
if (!
|
|
303
|
-
else if (!n.api) Q.error("
|
|
301
|
+
if (!d.value) Q.warning(u("components.importDialog.fileRequired"));
|
|
302
|
+
else if (!n.api) Q.error(u("components.importDialog.apiMissing"));
|
|
304
303
|
else {
|
|
305
|
-
c.value = "importing", O.value = !0, A.value = 8, j.value =
|
|
304
|
+
c.value = "importing", O.value = !0, A.value = 8, j.value = u("components.importDialog.importingStart");
|
|
306
305
|
try {
|
|
307
306
|
let e = xe(await Sn.upload(he(n.api), {
|
|
308
|
-
file:
|
|
307
|
+
file: d.value,
|
|
309
308
|
mode: l.value
|
|
310
309
|
}, { onUploadProgress: (e) => {
|
|
311
310
|
e.total && Ie(8 + Math.round(e.loaded / e.total * 84));
|
|
@@ -314,7 +313,7 @@ var Sn = {
|
|
|
314
313
|
} catch (e) {
|
|
315
314
|
let t = {
|
|
316
315
|
success: !1,
|
|
317
|
-
detail: ve(e,
|
|
316
|
+
detail: ve(e, u("components.importDialog.importError"))
|
|
318
317
|
};
|
|
319
318
|
A.value = 100, M.value = t, i("error", e instanceof Error ? e : t);
|
|
320
319
|
} finally {
|
|
@@ -329,14 +328,14 @@ var Sn = {
|
|
|
329
328
|
A.value = Math.max(0, Math.min(100, Math.round(e))), t && (j.value = t);
|
|
330
329
|
}
|
|
331
330
|
async function Le() {
|
|
332
|
-
if (!
|
|
333
|
-
else if (!m.value) Q.warning(
|
|
331
|
+
if (!d.value) Q.warning(u("components.importDialog.fileRequired"));
|
|
332
|
+
else if (!m.value) Q.warning(u("components.importDialog.sheetRequired"));
|
|
334
333
|
else if (Oe()) {
|
|
335
|
-
c.value = "importing", O.value = !0, A.value = 8, j.value =
|
|
334
|
+
c.value = "importing", O.value = !0, A.value = 8, j.value = u("components.importDialog.importingStart");
|
|
336
335
|
try {
|
|
337
|
-
if (!n.submitImport) throw Error("
|
|
336
|
+
if (!n.submitImport) throw Error(u("components.importDialog.submitImportMissing"));
|
|
338
337
|
let e = await n.submitImport({
|
|
339
|
-
file:
|
|
338
|
+
file: d.value,
|
|
340
339
|
mode: l.value,
|
|
341
340
|
sheet: m.value,
|
|
342
341
|
mappings: v.value,
|
|
@@ -346,7 +345,7 @@ var Sn = {
|
|
|
346
345
|
} catch (e) {
|
|
347
346
|
let t = {
|
|
348
347
|
success: !1,
|
|
349
|
-
detail: e instanceof Error ? e.message :
|
|
348
|
+
detail: e instanceof Error ? e.message : u("components.importDialog.importError")
|
|
350
349
|
};
|
|
351
350
|
A.value = 100, M.value = t, i("error", e instanceof Error ? e : t);
|
|
352
351
|
} finally {
|
|
@@ -355,8 +354,8 @@ var Sn = {
|
|
|
355
354
|
}
|
|
356
355
|
}
|
|
357
356
|
return (e, t) => {
|
|
358
|
-
let n =
|
|
359
|
-
return
|
|
357
|
+
let n = H("loading");
|
|
358
|
+
return R(), x(G(a), {
|
|
360
359
|
title: P.value,
|
|
361
360
|
class: "import-dialog__dialog w-[600px]",
|
|
362
361
|
closable: !1,
|
|
@@ -364,84 +363,84 @@ var Sn = {
|
|
|
364
363
|
"close-on-press-escape": !O.value,
|
|
365
364
|
"fullscreen-button": !1
|
|
366
365
|
}, {
|
|
367
|
-
title: J(() => [w("div", Cn, [w("div", wn, W(P.value), 1), w("div", Tn, [D(
|
|
366
|
+
title: J(() => [w("div", Cn, [w("div", wn, W(P.value), 1), w("div", Tn, [D(G(Y), {
|
|
368
367
|
text: "",
|
|
369
368
|
circle: "",
|
|
370
369
|
class: "import-dialog__action",
|
|
371
370
|
onClick: X
|
|
372
371
|
}, {
|
|
373
|
-
default: J(() => [D(
|
|
374
|
-
default: J(() => [k.value ? (
|
|
372
|
+
default: J(() => [D(G(Z), { size: 16 }, {
|
|
373
|
+
default: J(() => [k.value ? (R(), x(G(ut), { key: 0 })) : (R(), x(G(rt), { key: 1 }))]),
|
|
375
374
|
_: 1
|
|
376
375
|
})]),
|
|
377
376
|
_: 1
|
|
378
|
-
}), D(
|
|
377
|
+
}), D(G(Y), {
|
|
379
378
|
text: "",
|
|
380
379
|
circle: "",
|
|
381
380
|
class: "import-dialog__action",
|
|
382
381
|
onClick: fe
|
|
383
382
|
}, {
|
|
384
|
-
default: J(() => [D(
|
|
385
|
-
default: J(() => [D(
|
|
383
|
+
default: J(() => [D(G(Z), { size: 16 }, {
|
|
384
|
+
default: J(() => [D(G($e))]),
|
|
386
385
|
_: 1
|
|
387
386
|
})]),
|
|
388
387
|
_: 1
|
|
389
388
|
})])])]),
|
|
390
|
-
footer: J(() => [w("div", ir, [c.value === "preview" || c.value === "mapping" ? (
|
|
391
|
-
default: J(() => [E(W(
|
|
389
|
+
footer: J(() => [w("div", ir, [c.value === "preview" || c.value === "mapping" ? (R(), C(y, { key: 0 }, [D(G(Y), { onClick: Fe }, {
|
|
390
|
+
default: J(() => [E(W(G(u)("components.importDialog.previous")), 1)]),
|
|
392
391
|
_: 1
|
|
393
|
-
}), D(
|
|
392
|
+
}), D(G(Y), {
|
|
394
393
|
type: "primary",
|
|
395
394
|
loading: T.value || O.value,
|
|
396
395
|
onClick: ke
|
|
397
396
|
}, {
|
|
398
|
-
default: J(() => [E(W(c.value === "mapping" ?
|
|
397
|
+
default: J(() => [E(W(c.value === "mapping" ? G(u)("components.importDialog.startImport") : G(u)("components.importDialog.next")), 1)]),
|
|
399
398
|
_: 1
|
|
400
|
-
}, 8, ["loading"])], 64)) : c.value === "upload" ? (
|
|
399
|
+
}, 8, ["loading"])], 64)) : c.value === "upload" ? (R(), x(G(Y), {
|
|
401
400
|
key: 1,
|
|
402
401
|
type: "primary",
|
|
403
402
|
loading: T.value || O.value,
|
|
404
403
|
onClick: ke
|
|
405
404
|
}, {
|
|
406
|
-
default: J(() => [E(W(
|
|
405
|
+
default: J(() => [E(W(ee.value ? G(u)("components.importDialog.startImport") : G(u)("components.importDialog.next")), 1)]),
|
|
407
406
|
_: 1
|
|
408
|
-
}, 8, ["loading"])) : (
|
|
407
|
+
}, 8, ["loading"])) : (R(), x(G(Y), {
|
|
409
408
|
key: 2,
|
|
410
409
|
onClick: fe
|
|
411
410
|
}, {
|
|
412
|
-
default: J(() => [E(W(
|
|
411
|
+
default: J(() => [E(W(G(u)("common.close")), 1)]),
|
|
413
412
|
_: 1
|
|
414
413
|
}))])]),
|
|
415
|
-
default: J(() => [w("div", En, [
|
|
414
|
+
default: J(() => [w("div", En, [re.value ? (R(), C("div", Dn, [(R(!0), C(y, null, B(ce.value, (e, t) => (R(), C("div", {
|
|
416
415
|
key: e,
|
|
417
416
|
class: "import-dialog__step"
|
|
418
417
|
}, [
|
|
419
|
-
w("div", { class:
|
|
418
|
+
w("div", { class: F(["import-dialog__step-node", {
|
|
420
419
|
"is-active": c.value === "upload" && t === 0 || c.value === "preview" && t === 1 || c.value === "mapping" && t === 2 || c.value === "importing" && t === 3,
|
|
421
420
|
"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 ? (
|
|
423
|
-
default: J(() => [D(
|
|
421
|
+
}]) }, [c.value === "preview" && t === 0 || c.value === "mapping" && t <= 1 || c.value === "importing" && t <= 2 ? (R(), x(G(Z), { key: 0 }, {
|
|
422
|
+
default: J(() => [D(G(Qe))]),
|
|
424
423
|
_: 1
|
|
425
|
-
})) : (
|
|
424
|
+
})) : (R(), C("span", On, W(t + 1), 1))], 2),
|
|
426
425
|
w("div", kn, W(e), 1),
|
|
427
|
-
t === ce.value.length - 1 ? S("", !0) : (
|
|
426
|
+
t === ce.value.length - 1 ? S("", !0) : (R(), C("div", {
|
|
428
427
|
key: 0,
|
|
429
|
-
class:
|
|
428
|
+
class: F(["import-dialog__step-line", { "is-active": c.value === "preview" && t === 0 || c.value === "mapping" && t <= 1 || c.value === "importing" && t <= 2 }])
|
|
430
429
|
}, null, 2))
|
|
431
|
-
]))), 128))])) : S("", !0), c.value === "upload" ? (
|
|
432
|
-
w("div", An, [w("span", null, W(
|
|
433
|
-
default: J(() => [D(
|
|
434
|
-
default: J(() => [D(
|
|
430
|
+
]))), 128))])) : S("", !0), c.value === "upload" ? (R(), C(y, { key: 1 }, [
|
|
431
|
+
w("div", An, [w("span", null, W(G(u)("components.importDialog.modeLabel")), 1), D(G(He), { content: G(u)("components.importDialog.modeHelp") }, {
|
|
432
|
+
default: J(() => [D(G(Z), { class: "import-dialog__info" }, {
|
|
433
|
+
default: J(() => [D(G(it))]),
|
|
435
434
|
_: 1
|
|
436
435
|
})]),
|
|
437
436
|
_: 1
|
|
438
437
|
}, 8, ["content"])]),
|
|
439
|
-
D(
|
|
438
|
+
D(G(Me), {
|
|
440
439
|
"model-value": l.value,
|
|
441
440
|
class: "import-dialog__mode-group",
|
|
442
441
|
"onUpdate:modelValue": Ee
|
|
443
442
|
}, {
|
|
444
|
-
default: J(() => [(
|
|
443
|
+
default: J(() => [(R(!0), C(y, null, B(I.value, (e) => (R(), x(G(je), {
|
|
445
444
|
key: e.value,
|
|
446
445
|
label: e.value,
|
|
447
446
|
disabled: e.disabled
|
|
@@ -451,68 +450,68 @@ var Sn = {
|
|
|
451
450
|
}, 1032, ["label", "disabled"]))), 128))]),
|
|
452
451
|
_: 1
|
|
453
452
|
}, 8, ["model-value"]),
|
|
454
|
-
D(
|
|
453
|
+
D(G(Ue), {
|
|
455
454
|
ref_key: "uploadRef",
|
|
456
455
|
ref: s,
|
|
457
456
|
class: "import-dialog__upload",
|
|
458
457
|
drag: "",
|
|
459
458
|
"auto-upload": !1,
|
|
460
459
|
"show-file-list": !1,
|
|
461
|
-
accept:
|
|
460
|
+
accept: te.value,
|
|
462
461
|
"on-change": we
|
|
463
462
|
}, {
|
|
464
463
|
default: J(() => [w("div", jn, [
|
|
465
|
-
w("div", Mn, [D(
|
|
466
|
-
default: J(() => [D(
|
|
464
|
+
w("div", Mn, [D(G(Z), { size: 20 }, {
|
|
465
|
+
default: J(() => [D(G(st))]),
|
|
467
466
|
_: 1
|
|
468
467
|
})]),
|
|
469
|
-
w("div", Nn, [E(W(
|
|
470
|
-
w("div", Fn, W(
|
|
471
|
-
ie.value ? (
|
|
468
|
+
w("div", Nn, [E(W(G(u)("components.importDialog.uploadPlaceholder")) + " ", 1), w("span", Pn, W(G(u)("components.importDialog.selectUpload")), 1)]),
|
|
469
|
+
w("div", Fn, W(G(u)("components.importDialog.supportedTypes", { types: ne.value })), 1),
|
|
470
|
+
ie.value ? (R(), C("div", In, W(ie.value), 1)) : S("", !0)
|
|
472
471
|
])]),
|
|
473
472
|
_: 1
|
|
474
473
|
}, 8, ["accept"]),
|
|
475
474
|
w("div", Ln, [
|
|
476
|
-
D(
|
|
477
|
-
default: J(() => [D(
|
|
475
|
+
D(G(Z), { size: 14 }, {
|
|
476
|
+
default: J(() => [D(G(nt))]),
|
|
478
477
|
_: 1
|
|
479
478
|
}),
|
|
480
|
-
w("span", null, W(
|
|
479
|
+
w("span", null, W(G(u)("components.importDialog.templateText")), 1),
|
|
481
480
|
w("button", {
|
|
482
481
|
type: "button",
|
|
483
482
|
class: "import-dialog__download-button",
|
|
484
483
|
onClick: pe
|
|
485
|
-
}, W(
|
|
484
|
+
}, W(G(u)("components.importDialog.downloadTemplate")), 1)
|
|
486
485
|
]),
|
|
487
|
-
w("div", Rn, [(
|
|
486
|
+
w("div", Rn, [(R(!0), C(y, null, B(L.value, (e) => (R(), C("div", {
|
|
488
487
|
key: e,
|
|
489
488
|
class: "import-dialog__tip-item"
|
|
490
489
|
}, W(e), 1))), 128))])
|
|
491
|
-
], 64)) : c.value === "preview" ? (
|
|
492
|
-
w("div", zn, [w("div", Bn, [w("div", Vn, W(
|
|
490
|
+
], 64)) : c.value === "preview" ? (R(), C(y, { key: 2 }, [
|
|
491
|
+
w("div", zn, [w("div", Bn, [w("div", Vn, W(G(u)("components.importDialog.fileLabel")), 1), D(G(Te), {
|
|
493
492
|
"model-value": ie.value,
|
|
494
493
|
readonly: ""
|
|
495
|
-
}, null, 8, ["model-value"])]), w("div", Hn, [w("div", Un, W(
|
|
494
|
+
}, null, 8, ["model-value"])]), w("div", Hn, [w("div", Un, W(G(u)("components.importDialog.sheetLabel")), 1), D(G(Pe), {
|
|
496
495
|
modelValue: m.value,
|
|
497
496
|
"onUpdate:modelValue": t[0] ||= (e) => m.value = e,
|
|
498
497
|
class: "import-dialog__sheet-select",
|
|
499
498
|
disabled: T.value,
|
|
500
499
|
onChange: De
|
|
501
500
|
}, {
|
|
502
|
-
default: J(() => [(
|
|
501
|
+
default: J(() => [(R(!0), C(y, null, B(p.value, (e) => (R(), x(G($), {
|
|
503
502
|
key: e.value,
|
|
504
503
|
label: e.label,
|
|
505
504
|
value: e.value
|
|
506
505
|
}, null, 8, ["label", "value"]))), 128))]),
|
|
507
506
|
_: 1
|
|
508
507
|
}, 8, ["modelValue", "disabled"])])]),
|
|
509
|
-
ue((
|
|
508
|
+
ue((R(), x(G(Re), {
|
|
510
509
|
data: g.value,
|
|
511
510
|
border: "",
|
|
512
511
|
height: "352",
|
|
513
512
|
class: "import-dialog__table"
|
|
514
513
|
}, {
|
|
515
|
-
default: J(() => [(
|
|
514
|
+
default: J(() => [(R(!0), C(y, null, B(h.value, (e) => (R(), x(G(ze), {
|
|
516
515
|
key: e.prop,
|
|
517
516
|
prop: e.prop,
|
|
518
517
|
label: e.label,
|
|
@@ -527,23 +526,23 @@ var Sn = {
|
|
|
527
526
|
]))), 128))]),
|
|
528
527
|
_: 1
|
|
529
528
|
}, 8, ["data"])), [[n, T.value]]),
|
|
530
|
-
w("div", Wn, W(
|
|
531
|
-
], 64)) : c.value === "mapping" ? (
|
|
532
|
-
w("div", null, W(
|
|
529
|
+
w("div", Wn, W(U.value), 1)
|
|
530
|
+
], 64)) : c.value === "mapping" ? (R(), C(y, { key: 3 }, [w("div", Gn, [
|
|
531
|
+
w("div", null, W(G(u)("components.importDialog.mappingExcelColumn")), 1),
|
|
533
532
|
t[1] ||= w("div", null, null, -1),
|
|
534
|
-
w("div", null, W(
|
|
535
|
-
w("div", null, W(
|
|
536
|
-
]), w("div", Kn, [(
|
|
533
|
+
w("div", null, W(G(u)("components.importDialog.mappingTargetField")), 1),
|
|
534
|
+
w("div", null, W(G(u)("components.importDialog.mappingDuplicateLabel")), 1)
|
|
535
|
+
]), w("div", Kn, [(R(!0), C(y, null, B(v.value, (e) => (R(), C("div", {
|
|
537
536
|
key: e.targetField,
|
|
538
537
|
class: "import-dialog__mapping-row"
|
|
539
538
|
}, [
|
|
540
|
-
D(
|
|
539
|
+
D(G(Pe), {
|
|
541
540
|
modelValue: e.sourceColumn,
|
|
542
541
|
"onUpdate:modelValue": (t) => e.sourceColumn = t,
|
|
543
542
|
clearable: "",
|
|
544
|
-
placeholder:
|
|
543
|
+
placeholder: G(u)("common.pleaseSelect")
|
|
545
544
|
}, {
|
|
546
|
-
default: J(() => [(
|
|
545
|
+
default: J(() => [(R(!0), C(y, null, B(ae.value, (e) => (R(), x(G($), {
|
|
547
546
|
key: e.value,
|
|
548
547
|
label: e.label,
|
|
549
548
|
value: e.value
|
|
@@ -554,12 +553,12 @@ var Sn = {
|
|
|
554
553
|
"onUpdate:modelValue",
|
|
555
554
|
"placeholder"
|
|
556
555
|
]),
|
|
557
|
-
w("div", qn, [D(
|
|
558
|
-
default: J(() => [D(
|
|
556
|
+
w("div", qn, [D(G(Z), { size: 18 }, {
|
|
557
|
+
default: J(() => [D(G(Ye))]),
|
|
559
558
|
_: 1
|
|
560
559
|
})]),
|
|
561
|
-
w("div", { class:
|
|
562
|
-
w("div", Jn, [D(
|
|
560
|
+
w("div", { class: F(["import-dialog__mapping-target", { "is-required": e.required }]) }, W(e.targetLabel), 3),
|
|
561
|
+
w("div", Jn, [D(G(me), {
|
|
563
562
|
modelValue: e.duplicateCheck,
|
|
564
563
|
"onUpdate:modelValue": (t) => e.duplicateCheck = t,
|
|
565
564
|
disabled: !e.allowDuplicateCheck
|
|
@@ -568,39 +567,39 @@ var Sn = {
|
|
|
568
567
|
"onUpdate:modelValue",
|
|
569
568
|
"disabled"
|
|
570
569
|
])])
|
|
571
|
-
]))), 128))])], 64)) :
|
|
572
|
-
w("div", { class:
|
|
570
|
+
]))), 128))])], 64)) : V.value ? (R(), C(y, { key: 4 }, [
|
|
571
|
+
w("div", { class: F(["import-dialog__result-illustration", {
|
|
573
572
|
"is-success": M.value?.success,
|
|
574
573
|
"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 ? (
|
|
576
|
-
default: J(() => [D(
|
|
574
|
+
}]) }, [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 ? (R(), x(G(Z), { key: 0 }, {
|
|
575
|
+
default: J(() => [D(G(pt))]),
|
|
577
576
|
_: 1
|
|
578
|
-
})) : (
|
|
579
|
-
default: J(() => [D(
|
|
577
|
+
})) : (R(), x(G(Z), { key: 1 }, {
|
|
578
|
+
default: J(() => [D(G(mt))]),
|
|
580
579
|
_: 1
|
|
581
580
|
}))])], 2),
|
|
582
|
-
w("div", Xn, W(
|
|
581
|
+
w("div", Xn, W(K.value), 1),
|
|
583
582
|
w("div", Zn, W(se.value), 1),
|
|
584
|
-
M.value?.detail ? (
|
|
585
|
-
], 64)) : c.value === "importing" ? (
|
|
586
|
-
w("div", $n, [D(
|
|
583
|
+
M.value?.detail ? (R(), C("div", Qn, W(M.value.detail), 1)) : S("", !0)
|
|
584
|
+
], 64)) : c.value === "importing" ? (R(), C(y, { key: 5 }, [
|
|
585
|
+
w("div", $n, [D(G(Ae), {
|
|
587
586
|
percentage: A.value,
|
|
588
587
|
"stroke-width": 10,
|
|
589
588
|
"show-text": !1,
|
|
590
589
|
color: "var(--color-success)"
|
|
591
|
-
}, null, 8, ["percentage"]), w("div", er, [D(
|
|
592
|
-
default: J(() => [D(
|
|
590
|
+
}, null, 8, ["percentage"]), w("div", er, [D(G(Z), { color: "var(--color-success)" }, {
|
|
591
|
+
default: J(() => [D(G(pt))]),
|
|
593
592
|
_: 1
|
|
594
593
|
})])]),
|
|
595
|
-
w("div", tr, W(
|
|
596
|
-
w("div", nr, W(
|
|
597
|
-
w("div", rr, W(
|
|
594
|
+
w("div", tr, W(G(u)("components.importDialog.importingTitle")), 1),
|
|
595
|
+
w("div", nr, W(oe.value), 1),
|
|
596
|
+
w("div", rr, W(G(u)("components.importDialog.importingHint")), 1)
|
|
598
597
|
], 64)) : S("", !0)])]),
|
|
599
598
|
_: 1
|
|
600
599
|
}, 8, ["title", "close-on-press-escape"]);
|
|
601
600
|
};
|
|
602
601
|
}
|
|
603
|
-
}), [["__scopeId", "data-v-
|
|
602
|
+
}), [["__scopeId", "data-v-1f28ec73"]]), or = { class: "column-settings-panel" }, sr = { class: "column-settings-panel__header" }, cr = { class: "column-settings-panel__title" }, lr = { class: "column-settings-panel__list" }, ur = { class: "column-settings-panel__head" }, dr = { class: "column-settings-panel__drag-handle" }, fr = { class: "column-settings-panel__label" }, pr = { class: "column-settings-panel__footer" }, mr = { class: "column-settings-panel__count" }, hr = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
604
603
|
__name: "ColumnSettingsPanel",
|
|
605
604
|
props: {
|
|
606
605
|
settings: {},
|
|
@@ -616,7 +615,7 @@ var Sn = {
|
|
|
616
615
|
"reset"
|
|
617
616
|
],
|
|
618
617
|
setup(e, { emit: t }) {
|
|
619
|
-
let n = e, r = t, i =
|
|
618
|
+
let n = e, r = t, i = z([...n.settings]);
|
|
620
619
|
q(() => n.settings, (e) => {
|
|
621
620
|
i.value = e.map((e) => ({ ...e }));
|
|
622
621
|
}, { deep: !0 });
|
|
@@ -633,25 +632,25 @@ var Sn = {
|
|
|
633
632
|
function l(e) {
|
|
634
633
|
return n.fixedItems.find((t) => t.key === e)?.fixed ?? !1;
|
|
635
634
|
}
|
|
636
|
-
return (e, t) => (
|
|
637
|
-
w("div", sr, [w("span", cr, W(
|
|
635
|
+
return (e, t) => (R(), C("div", or, [
|
|
636
|
+
w("div", sr, [w("span", cr, W(G(u)("components.tableEntity.columnSettings")), 1), D(G(Y), {
|
|
638
637
|
type: "primary",
|
|
639
638
|
link: "",
|
|
640
639
|
size: "small",
|
|
641
640
|
onClick: c
|
|
642
641
|
}, {
|
|
643
|
-
default: J(() => [E(W(
|
|
642
|
+
default: J(() => [E(W(G(u)("components.tableEntity.restoreDefault")), 1)]),
|
|
644
643
|
_: 1
|
|
645
644
|
})]),
|
|
646
645
|
w("div", lr, [w("div", ur, [
|
|
647
646
|
t[1] ||= w("span", null, null, -1),
|
|
648
|
-
w("span", null, W(
|
|
649
|
-
w("span", null, W(
|
|
650
|
-
w("span", null, W(
|
|
651
|
-
w("span", null, W(
|
|
652
|
-
w("span", null, W(
|
|
653
|
-
w("span", null, W(
|
|
654
|
-
]), D(
|
|
647
|
+
w("span", null, W(G(u)("components.tableEntity.display")), 1),
|
|
648
|
+
w("span", null, W(G(u)("components.tableEntity.columnName")), 1),
|
|
649
|
+
w("span", null, W(G(u)("components.tableEntity.width")), 1),
|
|
650
|
+
w("span", null, W(G(u)("components.tableEntity.headerAlign")), 1),
|
|
651
|
+
w("span", null, W(G(u)("components.tableEntity.contentAlign")), 1),
|
|
652
|
+
w("span", null, W(G(u)("components.tableEntity.fixedColumn")), 1)
|
|
653
|
+
]), D(G(vt), {
|
|
655
654
|
modelValue: i.value,
|
|
656
655
|
"onUpdate:modelValue": t[0] ||= (e) => i.value = e,
|
|
657
656
|
animation: 200,
|
|
@@ -659,22 +658,22 @@ var Sn = {
|
|
|
659
658
|
"ghost-class": "column-settings-panel__ghost",
|
|
660
659
|
onUpdate: o
|
|
661
660
|
}, {
|
|
662
|
-
default: J(() => [(
|
|
661
|
+
default: J(() => [(R(!0), C(y, null, B(i.value, (e) => (R(), C("div", {
|
|
663
662
|
key: e.key,
|
|
664
|
-
class:
|
|
663
|
+
class: F(["column-settings-panel__item", { "column-settings-panel__item--hidden": !e.visible }])
|
|
665
664
|
}, [
|
|
666
|
-
w("span", dr, [D(
|
|
667
|
-
default: J(() => [D(
|
|
665
|
+
w("span", dr, [D(G(Z), null, {
|
|
666
|
+
default: J(() => [D(G(ot))]),
|
|
668
667
|
_: 1
|
|
669
668
|
})]),
|
|
670
|
-
D(
|
|
669
|
+
D(G(Ie), {
|
|
671
670
|
"model-value": e.visible,
|
|
672
671
|
size: "small",
|
|
673
672
|
class: "column-settings-panel__checkbox",
|
|
674
673
|
onChange: (t) => s(e.key)
|
|
675
674
|
}, null, 8, ["model-value", "onChange"]),
|
|
676
675
|
w("span", fr, W(e.title), 1),
|
|
677
|
-
D(
|
|
676
|
+
D(G(Ee), {
|
|
678
677
|
"model-value": e.column.width ?? 120,
|
|
679
678
|
min: 50,
|
|
680
679
|
controls: !1,
|
|
@@ -682,67 +681,67 @@ var Sn = {
|
|
|
682
681
|
class: "column-settings-panel__width",
|
|
683
682
|
onChange: (t) => r("setWidth", e.key, Number(t) || 120)
|
|
684
683
|
}, null, 8, ["model-value", "onChange"]),
|
|
685
|
-
D(
|
|
684
|
+
D(G(Pe), {
|
|
686
685
|
"model-value": e.headerAlign,
|
|
687
686
|
size: "small",
|
|
688
687
|
class: "column-settings-panel__select",
|
|
689
688
|
onChange: (t) => r("setHeaderAlign", e.key, t)
|
|
690
689
|
}, {
|
|
691
690
|
default: J(() => [
|
|
692
|
-
D(
|
|
693
|
-
label:
|
|
691
|
+
D(G($), {
|
|
692
|
+
label: G(u)("components.tableEntity.left"),
|
|
694
693
|
value: "left"
|
|
695
694
|
}, null, 8, ["label"]),
|
|
696
|
-
D(
|
|
697
|
-
label:
|
|
695
|
+
D(G($), {
|
|
696
|
+
label: G(u)("components.tableEntity.center"),
|
|
698
697
|
value: "center"
|
|
699
698
|
}, null, 8, ["label"]),
|
|
700
|
-
D(
|
|
701
|
-
label:
|
|
699
|
+
D(G($), {
|
|
700
|
+
label: G(u)("components.tableEntity.right"),
|
|
702
701
|
value: "right"
|
|
703
702
|
}, null, 8, ["label"])
|
|
704
703
|
]),
|
|
705
704
|
_: 1
|
|
706
705
|
}, 8, ["model-value", "onChange"]),
|
|
707
|
-
D(
|
|
706
|
+
D(G(Pe), {
|
|
708
707
|
"model-value": e.contentAlign,
|
|
709
708
|
size: "small",
|
|
710
709
|
class: "column-settings-panel__select",
|
|
711
710
|
onChange: (t) => r("setContentAlign", e.key, t)
|
|
712
711
|
}, {
|
|
713
712
|
default: J(() => [
|
|
714
|
-
D(
|
|
715
|
-
label:
|
|
713
|
+
D(G($), {
|
|
714
|
+
label: G(u)("components.tableEntity.left"),
|
|
716
715
|
value: "left"
|
|
717
716
|
}, null, 8, ["label"]),
|
|
718
|
-
D(
|
|
719
|
-
label:
|
|
717
|
+
D(G($), {
|
|
718
|
+
label: G(u)("components.tableEntity.center"),
|
|
720
719
|
value: "center"
|
|
721
720
|
}, null, 8, ["label"]),
|
|
722
|
-
D(
|
|
723
|
-
label:
|
|
721
|
+
D(G($), {
|
|
722
|
+
label: G(u)("components.tableEntity.right"),
|
|
724
723
|
value: "right"
|
|
725
724
|
}, null, 8, ["label"])
|
|
726
725
|
]),
|
|
727
726
|
_: 1
|
|
728
727
|
}, 8, ["model-value", "onChange"]),
|
|
729
|
-
D(
|
|
728
|
+
D(G(Pe), {
|
|
730
729
|
"model-value": l(e.key),
|
|
731
730
|
size: "small",
|
|
732
731
|
class: "column-settings-panel__select",
|
|
733
732
|
onChange: (t) => r("setFixed", e.key, t ?? !1)
|
|
734
733
|
}, {
|
|
735
734
|
default: J(() => [
|
|
736
|
-
D(
|
|
737
|
-
label:
|
|
735
|
+
D(G($), {
|
|
736
|
+
label: G(u)("components.tableEntity.unfixed"),
|
|
738
737
|
value: !1
|
|
739
738
|
}, null, 8, ["label"]),
|
|
740
|
-
D(
|
|
741
|
-
label:
|
|
739
|
+
D(G($), {
|
|
740
|
+
label: G(u)("components.tableEntity.leftFixed"),
|
|
742
741
|
value: "left"
|
|
743
742
|
}, null, 8, ["label"]),
|
|
744
|
-
D(
|
|
745
|
-
label:
|
|
743
|
+
D(G($), {
|
|
744
|
+
label: G(u)("components.tableEntity.rightFixed"),
|
|
746
745
|
value: "right"
|
|
747
746
|
}, null, 8, ["label"])
|
|
748
747
|
]),
|
|
@@ -751,16 +750,16 @@ var Sn = {
|
|
|
751
750
|
], 2))), 128))]),
|
|
752
751
|
_: 1
|
|
753
752
|
}, 8, ["modelValue"])]),
|
|
754
|
-
w("div", pr, [w("span", mr, W(
|
|
753
|
+
w("div", pr, [w("span", mr, W(G(u)("components.tableEntity.visibleCount", {
|
|
755
754
|
visible: a.value,
|
|
756
755
|
total: i.value.length
|
|
757
756
|
})), 1)])
|
|
758
757
|
]));
|
|
759
758
|
}
|
|
760
|
-
}), [["__scopeId", "data-v-
|
|
759
|
+
}), [["__scopeId", "data-v-268ac90c"]]);
|
|
761
760
|
// src/components/table-entity/composables/use-column-fixed.ts
|
|
762
761
|
function gr(e) {
|
|
763
|
-
let t =
|
|
762
|
+
let t = z({});
|
|
764
763
|
function n(e) {
|
|
765
764
|
return e.fixed === !0 || e.fixed === "left" ? "left" : e.fixed === "right" && "right";
|
|
766
765
|
}
|
|
@@ -831,7 +830,7 @@ function _r(e) {
|
|
|
831
830
|
}
|
|
832
831
|
// src/components/table-entity/composables/use-column-resize.ts
|
|
833
832
|
function vr(e = 50) {
|
|
834
|
-
let t =
|
|
833
|
+
let t = ne({}), n = ne({
|
|
835
834
|
active: !1,
|
|
836
835
|
colKey: null,
|
|
837
836
|
startX: 0,
|
|
@@ -872,7 +871,7 @@ function vr(e = 50) {
|
|
|
872
871
|
display: n.active ? "block" : "none",
|
|
873
872
|
left: `${n.currentX}px`
|
|
874
873
|
}));
|
|
875
|
-
return
|
|
874
|
+
return te(() => {
|
|
876
875
|
n.active && (n.active = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "");
|
|
877
876
|
}), {
|
|
878
877
|
widthOverrides: t,
|
|
@@ -884,7 +883,7 @@ function vr(e = 50) {
|
|
|
884
883
|
}
|
|
885
884
|
// src/components/table-entity/composables/use-column-settings.ts
|
|
886
885
|
function yr(e) {
|
|
887
|
-
let t =
|
|
886
|
+
let t = z([]), n = z(/* @__PURE__ */ new Set()), r = z({}), i = z({}), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = {};
|
|
888
887
|
function c(e) {
|
|
889
888
|
return e.filter((e) => !!e).filter((e) => !!xr(e)).map((e) => xr(e));
|
|
890
889
|
}
|
|
@@ -1019,7 +1018,7 @@ function Tr(e, t, n) {
|
|
|
1019
1018
|
return i === void 0 ? e : (r.splice(n, 0, i), r);
|
|
1020
1019
|
}
|
|
1021
1020
|
function Er(e) {
|
|
1022
|
-
let t =
|
|
1021
|
+
let t = z(null), n = z(null), r = 0, i = 0, a = !1, o = "", s = "";
|
|
1023
1022
|
function c(t, n, r) {
|
|
1024
1023
|
let i = e.getRows();
|
|
1025
1024
|
if (t < 0 || t >= i.length) return null;
|
|
@@ -1106,7 +1105,7 @@ function Er(e) {
|
|
|
1106
1105
|
let p = c[r], m = c[i];
|
|
1107
1106
|
if (!p || !m) return;
|
|
1108
1107
|
let h = e.moveRows(p, m, r, i);
|
|
1109
|
-
h && (e.onSort(h), await
|
|
1108
|
+
h && (e.onSort(h), await ee(), d(s, l));
|
|
1110
1109
|
}
|
|
1111
1110
|
function h(c) {
|
|
1112
1111
|
if (!e.isEnabled() || c.button !== 0) return;
|
|
@@ -1119,7 +1118,7 @@ function Er(e) {
|
|
|
1119
1118
|
let h = Sr(f, e.getRowHeight()), g = h == null ? void 0 : e.getRows()[h];
|
|
1120
1119
|
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
1120
|
}
|
|
1122
|
-
return
|
|
1121
|
+
return te(f), {
|
|
1123
1122
|
draggingIndex: t,
|
|
1124
1123
|
onPointerDown: h,
|
|
1125
1124
|
overIndex: n
|
|
@@ -1128,7 +1127,7 @@ function Er(e) {
|
|
|
1128
1127
|
// src/components/table-entity/composables/use-table-selection.ts
|
|
1129
1128
|
var Dr = 40;
|
|
1130
1129
|
function Or(e, t, n, r = n) {
|
|
1131
|
-
let i =
|
|
1130
|
+
let i = z(/* @__PURE__ */ new Set()), a = z(/* @__PURE__ */ new Map()), o = z(-1), s = () => e.rowKey ?? "id";
|
|
1132
1131
|
q(() => e.selectedKeys, (e) => {
|
|
1133
1132
|
i.value = new Set(e ?? []);
|
|
1134
1133
|
}, { immediate: !0 }), q(() => r.value, (e) => {
|
|
@@ -1228,14 +1227,14 @@ var kr = [
|
|
|
1228
1227
|
"all"
|
|
1229
1228
|
];
|
|
1230
1229
|
function Ar() {
|
|
1231
|
-
return
|
|
1230
|
+
return a();
|
|
1232
1231
|
}
|
|
1233
1232
|
// src/composables/use-dict-data.ts
|
|
1234
1233
|
function jr(e = !0) {
|
|
1235
1234
|
return bt({
|
|
1236
1235
|
queryKey: kr,
|
|
1237
1236
|
queryFn: Ar,
|
|
1238
|
-
enabled: b(() =>
|
|
1237
|
+
enabled: b(() => oe(e)),
|
|
1239
1238
|
staleTime: 18e5,
|
|
1240
1239
|
gcTime: 36e5,
|
|
1241
1240
|
refetchOnMount: !1,
|
|
@@ -1258,8 +1257,8 @@ function Pr(e, t) {
|
|
|
1258
1257
|
return e.find((e) => String(e.code ?? e.dictValue ?? "") === n) ?? null;
|
|
1259
1258
|
}
|
|
1260
1259
|
function Fr(e) {
|
|
1261
|
-
let t = jr(() => !!
|
|
1262
|
-
let n =
|
|
1260
|
+
let t = jr(() => !!oe(e)), n = b(() => {
|
|
1261
|
+
let n = oe(e);
|
|
1263
1262
|
return n ? t.data.value?.[n] ?? [] : [];
|
|
1264
1263
|
}), r = b(() => Nr(n.value));
|
|
1265
1264
|
return {
|
|
@@ -1296,9 +1295,9 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1296
1295
|
let e = t.color ?? i.value?.color ?? i.value?.cssClass;
|
|
1297
1296
|
return typeof e == "string" && e ? e : void 0;
|
|
1298
1297
|
}), 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:
|
|
1298
|
+
return (e, t) => (R(), C("span", {
|
|
1299
|
+
class: F(["dict-tag", s.value]),
|
|
1300
|
+
style: L(c.value)
|
|
1302
1301
|
}, W(a.value), 7));
|
|
1303
1302
|
}
|
|
1304
1303
|
}), [["__scopeId", "data-v-0d76da83"]]), Lr = { class: "file-cell flex items-center" }, Rr = {
|
|
@@ -1319,10 +1318,10 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1319
1318
|
} }, Hr = { style: { color: "#909399" } }, Ur = {
|
|
1320
1319
|
key: 0,
|
|
1321
1320
|
style: { color: "#909399" }
|
|
1322
|
-
}, Wr = ["onClick"],
|
|
1321
|
+
}, Wr = { style: { color: "#909399" } }, Gr = ["onClick"], Kr = { class: "file-icon-wrapper" }, qr = ["src"], Jr = {
|
|
1323
1322
|
key: 1,
|
|
1324
1323
|
class: "file-cell__extra"
|
|
1325
|
-
},
|
|
1324
|
+
}, Yr = { key: 1 }, Xr = /*@__PURE__*/ k({
|
|
1326
1325
|
__name: "file-cell",
|
|
1327
1326
|
props: {
|
|
1328
1327
|
attachments: { default: null },
|
|
@@ -1355,9 +1354,9 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1355
1354
|
label: "Word"
|
|
1356
1355
|
} : {
|
|
1357
1356
|
kind: "other",
|
|
1358
|
-
label: "
|
|
1357
|
+
label: u("components.tableEntity.fileKindOther")
|
|
1359
1358
|
};
|
|
1360
|
-
},
|
|
1359
|
+
}, d = b(() => t.attachments ? Array.isArray(t.attachments) ? t.attachments : [t.attachments] : []), f = b(() => d.value.filter((e) => e && c(e)).map((e) => a(e.fileUrl || e.fileOriginName || "")).filter((e) => !!e)), m = b(() => d.value.filter((e) => e && !c(e) && (e.fileUrl || e.fileOriginName)).map((e) => {
|
|
1361
1360
|
let t = e.fileUrl || e.fileOriginName || "", n = a(t), r = e.fileOriginName || o(t), i = h(r, e.fileSuffix), { kind: c, label: u } = l(r, s(e.fileSuffix));
|
|
1362
1361
|
return {
|
|
1363
1362
|
fileUrl: n,
|
|
@@ -1369,18 +1368,18 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1369
1368
|
kind: c,
|
|
1370
1369
|
kindLabel: u
|
|
1371
1370
|
};
|
|
1372
|
-
})),
|
|
1371
|
+
})), g = b(() => m.value.slice(0, t.maxPreviewCount)), _ = b(() => Math.max(0, m.value.length - g.value.length)), v = (e) => {
|
|
1373
1372
|
e.fileUrl && window.open(e.fileUrl, "_blank");
|
|
1374
|
-
},
|
|
1375
|
-
return (t, r) => (
|
|
1376
|
-
|
|
1373
|
+
}, T = (e) => !e || e <= 0 ? "" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(2)} MB`;
|
|
1374
|
+
return (t, r) => (R(), C("div", Lr, [f.value.length > 0 || g.value.length > 0 ? (R(), C("div", Rr, [
|
|
1375
|
+
f.value.length > 0 ? (R(), x(n, {
|
|
1377
1376
|
key: 0,
|
|
1378
|
-
urls:
|
|
1377
|
+
urls: f.value,
|
|
1379
1378
|
"max-preview-count": e.maxPreviewCount,
|
|
1380
1379
|
size: 26,
|
|
1381
1380
|
"image-list-props": {}
|
|
1382
1381
|
}, null, 8, ["urls", "max-preview-count"])) : S("", !0),
|
|
1383
|
-
(
|
|
1382
|
+
(R(!0), C(y, null, B(g.value, (e) => (R(), x(G(He), {
|
|
1384
1383
|
key: e.fileUrl,
|
|
1385
1384
|
placement: "top",
|
|
1386
1385
|
effect: "light",
|
|
@@ -1388,7 +1387,7 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1388
1387
|
teleported: !0,
|
|
1389
1388
|
"z-index": 3e3
|
|
1390
1389
|
}, {
|
|
1391
|
-
content: J(() => [e.kind === "pdf" ? (
|
|
1390
|
+
content: J(() => [e.kind === "pdf" ? (R(), C("iframe", {
|
|
1392
1391
|
key: 0,
|
|
1393
1392
|
src: e.fileUrl,
|
|
1394
1393
|
style: {
|
|
@@ -1397,30 +1396,30 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1397
1396
|
height: "500px",
|
|
1398
1397
|
border: "none"
|
|
1399
1398
|
}
|
|
1400
|
-
}, null, 8, zr)) : (
|
|
1399
|
+
}, null, 8, zr)) : (R(), C("div", Br, [
|
|
1401
1400
|
w("div", Vr, W(e.fileOriginName), 1),
|
|
1402
|
-
w("div", Hr, "
|
|
1403
|
-
|
|
1404
|
-
|
|
1401
|
+
w("div", Hr, W(G(u)("components.tableEntity.fileType")) + ":" + W(e.kindLabel), 1),
|
|
1402
|
+
T(e.size) ? (R(), C("div", Ur, W(G(u)("components.tableEntity.fileSize")) + ":" + W(T(e.size)), 1)) : S("", !0),
|
|
1403
|
+
w("div", Wr, W(G(u)("components.tableEntity.fileOpenHint")), 1)
|
|
1405
1404
|
]))]),
|
|
1406
1405
|
default: J(() => [w("div", {
|
|
1407
1406
|
class: "file-cell__item",
|
|
1408
|
-
onClick: fe((t) =>
|
|
1409
|
-
}, [w("div",
|
|
1407
|
+
onClick: fe((t) => v(e), ["stop"])
|
|
1408
|
+
}, [w("div", Kr, [e.iconSvg ? (R(), C("img", {
|
|
1410
1409
|
key: 0,
|
|
1411
1410
|
src: e.iconSvg,
|
|
1412
1411
|
alt: "",
|
|
1413
1412
|
class: "file-icon"
|
|
1414
|
-
}, null, 8,
|
|
1413
|
+
}, null, 8, qr)) : S("", !0)])], 8, Gr)]),
|
|
1415
1414
|
_: 2
|
|
1416
1415
|
}, 1024))), 128)),
|
|
1417
|
-
|
|
1418
|
-
])) : (
|
|
1416
|
+
_.value > 0 ? (R(), C("span", Jr, " +" + W(_.value), 1)) : S("", !0)
|
|
1417
|
+
])) : (R(), C("span", Yr, "-"))]));
|
|
1419
1418
|
}
|
|
1420
|
-
}),
|
|
1419
|
+
}), Zr = /* @__PURE__ */ e({ default: () => Qr }), Qr = /*#__PURE__*/ f(Xr, [["__scopeId", "data-v-16821a65"]]), $r = {
|
|
1421
1420
|
key: 0,
|
|
1422
1421
|
class: "list-expand-cell"
|
|
1423
|
-
},
|
|
1422
|
+
}, ei = ["innerHTML"], ti = { key: 1 }, ni = { key: 1 }, ri = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
1424
1423
|
__name: "list-expand-cell",
|
|
1425
1424
|
props: {
|
|
1426
1425
|
expanded: {
|
|
@@ -1437,30 +1436,30 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1437
1436
|
},
|
|
1438
1437
|
emits: ["toggle"],
|
|
1439
1438
|
setup(e, { emit: t }) {
|
|
1440
|
-
let n = e, r = t, i = b(() => Math.max(1, n.max)), a = b(() => n.items.length > i.value), o = b(() => n.expanded || !a.value ? n.items : n.items.slice(0, i.value)), s = b(() => n.unit ||
|
|
1439
|
+
let n = e, r = t, i = b(() => Math.max(1, n.max)), a = b(() => n.items.length > i.value), o = b(() => n.expanded || !a.value ? n.items : n.items.slice(0, i.value)), s = b(() => n.unit || u("components.tableEntity.itemUnit"));
|
|
1441
1440
|
function c(e) {
|
|
1442
1441
|
e.stopPropagation(), r("toggle");
|
|
1443
1442
|
}
|
|
1444
|
-
return (t, n) => e.items.length > 0 ? (
|
|
1443
|
+
return (t, n) => e.items.length > 0 ? (R(), C("div", $r, [(R(!0), C(y, null, B(o.value, (t, n) => (R(), C("div", {
|
|
1445
1444
|
key: `${n}-${t}`,
|
|
1446
1445
|
class: "list-expand-cell__item"
|
|
1447
|
-
}, [w("span", null, W(n + 1) + ".", 1), e.html ? (
|
|
1446
|
+
}, [w("span", null, W(n + 1) + ".", 1), e.html ? (R(), C("span", {
|
|
1448
1447
|
key: 0,
|
|
1449
1448
|
innerHTML: t
|
|
1450
|
-
}, null, 8,
|
|
1449
|
+
}, null, 8, ei)) : (R(), C("span", ti, W(t), 1))]))), 128)), a.value ? (R(), C("button", {
|
|
1451
1450
|
key: 0,
|
|
1452
1451
|
class: "list-expand-cell__toggle",
|
|
1453
1452
|
type: "button",
|
|
1454
1453
|
onClick: c
|
|
1455
|
-
}, [w("span", null, W(e.expanded ?
|
|
1454
|
+
}, [w("span", null, W(e.expanded ? G(u)("components.tableEntity.collapseItems") : G(u)("components.tableEntity.viewAllItems", {
|
|
1456
1455
|
count: e.items.length,
|
|
1457
1456
|
unit: s.value
|
|
1458
|
-
})), 1), D(
|
|
1459
|
-
default: J(() => [e.expanded ? (
|
|
1457
|
+
})), 1), D(G(Z), { class: "list-expand-cell__icon" }, {
|
|
1458
|
+
default: J(() => [e.expanded ? (R(), x(G(Xe), { key: 0 })) : (R(), x(G(Je), { key: 1 }))]),
|
|
1460
1459
|
_: 1
|
|
1461
|
-
})])) : S("", !0)])) : (
|
|
1460
|
+
})])) : S("", !0)])) : (R(), C("span", ni, "-"));
|
|
1462
1461
|
}
|
|
1463
|
-
}), [["__scopeId", "data-v-
|
|
1462
|
+
}), [["__scopeId", "data-v-b95b0844"]]), ii = { class: "price-cell" }, ai = /* @__PURE__ */ k({
|
|
1464
1463
|
__name: "price-cell",
|
|
1465
1464
|
props: {
|
|
1466
1465
|
price: { default: "" },
|
|
@@ -1475,53 +1474,53 @@ var Ir = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
|
1475
1474
|
let n = String(e ?? "").replace(/[^0-9.-]/g, ""), r = parseFloat(n), i = isNaN(r) ? "0.00" : r.toFixed(t.toFixed);
|
|
1476
1475
|
return `${t.unit}${i}`;
|
|
1477
1476
|
};
|
|
1478
|
-
return (r, i) => (
|
|
1477
|
+
return (r, i) => (R(), C("div", ii, [w("span", {
|
|
1479
1478
|
class: "text-[red]",
|
|
1480
|
-
style:
|
|
1481
|
-
}, W(n(e.price)), 5), e.oldPrice ? (
|
|
1479
|
+
style: L(t.style)
|
|
1480
|
+
}, W(n(e.price)), 5), e.oldPrice ? (R(), C("span", {
|
|
1482
1481
|
key: 0,
|
|
1483
1482
|
class: "ml-1 line-through",
|
|
1484
|
-
style:
|
|
1483
|
+
style: L(t.oldPriceStyle)
|
|
1485
1484
|
}, W(n(e.oldPrice)), 5)) : S("", !0)]));
|
|
1486
1485
|
}
|
|
1487
1486
|
});
|
|
1488
1487
|
// src/components/table-entity/utils/column-utils.ts
|
|
1489
|
-
function
|
|
1488
|
+
function oi(e) {
|
|
1490
1489
|
return `${e}Col`;
|
|
1491
1490
|
}
|
|
1492
|
-
var
|
|
1491
|
+
var si = [
|
|
1493
1492
|
"create_time",
|
|
1494
1493
|
"createTime",
|
|
1495
1494
|
"created_at",
|
|
1496
1495
|
"createdAt",
|
|
1497
1496
|
"created_time"
|
|
1498
|
-
],
|
|
1497
|
+
], ci = [
|
|
1499
1498
|
"update_time",
|
|
1500
1499
|
"updateTime",
|
|
1501
1500
|
"updated_at",
|
|
1502
1501
|
"updatedAt",
|
|
1503
1502
|
"updated_time"
|
|
1504
1503
|
];
|
|
1505
|
-
function
|
|
1504
|
+
function li(e) {
|
|
1506
1505
|
return e == null || e === "";
|
|
1507
1506
|
}
|
|
1508
|
-
function
|
|
1509
|
-
return
|
|
1507
|
+
function ui(e) {
|
|
1508
|
+
return si.includes(e) ? si : ci.includes(e) ? ci : [];
|
|
1510
1509
|
}
|
|
1511
|
-
function
|
|
1510
|
+
function di(e, t, n) {
|
|
1512
1511
|
let r = n === void 0 ? e?.[t] : n;
|
|
1513
|
-
if (!
|
|
1514
|
-
for (let n of
|
|
1512
|
+
if (!li(r) || !e) return r;
|
|
1513
|
+
for (let n of ui(t)) {
|
|
1515
1514
|
if (n === t) continue;
|
|
1516
1515
|
let r = e[n];
|
|
1517
|
-
if (!
|
|
1516
|
+
if (!li(r)) return r;
|
|
1518
1517
|
}
|
|
1519
1518
|
return r;
|
|
1520
1519
|
}
|
|
1521
|
-
function
|
|
1522
|
-
return
|
|
1520
|
+
function fi(e, t) {
|
|
1521
|
+
return li(e) ? "--" : t === "datetime" ? yn(e) : t === "date" ? vn(e) : pi(e);
|
|
1523
1522
|
}
|
|
1524
|
-
function
|
|
1523
|
+
function pi(e) {
|
|
1525
1524
|
if (e == null || e === "") return "--";
|
|
1526
1525
|
if (typeof e == "object") try {
|
|
1527
1526
|
return JSON.stringify(e);
|
|
@@ -1531,13 +1530,13 @@ function fi(e) {
|
|
|
1531
1530
|
return String(e);
|
|
1532
1531
|
}
|
|
1533
1532
|
// src/components/table-entity/utils/list-expand.ts
|
|
1534
|
-
function
|
|
1533
|
+
function mi(e) {
|
|
1535
1534
|
return String(e.key ?? e.dataKey ?? e.dataIndex ?? "");
|
|
1536
1535
|
}
|
|
1537
|
-
function
|
|
1536
|
+
function hi(e, t) {
|
|
1538
1537
|
return `${String(e)}::${t}`;
|
|
1539
1538
|
}
|
|
1540
|
-
function
|
|
1539
|
+
function gi(e, t = "name") {
|
|
1541
1540
|
return (Array.isArray(e) ? e : typeof e == "string" ? e.split(/\r?\n/).map((e) => e.trim()).filter(Boolean) : e == null || e === "" ? [] : [e]).map((e) => {
|
|
1542
1541
|
if (e == null || e === "") return "";
|
|
1543
1542
|
if (typeof e != "object") return String(e);
|
|
@@ -1546,50 +1545,62 @@ function hi(e, t = "name") {
|
|
|
1546
1545
|
}).filter(Boolean);
|
|
1547
1546
|
}
|
|
1548
1547
|
// src/components/table-entity/utils/column-slots.ts
|
|
1549
|
-
var
|
|
1550
|
-
function
|
|
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) =>
|
|
1548
|
+
var _i = O(() => Promise.resolve().then(() => Zr)), vi = O(() => import("./picture-cell-C6BLbwEb.js").then((e) => e.n)), yi = O(() => import("./avatar-cell-B0Pvug8d.js")), { resolveImageUrl: bi } = p();
|
|
1549
|
+
function xi(e) {
|
|
1550
|
+
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) => bi(e)).filter(Boolean);
|
|
1551
|
+
}
|
|
1552
|
+
var Si = (e) => Array.isArray(e) ? e.map((e) => ({ fileUrl: e })) : { fileUrl: e };
|
|
1553
|
+
function Ci(e, t, n, r) {
|
|
1554
|
+
let i = e.cellProps ?? e.props ?? {};
|
|
1555
|
+
return typeof i == "function" ? i({
|
|
1556
|
+
row: t,
|
|
1557
|
+
value: n,
|
|
1558
|
+
rowIndex: r,
|
|
1559
|
+
column: e
|
|
1560
|
+
}) ?? {} : i;
|
|
1552
1561
|
}
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
let i = e.maxPreviewCount ?? 3, a = e.cellProps ?? e.props ?? {};
|
|
1562
|
+
function wi(e, t, n, r, i) {
|
|
1563
|
+
let a = e.maxPreviewCount ?? 3, o = Ci(e, t, n, r);
|
|
1556
1564
|
switch (e.type) {
|
|
1557
|
-
case "avatar": return j(
|
|
1558
|
-
row:
|
|
1565
|
+
case "avatar": return j(yi, {
|
|
1566
|
+
row: {
|
|
1567
|
+
...t,
|
|
1568
|
+
...o
|
|
1569
|
+
},
|
|
1559
1570
|
value: n
|
|
1560
1571
|
});
|
|
1561
|
-
case "file": return j(
|
|
1562
|
-
...
|
|
1563
|
-
attachments:
|
|
1564
|
-
maxPreviewCount:
|
|
1572
|
+
case "file": return j(_i, {
|
|
1573
|
+
...o,
|
|
1574
|
+
attachments: Si(n),
|
|
1575
|
+
maxPreviewCount: a
|
|
1565
1576
|
});
|
|
1566
|
-
case "picture": return j(
|
|
1567
|
-
...
|
|
1568
|
-
urls:
|
|
1569
|
-
maxPreviewCount:
|
|
1577
|
+
case "picture": return j(vi, {
|
|
1578
|
+
...o,
|
|
1579
|
+
urls: xi(n),
|
|
1580
|
+
maxPreviewCount: a
|
|
1570
1581
|
});
|
|
1571
|
-
case "price": return j(
|
|
1572
|
-
...
|
|
1582
|
+
case "price": return j(ai, {
|
|
1583
|
+
...o,
|
|
1573
1584
|
price: String(n || "0"),
|
|
1574
|
-
oldPrice: t[
|
|
1575
|
-
style:
|
|
1576
|
-
oldPriceStyle:
|
|
1585
|
+
oldPrice: t[o?.oldPrice] ?? null,
|
|
1586
|
+
style: o?.style ?? (() => ({})),
|
|
1587
|
+
oldPriceStyle: o?.oldPriceStyle ?? (() => ({}))
|
|
1577
1588
|
});
|
|
1578
1589
|
case "listExpand": {
|
|
1579
|
-
let
|
|
1580
|
-
return j(
|
|
1581
|
-
items:
|
|
1582
|
-
max:
|
|
1583
|
-
unit:
|
|
1584
|
-
expanded:
|
|
1585
|
-
onToggle: () =>
|
|
1586
|
-
html:
|
|
1590
|
+
let r = hi(t?.[i?.rowKey ?? "id"], mi(e));
|
|
1591
|
+
return j(ri, {
|
|
1592
|
+
items: gi(n, o.labelKey),
|
|
1593
|
+
max: o.max,
|
|
1594
|
+
unit: o.unit,
|
|
1595
|
+
expanded: i?.expandedKeys.has(r) ?? !1,
|
|
1596
|
+
onToggle: () => i?.onToggle(r),
|
|
1597
|
+
html: o.html ?? !1
|
|
1587
1598
|
});
|
|
1588
1599
|
}
|
|
1589
1600
|
default: return;
|
|
1590
1601
|
}
|
|
1591
1602
|
}
|
|
1592
|
-
function
|
|
1603
|
+
function Ti(e) {
|
|
1593
1604
|
let t = {
|
|
1594
1605
|
bottom: "flex-end",
|
|
1595
1606
|
center: "center",
|
|
@@ -1600,11 +1611,11 @@ function Ci(e) {
|
|
|
1600
1611
|
width: "100%"
|
|
1601
1612
|
} : void 0;
|
|
1602
1613
|
}
|
|
1603
|
-
function
|
|
1614
|
+
function Ei(e, t, n) {
|
|
1604
1615
|
return e.map((e) => {
|
|
1605
1616
|
if (e.key === "__sel__" || e.key === "__fill__") return e;
|
|
1606
1617
|
if (e.cellRenderer) {
|
|
1607
|
-
let t = e.cellRenderer, n =
|
|
1618
|
+
let t = e.cellRenderer, n = Ti(e);
|
|
1608
1619
|
return n ? {
|
|
1609
1620
|
...e,
|
|
1610
1621
|
cellRenderer: (e) => j("div", {
|
|
@@ -1615,11 +1626,11 @@ function wi(e, t, n) {
|
|
|
1615
1626
|
}
|
|
1616
1627
|
let r = e.dataKey;
|
|
1617
1628
|
if (r == null || r === "") return e;
|
|
1618
|
-
let i =
|
|
1629
|
+
let i = oi(String(r));
|
|
1619
1630
|
return {
|
|
1620
1631
|
...e,
|
|
1621
1632
|
cellRenderer: (a) => {
|
|
1622
|
-
let { rowData: o, rowIndex: s, cellData: c } = a, l = a.column ?? e, u = l.align ?? e.align ?? "left", d =
|
|
1633
|
+
let { rowData: o, rowIndex: s, cellData: c } = a, l = a.column ?? e, u = l.align ?? e.align ?? "left", d = Ti(l), f = l.valueType ?? e.valueType, p = f === "date" || f === "datetime" ? di(o, String(r), c) : c === void 0 ? o?.[r] : c, m = fi(p, f), h = typeof p == "object" && p ? void 0 : m, g = t[i];
|
|
1623
1634
|
if (g) return j("div", {
|
|
1624
1635
|
class: "table-entity__col-slot",
|
|
1625
1636
|
title: h,
|
|
@@ -1634,7 +1645,7 @@ function wi(e, t, n) {
|
|
|
1634
1645
|
column: l,
|
|
1635
1646
|
rowIndex: s
|
|
1636
1647
|
}));
|
|
1637
|
-
let _ =
|
|
1648
|
+
let _ = wi(l, o, p, s, n);
|
|
1638
1649
|
if (_) {
|
|
1639
1650
|
let t = l.type === "picture" || e.type === "picture", n = l.type === "listExpand" || e.type === "listExpand";
|
|
1640
1651
|
return j("div", {
|
|
@@ -1685,13 +1696,13 @@ function wi(e, t, n) {
|
|
|
1685
1696
|
});
|
|
1686
1697
|
}
|
|
1687
1698
|
// src/components/table-entity/index.vue?vue&type=script&setup=true&lang.ts
|
|
1688
|
-
var
|
|
1699
|
+
var Di = { class: "table-entity__toolbar-right" }, Oi = { class: "buttons" }, ki = {
|
|
1689
1700
|
key: 0,
|
|
1690
1701
|
class: "table-entity__toolbar-left"
|
|
1691
|
-
},
|
|
1702
|
+
}, Ai = {
|
|
1692
1703
|
key: 1,
|
|
1693
1704
|
class: "table-entity__pagination"
|
|
1694
|
-
},
|
|
1705
|
+
}, ji = "__actions__", Mi = "__drag__", Ni = "table-entity__drag-handle", Pi = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
1695
1706
|
__name: "index",
|
|
1696
1707
|
props: {
|
|
1697
1708
|
columns: { default: () => [] },
|
|
@@ -1779,129 +1790,130 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
1779
1790
|
"rowSort"
|
|
1780
1791
|
],
|
|
1781
1792
|
setup(e, { expose: t, emit: n }) {
|
|
1782
|
-
let r = e, i = n, a =
|
|
1793
|
+
let r = e, i = n, a = z(!1), o = z(!1), c = {
|
|
1783
1794
|
view: {
|
|
1784
|
-
label:
|
|
1795
|
+
label: "components.tableEntity.view",
|
|
1785
1796
|
type: "primary"
|
|
1786
1797
|
},
|
|
1787
1798
|
edit: {
|
|
1788
|
-
label:
|
|
1799
|
+
label: "components.tableEntity.edit",
|
|
1789
1800
|
type: "primary"
|
|
1790
1801
|
},
|
|
1791
1802
|
copy: {
|
|
1792
|
-
label:
|
|
1803
|
+
label: "components.tableEntity.copy",
|
|
1793
1804
|
type: "primary"
|
|
1794
1805
|
},
|
|
1795
1806
|
delete: {
|
|
1796
|
-
label:
|
|
1807
|
+
label: "components.tableEntity.delete",
|
|
1797
1808
|
type: "danger"
|
|
1798
1809
|
}
|
|
1799
|
-
}, l =
|
|
1800
|
-
let e = (
|
|
1810
|
+
}, l = z(0), d = s(), f = b(() => {
|
|
1811
|
+
let e = (d.value.pageSizes ?? []).map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0);
|
|
1801
1812
|
return e.length > 0 ? e : [
|
|
1802
1813
|
10,
|
|
1803
1814
|
20,
|
|
1804
1815
|
50,
|
|
1805
1816
|
100
|
|
1806
1817
|
];
|
|
1807
|
-
}), p = se(), { hasAccessByCodes: m } = pn(), h =
|
|
1818
|
+
}), p = se(), { hasAccessByCodes: m } = pn(), h = z([]), g = z(/* @__PURE__ */ new Set()), _ = z(!1), v = z([...r.defaultExpandedRowKeys ?? []]), y = z(), { width: T } = _t(y), E = ne({
|
|
1808
1819
|
current_page: r.current_page,
|
|
1809
1820
|
per_page: r.per_page
|
|
1810
1821
|
}), 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");
|
|
1811
1822
|
function M() {
|
|
1812
|
-
i("refresh"),
|
|
1823
|
+
i("refresh"), nt();
|
|
1813
1824
|
}
|
|
1814
1825
|
let N = b(() => r.columns.filter(Boolean).map((e) => ({
|
|
1815
1826
|
...e,
|
|
1816
1827
|
dataKey: e.dataKey ?? e.dataIndex
|
|
1817
|
-
}))),
|
|
1818
|
-
function
|
|
1828
|
+
}))), ee = b(() => N.value.filter((e) => e.type === "listExpand")), I = b(() => !r.tree && ee.value.length > 0);
|
|
1829
|
+
function te(e) {
|
|
1819
1830
|
let t = new Set(g.value);
|
|
1820
1831
|
t.has(e) ? t.delete(e) : t.add(e), g.value = t;
|
|
1821
1832
|
}
|
|
1822
|
-
let
|
|
1833
|
+
let B = b(() => Ei(N.value, p, {
|
|
1823
1834
|
expandedKeys: g.value,
|
|
1824
|
-
onToggle:
|
|
1835
|
+
onToggle: te,
|
|
1825
1836
|
rowKey: r.rowKey ?? "id"
|
|
1826
|
-
})),
|
|
1827
|
-
field:
|
|
1828
|
-
order:
|
|
1837
|
+
})), re = r.columns.find((e) => e.sortOrder), U = z({
|
|
1838
|
+
field: re && String(re.dataKey ?? re.dataIndex ?? re.key ?? "") || void 0,
|
|
1839
|
+
order: re?.sortOrder
|
|
1829
1840
|
});
|
|
1830
1841
|
function ie(e) {
|
|
1831
1842
|
let t = e.dataKey ?? e.dataIndex ?? e.key;
|
|
1832
1843
|
return t == null ? void 0 : String(t);
|
|
1833
1844
|
}
|
|
1834
|
-
function
|
|
1845
|
+
function ae(e) {
|
|
1835
1846
|
if (!e.sortable && !e.sortOrder) return;
|
|
1836
1847
|
let t = ie(e);
|
|
1837
1848
|
if (!t) return;
|
|
1838
|
-
let n =
|
|
1839
|
-
|
|
1849
|
+
let n = U.value.field === t && U.value.order === "asc" ? "desc" : "asc";
|
|
1850
|
+
U.value = {
|
|
1840
1851
|
field: t,
|
|
1841
1852
|
order: n
|
|
1842
|
-
}, E.current_page === 1 ? (
|
|
1853
|
+
}, E.current_page === 1 ? (oe(), typeof r.data == "function" && nt()) : (E.current_page = 1, i("update:current_page", 1), i("update:page", 1), oe());
|
|
1843
1854
|
}
|
|
1844
|
-
function
|
|
1855
|
+
function oe() {
|
|
1845
1856
|
i("change", {
|
|
1846
1857
|
current_page: E.current_page,
|
|
1847
1858
|
page: E.current_page,
|
|
1848
1859
|
per_page: E.per_page,
|
|
1849
|
-
sortField:
|
|
1850
|
-
sortOrder:
|
|
1860
|
+
sortField: U.value.field,
|
|
1861
|
+
sortOrder: U.value.order
|
|
1851
1862
|
});
|
|
1852
1863
|
}
|
|
1853
|
-
let
|
|
1854
|
-
|
|
1855
|
-
|
|
1864
|
+
let K = yr(B), ce = gr(B), le = ce.orderedItems, de = ce.setFixed;
|
|
1865
|
+
ce.reset;
|
|
1866
|
+
function fe() {
|
|
1867
|
+
K.reset(), ce.reset();
|
|
1856
1868
|
}
|
|
1857
|
-
let { applyColumnWidths:
|
|
1858
|
-
let e = r.showColumnSettings ?
|
|
1859
|
-
return
|
|
1860
|
-
}),
|
|
1869
|
+
let { applyColumnWidths: X, resizeLineStyle: pe, onViewportMouseDown: me } = vr(r.minColumnWidth), he = b(() => {
|
|
1870
|
+
let e = r.showColumnSettings ? K.visibleColumns.value : B.value;
|
|
1871
|
+
return ce.applyFixed(K.applyAlign(X(e)));
|
|
1872
|
+
}), ge = b(() => {
|
|
1861
1873
|
if (!r.tree) return;
|
|
1862
1874
|
if (r.expandColumnKey) return r.expandColumnKey;
|
|
1863
|
-
let e =
|
|
1875
|
+
let e = B.value.find((e) => {
|
|
1864
1876
|
let t = e.key ?? e.dataKey;
|
|
1865
1877
|
return t != null && String(t) !== "";
|
|
1866
1878
|
}), t = e?.key ?? e?.dataKey;
|
|
1867
1879
|
return t == null ? void 0 : String(t);
|
|
1868
|
-
}),
|
|
1869
|
-
function
|
|
1870
|
-
let t = r.rowKey ?? "id", n = r.treeChildrenKey ?? "children", i =
|
|
1880
|
+
}), _e = b(() => r.expandedRowKeys ?? v.value), Se = b(() => !r.tree || r.treeChildrenKey === "children" ? h.value : it(h.value, r.treeChildrenKey));
|
|
1881
|
+
function Ce(e) {
|
|
1882
|
+
let t = r.rowKey ?? "id", n = r.treeChildrenKey ?? "children", i = ee.value.map((e) => mi(e));
|
|
1871
1883
|
return e.map((e) => {
|
|
1872
|
-
let r = i.map((n) => g.value.has(
|
|
1884
|
+
let r = i.map((n) => g.value.has(hi(e[t], n)) ? "1" : "0").join(""), a = {
|
|
1873
1885
|
...e,
|
|
1874
1886
|
__measureKey: `${e[t]}:${r}`
|
|
1875
1887
|
};
|
|
1876
|
-
return Array.isArray(e[n]) && (a[n] =
|
|
1888
|
+
return Array.isArray(e[n]) && (a[n] = Ce(e[n])), a;
|
|
1877
1889
|
});
|
|
1878
1890
|
}
|
|
1879
|
-
let
|
|
1891
|
+
let we = b(() => I.value ? Ce(Se.value) : Se.value), Te = b(() => r.tree ? at(Se.value, _e.value) : h.value), Ee = b(() => r.tree ? at(Se.value) : h.value);
|
|
1880
1892
|
q(() => r.current_page, (e) => {
|
|
1881
1893
|
E.current_page = e;
|
|
1882
1894
|
}), q(() => r.per_page, (e) => {
|
|
1883
1895
|
E.per_page = e;
|
|
1884
1896
|
}), q(() => r.data, async () => {
|
|
1885
|
-
await
|
|
1897
|
+
await nt();
|
|
1886
1898
|
}, {
|
|
1887
1899
|
deep: !0,
|
|
1888
1900
|
immediate: !0
|
|
1889
1901
|
}), q(() => [E.current_page, E.per_page], async () => {
|
|
1890
|
-
typeof r.data == "function" && await
|
|
1902
|
+
typeof r.data == "function" && await nt();
|
|
1891
1903
|
}), q(() => r.expandedRowKeys, (e) => {
|
|
1892
1904
|
e && (v.value = [...e]);
|
|
1893
1905
|
}, { immediate: !0 });
|
|
1894
|
-
let { selectionColumn:
|
|
1895
|
-
function
|
|
1906
|
+
let { selectionColumn: Q, rowEventHandlers: De, clearSelection: $, getSelectedRows: ke, getSelectedCount: Ae, setSelectedKeys: je } = Or(r, i, Te, Ee);
|
|
1907
|
+
function Me() {
|
|
1896
1908
|
return r.importDialog ? (a.value = !0, !0) : !1;
|
|
1897
1909
|
}
|
|
1898
|
-
function
|
|
1899
|
-
i("importSuccess", e),
|
|
1910
|
+
function Ne(e) {
|
|
1911
|
+
i("importSuccess", e), nt();
|
|
1900
1912
|
}
|
|
1901
|
-
function
|
|
1913
|
+
function Pe(e) {
|
|
1902
1914
|
i("importError", e);
|
|
1903
1915
|
}
|
|
1904
|
-
let
|
|
1916
|
+
let Fe = Symbol("table-entity-root-parent"), Ie = b(() => r.rowDraggable), Le = b(() => r.tree && ge.value ? at(Se.value, _e.value) : r.tree ? Se.value : h.value), Re = b(() => {
|
|
1905
1917
|
let e = /* @__PURE__ */ new Map(), t = r.rowKey ?? "id", n = r.treeChildrenKey ?? "children";
|
|
1906
1918
|
function i(r, a) {
|
|
1907
1919
|
for (let o of r) {
|
|
@@ -1911,9 +1923,9 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
1911
1923
|
Array.isArray(s) && i(s, r);
|
|
1912
1924
|
}
|
|
1913
1925
|
}
|
|
1914
|
-
return i(h.value,
|
|
1926
|
+
return i(h.value, Fe), e;
|
|
1915
1927
|
});
|
|
1916
|
-
function
|
|
1928
|
+
function ze(e, t, n, r, i, a = null) {
|
|
1917
1929
|
let o = e.findIndex((e) => e[r] === t), s = e.findIndex((e) => e[r] === n);
|
|
1918
1930
|
if (o >= 0 && s >= 0 && o !== s) return {
|
|
1919
1931
|
newIndex: s,
|
|
@@ -1924,7 +1936,7 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
1924
1936
|
for (let a = 0; a < e.length; a += 1) {
|
|
1925
1937
|
let o = e[a], s = o[i];
|
|
1926
1938
|
if (!Array.isArray(s)) continue;
|
|
1927
|
-
let c =
|
|
1939
|
+
let c = ze(s, t, n, r, i, o[r] ?? null);
|
|
1928
1940
|
if (c) return {
|
|
1929
1941
|
...c,
|
|
1930
1942
|
rows: e.map((e, t) => t === a ? {
|
|
@@ -1935,17 +1947,17 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
1935
1947
|
}
|
|
1936
1948
|
return null;
|
|
1937
1949
|
}
|
|
1938
|
-
let { draggingIndex:
|
|
1950
|
+
let { draggingIndex: Ve, onPointerDown: Ue, overIndex: We } = Er({
|
|
1939
1951
|
canDrop: (e, t) => {
|
|
1940
1952
|
if (!r.tree) return !0;
|
|
1941
|
-
let n = r.rowKey ?? "id", i =
|
|
1953
|
+
let n = r.rowKey ?? "id", i = Re.value, a = e[n], o = t[n];
|
|
1942
1954
|
return a != null && o != null && i.has(a) && i.has(o) && i.get(a) === i.get(o);
|
|
1943
1955
|
},
|
|
1944
|
-
getHandle: () => r.rowDragHandle || `.${
|
|
1956
|
+
getHandle: () => r.rowDragHandle || `.${Ni}`,
|
|
1945
1957
|
getRoot: () => y.value,
|
|
1946
1958
|
getRowHeight: () => r.rowHeight,
|
|
1947
|
-
getRows: () =>
|
|
1948
|
-
isEnabled: () =>
|
|
1959
|
+
getRows: () => Le.value,
|
|
1960
|
+
isEnabled: () => Ie.value,
|
|
1949
1961
|
isTree: () => r.tree,
|
|
1950
1962
|
isRowDisabled: (e) => r.rowDragDisabled?.(e) ?? !1,
|
|
1951
1963
|
moveRows: (e, t, n, i) => {
|
|
@@ -1957,61 +1969,61 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
1957
1969
|
rows: e
|
|
1958
1970
|
});
|
|
1959
1971
|
}
|
|
1960
|
-
let a = r.rowKey ?? "id", o =
|
|
1972
|
+
let a = r.rowKey ?? "id", o = ze(h.value, e[a], t[a], a, r.treeChildrenKey ?? "children");
|
|
1961
1973
|
return o ? (h.value = o.rows, o) : null;
|
|
1962
1974
|
},
|
|
1963
1975
|
onSort: (e) => i("rowSort", e)
|
|
1964
1976
|
});
|
|
1965
|
-
function
|
|
1966
|
-
if (!
|
|
1977
|
+
function Ge({ rowData: e, rowIndex: t }) {
|
|
1978
|
+
if (!Ie.value) return "";
|
|
1967
1979
|
let n = [];
|
|
1968
|
-
return r.rowDragDisabled?.(e) && n.push("table-entity__row--drag-disabled"),
|
|
1980
|
+
return r.rowDragDisabled?.(e) && n.push("table-entity__row--drag-disabled"), Ve.value != null && We.value === t && We.value !== Ve.value && n.push("table-entity__row--drop-target"), n.join(" ");
|
|
1969
1981
|
}
|
|
1970
|
-
function
|
|
1971
|
-
if (!
|
|
1982
|
+
function Ke({ rowData: e, rowIndex: t }) {
|
|
1983
|
+
if (!Ie.value) return {};
|
|
1972
1984
|
let n = e?.[r.rowKey ?? "id"];
|
|
1973
1985
|
return {
|
|
1974
1986
|
"data-row-index": t,
|
|
1975
1987
|
"data-row-key": String(n ?? t)
|
|
1976
1988
|
};
|
|
1977
1989
|
}
|
|
1978
|
-
let
|
|
1979
|
-
key:
|
|
1980
|
-
dataKey:
|
|
1990
|
+
let qe = b(() => ({
|
|
1991
|
+
key: Mi,
|
|
1992
|
+
dataKey: Mi,
|
|
1981
1993
|
title: "",
|
|
1982
1994
|
width: 40,
|
|
1983
1995
|
cellRenderer: ({ rowData: e }) => r.rowDragDisabled?.(e) ? null : j("span", {
|
|
1984
|
-
class:
|
|
1985
|
-
title: "
|
|
1996
|
+
class: Ni,
|
|
1997
|
+
title: u("components.tableEntity.dragSort")
|
|
1986
1998
|
}, j(Z, { size: 16 }, () => j(ct)))
|
|
1987
1999
|
}));
|
|
1988
|
-
function
|
|
2000
|
+
function Je(e) {
|
|
1989
2001
|
if (!e || !r.permissionCode) return;
|
|
1990
2002
|
let t = e === "delete" ? "remove" : e === "view" ? "query" : e;
|
|
1991
2003
|
return `${r.permissionCode}:${t}`;
|
|
1992
2004
|
}
|
|
1993
|
-
function
|
|
1994
|
-
let t =
|
|
2005
|
+
function Ye(e) {
|
|
2006
|
+
let t = Je(e);
|
|
1995
2007
|
return !t || m([t]);
|
|
1996
2008
|
}
|
|
1997
|
-
let
|
|
2009
|
+
let Xe = b(() => {
|
|
1998
2010
|
let e = /* @__PURE__ */ new Set();
|
|
1999
|
-
for (let t of r.actions ?? [])
|
|
2000
|
-
for (let t of r.pushActions ?? []) t.name &&
|
|
2011
|
+
for (let t of r.actions ?? []) Ye(t) && e.add(t);
|
|
2012
|
+
for (let t of r.pushActions ?? []) t.name && Ye(t.name) && e.add(t.name);
|
|
2001
2013
|
return e;
|
|
2002
2014
|
});
|
|
2003
|
-
function
|
|
2004
|
-
let n =
|
|
2015
|
+
function Ze(e, t) {
|
|
2016
|
+
let n = Je(t), r = H("access");
|
|
2005
2017
|
return !n || !r ? e : ue(e, [[r, [n]]]);
|
|
2006
2018
|
}
|
|
2007
|
-
let
|
|
2019
|
+
let Qe = b(() => 50), $e = b(() => {
|
|
2008
2020
|
if (!r.showActions) return null;
|
|
2009
|
-
let e =
|
|
2021
|
+
let e = Xe.value;
|
|
2010
2022
|
return {
|
|
2011
|
-
key:
|
|
2012
|
-
dataKey:
|
|
2013
|
-
title: r.actionColumnTitle ||
|
|
2014
|
-
width:
|
|
2023
|
+
key: ji,
|
|
2024
|
+
dataKey: ji,
|
|
2025
|
+
title: r.actionColumnTitle || u("components.tableEntity.action"),
|
|
2026
|
+
width: Qe.value,
|
|
2015
2027
|
fixed: "right",
|
|
2016
2028
|
cellRenderer: (t) => {
|
|
2017
2029
|
let n = p.actionsCol;
|
|
@@ -2027,7 +2039,7 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2027
2039
|
let t = c[e];
|
|
2028
2040
|
t && a.push({
|
|
2029
2041
|
name: e,
|
|
2030
|
-
label:
|
|
2042
|
+
label: u(t.label),
|
|
2031
2043
|
type: t.type
|
|
2032
2044
|
});
|
|
2033
2045
|
}
|
|
@@ -2040,7 +2052,7 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2040
2052
|
function s(e, n = !0) {
|
|
2041
2053
|
if (e.component) {
|
|
2042
2054
|
let r;
|
|
2043
|
-
return r = typeof e.component == "function" ? e.component({ row: t.rowData }) : j(e.component, { row: t.rowData }), n ?
|
|
2055
|
+
return r = typeof e.component == "function" ? e.component({ row: t.rowData }) : j(e.component, { row: t.rowData }), n ? Ze(r, e.name) : r;
|
|
2044
2056
|
}
|
|
2045
2057
|
let r = j(Y, {
|
|
2046
2058
|
type: e.type,
|
|
@@ -2051,9 +2063,9 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2051
2063
|
row: t.rowData
|
|
2052
2064
|
})
|
|
2053
2065
|
}, () => e.label);
|
|
2054
|
-
return n ?
|
|
2066
|
+
return n ? Ze(r, e.name) : r;
|
|
2055
2067
|
}
|
|
2056
|
-
let l = o.length > 1 ? o : [],
|
|
2068
|
+
let l = o.length > 1 ? o : [], d = (l.length > 0 ? [] : o).map((e) => s(e));
|
|
2057
2069
|
if (l.length > 0) {
|
|
2058
2070
|
let e = j(ye, {
|
|
2059
2071
|
trigger: "hover",
|
|
@@ -2062,9 +2074,9 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2062
2074
|
default: () => j(Y, {
|
|
2063
2075
|
link: !0,
|
|
2064
2076
|
size: "small",
|
|
2065
|
-
title:
|
|
2077
|
+
title: u("components.tableEntity.moreActions")
|
|
2066
2078
|
}, () => "..."),
|
|
2067
|
-
dropdown: () => j(xe, {}, () => l.map((e, n) => e.component ?
|
|
2079
|
+
dropdown: () => j(xe, {}, () => l.map((e, n) => e.component ? Ze(j(be, { key: e.name ?? `component-${n}` }, () => s(e, !1)), e.name) : Ze(j(be, {
|
|
2068
2080
|
key: e.name,
|
|
2069
2081
|
onClick: () => i("handle-action", {
|
|
2070
2082
|
action: e.name,
|
|
@@ -2076,18 +2088,18 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2076
2088
|
type: e.type
|
|
2077
2089
|
}, () => e.label)))))
|
|
2078
2090
|
});
|
|
2079
|
-
return j("div", { class: "table-entity__actions" }, [...
|
|
2091
|
+
return j("div", { class: "table-entity__actions" }, [...d, e]);
|
|
2080
2092
|
}
|
|
2081
|
-
return j("div", { class: "table-entity__actions" },
|
|
2093
|
+
return j("div", { class: "table-entity__actions" }, d);
|
|
2082
2094
|
}
|
|
2083
2095
|
};
|
|
2084
|
-
}),
|
|
2096
|
+
}), et = b(() => {
|
|
2085
2097
|
let e = [];
|
|
2086
|
-
return
|
|
2098
|
+
return Ie.value && !r.rowDragHandle && e.push(qe.value), r.selectable && e.push(Q.value), e.push(...he.value), $e.value && e.push($e.value), rt(e, O.value);
|
|
2087
2099
|
});
|
|
2088
|
-
function
|
|
2100
|
+
function tt(e) {
|
|
2089
2101
|
return e.map((e) => {
|
|
2090
|
-
let t = e.headerCellRenderer, n = ie(e), r =
|
|
2102
|
+
let t = e.headerCellRenderer, n = ie(e), r = U.value.field === n, i = !!(e.sortable || e.sortOrder), a = i && r ? j("span", { class: ["table-entity__sort-arrow", U.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;
|
|
2091
2103
|
return {
|
|
2092
2104
|
...e,
|
|
2093
2105
|
width: e.width ?? 120,
|
|
@@ -2102,13 +2114,13 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2102
2114
|
cursor: i ? "pointer" : void 0
|
|
2103
2115
|
},
|
|
2104
2116
|
onClick: i ? (t) => {
|
|
2105
|
-
t.stopPropagation(),
|
|
2117
|
+
t.stopPropagation(), ae(e);
|
|
2106
2118
|
} : void 0
|
|
2107
2119
|
}, [t ? t(n) : e.title, a])
|
|
2108
2120
|
};
|
|
2109
2121
|
});
|
|
2110
2122
|
}
|
|
2111
|
-
async function
|
|
2123
|
+
async function nt() {
|
|
2112
2124
|
if (Array.isArray(r.data)) h.value = [...r.data], l.value = h.value.length;
|
|
2113
2125
|
else if (typeof r.data != "function") h.value = [];
|
|
2114
2126
|
else {
|
|
@@ -2119,8 +2131,8 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2119
2131
|
page: E.current_page,
|
|
2120
2132
|
per_page: E.per_page,
|
|
2121
2133
|
query: r.query,
|
|
2122
|
-
sortField:
|
|
2123
|
-
sortOrder:
|
|
2134
|
+
sortField: U.value.field,
|
|
2135
|
+
sortOrder: U.value.order
|
|
2124
2136
|
});
|
|
2125
2137
|
h.value = e.rows, l.value = e.total;
|
|
2126
2138
|
} finally {
|
|
@@ -2128,18 +2140,18 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2128
2140
|
}
|
|
2129
2141
|
}
|
|
2130
2142
|
}
|
|
2131
|
-
function
|
|
2143
|
+
function rt(e, t) {
|
|
2132
2144
|
if (e.length === 0 || t <= 1) return e;
|
|
2133
2145
|
let n = e.map((e) => ({
|
|
2134
2146
|
...e,
|
|
2135
2147
|
width: Number(e.width ?? 120)
|
|
2136
2148
|
})), r = n.reduce((e, t) => e + Number(t.width ?? 0), 0);
|
|
2137
2149
|
if (r >= t) return n;
|
|
2138
|
-
let i = n.filter((e) => e.dataKey !==
|
|
2150
|
+
let i = n.filter((e) => e.dataKey !== ji && e.dataKey !== "__sel__" && e.dataKey !== Mi);
|
|
2139
2151
|
if (i.length === 0) return n;
|
|
2140
2152
|
let a = t - r, o = i.reduce((e, t) => e + Number(t.width ?? 0), 0);
|
|
2141
2153
|
return n.map((e) => {
|
|
2142
|
-
if (e.dataKey ===
|
|
2154
|
+
if (e.dataKey === ji || e.dataKey === "__sel__" || e.dataKey === Mi) return e;
|
|
2143
2155
|
let t = Number(e.width ?? 120);
|
|
2144
2156
|
return {
|
|
2145
2157
|
...e,
|
|
@@ -2147,16 +2159,16 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2147
2159
|
};
|
|
2148
2160
|
});
|
|
2149
2161
|
}
|
|
2150
|
-
function
|
|
2162
|
+
function it(e, t = "children") {
|
|
2151
2163
|
return e.map((e) => {
|
|
2152
2164
|
let n = e[t];
|
|
2153
2165
|
return Array.isArray(n) ? {
|
|
2154
2166
|
...e,
|
|
2155
|
-
children:
|
|
2167
|
+
children: it(n, t)
|
|
2156
2168
|
} : e;
|
|
2157
2169
|
});
|
|
2158
2170
|
}
|
|
2159
|
-
function
|
|
2171
|
+
function at(e, t) {
|
|
2160
2172
|
let n = [], i = t ? new Set(t) : void 0, a = r.rowKey ?? "id";
|
|
2161
2173
|
function o(e) {
|
|
2162
2174
|
e.forEach((e) => {
|
|
@@ -2167,89 +2179,89 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2167
2179
|
}
|
|
2168
2180
|
return o(e), n;
|
|
2169
2181
|
}
|
|
2170
|
-
function
|
|
2182
|
+
function ot(e) {
|
|
2171
2183
|
v.value = [...e], i("update:expandedRowKeys", [...e]);
|
|
2172
2184
|
}
|
|
2173
|
-
function
|
|
2174
|
-
|
|
2185
|
+
function st(e) {
|
|
2186
|
+
ot(e);
|
|
2175
2187
|
}
|
|
2176
|
-
function
|
|
2177
|
-
|
|
2188
|
+
function ut(e) {
|
|
2189
|
+
ot(e), i("expandedRowsChange", [...e]);
|
|
2178
2190
|
}
|
|
2179
|
-
function
|
|
2191
|
+
function dt(e) {
|
|
2180
2192
|
i("rowExpand", e);
|
|
2181
2193
|
}
|
|
2182
|
-
function
|
|
2183
|
-
E.current_page = e, i("update:current_page", e), i("pageChange", e),
|
|
2194
|
+
function pt(e) {
|
|
2195
|
+
E.current_page = e, i("update:current_page", e), i("pageChange", e), oe();
|
|
2184
2196
|
}
|
|
2185
|
-
function
|
|
2186
|
-
E.per_page = e, i("update:per_page", e),
|
|
2197
|
+
function mt(e) {
|
|
2198
|
+
E.per_page = e, i("update:per_page", e), oe();
|
|
2187
2199
|
}
|
|
2188
|
-
async function
|
|
2189
|
-
e != null && E.current_page !== e ? (E.current_page = e, i("update:current_page", e),
|
|
2200
|
+
async function ht(e) {
|
|
2201
|
+
e != null && E.current_page !== e ? (E.current_page = e, i("update:current_page", e), oe()) : await nt();
|
|
2190
2202
|
}
|
|
2191
2203
|
return t({
|
|
2192
|
-
clearSelection:
|
|
2193
|
-
getSelectedRows:
|
|
2194
|
-
getSelectedCount:
|
|
2195
|
-
setSelectedKeys:
|
|
2196
|
-
openImport:
|
|
2197
|
-
reload:
|
|
2204
|
+
clearSelection: $,
|
|
2205
|
+
getSelectedRows: ke,
|
|
2206
|
+
getSelectedCount: Ae,
|
|
2207
|
+
setSelectedKeys: je,
|
|
2208
|
+
openImport: Me,
|
|
2209
|
+
reload: ht
|
|
2198
2210
|
}), (t, n) => {
|
|
2199
|
-
let i =
|
|
2200
|
-
return
|
|
2211
|
+
let i = H("loading");
|
|
2212
|
+
return R(), C("div", { class: F(["table-entity", {
|
|
2201
2213
|
"table-entity--large-row": r.rowHeight > 40,
|
|
2202
|
-
"table-entity--dynamic-row":
|
|
2214
|
+
"table-entity--dynamic-row": I.value
|
|
2203
2215
|
}]) }, [
|
|
2204
2216
|
n[5] ||= w("div", { class: "flex justify-between mb-1" }, null, -1),
|
|
2205
2217
|
w("div", {
|
|
2206
2218
|
class: "table-entity__toolbar",
|
|
2207
|
-
style:
|
|
2208
|
-
}, [w("div",
|
|
2209
|
-
D(
|
|
2210
|
-
content:
|
|
2219
|
+
style: L({ width: `${e.width}px` })
|
|
2220
|
+
}, [w("div", Di, [w("div", Oi, [V(t.$slots, "buttons", {}, void 0, !0)])]), A.value ? (R(), C("div", ki, [
|
|
2221
|
+
D(G(He), {
|
|
2222
|
+
content: G(u)("components.tableEntity.refresh"),
|
|
2211
2223
|
placement: "top"
|
|
2212
2224
|
}, {
|
|
2213
|
-
default: J(() => [D(
|
|
2214
|
-
icon:
|
|
2225
|
+
default: J(() => [D(G(Y), {
|
|
2226
|
+
icon: G(lt),
|
|
2215
2227
|
circle: "",
|
|
2216
2228
|
size: "small",
|
|
2217
|
-
title:
|
|
2229
|
+
title: G(u)("components.tableEntity.refresh"),
|
|
2218
2230
|
onClick: M
|
|
2219
2231
|
}, null, 8, ["icon", "title"])]),
|
|
2220
2232
|
_: 1
|
|
2221
2233
|
}, 8, ["content"]),
|
|
2222
|
-
w("div", null, [D(
|
|
2223
|
-
content:
|
|
2234
|
+
w("div", null, [D(G(He), {
|
|
2235
|
+
content: G(u)("components.tableEntity.columnSettings"),
|
|
2224
2236
|
placement: "top"
|
|
2225
2237
|
}, {
|
|
2226
|
-
default: J(() => [D(
|
|
2238
|
+
default: J(() => [D(G(Y), {
|
|
2227
2239
|
class: "table-entity__settings-btn",
|
|
2228
|
-
icon:
|
|
2240
|
+
icon: G(ft),
|
|
2229
2241
|
circle: "",
|
|
2230
2242
|
size: "small",
|
|
2231
|
-
onClick: n[0] ||= (e) =>
|
|
2243
|
+
onClick: n[0] ||= (e) => o.value = !0
|
|
2232
2244
|
}, null, 8, ["icon"])]),
|
|
2233
2245
|
_: 1
|
|
2234
2246
|
}, 8, ["content"])]),
|
|
2235
|
-
r.showColumnSettings ? (
|
|
2247
|
+
r.showColumnSettings ? (R(), x(G(ve), {
|
|
2236
2248
|
key: 0,
|
|
2237
|
-
modelValue:
|
|
2238
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
2239
|
-
title:
|
|
2249
|
+
modelValue: o.value,
|
|
2250
|
+
"onUpdate:modelValue": n[1] ||= (e) => o.value = e,
|
|
2251
|
+
title: G(u)("components.tableEntity.columnConfig"),
|
|
2240
2252
|
direction: "rtl",
|
|
2241
2253
|
size: "640px"
|
|
2242
2254
|
}, {
|
|
2243
2255
|
default: J(() => [D(hr, {
|
|
2244
|
-
settings: K
|
|
2245
|
-
"fixed-items":
|
|
2246
|
-
onToggle: K
|
|
2247
|
-
onSetHeaderAlign: K
|
|
2248
|
-
onSetContentAlign: K
|
|
2249
|
-
onSetWidth: K
|
|
2250
|
-
onSetFixed:
|
|
2251
|
-
onReset:
|
|
2252
|
-
"onUpdate:settings": K
|
|
2256
|
+
settings: G(K).orderedSettings.value,
|
|
2257
|
+
"fixed-items": G(le),
|
|
2258
|
+
onToggle: G(K).toggleColumn,
|
|
2259
|
+
onSetHeaderAlign: G(K).setHeaderAlign,
|
|
2260
|
+
onSetContentAlign: G(K).setContentAlign,
|
|
2261
|
+
onSetWidth: G(K).setWidth,
|
|
2262
|
+
onSetFixed: G(de),
|
|
2263
|
+
onReset: fe,
|
|
2264
|
+
"onUpdate:settings": G(K).reorderSettings
|
|
2253
2265
|
}, null, 8, [
|
|
2254
2266
|
"settings",
|
|
2255
2267
|
"fixed-items",
|
|
@@ -2264,33 +2276,33 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2264
2276
|
}, 8, ["modelValue", "title"])) : S("", !0),
|
|
2265
2277
|
S("", !0)
|
|
2266
2278
|
])) : S("", !0)], 4),
|
|
2267
|
-
ue((
|
|
2279
|
+
ue((R(), C("div", {
|
|
2268
2280
|
ref_key: "tableViewportRef",
|
|
2269
2281
|
ref: y,
|
|
2270
2282
|
class: "table-entity__viewport",
|
|
2271
|
-
onMousedown: n[2] ||= (...e) =>
|
|
2272
|
-
onPointerdown: n[3] ||= (...e) =>
|
|
2273
|
-
}, [D(
|
|
2274
|
-
columns:
|
|
2275
|
-
data:
|
|
2283
|
+
onMousedown: n[2] ||= (...e) => G(me) && G(me)(...e),
|
|
2284
|
+
onPointerdown: n[3] ||= (...e) => G(Ue) && G(Ue)(...e)
|
|
2285
|
+
}, [D(G(Be), {
|
|
2286
|
+
columns: tt(et.value),
|
|
2287
|
+
data: we.value,
|
|
2276
2288
|
width: O.value,
|
|
2277
2289
|
height: r.height,
|
|
2278
2290
|
"row-height": r.rowHeight,
|
|
2279
|
-
"row-class":
|
|
2280
|
-
"row-props":
|
|
2291
|
+
"row-class": Ge,
|
|
2292
|
+
"row-props": Ke,
|
|
2281
2293
|
cache: r.cache,
|
|
2282
|
-
"estimated-row-height":
|
|
2283
|
-
"row-key":
|
|
2284
|
-
"expand-column-key":
|
|
2285
|
-
"expanded-row-keys":
|
|
2294
|
+
"estimated-row-height": I.value ? r.rowHeight : void 0,
|
|
2295
|
+
"row-key": I.value ? "__measureKey" : r.rowKey,
|
|
2296
|
+
"expand-column-key": ge.value,
|
|
2297
|
+
"expanded-row-keys": _e.value,
|
|
2286
2298
|
"default-expanded-row-keys": r.defaultExpandedRowKeys,
|
|
2287
2299
|
"indent-size": r.indentSize,
|
|
2288
2300
|
"icon-size": r.iconSize,
|
|
2289
|
-
"row-event-handlers": r.selectable ?
|
|
2301
|
+
"row-event-handlers": r.selectable ? G(De) : void 0,
|
|
2290
2302
|
fixed: "",
|
|
2291
|
-
"onUpdate:expandedRowKeys":
|
|
2292
|
-
onExpandedRowsChange:
|
|
2293
|
-
onRowExpand:
|
|
2303
|
+
"onUpdate:expandedRowKeys": st,
|
|
2304
|
+
onExpandedRowsChange: ut,
|
|
2305
|
+
onRowExpand: dt
|
|
2294
2306
|
}, null, 8, [
|
|
2295
2307
|
"columns",
|
|
2296
2308
|
"data",
|
|
@@ -2307,26 +2319,26 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2307
2319
|
"icon-size",
|
|
2308
2320
|
"row-event-handlers"
|
|
2309
2321
|
])], 32)), [[i, _.value]]),
|
|
2310
|
-
r.resizable ? (
|
|
2322
|
+
r.resizable ? (R(), C("div", {
|
|
2311
2323
|
key: 0,
|
|
2312
2324
|
class: "table-entity__resize-line",
|
|
2313
|
-
style:
|
|
2325
|
+
style: L(G(pe))
|
|
2314
2326
|
}, null, 4)) : S("", !0),
|
|
2315
|
-
r.showPagination ? (
|
|
2327
|
+
r.showPagination ? (R(), C("div", Ai, [w("div", null, W(G(u)("components.tableEntity.selectedCount", { count: G(Ae)() })), 1), D(G(Oe), P({
|
|
2316
2328
|
"current-page": E.current_page,
|
|
2317
2329
|
"page-size": E.per_page,
|
|
2318
2330
|
total: k.value
|
|
2319
|
-
},
|
|
2331
|
+
}, G(d), {
|
|
2320
2332
|
"page-sizes": f.value,
|
|
2321
|
-
onSizeChange:
|
|
2322
|
-
onCurrentChange:
|
|
2333
|
+
onSizeChange: mt,
|
|
2334
|
+
onCurrentChange: pt
|
|
2323
2335
|
}), null, 16, [
|
|
2324
2336
|
"current-page",
|
|
2325
2337
|
"page-size",
|
|
2326
2338
|
"total",
|
|
2327
2339
|
"page-sizes"
|
|
2328
2340
|
])])) : S("", !0),
|
|
2329
|
-
r.importDialog ? (
|
|
2341
|
+
r.importDialog ? (R(), x(G(ar), {
|
|
2330
2342
|
key: 2,
|
|
2331
2343
|
modelValue: a.value,
|
|
2332
2344
|
"onUpdate:modelValue": n[4] ||= (e) => a.value = e,
|
|
@@ -2344,8 +2356,8 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2344
2356
|
"parse-file": r.importDialog.parseFile,
|
|
2345
2357
|
"submit-import": r.importDialog.submitImport,
|
|
2346
2358
|
"reset-on-close": r.importDialog.resetOnClose,
|
|
2347
|
-
onSuccess:
|
|
2348
|
-
onError:
|
|
2359
|
+
onSuccess: Ne,
|
|
2360
|
+
onError: Pe
|
|
2349
2361
|
}, null, 8, [
|
|
2350
2362
|
"modelValue",
|
|
2351
2363
|
"api",
|
|
@@ -2366,10 +2378,10 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2366
2378
|
], 2);
|
|
2367
2379
|
};
|
|
2368
2380
|
}
|
|
2369
|
-
}), [["__scopeId", "data-v-
|
|
2381
|
+
}), [["__scopeId", "data-v-7026ed16"]]), Fi = { class: "dialog-list" }, Ii = { class: "dialog-list__bar" }, Li = {
|
|
2370
2382
|
key: 0,
|
|
2371
2383
|
class: "dialog-list__count"
|
|
2372
|
-
},
|
|
2384
|
+
}, Ri = { class: "dialog-list__table" }, zi = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
2373
2385
|
__name: "index",
|
|
2374
2386
|
props: {
|
|
2375
2387
|
visible: { type: Boolean },
|
|
@@ -2401,10 +2413,10 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2401
2413
|
onOpenChange: (e) => {
|
|
2402
2414
|
e !== i.visible && a("update:visible", e);
|
|
2403
2415
|
}
|
|
2404
|
-
}), c =
|
|
2416
|
+
}), c = z(), l = z(""), d = z(1), f = z(i.perPage), p = z([]), m = b(() => [
|
|
2405
2417
|
"__dialog-list__",
|
|
2406
2418
|
i.rowKey,
|
|
2407
|
-
|
|
2419
|
+
d.value,
|
|
2408
2420
|
f.value,
|
|
2409
2421
|
l.value || "",
|
|
2410
2422
|
JSON.stringify(i.filterParams)
|
|
@@ -2412,7 +2424,7 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2412
2424
|
queryKey: m,
|
|
2413
2425
|
queryFn: () => i.fetcher({
|
|
2414
2426
|
keyword: l.value || void 0,
|
|
2415
|
-
page:
|
|
2427
|
+
page: d.value,
|
|
2416
2428
|
per_page: f.value,
|
|
2417
2429
|
params: i.filterParams
|
|
2418
2430
|
}),
|
|
@@ -2428,16 +2440,16 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2428
2440
|
return;
|
|
2429
2441
|
}
|
|
2430
2442
|
let t = Array.isArray(i.modelValue) ? i.modelValue : i.modelValue == null ? [] : [i.modelValue];
|
|
2431
|
-
p.value = t, l.value = "",
|
|
2443
|
+
p.value = t, l.value = "", d.value = 1, f.value = i.perPage, k = [], s.open();
|
|
2432
2444
|
}, { immediate: !0 });
|
|
2433
2445
|
function y() {
|
|
2434
|
-
|
|
2446
|
+
d.value = 1;
|
|
2435
2447
|
}
|
|
2436
2448
|
function T(e) {
|
|
2437
|
-
e !==
|
|
2449
|
+
e !== d.value && (d.value = e);
|
|
2438
2450
|
}
|
|
2439
2451
|
function E(e) {
|
|
2440
|
-
f.value = e,
|
|
2452
|
+
f.value = e, d.value = 1;
|
|
2441
2453
|
}
|
|
2442
2454
|
let O = b(() => p.value.length), k = [];
|
|
2443
2455
|
function A(e) {
|
|
@@ -2454,28 +2466,28 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2454
2466
|
a("update:modelValue", t), a("confirm", e), s.close();
|
|
2455
2467
|
}
|
|
2456
2468
|
return t({ tableRef: c }), (t, n) => {
|
|
2457
|
-
let r =
|
|
2458
|
-
return
|
|
2459
|
-
title: e.dialogTitle ||
|
|
2460
|
-
class:
|
|
2461
|
-
"cancel-text":
|
|
2462
|
-
"confirm-text":
|
|
2469
|
+
let r = re("el-button"), i = re("el-input"), a = H("loading");
|
|
2470
|
+
return R(), x(G(o), {
|
|
2471
|
+
title: e.dialogTitle || G(u)("components.asyncSelect.placeholder"),
|
|
2472
|
+
class: F(`dialog-list__modal w-[${e.dialogWidth}]`),
|
|
2473
|
+
"cancel-text": G(u)("components.dialogList.cancel"),
|
|
2474
|
+
"confirm-text": G(u)("components.dialogList.confirm")
|
|
2463
2475
|
}, {
|
|
2464
|
-
default: J(() => [w("div",
|
|
2476
|
+
default: J(() => [w("div", Fi, [w("div", Ii, [D(i, {
|
|
2465
2477
|
modelValue: l.value,
|
|
2466
2478
|
"onUpdate:modelValue": n[0] ||= (e) => l.value = e,
|
|
2467
|
-
placeholder:
|
|
2479
|
+
placeholder: G(u)("components.dialogList.placeholder"),
|
|
2468
2480
|
clearable: "",
|
|
2469
2481
|
style: { width: "260px" },
|
|
2470
2482
|
onKeyup: de(y, ["enter"]),
|
|
2471
2483
|
onClear: y
|
|
2472
2484
|
}, {
|
|
2473
2485
|
append: J(() => [D(r, {
|
|
2474
|
-
icon:
|
|
2486
|
+
icon: G(dt),
|
|
2475
2487
|
onClick: y
|
|
2476
2488
|
}, null, 8, ["icon"])]),
|
|
2477
2489
|
_: 1
|
|
2478
|
-
}, 8, ["modelValue", "placeholder"]), O.value > 0 ? (
|
|
2490
|
+
}, 8, ["modelValue", "placeholder"]), O.value > 0 ? (R(), C("span", Li, W(G(u)("components.dialogList.selectedCount", { count: O.value })), 1)) : S("", !0)]), ue((R(), C("div", Ri, [D(Pi, {
|
|
2479
2491
|
ref_key: "tableRef",
|
|
2480
2492
|
ref: c,
|
|
2481
2493
|
columns: e.columns,
|
|
@@ -2489,7 +2501,7 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2489
2501
|
"show-pagination": "",
|
|
2490
2502
|
total: v.value,
|
|
2491
2503
|
per_page: f.value,
|
|
2492
|
-
current_page:
|
|
2504
|
+
current_page: d.value,
|
|
2493
2505
|
"onUpdate:selectedKeys": A,
|
|
2494
2506
|
"onUpdate:per_page": E,
|
|
2495
2507
|
onSelectionChange: j,
|
|
@@ -2504,7 +2516,7 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2504
2516
|
"total",
|
|
2505
2517
|
"per_page",
|
|
2506
2518
|
"current_page"
|
|
2507
|
-
])])), [[a,
|
|
2519
|
+
])])), [[a, G(g)]])])]),
|
|
2508
2520
|
_: 1
|
|
2509
2521
|
}, 8, [
|
|
2510
2522
|
"title",
|
|
@@ -2516,7 +2528,7 @@ var Ti = { class: "table-entity__toolbar-right" }, Ei = { class: "buttons" }, Di
|
|
|
2516
2528
|
}
|
|
2517
2529
|
}), [["__scopeId", "data-v-34113a12"]]);
|
|
2518
2530
|
// src/components/async-select/async-select.utils.ts
|
|
2519
|
-
async function
|
|
2531
|
+
async function Bi({ activeValues: e, selectedValues: t, loadRows: n, resolveValue: r, toOption: i }) {
|
|
2520
2532
|
let a = e.filter((e) => !t.some((t) => String(t) === String(e)));
|
|
2521
2533
|
if (a.length === 0) return [];
|
|
2522
2534
|
let o = new Set(a.map(String)), s = await n(a), c = [];
|
|
@@ -2529,13 +2541,13 @@ async function Ri({ activeValues: e, selectedValues: t, loadRows: n, resolveValu
|
|
|
2529
2541
|
return c;
|
|
2530
2542
|
}
|
|
2531
2543
|
// src/components/async-select/async-select.vue?vue&type=script&setup=true&lang.ts
|
|
2532
|
-
var
|
|
2544
|
+
var Vi = { class: "async-select" }, Hi = { class: "async-select__value" }, Ui = ["src"], Wi = { class: "async-select__value-text" }, Gi = {
|
|
2533
2545
|
key: 0,
|
|
2534
2546
|
class: "async-select__option"
|
|
2535
|
-
},
|
|
2547
|
+
}, Ki = { class: "async-select__option-label" }, qi = ["src"], Ji = { class: "async-select__option-text" }, Yi = {
|
|
2536
2548
|
key: 0,
|
|
2537
2549
|
class: "async-select__option-desc"
|
|
2538
|
-
},
|
|
2550
|
+
}, Xi = ["title"], Zi = ["src", "alt"], Qi = /*@__PURE__*/ k({
|
|
2539
2551
|
__name: "async-select",
|
|
2540
2552
|
props: {
|
|
2541
2553
|
modelValue: {},
|
|
@@ -2567,7 +2579,7 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2567
2579
|
if (r.labelKey) return r.labelKey;
|
|
2568
2580
|
let e = r.columns?.[0];
|
|
2569
2581
|
return e?.dataKey ? e.dataKey : "label";
|
|
2570
|
-
}), c =
|
|
2582
|
+
}), c = z([]), l = z([]), d = z(0), f = z(!1), p = z(!0), m = z(""), h = z(!1), g = b(() => typeof r.fetcher == "function"), _ = /* @__PURE__ */ new Map(), v = null, y = b({
|
|
2571
2583
|
get: () => r.modelValue,
|
|
2572
2584
|
set: (e) => i("update:modelValue", e)
|
|
2573
2585
|
}), T = b(() => Array.isArray(r.modelValue) ? r.modelValue.filter((e) => e != null) : r.modelValue == null ? [] : [r.modelValue]);
|
|
@@ -2599,7 +2611,7 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2599
2611
|
function N(e) {
|
|
2600
2612
|
return T.value.find((t) => j(t, e)) ?? e;
|
|
2601
2613
|
}
|
|
2602
|
-
function
|
|
2614
|
+
function ee(e) {
|
|
2603
2615
|
for (let t of e) {
|
|
2604
2616
|
let e = {
|
|
2605
2617
|
...t,
|
|
@@ -2608,7 +2620,7 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2608
2620
|
l.value.find((t) => j(t.value, e.value)) || l.value.push(e);
|
|
2609
2621
|
}
|
|
2610
2622
|
}
|
|
2611
|
-
let
|
|
2623
|
+
let I = b(() => {
|
|
2612
2624
|
let e = c.value.map((e) => {
|
|
2613
2625
|
let t = A(e);
|
|
2614
2626
|
return {
|
|
@@ -2624,7 +2636,7 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2624
2636
|
q(o, (e) => {
|
|
2625
2637
|
g.value || (c.value = e ?? [], p.value = !1);
|
|
2626
2638
|
}, { immediate: !0 });
|
|
2627
|
-
async function
|
|
2639
|
+
async function L(e = !1) {
|
|
2628
2640
|
let t = m.value || void 0, n = t ?? "";
|
|
2629
2641
|
if (!e && v === n) return;
|
|
2630
2642
|
let r = _.get(n);
|
|
@@ -2632,8 +2644,8 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2632
2644
|
await r;
|
|
2633
2645
|
return;
|
|
2634
2646
|
}
|
|
2635
|
-
|
|
2636
|
-
let i =
|
|
2647
|
+
d.value = 1, c.value = [], p.value = !0;
|
|
2648
|
+
let i = ne(1, t);
|
|
2637
2649
|
_.set(n, i);
|
|
2638
2650
|
try {
|
|
2639
2651
|
await i, (m.value || void 0) === t && (v = n);
|
|
@@ -2641,10 +2653,10 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2641
2653
|
_.get(n) === i && _.delete(n);
|
|
2642
2654
|
}
|
|
2643
2655
|
}
|
|
2644
|
-
async function
|
|
2645
|
-
!f.value && p.value && await
|
|
2656
|
+
async function te() {
|
|
2657
|
+
!f.value && p.value && await ne(d.value + 1);
|
|
2646
2658
|
}
|
|
2647
|
-
async function
|
|
2659
|
+
async function ne(e, t = m.value || void 0) {
|
|
2648
2660
|
if (r.fetcher) {
|
|
2649
2661
|
f.value = !0;
|
|
2650
2662
|
try {
|
|
@@ -2655,17 +2667,17 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2655
2667
|
});
|
|
2656
2668
|
if ((m.value || void 0) !== t) return;
|
|
2657
2669
|
let i = n.items ?? [];
|
|
2658
|
-
e === 1 ? c.value = i : c.value.push(...i),
|
|
2670
|
+
e === 1 ? c.value = i : c.value.push(...i), d.value = e, p.value = e * r.perPage < Number(n.total ?? 0);
|
|
2659
2671
|
} finally {
|
|
2660
2672
|
f.value = !1;
|
|
2661
2673
|
}
|
|
2662
2674
|
}
|
|
2663
2675
|
}
|
|
2664
|
-
async function
|
|
2665
|
-
h.value = e, e && g.value && c.value.length === 0 && await
|
|
2676
|
+
async function B(e) {
|
|
2677
|
+
h.value = e, e && g.value && c.value.length === 0 && await L();
|
|
2666
2678
|
}
|
|
2667
2679
|
q([T, o], async ([e, t]) => {
|
|
2668
|
-
e.length === 0 ? l.value = [] : (
|
|
2680
|
+
e.length === 0 ? l.value = [] : (ee(t.filter((t) => e.some((e) => j(e, E(t)))).map(A)), g.value && r.fetcher && ee(await Bi({
|
|
2669
2681
|
activeValues: e,
|
|
2670
2682
|
selectedValues: l.value.map((e) => e.value),
|
|
2671
2683
|
loadRows: (e) => r.fetcher({
|
|
@@ -2677,16 +2689,16 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2677
2689
|
toOption: A
|
|
2678
2690
|
})));
|
|
2679
2691
|
}, { immediate: !0 });
|
|
2680
|
-
let
|
|
2681
|
-
function
|
|
2682
|
-
r.disabled || (
|
|
2692
|
+
let V = z(!1);
|
|
2693
|
+
function re() {
|
|
2694
|
+
r.disabled || (V.value = !0);
|
|
2683
2695
|
}
|
|
2684
|
-
function
|
|
2685
|
-
|
|
2696
|
+
function H(e) {
|
|
2697
|
+
ee(e.map(A));
|
|
2686
2698
|
let t = r.multiple ? e.map((e) => E(e)) : e[0] ? E(e[0]) : null;
|
|
2687
2699
|
i("update:modelValue", t), i("change", t, e);
|
|
2688
2700
|
}
|
|
2689
|
-
async function
|
|
2701
|
+
async function U(e) {
|
|
2690
2702
|
if (r.fetcher) {
|
|
2691
2703
|
let t = await r.fetcher(e);
|
|
2692
2704
|
return {
|
|
@@ -2700,16 +2712,16 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2700
2712
|
total: n.length
|
|
2701
2713
|
};
|
|
2702
2714
|
}
|
|
2703
|
-
let ie = b(() => r.placeholder ||
|
|
2715
|
+
let ie = b(() => r.placeholder || u("components.asyncSelect.placeholder")), ae = b(() => r.dialogTitle || u("components.asyncSelect.placeholder"));
|
|
2704
2716
|
return t({
|
|
2705
|
-
reload: () =>
|
|
2717
|
+
reload: () => L(!0),
|
|
2706
2718
|
allItems: c
|
|
2707
|
-
}), (t, n) => (
|
|
2708
|
-
D(
|
|
2719
|
+
}), (t, n) => (R(), C("div", Vi, [
|
|
2720
|
+
D(G(Fe), P({
|
|
2709
2721
|
modelValue: y.value,
|
|
2710
2722
|
"onUpdate:modelValue": n[0] ||= (e) => y.value = e,
|
|
2711
2723
|
class: "async-select__select",
|
|
2712
|
-
options:
|
|
2724
|
+
options: I.value,
|
|
2713
2725
|
loading: f.value,
|
|
2714
2726
|
multiple: e.multiple,
|
|
2715
2727
|
filterable: "",
|
|
@@ -2717,26 +2729,26 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2717
2729
|
remote: g.value,
|
|
2718
2730
|
"remote-show-suffix": "",
|
|
2719
2731
|
"remote-method": g.value ? (e) => {
|
|
2720
|
-
m.value !== e && (m.value = e, M(v) ? v.value = null : v = null),
|
|
2732
|
+
m.value !== e && (m.value = e, M(v) ? v.value = null : v = null), L();
|
|
2721
2733
|
} : void 0,
|
|
2722
2734
|
placeholder: ie.value,
|
|
2723
2735
|
disabled: e.disabled
|
|
2724
2736
|
}, t.$attrs, {
|
|
2725
|
-
onVisibleChange:
|
|
2726
|
-
onEndReached:
|
|
2737
|
+
onVisibleChange: B,
|
|
2738
|
+
onEndReached: te
|
|
2727
2739
|
}), {
|
|
2728
|
-
label: J((e) => [w("span",
|
|
2740
|
+
label: J((e) => [w("span", Hi, [e?.label?.flag ? (R(), C("img", {
|
|
2729
2741
|
key: 0,
|
|
2730
2742
|
class: "async-select__flag",
|
|
2731
2743
|
src: e.label.flag,
|
|
2732
2744
|
alt: ""
|
|
2733
|
-
}, null, 8,
|
|
2734
|
-
default: J((e) => [e?.item ? (
|
|
2745
|
+
}, null, 8, Ui)) : S("", !0), w("span", Wi, W(e?.label?.label ?? ""), 1)])]),
|
|
2746
|
+
default: J((e) => [e?.item ? (R(), C("div", Gi, [w("p", Ki, [e.item.label.flag ? (R(), C("img", {
|
|
2735
2747
|
key: 0,
|
|
2736
2748
|
class: "async-select__flag",
|
|
2737
2749
|
src: e.item.label.flag,
|
|
2738
2750
|
alt: ""
|
|
2739
|
-
}, null, 8,
|
|
2751
|
+
}, null, 8, qi)) : S("", !0), w("span", Ji, W(e.item.label.label), 1)]), e.item.label.subtitle ? (R(), C("p", Yi, W(e.item.label.subtitle), 1)) : S("", !0)])) : S("", !0)]),
|
|
2740
2752
|
_: 1
|
|
2741
2753
|
}, 16, [
|
|
2742
2754
|
"modelValue",
|
|
@@ -2748,32 +2760,32 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2748
2760
|
"placeholder",
|
|
2749
2761
|
"disabled"
|
|
2750
2762
|
]),
|
|
2751
|
-
e.columns.length > 0 ? (
|
|
2763
|
+
e.columns.length > 0 ? (R(), C("button", {
|
|
2752
2764
|
key: 0,
|
|
2753
2765
|
type: "button",
|
|
2754
|
-
class:
|
|
2755
|
-
title:
|
|
2766
|
+
class: F(["async-select__inner-trigger", { "is-disabled": e.disabled }]),
|
|
2767
|
+
title: G(u)("components.asyncSelect.dialogSelect"),
|
|
2756
2768
|
onMousedown: n[1] ||= fe(() => {}, ["prevent"]),
|
|
2757
|
-
onClick: fe(
|
|
2758
|
-
}, [D(
|
|
2769
|
+
onClick: fe(re, ["stop"])
|
|
2770
|
+
}, [D(G(Z), null, {
|
|
2759
2771
|
default: J(() => [w("img", {
|
|
2760
|
-
src:
|
|
2761
|
-
alt:
|
|
2762
|
-
}, null, 8,
|
|
2772
|
+
src: G(fn),
|
|
2773
|
+
alt: G(u)("components.asyncSelect.more")
|
|
2774
|
+
}, null, 8, Zi)]),
|
|
2763
2775
|
_: 1
|
|
2764
|
-
})], 42,
|
|
2765
|
-
e.columns.length > 0 ? (
|
|
2776
|
+
})], 42, Xi)) : S("", !0),
|
|
2777
|
+
e.columns.length > 0 ? (R(), x(zi, {
|
|
2766
2778
|
key: 1,
|
|
2767
|
-
visible:
|
|
2779
|
+
visible: V.value,
|
|
2768
2780
|
columns: e.columns,
|
|
2769
2781
|
"model-value": e.modelValue,
|
|
2770
2782
|
multiple: e.multiple,
|
|
2771
|
-
fetcher: (e) =>
|
|
2783
|
+
fetcher: (e) => U(e),
|
|
2772
2784
|
"row-key": e.valueKey,
|
|
2773
2785
|
"dialog-title": ae.value,
|
|
2774
2786
|
"per-page": e.perPage,
|
|
2775
|
-
"onUpdate:visible": n[2] ||= (e) =>
|
|
2776
|
-
onConfirm:
|
|
2787
|
+
"onUpdate:visible": n[2] ||= (e) => V.value = e,
|
|
2788
|
+
onConfirm: H
|
|
2777
2789
|
}, null, 8, [
|
|
2778
2790
|
"visible",
|
|
2779
2791
|
"columns",
|
|
@@ -2786,26 +2798,26 @@ var zi = { class: "async-select" }, Bi = { class: "async-select__value" }, Vi =
|
|
|
2786
2798
|
])) : S("", !0)
|
|
2787
2799
|
]));
|
|
2788
2800
|
}
|
|
2789
|
-
}),
|
|
2790
|
-
return
|
|
2791
|
-
} } },
|
|
2801
|
+
}), $i = /* @__PURE__ */ e({ default: () => ea }), ea = /*#__PURE__*/ f(Qi, [["__scopeId", "data-v-a1f5097a"]]), ta = { theme: { get cardShadow() {
|
|
2802
|
+
return c().value;
|
|
2803
|
+
} } }, na = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
2792
2804
|
inheritAttrs: !1,
|
|
2793
2805
|
__name: "index",
|
|
2794
2806
|
setup(e) {
|
|
2795
|
-
let t = b(() =>
|
|
2796
|
-
return (e, n) => (
|
|
2807
|
+
let t = b(() => ta.theme.cardShadow);
|
|
2808
|
+
return (e, n) => (R(), x(G(X), P({ class: "box-card" }, e.$attrs, { shadow: t.value }), T({ _: 2 }, [B(e.$slots, (t, n) => ({
|
|
2797
2809
|
name: n,
|
|
2798
|
-
fn: J((t) => [
|
|
2810
|
+
fn: J((t) => [V(e.$slots, n, I(A(t ?? {})), void 0, !0)])
|
|
2799
2811
|
}))]), 1040, ["shadow"]));
|
|
2800
2812
|
}
|
|
2801
|
-
}), [["__scopeId", "data-v-ed977a22"]]),
|
|
2802
|
-
function
|
|
2803
|
-
|
|
2813
|
+
}), [["__scopeId", "data-v-ed977a22"]]), ra = /* @__PURE__ */ new Map();
|
|
2814
|
+
function ia(e) {
|
|
2815
|
+
ra.set(e.key, e);
|
|
2804
2816
|
}
|
|
2805
|
-
function
|
|
2806
|
-
return
|
|
2817
|
+
function aa(e) {
|
|
2818
|
+
return ra.get(e);
|
|
2807
2819
|
}
|
|
2808
|
-
function
|
|
2820
|
+
function oa(e, { keyword: t, page: n, per_page: r }, i) {
|
|
2809
2821
|
let a = t?.trim().toLowerCase(), o = a ? e.filter((e) => i.some((t) => String(e[t] ?? "").toLowerCase().includes(a))) : e;
|
|
2810
2822
|
return {
|
|
2811
2823
|
items: o.slice((n - 1) * r, n * r),
|
|
@@ -2813,13 +2825,13 @@ function ia(e, { keyword: t, page: n, per_page: r }, i) {
|
|
|
2813
2825
|
};
|
|
2814
2826
|
}
|
|
2815
2827
|
// src/components/schema-form/readonly-text.vue?vue&type=script&setup=true&lang.ts
|
|
2816
|
-
var
|
|
2828
|
+
var sa = { class: "readonly-text" }, ca = {
|
|
2817
2829
|
key: 0,
|
|
2818
2830
|
class: "readonly-text__value"
|
|
2819
|
-
},
|
|
2831
|
+
}, la = {
|
|
2820
2832
|
key: 1,
|
|
2821
2833
|
class: "readonly-text__empty"
|
|
2822
|
-
},
|
|
2834
|
+
}, ua = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
2823
2835
|
__name: "readonly-text",
|
|
2824
2836
|
props: {
|
|
2825
2837
|
copyable: { type: Boolean },
|
|
@@ -2831,33 +2843,33 @@ var aa = { class: "readonly-text" }, oa = {
|
|
|
2831
2843
|
return e == null || e === "" ? "" : Array.isArray(e) ? e.join(", ") : String(e);
|
|
2832
2844
|
}), a = b(() => t.copyable && r.value && i.value);
|
|
2833
2845
|
async function o() {
|
|
2834
|
-
await n(i.value), Q.success(
|
|
2846
|
+
await n(i.value), Q.success(u("schemaForm.copied"));
|
|
2835
2847
|
}
|
|
2836
|
-
return (e, t) => (
|
|
2848
|
+
return (e, t) => (R(), C("div", sa, [i.value ? (R(), C("span", ca, W(i.value), 1)) : (R(), C("span", la, W(G(u)("schemaForm.empty")), 1)), a.value ? (R(), x(G(Z), {
|
|
2837
2849
|
key: 2,
|
|
2838
2850
|
class: "readonly-text__copy",
|
|
2839
|
-
title:
|
|
2851
|
+
title: G(u)("schemaForm.copy"),
|
|
2840
2852
|
onClick: o
|
|
2841
2853
|
}, {
|
|
2842
|
-
default: J(() => [D(
|
|
2854
|
+
default: J(() => [D(G(et))]),
|
|
2843
2855
|
_: 1
|
|
2844
2856
|
}, 8, ["title"])) : S("", !0)]));
|
|
2845
2857
|
}
|
|
2846
|
-
}), [["__scopeId", "data-v-1f95eeac"]]),
|
|
2847
|
-
function
|
|
2858
|
+
}), [["__scopeId", "data-v-1f95eeac"]]), da = ie({});
|
|
2859
|
+
function fa(e) {
|
|
2848
2860
|
return typeof e == "object" && e && "component" in e && e.component ? e : { component: e };
|
|
2849
2861
|
}
|
|
2850
|
-
function
|
|
2851
|
-
for (let [t, n] of Object.entries(e)) n && (
|
|
2862
|
+
function pa(e) {
|
|
2863
|
+
for (let [t, n] of Object.entries(e)) n && (da[t] = n);
|
|
2852
2864
|
}
|
|
2853
|
-
function
|
|
2865
|
+
function ma(e) {
|
|
2854
2866
|
if (!e) return;
|
|
2855
|
-
if (typeof e != "string") return
|
|
2856
|
-
let t =
|
|
2857
|
-
return t ?
|
|
2867
|
+
if (typeof e != "string") return fa(e);
|
|
2868
|
+
let t = da[e];
|
|
2869
|
+
return t ? fa(t) : void 0;
|
|
2858
2870
|
}
|
|
2859
2871
|
// src/components/schema-form/schema-form.util.ts
|
|
2860
|
-
var
|
|
2872
|
+
var ha = /* @__PURE__ */ new Set([
|
|
2861
2873
|
"async-select",
|
|
2862
2874
|
"cascader",
|
|
2863
2875
|
"checkbox",
|
|
@@ -2871,43 +2883,43 @@ var pa = /* @__PURE__ */ new Set([
|
|
|
2871
2883
|
"switch",
|
|
2872
2884
|
"upload"
|
|
2873
2885
|
]);
|
|
2874
|
-
function
|
|
2875
|
-
return
|
|
2886
|
+
function ga(e) {
|
|
2887
|
+
return ha.has(e.type);
|
|
2876
2888
|
}
|
|
2877
|
-
function
|
|
2889
|
+
function _a(e) {
|
|
2878
2890
|
return e.type === "group";
|
|
2879
2891
|
}
|
|
2880
|
-
function
|
|
2881
|
-
return e.flatMap((e) =>
|
|
2892
|
+
function va(e) {
|
|
2893
|
+
return e.flatMap((e) => _a(e) ? e.children : [e]);
|
|
2882
2894
|
}
|
|
2883
|
-
function
|
|
2895
|
+
function ya(e, t) {
|
|
2884
2896
|
return typeof e == "function" ? e(t) : e === !0;
|
|
2885
2897
|
}
|
|
2886
|
-
function
|
|
2887
|
-
return t.mode === "create" && e.hideOnCreate || t.mode === "edit" && e.hideOnEdit ? !0 :
|
|
2898
|
+
function ba(e, t) {
|
|
2899
|
+
return t.mode === "create" && e.hideOnCreate || t.mode === "edit" && e.hideOnEdit ? !0 : ya(e.hidden, t);
|
|
2888
2900
|
}
|
|
2889
|
-
function
|
|
2901
|
+
function xa(e) {
|
|
2890
2902
|
if (e.placeholder) return e.placeholder;
|
|
2891
2903
|
let t = e.label || e.prop;
|
|
2892
|
-
return
|
|
2904
|
+
return ga(e) ? u("validation.selectField", { field: t }) : u("validation.enterField", { field: t });
|
|
2893
2905
|
}
|
|
2894
|
-
function
|
|
2906
|
+
function Sa(e, t) {
|
|
2895
2907
|
let n = e.rules ? [...e.rules] : [];
|
|
2896
|
-
return
|
|
2908
|
+
return ya(e.required, t) && n.unshift(e.translateConfig && [
|
|
2897
2909
|
"rich-text",
|
|
2898
2910
|
"text",
|
|
2899
2911
|
"textarea"
|
|
2900
2912
|
].includes(e.type) ? {
|
|
2901
|
-
message:
|
|
2913
|
+
message: xa(e),
|
|
2902
2914
|
trigger: "change",
|
|
2903
2915
|
validator: (t, n) => {
|
|
2904
2916
|
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;
|
|
2905
|
-
return n && typeof n == "object" && Object.values(n).some((e) => r(e)) || Error(
|
|
2917
|
+
return n && typeof n == "object" && Object.values(n).some((e) => r(e)) || Error(xa(e));
|
|
2906
2918
|
}
|
|
2907
2919
|
} : {
|
|
2908
2920
|
required: !0,
|
|
2909
|
-
message:
|
|
2910
|
-
trigger:
|
|
2921
|
+
message: xa(e),
|
|
2922
|
+
trigger: ga(e) ? "change" : "blur"
|
|
2911
2923
|
}), n.map((e) => {
|
|
2912
2924
|
if (e.asyncValidator) {
|
|
2913
2925
|
let n = e.asyncValidator;
|
|
@@ -2927,11 +2939,11 @@ function ba(e, t) {
|
|
|
2927
2939
|
});
|
|
2928
2940
|
}
|
|
2929
2941
|
// src/components/rich-text-editor/index.vue?vue&type=script&setup=true&lang.ts
|
|
2930
|
-
var
|
|
2942
|
+
var Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["disabled"], Oa = { value: "" }, ka = ["title"], Aa = ["title"], ja = ["title"], Ma = ["title"], Na = ["title"], Pa = ["title"], Fa = ["disabled"], Ia = ["value"], La = ["disabled"], Ra = ["value"], za = ["disabled"], Ba = { value: "paragraph" }, Va = { value: "h1" }, Ha = { value: "h2" }, Ua = { value: "h3" }, Wa = { value: "blockquote" }, Ga = ["title"], Ka = ["title"], qa = ["title"], Ja = ["title"], Ya = ["title"], Xa = ["title"], Za = ["title"], Qa = ["title"], $a = ["title"], eo = ["title"], to = ["title"], no = ["disabled"], ro = { value: "" }, io = { value: "insertTable" }, ao = { value: "addColumnBefore" }, oo = { value: "addColumnAfter" }, so = { value: "deleteColumn" }, co = { value: "addRowBefore" }, lo = { value: "addRowAfter" }, uo = { value: "deleteRow" }, fo = { value: "deleteTable" }, po = ["title"], mo = ["title"], ho = ["title"], go = ["title"], _o = ["title"], vo = [
|
|
2931
2943
|
"title",
|
|
2932
2944
|
"disabled",
|
|
2933
2945
|
"onClick"
|
|
2934
|
-
],
|
|
2946
|
+
], yo = { key: 1 }, bo = ["readonly"], xo = /*@__PURE__*/ k({
|
|
2935
2947
|
__name: "index",
|
|
2936
2948
|
props: {
|
|
2937
2949
|
editable: {
|
|
@@ -2975,7 +2987,7 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
2975
2987
|
"20px",
|
|
2976
2988
|
"24px",
|
|
2977
2989
|
"32px"
|
|
2978
|
-
], s =
|
|
2990
|
+
], s = z(r.modelValue), c = z(!1), l = z(!1), d = z(0), f = b(() => r.placeholder || u("components.richTextEditor.placeholder")), p = dn({
|
|
2979
2991
|
content: r.modelValue,
|
|
2980
2992
|
editable: r.editable,
|
|
2981
2993
|
extensions: [
|
|
@@ -3015,11 +3027,11 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3015
3027
|
],
|
|
3016
3028
|
editorProps: { attributes: { class: "tiptap-editor-content" } },
|
|
3017
3029
|
onSelectionUpdate: () => {
|
|
3018
|
-
|
|
3030
|
+
d.value += 1;
|
|
3019
3031
|
},
|
|
3020
3032
|
onUpdate: ({ editor: e }) => {
|
|
3021
3033
|
let t = e.getHTML();
|
|
3022
|
-
s.value = t,
|
|
3034
|
+
s.value = t, d.value += 1, i("update:modelValue", t);
|
|
3023
3035
|
}
|
|
3024
3036
|
}), m = b(() => !r.editable);
|
|
3025
3037
|
function h() {
|
|
@@ -3028,7 +3040,7 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3028
3040
|
function g(e) {
|
|
3029
3041
|
s.value = e, p.value && p.value.getHTML() !== e && p.value.commands.setContent(e, { emitUpdate: !0 });
|
|
3030
3042
|
}
|
|
3031
|
-
let _ = b(() => (
|
|
3043
|
+
let _ = b(() => (d.value, {
|
|
3032
3044
|
...r.toolContext ?? {},
|
|
3033
3045
|
editable: r.editable,
|
|
3034
3046
|
editor: p.value,
|
|
@@ -3039,7 +3051,7 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3039
3051
|
function v(e, t) {
|
|
3040
3052
|
return typeof e == "function" ? e(_.value) : e ?? t;
|
|
3041
3053
|
}
|
|
3042
|
-
let T = b(() => (
|
|
3054
|
+
let T = b(() => (d.value, (r.richTextTools ?? []).filter((e) => v(e.visible, !0)).map((e, t) => ({
|
|
3043
3055
|
index: t,
|
|
3044
3056
|
tool: e
|
|
3045
3057
|
})).sort((e, t) => (e.tool.order ?? 0) - (t.tool.order ?? 0) || e.index - t.index).map(({ tool: e }) => e)));
|
|
@@ -3051,14 +3063,14 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3051
3063
|
}
|
|
3052
3064
|
let A = b({
|
|
3053
3065
|
get() {
|
|
3054
|
-
return
|
|
3066
|
+
return d.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";
|
|
3055
3067
|
},
|
|
3056
3068
|
set(e) {
|
|
3057
|
-
|
|
3069
|
+
ee(e);
|
|
3058
3070
|
}
|
|
3059
3071
|
}), j = b({
|
|
3060
3072
|
get() {
|
|
3061
|
-
return
|
|
3073
|
+
return d.value, String(p.value?.getAttributes("textStyle").fontFamily ?? "");
|
|
3062
3074
|
},
|
|
3063
3075
|
set(e) {
|
|
3064
3076
|
let t = p.value?.chain().focus();
|
|
@@ -3066,7 +3078,7 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3066
3078
|
}
|
|
3067
3079
|
}), M = b({
|
|
3068
3080
|
get() {
|
|
3069
|
-
return
|
|
3081
|
+
return d.value, String(p.value?.getAttributes("textStyle").fontSize ?? "16px");
|
|
3070
3082
|
},
|
|
3071
3083
|
set(e) {
|
|
3072
3084
|
p.value?.chain().focus().setFontSize(e).run();
|
|
@@ -3082,33 +3094,33 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3082
3094
|
t && (t.options.placeholder = e, p.value?.view.dispatch(p.value.state.tr));
|
|
3083
3095
|
});
|
|
3084
3096
|
function N(e) {
|
|
3085
|
-
p.value && !m.value && (e(p.value),
|
|
3097
|
+
p.value && !m.value && (e(p.value), d.value += 1);
|
|
3086
3098
|
}
|
|
3087
|
-
function
|
|
3099
|
+
function ee(e) {
|
|
3088
3100
|
N((t) => {
|
|
3089
3101
|
let n = t.chain().focus();
|
|
3090
3102
|
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();
|
|
3091
3103
|
});
|
|
3092
3104
|
}
|
|
3093
|
-
function
|
|
3105
|
+
function I() {
|
|
3094
3106
|
p.value && p.value.getHTML() !== s.value && p.value.commands.setContent(s.value, { emitUpdate: !0 });
|
|
3095
3107
|
}
|
|
3096
|
-
function ee() {
|
|
3097
|
-
c.value ? L() : s.value = p.value?.getHTML() ?? r.modelValue, c.value = !c.value;
|
|
3098
|
-
}
|
|
3099
3108
|
function te() {
|
|
3109
|
+
c.value ? I() : s.value = p.value?.getHTML() ?? r.modelValue, c.value = !c.value;
|
|
3110
|
+
}
|
|
3111
|
+
function ne() {
|
|
3100
3112
|
if (m.value) return;
|
|
3101
|
-
let e = p.value?.getAttributes("link").href, t = window.prompt(
|
|
3113
|
+
let e = p.value?.getAttributes("link").href, t = window.prompt(u("components.richTextEditor.linkPrompt"), e ?? "");
|
|
3102
3114
|
if (t === null) return;
|
|
3103
3115
|
let n = t.trim();
|
|
3104
|
-
n ? p.value?.chain().focus().extendMarkRange("link").setLink({ href:
|
|
3116
|
+
n ? p.value?.chain().focus().extendMarkRange("link").setLink({ href: H(n) }).run() : p.value?.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
3105
3117
|
}
|
|
3106
|
-
function
|
|
3118
|
+
function re() {
|
|
3107
3119
|
if (m.value) return;
|
|
3108
|
-
let e = window.prompt(
|
|
3120
|
+
let e = window.prompt(u("components.richTextEditor.imagePrompt"));
|
|
3109
3121
|
e && p.value?.chain().focus().setImage({ src: e.trim() }).run();
|
|
3110
3122
|
}
|
|
3111
|
-
function
|
|
3123
|
+
function H(e) {
|
|
3112
3124
|
return /^(https?:|mailto:|tel:)/i.test(e) ? e : "https://" + e;
|
|
3113
3125
|
}
|
|
3114
3126
|
function ie(e) {
|
|
@@ -3119,10 +3131,10 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3119
3131
|
let t = e.target.value;
|
|
3120
3132
|
N((e) => e.chain().focus().setBackgroundColor(t).run());
|
|
3121
3133
|
}
|
|
3122
|
-
function
|
|
3134
|
+
function oe(e) {
|
|
3123
3135
|
N((t) => t.chain().focus().setTextAlign(e).run());
|
|
3124
3136
|
}
|
|
3125
|
-
function
|
|
3137
|
+
function K(e) {
|
|
3126
3138
|
let t = e.target.value;
|
|
3127
3139
|
t && N((e) => e.chain().focus().setLineHeight(t).run());
|
|
3128
3140
|
}
|
|
@@ -3148,7 +3160,7 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3148
3160
|
e.chain().focus().clearNodes().unsetAllMarks().unsetTextAlign().run();
|
|
3149
3161
|
});
|
|
3150
3162
|
}
|
|
3151
|
-
let X = (e, t) => (
|
|
3163
|
+
let X = (e, t) => (d.value, p.value?.isActive(e, t) ?? !1), pe = (e) => (d.value, p.value?.isActive({ textAlign: e }) || e === "left" && ![
|
|
3152
3164
|
"center",
|
|
3153
3165
|
"right",
|
|
3154
3166
|
"justify"
|
|
@@ -3156,9 +3168,9 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3156
3168
|
return t({
|
|
3157
3169
|
editor: p,
|
|
3158
3170
|
clearFormat: Y
|
|
3159
|
-
}), (t, n) =>
|
|
3171
|
+
}), (t, n) => G(p) ? (R(), C("div", {
|
|
3160
3172
|
key: 0,
|
|
3161
|
-
class:
|
|
3173
|
+
class: F(["rich-text-editor", {
|
|
3162
3174
|
"is-fullscreen": l.value,
|
|
3163
3175
|
"is-source": c.value
|
|
3164
3176
|
}])
|
|
@@ -3168,244 +3180,244 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3168
3180
|
}, [
|
|
3169
3181
|
w("button", {
|
|
3170
3182
|
type: "button",
|
|
3171
|
-
title:
|
|
3172
|
-
onClick: n[0] ||= (e) =>
|
|
3173
|
-
}, [D(
|
|
3183
|
+
title: G(u)("components.richTextEditor.undo"),
|
|
3184
|
+
onClick: n[0] ||= (e) => G(p).chain().focus().undo().run()
|
|
3185
|
+
}, [D(G(Gt), { size: 17 })], 8, Ca),
|
|
3174
3186
|
w("button", {
|
|
3175
3187
|
type: "button",
|
|
3176
|
-
title:
|
|
3177
|
-
onClick: n[1] ||= (e) =>
|
|
3178
|
-
}, [D(
|
|
3188
|
+
title: G(u)("components.richTextEditor.redo"),
|
|
3189
|
+
onClick: n[1] ||= (e) => G(p).chain().focus().redo().run()
|
|
3190
|
+
}, [D(G(Vt), { size: 17 })], 8, wa),
|
|
3179
3191
|
n[27] ||= w("span", { class: "rich-text-separator" }, null, -1),
|
|
3180
3192
|
w("button", {
|
|
3181
3193
|
type: "button",
|
|
3182
|
-
title:
|
|
3183
|
-
onClick:
|
|
3184
|
-
}, [D(
|
|
3194
|
+
title: G(u)("components.richTextEditor.insertImage"),
|
|
3195
|
+
onClick: re
|
|
3196
|
+
}, [D(G(kt), { size: 17 })], 8, Ta),
|
|
3185
3197
|
w("label", {
|
|
3186
3198
|
class: "rich-text-select-wrap rich-text-select-wrap--line",
|
|
3187
|
-
title:
|
|
3188
|
-
}, [D(
|
|
3199
|
+
title: G(u)("components.richTextEditor.lineHeight")
|
|
3200
|
+
}, [D(G(jt), { size: 17 }), w("select", {
|
|
3189
3201
|
disabled: m.value,
|
|
3190
|
-
onChange:
|
|
3202
|
+
onChange: K
|
|
3191
3203
|
}, [
|
|
3192
|
-
w("option",
|
|
3204
|
+
w("option", Oa, W(G(u)("components.richTextEditor.lineHeight")), 1),
|
|
3193
3205
|
n[22] ||= w("option", { value: "1.2" }, "1.2", -1),
|
|
3194
3206
|
n[23] ||= w("option", { value: "1.5" }, "1.5", -1),
|
|
3195
3207
|
n[24] ||= w("option", { value: "1.75" }, "1.75", -1),
|
|
3196
3208
|
n[25] ||= w("option", { value: "2" }, "2", -1)
|
|
3197
|
-
], 40,
|
|
3209
|
+
], 40, Da)], 8, Ea),
|
|
3198
3210
|
n[28] ||= w("span", { class: "rich-text-separator" }, null, -1),
|
|
3199
3211
|
w("button", {
|
|
3200
3212
|
type: "button",
|
|
3201
|
-
class:
|
|
3202
|
-
title:
|
|
3203
|
-
onClick: n[2] ||= (e) =>
|
|
3204
|
-
}, [D(
|
|
3213
|
+
class: F({ "is-active": X("bold") }),
|
|
3214
|
+
title: G(u)("components.richTextEditor.bold"),
|
|
3215
|
+
onClick: n[2] ||= (e) => G(p).chain().focus().toggleBold().run()
|
|
3216
|
+
}, [D(G(Tt), { size: 17 })], 10, ka),
|
|
3205
3217
|
w("button", {
|
|
3206
3218
|
type: "button",
|
|
3207
|
-
class:
|
|
3208
|
-
title:
|
|
3209
|
-
onClick: n[3] ||= (e) =>
|
|
3210
|
-
}, [D(
|
|
3219
|
+
class: F({ "is-active": X("italic") }),
|
|
3220
|
+
title: G(u)("components.richTextEditor.italic"),
|
|
3221
|
+
onClick: n[3] ||= (e) => G(p).chain().focus().toggleItalic().run()
|
|
3222
|
+
}, [D(G(Mt), { size: 17 })], 10, Aa),
|
|
3211
3223
|
w("button", {
|
|
3212
3224
|
type: "button",
|
|
3213
|
-
class:
|
|
3214
|
-
title:
|
|
3215
|
-
onClick: n[4] ||= (e) =>
|
|
3216
|
-
}, [D(
|
|
3225
|
+
class: F({ "is-active": X("underline") }),
|
|
3226
|
+
title: G(u)("components.richTextEditor.underline"),
|
|
3227
|
+
onClick: n[4] ||= (e) => G(p).chain().focus().toggleUnderline().run()
|
|
3228
|
+
}, [D(G(Wt), { size: 17 })], 10, ja),
|
|
3217
3229
|
w("button", {
|
|
3218
3230
|
type: "button",
|
|
3219
|
-
class:
|
|
3220
|
-
title:
|
|
3221
|
-
onClick: n[5] ||= (e) =>
|
|
3222
|
-
}, [D(
|
|
3231
|
+
class: F({ "is-active": X("strike") }),
|
|
3232
|
+
title: G(u)("components.richTextEditor.strike"),
|
|
3233
|
+
onClick: n[5] ||= (e) => G(p).chain().focus().toggleStrike().run()
|
|
3234
|
+
}, [D(G(Ht), { size: 17 })], 10, Ma),
|
|
3223
3235
|
w("label", {
|
|
3224
3236
|
class: "rich-text-color",
|
|
3225
|
-
title:
|
|
3226
|
-
}, [D(
|
|
3237
|
+
title: G(u)("components.richTextEditor.textColor")
|
|
3238
|
+
}, [D(G(zt), { size: 17 }), w("input", {
|
|
3227
3239
|
type: "color",
|
|
3228
3240
|
value: "#111827",
|
|
3229
3241
|
onInput: ie
|
|
3230
|
-
}, null, 32)], 8,
|
|
3242
|
+
}, null, 32)], 8, Na),
|
|
3231
3243
|
w("label", {
|
|
3232
3244
|
class: "rich-text-color",
|
|
3233
|
-
title:
|
|
3234
|
-
}, [D(
|
|
3245
|
+
title: G(u)("components.richTextEditor.highlight")
|
|
3246
|
+
}, [D(G(Ot), { size: 17 }), w("input", {
|
|
3235
3247
|
type: "color",
|
|
3236
3248
|
value: "#fff3bf",
|
|
3237
3249
|
onInput: ae
|
|
3238
|
-
}, null, 32)], 8,
|
|
3250
|
+
}, null, 32)], 8, Pa),
|
|
3239
3251
|
n[29] ||= w("span", { class: "rich-text-separator" }, null, -1),
|
|
3240
3252
|
ue(w("select", {
|
|
3241
3253
|
"onUpdate:modelValue": n[6] ||= (e) => j.value = e,
|
|
3242
3254
|
class: "rich-text-select rich-text-select--font",
|
|
3243
3255
|
disabled: m.value
|
|
3244
|
-
}, [(
|
|
3256
|
+
}, [(R(), C(y, null, B(a, (e) => w("option", {
|
|
3245
3257
|
key: e.label,
|
|
3246
3258
|
value: e.value
|
|
3247
|
-
}, W(e.label), 9,
|
|
3259
|
+
}, W(e.label), 9, Ia)), 64))], 8, Fa), [[ce, j.value]]),
|
|
3248
3260
|
ue(w("select", {
|
|
3249
3261
|
"onUpdate:modelValue": n[7] ||= (e) => M.value = e,
|
|
3250
3262
|
class: "rich-text-select rich-text-select--size",
|
|
3251
3263
|
disabled: m.value
|
|
3252
|
-
}, [(
|
|
3264
|
+
}, [(R(), C(y, null, B(o, (e) => w("option", {
|
|
3253
3265
|
key: e,
|
|
3254
3266
|
value: e
|
|
3255
|
-
}, W(e), 9,
|
|
3267
|
+
}, W(e), 9, Ra)), 64))], 8, La), [[ce, M.value]]),
|
|
3256
3268
|
ue(w("select", {
|
|
3257
3269
|
"onUpdate:modelValue": n[8] ||= (e) => A.value = e,
|
|
3258
3270
|
class: "rich-text-select rich-text-select--block",
|
|
3259
3271
|
disabled: m.value
|
|
3260
3272
|
}, [
|
|
3261
|
-
w("option",
|
|
3262
|
-
w("option",
|
|
3263
|
-
w("option",
|
|
3264
|
-
w("option",
|
|
3265
|
-
w("option",
|
|
3266
|
-
], 8,
|
|
3273
|
+
w("option", Ba, W(G(u)("components.richTextEditor.paragraph")), 1),
|
|
3274
|
+
w("option", Va, W(G(u)("components.richTextEditor.heading1")), 1),
|
|
3275
|
+
w("option", Ha, W(G(u)("components.richTextEditor.heading2")), 1),
|
|
3276
|
+
w("option", Ua, W(G(u)("components.richTextEditor.heading3")), 1),
|
|
3277
|
+
w("option", Wa, W(G(u)("components.richTextEditor.blockquote")), 1)
|
|
3278
|
+
], 8, za), [[ce, A.value]]),
|
|
3267
3279
|
n[30] ||= w("span", { class: "rich-text-separator" }, null, -1),
|
|
3268
3280
|
w("button", {
|
|
3269
3281
|
type: "button",
|
|
3270
|
-
class:
|
|
3271
|
-
title:
|
|
3272
|
-
onClick: n[9] ||= (e) =>
|
|
3273
|
-
}, [D(
|
|
3282
|
+
class: F({ "is-active": pe("left") }),
|
|
3283
|
+
title: G(u)("components.richTextEditor.alignLeft"),
|
|
3284
|
+
onClick: n[9] ||= (e) => oe("left")
|
|
3285
|
+
}, [D(G(Ct), { size: 17 })], 10, Ga),
|
|
3274
3286
|
w("button", {
|
|
3275
3287
|
type: "button",
|
|
3276
|
-
class:
|
|
3277
|
-
title:
|
|
3278
|
-
onClick: n[10] ||= (e) =>
|
|
3279
|
-
}, [D(
|
|
3288
|
+
class: F({ "is-active": pe("center") }),
|
|
3289
|
+
title: G(u)("components.richTextEditor.alignCenter"),
|
|
3290
|
+
onClick: n[10] ||= (e) => oe("center")
|
|
3291
|
+
}, [D(G(xt), { size: 17 })], 10, Ka),
|
|
3280
3292
|
w("button", {
|
|
3281
3293
|
type: "button",
|
|
3282
|
-
class:
|
|
3283
|
-
title:
|
|
3284
|
-
onClick: n[11] ||= (e) =>
|
|
3285
|
-
}, [D(
|
|
3294
|
+
class: F({ "is-active": pe("right") }),
|
|
3295
|
+
title: G(u)("components.richTextEditor.alignRight"),
|
|
3296
|
+
onClick: n[11] ||= (e) => oe("right")
|
|
3297
|
+
}, [D(G(wt), { size: 17 })], 10, qa),
|
|
3286
3298
|
w("button", {
|
|
3287
3299
|
type: "button",
|
|
3288
|
-
class:
|
|
3289
|
-
title:
|
|
3290
|
-
onClick: n[12] ||= (e) =>
|
|
3291
|
-
}, [D(
|
|
3300
|
+
class: F({ "is-active": pe("justify") }),
|
|
3301
|
+
title: G(u)("components.richTextEditor.alignJustify"),
|
|
3302
|
+
onClick: n[12] ||= (e) => oe("justify")
|
|
3303
|
+
}, [D(G(St), { size: 17 })], 10, Ja),
|
|
3292
3304
|
n[31] ||= w("span", { class: "rich-text-break" }, null, -1),
|
|
3293
3305
|
w("button", {
|
|
3294
3306
|
type: "button",
|
|
3295
|
-
title:
|
|
3307
|
+
title: G(u)("components.richTextEditor.decreaseIndent"),
|
|
3296
3308
|
onClick: de
|
|
3297
|
-
}, [D(
|
|
3309
|
+
}, [D(G(At), { size: 17 })], 8, Ya),
|
|
3298
3310
|
w("button", {
|
|
3299
3311
|
type: "button",
|
|
3300
|
-
title:
|
|
3312
|
+
title: G(u)("components.richTextEditor.increaseIndent"),
|
|
3301
3313
|
onClick: J
|
|
3302
|
-
}, [D(
|
|
3314
|
+
}, [D(G(jt), { size: 17 })], 8, Xa),
|
|
3303
3315
|
w("button", {
|
|
3304
3316
|
type: "button",
|
|
3305
|
-
class:
|
|
3306
|
-
title:
|
|
3307
|
-
onClick: n[13] ||= (e) =>
|
|
3308
|
-
}, [D(
|
|
3317
|
+
class: F({ "is-active": X("orderedList") }),
|
|
3318
|
+
title: G(u)("components.richTextEditor.orderedList"),
|
|
3319
|
+
onClick: n[13] ||= (e) => G(p).chain().focus().toggleOrderedList().run()
|
|
3320
|
+
}, [D(G(It), { size: 17 })], 10, Za),
|
|
3309
3321
|
w("button", {
|
|
3310
3322
|
type: "button",
|
|
3311
|
-
class:
|
|
3312
|
-
title:
|
|
3313
|
-
onClick: n[14] ||= (e) =>
|
|
3314
|
-
}, [D(
|
|
3323
|
+
class: F({ "is-active": X("bulletList") }),
|
|
3324
|
+
title: G(u)("components.richTextEditor.bulletList"),
|
|
3325
|
+
onClick: n[14] ||= (e) => G(p).chain().focus().toggleBulletList().run()
|
|
3326
|
+
}, [D(G(Ft), { size: 17 })], 10, Qa),
|
|
3315
3327
|
w("button", {
|
|
3316
3328
|
type: "button",
|
|
3317
|
-
class:
|
|
3318
|
-
title:
|
|
3319
|
-
onClick: n[15] ||= (e) =>
|
|
3320
|
-
}, [...n[26] ||= [w("span", { class: "rich-text-tx" }, [E("T"), w("sub", null, "x")], -1)]], 10,
|
|
3329
|
+
class: F({ "is-active": X("code") }),
|
|
3330
|
+
title: G(u)("components.richTextEditor.code"),
|
|
3331
|
+
onClick: n[15] ||= (e) => G(p).chain().focus().toggleCode().run()
|
|
3332
|
+
}, [...n[26] ||= [w("span", { class: "rich-text-tx" }, [E("T"), w("sub", null, "x")], -1)]], 10, $a),
|
|
3321
3333
|
w("button", {
|
|
3322
3334
|
type: "button",
|
|
3323
|
-
title:
|
|
3324
|
-
onClick:
|
|
3325
|
-
}, [D(
|
|
3335
|
+
title: G(u)("components.richTextEditor.insertLink"),
|
|
3336
|
+
onClick: ne
|
|
3337
|
+
}, [D(G(Pt), { size: 17 })], 8, eo),
|
|
3326
3338
|
w("label", {
|
|
3327
3339
|
class: "rich-text-select-wrap rich-text-select-wrap--table",
|
|
3328
|
-
title:
|
|
3329
|
-
}, [D(
|
|
3340
|
+
title: G(u)("components.richTextEditor.table")
|
|
3341
|
+
}, [D(G(Ut), { size: 17 }), w("select", {
|
|
3330
3342
|
disabled: m.value,
|
|
3331
3343
|
onChange: se
|
|
3332
3344
|
}, [
|
|
3333
|
-
w("option",
|
|
3334
|
-
w("option",
|
|
3335
|
-
w("option",
|
|
3336
|
-
w("option",
|
|
3337
|
-
w("option",
|
|
3338
|
-
w("option",
|
|
3339
|
-
w("option",
|
|
3340
|
-
w("option",
|
|
3341
|
-
w("option",
|
|
3342
|
-
], 40,
|
|
3345
|
+
w("option", ro, W(G(u)("components.richTextEditor.table")), 1),
|
|
3346
|
+
w("option", io, W(G(u)("components.richTextEditor.insertTable")), 1),
|
|
3347
|
+
w("option", ao, W(G(u)("components.richTextEditor.addColumnBefore")), 1),
|
|
3348
|
+
w("option", oo, W(G(u)("components.richTextEditor.addColumnAfter")), 1),
|
|
3349
|
+
w("option", so, W(G(u)("components.richTextEditor.deleteColumn")), 1),
|
|
3350
|
+
w("option", co, W(G(u)("components.richTextEditor.addRowBefore")), 1),
|
|
3351
|
+
w("option", lo, W(G(u)("components.richTextEditor.addRowAfter")), 1),
|
|
3352
|
+
w("option", uo, W(G(u)("components.richTextEditor.deleteRow")), 1),
|
|
3353
|
+
w("option", fo, W(G(u)("components.richTextEditor.deleteTable")), 1)
|
|
3354
|
+
], 40, no)], 8, to),
|
|
3343
3355
|
n[32] ||= w("span", { class: "rich-text-separator" }, null, -1),
|
|
3344
3356
|
w("button", {
|
|
3345
3357
|
type: "button",
|
|
3346
|
-
title:
|
|
3358
|
+
title: G(u)("components.richTextEditor.fullscreen"),
|
|
3347
3359
|
onClick: n[16] ||= (e) => l.value = !l.value
|
|
3348
|
-
}, [l.value ? (
|
|
3360
|
+
}, [l.value ? (R(), x(G(Rt), {
|
|
3349
3361
|
key: 0,
|
|
3350
3362
|
size: 17
|
|
3351
|
-
})) : (
|
|
3363
|
+
})) : (R(), x(G(Lt), {
|
|
3352
3364
|
key: 1,
|
|
3353
3365
|
size: 17
|
|
3354
|
-
}))], 8,
|
|
3366
|
+
}))], 8, po),
|
|
3355
3367
|
w("button", {
|
|
3356
3368
|
type: "button",
|
|
3357
|
-
class:
|
|
3358
|
-
title:
|
|
3359
|
-
onClick:
|
|
3360
|
-
}, [D(
|
|
3369
|
+
class: F({ "is-active": c.value }),
|
|
3370
|
+
title: G(u)("components.richTextEditor.sourceCode"),
|
|
3371
|
+
onClick: te
|
|
3372
|
+
}, [D(G(Et), { size: 17 })], 10, mo),
|
|
3361
3373
|
w("button", {
|
|
3362
3374
|
type: "button",
|
|
3363
|
-
title:
|
|
3375
|
+
title: G(u)("components.richTextEditor.clearFormat"),
|
|
3364
3376
|
onClick: Y
|
|
3365
|
-
}, [D(
|
|
3377
|
+
}, [D(G(Dt), { size: 17 })], 8, ho),
|
|
3366
3378
|
w("button", {
|
|
3367
3379
|
type: "button",
|
|
3368
|
-
class:
|
|
3369
|
-
title:
|
|
3370
|
-
onClick: n[17] ||= (e) =>
|
|
3371
|
-
}, [D(
|
|
3372
|
-
t.$slots["toolbar-append"] ? (
|
|
3380
|
+
class: F({ "is-active": X("blockquote") }),
|
|
3381
|
+
title: G(u)("components.richTextEditor.blockquote"),
|
|
3382
|
+
onClick: n[17] ||= (e) => G(p).chain().focus().toggleBlockquote().run()
|
|
3383
|
+
}, [D(G(Bt), { size: 17 })], 10, go),
|
|
3384
|
+
t.$slots["toolbar-append"] ? (R(), C("div", {
|
|
3373
3385
|
key: 0,
|
|
3374
3386
|
class: "rich-text-toolbar-extension",
|
|
3375
3387
|
onMousedown: n[18] ||= fe(() => {}, ["stop"])
|
|
3376
|
-
}, [
|
|
3377
|
-
(
|
|
3388
|
+
}, [V(t.$slots, "toolbar-append", {}, void 0, !0)], 32)) : S("", !0),
|
|
3389
|
+
(R(!0), C(y, null, B(T.value, (e) => (R(), C(y, { key: e.key }, [e.component ? (R(), C("div", {
|
|
3378
3390
|
key: 0,
|
|
3379
3391
|
class: "rich-text-toolbar-extension",
|
|
3380
3392
|
title: e.label,
|
|
3381
3393
|
onMousedown: n[19] ||= fe(() => {}, ["stop"])
|
|
3382
|
-
}, [(
|
|
3394
|
+
}, [(R(), x(U(e.component), P({ ref_for: !0 }, e.props, {
|
|
3383
3395
|
context: _.value,
|
|
3384
3396
|
disabled: O(e)
|
|
3385
|
-
}), null, 16, ["context", "disabled"]))], 40,
|
|
3397
|
+
}), null, 16, ["context", "disabled"]))], 40, _o)) : (R(), C("button", {
|
|
3386
3398
|
key: 1,
|
|
3387
3399
|
type: "button",
|
|
3388
3400
|
title: e.label,
|
|
3389
3401
|
disabled: O(e),
|
|
3390
3402
|
onClick: (t) => k(e)
|
|
3391
|
-
}, [e.icon ? (
|
|
3403
|
+
}, [e.icon ? (R(), x(U(e.icon), {
|
|
3392
3404
|
key: 0,
|
|
3393
3405
|
size: 17
|
|
3394
|
-
})) : (
|
|
3395
|
-
], 32), c.value ? ue((
|
|
3406
|
+
})) : (R(), C("span", yo, W(e.label), 1))], 8, vo))], 64))), 128))
|
|
3407
|
+
], 32), c.value ? ue((R(), C("textarea", {
|
|
3396
3408
|
key: 0,
|
|
3397
3409
|
"onUpdate:modelValue": n[21] ||= (e) => s.value = e,
|
|
3398
3410
|
class: "rich-text-source",
|
|
3399
3411
|
readonly: m.value,
|
|
3400
|
-
style:
|
|
3401
|
-
onBlur:
|
|
3402
|
-
}, null, 44,
|
|
3412
|
+
style: L({ "--rich-text-max-height": e.maxHeight }),
|
|
3413
|
+
onBlur: I
|
|
3414
|
+
}, null, 44, bo)), [[le, s.value]]) : (R(), x(G(un), {
|
|
3403
3415
|
key: 1,
|
|
3404
|
-
editor:
|
|
3405
|
-
style:
|
|
3416
|
+
editor: G(p),
|
|
3417
|
+
style: L({ "--rich-text-max-height": e.maxHeight })
|
|
3406
3418
|
}, null, 8, ["editor", "style"]))], 2)) : S("", !0);
|
|
3407
3419
|
}
|
|
3408
|
-
}),
|
|
3420
|
+
}), So = /* @__PURE__ */ e({ default: () => Co }), Co = /*#__PURE__*/ f(xo, [["__scopeId", "data-v-6961f3bf"]]), wo = [
|
|
3409
3421
|
{
|
|
3410
3422
|
code: "en",
|
|
3411
3423
|
label: "English"
|
|
@@ -3454,10 +3466,10 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3454
3466
|
code: "fr",
|
|
3455
3467
|
label: "French"
|
|
3456
3468
|
}
|
|
3457
|
-
],
|
|
3469
|
+
], To = {
|
|
3458
3470
|
key: 0,
|
|
3459
3471
|
class: "translate-toolbar__inline"
|
|
3460
|
-
},
|
|
3472
|
+
}, Eo = { class: "translate-toolbar__label" }, Do = { class: "translate-toolbar__controls" }, Oo = { class: "translate-toolbar__row" }, ko = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
3461
3473
|
__name: "translate-toolbar",
|
|
3462
3474
|
props: {
|
|
3463
3475
|
disabled: {
|
|
@@ -3484,25 +3496,25 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3484
3496
|
setup(e, { emit: t }) {
|
|
3485
3497
|
let n = e, r = t, i = b(() => [...n.languages.filter(({ code: e }) => e !== n.sourceLanguage), {
|
|
3486
3498
|
code: "all",
|
|
3487
|
-
label:
|
|
3499
|
+
label: u("product-management.attribute.translation.all")
|
|
3488
3500
|
}]);
|
|
3489
3501
|
function a(e) {
|
|
3490
3502
|
(e === "translate" || e === "polish") && r("translate", e);
|
|
3491
3503
|
}
|
|
3492
|
-
return (t, n) => e.inline ? (
|
|
3504
|
+
return (t, n) => e.inline ? (R(), C("div", To, [w("span", Eo, [D(G(Nt), {
|
|
3493
3505
|
class: "translate-toolbar__label-icon",
|
|
3494
3506
|
size: 16,
|
|
3495
3507
|
color: "#8994BC",
|
|
3496
3508
|
"stroke-width": 2
|
|
3497
|
-
}), E(" " + W(
|
|
3498
|
-
D(
|
|
3509
|
+
}), E(" " + W(G(u)("product-management.attribute.translation.label")), 1)]), w("div", Do, [
|
|
3510
|
+
D(G(Pe), {
|
|
3499
3511
|
"model-value": e.sourceLanguage,
|
|
3500
3512
|
disabled: e.disabled || e.loading,
|
|
3501
|
-
placeholder:
|
|
3513
|
+
placeholder: G(u)("product-management.attribute.translation.from"),
|
|
3502
3514
|
class: "translate-toolbar__language-select",
|
|
3503
3515
|
"onUpdate:modelValue": n[0] ||= (e) => r("update:sourceLanguage", String(e))
|
|
3504
3516
|
}, {
|
|
3505
|
-
default: J(() => [(
|
|
3517
|
+
default: J(() => [(R(!0), C(y, null, B(e.languages, (e) => (R(), x(G($), {
|
|
3506
3518
|
key: e.code,
|
|
3507
3519
|
label: e.label,
|
|
3508
3520
|
value: e.code
|
|
@@ -3517,14 +3529,14 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3517
3529
|
class: "translate-toolbar__arrow",
|
|
3518
3530
|
"aria-hidden": "true"
|
|
3519
3531
|
}, "→", -1),
|
|
3520
|
-
D(
|
|
3532
|
+
D(G(Pe), {
|
|
3521
3533
|
"model-value": e.targetLanguage,
|
|
3522
3534
|
disabled: e.disabled || e.loading,
|
|
3523
|
-
placeholder:
|
|
3535
|
+
placeholder: G(u)("product-management.attribute.translation.to"),
|
|
3524
3536
|
class: "translate-toolbar__language-select",
|
|
3525
3537
|
"onUpdate:modelValue": n[1] ||= (e) => r("update:targetLanguage", String(e))
|
|
3526
3538
|
}, {
|
|
3527
|
-
default: J(() => [(
|
|
3539
|
+
default: J(() => [(R(!0), C(y, null, B(i.value, (e) => (R(), x(G($), {
|
|
3528
3540
|
key: e.code,
|
|
3529
3541
|
label: e.label,
|
|
3530
3542
|
value: e.code
|
|
@@ -3535,7 +3547,7 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3535
3547
|
"disabled",
|
|
3536
3548
|
"placeholder"
|
|
3537
3549
|
]),
|
|
3538
|
-
D(
|
|
3550
|
+
D(G(ye), {
|
|
3539
3551
|
"split-button": "",
|
|
3540
3552
|
type: "primary",
|
|
3541
3553
|
class: "translate-toolbar__action",
|
|
@@ -3543,48 +3555,48 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3543
3555
|
onClick: n[2] ||= (e) => r("translate", "translate"),
|
|
3544
3556
|
onCommand: a
|
|
3545
3557
|
}, {
|
|
3546
|
-
dropdown: J(() => [D(
|
|
3547
|
-
default: J(() => [D(
|
|
3548
|
-
default: J(() => [E(W(
|
|
3558
|
+
dropdown: J(() => [D(G(xe), null, {
|
|
3559
|
+
default: J(() => [D(G(be), { command: "translate" }, {
|
|
3560
|
+
default: J(() => [E(W(G(u)("product-management.attribute.translation.translate")), 1)]),
|
|
3549
3561
|
_: 1
|
|
3550
|
-
}), D(
|
|
3551
|
-
default: J(() => [E(W(
|
|
3562
|
+
}), D(G(be), { command: "polish" }, {
|
|
3563
|
+
default: J(() => [E(W(G(u)("product-management.attribute.translation.polish")), 1)]),
|
|
3552
3564
|
_: 1
|
|
3553
3565
|
})]),
|
|
3554
3566
|
_: 1
|
|
3555
3567
|
})]),
|
|
3556
|
-
default: J(() => [E(W(
|
|
3568
|
+
default: J(() => [E(W(G(u)("product-management.attribute.translation.translate")) + " ", 1)]),
|
|
3557
3569
|
_: 1
|
|
3558
3570
|
}, 8, ["disabled"])
|
|
3559
|
-
])])) : (
|
|
3571
|
+
])])) : (R(), x(G(ke), {
|
|
3560
3572
|
key: 1,
|
|
3561
3573
|
width: 390,
|
|
3562
3574
|
placement: "bottom-end",
|
|
3563
3575
|
disabled: e.disabled,
|
|
3564
3576
|
trigger: "hover"
|
|
3565
3577
|
}, {
|
|
3566
|
-
reference: J(() => [D(
|
|
3578
|
+
reference: J(() => [D(G(Y), {
|
|
3567
3579
|
text: "",
|
|
3568
|
-
icon:
|
|
3580
|
+
icon: G(Ze),
|
|
3569
3581
|
disabled: e.disabled,
|
|
3570
3582
|
size: "large",
|
|
3571
|
-
title:
|
|
3572
|
-
"aria-label":
|
|
3583
|
+
title: G(u)("product-management.attribute.translation.label"),
|
|
3584
|
+
"aria-label": G(u)("product-management.attribute.translation.label")
|
|
3573
3585
|
}, null, 8, [
|
|
3574
3586
|
"icon",
|
|
3575
3587
|
"disabled",
|
|
3576
3588
|
"title",
|
|
3577
3589
|
"aria-label"
|
|
3578
3590
|
])]),
|
|
3579
|
-
default: J(() => [w("div",
|
|
3580
|
-
D(
|
|
3591
|
+
default: J(() => [w("div", Oo, [
|
|
3592
|
+
D(G(Pe), {
|
|
3581
3593
|
"model-value": e.sourceLanguage,
|
|
3582
3594
|
disabled: e.disabled || e.loading,
|
|
3583
|
-
placeholder:
|
|
3595
|
+
placeholder: G(u)("product-management.attribute.translation.from"),
|
|
3584
3596
|
class: "translate-toolbar__language-select",
|
|
3585
3597
|
"onUpdate:modelValue": n[3] ||= (e) => r("update:sourceLanguage", String(e))
|
|
3586
3598
|
}, {
|
|
3587
|
-
default: J(() => [(
|
|
3599
|
+
default: J(() => [(R(!0), C(y, null, B(e.languages, (e) => (R(), x(G($), {
|
|
3588
3600
|
key: e.code,
|
|
3589
3601
|
label: e.label,
|
|
3590
3602
|
value: e.code
|
|
@@ -3599,14 +3611,14 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3599
3611
|
class: "translate-toolbar__arrow",
|
|
3600
3612
|
"aria-hidden": "true"
|
|
3601
3613
|
}, "→", -1),
|
|
3602
|
-
D(
|
|
3614
|
+
D(G(Pe), {
|
|
3603
3615
|
"model-value": e.targetLanguage,
|
|
3604
3616
|
disabled: e.disabled || e.loading,
|
|
3605
|
-
placeholder:
|
|
3617
|
+
placeholder: G(u)("product-management.attribute.translation.to"),
|
|
3606
3618
|
class: "translate-toolbar__language-select",
|
|
3607
3619
|
"onUpdate:modelValue": n[4] ||= (e) => r("update:targetLanguage", String(e))
|
|
3608
3620
|
}, {
|
|
3609
|
-
default: J(() => [(
|
|
3621
|
+
default: J(() => [(R(!0), C(y, null, B(i.value, (e) => (R(), x(G($), {
|
|
3610
3622
|
key: e.code,
|
|
3611
3623
|
label: e.label,
|
|
3612
3624
|
value: e.code
|
|
@@ -3617,7 +3629,7 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3617
3629
|
"disabled",
|
|
3618
3630
|
"placeholder"
|
|
3619
3631
|
]),
|
|
3620
|
-
D(
|
|
3632
|
+
D(G(ye), {
|
|
3621
3633
|
"split-button": "",
|
|
3622
3634
|
type: "primary",
|
|
3623
3635
|
class: "translate-toolbar__action",
|
|
@@ -3625,27 +3637,27 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3625
3637
|
onClick: n[5] ||= (e) => r("translate", "translate"),
|
|
3626
3638
|
onCommand: a
|
|
3627
3639
|
}, {
|
|
3628
|
-
dropdown: J(() => [D(
|
|
3629
|
-
default: J(() => [D(
|
|
3630
|
-
default: J(() => [E(W(
|
|
3640
|
+
dropdown: J(() => [D(G(xe), null, {
|
|
3641
|
+
default: J(() => [D(G(be), { command: "translate" }, {
|
|
3642
|
+
default: J(() => [E(W(G(u)("product-management.attribute.translation.translate")), 1)]),
|
|
3631
3643
|
_: 1
|
|
3632
|
-
}), D(
|
|
3633
|
-
default: J(() => [E(W(
|
|
3644
|
+
}), D(G(be), { command: "polish" }, {
|
|
3645
|
+
default: J(() => [E(W(G(u)("product-management.attribute.translation.polish")), 1)]),
|
|
3634
3646
|
_: 1
|
|
3635
3647
|
})]),
|
|
3636
3648
|
_: 1
|
|
3637
3649
|
})]),
|
|
3638
|
-
default: J(() => [E(W(
|
|
3650
|
+
default: J(() => [E(W(G(u)("product-management.attribute.translation.translate")) + " ", 1)]),
|
|
3639
3651
|
_: 1
|
|
3640
3652
|
}, 8, ["disabled"])
|
|
3641
3653
|
])]),
|
|
3642
3654
|
_: 1
|
|
3643
3655
|
}, 8, ["disabled"]));
|
|
3644
3656
|
}
|
|
3645
|
-
}), [["__scopeId", "data-v-df9539f3"]]),
|
|
3657
|
+
}), [["__scopeId", "data-v-df9539f3"]]), Ao = ["element-loading-text"], jo = {
|
|
3646
3658
|
key: 1,
|
|
3647
3659
|
class: "translate-field__grid"
|
|
3648
|
-
},
|
|
3660
|
+
}, Mo = ["for"], No = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
3649
3661
|
__name: "translate-field",
|
|
3650
3662
|
props: {
|
|
3651
3663
|
config: { default: void 0 },
|
|
@@ -3666,13 +3678,13 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3666
3678
|
},
|
|
3667
3679
|
emits: ["update:modelValue"],
|
|
3668
3680
|
setup(e, { emit: t }) {
|
|
3669
|
-
let n = e, r = t, i = b(() => n.config?.language?.length ? n.config.language :
|
|
3681
|
+
let n = e, r = t, i = b(() => n.config?.language?.length ? n.config.language : wo), a = b(() => i.value.map(({ code: e }) => e)), o = b(() => n.config?.layout ?? ([
|
|
3670
3682
|
"rich-text",
|
|
3671
3683
|
"text",
|
|
3672
3684
|
"textarea"
|
|
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 =
|
|
3685
|
+
].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 = z("en"), d = z("en"), f = z("all"), p = z(!1), m = b(() => n.disabled || n.readonly || p.value);
|
|
3674
3686
|
q(a, (e) => {
|
|
3675
|
-
e.includes(l.value) || (l.value = e.includes("en") ? "en" : e[0] ?? ""), e.includes(
|
|
3687
|
+
e.includes(l.value) || (l.value = e.includes("en") ? "en" : e[0] ?? ""), e.includes(d.value) || (d.value = e.includes("en") ? "en" : e[0] ?? ""), f.value === "all" || e.includes(f.value) && f.value !== d.value || (f.value = "all");
|
|
3676
3688
|
}, { immediate: !0 });
|
|
3677
3689
|
function h(e, t) {
|
|
3678
3690
|
r("update:modelValue", {
|
|
@@ -3694,14 +3706,14 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3694
3706
|
};
|
|
3695
3707
|
}
|
|
3696
3708
|
async function v(e = "translate") {
|
|
3697
|
-
if (m.value || !
|
|
3698
|
-
let t = f.value === "all" ? a.value.filter((e) => e !==
|
|
3709
|
+
if (m.value || !d.value || !f.value) return;
|
|
3710
|
+
let t = f.value === "all" ? a.value.filter((e) => e !== d.value) : [f.value], o = { ...c.value }, s = o[d.value], h = {
|
|
3699
3711
|
...n.context,
|
|
3700
3712
|
before: o,
|
|
3701
3713
|
command: e,
|
|
3702
3714
|
fieldProp: n.field.prop,
|
|
3703
3715
|
fieldValue: o,
|
|
3704
|
-
sourceLanguage:
|
|
3716
|
+
sourceLanguage: d.value,
|
|
3705
3717
|
sourceValue: s,
|
|
3706
3718
|
targetLanguage: f.value,
|
|
3707
3719
|
targetLanguages: t
|
|
@@ -3717,34 +3729,34 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3717
3729
|
let n = t.find((t) => e[t] !== void 0);
|
|
3718
3730
|
n && (l.value = n);
|
|
3719
3731
|
}
|
|
3720
|
-
if (n.config?.translate) Q.success(
|
|
3732
|
+
if (n.config?.translate) Q.success(u("product-management.attribute.translation.completed"));
|
|
3721
3733
|
else {
|
|
3722
3734
|
let e = t.map((e) => i.value.find((t) => t.code === e)?.label).join(", ");
|
|
3723
|
-
Q.info(
|
|
3735
|
+
Q.info(u("product-management.attribute.translation.mockCopied", { targets: e }));
|
|
3724
3736
|
}
|
|
3725
3737
|
} catch {
|
|
3726
|
-
Q.error(
|
|
3738
|
+
Q.error(u("product-management.attribute.translation.failed"));
|
|
3727
3739
|
} finally {
|
|
3728
3740
|
p.value = !1;
|
|
3729
3741
|
}
|
|
3730
3742
|
}
|
|
3731
3743
|
return (t, n) => {
|
|
3732
|
-
let r =
|
|
3733
|
-
return ue((
|
|
3734
|
-
class:
|
|
3735
|
-
"element-loading-text":
|
|
3736
|
-
}, [o.value === "tabs" ? (
|
|
3744
|
+
let r = H("loading");
|
|
3745
|
+
return ue((R(), C("div", {
|
|
3746
|
+
class: F(["translate-field", [`translate-field--label-${e.labelPosition}`, { "translate-field--plain-input": e.field.type === "text" || e.field.type === "textarea" }]]),
|
|
3747
|
+
"element-loading-text": G(u)("product-management.attribute.translation.loading")
|
|
3748
|
+
}, [o.value === "tabs" ? (R(), C(y, { key: 0 }, [D(G(Ve), {
|
|
3737
3749
|
modelValue: l.value,
|
|
3738
3750
|
"onUpdate:modelValue": n[0] ||= (e) => l.value = e,
|
|
3739
3751
|
class: "translate-field__tabs"
|
|
3740
3752
|
}, {
|
|
3741
|
-
default: J(() => [(
|
|
3753
|
+
default: J(() => [(R(!0), C(y, null, B(i.value, (e) => (R(), x(G(Le), {
|
|
3742
3754
|
key: e.code,
|
|
3743
3755
|
label: e.label,
|
|
3744
3756
|
name: e.code
|
|
3745
3757
|
}, null, 8, ["label", "name"]))), 128))]),
|
|
3746
3758
|
_: 1
|
|
3747
|
-
}, 8, ["modelValue"]), e.field.type === "rich-text" ? (
|
|
3759
|
+
}, 8, ["modelValue"]), e.field.type === "rich-text" ? (R(), x(Co, P({ key: 0 }, e.inputProps, {
|
|
3748
3760
|
id: `${e.field.prop}-${l.value}`,
|
|
3749
3761
|
"model-value": String(c.value[l.value] ?? ""),
|
|
3750
3762
|
placeholder: e.placeholder || s.value,
|
|
@@ -3753,13 +3765,13 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3753
3765
|
"tool-context": _(l.value),
|
|
3754
3766
|
"onUpdate:modelValue": n[3] ||= (e) => h(l.value, e)
|
|
3755
3767
|
}), {
|
|
3756
|
-
"toolbar-append": J(() => [D(
|
|
3768
|
+
"toolbar-append": J(() => [D(ko, {
|
|
3757
3769
|
languages: i.value,
|
|
3758
|
-
"source-language":
|
|
3770
|
+
"source-language": d.value,
|
|
3759
3771
|
"target-language": f.value,
|
|
3760
3772
|
disabled: m.value,
|
|
3761
3773
|
loading: p.value,
|
|
3762
|
-
"onUpdate:sourceLanguage": n[1] ||= (e) =>
|
|
3774
|
+
"onUpdate:sourceLanguage": n[1] ||= (e) => d.value = e,
|
|
3763
3775
|
"onUpdate:targetLanguage": n[2] ||= (e) => f.value = e,
|
|
3764
3776
|
onTranslate: v
|
|
3765
3777
|
}, null, 8, [
|
|
@@ -3777,7 +3789,7 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3777
3789
|
"editable",
|
|
3778
3790
|
"max-height",
|
|
3779
3791
|
"tool-context"
|
|
3780
|
-
])) : (
|
|
3792
|
+
])) : (R(), x(G(Te), P({ key: 1 }, e.inputProps, {
|
|
3781
3793
|
id: `${e.field.prop}-${l.value}`,
|
|
3782
3794
|
"model-value": g(l.value),
|
|
3783
3795
|
type: e.field.type === "textarea" ? "textarea" : "text",
|
|
@@ -3792,13 +3804,13 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3792
3804
|
"rows",
|
|
3793
3805
|
"placeholder",
|
|
3794
3806
|
"disabled"
|
|
3795
|
-
]))], 64)) : (
|
|
3807
|
+
]))], 64)) : (R(), C("div", jo, [(R(!0), C(y, null, B(i.value, (t) => (R(), C("div", {
|
|
3796
3808
|
key: t.code,
|
|
3797
3809
|
class: "translate-field__entry"
|
|
3798
3810
|
}, [w("label", {
|
|
3799
3811
|
class: "translate-field__label",
|
|
3800
3812
|
for: `${e.field.prop}-${t.code}`
|
|
3801
|
-
}, W(t.label), 9,
|
|
3813
|
+
}, W(t.label), 9, Mo), e.field.type === "rich-text" ? (R(), x(Co, P({
|
|
3802
3814
|
key: 0,
|
|
3803
3815
|
ref_for: !0
|
|
3804
3816
|
}, e.inputProps, {
|
|
@@ -3817,7 +3829,7 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3817
3829
|
"max-height",
|
|
3818
3830
|
"tool-context",
|
|
3819
3831
|
"onUpdate:modelValue"
|
|
3820
|
-
])) : (
|
|
3832
|
+
])) : (R(), x(G(Te), P({
|
|
3821
3833
|
key: 1,
|
|
3822
3834
|
ref_for: !0
|
|
3823
3835
|
}, e.inputProps, {
|
|
@@ -3836,16 +3848,16 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3836
3848
|
"placeholder",
|
|
3837
3849
|
"disabled",
|
|
3838
3850
|
"onUpdate:modelValue"
|
|
3839
|
-
]))]))), 128))])), o.value !== "tabs" || e.field.type !== "rich-text" ? (
|
|
3851
|
+
]))]))), 128))])), o.value !== "tabs" || e.field.type !== "rich-text" ? (R(), x(ko, {
|
|
3840
3852
|
key: 2,
|
|
3841
3853
|
inline: e.field.type === "text" || e.field.type === "textarea",
|
|
3842
3854
|
languages: i.value,
|
|
3843
|
-
"source-language":
|
|
3855
|
+
"source-language": d.value,
|
|
3844
3856
|
"target-language": f.value,
|
|
3845
3857
|
disabled: m.value,
|
|
3846
3858
|
loading: p.value,
|
|
3847
3859
|
class: "translate-field__standalone-toolbar",
|
|
3848
|
-
"onUpdate:sourceLanguage": n[5] ||= (e) =>
|
|
3860
|
+
"onUpdate:sourceLanguage": n[5] ||= (e) => d.value = e,
|
|
3849
3861
|
"onUpdate:targetLanguage": n[6] ||= (e) => f.value = e,
|
|
3850
3862
|
onTranslate: v
|
|
3851
3863
|
}, null, 8, [
|
|
@@ -3855,12 +3867,12 @@ var xa = ["title"], Sa = ["title"], Ca = ["title"], wa = ["title"], Ta = ["disab
|
|
|
3855
3867
|
"target-language",
|
|
3856
3868
|
"disabled",
|
|
3857
3869
|
"loading"
|
|
3858
|
-
])) : S("", !0)], 10,
|
|
3870
|
+
])) : S("", !0)], 10, Ao)), [[r, p.value]]);
|
|
3859
3871
|
};
|
|
3860
3872
|
}
|
|
3861
3873
|
}), [["__scopeId", "data-v-51b67e99"]]);
|
|
3862
3874
|
// src/components/schema-form/use-field-options.ts
|
|
3863
|
-
function
|
|
3875
|
+
function Po(e, t) {
|
|
3864
3876
|
let { options: n } = Fr(() => {
|
|
3865
3877
|
let t = e();
|
|
3866
3878
|
return t.optionSource === "dict" ? t.dictCode : "";
|
|
@@ -3871,13 +3883,13 @@ function Mo(e, t) {
|
|
|
3871
3883
|
});
|
|
3872
3884
|
}
|
|
3873
3885
|
// src/components/schema-form/schema-form-item.vue?vue&type=script&setup=true&lang.ts
|
|
3874
|
-
var
|
|
3886
|
+
var Fo = {
|
|
3875
3887
|
key: 2,
|
|
3876
3888
|
class: "schema-form-item__dict-tag"
|
|
3877
|
-
},
|
|
3889
|
+
}, Io = {
|
|
3878
3890
|
key: 23,
|
|
3879
3891
|
class: "schema-form-item__tip"
|
|
3880
|
-
},
|
|
3892
|
+
}, Lo = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
3881
3893
|
__name: "schema-form-item",
|
|
3882
3894
|
props: {
|
|
3883
3895
|
disabled: { type: Boolean },
|
|
@@ -3890,47 +3902,47 @@ var No = {
|
|
|
3890
3902
|
},
|
|
3891
3903
|
emits: ["update:modelValue"],
|
|
3892
3904
|
setup(e, { emit: t }) {
|
|
3893
|
-
let r = e, i = t, a = O(() => Promise.resolve().then(() =>
|
|
3905
|
+
let r = e, i = t, a = O(() => Promise.resolve().then(() => $i)), o = O(() => import("./file-upload-C1cpwWWY.js")), s = O(() => import("./picture-upload-DFIHyqTp.js")), c = O(() => Promise.resolve().then(() => So)), l = b(() => r.context ?? {
|
|
3894
3906
|
mode: "create",
|
|
3895
3907
|
values: {}
|
|
3896
|
-
}),
|
|
3908
|
+
}), d = Po(() => r.field, l), f = b(() => ({
|
|
3897
3909
|
...l.value,
|
|
3898
|
-
updateValue:
|
|
3899
|
-
})),
|
|
3910
|
+
updateValue: H
|
|
3911
|
+
})), p = b(() => typeof r.field.props == "function" ? r.field.props(f.value) : r.field.props), m = b(() => Sa(r.field, l.value)), h = b(() => xa(r.field)), g = b(() => r.field.copyable ?? !!r.field.readonly), _ = b(() => !!r.field.translateConfig && [
|
|
3900
3912
|
"rich-text",
|
|
3901
3913
|
"text",
|
|
3902
3914
|
"textarea"
|
|
3903
3915
|
].includes(r.field.type));
|
|
3904
|
-
function
|
|
3916
|
+
function v(e) {
|
|
3905
3917
|
return typeof e == "boolean" ? e ? "1" : "0" : e == null ? "" : String(e);
|
|
3906
3918
|
}
|
|
3907
|
-
function
|
|
3908
|
-
let t =
|
|
3909
|
-
return
|
|
3919
|
+
function w(e) {
|
|
3920
|
+
let t = v(e);
|
|
3921
|
+
return d.value.find((e) => v(e.value) === t)?.label ?? String(e ?? "");
|
|
3910
3922
|
}
|
|
3911
|
-
let
|
|
3923
|
+
let T = b(() => {
|
|
3912
3924
|
let { type: e } = r.field, t = r.modelValue;
|
|
3913
3925
|
if (e === "datetime") return yn(t);
|
|
3914
3926
|
if (e === "date") return vn(t);
|
|
3915
3927
|
if (e === "switch") {
|
|
3916
|
-
let e =
|
|
3917
|
-
if (
|
|
3918
|
-
if (
|
|
3928
|
+
let e = p.value?.activeValue ?? !0, n = p.value?.inactiveValue ?? !1;
|
|
3929
|
+
if (v(t) === v(e)) return p.value?.activeText ?? u("schemaForm.yes");
|
|
3930
|
+
if (v(t) === v(n)) return p.value?.inactiveText ?? u("schemaForm.no");
|
|
3919
3931
|
}
|
|
3920
3932
|
if (e === "select" || e === "async-select" || e === "radio" || e === "checkbox") {
|
|
3921
|
-
if (Array.isArray(t)) return t.map((e) =>
|
|
3922
|
-
if (t != null && t !== "") return
|
|
3933
|
+
if (Array.isArray(t)) return t.map((e) => w(e)).join("、");
|
|
3934
|
+
if (t != null && t !== "") return w(t);
|
|
3923
3935
|
}
|
|
3924
3936
|
return t;
|
|
3925
|
-
}),
|
|
3937
|
+
}), D = b(() => {
|
|
3926
3938
|
let e = (Array.isArray(r.modelValue) ? r.modelValue : [r.modelValue]).filter((e) => e != null && e !== "");
|
|
3927
3939
|
return e.length > 0 ? e : [null];
|
|
3928
|
-
}),
|
|
3940
|
+
}), k = b(() => {
|
|
3929
3941
|
let e = r.modelValue;
|
|
3930
3942
|
if (e == null || e === "") return [];
|
|
3931
3943
|
let t;
|
|
3932
3944
|
return t = Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : [e], t.map((e) => e && typeof e == "object" ? e.fileUrl ?? e.url : e).filter((e) => typeof e == "string" && !!e);
|
|
3933
|
-
}),
|
|
3945
|
+
}), A = b(() => {
|
|
3934
3946
|
let e = r.modelValue;
|
|
3935
3947
|
if (e == null || e === "") return [];
|
|
3936
3948
|
let t;
|
|
@@ -3947,30 +3959,30 @@ var No = {
|
|
|
3947
3959
|
fileOriginName: t.fileOriginName ?? t.name ?? t.url ?? t.fileUrl
|
|
3948
3960
|
};
|
|
3949
3961
|
}).filter((e) => !!e);
|
|
3950
|
-
}),
|
|
3951
|
-
let e =
|
|
3962
|
+
}), j = b(() => p.value?.maxPreviewCount ?? p.value?.maxCount ?? 3), M = b(() => ma(r.field.component)), N = b(() => {
|
|
3963
|
+
let e = M.value;
|
|
3952
3964
|
return e ? {
|
|
3953
|
-
...
|
|
3965
|
+
...p.value,
|
|
3954
3966
|
[e.modelProp ?? "modelValue"]: r.modelValue,
|
|
3955
3967
|
disabled: r.disabled
|
|
3956
3968
|
} : {};
|
|
3957
|
-
}),
|
|
3958
|
-
let e =
|
|
3959
|
-
return e ? { [e.updateEvent ?? `update:${e.modelProp ?? "modelValue"}`]: (t) =>
|
|
3960
|
-
}),
|
|
3961
|
-
...
|
|
3962
|
-
editable: !r.disabled && !r.readonly &&
|
|
3969
|
+
}), ee = b(() => {
|
|
3970
|
+
let e = M.value;
|
|
3971
|
+
return e ? { [e.updateEvent ?? `update:${e.modelProp ?? "modelValue"}`]: (t) => H(e.valueExtractor?.(t) ?? t) } : {};
|
|
3972
|
+
}), I = b(() => ({
|
|
3973
|
+
...p.value,
|
|
3974
|
+
editable: !r.disabled && !r.readonly && p.value?.editable !== !1,
|
|
3963
3975
|
toolContext: {
|
|
3964
3976
|
field: r.field,
|
|
3965
3977
|
formData: l.value.values,
|
|
3966
3978
|
getFormData: () => l.value.values,
|
|
3967
3979
|
mode: l.value.mode
|
|
3968
3980
|
}
|
|
3969
|
-
})), L = b(() => r.field.apiOptions),
|
|
3981
|
+
})), L = b(() => r.field.apiOptions), te = b(() => L.value ? aa(L.value.entityKey) : void 0), ne = b(() => {
|
|
3970
3982
|
let e = L.value?.params;
|
|
3971
3983
|
return typeof e == "function" ? e(l.value) : e;
|
|
3972
|
-
}),
|
|
3973
|
-
let e =
|
|
3984
|
+
}), z = b(() => JSON.stringify(ne.value ?? {})), re = b(() => {
|
|
3985
|
+
let e = te.value, t = L.value;
|
|
3974
3986
|
return !e || !t ? null : {
|
|
3975
3987
|
columns: e.columns ?? [],
|
|
3976
3988
|
dialogTitle: e.dialogTitle,
|
|
@@ -3980,21 +3992,21 @@ var No = {
|
|
|
3980
3992
|
valueKey: t.valueKey ?? e.valueKey
|
|
3981
3993
|
};
|
|
3982
3994
|
});
|
|
3983
|
-
function
|
|
3995
|
+
function H(e) {
|
|
3984
3996
|
i("update:modelValue", e);
|
|
3985
3997
|
}
|
|
3986
|
-
function
|
|
3987
|
-
let t =
|
|
3998
|
+
function ie(e) {
|
|
3999
|
+
let t = te.value;
|
|
3988
4000
|
return t ? t.fetch({
|
|
3989
4001
|
...e,
|
|
3990
|
-
params:
|
|
4002
|
+
params: ne.value
|
|
3991
4003
|
}) : Promise.resolve({
|
|
3992
4004
|
items: [],
|
|
3993
4005
|
total: 0
|
|
3994
4006
|
});
|
|
3995
4007
|
}
|
|
3996
|
-
function
|
|
3997
|
-
let t =
|
|
4008
|
+
function oe(e) {
|
|
4009
|
+
let t = d.value.map((e) => ({
|
|
3998
4010
|
label: e.label,
|
|
3999
4011
|
value: e.value,
|
|
4000
4012
|
...e.flag ? { flag: e.flag } : {}
|
|
@@ -4009,25 +4021,25 @@ var No = {
|
|
|
4009
4021
|
total: t.length
|
|
4010
4022
|
});
|
|
4011
4023
|
}
|
|
4012
|
-
return (t, r) => (
|
|
4013
|
-
class:
|
|
4024
|
+
return (t, r) => (R(), x(G(Ce), {
|
|
4025
|
+
class: F(["schema-form-item", { "schema-form-item--bare": e.hideLabel }]),
|
|
4014
4026
|
label: e.hideLabel ? void 0 : e.field.label,
|
|
4015
4027
|
"label-width": e.hideLabel ? "0" : void 0,
|
|
4016
4028
|
prop: e.field.prop,
|
|
4017
|
-
rules:
|
|
4029
|
+
rules: m.value
|
|
4018
4030
|
}, {
|
|
4019
|
-
default: J(() => [
|
|
4031
|
+
default: J(() => [_.value ? (R(), x(No, {
|
|
4020
4032
|
key: 0,
|
|
4021
4033
|
config: e.field.translateConfig,
|
|
4022
4034
|
context: l.value,
|
|
4023
4035
|
disabled: e.disabled || e.readonly,
|
|
4024
4036
|
field: e.field,
|
|
4025
4037
|
"label-position": e.labelPosition,
|
|
4026
|
-
"input-props":
|
|
4038
|
+
"input-props": p.value,
|
|
4027
4039
|
"model-value": e.modelValue,
|
|
4028
|
-
placeholder:
|
|
4040
|
+
placeholder: h.value,
|
|
4029
4041
|
readonly: e.readonly,
|
|
4030
|
-
"onUpdate:modelValue":
|
|
4042
|
+
"onUpdate:modelValue": H
|
|
4031
4043
|
}, null, 8, [
|
|
4032
4044
|
"config",
|
|
4033
4045
|
"context",
|
|
@@ -4038,124 +4050,124 @@ var No = {
|
|
|
4038
4050
|
"model-value",
|
|
4039
4051
|
"placeholder",
|
|
4040
4052
|
"readonly"
|
|
4041
|
-
])) : e.readonly && e.field.type === "rich-text" ? (
|
|
4053
|
+
])) : e.readonly && e.field.type === "rich-text" ? (R(), x(G(c), P({
|
|
4042
4054
|
key: 1,
|
|
4043
4055
|
"model-value": e.modelValue,
|
|
4044
|
-
placeholder:
|
|
4045
|
-
},
|
|
4056
|
+
placeholder: h.value
|
|
4057
|
+
}, I.value), null, 16, ["model-value", "placeholder"])) : e.readonly && e.field.optionSource === "dict" && e.field.dictCode ? (R(), C("span", Fo, [(R(!0), C(y, null, B(D.value, (t, n) => (R(), x(Ir, {
|
|
4046
4058
|
key: `${e.field.prop}-${n}`,
|
|
4047
4059
|
code: e.field.dictCode,
|
|
4048
4060
|
value: t
|
|
4049
|
-
}, null, 8, ["code", "value"]))), 128))])) : e.readonly && e.field.type === "picture" ? (
|
|
4061
|
+
}, null, 8, ["code", "value"]))), 128))])) : e.readonly && e.field.type === "picture" ? (R(), x(n, {
|
|
4050
4062
|
key: 3,
|
|
4051
|
-
urls:
|
|
4052
|
-
"max-preview-count":
|
|
4053
|
-
}, null, 8, ["urls", "max-preview-count"])) : e.readonly && (e.field.type === "file" || e.field.type === "upload") ? (
|
|
4063
|
+
urls: k.value,
|
|
4064
|
+
"max-preview-count": j.value
|
|
4065
|
+
}, null, 8, ["urls", "max-preview-count"])) : e.readonly && (e.field.type === "file" || e.field.type === "upload") ? (R(), x(Qr, {
|
|
4054
4066
|
key: 4,
|
|
4055
|
-
attachments:
|
|
4056
|
-
"max-preview-count":
|
|
4057
|
-
}, null, 8, ["attachments", "max-preview-count"])) : e.readonly ? (
|
|
4067
|
+
attachments: A.value,
|
|
4068
|
+
"max-preview-count": j.value
|
|
4069
|
+
}, null, 8, ["attachments", "max-preview-count"])) : e.readonly ? (R(), x(ua, {
|
|
4058
4070
|
key: 5,
|
|
4059
|
-
value:
|
|
4060
|
-
copyable:
|
|
4061
|
-
}, null, 8, ["value", "copyable"])) :
|
|
4071
|
+
value: T.value,
|
|
4072
|
+
copyable: g.value
|
|
4073
|
+
}, null, 8, ["value", "copyable"])) : M.value ? (R(), x(U(M.value.component), P({ key: 6 }, N.value, ae(ee.value)), null, 16)) : e.field.type === "upload" ? (R(), x(G(o), P({
|
|
4062
4074
|
key: 7,
|
|
4063
4075
|
"model-value": e.modelValue,
|
|
4064
4076
|
placeholder: e.field.placeholder,
|
|
4065
4077
|
disabled: e.disabled || e.readonly,
|
|
4066
4078
|
"show-remove": !e.readonly
|
|
4067
|
-
},
|
|
4079
|
+
}, p.value, { "onUpdate:modelValue": H }), null, 16, [
|
|
4068
4080
|
"model-value",
|
|
4069
4081
|
"placeholder",
|
|
4070
4082
|
"disabled",
|
|
4071
4083
|
"show-remove"
|
|
4072
|
-
])) : e.field.type === "picture" ? (
|
|
4084
|
+
])) : e.field.type === "picture" ? (R(), x(G(s), P({
|
|
4073
4085
|
key: 8,
|
|
4074
4086
|
"model-value": e.modelValue,
|
|
4075
4087
|
disabled: e.disabled || e.readonly,
|
|
4076
4088
|
"show-remove": !e.readonly
|
|
4077
|
-
},
|
|
4089
|
+
}, p.value, { "onUpdate:modelValue": H }), null, 16, [
|
|
4078
4090
|
"model-value",
|
|
4079
4091
|
"disabled",
|
|
4080
4092
|
"show-remove"
|
|
4081
|
-
])) : e.field.type === "file" ? (
|
|
4093
|
+
])) : e.field.type === "file" ? (R(), x(G(o), P({
|
|
4082
4094
|
key: 9,
|
|
4083
4095
|
"model-value": e.modelValue,
|
|
4084
4096
|
placeholder: e.field.placeholder,
|
|
4085
4097
|
disabled: e.disabled || e.readonly,
|
|
4086
4098
|
"show-remove": !e.readonly
|
|
4087
|
-
},
|
|
4099
|
+
}, p.value, { "onUpdate:modelValue": H }), null, 16, [
|
|
4088
4100
|
"model-value",
|
|
4089
4101
|
"placeholder",
|
|
4090
4102
|
"disabled",
|
|
4091
4103
|
"show-remove"
|
|
4092
|
-
])) : e.field.type === "slot" ?
|
|
4104
|
+
])) : e.field.type === "slot" ? V(t.$slots, "default", {
|
|
4093
4105
|
field: e.field,
|
|
4094
4106
|
value: e.modelValue,
|
|
4095
4107
|
disabled: e.disabled,
|
|
4096
|
-
updateValue:
|
|
4097
|
-
}, void 0, !0, 10) : e.field.type === "text" ? (
|
|
4108
|
+
updateValue: H
|
|
4109
|
+
}, void 0, !0, 10) : e.field.type === "text" ? (R(), x(G(Te), P({
|
|
4098
4110
|
key: 11,
|
|
4099
4111
|
"model-value": e.modelValue,
|
|
4100
|
-
placeholder:
|
|
4112
|
+
placeholder: h.value,
|
|
4101
4113
|
disabled: e.disabled,
|
|
4102
4114
|
clearable: ""
|
|
4103
|
-
},
|
|
4115
|
+
}, p.value, { "onUpdate:modelValue": H }), null, 16, [
|
|
4104
4116
|
"model-value",
|
|
4105
4117
|
"placeholder",
|
|
4106
4118
|
"disabled"
|
|
4107
|
-
])) : e.field.type === "textarea" ? (
|
|
4119
|
+
])) : e.field.type === "textarea" ? (R(), x(G(Te), P({
|
|
4108
4120
|
key: 12,
|
|
4109
4121
|
type: "textarea",
|
|
4110
4122
|
rows: 4,
|
|
4111
4123
|
"model-value": e.modelValue,
|
|
4112
|
-
placeholder:
|
|
4124
|
+
placeholder: h.value,
|
|
4113
4125
|
disabled: e.disabled
|
|
4114
|
-
},
|
|
4126
|
+
}, p.value, { "onUpdate:modelValue": H }), null, 16, [
|
|
4115
4127
|
"model-value",
|
|
4116
4128
|
"placeholder",
|
|
4117
4129
|
"disabled"
|
|
4118
|
-
])) : e.field.type === "rich-text" ? (
|
|
4130
|
+
])) : e.field.type === "rich-text" ? (R(), x(G(c), P({
|
|
4119
4131
|
key: 13,
|
|
4120
4132
|
"model-value": e.modelValue,
|
|
4121
|
-
placeholder:
|
|
4122
|
-
},
|
|
4133
|
+
placeholder: h.value
|
|
4134
|
+
}, I.value, { "onUpdate:modelValue": H }), null, 16, ["model-value", "placeholder"])) : e.field.type === "number" ? (R(), x(G(Ee), P({
|
|
4123
4135
|
key: 14,
|
|
4124
4136
|
"model-value": e.modelValue,
|
|
4125
|
-
placeholder:
|
|
4137
|
+
placeholder: h.value,
|
|
4126
4138
|
disabled: e.disabled
|
|
4127
|
-
},
|
|
4139
|
+
}, p.value, { "onUpdate:modelValue": H }), null, 16, [
|
|
4128
4140
|
"model-value",
|
|
4129
4141
|
"placeholder",
|
|
4130
4142
|
"disabled"
|
|
4131
|
-
])) : e.field.type === "cascader" ? (
|
|
4143
|
+
])) : e.field.type === "cascader" ? (R(), x(G(pe), P({
|
|
4132
4144
|
key: 15,
|
|
4133
4145
|
"model-value": e.modelValue,
|
|
4134
|
-
placeholder:
|
|
4146
|
+
placeholder: h.value,
|
|
4135
4147
|
disabled: e.disabled,
|
|
4136
4148
|
filterable: ""
|
|
4137
|
-
},
|
|
4149
|
+
}, p.value, { "onUpdate:modelValue": H }), null, 16, [
|
|
4138
4150
|
"model-value",
|
|
4139
4151
|
"placeholder",
|
|
4140
4152
|
"disabled"
|
|
4141
|
-
])) : e.field.type === "select" ? (
|
|
4153
|
+
])) : e.field.type === "select" ? (R(), x(G(a), P({
|
|
4142
4154
|
key: 16,
|
|
4143
4155
|
"model-value": e.modelValue,
|
|
4144
|
-
placeholder:
|
|
4156
|
+
placeholder: h.value,
|
|
4145
4157
|
disabled: e.disabled,
|
|
4146
|
-
fetcher:
|
|
4158
|
+
fetcher: oe,
|
|
4147
4159
|
"label-key": "label",
|
|
4148
4160
|
"value-key": "value"
|
|
4149
|
-
},
|
|
4161
|
+
}, p.value, { "onUpdate:modelValue": H }), null, 16, [
|
|
4150
4162
|
"model-value",
|
|
4151
4163
|
"placeholder",
|
|
4152
4164
|
"disabled"
|
|
4153
|
-
])) : e.field.type === "radio" ? (
|
|
4165
|
+
])) : e.field.type === "radio" ? (R(), x(G(Me), P({
|
|
4154
4166
|
key: 17,
|
|
4155
4167
|
"model-value": e.modelValue,
|
|
4156
4168
|
disabled: e.disabled
|
|
4157
|
-
},
|
|
4158
|
-
default: J(() => [(
|
|
4169
|
+
}, p.value, { "onUpdate:modelValue": H }), {
|
|
4170
|
+
default: J(() => [(R(!0), C(y, null, B(G(d), (e) => (R(), x(G(je), {
|
|
4159
4171
|
key: e.value,
|
|
4160
4172
|
value: e.value
|
|
4161
4173
|
}, {
|
|
@@ -4163,12 +4175,12 @@ var No = {
|
|
|
4163
4175
|
_: 2
|
|
4164
4176
|
}, 1032, ["value"]))), 128))]),
|
|
4165
4177
|
_: 1
|
|
4166
|
-
}, 16, ["model-value", "disabled"])) : e.field.type === "checkbox" ? (
|
|
4178
|
+
}, 16, ["model-value", "disabled"])) : e.field.type === "checkbox" ? (R(), x(G(he), P({
|
|
4167
4179
|
key: 18,
|
|
4168
4180
|
"model-value": e.modelValue,
|
|
4169
4181
|
disabled: e.disabled
|
|
4170
|
-
},
|
|
4171
|
-
default: J(() => [(
|
|
4182
|
+
}, p.value, { "onUpdate:modelValue": H }), {
|
|
4183
|
+
default: J(() => [(R(!0), C(y, null, B(G(d), (e) => (R(), x(G(me), {
|
|
4172
4184
|
key: e.value,
|
|
4173
4185
|
value: e.value
|
|
4174
4186
|
}, {
|
|
@@ -4176,43 +4188,43 @@ var No = {
|
|
|
4176
4188
|
_: 2
|
|
4177
4189
|
}, 1032, ["value"]))), 128))]),
|
|
4178
4190
|
_: 1
|
|
4179
|
-
}, 16, ["model-value", "disabled"])) : e.field.type === "switch" ? (
|
|
4191
|
+
}, 16, ["model-value", "disabled"])) : e.field.type === "switch" ? (R(), x(G(Ie), P({
|
|
4180
4192
|
key: 19,
|
|
4181
4193
|
"model-value": e.modelValue,
|
|
4182
4194
|
disabled: e.disabled
|
|
4183
|
-
},
|
|
4195
|
+
}, p.value, { "onUpdate:modelValue": H }), null, 16, ["model-value", "disabled"])) : e.field.type === "date" || e.field.type === "datetime" ? (R(), x(G(_e), P({
|
|
4184
4196
|
key: 20,
|
|
4185
4197
|
type: e.field.type,
|
|
4186
4198
|
"model-value": e.modelValue,
|
|
4187
|
-
placeholder:
|
|
4199
|
+
placeholder: h.value,
|
|
4188
4200
|
disabled: e.disabled,
|
|
4189
4201
|
"value-format": e.field.type === "date" ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss"
|
|
4190
|
-
},
|
|
4202
|
+
}, p.value, { "onUpdate:modelValue": H }), null, 16, [
|
|
4191
4203
|
"type",
|
|
4192
4204
|
"model-value",
|
|
4193
4205
|
"placeholder",
|
|
4194
4206
|
"disabled",
|
|
4195
4207
|
"value-format"
|
|
4196
|
-
])) : e.field.type === "async-select" && (
|
|
4197
|
-
key:
|
|
4208
|
+
])) : e.field.type === "async-select" && (re.value || e.field.optionSource === "dict") ? (R(), x(G(a), P({
|
|
4209
|
+
key: z.value,
|
|
4198
4210
|
"model-value": e.modelValue,
|
|
4199
|
-
placeholder:
|
|
4211
|
+
placeholder: h.value,
|
|
4200
4212
|
disabled: e.disabled,
|
|
4201
|
-
fetcher:
|
|
4202
|
-
options:
|
|
4213
|
+
fetcher: te.value ? ie : void 0,
|
|
4214
|
+
options: te.value ? void 0 : G(d)
|
|
4203
4215
|
}, {
|
|
4204
|
-
...
|
|
4205
|
-
...
|
|
4206
|
-
}, { "onUpdate:modelValue":
|
|
4216
|
+
...re.value,
|
|
4217
|
+
...p.value
|
|
4218
|
+
}, { "onUpdate:modelValue": H }), null, 16, [
|
|
4207
4219
|
"model-value",
|
|
4208
4220
|
"placeholder",
|
|
4209
4221
|
"disabled",
|
|
4210
4222
|
"fetcher",
|
|
4211
4223
|
"options"
|
|
4212
|
-
])) : (
|
|
4224
|
+
])) : (R(), x(ua, {
|
|
4213
4225
|
key: 22,
|
|
4214
4226
|
value: e.modelValue
|
|
4215
|
-
}, null, 8, ["value"])), e.field.tip ? (
|
|
4227
|
+
}, null, 8, ["value"])), e.field.tip ? (R(), C("div", Io, W(e.field.tip), 1)) : S("", !0)]),
|
|
4216
4228
|
_: 3
|
|
4217
4229
|
}, 8, [
|
|
4218
4230
|
"class",
|
|
@@ -4222,20 +4234,20 @@ var No = {
|
|
|
4222
4234
|
"rules"
|
|
4223
4235
|
]));
|
|
4224
4236
|
}
|
|
4225
|
-
}), [["__scopeId", "data-v-
|
|
4237
|
+
}), [["__scopeId", "data-v-7c39b720"]]), Ro = { class: "schema-form-root" }, zo = {
|
|
4226
4238
|
key: 0,
|
|
4227
4239
|
class: "schema-form__row-break",
|
|
4228
4240
|
"aria-hidden": "true"
|
|
4229
|
-
},
|
|
4241
|
+
}, Bo = {
|
|
4230
4242
|
key: 0,
|
|
4231
4243
|
class: "schema-form-group__header"
|
|
4232
|
-
},
|
|
4244
|
+
}, Vo = { class: "schema-form-group__index" }, Ho = { class: "schema-form-group__heading" }, Uo = { key: 0 }, Wo = {
|
|
4233
4245
|
key: 0,
|
|
4234
4246
|
class: "schema-form-group__required-note"
|
|
4235
|
-
},
|
|
4247
|
+
}, Go = { key: 1 }, Ko = {
|
|
4236
4248
|
key: 0,
|
|
4237
4249
|
class: "schema-form-group__tip"
|
|
4238
|
-
},
|
|
4250
|
+
}, qo = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
4239
4251
|
__name: "schema-form",
|
|
4240
4252
|
props: /*@__PURE__*/ N({
|
|
4241
4253
|
columns: { default: 1 },
|
|
@@ -4265,48 +4277,48 @@ var No = {
|
|
|
4265
4277
|
}),
|
|
4266
4278
|
emits: /*@__PURE__*/ N(["field-change"], ["update:modelValue"]),
|
|
4267
4279
|
setup(e, { expose: t, emit: n }) {
|
|
4268
|
-
let r = e, i = n, a =
|
|
4280
|
+
let r = e, i = n, a = K(e, "modelValue"), o = z(), s = {
|
|
4269
4281
|
behavior: "smooth",
|
|
4270
4282
|
block: "center"
|
|
4271
4283
|
}, c = b(() => r.schema), l = b(() => ({
|
|
4272
4284
|
mode: r.mode,
|
|
4273
4285
|
values: a.value ?? {}
|
|
4274
|
-
})),
|
|
4275
|
-
function
|
|
4276
|
-
return e.children.filter((e) => !
|
|
4286
|
+
})), d = b(() => c.value.filter((e) => ba(e, l.value) ? !1 : !_a(e) || f(e).length > 0));
|
|
4287
|
+
function f(e) {
|
|
4288
|
+
return e.children.filter((e) => !ba(e, l.value));
|
|
4277
4289
|
}
|
|
4278
|
-
let
|
|
4290
|
+
let p = b(() => d.value.flatMap((e) => _a(e) ? f(e) : [e])), m = b(() => Math.floor(24 / r.columns)), h = b(() => ({
|
|
4279
4291
|
[`schema-form--label-align-${r.labelAlign}`]: !!r.labelAlign,
|
|
4280
4292
|
"schema-form--underline": r.underline
|
|
4281
|
-
})),
|
|
4282
|
-
function
|
|
4293
|
+
})), g = b(() => r.mode === "view" ? "left" : r.labelPosition);
|
|
4294
|
+
function _(e) {
|
|
4283
4295
|
return typeof e == "number" ? `${e}px` : e;
|
|
4284
4296
|
}
|
|
4285
|
-
let
|
|
4286
|
-
"--schema-form-group-gap":
|
|
4287
|
-
"--schema-form-item-gap":
|
|
4288
|
-
"--schema-form-label-gap":
|
|
4297
|
+
let v = b(() => ({
|
|
4298
|
+
"--schema-form-group-gap": _(r.groupGap),
|
|
4299
|
+
"--schema-form-item-gap": _(r.itemGap),
|
|
4300
|
+
"--schema-form-label-gap": _(r.labelGap)
|
|
4289
4301
|
}));
|
|
4290
|
-
function
|
|
4291
|
-
return
|
|
4302
|
+
function T(e, t) {
|
|
4303
|
+
return _a(e) ? `group-${t}-${e.label}` : e.prop;
|
|
4292
4304
|
}
|
|
4293
|
-
function
|
|
4294
|
-
return t ? { gridColumn: e.newRow ? "1 / -1" : `span ${e.span ??
|
|
4295
|
-
}
|
|
4296
|
-
function E(e) {
|
|
4297
|
-
return d(e).some((e) => _a(e.required, l.value));
|
|
4305
|
+
function E(e, t = !1) {
|
|
4306
|
+
return t ? { gridColumn: e.newRow ? "1 / -1" : `span ${e.span ?? m.value}` } : { flex: `${e.span ?? 1} 1 0` };
|
|
4298
4307
|
}
|
|
4299
4308
|
function O(e) {
|
|
4300
|
-
|
|
4309
|
+
return f(e).some((e) => ya(e.required, l.value));
|
|
4310
|
+
}
|
|
4311
|
+
function k(e) {
|
|
4312
|
+
let t = d.value.filter((e) => _a(e) && !!e.anchor);
|
|
4301
4313
|
return String(t.indexOf(e) + 1).padStart(2, "0");
|
|
4302
4314
|
}
|
|
4303
|
-
function
|
|
4304
|
-
return r.disabled ||
|
|
4315
|
+
function A(e, t) {
|
|
4316
|
+
return r.disabled || ya(t?.disabled, l.value) || ya(e.disabled, l.value);
|
|
4305
4317
|
}
|
|
4306
|
-
function
|
|
4318
|
+
function j(e) {
|
|
4307
4319
|
return r.mode === "view" || !!e.readonly;
|
|
4308
4320
|
}
|
|
4309
|
-
function
|
|
4321
|
+
function M(e, t) {
|
|
4310
4322
|
a.value = {
|
|
4311
4323
|
...a.value,
|
|
4312
4324
|
[e.prop]: t
|
|
@@ -4314,70 +4326,70 @@ var No = {
|
|
|
4314
4326
|
}
|
|
4315
4327
|
q([c, a], () => {
|
|
4316
4328
|
let e = a.value ?? {}, t = {};
|
|
4317
|
-
for (let n of
|
|
4329
|
+
for (let n of va(c.value)) n.defaultValue !== void 0 && !(n.prop in e) && (t[n.prop] = n.defaultValue);
|
|
4318
4330
|
Object.keys(t).length > 0 && (a.value = {
|
|
4319
4331
|
...e,
|
|
4320
4332
|
...t
|
|
4321
4333
|
});
|
|
4322
4334
|
}, { immediate: !0 });
|
|
4323
|
-
async function
|
|
4335
|
+
async function N() {
|
|
4324
4336
|
if (!o.value) return !1;
|
|
4325
4337
|
try {
|
|
4326
4338
|
return await o.value.validate(), !0;
|
|
4327
4339
|
} catch (e) {
|
|
4328
|
-
let t = new Set(e && typeof e == "object" ? Object.keys(e) : []), n =
|
|
4329
|
-
return n && (await
|
|
4340
|
+
let t = new Set(e && typeof e == "object" ? Object.keys(e) : []), n = p.value.find((e) => t.has(e.prop))?.prop ?? t.values().next().value;
|
|
4341
|
+
return n && (await ee(), o.value?.scrollToField(n)), !1;
|
|
4330
4342
|
}
|
|
4331
4343
|
}
|
|
4332
4344
|
return t({
|
|
4333
|
-
validate:
|
|
4345
|
+
validate: N,
|
|
4334
4346
|
clearValidate: () => o.value?.clearValidate(),
|
|
4335
4347
|
resetFields: () => o.value?.resetFields(),
|
|
4336
|
-
getValues: () => Object.fromEntries(
|
|
4348
|
+
getValues: () => Object.fromEntries(p.value.map((e) => [e.prop, a.value?.[e.prop]]))
|
|
4337
4349
|
}), (t, n) => {
|
|
4338
|
-
let r =
|
|
4339
|
-
return
|
|
4350
|
+
let r = H("loading");
|
|
4351
|
+
return R(), C("div", Ro, [ue((R(), x(G(Se), {
|
|
4340
4352
|
ref_key: "formRef",
|
|
4341
4353
|
ref: o,
|
|
4342
|
-
class:
|
|
4343
|
-
style:
|
|
4354
|
+
class: F(["schema-form", h.value]),
|
|
4355
|
+
style: L(v.value),
|
|
4344
4356
|
model: a.value,
|
|
4345
4357
|
"label-width": e.labelWidth,
|
|
4346
|
-
"label-position":
|
|
4358
|
+
"label-position": g.value,
|
|
4347
4359
|
"scroll-into-view-options": s
|
|
4348
4360
|
}, {
|
|
4349
|
-
default: J(() => [D(
|
|
4350
|
-
default: J(() => [(
|
|
4351
|
-
span: e.span ?? (e.type === "group" ? 24 :
|
|
4352
|
-
class:
|
|
4361
|
+
default: J(() => [D(G(Ne), { gutter: 16 }, {
|
|
4362
|
+
default: J(() => [(R(!0), C(y, null, B(d.value, (e, n) => (R(), C(y, { key: T(e, n) }, [e.newRow ? (R(), C("div", zo)) : S("", !0), D(G(ge), {
|
|
4363
|
+
span: e.span ?? (e.type === "group" ? 24 : m.value),
|
|
4364
|
+
class: F({
|
|
4353
4365
|
"schema-form-col--anchor-group": e.type === "group" && e.anchor,
|
|
4354
4366
|
"schema-form-col--group-divider": e.type === "group" && n > 0
|
|
4355
4367
|
})
|
|
4356
4368
|
}, {
|
|
4357
|
-
default: J(() => [e.type === "group" ? (
|
|
4369
|
+
default: J(() => [e.type === "group" ? (R(), x(G(Ce), {
|
|
4358
4370
|
key: 0,
|
|
4359
|
-
class:
|
|
4371
|
+
class: F(["schema-form-group", { "schema-form-group--anchor": e.anchor }]),
|
|
4360
4372
|
"data-form-anchor": e.anchor ? c.value.indexOf(e) : void 0,
|
|
4361
4373
|
label: e.label
|
|
4362
4374
|
}, {
|
|
4363
|
-
label: J(() => [e.anchor ? (
|
|
4364
|
-
w("span",
|
|
4365
|
-
w("span",
|
|
4366
|
-
|
|
4367
|
-
])) : (
|
|
4368
|
-
default: J(() => [w("div", { class:
|
|
4375
|
+
label: J(() => [e.anchor ? (R(), C("div", Bo, [
|
|
4376
|
+
w("span", Vo, W(k(e)), 1),
|
|
4377
|
+
w("span", Ho, [w("strong", null, W(e.label), 1), e.description ? (R(), C("small", Uo, W(e.description), 1)) : S("", !0)]),
|
|
4378
|
+
O(e) ? (R(), C("span", Wo, W(G(u)("schemaForm.requiredNote")), 1)) : S("", !0)
|
|
4379
|
+
])) : (R(), C("span", Go, W(e.label), 1))]),
|
|
4380
|
+
default: J(() => [w("div", { class: F(["schema-form-group__body", { "schema-form-group__body--grid": e.anchor }]) }, [(R(!0), C(y, null, B(f(e), (n) => (R(), x(Lo, {
|
|
4369
4381
|
key: n.prop,
|
|
4370
|
-
style:
|
|
4382
|
+
style: L(E(n, e.anchor)),
|
|
4371
4383
|
"hide-label": !e.anchor,
|
|
4372
4384
|
field: n,
|
|
4373
4385
|
context: l.value,
|
|
4374
|
-
"label-position":
|
|
4386
|
+
"label-position": g.value,
|
|
4375
4387
|
"model-value": a.value[n.prop],
|
|
4376
|
-
disabled:
|
|
4377
|
-
readonly:
|
|
4378
|
-
"onUpdate:modelValue": (e) =>
|
|
4388
|
+
disabled: A(n, e),
|
|
4389
|
+
readonly: j(n),
|
|
4390
|
+
"onUpdate:modelValue": (e) => M(n, e)
|
|
4379
4391
|
}, {
|
|
4380
|
-
default: J((e) => [
|
|
4392
|
+
default: J((e) => [V(t.$slots, n.prop, P({ ref_for: !0 }, e), void 0, !0)]),
|
|
4381
4393
|
_: 2
|
|
4382
4394
|
}, 1032, [
|
|
4383
4395
|
"style",
|
|
@@ -4389,23 +4401,23 @@ var No = {
|
|
|
4389
4401
|
"disabled",
|
|
4390
4402
|
"readonly",
|
|
4391
4403
|
"onUpdate:modelValue"
|
|
4392
|
-
]))), 128))], 2), e.tip ? (
|
|
4404
|
+
]))), 128))], 2), e.tip ? (R(), C("div", Ko, W(e.tip), 1)) : S("", !0)]),
|
|
4393
4405
|
_: 2
|
|
4394
4406
|
}, 1032, [
|
|
4395
4407
|
"class",
|
|
4396
4408
|
"data-form-anchor",
|
|
4397
4409
|
"label"
|
|
4398
|
-
])) : (
|
|
4410
|
+
])) : (R(), x(Lo, {
|
|
4399
4411
|
key: 1,
|
|
4400
4412
|
field: e,
|
|
4401
4413
|
context: l.value,
|
|
4402
|
-
"label-position":
|
|
4414
|
+
"label-position": g.value,
|
|
4403
4415
|
"model-value": a.value[e.prop],
|
|
4404
|
-
disabled:
|
|
4405
|
-
readonly:
|
|
4406
|
-
"onUpdate:modelValue": (t) =>
|
|
4416
|
+
disabled: A(e),
|
|
4417
|
+
readonly: j(e),
|
|
4418
|
+
"onUpdate:modelValue": (t) => M(e, t)
|
|
4407
4419
|
}, {
|
|
4408
|
-
default: J((n) => [
|
|
4420
|
+
default: J((n) => [V(t.$slots, e.prop, P({ ref_for: !0 }, n), void 0, !0)]),
|
|
4409
4421
|
_: 2
|
|
4410
4422
|
}, 1032, [
|
|
4411
4423
|
"field",
|
|
@@ -4430,11 +4442,11 @@ var No = {
|
|
|
4430
4442
|
])), [[r, e.loading]])]);
|
|
4431
4443
|
};
|
|
4432
4444
|
}
|
|
4433
|
-
}), [["__scopeId", "data-v-
|
|
4445
|
+
}), [["__scopeId", "data-v-c8073595"]]), Jo = { class: "drawer-form-page__header" }, Yo = { class: "drawer-form-page__header-main" }, Xo = { class: "drawer-form-page__title-stack" }, Zo = { class: "drawer-form-page__title" }, Qo = { class: "drawer-form-page__header-actions" }, $o = { class: "drawer-form-page__status" }, es = {
|
|
4434
4446
|
key: 0,
|
|
4435
4447
|
class: "drawer-form-page__anchors",
|
|
4436
4448
|
"aria-label": "表单分区"
|
|
4437
|
-
},
|
|
4449
|
+
}, ts = ["onClick"], ns = { class: "drawer-form-page__footer" }, rs = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
4438
4450
|
__name: "index",
|
|
4439
4451
|
props: {
|
|
4440
4452
|
modelValue: {
|
|
@@ -4518,7 +4530,7 @@ var No = {
|
|
|
4518
4530
|
"closed"
|
|
4519
4531
|
],
|
|
4520
4532
|
setup(e, { expose: t, emit: n }) {
|
|
4521
|
-
let r = e, i = n, a =
|
|
4533
|
+
let r = e, i = n, a = z(0), o = se(), s = z(), c = z(), l = z(r.fullscreen), u = b({
|
|
4522
4534
|
get: () => r.modelValue,
|
|
4523
4535
|
set: (e) => i("update:modelValue", e)
|
|
4524
4536
|
}), d = b({
|
|
@@ -4543,7 +4555,7 @@ var No = {
|
|
|
4543
4555
|
l.value = !l.value, i("update:fullscreen", l.value);
|
|
4544
4556
|
}
|
|
4545
4557
|
async function k(e) {
|
|
4546
|
-
await
|
|
4558
|
+
await ee(), (c.value?.querySelector(`[data-form-anchor="${e}"]`))?.scrollIntoView({
|
|
4547
4559
|
behavior: "smooth",
|
|
4548
4560
|
block: "start"
|
|
4549
4561
|
});
|
|
@@ -4557,19 +4569,19 @@ var No = {
|
|
|
4557
4569
|
async function N() {
|
|
4558
4570
|
return await s.value?.validate() ?? !1;
|
|
4559
4571
|
}
|
|
4560
|
-
function
|
|
4572
|
+
function L() {
|
|
4561
4573
|
return s.value?.getValues() ?? {};
|
|
4562
4574
|
}
|
|
4563
|
-
async function
|
|
4564
|
-
return r.mode === "view" || r.submitting || r.loading || !await N() ? !1 : (i("submit",
|
|
4575
|
+
async function te() {
|
|
4576
|
+
return r.mode === "view" || r.submitting || r.loading || !await N() ? !1 : (i("submit", L()), !0);
|
|
4565
4577
|
}
|
|
4566
|
-
function
|
|
4578
|
+
function ne() {
|
|
4567
4579
|
s.value?.resetFields();
|
|
4568
4580
|
}
|
|
4569
|
-
function
|
|
4581
|
+
function re() {
|
|
4570
4582
|
i("closed");
|
|
4571
4583
|
}
|
|
4572
|
-
function
|
|
4584
|
+
function U() {
|
|
4573
4585
|
a.value = v.value[0]?.index ?? 0, i("open");
|
|
4574
4586
|
}
|
|
4575
4587
|
function ie() {
|
|
@@ -4584,14 +4596,14 @@ var No = {
|
|
|
4584
4596
|
}
|
|
4585
4597
|
return t({
|
|
4586
4598
|
close: j,
|
|
4587
|
-
getValues:
|
|
4588
|
-
resetFields:
|
|
4589
|
-
submit:
|
|
4599
|
+
getValues: L,
|
|
4600
|
+
resetFields: ne,
|
|
4601
|
+
submit: te,
|
|
4590
4602
|
toggleFullscreen: O,
|
|
4591
4603
|
validate: N
|
|
4592
4604
|
}), (e, t) => {
|
|
4593
|
-
let n =
|
|
4594
|
-
return
|
|
4605
|
+
let n = H("loading");
|
|
4606
|
+
return R(), x(G(ve), P({
|
|
4595
4607
|
modelValue: u.value,
|
|
4596
4608
|
"onUpdate:modelValue": t[1] ||= (e) => u.value = e
|
|
4597
4609
|
}, r.drawerProps, {
|
|
@@ -4604,59 +4616,59 @@ var No = {
|
|
|
4604
4616
|
"append-to-body": r.appendToBody,
|
|
4605
4617
|
"lock-scroll": r.lockScroll,
|
|
4606
4618
|
class: ["drawer-form-page", { "drawer-form-page--fullscreen": f.value }],
|
|
4607
|
-
onOpen:
|
|
4608
|
-
onClosed:
|
|
4619
|
+
onOpen: U,
|
|
4620
|
+
onClosed: re
|
|
4609
4621
|
}), T({
|
|
4610
|
-
header: J(() => [
|
|
4622
|
+
header: J(() => [V(e.$slots, "header", {
|
|
4611
4623
|
fullscreen: f.value,
|
|
4612
4624
|
title: r.title,
|
|
4613
4625
|
toggleFullscreen: O
|
|
4614
|
-
}, () => [w("div",
|
|
4615
|
-
w("div",
|
|
4616
|
-
w("div",
|
|
4617
|
-
w("span",
|
|
4618
|
-
r.fullscreenButton ? (
|
|
4626
|
+
}, () => [w("div", Jo, [
|
|
4627
|
+
w("div", Yo, [w("div", Xo, [w("span", Zo, W(r.title), 1)])]),
|
|
4628
|
+
w("div", Qo, [
|
|
4629
|
+
w("span", $o, [t[2] ||= w("i", { "aria-hidden": "true" }, null, -1), E(" " + W(g.value), 1)]),
|
|
4630
|
+
r.fullscreenButton ? (R(), x(G(He), {
|
|
4619
4631
|
key: 0,
|
|
4620
4632
|
content: f.value ? "退出全屏" : "全屏",
|
|
4621
4633
|
placement: "bottom"
|
|
4622
4634
|
}, {
|
|
4623
|
-
default: J(() => [D(
|
|
4635
|
+
default: J(() => [D(G(Y), {
|
|
4624
4636
|
link: "",
|
|
4625
|
-
icon: f.value ?
|
|
4637
|
+
icon: f.value ? G(ut) : G(rt),
|
|
4626
4638
|
"aria-label": f.value ? "退出全屏" : "全屏",
|
|
4627
4639
|
onClick: O
|
|
4628
4640
|
}, null, 8, ["icon", "aria-label"])]),
|
|
4629
4641
|
_: 1
|
|
4630
4642
|
}, 8, ["content"])) : S("", !0),
|
|
4631
|
-
D(
|
|
4643
|
+
D(G(He), {
|
|
4632
4644
|
content: "关闭",
|
|
4633
4645
|
placement: "bottom"
|
|
4634
4646
|
}, {
|
|
4635
|
-
default: J(() => [D(
|
|
4647
|
+
default: J(() => [D(G(Y), {
|
|
4636
4648
|
link: "",
|
|
4637
4649
|
class: "drawer-form-page__close",
|
|
4638
|
-
icon:
|
|
4650
|
+
icon: G($e),
|
|
4639
4651
|
"aria-label": "关闭",
|
|
4640
4652
|
onClick: j
|
|
4641
4653
|
}, null, 8, ["icon"])]),
|
|
4642
4654
|
_: 1
|
|
4643
4655
|
})
|
|
4644
4656
|
]),
|
|
4645
|
-
v.value.length ? (
|
|
4657
|
+
v.value.length ? (R(), C("nav", es, [(R(!0), C(y, null, B(v.value, ({ entry: e, index: t }) => (R(), C("button", {
|
|
4646
4658
|
key: t,
|
|
4647
4659
|
type: "button",
|
|
4648
|
-
class:
|
|
4660
|
+
class: F(["drawer-form-page__anchor", { "is-active": a.value === t }]),
|
|
4649
4661
|
onClick: (e) => {
|
|
4650
4662
|
a.value = t, k(t);
|
|
4651
4663
|
}
|
|
4652
|
-
}, W(e.label), 11,
|
|
4664
|
+
}, W(e.label), 11, ts))), 128))])) : S("", !0)
|
|
4653
4665
|
])], !0)]),
|
|
4654
|
-
default: J(() => [ue((
|
|
4666
|
+
default: J(() => [ue((R(), C("div", {
|
|
4655
4667
|
ref_key: "contentRef",
|
|
4656
4668
|
ref: c,
|
|
4657
4669
|
class: "drawer-form-page__content",
|
|
4658
4670
|
onScrollPassive: ie
|
|
4659
|
-
}, [D(
|
|
4671
|
+
}, [D(qo, P({
|
|
4660
4672
|
ref_key: "formRef",
|
|
4661
4673
|
ref: s
|
|
4662
4674
|
}, r.schemaFormProps, {
|
|
@@ -4667,9 +4679,9 @@ var No = {
|
|
|
4667
4679
|
columns: m.value,
|
|
4668
4680
|
disabled: r.disabled,
|
|
4669
4681
|
loading: r.loading
|
|
4670
|
-
}), T({ _: 2 }, [
|
|
4682
|
+
}), T({ _: 2 }, [B(_.value, (t) => ({
|
|
4671
4683
|
name: t,
|
|
4672
|
-
fn: J((n) => [
|
|
4684
|
+
fn: J((n) => [V(e.$slots, t, I(A(n)), void 0, !0)])
|
|
4673
4685
|
}))]), 1040, [
|
|
4674
4686
|
"modelValue",
|
|
4675
4687
|
"schema",
|
|
@@ -4677,27 +4689,27 @@ var No = {
|
|
|
4677
4689
|
"columns",
|
|
4678
4690
|
"disabled",
|
|
4679
4691
|
"loading"
|
|
4680
|
-
]),
|
|
4692
|
+
]), V(e.$slots, "default", {}, void 0, !0)], 32)), [[n, r.loading]])]),
|
|
4681
4693
|
_: 2
|
|
4682
4694
|
}, [r.showFooter ? {
|
|
4683
4695
|
name: "footer",
|
|
4684
|
-
fn: J(() => [
|
|
4696
|
+
fn: J(() => [V(e.$slots, "footer", {
|
|
4685
4697
|
cancel: M,
|
|
4686
|
-
submit:
|
|
4698
|
+
submit: te,
|
|
4687
4699
|
submitting: r.submitting
|
|
4688
|
-
}, () => [w("div",
|
|
4700
|
+
}, () => [w("div", ns, [r.showCancelButton ? (R(), x(G(Y), {
|
|
4689
4701
|
key: 0,
|
|
4690
4702
|
disabled: r.submitting,
|
|
4691
4703
|
onClick: M
|
|
4692
4704
|
}, {
|
|
4693
4705
|
default: J(() => [E(W(r.cancelText), 1)]),
|
|
4694
4706
|
_: 1
|
|
4695
|
-
}, 8, ["disabled"])) : S("", !0), h.value ? (
|
|
4707
|
+
}, 8, ["disabled"])) : S("", !0), h.value ? (R(), x(G(Y), {
|
|
4696
4708
|
key: 1,
|
|
4697
4709
|
type: "primary",
|
|
4698
4710
|
disabled: r.loading,
|
|
4699
4711
|
loading: r.submitting,
|
|
4700
|
-
onClick:
|
|
4712
|
+
onClick: te
|
|
4701
4713
|
}, {
|
|
4702
4714
|
default: J(() => [E(W(r.submitText), 1)]),
|
|
4703
4715
|
_: 1
|
|
@@ -4718,11 +4730,11 @@ var No = {
|
|
|
4718
4730
|
}
|
|
4719
4731
|
}), [["__scopeId", "data-v-41961167"]]);
|
|
4720
4732
|
// src/components/drawer-form-page/use-drawer-form-page.ts
|
|
4721
|
-
function
|
|
4722
|
-
let { closeOnSubmit: t = !0, initialValues: n, onCancel: r, onOpenChange: i, onSubmit: a, values: o, ...s } = e, c =
|
|
4733
|
+
function is(e = {}) {
|
|
4734
|
+
let { closeOnSubmit: t = !0, initialValues: n, onCancel: r, onOpenChange: i, onSubmit: a, values: o, ...s } = e, c = z(!1), l = z(as(o ?? n ?? {})), u = ne({ ...s }), d = z(), f;
|
|
4723
4735
|
function p(e = {}) {
|
|
4724
4736
|
let { values: t, ...r } = e;
|
|
4725
|
-
Object.assign(u, r), l.value =
|
|
4737
|
+
Object.assign(u, r), l.value = as(t ?? n ?? {}), c.value = !0;
|
|
4726
4738
|
}
|
|
4727
4739
|
function m() {
|
|
4728
4740
|
c.value = !1;
|
|
@@ -4750,7 +4762,7 @@ function ns(e = {}) {
|
|
|
4750
4762
|
}
|
|
4751
4763
|
function x(e) {
|
|
4752
4764
|
let { values: t, ...n } = e;
|
|
4753
|
-
Object.assign(u, n), t !== void 0 && (l.value =
|
|
4765
|
+
Object.assign(u, n), t !== void 0 && (l.value = as(t));
|
|
4754
4766
|
}
|
|
4755
4767
|
return f = {
|
|
4756
4768
|
close: m,
|
|
@@ -4768,7 +4780,7 @@ function ns(e = {}) {
|
|
|
4768
4780
|
name: "DrawerFormPageProvider",
|
|
4769
4781
|
inheritAttrs: !1,
|
|
4770
4782
|
setup(e, { attrs: n, slots: i }) {
|
|
4771
|
-
return () => j(
|
|
4783
|
+
return () => j(rs, {
|
|
4772
4784
|
...n,
|
|
4773
4785
|
...u,
|
|
4774
4786
|
ref: d,
|
|
@@ -4793,14 +4805,14 @@ function ns(e = {}) {
|
|
|
4793
4805
|
}
|
|
4794
4806
|
}), f];
|
|
4795
4807
|
}
|
|
4796
|
-
function
|
|
4808
|
+
function as(e) {
|
|
4797
4809
|
return { ...e };
|
|
4798
4810
|
}
|
|
4799
4811
|
// src/components/search-form/index.vue?vue&type=script&setup=true&lang.ts
|
|
4800
|
-
var
|
|
4812
|
+
var os = {
|
|
4801
4813
|
key: 0,
|
|
4802
4814
|
class: "search-form__actions"
|
|
4803
|
-
},
|
|
4815
|
+
}, ss = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
4804
4816
|
__name: "index",
|
|
4805
4817
|
props: /*@__PURE__*/ N({
|
|
4806
4818
|
collapsedRows: { default: 2 },
|
|
@@ -4824,55 +4836,55 @@ var is = {
|
|
|
4824
4836
|
}),
|
|
4825
4837
|
emits: /*@__PURE__*/ N(["reset", "search"], ["update:modelValue"]),
|
|
4826
4838
|
setup(e, { expose: t, emit: n }) {
|
|
4827
|
-
let r = e, i = n, a =
|
|
4839
|
+
let r = e, i = n, a = K(e, "modelValue"), o = se(), s = z(!1), c = z(), l = /* @__PURE__ */ new Set([
|
|
4828
4840
|
"async-select",
|
|
4829
4841
|
"cascader",
|
|
4830
4842
|
"select"
|
|
4831
|
-
]),
|
|
4843
|
+
]), d = b(() => r.schema), f = b(() => ({
|
|
4832
4844
|
mode: r.mode,
|
|
4833
4845
|
values: a.value ?? {}
|
|
4834
|
-
})),
|
|
4835
|
-
function
|
|
4836
|
-
return e.children.filter((e) => !
|
|
4837
|
-
}
|
|
4838
|
-
function v() {
|
|
4839
|
-
return ga(u.value);
|
|
4846
|
+
})), p = b(() => d.value.filter((e) => ba(e, f.value) ? !1 : !_a(e) || v(e).length > 0)), m = b(() => Math.max(r.columns * r.collapsedRows, r.columns)), h = b(() => r.showActions && p.value.length > m.value), g = b(() => !h.value || s.value ? p.value : p.value.slice(0, m.value)), _ = b(() => Object.keys(o));
|
|
4847
|
+
function v(e) {
|
|
4848
|
+
return e.children.filter((e) => !ba(e, f.value));
|
|
4840
4849
|
}
|
|
4841
4850
|
function y() {
|
|
4842
|
-
return
|
|
4851
|
+
return va(d.value);
|
|
4843
4852
|
}
|
|
4844
4853
|
function w() {
|
|
4845
|
-
return
|
|
4854
|
+
return Object.fromEntries(y().map((e) => [e.prop, e.defaultValue]));
|
|
4846
4855
|
}
|
|
4847
4856
|
function O() {
|
|
4848
|
-
|
|
4857
|
+
return { ...a.value ?? {} };
|
|
4849
4858
|
}
|
|
4850
|
-
function k(
|
|
4859
|
+
function k() {
|
|
4860
|
+
i("search", O());
|
|
4861
|
+
}
|
|
4862
|
+
function j(e) {
|
|
4851
4863
|
if (e.isComposing) return;
|
|
4852
4864
|
let t = e.target;
|
|
4853
|
-
t?.tagName === "INPUT" && (t.closest(".async-select, .el-select, .el-cascader, .el-date-editor") || (e.preventDefault(),
|
|
4865
|
+
t?.tagName === "INPUT" && (t.closest(".async-select, .el-select, .el-cascader, .el-date-editor") || (e.preventDefault(), k()));
|
|
4854
4866
|
}
|
|
4855
|
-
async function
|
|
4856
|
-
l.has(e.type) && (await
|
|
4867
|
+
async function M(e) {
|
|
4868
|
+
l.has(e.type) && (await ee(), k());
|
|
4857
4869
|
}
|
|
4858
|
-
function
|
|
4859
|
-
a.value =
|
|
4870
|
+
function N() {
|
|
4871
|
+
a.value = w(), i("reset", O());
|
|
4860
4872
|
}
|
|
4861
|
-
async function
|
|
4873
|
+
async function P() {
|
|
4862
4874
|
return await c.value?.validate() ?? !1;
|
|
4863
4875
|
}
|
|
4864
|
-
return q(
|
|
4876
|
+
return q(h, (e) => {
|
|
4865
4877
|
e || (s.value = !1);
|
|
4866
4878
|
}), t({
|
|
4867
|
-
getValues:
|
|
4868
|
-
validate:
|
|
4869
|
-
reset:
|
|
4870
|
-
search:
|
|
4871
|
-
}), (t, n) => (
|
|
4879
|
+
getValues: O,
|
|
4880
|
+
validate: P,
|
|
4881
|
+
reset: N,
|
|
4882
|
+
search: k
|
|
4883
|
+
}), (t, n) => (R(), C("form", {
|
|
4872
4884
|
class: "search-form",
|
|
4873
|
-
onKeydown: de(
|
|
4874
|
-
onSubmit: fe(
|
|
4875
|
-
}, [D(
|
|
4885
|
+
onKeydown: de(j, ["enter"]),
|
|
4886
|
+
onSubmit: fe(k, ["prevent"])
|
|
4887
|
+
}, [D(qo, {
|
|
4876
4888
|
ref_key: "schemaFormRef",
|
|
4877
4889
|
ref: c,
|
|
4878
4890
|
modelValue: a.value,
|
|
@@ -4880,52 +4892,54 @@ var is = {
|
|
|
4880
4892
|
class: "search-form__schema",
|
|
4881
4893
|
columns: e.columns,
|
|
4882
4894
|
disabled: e.disabled,
|
|
4883
|
-
schema:
|
|
4895
|
+
schema: g.value,
|
|
4884
4896
|
mode: e.mode,
|
|
4885
|
-
"label-align":
|
|
4886
|
-
"label-position":
|
|
4897
|
+
"label-align": e.labelAlign,
|
|
4898
|
+
"label-position": e.labelPosition,
|
|
4887
4899
|
"label-width": e.labelWidth,
|
|
4888
4900
|
"item-gap": 12,
|
|
4889
|
-
onFieldChange:
|
|
4890
|
-
}, T({ _: 2 }, [
|
|
4901
|
+
onFieldChange: M
|
|
4902
|
+
}, T({ _: 2 }, [B(_.value, (e) => ({
|
|
4891
4903
|
name: e,
|
|
4892
|
-
fn: J((n) => [
|
|
4904
|
+
fn: J((n) => [V(t.$slots, e, I(A(n)), void 0, !0)])
|
|
4893
4905
|
}))]), 1032, [
|
|
4894
4906
|
"modelValue",
|
|
4895
4907
|
"columns",
|
|
4896
4908
|
"disabled",
|
|
4897
4909
|
"schema",
|
|
4898
4910
|
"mode",
|
|
4911
|
+
"label-align",
|
|
4912
|
+
"label-position",
|
|
4899
4913
|
"label-width"
|
|
4900
|
-
]), e.showActions ? (
|
|
4901
|
-
D(
|
|
4914
|
+
]), e.showActions ? (R(), C("div", os, [
|
|
4915
|
+
D(G(Y), {
|
|
4902
4916
|
type: "primary",
|
|
4903
4917
|
"native-type": "submit"
|
|
4904
4918
|
}, {
|
|
4905
|
-
default: J(() => [
|
|
4919
|
+
default: J(() => [E(W(G(u)("components.searchForm.search")), 1)]),
|
|
4906
4920
|
_: 1
|
|
4907
4921
|
}),
|
|
4908
|
-
D(
|
|
4922
|
+
D(G(Y), {
|
|
4909
4923
|
"native-type": "button",
|
|
4910
|
-
onClick:
|
|
4924
|
+
onClick: N
|
|
4911
4925
|
}, {
|
|
4912
|
-
default: J(() => [
|
|
4926
|
+
default: J(() => [E(W(G(u)("components.searchForm.reset")), 1)]),
|
|
4913
4927
|
_: 1
|
|
4914
4928
|
}),
|
|
4915
|
-
|
|
4929
|
+
h.value ? (R(), x(G(Y), {
|
|
4916
4930
|
key: 0,
|
|
4917
4931
|
link: "",
|
|
4918
4932
|
type: "primary",
|
|
4919
4933
|
"native-type": "button",
|
|
4920
|
-
icon: s.value ?
|
|
4934
|
+
icon: s.value ? G(Xe) : G(Je),
|
|
4921
4935
|
onClick: n[1] ||= (e) => s.value = !s.value
|
|
4922
4936
|
}, {
|
|
4923
|
-
default: J(() => [E(W(s.value ? "
|
|
4937
|
+
default: J(() => [E(W(s.value ? G(u)("components.searchForm.collapse") : G(u)("components.searchForm.expand")), 1)]),
|
|
4924
4938
|
_: 1
|
|
4925
4939
|
}, 8, ["icon"])) : S("", !0)
|
|
4926
4940
|
])) : S("", !0)], 32));
|
|
4927
4941
|
}
|
|
4928
|
-
}), [["__scopeId", "data-v-
|
|
4942
|
+
}), [["__scopeId", "data-v-4b7b21fe"]]), cs = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
4929
4943
|
__name: "index",
|
|
4930
4944
|
props: {
|
|
4931
4945
|
fields: { default: () => [] },
|
|
@@ -4936,10 +4950,10 @@ var is = {
|
|
|
4936
4950
|
rowKey: { default: "id" },
|
|
4937
4951
|
actions: { default: void 0 },
|
|
4938
4952
|
pushToolbarActions: { default: () => [] },
|
|
4939
|
-
createTitle: { default:
|
|
4940
|
-
editTitle: { default:
|
|
4941
|
-
viewTitle: { default:
|
|
4942
|
-
addButtonText: { default:
|
|
4953
|
+
createTitle: { default: void 0 },
|
|
4954
|
+
editTitle: { default: void 0 },
|
|
4955
|
+
viewTitle: { default: void 0 },
|
|
4956
|
+
addButtonText: { default: void 0 },
|
|
4943
4957
|
permissionCode: {},
|
|
4944
4958
|
showImport: {
|
|
4945
4959
|
type: Boolean,
|
|
@@ -4958,7 +4972,7 @@ var is = {
|
|
|
4958
4972
|
},
|
|
4959
4973
|
deleteConfirmText: {
|
|
4960
4974
|
type: [Function, String],
|
|
4961
|
-
default:
|
|
4975
|
+
default: void 0
|
|
4962
4976
|
},
|
|
4963
4977
|
tableProps: { default: () => ({}) },
|
|
4964
4978
|
searchFormProps: { default: () => ({}) },
|
|
@@ -4991,9 +5005,9 @@ var is = {
|
|
|
4991
5005
|
"toolbarAction"
|
|
4992
5006
|
],
|
|
4993
5007
|
setup(e, { expose: t, emit: n }) {
|
|
4994
|
-
let r = e, i = n, a = se(), o =
|
|
5008
|
+
let r = e, i = n, a = se(), o = z(), s = z("create"), c = z({}), l = z(0), d = z([]), f = z({}), p = z({}), m = b(() => r.fields.filter((e) => e.form !== !1)), h = b(() => {
|
|
4995
5009
|
let e = r.searchFormProps?.schema;
|
|
4996
|
-
return e?.length ? e : r.fields.filter((e) => e.search).map((e) =>
|
|
5010
|
+
return e?.length ? e : r.fields.filter((e) => e.search).map((e) => ne(e)).filter((e) => !!e);
|
|
4997
5011
|
}), g = b(() => h.value.length > 0), _ = b(() => r.fields.filter((e) => e.table !== !1).filter((e) => e.type !== "group").map((e) => {
|
|
4998
5012
|
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);
|
|
4999
5013
|
return {
|
|
@@ -5016,7 +5030,7 @@ var is = {
|
|
|
5016
5030
|
if (r.actions) return r.actions;
|
|
5017
5031
|
let e = [];
|
|
5018
5032
|
return r.onUpdate && e.push("edit"), r.onDelete && e.push("delete"), e;
|
|
5019
|
-
}), M = b(() => r.tableProps?.showActions ?? O.value.length > 0), N = b(() => r.permissionCode ?? r.tableProps?.permissionCode ?? ""),
|
|
5033
|
+
}), M = b(() => r.tableProps?.showActions ?? O.value.length > 0), N = b(() => r.permissionCode ?? r.tableProps?.permissionCode ?? ""), F = b(() => {
|
|
5020
5034
|
let e = r.tableProps ?? {}, t = e.importDialog;
|
|
5021
5035
|
return !r.importUrl && !t ? e : {
|
|
5022
5036
|
...e,
|
|
@@ -5025,10 +5039,10 @@ var is = {
|
|
|
5025
5039
|
...typeof r.importUrl == "string" ? { api: r.importUrl } : r.importUrl ?? {}
|
|
5026
5040
|
}
|
|
5027
5041
|
};
|
|
5028
|
-
}),
|
|
5042
|
+
}), L = b(() => {
|
|
5029
5043
|
let { schema: e, ...t } = r.searchFormProps ?? {};
|
|
5030
5044
|
return t;
|
|
5031
|
-
}),
|
|
5045
|
+
}), te = /* @__PURE__ */ new Set([
|
|
5032
5046
|
"apiOptions",
|
|
5033
5047
|
"component",
|
|
5034
5048
|
"copyable",
|
|
@@ -5051,10 +5065,10 @@ var is = {
|
|
|
5051
5065
|
"tip",
|
|
5052
5066
|
"type"
|
|
5053
5067
|
]);
|
|
5054
|
-
function
|
|
5055
|
-
return e.type === "group" ?
|
|
5068
|
+
function ne(e) {
|
|
5069
|
+
return e.type === "group" ? re(e) : U(e);
|
|
5056
5070
|
}
|
|
5057
|
-
function
|
|
5071
|
+
function re(e) {
|
|
5058
5072
|
let t = e.search;
|
|
5059
5073
|
if (!t) return null;
|
|
5060
5074
|
let n = typeof t == "object" ? t : {}, r = Array.isArray(n.children) ? n.children : e.children;
|
|
@@ -5065,10 +5079,10 @@ var is = {
|
|
|
5065
5079
|
hidden: n.hidden ?? !1
|
|
5066
5080
|
};
|
|
5067
5081
|
}
|
|
5068
|
-
function
|
|
5082
|
+
function U(e) {
|
|
5069
5083
|
let t = e.search;
|
|
5070
5084
|
if (!t) return null;
|
|
5071
|
-
let n = typeof t == "object" ? t : {}, r = ae(n), i =
|
|
5085
|
+
let n = typeof t == "object" ? t : {}, r = ae(n), i = oe(e.props, r);
|
|
5072
5086
|
return {
|
|
5073
5087
|
...e,
|
|
5074
5088
|
...ie(n),
|
|
@@ -5080,12 +5094,12 @@ var is = {
|
|
|
5080
5094
|
};
|
|
5081
5095
|
}
|
|
5082
5096
|
function ie(e) {
|
|
5083
|
-
return Object.fromEntries(Object.entries(e).filter(([e]) =>
|
|
5097
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => te.has(e)));
|
|
5084
5098
|
}
|
|
5085
5099
|
function ae(e) {
|
|
5086
|
-
return Object.fromEntries(Object.entries(e).filter(([e]) => !
|
|
5100
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => !te.has(e)));
|
|
5087
5101
|
}
|
|
5088
|
-
function
|
|
5102
|
+
function oe(e, t) {
|
|
5089
5103
|
return Object.keys(t).length === 0 ? e : typeof e == "function" ? ((n) => ({
|
|
5090
5104
|
...e(n),
|
|
5091
5105
|
...t
|
|
@@ -5094,22 +5108,22 @@ var is = {
|
|
|
5094
5108
|
...t
|
|
5095
5109
|
};
|
|
5096
5110
|
}
|
|
5097
|
-
async function
|
|
5098
|
-
p.value = { ...e }, await
|
|
5111
|
+
async function K(e) {
|
|
5112
|
+
p.value = { ...e }, await ee(), await ke();
|
|
5099
5113
|
}
|
|
5100
5114
|
function ce(e) {
|
|
5101
|
-
|
|
5115
|
+
K(e);
|
|
5102
5116
|
}
|
|
5103
5117
|
function le() {
|
|
5104
|
-
|
|
5118
|
+
K({});
|
|
5105
5119
|
}
|
|
5106
5120
|
function q(e = f.value) {
|
|
5107
5121
|
f.value = { ...e }, ce(f.value);
|
|
5108
5122
|
}
|
|
5109
5123
|
function de(e = {}) {
|
|
5110
|
-
f.value = { ...e },
|
|
5124
|
+
f.value = { ...e }, K(f.value);
|
|
5111
5125
|
}
|
|
5112
|
-
let [fe, X] =
|
|
5126
|
+
let [fe, X] = is({
|
|
5113
5127
|
...r.drawerProps,
|
|
5114
5128
|
schema: m.value,
|
|
5115
5129
|
schemaFormProps: {
|
|
@@ -5118,20 +5132,20 @@ var is = {
|
|
|
5118
5132
|
},
|
|
5119
5133
|
onSubmit: async (e) => {
|
|
5120
5134
|
let t = s.value === "create";
|
|
5121
|
-
if (!(t ? r.onCreate : r.onUpdate)) return Q.warning("
|
|
5135
|
+
if (!(t ? r.onCreate : r.onUpdate)) return Q.warning(u("components.crudPage.submitHandlerMissing")), !1;
|
|
5122
5136
|
X.setState({ submitting: !0 });
|
|
5123
5137
|
try {
|
|
5124
5138
|
let n = t ? e : he(e, c.value);
|
|
5125
|
-
return (t ? await r.onCreate?.(e) : await r.onUpdate?.(n, c.value)) !== !1 && (Q.success(s.value === "create" ? "
|
|
5139
|
+
return (t ? await r.onCreate?.(e) : await r.onUpdate?.(n, c.value)) !== !1 && (Q.success(s.value === "create" ? u("components.crudPage.createSuccess") : u("components.crudPage.updateSuccess")), await ke(), !0);
|
|
5126
5140
|
} catch {
|
|
5127
|
-
return Q.error(s.value === "create" ? "
|
|
5141
|
+
return Q.error(s.value === "create" ? u("components.crudPage.createFailed") : u("components.crudPage.updateFailed")), !1;
|
|
5128
5142
|
} finally {
|
|
5129
5143
|
X.setState({ submitting: !1 });
|
|
5130
5144
|
}
|
|
5131
5145
|
}
|
|
5132
5146
|
});
|
|
5133
5147
|
function pe(e) {
|
|
5134
|
-
return e === "create" ? r.createTitle : e === "edit" ? r.editTitle : r.viewTitle;
|
|
5148
|
+
return e === "create" ? r.createTitle ?? u("components.crudPage.createTitle") : e === "edit" ? r.editTitle ?? u("components.crudPage.editTitle") : r.viewTitle ?? u("components.crudPage.viewTitle");
|
|
5135
5149
|
}
|
|
5136
5150
|
function me(e, t) {
|
|
5137
5151
|
let n = e === "create" ? {
|
|
@@ -5164,7 +5178,7 @@ var is = {
|
|
|
5164
5178
|
let i = await r.resolveFormValues?.(e, t);
|
|
5165
5179
|
n === l.value && i && (c.value = he(i, c.value), X.setValues(i));
|
|
5166
5180
|
} catch {
|
|
5167
|
-
n === l.value && (Q.error("
|
|
5181
|
+
n === l.value && (Q.error(u("components.crudPage.loadDetailFailed")), X.close());
|
|
5168
5182
|
} finally {
|
|
5169
5183
|
n === l.value && X.setState({ loading: !1 });
|
|
5170
5184
|
}
|
|
@@ -5173,10 +5187,11 @@ var is = {
|
|
|
5173
5187
|
await ge("create");
|
|
5174
5188
|
}
|
|
5175
5189
|
function ve(e) {
|
|
5176
|
-
|
|
5190
|
+
let t = r.deleteConfirmText;
|
|
5191
|
+
return typeof t == "function" ? t(e) : t ?? u("components.crudPage.deleteConfirmText");
|
|
5177
5192
|
}
|
|
5178
5193
|
async function ye(e) {
|
|
5179
|
-
if (!r.onDelete) Q.warning("
|
|
5194
|
+
if (!r.onDelete) Q.warning(u("components.crudPage.deleteHandlerMissing"));
|
|
5180
5195
|
else {
|
|
5181
5196
|
if (r.confirmDelete) try {
|
|
5182
5197
|
await De.confirm(ve(e), { type: "warning" });
|
|
@@ -5185,19 +5200,19 @@ var is = {
|
|
|
5185
5200
|
}
|
|
5186
5201
|
try {
|
|
5187
5202
|
if (await r.onDelete(e) === !1) return;
|
|
5188
|
-
Q.success("
|
|
5203
|
+
Q.success(u("components.crudPage.deleteSuccess")), await ke();
|
|
5189
5204
|
} catch {
|
|
5190
|
-
Q.error("
|
|
5205
|
+
Q.error(u("components.crudPage.deleteFailed"));
|
|
5191
5206
|
}
|
|
5192
5207
|
}
|
|
5193
5208
|
}
|
|
5194
5209
|
async function be() {
|
|
5195
|
-
let e = [...
|
|
5210
|
+
let e = [...d.value];
|
|
5196
5211
|
if (e.length !== 0) {
|
|
5197
|
-
if (!r.onDelete && !r.onBatchDelete) Q.warning("
|
|
5212
|
+
if (!r.onDelete && !r.onBatchDelete) Q.warning(u("components.crudPage.batchDeleteHandlerMissing"));
|
|
5198
5213
|
else {
|
|
5199
5214
|
try {
|
|
5200
|
-
await De.confirm(
|
|
5215
|
+
await De.confirm(u("components.crudPage.batchDeleteConfirm", { count: e.length }), { type: "warning" });
|
|
5201
5216
|
} catch {
|
|
5202
5217
|
return;
|
|
5203
5218
|
}
|
|
@@ -5205,22 +5220,22 @@ var is = {
|
|
|
5205
5220
|
if (r.onBatchDelete) {
|
|
5206
5221
|
if (await r.onBatchDelete(e) === !1) return;
|
|
5207
5222
|
} else for (let t of e) if (await r.onDelete?.(t) === !1) return;
|
|
5208
|
-
Q.success("
|
|
5223
|
+
Q.success(u("components.crudPage.deleteSuccess")), o.value?.clearSelection(), await ke();
|
|
5209
5224
|
} catch {
|
|
5210
|
-
Q.error("
|
|
5225
|
+
Q.error(u("components.crudPage.deleteFailed"));
|
|
5211
5226
|
}
|
|
5212
5227
|
}
|
|
5213
5228
|
}
|
|
5214
5229
|
}
|
|
5215
5230
|
function xe() {
|
|
5216
|
-
o.value?.openImport() || Q.warning("
|
|
5231
|
+
o.value?.openImport() || Q.warning(u("components.crudPage.importNotConfigured"));
|
|
5217
5232
|
}
|
|
5218
5233
|
async function Se() {
|
|
5219
5234
|
if (!r?.exportConfig) return;
|
|
5220
5235
|
let { onExport: e, name: t, url: n } = r.exportConfig;
|
|
5221
5236
|
if (e) try {
|
|
5222
5237
|
let r = mn(), i = e({
|
|
5223
|
-
rows:
|
|
5238
|
+
rows: d.value,
|
|
5224
5239
|
queryParmas: f.value
|
|
5225
5240
|
}), a = await Sn.download(Ce(n), {
|
|
5226
5241
|
responseReturn: "raw",
|
|
@@ -5234,7 +5249,7 @@ var is = {
|
|
|
5234
5249
|
source: a.data
|
|
5235
5250
|
});
|
|
5236
5251
|
} catch {
|
|
5237
|
-
Q.error("
|
|
5252
|
+
Q.error(u("components.crudPage.exportFailed"));
|
|
5238
5253
|
}
|
|
5239
5254
|
}
|
|
5240
5255
|
function Ce(e) {
|
|
@@ -5286,31 +5301,31 @@ var is = {
|
|
|
5286
5301
|
openView: (e) => ge("view", e),
|
|
5287
5302
|
reload: ke
|
|
5288
5303
|
}), (e, t) => {
|
|
5289
|
-
let n =
|
|
5290
|
-
return
|
|
5304
|
+
let n = H("access");
|
|
5305
|
+
return R(), C(y, null, [D(na, null, {
|
|
5291
5306
|
default: J(() => [
|
|
5292
|
-
|
|
5293
|
-
e.$slots.search ?
|
|
5307
|
+
V(e.$slots, "prepend", {}, void 0, !0),
|
|
5308
|
+
e.$slots.search ? V(e.$slots, "search", {
|
|
5294
5309
|
values: f.value,
|
|
5295
5310
|
search: q,
|
|
5296
5311
|
reset: de
|
|
5297
|
-
}, void 0, !0, 0) : g.value ? (
|
|
5312
|
+
}, void 0, !0, 0) : g.value ? (R(), x(ss, P({
|
|
5298
5313
|
key: 1,
|
|
5299
5314
|
modelValue: f.value,
|
|
5300
5315
|
"onUpdate:modelValue": t[0] ||= (e) => f.value = e,
|
|
5301
5316
|
class: "crud-page__search"
|
|
5302
|
-
},
|
|
5317
|
+
}, L.value, {
|
|
5303
5318
|
schema: h.value,
|
|
5304
5319
|
onSearch: ce,
|
|
5305
5320
|
onReset: le
|
|
5306
|
-
}), T({ _: 2 }, [
|
|
5321
|
+
}), T({ _: 2 }, [B(w.value, (t) => ({
|
|
5307
5322
|
name: t,
|
|
5308
|
-
fn: J((n) => [
|
|
5323
|
+
fn: J((n) => [V(e.$slots, t, I(A(n)), void 0, !0)])
|
|
5309
5324
|
}))]), 1040, ["modelValue", "schema"])) : S("", !0),
|
|
5310
|
-
D(
|
|
5325
|
+
D(Pi, P({
|
|
5311
5326
|
ref_key: "tableRef",
|
|
5312
5327
|
ref: o
|
|
5313
|
-
},
|
|
5328
|
+
}, F.value, {
|
|
5314
5329
|
"row-key": r.rowKey,
|
|
5315
5330
|
columns: _.value,
|
|
5316
5331
|
data: r.data,
|
|
@@ -5318,48 +5333,48 @@ var is = {
|
|
|
5318
5333
|
actions: O.value,
|
|
5319
5334
|
"show-actions": M.value,
|
|
5320
5335
|
"permission-code": N.value,
|
|
5321
|
-
onSelectionChange: t[1] ||= (e) =>
|
|
5336
|
+
onSelectionChange: t[1] ||= (e) => d.value = e,
|
|
5322
5337
|
onHandleAction: Oe,
|
|
5323
5338
|
onRowSort: t[2] ||= (e) => i("rowSort", e)
|
|
5324
5339
|
}), T({
|
|
5325
|
-
buttons: J(() => [
|
|
5326
|
-
r.onCreate ? ue((
|
|
5340
|
+
buttons: J(() => [V(e.$slots, "buttons", { selectedRows: d.value }, () => [
|
|
5341
|
+
r.onCreate ? ue((R(), x(G(Y), {
|
|
5327
5342
|
key: 0,
|
|
5328
5343
|
type: "primary",
|
|
5329
5344
|
onClick: _e
|
|
5330
5345
|
}, {
|
|
5331
|
-
default: J(() => [E(W(r.addButtonText), 1)]),
|
|
5346
|
+
default: J(() => [E(W(r.addButtonText ?? G(u)("components.crudPage.addButtonText")), 1)]),
|
|
5332
5347
|
_: 1
|
|
5333
5348
|
})), [[n, [`${N.value}:add`]]]) : S("", !0),
|
|
5334
|
-
r.onDelete || r.onBatchDelete ? ue((
|
|
5349
|
+
r.onDelete || r.onBatchDelete ? ue((R(), x(G(Y), {
|
|
5335
5350
|
key: 1,
|
|
5336
5351
|
type: "danger",
|
|
5337
|
-
disabled:
|
|
5352
|
+
disabled: d.value.length === 0,
|
|
5338
5353
|
onClick: be
|
|
5339
5354
|
}, {
|
|
5340
|
-
default: J(() => [E(W(
|
|
5355
|
+
default: J(() => [E(W(G(u)("components.tableEntity.batchDelete")), 1)]),
|
|
5341
5356
|
_: 1
|
|
5342
5357
|
}, 8, ["disabled"])), [[n, [`${N.value}:remove`]]]) : S("", !0),
|
|
5343
|
-
r.showImport ? ue((
|
|
5358
|
+
r.showImport ? ue((R(), x(G(Y), {
|
|
5344
5359
|
key: 2,
|
|
5345
5360
|
onClick: xe
|
|
5346
5361
|
}, {
|
|
5347
|
-
default: J(() => [E(W(
|
|
5362
|
+
default: J(() => [E(W(G(u)("components.tableEntity.import")), 1)]),
|
|
5348
5363
|
_: 1
|
|
5349
5364
|
})), [[n, [`${N.value}:import`]]]) : S("", !0),
|
|
5350
|
-
r.exportConfig ? ue((
|
|
5365
|
+
r.showExport && r.exportConfig ? ue((R(), x(G(Y), {
|
|
5351
5366
|
key: 3,
|
|
5352
5367
|
onClick: Se
|
|
5353
5368
|
}, {
|
|
5354
|
-
default: J(() => [E(W(
|
|
5369
|
+
default: J(() => [E(W(G(u)("components.tableEntity.export")), 1)]),
|
|
5355
5370
|
_: 1
|
|
5356
5371
|
})), [[n, [`${N.value}:export`]]]) : S("", !0),
|
|
5357
|
-
D(
|
|
5372
|
+
D(G($))
|
|
5358
5373
|
], !0)]),
|
|
5359
5374
|
_: 2
|
|
5360
|
-
}, [
|
|
5375
|
+
}, [B(v.value, (t) => ({
|
|
5361
5376
|
name: t,
|
|
5362
|
-
fn: J((n) => [
|
|
5377
|
+
fn: J((n) => [V(e.$slots, t, I(A(n)), void 0, !0)])
|
|
5363
5378
|
}))]), 1040, [
|
|
5364
5379
|
"row-key",
|
|
5365
5380
|
"columns",
|
|
@@ -5371,28 +5386,28 @@ var is = {
|
|
|
5371
5386
|
])
|
|
5372
5387
|
]),
|
|
5373
5388
|
_: 3
|
|
5374
|
-
}), D(
|
|
5375
|
-
default: J(() => [e.$slots.default ?
|
|
5389
|
+
}), D(G(fe), null, T({
|
|
5390
|
+
default: J(() => [e.$slots.default ? V(e.$slots, "default", {}, void 0, !0, 0) : S("", !0)]),
|
|
5376
5391
|
_: 2
|
|
5377
5392
|
}, [
|
|
5378
|
-
|
|
5393
|
+
B(w.value, (t) => ({
|
|
5379
5394
|
name: t,
|
|
5380
|
-
fn: J((n) => [
|
|
5395
|
+
fn: J((n) => [V(e.$slots, t, I(A(n)), void 0, !0)])
|
|
5381
5396
|
})),
|
|
5382
5397
|
e.$slots.header ? {
|
|
5383
5398
|
name: "header",
|
|
5384
|
-
fn: J((t) => [
|
|
5399
|
+
fn: J((t) => [V(e.$slots, "header", I(A(t)), void 0, !0)]),
|
|
5385
5400
|
key: "0"
|
|
5386
5401
|
} : void 0,
|
|
5387
5402
|
e.$slots.footer ? {
|
|
5388
5403
|
name: "footer",
|
|
5389
|
-
fn: J((t) => [
|
|
5404
|
+
fn: J((t) => [V(e.$slots, "footer", I(A(t)), void 0, !0)]),
|
|
5390
5405
|
key: "1"
|
|
5391
5406
|
} : void 0
|
|
5392
5407
|
]), 1024)], 64);
|
|
5393
5408
|
};
|
|
5394
5409
|
}
|
|
5395
|
-
}), [["__scopeId", "data-v-
|
|
5410
|
+
}), [["__scopeId", "data-v-a852aef4"]]), ls = /* @__PURE__ */ k({
|
|
5396
5411
|
__name: "index",
|
|
5397
5412
|
props: {
|
|
5398
5413
|
className: { default: "disguiseicon" },
|
|
@@ -5400,9 +5415,9 @@ var is = {
|
|
|
5400
5415
|
},
|
|
5401
5416
|
setup(e) {
|
|
5402
5417
|
let t = e;
|
|
5403
|
-
return (e, n) => (
|
|
5418
|
+
return (e, n) => (R(), x(G(Z), P(e.$attrs, { class: ["disguise iconfont", t.icon ? `${t.className}-${t.icon}` : void 0] }), null, 16, ["class"]));
|
|
5404
5419
|
}
|
|
5405
|
-
}),
|
|
5420
|
+
}), us = ["src"], ds = { class: "image-upload__mask" }, fs = { class: "image-upload__text" }, ps = /*#__PURE__*/ f(/* @__PURE__ */ k({
|
|
5406
5421
|
__name: "index",
|
|
5407
5422
|
props: /*@__PURE__*/ N({
|
|
5408
5423
|
accept: { default: () => [
|
|
@@ -5424,16 +5439,16 @@ var is = {
|
|
|
5424
5439
|
}),
|
|
5425
5440
|
emits: ["update:modelValue"],
|
|
5426
5441
|
setup(e) {
|
|
5427
|
-
let t = e, n =
|
|
5442
|
+
let t = e, n = K(e, "modelValue"), { resolveImageUrl: r } = p(), i = z(!1), a = z(!1), o = b(() => r(n.value)), s = b(() => ({
|
|
5428
5443
|
width: `${t.width}px`,
|
|
5429
5444
|
height: `${t.height}px`
|
|
5430
5445
|
}));
|
|
5431
5446
|
function c(e) {
|
|
5432
5447
|
if (t.accept.length > 0 && !t.accept.includes(e.type)) {
|
|
5433
5448
|
let e = t.accept.map((e) => e.replace("image/", "").replace("+xml", "")).join(" / ").toUpperCase();
|
|
5434
|
-
return Q.error(
|
|
5449
|
+
return Q.error(u("components.imageUpload.typeNotAllowed", { types: e })), !1;
|
|
5435
5450
|
}
|
|
5436
|
-
return e.size / 1024 / 1024 > t.maxSize ? (Q.error(
|
|
5451
|
+
return e.size / 1024 / 1024 > t.maxSize ? (Q.error(u("components.imageUpload.sizeLimitExceeded", { size: t.maxSize })), !1) : !0;
|
|
5437
5452
|
}
|
|
5438
5453
|
async function l(e) {
|
|
5439
5454
|
i.value = !0;
|
|
@@ -5444,33 +5459,33 @@ var is = {
|
|
|
5444
5459
|
i.value = !1;
|
|
5445
5460
|
}
|
|
5446
5461
|
}
|
|
5447
|
-
function
|
|
5462
|
+
function d() {
|
|
5448
5463
|
n.value = "";
|
|
5449
5464
|
}
|
|
5450
|
-
return (t, n) => (
|
|
5465
|
+
return (t, n) => (R(), C("div", { class: F(["image-upload", { "is-disabled": e.disabled }]) }, [o.value ? (R(), C("div", {
|
|
5451
5466
|
key: 0,
|
|
5452
5467
|
class: "image-upload__box",
|
|
5453
|
-
style:
|
|
5468
|
+
style: L(s.value)
|
|
5454
5469
|
}, [w("img", {
|
|
5455
5470
|
src: o.value,
|
|
5456
5471
|
alt: "",
|
|
5457
5472
|
class: "image-upload__img"
|
|
5458
|
-
}, null, 8,
|
|
5473
|
+
}, null, 8, us), w("div", ds, [D(G(Z), {
|
|
5459
5474
|
class: "image-upload__action",
|
|
5460
|
-
title:
|
|
5475
|
+
title: G(u)("components.imageUpload.preview"),
|
|
5461
5476
|
onClick: n[0] ||= (e) => a.value = !0
|
|
5462
5477
|
}, {
|
|
5463
|
-
default: J(() => [D(
|
|
5478
|
+
default: J(() => [D(G(ht))]),
|
|
5464
5479
|
_: 1
|
|
5465
|
-
}, 8, ["title"]), e.disabled ? S("", !0) : (
|
|
5480
|
+
}, 8, ["title"]), e.disabled ? S("", !0) : (R(), x(G(Z), {
|
|
5466
5481
|
key: 0,
|
|
5467
5482
|
class: "image-upload__action",
|
|
5468
|
-
title:
|
|
5469
|
-
onClick:
|
|
5483
|
+
title: G(u)("components.imageUpload.remove"),
|
|
5484
|
+
onClick: d
|
|
5470
5485
|
}, {
|
|
5471
|
-
default: J(() => [D(
|
|
5486
|
+
default: J(() => [D(G(tt))]),
|
|
5472
5487
|
_: 1
|
|
5473
|
-
}, 8, ["title"]))])], 4)) : (
|
|
5488
|
+
}, 8, ["title"]))])], 4)) : (R(), x(G(Ue), {
|
|
5474
5489
|
key: 1,
|
|
5475
5490
|
accept: e.accept.join(","),
|
|
5476
5491
|
"before-upload": c,
|
|
@@ -5480,13 +5495,13 @@ var is = {
|
|
|
5480
5495
|
}, {
|
|
5481
5496
|
default: J(() => [w("div", {
|
|
5482
5497
|
class: "image-upload__box is-empty",
|
|
5483
|
-
style:
|
|
5484
|
-
}, [D(
|
|
5485
|
-
default: J(() => [i.value ? (
|
|
5498
|
+
style: L(s.value)
|
|
5499
|
+
}, [D(G(Z), { class: F(["image-upload__icon", { "is-loading": i.value }]) }, {
|
|
5500
|
+
default: J(() => [i.value ? (R(), x(G(at), { key: 0 })) : (R(), x(G(st), { key: 1 }))]),
|
|
5486
5501
|
_: 1
|
|
5487
|
-
}, 8, ["class"]), w("span",
|
|
5502
|
+
}, 8, ["class"]), w("span", fs, W(i.value ? G(u)("components.imageUpload.uploading") : G(u)("components.imageUpload.upload")), 1)], 4)]),
|
|
5488
5503
|
_: 1
|
|
5489
|
-
}, 8, ["accept", "disabled"])), a.value ? (
|
|
5504
|
+
}, 8, ["accept", "disabled"])), a.value ? (R(), x(G(we), {
|
|
5490
5505
|
key: 2,
|
|
5491
5506
|
"url-list": [o.value],
|
|
5492
5507
|
teleported: "",
|
|
@@ -5495,7 +5510,7 @@ var is = {
|
|
|
5495
5510
|
}
|
|
5496
5511
|
}), [["__scopeId", "data-v-c6aeef2e"]]);
|
|
5497
5512
|
// src/setup.ts
|
|
5498
|
-
function
|
|
5513
|
+
function ms(e = {}) {
|
|
5499
5514
|
l(e);
|
|
5500
5515
|
}
|
|
5501
|
-
export {
|
|
5516
|
+
export { ea as AsyncSelect, na as BaseCard, cs as CrudPage, zi as DialogList, Ir as DictTag, ls as DisguiseIcon, rs as DrawerFormPage, g as FileUpload, ps as ImageUpload, t as ImagesView, ar as ImportDialog, v as PictureUpload, Co as RichTextEditor, qo as SchemaForm, ss as SearchForm, Pi as TableEntity, m as UserAvatarInfo, aa as getEntity, oa as paginateLocally, ia as registerEntity, pa as registerSchemaFormComponents, ms as setupDisguise, is as useDrawerFormPage };
|