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