dydx-naive-ui-for-vue 0.1.49 → 0.1.51
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Mu } from "./resolver-BDxomgBZ.js";
|
|
2
2
|
import { NAutoComplete as Er, NButton as X, NCascader as Lr, NCheckbox as Ht, NCheckboxGroup as et, NColorPicker as Kr, NDataTable as Gr, NDatePicker as Vr, NDrawer as Hr, NDrawerContent as qr, NDropdown as Wr, NDynamicInput as Yr, NDynamicTags as Jr, NForm as Qr, NFormItem as Xr, NGrid as Zr, NGridItem as ea, NIcon as H, NImage as ta, NInput as ra, NInputNumber as aa, NMention as na, NModal as oa, NPopconfirm as la, NPopover as ia, NRadio as sa, NRadioButton as ua, NRadioGroup as Ne, NRate as da, NSelect as qt, NSlider as fa, NSpace as ae, NSpin as tt, NSwitch as Wt, NTag as Ve, NText as ca, NTimePicker as pa, NTooltip as Be, NTreeSelect as ya, NUpload as Yt, NUploadDragger as ga, createDiscreteApi as va, useMessage as ma } from "naive-ui";
|
|
3
|
-
import { Fragment as te, computed as K, createBlock as P, createCommentVNode as Y, createElementBlock as Q, createElementVNode as Fe, createSlots as de, createTextVNode as E, createVNode as C, defineComponent as he, guardReactiveProps as ue, h as
|
|
3
|
+
import { Fragment as te, computed as K, createBlock as P, createCommentVNode as Y, createElementBlock as Q, createElementVNode as Fe, createSlots as de, createTextVNode as E, createVNode as C, defineComponent as he, guardReactiveProps as ue, h as x, isRef as ba, mergeModels as vt, mergeProps as J, nextTick as ha, normalizeProps as le, onMounted as Jt, onUnmounted as _a, openBlock as h, ref as re, renderList as ne, renderSlot as U, resolveDynamicComponent as me, toDisplayString as W, toHandlers as wa, unref as c, useAttrs as rt, useModel as Ca, watch as Qt, withCtx as s } from "vue";
|
|
4
4
|
import * as je from "@vicons/ionicons5";
|
|
5
5
|
import { AddOutline as Xt, CheckmarkOutline as Zt, CloseOutline as er, CloudUploadOutline as mt, CreateOutline as Ta, DownloadOutline as xa, EyeOutline as ka, HelpCircleOutline as Sa, OpenOutline as $a, RefreshOutline as tr, SearchOutline as Aa, SettingsOutline as Pa, TrashOutline as Oa } from "@vicons/ionicons5";
|
|
6
6
|
var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
@@ -43,27 +43,27 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
43
43
|
"beforeUpload"
|
|
44
44
|
],
|
|
45
45
|
setup(e, { expose: t, emit: a }) {
|
|
46
|
-
const r = e, l = a, i = ma(), o = re(), g = K(() => r.listType ? r.listType : r.uploadType === "image" ? "image-card" : "text"),
|
|
47
|
-
...
|
|
48
|
-
url:
|
|
49
|
-
})) : r.fileList),
|
|
50
|
-
const
|
|
51
|
-
return r.acceptTypes?.length &&
|
|
46
|
+
const r = e, l = a, i = ma(), o = re(), g = K(() => r.listType ? r.listType : r.uploadType === "image" ? "image-card" : "text"), v = K(() => r.urlPrefix ? r.fileList.map((k) => ({
|
|
47
|
+
...k,
|
|
48
|
+
url: k.url && !k.url.startsWith("http") ? r.urlPrefix + k.url : k.url
|
|
49
|
+
})) : r.fileList), y = K(() => {
|
|
50
|
+
const k = [];
|
|
51
|
+
return r.acceptTypes?.length && k.push(`支持格式:${r.acceptTypes.join(", ")}`), r.maxSize && k.push(`单个文件不超过 ${r.maxSize}MB`), r.maxCount && k.push(`最多 ${r.maxCount} 个文件`), k.join(";");
|
|
52
52
|
}), p = K(() => {
|
|
53
53
|
if (r.accept) return r.accept;
|
|
54
54
|
if (r.acceptTypes?.length) return r.acceptTypes.join(",");
|
|
55
55
|
if (r.uploadType === "image") return "image/*";
|
|
56
|
-
}),
|
|
57
|
-
const { uploadType:
|
|
56
|
+
}), w = K(() => {
|
|
57
|
+
const { uploadType: k, fileList: D, customUpload: G, acceptTypes: f, maxSize: N, maxCount: u, multiple: _, autoUpload: m, disabled: F, urlPrefix: V, showTip: O, showDragger: ye, ...ge } = r;
|
|
58
58
|
return ge;
|
|
59
|
-
}), S = (
|
|
60
|
-
l("update:fileList", r.urlPrefix ?
|
|
59
|
+
}), S = (k) => {
|
|
60
|
+
l("update:fileList", r.urlPrefix ? k.map((D) => ({
|
|
61
61
|
...D,
|
|
62
62
|
url: D.url?.startsWith(r.urlPrefix) ? D.url.slice(r.urlPrefix.length) : D.url
|
|
63
|
-
})) :
|
|
64
|
-
}, T = async ({ file:
|
|
65
|
-
l("beforeUpload",
|
|
66
|
-
const D =
|
|
63
|
+
})) : k);
|
|
64
|
+
}, T = async ({ file: k }) => {
|
|
65
|
+
l("beforeUpload", k);
|
|
66
|
+
const D = k.file;
|
|
67
67
|
return D ? r.maxSize && D.size > r.maxSize * 1024 * 1024 ? (i.error(`文件大小不能超过 ${r.maxSize}MB`), !1) : r.acceptTypes?.length && !r.acceptTypes.some((G) => {
|
|
68
68
|
if (G.startsWith(".")) return D.name.toLowerCase().endsWith(G.toLowerCase());
|
|
69
69
|
if (G.includes("*")) {
|
|
@@ -72,8 +72,8 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
72
72
|
}
|
|
73
73
|
return D.type === G;
|
|
74
74
|
}) ? (i.error(`只支持 ${r.acceptTypes.join(", ")} 格式`), !1) : r.maxCount && r.fileList.length >= r.maxCount ? (l("exceed", [D]), i.error(`最多上传 ${r.maxCount} 个文件`), !1) : !0 : !0;
|
|
75
|
-
}, M = async (
|
|
76
|
-
const { file: D, onProgress: G, onFinish: f, onError: N } =
|
|
75
|
+
}, M = async (k) => {
|
|
76
|
+
const { file: D, onProgress: G, onFinish: f, onError: N } = k;
|
|
77
77
|
if (!r.customUpload) {
|
|
78
78
|
console.warn("DydxUpload: customUpload 方法未提供"), N();
|
|
79
79
|
return;
|
|
@@ -92,14 +92,14 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
92
92
|
submit: () => o.value?.submit(),
|
|
93
93
|
openDialog: () => o.value?.openOpenFileDialog(),
|
|
94
94
|
clear: () => o.value?.clear()
|
|
95
|
-
}), (
|
|
96
|
-
const G = H, f = ca, N = ga, u = X,
|
|
97
|
-
return
|
|
98
|
-
C(
|
|
95
|
+
}), (k, D) => {
|
|
96
|
+
const G = H, f = ca, N = ga, u = X, _ = Yt;
|
|
97
|
+
return h(), Q("div", null, [
|
|
98
|
+
C(_, J({
|
|
99
99
|
ref_key: "uploadRef",
|
|
100
100
|
ref: o
|
|
101
|
-
},
|
|
102
|
-
"file-list":
|
|
101
|
+
}, w.value, {
|
|
102
|
+
"file-list": v.value,
|
|
103
103
|
"custom-request": M,
|
|
104
104
|
accept: p.value,
|
|
105
105
|
max: e.maxCount,
|
|
@@ -110,7 +110,7 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
110
110
|
"onUpdate:fileList": S,
|
|
111
111
|
onBeforeUpload: T
|
|
112
112
|
}), {
|
|
113
|
-
default: s(() => [e.showDragger && e.uploadType !== "image" ? (
|
|
113
|
+
default: s(() => [e.showDragger && e.uploadType !== "image" ? (h(), P(N, { key: 0 }, {
|
|
114
114
|
default: s(() => [
|
|
115
115
|
Fe("div", Da, [C(G, {
|
|
116
116
|
size: "48",
|
|
@@ -123,7 +123,7 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
123
123
|
default: s(() => [...D[0] || (D[0] = [E(" 点击或拖拽文件到此区域上传 ", -1)])]),
|
|
124
124
|
_: 1
|
|
125
125
|
}),
|
|
126
|
-
e.showTip ? (
|
|
126
|
+
e.showTip ? (h(), P(f, {
|
|
127
127
|
key: 0,
|
|
128
128
|
depth: "3",
|
|
129
129
|
style: {
|
|
@@ -132,18 +132,18 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
132
132
|
display: "block"
|
|
133
133
|
}
|
|
134
134
|
}, {
|
|
135
|
-
default: s(() => [E(W(
|
|
135
|
+
default: s(() => [E(W(y.value), 1)]),
|
|
136
136
|
_: 1
|
|
137
137
|
})) : Y("", !0)
|
|
138
138
|
]),
|
|
139
139
|
_: 1
|
|
140
|
-
})) : U(
|
|
140
|
+
})) : U(k.$slots, "default", { key: 1 }, () => [e.uploadType === "image" && g.value === "image-card" ? (h(), P(G, {
|
|
141
141
|
key: 0,
|
|
142
142
|
size: 28
|
|
143
143
|
}, {
|
|
144
144
|
default: s(() => [C(c(Xt))]),
|
|
145
145
|
_: 1
|
|
146
|
-
})) : (
|
|
146
|
+
})) : (h(), P(u, { key: 1 }, {
|
|
147
147
|
icon: s(() => [C(G, null, {
|
|
148
148
|
default: s(() => [C(c(mt))]),
|
|
149
149
|
_: 1
|
|
@@ -161,7 +161,7 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
161
161
|
"default-upload",
|
|
162
162
|
"list-type"
|
|
163
163
|
]),
|
|
164
|
-
!e.autoUpload &&
|
|
164
|
+
!e.autoUpload && v.value.length > 0 ? (h(), P(u, {
|
|
165
165
|
key: 0,
|
|
166
166
|
type: "primary",
|
|
167
167
|
onClick: L,
|
|
@@ -170,7 +170,7 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
170
170
|
default: s(() => [...D[1] || (D[1] = [E(" 开始上传 ", -1)])]),
|
|
171
171
|
_: 1
|
|
172
172
|
})) : Y("", !0),
|
|
173
|
-
e.showTip && !(e.showDragger && e.uploadType !== "image") ? (
|
|
173
|
+
e.showTip && !(e.showDragger && e.uploadType !== "image") ? (h(), P(f, {
|
|
174
174
|
key: 1,
|
|
175
175
|
depth: "3",
|
|
176
176
|
style: {
|
|
@@ -179,7 +179,7 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
179
179
|
display: "block"
|
|
180
180
|
}
|
|
181
181
|
}, {
|
|
182
|
-
default: s(() => [E(W(
|
|
182
|
+
default: s(() => [E(W(y.value), 1)]),
|
|
183
183
|
_: 1
|
|
184
184
|
})) : Y("", !0)
|
|
185
185
|
]);
|
|
@@ -205,21 +205,21 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
205
205
|
emits: ["update:value"],
|
|
206
206
|
setup(e, { emit: t }) {
|
|
207
207
|
const a = e, r = t, l = Object.keys(je), i = K(() => {
|
|
208
|
-
let
|
|
209
|
-
return a.iconStyle === "outline" ?
|
|
208
|
+
let y = l;
|
|
209
|
+
return a.iconStyle === "outline" ? y = l.filter((p) => p.endsWith("Outline")) : a.iconStyle === "sharp" ? y = l.filter((p) => p.endsWith("Sharp")) : a.iconStyle === "filled" && (y = l.filter((p) => !p.endsWith("Outline") && !p.endsWith("Sharp"))), y.map((p) => ({
|
|
210
210
|
label: p,
|
|
211
211
|
value: p
|
|
212
212
|
}));
|
|
213
|
-
}), o = (
|
|
214
|
-
const p = je[
|
|
215
|
-
return p ?
|
|
216
|
-
}, g = ({ option:
|
|
217
|
-
const p = je[
|
|
218
|
-
return p ?
|
|
219
|
-
},
|
|
220
|
-
r("update:value",
|
|
213
|
+
}), o = (y) => {
|
|
214
|
+
const p = je[y.value];
|
|
215
|
+
return p ? x("div", { style: "display: flex; align-items: center; gap: 8px;" }, [x(H, { size: 18 }, () => x(p)), x("span", { style: "flex: 1; overflow: hidden; text-overflow: ellipsis;" }, y.label)]) : x("span", y.label);
|
|
216
|
+
}, g = ({ option: y }) => {
|
|
217
|
+
const p = je[y.value];
|
|
218
|
+
return p ? x("div", { style: "display: flex; align-items: center; gap: 4px;" }, [x(H, { size: 16 }, () => x(p)), y.label]) : x("span", y.label);
|
|
219
|
+
}, v = (y) => {
|
|
220
|
+
r("update:value", y);
|
|
221
221
|
};
|
|
222
|
-
return (
|
|
222
|
+
return (y, p) => (h(), P(c(qt), {
|
|
223
223
|
value: e.value,
|
|
224
224
|
options: i.value,
|
|
225
225
|
placeholder: e.placeholder,
|
|
@@ -229,7 +229,7 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
229
229
|
"render-label": o,
|
|
230
230
|
"render-tag": g,
|
|
231
231
|
"virtual-scroll": "",
|
|
232
|
-
"onUpdate:value":
|
|
232
|
+
"onUpdate:value": v
|
|
233
233
|
}, null, 8, [
|
|
234
234
|
"value",
|
|
235
235
|
"options",
|
|
@@ -404,8 +404,8 @@ function Ln(e, t, a, r) {
|
|
|
404
404
|
var l = !a;
|
|
405
405
|
a || (a = {});
|
|
406
406
|
for (var i = -1, o = t.length; ++i < o; ) {
|
|
407
|
-
var g = t[i],
|
|
408
|
-
|
|
407
|
+
var g = t[i], v = r ? r(a[g], e[g], g, a, e) : void 0;
|
|
408
|
+
v === void 0 && (v = e[g]), l ? ir(a, g, v) : ot(a, g, v);
|
|
409
409
|
}
|
|
410
410
|
return a;
|
|
411
411
|
}
|
|
@@ -459,8 +459,8 @@ var it = Fo, yr = typeof exports == "object" && exports && !exports.nodeType &&
|
|
|
459
459
|
}
|
|
460
460
|
})(), be = jo, $t = be && be.isTypedArray, Io = $t ? it($t) : Do, No = Io, Bo = Object.prototype.hasOwnProperty;
|
|
461
461
|
function zo(e, t) {
|
|
462
|
-
var a = Ce(e), r = !a && to(e), l = !a && !r && pr(e), i = !a && !r && !l && No(e), o = a || r || l || i, g = o ? Yn(e.length, String) : [],
|
|
463
|
-
for (var
|
|
462
|
+
var a = Ce(e), r = !a && to(e), l = !a && !r && pr(e), i = !a && !r && !l && No(e), o = a || r || l || i, g = o ? Yn(e.length, String) : [], v = g.length;
|
|
463
|
+
for (var y in e) (t || Bo.call(e, y)) && !(o && (y == "length" || l && (y == "offset" || y == "parent") || i && (y == "buffer" || y == "byteLength" || y == "byteOffset") || lr(y, v))) && g.push(y);
|
|
464
464
|
return g;
|
|
465
465
|
}
|
|
466
466
|
var gr = zo;
|
|
@@ -876,20 +876,20 @@ var Ms = Us, Lt = be && be.isSet, Es = Lt ? it(Lt) : Ms, Ls = Es, Ks = 1, Gs = 2
|
|
|
876
876
|
z[kr] = z[Hs] = z[nu] = z[ou] = z[qs] = z[Ws] = z[lu] = z[iu] = z[su] = z[uu] = z[du] = z[Qs] = z[Xs] = z[$r] = z[Zs] = z[eu] = z[tu] = z[ru] = z[fu] = z[cu] = z[pu] = z[yu] = !0;
|
|
877
877
|
z[Ys] = z[Sr] = z[au] = !1;
|
|
878
878
|
function Ie(e, t, a, r, l, i) {
|
|
879
|
-
var o, g = t & Ks,
|
|
879
|
+
var o, g = t & Ks, v = t & Gs, y = t & Vs;
|
|
880
880
|
if (a && (o = l ? a(e, r, l, i) : a(e)), o !== void 0) return o;
|
|
881
881
|
if (!fe(e)) return e;
|
|
882
882
|
var p = Ce(e);
|
|
883
883
|
if (p) {
|
|
884
884
|
if (o = Xi(e), !g) return Dn(e, o);
|
|
885
885
|
} else {
|
|
886
|
-
var
|
|
886
|
+
var w = pt(e), S = w == Sr || w == Js;
|
|
887
887
|
if (pr(e)) return ki(e, g);
|
|
888
|
-
if (
|
|
889
|
-
if (o =
|
|
888
|
+
if (w == $r || w == kr || S && !l) {
|
|
889
|
+
if (o = v || S ? {} : Fs(e), !g) return v ? Ni(e, Ti(o, e)) : Fi(e, wi(o, e));
|
|
890
890
|
} else {
|
|
891
|
-
if (!z[
|
|
892
|
-
o = Os(e,
|
|
891
|
+
if (!z[w]) return l ? e : {};
|
|
892
|
+
o = Os(e, w, g);
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
895
|
i || (i = new hi());
|
|
@@ -897,12 +897,12 @@ function Ie(e, t, a, r, l, i) {
|
|
|
897
897
|
if (T) return T;
|
|
898
898
|
i.set(e, o), Ls(e) ? e.forEach(function(L) {
|
|
899
899
|
o.add(Ie(L, t, a, L, e, i));
|
|
900
|
-
}) : zs(e) && e.forEach(function(L,
|
|
901
|
-
o.set(
|
|
900
|
+
}) : zs(e) && e.forEach(function(L, k) {
|
|
901
|
+
o.set(k, Ie(L, t, a, k, e, i));
|
|
902
902
|
});
|
|
903
|
-
var M = p ? void 0 : (
|
|
904
|
-
return In(M || e, function(L,
|
|
905
|
-
M && (
|
|
903
|
+
var M = p ? void 0 : (y ? v ? Mi : Ri : v ? ut : st)(e);
|
|
904
|
+
return In(M || e, function(L, k) {
|
|
905
|
+
M && (k = L, L = e[k]), ot(o, k, Ie(L, t, a, k, e, i));
|
|
906
906
|
}), o;
|
|
907
907
|
}
|
|
908
908
|
var gu = Ie, vu = 1, mu = 4;
|
|
@@ -914,13 +914,13 @@ function hu(e, t, a, r) {
|
|
|
914
914
|
if (!fe(e)) return e;
|
|
915
915
|
t = mr(t, e);
|
|
916
916
|
for (var l = -1, i = t.length, o = i - 1, g = e; g != null && ++l < i; ) {
|
|
917
|
-
var
|
|
918
|
-
if (
|
|
917
|
+
var v = br(t[l]), y = a;
|
|
918
|
+
if (v === "__proto__" || v === "constructor" || v === "prototype") return e;
|
|
919
919
|
if (l != o) {
|
|
920
|
-
var p = g[
|
|
921
|
-
|
|
920
|
+
var p = g[v];
|
|
921
|
+
y = r ? r(p, v, g) : void 0, y === void 0 && (y = fe(p) ? p : lr(t[l + 1]) ? [] : {});
|
|
922
922
|
}
|
|
923
|
-
ot(g,
|
|
923
|
+
ot(g, v, y), g = g[v];
|
|
924
924
|
}
|
|
925
925
|
return e;
|
|
926
926
|
}
|
|
@@ -988,21 +988,21 @@ var xu = /* @__PURE__ */ he({
|
|
|
988
988
|
"validate"
|
|
989
989
|
], ["update:model"]),
|
|
990
990
|
setup(e, { expose: t, emit: a }) {
|
|
991
|
-
const r = e, l = a, i = Ca(e, "model"), o = re(), g = re({}),
|
|
992
|
-
let
|
|
991
|
+
const r = e, l = a, i = Ca(e, "model"), o = re(), g = re({}), v = re();
|
|
992
|
+
let y = !1;
|
|
993
993
|
Jt(() => {
|
|
994
|
-
!
|
|
994
|
+
!y && i.value && (v.value = Kt(i.value), y = !0);
|
|
995
995
|
});
|
|
996
996
|
const p = K(() => ({
|
|
997
997
|
type: "primary",
|
|
998
998
|
text: "搜索",
|
|
999
999
|
loading: r.loading,
|
|
1000
|
-
renderIcon: () =>
|
|
1000
|
+
renderIcon: () => x(H, null, { default: () => x(Aa) }),
|
|
1001
1001
|
...r.submitButton
|
|
1002
|
-
})),
|
|
1002
|
+
})), w = K(() => ({
|
|
1003
1003
|
type: "default",
|
|
1004
1004
|
text: "重置",
|
|
1005
|
-
renderIcon: () =>
|
|
1005
|
+
renderIcon: () => x(H, null, { default: () => x(tr) }),
|
|
1006
1006
|
...r.resetButton
|
|
1007
1007
|
})), S = K(() => r.schemas.filter((n) => !(typeof n.hidden == "function" ? n.hidden(i.value) : n.hidden))), T = K(() => ({
|
|
1008
1008
|
disabled: r.disabled ?? !1,
|
|
@@ -1025,13 +1025,13 @@ var xu = /* @__PURE__ */ he({
|
|
|
1025
1025
|
...r.gridProps,
|
|
1026
1026
|
responsive: "self"
|
|
1027
1027
|
})), L = (n) => {
|
|
1028
|
-
const
|
|
1029
|
-
return
|
|
1030
|
-
},
|
|
1031
|
-
const
|
|
1032
|
-
if (
|
|
1028
|
+
const b = n.type || "input";
|
|
1029
|
+
return b === "custom" ? n.component : Ia[b];
|
|
1030
|
+
}, k = (n) => typeof n.disabled == "function" ? n.disabled(i.value) : n.disabled, D = (n) => {
|
|
1031
|
+
const b = { ...n.props };
|
|
1032
|
+
if (b.placeholder !== void 0) return b;
|
|
1033
1033
|
const I = typeof n.label == "string" ? n.label : "";
|
|
1034
|
-
if (!I) return
|
|
1034
|
+
if (!I) return b;
|
|
1035
1035
|
const q = n.type || "input", ee = [
|
|
1036
1036
|
"input",
|
|
1037
1037
|
"textarea",
|
|
@@ -1045,50 +1045,50 @@ var xu = /* @__PURE__ */ he({
|
|
|
1045
1045
|
"time-picker",
|
|
1046
1046
|
"color-picker"
|
|
1047
1047
|
];
|
|
1048
|
-
return ee.includes(q) ?
|
|
1048
|
+
return ee.includes(q) ? b.placeholder = `请输入${I}` : Z.includes(q) && (b.placeholder = `请选择${I}`), b;
|
|
1049
1049
|
}, G = (n) => {
|
|
1050
|
-
const
|
|
1050
|
+
const b = n.type === "custom" ? "modelValue" : "value";
|
|
1051
1051
|
return {
|
|
1052
|
-
[n.modelPropName ||
|
|
1052
|
+
[n.modelPropName || b]: _(n.name),
|
|
1053
1053
|
...D(n),
|
|
1054
|
-
disabled:
|
|
1054
|
+
disabled: k(n),
|
|
1055
1055
|
ref: V(n)
|
|
1056
1056
|
};
|
|
1057
1057
|
}, f = (n) => {
|
|
1058
|
-
const
|
|
1059
|
-
return { [n.modelEventName || `update:${I}`]: (q) =>
|
|
1058
|
+
const b = n.type === "custom" ? "modelValue" : "value", I = n.modelPropName || b;
|
|
1059
|
+
return { [n.modelEventName || `update:${I}`]: (q) => m(n.name, q) };
|
|
1060
1060
|
}, N = (n) => {
|
|
1061
1061
|
if (!n) return {};
|
|
1062
|
-
const
|
|
1063
|
-
return delete
|
|
1062
|
+
const b = { ...n };
|
|
1063
|
+
return delete b.options, delete b.labelField, delete b.valueField, b;
|
|
1064
1064
|
}, u = (n) => {
|
|
1065
1065
|
if (!n) return {};
|
|
1066
|
-
const
|
|
1067
|
-
return delete
|
|
1068
|
-
},
|
|
1069
|
-
Tu(i.value, n,
|
|
1070
|
-
}, F = (n,
|
|
1071
|
-
|
|
1066
|
+
const b = { ...n };
|
|
1067
|
+
return delete b.text, b;
|
|
1068
|
+
}, _ = (n) => Gt(i.value, n), m = (n, b) => {
|
|
1069
|
+
Tu(i.value, n, b);
|
|
1070
|
+
}, F = (n, b) => {
|
|
1071
|
+
b ? g.value[n] = b : delete g.value[n];
|
|
1072
1072
|
}, V = (n) => {
|
|
1073
|
-
const
|
|
1073
|
+
const b = n.name;
|
|
1074
1074
|
return n.ref ? typeof n.ref == "function" ? (I) => {
|
|
1075
|
-
F(
|
|
1075
|
+
F(b, I), n.ref(I);
|
|
1076
1076
|
} : (I) => {
|
|
1077
|
-
F(
|
|
1078
|
-
} : (I) => F(
|
|
1077
|
+
F(b, I), n.ref.value = I;
|
|
1078
|
+
} : (I) => F(b, I);
|
|
1079
1079
|
}, O = (n) => {
|
|
1080
|
-
let
|
|
1080
|
+
let b = typeof n.rule == "function" ? n.rule(i.value) : n.rule;
|
|
1081
1081
|
const I = !n.noRequired && !r.disableDefaultRequired;
|
|
1082
1082
|
if (I) {
|
|
1083
1083
|
const q = {
|
|
1084
1084
|
validator: (ee, Z) => Z == null || Z === "" ? /* @__PURE__ */ new Error(`${typeof n.label == "string" ? n.label : "此项"}不能为空`) : Array.isArray(Z) && Z.length === 0 ? /* @__PURE__ */ new Error(`${typeof n.label == "string" ? n.label : "此项"}不能为空`) : typeof Z == "object" && Z !== null && !Array.isArray(Z) && Object.keys(Z).length === 0 ? /* @__PURE__ */ new Error(`${typeof n.label == "string" ? n.label : "此项"}不能为空`) : !0,
|
|
1085
1085
|
trigger: "blur"
|
|
1086
1086
|
};
|
|
1087
|
-
|
|
1087
|
+
b ? b = Array.isArray(b) ? [q, ...b] : [q, b] : b = q;
|
|
1088
1088
|
}
|
|
1089
1089
|
return {
|
|
1090
1090
|
label: typeof n.label == "string" ? n.label : void 0,
|
|
1091
|
-
rule:
|
|
1091
|
+
rule: b,
|
|
1092
1092
|
showRequireMark: I,
|
|
1093
1093
|
contentClass: n.contentClass,
|
|
1094
1094
|
contentStyle: n.contentStyle,
|
|
@@ -1120,11 +1120,11 @@ var xu = /* @__PURE__ */ he({
|
|
|
1120
1120
|
}, ge = (n) => {
|
|
1121
1121
|
if (typeof n == "number" || typeof n == "string") return n;
|
|
1122
1122
|
if (typeof n == "object") {
|
|
1123
|
-
const
|
|
1123
|
+
const b = [];
|
|
1124
1124
|
return Object.entries(ye).forEach(([I, q]) => {
|
|
1125
1125
|
const ee = n[I];
|
|
1126
|
-
ee !== void 0 &&
|
|
1127
|
-
}),
|
|
1126
|
+
ee !== void 0 && b.push(`${q}:${ee}`);
|
|
1127
|
+
}), b.length === 0 ? 24 : b.join(" ");
|
|
1128
1128
|
}
|
|
1129
1129
|
return 24;
|
|
1130
1130
|
}, gt = (n) => ({
|
|
@@ -1132,14 +1132,14 @@ var xu = /* @__PURE__ */ he({
|
|
|
1132
1132
|
offset: n.offset
|
|
1133
1133
|
}), $ = async (...n) => {
|
|
1134
1134
|
await o.value.validate(...n);
|
|
1135
|
-
}, A = async (n,
|
|
1135
|
+
}, A = async (n, b) => {
|
|
1136
1136
|
const I = Array.isArray(n) ? n : [n];
|
|
1137
|
-
await o.value.validate(
|
|
1137
|
+
await o.value.validate(b, (q) => I.some((ee) => q.key === ee));
|
|
1138
1138
|
}, j = () => o.value?.restoreValidation(), ve = () => {
|
|
1139
|
-
if (j(),
|
|
1140
|
-
const n = Kt(
|
|
1141
|
-
(/* @__PURE__ */ new Set([...Object.keys(
|
|
1142
|
-
|
|
1139
|
+
if (j(), v.value !== void 0) {
|
|
1140
|
+
const n = Kt(v.value), b = i.value;
|
|
1141
|
+
(/* @__PURE__ */ new Set([...Object.keys(b), ...Object.keys(n)])).forEach((I) => {
|
|
1142
|
+
b[I] = I in n ? n[I] : null;
|
|
1143
1143
|
});
|
|
1144
1144
|
}
|
|
1145
1145
|
l("reset");
|
|
@@ -1165,14 +1165,14 @@ var xu = /* @__PURE__ */ he({
|
|
|
1165
1165
|
};
|
|
1166
1166
|
},
|
|
1167
1167
|
getFieldValue: (n) => Gt(i.value, n),
|
|
1168
|
-
setFieldValue: (n,
|
|
1168
|
+
setFieldValue: (n, b) => m(n, b),
|
|
1169
1169
|
resetFields: ve,
|
|
1170
1170
|
getFormItemInst: (n) => o.value?.getFormItemInst?.(n),
|
|
1171
1171
|
getFieldComponentRef: (n) => g.value[n],
|
|
1172
1172
|
getFieldComponentRefs: () => ({ ...g.value })
|
|
1173
|
-
}), (n,
|
|
1173
|
+
}), (n, b) => {
|
|
1174
1174
|
const I = Xr, q = ea, ee = X, Z = Zr, De = Qr;
|
|
1175
|
-
return
|
|
1175
|
+
return h(), Q(te, null, [
|
|
1176
1176
|
U(n.$slots, "header", { model: i.value }, void 0, !0),
|
|
1177
1177
|
C(c(tt), { show: r.loading }, {
|
|
1178
1178
|
default: s(() => [C(De, J({
|
|
@@ -1181,30 +1181,30 @@ var xu = /* @__PURE__ */ he({
|
|
|
1181
1181
|
model: i.value
|
|
1182
1182
|
}, T.value), {
|
|
1183
1183
|
default: s(() => [C(Z, le(ue(M.value)), {
|
|
1184
|
-
default: s(() => [(
|
|
1184
|
+
default: s(() => [(h(!0), Q(te, null, ne(S.value, (d) => (h(), P(q, J({ key: d.name }, { ref_for: !0 }, gt(d)), {
|
|
1185
1185
|
default: s(() => [d.type === "slot" ? U(n.$slots, d.slot || d.name, {
|
|
1186
1186
|
key: 0,
|
|
1187
1187
|
model: i.value,
|
|
1188
1188
|
schema: d
|
|
1189
|
-
}, void 0, !0) : (
|
|
1189
|
+
}, void 0, !0) : (h(), P(I, J({
|
|
1190
1190
|
key: 1,
|
|
1191
1191
|
path: d.name
|
|
1192
1192
|
}, { ref_for: !0 }, O(d)), de({
|
|
1193
1193
|
default: s(() => [U(n.$slots, `field-${d.name}`, {
|
|
1194
1194
|
model: i.value,
|
|
1195
1195
|
schema: d,
|
|
1196
|
-
value:
|
|
1197
|
-
setValue: (B) =>
|
|
1198
|
-
}, () => [d.type === "radio-group" && d.props?.options ? (
|
|
1196
|
+
value: _(d.name),
|
|
1197
|
+
setValue: (B) => m(d.name, B)
|
|
1198
|
+
}, () => [d.type === "radio-group" && d.props?.options ? (h(), P(c(Ne), J({
|
|
1199
1199
|
key: 0,
|
|
1200
|
-
value:
|
|
1201
|
-
"onUpdate:value": (B) =>
|
|
1200
|
+
value: _(d.name),
|
|
1201
|
+
"onUpdate:value": (B) => m(d.name, B)
|
|
1202
1202
|
}, { ref_for: !0 }, N(d.props), {
|
|
1203
1203
|
ref_for: !0,
|
|
1204
1204
|
ref: V(d)
|
|
1205
1205
|
}), {
|
|
1206
1206
|
default: s(() => [C(c(ae), null, {
|
|
1207
|
-
default: s(() => [(
|
|
1207
|
+
default: s(() => [(h(!0), Q(te, null, ne(d.props.options, (B) => (h(), P(c(sa), {
|
|
1208
1208
|
key: B[d.props.valueField || "value"],
|
|
1209
1209
|
value: B[d.props.valueField || "value"],
|
|
1210
1210
|
disabled: B.disabled
|
|
@@ -1215,15 +1215,15 @@ var xu = /* @__PURE__ */ he({
|
|
|
1215
1215
|
_: 2
|
|
1216
1216
|
}, 1024)]),
|
|
1217
1217
|
_: 2
|
|
1218
|
-
}, 1040, ["value", "onUpdate:value"])) : d.type === "radio-button-group" && d.props?.options ? (
|
|
1218
|
+
}, 1040, ["value", "onUpdate:value"])) : d.type === "radio-button-group" && d.props?.options ? (h(), P(c(Ne), J({
|
|
1219
1219
|
key: 1,
|
|
1220
|
-
value:
|
|
1221
|
-
"onUpdate:value": (B) =>
|
|
1220
|
+
value: _(d.name),
|
|
1221
|
+
"onUpdate:value": (B) => m(d.name, B)
|
|
1222
1222
|
}, { ref_for: !0 }, N(d.props), {
|
|
1223
1223
|
ref_for: !0,
|
|
1224
1224
|
ref: V(d)
|
|
1225
1225
|
}), {
|
|
1226
|
-
default: s(() => [(
|
|
1226
|
+
default: s(() => [(h(!0), Q(te, null, ne(d.props.options, (B) => (h(), P(c(ua), {
|
|
1227
1227
|
key: B[d.props.valueField || "value"],
|
|
1228
1228
|
value: B[d.props.valueField || "value"],
|
|
1229
1229
|
disabled: B.disabled
|
|
@@ -1232,16 +1232,16 @@ var xu = /* @__PURE__ */ he({
|
|
|
1232
1232
|
_: 2
|
|
1233
1233
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
1234
1234
|
_: 2
|
|
1235
|
-
}, 1040, ["value", "onUpdate:value"])) : d.type === "checkbox-group" && d.props?.options ? (
|
|
1235
|
+
}, 1040, ["value", "onUpdate:value"])) : d.type === "checkbox-group" && d.props?.options ? (h(), P(c(et), J({
|
|
1236
1236
|
key: 2,
|
|
1237
|
-
value:
|
|
1238
|
-
"onUpdate:value": (B) =>
|
|
1237
|
+
value: _(d.name),
|
|
1238
|
+
"onUpdate:value": (B) => m(d.name, B)
|
|
1239
1239
|
}, { ref_for: !0 }, N(d.props), {
|
|
1240
1240
|
ref_for: !0,
|
|
1241
1241
|
ref: V(d)
|
|
1242
1242
|
}), {
|
|
1243
1243
|
default: s(() => [C(c(ae), null, {
|
|
1244
|
-
default: s(() => [(
|
|
1244
|
+
default: s(() => [(h(!0), Q(te, null, ne(d.props.options, (B) => (h(), P(c(Ht), {
|
|
1245
1245
|
key: B[d.props.valueField || "value"],
|
|
1246
1246
|
value: B[d.props.valueField || "value"],
|
|
1247
1247
|
disabled: B.disabled
|
|
@@ -1252,25 +1252,25 @@ var xu = /* @__PURE__ */ he({
|
|
|
1252
1252
|
_: 2
|
|
1253
1253
|
}, 1024)]),
|
|
1254
1254
|
_: 2
|
|
1255
|
-
}, 1040, ["value", "onUpdate:value"])) : d.type === "switch" ? (
|
|
1255
|
+
}, 1040, ["value", "onUpdate:value"])) : d.type === "switch" ? (h(), P(me(L(d)), J({
|
|
1256
1256
|
key: 3,
|
|
1257
|
-
value:
|
|
1258
|
-
"onUpdate:value": (B) =>
|
|
1257
|
+
value: _(d.name),
|
|
1258
|
+
"onUpdate:value": (B) => m(d.name, B)
|
|
1259
1259
|
}, { ref_for: !0 }, d.props, {
|
|
1260
|
-
disabled:
|
|
1260
|
+
disabled: k(d),
|
|
1261
1261
|
ref_for: !0,
|
|
1262
1262
|
ref: V(d)
|
|
1263
1263
|
}), null, 16, [
|
|
1264
1264
|
"value",
|
|
1265
1265
|
"onUpdate:value",
|
|
1266
1266
|
"disabled"
|
|
1267
|
-
])) : d.type === "image-upload" || d.type === "file-upload" ? (
|
|
1267
|
+
])) : d.type === "image-upload" || d.type === "file-upload" ? (h(), P(me(L(d)), J({
|
|
1268
1268
|
key: 4,
|
|
1269
|
-
"file-list":
|
|
1270
|
-
"onUpdate:fileList": (B) =>
|
|
1269
|
+
"file-list": _(d.name) || [],
|
|
1270
|
+
"onUpdate:fileList": (B) => m(d.name, B),
|
|
1271
1271
|
"upload-type": d.type === "image-upload" ? "image" : "file"
|
|
1272
1272
|
}, { ref_for: !0 }, d.props, {
|
|
1273
|
-
disabled:
|
|
1273
|
+
disabled: k(d),
|
|
1274
1274
|
ref_for: !0,
|
|
1275
1275
|
ref: V(d)
|
|
1276
1276
|
}), null, 16, [
|
|
@@ -1278,14 +1278,14 @@ var xu = /* @__PURE__ */ he({
|
|
|
1278
1278
|
"onUpdate:fileList",
|
|
1279
1279
|
"upload-type",
|
|
1280
1280
|
"disabled"
|
|
1281
|
-
])) : (
|
|
1281
|
+
])) : (h(), P(me(L(d)), J({
|
|
1282
1282
|
key: 5,
|
|
1283
1283
|
ref_for: !0
|
|
1284
1284
|
}, G(d), wa(f(d))), null, 16))], !0)]),
|
|
1285
1285
|
_: 2
|
|
1286
1286
|
}, [typeof d.label == "function" || d.help ? {
|
|
1287
1287
|
name: "label",
|
|
1288
|
-
fn: s(() => [typeof d.label == "function" ? (
|
|
1288
|
+
fn: s(() => [typeof d.label == "function" ? (h(), P(me(d.label), { key: 0 })) : (h(), Q(te, { key: 1 }, [E(W(d.label), 1)], 64)), d.help ? (h(), P(c(Be), {
|
|
1289
1289
|
key: 2,
|
|
1290
1290
|
trigger: "hover"
|
|
1291
1291
|
}, {
|
|
@@ -1302,7 +1302,7 @@ var xu = /* @__PURE__ */ he({
|
|
|
1302
1302
|
key: "0"
|
|
1303
1303
|
} : void 0]), 1040, ["path"]))]),
|
|
1304
1304
|
_: 2
|
|
1305
|
-
}, 1040))), 128)), r.showFooter ? (
|
|
1305
|
+
}, 1040))), 128)), r.showFooter ? (h(), P(q, {
|
|
1306
1306
|
key: 0,
|
|
1307
1307
|
span: r.footerSpan
|
|
1308
1308
|
}, {
|
|
@@ -1312,15 +1312,15 @@ var xu = /* @__PURE__ */ he({
|
|
|
1312
1312
|
reset: ve
|
|
1313
1313
|
}, () => [C(c(ae), { justify: r.footerAlign }, {
|
|
1314
1314
|
default: s(() => [
|
|
1315
|
-
|
|
1316
|
-
default: s(() => [E(W(
|
|
1315
|
+
w.value.hidden ? Y("", !0) : (h(), P(ee, J({ key: 0 }, u(w.value), { onClick: Ge }), {
|
|
1316
|
+
default: s(() => [E(W(w.value.text), 1)]),
|
|
1317
1317
|
_: 1
|
|
1318
1318
|
}, 16)),
|
|
1319
|
-
p.value.hidden ? Y("", !0) : (
|
|
1319
|
+
p.value.hidden ? Y("", !0) : (h(), P(ee, J({ key: 1 }, u(p.value), { onClick: Ke }), {
|
|
1320
1320
|
default: s(() => [E(W(p.value.text), 1)]),
|
|
1321
1321
|
_: 1
|
|
1322
1322
|
}, 16)),
|
|
1323
|
-
(
|
|
1323
|
+
(h(!0), Q(te, null, ne(r.extraButtons, (d) => (h(), P(ee, {
|
|
1324
1324
|
key: d.text,
|
|
1325
1325
|
type: d.type,
|
|
1326
1326
|
size: d.size,
|
|
@@ -1356,25 +1356,25 @@ var xu = /* @__PURE__ */ he({
|
|
|
1356
1356
|
return a;
|
|
1357
1357
|
}, Le = /* @__PURE__ */ Ar(xu, [["__scopeId", "data-v-5f266062"]]);
|
|
1358
1358
|
function ku(e) {
|
|
1359
|
-
const { maxVisible: t = -1, buttons: a = [], showView: r = !1, showEdit: l = !0, showDelete: i = !0, viewConfig: o, editConfig: g, deleteConfig:
|
|
1359
|
+
const { maxVisible: t = -1, buttons: a = [], showView: r = !1, showEdit: l = !0, showDelete: i = !0, viewConfig: o, editConfig: g, deleteConfig: v, onView: y, onEdit: p, onDelete: w } = e, S = (u, _, m, F) => _ ? u ? typeof u.show == "function" ? u.show(m, F) : u.show !== !1 : !0 : !1, T = (u, _, m) => u ? typeof u.disabled == "function" ? u.disabled(_, m) : u.disabled === !0 : !1, M = (u, _, m) => typeof u.show == "function" ? u.show(_, m) : u.show !== !1, L = (u, _, m) => typeof u.disabled == "function" ? u.disabled(_, m) : u.disabled === !0, k = (u, _, m = "确认操作") => {
|
|
1360
1360
|
if (u) {
|
|
1361
1361
|
if (typeof u == "string") return {
|
|
1362
|
-
title:
|
|
1362
|
+
title: m,
|
|
1363
1363
|
content: u,
|
|
1364
1364
|
type: "warning",
|
|
1365
1365
|
positiveText: "确定",
|
|
1366
1366
|
negativeText: "取消"
|
|
1367
1367
|
};
|
|
1368
1368
|
if (typeof u == "function") {
|
|
1369
|
-
const F = u(
|
|
1369
|
+
const F = u(_);
|
|
1370
1370
|
return typeof F == "string" ? {
|
|
1371
|
-
title:
|
|
1371
|
+
title: m,
|
|
1372
1372
|
content: F,
|
|
1373
1373
|
type: "warning",
|
|
1374
1374
|
positiveText: "确定",
|
|
1375
1375
|
negativeText: "取消"
|
|
1376
1376
|
} : {
|
|
1377
|
-
title:
|
|
1377
|
+
title: m,
|
|
1378
1378
|
type: "warning",
|
|
1379
1379
|
positiveText: "确定",
|
|
1380
1380
|
negativeText: "取消",
|
|
@@ -1382,116 +1382,116 @@ function ku(e) {
|
|
|
1382
1382
|
};
|
|
1383
1383
|
}
|
|
1384
1384
|
return {
|
|
1385
|
-
title:
|
|
1385
|
+
title: m,
|
|
1386
1386
|
type: "warning",
|
|
1387
1387
|
positiveText: "确定",
|
|
1388
1388
|
negativeText: "取消",
|
|
1389
1389
|
...u
|
|
1390
1390
|
};
|
|
1391
1391
|
}
|
|
1392
|
-
}, D = (u,
|
|
1393
|
-
const { dialog:
|
|
1392
|
+
}, D = (u, _) => {
|
|
1393
|
+
const { dialog: m } = va(["dialog"]), F = {
|
|
1394
1394
|
...u,
|
|
1395
|
-
onPositiveClick: () => (
|
|
1395
|
+
onPositiveClick: () => (_(), !0)
|
|
1396
1396
|
};
|
|
1397
1397
|
switch (u.type) {
|
|
1398
1398
|
case "info":
|
|
1399
|
-
|
|
1399
|
+
m.info(F);
|
|
1400
1400
|
break;
|
|
1401
1401
|
case "success":
|
|
1402
|
-
|
|
1402
|
+
m.success(F);
|
|
1403
1403
|
break;
|
|
1404
1404
|
case "error":
|
|
1405
|
-
|
|
1405
|
+
m.error(F);
|
|
1406
1406
|
break;
|
|
1407
1407
|
case "warning":
|
|
1408
1408
|
default:
|
|
1409
|
-
|
|
1409
|
+
m.warning(F);
|
|
1410
1410
|
break;
|
|
1411
1411
|
}
|
|
1412
1412
|
}, G = (u) => {
|
|
1413
|
-
const
|
|
1413
|
+
const _ = () => {
|
|
1414
1414
|
u.confirm ? D(u.confirm, u.onClick) : u.onClick();
|
|
1415
1415
|
};
|
|
1416
|
-
return
|
|
1416
|
+
return x(X, {
|
|
1417
1417
|
type: u.type,
|
|
1418
1418
|
size: "small",
|
|
1419
1419
|
disabled: u.disabled,
|
|
1420
|
-
onClick:
|
|
1420
|
+
onClick: _,
|
|
1421
1421
|
renderIcon: u.icon
|
|
1422
1422
|
}, { default: () => u.label });
|
|
1423
1423
|
}, f = (u) => {
|
|
1424
|
-
const
|
|
1424
|
+
const _ = u.map((F) => ({
|
|
1425
1425
|
label: F.label,
|
|
1426
1426
|
key: F.key,
|
|
1427
1427
|
disabled: F.disabled
|
|
1428
1428
|
}));
|
|
1429
|
-
return
|
|
1430
|
-
options:
|
|
1429
|
+
return x(Wr, {
|
|
1430
|
+
options: _,
|
|
1431
1431
|
trigger: "click",
|
|
1432
1432
|
onSelect: (F) => {
|
|
1433
1433
|
const V = u.find((O) => O.key === F);
|
|
1434
1434
|
V && (V.confirm ? D(V.confirm, V.onClick) : V.onClick());
|
|
1435
1435
|
}
|
|
1436
|
-
}, { default: () =>
|
|
1436
|
+
}, { default: () => x(X, { size: "small" }, { default: () => "更多" }) });
|
|
1437
1437
|
};
|
|
1438
1438
|
return {
|
|
1439
|
-
renderActions: (u,
|
|
1440
|
-
const
|
|
1441
|
-
if (S(o, r, u,
|
|
1439
|
+
renderActions: (u, _) => {
|
|
1440
|
+
const m = [];
|
|
1441
|
+
if (S(o, r, u, _) && m.push({
|
|
1442
1442
|
key: "__view__",
|
|
1443
1443
|
label: o?.label || "查看",
|
|
1444
1444
|
type: "info",
|
|
1445
|
-
disabled: T(o, u,
|
|
1446
|
-
icon: () =>
|
|
1447
|
-
onClick: () =>
|
|
1445
|
+
disabled: T(o, u, _),
|
|
1446
|
+
icon: () => x(H, null, { default: () => x(ka) }),
|
|
1447
|
+
onClick: () => y?.({
|
|
1448
1448
|
row: u,
|
|
1449
|
-
index:
|
|
1449
|
+
index: _
|
|
1450
1450
|
})
|
|
1451
|
-
}), S(g, l, u,
|
|
1451
|
+
}), S(g, l, u, _) && m.push({
|
|
1452
1452
|
key: "__edit__",
|
|
1453
1453
|
label: g?.label || "编辑",
|
|
1454
1454
|
type: "primary",
|
|
1455
|
-
disabled: T(g, u,
|
|
1456
|
-
icon: () =>
|
|
1455
|
+
disabled: T(g, u, _),
|
|
1456
|
+
icon: () => x(H, null, { default: () => x(Ta) }),
|
|
1457
1457
|
onClick: () => p?.({
|
|
1458
1458
|
row: u,
|
|
1459
|
-
index:
|
|
1459
|
+
index: _
|
|
1460
1460
|
})
|
|
1461
|
-
}), S(
|
|
1461
|
+
}), S(v, i, u, _) && m.push({
|
|
1462
1462
|
key: "__delete__",
|
|
1463
|
-
label:
|
|
1463
|
+
label: v?.label || "删除",
|
|
1464
1464
|
type: "error",
|
|
1465
|
-
disabled: T(
|
|
1466
|
-
confirm:
|
|
1465
|
+
disabled: T(v, u, _),
|
|
1466
|
+
confirm: k(v?.confirm, u, "确认删除") || {
|
|
1467
1467
|
title: "确认删除",
|
|
1468
1468
|
content: "确定删除此记录吗?",
|
|
1469
1469
|
type: "warning",
|
|
1470
1470
|
positiveText: "确定",
|
|
1471
1471
|
negativeText: "取消"
|
|
1472
1472
|
},
|
|
1473
|
-
icon: () =>
|
|
1474
|
-
onClick: () =>
|
|
1473
|
+
icon: () => x(H, null, { default: () => x(Oa) }),
|
|
1474
|
+
onClick: () => w?.({
|
|
1475
1475
|
row: u,
|
|
1476
|
-
index:
|
|
1476
|
+
index: _
|
|
1477
1477
|
})
|
|
1478
1478
|
}), a.forEach((O) => {
|
|
1479
|
-
M(O, u,
|
|
1479
|
+
M(O, u, _) && m.push({
|
|
1480
1480
|
key: O.key,
|
|
1481
1481
|
label: O.label,
|
|
1482
1482
|
type: O.type || "default",
|
|
1483
|
-
disabled: L(O, u,
|
|
1484
|
-
confirm:
|
|
1483
|
+
disabled: L(O, u, _),
|
|
1484
|
+
confirm: k(O.confirm, u, "确认操作"),
|
|
1485
1485
|
icon: O.icon,
|
|
1486
|
-
onClick: () => O.onClick?.(u,
|
|
1486
|
+
onClick: () => O.onClick?.(u, _)
|
|
1487
1487
|
});
|
|
1488
|
-
}), t === -1 ||
|
|
1488
|
+
}), t === -1 || m.length <= t) return x(ae, {
|
|
1489
1489
|
size: "small",
|
|
1490
1490
|
wrap: !1
|
|
1491
|
-
}, () =>
|
|
1492
|
-
if (t === 0) return f(
|
|
1493
|
-
const F =
|
|
1494
|
-
return
|
|
1491
|
+
}, () => m.map((O) => G(O)));
|
|
1492
|
+
if (t === 0) return f(m);
|
|
1493
|
+
const F = m.slice(0, t), V = m.slice(t);
|
|
1494
|
+
return x(ae, {
|
|
1495
1495
|
size: "small",
|
|
1496
1496
|
wrap: !1
|
|
1497
1497
|
}, () => [...F.map((O) => G(O)), f(V)]);
|
|
@@ -1513,7 +1513,7 @@ var Su = (e) => {
|
|
|
1513
1513
|
if (!e) return "-";
|
|
1514
1514
|
const r = String(e), l = a?.newWindow !== !1;
|
|
1515
1515
|
let i;
|
|
1516
|
-
return a?.text ? i = typeof a.text == "function" ? a.text(t) : a.text : i = r,
|
|
1516
|
+
return a?.text ? i = typeof a.text == "function" ? a.text(t) : a.text : i = r, x(X, {
|
|
1517
1517
|
text: !0,
|
|
1518
1518
|
type: "primary",
|
|
1519
1519
|
onClick: () => {
|
|
@@ -1521,12 +1521,12 @@ var Su = (e) => {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
}, {
|
|
1523
1523
|
default: () => i,
|
|
1524
|
-
icon: () =>
|
|
1524
|
+
icon: () => x(H, { size: 14 }, () => x($a))
|
|
1525
1525
|
});
|
|
1526
1526
|
}, Dr = (e, t) => {
|
|
1527
1527
|
if (!e) return "-";
|
|
1528
1528
|
const a = String(e), r = t?.width ?? 60, l = t?.height ?? 60, i = t?.radius ?? 4, o = t?.fallback;
|
|
1529
|
-
return
|
|
1529
|
+
return x(ta, {
|
|
1530
1530
|
src: a,
|
|
1531
1531
|
width: typeof r == "number" ? r : void 0,
|
|
1532
1532
|
height: typeof l == "number" ? l : void 0,
|
|
@@ -1546,13 +1546,13 @@ var Su = (e) => {
|
|
|
1546
1546
|
const o = document.createElement("a");
|
|
1547
1547
|
o.href = r, o.download = l, o.target = "_blank", o.rel = "noopener noreferrer", document.body.appendChild(o), o.click(), document.body.removeChild(o);
|
|
1548
1548
|
};
|
|
1549
|
-
return
|
|
1550
|
-
trigger: () =>
|
|
1549
|
+
return x(Be, { trigger: "hover" }, {
|
|
1550
|
+
trigger: () => x(X, {
|
|
1551
1551
|
text: !0,
|
|
1552
1552
|
type: "primary",
|
|
1553
1553
|
onClick: i
|
|
1554
1554
|
}, {
|
|
1555
|
-
default: () =>
|
|
1555
|
+
default: () => x("span", { style: {
|
|
1556
1556
|
maxWidth: "150px",
|
|
1557
1557
|
overflow: "hidden",
|
|
1558
1558
|
textOverflow: "ellipsis",
|
|
@@ -1560,74 +1560,80 @@ var Su = (e) => {
|
|
|
1560
1560
|
display: "inline-block",
|
|
1561
1561
|
verticalAlign: "middle"
|
|
1562
1562
|
} }, l),
|
|
1563
|
-
icon: () =>
|
|
1563
|
+
icon: () => x(H, { size: 14 }, () => x(xa))
|
|
1564
1564
|
}),
|
|
1565
1565
|
default: () => l
|
|
1566
1566
|
});
|
|
1567
1567
|
}, jr = (e, t) => {
|
|
1568
1568
|
if (!e) return "-";
|
|
1569
1569
|
const a = String(e), r = je[a];
|
|
1570
|
-
return r ?
|
|
1570
|
+
return r ? x(H, {
|
|
1571
1571
|
size: t?.size ?? 20,
|
|
1572
1572
|
color: t?.color
|
|
1573
|
-
}, () =>
|
|
1573
|
+
}, () => x(r)) : a;
|
|
1574
1574
|
}, Ze = (e, t, a = "label", r = "value") => {
|
|
1575
1575
|
if (e == null) return "-";
|
|
1576
|
-
if (!t || t.length === 0) return
|
|
1576
|
+
if (!t || t.length === 0) return x(Ve, { size: "small" }, () => String(e));
|
|
1577
1577
|
const l = t.find((i) => {
|
|
1578
1578
|
const o = i[r];
|
|
1579
1579
|
return o === e || String(o) === String(e) ? !0 : typeof o == "number" && !isNaN(Number(e)) ? o === Number(e) : typeof e == "number" && !isNaN(Number(o)) ? Number(o) === e : typeof o == "boolean" ? o === (e === "true" || e === !0) : typeof e == "boolean" ? (o === "true" || o === !0) === e : !1;
|
|
1580
1580
|
});
|
|
1581
1581
|
if (l) {
|
|
1582
1582
|
const i = l, o = i[a] || i[r] || String(e);
|
|
1583
|
-
return
|
|
1583
|
+
return x(Ve, {
|
|
1584
1584
|
size: "small",
|
|
1585
|
-
...Object.keys(l).reduce((g,
|
|
1585
|
+
...Object.keys(l).reduce((g, v) => (v !== a && v !== r && (g[v] = i[v]), g), {})
|
|
1586
1586
|
}, () => o);
|
|
1587
1587
|
}
|
|
1588
|
-
return
|
|
1588
|
+
return x(Ve, { size: "small" }, () => String(e));
|
|
1589
1589
|
}, Ir = (e, t, a, r) => {
|
|
1590
1590
|
if (!r?.onChange)
|
|
1591
1591
|
return console.warn("Switch column requires onChange function"), "-";
|
|
1592
1592
|
const l = e === (r.valueMap || {
|
|
1593
1593
|
checked: !0,
|
|
1594
1594
|
unchecked: !1
|
|
1595
|
-
}).checked, i =
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1595
|
+
}).checked, i = typeof r.disabled == "function" ? r.disabled(t, a) : r.disabled || !1;
|
|
1596
|
+
return x({ setup() {
|
|
1597
|
+
const o = re(!1), g = re(l), v = async (y) => {
|
|
1598
|
+
if (!(o.value || i))
|
|
1599
|
+
try {
|
|
1600
|
+
o.value = !0;
|
|
1601
|
+
const p = r.onChange(y, t, a);
|
|
1602
|
+
p && typeof p.then == "function" && await p, g.value = y;
|
|
1603
|
+
} catch (p) {
|
|
1604
|
+
console.error("Switch change failed:", p);
|
|
1605
|
+
} finally {
|
|
1606
|
+
o.value = !1;
|
|
1607
|
+
}
|
|
1608
|
+
};
|
|
1609
|
+
return () => {
|
|
1610
|
+
const y = x(Wt, {
|
|
1611
|
+
value: g.value,
|
|
1612
|
+
size: r.size || "medium",
|
|
1613
|
+
disabled: i || o.value,
|
|
1614
|
+
loading: o.value,
|
|
1615
|
+
onUpdateValue: r.confirm ? void 0 : v
|
|
1616
|
+
});
|
|
1617
|
+
if (r.confirm && !i) {
|
|
1618
|
+
const p = typeof r.confirm.text == "function" ? r.confirm.text(!g.value, t) : r.confirm.text;
|
|
1619
|
+
return x(la, {
|
|
1620
|
+
onPositiveClick: () => v(!g.value),
|
|
1621
|
+
positiveText: r.confirm.okText || "确认",
|
|
1622
|
+
negativeText: r.confirm.cancelText || "取消"
|
|
1623
|
+
}, {
|
|
1624
|
+
trigger: () => y,
|
|
1625
|
+
default: () => p
|
|
1626
|
+
});
|
|
1605
1627
|
}
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
loading: i.value,
|
|
1611
|
-
onUpdateValue: r.confirm ? void 0 : m
|
|
1612
|
-
});
|
|
1613
|
-
if (r.confirm) {
|
|
1614
|
-
const p = typeof r.confirm.text == "function" ? r.confirm.text(!o.value, t) : r.confirm.text;
|
|
1615
|
-
return k(la, {
|
|
1616
|
-
onPositiveClick: () => m(!o.value),
|
|
1617
|
-
positiveText: r.confirm.okText || "确认",
|
|
1618
|
-
negativeText: r.confirm.cancelText || "取消"
|
|
1619
|
-
}, {
|
|
1620
|
-
trigger: () => v,
|
|
1621
|
-
default: () => p
|
|
1622
|
-
});
|
|
1623
|
-
}
|
|
1624
|
-
return v;
|
|
1625
|
-
}, Nr = (e, t, a = "label", r = "value") => e == null ? "-" : Array.isArray(e) ? k(ae, {
|
|
1628
|
+
return y;
|
|
1629
|
+
};
|
|
1630
|
+
} });
|
|
1631
|
+
}, Nr = (e, t, a = "label", r = "value") => e == null ? "-" : Array.isArray(e) ? x(ae, {
|
|
1626
1632
|
size: "small",
|
|
1627
1633
|
wrap: !0
|
|
1628
1634
|
}, () => e.map((l, i) => {
|
|
1629
1635
|
const o = Ze(l, t, a, r);
|
|
1630
|
-
return typeof o == "string" ?
|
|
1636
|
+
return typeof o == "string" ? x("span", { key: i }, o) : o;
|
|
1631
1637
|
})) : Ze(e, t, a, r);
|
|
1632
1638
|
const Br = (e, t, a, r) => {
|
|
1633
1639
|
switch (a.columnType || "text") {
|
|
@@ -1672,19 +1678,19 @@ function $u(e) {
|
|
|
1672
1678
|
if (typeof f.title == "function") return "自定义列";
|
|
1673
1679
|
}
|
|
1674
1680
|
return o(f);
|
|
1675
|
-
},
|
|
1681
|
+
}, v = (f) => "defaultVisible" in f ? f.defaultVisible !== !1 : !0, y = (f) => "type" in f && (f.type === "selection" || f.type === "expand") ? !1 : "configurable" in f ? f.configurable !== !1 : !0, p = (f) => f.filter((N) => v(N)).map((N) => o(N)).filter(Boolean), w = re(p(l.value));
|
|
1676
1682
|
Qt(l, (f, N) => {
|
|
1677
|
-
const u = f.map((O) => o(O)).filter(Boolean),
|
|
1678
|
-
|
|
1683
|
+
const u = f.map((O) => o(O)).filter(Boolean), _ = N?.map((O) => o(O)).filter(Boolean) || [], m = u.filter((O) => !_.includes(O)), F = _.filter((O) => !u.includes(O)), V = w.value.filter((O) => !F.includes(O));
|
|
1684
|
+
m.forEach((O) => {
|
|
1679
1685
|
const ye = f.find((ge) => o(ge) === O);
|
|
1680
|
-
ye &&
|
|
1681
|
-
}),
|
|
1686
|
+
ye && v(ye) && V.push(O);
|
|
1687
|
+
}), w.value = V;
|
|
1682
1688
|
});
|
|
1683
|
-
const S = K(() => l.value.filter((f) => o(f) &&
|
|
1689
|
+
const S = K(() => l.value.filter((f) => o(f) && y(f)).map((f) => ({
|
|
1684
1690
|
key: o(f),
|
|
1685
1691
|
title: g(f),
|
|
1686
|
-
visible:
|
|
1687
|
-
configurable:
|
|
1692
|
+
visible: w.value.includes(o(f)),
|
|
1693
|
+
configurable: y(f)
|
|
1688
1694
|
}))), T = (f) => {
|
|
1689
1695
|
if (f?.show === !1) return null;
|
|
1690
1696
|
const { renderActions: N } = ku({
|
|
@@ -1700,7 +1706,7 @@ function $u(e) {
|
|
|
1700
1706
|
minWidth: f?.minWidth,
|
|
1701
1707
|
fixed: f?.fixed !== !1 ? f?.fixed || "right" : void 0,
|
|
1702
1708
|
align: "center",
|
|
1703
|
-
render: (u,
|
|
1709
|
+
render: (u, _) => N(u, _)
|
|
1704
1710
|
};
|
|
1705
1711
|
}, M = (f) => {
|
|
1706
1712
|
if ("columnType" in f && zr(f)) {
|
|
@@ -1708,7 +1714,7 @@ function $u(e) {
|
|
|
1708
1714
|
return {
|
|
1709
1715
|
...f,
|
|
1710
1716
|
align: f.align || "center",
|
|
1711
|
-
render: (u,
|
|
1717
|
+
render: (u, _) => Br(N ? u[N] : void 0, u, l.value.find((m) => "key" in m && m.key === N) || f, _)
|
|
1712
1718
|
};
|
|
1713
1719
|
}
|
|
1714
1720
|
return {
|
|
@@ -1718,21 +1724,21 @@ function $u(e) {
|
|
|
1718
1724
|
};
|
|
1719
1725
|
return {
|
|
1720
1726
|
mergedColumns: K(() => {
|
|
1721
|
-
const f = l.value, N = i.value, u = f.filter((
|
|
1722
|
-
const F = o(
|
|
1723
|
-
return "type" in
|
|
1724
|
-
}).map((
|
|
1725
|
-
return
|
|
1727
|
+
const f = l.value, N = i.value, u = f.filter((m) => {
|
|
1728
|
+
const F = o(m);
|
|
1729
|
+
return "type" in m && (m.type === "selection" || m.type === "expand") || !F ? !0 : w.value.includes(F);
|
|
1730
|
+
}).map((m) => M(m)), _ = T(N);
|
|
1731
|
+
return _ && u.push(_), u;
|
|
1726
1732
|
}),
|
|
1727
1733
|
configurableColumns: S,
|
|
1728
|
-
visibleColumnKeys:
|
|
1734
|
+
visibleColumnKeys: w,
|
|
1729
1735
|
setVisibleColumnKeys: (f) => {
|
|
1730
|
-
|
|
1736
|
+
w.value = f;
|
|
1731
1737
|
},
|
|
1732
1738
|
resetColumnSetting: () => {
|
|
1733
|
-
|
|
1739
|
+
w.value = p(l.value);
|
|
1734
1740
|
},
|
|
1735
|
-
getVisibleColumnKeys: () => [...
|
|
1741
|
+
getVisibleColumnKeys: () => [...w.value]
|
|
1736
1742
|
};
|
|
1737
1743
|
}
|
|
1738
1744
|
var Au = {
|
|
@@ -1765,11 +1771,11 @@ function Pu(e) {
|
|
|
1765
1771
|
showQuickJumper: t.showQuickJumper ?? We.showQuickJumper,
|
|
1766
1772
|
prefix: t.prefix,
|
|
1767
1773
|
suffix: t.suffix
|
|
1768
|
-
}),
|
|
1774
|
+
}), v = (S) => {
|
|
1769
1775
|
if (t === !1 || !t) return {};
|
|
1770
1776
|
const T = i(), M = { ...t };
|
|
1771
1777
|
return S.page !== void 0 && (M[T.page] = S.page), S.pageSize !== void 0 && (M[T.pageSize] = S.pageSize), M;
|
|
1772
|
-
},
|
|
1778
|
+
}, y = (S) => {
|
|
1773
1779
|
const T = i();
|
|
1774
1780
|
return {
|
|
1775
1781
|
[T.page]: S[T.page],
|
|
@@ -1780,15 +1786,15 @@ function Pu(e) {
|
|
|
1780
1786
|
return {
|
|
1781
1787
|
paginationConfig: g,
|
|
1782
1788
|
handlePageChange: (S) => {
|
|
1783
|
-
const T =
|
|
1784
|
-
r?.(T), l?.(
|
|
1789
|
+
const T = v({ page: S });
|
|
1790
|
+
r?.(T), l?.(y(T));
|
|
1785
1791
|
},
|
|
1786
1792
|
handlePageSizeChange: (S) => {
|
|
1787
|
-
const T =
|
|
1793
|
+
const T = v({
|
|
1788
1794
|
page: 1,
|
|
1789
1795
|
pageSize: S
|
|
1790
1796
|
});
|
|
1791
|
-
r?.(T), l?.(
|
|
1797
|
+
r?.(T), l?.(y(T));
|
|
1792
1798
|
},
|
|
1793
1799
|
getFieldNames: i
|
|
1794
1800
|
};
|
|
@@ -1847,18 +1853,18 @@ var Ou = {
|
|
|
1847
1853
|
"delete"
|
|
1848
1854
|
],
|
|
1849
1855
|
setup(e, { expose: t, emit: a }) {
|
|
1850
|
-
const r = e, l = a, i = rt(), o = re(null), g = re(void 0),
|
|
1856
|
+
const r = e, l = a, i = rt(), o = re(null), g = re(void 0), v = K(() => !i.maxHeight), y = ($) => {
|
|
1851
1857
|
const A = getComputedStyle($);
|
|
1852
1858
|
return $.clientHeight <= 0 ? !1 : !!(parseFloat(A.flexGrow) > 0 || A.height && A.height !== "auto" && A.height !== "0px" || A.maxHeight && A.maxHeight !== "none" && A.maxHeight !== "0px" || A.overflowY === "auto" || A.overflowY === "scroll");
|
|
1853
1859
|
}, p = ($) => {
|
|
1854
1860
|
let A = $.parentElement;
|
|
1855
1861
|
for (; A && A !== document.body; ) {
|
|
1856
|
-
if (
|
|
1862
|
+
if (y(A)) return A;
|
|
1857
1863
|
A = A.parentElement;
|
|
1858
1864
|
}
|
|
1859
1865
|
return null;
|
|
1860
|
-
},
|
|
1861
|
-
|
|
1866
|
+
}, w = () => {
|
|
1867
|
+
v.value && ha(() => {
|
|
1862
1868
|
const $ = o.value;
|
|
1863
1869
|
if (!$) return;
|
|
1864
1870
|
const A = p($);
|
|
@@ -1866,22 +1872,22 @@ var Ou = {
|
|
|
1866
1872
|
g.value = void 0;
|
|
1867
1873
|
return;
|
|
1868
1874
|
}
|
|
1869
|
-
const j = getComputedStyle(A), ve = parseFloat(j.paddingTop), Ke = parseFloat(j.paddingBottom), Ge = A.getBoundingClientRect(), n = $.getBoundingClientRect(),
|
|
1875
|
+
const j = getComputedStyle(A), ve = parseFloat(j.paddingTop), Ke = parseFloat(j.paddingBottom), Ge = A.getBoundingClientRect(), n = $.getBoundingClientRect(), b = $.querySelector(".dydx-table__toolbar"), I = b ? b.offsetHeight + 16 : 0, q = $.querySelector(".n-data-table-thead"), ee = q ? q.offsetHeight : 40, Z = n.top - (Ge.top + ve), De = A.clientHeight - ve - Ke - Z - I - ee;
|
|
1870
1876
|
De > 200 ? g.value = De : g.value = void 0;
|
|
1871
1877
|
});
|
|
1872
1878
|
}, S = K(() => i.maxHeight ? i.maxHeight : g.value);
|
|
1873
1879
|
Jt(() => {
|
|
1874
|
-
|
|
1880
|
+
w(), window.addEventListener("resize", w);
|
|
1875
1881
|
}), _a(() => {
|
|
1876
|
-
window.removeEventListener("resize",
|
|
1882
|
+
window.removeEventListener("resize", w);
|
|
1877
1883
|
});
|
|
1878
|
-
const T = re(null), { mergedColumns: M, configurableColumns: L, visibleColumnKeys:
|
|
1884
|
+
const T = re(null), { mergedColumns: M, configurableColumns: L, visibleColumnKeys: k, setVisibleColumnKeys: D, resetColumnSetting: G, getVisibleColumnKeys: f } = $u({
|
|
1879
1885
|
columns: () => r.columns,
|
|
1880
1886
|
actionColumn: () => r.actionColumn,
|
|
1881
1887
|
onView: ($) => l("view", $),
|
|
1882
1888
|
onEdit: ($) => l("edit", $),
|
|
1883
1889
|
onDelete: ($) => l("delete", $)
|
|
1884
|
-
}), { paginationConfig: N, handlePageChange: u, handlePageSizeChange:
|
|
1890
|
+
}), { paginationConfig: N, handlePageChange: u, handlePageSizeChange: _ } = Pu({
|
|
1885
1891
|
get pagination() {
|
|
1886
1892
|
return r.pagination;
|
|
1887
1893
|
},
|
|
@@ -1891,11 +1897,11 @@ var Ou = {
|
|
|
1891
1897
|
onUpdatePagination: ($) => l("update:pagination", $),
|
|
1892
1898
|
onPageChange: ($) => l("pageChange", $)
|
|
1893
1899
|
});
|
|
1894
|
-
Qt(
|
|
1900
|
+
Qt(k, ($) => {
|
|
1895
1901
|
l("update:visibleColumns", $);
|
|
1896
1902
|
});
|
|
1897
|
-
const
|
|
1898
|
-
l("update:checkedRowKeys", $, r.data.filter((A) => $.includes(
|
|
1903
|
+
const m = K(() => typeof r.rowKey == "function" ? r.rowKey : ($) => $[r.rowKey]), F = ($) => {
|
|
1904
|
+
l("update:checkedRowKeys", $, r.data.filter((A) => $.includes(m.value(A))));
|
|
1899
1905
|
}, V = () => {
|
|
1900
1906
|
r.onAdd?.();
|
|
1901
1907
|
}, O = () => {
|
|
@@ -1915,16 +1921,16 @@ var Ou = {
|
|
|
1915
1921
|
scrollTo: ($) => {
|
|
1916
1922
|
T.value?.scrollTo($);
|
|
1917
1923
|
}
|
|
1918
|
-
}), ($, A) => (
|
|
1924
|
+
}), ($, A) => (h(), Q("div", {
|
|
1919
1925
|
ref_key: "containerRef",
|
|
1920
1926
|
ref: o,
|
|
1921
1927
|
class: "dydx-table"
|
|
1922
|
-
}, [r.showToolbar ? (
|
|
1928
|
+
}, [r.showToolbar ? (h(), Q("div", Ou, [C(c(ae), {
|
|
1923
1929
|
class: "dydx-table__toolbar-left",
|
|
1924
1930
|
size: 12
|
|
1925
1931
|
}, {
|
|
1926
1932
|
default: s(() => [
|
|
1927
|
-
e.showAdd ? (
|
|
1933
|
+
e.showAdd ? (h(), P(c(X), {
|
|
1928
1934
|
key: 0,
|
|
1929
1935
|
type: "primary",
|
|
1930
1936
|
onClick: V
|
|
@@ -1936,7 +1942,7 @@ var Ou = {
|
|
|
1936
1942
|
default: s(() => [E(" " + W(e.addButtonText), 1)]),
|
|
1937
1943
|
_: 3
|
|
1938
1944
|
})) : Y("", !0),
|
|
1939
|
-
(
|
|
1945
|
+
(h(!0), Q(te, null, ne(e.leftButtons, (j) => (h(), Q(te, { key: j.key }, [j.show !== !1 ? (h(), P(c(X), {
|
|
1940
1946
|
key: 0,
|
|
1941
1947
|
type: j.type,
|
|
1942
1948
|
disabled: j.disabled,
|
|
@@ -1946,7 +1952,7 @@ var Ou = {
|
|
|
1946
1952
|
_: 2
|
|
1947
1953
|
}, [j.icon ? {
|
|
1948
1954
|
name: "icon",
|
|
1949
|
-
fn: s(() => [(
|
|
1955
|
+
fn: s(() => [(h(), P(me(j.icon)))]),
|
|
1950
1956
|
key: "0"
|
|
1951
1957
|
} : void 0]), 1032, [
|
|
1952
1958
|
"type",
|
|
@@ -1962,7 +1968,7 @@ var Ou = {
|
|
|
1962
1968
|
}, {
|
|
1963
1969
|
default: s(() => [
|
|
1964
1970
|
U($.$slots, "toolbar-right", {}, void 0, !0),
|
|
1965
|
-
(
|
|
1971
|
+
(h(!0), Q(te, null, ne(e.rightButtons, (j) => (h(), Q(te, { key: j.key }, [j.show !== !1 ? (h(), P(c(X), {
|
|
1966
1972
|
key: 0,
|
|
1967
1973
|
type: j.type,
|
|
1968
1974
|
disabled: j.disabled,
|
|
@@ -1972,14 +1978,14 @@ var Ou = {
|
|
|
1972
1978
|
_: 2
|
|
1973
1979
|
}, [j.icon ? {
|
|
1974
1980
|
name: "icon",
|
|
1975
|
-
fn: s(() => [(
|
|
1981
|
+
fn: s(() => [(h(), P(me(j.icon)))]),
|
|
1976
1982
|
key: "0"
|
|
1977
1983
|
} : void 0]), 1032, [
|
|
1978
1984
|
"type",
|
|
1979
1985
|
"disabled",
|
|
1980
1986
|
"onClick"
|
|
1981
1987
|
])) : Y("", !0)], 64))), 128)),
|
|
1982
|
-
e.showRefresh ? (
|
|
1988
|
+
e.showRefresh ? (h(), P(c(Be), {
|
|
1983
1989
|
key: 0,
|
|
1984
1990
|
trigger: "hover"
|
|
1985
1991
|
}, {
|
|
@@ -1997,7 +2003,7 @@ var Ou = {
|
|
|
1997
2003
|
default: s(() => [A[1] || (A[1] = E(" 刷新 ", -1))]),
|
|
1998
2004
|
_: 1
|
|
1999
2005
|
})) : Y("", !0),
|
|
2000
|
-
e.showColumnSetting ? (
|
|
2006
|
+
e.showColumnSetting ? (h(), P(c(ia), {
|
|
2001
2007
|
key: 1,
|
|
2002
2008
|
trigger: "click",
|
|
2003
2009
|
placement: "bottom-end"
|
|
@@ -2025,14 +2031,14 @@ var Ou = {
|
|
|
2025
2031
|
default: s(() => [...A[3] || (A[3] = [E(" 重置 ", -1)])]),
|
|
2026
2032
|
_: 1
|
|
2027
2033
|
}, 8, ["onClick"])]), C(c(et), {
|
|
2028
|
-
value: c(
|
|
2029
|
-
"onUpdate:value": A[0] || (A[0] = (j) => ba(
|
|
2034
|
+
value: c(k),
|
|
2035
|
+
"onUpdate:value": A[0] || (A[0] = (j) => ba(k) ? k.value = j : null)
|
|
2030
2036
|
}, {
|
|
2031
2037
|
default: s(() => [C(c(ae), {
|
|
2032
2038
|
vertical: "",
|
|
2033
2039
|
size: 8
|
|
2034
2040
|
}, {
|
|
2035
|
-
default: s(() => [(
|
|
2041
|
+
default: s(() => [(h(!0), Q(te, null, ne(c(L), (j) => (h(), P(c(Ht), {
|
|
2036
2042
|
key: j.key,
|
|
2037
2043
|
value: j.key,
|
|
2038
2044
|
label: j.title
|
|
@@ -2050,7 +2056,7 @@ var Ou = {
|
|
|
2050
2056
|
ref: T,
|
|
2051
2057
|
data: e.data,
|
|
2052
2058
|
columns: c(M),
|
|
2053
|
-
"row-key":
|
|
2059
|
+
"row-key": m.value,
|
|
2054
2060
|
loading: e.loading,
|
|
2055
2061
|
pagination: c(N),
|
|
2056
2062
|
remote: e.remote,
|
|
@@ -2058,7 +2064,7 @@ var Ou = {
|
|
|
2058
2064
|
"max-height": S.value
|
|
2059
2065
|
}, c(i), {
|
|
2060
2066
|
"onUpdate:page": c(u),
|
|
2061
|
-
"onUpdate:pageSize": c(
|
|
2067
|
+
"onUpdate:pageSize": c(_),
|
|
2062
2068
|
"onUpdate:checkedRowKeys": F
|
|
2063
2069
|
}), null, 16, [
|
|
2064
2070
|
"data",
|
|
@@ -2108,7 +2114,7 @@ var Ou = {
|
|
|
2108
2114
|
"cancel"
|
|
2109
2115
|
],
|
|
2110
2116
|
setup(e, { expose: t, emit: a }) {
|
|
2111
|
-
const r = e, l = a, i = rt(), o = re(), g = K(() => r.title ? r.title : `${r.model[r.rowKey] ? "编辑" : "新增"}${r.subtitle}`),
|
|
2117
|
+
const r = e, l = a, i = rt(), o = re(), g = K(() => r.title ? r.title : `${r.model[r.rowKey] ? "编辑" : "新增"}${r.subtitle}`), v = K(() => ({ width: typeof r.width == "number" ? `${r.width}px` : r.width })), y = () => {
|
|
2112
2118
|
l("update:show", !1), l("cancel");
|
|
2113
2119
|
}, p = async () => {
|
|
2114
2120
|
try {
|
|
@@ -2120,26 +2126,26 @@ var Ou = {
|
|
|
2120
2126
|
getFormRef: () => o.value,
|
|
2121
2127
|
validate: () => o.value?.validate(),
|
|
2122
2128
|
resetFields: () => o.value?.resetFields()
|
|
2123
|
-
}), (
|
|
2129
|
+
}), (w, S) => (h(), P(c(oa), J({
|
|
2124
2130
|
show: e.show,
|
|
2125
2131
|
preset: "card",
|
|
2126
2132
|
title: g.value,
|
|
2127
|
-
style:
|
|
2133
|
+
style: v.value,
|
|
2128
2134
|
"mask-closable": !1
|
|
2129
2135
|
}, c(i), { "onUpdate:show": S[0] || (S[0] = (T) => l("update:show", T)) }), de({ _: 2 }, [
|
|
2130
|
-
|
|
2136
|
+
w.$slots.header ? {
|
|
2131
2137
|
name: "header",
|
|
2132
|
-
fn: s(() => [U(
|
|
2138
|
+
fn: s(() => [U(w.$slots, "header")]),
|
|
2133
2139
|
key: "0"
|
|
2134
2140
|
} : void 0,
|
|
2135
|
-
|
|
2141
|
+
w.$slots["header-extra"] ? {
|
|
2136
2142
|
name: "header-extra",
|
|
2137
|
-
fn: s(() => [U(
|
|
2143
|
+
fn: s(() => [U(w.$slots, "header-extra")]),
|
|
2138
2144
|
key: "1"
|
|
2139
2145
|
} : void 0,
|
|
2140
|
-
|
|
2146
|
+
w.$slots.default ? {
|
|
2141
2147
|
name: "default",
|
|
2142
|
-
fn: s(() => [U(
|
|
2148
|
+
fn: s(() => [U(w.$slots, "default")]),
|
|
2143
2149
|
key: "2"
|
|
2144
2150
|
} : {
|
|
2145
2151
|
name: "default",
|
|
@@ -2157,24 +2163,24 @@ var Ou = {
|
|
|
2157
2163
|
"show-footer": !1,
|
|
2158
2164
|
"disable-default-required": e.disableDefaultRequired
|
|
2159
2165
|
}, de({ _: 2 }, [
|
|
2160
|
-
|
|
2166
|
+
w.$slots["form-header"] ? {
|
|
2161
2167
|
name: "header",
|
|
2162
|
-
fn: s((T) => [U(
|
|
2168
|
+
fn: s((T) => [U(w.$slots, "form-header", le(ue(T)))]),
|
|
2163
2169
|
key: "0"
|
|
2164
2170
|
} : void 0,
|
|
2165
|
-
|
|
2171
|
+
w.$slots["form-footer"] ? {
|
|
2166
2172
|
name: "footer",
|
|
2167
|
-
fn: s((T) => [U(
|
|
2173
|
+
fn: s((T) => [U(w.$slots, "form-footer", le(ue(T)))]),
|
|
2168
2174
|
key: "1"
|
|
2169
2175
|
} : void 0,
|
|
2170
|
-
|
|
2176
|
+
w.$slots["form-append"] ? {
|
|
2171
2177
|
name: "append",
|
|
2172
|
-
fn: s((T) => [U(
|
|
2178
|
+
fn: s((T) => [U(w.$slots, "form-append", le(ue(T)))]),
|
|
2173
2179
|
key: "2"
|
|
2174
2180
|
} : void 0,
|
|
2175
|
-
ne(
|
|
2181
|
+
ne(w.$slots, (T, M) => ({
|
|
2176
2182
|
name: M,
|
|
2177
|
-
fn: s((L) => [typeof M == "string" && M.startsWith("field-") ? U(
|
|
2183
|
+
fn: s((L) => [typeof M == "string" && M.startsWith("field-") ? U(w.$slots, M, le(J({ key: 0 }, L))) : Y("", !0)])
|
|
2178
2184
|
}))
|
|
2179
2185
|
]), 1032, [
|
|
2180
2186
|
"schemas",
|
|
@@ -2190,16 +2196,16 @@ var Ou = {
|
|
|
2190
2196
|
}, 8, ["show"])]),
|
|
2191
2197
|
key: "3"
|
|
2192
2198
|
},
|
|
2193
|
-
|
|
2199
|
+
w.$slots.footer ? {
|
|
2194
2200
|
name: "footer",
|
|
2195
|
-
fn: s(() => [U(
|
|
2201
|
+
fn: s(() => [U(w.$slots, "footer")]),
|
|
2196
2202
|
key: "4"
|
|
2197
2203
|
} : {
|
|
2198
2204
|
name: "footer",
|
|
2199
2205
|
fn: s(() => [C(c(ae), { justify: "end" }, {
|
|
2200
|
-
default: s(() => [e.showCancel ? (
|
|
2206
|
+
default: s(() => [e.showCancel ? (h(), P(c(X), {
|
|
2201
2207
|
key: 0,
|
|
2202
|
-
onClick:
|
|
2208
|
+
onClick: y
|
|
2203
2209
|
}, {
|
|
2204
2210
|
icon: s(() => [C(c(H), null, {
|
|
2205
2211
|
default: s(() => [C(c(er))]),
|
|
@@ -2223,9 +2229,9 @@ var Ou = {
|
|
|
2223
2229
|
})]),
|
|
2224
2230
|
key: "5"
|
|
2225
2231
|
},
|
|
2226
|
-
|
|
2232
|
+
w.$slots.action ? {
|
|
2227
2233
|
name: "action",
|
|
2228
|
-
fn: s(() => [U(
|
|
2234
|
+
fn: s(() => [U(w.$slots, "action")]),
|
|
2229
2235
|
key: "6"
|
|
2230
2236
|
} : void 0
|
|
2231
2237
|
]), 1040, [
|
|
@@ -2276,9 +2282,9 @@ var Ou = {
|
|
|
2276
2282
|
"cancel"
|
|
2277
2283
|
],
|
|
2278
2284
|
setup(e, { expose: t, emit: a }) {
|
|
2279
|
-
const r = e, l = a, i = rt(), o = re(), g = K(() => r.title ? r.title : `${r.model[r.rowKey] ? "编辑" : "新增"}${r.subtitle}`),
|
|
2285
|
+
const r = e, l = a, i = rt(), o = re(), g = K(() => r.title ? r.title : `${r.model[r.rowKey] ? "编辑" : "新增"}${r.subtitle}`), v = () => {
|
|
2280
2286
|
l("update:show", !1), l("cancel");
|
|
2281
|
-
},
|
|
2287
|
+
}, y = async () => {
|
|
2282
2288
|
try {
|
|
2283
2289
|
await o.value?.validate(), l("confirm", r.model);
|
|
2284
2290
|
} catch {
|
|
@@ -2288,23 +2294,23 @@ var Ou = {
|
|
|
2288
2294
|
getFormRef: () => o.value,
|
|
2289
2295
|
validate: () => o.value?.validate(),
|
|
2290
2296
|
resetFields: () => o.value?.resetFields()
|
|
2291
|
-
}), (p,
|
|
2297
|
+
}), (p, w) => (h(), P(c(Hr), J({
|
|
2292
2298
|
show: e.show,
|
|
2293
2299
|
width: e.width,
|
|
2294
2300
|
placement: e.placement,
|
|
2295
2301
|
"mask-closable": !1
|
|
2296
|
-
}, c(i), { "onUpdate:show":
|
|
2302
|
+
}, c(i), { "onUpdate:show": w[0] || (w[0] = (S) => l("update:show", S)) }), {
|
|
2297
2303
|
default: s(() => [C(c(qr), {
|
|
2298
2304
|
title: g.value,
|
|
2299
2305
|
closable: "",
|
|
2300
|
-
onClose:
|
|
2306
|
+
onClose: v
|
|
2301
2307
|
}, de({ _: 2 }, [p.$slots.default ? {
|
|
2302
2308
|
name: "default",
|
|
2303
2309
|
fn: s(() => [U(p.$slots, "default")]),
|
|
2304
2310
|
key: "0"
|
|
2305
2311
|
} : {
|
|
2306
2312
|
name: "default",
|
|
2307
|
-
fn: s(() => [p.$slots["header-extra"] ? (
|
|
2313
|
+
fn: s(() => [p.$slots["header-extra"] ? (h(), Q("div", Nu, [U(p.$slots, "header-extra")])) : Y("", !0), C(c(tt), { show: e.loading }, {
|
|
2308
2314
|
default: s(() => [C(c(Le), {
|
|
2309
2315
|
ref_key: "formRef",
|
|
2310
2316
|
ref: o,
|
|
@@ -2357,9 +2363,9 @@ var Ou = {
|
|
|
2357
2363
|
} : {
|
|
2358
2364
|
name: "footer",
|
|
2359
2365
|
fn: s(() => [C(c(ae), { justify: "end" }, {
|
|
2360
|
-
default: s(() => [e.showCancel ? (
|
|
2366
|
+
default: s(() => [e.showCancel ? (h(), P(c(X), {
|
|
2361
2367
|
key: 0,
|
|
2362
|
-
onClick:
|
|
2368
|
+
onClick: v
|
|
2363
2369
|
}, {
|
|
2364
2370
|
icon: s(() => [C(c(H), null, {
|
|
2365
2371
|
default: s(() => [C(c(er))]),
|
|
@@ -2370,7 +2376,7 @@ var Ou = {
|
|
|
2370
2376
|
})) : Y("", !0), C(c(X), {
|
|
2371
2377
|
type: "primary",
|
|
2372
2378
|
loading: e.loading,
|
|
2373
|
-
onClick:
|
|
2379
|
+
onClick: y
|
|
2374
2380
|
}, {
|
|
2375
2381
|
icon: s(() => [C(c(H), null, {
|
|
2376
2382
|
default: s(() => [C(c(Zt))]),
|