disguise-ui 0.3.9-4 → 0.3.9-6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/disguise-ui.js +642 -636
- package/dist/style.css +1 -1
- package/dist/types/components/crud-page/index.vue.d.ts +2 -2
- package/dist/types/components/dialog-list/index.vue.d.ts +6 -6
- package/dist/types/components/import-dialog/index.type.d.ts +3 -0
- package/dist/types/components/import-dialog/index.vue.d.ts +1 -0
- package/dist/types/components/table-entity/index.vue.d.ts +1 -1
- package/package.json +1 -1
package/dist/disguise-ui.js
CHANGED
|
@@ -10,7 +10,7 @@ import { t as g } from "./rich-text-editor-BBqumj_m.js";
|
|
|
10
10
|
import { t as _ } from "./file-upload-tFhYHbgo.js";
|
|
11
11
|
import { r as v } from "./use-multiple-file-upload-Drg_TeGr.js";
|
|
12
12
|
import { t as y } from "./picture-upload-nL1bAp7g.js";
|
|
13
|
-
import { Fragment as b, computed as x, createBlock as S, createCommentVNode as C, createElementBlock as w, createElementVNode as T, createSlots as E, createTextVNode as D, createVNode as O, defineAsyncComponent as k, defineComponent as A, guardReactiveProps as j, h as M, isRef as N, mergeModels as P, mergeProps as F, nextTick as
|
|
13
|
+
import { Fragment as b, computed as x, createBlock as S, createCommentVNode as C, createElementBlock as w, createElementVNode as T, createSlots as E, createTextVNode as D, createVNode as O, defineAsyncComponent as k, defineComponent as A, guardReactiveProps as j, h as M, isRef as N, mergeModels as P, mergeProps as F, nextTick as I, normalizeClass as L, normalizeProps as R, normalizeStyle as z, onUnmounted as ee, openBlock as B, reactive as te, ref as V, renderList as H, renderSlot as U, resolveDirective as ne, resolveDynamicComponent as re, shallowReactive as W, toDisplayString as G, toHandlers as ie, toValue as ae, unref as K, useModel as oe, useSlots as se, watch as q, withCtx as J, withDirectives as ce, withKeys as le, withModifiers as Y } from "vue";
|
|
14
14
|
import { ElButton as X, ElCard as ue, ElCascader as de, ElCheckbox as fe, ElCheckboxGroup as pe, ElCol as me, ElDatePicker as he, ElDrawer as ge, ElDropdown as _e, ElDropdownItem as ve, ElDropdownMenu as ye, ElForm as be, ElFormItem as xe, ElIcon as Z, ElImageViewer as Se, ElInput as Ce, ElInputNumber as we, ElMessage as Q, ElMessageBox as Te, ElOption as $, ElPagination as Ee, ElPopover as De, ElProgress as Oe, ElRadio as ke, ElRadioGroup as Ae, ElRow as je, ElSelect as Me, ElSelectV2 as Ne, ElSwitch as Pe, ElTabPane as Fe, ElTable as Ie, ElTableColumn as Le, ElTableV2 as Re, ElTabs as ze, ElTooltip as Be, ElUpload as Ve, TableV2FixedDir as He } from "element-plus";
|
|
15
15
|
import Ue from "dayjs";
|
|
16
16
|
import We from "dayjs/plugin/timezone.js";
|
|
@@ -85,7 +85,10 @@ var Ot = {
|
|
|
85
85
|
}, Rt = { class: "import-dialog__upload-inner" }, zt = { class: "import-dialog__upload-icon" }, Bt = { class: "import-dialog__upload-title" }, Vt = { class: "import-dialog__upload-link" }, Ht = { class: "import-dialog__upload-subtitle" }, Ut = {
|
|
86
86
|
key: 0,
|
|
87
87
|
class: "import-dialog__upload-name"
|
|
88
|
-
}, Wt = {
|
|
88
|
+
}, Wt = {
|
|
89
|
+
key: 0,
|
|
90
|
+
class: "import-dialog__download"
|
|
91
|
+
}, Gt = { class: "import-dialog__tips" }, Kt = { class: "import-dialog__preview-header" }, qt = { class: "import-dialog__preview-field" }, Jt = { class: "import-dialog__form-label" }, Yt = { class: "import-dialog__preview-field" }, Xt = { class: "import-dialog__form-label" }, Zt = { class: "import-dialog__preview-summary" }, Qt = { class: "import-dialog__mapping-header" }, $t = { class: "import-dialog__mapping-body" }, en = { class: "import-dialog__mapping-arrow" }, tn = { class: "import-dialog__mapping-checkbox" }, nn = { class: "import-dialog__result-badge" }, rn = { class: "import-dialog__result-title" }, an = { class: "import-dialog__result-description" }, on = {
|
|
89
92
|
key: 0,
|
|
90
93
|
class: "import-dialog__result-detail"
|
|
91
94
|
}, sn = { class: "import-dialog__progress" }, cn = { class: "import-dialog__progress-icon" }, ln = { class: "import-dialog__progress-title" }, un = { class: "import-dialog__progress-description" }, dn = { class: "import-dialog__progress-hint" }, fn = { class: "import-dialog__footer" }, pn = /* @__PURE__ */ u(/* @__PURE__ */ A({
|
|
@@ -120,7 +123,8 @@ var Ot = {
|
|
|
120
123
|
type: Boolean,
|
|
121
124
|
default: !0
|
|
122
125
|
},
|
|
123
|
-
templateName: { default: "导入模版" }
|
|
126
|
+
templateName: { default: "导入模版" },
|
|
127
|
+
uploadProps: { default: () => ({}) }
|
|
124
128
|
},
|
|
125
129
|
emits: [
|
|
126
130
|
"update:modelValue",
|
|
@@ -133,19 +137,19 @@ var Ot = {
|
|
|
133
137
|
setup(e, { emit: n }) {
|
|
134
138
|
let r = e, i = n, [a, o] = t({ onOpenChange: (e) => {
|
|
135
139
|
e !== r.modelValue && i("update:modelValue", e);
|
|
136
|
-
} }), s =
|
|
140
|
+
} }), s = V(), l = V("upload"), u = V(r.defaultMode), d = V(null), f = V(""), p = V([]), m = V(""), h = V([]), g = V([]), _ = V(0), v = V([]), y = V(!1), E = V(!1), k = V(!1), A = V(0), j = V(""), M = V(null), N = V(0), P = x(() => r.title || c("components.importDialog.title")), I = x(() => !!r.api), R = x(() => r.tips?.length ? r.tips : [
|
|
137
141
|
c("components.importDialog.tipSize", { size: r.maxSize }),
|
|
138
142
|
c("components.importDialog.tipHeader"),
|
|
139
143
|
c("components.importDialog.tipFormula"),
|
|
140
144
|
c("components.importDialog.tipArea"),
|
|
141
145
|
c("components.importDialog.tipRelation")
|
|
142
|
-
]),
|
|
146
|
+
]), z = x(() => r.accept.join(",")), ee = x(() => r.accept.map((e) => e.replace(/^\./, "").toUpperCase()).join("、")), te = x(() => M.value !== null), re = x(() => !te.value && !I.value), W = x(() => c("components.importDialog.previewSummary", {
|
|
143
147
|
total: _.value,
|
|
144
148
|
count: Math.min(g.value.length, r.maxPreviewCount)
|
|
145
|
-
})),
|
|
149
|
+
})), ie = x(() => f.value || d.value?.name || ""), ae = x(() => h.value.map((e) => ({
|
|
146
150
|
label: e.label,
|
|
147
151
|
value: e.label
|
|
148
|
-
}))), oe = x(() => j.value || c("components.importDialog.importingProgress", { progress: A.value })), se = x(() => M.value ? M.value.title ? M.value.title : M.value.success ? c("components.importDialog.successTitle") : c("components.importDialog.errorTitle") : ""),
|
|
152
|
+
}))), oe = x(() => j.value || c("components.importDialog.importingProgress", { progress: A.value })), se = x(() => M.value ? M.value.title ? M.value.title : M.value.success ? c("components.importDialog.successTitle") : c("components.importDialog.errorTitle") : ""), le = x(() => M.value ? M.value.description ? M.value.description : M.value.success ? c("components.importDialog.successDescription") : c("components.importDialog.errorDescription") : ""), Y = x(() => r.skipSteps.includes("preview")), ue = x(() => r.skipSteps.includes("mapping")), de = x(() => [
|
|
149
153
|
{
|
|
150
154
|
key: "upload",
|
|
151
155
|
label: c("components.importDialog.stepUpload")
|
|
@@ -162,46 +166,46 @@ var Ot = {
|
|
|
162
166
|
key: "import",
|
|
163
167
|
label: c("components.importDialog.stepImport")
|
|
164
168
|
}
|
|
165
|
-
].filter((e) => !(e.key === "preview" &&
|
|
166
|
-
let e = l.value === "importing" ? "import" : l.value, t =
|
|
169
|
+
].filter((e) => !(e.key === "preview" && Y.value || e.key === "mapping" && ue.value))), pe = x(() => {
|
|
170
|
+
let e = l.value === "importing" ? "import" : l.value, t = de.value.findIndex((t) => t.key === e);
|
|
167
171
|
return t === -1 ? 0 : t;
|
|
168
|
-
}),
|
|
169
|
-
|
|
170
|
-
e ? (u.value = r.defaultMode, o.open()) : (o.close(), k.value = !1, o.setState({ fullscreen: !1 }), t && r.resetOnClose &&
|
|
172
|
+
}), me = x(() => l.value === "mapping" ? !0 : l.value === "preview" ? ue.value : l.value === "upload" ? I.value || Y.value && ue.value : !1);
|
|
173
|
+
q(() => r.modelValue, (e, t) => {
|
|
174
|
+
e ? (u.value = r.defaultMode, o.open()) : (o.close(), k.value = !1, o.setState({ fullscreen: !1 }), t && r.resetOnClose && he());
|
|
171
175
|
}, { immediate: !0 });
|
|
172
|
-
function
|
|
176
|
+
function he() {
|
|
173
177
|
N.value += 1, l.value = "upload", d.value = null, f.value = "", p.value = [], m.value = "", h.value = [], g.value = [], _.value = 0, v.value = [], y.value = !1, E.value = !1, A.value = 0, j.value = "", M.value = null, s.value?.clearFiles();
|
|
174
178
|
}
|
|
175
|
-
function
|
|
179
|
+
function ge() {
|
|
176
180
|
p.value = [], m.value = "", h.value = [], g.value = [], _.value = 0, v.value = [], M.value = null;
|
|
177
181
|
}
|
|
178
|
-
function
|
|
182
|
+
function _e() {
|
|
179
183
|
te.value || i("cancel"), i("update:modelValue", !1);
|
|
180
184
|
}
|
|
181
|
-
function
|
|
185
|
+
function ve() {
|
|
182
186
|
k.value = !k.value, o.setState({ fullscreen: k.value });
|
|
183
187
|
}
|
|
184
|
-
async function
|
|
188
|
+
async function ye() {
|
|
185
189
|
if (!r.templateUrl) i("downloadTemplate");
|
|
186
190
|
else try {
|
|
187
|
-
let e = await Ot.download(
|
|
191
|
+
let e = await Ot.download(be(r.templateUrl), {
|
|
188
192
|
method: r.templateMethod,
|
|
189
193
|
responseReturn: "raw"
|
|
190
194
|
});
|
|
191
195
|
Et({
|
|
192
|
-
fileName: xe(
|
|
196
|
+
fileName: Se(xe(e.headers, "content-disposition"), r.templateName || "import-template.xlsx"),
|
|
193
197
|
source: e.data
|
|
194
198
|
});
|
|
195
199
|
} catch (e) {
|
|
196
|
-
Q.error(
|
|
200
|
+
Q.error(we(e, c("components.importDialog.templateDownloadError")));
|
|
197
201
|
}
|
|
198
202
|
}
|
|
199
|
-
function
|
|
203
|
+
function be(e) {
|
|
200
204
|
if (/^https?:\/\//i.test(e)) return e;
|
|
201
205
|
let t = Ot.getBaseUrl() || "", n = (/^https?:\/\//i.test(t) ? new URL(t).pathname : t.split(/[?#]/, 1)[0] ?? "").replace(/\/+$/, "");
|
|
202
206
|
return n && n !== "/" && (e === n || e.startsWith(`${n}/`)) ? e.slice(n.length) || "/" : e;
|
|
203
207
|
}
|
|
204
|
-
function
|
|
208
|
+
function xe(e, t) {
|
|
205
209
|
if (typeof e.get == "function") {
|
|
206
210
|
let n = e.get(t);
|
|
207
211
|
return typeof n == "string" ? n : void 0;
|
|
@@ -209,23 +213,23 @@ var Ot = {
|
|
|
209
213
|
let n = e[t];
|
|
210
214
|
return typeof n == "string" ? n : void 0;
|
|
211
215
|
}
|
|
212
|
-
function
|
|
216
|
+
function Se(e, t) {
|
|
213
217
|
let n = e?.match(/filename\*=UTF-8''([^;]+)/i)?.[1];
|
|
214
218
|
return n ? decodeURIComponent(n.replace(/^["']|["']$/g, "")) : e?.match(/filename="?([^";]+)"?/i)?.[1] || t;
|
|
215
219
|
}
|
|
216
|
-
function
|
|
220
|
+
function we(e, t) {
|
|
217
221
|
return e instanceof Error && e.message ? e.message : t;
|
|
218
222
|
}
|
|
219
|
-
function
|
|
223
|
+
function Te(e) {
|
|
220
224
|
if (e.size / 1024 / 1024 > r.maxSize) return Q.error(c("components.importDialog.fileSizeExceeded", { size: r.maxSize })), !1;
|
|
221
225
|
if (!r.accept.length) return !0;
|
|
222
226
|
let t = e.name.toLowerCase(), n = e.type.toLowerCase();
|
|
223
227
|
return r.accept.some((e) => {
|
|
224
228
|
let r = e.toLowerCase();
|
|
225
229
|
return r.startsWith(".") ? t.endsWith(r) : n === r;
|
|
226
|
-
}) ? !0 : (Q.error(c("components.importDialog.fileTypeInvalid", { types:
|
|
230
|
+
}) ? !0 : (Q.error(c("components.importDialog.fileTypeInvalid", { types: ee.value })), !1);
|
|
227
231
|
}
|
|
228
|
-
function
|
|
232
|
+
function Ee(e) {
|
|
229
233
|
let t = new Map((e ?? []).map((e) => [e.targetField, e]));
|
|
230
234
|
return r.targetFields.map((e) => {
|
|
231
235
|
let n = t.get(e.field);
|
|
@@ -239,14 +243,14 @@ var Ot = {
|
|
|
239
243
|
};
|
|
240
244
|
});
|
|
241
245
|
}
|
|
242
|
-
function
|
|
246
|
+
function De(e) {
|
|
243
247
|
let t = e && typeof e == "object" ? e : {}, n = t.data && typeof t.data == "object" ? t.data : t, r = { success: typeof n.success == "boolean" ? n.success : t.success !== !1 };
|
|
244
248
|
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
249
|
}
|
|
246
|
-
function
|
|
247
|
-
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 =
|
|
250
|
+
function ke(e) {
|
|
251
|
+
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 = Ee(e.mappings);
|
|
248
252
|
}
|
|
249
|
-
async function
|
|
253
|
+
async function Ae(e) {
|
|
250
254
|
if (!d.value) return Q.warning(c("components.importDialog.fileRequired")), !1;
|
|
251
255
|
if (!r.parseFile) return Q.error(c("components.importDialog.parseFileMissing")), !1;
|
|
252
256
|
let t = ++N.value;
|
|
@@ -257,7 +261,7 @@ var Ot = {
|
|
|
257
261
|
mode: u.value,
|
|
258
262
|
sheet: e
|
|
259
263
|
});
|
|
260
|
-
return t === N.value && (
|
|
264
|
+
return t === N.value && (ke(n), !0);
|
|
261
265
|
} catch (e) {
|
|
262
266
|
if (t !== N.value) return !1;
|
|
263
267
|
let n = e instanceof Error ? e.message : c("components.importDialog.parseError");
|
|
@@ -266,60 +270,60 @@ var Ot = {
|
|
|
266
270
|
t === N.value && (y.value = !1);
|
|
267
271
|
}
|
|
268
272
|
}
|
|
269
|
-
function
|
|
273
|
+
function je(e) {
|
|
270
274
|
let t = e.raw;
|
|
271
|
-
s.value?.clearFiles(), t &&
|
|
275
|
+
s.value?.clearFiles(), t && Te(t) && (d.value = t, f.value = t.name, l.value = "upload", ge(), i("fileChange", t));
|
|
272
276
|
}
|
|
273
|
-
async function
|
|
274
|
-
e && d.value && await
|
|
277
|
+
async function Ne(e) {
|
|
278
|
+
e && d.value && await Ae(e);
|
|
275
279
|
}
|
|
276
|
-
function
|
|
280
|
+
function Pe() {
|
|
277
281
|
let e = v.value.find((e) => e.required && !e.sourceColumn);
|
|
278
282
|
if (e) return Q.warning(c("components.importDialog.mappingRequired", { field: e.targetLabel })), !1;
|
|
279
283
|
let t = v.value.map((e) => e.sourceColumn).filter(Boolean);
|
|
280
284
|
return new Set(t).size === t.length || (Q.warning(c("components.importDialog.mappingDuplicate")), !1);
|
|
281
285
|
}
|
|
282
|
-
async function
|
|
286
|
+
async function Fe() {
|
|
283
287
|
if (l.value === "upload") {
|
|
284
|
-
if (
|
|
285
|
-
await
|
|
288
|
+
if (I.value) {
|
|
289
|
+
await Re();
|
|
286
290
|
return;
|
|
287
291
|
}
|
|
288
|
-
if (!await
|
|
289
|
-
if (!
|
|
292
|
+
if (!await Ae()) return;
|
|
293
|
+
if (!Y.value) {
|
|
290
294
|
l.value = "preview";
|
|
291
295
|
return;
|
|
292
296
|
}
|
|
293
|
-
if (!
|
|
297
|
+
if (!ue.value) {
|
|
294
298
|
l.value = "mapping";
|
|
295
299
|
return;
|
|
296
300
|
}
|
|
297
|
-
await
|
|
301
|
+
await He();
|
|
298
302
|
} else if (l.value === "preview") {
|
|
299
|
-
if (
|
|
300
|
-
await
|
|
303
|
+
if (ue.value) {
|
|
304
|
+
await He();
|
|
301
305
|
return;
|
|
302
306
|
}
|
|
303
307
|
l.value = "mapping";
|
|
304
|
-
} else l.value === "mapping" && await
|
|
308
|
+
} else l.value === "mapping" && await He();
|
|
305
309
|
}
|
|
306
|
-
async function
|
|
310
|
+
async function Re() {
|
|
307
311
|
if (!d.value) Q.warning(c("components.importDialog.fileRequired"));
|
|
308
312
|
else if (!r.api) Q.error(c("components.importDialog.apiMissing"));
|
|
309
313
|
else {
|
|
310
314
|
l.value = "importing", E.value = !0, A.value = 8, j.value = c("components.importDialog.importingStart");
|
|
311
315
|
try {
|
|
312
|
-
let e =
|
|
316
|
+
let e = De(await Ot.upload(be(r.api), {
|
|
313
317
|
file: d.value,
|
|
314
318
|
mode: u.value
|
|
315
319
|
}, { onUploadProgress: (e) => {
|
|
316
|
-
e.total &&
|
|
320
|
+
e.total && Be(8 + Math.round(e.loaded / e.total * 84));
|
|
317
321
|
} }));
|
|
318
322
|
A.value = 100, M.value = e, e.success ? i("success", e) : i("error", e);
|
|
319
323
|
} catch (e) {
|
|
320
324
|
let t = {
|
|
321
325
|
success: !1,
|
|
322
|
-
detail:
|
|
326
|
+
detail: we(e, c("components.importDialog.importError"))
|
|
323
327
|
};
|
|
324
328
|
A.value = 100, M.value = t, i("error", e instanceof Error ? e : t);
|
|
325
329
|
} finally {
|
|
@@ -327,16 +331,16 @@ var Ot = {
|
|
|
327
331
|
}
|
|
328
332
|
}
|
|
329
333
|
}
|
|
330
|
-
function
|
|
331
|
-
l.value === "mapping" ? l.value =
|
|
334
|
+
function ze() {
|
|
335
|
+
l.value === "mapping" ? l.value = Y.value ? "upload" : "preview" : l.value === "preview" && (l.value = "upload");
|
|
332
336
|
}
|
|
333
|
-
function
|
|
337
|
+
function Be(e, t) {
|
|
334
338
|
A.value = Math.max(0, Math.min(100, Math.round(e))), t && (j.value = t);
|
|
335
339
|
}
|
|
336
|
-
async function
|
|
340
|
+
async function He() {
|
|
337
341
|
if (!d.value) Q.warning(c("components.importDialog.fileRequired"));
|
|
338
|
-
else if (!
|
|
339
|
-
else if (
|
|
342
|
+
else if (!Y.value && !m.value) Q.warning(c("components.importDialog.sheetRequired"));
|
|
343
|
+
else if (ue.value || Pe()) {
|
|
340
344
|
l.value = "importing", E.value = !0, A.value = 8, j.value = c("components.importDialog.importingStart");
|
|
341
345
|
try {
|
|
342
346
|
if (!r.submitImport) throw Error(c("components.importDialog.submitImportMissing"));
|
|
@@ -345,7 +349,7 @@ var Ot = {
|
|
|
345
349
|
mode: u.value,
|
|
346
350
|
sheet: m.value,
|
|
347
351
|
mappings: v.value,
|
|
348
|
-
onProgress:
|
|
352
|
+
onProgress: Be
|
|
349
353
|
});
|
|
350
354
|
A.value = 100, M.value = e, e.success ? i("success", e) : i("error", e);
|
|
351
355
|
} catch (e) {
|
|
@@ -360,8 +364,8 @@ var Ot = {
|
|
|
360
364
|
}
|
|
361
365
|
}
|
|
362
366
|
return (t, n) => {
|
|
363
|
-
let
|
|
364
|
-
return
|
|
367
|
+
let i = ne("loading");
|
|
368
|
+
return B(), S(K(a), {
|
|
365
369
|
title: P.value,
|
|
366
370
|
class: "import-dialog__dialog",
|
|
367
371
|
closable: !1,
|
|
@@ -369,136 +373,138 @@ var Ot = {
|
|
|
369
373
|
"close-on-press-escape": !E.value,
|
|
370
374
|
"fullscreen-button": !1
|
|
371
375
|
}, {
|
|
372
|
-
title:
|
|
376
|
+
title: J(() => [T("div", kt, [T("div", At, G(P.value), 1), T("div", jt, [O(K(X), {
|
|
373
377
|
text: "",
|
|
374
378
|
circle: "",
|
|
375
379
|
class: "import-dialog__action",
|
|
376
|
-
onClick:
|
|
380
|
+
onClick: ve
|
|
377
381
|
}, {
|
|
378
|
-
default:
|
|
379
|
-
default:
|
|
382
|
+
default: J(() => [O(K(Z), { size: 16 }, {
|
|
383
|
+
default: J(() => [k.value ? (B(), S(K(st), { key: 0 })) : (B(), S(K(tt), { key: 1 }))]),
|
|
380
384
|
_: 1
|
|
381
385
|
})]),
|
|
382
386
|
_: 1
|
|
383
|
-
}), O(
|
|
387
|
+
}), O(K(X), {
|
|
384
388
|
text: "",
|
|
385
389
|
circle: "",
|
|
386
390
|
class: "import-dialog__action",
|
|
387
|
-
onClick:
|
|
391
|
+
onClick: _e
|
|
388
392
|
}, {
|
|
389
|
-
default:
|
|
390
|
-
default:
|
|
393
|
+
default: J(() => [O(K(Z), { size: 16 }, {
|
|
394
|
+
default: J(() => [O(K(Ze))]),
|
|
391
395
|
_: 1
|
|
392
396
|
})]),
|
|
393
397
|
_: 1
|
|
394
398
|
})])])]),
|
|
395
|
-
footer:
|
|
396
|
-
default:
|
|
399
|
+
footer: J(() => [T("div", fn, [l.value === "preview" || l.value === "mapping" ? (B(), w(b, { key: 0 }, [O(K(X), { onClick: ze }, {
|
|
400
|
+
default: J(() => [D(G(K(c)("components.importDialog.previous")), 1)]),
|
|
397
401
|
_: 1
|
|
398
|
-
}), O(
|
|
402
|
+
}), O(K(X), {
|
|
399
403
|
type: "primary",
|
|
400
404
|
loading: y.value || E.value,
|
|
401
|
-
onClick:
|
|
405
|
+
onClick: Fe
|
|
402
406
|
}, {
|
|
403
|
-
default:
|
|
407
|
+
default: J(() => [D(G(me.value ? K(c)("components.importDialog.startImport") : K(c)("components.importDialog.next")), 1)]),
|
|
404
408
|
_: 1
|
|
405
|
-
}, 8, ["loading"])], 64)) : l.value === "upload" ? (
|
|
409
|
+
}, 8, ["loading"])], 64)) : l.value === "upload" ? (B(), S(K(X), {
|
|
406
410
|
key: 1,
|
|
407
411
|
type: "primary",
|
|
408
412
|
loading: y.value || E.value,
|
|
409
|
-
onClick:
|
|
413
|
+
onClick: Fe
|
|
410
414
|
}, {
|
|
411
|
-
default:
|
|
415
|
+
default: J(() => [D(G(me.value ? K(c)("components.importDialog.startImport") : K(c)("components.importDialog.next")), 1)]),
|
|
412
416
|
_: 1
|
|
413
|
-
}, 8, ["loading"])) : (
|
|
417
|
+
}, 8, ["loading"])) : (B(), S(K(X), {
|
|
414
418
|
key: 2,
|
|
415
|
-
onClick:
|
|
419
|
+
onClick: _e
|
|
416
420
|
}, {
|
|
417
|
-
default:
|
|
421
|
+
default: J(() => [D(G(K(c)("common.close")), 1)]),
|
|
418
422
|
_: 1
|
|
419
423
|
}))])]),
|
|
420
|
-
default:
|
|
424
|
+
default: J(() => [T("div", Mt, [re.value ? (B(), w("div", Nt, [(B(!0), w(b, null, H(de.value, (e, t) => (B(), w("div", {
|
|
421
425
|
key: e.key,
|
|
422
426
|
class: "import-dialog__step"
|
|
423
427
|
}, [
|
|
424
|
-
T("div", { class:
|
|
425
|
-
"is-active": t ===
|
|
426
|
-
"is-done": t <
|
|
427
|
-
}]) }, [t <
|
|
428
|
-
default:
|
|
428
|
+
T("div", { class: L(["import-dialog__step-node", {
|
|
429
|
+
"is-active": t === pe.value,
|
|
430
|
+
"is-done": t < pe.value
|
|
431
|
+
}]) }, [t < pe.value ? (B(), S(K(Z), { key: 0 }, {
|
|
432
|
+
default: J(() => [O(K(Xe))]),
|
|
429
433
|
_: 1
|
|
430
|
-
})) : (
|
|
431
|
-
T("div", Ft,
|
|
432
|
-
t ===
|
|
434
|
+
})) : (B(), w("span", Pt, G(t + 1), 1))], 2),
|
|
435
|
+
T("div", Ft, G(e.label), 1),
|
|
436
|
+
t === de.value.length - 1 ? C("", !0) : (B(), w("div", {
|
|
433
437
|
key: 0,
|
|
434
|
-
class:
|
|
438
|
+
class: L(["import-dialog__step-line", { "is-active": t < pe.value }])
|
|
435
439
|
}, null, 2))
|
|
436
|
-
]))), 128))])) : C("", !0), l.value === "upload" ? (
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
O(
|
|
440
|
+
]))), 128))])) : C("", !0), l.value === "upload" ? (B(), w(b, { key: 1 }, [
|
|
441
|
+
U(t.$slots, "desc-title", {}, () => [T("div", It, G(K(c)("components.importDialog.descLabel")), 1)], !0),
|
|
442
|
+
U(t.$slots, "desc-content", {}, () => [e.importDesc ? (B(), w("div", Lt, G(e.importDesc), 1)) : C("", !0)], !0),
|
|
443
|
+
O(K(Ve), F({
|
|
440
444
|
ref_key: "uploadRef",
|
|
441
445
|
ref: s,
|
|
442
446
|
class: "import-dialog__upload",
|
|
443
447
|
drag: "",
|
|
444
448
|
"auto-upload": !1,
|
|
445
449
|
"show-file-list": !1,
|
|
446
|
-
|
|
447
|
-
"on-change": Ae
|
|
450
|
+
"on-change": je
|
|
448
451
|
}, {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
+
accept: z.value,
|
|
453
|
+
...r.uploadProps
|
|
454
|
+
}), {
|
|
455
|
+
default: J(() => [T("div", Rt, [
|
|
456
|
+
T("div", zt, [O(K(Z), { size: 20 }, {
|
|
457
|
+
default: J(() => [O(K(it))]),
|
|
452
458
|
_: 1
|
|
453
459
|
})]),
|
|
454
|
-
T("div", Bt, [D(
|
|
455
|
-
T("div", Ht,
|
|
456
|
-
|
|
460
|
+
T("div", Bt, [D(G(K(c)("components.importDialog.uploadPlaceholder")) + " ", 1), T("span", Vt, G(K(c)("components.importDialog.selectUpload")), 1)]),
|
|
461
|
+
T("div", Ht, G(K(c)("components.importDialog.supportedTypes", { types: ee.value })), 1),
|
|
462
|
+
ie.value ? (B(), w("div", Ut, G(ie.value), 1)) : C("", !0)
|
|
457
463
|
])]),
|
|
458
464
|
_: 1
|
|
459
|
-
},
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
O(
|
|
463
|
-
default:
|
|
465
|
+
}, 16),
|
|
466
|
+
U(t.$slots, "after-upload", {}, void 0, !0),
|
|
467
|
+
e.templateUrl ? (B(), w("div", Wt, [
|
|
468
|
+
O(K(Z), { size: 14 }, {
|
|
469
|
+
default: J(() => [O(K(et))]),
|
|
464
470
|
_: 1
|
|
465
471
|
}),
|
|
466
|
-
T("span", null,
|
|
472
|
+
T("span", null, G(K(c)("components.importDialog.templateText")), 1),
|
|
467
473
|
T("button", {
|
|
468
474
|
type: "button",
|
|
469
475
|
class: "import-dialog__download-button",
|
|
470
|
-
onClick:
|
|
471
|
-
},
|
|
472
|
-
]),
|
|
473
|
-
T("div", Gt, [(
|
|
476
|
+
onClick: ye
|
|
477
|
+
}, G(K(c)("components.importDialog.downloadTemplate")), 1)
|
|
478
|
+
])) : C("", !0),
|
|
479
|
+
T("div", Gt, [(B(!0), w(b, null, H(R.value, (e) => (B(), w("div", {
|
|
474
480
|
key: e,
|
|
475
481
|
class: "import-dialog__tip-item"
|
|
476
|
-
},
|
|
477
|
-
], 64)) : l.value === "preview" ? (
|
|
478
|
-
T("div", Kt, [T("div", qt, [T("div", Jt,
|
|
479
|
-
"model-value":
|
|
482
|
+
}, G(e), 1))), 128))])
|
|
483
|
+
], 64)) : l.value === "preview" ? (B(), w(b, { key: 2 }, [
|
|
484
|
+
T("div", Kt, [T("div", qt, [T("div", Jt, G(K(c)("components.importDialog.fileLabel")), 1), O(K(Ce), {
|
|
485
|
+
"model-value": ie.value,
|
|
480
486
|
readonly: ""
|
|
481
|
-
}, null, 8, ["model-value"])]), T("div", Yt, [T("div", Xt,
|
|
487
|
+
}, null, 8, ["model-value"])]), T("div", Yt, [T("div", Xt, G(K(c)("components.importDialog.sheetLabel")), 1), O(K(Me), {
|
|
482
488
|
modelValue: m.value,
|
|
483
489
|
"onUpdate:modelValue": n[0] ||= (e) => m.value = e,
|
|
484
490
|
class: "import-dialog__sheet-select",
|
|
485
491
|
disabled: y.value,
|
|
486
|
-
onChange:
|
|
492
|
+
onChange: Ne
|
|
487
493
|
}, {
|
|
488
|
-
default:
|
|
494
|
+
default: J(() => [(B(!0), w(b, null, H(p.value, (e) => (B(), S(K($), {
|
|
489
495
|
key: e.value,
|
|
490
496
|
label: e.label,
|
|
491
497
|
value: e.value
|
|
492
498
|
}, null, 8, ["label", "value"]))), 128))]),
|
|
493
499
|
_: 1
|
|
494
500
|
}, 8, ["modelValue", "disabled"])])]),
|
|
495
|
-
|
|
501
|
+
ce((B(), S(K(Ie), {
|
|
496
502
|
data: g.value,
|
|
497
503
|
border: "",
|
|
498
504
|
height: "352",
|
|
499
505
|
class: "import-dialog__table"
|
|
500
506
|
}, {
|
|
501
|
-
default:
|
|
507
|
+
default: J(() => [(B(!0), w(b, null, H(h.value, (e) => (B(), S(K(Le), {
|
|
502
508
|
key: e.prop,
|
|
503
509
|
prop: e.prop,
|
|
504
510
|
label: e.label,
|
|
@@ -512,24 +518,24 @@ var Ot = {
|
|
|
512
518
|
"min-width"
|
|
513
519
|
]))), 128))]),
|
|
514
520
|
_: 1
|
|
515
|
-
}, 8, ["data"])), [[
|
|
516
|
-
T("div", Zt, W
|
|
517
|
-
], 64)) : l.value === "mapping" ? (
|
|
518
|
-
T("div", null,
|
|
521
|
+
}, 8, ["data"])), [[i, y.value]]),
|
|
522
|
+
T("div", Zt, G(W.value), 1)
|
|
523
|
+
], 64)) : l.value === "mapping" ? (B(), w(b, { key: 3 }, [T("div", Qt, [
|
|
524
|
+
T("div", null, G(K(c)("components.importDialog.mappingExcelColumn")), 1),
|
|
519
525
|
n[1] ||= T("div", null, null, -1),
|
|
520
|
-
T("div", null,
|
|
521
|
-
T("div", null,
|
|
522
|
-
]), T("div", $t, [(
|
|
526
|
+
T("div", null, G(K(c)("components.importDialog.mappingTargetField")), 1),
|
|
527
|
+
T("div", null, G(K(c)("components.importDialog.mappingDuplicateLabel")), 1)
|
|
528
|
+
]), T("div", $t, [(B(!0), w(b, null, H(v.value, (e) => (B(), w("div", {
|
|
523
529
|
key: e.targetField,
|
|
524
530
|
class: "import-dialog__mapping-row"
|
|
525
531
|
}, [
|
|
526
|
-
O(
|
|
532
|
+
O(K(Me), {
|
|
527
533
|
modelValue: e.sourceColumn,
|
|
528
534
|
"onUpdate:modelValue": (t) => e.sourceColumn = t,
|
|
529
535
|
clearable: "",
|
|
530
|
-
placeholder:
|
|
536
|
+
placeholder: K(c)("common.pleaseSelect")
|
|
531
537
|
}, {
|
|
532
|
-
default:
|
|
538
|
+
default: J(() => [(B(!0), w(b, null, H(ae.value, (e) => (B(), S(K($), {
|
|
533
539
|
key: e.value,
|
|
534
540
|
label: e.label,
|
|
535
541
|
value: e.value
|
|
@@ -540,12 +546,12 @@ var Ot = {
|
|
|
540
546
|
"onUpdate:modelValue",
|
|
541
547
|
"placeholder"
|
|
542
548
|
]),
|
|
543
|
-
T("div", en, [O(
|
|
544
|
-
default:
|
|
549
|
+
T("div", en, [O(K(Z), { size: 18 }, {
|
|
550
|
+
default: J(() => [O(K(qe))]),
|
|
545
551
|
_: 1
|
|
546
552
|
})]),
|
|
547
|
-
T("div", { class:
|
|
548
|
-
T("div", tn, [O(
|
|
553
|
+
T("div", { class: L(["import-dialog__mapping-target", { "is-required": e.required }]) }, G(e.targetLabel), 3),
|
|
554
|
+
T("div", tn, [O(K(fe), {
|
|
549
555
|
modelValue: e.duplicateCheck,
|
|
550
556
|
"onUpdate:modelValue": (t) => e.duplicateCheck = t,
|
|
551
557
|
disabled: !e.allowDuplicateCheck
|
|
@@ -554,39 +560,39 @@ var Ot = {
|
|
|
554
560
|
"onUpdate:modelValue",
|
|
555
561
|
"disabled"
|
|
556
562
|
])])
|
|
557
|
-
]))), 128))])], 64)) : te.value ? (
|
|
558
|
-
T("div", { class:
|
|
563
|
+
]))), 128))])], 64)) : te.value ? (B(), w(b, { key: 4 }, [
|
|
564
|
+
T("div", { class: L(["import-dialog__result-illustration", {
|
|
559
565
|
"is-success": M.value?.success,
|
|
560
566
|
"is-error": !M.value?.success
|
|
561
|
-
}]) }, [n[2] ||= T("div", { class: "import-dialog__result-card" }, [T("div", { class: "import-dialog__result-layer" }), T("div", { class: "import-dialog__result-layer is-front" })], -1), T("div", nn, [M.value?.success ? (
|
|
562
|
-
default:
|
|
567
|
+
}]) }, [n[2] ||= T("div", { class: "import-dialog__result-card" }, [T("div", { class: "import-dialog__result-layer" }), T("div", { class: "import-dialog__result-layer is-front" })], -1), T("div", nn, [M.value?.success ? (B(), S(K(Z), { key: 0 }, {
|
|
568
|
+
default: J(() => [O(K(lt))]),
|
|
563
569
|
_: 1
|
|
564
|
-
})) : (
|
|
565
|
-
default:
|
|
570
|
+
})) : (B(), S(K(Z), { key: 1 }, {
|
|
571
|
+
default: J(() => [O(K(ut))]),
|
|
566
572
|
_: 1
|
|
567
573
|
}))])], 2),
|
|
568
|
-
T("div", rn,
|
|
569
|
-
T("div", an,
|
|
570
|
-
M.value?.detail ? (
|
|
571
|
-
], 64)) : l.value === "importing" ? (
|
|
572
|
-
T("div", sn, [O(
|
|
574
|
+
T("div", rn, G(se.value), 1),
|
|
575
|
+
T("div", an, G(le.value), 1),
|
|
576
|
+
M.value?.detail ? (B(), w("div", on, G(M.value.detail), 1)) : C("", !0)
|
|
577
|
+
], 64)) : l.value === "importing" ? (B(), w(b, { key: 5 }, [
|
|
578
|
+
T("div", sn, [O(K(Oe), {
|
|
573
579
|
percentage: A.value,
|
|
574
580
|
"stroke-width": 10,
|
|
575
581
|
"show-text": !1,
|
|
576
582
|
color: "var(--color-success)"
|
|
577
|
-
}, null, 8, ["percentage"]), T("div", cn, [O(
|
|
578
|
-
default:
|
|
583
|
+
}, null, 8, ["percentage"]), T("div", cn, [O(K(Z), { color: "var(--color-success)" }, {
|
|
584
|
+
default: J(() => [O(K(lt))]),
|
|
579
585
|
_: 1
|
|
580
586
|
})])]),
|
|
581
|
-
T("div", ln,
|
|
582
|
-
T("div", un,
|
|
583
|
-
T("div", dn,
|
|
587
|
+
T("div", ln, G(K(c)("components.importDialog.importingTitle")), 1),
|
|
588
|
+
T("div", un, G(oe.value), 1),
|
|
589
|
+
T("div", dn, G(K(c)("components.importDialog.importingHint")), 1)
|
|
584
590
|
], 64)) : C("", !0)])]),
|
|
585
591
|
_: 3
|
|
586
592
|
}, 8, ["title", "close-on-press-escape"]);
|
|
587
593
|
};
|
|
588
594
|
}
|
|
589
|
-
}), [["__scopeId", "data-v-
|
|
595
|
+
}), [["__scopeId", "data-v-d684e4fd"]]), mn = { class: "column-settings-panel" }, hn = { class: "column-settings-panel__header" }, gn = { class: "column-settings-panel__title" }, _n = { class: "column-settings-panel__list" }, vn = { class: "column-settings-panel__head" }, yn = { class: "column-settings-panel__drag-handle" }, bn = { class: "column-settings-panel__label" }, xn = { class: "column-settings-panel__footer" }, Sn = { class: "column-settings-panel__count" }, Cn = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
590
596
|
__name: "ColumnSettingsPanel",
|
|
591
597
|
props: {
|
|
592
598
|
settings: {},
|
|
@@ -602,8 +608,8 @@ var Ot = {
|
|
|
602
608
|
"reset"
|
|
603
609
|
],
|
|
604
610
|
setup(e, { emit: t }) {
|
|
605
|
-
let n = e, r = t, i =
|
|
606
|
-
|
|
611
|
+
let n = e, r = t, i = V([...n.settings]);
|
|
612
|
+
q(() => n.settings, (e) => {
|
|
607
613
|
i.value = e.map((e) => ({ ...e }));
|
|
608
614
|
}, { deep: !0 });
|
|
609
615
|
let a = x(() => i.value.filter((e) => e.visible).length);
|
|
@@ -619,25 +625,25 @@ var Ot = {
|
|
|
619
625
|
function u(e) {
|
|
620
626
|
return n.fixedItems.find((t) => t.key === e)?.fixed ?? !1;
|
|
621
627
|
}
|
|
622
|
-
return (e, t) => (
|
|
623
|
-
T("div", hn, [T("span", gn,
|
|
628
|
+
return (e, t) => (B(), w("div", mn, [
|
|
629
|
+
T("div", hn, [T("span", gn, G(K(c)("components.tableEntity.columnSettings")), 1), O(K(X), {
|
|
624
630
|
type: "primary",
|
|
625
631
|
link: "",
|
|
626
632
|
size: "small",
|
|
627
633
|
onClick: l
|
|
628
634
|
}, {
|
|
629
|
-
default:
|
|
635
|
+
default: J(() => [D(G(K(c)("components.tableEntity.restoreDefault")), 1)]),
|
|
630
636
|
_: 1
|
|
631
637
|
})]),
|
|
632
638
|
T("div", _n, [T("div", vn, [
|
|
633
639
|
t[1] ||= T("span", null, null, -1),
|
|
634
|
-
T("span", null,
|
|
635
|
-
T("span", null,
|
|
636
|
-
T("span", null,
|
|
637
|
-
T("span", null,
|
|
638
|
-
T("span", null,
|
|
639
|
-
T("span", null,
|
|
640
|
-
]), O(
|
|
640
|
+
T("span", null, G(K(c)("components.tableEntity.display")), 1),
|
|
641
|
+
T("span", null, G(K(c)("components.tableEntity.columnName")), 1),
|
|
642
|
+
T("span", null, G(K(c)("components.tableEntity.width")), 1),
|
|
643
|
+
T("span", null, G(K(c)("components.tableEntity.headerAlign")), 1),
|
|
644
|
+
T("span", null, G(K(c)("components.tableEntity.contentAlign")), 1),
|
|
645
|
+
T("span", null, G(K(c)("components.tableEntity.fixedColumn")), 1)
|
|
646
|
+
]), O(K(mt), {
|
|
641
647
|
modelValue: i.value,
|
|
642
648
|
"onUpdate:modelValue": t[0] ||= (e) => i.value = e,
|
|
643
649
|
animation: 200,
|
|
@@ -645,22 +651,22 @@ var Ot = {
|
|
|
645
651
|
"ghost-class": "column-settings-panel__ghost",
|
|
646
652
|
onUpdate: o
|
|
647
653
|
}, {
|
|
648
|
-
default:
|
|
654
|
+
default: J(() => [(B(!0), w(b, null, H(i.value, (e) => (B(), w("div", {
|
|
649
655
|
key: e.key,
|
|
650
|
-
class:
|
|
656
|
+
class: L(["column-settings-panel__item", { "column-settings-panel__item--hidden": !e.visible }])
|
|
651
657
|
}, [
|
|
652
|
-
T("span", yn, [O(
|
|
653
|
-
default:
|
|
658
|
+
T("span", yn, [O(K(Z), null, {
|
|
659
|
+
default: J(() => [O(K(rt))]),
|
|
654
660
|
_: 1
|
|
655
661
|
})]),
|
|
656
|
-
O(
|
|
662
|
+
O(K(Pe), {
|
|
657
663
|
"model-value": e.visible,
|
|
658
664
|
size: "small",
|
|
659
665
|
class: "column-settings-panel__checkbox",
|
|
660
666
|
onChange: (t) => s(e.key)
|
|
661
667
|
}, null, 8, ["model-value", "onChange"]),
|
|
662
|
-
T("span", bn,
|
|
663
|
-
O(
|
|
668
|
+
T("span", bn, G(e.title), 1),
|
|
669
|
+
O(K(we), {
|
|
664
670
|
"model-value": e.column.width ?? 120,
|
|
665
671
|
min: 50,
|
|
666
672
|
controls: !1,
|
|
@@ -668,67 +674,67 @@ var Ot = {
|
|
|
668
674
|
class: "column-settings-panel__width",
|
|
669
675
|
onChange: (t) => r("setWidth", e.key, Number(t) || 120)
|
|
670
676
|
}, null, 8, ["model-value", "onChange"]),
|
|
671
|
-
O(
|
|
677
|
+
O(K(Me), {
|
|
672
678
|
"model-value": e.headerAlign,
|
|
673
679
|
size: "small",
|
|
674
680
|
class: "column-settings-panel__select",
|
|
675
681
|
onChange: (t) => r("setHeaderAlign", e.key, t)
|
|
676
682
|
}, {
|
|
677
|
-
default:
|
|
678
|
-
O(
|
|
679
|
-
label:
|
|
683
|
+
default: J(() => [
|
|
684
|
+
O(K($), {
|
|
685
|
+
label: K(c)("components.tableEntity.left"),
|
|
680
686
|
value: "left"
|
|
681
687
|
}, null, 8, ["label"]),
|
|
682
|
-
O(
|
|
683
|
-
label:
|
|
688
|
+
O(K($), {
|
|
689
|
+
label: K(c)("components.tableEntity.center"),
|
|
684
690
|
value: "center"
|
|
685
691
|
}, null, 8, ["label"]),
|
|
686
|
-
O(
|
|
687
|
-
label:
|
|
692
|
+
O(K($), {
|
|
693
|
+
label: K(c)("components.tableEntity.right"),
|
|
688
694
|
value: "right"
|
|
689
695
|
}, null, 8, ["label"])
|
|
690
696
|
]),
|
|
691
697
|
_: 1
|
|
692
698
|
}, 8, ["model-value", "onChange"]),
|
|
693
|
-
O(
|
|
699
|
+
O(K(Me), {
|
|
694
700
|
"model-value": e.contentAlign,
|
|
695
701
|
size: "small",
|
|
696
702
|
class: "column-settings-panel__select",
|
|
697
703
|
onChange: (t) => r("setContentAlign", e.key, t)
|
|
698
704
|
}, {
|
|
699
|
-
default:
|
|
700
|
-
O(
|
|
701
|
-
label:
|
|
705
|
+
default: J(() => [
|
|
706
|
+
O(K($), {
|
|
707
|
+
label: K(c)("components.tableEntity.left"),
|
|
702
708
|
value: "left"
|
|
703
709
|
}, null, 8, ["label"]),
|
|
704
|
-
O(
|
|
705
|
-
label:
|
|
710
|
+
O(K($), {
|
|
711
|
+
label: K(c)("components.tableEntity.center"),
|
|
706
712
|
value: "center"
|
|
707
713
|
}, null, 8, ["label"]),
|
|
708
|
-
O(
|
|
709
|
-
label:
|
|
714
|
+
O(K($), {
|
|
715
|
+
label: K(c)("components.tableEntity.right"),
|
|
710
716
|
value: "right"
|
|
711
717
|
}, null, 8, ["label"])
|
|
712
718
|
]),
|
|
713
719
|
_: 1
|
|
714
720
|
}, 8, ["model-value", "onChange"]),
|
|
715
|
-
O(
|
|
721
|
+
O(K(Me), {
|
|
716
722
|
"model-value": u(e.key),
|
|
717
723
|
size: "small",
|
|
718
724
|
class: "column-settings-panel__select",
|
|
719
725
|
onChange: (t) => r("setFixed", e.key, t ?? !1)
|
|
720
726
|
}, {
|
|
721
|
-
default:
|
|
722
|
-
O(
|
|
723
|
-
label:
|
|
727
|
+
default: J(() => [
|
|
728
|
+
O(K($), {
|
|
729
|
+
label: K(c)("components.tableEntity.unfixed"),
|
|
724
730
|
value: !1
|
|
725
731
|
}, null, 8, ["label"]),
|
|
726
|
-
O(
|
|
727
|
-
label:
|
|
732
|
+
O(K($), {
|
|
733
|
+
label: K(c)("components.tableEntity.leftFixed"),
|
|
728
734
|
value: "left"
|
|
729
735
|
}, null, 8, ["label"]),
|
|
730
|
-
O(
|
|
731
|
-
label:
|
|
736
|
+
O(K($), {
|
|
737
|
+
label: K(c)("components.tableEntity.rightFixed"),
|
|
732
738
|
value: "right"
|
|
733
739
|
}, null, 8, ["label"])
|
|
734
740
|
]),
|
|
@@ -737,7 +743,7 @@ var Ot = {
|
|
|
737
743
|
], 2))), 128))]),
|
|
738
744
|
_: 1
|
|
739
745
|
}, 8, ["modelValue"])]),
|
|
740
|
-
T("div", xn, [T("span", Sn,
|
|
746
|
+
T("div", xn, [T("span", Sn, G(K(c)("components.tableEntity.visibleCount", {
|
|
741
747
|
visible: a.value,
|
|
742
748
|
total: i.value.length
|
|
743
749
|
})), 1)])
|
|
@@ -746,7 +752,7 @@ var Ot = {
|
|
|
746
752
|
}), [["__scopeId", "data-v-268ac90c"]]);
|
|
747
753
|
// src/components/table-entity/composables/use-column-fixed.ts
|
|
748
754
|
function wn(e) {
|
|
749
|
-
let t =
|
|
755
|
+
let t = V({});
|
|
750
756
|
function n(e) {
|
|
751
757
|
return e.fixed === !0 || e.fixed === "left" ? "left" : e.fixed === "right" && "right";
|
|
752
758
|
}
|
|
@@ -758,7 +764,7 @@ function wn(e) {
|
|
|
758
764
|
}
|
|
759
765
|
return t;
|
|
760
766
|
}
|
|
761
|
-
|
|
767
|
+
q(() => e.value, (e) => {
|
|
762
768
|
let n = r(e), i = {};
|
|
763
769
|
for (let e of Object.keys(n)) i[e] = e in t.value ? t.value[e] ?? !1 : n[e] ?? !1;
|
|
764
770
|
t.value = i;
|
|
@@ -817,7 +823,7 @@ function Tn(e) {
|
|
|
817
823
|
}
|
|
818
824
|
// src/components/table-entity/composables/use-column-resize.ts
|
|
819
825
|
function En(e = 50) {
|
|
820
|
-
let t =
|
|
826
|
+
let t = te({}), n = te({
|
|
821
827
|
active: !1,
|
|
822
828
|
colKey: null,
|
|
823
829
|
startX: 0,
|
|
@@ -858,7 +864,7 @@ function En(e = 50) {
|
|
|
858
864
|
display: n.active ? "block" : "none",
|
|
859
865
|
left: `${n.currentX}px`
|
|
860
866
|
}));
|
|
861
|
-
return
|
|
867
|
+
return ee(() => {
|
|
862
868
|
n.active && (n.active = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.body.style.cursor = "", document.body.style.userSelect = "");
|
|
863
869
|
}), {
|
|
864
870
|
widthOverrides: t,
|
|
@@ -870,11 +876,11 @@ function En(e = 50) {
|
|
|
870
876
|
}
|
|
871
877
|
// src/components/table-entity/composables/use-column-settings.ts
|
|
872
878
|
function Dn(e) {
|
|
873
|
-
let t =
|
|
879
|
+
let t = V([]), n = V(/* @__PURE__ */ new Set()), r = V({}), i = V({}), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = {};
|
|
874
880
|
function c(e) {
|
|
875
881
|
return e.filter((e) => !!e).filter((e) => !!kn(e)).map((e) => kn(e));
|
|
876
882
|
}
|
|
877
|
-
|
|
883
|
+
q(() => e.value, (e) => {
|
|
878
884
|
let l = t.value, u = c(e), d = new Set(l), f = new Set(u), p = u.filter((e) => !d.has(e)), m = l.filter((e) => !f.has(e));
|
|
879
885
|
if (p.length > 0 || m.length > 0) {
|
|
880
886
|
let e = l.filter((e) => f.has(e));
|
|
@@ -1005,7 +1011,7 @@ function Nn(e, t, n) {
|
|
|
1005
1011
|
return i === void 0 ? e : (r.splice(n, 0, i), r);
|
|
1006
1012
|
}
|
|
1007
1013
|
function Pn(e) {
|
|
1008
|
-
let t =
|
|
1014
|
+
let t = V(null), n = V(null), r = 0, i = 0, a = !1, o = "", s = "";
|
|
1009
1015
|
function c(t, n, r) {
|
|
1010
1016
|
let i = e.getRows();
|
|
1011
1017
|
if (t < 0 || t >= i.length) return null;
|
|
@@ -1092,7 +1098,7 @@ function Pn(e) {
|
|
|
1092
1098
|
let p = c[r], m = c[i];
|
|
1093
1099
|
if (!p || !m) return;
|
|
1094
1100
|
let h = e.moveRows(p, m, r, i);
|
|
1095
|
-
h && (e.onSort(h), await
|
|
1101
|
+
h && (e.onSort(h), await I(), d(s, l));
|
|
1096
1102
|
}
|
|
1097
1103
|
function h(c) {
|
|
1098
1104
|
if (!e.isEnabled() || c.button !== 0) return;
|
|
@@ -1105,7 +1111,7 @@ function Pn(e) {
|
|
|
1105
1111
|
let h = An(f, e.getRowHeight()), g = h == null ? void 0 : e.getRows()[h];
|
|
1106
1112
|
h != null && g && !e.isRowDisabled(g) && (c.preventDefault(), r = c.clientX, i = c.clientY, a = !1, t.value = h, n.value = h, o = document.body.style.cursor, s = document.body.style.userSelect, document.body.style.cursor = "grabbing", document.body.style.userSelect = "none", document.addEventListener("pointermove", p), document.addEventListener("pointerup", m));
|
|
1107
1113
|
}
|
|
1108
|
-
return
|
|
1114
|
+
return ee(f), {
|
|
1109
1115
|
draggingIndex: t,
|
|
1110
1116
|
onPointerDown: h,
|
|
1111
1117
|
overIndex: n
|
|
@@ -1114,10 +1120,10 @@ function Pn(e) {
|
|
|
1114
1120
|
// src/components/table-entity/composables/use-table-selection.ts
|
|
1115
1121
|
var Fn = 40;
|
|
1116
1122
|
function In(e, t, n, r = n) {
|
|
1117
|
-
let i =
|
|
1118
|
-
|
|
1123
|
+
let i = V(/* @__PURE__ */ new Set()), a = V(/* @__PURE__ */ new Map()), o = V(-1), s = () => e.rowKey ?? "id";
|
|
1124
|
+
q(() => e.selectedKeys, (e) => {
|
|
1119
1125
|
i.value = new Set(e ?? []);
|
|
1120
|
-
}, { immediate: !0 }),
|
|
1126
|
+
}, { immediate: !0 }), q(() => r.value, (e) => {
|
|
1121
1127
|
let t = s();
|
|
1122
1128
|
e.forEach((e) => {
|
|
1123
1129
|
let n = e[t];
|
|
@@ -1221,7 +1227,7 @@ function zn(e = !0) {
|
|
|
1221
1227
|
return gt({
|
|
1222
1228
|
queryKey: Ln,
|
|
1223
1229
|
queryFn: Rn,
|
|
1224
|
-
enabled: x(() =>
|
|
1230
|
+
enabled: x(() => ae(e)),
|
|
1225
1231
|
staleTime: 18e5,
|
|
1226
1232
|
gcTime: 36e5,
|
|
1227
1233
|
refetchOnMount: !1,
|
|
@@ -1244,8 +1250,8 @@ function Hn(e, t) {
|
|
|
1244
1250
|
return e.find((e) => String(e.code ?? e.dictValue ?? "") === n) ?? null;
|
|
1245
1251
|
}
|
|
1246
1252
|
function Un(e) {
|
|
1247
|
-
let t = zn(() => !!
|
|
1248
|
-
let n =
|
|
1253
|
+
let t = zn(() => !!ae(e)), n = x(() => {
|
|
1254
|
+
let n = ae(e);
|
|
1249
1255
|
return n ? t.data.value?.[n] ?? [] : [];
|
|
1250
1256
|
}), r = x(() => Vn(n.value));
|
|
1251
1257
|
return {
|
|
@@ -1282,10 +1288,10 @@ var Wn = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
1282
1288
|
let e = t.color ?? i.value?.color ?? i.value?.cssClass;
|
|
1283
1289
|
return typeof e == "string" && e ? e : void 0;
|
|
1284
1290
|
}), s = x(() => o.value ? n[o.value] ?? "dict-tag--colored" : ""), c = x(() => o.value && !n[o.value] ? { "--dict-tag-color": o.value } : {});
|
|
1285
|
-
return (e, t) => (
|
|
1286
|
-
class:
|
|
1287
|
-
style:
|
|
1288
|
-
},
|
|
1291
|
+
return (e, t) => (B(), w("span", {
|
|
1292
|
+
class: L(["dict-tag", s.value]),
|
|
1293
|
+
style: z(c.value)
|
|
1294
|
+
}, G(a.value), 7));
|
|
1289
1295
|
}
|
|
1290
1296
|
}), [["__scopeId", "data-v-0d76da83"]]), Gn = {
|
|
1291
1297
|
key: 0,
|
|
@@ -1311,24 +1317,24 @@ var Wn = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
1311
1317
|
function l(e) {
|
|
1312
1318
|
e.stopPropagation(), r("toggle");
|
|
1313
1319
|
}
|
|
1314
|
-
return (t, n) => e.items.length > 0 ? (
|
|
1320
|
+
return (t, n) => e.items.length > 0 ? (B(), w("div", Gn, [(B(!0), w(b, null, H(o.value, (t, n) => (B(), w("div", {
|
|
1315
1321
|
key: `${n}-${t}`,
|
|
1316
1322
|
class: "list-expand-cell__item"
|
|
1317
|
-
}, [T("span", null,
|
|
1323
|
+
}, [T("span", null, G(n + 1) + ".", 1), e.html ? (B(), w("span", {
|
|
1318
1324
|
key: 0,
|
|
1319
1325
|
innerHTML: t
|
|
1320
|
-
}, null, 8, Kn)) : (
|
|
1326
|
+
}, null, 8, Kn)) : (B(), w("span", qn, G(t), 1))]))), 128)), a.value ? (B(), w("button", {
|
|
1321
1327
|
key: 0,
|
|
1322
1328
|
class: "list-expand-cell__toggle",
|
|
1323
1329
|
type: "button",
|
|
1324
1330
|
onClick: l
|
|
1325
|
-
}, [T("span", null,
|
|
1331
|
+
}, [T("span", null, G(e.expanded ? K(c)("components.tableEntity.collapseItems") : K(c)("components.tableEntity.viewAllItems", {
|
|
1326
1332
|
count: e.items.length,
|
|
1327
1333
|
unit: s.value
|
|
1328
|
-
})), 1), O(
|
|
1329
|
-
default:
|
|
1334
|
+
})), 1), O(K(Z), { class: "list-expand-cell__icon" }, {
|
|
1335
|
+
default: J(() => [e.expanded ? (B(), S(K(Je), { key: 0 })) : (B(), S(K(Ke), { key: 1 }))]),
|
|
1330
1336
|
_: 1
|
|
1331
|
-
})])) : C("", !0)])) : (
|
|
1337
|
+
})])) : C("", !0)])) : (B(), w("span", Jn, "-"));
|
|
1332
1338
|
}
|
|
1333
1339
|
}), [["__scopeId", "data-v-b95b0844"]]), Xn = { class: "price-cell" }, Zn = /* @__PURE__ */ A({
|
|
1334
1340
|
__name: "price-cell",
|
|
@@ -1345,14 +1351,14 @@ var Wn = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
1345
1351
|
let n = String(e ?? "").replace(/[^0-9.-]/g, ""), r = parseFloat(n), i = isNaN(r) ? "0.00" : r.toFixed(t.toFixed);
|
|
1346
1352
|
return `${t.unit}${i}`;
|
|
1347
1353
|
};
|
|
1348
|
-
return (r, i) => (
|
|
1354
|
+
return (r, i) => (B(), w("div", Xn, [T("span", {
|
|
1349
1355
|
class: "text-[red]",
|
|
1350
|
-
style:
|
|
1351
|
-
},
|
|
1356
|
+
style: z(t.style)
|
|
1357
|
+
}, G(n(e.price)), 5), e.oldPrice ? (B(), w("span", {
|
|
1352
1358
|
key: 0,
|
|
1353
1359
|
class: "ml-1 line-through",
|
|
1354
|
-
style:
|
|
1355
|
-
},
|
|
1360
|
+
style: z(t.oldPriceStyle)
|
|
1361
|
+
}, G(n(e.oldPrice)), 5)) : C("", !0)]));
|
|
1356
1362
|
}
|
|
1357
1363
|
});
|
|
1358
1364
|
// src/components/table-entity/utils/column-utils.ts
|
|
@@ -1664,7 +1670,7 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
1664
1670
|
"rowSort"
|
|
1665
1671
|
],
|
|
1666
1672
|
setup(e, { expose: t, emit: n }) {
|
|
1667
|
-
let r = e, i = n, o =
|
|
1673
|
+
let r = e, i = n, o = V(!1), s = V(!1), l = {
|
|
1668
1674
|
view: {
|
|
1669
1675
|
label: "components.tableEntity.view",
|
|
1670
1676
|
type: "primary"
|
|
@@ -1681,7 +1687,7 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
1681
1687
|
label: "components.tableEntity.delete",
|
|
1682
1688
|
type: "danger"
|
|
1683
1689
|
}
|
|
1684
|
-
}, u =
|
|
1690
|
+
}, u = V(0), d = a(), f = x(() => {
|
|
1685
1691
|
let e = (d.value.pageSizes ?? []).map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0);
|
|
1686
1692
|
return e.length > 0 ? e : [
|
|
1687
1693
|
10,
|
|
@@ -1689,7 +1695,7 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
1689
1695
|
50,
|
|
1690
1696
|
100
|
|
1691
1697
|
];
|
|
1692
|
-
}), p =
|
|
1698
|
+
}), p = se(), { hasAccessByCodes: m } = yt(), h = V([]), g = V(/* @__PURE__ */ new Set()), _ = V(!1), v = V([...r.defaultExpandedRowKeys ?? []]), y = V(), { width: b } = pt(y), E = te({
|
|
1693
1699
|
current_page: r.current_page,
|
|
1694
1700
|
per_page: r.per_page
|
|
1695
1701
|
}), k = x(() => Math.max(1, Math.floor(r.width ?? b.value))), A = x(() => r.total == null ? u.value : Number(r.total)), j = x(() => r.showColumnSettings || typeof r.data == "function");
|
|
@@ -1699,61 +1705,61 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
1699
1705
|
let P = x(() => r.columns.filter(Boolean).map((e) => ({
|
|
1700
1706
|
...e,
|
|
1701
1707
|
dataKey: e.dataKey ?? e.dataIndex
|
|
1702
|
-
}))),
|
|
1703
|
-
function
|
|
1708
|
+
}))), I = x(() => P.value.filter((e) => e.type === "listExpand")), R = x(() => !r.tree && I.value.length > 0);
|
|
1709
|
+
function ee(e) {
|
|
1704
1710
|
let t = new Set(g.value);
|
|
1705
1711
|
t.has(e) ? t.delete(e) : t.add(e), g.value = t;
|
|
1706
1712
|
}
|
|
1707
|
-
let
|
|
1713
|
+
let H = x(() => vr(P.value, p, {
|
|
1708
1714
|
expandedKeys: g.value,
|
|
1709
|
-
onToggle:
|
|
1715
|
+
onToggle: ee,
|
|
1710
1716
|
rowKey: r.rowKey ?? "id"
|
|
1711
|
-
})),
|
|
1712
|
-
field:
|
|
1713
|
-
order:
|
|
1717
|
+
})), re = r.columns.find((e) => e.sortOrder), W = V({
|
|
1718
|
+
field: re && String(re.dataKey ?? re.dataIndex ?? re.key ?? "") || void 0,
|
|
1719
|
+
order: re?.sortOrder
|
|
1714
1720
|
});
|
|
1715
|
-
function
|
|
1721
|
+
function ie(e) {
|
|
1716
1722
|
let t = e.dataKey ?? e.dataIndex ?? e.key;
|
|
1717
1723
|
return t == null ? void 0 : String(t);
|
|
1718
1724
|
}
|
|
1719
|
-
function
|
|
1725
|
+
function ae(e) {
|
|
1720
1726
|
if (!e.sortable && !e.sortOrder) return;
|
|
1721
|
-
let t =
|
|
1727
|
+
let t = ie(e);
|
|
1722
1728
|
if (!t) return;
|
|
1723
|
-
let n =
|
|
1724
|
-
|
|
1729
|
+
let n = W.value.field === t && W.value.order === "asc" ? "desc" : "asc";
|
|
1730
|
+
W.value = {
|
|
1725
1731
|
field: t,
|
|
1726
1732
|
order: n
|
|
1727
|
-
}, E.current_page === 1 ? (
|
|
1733
|
+
}, E.current_page === 1 ? (oe(), typeof r.data == "function" && rt()) : (E.current_page = 1, i("update:current_page", 1), i("update:page", 1), oe());
|
|
1728
1734
|
}
|
|
1729
|
-
function
|
|
1735
|
+
function oe() {
|
|
1730
1736
|
i("change", {
|
|
1731
1737
|
current_page: E.current_page,
|
|
1732
1738
|
page: E.current_page,
|
|
1733
1739
|
per_page: E.per_page,
|
|
1734
|
-
sortField:
|
|
1735
|
-
sortOrder:
|
|
1740
|
+
sortField: W.value.field,
|
|
1741
|
+
sortOrder: W.value.order
|
|
1736
1742
|
});
|
|
1737
1743
|
}
|
|
1738
|
-
let
|
|
1744
|
+
let le = Dn(H), Y = wn(H), ue = Y.orderedItems, de = Y.setFixed;
|
|
1739
1745
|
Y.reset;
|
|
1740
1746
|
function fe() {
|
|
1741
|
-
|
|
1747
|
+
le.reset(), Y.reset();
|
|
1742
1748
|
}
|
|
1743
1749
|
let { applyColumnWidths: pe, resizeLineStyle: me, onViewportMouseDown: he } = En(r.minColumnWidth), be = x(() => {
|
|
1744
|
-
let e = r.showColumnSettings ?
|
|
1745
|
-
return Y.applyFixed(
|
|
1750
|
+
let e = r.showColumnSettings ? le.visibleColumns.value : H.value;
|
|
1751
|
+
return Y.applyFixed(le.applyAlign(pe(e)));
|
|
1746
1752
|
}), xe = x(() => {
|
|
1747
1753
|
if (!r.tree) return;
|
|
1748
1754
|
if (r.expandColumnKey) return r.expandColumnKey;
|
|
1749
|
-
let e =
|
|
1755
|
+
let e = H.value.find((e) => {
|
|
1750
1756
|
let t = e.key ?? e.dataKey;
|
|
1751
1757
|
return t != null && String(t) !== "";
|
|
1752
1758
|
}), t = e?.key ?? e?.dataKey;
|
|
1753
1759
|
return t == null ? void 0 : String(t);
|
|
1754
1760
|
}), Se = x(() => r.expandedRowKeys ?? v.value), Ce = x(() => !r.tree || r.treeChildrenKey === "children" ? h.value : st(h.value, r.treeChildrenKey));
|
|
1755
1761
|
function we(e) {
|
|
1756
|
-
let t = r.rowKey ?? "id", n = r.treeChildrenKey ?? "children", i =
|
|
1762
|
+
let t = r.rowKey ?? "id", n = r.treeChildrenKey ?? "children", i = I.value.map((e) => or(e));
|
|
1757
1763
|
return e.map((e) => {
|
|
1758
1764
|
let r = i.map((n) => g.value.has(sr(e[t], n)) ? "1" : "0").join(""), a = {
|
|
1759
1765
|
...e,
|
|
@@ -1762,19 +1768,19 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
1762
1768
|
return Array.isArray(e[n]) && (a[n] = we(e[n])), a;
|
|
1763
1769
|
});
|
|
1764
1770
|
}
|
|
1765
|
-
let Q = x(() =>
|
|
1766
|
-
|
|
1771
|
+
let Q = x(() => R.value ? we(Ce.value) : Ce.value), Te = x(() => r.tree ? lt(Ce.value, Se.value) : h.value), $ = x(() => r.tree ? lt(Ce.value) : h.value);
|
|
1772
|
+
q(() => r.current_page, (e) => {
|
|
1767
1773
|
E.current_page = e;
|
|
1768
|
-
}),
|
|
1774
|
+
}), q(() => r.per_page, (e) => {
|
|
1769
1775
|
E.per_page = e;
|
|
1770
|
-
}),
|
|
1776
|
+
}), q(() => r.data, async () => {
|
|
1771
1777
|
await rt();
|
|
1772
1778
|
}, {
|
|
1773
1779
|
deep: !0,
|
|
1774
1780
|
immediate: !0
|
|
1775
|
-
}),
|
|
1781
|
+
}), q(() => [E.current_page, E.per_page], async () => {
|
|
1776
1782
|
typeof r.data == "function" && await rt();
|
|
1777
|
-
}),
|
|
1783
|
+
}), q(() => r.expandedRowKeys, (e) => {
|
|
1778
1784
|
e && (v.value = [...e]);
|
|
1779
1785
|
}, { immediate: !0 });
|
|
1780
1786
|
let { selectionColumn: De, rowEventHandlers: Oe, clearSelection: ke, getSelectedRows: Ae, getSelectedCount: je, setSelectedKeys: Me } = In(r, i, Te, $);
|
|
@@ -1887,8 +1893,8 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
1887
1893
|
return e;
|
|
1888
1894
|
});
|
|
1889
1895
|
function Qe(e, t) {
|
|
1890
|
-
let n = Ye(t), r =
|
|
1891
|
-
return !n || !r ? e :
|
|
1896
|
+
let n = Ye(t), r = ne("access");
|
|
1897
|
+
return !n || !r ? e : ce(e, [[r, [n]]]);
|
|
1892
1898
|
}
|
|
1893
1899
|
let $e = x(() => 50), et = x(() => {
|
|
1894
1900
|
if (!r.showActions) return null;
|
|
@@ -1973,7 +1979,7 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
1973
1979
|
});
|
|
1974
1980
|
function nt(e) {
|
|
1975
1981
|
return e.map((e) => {
|
|
1976
|
-
let t = e.headerCellRenderer, n =
|
|
1982
|
+
let t = e.headerCellRenderer, n = ie(e), r = W.value.field === n, i = !!(e.sortable || e.sortOrder), a = i && r ? M("span", { class: ["table-entity__sort-arrow", W.value.order === "desc" ? "table-entity__sort-arrow--desc" : "table-entity__sort-arrow--asc"] }) : i ? M("span", { class: "table-entity__sort-icons" }, [M("span", { class: "table-entity__sort-arrow--asc" }), M("span", { class: "table-entity__sort-arrow--desc" })]) : null;
|
|
1977
1983
|
return {
|
|
1978
1984
|
...e,
|
|
1979
1985
|
width: e.width ?? 120,
|
|
@@ -1988,7 +1994,7 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
1988
1994
|
cursor: i ? "pointer" : void 0
|
|
1989
1995
|
},
|
|
1990
1996
|
onClick: i ? (t) => {
|
|
1991
|
-
t.stopPropagation(),
|
|
1997
|
+
t.stopPropagation(), ae(e);
|
|
1992
1998
|
} : void 0
|
|
1993
1999
|
}, [t ? t(n) : e.title, a])
|
|
1994
2000
|
};
|
|
@@ -2005,8 +2011,8 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
2005
2011
|
page: E.current_page,
|
|
2006
2012
|
per_page: E.per_page,
|
|
2007
2013
|
query: r.query,
|
|
2008
|
-
sortField:
|
|
2009
|
-
sortOrder:
|
|
2014
|
+
sortField: W.value.field,
|
|
2015
|
+
sortOrder: W.value.order
|
|
2010
2016
|
});
|
|
2011
2017
|
h.value = e.rows, u.value = e.total;
|
|
2012
2018
|
} finally {
|
|
@@ -2066,13 +2072,13 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
2066
2072
|
i("rowExpand", e);
|
|
2067
2073
|
}
|
|
2068
2074
|
function ht(e) {
|
|
2069
|
-
E.current_page = e, i("update:current_page", e), i("pageChange", e),
|
|
2075
|
+
E.current_page = e, i("update:current_page", e), i("pageChange", e), oe();
|
|
2070
2076
|
}
|
|
2071
2077
|
function gt(e) {
|
|
2072
|
-
E.per_page = e, i("update:per_page", e),
|
|
2078
|
+
E.per_page = e, i("update:per_page", e), oe();
|
|
2073
2079
|
}
|
|
2074
2080
|
async function _t(e) {
|
|
2075
|
-
e != null && E.current_page !== e ? (E.current_page = e, i("update:current_page", e),
|
|
2081
|
+
e != null && E.current_page !== e ? (E.current_page = e, i("update:current_page", e), oe()) : await rt();
|
|
2076
2082
|
}
|
|
2077
2083
|
return t({
|
|
2078
2084
|
clearSelection: ke,
|
|
@@ -2082,60 +2088,60 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
2082
2088
|
openImport: Ne,
|
|
2083
2089
|
reload: _t
|
|
2084
2090
|
}), (t, n) => {
|
|
2085
|
-
let i =
|
|
2086
|
-
return
|
|
2091
|
+
let i = ne("loading");
|
|
2092
|
+
return B(), w("div", { class: L(["table-entity", {
|
|
2087
2093
|
"table-entity--large-row": r.rowHeight > 40,
|
|
2088
|
-
"table-entity--dynamic-row":
|
|
2094
|
+
"table-entity--dynamic-row": R.value
|
|
2089
2095
|
}]) }, [
|
|
2090
2096
|
n[6] ||= T("div", { class: "flex justify-between mb-1" }, null, -1),
|
|
2091
2097
|
T("div", {
|
|
2092
2098
|
class: "table-entity__toolbar",
|
|
2093
|
-
style:
|
|
2094
|
-
}, [T("div", yr, [T("div", br, [
|
|
2095
|
-
O(
|
|
2096
|
-
content:
|
|
2099
|
+
style: z({ width: `${e.width}px` })
|
|
2100
|
+
}, [T("div", yr, [T("div", br, [U(t.$slots, "buttons", {}, void 0, !0)])]), j.value ? (B(), w("div", xr, [
|
|
2101
|
+
O(K(Be), {
|
|
2102
|
+
content: K(c)("components.tableEntity.refresh"),
|
|
2097
2103
|
placement: "top"
|
|
2098
2104
|
}, {
|
|
2099
|
-
default:
|
|
2100
|
-
icon:
|
|
2105
|
+
default: J(() => [O(K(X), {
|
|
2106
|
+
icon: K(ot),
|
|
2101
2107
|
circle: "",
|
|
2102
2108
|
size: "small",
|
|
2103
|
-
title:
|
|
2109
|
+
title: K(c)("components.tableEntity.refresh"),
|
|
2104
2110
|
onClick: N
|
|
2105
2111
|
}, null, 8, ["icon", "title"])]),
|
|
2106
2112
|
_: 1
|
|
2107
2113
|
}, 8, ["content"]),
|
|
2108
|
-
T("div", null, [O(
|
|
2109
|
-
content:
|
|
2114
|
+
T("div", null, [O(K(Be), {
|
|
2115
|
+
content: K(c)("components.tableEntity.columnSettings"),
|
|
2110
2116
|
placement: "top"
|
|
2111
2117
|
}, {
|
|
2112
|
-
default:
|
|
2118
|
+
default: J(() => [O(K(X), {
|
|
2113
2119
|
class: "table-entity__settings-btn",
|
|
2114
|
-
icon:
|
|
2120
|
+
icon: K(ct),
|
|
2115
2121
|
circle: "",
|
|
2116
2122
|
size: "small",
|
|
2117
2123
|
onClick: n[0] ||= (e) => s.value = !0
|
|
2118
2124
|
}, null, 8, ["icon"])]),
|
|
2119
2125
|
_: 1
|
|
2120
2126
|
}, 8, ["content"])]),
|
|
2121
|
-
r.showColumnSettings ? (
|
|
2127
|
+
r.showColumnSettings ? (B(), S(K(ge), {
|
|
2122
2128
|
key: 0,
|
|
2123
2129
|
modelValue: s.value,
|
|
2124
2130
|
"onUpdate:modelValue": n[1] ||= (e) => s.value = e,
|
|
2125
|
-
title:
|
|
2131
|
+
title: K(c)("components.tableEntity.columnConfig"),
|
|
2126
2132
|
direction: "rtl",
|
|
2127
2133
|
size: "640px"
|
|
2128
2134
|
}, {
|
|
2129
|
-
default:
|
|
2130
|
-
settings:
|
|
2131
|
-
"fixed-items":
|
|
2132
|
-
onToggle:
|
|
2133
|
-
onSetHeaderAlign:
|
|
2134
|
-
onSetContentAlign:
|
|
2135
|
-
onSetWidth:
|
|
2136
|
-
onSetFixed:
|
|
2135
|
+
default: J(() => [O(Cn, {
|
|
2136
|
+
settings: K(le).orderedSettings.value,
|
|
2137
|
+
"fixed-items": K(ue),
|
|
2138
|
+
onToggle: K(le).toggleColumn,
|
|
2139
|
+
onSetHeaderAlign: K(le).setHeaderAlign,
|
|
2140
|
+
onSetContentAlign: K(le).setContentAlign,
|
|
2141
|
+
onSetWidth: K(le).setWidth,
|
|
2142
|
+
onSetFixed: K(de),
|
|
2137
2143
|
onReset: fe,
|
|
2138
|
-
"onUpdate:settings":
|
|
2144
|
+
"onUpdate:settings": K(le).reorderSettings
|
|
2139
2145
|
}, null, 8, [
|
|
2140
2146
|
"settings",
|
|
2141
2147
|
"fixed-items",
|
|
@@ -2150,13 +2156,13 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
2150
2156
|
}, 8, ["modelValue", "title"])) : C("", !0),
|
|
2151
2157
|
C("", !0)
|
|
2152
2158
|
])) : C("", !0)], 4),
|
|
2153
|
-
|
|
2159
|
+
ce((B(), w("div", {
|
|
2154
2160
|
ref_key: "tableViewportRef",
|
|
2155
2161
|
ref: y,
|
|
2156
2162
|
class: "table-entity__viewport",
|
|
2157
|
-
onMousedown: n[2] ||= (...e) =>
|
|
2158
|
-
onPointerdown: n[3] ||= (...e) =>
|
|
2159
|
-
}, [O(
|
|
2163
|
+
onMousedown: n[2] ||= (...e) => K(he) && K(he)(...e),
|
|
2164
|
+
onPointerdown: n[3] ||= (...e) => K(We) && K(We)(...e)
|
|
2165
|
+
}, [O(K(Re), {
|
|
2160
2166
|
columns: nt(tt.value),
|
|
2161
2167
|
data: Q.value,
|
|
2162
2168
|
width: k.value,
|
|
@@ -2165,14 +2171,14 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
2165
2171
|
"row-class": Ke,
|
|
2166
2172
|
"row-props": qe,
|
|
2167
2173
|
cache: r.cache,
|
|
2168
|
-
"estimated-row-height":
|
|
2169
|
-
"row-key":
|
|
2174
|
+
"estimated-row-height": R.value ? r.rowHeight : void 0,
|
|
2175
|
+
"row-key": R.value ? "__measureKey" : r.rowKey,
|
|
2170
2176
|
"expand-column-key": xe.value,
|
|
2171
2177
|
"expanded-row-keys": Se.value,
|
|
2172
2178
|
"default-expanded-row-keys": r.defaultExpandedRowKeys,
|
|
2173
2179
|
"indent-size": r.indentSize,
|
|
2174
2180
|
"icon-size": r.iconSize,
|
|
2175
|
-
"row-event-handlers": r.selectable ?
|
|
2181
|
+
"row-event-handlers": r.selectable ? K(Oe) : void 0,
|
|
2176
2182
|
fixed: "",
|
|
2177
2183
|
"onUpdate:expandedRowKeys": dt,
|
|
2178
2184
|
onExpandedRowsChange: ft,
|
|
@@ -2193,19 +2199,19 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
2193
2199
|
"icon-size",
|
|
2194
2200
|
"row-event-handlers"
|
|
2195
2201
|
])], 32)), [[i, _.value]]),
|
|
2196
|
-
r.resizable ? (
|
|
2202
|
+
r.resizable ? (B(), w("div", {
|
|
2197
2203
|
key: 0,
|
|
2198
2204
|
class: "table-entity__resize-line",
|
|
2199
|
-
style:
|
|
2205
|
+
style: z(K(me))
|
|
2200
2206
|
}, null, 4)) : C("", !0),
|
|
2201
|
-
r.showPagination ? (
|
|
2207
|
+
r.showPagination ? (B(), w("div", Sr, [K(je)() > 0 ? (B(), w("div", Cr, [n[5] ||= T("span", {
|
|
2202
2208
|
class: "size-2 rounded-full bg-[var(--el-color-primary)] shadow-[0_0_0_3px_var(--el-color-primary-light-8)]",
|
|
2203
2209
|
"aria-hidden": "true"
|
|
2204
|
-
}, null, -1), D(" " +
|
|
2210
|
+
}, null, -1), D(" " + G(K(c)("components.tableEntity.selectedCount", { count: K(je)() })), 1)])) : (B(), w("div", wr)), O(K(Ee), F({
|
|
2205
2211
|
"current-page": E.current_page,
|
|
2206
2212
|
"page-size": E.per_page,
|
|
2207
2213
|
total: A.value
|
|
2208
|
-
},
|
|
2214
|
+
}, K(d), {
|
|
2209
2215
|
"page-sizes": f.value,
|
|
2210
2216
|
onSizeChange: gt,
|
|
2211
2217
|
onCurrentChange: ht
|
|
@@ -2215,7 +2221,7 @@ var yr = { class: "table-entity__toolbar-right" }, br = { class: "buttons" }, xr
|
|
|
2215
2221
|
"total",
|
|
2216
2222
|
"page-sizes"
|
|
2217
2223
|
])])) : C("", !0),
|
|
2218
|
-
r.importDialog ? (
|
|
2224
|
+
r.importDialog ? (B(), S(K(pn), {
|
|
2219
2225
|
key: 2,
|
|
2220
2226
|
modelValue: o.value,
|
|
2221
2227
|
"onUpdate:modelValue": n[4] ||= (e) => o.value = e,
|
|
@@ -2360,17 +2366,17 @@ var Vr = { class: "readonly-text" }, Hr = {
|
|
|
2360
2366
|
async function o() {
|
|
2361
2367
|
await n(i.value), Q.success(c("schemaForm.copied"));
|
|
2362
2368
|
}
|
|
2363
|
-
return (e, t) => (
|
|
2369
|
+
return (e, t) => (B(), w("div", Vr, [i.value ? (B(), w("span", Hr, G(i.value), 1)) : (B(), w("span", Ur, G(K(c)("schemaForm.empty")), 1)), a.value ? (B(), S(K(Z), {
|
|
2364
2370
|
key: 2,
|
|
2365
2371
|
class: "readonly-text__copy",
|
|
2366
|
-
title:
|
|
2372
|
+
title: K(c)("schemaForm.copy"),
|
|
2367
2373
|
onClick: o
|
|
2368
2374
|
}, {
|
|
2369
|
-
default:
|
|
2375
|
+
default: J(() => [O(K(Qe))]),
|
|
2370
2376
|
_: 1
|
|
2371
2377
|
}, 8, ["title"])) : C("", !0)]));
|
|
2372
2378
|
}
|
|
2373
|
-
}), [["__scopeId", "data-v-1f95eeac"]]), Gr =
|
|
2379
|
+
}), [["__scopeId", "data-v-1f95eeac"]]), Gr = W({});
|
|
2374
2380
|
function Kr(e) {
|
|
2375
2381
|
return typeof e == "object" && e && "component" in e && e.component ? e : { component: e };
|
|
2376
2382
|
}
|
|
@@ -2472,20 +2478,20 @@ var Yr = [
|
|
|
2472
2478
|
function a(e) {
|
|
2473
2479
|
(e === "translate" || e === "polish") && r("translate", e);
|
|
2474
2480
|
}
|
|
2475
|
-
return (t, n) => e.inline ? (
|
|
2481
|
+
return (t, n) => e.inline ? (B(), w("div", Xr, [T("span", Zr, [O(K(_t), {
|
|
2476
2482
|
class: "translate-toolbar__label-icon",
|
|
2477
2483
|
size: 16,
|
|
2478
2484
|
color: "#8994BC",
|
|
2479
2485
|
"stroke-width": 2
|
|
2480
|
-
}), D(" " +
|
|
2481
|
-
O(
|
|
2486
|
+
}), D(" " + G(K(c)("product-management.attribute.translation.label")), 1)]), T("div", Qr, [
|
|
2487
|
+
O(K(Me), {
|
|
2482
2488
|
"model-value": e.sourceLanguage,
|
|
2483
2489
|
disabled: e.disabled || e.loading,
|
|
2484
|
-
placeholder:
|
|
2490
|
+
placeholder: K(c)("product-management.attribute.translation.from"),
|
|
2485
2491
|
class: "translate-toolbar__language-select",
|
|
2486
2492
|
"onUpdate:modelValue": n[0] ||= (e) => r("update:sourceLanguage", String(e))
|
|
2487
2493
|
}, {
|
|
2488
|
-
default:
|
|
2494
|
+
default: J(() => [(B(!0), w(b, null, H(e.languages, (e) => (B(), S(K($), {
|
|
2489
2495
|
key: e.code,
|
|
2490
2496
|
label: e.label,
|
|
2491
2497
|
value: e.code
|
|
@@ -2500,14 +2506,14 @@ var Yr = [
|
|
|
2500
2506
|
class: "translate-toolbar__arrow",
|
|
2501
2507
|
"aria-hidden": "true"
|
|
2502
2508
|
}, "→", -1),
|
|
2503
|
-
O(
|
|
2509
|
+
O(K(Me), {
|
|
2504
2510
|
"model-value": e.targetLanguage,
|
|
2505
2511
|
disabled: e.disabled || e.loading,
|
|
2506
|
-
placeholder:
|
|
2512
|
+
placeholder: K(c)("product-management.attribute.translation.to"),
|
|
2507
2513
|
class: "translate-toolbar__language-select",
|
|
2508
2514
|
"onUpdate:modelValue": n[1] ||= (e) => r("update:targetLanguage", String(e))
|
|
2509
2515
|
}, {
|
|
2510
|
-
default:
|
|
2516
|
+
default: J(() => [(B(!0), w(b, null, H(i.value, (e) => (B(), S(K($), {
|
|
2511
2517
|
key: e.code,
|
|
2512
2518
|
label: e.label,
|
|
2513
2519
|
value: e.code
|
|
@@ -2518,7 +2524,7 @@ var Yr = [
|
|
|
2518
2524
|
"disabled",
|
|
2519
2525
|
"placeholder"
|
|
2520
2526
|
]),
|
|
2521
|
-
O(
|
|
2527
|
+
O(K(_e), {
|
|
2522
2528
|
"split-button": "",
|
|
2523
2529
|
type: "primary",
|
|
2524
2530
|
class: "translate-toolbar__action",
|
|
@@ -2526,49 +2532,49 @@ var Yr = [
|
|
|
2526
2532
|
onClick: n[2] ||= (e) => r("translate", "translate"),
|
|
2527
2533
|
onCommand: a
|
|
2528
2534
|
}, {
|
|
2529
|
-
dropdown:
|
|
2530
|
-
default:
|
|
2531
|
-
default:
|
|
2535
|
+
dropdown: J(() => [O(K(ye), null, {
|
|
2536
|
+
default: J(() => [O(K(ve), { command: "translate" }, {
|
|
2537
|
+
default: J(() => [D(G(K(c)("product-management.attribute.translation.translate")), 1)]),
|
|
2532
2538
|
_: 1
|
|
2533
|
-
}), O(
|
|
2534
|
-
default:
|
|
2539
|
+
}), O(K(ve), { command: "polish" }, {
|
|
2540
|
+
default: J(() => [D(G(K(c)("product-management.attribute.translation.polish")), 1)]),
|
|
2535
2541
|
_: 1
|
|
2536
2542
|
})]),
|
|
2537
2543
|
_: 1
|
|
2538
2544
|
})]),
|
|
2539
|
-
default:
|
|
2545
|
+
default: J(() => [D(G(K(c)("product-management.attribute.translation.translate")) + " ", 1)]),
|
|
2540
2546
|
_: 1
|
|
2541
2547
|
}, 8, ["disabled"])
|
|
2542
|
-
])])) : (
|
|
2548
|
+
])])) : (B(), S(K(De), {
|
|
2543
2549
|
key: 1,
|
|
2544
2550
|
width: 390,
|
|
2545
2551
|
placement: "bottom-end",
|
|
2546
2552
|
disabled: e.disabled,
|
|
2547
2553
|
trigger: "hover"
|
|
2548
2554
|
}, {
|
|
2549
|
-
reference:
|
|
2555
|
+
reference: J(() => [O(K(X), {
|
|
2550
2556
|
text: "",
|
|
2551
|
-
icon:
|
|
2557
|
+
icon: K(Ye),
|
|
2552
2558
|
disabled: e.disabled,
|
|
2553
2559
|
size: "large",
|
|
2554
|
-
title:
|
|
2555
|
-
"aria-label":
|
|
2560
|
+
title: K(c)("product-management.attribute.translation.label"),
|
|
2561
|
+
"aria-label": K(c)("product-management.attribute.translation.label")
|
|
2556
2562
|
}, null, 8, [
|
|
2557
2563
|
"icon",
|
|
2558
2564
|
"disabled",
|
|
2559
2565
|
"title",
|
|
2560
2566
|
"aria-label"
|
|
2561
2567
|
])]),
|
|
2562
|
-
default:
|
|
2563
|
-
O(
|
|
2568
|
+
default: J(() => [T("div", $r, [
|
|
2569
|
+
O(K(Me), {
|
|
2564
2570
|
"model-value": e.sourceLanguage,
|
|
2565
2571
|
disabled: e.disabled || e.loading,
|
|
2566
2572
|
teleported: e.selectTeleported,
|
|
2567
|
-
placeholder:
|
|
2573
|
+
placeholder: K(c)("product-management.attribute.translation.from"),
|
|
2568
2574
|
class: "translate-toolbar__language-select",
|
|
2569
2575
|
"onUpdate:modelValue": n[3] ||= (e) => r("update:sourceLanguage", String(e))
|
|
2570
2576
|
}, {
|
|
2571
|
-
default:
|
|
2577
|
+
default: J(() => [(B(!0), w(b, null, H(e.languages, (e) => (B(), S(K($), {
|
|
2572
2578
|
key: e.code,
|
|
2573
2579
|
label: e.label,
|
|
2574
2580
|
value: e.code
|
|
@@ -2584,15 +2590,15 @@ var Yr = [
|
|
|
2584
2590
|
class: "translate-toolbar__arrow",
|
|
2585
2591
|
"aria-hidden": "true"
|
|
2586
2592
|
}, "→", -1),
|
|
2587
|
-
O(
|
|
2593
|
+
O(K(Me), {
|
|
2588
2594
|
"model-value": e.targetLanguage,
|
|
2589
2595
|
disabled: e.disabled || e.loading,
|
|
2590
2596
|
teleported: e.selectTeleported,
|
|
2591
|
-
placeholder:
|
|
2597
|
+
placeholder: K(c)("product-management.attribute.translation.to"),
|
|
2592
2598
|
class: "translate-toolbar__language-select",
|
|
2593
2599
|
"onUpdate:modelValue": n[4] ||= (e) => r("update:targetLanguage", String(e))
|
|
2594
2600
|
}, {
|
|
2595
|
-
default:
|
|
2601
|
+
default: J(() => [(B(!0), w(b, null, H(i.value, (e) => (B(), S(K($), {
|
|
2596
2602
|
key: e.code,
|
|
2597
2603
|
label: e.label,
|
|
2598
2604
|
value: e.code
|
|
@@ -2604,7 +2610,7 @@ var Yr = [
|
|
|
2604
2610
|
"teleported",
|
|
2605
2611
|
"placeholder"
|
|
2606
2612
|
]),
|
|
2607
|
-
O(
|
|
2613
|
+
O(K(_e), {
|
|
2608
2614
|
"split-button": "",
|
|
2609
2615
|
type: "primary",
|
|
2610
2616
|
teleported: e.selectTeleported,
|
|
@@ -2613,17 +2619,17 @@ var Yr = [
|
|
|
2613
2619
|
onClick: n[5] ||= (e) => r("translate", "translate"),
|
|
2614
2620
|
onCommand: a
|
|
2615
2621
|
}, {
|
|
2616
|
-
dropdown:
|
|
2617
|
-
default:
|
|
2618
|
-
default:
|
|
2622
|
+
dropdown: J(() => [O(K(ye), null, {
|
|
2623
|
+
default: J(() => [O(K(ve), { command: "translate" }, {
|
|
2624
|
+
default: J(() => [D(G(K(c)("product-management.attribute.translation.translate")), 1)]),
|
|
2619
2625
|
_: 1
|
|
2620
|
-
}), O(
|
|
2621
|
-
default:
|
|
2626
|
+
}), O(K(ve), { command: "polish" }, {
|
|
2627
|
+
default: J(() => [D(G(K(c)("product-management.attribute.translation.polish")), 1)]),
|
|
2622
2628
|
_: 1
|
|
2623
2629
|
})]),
|
|
2624
2630
|
_: 1
|
|
2625
2631
|
})]),
|
|
2626
|
-
default:
|
|
2632
|
+
default: J(() => [D(G(K(c)("product-management.attribute.translation.translate")) + " ", 1)]),
|
|
2627
2633
|
_: 1
|
|
2628
2634
|
}, 8, ["teleported", "disabled"])
|
|
2629
2635
|
])]),
|
|
@@ -2658,8 +2664,8 @@ var Yr = [
|
|
|
2658
2664
|
"rich-text",
|
|
2659
2665
|
"text",
|
|
2660
2666
|
"textarea"
|
|
2661
|
-
].includes(n.field.type) ? "tabs" : "grid")), s = x(() => i.value.find(({ code: e }) => e === u.value)?.label ?? ""), l = x(() => n.modelValue && typeof n.modelValue == "object" && !Array.isArray(n.modelValue) ? n.modelValue : typeof n.modelValue == "string" ? { [i.value[0]?.code ?? "en"]: n.modelValue } : {}), u =
|
|
2662
|
-
|
|
2667
|
+
].includes(n.field.type) ? "tabs" : "grid")), s = x(() => i.value.find(({ code: e }) => e === u.value)?.label ?? ""), l = x(() => n.modelValue && typeof n.modelValue == "object" && !Array.isArray(n.modelValue) ? n.modelValue : typeof n.modelValue == "string" ? { [i.value[0]?.code ?? "en"]: n.modelValue } : {}), u = V("en"), d = V("en"), f = V("all"), p = V(!1), m = x(() => n.disabled || n.readonly || p.value);
|
|
2668
|
+
q(a, (e) => {
|
|
2663
2669
|
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");
|
|
2664
2670
|
}, { immediate: !0 });
|
|
2665
2671
|
function h(e, t) {
|
|
@@ -2717,22 +2723,22 @@ var Yr = [
|
|
|
2717
2723
|
}
|
|
2718
2724
|
}
|
|
2719
2725
|
return (t, n) => {
|
|
2720
|
-
let r =
|
|
2721
|
-
return
|
|
2722
|
-
class:
|
|
2723
|
-
"element-loading-text":
|
|
2724
|
-
}, [o.value === "tabs" ? (
|
|
2726
|
+
let r = ne("loading");
|
|
2727
|
+
return ce((B(), w("div", {
|
|
2728
|
+
class: L(["translate-field", [`translate-field--label-${e.labelPosition}`, { "translate-field--plain-input": e.field.type === "text" || e.field.type === "textarea" }]]),
|
|
2729
|
+
"element-loading-text": K(c)("product-management.attribute.translation.loading")
|
|
2730
|
+
}, [o.value === "tabs" ? (B(), w(b, { key: 0 }, [O(K(ze), {
|
|
2725
2731
|
modelValue: u.value,
|
|
2726
2732
|
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
2727
2733
|
class: "translate-field__tabs"
|
|
2728
2734
|
}, {
|
|
2729
|
-
default:
|
|
2735
|
+
default: J(() => [(B(!0), w(b, null, H(i.value, (e) => (B(), S(K(Fe), {
|
|
2730
2736
|
key: e.code,
|
|
2731
2737
|
label: e.label,
|
|
2732
2738
|
name: e.code
|
|
2733
2739
|
}, null, 8, ["label", "name"]))), 128))]),
|
|
2734
2740
|
_: 1
|
|
2735
|
-
}, 8, ["modelValue"]), e.field.type === "rich-text" ? (
|
|
2741
|
+
}, 8, ["modelValue"]), e.field.type === "rich-text" ? (B(), S(g, F({ key: 0 }, e.inputProps, {
|
|
2736
2742
|
id: `${e.field.prop}-${u.value}`,
|
|
2737
2743
|
"model-value": String(l.value[u.value] ?? ""),
|
|
2738
2744
|
placeholder: e.placeholder || s.value,
|
|
@@ -2741,7 +2747,7 @@ var Yr = [
|
|
|
2741
2747
|
"tool-context": v(u.value),
|
|
2742
2748
|
"onUpdate:modelValue": n[3] ||= (e) => h(u.value, e)
|
|
2743
2749
|
}), {
|
|
2744
|
-
"toolbar-append":
|
|
2750
|
+
"toolbar-append": J(() => [O(ei, {
|
|
2745
2751
|
languages: i.value,
|
|
2746
2752
|
"source-language": d.value,
|
|
2747
2753
|
"target-language": f.value,
|
|
@@ -2766,7 +2772,7 @@ var Yr = [
|
|
|
2766
2772
|
"editable",
|
|
2767
2773
|
"max-height",
|
|
2768
2774
|
"tool-context"
|
|
2769
|
-
])) : (
|
|
2775
|
+
])) : (B(), S(K(Ce), F({ key: 1 }, e.inputProps, {
|
|
2770
2776
|
id: `${e.field.prop}-${u.value}`,
|
|
2771
2777
|
"model-value": _(u.value),
|
|
2772
2778
|
type: e.field.type === "textarea" ? "textarea" : "text",
|
|
@@ -2781,13 +2787,13 @@ var Yr = [
|
|
|
2781
2787
|
"rows",
|
|
2782
2788
|
"placeholder",
|
|
2783
2789
|
"disabled"
|
|
2784
|
-
]))], 64)) : (
|
|
2790
|
+
]))], 64)) : (B(), w("div", ni, [(B(!0), w(b, null, H(i.value, (t) => (B(), w("div", {
|
|
2785
2791
|
key: t.code,
|
|
2786
2792
|
class: "translate-field__entry"
|
|
2787
2793
|
}, [T("label", {
|
|
2788
2794
|
class: "translate-field__label",
|
|
2789
2795
|
for: `${e.field.prop}-${t.code}`
|
|
2790
|
-
},
|
|
2796
|
+
}, G(t.label), 9, ri), e.field.type === "rich-text" ? (B(), S(g, F({
|
|
2791
2797
|
key: 0,
|
|
2792
2798
|
ref_for: !0
|
|
2793
2799
|
}, e.inputProps, {
|
|
@@ -2806,7 +2812,7 @@ var Yr = [
|
|
|
2806
2812
|
"max-height",
|
|
2807
2813
|
"tool-context",
|
|
2808
2814
|
"onUpdate:modelValue"
|
|
2809
|
-
])) : (
|
|
2815
|
+
])) : (B(), S(K(Ce), F({
|
|
2810
2816
|
key: 1,
|
|
2811
2817
|
ref_for: !0
|
|
2812
2818
|
}, e.inputProps, {
|
|
@@ -2825,7 +2831,7 @@ var Yr = [
|
|
|
2825
2831
|
"placeholder",
|
|
2826
2832
|
"disabled",
|
|
2827
2833
|
"onUpdate:modelValue"
|
|
2828
|
-
]))]))), 128))])), o.value !== "tabs" || e.field.type !== "rich-text" ? (
|
|
2834
|
+
]))]))), 128))])), o.value !== "tabs" || e.field.type !== "rich-text" ? (B(), S(ei, {
|
|
2829
2835
|
key: 2,
|
|
2830
2836
|
inline: e.field.type === "text" || e.field.type === "textarea",
|
|
2831
2837
|
languages: i.value,
|
|
@@ -2884,7 +2890,7 @@ var oi = {
|
|
|
2884
2890
|
values: {}
|
|
2885
2891
|
}), u = ai(() => n.field, l), d = x(() => ({
|
|
2886
2892
|
...l.value,
|
|
2887
|
-
updateValue:
|
|
2893
|
+
updateValue: W
|
|
2888
2894
|
})), f = x(() => typeof n.field.props == "function" ? n.field.props(d.value) : n.field.props), p = x(() => Ir(n.field, l.value)), g = x(() => Fr(n.field)), _ = x(() => n.field.copyable ?? !!n.field.readonly), v = x(() => !!n.field.translateConfig && [
|
|
2889
2895
|
"rich-text",
|
|
2890
2896
|
"text",
|
|
@@ -2943,10 +2949,10 @@ var oi = {
|
|
|
2943
2949
|
[e.modelProp ?? "modelValue"]: n.modelValue,
|
|
2944
2950
|
disabled: n.disabled
|
|
2945
2951
|
} : {};
|
|
2946
|
-
}),
|
|
2952
|
+
}), I = x(() => {
|
|
2947
2953
|
let e = N.value;
|
|
2948
|
-
return e ? { [e.updateEvent ?? `update:${e.modelProp ?? "modelValue"}`]: (t) =>
|
|
2949
|
-
}),
|
|
2954
|
+
return e ? { [e.updateEvent ?? `update:${e.modelProp ?? "modelValue"}`]: (t) => W(e.valueExtractor?.(t) ?? t) } : {};
|
|
2955
|
+
}), R = x(() => ({
|
|
2950
2956
|
...f.value,
|
|
2951
2957
|
editable: !n.disabled && !n.readonly && f.value?.editable !== !1,
|
|
2952
2958
|
toolContext: {
|
|
@@ -2955,11 +2961,11 @@ var oi = {
|
|
|
2955
2961
|
getFormData: () => l.value.values,
|
|
2956
2962
|
mode: l.value.mode
|
|
2957
2963
|
}
|
|
2958
|
-
})),
|
|
2959
|
-
let e =
|
|
2964
|
+
})), z = x(() => n.field.apiOptions), ee = x(() => z.value ? zr(z.value.entityKey) : void 0), te = x(() => {
|
|
2965
|
+
let e = z.value?.params;
|
|
2960
2966
|
return typeof e == "function" ? e(l.value) : e;
|
|
2961
|
-
}),
|
|
2962
|
-
let e =
|
|
2967
|
+
}), V = x(() => JSON.stringify(te.value ?? {})), ne = x(() => {
|
|
2968
|
+
let e = ee.value, t = z.value;
|
|
2963
2969
|
return !e || !t ? null : {
|
|
2964
2970
|
columns: e.columns ?? [],
|
|
2965
2971
|
dialogTitle: e.dialogTitle,
|
|
@@ -2969,15 +2975,15 @@ var oi = {
|
|
|
2969
2975
|
valueKey: t.valueKey ?? e.valueKey
|
|
2970
2976
|
};
|
|
2971
2977
|
});
|
|
2972
|
-
function
|
|
2978
|
+
function W(e) {
|
|
2973
2979
|
r("update:modelValue", e);
|
|
2974
2980
|
}
|
|
2975
|
-
function
|
|
2976
|
-
let t =
|
|
2981
|
+
function ae(e) {
|
|
2982
|
+
let t = ee.value;
|
|
2977
2983
|
return t ? t.fetch({
|
|
2978
2984
|
...e,
|
|
2979
2985
|
params: {
|
|
2980
|
-
...
|
|
2986
|
+
...te.value ?? {},
|
|
2981
2987
|
...e.params ?? {}
|
|
2982
2988
|
}
|
|
2983
2989
|
}) : Promise.resolve({
|
|
@@ -2985,7 +2991,7 @@ var oi = {
|
|
|
2985
2991
|
total: 0
|
|
2986
2992
|
});
|
|
2987
2993
|
}
|
|
2988
|
-
function
|
|
2994
|
+
function oe(e) {
|
|
2989
2995
|
let t = u.value.map((e) => ({
|
|
2990
2996
|
label: e.label,
|
|
2991
2997
|
value: e.value,
|
|
@@ -3001,14 +3007,14 @@ var oi = {
|
|
|
3001
3007
|
total: t.length
|
|
3002
3008
|
});
|
|
3003
3009
|
}
|
|
3004
|
-
return (t, n) => (
|
|
3005
|
-
class:
|
|
3010
|
+
return (t, n) => (B(), S(K(xe), {
|
|
3011
|
+
class: L(["schema-form-item", { "schema-form-item--bare": e.hideLabel }]),
|
|
3006
3012
|
label: e.hideLabel ? void 0 : e.field.label,
|
|
3007
3013
|
"label-width": e.hideLabel ? "0" : void 0,
|
|
3008
3014
|
prop: e.field.prop,
|
|
3009
3015
|
rules: p.value
|
|
3010
3016
|
}, {
|
|
3011
|
-
default:
|
|
3017
|
+
default: J(() => [v.value ? (B(), S(ii, {
|
|
3012
3018
|
key: 0,
|
|
3013
3019
|
config: e.field.translateConfig,
|
|
3014
3020
|
context: l.value,
|
|
@@ -3019,7 +3025,7 @@ var oi = {
|
|
|
3019
3025
|
"model-value": e.modelValue,
|
|
3020
3026
|
placeholder: g.value,
|
|
3021
3027
|
readonly: e.readonly,
|
|
3022
|
-
"onUpdate:modelValue":
|
|
3028
|
+
"onUpdate:modelValue": W
|
|
3023
3029
|
}, null, 8, [
|
|
3024
3030
|
"config",
|
|
3025
3031
|
"context",
|
|
@@ -3030,181 +3036,181 @@ var oi = {
|
|
|
3030
3036
|
"model-value",
|
|
3031
3037
|
"placeholder",
|
|
3032
3038
|
"readonly"
|
|
3033
|
-
])) : e.readonly && e.field.type === "rich-text" ? (
|
|
3039
|
+
])) : e.readonly && e.field.type === "rich-text" ? (B(), S(K(s), F({
|
|
3034
3040
|
key: 1,
|
|
3035
3041
|
"model-value": e.modelValue,
|
|
3036
3042
|
placeholder: g.value
|
|
3037
|
-
},
|
|
3043
|
+
}, R.value), null, 16, ["model-value", "placeholder"])) : e.readonly && e.field.optionSource === "dict" && e.field.dictCode ? (B(), w("span", oi, [(B(!0), w(b, null, H(O.value, (t, n) => (B(), S(Wn, {
|
|
3038
3044
|
key: `${e.field.prop}-${n}`,
|
|
3039
3045
|
code: e.field.dictCode,
|
|
3040
3046
|
value: t
|
|
3041
|
-
}, null, 8, ["code", "value"]))), 128))])) : e.readonly && e.field.type === "picture" ? (
|
|
3047
|
+
}, null, 8, ["code", "value"]))), 128))])) : e.readonly && e.field.type === "picture" ? (B(), S(m, {
|
|
3042
3048
|
key: 3,
|
|
3043
3049
|
urls: A.value,
|
|
3044
3050
|
"max-preview-count": M.value
|
|
3045
|
-
}, null, 8, ["urls", "max-preview-count"])) : e.readonly && (e.field.type === "file" || e.field.type === "upload") ? (
|
|
3051
|
+
}, null, 8, ["urls", "max-preview-count"])) : e.readonly && (e.field.type === "file" || e.field.type === "upload") ? (B(), S(h, {
|
|
3046
3052
|
key: 4,
|
|
3047
3053
|
attachments: j.value,
|
|
3048
3054
|
"max-preview-count": M.value
|
|
3049
|
-
}, null, 8, ["attachments", "max-preview-count"])) : e.readonly ? (
|
|
3055
|
+
}, null, 8, ["attachments", "max-preview-count"])) : e.readonly ? (B(), S(Wr, {
|
|
3050
3056
|
key: 5,
|
|
3051
3057
|
value: E.value,
|
|
3052
3058
|
copyable: _.value
|
|
3053
|
-
}, null, 8, ["value", "copyable"])) : N.value ? (
|
|
3059
|
+
}, null, 8, ["value", "copyable"])) : N.value ? (B(), S(re(N.value.component), F({ key: 6 }, P.value, ie(I.value)), null, 16)) : e.field.type === "upload" ? (B(), S(K(a), F({
|
|
3054
3060
|
key: 7,
|
|
3055
3061
|
"model-value": e.modelValue,
|
|
3056
3062
|
placeholder: e.field.placeholder,
|
|
3057
3063
|
disabled: e.disabled || e.readonly,
|
|
3058
3064
|
"show-remove": !e.readonly
|
|
3059
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3065
|
+
}, f.value, { "onUpdate:modelValue": W }), null, 16, [
|
|
3060
3066
|
"model-value",
|
|
3061
3067
|
"placeholder",
|
|
3062
3068
|
"disabled",
|
|
3063
3069
|
"show-remove"
|
|
3064
|
-
])) : e.field.type === "picture" ? (
|
|
3070
|
+
])) : e.field.type === "picture" ? (B(), S(K(o), F({
|
|
3065
3071
|
key: 8,
|
|
3066
3072
|
"model-value": e.modelValue,
|
|
3067
3073
|
disabled: e.disabled || e.readonly,
|
|
3068
3074
|
"show-remove": !e.readonly
|
|
3069
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3075
|
+
}, f.value, { "onUpdate:modelValue": W }), null, 16, [
|
|
3070
3076
|
"model-value",
|
|
3071
3077
|
"disabled",
|
|
3072
3078
|
"show-remove"
|
|
3073
|
-
])) : e.field.type === "file" ? (
|
|
3079
|
+
])) : e.field.type === "file" ? (B(), S(K(a), F({
|
|
3074
3080
|
key: 9,
|
|
3075
3081
|
"model-value": e.modelValue,
|
|
3076
3082
|
placeholder: e.field.placeholder,
|
|
3077
3083
|
disabled: e.disabled || e.readonly,
|
|
3078
3084
|
"show-remove": !e.readonly
|
|
3079
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3085
|
+
}, f.value, { "onUpdate:modelValue": W }), null, 16, [
|
|
3080
3086
|
"model-value",
|
|
3081
3087
|
"placeholder",
|
|
3082
3088
|
"disabled",
|
|
3083
3089
|
"show-remove"
|
|
3084
|
-
])) : e.field.type === "slot" ?
|
|
3090
|
+
])) : e.field.type === "slot" ? U(t.$slots, "default", {
|
|
3085
3091
|
field: e.field,
|
|
3086
3092
|
value: e.modelValue,
|
|
3087
3093
|
disabled: e.disabled,
|
|
3088
|
-
updateValue:
|
|
3089
|
-
}, void 0, !0, 10) : e.field.type === "text" ? (
|
|
3094
|
+
updateValue: W
|
|
3095
|
+
}, void 0, !0, 10) : e.field.type === "text" ? (B(), S(K(Ce), F({
|
|
3090
3096
|
key: 11,
|
|
3091
3097
|
"model-value": e.modelValue,
|
|
3092
3098
|
placeholder: g.value,
|
|
3093
3099
|
disabled: e.disabled,
|
|
3094
3100
|
clearable: ""
|
|
3095
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3101
|
+
}, f.value, { "onUpdate:modelValue": W }), null, 16, [
|
|
3096
3102
|
"model-value",
|
|
3097
3103
|
"placeholder",
|
|
3098
3104
|
"disabled"
|
|
3099
|
-
])) : e.field.type === "textarea" ? (
|
|
3105
|
+
])) : e.field.type === "textarea" ? (B(), S(K(Ce), F({
|
|
3100
3106
|
key: 12,
|
|
3101
3107
|
type: "textarea",
|
|
3102
3108
|
rows: 4,
|
|
3103
3109
|
"model-value": e.modelValue,
|
|
3104
3110
|
placeholder: g.value,
|
|
3105
3111
|
disabled: e.disabled
|
|
3106
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3112
|
+
}, f.value, { "onUpdate:modelValue": W }), null, 16, [
|
|
3107
3113
|
"model-value",
|
|
3108
3114
|
"placeholder",
|
|
3109
3115
|
"disabled"
|
|
3110
|
-
])) : e.field.type === "rich-text" ? (
|
|
3116
|
+
])) : e.field.type === "rich-text" ? (B(), S(K(s), F({
|
|
3111
3117
|
key: 13,
|
|
3112
3118
|
"model-value": e.modelValue,
|
|
3113
3119
|
placeholder: g.value
|
|
3114
|
-
},
|
|
3120
|
+
}, R.value, { "onUpdate:modelValue": W }), null, 16, ["model-value", "placeholder"])) : e.field.type === "number" ? (B(), S(K(we), F({
|
|
3115
3121
|
key: 14,
|
|
3116
3122
|
"model-value": e.modelValue,
|
|
3117
3123
|
placeholder: g.value,
|
|
3118
3124
|
disabled: e.disabled
|
|
3119
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3125
|
+
}, f.value, { "onUpdate:modelValue": W }), null, 16, [
|
|
3120
3126
|
"model-value",
|
|
3121
3127
|
"placeholder",
|
|
3122
3128
|
"disabled"
|
|
3123
|
-
])) : e.field.type === "cascader" ? (
|
|
3129
|
+
])) : e.field.type === "cascader" ? (B(), S(K(de), F({
|
|
3124
3130
|
key: 15,
|
|
3125
3131
|
"model-value": e.modelValue,
|
|
3126
3132
|
placeholder: g.value,
|
|
3127
3133
|
disabled: e.disabled,
|
|
3128
3134
|
filterable: ""
|
|
3129
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3135
|
+
}, f.value, { "onUpdate:modelValue": W }), null, 16, [
|
|
3130
3136
|
"model-value",
|
|
3131
3137
|
"placeholder",
|
|
3132
3138
|
"disabled"
|
|
3133
|
-
])) : e.field.type === "select" ? (
|
|
3139
|
+
])) : e.field.type === "select" ? (B(), S(K(i), F({
|
|
3134
3140
|
key: 16,
|
|
3135
3141
|
"model-value": e.modelValue,
|
|
3136
3142
|
placeholder: g.value,
|
|
3137
3143
|
disabled: e.disabled,
|
|
3138
|
-
fetcher:
|
|
3144
|
+
fetcher: oe,
|
|
3139
3145
|
"label-key": "label",
|
|
3140
3146
|
"value-key": "value"
|
|
3141
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3147
|
+
}, f.value, { "onUpdate:modelValue": W }), null, 16, [
|
|
3142
3148
|
"model-value",
|
|
3143
3149
|
"placeholder",
|
|
3144
3150
|
"disabled"
|
|
3145
|
-
])) : e.field.type === "radio" ? (
|
|
3151
|
+
])) : e.field.type === "radio" ? (B(), S(K(Ae), F({
|
|
3146
3152
|
key: 17,
|
|
3147
3153
|
"model-value": e.modelValue,
|
|
3148
3154
|
disabled: e.disabled
|
|
3149
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3150
|
-
default:
|
|
3155
|
+
}, f.value, { "onUpdate:modelValue": W }), {
|
|
3156
|
+
default: J(() => [(B(!0), w(b, null, H(K(u), (e) => (B(), S(K(ke), {
|
|
3151
3157
|
key: e.value,
|
|
3152
3158
|
value: e.value
|
|
3153
3159
|
}, {
|
|
3154
|
-
default:
|
|
3160
|
+
default: J(() => [D(G(e.label), 1)]),
|
|
3155
3161
|
_: 2
|
|
3156
3162
|
}, 1032, ["value"]))), 128))]),
|
|
3157
3163
|
_: 1
|
|
3158
|
-
}, 16, ["model-value", "disabled"])) : e.field.type === "checkbox" ? (
|
|
3164
|
+
}, 16, ["model-value", "disabled"])) : e.field.type === "checkbox" ? (B(), S(K(pe), F({
|
|
3159
3165
|
key: 18,
|
|
3160
3166
|
"model-value": e.modelValue,
|
|
3161
3167
|
disabled: e.disabled
|
|
3162
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3163
|
-
default:
|
|
3168
|
+
}, f.value, { "onUpdate:modelValue": W }), {
|
|
3169
|
+
default: J(() => [(B(!0), w(b, null, H(K(u), (e) => (B(), S(K(fe), {
|
|
3164
3170
|
key: e.value,
|
|
3165
3171
|
value: e.value
|
|
3166
3172
|
}, {
|
|
3167
|
-
default:
|
|
3173
|
+
default: J(() => [D(G(e.label), 1)]),
|
|
3168
3174
|
_: 2
|
|
3169
3175
|
}, 1032, ["value"]))), 128))]),
|
|
3170
3176
|
_: 1
|
|
3171
|
-
}, 16, ["model-value", "disabled"])) : e.field.type === "switch" ? (
|
|
3177
|
+
}, 16, ["model-value", "disabled"])) : e.field.type === "switch" ? (B(), S(K(Pe), F({
|
|
3172
3178
|
key: 19,
|
|
3173
3179
|
"model-value": e.modelValue,
|
|
3174
3180
|
disabled: e.disabled
|
|
3175
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3181
|
+
}, f.value, { "onUpdate:modelValue": W }), null, 16, ["model-value", "disabled"])) : e.field.type === "date" || e.field.type === "datetime" ? (B(), S(K(he), F({
|
|
3176
3182
|
key: 20,
|
|
3177
3183
|
type: e.field.type,
|
|
3178
3184
|
"model-value": e.modelValue,
|
|
3179
3185
|
placeholder: g.value,
|
|
3180
3186
|
disabled: e.disabled,
|
|
3181
3187
|
"value-format": e.field.type === "date" ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss"
|
|
3182
|
-
}, f.value, { "onUpdate:modelValue":
|
|
3188
|
+
}, f.value, { "onUpdate:modelValue": W }), null, 16, [
|
|
3183
3189
|
"type",
|
|
3184
3190
|
"model-value",
|
|
3185
3191
|
"placeholder",
|
|
3186
3192
|
"disabled",
|
|
3187
3193
|
"value-format"
|
|
3188
|
-
])) : e.field.type === "async-select" && (
|
|
3189
|
-
key:
|
|
3194
|
+
])) : e.field.type === "async-select" && (ne.value || e.field.optionSource === "dict") ? (B(), S(K(i), F({
|
|
3195
|
+
key: V.value,
|
|
3190
3196
|
"model-value": e.modelValue,
|
|
3191
3197
|
placeholder: g.value,
|
|
3192
3198
|
disabled: e.disabled,
|
|
3193
|
-
fetcher:
|
|
3194
|
-
options:
|
|
3199
|
+
fetcher: ee.value ? ae : void 0,
|
|
3200
|
+
options: ee.value ? void 0 : K(u)
|
|
3195
3201
|
}, {
|
|
3196
|
-
...
|
|
3202
|
+
...ne.value,
|
|
3197
3203
|
...f.value
|
|
3198
|
-
}, { "onUpdate:modelValue":
|
|
3204
|
+
}, { "onUpdate:modelValue": W }), null, 16, [
|
|
3199
3205
|
"model-value",
|
|
3200
3206
|
"placeholder",
|
|
3201
3207
|
"disabled",
|
|
3202
3208
|
"fetcher",
|
|
3203
3209
|
"options"
|
|
3204
|
-
])) : (
|
|
3210
|
+
])) : (B(), S(Wr, {
|
|
3205
3211
|
key: 22,
|
|
3206
3212
|
value: e.modelValue
|
|
3207
|
-
}, null, 8, ["value"])), e.field.tip ? (
|
|
3213
|
+
}, null, 8, ["value"])), e.field.tip ? (B(), w("div", si, G(e.field.tip), 1)) : C("", !0)]),
|
|
3208
3214
|
_: 3
|
|
3209
3215
|
}, 8, [
|
|
3210
3216
|
"class",
|
|
@@ -3257,7 +3263,7 @@ var oi = {
|
|
|
3257
3263
|
}),
|
|
3258
3264
|
emits: /*@__PURE__*/ P(["field-change"], ["update:modelValue"]),
|
|
3259
3265
|
setup(e, { expose: t, emit: n }) {
|
|
3260
|
-
let r = e, i = n, a =
|
|
3266
|
+
let r = e, i = n, a = oe(e, "modelValue"), o = V(), s = {
|
|
3261
3267
|
behavior: "smooth",
|
|
3262
3268
|
block: "center"
|
|
3263
3269
|
}, l = x(() => r.schema), u = x(() => ({
|
|
@@ -3304,7 +3310,7 @@ var oi = {
|
|
|
3304
3310
|
[e.prop]: t
|
|
3305
3311
|
}, i("field-change", e, t);
|
|
3306
3312
|
}
|
|
3307
|
-
|
|
3313
|
+
q([l, a], () => {
|
|
3308
3314
|
let e = a.value ?? {}, t = {};
|
|
3309
3315
|
for (let n of Mr(l.value)) n.defaultValue !== void 0 && !(n.prop in e) && (t[n.prop] = n.defaultValue);
|
|
3310
3316
|
Object.keys(t).length > 0 && (a.value = {
|
|
@@ -3318,7 +3324,7 @@ var oi = {
|
|
|
3318
3324
|
return await o.value.validate(), !0;
|
|
3319
3325
|
} catch (e) {
|
|
3320
3326
|
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;
|
|
3321
|
-
return n && (await
|
|
3327
|
+
return n && (await I(), o.value?.scrollToField(n)), !1;
|
|
3322
3328
|
}
|
|
3323
3329
|
}
|
|
3324
3330
|
return t({
|
|
@@ -3327,39 +3333,39 @@ var oi = {
|
|
|
3327
3333
|
resetFields: () => o.value?.resetFields(),
|
|
3328
3334
|
getValues: () => Object.fromEntries(p.value.map((e) => [e.prop, a.value?.[e.prop]]))
|
|
3329
3335
|
}), (t, n) => {
|
|
3330
|
-
let r =
|
|
3331
|
-
return
|
|
3336
|
+
let r = ne("loading");
|
|
3337
|
+
return B(), w("div", li, [ce((B(), S(K(be), {
|
|
3332
3338
|
ref_key: "formRef",
|
|
3333
3339
|
ref: o,
|
|
3334
|
-
class:
|
|
3335
|
-
style:
|
|
3340
|
+
class: L(["schema-form", h.value]),
|
|
3341
|
+
style: z(v.value),
|
|
3336
3342
|
model: a.value,
|
|
3337
3343
|
"label-width": e.labelWidth,
|
|
3338
3344
|
"label-position": g.value,
|
|
3339
3345
|
"scroll-into-view-options": s
|
|
3340
3346
|
}, {
|
|
3341
|
-
default:
|
|
3342
|
-
default:
|
|
3347
|
+
default: J(() => [O(K(je), { gutter: 16 }, {
|
|
3348
|
+
default: J(() => [(B(!0), w(b, null, H(d.value, (e, n) => (B(), w(b, { key: y(e, n) }, [e.newRow ? (B(), w("div", ui)) : C("", !0), O(K(me), {
|
|
3343
3349
|
span: e.span ?? (e.type === "group" ? 24 : m.value),
|
|
3344
|
-
class:
|
|
3350
|
+
class: L({
|
|
3345
3351
|
"schema-form-col--anchor-group": e.type === "group" && e.anchor,
|
|
3346
3352
|
"schema-form-col--group-divider": e.type === "group" && n > 0
|
|
3347
3353
|
})
|
|
3348
3354
|
}, {
|
|
3349
|
-
default:
|
|
3355
|
+
default: J(() => [e.type === "group" ? (B(), S(K(xe), {
|
|
3350
3356
|
key: 0,
|
|
3351
|
-
class:
|
|
3357
|
+
class: L(["schema-form-group", { "schema-form-group--anchor": e.anchor }]),
|
|
3352
3358
|
"data-form-anchor": e.anchor ? l.value.indexOf(e) : void 0,
|
|
3353
3359
|
label: e.label
|
|
3354
3360
|
}, {
|
|
3355
|
-
label:
|
|
3356
|
-
T("span", fi,
|
|
3357
|
-
T("span", pi, [T("strong", null,
|
|
3358
|
-
D(e) ? (
|
|
3359
|
-
])) : (
|
|
3360
|
-
default:
|
|
3361
|
+
label: J(() => [e.anchor ? (B(), w("div", di, [
|
|
3362
|
+
T("span", fi, G(k(e)), 1),
|
|
3363
|
+
T("span", pi, [T("strong", null, G(e.label), 1), e.description ? (B(), w("small", mi, G(e.description), 1)) : C("", !0)]),
|
|
3364
|
+
D(e) ? (B(), w("span", hi, G(K(c)("schemaForm.requiredNote")), 1)) : C("", !0)
|
|
3365
|
+
])) : (B(), w("span", gi, G(e.label), 1))]),
|
|
3366
|
+
default: J(() => [T("div", { class: L(["schema-form-group__body", { "schema-form-group__body--grid": e.anchor }]) }, [(B(!0), w(b, null, H(f(e), (n) => (B(), S(ci, {
|
|
3361
3367
|
key: n.prop,
|
|
3362
|
-
style:
|
|
3368
|
+
style: z(E(n, e.anchor)),
|
|
3363
3369
|
"hide-label": !e.anchor,
|
|
3364
3370
|
field: n,
|
|
3365
3371
|
context: u.value,
|
|
@@ -3369,7 +3375,7 @@ var oi = {
|
|
|
3369
3375
|
readonly: j(n),
|
|
3370
3376
|
"onUpdate:modelValue": (e) => M(n, e)
|
|
3371
3377
|
}, {
|
|
3372
|
-
default:
|
|
3378
|
+
default: J((e) => [U(t.$slots, n.prop, F({ ref_for: !0 }, e), void 0, !0)]),
|
|
3373
3379
|
_: 2
|
|
3374
3380
|
}, 1032, [
|
|
3375
3381
|
"style",
|
|
@@ -3381,13 +3387,13 @@ var oi = {
|
|
|
3381
3387
|
"disabled",
|
|
3382
3388
|
"readonly",
|
|
3383
3389
|
"onUpdate:modelValue"
|
|
3384
|
-
]))), 128))], 2), e.tip ? (
|
|
3390
|
+
]))), 128))], 2), e.tip ? (B(), w("div", _i, G(e.tip), 1)) : C("", !0)]),
|
|
3385
3391
|
_: 2
|
|
3386
3392
|
}, 1032, [
|
|
3387
3393
|
"class",
|
|
3388
3394
|
"data-form-anchor",
|
|
3389
3395
|
"label"
|
|
3390
|
-
])) : (
|
|
3396
|
+
])) : (B(), S(ci, {
|
|
3391
3397
|
key: 1,
|
|
3392
3398
|
field: e,
|
|
3393
3399
|
context: u.value,
|
|
@@ -3397,7 +3403,7 @@ var oi = {
|
|
|
3397
3403
|
readonly: j(e),
|
|
3398
3404
|
"onUpdate:modelValue": (t) => M(e, t)
|
|
3399
3405
|
}, {
|
|
3400
|
-
default:
|
|
3406
|
+
default: J((n) => [U(t.$slots, e.prop, F({ ref_for: !0 }, n), void 0, !0)]),
|
|
3401
3407
|
_: 2
|
|
3402
3408
|
}, 1032, [
|
|
3403
3409
|
"field",
|
|
@@ -3449,7 +3455,7 @@ var oi = {
|
|
|
3449
3455
|
}),
|
|
3450
3456
|
emits: /*@__PURE__*/ P(["reset", "search"], ["update:modelValue"]),
|
|
3451
3457
|
setup(e, { expose: t, emit: n }) {
|
|
3452
|
-
let r = e, i = n, a =
|
|
3458
|
+
let r = e, i = n, a = oe(e, "modelValue"), o = se(), s = V(!1), l = V(), u = /* @__PURE__ */ new Set([
|
|
3453
3459
|
"async-select",
|
|
3454
3460
|
"cascader",
|
|
3455
3461
|
"select"
|
|
@@ -3478,7 +3484,7 @@ var oi = {
|
|
|
3478
3484
|
t?.tagName === "INPUT" && (t.closest(".async-select, .el-select, .el-cascader, .el-date-editor") || (e.preventDefault(), k()));
|
|
3479
3485
|
}
|
|
3480
3486
|
async function M(e) {
|
|
3481
|
-
u.has(e.type) && (await
|
|
3487
|
+
u.has(e.type) && (await I(), k());
|
|
3482
3488
|
}
|
|
3483
3489
|
function N() {
|
|
3484
3490
|
a.value = b(), i("reset", T());
|
|
@@ -3486,16 +3492,16 @@ var oi = {
|
|
|
3486
3492
|
async function P() {
|
|
3487
3493
|
return await l.value?.validate() ?? !1;
|
|
3488
3494
|
}
|
|
3489
|
-
return
|
|
3495
|
+
return q(h, (e) => {
|
|
3490
3496
|
e || (s.value = !1);
|
|
3491
3497
|
}), t({
|
|
3492
3498
|
getValues: T,
|
|
3493
3499
|
validate: P,
|
|
3494
3500
|
reset: N,
|
|
3495
3501
|
search: k
|
|
3496
|
-
}), (t, n) => (
|
|
3502
|
+
}), (t, n) => (B(), w("form", {
|
|
3497
3503
|
class: "search-form",
|
|
3498
|
-
onKeydown:
|
|
3504
|
+
onKeydown: le(A, ["enter"]),
|
|
3499
3505
|
onSubmit: Y(k, ["prevent"])
|
|
3500
3506
|
}, [O(vi, {
|
|
3501
3507
|
ref_key: "schemaFormRef",
|
|
@@ -3512,9 +3518,9 @@ var oi = {
|
|
|
3512
3518
|
"label-width": e.labelWidth,
|
|
3513
3519
|
"item-gap": 12,
|
|
3514
3520
|
onFieldChange: M
|
|
3515
|
-
}, E({ _: 2 }, [
|
|
3521
|
+
}, E({ _: 2 }, [H(_.value, (e) => ({
|
|
3516
3522
|
name: e,
|
|
3517
|
-
fn:
|
|
3523
|
+
fn: J((n) => [U(t.$slots, e, R(j(n)), void 0, !0)])
|
|
3518
3524
|
}))]), 1032, [
|
|
3519
3525
|
"modelValue",
|
|
3520
3526
|
"columns",
|
|
@@ -3524,30 +3530,30 @@ var oi = {
|
|
|
3524
3530
|
"label-align",
|
|
3525
3531
|
"label-position",
|
|
3526
3532
|
"label-width"
|
|
3527
|
-
]), e.showActions ? (
|
|
3528
|
-
O(
|
|
3533
|
+
]), e.showActions ? (B(), w("div", yi, [
|
|
3534
|
+
O(K(X), {
|
|
3529
3535
|
type: "primary",
|
|
3530
3536
|
"native-type": "submit"
|
|
3531
3537
|
}, {
|
|
3532
|
-
default:
|
|
3538
|
+
default: J(() => [D(G(K(c)("components.searchForm.search")), 1)]),
|
|
3533
3539
|
_: 1
|
|
3534
3540
|
}),
|
|
3535
|
-
O(
|
|
3541
|
+
O(K(X), {
|
|
3536
3542
|
"native-type": "button",
|
|
3537
3543
|
onClick: N
|
|
3538
3544
|
}, {
|
|
3539
|
-
default:
|
|
3545
|
+
default: J(() => [D(G(K(c)("components.searchForm.reset")), 1)]),
|
|
3540
3546
|
_: 1
|
|
3541
3547
|
}),
|
|
3542
|
-
h.value ? (
|
|
3548
|
+
h.value ? (B(), S(K(X), {
|
|
3543
3549
|
key: 0,
|
|
3544
3550
|
link: "",
|
|
3545
3551
|
type: "primary",
|
|
3546
3552
|
"native-type": "button",
|
|
3547
|
-
icon: s.value ?
|
|
3553
|
+
icon: s.value ? K(Je) : K(Ke),
|
|
3548
3554
|
onClick: n[1] ||= (e) => s.value = !s.value
|
|
3549
3555
|
}, {
|
|
3550
|
-
default:
|
|
3556
|
+
default: J(() => [D(G(s.value ? K(c)("components.searchForm.collapse") : K(c)("components.searchForm.expand")), 1)]),
|
|
3551
3557
|
_: 1
|
|
3552
3558
|
}, 8, ["icon"])) : C("", !0)
|
|
3553
3559
|
])) : C("", !0)], 32));
|
|
@@ -3630,12 +3636,12 @@ var oi = {
|
|
|
3630
3636
|
let l = e, u = r, [d, f] = t({
|
|
3631
3637
|
fullscreenButton: !1,
|
|
3632
3638
|
zIndex: 3e3,
|
|
3633
|
-
onCancel: () =>
|
|
3634
|
-
onConfirm: () =>
|
|
3639
|
+
onCancel: () => ee(),
|
|
3640
|
+
onConfirm: () => te(),
|
|
3635
3641
|
onOpenChange: (e) => {
|
|
3636
3642
|
e !== l.visible && u("update:visible", e);
|
|
3637
3643
|
}
|
|
3638
|
-
}), p =
|
|
3644
|
+
}), p = V(), m = x(() => l.columns.map((e) => s(e)).filter((e) => !!e)), h = x(() => m.value.length > 0), g = V({}), _ = V({}), v = V(1), y = V(l.perPage), b = V([]), E = x(() => [
|
|
3639
3645
|
"__dialog-list__",
|
|
3640
3646
|
l.rowKey,
|
|
3641
3647
|
v.value,
|
|
@@ -3658,13 +3664,13 @@ var oi = {
|
|
|
3658
3664
|
refetchOnMount: !1,
|
|
3659
3665
|
refetchOnReconnect: !1
|
|
3660
3666
|
}), A = x(() => D.value?.items ?? []), j = x(() => D.value?.total ?? 0);
|
|
3661
|
-
|
|
3667
|
+
q(() => l.visible, (e) => {
|
|
3662
3668
|
if (!e) {
|
|
3663
3669
|
f.close();
|
|
3664
3670
|
return;
|
|
3665
3671
|
}
|
|
3666
3672
|
let t = Array.isArray(l.modelValue) ? l.modelValue : l.modelValue == null ? [] : [l.modelValue];
|
|
3667
|
-
b.value = t, g.value = {}, _.value = {}, v.value = 1, y.value = l.perPage,
|
|
3673
|
+
b.value = t, g.value = {}, _.value = {}, v.value = 1, y.value = l.perPage, I = [], f.open();
|
|
3668
3674
|
}, { immediate: !0 });
|
|
3669
3675
|
function M(e) {
|
|
3670
3676
|
_.value = Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
@@ -3675,30 +3681,30 @@ var oi = {
|
|
|
3675
3681
|
function P(e) {
|
|
3676
3682
|
y.value = e, v.value = 1;
|
|
3677
3683
|
}
|
|
3678
|
-
let F = x(() => b.value.length),
|
|
3679
|
-
function
|
|
3684
|
+
let F = x(() => b.value.length), I = [];
|
|
3685
|
+
function R(e) {
|
|
3680
3686
|
b.value = e;
|
|
3681
3687
|
}
|
|
3682
|
-
function
|
|
3683
|
-
|
|
3688
|
+
function z(e) {
|
|
3689
|
+
I = e;
|
|
3684
3690
|
}
|
|
3685
|
-
function
|
|
3691
|
+
function ee() {
|
|
3686
3692
|
f.close();
|
|
3687
3693
|
}
|
|
3688
|
-
function
|
|
3689
|
-
let e =
|
|
3694
|
+
function te() {
|
|
3695
|
+
let e = I.length > 0 ? I : p.value?.getSelectedRows() ?? [], t = l.multiple ? [...b.value] : b.value[0] ?? null;
|
|
3690
3696
|
u("update:modelValue", t), u("confirm", e), f.close();
|
|
3691
3697
|
}
|
|
3692
3698
|
return n({ tableRef: p }), (t, n) => {
|
|
3693
|
-
let r =
|
|
3694
|
-
return
|
|
3695
|
-
title: e.dialogTitle ||
|
|
3696
|
-
class:
|
|
3697
|
-
"cancel-text":
|
|
3698
|
-
"confirm-text":
|
|
3699
|
+
let r = ne("loading");
|
|
3700
|
+
return B(), S(K(d), {
|
|
3701
|
+
title: e.dialogTitle || K(c)("components.asyncSelect.placeholder"),
|
|
3702
|
+
class: L(`dialog-list__modal w-[${e.dialogWidth}]`),
|
|
3703
|
+
"cancel-text": K(c)("components.dialogList.cancel"),
|
|
3704
|
+
"confirm-text": K(c)("components.dialogList.confirm")
|
|
3699
3705
|
}, {
|
|
3700
|
-
default:
|
|
3701
|
-
h.value ? (
|
|
3706
|
+
default: J(() => [T("div", xi, [
|
|
3707
|
+
h.value ? (B(), S(K(bi), {
|
|
3702
3708
|
key: 0,
|
|
3703
3709
|
modelValue: g.value,
|
|
3704
3710
|
"onUpdate:modelValue": n[0] ||= (e) => g.value = e,
|
|
@@ -3706,8 +3712,8 @@ var oi = {
|
|
|
3706
3712
|
onSearch: M,
|
|
3707
3713
|
onReset: M
|
|
3708
3714
|
}, null, 8, ["modelValue", "schema"])) : C("", !0),
|
|
3709
|
-
T("div", Si, [F.value > 0 ? (
|
|
3710
|
-
|
|
3715
|
+
T("div", Si, [F.value > 0 ? (B(), w("span", Ci, G(K(c)("components.dialogList.selectedCount", { count: F.value })), 1)) : C("", !0)]),
|
|
3716
|
+
ce((B(), w("div", wi, [O(Or, {
|
|
3711
3717
|
ref_key: "tableRef",
|
|
3712
3718
|
ref: p,
|
|
3713
3719
|
columns: e.columns,
|
|
@@ -3722,9 +3728,9 @@ var oi = {
|
|
|
3722
3728
|
total: j.value,
|
|
3723
3729
|
per_page: y.value,
|
|
3724
3730
|
current_page: v.value,
|
|
3725
|
-
"onUpdate:selectedKeys":
|
|
3731
|
+
"onUpdate:selectedKeys": R,
|
|
3726
3732
|
"onUpdate:per_page": P,
|
|
3727
|
-
onSelectionChange:
|
|
3733
|
+
onSelectionChange: z,
|
|
3728
3734
|
onPageChange: N
|
|
3729
3735
|
}, null, 8, [
|
|
3730
3736
|
"columns",
|
|
@@ -3736,7 +3742,7 @@ var oi = {
|
|
|
3736
3742
|
"total",
|
|
3737
3743
|
"per_page",
|
|
3738
3744
|
"current_page"
|
|
3739
|
-
])])), [[r,
|
|
3745
|
+
])])), [[r, K(k)]])
|
|
3740
3746
|
])]),
|
|
3741
3747
|
_: 1
|
|
3742
3748
|
}, 8, [
|
|
@@ -3800,7 +3806,7 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
3800
3806
|
if (r.labelKey) return r.labelKey;
|
|
3801
3807
|
let e = r.columns?.[0];
|
|
3802
3808
|
return e?.dataKey ? e.dataKey : "label";
|
|
3803
|
-
}), l =
|
|
3809
|
+
}), l = V([]), u = V([]), d = V(0), f = V(!1), p = V(!0), m = V(""), h = V(!1), g = x(() => typeof r.fetcher == "function"), _ = /* @__PURE__ */ new Map(), v = null, y = x({
|
|
3804
3810
|
get: () => r.modelValue,
|
|
3805
3811
|
set: (e) => i("update:modelValue", e)
|
|
3806
3812
|
}), b = x(() => Array.isArray(r.modelValue) ? r.modelValue.filter((e) => e != null) : r.modelValue == null ? [] : [r.modelValue]);
|
|
@@ -3841,7 +3847,7 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
3841
3847
|
u.value.find((t) => j(t.value, e.value)) || u.value.push(e);
|
|
3842
3848
|
}
|
|
3843
3849
|
}
|
|
3844
|
-
let
|
|
3850
|
+
let I = x(() => {
|
|
3845
3851
|
let e = l.value.map((e) => {
|
|
3846
3852
|
let t = A(e);
|
|
3847
3853
|
return {
|
|
@@ -3854,10 +3860,10 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
3854
3860
|
})).filter((t) => b.value.some((e) => j(e, t.value)) && !e.find((e) => j(e.value, t.value)));
|
|
3855
3861
|
return [...e, ...t];
|
|
3856
3862
|
});
|
|
3857
|
-
|
|
3863
|
+
q(o, (e) => {
|
|
3858
3864
|
g.value || (l.value = e ?? [], p.value = !1);
|
|
3859
3865
|
}, { immediate: !0 });
|
|
3860
|
-
async function
|
|
3866
|
+
async function R(e = !1) {
|
|
3861
3867
|
let t = m.value || void 0, n = t ?? "";
|
|
3862
3868
|
if (!e && v === n) return;
|
|
3863
3869
|
let r = _.get(n);
|
|
@@ -3866,7 +3872,7 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
3866
3872
|
return;
|
|
3867
3873
|
}
|
|
3868
3874
|
d.value = 1, l.value = [], p.value = !0;
|
|
3869
|
-
let i =
|
|
3875
|
+
let i = ee(1, t);
|
|
3870
3876
|
_.set(n, i);
|
|
3871
3877
|
try {
|
|
3872
3878
|
await i, (m.value || void 0) === t && (v = n);
|
|
@@ -3874,10 +3880,10 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
3874
3880
|
_.get(n) === i && _.delete(n);
|
|
3875
3881
|
}
|
|
3876
3882
|
}
|
|
3877
|
-
async function
|
|
3878
|
-
!f.value && p.value && await
|
|
3883
|
+
async function z() {
|
|
3884
|
+
!f.value && p.value && await ee(d.value + 1);
|
|
3879
3885
|
}
|
|
3880
|
-
async function
|
|
3886
|
+
async function ee(e, t = m.value || void 0) {
|
|
3881
3887
|
if (r.fetcher) {
|
|
3882
3888
|
f.value = !0;
|
|
3883
3889
|
try {
|
|
@@ -3894,10 +3900,10 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
3894
3900
|
}
|
|
3895
3901
|
}
|
|
3896
3902
|
}
|
|
3897
|
-
async function
|
|
3898
|
-
h.value = e, e && g.value && l.value.length === 0 && await
|
|
3903
|
+
async function te(e) {
|
|
3904
|
+
h.value = e, e && g.value && l.value.length === 0 && await R();
|
|
3899
3905
|
}
|
|
3900
|
-
|
|
3906
|
+
q([b, o], async ([e, t]) => {
|
|
3901
3907
|
e.length === 0 ? u.value = [] : (P(t.filter((t) => e.some((e) => j(e, E(t)))).map(A)), g.value && r.fetcher && P(await Ei({
|
|
3902
3908
|
activeValues: e,
|
|
3903
3909
|
selectedValues: u.value.map((e) => e.value),
|
|
@@ -3910,16 +3916,16 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
3910
3916
|
toOption: A
|
|
3911
3917
|
})));
|
|
3912
3918
|
}, { immediate: !0 });
|
|
3913
|
-
let
|
|
3914
|
-
function
|
|
3915
|
-
r.disabled || (
|
|
3919
|
+
let H = V(!1);
|
|
3920
|
+
function U() {
|
|
3921
|
+
r.disabled || (H.value = !0);
|
|
3916
3922
|
}
|
|
3917
|
-
function
|
|
3923
|
+
function ne(e) {
|
|
3918
3924
|
P(e.map(A));
|
|
3919
3925
|
let t = r.multiple ? e.map((e) => E(e)) : e[0] ? E(e[0]) : null;
|
|
3920
3926
|
i("update:modelValue", t), i("change", t, e);
|
|
3921
3927
|
}
|
|
3922
|
-
async function
|
|
3928
|
+
async function re(e) {
|
|
3923
3929
|
if (r.fetcher) {
|
|
3924
3930
|
let t = await r.fetcher(e);
|
|
3925
3931
|
return {
|
|
@@ -3933,16 +3939,16 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
3933
3939
|
total: n.length
|
|
3934
3940
|
};
|
|
3935
3941
|
}
|
|
3936
|
-
let
|
|
3942
|
+
let W = x(() => r.placeholder || c("components.asyncSelect.placeholder")), ie = x(() => r.dialogTitle || c("components.asyncSelect.placeholder"));
|
|
3937
3943
|
return t({
|
|
3938
|
-
reload: () =>
|
|
3944
|
+
reload: () => R(!0),
|
|
3939
3945
|
allItems: l
|
|
3940
|
-
}), (t, n) => (
|
|
3941
|
-
O(
|
|
3946
|
+
}), (t, n) => (B(), w("div", Di, [
|
|
3947
|
+
O(K(Ne), F({
|
|
3942
3948
|
modelValue: y.value,
|
|
3943
3949
|
"onUpdate:modelValue": n[0] ||= (e) => y.value = e,
|
|
3944
3950
|
class: "async-select__select",
|
|
3945
|
-
options:
|
|
3951
|
+
options: I.value,
|
|
3946
3952
|
loading: f.value,
|
|
3947
3953
|
multiple: e.multiple,
|
|
3948
3954
|
filterable: "",
|
|
@@ -3950,26 +3956,26 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
3950
3956
|
remote: g.value,
|
|
3951
3957
|
"remote-show-suffix": "",
|
|
3952
3958
|
"remote-method": g.value ? (e) => {
|
|
3953
|
-
m.value !== e && (m.value = e, N(v) ? v.value = null : v = null),
|
|
3959
|
+
m.value !== e && (m.value = e, N(v) ? v.value = null : v = null), R();
|
|
3954
3960
|
} : void 0,
|
|
3955
|
-
placeholder:
|
|
3961
|
+
placeholder: W.value,
|
|
3956
3962
|
disabled: e.disabled
|
|
3957
3963
|
}, t.$attrs, {
|
|
3958
|
-
onVisibleChange:
|
|
3959
|
-
onEndReached:
|
|
3964
|
+
onVisibleChange: te,
|
|
3965
|
+
onEndReached: z
|
|
3960
3966
|
}), {
|
|
3961
|
-
label:
|
|
3967
|
+
label: J((e) => [T("span", Oi, [e?.label?.flag ? (B(), w("img", {
|
|
3962
3968
|
key: 0,
|
|
3963
3969
|
class: "async-select__flag",
|
|
3964
3970
|
src: e.label.flag,
|
|
3965
3971
|
alt: ""
|
|
3966
|
-
}, null, 8, ki)) : C("", !0), T("span", Ai,
|
|
3967
|
-
default:
|
|
3972
|
+
}, null, 8, ki)) : C("", !0), T("span", Ai, G(e?.label?.label ?? ""), 1)])]),
|
|
3973
|
+
default: J((e) => [e?.item ? (B(), w("div", ji, [T("p", Mi, [e.item.label.flag ? (B(), w("img", {
|
|
3968
3974
|
key: 0,
|
|
3969
3975
|
class: "async-select__flag",
|
|
3970
3976
|
src: e.item.label.flag,
|
|
3971
3977
|
alt: ""
|
|
3972
|
-
}, null, 8, Ni)) : C("", !0), T("span", Pi,
|
|
3978
|
+
}, null, 8, Ni)) : C("", !0), T("span", Pi, G(e.item.label.label), 1)]), e.item.label.subtitle ? (B(), w("p", Fi, G(e.item.label.subtitle), 1)) : C("", !0)])) : C("", !0)]),
|
|
3973
3979
|
_: 1
|
|
3974
3980
|
}, 16, [
|
|
3975
3981
|
"modelValue",
|
|
@@ -3981,32 +3987,32 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
3981
3987
|
"placeholder",
|
|
3982
3988
|
"disabled"
|
|
3983
3989
|
]),
|
|
3984
|
-
e.columns.length > 0 ? (
|
|
3990
|
+
e.columns.length > 0 ? (B(), w("button", {
|
|
3985
3991
|
key: 0,
|
|
3986
3992
|
type: "button",
|
|
3987
|
-
class:
|
|
3988
|
-
title:
|
|
3993
|
+
class: L(["async-select__inner-trigger", { "is-disabled": e.disabled }]),
|
|
3994
|
+
title: K(c)("components.asyncSelect.dialogSelect"),
|
|
3989
3995
|
onMousedown: n[1] ||= Y(() => {}, ["prevent"]),
|
|
3990
|
-
onClick: Y(
|
|
3991
|
-
}, [O(
|
|
3992
|
-
default:
|
|
3993
|
-
src:
|
|
3994
|
-
alt:
|
|
3996
|
+
onClick: Y(U, ["stop"])
|
|
3997
|
+
}, [O(K(Z), null, {
|
|
3998
|
+
default: J(() => [T("img", {
|
|
3999
|
+
src: K(vt),
|
|
4000
|
+
alt: K(c)("components.asyncSelect.more")
|
|
3995
4001
|
}, null, 8, Li)]),
|
|
3996
4002
|
_: 1
|
|
3997
4003
|
})], 42, Ii)) : C("", !0),
|
|
3998
|
-
e.columns.length > 0 ? (
|
|
4004
|
+
e.columns.length > 0 ? (B(), S(Ti, {
|
|
3999
4005
|
key: 1,
|
|
4000
|
-
visible:
|
|
4006
|
+
visible: H.value,
|
|
4001
4007
|
columns: e.columns,
|
|
4002
4008
|
"model-value": e.modelValue,
|
|
4003
4009
|
multiple: e.multiple,
|
|
4004
|
-
fetcher: (e) =>
|
|
4010
|
+
fetcher: (e) => re(e),
|
|
4005
4011
|
"row-key": e.valueKey,
|
|
4006
|
-
"dialog-title":
|
|
4012
|
+
"dialog-title": ie.value,
|
|
4007
4013
|
"per-page": e.perPage,
|
|
4008
|
-
"onUpdate:visible": n[2] ||= (e) =>
|
|
4009
|
-
onConfirm:
|
|
4014
|
+
"onUpdate:visible": n[2] ||= (e) => H.value = e,
|
|
4015
|
+
onConfirm: ne
|
|
4010
4016
|
}, null, 8, [
|
|
4011
4017
|
"visible",
|
|
4012
4018
|
"columns",
|
|
@@ -4026,9 +4032,9 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
4026
4032
|
__name: "index",
|
|
4027
4033
|
setup(e) {
|
|
4028
4034
|
let t = x(() => Vi.theme.cardShadow);
|
|
4029
|
-
return (e, n) => (
|
|
4035
|
+
return (e, n) => (B(), S(K(ue), F({ class: "box-card" }, e.$attrs, { shadow: t.value }), E({ _: 2 }, [H(e.$slots, (t, n) => ({
|
|
4030
4036
|
name: n,
|
|
4031
|
-
fn:
|
|
4037
|
+
fn: J((t) => [U(e.$slots, n, R(j(t ?? {})), void 0, !0)])
|
|
4032
4038
|
}))]), 1040, ["shadow"]));
|
|
4033
4039
|
}
|
|
4034
4040
|
}), [["__scopeId", "data-v-ed977a22"]]), Ui = { class: "drawer-form-page__header" }, Wi = { class: "drawer-form-page__header-main" }, Gi = { class: "drawer-form-page__title-stack" }, Ki = { class: "drawer-form-page__title" }, qi = { class: "drawer-form-page__header-actions" }, Ji = { class: "drawer-form-page__status" }, Yi = {
|
|
@@ -4119,7 +4125,7 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
4119
4125
|
"closed"
|
|
4120
4126
|
],
|
|
4121
4127
|
setup(e, { expose: t, emit: n }) {
|
|
4122
|
-
let r = e, i = n, a =
|
|
4128
|
+
let r = e, i = n, a = V(0), o = se(), s = V(), c = V(), l = V(r.fullscreen), u = x({
|
|
4123
4129
|
get: () => r.modelValue,
|
|
4124
4130
|
set: (e) => i("update:modelValue", e)
|
|
4125
4131
|
}), d = x({
|
|
@@ -4137,14 +4143,14 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
4137
4143
|
entry: e,
|
|
4138
4144
|
index: t
|
|
4139
4145
|
})).filter(({ entry: e }) => e.type === "group" && e.anchor));
|
|
4140
|
-
|
|
4146
|
+
q(() => r.fullscreen, (e) => {
|
|
4141
4147
|
l.value = e;
|
|
4142
4148
|
});
|
|
4143
4149
|
function y() {
|
|
4144
4150
|
l.value = !l.value, i("update:fullscreen", l.value);
|
|
4145
4151
|
}
|
|
4146
4152
|
async function k(e) {
|
|
4147
|
-
await
|
|
4153
|
+
await I(), (c.value?.querySelector(`[data-form-anchor="${e}"]`))?.scrollIntoView({
|
|
4148
4154
|
behavior: "smooth",
|
|
4149
4155
|
block: "start"
|
|
4150
4156
|
});
|
|
@@ -4161,19 +4167,19 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
4161
4167
|
function P() {
|
|
4162
4168
|
return s.value?.getValues() ?? {};
|
|
4163
4169
|
}
|
|
4164
|
-
async function
|
|
4170
|
+
async function z() {
|
|
4165
4171
|
return r.mode === "view" || r.submitting || r.loading || !await N() ? !1 : (i("submit", P()), !0);
|
|
4166
4172
|
}
|
|
4167
|
-
function
|
|
4173
|
+
function ee() {
|
|
4168
4174
|
s.value?.resetFields();
|
|
4169
4175
|
}
|
|
4170
|
-
function
|
|
4176
|
+
function te() {
|
|
4171
4177
|
i("closed");
|
|
4172
4178
|
}
|
|
4173
|
-
function
|
|
4179
|
+
function re() {
|
|
4174
4180
|
a.value = v.value[0]?.index ?? 0, i("open");
|
|
4175
4181
|
}
|
|
4176
|
-
function
|
|
4182
|
+
function W() {
|
|
4177
4183
|
let e = c.value;
|
|
4178
4184
|
if (!e) return;
|
|
4179
4185
|
let t = e.getBoundingClientRect().top, n = v.value[0]?.index ?? 0;
|
|
@@ -4186,13 +4192,13 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
4186
4192
|
return t({
|
|
4187
4193
|
close: A,
|
|
4188
4194
|
getValues: P,
|
|
4189
|
-
resetFields:
|
|
4190
|
-
submit:
|
|
4195
|
+
resetFields: ee,
|
|
4196
|
+
submit: z,
|
|
4191
4197
|
toggleFullscreen: y,
|
|
4192
4198
|
validate: N
|
|
4193
4199
|
}), (e, t) => {
|
|
4194
|
-
let n =
|
|
4195
|
-
return
|
|
4200
|
+
let n = ne("loading");
|
|
4201
|
+
return B(), S(K(ge), F({
|
|
4196
4202
|
modelValue: u.value,
|
|
4197
4203
|
"onUpdate:modelValue": t[1] ||= (e) => u.value = e
|
|
4198
4204
|
}, r.drawerProps, {
|
|
@@ -4205,58 +4211,58 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
4205
4211
|
"append-to-body": r.appendToBody,
|
|
4206
4212
|
"lock-scroll": r.lockScroll,
|
|
4207
4213
|
class: ["drawer-form-page", { "drawer-form-page--fullscreen": f.value }],
|
|
4208
|
-
onOpen:
|
|
4209
|
-
onClosed:
|
|
4214
|
+
onOpen: re,
|
|
4215
|
+
onClosed: te
|
|
4210
4216
|
}), E({
|
|
4211
|
-
header:
|
|
4217
|
+
header: J(() => [U(e.$slots, "header", {
|
|
4212
4218
|
fullscreen: f.value,
|
|
4213
4219
|
title: r.title,
|
|
4214
4220
|
toggleFullscreen: y
|
|
4215
4221
|
}, () => [T("div", Ui, [
|
|
4216
|
-
T("div", Wi, [T("div", Gi, [T("span", Ki,
|
|
4222
|
+
T("div", Wi, [T("div", Gi, [T("span", Ki, G(r.title), 1)])]),
|
|
4217
4223
|
T("div", qi, [
|
|
4218
|
-
T("span", Ji, [t[2] ||= T("i", { "aria-hidden": "true" }, null, -1), D(" " +
|
|
4219
|
-
r.fullscreenButton ? (
|
|
4224
|
+
T("span", Ji, [t[2] ||= T("i", { "aria-hidden": "true" }, null, -1), D(" " + G(g.value), 1)]),
|
|
4225
|
+
r.fullscreenButton ? (B(), S(K(Be), {
|
|
4220
4226
|
key: 0,
|
|
4221
4227
|
content: f.value ? "退出全屏" : "全屏",
|
|
4222
4228
|
placement: "bottom"
|
|
4223
4229
|
}, {
|
|
4224
|
-
default:
|
|
4230
|
+
default: J(() => [O(K(X), {
|
|
4225
4231
|
link: "",
|
|
4226
|
-
icon: f.value ?
|
|
4232
|
+
icon: f.value ? K(st) : K(tt),
|
|
4227
4233
|
"aria-label": f.value ? "退出全屏" : "全屏",
|
|
4228
4234
|
onClick: y
|
|
4229
4235
|
}, null, 8, ["icon", "aria-label"])]),
|
|
4230
4236
|
_: 1
|
|
4231
4237
|
}, 8, ["content"])) : C("", !0),
|
|
4232
|
-
O(
|
|
4238
|
+
O(K(Be), {
|
|
4233
4239
|
content: "关闭",
|
|
4234
4240
|
placement: "bottom"
|
|
4235
4241
|
}, {
|
|
4236
|
-
default:
|
|
4242
|
+
default: J(() => [O(K(X), {
|
|
4237
4243
|
link: "",
|
|
4238
4244
|
class: "drawer-form-page__close",
|
|
4239
|
-
icon:
|
|
4245
|
+
icon: K(Ze),
|
|
4240
4246
|
"aria-label": "关闭",
|
|
4241
4247
|
onClick: A
|
|
4242
4248
|
}, null, 8, ["icon"])]),
|
|
4243
4249
|
_: 1
|
|
4244
4250
|
})
|
|
4245
4251
|
]),
|
|
4246
|
-
v.value.length ? (
|
|
4252
|
+
v.value.length ? (B(), w("nav", Yi, [(B(!0), w(b, null, H(v.value, ({ entry: e, index: t }) => (B(), w("button", {
|
|
4247
4253
|
key: t,
|
|
4248
4254
|
type: "button",
|
|
4249
|
-
class:
|
|
4255
|
+
class: L(["drawer-form-page__anchor", { "is-active": a.value === t }]),
|
|
4250
4256
|
onClick: (e) => {
|
|
4251
4257
|
a.value = t, k(t);
|
|
4252
4258
|
}
|
|
4253
|
-
},
|
|
4259
|
+
}, G(e.label), 11, Xi))), 128))])) : C("", !0)
|
|
4254
4260
|
])], !0)]),
|
|
4255
|
-
default:
|
|
4261
|
+
default: J(() => [ce((B(), w("div", {
|
|
4256
4262
|
ref_key: "contentRef",
|
|
4257
4263
|
ref: c,
|
|
4258
4264
|
class: "drawer-form-page__content",
|
|
4259
|
-
onScrollPassive:
|
|
4265
|
+
onScrollPassive: W
|
|
4260
4266
|
}, [O(vi, F({
|
|
4261
4267
|
ref_key: "formRef",
|
|
4262
4268
|
ref: s
|
|
@@ -4268,9 +4274,9 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
4268
4274
|
columns: m.value,
|
|
4269
4275
|
disabled: r.disabled,
|
|
4270
4276
|
loading: r.loading
|
|
4271
|
-
}), E({ _: 2 }, [
|
|
4277
|
+
}), E({ _: 2 }, [H(_.value, (t) => ({
|
|
4272
4278
|
name: t,
|
|
4273
|
-
fn:
|
|
4279
|
+
fn: J((n) => [U(e.$slots, t, R(j(n)), void 0, !0)])
|
|
4274
4280
|
}))]), 1040, [
|
|
4275
4281
|
"modelValue",
|
|
4276
4282
|
"schema",
|
|
@@ -4278,29 +4284,29 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
4278
4284
|
"columns",
|
|
4279
4285
|
"disabled",
|
|
4280
4286
|
"loading"
|
|
4281
|
-
]),
|
|
4287
|
+
]), U(e.$slots, "default", {}, void 0, !0)], 32)), [[n, r.loading]])]),
|
|
4282
4288
|
_: 2
|
|
4283
4289
|
}, [r.showFooter ? {
|
|
4284
4290
|
name: "footer",
|
|
4285
|
-
fn:
|
|
4291
|
+
fn: J(() => [U(e.$slots, "footer", {
|
|
4286
4292
|
cancel: M,
|
|
4287
|
-
submit:
|
|
4293
|
+
submit: z,
|
|
4288
4294
|
submitting: r.submitting
|
|
4289
|
-
}, () => [T("div", Zi, [r.showCancelButton ? (
|
|
4295
|
+
}, () => [T("div", Zi, [r.showCancelButton ? (B(), S(K(X), {
|
|
4290
4296
|
key: 0,
|
|
4291
4297
|
disabled: r.submitting,
|
|
4292
4298
|
onClick: M
|
|
4293
4299
|
}, {
|
|
4294
|
-
default:
|
|
4300
|
+
default: J(() => [D(G(r.cancelText), 1)]),
|
|
4295
4301
|
_: 1
|
|
4296
|
-
}, 8, ["disabled"])) : C("", !0), h.value ? (
|
|
4302
|
+
}, 8, ["disabled"])) : C("", !0), h.value ? (B(), S(K(X), {
|
|
4297
4303
|
key: 1,
|
|
4298
4304
|
type: "primary",
|
|
4299
4305
|
disabled: r.loading,
|
|
4300
4306
|
loading: r.submitting,
|
|
4301
|
-
onClick:
|
|
4307
|
+
onClick: z
|
|
4302
4308
|
}, {
|
|
4303
|
-
default:
|
|
4309
|
+
default: J(() => [D(G(r.submitText), 1)]),
|
|
4304
4310
|
_: 1
|
|
4305
4311
|
}, 8, ["disabled", "loading"])) : C("", !0)])], !0)]),
|
|
4306
4312
|
key: "0"
|
|
@@ -4320,7 +4326,7 @@ var Di = { class: "async-select" }, Oi = { class: "async-select__value" }, ki =
|
|
|
4320
4326
|
}), [["__scopeId", "data-v-41961167"]]);
|
|
4321
4327
|
// src/components/drawer-form-page/use-drawer-form-page.ts
|
|
4322
4328
|
function $i(e = {}) {
|
|
4323
|
-
let { closeOnSubmit: t = !0, initialValues: n, onCancel: r, onOpenChange: i, onSubmit: a, values: o, ...s } = e, c =
|
|
4329
|
+
let { closeOnSubmit: t = !0, initialValues: n, onCancel: r, onOpenChange: i, onSubmit: a, values: o, ...s } = e, c = V(!1), l = V(ea(o ?? n ?? {})), u = te({ ...s }), d = V(), f;
|
|
4324
4330
|
function p(e = {}) {
|
|
4325
4331
|
let { values: t, ...r } = e;
|
|
4326
4332
|
Object.assign(u, r), l.value = ea(t ?? n ?? {}), c.value = !0;
|
|
@@ -4363,7 +4369,7 @@ function $i(e = {}) {
|
|
|
4363
4369
|
submit: b,
|
|
4364
4370
|
toggleFullscreen: h,
|
|
4365
4371
|
validate: v
|
|
4366
|
-
},
|
|
4372
|
+
}, q(c, (e) => {
|
|
4367
4373
|
i?.(e);
|
|
4368
4374
|
}), [A({
|
|
4369
4375
|
name: "DrawerFormPageProvider",
|
|
@@ -4464,9 +4470,9 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4464
4470
|
"toolbarAction"
|
|
4465
4471
|
],
|
|
4466
4472
|
setup(e, { expose: t, emit: n }) {
|
|
4467
|
-
let r = e, i = n, a =
|
|
4473
|
+
let r = e, i = n, a = se(), o = V(), s = V("create"), l = V({}), u = V(0), d = V([]), f = V({}), p = V({}), m = x(() => r.fields.filter((e) => e.form !== !1)), h = x(() => {
|
|
4468
4474
|
let e = r.searchFormProps?.schema;
|
|
4469
|
-
return e?.length ? e : r.fields.filter((e) => e.search).map((e) =>
|
|
4475
|
+
return e?.length ? e : r.fields.filter((e) => e.search).map((e) => ee(e)).filter((e) => !!e);
|
|
4470
4476
|
}), g = x(() => h.value.length > 0), _ = x(() => r.fields.filter((e) => e.table !== !1).filter((e) => e.type !== "group").map((e) => {
|
|
4471
4477
|
let t = typeof e.table == "object" ? e.table : {}, n = t.type ?? (e.type === "picture" || e.type === "file" ? e.type : void 0), r = t.valueType ?? (e.type === "date" || e.type === "datetime" ? e.type : void 0);
|
|
4472
4478
|
return {
|
|
@@ -4498,10 +4504,10 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4498
4504
|
...typeof r.importUrl == "string" ? { api: r.importUrl } : r.importUrl ?? {}
|
|
4499
4505
|
}
|
|
4500
4506
|
};
|
|
4501
|
-
}),
|
|
4507
|
+
}), L = x(() => {
|
|
4502
4508
|
let { schema: e, ...t } = r.searchFormProps ?? {};
|
|
4503
4509
|
return t;
|
|
4504
|
-
}),
|
|
4510
|
+
}), z = /* @__PURE__ */ new Set([
|
|
4505
4511
|
"apiOptions",
|
|
4506
4512
|
"component",
|
|
4507
4513
|
"copyable",
|
|
@@ -4524,27 +4530,27 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4524
4530
|
"tip",
|
|
4525
4531
|
"type"
|
|
4526
4532
|
]);
|
|
4527
|
-
function
|
|
4528
|
-
return e.type === "group" ?
|
|
4533
|
+
function ee(e) {
|
|
4534
|
+
return e.type === "group" ? te(e) : re(e);
|
|
4529
4535
|
}
|
|
4530
|
-
function
|
|
4536
|
+
function te(e) {
|
|
4531
4537
|
let t = e.search;
|
|
4532
4538
|
if (!t) return null;
|
|
4533
4539
|
let n = typeof t == "object" ? t : {}, r = Array.isArray(n.children) ? n.children : e.children;
|
|
4534
4540
|
return {
|
|
4535
4541
|
...e,
|
|
4536
|
-
...
|
|
4542
|
+
...W(n),
|
|
4537
4543
|
children: r,
|
|
4538
4544
|
hidden: n.hidden ?? !1
|
|
4539
4545
|
};
|
|
4540
4546
|
}
|
|
4541
|
-
function
|
|
4547
|
+
function re(e) {
|
|
4542
4548
|
let t = e.search;
|
|
4543
4549
|
if (!t) return null;
|
|
4544
|
-
let n = typeof t == "object" ? t : {}, r =
|
|
4550
|
+
let n = typeof t == "object" ? t : {}, r = ie(n), i = ae(e.props, r);
|
|
4545
4551
|
return {
|
|
4546
4552
|
...e,
|
|
4547
|
-
...
|
|
4553
|
+
...W(n),
|
|
4548
4554
|
props: i,
|
|
4549
4555
|
hidden: n.hidden ?? !1,
|
|
4550
4556
|
readonly: n.readonly ?? !1,
|
|
@@ -4552,13 +4558,13 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4552
4558
|
rules: n.rules ?? []
|
|
4553
4559
|
};
|
|
4554
4560
|
}
|
|
4555
|
-
function
|
|
4556
|
-
return Object.fromEntries(Object.entries(e).filter(([e]) =>
|
|
4561
|
+
function W(e) {
|
|
4562
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => z.has(e)));
|
|
4557
4563
|
}
|
|
4558
|
-
function
|
|
4559
|
-
return Object.fromEntries(Object.entries(e).filter(([e]) => !
|
|
4564
|
+
function ie(e) {
|
|
4565
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => !z.has(e)));
|
|
4560
4566
|
}
|
|
4561
|
-
function
|
|
4567
|
+
function ae(e, t) {
|
|
4562
4568
|
return Object.keys(t).length === 0 ? e : typeof e == "function" ? ((n) => ({
|
|
4563
4569
|
...e(n),
|
|
4564
4570
|
...t
|
|
@@ -4567,20 +4573,20 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4567
4573
|
...t
|
|
4568
4574
|
};
|
|
4569
4575
|
}
|
|
4570
|
-
async function
|
|
4571
|
-
p.value = { ...e }, await
|
|
4576
|
+
async function oe(e) {
|
|
4577
|
+
p.value = { ...e }, await I(), await ke();
|
|
4572
4578
|
}
|
|
4573
|
-
function
|
|
4574
|
-
|
|
4579
|
+
function q(e) {
|
|
4580
|
+
oe(e);
|
|
4575
4581
|
}
|
|
4576
|
-
function
|
|
4577
|
-
|
|
4582
|
+
function le() {
|
|
4583
|
+
oe({});
|
|
4578
4584
|
}
|
|
4579
4585
|
function Y(e = f.value) {
|
|
4580
|
-
f.value = { ...e },
|
|
4586
|
+
f.value = { ...e }, q(f.value);
|
|
4581
4587
|
}
|
|
4582
4588
|
function ue(e = {}) {
|
|
4583
|
-
f.value = { ...e },
|
|
4589
|
+
f.value = { ...e }, oe(f.value);
|
|
4584
4590
|
}
|
|
4585
4591
|
let [de, fe] = $i({
|
|
4586
4592
|
...r.drawerProps,
|
|
@@ -4760,26 +4766,26 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4760
4766
|
openView: (e) => ge("view", e),
|
|
4761
4767
|
reload: ke
|
|
4762
4768
|
}), (e, t) => {
|
|
4763
|
-
let n =
|
|
4764
|
-
return
|
|
4765
|
-
default:
|
|
4766
|
-
|
|
4767
|
-
e.$slots.search ?
|
|
4769
|
+
let n = ne("access");
|
|
4770
|
+
return B(), w(b, null, [O(Hi, null, {
|
|
4771
|
+
default: J(() => [
|
|
4772
|
+
U(e.$slots, "prepend", {}, void 0, !0),
|
|
4773
|
+
e.$slots.search ? U(e.$slots, "search", {
|
|
4768
4774
|
values: f.value,
|
|
4769
4775
|
search: Y,
|
|
4770
4776
|
reset: ue
|
|
4771
|
-
}, void 0, !0, 0) : g.value ? (
|
|
4777
|
+
}, void 0, !0, 0) : g.value ? (B(), S(bi, F({
|
|
4772
4778
|
key: 1,
|
|
4773
4779
|
modelValue: f.value,
|
|
4774
4780
|
"onUpdate:modelValue": t[0] ||= (e) => f.value = e,
|
|
4775
4781
|
class: "crud-page__search"
|
|
4776
|
-
},
|
|
4782
|
+
}, L.value, {
|
|
4777
4783
|
schema: h.value,
|
|
4778
|
-
onSearch:
|
|
4779
|
-
onReset:
|
|
4780
|
-
}), E({ _: 2 }, [
|
|
4784
|
+
onSearch: q,
|
|
4785
|
+
onReset: le
|
|
4786
|
+
}), E({ _: 2 }, [H(y.value, (t) => ({
|
|
4781
4787
|
name: t,
|
|
4782
|
-
fn:
|
|
4788
|
+
fn: J((n) => [U(e.$slots, t, R(j(n)), void 0, !0)])
|
|
4783
4789
|
}))]), 1040, ["modelValue", "schema"])) : C("", !0),
|
|
4784
4790
|
O(Or, F({
|
|
4785
4791
|
ref_key: "tableRef",
|
|
@@ -4796,44 +4802,44 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4796
4802
|
onHandleAction: Oe,
|
|
4797
4803
|
onRowSort: t[2] ||= (e) => i("rowSort", e)
|
|
4798
4804
|
}), E({
|
|
4799
|
-
buttons:
|
|
4800
|
-
r.onCreate ?
|
|
4805
|
+
buttons: J(() => [U(e.$slots, "buttons", { selectedRows: d.value }, () => [
|
|
4806
|
+
r.onCreate ? ce((B(), S(K(X), {
|
|
4801
4807
|
key: 0,
|
|
4802
4808
|
type: "primary",
|
|
4803
4809
|
onClick: _e
|
|
4804
4810
|
}, {
|
|
4805
|
-
default:
|
|
4811
|
+
default: J(() => [D(G(r.addButtonText ?? K(c)("components.crudPage.addButtonText")), 1)]),
|
|
4806
4812
|
_: 1
|
|
4807
4813
|
})), [[n, [`${N.value}:add`]]]) : C("", !0),
|
|
4808
|
-
r.onDelete || r.onBatchDelete ?
|
|
4814
|
+
r.onDelete || r.onBatchDelete ? ce((B(), S(K(X), {
|
|
4809
4815
|
key: 1,
|
|
4810
4816
|
type: "danger",
|
|
4811
4817
|
disabled: d.value.length === 0,
|
|
4812
4818
|
onClick: be
|
|
4813
4819
|
}, {
|
|
4814
|
-
default:
|
|
4820
|
+
default: J(() => [D(G(K(c)("components.tableEntity.batchDelete")), 1)]),
|
|
4815
4821
|
_: 1
|
|
4816
4822
|
}, 8, ["disabled"])), [[n, [`${N.value}:remove`]]]) : C("", !0),
|
|
4817
|
-
r.showImport ?
|
|
4823
|
+
r.showImport ? ce((B(), S(K(X), {
|
|
4818
4824
|
key: 2,
|
|
4819
4825
|
onClick: xe
|
|
4820
4826
|
}, {
|
|
4821
|
-
default:
|
|
4827
|
+
default: J(() => [D(G(K(c)("components.tableEntity.import")), 1)]),
|
|
4822
4828
|
_: 1
|
|
4823
4829
|
})), [[n, [`${N.value}:import`]]]) : C("", !0),
|
|
4824
|
-
r.showExport && r.exportConfig ?
|
|
4830
|
+
r.showExport && r.exportConfig ? ce((B(), S(K(X), {
|
|
4825
4831
|
key: 3,
|
|
4826
4832
|
onClick: Z
|
|
4827
4833
|
}, {
|
|
4828
|
-
default:
|
|
4834
|
+
default: J(() => [D(G(K(c)("components.tableEntity.export")), 1)]),
|
|
4829
4835
|
_: 1
|
|
4830
4836
|
})), [[n, [`${N.value}:export`]]]) : C("", !0),
|
|
4831
|
-
O(
|
|
4837
|
+
O(K(De))
|
|
4832
4838
|
], !0)]),
|
|
4833
4839
|
_: 2
|
|
4834
|
-
}, [
|
|
4840
|
+
}, [H(v.value, (t) => ({
|
|
4835
4841
|
name: t,
|
|
4836
|
-
fn:
|
|
4842
|
+
fn: J((n) => [U(e.$slots, t, R(j(n)), void 0, !0)])
|
|
4837
4843
|
}))]), 1040, [
|
|
4838
4844
|
"row-key",
|
|
4839
4845
|
"columns",
|
|
@@ -4845,22 +4851,22 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4845
4851
|
])
|
|
4846
4852
|
]),
|
|
4847
4853
|
_: 3
|
|
4848
|
-
}), O(
|
|
4849
|
-
default:
|
|
4854
|
+
}), O(K(de), null, E({
|
|
4855
|
+
default: J(() => [e.$slots.default ? U(e.$slots, "default", {}, void 0, !0, 0) : C("", !0)]),
|
|
4850
4856
|
_: 2
|
|
4851
4857
|
}, [
|
|
4852
|
-
|
|
4858
|
+
H(y.value, (t) => ({
|
|
4853
4859
|
name: t,
|
|
4854
|
-
fn:
|
|
4860
|
+
fn: J((n) => [U(e.$slots, t, R(j(n)), void 0, !0)])
|
|
4855
4861
|
})),
|
|
4856
4862
|
e.$slots.header ? {
|
|
4857
4863
|
name: "header",
|
|
4858
|
-
fn:
|
|
4864
|
+
fn: J((t) => [U(e.$slots, "header", R(j(t)), void 0, !0)]),
|
|
4859
4865
|
key: "0"
|
|
4860
4866
|
} : void 0,
|
|
4861
4867
|
e.$slots.footer ? {
|
|
4862
4868
|
name: "footer",
|
|
4863
|
-
fn:
|
|
4869
|
+
fn: J((t) => [U(e.$slots, "footer", R(j(t)), void 0, !0)]),
|
|
4864
4870
|
key: "1"
|
|
4865
4871
|
} : void 0
|
|
4866
4872
|
]), 1024)], 64);
|
|
@@ -4874,7 +4880,7 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4874
4880
|
},
|
|
4875
4881
|
setup(e) {
|
|
4876
4882
|
let t = e;
|
|
4877
|
-
return (e, n) => (
|
|
4883
|
+
return (e, n) => (B(), S(K(Z), F(e.$attrs, { class: ["disguise iconfont", t.icon ? `${t.className}-${t.icon}` : void 0] }), null, 16, ["class"]));
|
|
4878
4884
|
}
|
|
4879
4885
|
}), ra = ["src"], ia = { class: "image-upload__mask" }, aa = { class: "image-upload__text" }, oa = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
4880
4886
|
__name: "index",
|
|
@@ -4898,7 +4904,7 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4898
4904
|
}),
|
|
4899
4905
|
emits: ["update:modelValue"],
|
|
4900
4906
|
setup(e) {
|
|
4901
|
-
let t = e, n =
|
|
4907
|
+
let t = e, n = oe(e, "modelValue"), { resolveImageUrl: r } = d(), i = V(!1), a = V(!1), o = x(() => r(n.value)), s = x(() => ({
|
|
4902
4908
|
width: `${t.width}px`,
|
|
4903
4909
|
height: `${t.height}px`
|
|
4904
4910
|
}));
|
|
@@ -4921,30 +4927,30 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4921
4927
|
function f() {
|
|
4922
4928
|
n.value = "";
|
|
4923
4929
|
}
|
|
4924
|
-
return (t, n) => (
|
|
4930
|
+
return (t, n) => (B(), w("div", { class: L(["image-upload", { "is-disabled": e.disabled }]) }, [o.value ? (B(), w("div", {
|
|
4925
4931
|
key: 0,
|
|
4926
4932
|
class: "image-upload__box",
|
|
4927
|
-
style:
|
|
4933
|
+
style: z(s.value)
|
|
4928
4934
|
}, [T("img", {
|
|
4929
4935
|
src: o.value,
|
|
4930
4936
|
alt: "",
|
|
4931
4937
|
class: "image-upload__img"
|
|
4932
|
-
}, null, 8, ra), T("div", ia, [O(
|
|
4938
|
+
}, null, 8, ra), T("div", ia, [O(K(Z), {
|
|
4933
4939
|
class: "image-upload__action",
|
|
4934
|
-
title:
|
|
4940
|
+
title: K(c)("components.imageUpload.preview"),
|
|
4935
4941
|
onClick: n[0] ||= (e) => a.value = !0
|
|
4936
4942
|
}, {
|
|
4937
|
-
default:
|
|
4943
|
+
default: J(() => [O(K(dt))]),
|
|
4938
4944
|
_: 1
|
|
4939
|
-
}, 8, ["title"]), e.disabled ? C("", !0) : (
|
|
4945
|
+
}, 8, ["title"]), e.disabled ? C("", !0) : (B(), S(K(Z), {
|
|
4940
4946
|
key: 0,
|
|
4941
4947
|
class: "image-upload__action",
|
|
4942
|
-
title:
|
|
4948
|
+
title: K(c)("components.imageUpload.remove"),
|
|
4943
4949
|
onClick: f
|
|
4944
4950
|
}, {
|
|
4945
|
-
default:
|
|
4951
|
+
default: J(() => [O(K($e))]),
|
|
4946
4952
|
_: 1
|
|
4947
|
-
}, 8, ["title"]))])], 4)) : (
|
|
4953
|
+
}, 8, ["title"]))])], 4)) : (B(), S(K(Ve), {
|
|
4948
4954
|
key: 1,
|
|
4949
4955
|
accept: e.accept.join(","),
|
|
4950
4956
|
"before-upload": l,
|
|
@@ -4952,15 +4958,15 @@ var ta = /*#__PURE__*/ u(/* @__PURE__ */ A({
|
|
|
4952
4958
|
"http-request": u,
|
|
4953
4959
|
"show-file-list": !1
|
|
4954
4960
|
}, {
|
|
4955
|
-
default:
|
|
4961
|
+
default: J(() => [T("div", {
|
|
4956
4962
|
class: "image-upload__box is-empty",
|
|
4957
|
-
style:
|
|
4958
|
-
}, [O(
|
|
4959
|
-
default:
|
|
4963
|
+
style: z(s.value)
|
|
4964
|
+
}, [O(K(Z), { class: L(["image-upload__icon", { "is-loading": i.value }]) }, {
|
|
4965
|
+
default: J(() => [i.value ? (B(), S(K(nt), { key: 0 })) : (B(), S(K(it), { key: 1 }))]),
|
|
4960
4966
|
_: 1
|
|
4961
|
-
}, 8, ["class"]), T("span", aa,
|
|
4967
|
+
}, 8, ["class"]), T("span", aa, G(i.value ? K(c)("components.imageUpload.uploading") : K(c)("components.imageUpload.upload")), 1)], 4)]),
|
|
4962
4968
|
_: 1
|
|
4963
|
-
}, 8, ["accept", "disabled"])), a.value ? (
|
|
4969
|
+
}, 8, ["accept", "disabled"])), a.value ? (B(), S(K(Se), {
|
|
4964
4970
|
key: 2,
|
|
4965
4971
|
"url-list": [o.value],
|
|
4966
4972
|
teleported: "",
|