disguise-ui 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/disguise-ui.js +1107 -1035
- package/dist/style.css +1 -1
- package/dist/types/components/async-select/async-select.type.d.ts +4 -0
- package/dist/types/components/async-select/async-select.utils.d.ts +1 -1
- package/dist/types/components/async-select/async-select.vue.d.ts +3 -3
- package/dist/types/components/async-select/index.d.ts +1 -1
- package/dist/types/components/rich-text-editor/index.type.d.ts +57 -0
- package/dist/types/components/rich-text-editor/index.vue.d.ts +2 -6
- package/dist/types/components/schema-form/index.d.ts +1 -1
- package/dist/types/components/schema-form/schema-form.type.d.ts +23 -6
- package/dist/types/entities/registry.d.ts +3 -3
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/disguise-ui.js
CHANGED
|
@@ -7,97 +7,97 @@ import { t as f } from "./use-image-url-hImb4UEO.js";
|
|
|
7
7
|
import { t as p } from "./use-file-type-rNstoxXw.js";
|
|
8
8
|
import { r as m } from "./use-multiple-file-upload-BrhklFSk.js";
|
|
9
9
|
import { t as h } from "./picture-upload-KEFFSvsi.js";
|
|
10
|
-
import { Fragment as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createSlots as S, createTextVNode as C, createVNode as w, defineAsyncComponent as T, defineComponent as E, guardReactiveProps as D, h as O, isRef as k, mergeModels as A, mergeProps as j, nextTick as M, normalizeClass as N, normalizeProps as P, normalizeStyle as F, onUnmounted as I, openBlock as L, reactive as
|
|
11
|
-
import { ElButton as
|
|
10
|
+
import { Fragment as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createSlots as S, createTextVNode as C, createVNode as w, defineAsyncComponent as T, defineComponent as E, guardReactiveProps as D, h as O, isRef as k, mergeModels as A, mergeProps as j, nextTick as M, normalizeClass as N, normalizeProps as P, normalizeStyle as F, onUnmounted as I, openBlock as L, reactive as ee, ref as R, renderList as z, renderSlot as B, resolveComponent as te, resolveDirective as V, resolveDynamicComponent as H, shallowReactive as ne, toDisplayString as U, toHandlers as re, toValue as ie, unref as W, useModel as G, useSlots as ae, vModelSelect as oe, vModelText as se, watch as K, withCtx as q, withDirectives as J, withKeys as ce, withModifiers as le } from "vue";
|
|
11
|
+
import { ElButton as Y, ElCard as ue, ElCheckbox as de, ElCheckboxGroup as fe, ElCol as X, ElDatePicker as pe, ElDrawer as me, ElDropdown as he, ElDropdownItem as ge, ElDropdownMenu as _e, ElForm as ve, ElFormItem as ye, ElIcon as Z, ElImageViewer as be, ElInput as xe, ElInputNumber as Se, ElMessage as Q, ElMessageBox as Ce, ElOption as $, ElPagination as we, ElPopover as Te, ElProgress as Ee, ElRadio as De, ElRadioGroup as Oe, ElRow as ke, ElSelect as Ae, ElSelectV2 as je, ElSwitch as Me, ElTabPane as Ne, ElTable as Pe, ElTableColumn as Fe, ElTableV2 as Ie, ElTabs as Le, ElTooltip as Re, ElUpload as ze, TableV2FixedDir as Be } from "element-plus";
|
|
12
12
|
import Ve from "dayjs";
|
|
13
13
|
import He from "dayjs/plugin/timezone.js";
|
|
14
14
|
import Ue from "dayjs/plugin/utc.js";
|
|
15
15
|
import { ArrowDown as We, ArrowRight as Ge, ArrowUp as Ke, ChatDotRound as qe, Check as Je, Close as Ye, CopyDocument as Xe, Delete as Ze, Download as Qe, FullScreen as $e, InfoFilled as et, Loading as tt, Menu as nt, Plus as rt, Rank as it, Refresh as at, ScaleToOriginal as ot, Search as st, Setting as ct, SuccessFilled as lt, WarningFilled as ut, ZoomIn as dt } from "@element-plus/icons-vue";
|
|
16
16
|
import { useClipboard as ft, useElementSize as pt } from "@vueuse/core";
|
|
17
17
|
import { VueDraggable as mt } from "vue-draggable-plus";
|
|
18
|
-
import {
|
|
19
|
-
import { AlignCenter as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import { Table as
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import { BackgroundColor as
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import { EditorContent as
|
|
18
|
+
import { keepPreviousData as ht, useQuery as gt } from "@tanstack/vue-query";
|
|
19
|
+
import { AlignCenter as _t, AlignJustify as vt, AlignLeft as yt, AlignRight as bt, Bold as xt, Code2 as St, Eraser as Ct, Highlighter as wt, ImageIcon as Tt, IndentDecrease as Et, IndentIncrease as Dt, Italic as Ot, Languages as kt, Link2 as At, List as jt, ListOrdered as Mt, Maximize2 as Nt, Minimize2 as Pt, Palette as Ft, Quote as It, Redo2 as Lt, Strikethrough as Rt, Table2 as zt, Underline as Bt, Undo2 as Vt } from "lucide-vue-next";
|
|
20
|
+
import Ht from "@tiptap/extension-color";
|
|
21
|
+
import Ut from "@tiptap/extension-font-family";
|
|
22
|
+
import Wt from "@tiptap/extension-highlight";
|
|
23
|
+
import Gt from "@tiptap/extension-image";
|
|
24
|
+
import Kt from "@tiptap/extension-link";
|
|
25
|
+
import qt from "@tiptap/extension-placeholder";
|
|
26
|
+
import { Table as Jt } from "@tiptap/extension-table";
|
|
27
|
+
import Yt from "@tiptap/extension-table-cell";
|
|
28
|
+
import Xt from "@tiptap/extension-table-header";
|
|
29
|
+
import Zt from "@tiptap/extension-table-row";
|
|
30
|
+
import Qt from "@tiptap/extension-text-align";
|
|
31
|
+
import { BackgroundColor as $t, FontSize as en, LineHeight as tn, TextStyle as nn } from "@tiptap/extension-text-style";
|
|
32
|
+
import rn from "@tiptap/extension-underline";
|
|
33
|
+
import an from "@tiptap/starter-kit";
|
|
34
|
+
import { EditorContent as on, useEditor as sn } from "@tiptap/vue-3";
|
|
35
35
|
// src/assets/svgs/more-dot.svg
|
|
36
|
-
var
|
|
36
|
+
var cn = "data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.75%205.875C2.75%206.35825%202.35825%206.75%201.875%206.75C1.39175%206.75%201%206.35825%201%205.875C1%205.39175%201.39175%205%201.875%205C2.35825%205%202.75%205.39175%202.75%205.875Z'%20fill='%232B2F36'/%3e%3cpath%20d='M6.86269%205.875C6.86269%206.35825%206.47094%206.75%205.98769%206.75C5.50444%206.75%205.11269%206.35825%205.11269%205.875C5.11269%205.39175%205.50444%205%205.98769%205C6.47094%205%206.86269%205.39175%206.86269%205.875Z'%20fill='%232B2F36'/%3e%3cpath%20d='M11%205.875C11%206.35825%2010.6082%206.75%2010.125%206.75C9.64175%206.75%209.25%206.35825%209.25%205.875C9.25%205.39175%209.64175%205%2010.125%205C10.6082%205%2011%205.39175%2011%205.875Z'%20fill='%232B2F36'/%3e%3c/svg%3e";
|
|
37
37
|
// src/runtime/access.ts
|
|
38
|
-
function
|
|
38
|
+
function ln() {
|
|
39
39
|
return { hasAccessByCodes(e) {
|
|
40
40
|
return o().value(e);
|
|
41
41
|
} };
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function un() {
|
|
44
44
|
return { get accessToken() {
|
|
45
45
|
return s();
|
|
46
46
|
} };
|
|
47
47
|
}
|
|
48
48
|
Ve.extend(Ue), Ve.extend(He), Ve.tz.setDefault(Ve.tz.guess());
|
|
49
|
-
var
|
|
50
|
-
function dn(e) {
|
|
51
|
-
return Number.isFinite(e) && Math.abs(e) < un ? e * 1e3 : e;
|
|
52
|
-
}
|
|
49
|
+
var dn = 1e11;
|
|
53
50
|
function fn(e) {
|
|
54
|
-
|
|
51
|
+
return Number.isFinite(e) && Math.abs(e) < dn ? e * 1e3 : e;
|
|
52
|
+
}
|
|
53
|
+
function pn(e) {
|
|
54
|
+
if (typeof e == "number") return fn(e);
|
|
55
55
|
if (typeof e == "string") {
|
|
56
56
|
let t = e.trim();
|
|
57
|
-
if (/^-?\d+(?:\.\d+)?$/.test(t)) return
|
|
57
|
+
if (/^-?\d+(?:\.\d+)?$/.test(t)) return fn(Number(t));
|
|
58
58
|
}
|
|
59
59
|
return e;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function mn(e, t = "YYYY-MM-DD") {
|
|
62
62
|
if (e == null || e === "") return "";
|
|
63
63
|
if (typeof e != "number" && typeof e != "string" && !(e instanceof Date) && !Ve.isDayjs(e)) return String(e);
|
|
64
|
-
let n = Ve.isDayjs(e) ? e : Ve(
|
|
64
|
+
let n = Ve.isDayjs(e) ? e : Ve(pn(e));
|
|
65
65
|
return n.isValid() ? n.tz().format(t) : String(e ?? "");
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
67
|
+
function hn(e) {
|
|
68
|
+
return mn(e, "YYYY-MM-DD HH:mm:ss");
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function gn({ fileName: e = "download", source: t }) {
|
|
71
71
|
if (!(t instanceof Blob)) throw TypeError("Invalid Blob data.");
|
|
72
72
|
let n = URL.createObjectURL(t), r = document.createElement("a");
|
|
73
73
|
r.href = n, r.download = e, r.style.display = "none", document.body.append(r), r.click(), r.remove(), URL.revokeObjectURL(n);
|
|
74
74
|
}
|
|
75
75
|
// src/runtime/request.ts
|
|
76
|
-
function
|
|
76
|
+
function _n() {
|
|
77
77
|
let e = a();
|
|
78
78
|
if (!e) throw Error("请先调用 setupDisguise,并传入 request");
|
|
79
79
|
return e;
|
|
80
80
|
}
|
|
81
|
-
var
|
|
81
|
+
var vn = {
|
|
82
82
|
getBaseUrl() {
|
|
83
83
|
return a()?.getBaseUrl() ?? "";
|
|
84
84
|
},
|
|
85
85
|
download(e, t) {
|
|
86
|
-
return
|
|
86
|
+
return _n().download(e, t);
|
|
87
87
|
},
|
|
88
88
|
upload(e, t, n) {
|
|
89
|
-
return
|
|
89
|
+
return _n().upload(e, t, n);
|
|
90
90
|
}
|
|
91
|
-
},
|
|
91
|
+
}, yn = { class: "import-dialog__header" }, bn = { class: "import-dialog__title" }, xn = { class: "import-dialog__header-actions" }, Sn = { class: "import-dialog" }, Cn = {
|
|
92
92
|
key: 0,
|
|
93
93
|
class: "import-dialog__steps"
|
|
94
|
-
},
|
|
94
|
+
}, wn = { key: 1 }, Tn = { class: "import-dialog__step-label" }, En = { class: "import-dialog__form-label" }, Dn = { class: "import-dialog__upload-inner" }, On = { class: "import-dialog__upload-icon" }, kn = { class: "import-dialog__upload-title" }, An = { class: "import-dialog__upload-link" }, jn = { class: "import-dialog__upload-subtitle" }, Mn = {
|
|
95
95
|
key: 0,
|
|
96
96
|
class: "import-dialog__upload-name"
|
|
97
|
-
},
|
|
97
|
+
}, Nn = { class: "import-dialog__download" }, Pn = { class: "import-dialog__tips" }, Fn = { class: "import-dialog__preview-header" }, In = { class: "import-dialog__preview-field" }, Ln = { class: "import-dialog__form-label" }, Rn = { class: "import-dialog__preview-field" }, zn = { class: "import-dialog__form-label" }, Bn = { class: "import-dialog__preview-summary" }, Vn = { class: "import-dialog__mapping-header" }, Hn = { class: "import-dialog__mapping-body" }, Un = { class: "import-dialog__mapping-arrow" }, Wn = { class: "import-dialog__mapping-checkbox" }, Gn = { class: "import-dialog__result-badge" }, Kn = { class: "import-dialog__result-title" }, qn = { class: "import-dialog__result-description" }, Jn = {
|
|
98
98
|
key: 0,
|
|
99
99
|
class: "import-dialog__result-detail"
|
|
100
|
-
},
|
|
100
|
+
}, Yn = { class: "import-dialog__progress" }, Xn = { class: "import-dialog__progress-icon" }, Zn = { class: "import-dialog__progress-title" }, Qn = { class: "import-dialog__progress-description" }, $n = { class: "import-dialog__progress-hint" }, er = { class: "import-dialog__footer" }, tr = /* @__PURE__ */ d(/* @__PURE__ */ E({
|
|
101
101
|
__name: "index",
|
|
102
102
|
props: {
|
|
103
103
|
modelValue: {
|
|
@@ -140,41 +140,41 @@ var _n = {
|
|
|
140
140
|
setup(e, { emit: t }) {
|
|
141
141
|
let n = e, i = t, [a, o] = r({ onOpenChange: (e) => {
|
|
142
142
|
e !== n.modelValue && i("update:modelValue", e);
|
|
143
|
-
} }), s =
|
|
143
|
+
} }), s = R(), c = R("upload"), l = R(n.defaultMode), d = R(null), f = R(""), p = R([]), m = R(""), h = R([]), S = R([]), T = R(0), E = R([]), D = R(!1), O = R(!1), k = R(!1), A = R(0), j = R(""), M = R(null), P = R(0), F = _(() => n.title || u("components.importDialog.title")), I = _(() => !!n.api), ee = _(() => n.modes?.length ? n.modes : [{
|
|
144
144
|
label: u("components.importDialog.modeCreate"),
|
|
145
145
|
value: "create"
|
|
146
146
|
}, {
|
|
147
147
|
label: u("components.importDialog.modeUpdate"),
|
|
148
148
|
value: "update"
|
|
149
|
-
}]),
|
|
149
|
+
}]), B = _(() => n.tips?.length ? n.tips : [
|
|
150
150
|
u("components.importDialog.tipSize", { size: n.maxSize }),
|
|
151
151
|
u("components.importDialog.tipHeader"),
|
|
152
152
|
u("components.importDialog.tipFormula"),
|
|
153
153
|
u("components.importDialog.tipArea"),
|
|
154
154
|
u("components.importDialog.tipRelation")
|
|
155
|
-
]),
|
|
155
|
+
]), te = _(() => n.accept.join(",")), H = _(() => n.accept.map((e) => e.replace(/^\./, "").toUpperCase()).join("、")), ne = _(() => M.value !== null), re = _(() => !ne.value && !I.value), ie = _(() => u("components.importDialog.previewSummary", {
|
|
156
156
|
total: T.value,
|
|
157
157
|
count: Math.min(S.value.length, n.maxPreviewCount)
|
|
158
|
-
})),
|
|
158
|
+
})), G = _(() => f.value || d.value?.name || ""), ae = _(() => h.value.map((e) => ({
|
|
159
159
|
label: e.label,
|
|
160
160
|
value: e.label
|
|
161
|
-
}))),
|
|
161
|
+
}))), oe = _(() => j.value || u("components.importDialog.importingProgress", { progress: A.value })), se = _(() => M.value ? M.value.title ? M.value.title : M.value.success ? u("components.importDialog.successTitle") : u("components.importDialog.errorTitle") : ""), ce = _(() => M.value ? M.value.description ? M.value.description : M.value.success ? u("components.importDialog.successDescription") : u("components.importDialog.errorDescription") : ""), le = _(() => [
|
|
162
162
|
u("components.importDialog.stepUpload"),
|
|
163
163
|
u("components.importDialog.stepPreview"),
|
|
164
164
|
u("components.importDialog.stepMapping"),
|
|
165
165
|
u("components.importDialog.stepImport")
|
|
166
166
|
]);
|
|
167
|
-
|
|
168
|
-
e ? (l.value = n.defaultMode, o.open()) : (o.close(), k.value = !1, o.setState({ fullscreen: !1 }), t && n.resetOnClose &&
|
|
167
|
+
K(() => n.modelValue, (e, t) => {
|
|
168
|
+
e ? (l.value = n.defaultMode, o.open()) : (o.close(), k.value = !1, o.setState({ fullscreen: !1 }), t && n.resetOnClose && ue());
|
|
169
169
|
}, { immediate: !0 });
|
|
170
|
-
function
|
|
170
|
+
function ue() {
|
|
171
171
|
P.value += 1, c.value = "upload", d.value = null, f.value = "", p.value = [], m.value = "", h.value = [], S.value = [], T.value = 0, E.value = [], D.value = !1, O.value = !1, A.value = 0, j.value = "", M.value = null, s.value?.clearFiles();
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function fe() {
|
|
174
174
|
p.value = [], m.value = "", h.value = [], S.value = [], T.value = 0, E.value = [], M.value = null;
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
|
|
176
|
+
function X() {
|
|
177
|
+
ne.value || i("cancel"), i("update:modelValue", !1);
|
|
178
178
|
}
|
|
179
179
|
function pe() {
|
|
180
180
|
k.value = !k.value, o.setState({ fullscreen: k.value });
|
|
@@ -182,11 +182,11 @@ var _n = {
|
|
|
182
182
|
async function me() {
|
|
183
183
|
if (!n.templateUrl) i("downloadTemplate");
|
|
184
184
|
else try {
|
|
185
|
-
let e = await
|
|
185
|
+
let e = await vn.download(he(n.templateUrl), {
|
|
186
186
|
method: n.templateMethod,
|
|
187
187
|
responseReturn: "raw"
|
|
188
188
|
});
|
|
189
|
-
|
|
189
|
+
gn({
|
|
190
190
|
fileName: _e(ge(e.headers, "content-disposition"), n.templateName || "import-template.xlsx"),
|
|
191
191
|
source: e.data
|
|
192
192
|
});
|
|
@@ -196,7 +196,7 @@ var _n = {
|
|
|
196
196
|
}
|
|
197
197
|
function he(e) {
|
|
198
198
|
if (/^https?:\/\//i.test(e)) return e;
|
|
199
|
-
let t =
|
|
199
|
+
let t = vn.getBaseUrl() || "", n = (/^https?:\/\//i.test(t) ? new URL(t).pathname : t.split(/[?#]/, 1)[0] ?? "").replace(/\/+$/, "");
|
|
200
200
|
return n && n !== "/" && (e === n || e.startsWith(`${n}/`)) ? e.slice(n.length) || "/" : e;
|
|
201
201
|
}
|
|
202
202
|
function ge(e, t) {
|
|
@@ -221,7 +221,7 @@ var _n = {
|
|
|
221
221
|
return n.accept.some((e) => {
|
|
222
222
|
let n = e.toLowerCase();
|
|
223
223
|
return n.startsWith(".") ? t.endsWith(n) : r === n;
|
|
224
|
-
}) ? !0 : (Q.error(u("components.importDialog.fileTypeInvalid", { types:
|
|
224
|
+
}) ? !0 : (Q.error(u("components.importDialog.fileTypeInvalid", { types: H.value })), !1);
|
|
225
225
|
}
|
|
226
226
|
function be(e) {
|
|
227
227
|
let t = new Map((e ?? []).map((e) => [e.targetField, e]));
|
|
@@ -273,10 +273,10 @@ var _n = {
|
|
|
273
273
|
}
|
|
274
274
|
function Te(e) {
|
|
275
275
|
let t = e.raw;
|
|
276
|
-
s.value?.clearFiles(), t && ye(t) && (d.value = t, f.value = t.name, c.value = "upload",
|
|
276
|
+
s.value?.clearFiles(), t && ye(t) && (d.value = t, f.value = t.name, c.value = "upload", fe(), i("fileChange", t));
|
|
277
277
|
}
|
|
278
278
|
function ke(e) {
|
|
279
|
-
typeof e == "string" && (l.value = e,
|
|
279
|
+
typeof e == "string" && (l.value = e, fe(), c.value = "upload");
|
|
280
280
|
}
|
|
281
281
|
async function je(e) {
|
|
282
282
|
e && d.value && await we(e);
|
|
@@ -302,7 +302,7 @@ var _n = {
|
|
|
302
302
|
else {
|
|
303
303
|
c.value = "importing", O.value = !0, A.value = 8, j.value = u("components.importDialog.importingStart");
|
|
304
304
|
try {
|
|
305
|
-
let e = Se(await
|
|
305
|
+
let e = Se(await vn.upload(he(n.api), {
|
|
306
306
|
file: d.value,
|
|
307
307
|
mode: l.value
|
|
308
308
|
}, { onUploadProgress: (e) => {
|
|
@@ -353,8 +353,8 @@ var _n = {
|
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
return (e, t) => {
|
|
356
|
-
let n =
|
|
357
|
-
return L(), v(
|
|
356
|
+
let n = V("loading");
|
|
357
|
+
return L(), v(W(a), {
|
|
358
358
|
title: F.value,
|
|
359
359
|
class: "import-dialog__dialog w-[600px]",
|
|
360
360
|
closable: !1,
|
|
@@ -362,155 +362,155 @@ var _n = {
|
|
|
362
362
|
"close-on-press-escape": !O.value,
|
|
363
363
|
"fullscreen-button": !1
|
|
364
364
|
}, {
|
|
365
|
-
title:
|
|
365
|
+
title: q(() => [x("div", yn, [x("div", bn, U(F.value), 1), x("div", xn, [w(W(Y), {
|
|
366
366
|
text: "",
|
|
367
367
|
circle: "",
|
|
368
368
|
class: "import-dialog__action",
|
|
369
369
|
onClick: pe
|
|
370
370
|
}, {
|
|
371
|
-
default:
|
|
372
|
-
default:
|
|
371
|
+
default: q(() => [w(W(Z), { size: 16 }, {
|
|
372
|
+
default: q(() => [k.value ? (L(), v(W(ot), { key: 0 })) : (L(), v(W($e), { key: 1 }))]),
|
|
373
373
|
_: 1
|
|
374
374
|
})]),
|
|
375
375
|
_: 1
|
|
376
|
-
}), w(
|
|
376
|
+
}), w(W(Y), {
|
|
377
377
|
text: "",
|
|
378
378
|
circle: "",
|
|
379
379
|
class: "import-dialog__action",
|
|
380
|
-
onClick:
|
|
380
|
+
onClick: X
|
|
381
381
|
}, {
|
|
382
|
-
default:
|
|
383
|
-
default:
|
|
382
|
+
default: q(() => [w(W(Z), { size: 16 }, {
|
|
383
|
+
default: q(() => [w(W(Ye))]),
|
|
384
384
|
_: 1
|
|
385
385
|
})]),
|
|
386
386
|
_: 1
|
|
387
387
|
})])])]),
|
|
388
|
-
footer:
|
|
389
|
-
default:
|
|
388
|
+
footer: q(() => [x("div", er, [c.value === "preview" || c.value === "mapping" ? (L(), b(g, { key: 0 }, [w(W(Y), { onClick: Le }, {
|
|
389
|
+
default: q(() => [C(U(W(u)("components.importDialog.previous")), 1)]),
|
|
390
390
|
_: 1
|
|
391
|
-
}), w(
|
|
391
|
+
}), w(W(Y), {
|
|
392
392
|
type: "primary",
|
|
393
393
|
loading: D.value || O.value,
|
|
394
394
|
onClick: Ne
|
|
395
395
|
}, {
|
|
396
|
-
default:
|
|
396
|
+
default: q(() => [C(U(c.value === "mapping" ? W(u)("components.importDialog.startImport") : W(u)("components.importDialog.next")), 1)]),
|
|
397
397
|
_: 1
|
|
398
|
-
}, 8, ["loading"])], 64)) : c.value === "upload" ? (L(), v(
|
|
398
|
+
}, 8, ["loading"])], 64)) : c.value === "upload" ? (L(), v(W(Y), {
|
|
399
399
|
key: 1,
|
|
400
400
|
type: "primary",
|
|
401
401
|
loading: D.value || O.value,
|
|
402
402
|
onClick: Ne
|
|
403
403
|
}, {
|
|
404
|
-
default:
|
|
404
|
+
default: q(() => [C(U(I.value ? W(u)("components.importDialog.startImport") : W(u)("components.importDialog.next")), 1)]),
|
|
405
405
|
_: 1
|
|
406
|
-
}, 8, ["loading"])) : (L(), v(
|
|
406
|
+
}, 8, ["loading"])) : (L(), v(W(Y), {
|
|
407
407
|
key: 2,
|
|
408
|
-
onClick:
|
|
408
|
+
onClick: X
|
|
409
409
|
}, {
|
|
410
|
-
default:
|
|
410
|
+
default: q(() => [C(U(W(u)("common.close")), 1)]),
|
|
411
411
|
_: 1
|
|
412
412
|
}))])]),
|
|
413
|
-
default:
|
|
413
|
+
default: q(() => [x("div", Sn, [re.value ? (L(), b("div", Cn, [(L(!0), b(g, null, z(le.value, (e, t) => (L(), b("div", {
|
|
414
414
|
key: e,
|
|
415
415
|
class: "import-dialog__step"
|
|
416
416
|
}, [
|
|
417
417
|
x("div", { class: N(["import-dialog__step-node", {
|
|
418
418
|
"is-active": c.value === "upload" && t === 0 || c.value === "preview" && t === 1 || c.value === "mapping" && t === 2 || c.value === "importing" && t === 3,
|
|
419
419
|
"is-done": c.value === "preview" && t === 0 || c.value === "mapping" && t <= 1 || c.value === "importing" && t <= 2
|
|
420
|
-
}]) }, [c.value === "preview" && t === 0 || c.value === "mapping" && t <= 1 || c.value === "importing" && t <= 2 ? (L(), v(
|
|
421
|
-
default:
|
|
420
|
+
}]) }, [c.value === "preview" && t === 0 || c.value === "mapping" && t <= 1 || c.value === "importing" && t <= 2 ? (L(), v(W(Z), { key: 0 }, {
|
|
421
|
+
default: q(() => [w(W(Je))]),
|
|
422
422
|
_: 1
|
|
423
|
-
})) : (L(), b("span",
|
|
424
|
-
x("div",
|
|
425
|
-
t ===
|
|
423
|
+
})) : (L(), b("span", wn, U(t + 1), 1))], 2),
|
|
424
|
+
x("div", Tn, U(e), 1),
|
|
425
|
+
t === le.value.length - 1 ? y("", !0) : (L(), b("div", {
|
|
426
426
|
key: 0,
|
|
427
427
|
class: N(["import-dialog__step-line", { "is-active": c.value === "preview" && t === 0 || c.value === "mapping" && t <= 1 || c.value === "importing" && t <= 2 }])
|
|
428
428
|
}, null, 2))
|
|
429
429
|
]))), 128))])) : y("", !0), c.value === "upload" ? (L(), b(g, { key: 1 }, [
|
|
430
|
-
x("div",
|
|
431
|
-
default:
|
|
432
|
-
default:
|
|
430
|
+
x("div", En, [x("span", null, U(W(u)("components.importDialog.modeLabel")), 1), w(W(Re), { content: W(u)("components.importDialog.modeHelp") }, {
|
|
431
|
+
default: q(() => [w(W(Z), { class: "import-dialog__info" }, {
|
|
432
|
+
default: q(() => [w(W(et))]),
|
|
433
433
|
_: 1
|
|
434
434
|
})]),
|
|
435
435
|
_: 1
|
|
436
436
|
}, 8, ["content"])]),
|
|
437
|
-
w(
|
|
437
|
+
w(W(Oe), {
|
|
438
438
|
"model-value": l.value,
|
|
439
439
|
class: "import-dialog__mode-group",
|
|
440
440
|
"onUpdate:modelValue": ke
|
|
441
441
|
}, {
|
|
442
|
-
default:
|
|
442
|
+
default: q(() => [(L(!0), b(g, null, z(ee.value, (e) => (L(), v(W(De), {
|
|
443
443
|
key: e.value,
|
|
444
444
|
label: e.value,
|
|
445
445
|
disabled: e.disabled
|
|
446
446
|
}, {
|
|
447
|
-
default:
|
|
447
|
+
default: q(() => [C(U(e.label), 1)]),
|
|
448
448
|
_: 2
|
|
449
449
|
}, 1032, ["label", "disabled"]))), 128))]),
|
|
450
450
|
_: 1
|
|
451
451
|
}, 8, ["model-value"]),
|
|
452
|
-
w(
|
|
452
|
+
w(W(ze), {
|
|
453
453
|
ref_key: "uploadRef",
|
|
454
454
|
ref: s,
|
|
455
455
|
class: "import-dialog__upload",
|
|
456
456
|
drag: "",
|
|
457
457
|
"auto-upload": !1,
|
|
458
458
|
"show-file-list": !1,
|
|
459
|
-
accept:
|
|
459
|
+
accept: te.value,
|
|
460
460
|
"on-change": Te
|
|
461
461
|
}, {
|
|
462
|
-
default:
|
|
463
|
-
x("div",
|
|
464
|
-
default:
|
|
462
|
+
default: q(() => [x("div", Dn, [
|
|
463
|
+
x("div", On, [w(W(Z), { size: 20 }, {
|
|
464
|
+
default: q(() => [w(W(rt))]),
|
|
465
465
|
_: 1
|
|
466
466
|
})]),
|
|
467
|
-
x("div",
|
|
468
|
-
x("div",
|
|
469
|
-
|
|
467
|
+
x("div", kn, [C(U(W(u)("components.importDialog.uploadPlaceholder")) + " ", 1), x("span", An, U(W(u)("components.importDialog.selectUpload")), 1)]),
|
|
468
|
+
x("div", jn, U(W(u)("components.importDialog.supportedTypes", { types: H.value })), 1),
|
|
469
|
+
G.value ? (L(), b("div", Mn, U(G.value), 1)) : y("", !0)
|
|
470
470
|
])]),
|
|
471
471
|
_: 1
|
|
472
472
|
}, 8, ["accept"]),
|
|
473
|
-
x("div",
|
|
474
|
-
w(
|
|
475
|
-
default:
|
|
473
|
+
x("div", Nn, [
|
|
474
|
+
w(W(Z), { size: 14 }, {
|
|
475
|
+
default: q(() => [w(W(Qe))]),
|
|
476
476
|
_: 1
|
|
477
477
|
}),
|
|
478
|
-
x("span", null, W(
|
|
478
|
+
x("span", null, U(W(u)("components.importDialog.templateText")), 1),
|
|
479
479
|
x("button", {
|
|
480
480
|
type: "button",
|
|
481
481
|
class: "import-dialog__download-button",
|
|
482
482
|
onClick: me
|
|
483
|
-
}, W(
|
|
483
|
+
}, U(W(u)("components.importDialog.downloadTemplate")), 1)
|
|
484
484
|
]),
|
|
485
|
-
x("div",
|
|
485
|
+
x("div", Pn, [(L(!0), b(g, null, z(B.value, (e) => (L(), b("div", {
|
|
486
486
|
key: e,
|
|
487
487
|
class: "import-dialog__tip-item"
|
|
488
|
-
},
|
|
488
|
+
}, U(e), 1))), 128))])
|
|
489
489
|
], 64)) : c.value === "preview" ? (L(), b(g, { key: 2 }, [
|
|
490
|
-
x("div",
|
|
491
|
-
"model-value":
|
|
490
|
+
x("div", Fn, [x("div", In, [x("div", Ln, U(W(u)("components.importDialog.fileLabel")), 1), w(W(xe), {
|
|
491
|
+
"model-value": G.value,
|
|
492
492
|
readonly: ""
|
|
493
|
-
}, null, 8, ["model-value"])]), x("div",
|
|
493
|
+
}, null, 8, ["model-value"])]), x("div", Rn, [x("div", zn, U(W(u)("components.importDialog.sheetLabel")), 1), w(W(Ae), {
|
|
494
494
|
modelValue: m.value,
|
|
495
495
|
"onUpdate:modelValue": t[0] ||= (e) => m.value = e,
|
|
496
496
|
class: "import-dialog__sheet-select",
|
|
497
497
|
disabled: D.value,
|
|
498
498
|
onChange: je
|
|
499
499
|
}, {
|
|
500
|
-
default:
|
|
500
|
+
default: q(() => [(L(!0), b(g, null, z(p.value, (e) => (L(), v(W($), {
|
|
501
501
|
key: e.value,
|
|
502
502
|
label: e.label,
|
|
503
503
|
value: e.value
|
|
504
504
|
}, null, 8, ["label", "value"]))), 128))]),
|
|
505
505
|
_: 1
|
|
506
506
|
}, 8, ["modelValue", "disabled"])])]),
|
|
507
|
-
|
|
507
|
+
J((L(), v(W(Pe), {
|
|
508
508
|
data: S.value,
|
|
509
509
|
border: "",
|
|
510
510
|
height: "352",
|
|
511
511
|
class: "import-dialog__table"
|
|
512
512
|
}, {
|
|
513
|
-
default:
|
|
513
|
+
default: q(() => [(L(!0), b(g, null, z(h.value, (e) => (L(), v(W(Fe), {
|
|
514
514
|
key: e.prop,
|
|
515
515
|
prop: e.prop,
|
|
516
516
|
label: e.label,
|
|
@@ -525,23 +525,23 @@ var _n = {
|
|
|
525
525
|
]))), 128))]),
|
|
526
526
|
_: 1
|
|
527
527
|
}, 8, ["data"])), [[n, D.value]]),
|
|
528
|
-
x("div",
|
|
529
|
-
], 64)) : c.value === "mapping" ? (L(), b(g, { key: 3 }, [x("div",
|
|
530
|
-
x("div", null, W(
|
|
528
|
+
x("div", Bn, U(ie.value), 1)
|
|
529
|
+
], 64)) : c.value === "mapping" ? (L(), b(g, { key: 3 }, [x("div", Vn, [
|
|
530
|
+
x("div", null, U(W(u)("components.importDialog.mappingExcelColumn")), 1),
|
|
531
531
|
t[1] ||= x("div", null, null, -1),
|
|
532
|
-
x("div", null, W(
|
|
533
|
-
x("div", null, W(
|
|
534
|
-
]), x("div",
|
|
532
|
+
x("div", null, U(W(u)("components.importDialog.mappingTargetField")), 1),
|
|
533
|
+
x("div", null, U(W(u)("components.importDialog.mappingDuplicateLabel")), 1)
|
|
534
|
+
]), x("div", Hn, [(L(!0), b(g, null, z(E.value, (e) => (L(), b("div", {
|
|
535
535
|
key: e.targetField,
|
|
536
536
|
class: "import-dialog__mapping-row"
|
|
537
537
|
}, [
|
|
538
|
-
w(
|
|
538
|
+
w(W(Ae), {
|
|
539
539
|
modelValue: e.sourceColumn,
|
|
540
540
|
"onUpdate:modelValue": (t) => e.sourceColumn = t,
|
|
541
541
|
clearable: "",
|
|
542
|
-
placeholder:
|
|
542
|
+
placeholder: W(u)("common.pleaseSelect")
|
|
543
543
|
}, {
|
|
544
|
-
default:
|
|
544
|
+
default: q(() => [(L(!0), b(g, null, z(ae.value, (e) => (L(), v(W($), {
|
|
545
545
|
key: e.value,
|
|
546
546
|
label: e.label,
|
|
547
547
|
value: e.value
|
|
@@ -552,12 +552,12 @@ var _n = {
|
|
|
552
552
|
"onUpdate:modelValue",
|
|
553
553
|
"placeholder"
|
|
554
554
|
]),
|
|
555
|
-
x("div",
|
|
556
|
-
default:
|
|
555
|
+
x("div", Un, [w(W(Z), { size: 18 }, {
|
|
556
|
+
default: q(() => [w(W(Ge))]),
|
|
557
557
|
_: 1
|
|
558
558
|
})]),
|
|
559
|
-
x("div", { class: N(["import-dialog__mapping-target", { "is-required": e.required }]) },
|
|
560
|
-
x("div",
|
|
559
|
+
x("div", { class: N(["import-dialog__mapping-target", { "is-required": e.required }]) }, U(e.targetLabel), 3),
|
|
560
|
+
x("div", Wn, [w(W(de), {
|
|
561
561
|
modelValue: e.duplicateCheck,
|
|
562
562
|
"onUpdate:modelValue": (t) => e.duplicateCheck = t,
|
|
563
563
|
disabled: !e.allowDuplicateCheck
|
|
@@ -566,39 +566,39 @@ var _n = {
|
|
|
566
566
|
"onUpdate:modelValue",
|
|
567
567
|
"disabled"
|
|
568
568
|
])])
|
|
569
|
-
]))), 128))])], 64)) :
|
|
569
|
+
]))), 128))])], 64)) : ne.value ? (L(), b(g, { key: 4 }, [
|
|
570
570
|
x("div", { class: N(["import-dialog__result-illustration", {
|
|
571
571
|
"is-success": M.value?.success,
|
|
572
572
|
"is-error": !M.value?.success
|
|
573
|
-
}]) }, [t[2] ||= x("div", { class: "import-dialog__result-card" }, [x("div", { class: "import-dialog__result-layer" }), x("div", { class: "import-dialog__result-layer is-front" })], -1), x("div",
|
|
574
|
-
default:
|
|
573
|
+
}]) }, [t[2] ||= x("div", { class: "import-dialog__result-card" }, [x("div", { class: "import-dialog__result-layer" }), x("div", { class: "import-dialog__result-layer is-front" })], -1), x("div", Gn, [M.value?.success ? (L(), v(W(Z), { key: 0 }, {
|
|
574
|
+
default: q(() => [w(W(lt))]),
|
|
575
575
|
_: 1
|
|
576
|
-
})) : (L(), v(
|
|
577
|
-
default:
|
|
576
|
+
})) : (L(), v(W(Z), { key: 1 }, {
|
|
577
|
+
default: q(() => [w(W(ut))]),
|
|
578
578
|
_: 1
|
|
579
579
|
}))])], 2),
|
|
580
|
-
x("div",
|
|
581
|
-
x("div",
|
|
582
|
-
M.value?.detail ? (L(), b("div",
|
|
580
|
+
x("div", Kn, U(se.value), 1),
|
|
581
|
+
x("div", qn, U(ce.value), 1),
|
|
582
|
+
M.value?.detail ? (L(), b("div", Jn, U(M.value.detail), 1)) : y("", !0)
|
|
583
583
|
], 64)) : c.value === "importing" ? (L(), b(g, { key: 5 }, [
|
|
584
|
-
x("div",
|
|
584
|
+
x("div", Yn, [w(W(Ee), {
|
|
585
585
|
percentage: A.value,
|
|
586
586
|
"stroke-width": 10,
|
|
587
587
|
"show-text": !1,
|
|
588
588
|
color: "var(--color-success)"
|
|
589
|
-
}, null, 8, ["percentage"]), x("div",
|
|
590
|
-
default:
|
|
589
|
+
}, null, 8, ["percentage"]), x("div", Xn, [w(W(Z), { color: "var(--color-success)" }, {
|
|
590
|
+
default: q(() => [w(W(lt))]),
|
|
591
591
|
_: 1
|
|
592
592
|
})])]),
|
|
593
|
-
x("div",
|
|
594
|
-
x("div",
|
|
595
|
-
x("div",
|
|
593
|
+
x("div", Zn, U(W(u)("components.importDialog.importingTitle")), 1),
|
|
594
|
+
x("div", Qn, U(oe.value), 1),
|
|
595
|
+
x("div", $n, U(W(u)("components.importDialog.importingHint")), 1)
|
|
596
596
|
], 64)) : y("", !0)])]),
|
|
597
597
|
_: 1
|
|
598
598
|
}, 8, ["title", "close-on-press-escape"]);
|
|
599
599
|
};
|
|
600
600
|
}
|
|
601
|
-
}), [["__scopeId", "data-v-130e30bd"]]),
|
|
601
|
+
}), [["__scopeId", "data-v-130e30bd"]]), nr = { class: "column-settings-panel" }, rr = { class: "column-settings-panel__header" }, ir = { class: "column-settings-panel__title" }, ar = { class: "column-settings-panel__list" }, or = { class: "column-settings-panel__head" }, sr = { class: "column-settings-panel__drag-handle" }, cr = { class: "column-settings-panel__label" }, lr = { class: "column-settings-panel__footer" }, ur = { class: "column-settings-panel__count" }, dr = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
602
602
|
__name: "ColumnSettingsPanel",
|
|
603
603
|
props: {
|
|
604
604
|
settings: {},
|
|
@@ -614,8 +614,8 @@ var _n = {
|
|
|
614
614
|
"reset"
|
|
615
615
|
],
|
|
616
616
|
setup(e, { emit: t }) {
|
|
617
|
-
let n = e, r = t, i =
|
|
618
|
-
|
|
617
|
+
let n = e, r = t, i = R([...n.settings]);
|
|
618
|
+
K(() => n.settings, (e) => {
|
|
619
619
|
i.value = e.map((e) => ({ ...e }));
|
|
620
620
|
}, { deep: !0 });
|
|
621
621
|
let a = _(() => i.value.filter((e) => e.visible).length);
|
|
@@ -631,25 +631,25 @@ var _n = {
|
|
|
631
631
|
function l(e) {
|
|
632
632
|
return n.fixedItems.find((t) => t.key === e)?.fixed ?? !1;
|
|
633
633
|
}
|
|
634
|
-
return (e, t) => (L(), b("div",
|
|
635
|
-
x("div",
|
|
634
|
+
return (e, t) => (L(), b("div", nr, [
|
|
635
|
+
x("div", rr, [x("span", ir, U(W(u)("components.tableEntity.columnSettings")), 1), w(W(Y), {
|
|
636
636
|
type: "primary",
|
|
637
637
|
link: "",
|
|
638
638
|
size: "small",
|
|
639
639
|
onClick: c
|
|
640
640
|
}, {
|
|
641
|
-
default:
|
|
641
|
+
default: q(() => [C(U(W(u)("components.tableEntity.restoreDefault")), 1)]),
|
|
642
642
|
_: 1
|
|
643
643
|
})]),
|
|
644
|
-
x("div",
|
|
644
|
+
x("div", ar, [x("div", or, [
|
|
645
645
|
t[1] ||= x("span", null, null, -1),
|
|
646
|
-
x("span", null, W(
|
|
647
|
-
x("span", null, W(
|
|
648
|
-
x("span", null, W(
|
|
649
|
-
x("span", null, W(
|
|
650
|
-
x("span", null, W(
|
|
651
|
-
x("span", null, W(
|
|
652
|
-
]), w(
|
|
646
|
+
x("span", null, U(W(u)("components.tableEntity.display")), 1),
|
|
647
|
+
x("span", null, U(W(u)("components.tableEntity.columnName")), 1),
|
|
648
|
+
x("span", null, U(W(u)("components.tableEntity.width")), 1),
|
|
649
|
+
x("span", null, U(W(u)("components.tableEntity.headerAlign")), 1),
|
|
650
|
+
x("span", null, U(W(u)("components.tableEntity.contentAlign")), 1),
|
|
651
|
+
x("span", null, U(W(u)("components.tableEntity.fixedColumn")), 1)
|
|
652
|
+
]), w(W(mt), {
|
|
653
653
|
modelValue: i.value,
|
|
654
654
|
"onUpdate:modelValue": t[0] ||= (e) => i.value = e,
|
|
655
655
|
animation: 200,
|
|
@@ -657,22 +657,22 @@ var _n = {
|
|
|
657
657
|
"ghost-class": "column-settings-panel__ghost",
|
|
658
658
|
onUpdate: o
|
|
659
659
|
}, {
|
|
660
|
-
default:
|
|
660
|
+
default: q(() => [(L(!0), b(g, null, z(i.value, (e) => (L(), b("div", {
|
|
661
661
|
key: e.key,
|
|
662
662
|
class: N(["column-settings-panel__item", { "column-settings-panel__item--hidden": !e.visible }])
|
|
663
663
|
}, [
|
|
664
|
-
x("span",
|
|
665
|
-
default:
|
|
664
|
+
x("span", sr, [w(W(Z), null, {
|
|
665
|
+
default: q(() => [w(W(nt))]),
|
|
666
666
|
_: 1
|
|
667
667
|
})]),
|
|
668
|
-
w(
|
|
668
|
+
w(W(Me), {
|
|
669
669
|
"model-value": e.visible,
|
|
670
670
|
size: "small",
|
|
671
671
|
class: "column-settings-panel__checkbox",
|
|
672
672
|
onChange: (t) => s(e.key)
|
|
673
673
|
}, null, 8, ["model-value", "onChange"]),
|
|
674
|
-
x("span",
|
|
675
|
-
w(
|
|
674
|
+
x("span", cr, U(e.title), 1),
|
|
675
|
+
w(W(Se), {
|
|
676
676
|
"model-value": e.column.width ?? 120,
|
|
677
677
|
min: 50,
|
|
678
678
|
controls: !1,
|
|
@@ -680,67 +680,67 @@ var _n = {
|
|
|
680
680
|
class: "column-settings-panel__width",
|
|
681
681
|
onChange: (t) => r("setWidth", e.key, Number(t) || 120)
|
|
682
682
|
}, null, 8, ["model-value", "onChange"]),
|
|
683
|
-
w(
|
|
683
|
+
w(W(Ae), {
|
|
684
684
|
"model-value": e.headerAlign,
|
|
685
685
|
size: "small",
|
|
686
686
|
class: "column-settings-panel__select",
|
|
687
687
|
onChange: (t) => r("setHeaderAlign", e.key, t)
|
|
688
688
|
}, {
|
|
689
|
-
default:
|
|
690
|
-
w(
|
|
691
|
-
label:
|
|
689
|
+
default: q(() => [
|
|
690
|
+
w(W($), {
|
|
691
|
+
label: W(u)("components.tableEntity.left"),
|
|
692
692
|
value: "left"
|
|
693
693
|
}, null, 8, ["label"]),
|
|
694
|
-
w(
|
|
695
|
-
label:
|
|
694
|
+
w(W($), {
|
|
695
|
+
label: W(u)("components.tableEntity.center"),
|
|
696
696
|
value: "center"
|
|
697
697
|
}, null, 8, ["label"]),
|
|
698
|
-
w(
|
|
699
|
-
label:
|
|
698
|
+
w(W($), {
|
|
699
|
+
label: W(u)("components.tableEntity.right"),
|
|
700
700
|
value: "right"
|
|
701
701
|
}, null, 8, ["label"])
|
|
702
702
|
]),
|
|
703
703
|
_: 1
|
|
704
704
|
}, 8, ["model-value", "onChange"]),
|
|
705
|
-
w(
|
|
705
|
+
w(W(Ae), {
|
|
706
706
|
"model-value": e.contentAlign,
|
|
707
707
|
size: "small",
|
|
708
708
|
class: "column-settings-panel__select",
|
|
709
709
|
onChange: (t) => r("setContentAlign", e.key, t)
|
|
710
710
|
}, {
|
|
711
|
-
default:
|
|
712
|
-
w(
|
|
713
|
-
label:
|
|
711
|
+
default: q(() => [
|
|
712
|
+
w(W($), {
|
|
713
|
+
label: W(u)("components.tableEntity.left"),
|
|
714
714
|
value: "left"
|
|
715
715
|
}, null, 8, ["label"]),
|
|
716
|
-
w(
|
|
717
|
-
label:
|
|
716
|
+
w(W($), {
|
|
717
|
+
label: W(u)("components.tableEntity.center"),
|
|
718
718
|
value: "center"
|
|
719
719
|
}, null, 8, ["label"]),
|
|
720
|
-
w(
|
|
721
|
-
label:
|
|
720
|
+
w(W($), {
|
|
721
|
+
label: W(u)("components.tableEntity.right"),
|
|
722
722
|
value: "right"
|
|
723
723
|
}, null, 8, ["label"])
|
|
724
724
|
]),
|
|
725
725
|
_: 1
|
|
726
726
|
}, 8, ["model-value", "onChange"]),
|
|
727
|
-
w(
|
|
727
|
+
w(W(Ae), {
|
|
728
728
|
"model-value": l(e.key),
|
|
729
729
|
size: "small",
|
|
730
730
|
class: "column-settings-panel__select",
|
|
731
731
|
onChange: (t) => r("setFixed", e.key, t ?? !1)
|
|
732
732
|
}, {
|
|
733
|
-
default:
|
|
734
|
-
w(
|
|
735
|
-
label:
|
|
733
|
+
default: q(() => [
|
|
734
|
+
w(W($), {
|
|
735
|
+
label: W(u)("components.tableEntity.unfixed"),
|
|
736
736
|
value: !1
|
|
737
737
|
}, null, 8, ["label"]),
|
|
738
|
-
w(
|
|
739
|
-
label:
|
|
738
|
+
w(W($), {
|
|
739
|
+
label: W(u)("components.tableEntity.leftFixed"),
|
|
740
740
|
value: "left"
|
|
741
741
|
}, null, 8, ["label"]),
|
|
742
|
-
w(
|
|
743
|
-
label:
|
|
742
|
+
w(W($), {
|
|
743
|
+
label: W(u)("components.tableEntity.rightFixed"),
|
|
744
744
|
value: "right"
|
|
745
745
|
}, null, 8, ["label"])
|
|
746
746
|
]),
|
|
@@ -749,7 +749,7 @@ var _n = {
|
|
|
749
749
|
], 2))), 128))]),
|
|
750
750
|
_: 1
|
|
751
751
|
}, 8, ["modelValue"])]),
|
|
752
|
-
x("div",
|
|
752
|
+
x("div", lr, [x("span", ur, U(W(u)("components.tableEntity.visibleCount", {
|
|
753
753
|
visible: a.value,
|
|
754
754
|
total: i.value.length
|
|
755
755
|
})), 1)])
|
|
@@ -757,20 +757,20 @@ var _n = {
|
|
|
757
757
|
}
|
|
758
758
|
}), [["__scopeId", "data-v-a07ab19c"]]);
|
|
759
759
|
// src/components/table-entity/composables/use-column-fixed.ts
|
|
760
|
-
function
|
|
761
|
-
let t =
|
|
760
|
+
function fr(e) {
|
|
761
|
+
let t = R({});
|
|
762
762
|
function n(e) {
|
|
763
763
|
return e.fixed === !0 || e.fixed === "left" ? "left" : e.fixed === "right" && "right";
|
|
764
764
|
}
|
|
765
765
|
function r(e) {
|
|
766
766
|
let t = {};
|
|
767
767
|
for (let r of e) {
|
|
768
|
-
let e =
|
|
768
|
+
let e = pr(r);
|
|
769
769
|
e && (t[e] = n(r));
|
|
770
770
|
}
|
|
771
771
|
return t;
|
|
772
772
|
}
|
|
773
|
-
|
|
773
|
+
K(() => e.value, (e) => {
|
|
774
774
|
let n = r(e), i = {};
|
|
775
775
|
for (let e of Object.keys(n)) i[e] = e in t.value ? t.value[e] ?? !1 : n[e] ?? !1;
|
|
776
776
|
t.value = i;
|
|
@@ -781,7 +781,7 @@ function dr(e) {
|
|
|
781
781
|
let i = _(() => {
|
|
782
782
|
let t = {};
|
|
783
783
|
for (let n of e.value) {
|
|
784
|
-
let e =
|
|
784
|
+
let e = pr(n);
|
|
785
785
|
e && (t[e] = n);
|
|
786
786
|
}
|
|
787
787
|
return t;
|
|
@@ -808,7 +808,7 @@ function dr(e) {
|
|
|
808
808
|
}
|
|
809
809
|
function c(e) {
|
|
810
810
|
return e.map((e) => {
|
|
811
|
-
let n =
|
|
811
|
+
let n = pr(e);
|
|
812
812
|
if (!n || !(n in t.value)) return e;
|
|
813
813
|
let r = t.value[n] ?? !1;
|
|
814
814
|
return {
|
|
@@ -824,12 +824,12 @@ function dr(e) {
|
|
|
824
824
|
applyFixed: c
|
|
825
825
|
};
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function pr(e) {
|
|
828
828
|
return e.key ?? e.dataKey ?? "";
|
|
829
829
|
}
|
|
830
830
|
// src/components/table-entity/composables/use-column-resize.ts
|
|
831
|
-
function
|
|
832
|
-
let t =
|
|
831
|
+
function mr(e = 50) {
|
|
832
|
+
let t = ee({}), n = ee({
|
|
833
833
|
active: !1,
|
|
834
834
|
colKey: null,
|
|
835
835
|
startX: 0,
|
|
@@ -881,12 +881,12 @@ function pr(e = 50) {
|
|
|
881
881
|
};
|
|
882
882
|
}
|
|
883
883
|
// src/components/table-entity/composables/use-column-settings.ts
|
|
884
|
-
function
|
|
885
|
-
let t =
|
|
884
|
+
function hr(e) {
|
|
885
|
+
let t = R([]), n = R(/* @__PURE__ */ new Set()), r = R({}), i = R({}), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = {};
|
|
886
886
|
function c(e) {
|
|
887
|
-
return e.filter((e) => !!e).filter((e) => !!
|
|
887
|
+
return e.filter((e) => !!e).filter((e) => !!_r(e)).map((e) => _r(e));
|
|
888
888
|
}
|
|
889
|
-
|
|
889
|
+
K(() => e.value, (e) => {
|
|
890
890
|
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));
|
|
891
891
|
if (p.length > 0 || m.length > 0) {
|
|
892
892
|
let e = l.filter((e) => f.has(e));
|
|
@@ -899,9 +899,9 @@ function mr(e) {
|
|
|
899
899
|
let h = { ...r.value }, g = { ...i.value };
|
|
900
900
|
for (let t of e) {
|
|
901
901
|
if (!t) continue;
|
|
902
|
-
let e =
|
|
902
|
+
let e = _r(t);
|
|
903
903
|
if (!e) continue;
|
|
904
|
-
let n =
|
|
904
|
+
let n = gr(t.headerAlign ?? t.align), r = gr(t.align), i = s[e];
|
|
905
905
|
i && i.headerAlign === n || (h[e] = n), i && i.contentAlign === r || (g[e] = r), s[e] = {
|
|
906
906
|
headerAlign: n,
|
|
907
907
|
contentAlign: r
|
|
@@ -918,7 +918,7 @@ function mr(e) {
|
|
|
918
918
|
let t = {};
|
|
919
919
|
for (let n of e.value) {
|
|
920
920
|
if (!n) continue;
|
|
921
|
-
let e =
|
|
921
|
+
let e = _r(n);
|
|
922
922
|
e && (t[e] = n);
|
|
923
923
|
}
|
|
924
924
|
return t;
|
|
@@ -929,8 +929,8 @@ function mr(e) {
|
|
|
929
929
|
title: e[t]?.title || t,
|
|
930
930
|
visible: !n.value.has(t),
|
|
931
931
|
column: e[t],
|
|
932
|
-
headerAlign: r.value[t] ??
|
|
933
|
-
contentAlign: i.value[t] ??
|
|
932
|
+
headerAlign: r.value[t] ?? gr(e[t]?.headerAlign ?? e[t]?.align),
|
|
933
|
+
contentAlign: i.value[t] ?? gr(e[t]?.align)
|
|
934
934
|
}));
|
|
935
935
|
}), d = _(() => u.value.filter((e) => e.visible).map((e) => e.column)), f = _(() => u.value.filter((e) => !e.visible));
|
|
936
936
|
function p(e) {
|
|
@@ -953,18 +953,18 @@ function mr(e) {
|
|
|
953
953
|
}, o.add(e);
|
|
954
954
|
}
|
|
955
955
|
function v(t, n) {
|
|
956
|
-
let r = e.value.find((e) =>
|
|
956
|
+
let r = e.value.find((e) => _r(e) === t);
|
|
957
957
|
r && (r.width = n);
|
|
958
958
|
}
|
|
959
959
|
function y() {
|
|
960
960
|
n.value = /* @__PURE__ */ new Set();
|
|
961
961
|
}
|
|
962
962
|
function b() {
|
|
963
|
-
a.clear(), o.clear(), t.value = c(e.value), n.value = /* @__PURE__ */ new Set(), r.value = Object.fromEntries(e.value.filter(Boolean).map((e) => [
|
|
963
|
+
a.clear(), o.clear(), t.value = c(e.value), n.value = /* @__PURE__ */ new Set(), r.value = Object.fromEntries(e.value.filter(Boolean).map((e) => [_r(e), gr(e.headerAlign ?? e.align)]).filter(([e]) => e)), i.value = Object.fromEntries(e.value.filter(Boolean).map((e) => [_r(e), gr(e.align)]).filter(([e]) => e));
|
|
964
964
|
}
|
|
965
965
|
function x(e) {
|
|
966
966
|
return e.map((e) => {
|
|
967
|
-
let t =
|
|
967
|
+
let t = _r(e), n = t && a.has(t) ? r.value[t] : e.headerAlign ?? e.align, s = t && o.has(t) ? i.value[t] : e.align;
|
|
968
968
|
return {
|
|
969
969
|
...e,
|
|
970
970
|
...s ? { align: s } : {},
|
|
@@ -988,36 +988,36 @@ function mr(e) {
|
|
|
988
988
|
reset: b
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function gr(e) {
|
|
992
992
|
let t = e?.align;
|
|
993
993
|
return t === "center" || t === "right" ? t : "left";
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function _r(e) {
|
|
996
996
|
return e.key ?? e.dataKey ?? "";
|
|
997
997
|
}
|
|
998
998
|
// src/components/table-entity/composables/use-row-drag.ts
|
|
999
|
-
function
|
|
999
|
+
function vr(e, t) {
|
|
1000
1000
|
let n = Number(e.dataset.rowIndex);
|
|
1001
1001
|
if (Number.isInteger(n) && n >= 0) return n;
|
|
1002
1002
|
let r = Number.parseFloat(e.style.top);
|
|
1003
1003
|
return Number.isFinite(r) && t > 0 ? Math.round(r / t) : null;
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1005
|
+
function yr(e) {
|
|
1006
1006
|
return Array.from(e.querySelectorAll(".el-table-v2__body .el-table-v2__row"));
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1008
|
+
function br(e) {
|
|
1009
1009
|
if (e) {
|
|
1010
|
-
for (let t of
|
|
1010
|
+
for (let t of yr(e)) t.style.transition = "", t.style.transform = "", t.style.zIndex = "", t.classList.remove("table-entity__row--lift");
|
|
1011
1011
|
e.classList.remove("table-entity--row-dragging");
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1014
|
+
function xr(e, t, n) {
|
|
1015
1015
|
if (t === n || t < 0 || n < 0 || t >= e.length || n >= e.length) return e;
|
|
1016
1016
|
let r = [...e], [i] = r.splice(t, 1);
|
|
1017
1017
|
return i === void 0 ? e : (r.splice(n, 0, i), r);
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1020
|
-
let t =
|
|
1019
|
+
function Sr(e) {
|
|
1020
|
+
let t = R(null), n = R(null), r = 0, i = 0, a = !1, o = "", s = "";
|
|
1021
1021
|
function c(t, n, r) {
|
|
1022
1022
|
let i = e.getRows();
|
|
1023
1023
|
if (t < 0 || t >= i.length) return null;
|
|
@@ -1036,8 +1036,8 @@ function xr(e) {
|
|
|
1036
1036
|
if (!i || a == null || o == null) return;
|
|
1037
1037
|
let s = e.getRowHeight();
|
|
1038
1038
|
i.classList.add("table-entity--row-dragging");
|
|
1039
|
-
for (let t of
|
|
1040
|
-
let n =
|
|
1039
|
+
for (let t of yr(i)) {
|
|
1040
|
+
let n = vr(t, s);
|
|
1041
1041
|
if (n == null) continue;
|
|
1042
1042
|
if (n === a) {
|
|
1043
1043
|
t.classList.add("table-entity__row--lift"), t.style.zIndex = "5", t.style.transition = "none", t.style.transform = `translateY(${r}px)`;
|
|
@@ -1053,7 +1053,7 @@ function xr(e) {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
function u(e) {
|
|
1055
1055
|
let t = /* @__PURE__ */ new Map();
|
|
1056
|
-
for (let n of
|
|
1056
|
+
for (let n of yr(e)) {
|
|
1057
1057
|
let e = n.dataset.rowKey;
|
|
1058
1058
|
e && t.set(e, n.getBoundingClientRect().top);
|
|
1059
1059
|
}
|
|
@@ -1061,9 +1061,9 @@ function xr(e) {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
function d(e, t) {
|
|
1063
1063
|
let n = [];
|
|
1064
|
-
for (let t of
|
|
1064
|
+
for (let t of yr(e)) t.style.transition = "none", t.style.transform = "";
|
|
1065
1065
|
e.getBoundingClientRect();
|
|
1066
|
-
for (let r of
|
|
1066
|
+
for (let r of yr(e)) {
|
|
1067
1067
|
let e = r.dataset.rowKey, i = e ? t.get(e) : void 0;
|
|
1068
1068
|
if (i == null) continue;
|
|
1069
1069
|
let a = i - r.getBoundingClientRect().top;
|
|
@@ -1080,7 +1080,7 @@ function xr(e) {
|
|
|
1080
1080
|
});
|
|
1081
1081
|
}
|
|
1082
1082
|
function f() {
|
|
1083
|
-
|
|
1083
|
+
br(e.getRoot()), t.value = null, n.value = null, document.removeEventListener("pointermove", p), document.removeEventListener("pointerup", m), document.body.style.cursor = o, document.body.style.userSelect = s;
|
|
1084
1084
|
}
|
|
1085
1085
|
function p(o) {
|
|
1086
1086
|
let s = e.getRoot(), u = t.value;
|
|
@@ -1114,7 +1114,7 @@ function xr(e) {
|
|
|
1114
1114
|
if (!d || !u.closest(d)) return;
|
|
1115
1115
|
let f = u.closest(".el-table-v2__row");
|
|
1116
1116
|
if (!f || !l.contains(f)) return;
|
|
1117
|
-
let h =
|
|
1117
|
+
let h = vr(f, e.getRowHeight()), g = h == null ? void 0 : e.getRows()[h];
|
|
1118
1118
|
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));
|
|
1119
1119
|
}
|
|
1120
1120
|
return I(f), {
|
|
@@ -1124,12 +1124,12 @@ function xr(e) {
|
|
|
1124
1124
|
};
|
|
1125
1125
|
}
|
|
1126
1126
|
// src/components/table-entity/composables/use-table-selection.ts
|
|
1127
|
-
var
|
|
1128
|
-
function
|
|
1129
|
-
let i =
|
|
1130
|
-
|
|
1127
|
+
var Cr = 40;
|
|
1128
|
+
function wr(e, t, n, r = n) {
|
|
1129
|
+
let i = R(/* @__PURE__ */ new Set()), a = R(/* @__PURE__ */ new Map()), o = R(-1), s = () => e.rowKey ?? "id";
|
|
1130
|
+
K(() => e.selectedKeys, (e) => {
|
|
1131
1131
|
i.value = new Set(e ?? []);
|
|
1132
|
-
}, { immediate: !0 }),
|
|
1132
|
+
}, { immediate: !0 }), K(() => r.value, (e) => {
|
|
1133
1133
|
let t = s();
|
|
1134
1134
|
e.forEach((e) => {
|
|
1135
1135
|
let n = e[t];
|
|
@@ -1178,13 +1178,13 @@ function Cr(e, t, n, r = n) {
|
|
|
1178
1178
|
selectionColumn: _(() => ({
|
|
1179
1179
|
key: "__sel__",
|
|
1180
1180
|
dataKey: "__sel__",
|
|
1181
|
-
width:
|
|
1181
|
+
width: Cr,
|
|
1182
1182
|
align: "center",
|
|
1183
1183
|
headerAlign: "center",
|
|
1184
1184
|
fixed: Be.LEFT,
|
|
1185
1185
|
cellRenderer: ({ rowData: t, rowIndex: n }) => {
|
|
1186
1186
|
let r = l(t), i = o.value === n;
|
|
1187
|
-
return !r && !i ? O("span", { class: "sel-index" }, n + 1) : e.multiple ? O(
|
|
1187
|
+
return !r && !i ? O("span", { class: "sel-index" }, n + 1) : e.multiple ? O(de, {
|
|
1188
1188
|
modelValue: r,
|
|
1189
1189
|
onClick: (e) => {
|
|
1190
1190
|
e.stopPropagation(), u(t);
|
|
@@ -1196,7 +1196,7 @@ function Cr(e, t, n, r = n) {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
});
|
|
1198
1198
|
},
|
|
1199
|
-
headerCellRenderer: () => e.multiple ? O(
|
|
1199
|
+
headerCellRenderer: () => e.multiple ? O(de, {
|
|
1200
1200
|
modelValue: f.value,
|
|
1201
1201
|
indeterminate: p.value && !f.value,
|
|
1202
1202
|
disabled: n.value.length === 0,
|
|
@@ -1220,46 +1220,46 @@ function Cr(e, t, n, r = n) {
|
|
|
1220
1220
|
};
|
|
1221
1221
|
}
|
|
1222
1222
|
// src/runtime/dict.ts
|
|
1223
|
-
var
|
|
1223
|
+
var Tr = [
|
|
1224
1224
|
"disguise-ui",
|
|
1225
1225
|
"dict",
|
|
1226
1226
|
"all"
|
|
1227
1227
|
];
|
|
1228
|
-
function
|
|
1228
|
+
function Er() {
|
|
1229
1229
|
return l();
|
|
1230
1230
|
}
|
|
1231
1231
|
// src/composables/use-dict-data.ts
|
|
1232
|
-
function
|
|
1233
|
-
return
|
|
1234
|
-
queryKey:
|
|
1235
|
-
queryFn:
|
|
1236
|
-
enabled: _(() =>
|
|
1232
|
+
function Dr(e = !0) {
|
|
1233
|
+
return gt({
|
|
1234
|
+
queryKey: Tr,
|
|
1235
|
+
queryFn: Er,
|
|
1236
|
+
enabled: _(() => ie(e)),
|
|
1237
1237
|
staleTime: 18e5,
|
|
1238
1238
|
gcTime: 36e5,
|
|
1239
1239
|
refetchOnMount: !1,
|
|
1240
1240
|
refetchOnWindowFocus: !1
|
|
1241
1241
|
});
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1243
|
+
function Or(e) {
|
|
1244
1244
|
return e === void 0 || e === !0 || e === 1 || e === "1";
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1247
|
-
return (e ?? []).filter((e) =>
|
|
1246
|
+
function kr(e) {
|
|
1247
|
+
return (e ?? []).filter((e) => Or(e.status)).map((e) => ({
|
|
1248
1248
|
label: e.name ?? e.dictLabel ?? "",
|
|
1249
1249
|
value: String(e.code ?? e.dictValue ?? ""),
|
|
1250
1250
|
color: e.color ?? e.cssClass
|
|
1251
1251
|
}));
|
|
1252
1252
|
}
|
|
1253
|
-
function
|
|
1253
|
+
function Ar(e, t) {
|
|
1254
1254
|
if (t == null || t === "") return null;
|
|
1255
1255
|
let n = String(t);
|
|
1256
1256
|
return e.find((e) => String(e.code ?? e.dictValue ?? "") === n) ?? null;
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1259
|
-
let t =
|
|
1260
|
-
let n =
|
|
1258
|
+
function jr(e) {
|
|
1259
|
+
let t = Dr(() => !!ie(e)), n = _(() => {
|
|
1260
|
+
let n = ie(e);
|
|
1261
1261
|
return n ? t.data.value?.[n] ?? [] : [];
|
|
1262
|
-
}), r = _(() =>
|
|
1262
|
+
}), r = _(() => kr(n.value));
|
|
1263
1263
|
return {
|
|
1264
1264
|
...t,
|
|
1265
1265
|
items: n,
|
|
@@ -1267,7 +1267,7 @@ function Ar(e) {
|
|
|
1267
1267
|
};
|
|
1268
1268
|
}
|
|
1269
1269
|
// src/components/dict-tag/index.vue
|
|
1270
|
-
var
|
|
1270
|
+
var Mr = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
1271
1271
|
__name: "index",
|
|
1272
1272
|
props: {
|
|
1273
1273
|
code: { default: "" },
|
|
@@ -1290,19 +1290,19 @@ var jr = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
|
1290
1290
|
success: "dict-tag--success",
|
|
1291
1291
|
warning: "dict-tag--warning",
|
|
1292
1292
|
yellow: "dict-tag--warning"
|
|
1293
|
-
}, { items: r } =
|
|
1293
|
+
}, { items: r } = jr(_(() => t.code || t.dictType)), i = _(() => Ar(r.value, t.value)), a = _(() => t.label ?? i.value?.name ?? i.value?.dictLabel ?? (t.value === null || t.value === void 0 || t.value === "" ? "--" : String(t.value))), o = _(() => {
|
|
1294
1294
|
let e = t.color ?? i.value?.color ?? i.value?.cssClass;
|
|
1295
1295
|
return typeof e == "string" && e ? e : void 0;
|
|
1296
1296
|
}), s = _(() => o.value ? n[o.value] ?? "dict-tag--colored" : ""), c = _(() => o.value && !n[o.value] ? { "--dict-tag-color": o.value } : {});
|
|
1297
1297
|
return (e, t) => (L(), b("span", {
|
|
1298
1298
|
class: N(["dict-tag", s.value]),
|
|
1299
1299
|
style: F(c.value)
|
|
1300
|
-
},
|
|
1300
|
+
}, U(a.value), 7));
|
|
1301
1301
|
}
|
|
1302
|
-
}), [["__scopeId", "data-v-0d76da83"]]),
|
|
1302
|
+
}), [["__scopeId", "data-v-0d76da83"]]), Nr = { class: "file-cell flex items-center" }, Pr = {
|
|
1303
1303
|
key: 0,
|
|
1304
1304
|
class: "file-cell__list"
|
|
1305
|
-
},
|
|
1305
|
+
}, Fr = ["src"], Ir = {
|
|
1306
1306
|
key: 1,
|
|
1307
1307
|
style: {
|
|
1308
1308
|
"min-width": "200px",
|
|
@@ -1311,16 +1311,16 @@ var jr = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
|
1311
1311
|
"font-size": "13px",
|
|
1312
1312
|
"line-height": "1.6"
|
|
1313
1313
|
}
|
|
1314
|
-
},
|
|
1314
|
+
}, Lr = { style: {
|
|
1315
1315
|
"font-weight": "600",
|
|
1316
1316
|
"word-break": "break-all"
|
|
1317
|
-
} },
|
|
1317
|
+
} }, Rr = { style: { color: "#909399" } }, zr = {
|
|
1318
1318
|
key: 0,
|
|
1319
1319
|
style: { color: "#909399" }
|
|
1320
|
-
},
|
|
1320
|
+
}, Br = ["onClick"], Vr = { class: "file-icon-wrapper" }, Hr = ["src"], Ur = {
|
|
1321
1321
|
key: 1,
|
|
1322
1322
|
class: "file-cell__extra"
|
|
1323
|
-
},
|
|
1323
|
+
}, Wr = { key: 1 }, Gr = /*@__PURE__*/ E({
|
|
1324
1324
|
__name: "file-cell",
|
|
1325
1325
|
props: {
|
|
1326
1326
|
attachments: { default: null },
|
|
@@ -1370,7 +1370,7 @@ var jr = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
|
1370
1370
|
})), h = _(() => m.value.slice(0, t.maxPreviewCount)), S = _(() => Math.max(0, m.value.length - h.value.length)), C = (e) => {
|
|
1371
1371
|
e.fileUrl && window.open(e.fileUrl, "_blank");
|
|
1372
1372
|
}, w = (e) => !e || e <= 0 ? "" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(2)} MB`;
|
|
1373
|
-
return (t, r) => (L(), b("div",
|
|
1373
|
+
return (t, r) => (L(), b("div", Nr, [d.value.length > 0 || h.value.length > 0 ? (L(), b("div", Pr, [
|
|
1374
1374
|
d.value.length > 0 ? (L(), v(n, {
|
|
1375
1375
|
key: 0,
|
|
1376
1376
|
urls: d.value,
|
|
@@ -1378,7 +1378,7 @@ var jr = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
|
1378
1378
|
size: 26,
|
|
1379
1379
|
"image-list-props": {}
|
|
1380
1380
|
}, null, 8, ["urls", "max-preview-count"])) : y("", !0),
|
|
1381
|
-
(L(!0), b(g, null,
|
|
1381
|
+
(L(!0), b(g, null, z(h.value, (e) => (L(), v(W(Re), {
|
|
1382
1382
|
key: e.fileUrl,
|
|
1383
1383
|
placement: "top",
|
|
1384
1384
|
effect: "light",
|
|
@@ -1386,7 +1386,7 @@ var jr = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
|
1386
1386
|
teleported: !0,
|
|
1387
1387
|
"z-index": 3e3
|
|
1388
1388
|
}, {
|
|
1389
|
-
content:
|
|
1389
|
+
content: q(() => [e.kind === "pdf" ? (L(), b("iframe", {
|
|
1390
1390
|
key: 0,
|
|
1391
1391
|
src: e.fileUrl,
|
|
1392
1392
|
style: {
|
|
@@ -1395,30 +1395,30 @@ var jr = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
|
1395
1395
|
height: "500px",
|
|
1396
1396
|
border: "none"
|
|
1397
1397
|
}
|
|
1398
|
-
}, null, 8,
|
|
1399
|
-
x("div",
|
|
1400
|
-
x("div",
|
|
1401
|
-
w(e.size) ? (L(), b("div",
|
|
1398
|
+
}, null, 8, Fr)) : (L(), b("div", Ir, [
|
|
1399
|
+
x("div", Lr, U(e.fileOriginName), 1),
|
|
1400
|
+
x("div", Rr, "类型:" + U(e.kindLabel), 1),
|
|
1401
|
+
w(e.size) ? (L(), b("div", zr, " 大小:" + U(w(e.size)), 1)) : y("", !0),
|
|
1402
1402
|
r[0] ||= x("div", { style: { color: "#909399" } }, "点击打开 / 下载", -1)
|
|
1403
1403
|
]))]),
|
|
1404
|
-
default:
|
|
1404
|
+
default: q(() => [x("div", {
|
|
1405
1405
|
class: "file-cell__item",
|
|
1406
|
-
onClick:
|
|
1407
|
-
}, [x("div",
|
|
1406
|
+
onClick: le((t) => C(e), ["stop"])
|
|
1407
|
+
}, [x("div", Vr, [e.iconSvg ? (L(), b("img", {
|
|
1408
1408
|
key: 0,
|
|
1409
1409
|
src: e.iconSvg,
|
|
1410
1410
|
alt: "",
|
|
1411
1411
|
class: "file-icon"
|
|
1412
|
-
}, null, 8,
|
|
1412
|
+
}, null, 8, Hr)) : y("", !0)])], 8, Br)]),
|
|
1413
1413
|
_: 2
|
|
1414
1414
|
}, 1024))), 128)),
|
|
1415
|
-
S.value > 0 ? (L(), b("span",
|
|
1416
|
-
])) : (L(), b("span",
|
|
1415
|
+
S.value > 0 ? (L(), b("span", Ur, " +" + U(S.value), 1)) : y("", !0)
|
|
1416
|
+
])) : (L(), b("span", Wr, "-"))]));
|
|
1417
1417
|
}
|
|
1418
|
-
}),
|
|
1418
|
+
}), Kr = /* @__PURE__ */ e({ default: () => qr }), qr = /*#__PURE__*/ d(Gr, [["__scopeId", "data-v-b8fd048b"]]), Jr = {
|
|
1419
1419
|
key: 0,
|
|
1420
1420
|
class: "list-expand-cell"
|
|
1421
|
-
},
|
|
1421
|
+
}, Yr = { key: 1 }, Xr = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
1422
1422
|
__name: "list-expand-cell",
|
|
1423
1423
|
props: {
|
|
1424
1424
|
expanded: {
|
|
@@ -1435,26 +1435,26 @@ var jr = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
|
1435
1435
|
function c(e) {
|
|
1436
1436
|
e.stopPropagation(), r("toggle");
|
|
1437
1437
|
}
|
|
1438
|
-
return (t, n) => e.items.length > 0 ? (L(), b("div",
|
|
1438
|
+
return (t, n) => e.items.length > 0 ? (L(), b("div", Jr, [(L(!0), b(g, null, z(o.value, (e, t) => (L(), b("div", {
|
|
1439
1439
|
key: `${t}-${e}`,
|
|
1440
1440
|
class: "list-expand-cell__item"
|
|
1441
|
-
},
|
|
1441
|
+
}, U(t + 1) + ". " + U(e), 1))), 128)), a.value ? (L(), b("button", {
|
|
1442
1442
|
key: 0,
|
|
1443
1443
|
class: "list-expand-cell__toggle",
|
|
1444
1444
|
type: "button",
|
|
1445
1445
|
onClick: c
|
|
1446
|
-
}, [x("span", null,
|
|
1446
|
+
}, [x("span", null, U(e.expanded ? W(u)("components.tableEntity.collapseItems") : W(u)("components.tableEntity.viewAllItems", {
|
|
1447
1447
|
count: e.items.length,
|
|
1448
1448
|
unit: s.value
|
|
1449
|
-
})), 1), w(
|
|
1450
|
-
default:
|
|
1449
|
+
})), 1), w(W(Z), { class: "list-expand-cell__icon" }, {
|
|
1450
|
+
default: q(() => [e.expanded ? (L(), v(W(Ke), { key: 0 })) : (L(), v(W(We), { key: 1 }))]),
|
|
1451
1451
|
_: 1
|
|
1452
|
-
})])) : y("", !0)])) : (L(), b("span",
|
|
1452
|
+
})])) : y("", !0)])) : (L(), b("span", Yr, "-"));
|
|
1453
1453
|
}
|
|
1454
|
-
}), [["__scopeId", "data-v-21f61a6b"]]),
|
|
1454
|
+
}), [["__scopeId", "data-v-21f61a6b"]]), Zr = { class: "price-cell" }, Qr = { class: "text-[red]" }, $r = {
|
|
1455
1455
|
key: 0,
|
|
1456
1456
|
class: "ml-1 line-through"
|
|
1457
|
-
},
|
|
1457
|
+
}, ei = /* @__PURE__ */ E({
|
|
1458
1458
|
__name: "price-cell",
|
|
1459
1459
|
props: {
|
|
1460
1460
|
price: { default: "" },
|
|
@@ -1465,46 +1465,46 @@ var jr = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
|
1465
1465
|
let t = parseFloat(e.replace(/[^0-9.-]/g, ""));
|
|
1466
1466
|
return `$${isNaN(t) ? "0.00" : t.toFixed(2)}`;
|
|
1467
1467
|
};
|
|
1468
|
-
return (n, r) => (L(), b("div",
|
|
1468
|
+
return (n, r) => (L(), b("div", Zr, [x("span", Qr, U(t(e.price)), 1), e.lodPrice ? (L(), b("span", $r, U(t(e.lodPrice)), 1)) : y("", !0)]));
|
|
1469
1469
|
}
|
|
1470
1470
|
});
|
|
1471
1471
|
// src/components/table-entity/utils/column-utils.ts
|
|
1472
|
-
function
|
|
1472
|
+
function ti(e) {
|
|
1473
1473
|
return `${e}Col`;
|
|
1474
1474
|
}
|
|
1475
|
-
var
|
|
1475
|
+
var ni = [
|
|
1476
1476
|
"create_time",
|
|
1477
1477
|
"createTime",
|
|
1478
1478
|
"created_at",
|
|
1479
1479
|
"createdAt",
|
|
1480
1480
|
"created_time"
|
|
1481
|
-
],
|
|
1481
|
+
], ri = [
|
|
1482
1482
|
"update_time",
|
|
1483
1483
|
"updateTime",
|
|
1484
1484
|
"updated_at",
|
|
1485
1485
|
"updatedAt",
|
|
1486
1486
|
"updated_time"
|
|
1487
1487
|
];
|
|
1488
|
-
function
|
|
1488
|
+
function ii(e) {
|
|
1489
1489
|
return e == null || e === "";
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1492
|
-
return
|
|
1491
|
+
function ai(e) {
|
|
1492
|
+
return ni.includes(e) ? ni : ri.includes(e) ? ri : [];
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1494
|
+
function oi(e, t, n) {
|
|
1495
1495
|
let r = n === void 0 ? e?.[t] : n;
|
|
1496
|
-
if (!
|
|
1497
|
-
for (let n of
|
|
1496
|
+
if (!ii(r) || !e) return r;
|
|
1497
|
+
for (let n of ai(t)) {
|
|
1498
1498
|
if (n === t) continue;
|
|
1499
1499
|
let r = e[n];
|
|
1500
|
-
if (!
|
|
1500
|
+
if (!ii(r)) return r;
|
|
1501
1501
|
}
|
|
1502
1502
|
return r;
|
|
1503
1503
|
}
|
|
1504
|
-
function
|
|
1505
|
-
return
|
|
1504
|
+
function si(e, t) {
|
|
1505
|
+
return ii(e) ? "--" : t === "datetime" ? hn(e) : t === "date" ? mn(e) : ci(e);
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1507
|
+
function ci(e) {
|
|
1508
1508
|
if (e == null || e === "") return "--";
|
|
1509
1509
|
if (typeof e == "object") try {
|
|
1510
1510
|
return JSON.stringify(e);
|
|
@@ -1514,13 +1514,13 @@ function si(e) {
|
|
|
1514
1514
|
return String(e);
|
|
1515
1515
|
}
|
|
1516
1516
|
// src/components/table-entity/utils/list-expand.ts
|
|
1517
|
-
function
|
|
1517
|
+
function li(e) {
|
|
1518
1518
|
return String(e.key ?? e.dataKey ?? e.dataIndex ?? "");
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1520
|
+
function ui(e, t) {
|
|
1521
1521
|
return `${String(e)}::${t}`;
|
|
1522
1522
|
}
|
|
1523
|
-
function
|
|
1523
|
+
function di(e, t = "name") {
|
|
1524
1524
|
return (Array.isArray(e) ? e : typeof e == "string" ? e.split(/\r?\n/).map((e) => e.trim()).filter(Boolean) : e == null || e === "" ? [] : [e]).map((e) => {
|
|
1525
1525
|
if (e == null || e === "") return "";
|
|
1526
1526
|
if (typeof e != "object") return String(e);
|
|
@@ -1529,37 +1529,37 @@ function ui(e, t = "name") {
|
|
|
1529
1529
|
}).filter(Boolean);
|
|
1530
1530
|
}
|
|
1531
1531
|
// src/components/table-entity/utils/column-slots.ts
|
|
1532
|
-
var
|
|
1533
|
-
function
|
|
1534
|
-
return e == null || e === "" ? [] : (Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : [e]).map((e) => e && typeof e == "object" ? e.fileUrl ?? e.url : e).map((e) =>
|
|
1532
|
+
var fi = T(() => Promise.resolve().then(() => Kr)), pi = T(() => import("./picture-cell-DApeh9FW.js").then((e) => e.n)), mi = T(() => import("./avatar-cell-BzklaM_h.js")), { resolveImageUrl: hi } = f();
|
|
1533
|
+
function gi(e) {
|
|
1534
|
+
return e == null || e === "" ? [] : (Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : [e]).map((e) => e && typeof e == "object" ? e.fileUrl ?? e.url : e).map((e) => hi(e)).filter(Boolean);
|
|
1535
1535
|
}
|
|
1536
|
-
var
|
|
1537
|
-
function
|
|
1536
|
+
var _i = (e) => Array.isArray(e) ? e.map((e) => ({ fileUrl: e })) : { fileUrl: e };
|
|
1537
|
+
function vi(e, t, n, r) {
|
|
1538
1538
|
let i = e.maxPreviewCount ?? 3, a = e.cellProps ?? e.props ?? {};
|
|
1539
1539
|
switch (e.type) {
|
|
1540
|
-
case "avatar": return O(
|
|
1540
|
+
case "avatar": return O(mi, {
|
|
1541
1541
|
row: t,
|
|
1542
1542
|
value: n
|
|
1543
1543
|
});
|
|
1544
|
-
case "file": return O(
|
|
1544
|
+
case "file": return O(fi, {
|
|
1545
1545
|
...a,
|
|
1546
|
-
attachments:
|
|
1546
|
+
attachments: _i(n),
|
|
1547
1547
|
maxPreviewCount: i
|
|
1548
1548
|
});
|
|
1549
|
-
case "picture": return O(
|
|
1549
|
+
case "picture": return O(pi, {
|
|
1550
1550
|
...a,
|
|
1551
|
-
urls:
|
|
1551
|
+
urls: gi(n),
|
|
1552
1552
|
maxPreviewCount: i
|
|
1553
1553
|
});
|
|
1554
|
-
case "price": return O(
|
|
1554
|
+
case "price": return O(ei, {
|
|
1555
1555
|
...a,
|
|
1556
1556
|
price: String(n || "0"),
|
|
1557
1557
|
lodPrice: t[a?.lodPrice] ?? "请查看配置项"
|
|
1558
1558
|
});
|
|
1559
1559
|
case "listExpand": {
|
|
1560
|
-
let i =
|
|
1561
|
-
return O(
|
|
1562
|
-
items:
|
|
1560
|
+
let i = ui(t?.[r?.rowKey ?? "id"], li(e));
|
|
1561
|
+
return O(Xr, {
|
|
1562
|
+
items: di(n, a.labelKey),
|
|
1563
1563
|
max: a.max,
|
|
1564
1564
|
unit: a.unit,
|
|
1565
1565
|
expanded: r?.expandedKeys.has(i) ?? !1,
|
|
@@ -1569,7 +1569,7 @@ function _i(e, t, n, r) {
|
|
|
1569
1569
|
default: return;
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
|
-
function
|
|
1572
|
+
function yi(e) {
|
|
1573
1573
|
let t = {
|
|
1574
1574
|
bottom: "flex-end",
|
|
1575
1575
|
center: "center",
|
|
@@ -1580,11 +1580,11 @@ function vi(e) {
|
|
|
1580
1580
|
width: "100%"
|
|
1581
1581
|
} : void 0;
|
|
1582
1582
|
}
|
|
1583
|
-
function
|
|
1583
|
+
function bi(e, t, n) {
|
|
1584
1584
|
return e.map((e) => {
|
|
1585
1585
|
if (e.key === "__sel__" || e.key === "__fill__") return e;
|
|
1586
1586
|
if (e.cellRenderer) {
|
|
1587
|
-
let t = e.cellRenderer, n =
|
|
1587
|
+
let t = e.cellRenderer, n = yi(e);
|
|
1588
1588
|
return n ? {
|
|
1589
1589
|
...e,
|
|
1590
1590
|
cellRenderer: (e) => O("div", {
|
|
@@ -1595,11 +1595,11 @@ function yi(e, t, n) {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
let r = e.dataKey;
|
|
1597
1597
|
if (r == null || r === "") return e;
|
|
1598
|
-
let i =
|
|
1598
|
+
let i = ti(String(r));
|
|
1599
1599
|
return {
|
|
1600
1600
|
...e,
|
|
1601
1601
|
cellRenderer: (a) => {
|
|
1602
|
-
let { rowData: o, rowIndex: s, cellData: c } = a, l = a.column ?? e, u = l.align ?? e.align ?? "left", d =
|
|
1602
|
+
let { rowData: o, rowIndex: s, cellData: c } = a, l = a.column ?? e, u = l.align ?? e.align ?? "left", d = yi(l), f = l.valueType ?? e.valueType, p = f === "date" || f === "datetime" ? oi(o, String(r), c) : c === void 0 ? o?.[r] : c, m = si(p, f), h = typeof p == "object" && p ? void 0 : m, g = t[i];
|
|
1603
1603
|
if (g) return O("div", {
|
|
1604
1604
|
class: "table-entity__col-slot",
|
|
1605
1605
|
title: h,
|
|
@@ -1614,7 +1614,7 @@ function yi(e, t, n) {
|
|
|
1614
1614
|
column: l,
|
|
1615
1615
|
rowIndex: s
|
|
1616
1616
|
}));
|
|
1617
|
-
let _ =
|
|
1617
|
+
let _ = vi(l, o, p, n);
|
|
1618
1618
|
if (_) {
|
|
1619
1619
|
let t = l.type === "picture" || e.type === "picture", n = l.type === "listExpand" || e.type === "listExpand";
|
|
1620
1620
|
return O("div", {
|
|
@@ -1647,7 +1647,7 @@ function yi(e, t, n) {
|
|
|
1647
1647
|
textAlign: u,
|
|
1648
1648
|
...d
|
|
1649
1649
|
}
|
|
1650
|
-
}, O(
|
|
1650
|
+
}, O(Mr, {
|
|
1651
1651
|
code: e,
|
|
1652
1652
|
value: p
|
|
1653
1653
|
}));
|
|
@@ -1665,13 +1665,13 @@ function yi(e, t, n) {
|
|
|
1665
1665
|
});
|
|
1666
1666
|
}
|
|
1667
1667
|
// src/components/table-entity/index.vue?vue&type=script&setup=true&lang.ts
|
|
1668
|
-
var
|
|
1668
|
+
var xi = { class: "table-entity__toolbar-right" }, Si = { class: "buttons" }, Ci = {
|
|
1669
1669
|
key: 0,
|
|
1670
1670
|
class: "table-entity__toolbar-left"
|
|
1671
|
-
},
|
|
1671
|
+
}, wi = {
|
|
1672
1672
|
key: 1,
|
|
1673
1673
|
class: "table-entity__pagination"
|
|
1674
|
-
},
|
|
1674
|
+
}, Ti = "__actions__", Ei = "__drag__", Di = "table-entity__drag-handle", Oi = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
1675
1675
|
__name: "index",
|
|
1676
1676
|
props: {
|
|
1677
1677
|
columns: { default: () => [] },
|
|
@@ -1759,7 +1759,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
1759
1759
|
"rowSort"
|
|
1760
1760
|
],
|
|
1761
1761
|
setup(e, { expose: t, emit: n }) {
|
|
1762
|
-
let r = e, i = n, a =
|
|
1762
|
+
let r = e, i = n, a = R(!1), o = R(!1), s = {
|
|
1763
1763
|
view: {
|
|
1764
1764
|
label: u("components.tableEntity.view"),
|
|
1765
1765
|
type: "primary"
|
|
@@ -1776,7 +1776,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
1776
1776
|
label: u("components.tableEntity.delete"),
|
|
1777
1777
|
type: "danger"
|
|
1778
1778
|
}
|
|
1779
|
-
}, c =
|
|
1779
|
+
}, c = R(0), l = [
|
|
1780
1780
|
10,
|
|
1781
1781
|
50,
|
|
1782
1782
|
300,
|
|
@@ -1795,7 +1795,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
1795
1795
|
return [...l];
|
|
1796
1796
|
}
|
|
1797
1797
|
}
|
|
1798
|
-
let f = d(void 0), p =
|
|
1798
|
+
let f = d(void 0), p = ae(), { hasAccessByCodes: m } = ln(), h = R([]), g = R(/* @__PURE__ */ new Set()), S = R(!1), C = R([...r.defaultExpandedRowKeys ?? []]), T = R(), { width: E } = pt(T), D = ee({
|
|
1799
1799
|
current_page: r.current_page,
|
|
1800
1800
|
per_page: r.per_page
|
|
1801
1801
|
}), k = _(() => Math.max(1, Math.floor(r.width ?? E.value))), A = _(() => r.total == null ? c.value : Number(r.total)), j = _(() => r.showColumnSettings || typeof r.data == "function");
|
|
@@ -1805,84 +1805,84 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
1805
1805
|
let P = _(() => r.columns.filter(Boolean).map((e) => ({
|
|
1806
1806
|
...e,
|
|
1807
1807
|
dataKey: e.dataKey ?? e.dataIndex
|
|
1808
|
-
}))), I = _(() => P.value.filter((e) => e.type === "listExpand")),
|
|
1809
|
-
function
|
|
1808
|
+
}))), I = _(() => P.value.filter((e) => e.type === "listExpand")), z = _(() => !r.tree && I.value.length > 0);
|
|
1809
|
+
function te(e) {
|
|
1810
1810
|
let t = new Set(g.value);
|
|
1811
1811
|
t.has(e) ? t.delete(e) : t.add(e), g.value = t;
|
|
1812
1812
|
}
|
|
1813
|
-
let
|
|
1813
|
+
let H = _(() => bi(P.value, p, {
|
|
1814
1814
|
expandedKeys: g.value,
|
|
1815
|
-
onToggle:
|
|
1815
|
+
onToggle: te,
|
|
1816
1816
|
rowKey: r.rowKey ?? "id"
|
|
1817
|
-
})),
|
|
1818
|
-
field:
|
|
1819
|
-
order:
|
|
1817
|
+
})), ne = r.columns.find((e) => e.sortOrder), U = R({
|
|
1818
|
+
field: ne && String(ne.dataKey ?? ne.dataIndex ?? ne.key ?? "") || void 0,
|
|
1819
|
+
order: ne?.sortOrder
|
|
1820
1820
|
});
|
|
1821
|
-
function
|
|
1821
|
+
function re(e) {
|
|
1822
1822
|
let t = e.dataKey ?? e.dataIndex ?? e.key;
|
|
1823
1823
|
return t == null ? void 0 : String(t);
|
|
1824
1824
|
}
|
|
1825
|
-
function
|
|
1825
|
+
function ie(e) {
|
|
1826
1826
|
if (!e.sortable && !e.sortOrder) return;
|
|
1827
|
-
let t =
|
|
1827
|
+
let t = re(e);
|
|
1828
1828
|
if (!t) return;
|
|
1829
|
-
let n =
|
|
1830
|
-
|
|
1829
|
+
let n = U.value.field === t && U.value.order === "asc" ? "desc" : "asc";
|
|
1830
|
+
U.value = {
|
|
1831
1831
|
field: t,
|
|
1832
1832
|
order: n
|
|
1833
|
-
}, D.current_page === 1 ? (
|
|
1833
|
+
}, D.current_page === 1 ? (G(), typeof r.data == "function" && Qe()) : (D.current_page = 1, i("update:current_page", 1), i("update:page", 1), G());
|
|
1834
1834
|
}
|
|
1835
|
-
function
|
|
1835
|
+
function G() {
|
|
1836
1836
|
i("change", {
|
|
1837
1837
|
current_page: D.current_page,
|
|
1838
1838
|
page: D.current_page,
|
|
1839
1839
|
per_page: D.per_page,
|
|
1840
|
-
sortField:
|
|
1841
|
-
sortOrder:
|
|
1840
|
+
sortField: U.value.field,
|
|
1841
|
+
sortOrder: U.value.order
|
|
1842
1842
|
});
|
|
1843
1843
|
}
|
|
1844
|
-
let
|
|
1845
|
-
function
|
|
1846
|
-
|
|
1844
|
+
let oe = hr(H), se = fr(H);
|
|
1845
|
+
function ce() {
|
|
1846
|
+
oe.reset(), se.reset();
|
|
1847
1847
|
}
|
|
1848
|
-
let { applyColumnWidths:
|
|
1849
|
-
let e = r.showColumnSettings ?
|
|
1850
|
-
return
|
|
1851
|
-
}),
|
|
1848
|
+
let { applyColumnWidths: le, resizeLineStyle: ue, onViewportMouseDown: de } = mr(r.minColumnWidth), fe = _(() => {
|
|
1849
|
+
let e = r.showColumnSettings ? oe.visibleColumns.value : H.value;
|
|
1850
|
+
return se.applyFixed(oe.applyAlign(le(e)));
|
|
1851
|
+
}), X = _(() => {
|
|
1852
1852
|
if (!r.tree) return;
|
|
1853
1853
|
if (r.expandColumnKey) return r.expandColumnKey;
|
|
1854
|
-
let e =
|
|
1854
|
+
let e = H.value.find((e) => {
|
|
1855
1855
|
let t = e.key ?? e.dataKey;
|
|
1856
1856
|
return t != null && String(t) !== "";
|
|
1857
1857
|
}), t = e?.key ?? e?.dataKey;
|
|
1858
1858
|
return t == null ? void 0 : String(t);
|
|
1859
1859
|
}), pe = _(() => r.expandedRowKeys ?? C.value), ve = _(() => !r.tree || r.treeChildrenKey === "children" ? h.value : et(h.value, r.treeChildrenKey));
|
|
1860
1860
|
function ye(e) {
|
|
1861
|
-
let t = r.rowKey ?? "id", n = r.treeChildrenKey ?? "children", i = I.value.map((e) =>
|
|
1861
|
+
let t = r.rowKey ?? "id", n = r.treeChildrenKey ?? "children", i = I.value.map((e) => li(e));
|
|
1862
1862
|
return e.map((e) => {
|
|
1863
|
-
let r = i.map((n) => g.value.has(
|
|
1863
|
+
let r = i.map((n) => g.value.has(ui(e[t], n)) ? "1" : "0").join(""), a = {
|
|
1864
1864
|
...e,
|
|
1865
1865
|
__measureKey: `${e[t]}:${r}`
|
|
1866
1866
|
};
|
|
1867
1867
|
return Array.isArray(e[n]) && (a[n] = ye(e[n])), a;
|
|
1868
1868
|
});
|
|
1869
1869
|
}
|
|
1870
|
-
let be = _(() =>
|
|
1871
|
-
|
|
1870
|
+
let be = _(() => z.value ? ye(ve.value) : ve.value), xe = _(() => r.tree ? tt(ve.value, pe.value) : h.value), Se = _(() => r.tree ? tt(ve.value) : h.value);
|
|
1871
|
+
K(() => r.current_page, (e) => {
|
|
1872
1872
|
D.current_page = e;
|
|
1873
|
-
}),
|
|
1873
|
+
}), K(() => r.per_page, (e) => {
|
|
1874
1874
|
D.per_page = e;
|
|
1875
|
-
}),
|
|
1875
|
+
}), K(() => r.data, async () => {
|
|
1876
1876
|
await Qe();
|
|
1877
1877
|
}, {
|
|
1878
1878
|
deep: !0,
|
|
1879
1879
|
immediate: !0
|
|
1880
|
-
}),
|
|
1880
|
+
}), K(() => [D.current_page, D.per_page], async () => {
|
|
1881
1881
|
typeof r.data == "function" && await Qe();
|
|
1882
|
-
}),
|
|
1882
|
+
}), K(() => r.expandedRowKeys, (e) => {
|
|
1883
1883
|
e && (C.value = [...e]);
|
|
1884
1884
|
}, { immediate: !0 });
|
|
1885
|
-
let { selectionColumn: Q, rowEventHandlers: Ce, clearSelection: $, getSelectedRows: Te, getSelectedCount: Ee, setSelectedKeys: De } =
|
|
1885
|
+
let { selectionColumn: Q, rowEventHandlers: Ce, clearSelection: $, getSelectedRows: Te, getSelectedCount: Ee, setSelectedKeys: De } = wr(r, i, xe, Se);
|
|
1886
1886
|
function Oe() {
|
|
1887
1887
|
return r.importDialog ? (a.value = !0, !0) : !1;
|
|
1888
1888
|
}
|
|
@@ -1892,7 +1892,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
1892
1892
|
function Ae(e) {
|
|
1893
1893
|
i("importError", e);
|
|
1894
1894
|
}
|
|
1895
|
-
let je = Symbol("table-entity-root-parent"), Me = _(() => r.rowDraggable), Ne = _(() => r.tree &&
|
|
1895
|
+
let je = Symbol("table-entity-root-parent"), Me = _(() => r.rowDraggable), Ne = _(() => r.tree && X.value ? tt(ve.value, pe.value) : r.tree ? ve.value : h.value), Pe = _(() => {
|
|
1896
1896
|
let e = /* @__PURE__ */ new Map(), t = r.rowKey ?? "id", n = r.treeChildrenKey ?? "children";
|
|
1897
1897
|
function i(r, a) {
|
|
1898
1898
|
for (let o of r) {
|
|
@@ -1910,7 +1910,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
1910
1910
|
newIndex: s,
|
|
1911
1911
|
oldIndex: o,
|
|
1912
1912
|
parentRowKey: a,
|
|
1913
|
-
rows:
|
|
1913
|
+
rows: xr(e, o, s)
|
|
1914
1914
|
};
|
|
1915
1915
|
for (let a = 0; a < e.length; a += 1) {
|
|
1916
1916
|
let o = e[a], s = o[i];
|
|
@@ -1926,13 +1926,13 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
1926
1926
|
}
|
|
1927
1927
|
return null;
|
|
1928
1928
|
}
|
|
1929
|
-
let { draggingIndex: Le, onPointerDown: ze, overIndex: Be } =
|
|
1929
|
+
let { draggingIndex: Le, onPointerDown: ze, overIndex: Be } = Sr({
|
|
1930
1930
|
canDrop: (e, t) => {
|
|
1931
1931
|
if (!r.tree) return !0;
|
|
1932
1932
|
let n = r.rowKey ?? "id", i = Pe.value, a = e[n], o = t[n];
|
|
1933
1933
|
return a != null && o != null && i.has(a) && i.has(o) && i.get(a) === i.get(o);
|
|
1934
1934
|
},
|
|
1935
|
-
getHandle: () => r.rowDragHandle || `.${
|
|
1935
|
+
getHandle: () => r.rowDragHandle || `.${Di}`,
|
|
1936
1936
|
getRoot: () => T.value,
|
|
1937
1937
|
getRowHeight: () => r.rowHeight,
|
|
1938
1938
|
getRows: () => Ne.value,
|
|
@@ -1941,7 +1941,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
1941
1941
|
isRowDisabled: (e) => r.rowDragDisabled?.(e) ?? !1,
|
|
1942
1942
|
moveRows: (e, t, n, i) => {
|
|
1943
1943
|
if (!r.tree) {
|
|
1944
|
-
let e =
|
|
1944
|
+
let e = xr(h.value, n, i);
|
|
1945
1945
|
return e === h.value ? null : (h.value = e, {
|
|
1946
1946
|
newIndex: i,
|
|
1947
1947
|
oldIndex: n,
|
|
@@ -1967,12 +1967,12 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
1967
1967
|
};
|
|
1968
1968
|
}
|
|
1969
1969
|
let Ue = _(() => ({
|
|
1970
|
-
key:
|
|
1971
|
-
dataKey:
|
|
1970
|
+
key: Ei,
|
|
1971
|
+
dataKey: Ei,
|
|
1972
1972
|
title: "",
|
|
1973
1973
|
width: 40,
|
|
1974
1974
|
cellRenderer: ({ rowData: e }) => r.rowDragDisabled?.(e) ? null : O("span", {
|
|
1975
|
-
class:
|
|
1975
|
+
class: Di,
|
|
1976
1976
|
title: "拖拽排序"
|
|
1977
1977
|
}, O(Z, { size: 16 }, () => O(it)))
|
|
1978
1978
|
}));
|
|
@@ -1992,15 +1992,15 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
1992
1992
|
return e;
|
|
1993
1993
|
});
|
|
1994
1994
|
function qe(e, t) {
|
|
1995
|
-
let n = We(t), r =
|
|
1996
|
-
return !n || !r ? e :
|
|
1995
|
+
let n = We(t), r = V("access");
|
|
1996
|
+
return !n || !r ? e : J(e, [[r, [n]]]);
|
|
1997
1997
|
}
|
|
1998
1998
|
let Je = _(() => 50), Ye = _(() => {
|
|
1999
1999
|
if (!r.showActions) return null;
|
|
2000
2000
|
let e = Ke.value;
|
|
2001
2001
|
return {
|
|
2002
|
-
key:
|
|
2003
|
-
dataKey:
|
|
2002
|
+
key: Ti,
|
|
2003
|
+
dataKey: Ti,
|
|
2004
2004
|
title: r.actionColumnTitle || u("components.tableEntity.action"),
|
|
2005
2005
|
width: Je.value,
|
|
2006
2006
|
fixed: "right",
|
|
@@ -2033,7 +2033,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2033
2033
|
let r;
|
|
2034
2034
|
return r = typeof e.component == "function" ? e.component({ row: t.rowData }) : O(e.component, { row: t.rowData }), n ? qe(r, e.name) : r;
|
|
2035
2035
|
}
|
|
2036
|
-
let r = O(
|
|
2036
|
+
let r = O(Y, {
|
|
2037
2037
|
type: e.type,
|
|
2038
2038
|
link: !0,
|
|
2039
2039
|
size: "small",
|
|
@@ -2050,7 +2050,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2050
2050
|
trigger: "hover",
|
|
2051
2051
|
placement: "bottom-end"
|
|
2052
2052
|
}, {
|
|
2053
|
-
default: () => O(
|
|
2053
|
+
default: () => O(Y, {
|
|
2054
2054
|
link: !0,
|
|
2055
2055
|
size: "small",
|
|
2056
2056
|
title: u("components.tableEntity.moreActions")
|
|
@@ -2061,7 +2061,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2061
2061
|
action: e.name,
|
|
2062
2062
|
row: t.rowData
|
|
2063
2063
|
})
|
|
2064
|
-
}, () => O(
|
|
2064
|
+
}, () => O(Y, {
|
|
2065
2065
|
link: !0,
|
|
2066
2066
|
size: "small",
|
|
2067
2067
|
type: e.type
|
|
@@ -2074,11 +2074,11 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2074
2074
|
};
|
|
2075
2075
|
}), Xe = _(() => {
|
|
2076
2076
|
let e = [];
|
|
2077
|
-
return Me.value && !r.rowDragHandle && e.push(Ue.value), r.selectable && e.push(Q.value), e.push(...
|
|
2077
|
+
return Me.value && !r.rowDragHandle && e.push(Ue.value), r.selectable && e.push(Q.value), e.push(...fe.value), Ye.value && e.push(Ye.value), $e(e, k.value);
|
|
2078
2078
|
});
|
|
2079
2079
|
function Ze(e) {
|
|
2080
2080
|
return e.map((e) => {
|
|
2081
|
-
let t = e.headerCellRenderer, n =
|
|
2081
|
+
let t = e.headerCellRenderer, n = re(e), r = U.value.field === n, i = !!(e.sortable || e.sortOrder), a = i && r ? O("span", { class: ["table-entity__sort-arrow", U.value.order === "desc" ? "table-entity__sort-arrow--desc" : "table-entity__sort-arrow--asc"] }) : i ? O("span", { class: "table-entity__sort-icons" }, [O("span", { class: "table-entity__sort-arrow--asc" }), O("span", { class: "table-entity__sort-arrow--desc" })]) : null;
|
|
2082
2082
|
return {
|
|
2083
2083
|
...e,
|
|
2084
2084
|
width: e.width ?? 120,
|
|
@@ -2093,7 +2093,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2093
2093
|
cursor: i ? "pointer" : void 0
|
|
2094
2094
|
},
|
|
2095
2095
|
onClick: i ? (t) => {
|
|
2096
|
-
t.stopPropagation(),
|
|
2096
|
+
t.stopPropagation(), ie(e);
|
|
2097
2097
|
} : void 0
|
|
2098
2098
|
}, [t ? t(n) : e.title, a])
|
|
2099
2099
|
};
|
|
@@ -2110,8 +2110,8 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2110
2110
|
page: D.current_page,
|
|
2111
2111
|
per_page: D.per_page,
|
|
2112
2112
|
query: r.query,
|
|
2113
|
-
sortField:
|
|
2114
|
-
sortOrder:
|
|
2113
|
+
sortField: U.value.field,
|
|
2114
|
+
sortOrder: U.value.order
|
|
2115
2115
|
});
|
|
2116
2116
|
h.value = e.rows, c.value = e.total;
|
|
2117
2117
|
} finally {
|
|
@@ -2126,11 +2126,11 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2126
2126
|
width: Number(e.width ?? 120)
|
|
2127
2127
|
})), r = n.reduce((e, t) => e + Number(t.width ?? 0), 0);
|
|
2128
2128
|
if (r >= t) return n;
|
|
2129
|
-
let i = n.filter((e) => e.dataKey !==
|
|
2129
|
+
let i = n.filter((e) => e.dataKey !== Ti && e.dataKey !== "__sel__" && e.dataKey !== Ei);
|
|
2130
2130
|
if (i.length === 0) return n;
|
|
2131
2131
|
let a = t - r, o = i.reduce((e, t) => e + Number(t.width ?? 0), 0);
|
|
2132
2132
|
return n.map((e) => {
|
|
2133
|
-
if (e.dataKey ===
|
|
2133
|
+
if (e.dataKey === Ti || e.dataKey === "__sel__" || e.dataKey === Ei) return e;
|
|
2134
2134
|
let t = Number(e.width ?? 120);
|
|
2135
2135
|
return {
|
|
2136
2136
|
...e,
|
|
@@ -2171,13 +2171,13 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2171
2171
|
i("rowExpand", e);
|
|
2172
2172
|
}
|
|
2173
2173
|
function lt(e) {
|
|
2174
|
-
D.current_page = e, i("update:current_page", e), i("pageChange", e),
|
|
2174
|
+
D.current_page = e, i("update:current_page", e), i("pageChange", e), G();
|
|
2175
2175
|
}
|
|
2176
2176
|
function ut(e) {
|
|
2177
|
-
D.per_page = e, i("update:per_page", e),
|
|
2177
|
+
D.per_page = e, i("update:per_page", e), G();
|
|
2178
2178
|
}
|
|
2179
2179
|
async function dt(e) {
|
|
2180
|
-
e != null && D.current_page !== e ? (D.current_page = e, i("update:current_page", e),
|
|
2180
|
+
e != null && D.current_page !== e ? (D.current_page = e, i("update:current_page", e), G()) : await Qe();
|
|
2181
2181
|
}
|
|
2182
2182
|
return t({
|
|
2183
2183
|
clearSelection: $,
|
|
@@ -2187,60 +2187,60 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2187
2187
|
openImport: Oe,
|
|
2188
2188
|
reload: dt
|
|
2189
2189
|
}), (t, n) => {
|
|
2190
|
-
let i =
|
|
2190
|
+
let i = V("loading");
|
|
2191
2191
|
return L(), b("div", { class: N(["table-entity", {
|
|
2192
2192
|
"table-entity--large-row": r.rowHeight > 40,
|
|
2193
|
-
"table-entity--dynamic-row":
|
|
2193
|
+
"table-entity--dynamic-row": z.value
|
|
2194
2194
|
}]) }, [
|
|
2195
2195
|
n[5] ||= x("div", { class: "flex justify-between mb-1" }, null, -1),
|
|
2196
2196
|
x("div", {
|
|
2197
2197
|
class: "table-entity__toolbar",
|
|
2198
2198
|
style: F({ width: `${e.width}px` })
|
|
2199
|
-
}, [x("div",
|
|
2200
|
-
w(
|
|
2201
|
-
content:
|
|
2199
|
+
}, [x("div", xi, [x("div", Si, [B(t.$slots, "buttons", {}, void 0, !0)])]), j.value ? (L(), b("div", Ci, [
|
|
2200
|
+
w(W(Re), {
|
|
2201
|
+
content: W(u)("components.tableEntity.refresh"),
|
|
2202
2202
|
placement: "top"
|
|
2203
2203
|
}, {
|
|
2204
|
-
default:
|
|
2205
|
-
icon:
|
|
2204
|
+
default: q(() => [w(W(Y), {
|
|
2205
|
+
icon: W(at),
|
|
2206
2206
|
circle: "",
|
|
2207
2207
|
size: "small",
|
|
2208
|
-
title:
|
|
2208
|
+
title: W(u)("components.tableEntity.refresh"),
|
|
2209
2209
|
onClick: M
|
|
2210
2210
|
}, null, 8, ["icon", "title"])]),
|
|
2211
2211
|
_: 1
|
|
2212
2212
|
}, 8, ["content"]),
|
|
2213
|
-
x("div", null, [w(
|
|
2214
|
-
content:
|
|
2213
|
+
x("div", null, [w(W(Re), {
|
|
2214
|
+
content: W(u)("components.tableEntity.columnSettings"),
|
|
2215
2215
|
placement: "top"
|
|
2216
2216
|
}, {
|
|
2217
|
-
default:
|
|
2217
|
+
default: q(() => [w(W(Y), {
|
|
2218
2218
|
class: "table-entity__settings-btn",
|
|
2219
|
-
icon:
|
|
2219
|
+
icon: W(ct),
|
|
2220
2220
|
circle: "",
|
|
2221
2221
|
size: "small",
|
|
2222
2222
|
onClick: n[0] ||= (e) => o.value = !0
|
|
2223
2223
|
}, null, 8, ["icon"])]),
|
|
2224
2224
|
_: 1
|
|
2225
2225
|
}, 8, ["content"])]),
|
|
2226
|
-
r.showColumnSettings ? (L(), v(
|
|
2226
|
+
r.showColumnSettings ? (L(), v(W(me), {
|
|
2227
2227
|
key: 0,
|
|
2228
2228
|
modelValue: o.value,
|
|
2229
2229
|
"onUpdate:modelValue": n[1] ||= (e) => o.value = e,
|
|
2230
|
-
title:
|
|
2230
|
+
title: W(u)("components.tableEntity.columnConfig"),
|
|
2231
2231
|
direction: "rtl",
|
|
2232
2232
|
size: "640px"
|
|
2233
2233
|
}, {
|
|
2234
|
-
default:
|
|
2235
|
-
settings:
|
|
2236
|
-
"fixed-items":
|
|
2237
|
-
onToggle:
|
|
2238
|
-
onSetHeaderAlign:
|
|
2239
|
-
onSetContentAlign:
|
|
2240
|
-
onSetWidth:
|
|
2241
|
-
onSetFixed:
|
|
2242
|
-
onReset:
|
|
2243
|
-
"onUpdate:settings":
|
|
2234
|
+
default: q(() => [w(dr, {
|
|
2235
|
+
settings: W(oe).orderedSettings.value,
|
|
2236
|
+
"fixed-items": W(se).orderedItems.value,
|
|
2237
|
+
onToggle: W(oe).toggleColumn,
|
|
2238
|
+
onSetHeaderAlign: W(oe).setHeaderAlign,
|
|
2239
|
+
onSetContentAlign: W(oe).setContentAlign,
|
|
2240
|
+
onSetWidth: W(oe).setWidth,
|
|
2241
|
+
onSetFixed: W(se).setFixed,
|
|
2242
|
+
onReset: ce,
|
|
2243
|
+
"onUpdate:settings": W(oe).reorderSettings
|
|
2244
2244
|
}, null, 8, [
|
|
2245
2245
|
"settings",
|
|
2246
2246
|
"fixed-items",
|
|
@@ -2255,13 +2255,13 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2255
2255
|
}, 8, ["modelValue", "title"])) : y("", !0),
|
|
2256
2256
|
y("", !0)
|
|
2257
2257
|
])) : y("", !0)], 4),
|
|
2258
|
-
|
|
2258
|
+
J((L(), b("div", {
|
|
2259
2259
|
ref_key: "tableViewportRef",
|
|
2260
2260
|
ref: T,
|
|
2261
2261
|
class: "table-entity__viewport",
|
|
2262
|
-
onMousedown: n[2] ||= (...e) =>
|
|
2263
|
-
onPointerdown: n[3] ||= (...e) =>
|
|
2264
|
-
}, [w(
|
|
2262
|
+
onMousedown: n[2] ||= (...e) => W(de) && W(de)(...e),
|
|
2263
|
+
onPointerdown: n[3] ||= (...e) => W(ze) && W(ze)(...e)
|
|
2264
|
+
}, [w(W(Ie), {
|
|
2265
2265
|
columns: Ze(Xe.value),
|
|
2266
2266
|
data: be.value,
|
|
2267
2267
|
width: k.value,
|
|
@@ -2270,14 +2270,14 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2270
2270
|
"row-class": Ve,
|
|
2271
2271
|
"row-props": He,
|
|
2272
2272
|
cache: r.cache,
|
|
2273
|
-
"estimated-row-height":
|
|
2274
|
-
"row-key":
|
|
2275
|
-
"expand-column-key":
|
|
2273
|
+
"estimated-row-height": z.value ? r.rowHeight : void 0,
|
|
2274
|
+
"row-key": z.value ? "__measureKey" : r.rowKey,
|
|
2275
|
+
"expand-column-key": X.value,
|
|
2276
2276
|
"expanded-row-keys": pe.value,
|
|
2277
2277
|
"default-expanded-row-keys": r.defaultExpandedRowKeys,
|
|
2278
2278
|
"indent-size": r.indentSize,
|
|
2279
2279
|
"icon-size": r.iconSize,
|
|
2280
|
-
"row-event-handlers": r.selectable ?
|
|
2280
|
+
"row-event-handlers": r.selectable ? W(Ce) : void 0,
|
|
2281
2281
|
fixed: "",
|
|
2282
2282
|
"onUpdate:expandedRowKeys": rt,
|
|
2283
2283
|
onExpandedRowsChange: ot,
|
|
@@ -2301,15 +2301,15 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2301
2301
|
r.resizable ? (L(), b("div", {
|
|
2302
2302
|
key: 0,
|
|
2303
2303
|
class: "table-entity__resize-line",
|
|
2304
|
-
style: F(
|
|
2304
|
+
style: F(W(ue))
|
|
2305
2305
|
}, null, 4)) : y("", !0),
|
|
2306
|
-
r.showPagination ? (L(), b("div",
|
|
2306
|
+
r.showPagination ? (L(), b("div", wi, [w(W(we), {
|
|
2307
2307
|
"current-page": D.current_page,
|
|
2308
2308
|
"page-size": D.per_page,
|
|
2309
2309
|
total: A.value,
|
|
2310
2310
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
2311
2311
|
background: "",
|
|
2312
|
-
"page-sizes":
|
|
2312
|
+
"page-sizes": W(f),
|
|
2313
2313
|
onSizeChange: ut,
|
|
2314
2314
|
onCurrentChange: lt
|
|
2315
2315
|
}, null, 8, [
|
|
@@ -2318,7 +2318,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2318
2318
|
"total",
|
|
2319
2319
|
"page-sizes"
|
|
2320
2320
|
])])) : y("", !0),
|
|
2321
|
-
r.importDialog ? (L(), v(
|
|
2321
|
+
r.importDialog ? (L(), v(W(tr), {
|
|
2322
2322
|
key: 2,
|
|
2323
2323
|
modelValue: a.value,
|
|
2324
2324
|
"onUpdate:modelValue": n[4] ||= (e) => a.value = e,
|
|
@@ -2358,10 +2358,10 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2358
2358
|
], 2);
|
|
2359
2359
|
};
|
|
2360
2360
|
}
|
|
2361
|
-
}), [["__scopeId", "data-v-c6c67d3f"]]),
|
|
2361
|
+
}), [["__scopeId", "data-v-c6c67d3f"]]), ki = { class: "dialog-list" }, Ai = { class: "dialog-list__bar" }, ji = {
|
|
2362
2362
|
key: 0,
|
|
2363
2363
|
class: "dialog-list__count"
|
|
2364
|
-
},
|
|
2364
|
+
}, Mi = { class: "dialog-list__table" }, Ni = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
2365
2365
|
__name: "index",
|
|
2366
2366
|
props: {
|
|
2367
2367
|
visible: { type: Boolean },
|
|
@@ -2393,14 +2393,14 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2393
2393
|
onOpenChange: (e) => {
|
|
2394
2394
|
e !== i.visible && a("update:visible", e);
|
|
2395
2395
|
}
|
|
2396
|
-
}), c =
|
|
2396
|
+
}), c = R(), l = R(""), d = R(1), f = R(i.perPage), p = R([]), m = _(() => [
|
|
2397
2397
|
"__dialog-list__",
|
|
2398
2398
|
i.rowKey,
|
|
2399
2399
|
d.value,
|
|
2400
2400
|
f.value,
|
|
2401
2401
|
l.value || "",
|
|
2402
2402
|
JSON.stringify(i.filterParams)
|
|
2403
|
-
]), { data: h, isFetching: g } =
|
|
2403
|
+
]), { data: h, isFetching: g } = gt({
|
|
2404
2404
|
queryKey: m,
|
|
2405
2405
|
queryFn: () => i.fetcher({
|
|
2406
2406
|
keyword: l.value || void 0,
|
|
@@ -2409,11 +2409,12 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2409
2409
|
params: i.filterParams
|
|
2410
2410
|
}),
|
|
2411
2411
|
enabled: _(() => i.visible),
|
|
2412
|
+
placeholderData: ht,
|
|
2412
2413
|
staleTime: 3e5,
|
|
2413
2414
|
refetchOnMount: !1,
|
|
2414
2415
|
refetchOnReconnect: !1
|
|
2415
2416
|
}), S = _(() => h.value?.items ?? []), C = _(() => h.value?.total ?? 0);
|
|
2416
|
-
|
|
2417
|
+
K(() => i.visible, (e) => {
|
|
2417
2418
|
if (!e) {
|
|
2418
2419
|
s.close();
|
|
2419
2420
|
return;
|
|
@@ -2425,7 +2426,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2425
2426
|
d.value = 1;
|
|
2426
2427
|
}
|
|
2427
2428
|
function E(e) {
|
|
2428
|
-
d.value = e;
|
|
2429
|
+
e !== d.value && (d.value = e);
|
|
2429
2430
|
}
|
|
2430
2431
|
function D(e) {
|
|
2431
2432
|
f.value = e, d.value = 1;
|
|
@@ -2445,28 +2446,28 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2445
2446
|
a("update:modelValue", t), a("confirm", e), s.close();
|
|
2446
2447
|
}
|
|
2447
2448
|
return t({ tableRef: c }), (t, n) => {
|
|
2448
|
-
let r =
|
|
2449
|
-
return L(), v(
|
|
2450
|
-
title: e.dialogTitle ||
|
|
2449
|
+
let r = te("el-button"), i = te("el-input"), a = V("loading");
|
|
2450
|
+
return L(), v(W(o), {
|
|
2451
|
+
title: e.dialogTitle || W(u)("components.asyncSelect.placeholder"),
|
|
2451
2452
|
class: N(`dialog-list__modal w-[${e.dialogWidth}]`),
|
|
2452
|
-
"cancel-text":
|
|
2453
|
-
"confirm-text":
|
|
2453
|
+
"cancel-text": W(u)("components.dialogList.cancel"),
|
|
2454
|
+
"confirm-text": W(u)("components.dialogList.confirm")
|
|
2454
2455
|
}, {
|
|
2455
|
-
default:
|
|
2456
|
+
default: q(() => [x("div", ki, [x("div", Ai, [w(i, {
|
|
2456
2457
|
modelValue: l.value,
|
|
2457
2458
|
"onUpdate:modelValue": n[0] ||= (e) => l.value = e,
|
|
2458
|
-
placeholder:
|
|
2459
|
+
placeholder: W(u)("components.dialogList.placeholder"),
|
|
2459
2460
|
clearable: "",
|
|
2460
2461
|
style: { width: "260px" },
|
|
2461
|
-
onKeyup:
|
|
2462
|
+
onKeyup: ce(T, ["enter"]),
|
|
2462
2463
|
onClear: T
|
|
2463
2464
|
}, {
|
|
2464
|
-
append:
|
|
2465
|
-
icon:
|
|
2465
|
+
append: q(() => [w(r, {
|
|
2466
|
+
icon: W(st),
|
|
2466
2467
|
onClick: T
|
|
2467
2468
|
}, null, 8, ["icon"])]),
|
|
2468
2469
|
_: 1
|
|
2469
|
-
}, 8, ["modelValue", "placeholder"]), O.value > 0 ? (L(), b("span",
|
|
2470
|
+
}, 8, ["modelValue", "placeholder"]), O.value > 0 ? (L(), b("span", ji, U(W(u)("components.dialogList.selectedCount", { count: O.value })), 1)) : y("", !0)]), J((L(), b("div", Mi, [w(Oi, {
|
|
2470
2471
|
ref_key: "tableRef",
|
|
2471
2472
|
ref: c,
|
|
2472
2473
|
columns: e.columns,
|
|
@@ -2495,7 +2496,7 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2495
2496
|
"total",
|
|
2496
2497
|
"per_page",
|
|
2497
2498
|
"current_page"
|
|
2498
|
-
])])), [[a,
|
|
2499
|
+
])])), [[a, W(g)]])])]),
|
|
2499
2500
|
_: 1
|
|
2500
2501
|
}, 8, [
|
|
2501
2502
|
"title",
|
|
@@ -2505,12 +2506,12 @@ var bi = { class: "table-entity__toolbar-right" }, xi = { class: "buttons" }, Si
|
|
|
2505
2506
|
]);
|
|
2506
2507
|
};
|
|
2507
2508
|
}
|
|
2508
|
-
}), [["__scopeId", "data-v-
|
|
2509
|
+
}), [["__scopeId", "data-v-34113a12"]]);
|
|
2509
2510
|
// src/components/async-select/async-select.utils.ts
|
|
2510
|
-
async function
|
|
2511
|
+
async function Pi({ activeValues: e, selectedValues: t, loadRows: n, resolveValue: r, toOption: i }) {
|
|
2511
2512
|
let a = e.filter((e) => !t.some((t) => String(t) === String(e)));
|
|
2512
2513
|
if (a.length === 0) return [];
|
|
2513
|
-
let o = new Set(a.map(String)), s = await n(), c = [];
|
|
2514
|
+
let o = new Set(a.map(String)), s = await n(a), c = [];
|
|
2514
2515
|
for (let e of s) {
|
|
2515
2516
|
let t = r(e);
|
|
2516
2517
|
if (!o.has(String(t))) continue;
|
|
@@ -2520,13 +2521,13 @@ async function Ni({ activeValues: e, selectedValues: t, loadRows: n, resolveValu
|
|
|
2520
2521
|
return c;
|
|
2521
2522
|
}
|
|
2522
2523
|
// src/components/async-select/async-select.vue?vue&type=script&setup=true&lang.ts
|
|
2523
|
-
var
|
|
2524
|
+
var Fi = { class: "async-select" }, Ii = { class: "async-select__value" }, Li = ["src"], Ri = { class: "async-select__value-text" }, zi = {
|
|
2524
2525
|
key: 0,
|
|
2525
2526
|
class: "async-select__option"
|
|
2526
|
-
},
|
|
2527
|
+
}, Bi = { class: "async-select__option-label" }, Vi = ["src"], Hi = { class: "async-select__option-text" }, Ui = {
|
|
2527
2528
|
key: 0,
|
|
2528
2529
|
class: "async-select__option-desc"
|
|
2529
|
-
},
|
|
2530
|
+
}, Wi = ["title"], Gi = ["src", "alt"], Ki = /*@__PURE__*/ E({
|
|
2530
2531
|
__name: "async-select",
|
|
2531
2532
|
props: {
|
|
2532
2533
|
modelValue: {},
|
|
@@ -2554,11 +2555,11 @@ var Pi = { class: "async-select" }, Fi = { class: "async-select__value" }, Ii =
|
|
|
2554
2555
|
},
|
|
2555
2556
|
emits: ["update:modelValue", "change"],
|
|
2556
2557
|
setup(e, { expose: t, emit: n }) {
|
|
2557
|
-
let r = e, i = n, { options: a } =
|
|
2558
|
+
let r = e, i = n, { options: a } = jr(() => r.dictCode), o = _(() => r.dictCode ? a.value : r.options), s = _(() => {
|
|
2558
2559
|
if (r.labelKey) return r.labelKey;
|
|
2559
2560
|
let e = r.columns?.[0];
|
|
2560
2561
|
return e?.dataKey ? e.dataKey : "label";
|
|
2561
|
-
}), c =
|
|
2562
|
+
}), c = R([]), l = R([]), d = R(0), f = R(!1), p = R(!0), m = R(""), h = R(!1), g = _(() => typeof r.fetcher == "function"), S = /* @__PURE__ */ new Map(), C = null, T = _({
|
|
2562
2563
|
get: () => r.modelValue,
|
|
2563
2564
|
set: (e) => i("update:modelValue", e)
|
|
2564
2565
|
}), E = _(() => Array.isArray(r.modelValue) ? r.modelValue.filter((e) => e != null) : r.modelValue == null ? [] : [r.modelValue]);
|
|
@@ -2599,7 +2600,7 @@ var Pi = { class: "async-select" }, Fi = { class: "async-select__value" }, Ii =
|
|
|
2599
2600
|
l.value.find((t) => P(t.value, e.value)) || l.value.push(e);
|
|
2600
2601
|
}
|
|
2601
2602
|
}
|
|
2602
|
-
let
|
|
2603
|
+
let ee = _(() => {
|
|
2603
2604
|
let e = c.value.map((e) => {
|
|
2604
2605
|
let t = M(e);
|
|
2605
2606
|
return {
|
|
@@ -2612,10 +2613,10 @@ var Pi = { class: "async-select" }, Fi = { class: "async-select__value" }, Ii =
|
|
|
2612
2613
|
})).filter((t) => E.value.some((e) => P(e, t.value)) && !e.find((e) => P(e.value, t.value)));
|
|
2613
2614
|
return [...e, ...t];
|
|
2614
2615
|
});
|
|
2615
|
-
|
|
2616
|
+
K(o, (e) => {
|
|
2616
2617
|
g.value || (c.value = e ?? [], p.value = !1);
|
|
2617
2618
|
}, { immediate: !0 });
|
|
2618
|
-
async function
|
|
2619
|
+
async function z(e = !1) {
|
|
2619
2620
|
let t = m.value || void 0, n = t ?? "";
|
|
2620
2621
|
if (!e && C === n) return;
|
|
2621
2622
|
let r = S.get(n);
|
|
@@ -2624,7 +2625,7 @@ var Pi = { class: "async-select" }, Fi = { class: "async-select__value" }, Ii =
|
|
|
2624
2625
|
return;
|
|
2625
2626
|
}
|
|
2626
2627
|
d.value = 1, c.value = [], p.value = !0;
|
|
2627
|
-
let i =
|
|
2628
|
+
let i = te(1, t);
|
|
2628
2629
|
S.set(n, i);
|
|
2629
2630
|
try {
|
|
2630
2631
|
await i, (m.value || void 0) === t && (C = n);
|
|
@@ -2632,10 +2633,10 @@ var Pi = { class: "async-select" }, Fi = { class: "async-select__value" }, Ii =
|
|
|
2632
2633
|
S.get(n) === i && S.delete(n);
|
|
2633
2634
|
}
|
|
2634
2635
|
}
|
|
2635
|
-
async function
|
|
2636
|
-
!f.value && p.value && await
|
|
2636
|
+
async function B() {
|
|
2637
|
+
!f.value && p.value && await te(d.value + 1);
|
|
2637
2638
|
}
|
|
2638
|
-
async function
|
|
2639
|
+
async function te(e, t = m.value || void 0) {
|
|
2639
2640
|
if (r.fetcher) {
|
|
2640
2641
|
f.value = !0;
|
|
2641
2642
|
try {
|
|
@@ -2646,37 +2647,38 @@ var Pi = { class: "async-select" }, Fi = { class: "async-select__value" }, Ii =
|
|
|
2646
2647
|
});
|
|
2647
2648
|
if ((m.value || void 0) !== t) return;
|
|
2648
2649
|
let i = n.items ?? [];
|
|
2649
|
-
e === 1 ? c.value = i : c.value.push(...i), d.value = e, p.value =
|
|
2650
|
+
e === 1 ? c.value = i : c.value.push(...i), d.value = e, p.value = e * r.perPage < Number(n.total ?? 0);
|
|
2650
2651
|
} finally {
|
|
2651
2652
|
f.value = !1;
|
|
2652
2653
|
}
|
|
2653
2654
|
}
|
|
2654
2655
|
}
|
|
2655
|
-
async function
|
|
2656
|
-
h.value = e, e && g.value && c.value.length === 0 && await
|
|
2656
|
+
async function V(e) {
|
|
2657
|
+
h.value = e, e && g.value && c.value.length === 0 && await z();
|
|
2657
2658
|
}
|
|
2658
|
-
|
|
2659
|
-
e.length === 0 ? l.value = [] : (I(t.filter((t) => e.some((e) => P(e, D(t)))).map(M)), g.value && r.fetcher && I(await
|
|
2659
|
+
K([E, o], async ([e, t]) => {
|
|
2660
|
+
e.length === 0 ? l.value = [] : (I(t.filter((t) => e.some((e) => P(e, D(t)))).map(M)), g.value && r.fetcher && I(await Pi({
|
|
2660
2661
|
activeValues: e,
|
|
2661
2662
|
selectedValues: l.value.map((e) => e.value),
|
|
2662
|
-
loadRows: () => r.fetcher({
|
|
2663
|
+
loadRows: (e) => r.fetcher({
|
|
2663
2664
|
page: 1,
|
|
2664
|
-
per_page:
|
|
2665
|
+
per_page: Math.max(e.length, 1),
|
|
2666
|
+
selectedValues: e
|
|
2665
2667
|
}).then((e) => e.items ?? []),
|
|
2666
2668
|
resolveValue: D,
|
|
2667
2669
|
toOption: M
|
|
2668
2670
|
})));
|
|
2669
2671
|
}, { immediate: !0 });
|
|
2670
|
-
let
|
|
2671
|
-
function
|
|
2672
|
-
r.disabled || (
|
|
2672
|
+
let H = R(!1);
|
|
2673
|
+
function ne() {
|
|
2674
|
+
r.disabled || (H.value = !0);
|
|
2673
2675
|
}
|
|
2674
|
-
function
|
|
2676
|
+
function re(e) {
|
|
2675
2677
|
I(e.map(M));
|
|
2676
2678
|
let t = r.multiple ? e.map((e) => D(e)) : e[0] ? D(e[0]) : null;
|
|
2677
2679
|
i("update:modelValue", t), i("change", t, e);
|
|
2678
2680
|
}
|
|
2679
|
-
async function
|
|
2681
|
+
async function ie(e) {
|
|
2680
2682
|
if (r.fetcher) {
|
|
2681
2683
|
let t = await r.fetcher(e);
|
|
2682
2684
|
return {
|
|
@@ -2690,16 +2692,16 @@ var Pi = { class: "async-select" }, Fi = { class: "async-select__value" }, Ii =
|
|
|
2690
2692
|
total: n.length
|
|
2691
2693
|
};
|
|
2692
2694
|
}
|
|
2693
|
-
let
|
|
2695
|
+
let G = _(() => r.placeholder || u("components.asyncSelect.placeholder")), ae = _(() => r.dialogTitle || u("components.asyncSelect.placeholder"));
|
|
2694
2696
|
return t({
|
|
2695
|
-
reload: () =>
|
|
2697
|
+
reload: () => z(!0),
|
|
2696
2698
|
allItems: c
|
|
2697
|
-
}), (t, n) => (L(), b("div",
|
|
2698
|
-
w(
|
|
2699
|
+
}), (t, n) => (L(), b("div", Fi, [
|
|
2700
|
+
w(W(je), j({
|
|
2699
2701
|
modelValue: T.value,
|
|
2700
2702
|
"onUpdate:modelValue": n[0] ||= (e) => T.value = e,
|
|
2701
2703
|
class: "async-select__select",
|
|
2702
|
-
options:
|
|
2704
|
+
options: ee.value,
|
|
2703
2705
|
loading: f.value,
|
|
2704
2706
|
multiple: e.multiple,
|
|
2705
2707
|
filterable: "",
|
|
@@ -2707,26 +2709,26 @@ var Pi = { class: "async-select" }, Fi = { class: "async-select__value" }, Ii =
|
|
|
2707
2709
|
remote: g.value,
|
|
2708
2710
|
"remote-show-suffix": "",
|
|
2709
2711
|
"remote-method": g.value ? (e) => {
|
|
2710
|
-
m.value !== e && (m.value = e, k(C) ? C.value = null : C = null),
|
|
2712
|
+
m.value !== e && (m.value = e, k(C) ? C.value = null : C = null), z();
|
|
2711
2713
|
} : void 0,
|
|
2712
|
-
placeholder:
|
|
2714
|
+
placeholder: G.value,
|
|
2713
2715
|
disabled: e.disabled
|
|
2714
2716
|
}, t.$attrs, {
|
|
2715
|
-
onVisibleChange:
|
|
2716
|
-
onEndReached:
|
|
2717
|
+
onVisibleChange: V,
|
|
2718
|
+
onEndReached: B
|
|
2717
2719
|
}), {
|
|
2718
|
-
label:
|
|
2720
|
+
label: q((e) => [x("span", Ii, [e?.label?.flag ? (L(), b("img", {
|
|
2719
2721
|
key: 0,
|
|
2720
2722
|
class: "async-select__flag",
|
|
2721
2723
|
src: e.label.flag,
|
|
2722
2724
|
alt: ""
|
|
2723
|
-
}, null, 8,
|
|
2724
|
-
default:
|
|
2725
|
+
}, null, 8, Li)) : y("", !0), x("span", Ri, U(e?.label?.label ?? ""), 1)])]),
|
|
2726
|
+
default: q((e) => [e?.item ? (L(), b("div", zi, [x("p", Bi, [e.item.label.flag ? (L(), b("img", {
|
|
2725
2727
|
key: 0,
|
|
2726
2728
|
class: "async-select__flag",
|
|
2727
2729
|
src: e.item.label.flag,
|
|
2728
2730
|
alt: ""
|
|
2729
|
-
}, null, 8,
|
|
2731
|
+
}, null, 8, Vi)) : y("", !0), x("span", Hi, U(e.item.label.label), 1)]), e.item.label.subtitle ? (L(), b("p", Ui, U(e.item.label.subtitle), 1)) : y("", !0)])) : y("", !0)]),
|
|
2730
2732
|
_: 1
|
|
2731
2733
|
}, 16, [
|
|
2732
2734
|
"modelValue",
|
|
@@ -2742,28 +2744,28 @@ var Pi = { class: "async-select" }, Fi = { class: "async-select__value" }, Ii =
|
|
|
2742
2744
|
key: 0,
|
|
2743
2745
|
type: "button",
|
|
2744
2746
|
class: N(["async-select__inner-trigger", { "is-disabled": e.disabled }]),
|
|
2745
|
-
title:
|
|
2746
|
-
onMousedown: n[1] ||=
|
|
2747
|
-
onClick:
|
|
2748
|
-
}, [w(
|
|
2749
|
-
default:
|
|
2750
|
-
src:
|
|
2751
|
-
alt:
|
|
2752
|
-
}, null, 8,
|
|
2747
|
+
title: W(u)("components.asyncSelect.dialogSelect"),
|
|
2748
|
+
onMousedown: n[1] ||= le(() => {}, ["prevent"]),
|
|
2749
|
+
onClick: le(ne, ["stop"])
|
|
2750
|
+
}, [w(W(Z), null, {
|
|
2751
|
+
default: q(() => [x("img", {
|
|
2752
|
+
src: W(cn),
|
|
2753
|
+
alt: W(u)("components.asyncSelect.more")
|
|
2754
|
+
}, null, 8, Gi)]),
|
|
2753
2755
|
_: 1
|
|
2754
|
-
})], 42,
|
|
2755
|
-
e.columns.length > 0 ? (L(), v(
|
|
2756
|
+
})], 42, Wi)) : y("", !0),
|
|
2757
|
+
e.columns.length > 0 ? (L(), v(Ni, {
|
|
2756
2758
|
key: 1,
|
|
2757
|
-
visible:
|
|
2759
|
+
visible: H.value,
|
|
2758
2760
|
columns: e.columns,
|
|
2759
2761
|
"model-value": e.modelValue,
|
|
2760
2762
|
multiple: e.multiple,
|
|
2761
|
-
fetcher: (e) =>
|
|
2763
|
+
fetcher: (e) => ie(e),
|
|
2762
2764
|
"row-key": e.valueKey,
|
|
2763
|
-
"dialog-title":
|
|
2765
|
+
"dialog-title": ae.value,
|
|
2764
2766
|
"per-page": e.perPage,
|
|
2765
|
-
"onUpdate:visible": n[2] ||= (e) =>
|
|
2766
|
-
onConfirm:
|
|
2767
|
+
"onUpdate:visible": n[2] ||= (e) => H.value = e,
|
|
2768
|
+
onConfirm: re
|
|
2767
2769
|
}, null, 8, [
|
|
2768
2770
|
"visible",
|
|
2769
2771
|
"columns",
|
|
@@ -2776,26 +2778,26 @@ var Pi = { class: "async-select" }, Fi = { class: "async-select__value" }, Ii =
|
|
|
2776
2778
|
])) : y("", !0)
|
|
2777
2779
|
]));
|
|
2778
2780
|
}
|
|
2779
|
-
}),
|
|
2781
|
+
}), qi = /* @__PURE__ */ e({ default: () => Ji }), Ji = /*#__PURE__*/ d(Ki, [["__scopeId", "data-v-f23a4e1b"]]), Yi = { theme: { get cardShadow() {
|
|
2780
2782
|
return i().value;
|
|
2781
|
-
} } },
|
|
2783
|
+
} } }, Xi = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
2782
2784
|
inheritAttrs: !1,
|
|
2783
2785
|
__name: "index",
|
|
2784
2786
|
setup(e) {
|
|
2785
|
-
let t = _(() =>
|
|
2786
|
-
return (e, n) => (L(), v(
|
|
2787
|
+
let t = _(() => Yi.theme.cardShadow);
|
|
2788
|
+
return (e, n) => (L(), v(W(ue), j({ class: "box-card" }, e.$attrs, { shadow: t.value }), S({ _: 2 }, [z(e.$slots, (t, n) => ({
|
|
2787
2789
|
name: n,
|
|
2788
|
-
fn:
|
|
2790
|
+
fn: q((t) => [B(e.$slots, n, P(D(t ?? {})), void 0, !0)])
|
|
2789
2791
|
}))]), 1040, ["shadow"]));
|
|
2790
2792
|
}
|
|
2791
|
-
}), [["__scopeId", "data-v-ed977a22"]]),
|
|
2792
|
-
function Zi(e) {
|
|
2793
|
-
Xi.set(e.key, e);
|
|
2794
|
-
}
|
|
2793
|
+
}), [["__scopeId", "data-v-ed977a22"]]), Zi = /* @__PURE__ */ new Map();
|
|
2795
2794
|
function Qi(e) {
|
|
2796
|
-
|
|
2795
|
+
Zi.set(e.key, e);
|
|
2797
2796
|
}
|
|
2798
|
-
function $i(e
|
|
2797
|
+
function $i(e) {
|
|
2798
|
+
return Zi.get(e);
|
|
2799
|
+
}
|
|
2800
|
+
function ea(e, { keyword: t, page: n, per_page: r }, i) {
|
|
2799
2801
|
let a = t?.trim().toLowerCase(), o = a ? e.filter((e) => i.some((t) => String(e[t] ?? "").toLowerCase().includes(a))) : e;
|
|
2800
2802
|
return {
|
|
2801
2803
|
items: o.slice((n - 1) * r, n * r),
|
|
@@ -2803,13 +2805,13 @@ function $i(e, { keyword: t, page: n, per_page: r }, i) {
|
|
|
2803
2805
|
};
|
|
2804
2806
|
}
|
|
2805
2807
|
// src/components/schema-form/readonly-text.vue?vue&type=script&setup=true&lang.ts
|
|
2806
|
-
var
|
|
2808
|
+
var ta = { class: "readonly-text" }, na = {
|
|
2807
2809
|
key: 0,
|
|
2808
2810
|
class: "readonly-text__value"
|
|
2809
|
-
},
|
|
2811
|
+
}, ra = {
|
|
2810
2812
|
key: 1,
|
|
2811
2813
|
class: "readonly-text__empty"
|
|
2812
|
-
},
|
|
2814
|
+
}, ia = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
2813
2815
|
__name: "readonly-text",
|
|
2814
2816
|
props: {
|
|
2815
2817
|
copyable: { type: Boolean },
|
|
@@ -2823,31 +2825,31 @@ var ea = { class: "readonly-text" }, ta = {
|
|
|
2823
2825
|
async function o() {
|
|
2824
2826
|
await n(i.value), Q.success(u("schemaForm.copied"));
|
|
2825
2827
|
}
|
|
2826
|
-
return (e, t) => (L(), b("div",
|
|
2828
|
+
return (e, t) => (L(), b("div", ta, [i.value ? (L(), b("span", na, U(i.value), 1)) : (L(), b("span", ra, U(W(u)("schemaForm.empty")), 1)), a.value ? (L(), v(W(Z), {
|
|
2827
2829
|
key: 2,
|
|
2828
2830
|
class: "readonly-text__copy",
|
|
2829
|
-
title:
|
|
2831
|
+
title: W(u)("schemaForm.copy"),
|
|
2830
2832
|
onClick: o
|
|
2831
2833
|
}, {
|
|
2832
|
-
default:
|
|
2834
|
+
default: q(() => [w(W(Xe))]),
|
|
2833
2835
|
_: 1
|
|
2834
2836
|
}, 8, ["title"])) : y("", !0)]));
|
|
2835
2837
|
}
|
|
2836
|
-
}), [["__scopeId", "data-v-1f95eeac"]]),
|
|
2837
|
-
function aa(e) {
|
|
2838
|
-
return typeof e == "object" && e && "component" in e && e.component ? e : { component: e };
|
|
2839
|
-
}
|
|
2838
|
+
}), [["__scopeId", "data-v-1f95eeac"]]), aa = ne({});
|
|
2840
2839
|
function oa(e) {
|
|
2841
|
-
|
|
2840
|
+
return typeof e == "object" && e && "component" in e && e.component ? e : { component: e };
|
|
2842
2841
|
}
|
|
2843
2842
|
function sa(e) {
|
|
2843
|
+
for (let [t, n] of Object.entries(e)) n && (aa[t] = n);
|
|
2844
|
+
}
|
|
2845
|
+
function ca(e) {
|
|
2844
2846
|
if (!e) return;
|
|
2845
|
-
if (typeof e != "string") return
|
|
2846
|
-
let t =
|
|
2847
|
-
return t ?
|
|
2847
|
+
if (typeof e != "string") return oa(e);
|
|
2848
|
+
let t = aa[e];
|
|
2849
|
+
return t ? oa(t) : void 0;
|
|
2848
2850
|
}
|
|
2849
2851
|
// src/components/schema-form/schema-form.util.ts
|
|
2850
|
-
var
|
|
2852
|
+
var la = /* @__PURE__ */ new Set([
|
|
2851
2853
|
"async-select",
|
|
2852
2854
|
"checkbox",
|
|
2853
2855
|
"date",
|
|
@@ -2860,47 +2862,51 @@ var ca = /* @__PURE__ */ new Set([
|
|
|
2860
2862
|
"switch",
|
|
2861
2863
|
"upload"
|
|
2862
2864
|
]);
|
|
2863
|
-
function la(e) {
|
|
2864
|
-
return ca.has(e.type);
|
|
2865
|
-
}
|
|
2866
2865
|
function ua(e) {
|
|
2867
|
-
return e.type
|
|
2866
|
+
return la.has(e.type);
|
|
2868
2867
|
}
|
|
2869
2868
|
function da(e) {
|
|
2870
|
-
return e.
|
|
2869
|
+
return e.type === "group";
|
|
2871
2870
|
}
|
|
2872
|
-
function fa(e
|
|
2873
|
-
return
|
|
2871
|
+
function fa(e) {
|
|
2872
|
+
return e.flatMap((e) => da(e) ? e.children : [e]);
|
|
2874
2873
|
}
|
|
2875
2874
|
function pa(e, t) {
|
|
2876
|
-
return
|
|
2875
|
+
return typeof e == "function" ? e(t) : e === !0;
|
|
2877
2876
|
}
|
|
2878
|
-
function ma(e) {
|
|
2877
|
+
function ma(e, t) {
|
|
2878
|
+
return t.mode === "create" && e.hideOnCreate || t.mode === "edit" && e.hideOnEdit ? !0 : pa(e.hidden, t);
|
|
2879
|
+
}
|
|
2880
|
+
function ha(e) {
|
|
2879
2881
|
if (e.placeholder) return e.placeholder;
|
|
2880
2882
|
let t = e.label || e.prop;
|
|
2881
|
-
return
|
|
2883
|
+
return ua(e) ? u("validation.selectField", { field: t }) : u("validation.enterField", { field: t });
|
|
2882
2884
|
}
|
|
2883
|
-
function
|
|
2885
|
+
function ga(e, t) {
|
|
2884
2886
|
let n = e.rules ? [...e.rules] : [];
|
|
2885
|
-
return
|
|
2887
|
+
return pa(e.required, t) && n.unshift(e.translateConfig && [
|
|
2886
2888
|
"rich-text",
|
|
2887
2889
|
"text",
|
|
2888
2890
|
"textarea"
|
|
2889
2891
|
].includes(e.type) ? {
|
|
2890
|
-
message:
|
|
2892
|
+
message: ha(e),
|
|
2891
2893
|
trigger: "change",
|
|
2892
2894
|
validator: (t, n) => {
|
|
2893
2895
|
let r = (e) => typeof e == "string" ? e.trim().length > 0 : typeof e == "number" || typeof e == "boolean" ? !0 : Array.isArray(e) ? e.some((e) => r(e)) : e && typeof e == "object" ? Object.values(e).some((e) => r(e)) : !1;
|
|
2894
|
-
return n && typeof n == "object" && Object.values(n).some((e) => r(e)) || Error(
|
|
2896
|
+
return n && typeof n == "object" && Object.values(n).some((e) => r(e)) || Error(ha(e));
|
|
2895
2897
|
}
|
|
2896
2898
|
} : {
|
|
2897
2899
|
required: !0,
|
|
2898
|
-
message:
|
|
2899
|
-
trigger:
|
|
2900
|
+
message: ha(e),
|
|
2901
|
+
trigger: ua(e) ? "change" : "blur"
|
|
2900
2902
|
}), n;
|
|
2901
2903
|
}
|
|
2902
2904
|
// src/components/rich-text-editor/index.vue?vue&type=script&setup=true&lang.ts
|
|
2903
|
-
var
|
|
2905
|
+
var _a = ["title"], va = ["title"], ya = ["title"], ba = ["title"], xa = ["disabled"], Sa = { value: "" }, Ca = ["title"], wa = ["title"], Ta = ["title"], Ea = ["title"], Da = ["title"], Oa = ["title"], ka = ["disabled"], Aa = ["value"], ja = ["disabled"], Ma = ["value"], Na = ["disabled"], Pa = { value: "paragraph" }, Fa = { value: "h1" }, Ia = { value: "h2" }, La = { value: "h3" }, Ra = { value: "blockquote" }, za = ["title"], Ba = ["title"], Va = ["title"], Ha = ["title"], Ua = ["title"], Wa = ["title"], Ga = ["title"], Ka = ["title"], qa = ["title"], Ja = ["title"], Ya = ["title"], Xa = ["disabled"], Za = { value: "" }, Qa = { value: "insertTable" }, $a = { value: "addColumnBefore" }, eo = { value: "addColumnAfter" }, to = { value: "deleteColumn" }, no = { value: "addRowBefore" }, ro = { value: "addRowAfter" }, io = { value: "deleteRow" }, ao = { value: "deleteTable" }, oo = ["title"], so = ["title"], co = ["title"], lo = ["title"], uo = ["title"], fo = [
|
|
2906
|
+
"title",
|
|
2907
|
+
"disabled",
|
|
2908
|
+
"onClick"
|
|
2909
|
+
], po = { key: 1 }, mo = ["readonly"], ho = /*@__PURE__*/ E({
|
|
2904
2910
|
__name: "index",
|
|
2905
2911
|
props: {
|
|
2906
2912
|
editable: {
|
|
@@ -2909,7 +2915,9 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
2909
2915
|
},
|
|
2910
2916
|
maxHeight: { default: "400px" },
|
|
2911
2917
|
modelValue: { default: "" },
|
|
2912
|
-
placeholder: { default: "" }
|
|
2918
|
+
placeholder: { default: "" },
|
|
2919
|
+
richTextTools: {},
|
|
2920
|
+
toolContext: {}
|
|
2913
2921
|
},
|
|
2914
2922
|
emits: ["update:modelValue"],
|
|
2915
2923
|
setup(e, { expose: t, emit: n }) {
|
|
@@ -2942,37 +2950,37 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
2942
2950
|
"20px",
|
|
2943
2951
|
"24px",
|
|
2944
2952
|
"32px"
|
|
2945
|
-
], s =
|
|
2953
|
+
], s = R(r.modelValue), c = R(!1), l = R(!1), d = R(0), f = _(() => r.placeholder || u("components.richTextEditor.placeholder")), p = sn({
|
|
2946
2954
|
content: r.modelValue,
|
|
2947
2955
|
editable: r.editable,
|
|
2948
2956
|
extensions: [
|
|
2949
|
-
|
|
2957
|
+
an.configure({ heading: { levels: [
|
|
2950
2958
|
1,
|
|
2951
2959
|
2,
|
|
2952
2960
|
3
|
|
2953
2961
|
] } }),
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
Qt,
|
|
2962
|
+
nn,
|
|
2963
|
+
Ht,
|
|
2957
2964
|
$t,
|
|
2958
2965
|
en,
|
|
2959
|
-
|
|
2960
|
-
Ut
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2966
|
+
tn,
|
|
2967
|
+
Ut,
|
|
2968
|
+
Wt.configure({ multicolor: !0 }),
|
|
2969
|
+
rn,
|
|
2970
|
+
Qt.configure({ types: ["heading", "paragraph"] }),
|
|
2971
|
+
Jt.configure({
|
|
2964
2972
|
HTMLAttributes: { class: "rich-text-table" },
|
|
2965
2973
|
resizable: !0
|
|
2966
2974
|
}),
|
|
2975
|
+
Zt,
|
|
2967
2976
|
Xt,
|
|
2968
2977
|
Yt,
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
Wt.configure({
|
|
2978
|
+
qt.configure({ placeholder: f.value }),
|
|
2979
|
+
Gt.configure({
|
|
2972
2980
|
allowBase64: !0,
|
|
2973
2981
|
inline: !0
|
|
2974
2982
|
}),
|
|
2975
|
-
|
|
2983
|
+
Kt.configure({
|
|
2976
2984
|
HTMLAttributes: {
|
|
2977
2985
|
rel: "noopener noreferrer",
|
|
2978
2986
|
target: "_blank"
|
|
@@ -2988,14 +2996,42 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
2988
2996
|
let t = e.getHTML();
|
|
2989
2997
|
s.value = t, d.value += 1, i("update:modelValue", t);
|
|
2990
2998
|
}
|
|
2991
|
-
}), m = _(() => !r.editable)
|
|
2999
|
+
}), m = _(() => !r.editable);
|
|
3000
|
+
function h() {
|
|
3001
|
+
return c.value ? s.value : p.value?.getHTML() ?? r.modelValue;
|
|
3002
|
+
}
|
|
3003
|
+
function S(e) {
|
|
3004
|
+
s.value = e, p.value && p.value.getHTML() !== e && p.value.commands.setContent(e, { emitUpdate: !0 });
|
|
3005
|
+
}
|
|
3006
|
+
let T = _(() => (d.value, {
|
|
3007
|
+
...r.toolContext ?? {},
|
|
3008
|
+
editable: r.editable,
|
|
3009
|
+
editor: p.value,
|
|
3010
|
+
getValue: h,
|
|
3011
|
+
updateValue: S,
|
|
3012
|
+
value: h()
|
|
3013
|
+
}));
|
|
3014
|
+
function E(e, t) {
|
|
3015
|
+
return typeof e == "function" ? e(T.value) : e ?? t;
|
|
3016
|
+
}
|
|
3017
|
+
let D = _(() => (d.value, (r.richTextTools ?? []).filter((e) => E(e.visible, !0)).map((e, t) => ({
|
|
3018
|
+
index: t,
|
|
3019
|
+
tool: e
|
|
3020
|
+
})).sort((e, t) => (e.tool.order ?? 0) - (t.tool.order ?? 0) || e.index - t.index).map(({ tool: e }) => e)));
|
|
3021
|
+
function O(e) {
|
|
3022
|
+
return m.value || E(e.disabled, !1);
|
|
3023
|
+
}
|
|
3024
|
+
async function k(e) {
|
|
3025
|
+
"onClick" in e && e.onClick && !O(e) && await e.onClick(T.value);
|
|
3026
|
+
}
|
|
3027
|
+
let A = _({
|
|
2992
3028
|
get() {
|
|
2993
3029
|
return d.value, p.value?.isActive("heading", { level: 1 }) ? "h1" : p.value?.isActive("heading", { level: 2 }) ? "h2" : p.value?.isActive("heading", { level: 3 }) ? "h3" : p.value?.isActive("blockquote") ? "blockquote" : "paragraph";
|
|
2994
3030
|
},
|
|
2995
3031
|
set(e) {
|
|
2996
|
-
|
|
3032
|
+
ee(e);
|
|
2997
3033
|
}
|
|
2998
|
-
}),
|
|
3034
|
+
}), M = _({
|
|
2999
3035
|
get() {
|
|
3000
3036
|
return d.value, String(p.value?.getAttributes("textStyle").fontFamily ?? "");
|
|
3001
3037
|
},
|
|
@@ -3003,7 +3039,7 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3003
3039
|
let t = p.value?.chain().focus();
|
|
3004
3040
|
t && (e ? t.setFontFamily(e).run() : t.unsetFontFamily().run());
|
|
3005
3041
|
}
|
|
3006
|
-
}),
|
|
3042
|
+
}), P = _({
|
|
3007
3043
|
get() {
|
|
3008
3044
|
return d.value, String(p.value?.getAttributes("textStyle").fontSize ?? "16px");
|
|
3009
3045
|
},
|
|
@@ -3011,63 +3047,63 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3011
3047
|
p.value?.chain().focus().setFontSize(e).run();
|
|
3012
3048
|
}
|
|
3013
3049
|
});
|
|
3014
|
-
|
|
3050
|
+
K(() => r.modelValue, (e) => {
|
|
3015
3051
|
let t = e ?? "";
|
|
3016
3052
|
s.value = t, p.value && p.value.getHTML() !== t && p.value.commands.setContent(t, { emitUpdate: !1 });
|
|
3017
|
-
}),
|
|
3053
|
+
}), K(() => r.editable, (e) => {
|
|
3018
3054
|
p.value?.setEditable(e);
|
|
3019
|
-
}),
|
|
3055
|
+
}), K(f, (e) => {
|
|
3020
3056
|
let t = p.value?.extensionManager.extensions.find((e) => e.name === "placeholder");
|
|
3021
3057
|
t && (t.options.placeholder = e, p.value?.view.dispatch(p.value.state.tr));
|
|
3022
3058
|
});
|
|
3023
|
-
function
|
|
3059
|
+
function I(e) {
|
|
3024
3060
|
p.value && !m.value && (e(p.value), d.value += 1);
|
|
3025
3061
|
}
|
|
3026
|
-
function
|
|
3027
|
-
|
|
3062
|
+
function ee(e) {
|
|
3063
|
+
I((t) => {
|
|
3028
3064
|
let n = t.chain().focus();
|
|
3029
3065
|
e === "paragraph" && n.setParagraph().run(), e === "h1" && n.toggleHeading({ level: 1 }).run(), e === "h2" && n.toggleHeading({ level: 2 }).run(), e === "h3" && n.toggleHeading({ level: 3 }).run(), e === "blockquote" && n.toggleBlockquote().run();
|
|
3030
3066
|
});
|
|
3031
3067
|
}
|
|
3032
|
-
function
|
|
3068
|
+
function te() {
|
|
3033
3069
|
p.value && p.value.getHTML() !== s.value && p.value.commands.setContent(s.value, { emitUpdate: !0 });
|
|
3034
3070
|
}
|
|
3035
|
-
function
|
|
3036
|
-
c.value ?
|
|
3071
|
+
function V() {
|
|
3072
|
+
c.value ? te() : s.value = p.value?.getHTML() ?? r.modelValue, c.value = !c.value;
|
|
3037
3073
|
}
|
|
3038
|
-
function
|
|
3074
|
+
function ne() {
|
|
3039
3075
|
if (m.value) return;
|
|
3040
3076
|
let e = p.value?.getAttributes("link").href, t = window.prompt(u("components.richTextEditor.linkPrompt"), e ?? "");
|
|
3041
3077
|
if (t === null) return;
|
|
3042
3078
|
let n = t.trim();
|
|
3043
|
-
n ? p.value?.chain().focus().extendMarkRange("link").setLink({ href:
|
|
3079
|
+
n ? p.value?.chain().focus().extendMarkRange("link").setLink({ href: ie(n) }).run() : p.value?.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
3044
3080
|
}
|
|
3045
|
-
function
|
|
3081
|
+
function re() {
|
|
3046
3082
|
if (m.value) return;
|
|
3047
3083
|
let e = window.prompt(u("components.richTextEditor.imagePrompt"));
|
|
3048
3084
|
e && p.value?.chain().focus().setImage({ src: e.trim() }).run();
|
|
3049
3085
|
}
|
|
3050
|
-
function
|
|
3086
|
+
function ie(e) {
|
|
3051
3087
|
return /^(https?:|mailto:|tel:)/i.test(e) ? e : "https://" + e;
|
|
3052
3088
|
}
|
|
3053
|
-
function
|
|
3089
|
+
function G(e) {
|
|
3054
3090
|
let t = e.target.value;
|
|
3055
|
-
|
|
3091
|
+
I((e) => e.chain().focus().setColor(t).run());
|
|
3056
3092
|
}
|
|
3057
|
-
function
|
|
3093
|
+
function ae(e) {
|
|
3058
3094
|
let t = e.target.value;
|
|
3059
|
-
|
|
3095
|
+
I((e) => e.chain().focus().setBackgroundColor(t).run());
|
|
3060
3096
|
}
|
|
3061
|
-
function
|
|
3062
|
-
|
|
3097
|
+
function q(e) {
|
|
3098
|
+
I((t) => t.chain().focus().setTextAlign(e).run());
|
|
3063
3099
|
}
|
|
3064
|
-
function
|
|
3100
|
+
function ce(e) {
|
|
3065
3101
|
let t = e.target.value;
|
|
3066
|
-
t &&
|
|
3102
|
+
t && I((e) => e.chain().focus().setLineHeight(t).run());
|
|
3067
3103
|
}
|
|
3068
|
-
function
|
|
3104
|
+
function Y(e) {
|
|
3069
3105
|
let t = e.target, n = t.value;
|
|
3070
|
-
t.value = "", n &&
|
|
3106
|
+
t.value = "", n && I((e) => {
|
|
3071
3107
|
let t = e.chain().focus();
|
|
3072
3108
|
n === "insertTable" && t.insertTable({
|
|
3073
3109
|
cols: 3,
|
|
@@ -3076,26 +3112,26 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3076
3112
|
}).run(), n === "addColumnBefore" && t.addColumnBefore().run(), n === "addColumnAfter" && t.addColumnAfter().run(), n === "deleteColumn" && t.deleteColumn().run(), n === "addRowBefore" && t.addRowBefore().run(), n === "addRowAfter" && t.addRowAfter().run(), n === "deleteRow" && t.deleteRow().run(), n === "deleteTable" && t.deleteTable().run();
|
|
3077
3113
|
});
|
|
3078
3114
|
}
|
|
3079
|
-
function
|
|
3080
|
-
|
|
3115
|
+
function ue() {
|
|
3116
|
+
I((e) => e.chain().focus().sinkListItem("listItem").run());
|
|
3081
3117
|
}
|
|
3082
|
-
function
|
|
3083
|
-
|
|
3118
|
+
function de() {
|
|
3119
|
+
I((e) => e.chain().focus().liftListItem("listItem").run());
|
|
3084
3120
|
}
|
|
3085
|
-
function
|
|
3086
|
-
|
|
3121
|
+
function fe() {
|
|
3122
|
+
I((e) => {
|
|
3087
3123
|
e.chain().focus().clearNodes().unsetAllMarks().unsetTextAlign().run();
|
|
3088
3124
|
});
|
|
3089
3125
|
}
|
|
3090
|
-
let
|
|
3126
|
+
let X = (e, t) => (d.value, p.value?.isActive(e, t) ?? !1), pe = (e) => (d.value, p.value?.isActive({ textAlign: e }) || e === "left" && ![
|
|
3091
3127
|
"center",
|
|
3092
3128
|
"right",
|
|
3093
3129
|
"justify"
|
|
3094
3130
|
].some((e) => p.value?.isActive({ textAlign: e })));
|
|
3095
3131
|
return t({
|
|
3096
3132
|
editor: p,
|
|
3097
|
-
clearFormat:
|
|
3098
|
-
}), (t, n) =>
|
|
3133
|
+
clearFormat: fe
|
|
3134
|
+
}), (t, n) => W(p) ? (L(), b("div", {
|
|
3099
3135
|
key: 0,
|
|
3100
3136
|
class: N(["rich-text-editor", {
|
|
3101
3137
|
"is-fullscreen": l.value,
|
|
@@ -3103,230 +3139,248 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3103
3139
|
}])
|
|
3104
3140
|
}, [x("div", {
|
|
3105
3141
|
class: "rich-text-toolbar",
|
|
3106
|
-
onMousedown: n[
|
|
3142
|
+
onMousedown: n[20] ||= le(() => {}, ["prevent"])
|
|
3107
3143
|
}, [
|
|
3108
3144
|
x("button", {
|
|
3109
3145
|
type: "button",
|
|
3110
|
-
title:
|
|
3111
|
-
onClick: n[0] ||= (e) =>
|
|
3112
|
-
}, [w(
|
|
3146
|
+
title: W(u)("components.richTextEditor.undo"),
|
|
3147
|
+
onClick: n[0] ||= (e) => W(p).chain().focus().undo().run()
|
|
3148
|
+
}, [w(W(Vt), { size: 17 })], 8, _a),
|
|
3113
3149
|
x("button", {
|
|
3114
3150
|
type: "button",
|
|
3115
|
-
title:
|
|
3116
|
-
onClick: n[1] ||= (e) =>
|
|
3117
|
-
}, [w(
|
|
3118
|
-
n[
|
|
3151
|
+
title: W(u)("components.richTextEditor.redo"),
|
|
3152
|
+
onClick: n[1] ||= (e) => W(p).chain().focus().redo().run()
|
|
3153
|
+
}, [w(W(Lt), { size: 17 })], 8, va),
|
|
3154
|
+
n[27] ||= x("span", { class: "rich-text-separator" }, null, -1),
|
|
3119
3155
|
x("button", {
|
|
3120
3156
|
type: "button",
|
|
3121
|
-
title:
|
|
3122
|
-
onClick:
|
|
3123
|
-
}, [w(
|
|
3157
|
+
title: W(u)("components.richTextEditor.insertImage"),
|
|
3158
|
+
onClick: re
|
|
3159
|
+
}, [w(W(Tt), { size: 17 })], 8, ya),
|
|
3124
3160
|
x("label", {
|
|
3125
3161
|
class: "rich-text-select-wrap rich-text-select-wrap--line",
|
|
3126
|
-
title:
|
|
3127
|
-
}, [w(
|
|
3162
|
+
title: W(u)("components.richTextEditor.lineHeight")
|
|
3163
|
+
}, [w(W(Dt), { size: 17 }), x("select", {
|
|
3128
3164
|
disabled: m.value,
|
|
3129
|
-
onChange:
|
|
3165
|
+
onChange: ce
|
|
3130
3166
|
}, [
|
|
3131
|
-
x("option",
|
|
3132
|
-
n[
|
|
3133
|
-
n[
|
|
3134
|
-
n[
|
|
3135
|
-
n[
|
|
3136
|
-
], 40,
|
|
3137
|
-
n[
|
|
3167
|
+
x("option", Sa, U(W(u)("components.richTextEditor.lineHeight")), 1),
|
|
3168
|
+
n[22] ||= x("option", { value: "1.2" }, "1.2", -1),
|
|
3169
|
+
n[23] ||= x("option", { value: "1.5" }, "1.5", -1),
|
|
3170
|
+
n[24] ||= x("option", { value: "1.75" }, "1.75", -1),
|
|
3171
|
+
n[25] ||= x("option", { value: "2" }, "2", -1)
|
|
3172
|
+
], 40, xa)], 8, ba),
|
|
3173
|
+
n[28] ||= x("span", { class: "rich-text-separator" }, null, -1),
|
|
3138
3174
|
x("button", {
|
|
3139
3175
|
type: "button",
|
|
3140
|
-
class: N({ "is-active":
|
|
3141
|
-
title:
|
|
3142
|
-
onClick: n[2] ||= (e) =>
|
|
3143
|
-
}, [w(
|
|
3176
|
+
class: N({ "is-active": X("bold") }),
|
|
3177
|
+
title: W(u)("components.richTextEditor.bold"),
|
|
3178
|
+
onClick: n[2] ||= (e) => W(p).chain().focus().toggleBold().run()
|
|
3179
|
+
}, [w(W(xt), { size: 17 })], 10, Ca),
|
|
3144
3180
|
x("button", {
|
|
3145
3181
|
type: "button",
|
|
3146
|
-
class: N({ "is-active":
|
|
3147
|
-
title:
|
|
3148
|
-
onClick: n[3] ||= (e) =>
|
|
3149
|
-
}, [w(
|
|
3182
|
+
class: N({ "is-active": X("italic") }),
|
|
3183
|
+
title: W(u)("components.richTextEditor.italic"),
|
|
3184
|
+
onClick: n[3] ||= (e) => W(p).chain().focus().toggleItalic().run()
|
|
3185
|
+
}, [w(W(Ot), { size: 17 })], 10, wa),
|
|
3150
3186
|
x("button", {
|
|
3151
3187
|
type: "button",
|
|
3152
|
-
class: N({ "is-active":
|
|
3153
|
-
title:
|
|
3154
|
-
onClick: n[4] ||= (e) =>
|
|
3155
|
-
}, [w(
|
|
3188
|
+
class: N({ "is-active": X("underline") }),
|
|
3189
|
+
title: W(u)("components.richTextEditor.underline"),
|
|
3190
|
+
onClick: n[4] ||= (e) => W(p).chain().focus().toggleUnderline().run()
|
|
3191
|
+
}, [w(W(Bt), { size: 17 })], 10, Ta),
|
|
3156
3192
|
x("button", {
|
|
3157
3193
|
type: "button",
|
|
3158
|
-
class: N({ "is-active":
|
|
3159
|
-
title:
|
|
3160
|
-
onClick: n[5] ||= (e) =>
|
|
3161
|
-
}, [w(
|
|
3194
|
+
class: N({ "is-active": X("strike") }),
|
|
3195
|
+
title: W(u)("components.richTextEditor.strike"),
|
|
3196
|
+
onClick: n[5] ||= (e) => W(p).chain().focus().toggleStrike().run()
|
|
3197
|
+
}, [w(W(Rt), { size: 17 })], 10, Ea),
|
|
3162
3198
|
x("label", {
|
|
3163
3199
|
class: "rich-text-color",
|
|
3164
|
-
title:
|
|
3165
|
-
}, [w(
|
|
3200
|
+
title: W(u)("components.richTextEditor.textColor")
|
|
3201
|
+
}, [w(W(Ft), { size: 17 }), x("input", {
|
|
3166
3202
|
type: "color",
|
|
3167
3203
|
value: "#111827",
|
|
3168
|
-
onInput:
|
|
3169
|
-
}, null, 32)], 8,
|
|
3204
|
+
onInput: G
|
|
3205
|
+
}, null, 32)], 8, Da),
|
|
3170
3206
|
x("label", {
|
|
3171
3207
|
class: "rich-text-color",
|
|
3172
|
-
title:
|
|
3173
|
-
}, [w(
|
|
3208
|
+
title: W(u)("components.richTextEditor.highlight")
|
|
3209
|
+
}, [w(W(wt), { size: 17 }), x("input", {
|
|
3174
3210
|
type: "color",
|
|
3175
3211
|
value: "#fff3bf",
|
|
3176
|
-
onInput:
|
|
3177
|
-
}, null, 32)], 8,
|
|
3178
|
-
n[
|
|
3179
|
-
|
|
3180
|
-
"onUpdate:modelValue": n[6] ||= (e) =>
|
|
3212
|
+
onInput: ae
|
|
3213
|
+
}, null, 32)], 8, Oa),
|
|
3214
|
+
n[29] ||= x("span", { class: "rich-text-separator" }, null, -1),
|
|
3215
|
+
J(x("select", {
|
|
3216
|
+
"onUpdate:modelValue": n[6] ||= (e) => M.value = e,
|
|
3181
3217
|
class: "rich-text-select rich-text-select--font",
|
|
3182
3218
|
disabled: m.value
|
|
3183
|
-
}, [(L(), b(g, null,
|
|
3219
|
+
}, [(L(), b(g, null, z(a, (e) => x("option", {
|
|
3184
3220
|
key: e.label,
|
|
3185
3221
|
value: e.value
|
|
3186
|
-
},
|
|
3187
|
-
|
|
3188
|
-
"onUpdate:modelValue": n[7] ||= (e) =>
|
|
3222
|
+
}, U(e.label), 9, Aa)), 64))], 8, ka), [[oe, M.value]]),
|
|
3223
|
+
J(x("select", {
|
|
3224
|
+
"onUpdate:modelValue": n[7] ||= (e) => P.value = e,
|
|
3189
3225
|
class: "rich-text-select rich-text-select--size",
|
|
3190
3226
|
disabled: m.value
|
|
3191
|
-
}, [(L(), b(g, null,
|
|
3227
|
+
}, [(L(), b(g, null, z(o, (e) => x("option", {
|
|
3192
3228
|
key: e,
|
|
3193
3229
|
value: e
|
|
3194
|
-
},
|
|
3195
|
-
|
|
3196
|
-
"onUpdate:modelValue": n[8] ||= (e) =>
|
|
3230
|
+
}, U(e), 9, Ma)), 64))], 8, ja), [[oe, P.value]]),
|
|
3231
|
+
J(x("select", {
|
|
3232
|
+
"onUpdate:modelValue": n[8] ||= (e) => A.value = e,
|
|
3197
3233
|
class: "rich-text-select rich-text-select--block",
|
|
3198
3234
|
disabled: m.value
|
|
3199
3235
|
}, [
|
|
3200
|
-
x("option",
|
|
3201
|
-
x("option",
|
|
3202
|
-
x("option",
|
|
3203
|
-
x("option",
|
|
3204
|
-
x("option",
|
|
3205
|
-
], 8,
|
|
3206
|
-
n[
|
|
3236
|
+
x("option", Pa, U(W(u)("components.richTextEditor.paragraph")), 1),
|
|
3237
|
+
x("option", Fa, U(W(u)("components.richTextEditor.heading1")), 1),
|
|
3238
|
+
x("option", Ia, U(W(u)("components.richTextEditor.heading2")), 1),
|
|
3239
|
+
x("option", La, U(W(u)("components.richTextEditor.heading3")), 1),
|
|
3240
|
+
x("option", Ra, U(W(u)("components.richTextEditor.blockquote")), 1)
|
|
3241
|
+
], 8, Na), [[oe, A.value]]),
|
|
3242
|
+
n[30] ||= x("span", { class: "rich-text-separator" }, null, -1),
|
|
3207
3243
|
x("button", {
|
|
3208
3244
|
type: "button",
|
|
3209
|
-
class: N({ "is-active":
|
|
3210
|
-
title:
|
|
3211
|
-
onClick: n[9] ||= (e) =>
|
|
3212
|
-
}, [w(
|
|
3245
|
+
class: N({ "is-active": pe("left") }),
|
|
3246
|
+
title: W(u)("components.richTextEditor.alignLeft"),
|
|
3247
|
+
onClick: n[9] ||= (e) => q("left")
|
|
3248
|
+
}, [w(W(yt), { size: 17 })], 10, za),
|
|
3213
3249
|
x("button", {
|
|
3214
3250
|
type: "button",
|
|
3215
|
-
class: N({ "is-active":
|
|
3216
|
-
title:
|
|
3217
|
-
onClick: n[10] ||= (e) =>
|
|
3218
|
-
}, [w(
|
|
3251
|
+
class: N({ "is-active": pe("center") }),
|
|
3252
|
+
title: W(u)("components.richTextEditor.alignCenter"),
|
|
3253
|
+
onClick: n[10] ||= (e) => q("center")
|
|
3254
|
+
}, [w(W(_t), { size: 17 })], 10, Ba),
|
|
3219
3255
|
x("button", {
|
|
3220
3256
|
type: "button",
|
|
3221
|
-
class: N({ "is-active":
|
|
3222
|
-
title:
|
|
3223
|
-
onClick: n[11] ||= (e) =>
|
|
3224
|
-
}, [w(
|
|
3257
|
+
class: N({ "is-active": pe("right") }),
|
|
3258
|
+
title: W(u)("components.richTextEditor.alignRight"),
|
|
3259
|
+
onClick: n[11] ||= (e) => q("right")
|
|
3260
|
+
}, [w(W(bt), { size: 17 })], 10, Va),
|
|
3225
3261
|
x("button", {
|
|
3226
3262
|
type: "button",
|
|
3227
|
-
class: N({ "is-active":
|
|
3228
|
-
title:
|
|
3229
|
-
onClick: n[12] ||= (e) =>
|
|
3230
|
-
}, [w(
|
|
3231
|
-
n[
|
|
3263
|
+
class: N({ "is-active": pe("justify") }),
|
|
3264
|
+
title: W(u)("components.richTextEditor.alignJustify"),
|
|
3265
|
+
onClick: n[12] ||= (e) => q("justify")
|
|
3266
|
+
}, [w(W(vt), { size: 17 })], 10, Ha),
|
|
3267
|
+
n[31] ||= x("span", { class: "rich-text-break" }, null, -1),
|
|
3232
3268
|
x("button", {
|
|
3233
3269
|
type: "button",
|
|
3234
|
-
title:
|
|
3235
|
-
onClick:
|
|
3236
|
-
}, [w(
|
|
3270
|
+
title: W(u)("components.richTextEditor.decreaseIndent"),
|
|
3271
|
+
onClick: de
|
|
3272
|
+
}, [w(W(Et), { size: 17 })], 8, Ua),
|
|
3237
3273
|
x("button", {
|
|
3238
3274
|
type: "button",
|
|
3239
|
-
title:
|
|
3240
|
-
onClick:
|
|
3241
|
-
}, [w(
|
|
3275
|
+
title: W(u)("components.richTextEditor.increaseIndent"),
|
|
3276
|
+
onClick: ue
|
|
3277
|
+
}, [w(W(Dt), { size: 17 })], 8, Wa),
|
|
3242
3278
|
x("button", {
|
|
3243
3279
|
type: "button",
|
|
3244
|
-
class: N({ "is-active":
|
|
3245
|
-
title:
|
|
3246
|
-
onClick: n[13] ||= (e) =>
|
|
3247
|
-
}, [w(
|
|
3280
|
+
class: N({ "is-active": X("orderedList") }),
|
|
3281
|
+
title: W(u)("components.richTextEditor.orderedList"),
|
|
3282
|
+
onClick: n[13] ||= (e) => W(p).chain().focus().toggleOrderedList().run()
|
|
3283
|
+
}, [w(W(Mt), { size: 17 })], 10, Ga),
|
|
3248
3284
|
x("button", {
|
|
3249
3285
|
type: "button",
|
|
3250
|
-
class: N({ "is-active":
|
|
3251
|
-
title:
|
|
3252
|
-
onClick: n[14] ||= (e) =>
|
|
3253
|
-
}, [w(
|
|
3286
|
+
class: N({ "is-active": X("bulletList") }),
|
|
3287
|
+
title: W(u)("components.richTextEditor.bulletList"),
|
|
3288
|
+
onClick: n[14] ||= (e) => W(p).chain().focus().toggleBulletList().run()
|
|
3289
|
+
}, [w(W(jt), { size: 17 })], 10, Ka),
|
|
3254
3290
|
x("button", {
|
|
3255
3291
|
type: "button",
|
|
3256
|
-
class: N({ "is-active":
|
|
3257
|
-
title:
|
|
3258
|
-
onClick: n[15] ||= (e) =>
|
|
3259
|
-
}, [...n[
|
|
3292
|
+
class: N({ "is-active": X("code") }),
|
|
3293
|
+
title: W(u)("components.richTextEditor.code"),
|
|
3294
|
+
onClick: n[15] ||= (e) => W(p).chain().focus().toggleCode().run()
|
|
3295
|
+
}, [...n[26] ||= [x("span", { class: "rich-text-tx" }, [C("T"), x("sub", null, "x")], -1)]], 10, qa),
|
|
3260
3296
|
x("button", {
|
|
3261
3297
|
type: "button",
|
|
3262
|
-
title:
|
|
3263
|
-
onClick:
|
|
3264
|
-
}, [w(
|
|
3298
|
+
title: W(u)("components.richTextEditor.insertLink"),
|
|
3299
|
+
onClick: ne
|
|
3300
|
+
}, [w(W(At), { size: 17 })], 8, Ja),
|
|
3265
3301
|
x("label", {
|
|
3266
3302
|
class: "rich-text-select-wrap rich-text-select-wrap--table",
|
|
3267
|
-
title:
|
|
3268
|
-
}, [w(
|
|
3303
|
+
title: W(u)("components.richTextEditor.table")
|
|
3304
|
+
}, [w(W(zt), { size: 17 }), x("select", {
|
|
3269
3305
|
disabled: m.value,
|
|
3270
|
-
onChange:
|
|
3306
|
+
onChange: Y
|
|
3271
3307
|
}, [
|
|
3272
|
-
x("option",
|
|
3273
|
-
x("option",
|
|
3274
|
-
x("option",
|
|
3275
|
-
x("option",
|
|
3276
|
-
x("option",
|
|
3277
|
-
x("option",
|
|
3278
|
-
x("option",
|
|
3279
|
-
x("option",
|
|
3280
|
-
x("option",
|
|
3281
|
-
], 40,
|
|
3282
|
-
n[
|
|
3308
|
+
x("option", Za, U(W(u)("components.richTextEditor.table")), 1),
|
|
3309
|
+
x("option", Qa, U(W(u)("components.richTextEditor.insertTable")), 1),
|
|
3310
|
+
x("option", $a, U(W(u)("components.richTextEditor.addColumnBefore")), 1),
|
|
3311
|
+
x("option", eo, U(W(u)("components.richTextEditor.addColumnAfter")), 1),
|
|
3312
|
+
x("option", to, U(W(u)("components.richTextEditor.deleteColumn")), 1),
|
|
3313
|
+
x("option", no, U(W(u)("components.richTextEditor.addRowBefore")), 1),
|
|
3314
|
+
x("option", ro, U(W(u)("components.richTextEditor.addRowAfter")), 1),
|
|
3315
|
+
x("option", io, U(W(u)("components.richTextEditor.deleteRow")), 1),
|
|
3316
|
+
x("option", ao, U(W(u)("components.richTextEditor.deleteTable")), 1)
|
|
3317
|
+
], 40, Xa)], 8, Ya),
|
|
3318
|
+
n[32] ||= x("span", { class: "rich-text-separator" }, null, -1),
|
|
3283
3319
|
x("button", {
|
|
3284
3320
|
type: "button",
|
|
3285
|
-
title:
|
|
3321
|
+
title: W(u)("components.richTextEditor.fullscreen"),
|
|
3286
3322
|
onClick: n[16] ||= (e) => l.value = !l.value
|
|
3287
|
-
}, [l.value ? (L(), v(
|
|
3323
|
+
}, [l.value ? (L(), v(W(Pt), {
|
|
3288
3324
|
key: 0,
|
|
3289
3325
|
size: 17
|
|
3290
|
-
})) : (L(), v(
|
|
3326
|
+
})) : (L(), v(W(Nt), {
|
|
3291
3327
|
key: 1,
|
|
3292
3328
|
size: 17
|
|
3293
|
-
}))], 8,
|
|
3329
|
+
}))], 8, oo),
|
|
3294
3330
|
x("button", {
|
|
3295
3331
|
type: "button",
|
|
3296
3332
|
class: N({ "is-active": c.value }),
|
|
3297
|
-
title:
|
|
3298
|
-
onClick:
|
|
3299
|
-
}, [w(
|
|
3333
|
+
title: W(u)("components.richTextEditor.sourceCode"),
|
|
3334
|
+
onClick: V
|
|
3335
|
+
}, [w(W(St), { size: 17 })], 10, so),
|
|
3300
3336
|
x("button", {
|
|
3301
3337
|
type: "button",
|
|
3302
|
-
title:
|
|
3303
|
-
onClick:
|
|
3304
|
-
}, [w(
|
|
3338
|
+
title: W(u)("components.richTextEditor.clearFormat"),
|
|
3339
|
+
onClick: fe
|
|
3340
|
+
}, [w(W(Ct), { size: 17 })], 8, co),
|
|
3305
3341
|
x("button", {
|
|
3306
3342
|
type: "button",
|
|
3307
|
-
class: N({ "is-active":
|
|
3308
|
-
title:
|
|
3309
|
-
onClick: n[17] ||= (e) =>
|
|
3310
|
-
}, [w(
|
|
3343
|
+
class: N({ "is-active": X("blockquote") }),
|
|
3344
|
+
title: W(u)("components.richTextEditor.blockquote"),
|
|
3345
|
+
onClick: n[17] ||= (e) => W(p).chain().focus().toggleBlockquote().run()
|
|
3346
|
+
}, [w(W(It), { size: 17 })], 10, lo),
|
|
3311
3347
|
t.$slots["toolbar-append"] ? (L(), b("div", {
|
|
3312
3348
|
key: 0,
|
|
3313
3349
|
class: "rich-text-toolbar-extension",
|
|
3314
|
-
onMousedown: n[18] ||=
|
|
3315
|
-
}, [
|
|
3316
|
-
|
|
3350
|
+
onMousedown: n[18] ||= le(() => {}, ["stop"])
|
|
3351
|
+
}, [B(t.$slots, "toolbar-append", {}, void 0, !0)], 32)) : y("", !0),
|
|
3352
|
+
(L(!0), b(g, null, z(D.value, (e) => (L(), b(g, { key: e.key }, [e.component ? (L(), b("div", {
|
|
3353
|
+
key: 0,
|
|
3354
|
+
class: "rich-text-toolbar-extension",
|
|
3355
|
+
title: e.label,
|
|
3356
|
+
onMousedown: n[19] ||= le(() => {}, ["stop"])
|
|
3357
|
+
}, [(L(), v(H(e.component), j({ ref_for: !0 }, e.props, {
|
|
3358
|
+
context: T.value,
|
|
3359
|
+
disabled: O(e)
|
|
3360
|
+
}), null, 16, ["context", "disabled"]))], 40, uo)) : (L(), b("button", {
|
|
3361
|
+
key: 1,
|
|
3362
|
+
type: "button",
|
|
3363
|
+
title: e.label,
|
|
3364
|
+
disabled: O(e),
|
|
3365
|
+
onClick: (t) => k(e)
|
|
3366
|
+
}, [e.icon ? (L(), v(H(e.icon), {
|
|
3367
|
+
key: 0,
|
|
3368
|
+
size: 17
|
|
3369
|
+
})) : (L(), b("span", po, U(e.label), 1))], 8, fo))], 64))), 128))
|
|
3370
|
+
], 32), c.value ? J((L(), b("textarea", {
|
|
3317
3371
|
key: 0,
|
|
3318
|
-
"onUpdate:modelValue": n[
|
|
3372
|
+
"onUpdate:modelValue": n[21] ||= (e) => s.value = e,
|
|
3319
3373
|
class: "rich-text-source",
|
|
3320
3374
|
readonly: m.value,
|
|
3321
3375
|
style: F({ "--rich-text-max-height": e.maxHeight }),
|
|
3322
|
-
onBlur:
|
|
3323
|
-
}, null, 44,
|
|
3376
|
+
onBlur: te
|
|
3377
|
+
}, null, 44, mo)), [[se, s.value]]) : (L(), v(W(on), {
|
|
3324
3378
|
key: 1,
|
|
3325
|
-
editor:
|
|
3379
|
+
editor: W(p),
|
|
3326
3380
|
style: F({ "--rich-text-max-height": e.maxHeight })
|
|
3327
3381
|
}, null, 8, ["editor", "style"]))], 2)) : y("", !0);
|
|
3328
3382
|
}
|
|
3329
|
-
}),
|
|
3383
|
+
}), go = /* @__PURE__ */ e({ default: () => _o }), _o = /*#__PURE__*/ d(ho, [["__scopeId", "data-v-b8951950"]]), vo = [
|
|
3330
3384
|
{
|
|
3331
3385
|
code: "en",
|
|
3332
3386
|
label: "English"
|
|
@@ -3375,10 +3429,10 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3375
3429
|
code: "fr",
|
|
3376
3430
|
label: "French"
|
|
3377
3431
|
}
|
|
3378
|
-
],
|
|
3432
|
+
], yo = {
|
|
3379
3433
|
key: 0,
|
|
3380
3434
|
class: "translate-toolbar__inline"
|
|
3381
|
-
},
|
|
3435
|
+
}, bo = { class: "translate-toolbar__label" }, xo = { class: "translate-toolbar__controls" }, So = { class: "translate-toolbar__row" }, Co = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
3382
3436
|
__name: "translate-toolbar",
|
|
3383
3437
|
props: {
|
|
3384
3438
|
disabled: {
|
|
@@ -3410,20 +3464,20 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3410
3464
|
function a(e) {
|
|
3411
3465
|
(e === "translate" || e === "polish") && r("translate", e);
|
|
3412
3466
|
}
|
|
3413
|
-
return (t, n) => e.inline ? (L(), b("div",
|
|
3467
|
+
return (t, n) => e.inline ? (L(), b("div", yo, [x("span", bo, [w(W(kt), {
|
|
3414
3468
|
class: "translate-toolbar__label-icon",
|
|
3415
3469
|
size: 16,
|
|
3416
3470
|
color: "#8994BC",
|
|
3417
3471
|
"stroke-width": 2
|
|
3418
|
-
}), C(" " + W(
|
|
3419
|
-
w(
|
|
3472
|
+
}), C(" " + U(W(u)("product-management.attribute.translation.label")), 1)]), x("div", xo, [
|
|
3473
|
+
w(W(Ae), {
|
|
3420
3474
|
"model-value": e.sourceLanguage,
|
|
3421
3475
|
disabled: e.disabled || e.loading,
|
|
3422
|
-
placeholder:
|
|
3476
|
+
placeholder: W(u)("product-management.attribute.translation.from"),
|
|
3423
3477
|
class: "translate-toolbar__language-select",
|
|
3424
3478
|
"onUpdate:modelValue": n[0] ||= (e) => r("update:sourceLanguage", String(e))
|
|
3425
3479
|
}, {
|
|
3426
|
-
default:
|
|
3480
|
+
default: q(() => [(L(!0), b(g, null, z(e.languages, (e) => (L(), v(W($), {
|
|
3427
3481
|
key: e.code,
|
|
3428
3482
|
label: e.label,
|
|
3429
3483
|
value: e.code
|
|
@@ -3438,14 +3492,14 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3438
3492
|
class: "translate-toolbar__arrow",
|
|
3439
3493
|
"aria-hidden": "true"
|
|
3440
3494
|
}, "→", -1),
|
|
3441
|
-
w(
|
|
3495
|
+
w(W(Ae), {
|
|
3442
3496
|
"model-value": e.targetLanguage,
|
|
3443
3497
|
disabled: e.disabled || e.loading,
|
|
3444
|
-
placeholder:
|
|
3498
|
+
placeholder: W(u)("product-management.attribute.translation.to"),
|
|
3445
3499
|
class: "translate-toolbar__language-select",
|
|
3446
3500
|
"onUpdate:modelValue": n[1] ||= (e) => r("update:targetLanguage", String(e))
|
|
3447
3501
|
}, {
|
|
3448
|
-
default:
|
|
3502
|
+
default: q(() => [(L(!0), b(g, null, z(i.value, (e) => (L(), v(W($), {
|
|
3449
3503
|
key: e.code,
|
|
3450
3504
|
label: e.label,
|
|
3451
3505
|
value: e.code
|
|
@@ -3456,7 +3510,7 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3456
3510
|
"disabled",
|
|
3457
3511
|
"placeholder"
|
|
3458
3512
|
]),
|
|
3459
|
-
w(
|
|
3513
|
+
w(W(he), {
|
|
3460
3514
|
"split-button": "",
|
|
3461
3515
|
type: "primary",
|
|
3462
3516
|
class: "translate-toolbar__action",
|
|
@@ -3464,48 +3518,48 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3464
3518
|
onClick: n[2] ||= (e) => r("translate", "translate"),
|
|
3465
3519
|
onCommand: a
|
|
3466
3520
|
}, {
|
|
3467
|
-
dropdown:
|
|
3468
|
-
default:
|
|
3469
|
-
default:
|
|
3521
|
+
dropdown: q(() => [w(W(_e), null, {
|
|
3522
|
+
default: q(() => [w(W(ge), { command: "translate" }, {
|
|
3523
|
+
default: q(() => [C(U(W(u)("product-management.attribute.translation.translate")), 1)]),
|
|
3470
3524
|
_: 1
|
|
3471
|
-
}), w(
|
|
3472
|
-
default:
|
|
3525
|
+
}), w(W(ge), { command: "polish" }, {
|
|
3526
|
+
default: q(() => [C(U(W(u)("product-management.attribute.translation.polish")), 1)]),
|
|
3473
3527
|
_: 1
|
|
3474
3528
|
})]),
|
|
3475
3529
|
_: 1
|
|
3476
3530
|
})]),
|
|
3477
|
-
default:
|
|
3531
|
+
default: q(() => [C(U(W(u)("product-management.attribute.translation.translate")) + " ", 1)]),
|
|
3478
3532
|
_: 1
|
|
3479
3533
|
}, 8, ["disabled"])
|
|
3480
|
-
])])) : (L(), v(
|
|
3534
|
+
])])) : (L(), v(W(Te), {
|
|
3481
3535
|
key: 1,
|
|
3482
3536
|
width: 390,
|
|
3483
3537
|
placement: "bottom-end",
|
|
3484
3538
|
disabled: e.disabled,
|
|
3485
3539
|
trigger: "hover"
|
|
3486
3540
|
}, {
|
|
3487
|
-
reference:
|
|
3541
|
+
reference: q(() => [w(W(Y), {
|
|
3488
3542
|
text: "",
|
|
3489
|
-
icon:
|
|
3543
|
+
icon: W(qe),
|
|
3490
3544
|
disabled: e.disabled,
|
|
3491
3545
|
size: "large",
|
|
3492
|
-
title:
|
|
3493
|
-
"aria-label":
|
|
3546
|
+
title: W(u)("product-management.attribute.translation.label"),
|
|
3547
|
+
"aria-label": W(u)("product-management.attribute.translation.label")
|
|
3494
3548
|
}, null, 8, [
|
|
3495
3549
|
"icon",
|
|
3496
3550
|
"disabled",
|
|
3497
3551
|
"title",
|
|
3498
3552
|
"aria-label"
|
|
3499
3553
|
])]),
|
|
3500
|
-
default:
|
|
3501
|
-
w(
|
|
3554
|
+
default: q(() => [x("div", So, [
|
|
3555
|
+
w(W(Ae), {
|
|
3502
3556
|
"model-value": e.sourceLanguage,
|
|
3503
3557
|
disabled: e.disabled || e.loading,
|
|
3504
|
-
placeholder:
|
|
3558
|
+
placeholder: W(u)("product-management.attribute.translation.from"),
|
|
3505
3559
|
class: "translate-toolbar__language-select",
|
|
3506
3560
|
"onUpdate:modelValue": n[3] ||= (e) => r("update:sourceLanguage", String(e))
|
|
3507
3561
|
}, {
|
|
3508
|
-
default:
|
|
3562
|
+
default: q(() => [(L(!0), b(g, null, z(e.languages, (e) => (L(), v(W($), {
|
|
3509
3563
|
key: e.code,
|
|
3510
3564
|
label: e.label,
|
|
3511
3565
|
value: e.code
|
|
@@ -3520,14 +3574,14 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3520
3574
|
class: "translate-toolbar__arrow",
|
|
3521
3575
|
"aria-hidden": "true"
|
|
3522
3576
|
}, "→", -1),
|
|
3523
|
-
w(
|
|
3577
|
+
w(W(Ae), {
|
|
3524
3578
|
"model-value": e.targetLanguage,
|
|
3525
3579
|
disabled: e.disabled || e.loading,
|
|
3526
|
-
placeholder:
|
|
3580
|
+
placeholder: W(u)("product-management.attribute.translation.to"),
|
|
3527
3581
|
class: "translate-toolbar__language-select",
|
|
3528
3582
|
"onUpdate:modelValue": n[4] ||= (e) => r("update:targetLanguage", String(e))
|
|
3529
3583
|
}, {
|
|
3530
|
-
default:
|
|
3584
|
+
default: q(() => [(L(!0), b(g, null, z(i.value, (e) => (L(), v(W($), {
|
|
3531
3585
|
key: e.code,
|
|
3532
3586
|
label: e.label,
|
|
3533
3587
|
value: e.code
|
|
@@ -3538,7 +3592,7 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3538
3592
|
"disabled",
|
|
3539
3593
|
"placeholder"
|
|
3540
3594
|
]),
|
|
3541
|
-
w(
|
|
3595
|
+
w(W(he), {
|
|
3542
3596
|
"split-button": "",
|
|
3543
3597
|
type: "primary",
|
|
3544
3598
|
class: "translate-toolbar__action",
|
|
@@ -3546,27 +3600,27 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3546
3600
|
onClick: n[5] ||= (e) => r("translate", "translate"),
|
|
3547
3601
|
onCommand: a
|
|
3548
3602
|
}, {
|
|
3549
|
-
dropdown:
|
|
3550
|
-
default:
|
|
3551
|
-
default:
|
|
3603
|
+
dropdown: q(() => [w(W(_e), null, {
|
|
3604
|
+
default: q(() => [w(W(ge), { command: "translate" }, {
|
|
3605
|
+
default: q(() => [C(U(W(u)("product-management.attribute.translation.translate")), 1)]),
|
|
3552
3606
|
_: 1
|
|
3553
|
-
}), w(
|
|
3554
|
-
default:
|
|
3607
|
+
}), w(W(ge), { command: "polish" }, {
|
|
3608
|
+
default: q(() => [C(U(W(u)("product-management.attribute.translation.polish")), 1)]),
|
|
3555
3609
|
_: 1
|
|
3556
3610
|
})]),
|
|
3557
3611
|
_: 1
|
|
3558
3612
|
})]),
|
|
3559
|
-
default:
|
|
3613
|
+
default: q(() => [C(U(W(u)("product-management.attribute.translation.translate")) + " ", 1)]),
|
|
3560
3614
|
_: 1
|
|
3561
3615
|
}, 8, ["disabled"])
|
|
3562
3616
|
])]),
|
|
3563
3617
|
_: 1
|
|
3564
3618
|
}, 8, ["disabled"]));
|
|
3565
3619
|
}
|
|
3566
|
-
}), [["__scopeId", "data-v-df9539f3"]]),
|
|
3620
|
+
}), [["__scopeId", "data-v-df9539f3"]]), wo = ["element-loading-text"], To = {
|
|
3567
3621
|
key: 1,
|
|
3568
3622
|
class: "translate-field__grid"
|
|
3569
|
-
},
|
|
3623
|
+
}, Eo = ["for"], Do = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
3570
3624
|
__name: "translate-field",
|
|
3571
3625
|
props: {
|
|
3572
3626
|
config: { default: void 0 },
|
|
@@ -3587,12 +3641,12 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3587
3641
|
},
|
|
3588
3642
|
emits: ["update:modelValue"],
|
|
3589
3643
|
setup(e, { emit: t }) {
|
|
3590
|
-
let n = e, r = t, i = _(() => n.config?.language?.length ? n.config.language :
|
|
3644
|
+
let n = e, r = t, i = _(() => n.config?.language?.length ? n.config.language : vo), a = _(() => i.value.map(({ code: e }) => e)), o = _(() => n.config?.layout ?? ([
|
|
3591
3645
|
"rich-text",
|
|
3592
3646
|
"text",
|
|
3593
3647
|
"textarea"
|
|
3594
|
-
].includes(n.field.type) ? "tabs" : "grid")), s = _(() => i.value.find(({ code: e }) => e === l.value)?.label ?? ""), c = _(() => n.modelValue && typeof n.modelValue == "object" && !Array.isArray(n.modelValue) ? n.modelValue : typeof n.modelValue == "string" ? { [i.value[0]?.code ?? "en"]: n.modelValue } : {}), l =
|
|
3595
|
-
|
|
3648
|
+
].includes(n.field.type) ? "tabs" : "grid")), s = _(() => i.value.find(({ code: e }) => e === l.value)?.label ?? ""), c = _(() => n.modelValue && typeof n.modelValue == "object" && !Array.isArray(n.modelValue) ? n.modelValue : typeof n.modelValue == "string" ? { [i.value[0]?.code ?? "en"]: n.modelValue } : {}), l = R("en"), d = R("en"), f = R("all"), p = R(!1), m = _(() => n.disabled || n.readonly || p.value);
|
|
3649
|
+
K(a, (e) => {
|
|
3596
3650
|
e.includes(l.value) || (l.value = e.includes("en") ? "en" : e[0] ?? ""), e.includes(d.value) || (d.value = e.includes("en") ? "en" : e[0] ?? ""), f.value === "all" || e.includes(f.value) && f.value !== d.value || (f.value = "all");
|
|
3597
3651
|
}, { immediate: !0 });
|
|
3598
3652
|
function h(e, t) {
|
|
@@ -3605,7 +3659,16 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3605
3659
|
let t = c.value[e];
|
|
3606
3660
|
return typeof t == "string" || typeof t == "number" ? t : void 0;
|
|
3607
3661
|
}
|
|
3608
|
-
|
|
3662
|
+
function C(e) {
|
|
3663
|
+
return {
|
|
3664
|
+
field: n.field,
|
|
3665
|
+
formData: n.context.values,
|
|
3666
|
+
getFormData: () => n.context.values,
|
|
3667
|
+
language: e,
|
|
3668
|
+
mode: n.context.mode
|
|
3669
|
+
};
|
|
3670
|
+
}
|
|
3671
|
+
async function T(e = "translate") {
|
|
3609
3672
|
if (m.value || !d.value || !f.value) return;
|
|
3610
3673
|
let t = f.value === "all" ? a.value.filter((e) => e !== d.value) : [f.value], o = { ...c.value }, s = o[d.value], h = {
|
|
3611
3674
|
...n.context,
|
|
@@ -3641,30 +3704,31 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3641
3704
|
}
|
|
3642
3705
|
}
|
|
3643
3706
|
return (t, n) => {
|
|
3644
|
-
let r =
|
|
3645
|
-
return
|
|
3707
|
+
let r = V("loading");
|
|
3708
|
+
return J((L(), b("div", {
|
|
3646
3709
|
class: N(["translate-field", [`translate-field--label-${e.labelPosition}`, { "translate-field--plain-input": e.field.type === "text" || e.field.type === "textarea" }]]),
|
|
3647
|
-
"element-loading-text":
|
|
3648
|
-
}, [o.value === "tabs" ? (L(), b(g, { key: 0 }, [w(
|
|
3710
|
+
"element-loading-text": W(u)("product-management.attribute.translation.loading")
|
|
3711
|
+
}, [o.value === "tabs" ? (L(), b(g, { key: 0 }, [w(W(Le), {
|
|
3649
3712
|
modelValue: l.value,
|
|
3650
3713
|
"onUpdate:modelValue": n[0] ||= (e) => l.value = e,
|
|
3651
3714
|
class: "translate-field__tabs"
|
|
3652
3715
|
}, {
|
|
3653
|
-
default:
|
|
3716
|
+
default: q(() => [(L(!0), b(g, null, z(i.value, (e) => (L(), v(W(Ne), {
|
|
3654
3717
|
key: e.code,
|
|
3655
3718
|
label: e.label,
|
|
3656
3719
|
name: e.code
|
|
3657
3720
|
}, null, 8, ["label", "name"]))), 128))]),
|
|
3658
3721
|
_: 1
|
|
3659
|
-
}, 8, ["modelValue"]), e.field.type === "rich-text" ? (L(), v(
|
|
3722
|
+
}, 8, ["modelValue"]), e.field.type === "rich-text" ? (L(), v(_o, j({ key: 0 }, e.inputProps, {
|
|
3660
3723
|
id: `${e.field.prop}-${l.value}`,
|
|
3661
3724
|
"model-value": String(c.value[l.value] ?? ""),
|
|
3662
3725
|
placeholder: e.placeholder || s.value,
|
|
3663
3726
|
editable: !m.value && e.inputProps.editable !== !1,
|
|
3664
3727
|
"max-height": e.inputProps.maxHeight ?? "220px",
|
|
3728
|
+
"tool-context": C(l.value),
|
|
3665
3729
|
"onUpdate:modelValue": n[3] ||= (e) => h(l.value, e)
|
|
3666
3730
|
}), {
|
|
3667
|
-
"toolbar-append":
|
|
3731
|
+
"toolbar-append": q(() => [w(Co, {
|
|
3668
3732
|
languages: i.value,
|
|
3669
3733
|
"source-language": d.value,
|
|
3670
3734
|
"target-language": f.value,
|
|
@@ -3672,7 +3736,7 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3672
3736
|
loading: p.value,
|
|
3673
3737
|
"onUpdate:sourceLanguage": n[1] ||= (e) => d.value = e,
|
|
3674
3738
|
"onUpdate:targetLanguage": n[2] ||= (e) => f.value = e,
|
|
3675
|
-
onTranslate:
|
|
3739
|
+
onTranslate: T
|
|
3676
3740
|
}, null, 8, [
|
|
3677
3741
|
"languages",
|
|
3678
3742
|
"source-language",
|
|
@@ -3686,8 +3750,9 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3686
3750
|
"model-value",
|
|
3687
3751
|
"placeholder",
|
|
3688
3752
|
"editable",
|
|
3689
|
-
"max-height"
|
|
3690
|
-
|
|
3753
|
+
"max-height",
|
|
3754
|
+
"tool-context"
|
|
3755
|
+
])) : (L(), v(W(xe), j({ key: 1 }, e.inputProps, {
|
|
3691
3756
|
id: `${e.field.prop}-${l.value}`,
|
|
3692
3757
|
"model-value": S(l.value),
|
|
3693
3758
|
type: e.field.type === "textarea" ? "textarea" : "text",
|
|
@@ -3702,13 +3767,13 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3702
3767
|
"rows",
|
|
3703
3768
|
"placeholder",
|
|
3704
3769
|
"disabled"
|
|
3705
|
-
]))], 64)) : (L(), b("div",
|
|
3770
|
+
]))], 64)) : (L(), b("div", To, [(L(!0), b(g, null, z(i.value, (t) => (L(), b("div", {
|
|
3706
3771
|
key: t.code,
|
|
3707
3772
|
class: "translate-field__entry"
|
|
3708
3773
|
}, [x("label", {
|
|
3709
3774
|
class: "translate-field__label",
|
|
3710
3775
|
for: `${e.field.prop}-${t.code}`
|
|
3711
|
-
},
|
|
3776
|
+
}, U(t.label), 9, Eo), e.field.type === "rich-text" ? (L(), v(_o, j({
|
|
3712
3777
|
key: 0,
|
|
3713
3778
|
ref_for: !0
|
|
3714
3779
|
}, e.inputProps, {
|
|
@@ -3717,6 +3782,7 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3717
3782
|
placeholder: e.placeholder || t.label,
|
|
3718
3783
|
editable: !m.value && e.inputProps.editable !== !1,
|
|
3719
3784
|
"max-height": e.inputProps.maxHeight ?? "220px",
|
|
3785
|
+
"tool-context": C(t.code),
|
|
3720
3786
|
"onUpdate:modelValue": (e) => h(t.code, e)
|
|
3721
3787
|
}), null, 16, [
|
|
3722
3788
|
"id",
|
|
@@ -3724,8 +3790,9 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3724
3790
|
"placeholder",
|
|
3725
3791
|
"editable",
|
|
3726
3792
|
"max-height",
|
|
3793
|
+
"tool-context",
|
|
3727
3794
|
"onUpdate:modelValue"
|
|
3728
|
-
])) : (L(), v(
|
|
3795
|
+
])) : (L(), v(W(xe), j({
|
|
3729
3796
|
key: 1,
|
|
3730
3797
|
ref_for: !0
|
|
3731
3798
|
}, e.inputProps, {
|
|
@@ -3744,7 +3811,7 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3744
3811
|
"placeholder",
|
|
3745
3812
|
"disabled",
|
|
3746
3813
|
"onUpdate:modelValue"
|
|
3747
|
-
]))]))), 128))])), o.value !== "tabs" || e.field.type !== "rich-text" ? (L(), v(
|
|
3814
|
+
]))]))), 128))])), o.value !== "tabs" || e.field.type !== "rich-text" ? (L(), v(Co, {
|
|
3748
3815
|
key: 2,
|
|
3749
3816
|
inline: e.field.type === "text" || e.field.type === "textarea",
|
|
3750
3817
|
languages: i.value,
|
|
@@ -3755,7 +3822,7 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3755
3822
|
class: "translate-field__standalone-toolbar",
|
|
3756
3823
|
"onUpdate:sourceLanguage": n[5] ||= (e) => d.value = e,
|
|
3757
3824
|
"onUpdate:targetLanguage": n[6] ||= (e) => f.value = e,
|
|
3758
|
-
onTranslate:
|
|
3825
|
+
onTranslate: T
|
|
3759
3826
|
}, null, 8, [
|
|
3760
3827
|
"inline",
|
|
3761
3828
|
"languages",
|
|
@@ -3763,13 +3830,13 @@ var ga = ["title"], _a = ["title"], va = ["title"], ya = ["title"], ba = ["disab
|
|
|
3763
3830
|
"target-language",
|
|
3764
3831
|
"disabled",
|
|
3765
3832
|
"loading"
|
|
3766
|
-
])) : y("", !0)], 10,
|
|
3833
|
+
])) : y("", !0)], 10, wo)), [[r, p.value]]);
|
|
3767
3834
|
};
|
|
3768
3835
|
}
|
|
3769
|
-
}), [["__scopeId", "data-v-
|
|
3836
|
+
}), [["__scopeId", "data-v-51b67e99"]]);
|
|
3770
3837
|
// src/components/schema-form/use-field-options.ts
|
|
3771
|
-
function
|
|
3772
|
-
let { options: n } =
|
|
3838
|
+
function Oo(e, t) {
|
|
3839
|
+
let { options: n } = jr(() => {
|
|
3773
3840
|
let t = e();
|
|
3774
3841
|
return t.optionSource === "dict" ? t.dictCode : "";
|
|
3775
3842
|
});
|
|
@@ -3779,13 +3846,13 @@ function wo(e, t) {
|
|
|
3779
3846
|
});
|
|
3780
3847
|
}
|
|
3781
3848
|
// src/components/schema-form/schema-form-item.vue?vue&type=script&setup=true&lang.ts
|
|
3782
|
-
var
|
|
3849
|
+
var ko = {
|
|
3783
3850
|
key: 2,
|
|
3784
3851
|
class: "schema-form-item__dict-tag"
|
|
3785
|
-
},
|
|
3852
|
+
}, Ao = {
|
|
3786
3853
|
key: 22,
|
|
3787
3854
|
class: "schema-form-item__tip"
|
|
3788
|
-
},
|
|
3855
|
+
}, jo = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
3789
3856
|
__name: "schema-form-item",
|
|
3790
3857
|
props: {
|
|
3791
3858
|
disabled: { type: Boolean },
|
|
@@ -3798,13 +3865,13 @@ var To = {
|
|
|
3798
3865
|
},
|
|
3799
3866
|
emits: ["update:modelValue"],
|
|
3800
3867
|
setup(e, { emit: t }) {
|
|
3801
|
-
let r = e, i = t, a = T(() => Promise.resolve().then(() =>
|
|
3868
|
+
let r = e, i = t, a = T(() => Promise.resolve().then(() => qi)), o = T(() => import("./file-upload-g-PauJpk.js")), s = T(() => import("./picture-upload-vp1RCUJo.js")), c = T(() => Promise.resolve().then(() => go)), l = _(() => r.context ?? {
|
|
3802
3869
|
mode: "create",
|
|
3803
3870
|
values: {}
|
|
3804
|
-
}), u =
|
|
3871
|
+
}), u = Oo(() => r.field, l), d = _(() => ({
|
|
3805
3872
|
...l.value,
|
|
3806
|
-
updateValue:
|
|
3807
|
-
})), f = _(() => typeof r.field.props == "function" ? r.field.props(d.value) : r.field.props), p = _(() =>
|
|
3873
|
+
updateValue: V
|
|
3874
|
+
})), f = _(() => typeof r.field.props == "function" ? r.field.props(d.value) : r.field.props), p = _(() => ga(r.field, l.value)), m = _(() => ha(r.field)), h = _(() => r.field.copyable ?? !!r.field.readonly), x = _(() => !!r.field.translateConfig && [
|
|
3808
3875
|
"rich-text",
|
|
3809
3876
|
"text",
|
|
3810
3877
|
"textarea"
|
|
@@ -3818,8 +3885,8 @@ var To = {
|
|
|
3818
3885
|
}
|
|
3819
3886
|
let E = _(() => {
|
|
3820
3887
|
let { type: e } = r.field, t = r.modelValue;
|
|
3821
|
-
if (e === "datetime") return
|
|
3822
|
-
if (e === "date") return
|
|
3888
|
+
if (e === "datetime") return hn(t);
|
|
3889
|
+
if (e === "date") return mn(t);
|
|
3823
3890
|
if (e === "switch") {
|
|
3824
3891
|
let e = f.value?.activeValue ?? !0, n = f.value?.inactiveValue ?? !1;
|
|
3825
3892
|
if (S(t) === S(e)) return f.value?.activeText ?? "是";
|
|
@@ -3855,7 +3922,7 @@ var To = {
|
|
|
3855
3922
|
fileOriginName: t.fileOriginName ?? t.name ?? t.url ?? t.fileUrl
|
|
3856
3923
|
};
|
|
3857
3924
|
}).filter((e) => !!e);
|
|
3858
|
-
}), A = _(() => f.value?.maxPreviewCount ?? f.value?.maxCount ?? 3), M = _(() =>
|
|
3925
|
+
}), A = _(() => f.value?.maxPreviewCount ?? f.value?.maxCount ?? 3), M = _(() => ca(r.field.component)), P = _(() => {
|
|
3859
3926
|
let e = M.value;
|
|
3860
3927
|
return e ? {
|
|
3861
3928
|
...f.value,
|
|
@@ -3864,12 +3931,18 @@ var To = {
|
|
|
3864
3931
|
} : {};
|
|
3865
3932
|
}), F = _(() => {
|
|
3866
3933
|
let e = M.value;
|
|
3867
|
-
return e ? { [e.updateEvent ?? `update:${e.modelProp ?? "modelValue"}`]: (t) =>
|
|
3934
|
+
return e ? { [e.updateEvent ?? `update:${e.modelProp ?? "modelValue"}`]: (t) => V(e.valueExtractor?.(t) ?? t) } : {};
|
|
3868
3935
|
}), I = _(() => ({
|
|
3869
3936
|
...f.value,
|
|
3870
|
-
editable: !r.disabled && f.value?.editable !== !1
|
|
3871
|
-
|
|
3872
|
-
|
|
3937
|
+
editable: !r.disabled && !r.readonly && f.value?.editable !== !1,
|
|
3938
|
+
toolContext: {
|
|
3939
|
+
field: r.field,
|
|
3940
|
+
formData: l.value.values,
|
|
3941
|
+
getFormData: () => l.value.values,
|
|
3942
|
+
mode: l.value.mode
|
|
3943
|
+
}
|
|
3944
|
+
})), ee = _(() => r.field.apiOptions), R = _(() => ee.value ? $i(ee.value.entityKey) : void 0), te = _(() => {
|
|
3945
|
+
let e = R.value, t = ee.value;
|
|
3873
3946
|
return !e || !t ? null : {
|
|
3874
3947
|
columns: e.columns ?? [],
|
|
3875
3948
|
dialogTitle: e.dialogTitle,
|
|
@@ -3879,20 +3952,20 @@ var To = {
|
|
|
3879
3952
|
valueKey: t.valueKey ?? e.valueKey
|
|
3880
3953
|
};
|
|
3881
3954
|
});
|
|
3882
|
-
function
|
|
3955
|
+
function V(e) {
|
|
3883
3956
|
i("update:modelValue", e);
|
|
3884
3957
|
}
|
|
3885
|
-
function
|
|
3886
|
-
let t =
|
|
3958
|
+
function ne(e) {
|
|
3959
|
+
let t = R.value;
|
|
3887
3960
|
return t ? t.fetch({
|
|
3888
3961
|
...e,
|
|
3889
|
-
params:
|
|
3962
|
+
params: ee.value?.params
|
|
3890
3963
|
}) : Promise.resolve({
|
|
3891
3964
|
items: [],
|
|
3892
3965
|
total: 0
|
|
3893
3966
|
});
|
|
3894
3967
|
}
|
|
3895
|
-
function
|
|
3968
|
+
function ie(e) {
|
|
3896
3969
|
let t = u.value.map((e) => ({
|
|
3897
3970
|
label: e.label,
|
|
3898
3971
|
value: e.value,
|
|
@@ -3908,14 +3981,14 @@ var To = {
|
|
|
3908
3981
|
total: t.length
|
|
3909
3982
|
});
|
|
3910
3983
|
}
|
|
3911
|
-
return (t, r) => (L(), v(
|
|
3984
|
+
return (t, r) => (L(), v(W(ye), {
|
|
3912
3985
|
class: N(["schema-form-item", { "schema-form-item--bare": e.hideLabel }]),
|
|
3913
3986
|
label: e.hideLabel ? void 0 : e.field.label,
|
|
3914
3987
|
"label-width": e.hideLabel ? "0" : void 0,
|
|
3915
3988
|
prop: e.field.prop,
|
|
3916
3989
|
rules: p.value
|
|
3917
3990
|
}, {
|
|
3918
|
-
default:
|
|
3991
|
+
default: q(() => [x.value ? (L(), v(Do, {
|
|
3919
3992
|
key: 0,
|
|
3920
3993
|
config: e.field.translateConfig,
|
|
3921
3994
|
context: l.value,
|
|
@@ -3926,7 +3999,7 @@ var To = {
|
|
|
3926
3999
|
"model-value": e.modelValue,
|
|
3927
4000
|
placeholder: m.value,
|
|
3928
4001
|
readonly: e.readonly,
|
|
3929
|
-
"onUpdate:modelValue":
|
|
4002
|
+
"onUpdate:modelValue": V
|
|
3930
4003
|
}, null, 8, [
|
|
3931
4004
|
"config",
|
|
3932
4005
|
"context",
|
|
@@ -3937,12 +4010,11 @@ var To = {
|
|
|
3937
4010
|
"model-value",
|
|
3938
4011
|
"placeholder",
|
|
3939
4012
|
"readonly"
|
|
3940
|
-
])) : e.readonly && e.field.type === "rich-text" ? (L(), v(
|
|
4013
|
+
])) : e.readonly && e.field.type === "rich-text" ? (L(), v(W(c), j({
|
|
3941
4014
|
key: 1,
|
|
3942
4015
|
"model-value": e.modelValue,
|
|
3943
|
-
placeholder: m.value
|
|
3944
|
-
|
|
3945
|
-
}, f.value), null, 16, ["model-value", "placeholder"])) : e.readonly && e.field.optionSource === "dict" && e.field.dictCode ? (L(), b("span", To, [(L(!0), b(g, null, B(D.value, (t, n) => (L(), v(jr, {
|
|
4016
|
+
placeholder: m.value
|
|
4017
|
+
}, I.value), null, 16, ["model-value", "placeholder"])) : e.readonly && e.field.optionSource === "dict" && e.field.dictCode ? (L(), b("span", ko, [(L(!0), b(g, null, z(D.value, (t, n) => (L(), v(Mr, {
|
|
3946
4018
|
key: `${e.field.prop}-${n}`,
|
|
3947
4019
|
code: e.field.dictCode,
|
|
3948
4020
|
value: t
|
|
@@ -3950,159 +4022,159 @@ var To = {
|
|
|
3950
4022
|
key: 3,
|
|
3951
4023
|
urls: O.value,
|
|
3952
4024
|
"max-preview-count": A.value
|
|
3953
|
-
}, null, 8, ["urls", "max-preview-count"])) : e.readonly && (e.field.type === "file" || e.field.type === "upload") ? (L(), v(
|
|
4025
|
+
}, null, 8, ["urls", "max-preview-count"])) : e.readonly && (e.field.type === "file" || e.field.type === "upload") ? (L(), v(qr, {
|
|
3954
4026
|
key: 4,
|
|
3955
4027
|
attachments: k.value,
|
|
3956
4028
|
"max-preview-count": A.value
|
|
3957
|
-
}, null, 8, ["attachments", "max-preview-count"])) : e.readonly ? (L(), v(
|
|
4029
|
+
}, null, 8, ["attachments", "max-preview-count"])) : e.readonly ? (L(), v(ia, {
|
|
3958
4030
|
key: 5,
|
|
3959
4031
|
value: E.value,
|
|
3960
4032
|
copyable: h.value
|
|
3961
|
-
}, null, 8, ["value", "copyable"])) : M.value ? (L(), v(
|
|
4033
|
+
}, null, 8, ["value", "copyable"])) : M.value ? (L(), v(H(M.value.component), j({ key: 6 }, P.value, re(F.value)), null, 16)) : e.field.type === "upload" ? (L(), v(W(o), j({
|
|
3962
4034
|
key: 7,
|
|
3963
4035
|
"model-value": e.modelValue,
|
|
3964
4036
|
placeholder: e.field.placeholder,
|
|
3965
4037
|
disabled: e.disabled || e.readonly,
|
|
3966
4038
|
"show-remove": !e.readonly
|
|
3967
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4039
|
+
}, f.value, { "onUpdate:modelValue": V }), null, 16, [
|
|
3968
4040
|
"model-value",
|
|
3969
4041
|
"placeholder",
|
|
3970
4042
|
"disabled",
|
|
3971
4043
|
"show-remove"
|
|
3972
|
-
])) : e.field.type === "picture" ? (L(), v(
|
|
4044
|
+
])) : e.field.type === "picture" ? (L(), v(W(s), j({
|
|
3973
4045
|
key: 8,
|
|
3974
4046
|
"model-value": e.modelValue,
|
|
3975
4047
|
disabled: e.disabled || e.readonly,
|
|
3976
4048
|
"show-remove": !e.readonly
|
|
3977
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4049
|
+
}, f.value, { "onUpdate:modelValue": V }), null, 16, [
|
|
3978
4050
|
"model-value",
|
|
3979
4051
|
"disabled",
|
|
3980
4052
|
"show-remove"
|
|
3981
|
-
])) : e.field.type === "file" ? (L(), v(
|
|
4053
|
+
])) : e.field.type === "file" ? (L(), v(W(o), j({
|
|
3982
4054
|
key: 9,
|
|
3983
4055
|
"model-value": e.modelValue,
|
|
3984
4056
|
placeholder: e.field.placeholder,
|
|
3985
4057
|
disabled: e.disabled || e.readonly,
|
|
3986
4058
|
"show-remove": !e.readonly
|
|
3987
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4059
|
+
}, f.value, { "onUpdate:modelValue": V }), null, 16, [
|
|
3988
4060
|
"model-value",
|
|
3989
4061
|
"placeholder",
|
|
3990
4062
|
"disabled",
|
|
3991
4063
|
"show-remove"
|
|
3992
|
-
])) : e.field.type === "slot" ?
|
|
4064
|
+
])) : e.field.type === "slot" ? B(t.$slots, "default", {
|
|
3993
4065
|
field: e.field,
|
|
3994
4066
|
value: e.modelValue,
|
|
3995
4067
|
disabled: e.disabled,
|
|
3996
|
-
updateValue:
|
|
3997
|
-
}, void 0, !0, 10) : e.field.type === "text" ? (L(), v(
|
|
4068
|
+
updateValue: V
|
|
4069
|
+
}, void 0, !0, 10) : e.field.type === "text" ? (L(), v(W(xe), j({
|
|
3998
4070
|
key: 11,
|
|
3999
4071
|
"model-value": e.modelValue,
|
|
4000
4072
|
placeholder: m.value,
|
|
4001
4073
|
disabled: e.disabled,
|
|
4002
4074
|
clearable: ""
|
|
4003
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4075
|
+
}, f.value, { "onUpdate:modelValue": V }), null, 16, [
|
|
4004
4076
|
"model-value",
|
|
4005
4077
|
"placeholder",
|
|
4006
4078
|
"disabled"
|
|
4007
|
-
])) : e.field.type === "textarea" ? (L(), v(
|
|
4079
|
+
])) : e.field.type === "textarea" ? (L(), v(W(xe), j({
|
|
4008
4080
|
key: 12,
|
|
4009
4081
|
type: "textarea",
|
|
4010
4082
|
rows: 4,
|
|
4011
4083
|
"model-value": e.modelValue,
|
|
4012
4084
|
placeholder: m.value,
|
|
4013
4085
|
disabled: e.disabled
|
|
4014
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4086
|
+
}, f.value, { "onUpdate:modelValue": V }), null, 16, [
|
|
4015
4087
|
"model-value",
|
|
4016
4088
|
"placeholder",
|
|
4017
4089
|
"disabled"
|
|
4018
|
-
])) : e.field.type === "rich-text" ? (L(), v(
|
|
4090
|
+
])) : e.field.type === "rich-text" ? (L(), v(W(c), j({
|
|
4019
4091
|
key: 13,
|
|
4020
4092
|
"model-value": e.modelValue,
|
|
4021
4093
|
placeholder: m.value
|
|
4022
|
-
}, I.value, { "onUpdate:modelValue":
|
|
4094
|
+
}, I.value, { "onUpdate:modelValue": V }), null, 16, ["model-value", "placeholder"])) : e.field.type === "number" ? (L(), v(W(Se), j({
|
|
4023
4095
|
key: 14,
|
|
4024
4096
|
"model-value": e.modelValue,
|
|
4025
4097
|
placeholder: m.value,
|
|
4026
4098
|
disabled: e.disabled
|
|
4027
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4099
|
+
}, f.value, { "onUpdate:modelValue": V }), null, 16, [
|
|
4028
4100
|
"model-value",
|
|
4029
4101
|
"placeholder",
|
|
4030
4102
|
"disabled"
|
|
4031
|
-
])) : e.field.type === "select" ? (L(), v(
|
|
4103
|
+
])) : e.field.type === "select" ? (L(), v(W(a), j({
|
|
4032
4104
|
key: 15,
|
|
4033
4105
|
"model-value": e.modelValue,
|
|
4034
4106
|
placeholder: m.value,
|
|
4035
4107
|
disabled: e.disabled,
|
|
4036
|
-
fetcher:
|
|
4108
|
+
fetcher: ie,
|
|
4037
4109
|
"label-key": "label",
|
|
4038
4110
|
"value-key": "value"
|
|
4039
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4111
|
+
}, f.value, { "onUpdate:modelValue": V }), null, 16, [
|
|
4040
4112
|
"model-value",
|
|
4041
4113
|
"placeholder",
|
|
4042
4114
|
"disabled"
|
|
4043
|
-
])) : e.field.type === "radio" ? (L(), v(
|
|
4115
|
+
])) : e.field.type === "radio" ? (L(), v(W(Oe), j({
|
|
4044
4116
|
key: 16,
|
|
4045
4117
|
"model-value": e.modelValue,
|
|
4046
4118
|
disabled: e.disabled
|
|
4047
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4048
|
-
default:
|
|
4119
|
+
}, f.value, { "onUpdate:modelValue": V }), {
|
|
4120
|
+
default: q(() => [(L(!0), b(g, null, z(W(u), (e) => (L(), v(W(De), {
|
|
4049
4121
|
key: e.value,
|
|
4050
4122
|
value: e.value
|
|
4051
4123
|
}, {
|
|
4052
|
-
default:
|
|
4124
|
+
default: q(() => [C(U(e.label), 1)]),
|
|
4053
4125
|
_: 2
|
|
4054
4126
|
}, 1032, ["value"]))), 128))]),
|
|
4055
4127
|
_: 1
|
|
4056
|
-
}, 16, ["model-value", "disabled"])) : e.field.type === "checkbox" ? (L(), v(
|
|
4128
|
+
}, 16, ["model-value", "disabled"])) : e.field.type === "checkbox" ? (L(), v(W(fe), j({
|
|
4057
4129
|
key: 17,
|
|
4058
4130
|
"model-value": e.modelValue,
|
|
4059
4131
|
disabled: e.disabled
|
|
4060
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4061
|
-
default:
|
|
4132
|
+
}, f.value, { "onUpdate:modelValue": V }), {
|
|
4133
|
+
default: q(() => [(L(!0), b(g, null, z(W(u), (e) => (L(), v(W(de), {
|
|
4062
4134
|
key: e.value,
|
|
4063
4135
|
value: e.value
|
|
4064
4136
|
}, {
|
|
4065
|
-
default:
|
|
4137
|
+
default: q(() => [C(U(e.label), 1)]),
|
|
4066
4138
|
_: 2
|
|
4067
4139
|
}, 1032, ["value"]))), 128))]),
|
|
4068
4140
|
_: 1
|
|
4069
|
-
}, 16, ["model-value", "disabled"])) : e.field.type === "switch" ? (L(), v(
|
|
4141
|
+
}, 16, ["model-value", "disabled"])) : e.field.type === "switch" ? (L(), v(W(Me), j({
|
|
4070
4142
|
key: 18,
|
|
4071
4143
|
"model-value": e.modelValue,
|
|
4072
4144
|
disabled: e.disabled
|
|
4073
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4145
|
+
}, f.value, { "onUpdate:modelValue": V }), null, 16, ["model-value", "disabled"])) : e.field.type === "date" || e.field.type === "datetime" ? (L(), v(W(pe), j({
|
|
4074
4146
|
key: 19,
|
|
4075
4147
|
type: e.field.type,
|
|
4076
4148
|
"model-value": e.modelValue,
|
|
4077
4149
|
placeholder: m.value,
|
|
4078
4150
|
disabled: e.disabled,
|
|
4079
4151
|
"value-format": e.field.type === "date" ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss"
|
|
4080
|
-
}, f.value, { "onUpdate:modelValue":
|
|
4152
|
+
}, f.value, { "onUpdate:modelValue": V }), null, 16, [
|
|
4081
4153
|
"type",
|
|
4082
4154
|
"model-value",
|
|
4083
4155
|
"placeholder",
|
|
4084
4156
|
"disabled",
|
|
4085
4157
|
"value-format"
|
|
4086
|
-
])) : e.field.type === "async-select" && (
|
|
4158
|
+
])) : e.field.type === "async-select" && (te.value || e.field.optionSource === "dict") ? (L(), v(W(a), j({
|
|
4087
4159
|
key: 20,
|
|
4088
4160
|
"model-value": e.modelValue,
|
|
4089
4161
|
placeholder: m.value,
|
|
4090
4162
|
disabled: e.disabled,
|
|
4091
|
-
fetcher:
|
|
4092
|
-
options:
|
|
4163
|
+
fetcher: R.value ? ne : void 0,
|
|
4164
|
+
options: R.value ? void 0 : W(u)
|
|
4093
4165
|
}, {
|
|
4094
|
-
...
|
|
4166
|
+
...te.value,
|
|
4095
4167
|
...f.value
|
|
4096
|
-
}, { "onUpdate:modelValue":
|
|
4168
|
+
}, { "onUpdate:modelValue": V }), null, 16, [
|
|
4097
4169
|
"model-value",
|
|
4098
4170
|
"placeholder",
|
|
4099
4171
|
"disabled",
|
|
4100
4172
|
"fetcher",
|
|
4101
4173
|
"options"
|
|
4102
|
-
])) : (L(), v(
|
|
4174
|
+
])) : (L(), v(ia, {
|
|
4103
4175
|
key: 21,
|
|
4104
4176
|
value: e.modelValue
|
|
4105
|
-
}, null, 8, ["value"])), e.field.tip ? (L(), b("div",
|
|
4177
|
+
}, null, 8, ["value"])), e.field.tip ? (L(), b("div", Ao, U(e.field.tip), 1)) : y("", !0)]),
|
|
4106
4178
|
_: 3
|
|
4107
4179
|
}, 8, [
|
|
4108
4180
|
"class",
|
|
@@ -4112,20 +4184,20 @@ var To = {
|
|
|
4112
4184
|
"rules"
|
|
4113
4185
|
]));
|
|
4114
4186
|
}
|
|
4115
|
-
}), [["__scopeId", "data-v-
|
|
4187
|
+
}), [["__scopeId", "data-v-d305c47a"]]), Mo = { class: "schema-form-root" }, No = {
|
|
4116
4188
|
key: 0,
|
|
4117
4189
|
class: "schema-form__row-break",
|
|
4118
4190
|
"aria-hidden": "true"
|
|
4119
|
-
},
|
|
4191
|
+
}, Po = {
|
|
4120
4192
|
key: 0,
|
|
4121
4193
|
class: "schema-form-group__header"
|
|
4122
|
-
},
|
|
4194
|
+
}, Fo = { class: "schema-form-group__index" }, Io = { class: "schema-form-group__heading" }, Lo = { key: 0 }, Ro = {
|
|
4123
4195
|
key: 0,
|
|
4124
4196
|
class: "schema-form-group__required-note"
|
|
4125
|
-
},
|
|
4197
|
+
}, zo = { key: 1 }, Bo = {
|
|
4126
4198
|
key: 0,
|
|
4127
4199
|
class: "schema-form-group__tip"
|
|
4128
|
-
},
|
|
4200
|
+
}, Vo = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
4129
4201
|
__name: "schema-form",
|
|
4130
4202
|
props: /*@__PURE__*/ A({
|
|
4131
4203
|
columns: { default: 1 },
|
|
@@ -4155,14 +4227,14 @@ var To = {
|
|
|
4155
4227
|
}),
|
|
4156
4228
|
emits: ["update:modelValue"],
|
|
4157
4229
|
setup(e, { expose: t }) {
|
|
4158
|
-
let n = e, r =
|
|
4230
|
+
let n = e, r = G(e, "modelValue"), i = R(), a = _(() => n.schema), o = _(() => ({
|
|
4159
4231
|
mode: n.mode,
|
|
4160
4232
|
values: r.value ?? {}
|
|
4161
|
-
})), s = _(() => a.value.filter((e) =>
|
|
4233
|
+
})), s = _(() => a.value.filter((e) => ma(e, o.value) ? !1 : !da(e) || c(e).length > 0));
|
|
4162
4234
|
function c(e) {
|
|
4163
|
-
return e.children.filter((e) => !
|
|
4235
|
+
return e.children.filter((e) => !ma(e, o.value));
|
|
4164
4236
|
}
|
|
4165
|
-
let l = _(() => s.value.flatMap((e) =>
|
|
4237
|
+
let l = _(() => s.value.flatMap((e) => da(e) ? c(e) : [e])), u = _(() => Math.floor(24 / n.columns)), d = _(() => ({
|
|
4166
4238
|
[`schema-form--label-align-${n.labelAlign}`]: !!n.labelAlign,
|
|
4167
4239
|
"schema-form--underline": n.underline
|
|
4168
4240
|
})), f = _(() => n.mode === "view" ? "left" : n.labelPosition);
|
|
@@ -4175,20 +4247,20 @@ var To = {
|
|
|
4175
4247
|
"--schema-form-label-gap": p(n.labelGap)
|
|
4176
4248
|
}));
|
|
4177
4249
|
function h(e, t) {
|
|
4178
|
-
return
|
|
4250
|
+
return da(e) ? `group-${t}-${e.label}` : e.prop;
|
|
4179
4251
|
}
|
|
4180
4252
|
function S(e, t = !1) {
|
|
4181
4253
|
return t ? { gridColumn: e.newRow ? "1 / -1" : `span ${e.span ?? u.value}` } : { flex: `${e.span ?? 1} 1 0` };
|
|
4182
4254
|
}
|
|
4183
4255
|
function C(e) {
|
|
4184
|
-
return c(e).some((e) =>
|
|
4256
|
+
return c(e).some((e) => pa(e.required, o.value));
|
|
4185
4257
|
}
|
|
4186
4258
|
function T(e) {
|
|
4187
|
-
let t = s.value.filter((e) =>
|
|
4259
|
+
let t = s.value.filter((e) => da(e) && !!e.anchor);
|
|
4188
4260
|
return String(t.indexOf(e) + 1).padStart(2, "0");
|
|
4189
4261
|
}
|
|
4190
4262
|
function E(e, t) {
|
|
4191
|
-
return n.disabled ||
|
|
4263
|
+
return n.disabled || pa(t?.disabled, o.value) || pa(e.disabled, o.value);
|
|
4192
4264
|
}
|
|
4193
4265
|
function D(e) {
|
|
4194
4266
|
return n.mode === "view" || !!e.readonly;
|
|
@@ -4199,9 +4271,9 @@ var To = {
|
|
|
4199
4271
|
[e]: t
|
|
4200
4272
|
};
|
|
4201
4273
|
}
|
|
4202
|
-
|
|
4274
|
+
K([a, r], () => {
|
|
4203
4275
|
let e = r.value ?? {}, t = {};
|
|
4204
|
-
for (let n of
|
|
4276
|
+
for (let n of fa(a.value)) n.defaultValue !== void 0 && !(n.prop in e) && (t[n.prop] = n.defaultValue);
|
|
4205
4277
|
Object.keys(t).length > 0 && (r.value = {
|
|
4206
4278
|
...e,
|
|
4207
4279
|
...t
|
|
@@ -4221,8 +4293,8 @@ var To = {
|
|
|
4221
4293
|
resetFields: () => i.value?.resetFields(),
|
|
4222
4294
|
getValues: () => Object.fromEntries(l.value.map((e) => [e.prop, r.value?.[e.prop]]))
|
|
4223
4295
|
}), (t, n) => {
|
|
4224
|
-
let l =
|
|
4225
|
-
return L(), b("div",
|
|
4296
|
+
let l = V("loading");
|
|
4297
|
+
return L(), b("div", Mo, [J((L(), v(W(ve), {
|
|
4226
4298
|
ref_key: "formRef",
|
|
4227
4299
|
ref: i,
|
|
4228
4300
|
class: N(["schema-form", d.value]),
|
|
@@ -4231,26 +4303,26 @@ var To = {
|
|
|
4231
4303
|
"label-width": e.labelWidth,
|
|
4232
4304
|
"label-position": f.value
|
|
4233
4305
|
}, {
|
|
4234
|
-
default:
|
|
4235
|
-
default:
|
|
4306
|
+
default: q(() => [w(W(ke), { gutter: 16 }, {
|
|
4307
|
+
default: q(() => [(L(!0), b(g, null, z(s.value, (e, n) => (L(), b(g, { key: h(e, n) }, [e.newRow ? (L(), b("div", No)) : y("", !0), w(W(X), {
|
|
4236
4308
|
span: e.span ?? (e.type === "group" ? 24 : u.value),
|
|
4237
4309
|
class: N({
|
|
4238
4310
|
"schema-form-col--anchor-group": e.type === "group" && e.anchor,
|
|
4239
4311
|
"schema-form-col--group-divider": e.type === "group" && n > 0
|
|
4240
4312
|
})
|
|
4241
4313
|
}, {
|
|
4242
|
-
default:
|
|
4314
|
+
default: q(() => [e.type === "group" ? (L(), v(W(ye), {
|
|
4243
4315
|
key: 0,
|
|
4244
4316
|
class: N(["schema-form-group", { "schema-form-group--anchor": e.anchor }]),
|
|
4245
4317
|
"data-form-anchor": e.anchor ? a.value.indexOf(e) : void 0,
|
|
4246
4318
|
label: e.label
|
|
4247
4319
|
}, {
|
|
4248
|
-
label:
|
|
4249
|
-
x("span",
|
|
4250
|
-
x("span",
|
|
4251
|
-
C(e) ? (L(), b("span",
|
|
4252
|
-
])) : (L(), b("span",
|
|
4253
|
-
default:
|
|
4320
|
+
label: q(() => [e.anchor ? (L(), b("div", Po, [
|
|
4321
|
+
x("span", Fo, U(T(e)), 1),
|
|
4322
|
+
x("span", Io, [x("strong", null, U(e.label), 1), e.description ? (L(), b("small", Lo, U(e.description), 1)) : y("", !0)]),
|
|
4323
|
+
C(e) ? (L(), b("span", Ro, " 为必填项 ")) : y("", !0)
|
|
4324
|
+
])) : (L(), b("span", zo, U(e.label), 1))]),
|
|
4325
|
+
default: q(() => [x("div", { class: N(["schema-form-group__body", { "schema-form-group__body--grid": e.anchor }]) }, [(L(!0), b(g, null, z(c(e), (n) => (L(), v(jo, {
|
|
4254
4326
|
key: n.prop,
|
|
4255
4327
|
style: F(S(n, e.anchor)),
|
|
4256
4328
|
"hide-label": !e.anchor,
|
|
@@ -4262,7 +4334,7 @@ var To = {
|
|
|
4262
4334
|
readonly: D(n),
|
|
4263
4335
|
"onUpdate:modelValue": (e) => O(n.prop, e)
|
|
4264
4336
|
}, {
|
|
4265
|
-
default:
|
|
4337
|
+
default: q((e) => [B(t.$slots, n.prop, j({ ref_for: !0 }, e), void 0, !0)]),
|
|
4266
4338
|
_: 2
|
|
4267
4339
|
}, 1032, [
|
|
4268
4340
|
"style",
|
|
@@ -4274,13 +4346,13 @@ var To = {
|
|
|
4274
4346
|
"disabled",
|
|
4275
4347
|
"readonly",
|
|
4276
4348
|
"onUpdate:modelValue"
|
|
4277
|
-
]))), 128))], 2), e.tip ? (L(), b("div",
|
|
4349
|
+
]))), 128))], 2), e.tip ? (L(), b("div", Bo, U(e.tip), 1)) : y("", !0)]),
|
|
4278
4350
|
_: 2
|
|
4279
4351
|
}, 1032, [
|
|
4280
4352
|
"class",
|
|
4281
4353
|
"data-form-anchor",
|
|
4282
4354
|
"label"
|
|
4283
|
-
])) : (L(), v(
|
|
4355
|
+
])) : (L(), v(jo, {
|
|
4284
4356
|
key: 1,
|
|
4285
4357
|
field: e,
|
|
4286
4358
|
context: o.value,
|
|
@@ -4290,7 +4362,7 @@ var To = {
|
|
|
4290
4362
|
readonly: D(e),
|
|
4291
4363
|
"onUpdate:modelValue": (t) => O(e.prop, t)
|
|
4292
4364
|
}, {
|
|
4293
|
-
default:
|
|
4365
|
+
default: q((n) => [B(t.$slots, e.prop, j({ ref_for: !0 }, n), void 0, !0)]),
|
|
4294
4366
|
_: 2
|
|
4295
4367
|
}, 1032, [
|
|
4296
4368
|
"field",
|
|
@@ -4315,11 +4387,11 @@ var To = {
|
|
|
4315
4387
|
])), [[l, e.loading]])]);
|
|
4316
4388
|
};
|
|
4317
4389
|
}
|
|
4318
|
-
}), [["__scopeId", "data-v-38d44833"]]),
|
|
4390
|
+
}), [["__scopeId", "data-v-38d44833"]]), Ho = { class: "drawer-form-page__header" }, Uo = { class: "drawer-form-page__header-main" }, Wo = { class: "drawer-form-page__title-stack" }, Go = { class: "drawer-form-page__title" }, Ko = { class: "drawer-form-page__header-actions" }, qo = { class: "drawer-form-page__status" }, Jo = {
|
|
4319
4391
|
key: 0,
|
|
4320
4392
|
class: "drawer-form-page__anchors",
|
|
4321
4393
|
"aria-label": "表单分区"
|
|
4322
|
-
},
|
|
4394
|
+
}, Yo = ["onClick"], Xo = { class: "drawer-form-page__footer" }, Zo = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
4323
4395
|
__name: "index",
|
|
4324
4396
|
props: {
|
|
4325
4397
|
modelValue: {
|
|
@@ -4403,7 +4475,7 @@ var To = {
|
|
|
4403
4475
|
"closed"
|
|
4404
4476
|
],
|
|
4405
4477
|
setup(e, { expose: t, emit: n }) {
|
|
4406
|
-
let r = e, i = n, a =
|
|
4478
|
+
let r = e, i = n, a = R(0), o = ae(), s = R(), c = R(), l = R(r.fullscreen), u = _({
|
|
4407
4479
|
get: () => r.modelValue,
|
|
4408
4480
|
set: (e) => i("update:modelValue", e)
|
|
4409
4481
|
}), d = _({
|
|
@@ -4421,7 +4493,7 @@ var To = {
|
|
|
4421
4493
|
entry: e,
|
|
4422
4494
|
index: t
|
|
4423
4495
|
})).filter(({ entry: e }) => e.type === "group" && e.anchor));
|
|
4424
|
-
|
|
4496
|
+
K(() => r.fullscreen, (e) => {
|
|
4425
4497
|
l.value = e;
|
|
4426
4498
|
});
|
|
4427
4499
|
function k() {
|
|
@@ -4439,25 +4511,25 @@ var To = {
|
|
|
4439
4511
|
function I() {
|
|
4440
4512
|
F(), i("cancel");
|
|
4441
4513
|
}
|
|
4442
|
-
async function
|
|
4514
|
+
async function ee() {
|
|
4443
4515
|
return await s.value?.validate() ?? !1;
|
|
4444
4516
|
}
|
|
4445
|
-
function
|
|
4517
|
+
function te() {
|
|
4446
4518
|
return s.value?.getValues() ?? {};
|
|
4447
4519
|
}
|
|
4448
|
-
async function
|
|
4449
|
-
return r.mode === "view" || r.submitting || r.loading || !await
|
|
4520
|
+
async function H() {
|
|
4521
|
+
return r.mode === "view" || r.submitting || r.loading || !await ee() ? !1 : (i("submit", te()), !0);
|
|
4450
4522
|
}
|
|
4451
|
-
function
|
|
4523
|
+
function ne() {
|
|
4452
4524
|
s.value?.resetFields();
|
|
4453
4525
|
}
|
|
4454
|
-
function
|
|
4526
|
+
function re() {
|
|
4455
4527
|
i("closed");
|
|
4456
4528
|
}
|
|
4457
|
-
function
|
|
4529
|
+
function ie() {
|
|
4458
4530
|
a.value = O.value[0]?.index ?? 0, i("open");
|
|
4459
4531
|
}
|
|
4460
|
-
function
|
|
4532
|
+
function G() {
|
|
4461
4533
|
let e = c.value;
|
|
4462
4534
|
if (!e) return;
|
|
4463
4535
|
let t = e.getBoundingClientRect().top, n = O.value[0]?.index ?? 0;
|
|
@@ -4469,14 +4541,14 @@ var To = {
|
|
|
4469
4541
|
}
|
|
4470
4542
|
return t({
|
|
4471
4543
|
close: F,
|
|
4472
|
-
getValues:
|
|
4473
|
-
resetFields:
|
|
4474
|
-
submit:
|
|
4544
|
+
getValues: te,
|
|
4545
|
+
resetFields: ne,
|
|
4546
|
+
submit: H,
|
|
4475
4547
|
toggleFullscreen: k,
|
|
4476
|
-
validate:
|
|
4548
|
+
validate: ee
|
|
4477
4549
|
}), (e, t) => {
|
|
4478
|
-
let n =
|
|
4479
|
-
return L(), v(
|
|
4550
|
+
let n = V("loading");
|
|
4551
|
+
return L(), v(W(me), j({
|
|
4480
4552
|
modelValue: u.value,
|
|
4481
4553
|
"onUpdate:modelValue": t[1] ||= (e) => u.value = e
|
|
4482
4554
|
}, r.drawerProps, {
|
|
@@ -4489,59 +4561,59 @@ var To = {
|
|
|
4489
4561
|
"append-to-body": r.appendToBody,
|
|
4490
4562
|
"lock-scroll": r.lockScroll,
|
|
4491
4563
|
class: ["drawer-form-page", { "drawer-form-page--fullscreen": f.value }],
|
|
4492
|
-
onOpen:
|
|
4493
|
-
onClosed:
|
|
4564
|
+
onOpen: ie,
|
|
4565
|
+
onClosed: re
|
|
4494
4566
|
}), S({
|
|
4495
|
-
header:
|
|
4567
|
+
header: q(() => [B(e.$slots, "header", {
|
|
4496
4568
|
fullscreen: f.value,
|
|
4497
4569
|
title: r.title,
|
|
4498
4570
|
toggleFullscreen: k
|
|
4499
|
-
}, () => [x("div",
|
|
4500
|
-
x("div",
|
|
4501
|
-
x("div",
|
|
4502
|
-
x("span",
|
|
4503
|
-
r.fullscreenButton ? (L(), v(
|
|
4571
|
+
}, () => [x("div", Ho, [
|
|
4572
|
+
x("div", Uo, [x("div", Wo, [x("span", Go, U(r.title), 1)])]),
|
|
4573
|
+
x("div", Ko, [
|
|
4574
|
+
x("span", qo, [t[2] ||= x("i", { "aria-hidden": "true" }, null, -1), C(" " + U(T.value), 1)]),
|
|
4575
|
+
r.fullscreenButton ? (L(), v(W(Re), {
|
|
4504
4576
|
key: 0,
|
|
4505
4577
|
content: f.value ? "退出全屏" : "全屏",
|
|
4506
4578
|
placement: "bottom"
|
|
4507
4579
|
}, {
|
|
4508
|
-
default:
|
|
4580
|
+
default: q(() => [w(W(Y), {
|
|
4509
4581
|
link: "",
|
|
4510
|
-
icon: f.value ?
|
|
4582
|
+
icon: f.value ? W(ot) : W($e),
|
|
4511
4583
|
"aria-label": f.value ? "退出全屏" : "全屏",
|
|
4512
4584
|
onClick: k
|
|
4513
4585
|
}, null, 8, ["icon", "aria-label"])]),
|
|
4514
4586
|
_: 1
|
|
4515
4587
|
}, 8, ["content"])) : y("", !0),
|
|
4516
|
-
w(
|
|
4588
|
+
w(W(Re), {
|
|
4517
4589
|
content: "关闭",
|
|
4518
4590
|
placement: "bottom"
|
|
4519
4591
|
}, {
|
|
4520
|
-
default:
|
|
4592
|
+
default: q(() => [w(W(Y), {
|
|
4521
4593
|
link: "",
|
|
4522
4594
|
class: "drawer-form-page__close",
|
|
4523
|
-
icon:
|
|
4595
|
+
icon: W(Ye),
|
|
4524
4596
|
"aria-label": "关闭",
|
|
4525
4597
|
onClick: F
|
|
4526
4598
|
}, null, 8, ["icon"])]),
|
|
4527
4599
|
_: 1
|
|
4528
4600
|
})
|
|
4529
4601
|
]),
|
|
4530
|
-
O.value.length ? (L(), b("nav",
|
|
4602
|
+
O.value.length ? (L(), b("nav", Jo, [(L(!0), b(g, null, z(O.value, ({ entry: e, index: t }) => (L(), b("button", {
|
|
4531
4603
|
key: t,
|
|
4532
4604
|
type: "button",
|
|
4533
4605
|
class: N(["drawer-form-page__anchor", { "is-active": a.value === t }]),
|
|
4534
4606
|
onClick: (e) => {
|
|
4535
4607
|
a.value = t, A(t);
|
|
4536
4608
|
}
|
|
4537
|
-
},
|
|
4609
|
+
}, U(e.label), 11, Yo))), 128))])) : y("", !0)
|
|
4538
4610
|
])], !0)]),
|
|
4539
|
-
default:
|
|
4611
|
+
default: q(() => [J((L(), b("div", {
|
|
4540
4612
|
ref_key: "contentRef",
|
|
4541
4613
|
ref: c,
|
|
4542
4614
|
class: "drawer-form-page__content",
|
|
4543
|
-
onScrollPassive:
|
|
4544
|
-
}, [w(
|
|
4615
|
+
onScrollPassive: G
|
|
4616
|
+
}, [w(Vo, j({
|
|
4545
4617
|
ref_key: "formRef",
|
|
4546
4618
|
ref: s
|
|
4547
4619
|
}, r.schemaFormProps, {
|
|
@@ -4552,9 +4624,9 @@ var To = {
|
|
|
4552
4624
|
columns: m.value,
|
|
4553
4625
|
disabled: r.disabled,
|
|
4554
4626
|
loading: r.loading
|
|
4555
|
-
}), S({ _: 2 }, [
|
|
4627
|
+
}), S({ _: 2 }, [z(E.value, (t) => ({
|
|
4556
4628
|
name: t,
|
|
4557
|
-
fn:
|
|
4629
|
+
fn: q((n) => [B(e.$slots, t, P(D(n)), void 0, !0)])
|
|
4558
4630
|
}))]), 1040, [
|
|
4559
4631
|
"modelValue",
|
|
4560
4632
|
"schema",
|
|
@@ -4562,29 +4634,29 @@ var To = {
|
|
|
4562
4634
|
"columns",
|
|
4563
4635
|
"disabled",
|
|
4564
4636
|
"loading"
|
|
4565
|
-
]),
|
|
4637
|
+
]), B(e.$slots, "default", {}, void 0, !0)], 32)), [[n, r.loading]])]),
|
|
4566
4638
|
_: 2
|
|
4567
4639
|
}, [r.showFooter ? {
|
|
4568
4640
|
name: "footer",
|
|
4569
|
-
fn:
|
|
4641
|
+
fn: q(() => [B(e.$slots, "footer", {
|
|
4570
4642
|
cancel: I,
|
|
4571
|
-
submit:
|
|
4643
|
+
submit: H,
|
|
4572
4644
|
submitting: r.submitting
|
|
4573
|
-
}, () => [x("div",
|
|
4645
|
+
}, () => [x("div", Xo, [r.showCancelButton ? (L(), v(W(Y), {
|
|
4574
4646
|
key: 0,
|
|
4575
4647
|
disabled: r.submitting,
|
|
4576
4648
|
onClick: I
|
|
4577
4649
|
}, {
|
|
4578
|
-
default:
|
|
4650
|
+
default: q(() => [C(U(r.cancelText), 1)]),
|
|
4579
4651
|
_: 1
|
|
4580
|
-
}, 8, ["disabled"])) : y("", !0), h.value ? (L(), v(
|
|
4652
|
+
}, 8, ["disabled"])) : y("", !0), h.value ? (L(), v(W(Y), {
|
|
4581
4653
|
key: 1,
|
|
4582
4654
|
type: "primary",
|
|
4583
4655
|
disabled: r.loading,
|
|
4584
4656
|
loading: r.submitting,
|
|
4585
|
-
onClick:
|
|
4657
|
+
onClick: H
|
|
4586
4658
|
}, {
|
|
4587
|
-
default:
|
|
4659
|
+
default: q(() => [C(U(r.submitText), 1)]),
|
|
4588
4660
|
_: 1
|
|
4589
4661
|
}, 8, ["disabled", "loading"])) : y("", !0)])], !0)]),
|
|
4590
4662
|
key: "0"
|
|
@@ -4603,11 +4675,11 @@ var To = {
|
|
|
4603
4675
|
}
|
|
4604
4676
|
}), [["__scopeId", "data-v-e07a25ed"]]);
|
|
4605
4677
|
// src/components/drawer-form-page/use-drawer-form-page.ts
|
|
4606
|
-
function
|
|
4607
|
-
let { closeOnSubmit: t = !0, initialValues: n, onCancel: r, onOpenChange: i, onSubmit: a, values: o, ...s } = e, c =
|
|
4678
|
+
function Qo(e = {}) {
|
|
4679
|
+
let { closeOnSubmit: t = !0, initialValues: n, onCancel: r, onOpenChange: i, onSubmit: a, values: o, ...s } = e, c = R(!1), l = R($o(o ?? n ?? {})), u = ee({ ...s }), d = R(), f;
|
|
4608
4680
|
function p(e = {}) {
|
|
4609
4681
|
let { values: t, ...r } = e;
|
|
4610
|
-
Object.assign(u, r), l.value =
|
|
4682
|
+
Object.assign(u, r), l.value = $o(t ?? n ?? {}), c.value = !0;
|
|
4611
4683
|
}
|
|
4612
4684
|
function m() {
|
|
4613
4685
|
c.value = !1;
|
|
@@ -4635,7 +4707,7 @@ function Jo(e = {}) {
|
|
|
4635
4707
|
}
|
|
4636
4708
|
function x(e) {
|
|
4637
4709
|
let { values: t, ...n } = e;
|
|
4638
|
-
Object.assign(u, n), t !== void 0 && (l.value =
|
|
4710
|
+
Object.assign(u, n), t !== void 0 && (l.value = $o(t));
|
|
4639
4711
|
}
|
|
4640
4712
|
return f = {
|
|
4641
4713
|
close: m,
|
|
@@ -4647,13 +4719,13 @@ function Jo(e = {}) {
|
|
|
4647
4719
|
submit: b,
|
|
4648
4720
|
toggleFullscreen: h,
|
|
4649
4721
|
validate: v
|
|
4650
|
-
},
|
|
4722
|
+
}, K(c, (e) => {
|
|
4651
4723
|
i?.(e);
|
|
4652
4724
|
}), [E({
|
|
4653
4725
|
name: "DrawerFormPageProvider",
|
|
4654
4726
|
inheritAttrs: !1,
|
|
4655
4727
|
setup(e, { attrs: n, slots: i }) {
|
|
4656
|
-
return () => O(
|
|
4728
|
+
return () => O(Zo, {
|
|
4657
4729
|
...n,
|
|
4658
4730
|
...u,
|
|
4659
4731
|
ref: d,
|
|
@@ -4678,14 +4750,14 @@ function Jo(e = {}) {
|
|
|
4678
4750
|
}
|
|
4679
4751
|
}), f];
|
|
4680
4752
|
}
|
|
4681
|
-
function
|
|
4753
|
+
function $o(e) {
|
|
4682
4754
|
return { ...e };
|
|
4683
4755
|
}
|
|
4684
4756
|
// src/components/search-form/index.vue?vue&type=script&setup=true&lang.ts
|
|
4685
|
-
var
|
|
4757
|
+
var es = {
|
|
4686
4758
|
key: 0,
|
|
4687
4759
|
class: "search-form__actions"
|
|
4688
|
-
},
|
|
4760
|
+
}, ts = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
4689
4761
|
__name: "index",
|
|
4690
4762
|
props: /*@__PURE__*/ A({
|
|
4691
4763
|
collapsedRows: { default: 2 },
|
|
@@ -4709,15 +4781,15 @@ var Xo = {
|
|
|
4709
4781
|
}),
|
|
4710
4782
|
emits: /*@__PURE__*/ A(["reset", "search"], ["update:modelValue"]),
|
|
4711
4783
|
setup(e, { expose: t, emit: n }) {
|
|
4712
|
-
let r = e, i = n, a =
|
|
4784
|
+
let r = e, i = n, a = G(e, "modelValue"), o = ae(), s = R(!1), c = R(), l = _(() => r.schema), u = _(() => ({
|
|
4713
4785
|
mode: r.mode,
|
|
4714
4786
|
values: a.value ?? {}
|
|
4715
|
-
})), d = _(() => l.value.filter((e) =>
|
|
4787
|
+
})), d = _(() => l.value.filter((e) => ma(e, u.value) ? !1 : !da(e) || g(e).length > 0)), f = _(() => Math.max(r.columns * r.collapsedRows, r.columns)), p = _(() => r.showActions && d.value.length > f.value), m = _(() => !p.value || s.value ? d.value : d.value.slice(0, f.value)), h = _(() => Object.keys(o));
|
|
4716
4788
|
function g(e) {
|
|
4717
|
-
return e.children.filter((e) => !
|
|
4789
|
+
return e.children.filter((e) => !ma(e, u.value));
|
|
4718
4790
|
}
|
|
4719
4791
|
function x() {
|
|
4720
|
-
return
|
|
4792
|
+
return fa(l.value);
|
|
4721
4793
|
}
|
|
4722
4794
|
function T() {
|
|
4723
4795
|
return Object.fromEntries(x().map((e) => [e.prop, e.defaultValue]));
|
|
@@ -4734,7 +4806,7 @@ var Xo = {
|
|
|
4734
4806
|
async function A() {
|
|
4735
4807
|
return await c.value?.validate() ?? !1;
|
|
4736
4808
|
}
|
|
4737
|
-
return
|
|
4809
|
+
return K(p, (e) => {
|
|
4738
4810
|
e || (s.value = !1);
|
|
4739
4811
|
}), t({
|
|
4740
4812
|
getValues: E,
|
|
@@ -4743,8 +4815,8 @@ var Xo = {
|
|
|
4743
4815
|
search: O
|
|
4744
4816
|
}), (t, n) => (L(), b("form", {
|
|
4745
4817
|
class: "search-form",
|
|
4746
|
-
onSubmit:
|
|
4747
|
-
}, [w(
|
|
4818
|
+
onSubmit: le(O, ["prevent"])
|
|
4819
|
+
}, [w(Vo, {
|
|
4748
4820
|
ref_key: "schemaFormRef",
|
|
4749
4821
|
ref: c,
|
|
4750
4822
|
modelValue: a.value,
|
|
@@ -4758,9 +4830,9 @@ var Xo = {
|
|
|
4758
4830
|
"label-position": "left",
|
|
4759
4831
|
"label-width": e.labelWidth,
|
|
4760
4832
|
"item-gap": 12
|
|
4761
|
-
}, S({ _: 2 }, [
|
|
4833
|
+
}, S({ _: 2 }, [z(h.value, (e) => ({
|
|
4762
4834
|
name: e,
|
|
4763
|
-
fn:
|
|
4835
|
+
fn: q((n) => [B(t.$slots, e, P(D(n)), void 0, !0)])
|
|
4764
4836
|
}))]), 1032, [
|
|
4765
4837
|
"modelValue",
|
|
4766
4838
|
"columns",
|
|
@@ -4768,35 +4840,35 @@ var Xo = {
|
|
|
4768
4840
|
"schema",
|
|
4769
4841
|
"mode",
|
|
4770
4842
|
"label-width"
|
|
4771
|
-
]), e.showActions ? (L(), b("div",
|
|
4772
|
-
w(
|
|
4843
|
+
]), e.showActions ? (L(), b("div", es, [
|
|
4844
|
+
w(W(Y), {
|
|
4773
4845
|
type: "primary",
|
|
4774
4846
|
"native-type": "submit"
|
|
4775
4847
|
}, {
|
|
4776
|
-
default:
|
|
4848
|
+
default: q(() => [...n[2] ||= [C("搜索", -1)]]),
|
|
4777
4849
|
_: 1
|
|
4778
4850
|
}),
|
|
4779
|
-
w(
|
|
4851
|
+
w(W(Y), {
|
|
4780
4852
|
"native-type": "button",
|
|
4781
4853
|
onClick: k
|
|
4782
4854
|
}, {
|
|
4783
|
-
default:
|
|
4855
|
+
default: q(() => [...n[3] ||= [C("重置", -1)]]),
|
|
4784
4856
|
_: 1
|
|
4785
4857
|
}),
|
|
4786
|
-
p.value ? (L(), v(
|
|
4858
|
+
p.value ? (L(), v(W(Y), {
|
|
4787
4859
|
key: 0,
|
|
4788
4860
|
link: "",
|
|
4789
4861
|
type: "primary",
|
|
4790
4862
|
"native-type": "button",
|
|
4791
|
-
icon: s.value ?
|
|
4863
|
+
icon: s.value ? W(Ke) : W(We),
|
|
4792
4864
|
onClick: n[1] ||= (e) => s.value = !s.value
|
|
4793
4865
|
}, {
|
|
4794
|
-
default:
|
|
4866
|
+
default: q(() => [C(U(s.value ? "收起" : "展开"), 1)]),
|
|
4795
4867
|
_: 1
|
|
4796
4868
|
}, 8, ["icon"])) : y("", !0)
|
|
4797
4869
|
])) : y("", !0)], 32));
|
|
4798
4870
|
}
|
|
4799
|
-
}), [["__scopeId", "data-v-3392f119"]]),
|
|
4871
|
+
}), [["__scopeId", "data-v-3392f119"]]), ns = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
4800
4872
|
__name: "index",
|
|
4801
4873
|
props: {
|
|
4802
4874
|
fields: { default: () => [] },
|
|
@@ -4862,9 +4934,9 @@ var Xo = {
|
|
|
4862
4934
|
"toolbarAction"
|
|
4863
4935
|
],
|
|
4864
4936
|
setup(e, { expose: t, emit: n }) {
|
|
4865
|
-
let r = e, i = n, a =
|
|
4937
|
+
let r = e, i = n, a = ae(), o = R(), s = R("create"), c = R({}), l = R(0), d = R([]), f = R({}), p = R({}), m = _(() => r.fields.filter((e) => e.form !== !1)), h = _(() => {
|
|
4866
4938
|
let e = r.searchFormProps?.schema;
|
|
4867
|
-
return e?.length ? e : r.fields.filter((e) => e.search).map((e) =>
|
|
4939
|
+
return e?.length ? e : r.fields.filter((e) => e.search).map((e) => ne(e)).filter((e) => !!e);
|
|
4868
4940
|
}), x = _(() => h.value.length > 0), T = _(() => r.fields.filter((e) => e.table !== !1).filter((e) => e.type !== "group").map((e) => {
|
|
4869
4941
|
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);
|
|
4870
4942
|
return {
|
|
@@ -4887,7 +4959,7 @@ var Xo = {
|
|
|
4887
4959
|
if (r.actions) return r.actions;
|
|
4888
4960
|
let e = [];
|
|
4889
4961
|
return r.onUpdate && e.push("edit"), r.onDelete && e.push("delete"), e;
|
|
4890
|
-
}), F = _(() => r.tableProps?.showActions ?? N.value.length > 0), I = _(() => r.permissionCode ?? r.tableProps?.permissionCode ?? ""),
|
|
4962
|
+
}), F = _(() => r.tableProps?.showActions ?? N.value.length > 0), I = _(() => r.permissionCode ?? r.tableProps?.permissionCode ?? ""), ee = _(() => {
|
|
4891
4963
|
let e = r.tableProps ?? {}, t = e.importDialog;
|
|
4892
4964
|
return !r.importUrl && !t ? e : {
|
|
4893
4965
|
...e,
|
|
@@ -4896,10 +4968,10 @@ var Xo = {
|
|
|
4896
4968
|
...typeof r.importUrl == "string" ? { api: r.importUrl } : r.importUrl ?? {}
|
|
4897
4969
|
}
|
|
4898
4970
|
};
|
|
4899
|
-
}),
|
|
4971
|
+
}), te = _(() => {
|
|
4900
4972
|
let { schema: e, ...t } = r.searchFormProps ?? {};
|
|
4901
4973
|
return t;
|
|
4902
|
-
}),
|
|
4974
|
+
}), H = /* @__PURE__ */ new Set([
|
|
4903
4975
|
"apiOptions",
|
|
4904
4976
|
"component",
|
|
4905
4977
|
"copyable",
|
|
@@ -4922,27 +4994,27 @@ var Xo = {
|
|
|
4922
4994
|
"tip",
|
|
4923
4995
|
"type"
|
|
4924
4996
|
]);
|
|
4925
|
-
function te(e) {
|
|
4926
|
-
return e.type === "group" ? ne(e) : G(e);
|
|
4927
|
-
}
|
|
4928
4997
|
function ne(e) {
|
|
4998
|
+
return e.type === "group" ? re(e) : ie(e);
|
|
4999
|
+
}
|
|
5000
|
+
function re(e) {
|
|
4929
5001
|
let t = e.search;
|
|
4930
5002
|
if (!t) return null;
|
|
4931
5003
|
let n = typeof t == "object" ? t : {}, r = Array.isArray(n.children) ? n.children : e.children;
|
|
4932
5004
|
return {
|
|
4933
5005
|
...e,
|
|
4934
|
-
...
|
|
5006
|
+
...G(n),
|
|
4935
5007
|
children: r,
|
|
4936
5008
|
hidden: n.hidden ?? !1
|
|
4937
5009
|
};
|
|
4938
5010
|
}
|
|
4939
|
-
function
|
|
5011
|
+
function ie(e) {
|
|
4940
5012
|
let t = e.search;
|
|
4941
5013
|
if (!t) return null;
|
|
4942
|
-
let n = typeof t == "object" ? t : {}, r =
|
|
5014
|
+
let n = typeof t == "object" ? t : {}, r = oe(n), i = se(e.props, r);
|
|
4943
5015
|
return {
|
|
4944
5016
|
...e,
|
|
4945
|
-
...
|
|
5017
|
+
...G(n),
|
|
4946
5018
|
props: i,
|
|
4947
5019
|
hidden: n.hidden ?? !1,
|
|
4948
5020
|
readonly: n.readonly ?? !1,
|
|
@@ -4950,13 +5022,13 @@ var Xo = {
|
|
|
4950
5022
|
rules: n.rules ?? []
|
|
4951
5023
|
};
|
|
4952
5024
|
}
|
|
4953
|
-
function
|
|
4954
|
-
return Object.fromEntries(Object.entries(e).filter(([e]) =>
|
|
5025
|
+
function G(e) {
|
|
5026
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => H.has(e)));
|
|
4955
5027
|
}
|
|
4956
|
-
function
|
|
4957
|
-
return Object.fromEntries(Object.entries(e).filter(([e]) => !
|
|
5028
|
+
function oe(e) {
|
|
5029
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => !H.has(e)));
|
|
4958
5030
|
}
|
|
4959
|
-
function
|
|
5031
|
+
function se(e, t) {
|
|
4960
5032
|
return Object.keys(t).length === 0 ? e : typeof e == "function" ? ((n) => ({
|
|
4961
5033
|
...e(n),
|
|
4962
5034
|
...t
|
|
@@ -4965,22 +5037,22 @@ var Xo = {
|
|
|
4965
5037
|
...t
|
|
4966
5038
|
};
|
|
4967
5039
|
}
|
|
4968
|
-
async function
|
|
5040
|
+
async function K(e) {
|
|
4969
5041
|
p.value = { ...e }, await M(), await ke();
|
|
4970
5042
|
}
|
|
4971
|
-
function
|
|
4972
|
-
|
|
5043
|
+
function ce(e) {
|
|
5044
|
+
K(e);
|
|
4973
5045
|
}
|
|
4974
|
-
function
|
|
4975
|
-
|
|
5046
|
+
function le() {
|
|
5047
|
+
K({});
|
|
4976
5048
|
}
|
|
4977
|
-
function
|
|
4978
|
-
f.value = { ...e },
|
|
5049
|
+
function ue(e = f.value) {
|
|
5050
|
+
f.value = { ...e }, ce(f.value);
|
|
4979
5051
|
}
|
|
4980
|
-
function
|
|
4981
|
-
f.value = { ...e },
|
|
5052
|
+
function de(e = {}) {
|
|
5053
|
+
f.value = { ...e }, K(f.value);
|
|
4982
5054
|
}
|
|
4983
|
-
let [
|
|
5055
|
+
let [fe, X] = Qo({
|
|
4984
5056
|
...r.drawerProps,
|
|
4985
5057
|
schema: m.value,
|
|
4986
5058
|
schemaFormProps: {
|
|
@@ -4990,14 +5062,14 @@ var Xo = {
|
|
|
4990
5062
|
onSubmit: async (e) => {
|
|
4991
5063
|
let t = s.value === "create";
|
|
4992
5064
|
if (!(t ? r.onCreate : r.onUpdate)) return Q.warning("当前操作没有配置提交处理函数"), !1;
|
|
4993
|
-
|
|
5065
|
+
X.setState({ submitting: !0 });
|
|
4994
5066
|
try {
|
|
4995
5067
|
let n = t ? e : he(e, c.value);
|
|
4996
5068
|
return (t ? await r.onCreate?.(e) : await r.onUpdate?.(n, c.value)) !== !1 && (Q.success(s.value === "create" ? "新增成功" : "更新成功"), await ke(), !0);
|
|
4997
5069
|
} catch {
|
|
4998
5070
|
return Q.error(s.value === "create" ? "新增失败" : "更新失败"), !1;
|
|
4999
5071
|
} finally {
|
|
5000
|
-
|
|
5072
|
+
X.setState({ submitting: !1 });
|
|
5001
5073
|
}
|
|
5002
5074
|
}
|
|
5003
5075
|
});
|
|
@@ -5020,7 +5092,7 @@ var Xo = {
|
|
|
5020
5092
|
async function ge(e, t) {
|
|
5021
5093
|
s.value = e, c.value = { ...t ?? {} };
|
|
5022
5094
|
let n = ++l.value, i = e !== "create" && !!r.resolveFormValues;
|
|
5023
|
-
if (
|
|
5095
|
+
if (X.open({
|
|
5024
5096
|
...r.drawerProps,
|
|
5025
5097
|
loading: i,
|
|
5026
5098
|
mode: e,
|
|
@@ -5033,11 +5105,11 @@ var Xo = {
|
|
|
5033
5105
|
values: me(e, t)
|
|
5034
5106
|
}), i) try {
|
|
5035
5107
|
let i = await r.resolveFormValues?.(e, t);
|
|
5036
|
-
n === l.value && i && (c.value = he(i, c.value),
|
|
5108
|
+
n === l.value && i && (c.value = he(i, c.value), X.setValues(i));
|
|
5037
5109
|
} catch {
|
|
5038
|
-
n === l.value && (Q.error("加载详情失败"),
|
|
5110
|
+
n === l.value && (Q.error("加载详情失败"), X.close());
|
|
5039
5111
|
} finally {
|
|
5040
|
-
n === l.value &&
|
|
5112
|
+
n === l.value && X.setState({ loading: !1 });
|
|
5041
5113
|
}
|
|
5042
5114
|
}
|
|
5043
5115
|
async function _e() {
|
|
@@ -5090,17 +5162,17 @@ var Xo = {
|
|
|
5090
5162
|
if (!r?.exportConfig) return;
|
|
5091
5163
|
let { onExport: e, name: t, url: n } = r.exportConfig;
|
|
5092
5164
|
if (e) try {
|
|
5093
|
-
let r =
|
|
5165
|
+
let r = un(), i = e({
|
|
5094
5166
|
rows: d.value,
|
|
5095
5167
|
queryParmas: f.value
|
|
5096
|
-
}), a = await
|
|
5168
|
+
}), a = await vn.download(Se(n), {
|
|
5097
5169
|
responseReturn: "raw",
|
|
5098
5170
|
data: {
|
|
5099
5171
|
...i,
|
|
5100
5172
|
token: r.accessToken
|
|
5101
5173
|
}
|
|
5102
5174
|
});
|
|
5103
|
-
|
|
5175
|
+
gn({
|
|
5104
5176
|
fileName: we($(a.headers, "content-disposition"), t || "export.xlsx"),
|
|
5105
5177
|
source: a.data
|
|
5106
5178
|
});
|
|
@@ -5110,7 +5182,7 @@ var Xo = {
|
|
|
5110
5182
|
}
|
|
5111
5183
|
function Se(e) {
|
|
5112
5184
|
if (/^https?:\/\//i.test(e)) return e;
|
|
5113
|
-
let t =
|
|
5185
|
+
let t = vn.getBaseUrl() || "", n = (/^https?:\/\//i.test(t) ? new URL(t).pathname : t.split(/[?#]/, 1)[0] ?? "").replace(/\/+$/, "");
|
|
5114
5186
|
return n && n !== "/" && (e === n || e.startsWith(`${n}/`)) ? e.slice(n.length) || "/" : e;
|
|
5115
5187
|
}
|
|
5116
5188
|
function $(e, t) {
|
|
@@ -5126,7 +5198,7 @@ var Xo = {
|
|
|
5126
5198
|
return n ? decodeURIComponent(n.replace(/^["']|["']$/g, "")) : e?.match(/filename="?([^";]+)"?/i)?.[1] || t;
|
|
5127
5199
|
}
|
|
5128
5200
|
function Te(e) {
|
|
5129
|
-
return e.component ? typeof e.component == "function" ? e.component() : O(e.component) : !e.name || !e.label ? null : O(
|
|
5201
|
+
return e.component ? typeof e.component == "function" ? e.component() : O(e.component) : !e.name || !e.label ? null : O(Y, {
|
|
5130
5202
|
type: e.type ?? "primary",
|
|
5131
5203
|
onClick: () => i("toolbarAction", e.name)
|
|
5132
5204
|
}, () => e.label);
|
|
@@ -5148,40 +5220,40 @@ var Xo = {
|
|
|
5148
5220
|
}
|
|
5149
5221
|
return t({
|
|
5150
5222
|
clearSelection: () => o.value?.clearSelection(),
|
|
5151
|
-
close:
|
|
5223
|
+
close: X.close,
|
|
5152
5224
|
getSelectedRows: () => o.value?.getSelectedRows() ?? [],
|
|
5153
5225
|
getSearchValues: () => ({ ...p.value }),
|
|
5154
|
-
drawerApi:
|
|
5226
|
+
drawerApi: X,
|
|
5155
5227
|
openCreate: _e,
|
|
5156
5228
|
openEdit: (e) => ge("edit", e),
|
|
5157
5229
|
openView: (e) => ge("view", e),
|
|
5158
5230
|
reload: ke
|
|
5159
5231
|
}), (e, t) => {
|
|
5160
|
-
let n =
|
|
5161
|
-
return L(), b(g, null, [w(
|
|
5162
|
-
default:
|
|
5163
|
-
|
|
5164
|
-
e.$slots.search ?
|
|
5232
|
+
let n = V("access");
|
|
5233
|
+
return L(), b(g, null, [w(Xi, null, {
|
|
5234
|
+
default: q(() => [
|
|
5235
|
+
B(e.$slots, "prepend", {}, void 0, !0),
|
|
5236
|
+
e.$slots.search ? B(e.$slots, "search", {
|
|
5165
5237
|
values: f.value,
|
|
5166
|
-
search:
|
|
5167
|
-
reset:
|
|
5168
|
-
}, void 0, !0, 0) : x.value ? (L(), v(
|
|
5238
|
+
search: ue,
|
|
5239
|
+
reset: de
|
|
5240
|
+
}, void 0, !0, 0) : x.value ? (L(), v(ts, j({
|
|
5169
5241
|
key: 1,
|
|
5170
5242
|
modelValue: f.value,
|
|
5171
5243
|
"onUpdate:modelValue": t[0] ||= (e) => f.value = e,
|
|
5172
5244
|
class: "crud-page__search"
|
|
5173
|
-
},
|
|
5245
|
+
}, te.value, {
|
|
5174
5246
|
schema: h.value,
|
|
5175
|
-
onSearch:
|
|
5176
|
-
onReset:
|
|
5177
|
-
}), S({ _: 2 }, [
|
|
5247
|
+
onSearch: ce,
|
|
5248
|
+
onReset: le
|
|
5249
|
+
}), S({ _: 2 }, [z(A.value, (t) => ({
|
|
5178
5250
|
name: t,
|
|
5179
|
-
fn:
|
|
5251
|
+
fn: q((n) => [B(e.$slots, t, P(D(n)), void 0, !0)])
|
|
5180
5252
|
}))]), 1040, ["modelValue", "schema"])) : y("", !0),
|
|
5181
|
-
w(
|
|
5253
|
+
w(Oi, j({
|
|
5182
5254
|
ref_key: "tableRef",
|
|
5183
5255
|
ref: o
|
|
5184
|
-
},
|
|
5256
|
+
}, ee.value, {
|
|
5185
5257
|
"row-key": r.rowKey,
|
|
5186
5258
|
columns: T.value,
|
|
5187
5259
|
data: r.data,
|
|
@@ -5193,44 +5265,44 @@ var Xo = {
|
|
|
5193
5265
|
onHandleAction: Oe,
|
|
5194
5266
|
onRowSort: t[2] ||= (e) => i("rowSort", e)
|
|
5195
5267
|
}), S({
|
|
5196
|
-
buttons:
|
|
5197
|
-
r.onCreate ?
|
|
5268
|
+
buttons: q(() => [B(e.$slots, "buttons", { selectedRows: d.value }, () => [
|
|
5269
|
+
r.onCreate ? J((L(), v(W(Y), {
|
|
5198
5270
|
key: 0,
|
|
5199
5271
|
type: "primary",
|
|
5200
5272
|
onClick: _e
|
|
5201
5273
|
}, {
|
|
5202
|
-
default:
|
|
5274
|
+
default: q(() => [C(U(r.addButtonText), 1)]),
|
|
5203
5275
|
_: 1
|
|
5204
5276
|
})), [[n, [`${I.value}:add`]]]) : y("", !0),
|
|
5205
|
-
r.onDelete || r.onBatchDelete ?
|
|
5277
|
+
r.onDelete || r.onBatchDelete ? J((L(), v(W(Y), {
|
|
5206
5278
|
key: 1,
|
|
5207
5279
|
type: "danger",
|
|
5208
5280
|
disabled: d.value.length === 0,
|
|
5209
5281
|
onClick: Z
|
|
5210
5282
|
}, {
|
|
5211
|
-
default:
|
|
5283
|
+
default: q(() => [C(U(W(u)("components.tableEntity.batchDelete")), 1)]),
|
|
5212
5284
|
_: 1
|
|
5213
5285
|
}, 8, ["disabled"])), [[n, [`${I.value}:remove`]]]) : y("", !0),
|
|
5214
|
-
r.showImport ?
|
|
5286
|
+
r.showImport ? J((L(), v(W(Y), {
|
|
5215
5287
|
key: 2,
|
|
5216
5288
|
onClick: be
|
|
5217
5289
|
}, {
|
|
5218
|
-
default:
|
|
5290
|
+
default: q(() => [C(U(W(u)("components.tableEntity.import")), 1)]),
|
|
5219
5291
|
_: 1
|
|
5220
5292
|
})), [[n, [`${I.value}:import`]]]) : y("", !0),
|
|
5221
|
-
r.exportConfig ?
|
|
5293
|
+
r.exportConfig ? J((L(), v(W(Y), {
|
|
5222
5294
|
key: 3,
|
|
5223
5295
|
onClick: xe
|
|
5224
5296
|
}, {
|
|
5225
|
-
default:
|
|
5297
|
+
default: q(() => [C(U(W(u)("components.tableEntity.export")), 1)]),
|
|
5226
5298
|
_: 1
|
|
5227
5299
|
})), [[n, [`${I.value}:export`]]]) : y("", !0),
|
|
5228
|
-
w(
|
|
5300
|
+
w(W(De))
|
|
5229
5301
|
], !0)]),
|
|
5230
5302
|
_: 2
|
|
5231
|
-
}, [
|
|
5303
|
+
}, [z(k.value, (t) => ({
|
|
5232
5304
|
name: t,
|
|
5233
|
-
fn:
|
|
5305
|
+
fn: q((n) => [B(e.$slots, t, P(D(n)), void 0, !0)])
|
|
5234
5306
|
}))]), 1040, [
|
|
5235
5307
|
"row-key",
|
|
5236
5308
|
"columns",
|
|
@@ -5242,28 +5314,28 @@ var Xo = {
|
|
|
5242
5314
|
])
|
|
5243
5315
|
]),
|
|
5244
5316
|
_: 3
|
|
5245
|
-
}), w(
|
|
5246
|
-
default:
|
|
5317
|
+
}), w(W(fe), null, S({
|
|
5318
|
+
default: q(() => [e.$slots.default ? B(e.$slots, "default", {}, void 0, !0, 0) : y("", !0)]),
|
|
5247
5319
|
_: 2
|
|
5248
5320
|
}, [
|
|
5249
|
-
|
|
5321
|
+
z(A.value, (t) => ({
|
|
5250
5322
|
name: t,
|
|
5251
|
-
fn:
|
|
5323
|
+
fn: q((n) => [B(e.$slots, t, P(D(n)), void 0, !0)])
|
|
5252
5324
|
})),
|
|
5253
5325
|
e.$slots.header ? {
|
|
5254
5326
|
name: "header",
|
|
5255
|
-
fn:
|
|
5327
|
+
fn: q((t) => [B(e.$slots, "header", P(D(t)), void 0, !0)]),
|
|
5256
5328
|
key: "0"
|
|
5257
5329
|
} : void 0,
|
|
5258
5330
|
e.$slots.footer ? {
|
|
5259
5331
|
name: "footer",
|
|
5260
|
-
fn:
|
|
5332
|
+
fn: q((t) => [B(e.$slots, "footer", P(D(t)), void 0, !0)]),
|
|
5261
5333
|
key: "1"
|
|
5262
5334
|
} : void 0
|
|
5263
5335
|
]), 1024)], 64);
|
|
5264
5336
|
};
|
|
5265
5337
|
}
|
|
5266
|
-
}), [["__scopeId", "data-v-d344d607"]]),
|
|
5338
|
+
}), [["__scopeId", "data-v-d344d607"]]), rs = /* @__PURE__ */ E({
|
|
5267
5339
|
__name: "index",
|
|
5268
5340
|
props: {
|
|
5269
5341
|
className: { default: "disguiseicon" },
|
|
@@ -5271,9 +5343,9 @@ var Xo = {
|
|
|
5271
5343
|
},
|
|
5272
5344
|
setup(e) {
|
|
5273
5345
|
let t = e;
|
|
5274
|
-
return (e, n) => (L(), v(
|
|
5346
|
+
return (e, n) => (L(), v(W(Z), j(e.$attrs, { class: ["disguise iconfont", t.icon ? `${t.className}-${t.icon}` : void 0] }), null, 16, ["class"]));
|
|
5275
5347
|
}
|
|
5276
|
-
}),
|
|
5348
|
+
}), is = ["src"], as = { class: "image-upload__mask" }, os = { class: "image-upload__text" }, ss = /*#__PURE__*/ d(/* @__PURE__ */ E({
|
|
5277
5349
|
__name: "index",
|
|
5278
5350
|
props: /*@__PURE__*/ A({
|
|
5279
5351
|
accept: { default: () => [
|
|
@@ -5295,7 +5367,7 @@ var Xo = {
|
|
|
5295
5367
|
}),
|
|
5296
5368
|
emits: ["update:modelValue"],
|
|
5297
5369
|
setup(e) {
|
|
5298
|
-
let t = e, n =
|
|
5370
|
+
let t = e, n = G(e, "modelValue"), { resolveImageUrl: r } = f(), i = R(!1), a = R(!1), o = _(() => r(n.value)), s = _(() => ({
|
|
5299
5371
|
width: `${t.width}px`,
|
|
5300
5372
|
height: `${t.height}px`
|
|
5301
5373
|
}));
|
|
@@ -5326,22 +5398,22 @@ var Xo = {
|
|
|
5326
5398
|
src: o.value,
|
|
5327
5399
|
alt: "",
|
|
5328
5400
|
class: "image-upload__img"
|
|
5329
|
-
}, null, 8,
|
|
5401
|
+
}, null, 8, is), x("div", as, [w(W(Z), {
|
|
5330
5402
|
class: "image-upload__action",
|
|
5331
|
-
title:
|
|
5403
|
+
title: W(u)("components.imageUpload.preview"),
|
|
5332
5404
|
onClick: n[0] ||= (e) => a.value = !0
|
|
5333
5405
|
}, {
|
|
5334
|
-
default:
|
|
5406
|
+
default: q(() => [w(W(dt))]),
|
|
5335
5407
|
_: 1
|
|
5336
|
-
}, 8, ["title"]), e.disabled ? y("", !0) : (L(), v(
|
|
5408
|
+
}, 8, ["title"]), e.disabled ? y("", !0) : (L(), v(W(Z), {
|
|
5337
5409
|
key: 0,
|
|
5338
5410
|
class: "image-upload__action",
|
|
5339
|
-
title:
|
|
5411
|
+
title: W(u)("components.imageUpload.remove"),
|
|
5340
5412
|
onClick: d
|
|
5341
5413
|
}, {
|
|
5342
|
-
default:
|
|
5414
|
+
default: q(() => [w(W(Ze))]),
|
|
5343
5415
|
_: 1
|
|
5344
|
-
}, 8, ["title"]))])], 4)) : (L(), v(
|
|
5416
|
+
}, 8, ["title"]))])], 4)) : (L(), v(W(ze), {
|
|
5345
5417
|
key: 1,
|
|
5346
5418
|
accept: e.accept.join(","),
|
|
5347
5419
|
"before-upload": c,
|
|
@@ -5349,15 +5421,15 @@ var Xo = {
|
|
|
5349
5421
|
"http-request": l,
|
|
5350
5422
|
"show-file-list": !1
|
|
5351
5423
|
}, {
|
|
5352
|
-
default:
|
|
5424
|
+
default: q(() => [x("div", {
|
|
5353
5425
|
class: "image-upload__box is-empty",
|
|
5354
5426
|
style: F(s.value)
|
|
5355
|
-
}, [w(
|
|
5356
|
-
default:
|
|
5427
|
+
}, [w(W(Z), { class: N(["image-upload__icon", { "is-loading": i.value }]) }, {
|
|
5428
|
+
default: q(() => [i.value ? (L(), v(W(tt), { key: 0 })) : (L(), v(W(rt), { key: 1 }))]),
|
|
5357
5429
|
_: 1
|
|
5358
|
-
}, 8, ["class"]), x("span",
|
|
5430
|
+
}, 8, ["class"]), x("span", os, U(i.value ? W(u)("components.imageUpload.uploading") : W(u)("components.imageUpload.upload")), 1)], 4)]),
|
|
5359
5431
|
_: 1
|
|
5360
|
-
}, 8, ["accept", "disabled"])), a.value ? (L(), v(
|
|
5432
|
+
}, 8, ["accept", "disabled"])), a.value ? (L(), v(W(be), {
|
|
5361
5433
|
key: 2,
|
|
5362
5434
|
"url-list": [o.value],
|
|
5363
5435
|
teleported: "",
|
|
@@ -5366,7 +5438,7 @@ var Xo = {
|
|
|
5366
5438
|
}
|
|
5367
5439
|
}), [["__scopeId", "data-v-c6aeef2e"]]);
|
|
5368
5440
|
// src/setup.ts
|
|
5369
|
-
function
|
|
5441
|
+
function cs(e = {}) {
|
|
5370
5442
|
c(e);
|
|
5371
5443
|
}
|
|
5372
|
-
export {
|
|
5444
|
+
export { Ji as AsyncSelect, Xi as BaseCard, ns as CrudPage, Mr as DictTag, rs as DisguiseIcon, Zo as DrawerFormPage, ss as ImageUpload, t as ImagesView, tr as ImportDialog, h as PictureUpload, _o as RichTextEditor, Vo as SchemaForm, ts as SearchForm, Oi as TableEntity, $i as getEntity, ea as paginateLocally, Qi as registerEntity, sa as registerSchemaFormComponents, cs as setupDisguise, Qo as useDrawerFormPage };
|