dydx-naive-ui-for-vue 0.1.53 → 0.1.54
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
|
|
3
|
+
import { Fragment as te, computed as L, createBlock as $, createCommentVNode as Y, createElementBlock as Q, createElementVNode as Fe, createSlots as de, createTextVNode as M, createVNode as C, defineComponent as he, guardReactiveProps as ue, h as T, isRef as ba, mergeModels as vt, mergeProps as J, nextTick as ha, normalizeProps as le, onMounted as Jt, onUnmounted as _a, openBlock as _, ref as re, renderList as ne, renderSlot as U, resolveDynamicComponent as me, toDisplayString as W, toHandlers as wa, unref as y, 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,87 +43,87 @@ 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 =
|
|
47
|
-
...
|
|
48
|
-
url:
|
|
49
|
-
})) : r.fileList),
|
|
50
|
-
const
|
|
51
|
-
return r.acceptTypes?.length &&
|
|
52
|
-
}),
|
|
46
|
+
const r = e, l = a, i = ma(), o = re(), g = L(() => r.listType ? r.listType : r.uploadType === "image" ? "image-card" : "text"), h = L(() => r.urlPrefix ? r.fileList.map((x) => ({
|
|
47
|
+
...x,
|
|
48
|
+
url: x.url && !x.url.startsWith("http") ? r.urlPrefix + x.url : x.url
|
|
49
|
+
})) : r.fileList), v = L(() => {
|
|
50
|
+
const x = [];
|
|
51
|
+
return r.acceptTypes?.length && x.push(`支持格式:${r.acceptTypes.join(", ")}`), r.maxSize && x.push(`单个文件不超过 ${r.maxSize}MB`), r.maxCount && x.push(`最多 ${r.maxCount} 个文件`), x.join(";");
|
|
52
|
+
}), u = L(() => {
|
|
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
|
+
}), c = L(() => {
|
|
57
|
+
const { uploadType: x, fileList: O, customUpload: K, acceptTypes: p, maxSize: N, maxCount: d, multiple: w, autoUpload: m, disabled: F, urlPrefix: V, showTip: P, showDragger: ye, ...ge } = r;
|
|
58
58
|
return ge;
|
|
59
|
-
}),
|
|
60
|
-
l("update:fileList", r.urlPrefix ?
|
|
61
|
-
...
|
|
62
|
-
url:
|
|
63
|
-
})) :
|
|
64
|
-
},
|
|
65
|
-
l("beforeUpload",
|
|
66
|
-
const
|
|
67
|
-
return
|
|
68
|
-
if (
|
|
69
|
-
if (
|
|
70
|
-
const [
|
|
71
|
-
return
|
|
59
|
+
}), j = (x) => {
|
|
60
|
+
l("update:fileList", r.urlPrefix ? x.map((O) => ({
|
|
61
|
+
...O,
|
|
62
|
+
url: O.url?.startsWith(r.urlPrefix) ? O.url.slice(r.urlPrefix.length) : O.url
|
|
63
|
+
})) : x);
|
|
64
|
+
}, A = async ({ file: x }) => {
|
|
65
|
+
l("beforeUpload", x);
|
|
66
|
+
const O = x.file;
|
|
67
|
+
return O ? r.maxSize && O.size > r.maxSize * 1024 * 1024 ? (i.error(`文件大小不能超过 ${r.maxSize}MB`), !1) : r.acceptTypes?.length && !r.acceptTypes.some((K) => {
|
|
68
|
+
if (K.startsWith(".")) return O.name.toLowerCase().endsWith(K.toLowerCase());
|
|
69
|
+
if (K.includes("*")) {
|
|
70
|
+
const [p] = K.split("/");
|
|
71
|
+
return O.type.startsWith(p);
|
|
72
72
|
}
|
|
73
|
-
return
|
|
74
|
-
}) ? (i.error(`只支持 ${r.acceptTypes.join(", ")} 格式`), !1) : r.maxCount && r.fileList.length >= r.maxCount ? (l("exceed", [
|
|
75
|
-
},
|
|
76
|
-
const { file:
|
|
73
|
+
return O.type === K;
|
|
74
|
+
}) ? (i.error(`只支持 ${r.acceptTypes.join(", ")} 格式`), !1) : r.maxCount && r.fileList.length >= r.maxCount ? (l("exceed", [O]), i.error(`最多上传 ${r.maxCount} 个文件`), !1) : !0 : !0;
|
|
75
|
+
}, G = async (x) => {
|
|
76
|
+
const { file: O, onProgress: K, onFinish: p, onError: N } = x;
|
|
77
77
|
if (!r.customUpload) {
|
|
78
78
|
console.warn("DydxUpload: customUpload 方法未提供"), N();
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}),
|
|
85
|
-
} catch (
|
|
86
|
-
N(), l("error",
|
|
82
|
+
O.url = await r.customUpload(O.file, (d) => {
|
|
83
|
+
K({ percent: d });
|
|
84
|
+
}), O.status = "finished", p(), l("success", O);
|
|
85
|
+
} catch (d) {
|
|
86
|
+
N(), l("error", O, d);
|
|
87
87
|
}
|
|
88
|
-
},
|
|
88
|
+
}, E = () => {
|
|
89
89
|
o.value?.submit();
|
|
90
90
|
};
|
|
91
91
|
return t({
|
|
92
92
|
submit: () => o.value?.submit(),
|
|
93
93
|
openDialog: () => o.value?.openOpenFileDialog(),
|
|
94
94
|
clear: () => o.value?.clear()
|
|
95
|
-
}), (
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
C(
|
|
95
|
+
}), (x, O) => {
|
|
96
|
+
const K = H, p = ca, N = ga, d = X, w = Yt;
|
|
97
|
+
return _(), Q("div", null, [
|
|
98
|
+
C(w, J({
|
|
99
99
|
ref_key: "uploadRef",
|
|
100
100
|
ref: o
|
|
101
|
-
},
|
|
102
|
-
"file-list":
|
|
103
|
-
"custom-request":
|
|
104
|
-
accept:
|
|
101
|
+
}, c.value, {
|
|
102
|
+
"file-list": h.value,
|
|
103
|
+
"custom-request": G,
|
|
104
|
+
accept: u.value,
|
|
105
105
|
max: e.maxCount,
|
|
106
106
|
multiple: e.multiple,
|
|
107
107
|
disabled: e.disabled,
|
|
108
108
|
"default-upload": e.autoUpload,
|
|
109
109
|
"list-type": g.value,
|
|
110
|
-
"onUpdate:fileList":
|
|
111
|
-
onBeforeUpload:
|
|
110
|
+
"onUpdate:fileList": j,
|
|
111
|
+
onBeforeUpload: A
|
|
112
112
|
}), {
|
|
113
|
-
default: s(() => [e.showDragger && e.uploadType !== "image" ? (
|
|
113
|
+
default: s(() => [e.showDragger && e.uploadType !== "image" ? (_(), $(N, { key: 0 }, {
|
|
114
114
|
default: s(() => [
|
|
115
|
-
Fe("div", Da, [C(
|
|
115
|
+
Fe("div", Da, [C(K, {
|
|
116
116
|
size: "48",
|
|
117
117
|
depth: 3
|
|
118
118
|
}, {
|
|
119
|
-
default: s(() => [C(
|
|
119
|
+
default: s(() => [C(y(mt))]),
|
|
120
120
|
_: 1
|
|
121
121
|
})]),
|
|
122
|
-
C(
|
|
123
|
-
default: s(() => [...
|
|
122
|
+
C(p, { style: { "font-size": "16px" } }, {
|
|
123
|
+
default: s(() => [...O[0] || (O[0] = [M(" 点击或拖拽文件到此区域上传 ", -1)])]),
|
|
124
124
|
_: 1
|
|
125
125
|
}),
|
|
126
|
-
e.showTip ? (
|
|
126
|
+
e.showTip ? (_(), $(p, {
|
|
127
127
|
key: 0,
|
|
128
128
|
depth: "3",
|
|
129
129
|
style: {
|
|
@@ -132,23 +132,23 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
132
132
|
display: "block"
|
|
133
133
|
}
|
|
134
134
|
}, {
|
|
135
|
-
default: s(() => [
|
|
135
|
+
default: s(() => [M(W(v.value), 1)]),
|
|
136
136
|
_: 1
|
|
137
137
|
})) : Y("", !0)
|
|
138
138
|
]),
|
|
139
139
|
_: 1
|
|
140
|
-
})) : U(
|
|
140
|
+
})) : U(x.$slots, "default", { key: 1 }, () => [e.uploadType === "image" && g.value === "image-card" ? (_(), $(K, {
|
|
141
141
|
key: 0,
|
|
142
142
|
size: 28
|
|
143
143
|
}, {
|
|
144
|
-
default: s(() => [C(
|
|
144
|
+
default: s(() => [C(y(Xt))]),
|
|
145
145
|
_: 1
|
|
146
|
-
})) : (
|
|
147
|
-
icon: s(() => [C(
|
|
148
|
-
default: s(() => [C(
|
|
146
|
+
})) : (_(), $(d, { key: 1 }, {
|
|
147
|
+
icon: s(() => [C(K, null, {
|
|
148
|
+
default: s(() => [C(y(mt))]),
|
|
149
149
|
_: 1
|
|
150
150
|
})]),
|
|
151
|
-
default: s(() => [
|
|
151
|
+
default: s(() => [M(" " + W(e.uploadType === "image" ? "上传图片" : "上传文件"), 1)]),
|
|
152
152
|
_: 1
|
|
153
153
|
}))])]),
|
|
154
154
|
_: 3
|
|
@@ -161,16 +161,16 @@ 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 && h.value.length > 0 ? (_(), $(d, {
|
|
165
165
|
key: 0,
|
|
166
166
|
type: "primary",
|
|
167
|
-
onClick:
|
|
167
|
+
onClick: E,
|
|
168
168
|
style: { "margin-top": "8px" }
|
|
169
169
|
}, {
|
|
170
|
-
default: s(() => [...
|
|
170
|
+
default: s(() => [...O[1] || (O[1] = [M(" 开始上传 ", -1)])]),
|
|
171
171
|
_: 1
|
|
172
172
|
})) : Y("", !0),
|
|
173
|
-
e.showTip && !(e.showDragger && e.uploadType !== "image") ? (
|
|
173
|
+
e.showTip && !(e.showDragger && e.uploadType !== "image") ? (_(), $(p, {
|
|
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(() => [
|
|
182
|
+
default: s(() => [M(W(v.value), 1)]),
|
|
183
183
|
_: 1
|
|
184
184
|
})) : Y("", !0)
|
|
185
185
|
]);
|
|
@@ -204,22 +204,22 @@ var Da = { style: { "margin-bottom": "12px" } }, Fa = /* @__PURE__ */ he({
|
|
|
204
204
|
},
|
|
205
205
|
emits: ["update:value"],
|
|
206
206
|
setup(e, { emit: t }) {
|
|
207
|
-
const a = e, r = t, l = Object.keys(je), i =
|
|
208
|
-
let
|
|
209
|
-
return a.iconStyle === "outline" ?
|
|
210
|
-
label:
|
|
211
|
-
value:
|
|
207
|
+
const a = e, r = t, l = Object.keys(je), i = L(() => {
|
|
208
|
+
let v = l;
|
|
209
|
+
return a.iconStyle === "outline" ? v = l.filter((u) => u.endsWith("Outline")) : a.iconStyle === "sharp" ? v = l.filter((u) => u.endsWith("Sharp")) : a.iconStyle === "filled" && (v = l.filter((u) => !u.endsWith("Outline") && !u.endsWith("Sharp"))), v.map((u) => ({
|
|
210
|
+
label: u,
|
|
211
|
+
value: u
|
|
212
212
|
}));
|
|
213
|
-
}), o = (
|
|
214
|
-
const
|
|
215
|
-
return
|
|
216
|
-
}, g = ({ option:
|
|
217
|
-
const
|
|
218
|
-
return
|
|
219
|
-
},
|
|
220
|
-
r("update:value",
|
|
213
|
+
}), o = (v) => {
|
|
214
|
+
const u = je[v.value];
|
|
215
|
+
return u ? T("div", { style: "display: flex; align-items: center; gap: 8px;" }, [T(H, { size: 18 }, () => T(u)), T("span", { style: "flex: 1; overflow: hidden; text-overflow: ellipsis;" }, v.label)]) : T("span", v.label);
|
|
216
|
+
}, g = ({ option: v }) => {
|
|
217
|
+
const u = je[v.value];
|
|
218
|
+
return u ? T("div", { style: "display: flex; align-items: center; gap: 4px;" }, [T(H, { size: 16 }, () => T(u)), v.label]) : T("span", v.label);
|
|
219
|
+
}, h = (v) => {
|
|
220
|
+
r("update:value", v);
|
|
221
221
|
};
|
|
222
|
-
return (
|
|
222
|
+
return (v, u) => (_(), $(y(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": h
|
|
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], h = r ? r(a[g], e[g], g, a, e) : void 0;
|
|
408
|
+
h === void 0 && (h = e[g]), l ? ir(a, g, h) : ot(a, g, h);
|
|
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) : [], h = g.length;
|
|
463
|
+
for (var v in e) (t || Bo.call(e, v)) && !(o && (v == "length" || l && (v == "offset" || v == "parent") || i && (v == "buffer" || v == "byteLength" || v == "byteOffset") || lr(v, h))) && g.push(v);
|
|
464
464
|
return g;
|
|
465
465
|
}
|
|
466
466
|
var gr = zo;
|
|
@@ -876,33 +876,33 @@ 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, h = t & Gs, v = 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
|
-
var
|
|
883
|
-
if (
|
|
882
|
+
var u = Ce(e);
|
|
883
|
+
if (u) {
|
|
884
884
|
if (o = Xi(e), !g) return Dn(e, o);
|
|
885
885
|
} else {
|
|
886
|
-
var
|
|
886
|
+
var c = pt(e), j = c == Sr || c == Js;
|
|
887
887
|
if (pr(e)) return ki(e, g);
|
|
888
|
-
if (
|
|
889
|
-
if (o =
|
|
888
|
+
if (c == $r || c == kr || j && !l) {
|
|
889
|
+
if (o = h || j ? {} : Fs(e), !g) return h ? Ni(e, Ti(o, e)) : Fi(e, wi(o, e));
|
|
890
890
|
} else {
|
|
891
|
-
if (!z[
|
|
892
|
-
o = Os(e,
|
|
891
|
+
if (!z[c]) return l ? e : {};
|
|
892
|
+
o = Os(e, c, g);
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
895
|
i || (i = new hi());
|
|
896
|
-
var
|
|
897
|
-
if (
|
|
898
|
-
i.set(e, o), Ls(e) ? e.forEach(function(
|
|
899
|
-
o.add(Ie(
|
|
900
|
-
}) : zs(e) && e.forEach(function(
|
|
901
|
-
o.set(
|
|
896
|
+
var A = i.get(e);
|
|
897
|
+
if (A) return A;
|
|
898
|
+
i.set(e, o), Ls(e) ? e.forEach(function(E) {
|
|
899
|
+
o.add(Ie(E, t, a, E, e, i));
|
|
900
|
+
}) : zs(e) && e.forEach(function(E, x) {
|
|
901
|
+
o.set(x, Ie(E, t, a, x, e, i));
|
|
902
902
|
});
|
|
903
|
-
var
|
|
904
|
-
return In(
|
|
905
|
-
|
|
903
|
+
var G = u ? void 0 : (v ? h ? Mi : Ri : h ? ut : st)(e);
|
|
904
|
+
return In(G || e, function(E, x) {
|
|
905
|
+
G && (x = E, E = e[x]), ot(o, x, Ie(E, t, a, x, 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 h = br(t[l]), v = a;
|
|
918
|
+
if (h === "__proto__" || h === "constructor" || h === "prototype") return e;
|
|
919
919
|
if (l != o) {
|
|
920
|
-
var
|
|
921
|
-
|
|
920
|
+
var u = g[h];
|
|
921
|
+
v = r ? r(u, h, g) : void 0, v === void 0 && (v = fe(u) ? u : lr(t[l + 1]) ? [] : {});
|
|
922
922
|
}
|
|
923
|
-
ot(g,
|
|
923
|
+
ot(g, h, v), g = g[h];
|
|
924
924
|
}
|
|
925
925
|
return e;
|
|
926
926
|
}
|
|
@@ -988,23 +988,23 @@ 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({}), h = re();
|
|
992
|
+
let v = !1;
|
|
993
993
|
Jt(() => {
|
|
994
|
-
!
|
|
994
|
+
!v && i.value && (h.value = Kt(i.value), v = !0);
|
|
995
995
|
});
|
|
996
|
-
const
|
|
996
|
+
const u = L(() => ({
|
|
997
997
|
type: "primary",
|
|
998
998
|
text: "搜索",
|
|
999
999
|
loading: r.loading,
|
|
1000
|
-
renderIcon: () =>
|
|
1000
|
+
renderIcon: () => T(H, null, { default: () => T(Aa) }),
|
|
1001
1001
|
...r.submitButton
|
|
1002
|
-
})),
|
|
1002
|
+
})), c = L(() => ({
|
|
1003
1003
|
type: "default",
|
|
1004
1004
|
text: "重置",
|
|
1005
|
-
renderIcon: () =>
|
|
1005
|
+
renderIcon: () => T(H, null, { default: () => T(tr) }),
|
|
1006
1006
|
...r.resetButton
|
|
1007
|
-
})),
|
|
1007
|
+
})), j = L(() => r.schemas.filter((n) => !(typeof n.hidden == "function" ? n.hidden(i.value) : n.hidden))), A = L(() => ({
|
|
1008
1008
|
disabled: r.disabled ?? !1,
|
|
1009
1009
|
inline: r.inline ?? !1,
|
|
1010
1010
|
labelWidth: r.labelWidth ?? "auto",
|
|
@@ -1017,17 +1017,17 @@ var xu = /* @__PURE__ */ he({
|
|
|
1017
1017
|
requireMarkPlacement: r.requireMarkPlacement ?? "left",
|
|
1018
1018
|
size: r.size ?? "medium",
|
|
1019
1019
|
validateMessages: r.validateMessages
|
|
1020
|
-
})),
|
|
1020
|
+
})), G = L(() => ({
|
|
1021
1021
|
cols: 24,
|
|
1022
1022
|
xGap: r.xGap,
|
|
1023
1023
|
yGap: r.yGap,
|
|
1024
1024
|
itemResponsive: !0,
|
|
1025
1025
|
...r.gridProps,
|
|
1026
1026
|
responsive: "self"
|
|
1027
|
-
})),
|
|
1027
|
+
})), E = (n) => {
|
|
1028
1028
|
const b = n.type || "input";
|
|
1029
1029
|
return b === "custom" ? n.component : Ia[b];
|
|
1030
|
-
},
|
|
1030
|
+
}, x = (n) => typeof n.disabled == "function" ? n.disabled(i.value) : n.disabled, O = (n) => {
|
|
1031
1031
|
const b = { ...n.props };
|
|
1032
1032
|
if (b.placeholder !== void 0) return b;
|
|
1033
1033
|
const I = typeof n.label == "string" ? n.label : "";
|
|
@@ -1046,37 +1046,37 @@ var xu = /* @__PURE__ */ he({
|
|
|
1046
1046
|
"color-picker"
|
|
1047
1047
|
];
|
|
1048
1048
|
return ee.includes(q) ? b.placeholder = `请输入${I}` : Z.includes(q) && (b.placeholder = `请选择${I}`), b;
|
|
1049
|
-
},
|
|
1049
|
+
}, K = (n) => {
|
|
1050
1050
|
const b = n.type === "custom" ? "modelValue" : "value";
|
|
1051
1051
|
return {
|
|
1052
|
-
[n.modelPropName || b]:
|
|
1053
|
-
...
|
|
1054
|
-
disabled:
|
|
1052
|
+
[n.modelPropName || b]: w(n.name),
|
|
1053
|
+
...O(n),
|
|
1054
|
+
disabled: x(n),
|
|
1055
1055
|
ref: V(n)
|
|
1056
1056
|
};
|
|
1057
|
-
},
|
|
1057
|
+
}, p = (n) => {
|
|
1058
1058
|
const b = n.type === "custom" ? "modelValue" : "value", I = n.modelPropName || b;
|
|
1059
1059
|
return { [n.modelEventName || `update:${I}`]: (q) => m(n.name, q) };
|
|
1060
1060
|
}, N = (n) => {
|
|
1061
1061
|
if (!n) return {};
|
|
1062
1062
|
const b = { ...n };
|
|
1063
1063
|
return delete b.options, delete b.labelField, delete b.valueField, b;
|
|
1064
|
-
},
|
|
1064
|
+
}, d = (n) => {
|
|
1065
1065
|
if (!n) return {};
|
|
1066
1066
|
const b = { ...n };
|
|
1067
1067
|
return delete b.text, b;
|
|
1068
|
-
},
|
|
1068
|
+
}, w = (n) => Gt(i.value, n), m = (n, b) => {
|
|
1069
1069
|
Tu(i.value, n, b);
|
|
1070
|
-
},
|
|
1070
|
+
}, F = (n, b) => {
|
|
1071
1071
|
b ? g.value[n] = b : delete g.value[n];
|
|
1072
1072
|
}, V = (n) => {
|
|
1073
1073
|
const b = n.name;
|
|
1074
1074
|
return n.ref ? typeof n.ref == "function" ? (I) => {
|
|
1075
|
-
|
|
1075
|
+
F(b, I), n.ref(I);
|
|
1076
1076
|
} : (I) => {
|
|
1077
|
-
|
|
1078
|
-
} : (I) =>
|
|
1079
|
-
},
|
|
1077
|
+
F(b, I), n.ref.value = I;
|
|
1078
|
+
} : (I) => F(b, I);
|
|
1079
|
+
}, P = (n) => {
|
|
1080
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) {
|
|
@@ -1130,14 +1130,14 @@ var xu = /* @__PURE__ */ he({
|
|
|
1130
1130
|
}, gt = (n) => ({
|
|
1131
1131
|
span: ge(n.span ?? r.cols),
|
|
1132
1132
|
offset: n.offset
|
|
1133
|
-
}),
|
|
1133
|
+
}), k = async (...n) => {
|
|
1134
1134
|
await o.value.validate(...n);
|
|
1135
|
-
},
|
|
1135
|
+
}, S = async (n, b) => {
|
|
1136
1136
|
const I = Array.isArray(n) ? n : [n];
|
|
1137
1137
|
await o.value.validate(b, (q) => I.some((ee) => q.key === ee));
|
|
1138
|
-
},
|
|
1139
|
-
if (
|
|
1140
|
-
const n = Kt(
|
|
1138
|
+
}, D = () => o.value?.restoreValidation(), ve = () => {
|
|
1139
|
+
if (D(), h.value !== void 0) {
|
|
1140
|
+
const n = Kt(h.value), b = i.value;
|
|
1141
1141
|
(/* @__PURE__ */ new Set([...Object.keys(b), ...Object.keys(n)])).forEach((I) => {
|
|
1142
1142
|
b[I] = I in n ? n[I] : null;
|
|
1143
1143
|
});
|
|
@@ -1145,7 +1145,7 @@ var xu = /* @__PURE__ */ he({
|
|
|
1145
1145
|
l("reset");
|
|
1146
1146
|
}, Ke = async () => {
|
|
1147
1147
|
try {
|
|
1148
|
-
await
|
|
1148
|
+
await k(), l("submit", i.value);
|
|
1149
1149
|
} catch (n) {
|
|
1150
1150
|
l("validate", n);
|
|
1151
1151
|
}
|
|
@@ -1154,9 +1154,9 @@ var xu = /* @__PURE__ */ he({
|
|
|
1154
1154
|
};
|
|
1155
1155
|
return t({
|
|
1156
1156
|
formRef: o.value,
|
|
1157
|
-
validate:
|
|
1158
|
-
validateField:
|
|
1159
|
-
restoreValidation:
|
|
1157
|
+
validate: k,
|
|
1158
|
+
validateField: S,
|
|
1159
|
+
restoreValidation: D,
|
|
1160
1160
|
getFormData: () => i.value,
|
|
1161
1161
|
setFormData: (n) => {
|
|
1162
1162
|
i.value = {
|
|
@@ -1172,162 +1172,162 @@ var xu = /* @__PURE__ */ he({
|
|
|
1172
1172
|
getFieldComponentRefs: () => ({ ...g.value })
|
|
1173
1173
|
}), (n, b) => {
|
|
1174
1174
|
const I = Xr, q = ea, ee = X, Z = Zr, De = Qr;
|
|
1175
|
-
return
|
|
1175
|
+
return _(), Q(te, null, [
|
|
1176
1176
|
U(n.$slots, "header", { model: i.value }, void 0, !0),
|
|
1177
|
-
C(
|
|
1177
|
+
C(y(tt), { show: r.loading }, {
|
|
1178
1178
|
default: s(() => [C(De, J({
|
|
1179
1179
|
ref_key: "formRef",
|
|
1180
1180
|
ref: o,
|
|
1181
1181
|
model: i.value
|
|
1182
|
-
},
|
|
1183
|
-
default: s(() => [C(Z, le(ue(
|
|
1184
|
-
default: s(() => [(
|
|
1185
|
-
default: s(() => [
|
|
1182
|
+
}, A.value), {
|
|
1183
|
+
default: s(() => [C(Z, le(ue(G.value)), {
|
|
1184
|
+
default: s(() => [(_(!0), Q(te, null, ne(j.value, (f) => (_(), $(q, J({ key: f.name }, { ref_for: !0 }, gt(f)), {
|
|
1185
|
+
default: s(() => [f.type === "slot" ? U(n.$slots, f.slot || f.name, {
|
|
1186
1186
|
key: 0,
|
|
1187
1187
|
model: i.value,
|
|
1188
|
-
schema:
|
|
1189
|
-
}, void 0, !0) : (
|
|
1188
|
+
schema: f
|
|
1189
|
+
}, void 0, !0) : (_(), $(I, J({
|
|
1190
1190
|
key: 1,
|
|
1191
|
-
path:
|
|
1192
|
-
}, { ref_for: !0 },
|
|
1193
|
-
default: s(() => [U(n.$slots, `field-${
|
|
1191
|
+
path: f.name
|
|
1192
|
+
}, { ref_for: !0 }, P(f)), de({
|
|
1193
|
+
default: s(() => [U(n.$slots, `field-${f.name}`, {
|
|
1194
1194
|
model: i.value,
|
|
1195
|
-
schema:
|
|
1196
|
-
value:
|
|
1197
|
-
setValue: (B) => m(
|
|
1198
|
-
}, () => [
|
|
1195
|
+
schema: f,
|
|
1196
|
+
value: w(f.name),
|
|
1197
|
+
setValue: (B) => m(f.name, B)
|
|
1198
|
+
}, () => [f.type === "radio-group" && f.props?.options ? (_(), $(y(Ne), J({
|
|
1199
1199
|
key: 0,
|
|
1200
|
-
value:
|
|
1201
|
-
"onUpdate:value": (B) => m(
|
|
1202
|
-
}, { ref_for: !0 }, N(
|
|
1200
|
+
value: w(f.name),
|
|
1201
|
+
"onUpdate:value": (B) => m(f.name, B)
|
|
1202
|
+
}, { ref_for: !0 }, N(f.props), {
|
|
1203
1203
|
ref_for: !0,
|
|
1204
|
-
ref: V(
|
|
1204
|
+
ref: V(f)
|
|
1205
1205
|
}), {
|
|
1206
|
-
default: s(() => [C(
|
|
1207
|
-
default: s(() => [(
|
|
1208
|
-
key: B[
|
|
1209
|
-
value: B[
|
|
1206
|
+
default: s(() => [C(y(ae), null, {
|
|
1207
|
+
default: s(() => [(_(!0), Q(te, null, ne(f.props.options, (B) => (_(), $(y(sa), {
|
|
1208
|
+
key: B[f.props.valueField || "value"],
|
|
1209
|
+
value: B[f.props.valueField || "value"],
|
|
1210
1210
|
disabled: B.disabled
|
|
1211
1211
|
}, {
|
|
1212
|
-
default: s(() => [
|
|
1212
|
+
default: s(() => [M(W(B[f.props.labelField || "label"]), 1)]),
|
|
1213
1213
|
_: 2
|
|
1214
1214
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
1215
1215
|
_: 2
|
|
1216
1216
|
}, 1024)]),
|
|
1217
1217
|
_: 2
|
|
1218
|
-
}, 1040, ["value", "onUpdate:value"])) :
|
|
1218
|
+
}, 1040, ["value", "onUpdate:value"])) : f.type === "radio-button-group" && f.props?.options ? (_(), $(y(Ne), J({
|
|
1219
1219
|
key: 1,
|
|
1220
|
-
value:
|
|
1221
|
-
"onUpdate:value": (B) => m(
|
|
1222
|
-
}, { ref_for: !0 }, N(
|
|
1220
|
+
value: w(f.name),
|
|
1221
|
+
"onUpdate:value": (B) => m(f.name, B)
|
|
1222
|
+
}, { ref_for: !0 }, N(f.props), {
|
|
1223
1223
|
ref_for: !0,
|
|
1224
|
-
ref: V(
|
|
1224
|
+
ref: V(f)
|
|
1225
1225
|
}), {
|
|
1226
|
-
default: s(() => [(
|
|
1227
|
-
key: B[
|
|
1228
|
-
value: B[
|
|
1226
|
+
default: s(() => [(_(!0), Q(te, null, ne(f.props.options, (B) => (_(), $(y(ua), {
|
|
1227
|
+
key: B[f.props.valueField || "value"],
|
|
1228
|
+
value: B[f.props.valueField || "value"],
|
|
1229
1229
|
disabled: B.disabled
|
|
1230
1230
|
}, {
|
|
1231
|
-
default: s(() => [
|
|
1231
|
+
default: s(() => [M(W(B[f.props.labelField || "label"]), 1)]),
|
|
1232
1232
|
_: 2
|
|
1233
1233
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
1234
1234
|
_: 2
|
|
1235
|
-
}, 1040, ["value", "onUpdate:value"])) :
|
|
1235
|
+
}, 1040, ["value", "onUpdate:value"])) : f.type === "checkbox-group" && f.props?.options ? (_(), $(y(et), J({
|
|
1236
1236
|
key: 2,
|
|
1237
|
-
value:
|
|
1238
|
-
"onUpdate:value": (B) => m(
|
|
1239
|
-
}, { ref_for: !0 }, N(
|
|
1237
|
+
value: w(f.name),
|
|
1238
|
+
"onUpdate:value": (B) => m(f.name, B)
|
|
1239
|
+
}, { ref_for: !0 }, N(f.props), {
|
|
1240
1240
|
ref_for: !0,
|
|
1241
|
-
ref: V(
|
|
1241
|
+
ref: V(f)
|
|
1242
1242
|
}), {
|
|
1243
|
-
default: s(() => [C(
|
|
1244
|
-
default: s(() => [(
|
|
1245
|
-
key: B[
|
|
1246
|
-
value: B[
|
|
1243
|
+
default: s(() => [C(y(ae), null, {
|
|
1244
|
+
default: s(() => [(_(!0), Q(te, null, ne(f.props.options, (B) => (_(), $(y(Ht), {
|
|
1245
|
+
key: B[f.props.valueField || "value"],
|
|
1246
|
+
value: B[f.props.valueField || "value"],
|
|
1247
1247
|
disabled: B.disabled
|
|
1248
1248
|
}, {
|
|
1249
|
-
default: s(() => [
|
|
1249
|
+
default: s(() => [M(W(B[f.props.labelField || "label"]), 1)]),
|
|
1250
1250
|
_: 2
|
|
1251
1251
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
1252
1252
|
_: 2
|
|
1253
1253
|
}, 1024)]),
|
|
1254
1254
|
_: 2
|
|
1255
|
-
}, 1040, ["value", "onUpdate:value"])) :
|
|
1255
|
+
}, 1040, ["value", "onUpdate:value"])) : f.type === "switch" ? (_(), $(me(E(f)), J({
|
|
1256
1256
|
key: 3,
|
|
1257
|
-
value:
|
|
1258
|
-
"onUpdate:value": (B) => m(
|
|
1259
|
-
}, { ref_for: !0 },
|
|
1260
|
-
disabled:
|
|
1257
|
+
value: w(f.name),
|
|
1258
|
+
"onUpdate:value": (B) => m(f.name, B)
|
|
1259
|
+
}, { ref_for: !0 }, f.props, {
|
|
1260
|
+
disabled: x(f),
|
|
1261
1261
|
ref_for: !0,
|
|
1262
|
-
ref: V(
|
|
1262
|
+
ref: V(f)
|
|
1263
1263
|
}), null, 16, [
|
|
1264
1264
|
"value",
|
|
1265
1265
|
"onUpdate:value",
|
|
1266
1266
|
"disabled"
|
|
1267
|
-
])) :
|
|
1267
|
+
])) : f.type === "image-upload" || f.type === "file-upload" ? (_(), $(me(E(f)), J({
|
|
1268
1268
|
key: 4,
|
|
1269
|
-
"file-list":
|
|
1270
|
-
"onUpdate:fileList": (B) => m(
|
|
1271
|
-
"upload-type":
|
|
1272
|
-
}, { ref_for: !0 },
|
|
1273
|
-
disabled:
|
|
1269
|
+
"file-list": w(f.name) || [],
|
|
1270
|
+
"onUpdate:fileList": (B) => m(f.name, B),
|
|
1271
|
+
"upload-type": f.type === "image-upload" ? "image" : "file"
|
|
1272
|
+
}, { ref_for: !0 }, f.props, {
|
|
1273
|
+
disabled: x(f),
|
|
1274
1274
|
ref_for: !0,
|
|
1275
|
-
ref: V(
|
|
1275
|
+
ref: V(f)
|
|
1276
1276
|
}), null, 16, [
|
|
1277
1277
|
"file-list",
|
|
1278
1278
|
"onUpdate:fileList",
|
|
1279
1279
|
"upload-type",
|
|
1280
1280
|
"disabled"
|
|
1281
|
-
])) : (
|
|
1281
|
+
])) : (_(), $(me(E(f)), J({
|
|
1282
1282
|
key: 5,
|
|
1283
1283
|
ref_for: !0
|
|
1284
|
-
},
|
|
1284
|
+
}, K(f), wa(p(f))), null, 16))], !0)]),
|
|
1285
1285
|
_: 2
|
|
1286
|
-
}, [typeof
|
|
1286
|
+
}, [typeof f.label == "function" || f.help ? {
|
|
1287
1287
|
name: "label",
|
|
1288
|
-
fn: s(() => [typeof
|
|
1288
|
+
fn: s(() => [typeof f.label == "function" ? (_(), $(me(f.label), { key: 0 })) : (_(), Q(te, { key: 1 }, [M(W(f.label), 1)], 64)), f.help ? (_(), $(y(Be), {
|
|
1289
1289
|
key: 2,
|
|
1290
1290
|
trigger: "hover"
|
|
1291
1291
|
}, {
|
|
1292
|
-
trigger: s(() => [C(
|
|
1292
|
+
trigger: s(() => [C(y(H), {
|
|
1293
1293
|
class: "dydx-form-help-icon",
|
|
1294
1294
|
size: 16
|
|
1295
1295
|
}, {
|
|
1296
|
-
default: s(() => [C(
|
|
1296
|
+
default: s(() => [C(y(Sa))]),
|
|
1297
1297
|
_: 1
|
|
1298
1298
|
})]),
|
|
1299
|
-
default: s(() => [
|
|
1299
|
+
default: s(() => [M(" " + W(f.help), 1)]),
|
|
1300
1300
|
_: 2
|
|
1301
1301
|
}, 1024)) : Y("", !0)]),
|
|
1302
1302
|
key: "0"
|
|
1303
1303
|
} : void 0]), 1040, ["path"]))]),
|
|
1304
1304
|
_: 2
|
|
1305
|
-
}, 1040))), 128)), r.showFooter ? (
|
|
1305
|
+
}, 1040))), 128)), r.showFooter ? (_(), $(q, {
|
|
1306
1306
|
key: 0,
|
|
1307
1307
|
span: r.footerSpan
|
|
1308
1308
|
}, {
|
|
1309
1309
|
default: s(() => [U(n.$slots, "footer", {
|
|
1310
1310
|
model: i.value,
|
|
1311
|
-
validate:
|
|
1311
|
+
validate: k,
|
|
1312
1312
|
reset: ve
|
|
1313
|
-
}, () => [C(
|
|
1313
|
+
}, () => [C(y(ae), { justify: r.footerAlign }, {
|
|
1314
1314
|
default: s(() => [
|
|
1315
|
-
|
|
1316
|
-
default: s(() => [
|
|
1315
|
+
c.value.hidden ? Y("", !0) : (_(), $(ee, J({ key: 0 }, d(c.value), { onClick: Ge }), {
|
|
1316
|
+
default: s(() => [M(W(c.value.text), 1)]),
|
|
1317
1317
|
_: 1
|
|
1318
1318
|
}, 16)),
|
|
1319
|
-
|
|
1320
|
-
default: s(() => [
|
|
1319
|
+
u.value.hidden ? Y("", !0) : (_(), $(ee, J({ key: 1 }, d(u.value), { onClick: Ke }), {
|
|
1320
|
+
default: s(() => [M(W(u.value.text), 1)]),
|
|
1321
1321
|
_: 1
|
|
1322
1322
|
}, 16)),
|
|
1323
|
-
(
|
|
1324
|
-
key:
|
|
1325
|
-
type:
|
|
1326
|
-
size:
|
|
1327
|
-
disabled:
|
|
1328
|
-
onClick:
|
|
1323
|
+
(_(!0), Q(te, null, ne(r.extraButtons, (f) => (_(), $(ee, {
|
|
1324
|
+
key: f.text,
|
|
1325
|
+
type: f.type,
|
|
1326
|
+
size: f.size,
|
|
1327
|
+
disabled: f.disabled,
|
|
1328
|
+
onClick: f.onClick
|
|
1329
1329
|
}, {
|
|
1330
|
-
default: s(() => [
|
|
1330
|
+
default: s(() => [M(W(f.text), 1)]),
|
|
1331
1331
|
_: 2
|
|
1332
1332
|
}, 1032, [
|
|
1333
1333
|
"type",
|
|
@@ -1356,20 +1356,20 @@ 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:
|
|
1360
|
-
if (
|
|
1361
|
-
if (typeof
|
|
1359
|
+
const { maxVisible: t = -1, buttons: a = [], showView: r = !1, showEdit: l = !0, showDelete: i = !0, viewConfig: o, editConfig: g, deleteConfig: h, onView: v, onEdit: u, onDelete: c } = e, j = (d, w, m, F) => w ? d ? typeof d.show == "function" ? d.show(m, F) : d.show !== !1 : !0 : !1, A = (d, w, m) => d ? typeof d.disabled == "function" ? d.disabled(w, m) : d.disabled === !0 : !1, G = (d, w, m) => typeof d.show == "function" ? d.show(w, m) : d.show !== !1, E = (d, w, m) => typeof d.disabled == "function" ? d.disabled(w, m) : d.disabled === !0, x = (d, w, m = "确认操作") => {
|
|
1360
|
+
if (d) {
|
|
1361
|
+
if (typeof d == "string") return {
|
|
1362
1362
|
title: m,
|
|
1363
|
-
content:
|
|
1363
|
+
content: d,
|
|
1364
1364
|
type: "warning",
|
|
1365
1365
|
positiveText: "确定",
|
|
1366
1366
|
negativeText: "取消"
|
|
1367
1367
|
};
|
|
1368
|
-
if (typeof
|
|
1369
|
-
const
|
|
1370
|
-
return typeof
|
|
1368
|
+
if (typeof d == "function") {
|
|
1369
|
+
const F = d(w);
|
|
1370
|
+
return typeof F == "string" ? {
|
|
1371
1371
|
title: m,
|
|
1372
|
-
content:
|
|
1372
|
+
content: F,
|
|
1373
1373
|
type: "warning",
|
|
1374
1374
|
positiveText: "确定",
|
|
1375
1375
|
negativeText: "取消"
|
|
@@ -1378,7 +1378,7 @@ function ku(e) {
|
|
|
1378
1378
|
type: "warning",
|
|
1379
1379
|
positiveText: "确定",
|
|
1380
1380
|
negativeText: "取消",
|
|
1381
|
-
...
|
|
1381
|
+
...F
|
|
1382
1382
|
};
|
|
1383
1383
|
}
|
|
1384
1384
|
return {
|
|
@@ -1386,118 +1386,118 @@ function ku(e) {
|
|
|
1386
1386
|
type: "warning",
|
|
1387
1387
|
positiveText: "确定",
|
|
1388
1388
|
negativeText: "取消",
|
|
1389
|
-
...
|
|
1389
|
+
...d
|
|
1390
1390
|
};
|
|
1391
1391
|
}
|
|
1392
|
-
},
|
|
1393
|
-
const { dialog: m } = va(["dialog"]),
|
|
1394
|
-
...
|
|
1395
|
-
onPositiveClick: () => (
|
|
1392
|
+
}, O = (d, w) => {
|
|
1393
|
+
const { dialog: m } = va(["dialog"]), F = {
|
|
1394
|
+
...d,
|
|
1395
|
+
onPositiveClick: () => (w(), !0)
|
|
1396
1396
|
};
|
|
1397
|
-
switch (
|
|
1397
|
+
switch (d.type) {
|
|
1398
1398
|
case "info":
|
|
1399
|
-
m.info(
|
|
1399
|
+
m.info(F);
|
|
1400
1400
|
break;
|
|
1401
1401
|
case "success":
|
|
1402
|
-
m.success(
|
|
1402
|
+
m.success(F);
|
|
1403
1403
|
break;
|
|
1404
1404
|
case "error":
|
|
1405
|
-
m.error(
|
|
1405
|
+
m.error(F);
|
|
1406
1406
|
break;
|
|
1407
1407
|
case "warning":
|
|
1408
1408
|
default:
|
|
1409
|
-
m.warning(
|
|
1409
|
+
m.warning(F);
|
|
1410
1410
|
break;
|
|
1411
1411
|
}
|
|
1412
|
-
},
|
|
1413
|
-
const
|
|
1414
|
-
|
|
1412
|
+
}, K = (d) => {
|
|
1413
|
+
const w = () => {
|
|
1414
|
+
d.confirm ? O(d.confirm, d.onClick) : d.onClick();
|
|
1415
1415
|
};
|
|
1416
|
-
return
|
|
1417
|
-
type:
|
|
1416
|
+
return T(X, {
|
|
1417
|
+
type: d.type,
|
|
1418
1418
|
size: "small",
|
|
1419
|
-
disabled:
|
|
1420
|
-
onClick:
|
|
1421
|
-
renderIcon:
|
|
1422
|
-
}, { default: () =>
|
|
1423
|
-
},
|
|
1424
|
-
const
|
|
1425
|
-
label:
|
|
1426
|
-
key:
|
|
1427
|
-
disabled:
|
|
1419
|
+
disabled: d.disabled,
|
|
1420
|
+
onClick: w,
|
|
1421
|
+
renderIcon: d.icon
|
|
1422
|
+
}, { default: () => d.label });
|
|
1423
|
+
}, p = (d) => {
|
|
1424
|
+
const w = d.map((F) => ({
|
|
1425
|
+
label: F.label,
|
|
1426
|
+
key: F.key,
|
|
1427
|
+
disabled: F.disabled
|
|
1428
1428
|
}));
|
|
1429
|
-
return
|
|
1430
|
-
options:
|
|
1429
|
+
return T(Wr, {
|
|
1430
|
+
options: w,
|
|
1431
1431
|
trigger: "click",
|
|
1432
|
-
onSelect: (
|
|
1433
|
-
const V =
|
|
1434
|
-
V && (V.confirm ?
|
|
1432
|
+
onSelect: (F) => {
|
|
1433
|
+
const V = d.find((P) => P.key === F);
|
|
1434
|
+
V && (V.confirm ? O(V.confirm, V.onClick) : V.onClick());
|
|
1435
1435
|
}
|
|
1436
|
-
}, { default: () =>
|
|
1436
|
+
}, { default: () => T(X, { size: "small" }, { default: () => "更多" }) });
|
|
1437
1437
|
};
|
|
1438
1438
|
return {
|
|
1439
|
-
renderActions: (
|
|
1439
|
+
renderActions: (d, w) => {
|
|
1440
1440
|
const m = [];
|
|
1441
|
-
if (
|
|
1441
|
+
if (j(o, r, d, w) && m.push({
|
|
1442
1442
|
key: "__view__",
|
|
1443
1443
|
label: o?.label || "查看",
|
|
1444
1444
|
type: "info",
|
|
1445
|
-
disabled:
|
|
1446
|
-
icon: () =>
|
|
1447
|
-
onClick: () =>
|
|
1448
|
-
row:
|
|
1449
|
-
index:
|
|
1445
|
+
disabled: A(o, d, w),
|
|
1446
|
+
icon: () => T(H, null, { default: () => T(ka) }),
|
|
1447
|
+
onClick: () => v?.({
|
|
1448
|
+
row: d,
|
|
1449
|
+
index: w
|
|
1450
1450
|
})
|
|
1451
|
-
}),
|
|
1451
|
+
}), j(g, l, d, w) && m.push({
|
|
1452
1452
|
key: "__edit__",
|
|
1453
1453
|
label: g?.label || "编辑",
|
|
1454
1454
|
type: "primary",
|
|
1455
|
-
disabled:
|
|
1456
|
-
icon: () =>
|
|
1457
|
-
onClick: () =>
|
|
1458
|
-
row:
|
|
1459
|
-
index:
|
|
1455
|
+
disabled: A(g, d, w),
|
|
1456
|
+
icon: () => T(H, null, { default: () => T(Ta) }),
|
|
1457
|
+
onClick: () => u?.({
|
|
1458
|
+
row: d,
|
|
1459
|
+
index: w
|
|
1460
1460
|
})
|
|
1461
|
-
}),
|
|
1461
|
+
}), j(h, i, d, w) && m.push({
|
|
1462
1462
|
key: "__delete__",
|
|
1463
|
-
label:
|
|
1463
|
+
label: h?.label || "删除",
|
|
1464
1464
|
type: "error",
|
|
1465
|
-
disabled:
|
|
1466
|
-
confirm:
|
|
1465
|
+
disabled: A(h, d, w),
|
|
1466
|
+
confirm: x(h?.confirm, d, "确认删除") || {
|
|
1467
1467
|
title: "确认删除",
|
|
1468
1468
|
content: "确定删除此记录吗?",
|
|
1469
1469
|
type: "warning",
|
|
1470
1470
|
positiveText: "确定",
|
|
1471
1471
|
negativeText: "取消"
|
|
1472
1472
|
},
|
|
1473
|
-
icon: () =>
|
|
1474
|
-
onClick: () =>
|
|
1475
|
-
row:
|
|
1476
|
-
index:
|
|
1473
|
+
icon: () => T(H, null, { default: () => T(Oa) }),
|
|
1474
|
+
onClick: () => c?.({
|
|
1475
|
+
row: d,
|
|
1476
|
+
index: w
|
|
1477
1477
|
})
|
|
1478
|
-
}), a.forEach((
|
|
1479
|
-
|
|
1480
|
-
key:
|
|
1481
|
-
label:
|
|
1482
|
-
type:
|
|
1483
|
-
disabled:
|
|
1484
|
-
confirm:
|
|
1485
|
-
icon:
|
|
1486
|
-
onClick: () =>
|
|
1478
|
+
}), a.forEach((P) => {
|
|
1479
|
+
G(P, d, w) && m.push({
|
|
1480
|
+
key: P.key || P.label,
|
|
1481
|
+
label: P.label,
|
|
1482
|
+
type: P.type || "default",
|
|
1483
|
+
disabled: E(P, d, w),
|
|
1484
|
+
confirm: x(P.confirm, d, "确认操作"),
|
|
1485
|
+
icon: P.icon,
|
|
1486
|
+
onClick: () => P.onClick?.(d, w)
|
|
1487
1487
|
});
|
|
1488
|
-
}), t === -1 || m.length <= t) return
|
|
1488
|
+
}), t === -1 || m.length <= t) return T(ae, {
|
|
1489
1489
|
size: "small",
|
|
1490
1490
|
wrap: !1
|
|
1491
|
-
}, () => m.map((
|
|
1492
|
-
if (t === 0) return
|
|
1493
|
-
const
|
|
1494
|
-
return
|
|
1491
|
+
}, () => m.map((P) => K(P)));
|
|
1492
|
+
if (t === 0) return p(m);
|
|
1493
|
+
const F = m.slice(0, t), V = m.slice(t);
|
|
1494
|
+
return T(ae, {
|
|
1495
1495
|
size: "small",
|
|
1496
1496
|
wrap: !1
|
|
1497
|
-
}, () => [...
|
|
1497
|
+
}, () => [...F.map((P) => K(P)), p(V)]);
|
|
1498
1498
|
},
|
|
1499
|
-
isButtonVisible:
|
|
1500
|
-
isButtonDisabled:
|
|
1499
|
+
isButtonVisible: G,
|
|
1500
|
+
isButtonDisabled: E
|
|
1501
1501
|
};
|
|
1502
1502
|
}
|
|
1503
1503
|
var Su = (e) => {
|
|
@@ -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, T(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: () => T(H, { size: 14 }, () => T($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 T(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 T(Be, { trigger: "hover" }, {
|
|
1550
|
+
trigger: () => T(X, {
|
|
1551
1551
|
text: !0,
|
|
1552
1552
|
type: "primary",
|
|
1553
1553
|
onClick: i
|
|
1554
1554
|
}, {
|
|
1555
|
-
default: () =>
|
|
1555
|
+
default: () => T("span", { style: {
|
|
1556
1556
|
maxWidth: "150px",
|
|
1557
1557
|
overflow: "hidden",
|
|
1558
1558
|
textOverflow: "ellipsis",
|
|
@@ -1560,32 +1560,32 @@ var Su = (e) => {
|
|
|
1560
1560
|
display: "inline-block",
|
|
1561
1561
|
verticalAlign: "middle"
|
|
1562
1562
|
} }, l),
|
|
1563
|
-
icon: () =>
|
|
1563
|
+
icon: () => T(H, { size: 14 }, () => T(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 ? T(H, {
|
|
1571
1571
|
size: t?.size ?? 20,
|
|
1572
1572
|
color: t?.color
|
|
1573
|
-
}, () =>
|
|
1573
|
+
}, () => T(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 T(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 T(Ve, {
|
|
1584
1584
|
size: "small",
|
|
1585
|
-
...Object.keys(l).reduce((g,
|
|
1585
|
+
...Object.keys(l).reduce((g, h) => (h !== a && h !== r && (g[h] = i[h]), g), {})
|
|
1586
1586
|
}, () => o);
|
|
1587
1587
|
}
|
|
1588
|
-
return
|
|
1588
|
+
return T(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"), "-";
|
|
@@ -1593,47 +1593,47 @@ var Su = (e) => {
|
|
|
1593
1593
|
checked: !0,
|
|
1594
1594
|
unchecked: !1
|
|
1595
1595
|
}).checked, i = typeof r.disabled == "function" ? r.disabled(t, a) : r.disabled || !1;
|
|
1596
|
-
return
|
|
1597
|
-
const o = re(!1), g = re(l),
|
|
1596
|
+
return T({ setup() {
|
|
1597
|
+
const o = re(!1), g = re(l), h = async (v) => {
|
|
1598
1598
|
if (!(o.value || i))
|
|
1599
1599
|
try {
|
|
1600
1600
|
o.value = !0;
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1603
|
-
} catch (
|
|
1604
|
-
console.error("Switch change failed:",
|
|
1601
|
+
const u = r.onChange(v, t, a);
|
|
1602
|
+
u && typeof u.then == "function" && await u, g.value = v;
|
|
1603
|
+
} catch (u) {
|
|
1604
|
+
console.error("Switch change failed:", u);
|
|
1605
1605
|
} finally {
|
|
1606
1606
|
o.value = !1;
|
|
1607
1607
|
}
|
|
1608
1608
|
};
|
|
1609
1609
|
return () => {
|
|
1610
|
-
const
|
|
1610
|
+
const v = T(Wt, {
|
|
1611
1611
|
value: g.value,
|
|
1612
1612
|
size: r.size || "medium",
|
|
1613
1613
|
disabled: i || o.value,
|
|
1614
1614
|
loading: o.value,
|
|
1615
|
-
onUpdateValue: r.confirm ? void 0 :
|
|
1615
|
+
onUpdateValue: r.confirm ? void 0 : h
|
|
1616
1616
|
});
|
|
1617
1617
|
if (r.confirm && !i) {
|
|
1618
|
-
const
|
|
1619
|
-
return
|
|
1620
|
-
onPositiveClick: () =>
|
|
1618
|
+
const u = typeof r.confirm.text == "function" ? r.confirm.text(!g.value, t) : r.confirm.text;
|
|
1619
|
+
return T(la, {
|
|
1620
|
+
onPositiveClick: () => h(!g.value),
|
|
1621
1621
|
positiveText: r.confirm.okText || "确认",
|
|
1622
1622
|
negativeText: r.confirm.cancelText || "取消"
|
|
1623
1623
|
}, {
|
|
1624
|
-
trigger: () =>
|
|
1625
|
-
default: () =>
|
|
1624
|
+
trigger: () => v,
|
|
1625
|
+
default: () => u
|
|
1626
1626
|
});
|
|
1627
1627
|
}
|
|
1628
|
-
return
|
|
1628
|
+
return v;
|
|
1629
1629
|
};
|
|
1630
1630
|
} });
|
|
1631
|
-
}, Nr = (e, t, a = "label", r = "value") => e == null ? "-" : Array.isArray(e) ?
|
|
1631
|
+
}, Nr = (e, t, a = "label", r = "value") => e == null ? "-" : Array.isArray(e) ? T(ae, {
|
|
1632
1632
|
size: "small",
|
|
1633
1633
|
wrap: !0
|
|
1634
1634
|
}, () => e.map((l, i) => {
|
|
1635
1635
|
const o = Ze(l, t, a, r);
|
|
1636
|
-
return typeof o == "string" ?
|
|
1636
|
+
return typeof o == "string" ? T("span", { key: i }, o) : o;
|
|
1637
1637
|
})) : Ze(e, t, a, r);
|
|
1638
1638
|
const Br = (e, t, a, r) => {
|
|
1639
1639
|
switch (a.columnType || "text") {
|
|
@@ -1672,73 +1672,73 @@ function Vt(e) {
|
|
|
1672
1672
|
return typeof e == "function" ? e() : e;
|
|
1673
1673
|
}
|
|
1674
1674
|
function $u(e) {
|
|
1675
|
-
const { onView: t, onEdit: a, onDelete: r } = e, l =
|
|
1676
|
-
if ("title" in
|
|
1677
|
-
if (typeof
|
|
1678
|
-
if (typeof
|
|
1675
|
+
const { onView: t, onEdit: a, onDelete: r } = e, l = L(() => Vt(e.columns)), i = L(() => Vt(e.actionColumn)), o = (p) => "key" in p && p.key ? String(p.key) : "type" in p ? `__${p.type}__` : "", g = (p) => {
|
|
1676
|
+
if ("title" in p) {
|
|
1677
|
+
if (typeof p.title == "string") return p.title;
|
|
1678
|
+
if (typeof p.title == "function") return "自定义列";
|
|
1679
1679
|
}
|
|
1680
|
-
return o(
|
|
1681
|
-
},
|
|
1682
|
-
Qt(l, (
|
|
1683
|
-
const
|
|
1684
|
-
m.forEach((
|
|
1685
|
-
const ye =
|
|
1686
|
-
ye &&
|
|
1687
|
-
}),
|
|
1680
|
+
return o(p);
|
|
1681
|
+
}, h = (p) => "defaultVisible" in p ? p.defaultVisible !== !1 : !0, v = (p) => "type" in p && (p.type === "selection" || p.type === "expand") ? !1 : "configurable" in p ? p.configurable !== !1 : !0, u = (p) => p.filter((N) => h(N)).map((N) => o(N)).filter(Boolean), c = re(u(l.value));
|
|
1682
|
+
Qt(l, (p, N) => {
|
|
1683
|
+
const d = p.map((P) => o(P)).filter(Boolean), w = N?.map((P) => o(P)).filter(Boolean) || [], m = d.filter((P) => !w.includes(P)), F = w.filter((P) => !d.includes(P)), V = c.value.filter((P) => !F.includes(P));
|
|
1684
|
+
m.forEach((P) => {
|
|
1685
|
+
const ye = p.find((ge) => o(ge) === P);
|
|
1686
|
+
ye && h(ye) && V.push(P);
|
|
1687
|
+
}), c.value = V;
|
|
1688
1688
|
});
|
|
1689
|
-
const
|
|
1690
|
-
key: o(
|
|
1691
|
-
title: g(
|
|
1692
|
-
visible:
|
|
1693
|
-
configurable:
|
|
1694
|
-
}))),
|
|
1695
|
-
if (
|
|
1689
|
+
const j = L(() => l.value.filter((p) => o(p) && v(p)).map((p) => ({
|
|
1690
|
+
key: o(p),
|
|
1691
|
+
title: g(p),
|
|
1692
|
+
visible: c.value.includes(o(p)),
|
|
1693
|
+
configurable: v(p)
|
|
1694
|
+
}))), A = (p) => {
|
|
1695
|
+
if (p?.show === !1) return null;
|
|
1696
1696
|
const { renderActions: N } = ku({
|
|
1697
|
-
...
|
|
1697
|
+
...p,
|
|
1698
1698
|
onView: t,
|
|
1699
1699
|
onEdit: a,
|
|
1700
1700
|
onDelete: r
|
|
1701
1701
|
});
|
|
1702
1702
|
return {
|
|
1703
1703
|
key: "__actions__",
|
|
1704
|
-
title:
|
|
1705
|
-
width:
|
|
1706
|
-
minWidth:
|
|
1707
|
-
fixed:
|
|
1704
|
+
title: p?.title || "操作",
|
|
1705
|
+
width: p?.width || 260,
|
|
1706
|
+
minWidth: p?.minWidth,
|
|
1707
|
+
fixed: p?.fixed !== !1 ? p?.fixed || "right" : void 0,
|
|
1708
1708
|
align: "center",
|
|
1709
|
-
render: (
|
|
1709
|
+
render: (d, w) => N(d, w)
|
|
1710
1710
|
};
|
|
1711
|
-
},
|
|
1712
|
-
if ("columnType" in
|
|
1713
|
-
const N =
|
|
1711
|
+
}, G = (p) => {
|
|
1712
|
+
if ("columnType" in p && zr(p)) {
|
|
1713
|
+
const N = p.key;
|
|
1714
1714
|
return {
|
|
1715
|
-
...
|
|
1716
|
-
align:
|
|
1717
|
-
render: (
|
|
1715
|
+
...p,
|
|
1716
|
+
align: p.align || "center",
|
|
1717
|
+
render: (d, w) => Br(N ? d[N] : void 0, d, l.value.find((m) => "key" in m && m.key === N) || p, w)
|
|
1718
1718
|
};
|
|
1719
1719
|
}
|
|
1720
1720
|
return {
|
|
1721
|
-
...
|
|
1722
|
-
align:
|
|
1721
|
+
...p,
|
|
1722
|
+
align: p.align || "center"
|
|
1723
1723
|
};
|
|
1724
1724
|
};
|
|
1725
1725
|
return {
|
|
1726
|
-
mergedColumns:
|
|
1727
|
-
const
|
|
1728
|
-
const
|
|
1729
|
-
return "type" in m && (m.type === "selection" || m.type === "expand") || !
|
|
1730
|
-
}).map((m) =>
|
|
1731
|
-
return
|
|
1726
|
+
mergedColumns: L(() => {
|
|
1727
|
+
const p = l.value, N = i.value, d = p.filter((m) => {
|
|
1728
|
+
const F = o(m);
|
|
1729
|
+
return "type" in m && (m.type === "selection" || m.type === "expand") || !F ? !0 : c.value.includes(F);
|
|
1730
|
+
}).map((m) => G(m)), w = A(N);
|
|
1731
|
+
return w && d.push(w), d;
|
|
1732
1732
|
}),
|
|
1733
|
-
configurableColumns:
|
|
1734
|
-
visibleColumnKeys:
|
|
1735
|
-
setVisibleColumnKeys: (
|
|
1736
|
-
|
|
1733
|
+
configurableColumns: j,
|
|
1734
|
+
visibleColumnKeys: c,
|
|
1735
|
+
setVisibleColumnKeys: (p) => {
|
|
1736
|
+
c.value = p;
|
|
1737
1737
|
},
|
|
1738
1738
|
resetColumnSetting: () => {
|
|
1739
|
-
|
|
1739
|
+
c.value = u(l.value);
|
|
1740
1740
|
},
|
|
1741
|
-
getVisibleColumnKeys: () => [...
|
|
1741
|
+
getVisibleColumnKeys: () => [...c.value]
|
|
1742
1742
|
};
|
|
1743
1743
|
}
|
|
1744
1744
|
var Au = {
|
|
@@ -1756,47 +1756,52 @@ var Au = {
|
|
|
1756
1756
|
showQuickJumper: !0
|
|
1757
1757
|
};
|
|
1758
1758
|
function Pu(e) {
|
|
1759
|
-
const {
|
|
1759
|
+
const { onUpdatePagination: t, onPageChange: a } = e, r = () => ({
|
|
1760
1760
|
...Au,
|
|
1761
|
-
...
|
|
1762
|
-
}),
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
},
|
|
1779
|
-
const
|
|
1761
|
+
...e.fieldNames
|
|
1762
|
+
}), l = (u) => {
|
|
1763
|
+
const c = e.pagination;
|
|
1764
|
+
if (!(c === !1 || !c))
|
|
1765
|
+
return c[r()[u]];
|
|
1766
|
+
}, i = L(() => {
|
|
1767
|
+
const u = e.pagination;
|
|
1768
|
+
return u === !1 || !u ? !1 : {
|
|
1769
|
+
page: l("page") ?? 1,
|
|
1770
|
+
pageSize: l("pageSize") ?? 10,
|
|
1771
|
+
itemCount: l("itemCount"),
|
|
1772
|
+
pageSizes: u.pageSizes ?? We.pageSizes,
|
|
1773
|
+
showSizePicker: u.showSizePicker ?? We.showSizePicker,
|
|
1774
|
+
showQuickJumper: u.showQuickJumper ?? We.showQuickJumper,
|
|
1775
|
+
prefix: u.prefix,
|
|
1776
|
+
suffix: u.suffix
|
|
1777
|
+
};
|
|
1778
|
+
}), o = (u) => {
|
|
1779
|
+
const c = e.pagination;
|
|
1780
|
+
if (c === !1 || !c) return {};
|
|
1781
|
+
const j = r(), A = { ...c };
|
|
1782
|
+
return u.page !== void 0 && (A[j.page] = u.page), u.pageSize !== void 0 && (A[j.pageSize] = u.pageSize), A;
|
|
1783
|
+
}, g = (u) => {
|
|
1784
|
+
const c = r();
|
|
1780
1785
|
return {
|
|
1781
|
-
[
|
|
1782
|
-
[
|
|
1783
|
-
[
|
|
1786
|
+
[c.page]: u[c.page],
|
|
1787
|
+
[c.pageSize]: u[c.pageSize],
|
|
1788
|
+
[c.itemCount]: u[c.itemCount]
|
|
1784
1789
|
};
|
|
1785
1790
|
};
|
|
1786
1791
|
return {
|
|
1787
|
-
paginationConfig:
|
|
1788
|
-
handlePageChange: (
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1792
|
+
paginationConfig: i,
|
|
1793
|
+
handlePageChange: (u) => {
|
|
1794
|
+
const c = o({ page: u });
|
|
1795
|
+
t?.(c), a?.(g(c));
|
|
1791
1796
|
},
|
|
1792
|
-
handlePageSizeChange: (
|
|
1793
|
-
const
|
|
1797
|
+
handlePageSizeChange: (u) => {
|
|
1798
|
+
const c = o({
|
|
1794
1799
|
page: 1,
|
|
1795
|
-
pageSize:
|
|
1800
|
+
pageSize: u
|
|
1796
1801
|
});
|
|
1797
|
-
|
|
1802
|
+
t?.(c), a?.(g(c));
|
|
1798
1803
|
},
|
|
1799
|
-
getFieldNames:
|
|
1804
|
+
getFieldNames: r
|
|
1800
1805
|
};
|
|
1801
1806
|
}
|
|
1802
1807
|
var Ou = {
|
|
@@ -1853,195 +1858,195 @@ var Ou = {
|
|
|
1853
1858
|
"delete"
|
|
1854
1859
|
],
|
|
1855
1860
|
setup(e, { expose: t, emit: a }) {
|
|
1856
|
-
const r = e, l = a, i = rt(), o = re(null), g = re(void 0),
|
|
1857
|
-
const
|
|
1858
|
-
return
|
|
1859
|
-
},
|
|
1860
|
-
let
|
|
1861
|
-
for (;
|
|
1862
|
-
if (
|
|
1863
|
-
|
|
1861
|
+
const r = e, l = a, i = rt(), o = re(null), g = re(void 0), h = L(() => !i.maxHeight), v = (k) => {
|
|
1862
|
+
const S = getComputedStyle(k);
|
|
1863
|
+
return k.clientHeight <= 0 ? !1 : !!(parseFloat(S.flexGrow) > 0 || S.height && S.height !== "auto" && S.height !== "0px" || S.maxHeight && S.maxHeight !== "none" && S.maxHeight !== "0px" || S.overflowY === "auto" || S.overflowY === "scroll");
|
|
1864
|
+
}, u = (k) => {
|
|
1865
|
+
let S = k.parentElement;
|
|
1866
|
+
for (; S && S !== document.body; ) {
|
|
1867
|
+
if (v(S)) return S;
|
|
1868
|
+
S = S.parentElement;
|
|
1864
1869
|
}
|
|
1865
1870
|
return null;
|
|
1866
|
-
},
|
|
1867
|
-
|
|
1868
|
-
const
|
|
1869
|
-
if (
|
|
1870
|
-
const
|
|
1871
|
-
if (!
|
|
1871
|
+
}, c = () => {
|
|
1872
|
+
h.value && ha(() => {
|
|
1873
|
+
const k = o.value;
|
|
1874
|
+
if (!k) return;
|
|
1875
|
+
const S = u(k);
|
|
1876
|
+
if (!S) {
|
|
1872
1877
|
g.value = void 0;
|
|
1873
1878
|
return;
|
|
1874
1879
|
}
|
|
1875
|
-
const
|
|
1880
|
+
const D = getComputedStyle(S), ve = parseFloat(D.paddingTop), Ke = parseFloat(D.paddingBottom), Ge = S.getBoundingClientRect(), n = k.getBoundingClientRect(), b = k.querySelector(".dydx-table__toolbar"), I = b ? b.offsetHeight + 16 : 0, q = k.querySelector(".n-data-table-thead"), ee = q ? q.offsetHeight : 40, Z = n.top - (Ge.top + ve), De = S.clientHeight - ve - Ke - Z - I - ee;
|
|
1876
1881
|
De > 200 ? g.value = De : g.value = void 0;
|
|
1877
1882
|
});
|
|
1878
|
-
},
|
|
1883
|
+
}, j = L(() => i.maxHeight ? i.maxHeight : g.value);
|
|
1879
1884
|
Jt(() => {
|
|
1880
|
-
|
|
1885
|
+
c(), window.addEventListener("resize", c);
|
|
1881
1886
|
}), _a(() => {
|
|
1882
|
-
window.removeEventListener("resize",
|
|
1887
|
+
window.removeEventListener("resize", c);
|
|
1883
1888
|
});
|
|
1884
|
-
const
|
|
1889
|
+
const A = re(null), { mergedColumns: G, configurableColumns: E, visibleColumnKeys: x, setVisibleColumnKeys: O, resetColumnSetting: K, getVisibleColumnKeys: p } = $u({
|
|
1885
1890
|
columns: () => r.columns,
|
|
1886
1891
|
actionColumn: () => r.actionColumn,
|
|
1887
|
-
onView: (
|
|
1888
|
-
onEdit: (
|
|
1889
|
-
onDelete: (
|
|
1890
|
-
}), { paginationConfig: N, handlePageChange:
|
|
1892
|
+
onView: (k) => l("view", k),
|
|
1893
|
+
onEdit: (k) => l("edit", k),
|
|
1894
|
+
onDelete: (k) => l("delete", k)
|
|
1895
|
+
}), { paginationConfig: N, handlePageChange: d, handlePageSizeChange: w } = Pu({
|
|
1891
1896
|
get pagination() {
|
|
1892
1897
|
return r.pagination;
|
|
1893
1898
|
},
|
|
1894
1899
|
get fieldNames() {
|
|
1895
1900
|
return r.paginationFieldNames;
|
|
1896
1901
|
},
|
|
1897
|
-
onUpdatePagination: (
|
|
1898
|
-
onPageChange: (
|
|
1902
|
+
onUpdatePagination: (k) => l("update:pagination", k),
|
|
1903
|
+
onPageChange: (k) => l("pageChange", k)
|
|
1899
1904
|
});
|
|
1900
|
-
Qt(
|
|
1901
|
-
l("update:visibleColumns",
|
|
1905
|
+
Qt(x, (k) => {
|
|
1906
|
+
l("update:visibleColumns", k);
|
|
1902
1907
|
});
|
|
1903
|
-
const m =
|
|
1904
|
-
l("update:checkedRowKeys",
|
|
1908
|
+
const m = L(() => typeof r.rowKey == "function" ? r.rowKey : (k) => k[r.rowKey]), F = (k) => {
|
|
1909
|
+
l("update:checkedRowKeys", k, r.data.filter((S) => k.includes(m.value(S))));
|
|
1905
1910
|
}, V = () => {
|
|
1906
1911
|
r.onAdd?.();
|
|
1907
|
-
},
|
|
1912
|
+
}, P = () => {
|
|
1908
1913
|
r.onRefresh?.();
|
|
1909
1914
|
};
|
|
1910
1915
|
return t({
|
|
1911
|
-
getTableInstance: () =>
|
|
1916
|
+
getTableInstance: () => A.value,
|
|
1912
1917
|
clearChecked: () => {
|
|
1913
1918
|
l("update:checkedRowKeys", [], []);
|
|
1914
1919
|
},
|
|
1915
1920
|
refresh: () => {
|
|
1916
|
-
|
|
1921
|
+
P();
|
|
1917
1922
|
},
|
|
1918
|
-
getVisibleColumnKeys:
|
|
1919
|
-
setVisibleColumnKeys:
|
|
1920
|
-
resetColumnSetting:
|
|
1921
|
-
scrollTo: (
|
|
1922
|
-
|
|
1923
|
+
getVisibleColumnKeys: p,
|
|
1924
|
+
setVisibleColumnKeys: O,
|
|
1925
|
+
resetColumnSetting: K,
|
|
1926
|
+
scrollTo: (k) => {
|
|
1927
|
+
A.value?.scrollTo(k);
|
|
1923
1928
|
}
|
|
1924
|
-
}), (
|
|
1929
|
+
}), (k, S) => (_(), Q("div", {
|
|
1925
1930
|
ref_key: "containerRef",
|
|
1926
1931
|
ref: o,
|
|
1927
1932
|
class: "dydx-table"
|
|
1928
|
-
}, [r.showToolbar ? (
|
|
1933
|
+
}, [r.showToolbar ? (_(), Q("div", Ou, [C(y(ae), {
|
|
1929
1934
|
class: "dydx-table__toolbar-left",
|
|
1930
1935
|
size: 12
|
|
1931
1936
|
}, {
|
|
1932
1937
|
default: s(() => [
|
|
1933
|
-
e.showAdd ? (
|
|
1938
|
+
e.showAdd ? (_(), $(y(X), {
|
|
1934
1939
|
key: 0,
|
|
1935
1940
|
type: "primary",
|
|
1936
1941
|
onClick: V
|
|
1937
1942
|
}, {
|
|
1938
|
-
icon: s(() => [U(
|
|
1939
|
-
default: s(() => [C(
|
|
1943
|
+
icon: s(() => [U(k.$slots, "add-icon", {}, () => [C(y(H), null, {
|
|
1944
|
+
default: s(() => [C(y(Xt))]),
|
|
1940
1945
|
_: 1
|
|
1941
1946
|
})], !0)]),
|
|
1942
|
-
default: s(() => [
|
|
1947
|
+
default: s(() => [M(" " + W(e.addButtonText), 1)]),
|
|
1943
1948
|
_: 3
|
|
1944
1949
|
})) : Y("", !0),
|
|
1945
|
-
(
|
|
1950
|
+
(_(!0), Q(te, null, ne(e.leftButtons, (D) => (_(), Q(te, { key: D.key || D.label }, [D.show !== !1 ? (_(), $(y(X), {
|
|
1946
1951
|
key: 0,
|
|
1947
|
-
type:
|
|
1948
|
-
disabled:
|
|
1949
|
-
onClick:
|
|
1952
|
+
type: D.type,
|
|
1953
|
+
disabled: D.disabled,
|
|
1954
|
+
onClick: D.onClick
|
|
1950
1955
|
}, de({
|
|
1951
|
-
default: s(() => [
|
|
1956
|
+
default: s(() => [M(" " + W(D.label), 1)]),
|
|
1952
1957
|
_: 2
|
|
1953
|
-
}, [
|
|
1958
|
+
}, [D.icon ? {
|
|
1954
1959
|
name: "icon",
|
|
1955
|
-
fn: s(() => [(
|
|
1960
|
+
fn: s(() => [(_(), $(me(D.icon)))]),
|
|
1956
1961
|
key: "0"
|
|
1957
1962
|
} : void 0]), 1032, [
|
|
1958
1963
|
"type",
|
|
1959
1964
|
"disabled",
|
|
1960
1965
|
"onClick"
|
|
1961
1966
|
])) : Y("", !0)], 64))), 128)),
|
|
1962
|
-
U(
|
|
1967
|
+
U(k.$slots, "toolbar-left", {}, void 0, !0)
|
|
1963
1968
|
]),
|
|
1964
1969
|
_: 3
|
|
1965
|
-
}), C(
|
|
1970
|
+
}), C(y(ae), {
|
|
1966
1971
|
class: "dydx-table__toolbar-right",
|
|
1967
1972
|
size: 8
|
|
1968
1973
|
}, {
|
|
1969
1974
|
default: s(() => [
|
|
1970
|
-
U(
|
|
1971
|
-
(
|
|
1975
|
+
U(k.$slots, "toolbar-right", {}, void 0, !0),
|
|
1976
|
+
(_(!0), Q(te, null, ne(e.rightButtons, (D) => (_(), Q(te, { key: D.key || D.label }, [D.show !== !1 ? (_(), $(y(X), {
|
|
1972
1977
|
key: 0,
|
|
1973
|
-
type:
|
|
1974
|
-
disabled:
|
|
1975
|
-
onClick:
|
|
1978
|
+
type: D.type,
|
|
1979
|
+
disabled: D.disabled,
|
|
1980
|
+
onClick: D.onClick
|
|
1976
1981
|
}, de({
|
|
1977
|
-
default: s(() => [
|
|
1982
|
+
default: s(() => [M(" " + W(D.label), 1)]),
|
|
1978
1983
|
_: 2
|
|
1979
|
-
}, [
|
|
1984
|
+
}, [D.icon ? {
|
|
1980
1985
|
name: "icon",
|
|
1981
|
-
fn: s(() => [(
|
|
1986
|
+
fn: s(() => [(_(), $(me(D.icon)))]),
|
|
1982
1987
|
key: "0"
|
|
1983
1988
|
} : void 0]), 1032, [
|
|
1984
1989
|
"type",
|
|
1985
1990
|
"disabled",
|
|
1986
1991
|
"onClick"
|
|
1987
1992
|
])) : Y("", !0)], 64))), 128)),
|
|
1988
|
-
e.showRefresh ? (
|
|
1993
|
+
e.showRefresh ? (_(), $(y(Be), {
|
|
1989
1994
|
key: 0,
|
|
1990
1995
|
trigger: "hover"
|
|
1991
1996
|
}, {
|
|
1992
|
-
trigger: s(() => [C(
|
|
1997
|
+
trigger: s(() => [C(y(X), {
|
|
1993
1998
|
circle: "",
|
|
1994
1999
|
class: "dydx-table__icon-btn",
|
|
1995
|
-
onClick:
|
|
2000
|
+
onClick: P
|
|
1996
2001
|
}, {
|
|
1997
|
-
icon: s(() => [C(
|
|
1998
|
-
default: s(() => [C(
|
|
2002
|
+
icon: s(() => [C(y(H), null, {
|
|
2003
|
+
default: s(() => [C(y(tr))]),
|
|
1999
2004
|
_: 1
|
|
2000
2005
|
})]),
|
|
2001
2006
|
_: 1
|
|
2002
2007
|
})]),
|
|
2003
|
-
default: s(() => [
|
|
2008
|
+
default: s(() => [S[1] || (S[1] = M(" 刷新 ", -1))]),
|
|
2004
2009
|
_: 1
|
|
2005
2010
|
})) : Y("", !0),
|
|
2006
|
-
e.showColumnSetting ? (
|
|
2011
|
+
e.showColumnSetting ? (_(), $(y(ia), {
|
|
2007
2012
|
key: 1,
|
|
2008
2013
|
trigger: "click",
|
|
2009
2014
|
placement: "bottom-end"
|
|
2010
2015
|
}, {
|
|
2011
|
-
trigger: s(() => [C(
|
|
2012
|
-
trigger: s(() => [C(
|
|
2016
|
+
trigger: s(() => [C(y(Be), { trigger: "hover" }, {
|
|
2017
|
+
trigger: s(() => [C(y(X), {
|
|
2013
2018
|
circle: "",
|
|
2014
2019
|
class: "dydx-table__icon-btn"
|
|
2015
2020
|
}, {
|
|
2016
|
-
icon: s(() => [C(
|
|
2017
|
-
default: s(() => [C(
|
|
2021
|
+
icon: s(() => [C(y(H), null, {
|
|
2022
|
+
default: s(() => [C(y(Pa))]),
|
|
2018
2023
|
_: 1
|
|
2019
2024
|
})]),
|
|
2020
2025
|
_: 1
|
|
2021
2026
|
})]),
|
|
2022
|
-
default: s(() => [
|
|
2027
|
+
default: s(() => [S[2] || (S[2] = M(" 列设置 ", -1))]),
|
|
2023
2028
|
_: 1
|
|
2024
2029
|
})]),
|
|
2025
|
-
default: s(() => [Fe("div", Du, [Fe("div", Fu, [
|
|
2030
|
+
default: s(() => [Fe("div", Du, [Fe("div", Fu, [S[4] || (S[4] = Fe("span", null, "列设置", -1)), C(y(X), {
|
|
2026
2031
|
text: "",
|
|
2027
2032
|
size: "small",
|
|
2028
2033
|
type: "primary",
|
|
2029
|
-
onClick:
|
|
2034
|
+
onClick: y(K)
|
|
2030
2035
|
}, {
|
|
2031
|
-
default: s(() => [...
|
|
2036
|
+
default: s(() => [...S[3] || (S[3] = [M(" 重置 ", -1)])]),
|
|
2032
2037
|
_: 1
|
|
2033
|
-
}, 8, ["onClick"])]), C(
|
|
2034
|
-
value:
|
|
2035
|
-
"onUpdate:value":
|
|
2038
|
+
}, 8, ["onClick"])]), C(y(et), {
|
|
2039
|
+
value: y(x),
|
|
2040
|
+
"onUpdate:value": S[0] || (S[0] = (D) => ba(x) ? x.value = D : null)
|
|
2036
2041
|
}, {
|
|
2037
|
-
default: s(() => [C(
|
|
2042
|
+
default: s(() => [C(y(ae), {
|
|
2038
2043
|
vertical: "",
|
|
2039
2044
|
size: 8
|
|
2040
2045
|
}, {
|
|
2041
|
-
default: s(() => [(
|
|
2042
|
-
key:
|
|
2043
|
-
value:
|
|
2044
|
-
label:
|
|
2046
|
+
default: s(() => [(_(!0), Q(te, null, ne(y(E), (D) => (_(), $(y(Ht), {
|
|
2047
|
+
key: D.key,
|
|
2048
|
+
value: D.key,
|
|
2049
|
+
label: D.title
|
|
2045
2050
|
}, null, 8, ["value", "label"]))), 128))]),
|
|
2046
2051
|
_: 1
|
|
2047
2052
|
})]),
|
|
@@ -2051,21 +2056,21 @@ var Ou = {
|
|
|
2051
2056
|
})) : Y("", !0)
|
|
2052
2057
|
]),
|
|
2053
2058
|
_: 3
|
|
2054
|
-
})])) : Y("", !0), C(
|
|
2059
|
+
})])) : Y("", !0), C(y(Gr), J({
|
|
2055
2060
|
ref_key: "dataTableRef",
|
|
2056
|
-
ref:
|
|
2061
|
+
ref: A,
|
|
2057
2062
|
data: e.data,
|
|
2058
|
-
columns:
|
|
2063
|
+
columns: y(G),
|
|
2059
2064
|
"row-key": m.value,
|
|
2060
2065
|
loading: e.loading,
|
|
2061
|
-
pagination:
|
|
2066
|
+
pagination: y(N),
|
|
2062
2067
|
remote: e.remote,
|
|
2063
2068
|
"checked-row-keys": e.checkedRowKeys,
|
|
2064
|
-
"max-height":
|
|
2065
|
-
},
|
|
2066
|
-
"onUpdate:page":
|
|
2067
|
-
"onUpdate:pageSize":
|
|
2068
|
-
"onUpdate:checkedRowKeys":
|
|
2069
|
+
"max-height": j.value
|
|
2070
|
+
}, y(i), {
|
|
2071
|
+
"onUpdate:page": y(d),
|
|
2072
|
+
"onUpdate:pageSize": y(w),
|
|
2073
|
+
"onUpdate:checkedRowKeys": F
|
|
2069
2074
|
}), null, 16, [
|
|
2070
2075
|
"data",
|
|
2071
2076
|
"columns",
|
|
@@ -2114,9 +2119,9 @@ var Ou = {
|
|
|
2114
2119
|
"cancel"
|
|
2115
2120
|
],
|
|
2116
2121
|
setup(e, { expose: t, emit: a }) {
|
|
2117
|
-
const r = e, l = a, i = rt(), o = re(), g =
|
|
2122
|
+
const r = e, l = a, i = rt(), o = re(), g = L(() => r.title ? r.title : `${r.model[r.rowKey] ? "编辑" : "新增"}${r.subtitle}`), h = L(() => ({ width: typeof r.width == "number" ? `${r.width}px` : r.width })), v = () => {
|
|
2118
2123
|
l("update:show", !1), l("cancel");
|
|
2119
|
-
},
|
|
2124
|
+
}, u = async () => {
|
|
2120
2125
|
try {
|
|
2121
2126
|
await o.value?.validate(), l("confirm", r.model);
|
|
2122
2127
|
} catch {
|
|
@@ -2126,31 +2131,31 @@ var Ou = {
|
|
|
2126
2131
|
getFormRef: () => o.value,
|
|
2127
2132
|
validate: () => o.value?.validate(),
|
|
2128
2133
|
resetFields: () => o.value?.resetFields()
|
|
2129
|
-
}), (
|
|
2134
|
+
}), (c, j) => (_(), $(y(oa), J({
|
|
2130
2135
|
show: e.show,
|
|
2131
2136
|
preset: "card",
|
|
2132
2137
|
title: g.value,
|
|
2133
|
-
style:
|
|
2138
|
+
style: h.value,
|
|
2134
2139
|
"mask-closable": !1
|
|
2135
|
-
},
|
|
2136
|
-
|
|
2140
|
+
}, y(i), { "onUpdate:show": j[0] || (j[0] = (A) => l("update:show", A)) }), de({ _: 2 }, [
|
|
2141
|
+
c.$slots.header ? {
|
|
2137
2142
|
name: "header",
|
|
2138
|
-
fn: s(() => [U(
|
|
2143
|
+
fn: s(() => [U(c.$slots, "header")]),
|
|
2139
2144
|
key: "0"
|
|
2140
2145
|
} : void 0,
|
|
2141
|
-
|
|
2146
|
+
c.$slots["header-extra"] ? {
|
|
2142
2147
|
name: "header-extra",
|
|
2143
|
-
fn: s(() => [U(
|
|
2148
|
+
fn: s(() => [U(c.$slots, "header-extra")]),
|
|
2144
2149
|
key: "1"
|
|
2145
2150
|
} : void 0,
|
|
2146
|
-
|
|
2151
|
+
c.$slots.default ? {
|
|
2147
2152
|
name: "default",
|
|
2148
|
-
fn: s(() => [U(
|
|
2153
|
+
fn: s(() => [U(c.$slots, "default")]),
|
|
2149
2154
|
key: "2"
|
|
2150
2155
|
} : {
|
|
2151
2156
|
name: "default",
|
|
2152
|
-
fn: s(() => [C(
|
|
2153
|
-
default: s(() => [C(
|
|
2157
|
+
fn: s(() => [C(y(tt), { show: e.loading }, {
|
|
2158
|
+
default: s(() => [C(y(Le), {
|
|
2154
2159
|
ref_key: "formRef",
|
|
2155
2160
|
ref: o,
|
|
2156
2161
|
schemas: e.schemas,
|
|
@@ -2163,24 +2168,24 @@ var Ou = {
|
|
|
2163
2168
|
"show-footer": !1,
|
|
2164
2169
|
"disable-default-required": e.disableDefaultRequired
|
|
2165
2170
|
}, de({ _: 2 }, [
|
|
2166
|
-
|
|
2171
|
+
c.$slots["form-header"] ? {
|
|
2167
2172
|
name: "header",
|
|
2168
|
-
fn: s((
|
|
2173
|
+
fn: s((A) => [U(c.$slots, "form-header", le(ue(A)))]),
|
|
2169
2174
|
key: "0"
|
|
2170
2175
|
} : void 0,
|
|
2171
|
-
|
|
2176
|
+
c.$slots["form-footer"] ? {
|
|
2172
2177
|
name: "footer",
|
|
2173
|
-
fn: s((
|
|
2178
|
+
fn: s((A) => [U(c.$slots, "form-footer", le(ue(A)))]),
|
|
2174
2179
|
key: "1"
|
|
2175
2180
|
} : void 0,
|
|
2176
|
-
|
|
2181
|
+
c.$slots["form-append"] ? {
|
|
2177
2182
|
name: "append",
|
|
2178
|
-
fn: s((
|
|
2183
|
+
fn: s((A) => [U(c.$slots, "form-append", le(ue(A)))]),
|
|
2179
2184
|
key: "2"
|
|
2180
2185
|
} : void 0,
|
|
2181
|
-
ne(
|
|
2182
|
-
name:
|
|
2183
|
-
fn: s((
|
|
2186
|
+
ne(c.$slots, (A, G) => ({
|
|
2187
|
+
name: G,
|
|
2188
|
+
fn: s((E) => [typeof G == "string" && G.startsWith("field-") ? U(c.$slots, G, le(J({ key: 0 }, E))) : Y("", !0)])
|
|
2184
2189
|
}))
|
|
2185
2190
|
]), 1032, [
|
|
2186
2191
|
"schemas",
|
|
@@ -2196,42 +2201,42 @@ var Ou = {
|
|
|
2196
2201
|
}, 8, ["show"])]),
|
|
2197
2202
|
key: "3"
|
|
2198
2203
|
},
|
|
2199
|
-
|
|
2204
|
+
c.$slots.footer ? {
|
|
2200
2205
|
name: "footer",
|
|
2201
|
-
fn: s(() => [U(
|
|
2206
|
+
fn: s(() => [U(c.$slots, "footer")]),
|
|
2202
2207
|
key: "4"
|
|
2203
2208
|
} : {
|
|
2204
2209
|
name: "footer",
|
|
2205
|
-
fn: s(() => [C(
|
|
2206
|
-
default: s(() => [e.showCancel ? (
|
|
2210
|
+
fn: s(() => [C(y(ae), { justify: "end" }, {
|
|
2211
|
+
default: s(() => [e.showCancel ? (_(), $(y(X), {
|
|
2207
2212
|
key: 0,
|
|
2208
|
-
onClick:
|
|
2213
|
+
onClick: v
|
|
2209
2214
|
}, {
|
|
2210
|
-
icon: s(() => [C(
|
|
2211
|
-
default: s(() => [C(
|
|
2215
|
+
icon: s(() => [C(y(H), null, {
|
|
2216
|
+
default: s(() => [C(y(er))]),
|
|
2212
2217
|
_: 1
|
|
2213
2218
|
})]),
|
|
2214
|
-
default: s(() => [
|
|
2219
|
+
default: s(() => [M(" " + W(e.cancelText), 1)]),
|
|
2215
2220
|
_: 1
|
|
2216
|
-
})) : Y("", !0), C(
|
|
2221
|
+
})) : Y("", !0), C(y(X), {
|
|
2217
2222
|
type: "primary",
|
|
2218
2223
|
loading: e.loading,
|
|
2219
|
-
onClick:
|
|
2224
|
+
onClick: u
|
|
2220
2225
|
}, {
|
|
2221
|
-
icon: s(() => [C(
|
|
2222
|
-
default: s(() => [C(
|
|
2226
|
+
icon: s(() => [C(y(H), null, {
|
|
2227
|
+
default: s(() => [C(y(Zt))]),
|
|
2223
2228
|
_: 1
|
|
2224
2229
|
})]),
|
|
2225
|
-
default: s(() => [
|
|
2230
|
+
default: s(() => [M(" " + W(e.confirmText), 1)]),
|
|
2226
2231
|
_: 1
|
|
2227
2232
|
}, 8, ["loading"])]),
|
|
2228
2233
|
_: 1
|
|
2229
2234
|
})]),
|
|
2230
2235
|
key: "5"
|
|
2231
2236
|
},
|
|
2232
|
-
|
|
2237
|
+
c.$slots.action ? {
|
|
2233
2238
|
name: "action",
|
|
2234
|
-
fn: s(() => [U(
|
|
2239
|
+
fn: s(() => [U(c.$slots, "action")]),
|
|
2235
2240
|
key: "6"
|
|
2236
2241
|
} : void 0
|
|
2237
2242
|
]), 1040, [
|
|
@@ -2282,9 +2287,9 @@ var Ou = {
|
|
|
2282
2287
|
"cancel"
|
|
2283
2288
|
],
|
|
2284
2289
|
setup(e, { expose: t, emit: a }) {
|
|
2285
|
-
const r = e, l = a, i = rt(), o = re(), g =
|
|
2290
|
+
const r = e, l = a, i = rt(), o = re(), g = L(() => r.title ? r.title : `${r.model[r.rowKey] ? "编辑" : "新增"}${r.subtitle}`), h = () => {
|
|
2286
2291
|
l("update:show", !1), l("cancel");
|
|
2287
|
-
},
|
|
2292
|
+
}, v = async () => {
|
|
2288
2293
|
try {
|
|
2289
2294
|
await o.value?.validate(), l("confirm", r.model);
|
|
2290
2295
|
} catch {
|
|
@@ -2294,24 +2299,24 @@ var Ou = {
|
|
|
2294
2299
|
getFormRef: () => o.value,
|
|
2295
2300
|
validate: () => o.value?.validate(),
|
|
2296
2301
|
resetFields: () => o.value?.resetFields()
|
|
2297
|
-
}), (
|
|
2302
|
+
}), (u, c) => (_(), $(y(Hr), J({
|
|
2298
2303
|
show: e.show,
|
|
2299
2304
|
width: e.width,
|
|
2300
2305
|
placement: e.placement,
|
|
2301
2306
|
"mask-closable": !1
|
|
2302
|
-
},
|
|
2303
|
-
default: s(() => [C(
|
|
2307
|
+
}, y(i), { "onUpdate:show": c[0] || (c[0] = (j) => l("update:show", j)) }), {
|
|
2308
|
+
default: s(() => [C(y(qr), {
|
|
2304
2309
|
title: g.value,
|
|
2305
2310
|
closable: "",
|
|
2306
|
-
onClose:
|
|
2307
|
-
}, de({ _: 2 }, [
|
|
2311
|
+
onClose: h
|
|
2312
|
+
}, de({ _: 2 }, [u.$slots.default ? {
|
|
2308
2313
|
name: "default",
|
|
2309
|
-
fn: s(() => [U(
|
|
2314
|
+
fn: s(() => [U(u.$slots, "default")]),
|
|
2310
2315
|
key: "0"
|
|
2311
2316
|
} : {
|
|
2312
2317
|
name: "default",
|
|
2313
|
-
fn: s(() => [
|
|
2314
|
-
default: s(() => [C(
|
|
2318
|
+
fn: s(() => [u.$slots["header-extra"] ? (_(), Q("div", Nu, [U(u.$slots, "header-extra")])) : Y("", !0), C(y(tt), { show: e.loading }, {
|
|
2319
|
+
default: s(() => [C(y(Le), {
|
|
2315
2320
|
ref_key: "formRef",
|
|
2316
2321
|
ref: o,
|
|
2317
2322
|
schemas: e.schemas,
|
|
@@ -2324,24 +2329,24 @@ var Ou = {
|
|
|
2324
2329
|
"show-footer": !1,
|
|
2325
2330
|
"disable-default-required": e.disableDefaultRequired
|
|
2326
2331
|
}, de({ _: 2 }, [
|
|
2327
|
-
|
|
2332
|
+
u.$slots["form-header"] ? {
|
|
2328
2333
|
name: "header",
|
|
2329
|
-
fn: s((
|
|
2334
|
+
fn: s((j) => [U(u.$slots, "form-header", le(ue(j)))]),
|
|
2330
2335
|
key: "0"
|
|
2331
2336
|
} : void 0,
|
|
2332
|
-
|
|
2337
|
+
u.$slots["form-footer"] ? {
|
|
2333
2338
|
name: "footer",
|
|
2334
|
-
fn: s((
|
|
2339
|
+
fn: s((j) => [U(u.$slots, "form-footer", le(ue(j)))]),
|
|
2335
2340
|
key: "1"
|
|
2336
2341
|
} : void 0,
|
|
2337
|
-
|
|
2342
|
+
u.$slots["form-append"] ? {
|
|
2338
2343
|
name: "append",
|
|
2339
|
-
fn: s((
|
|
2344
|
+
fn: s((j) => [U(u.$slots, "form-append", le(ue(j)))]),
|
|
2340
2345
|
key: "2"
|
|
2341
2346
|
} : void 0,
|
|
2342
|
-
ne(
|
|
2343
|
-
name:
|
|
2344
|
-
fn: s((
|
|
2347
|
+
ne(u.$slots, (j, A) => ({
|
|
2348
|
+
name: A,
|
|
2349
|
+
fn: s((G) => [typeof A == "string" && A.startsWith("field-") ? U(u.$slots, A, le(J({ key: 0 }, G))) : Y("", !0)])
|
|
2345
2350
|
}))
|
|
2346
2351
|
]), 1032, [
|
|
2347
2352
|
"schemas",
|
|
@@ -2356,33 +2361,33 @@ var Ou = {
|
|
|
2356
2361
|
_: 3
|
|
2357
2362
|
}, 8, ["show"])]),
|
|
2358
2363
|
key: "1"
|
|
2359
|
-
},
|
|
2364
|
+
}, u.$slots.footer ? {
|
|
2360
2365
|
name: "footer",
|
|
2361
|
-
fn: s(() => [U(
|
|
2366
|
+
fn: s(() => [U(u.$slots, "footer")]),
|
|
2362
2367
|
key: "2"
|
|
2363
2368
|
} : {
|
|
2364
2369
|
name: "footer",
|
|
2365
|
-
fn: s(() => [C(
|
|
2366
|
-
default: s(() => [e.showCancel ? (
|
|
2370
|
+
fn: s(() => [C(y(ae), { justify: "end" }, {
|
|
2371
|
+
default: s(() => [e.showCancel ? (_(), $(y(X), {
|
|
2367
2372
|
key: 0,
|
|
2368
|
-
onClick:
|
|
2373
|
+
onClick: h
|
|
2369
2374
|
}, {
|
|
2370
|
-
icon: s(() => [C(
|
|
2371
|
-
default: s(() => [C(
|
|
2375
|
+
icon: s(() => [C(y(H), null, {
|
|
2376
|
+
default: s(() => [C(y(er))]),
|
|
2372
2377
|
_: 1
|
|
2373
2378
|
})]),
|
|
2374
|
-
default: s(() => [
|
|
2379
|
+
default: s(() => [M(" " + W(e.cancelText), 1)]),
|
|
2375
2380
|
_: 1
|
|
2376
|
-
})) : Y("", !0), C(
|
|
2381
|
+
})) : Y("", !0), C(y(X), {
|
|
2377
2382
|
type: "primary",
|
|
2378
2383
|
loading: e.loading,
|
|
2379
|
-
onClick:
|
|
2384
|
+
onClick: v
|
|
2380
2385
|
}, {
|
|
2381
|
-
icon: s(() => [C(
|
|
2382
|
-
default: s(() => [C(
|
|
2386
|
+
icon: s(() => [C(y(H), null, {
|
|
2387
|
+
default: s(() => [C(y(Zt))]),
|
|
2383
2388
|
_: 1
|
|
2384
2389
|
})]),
|
|
2385
|
-
default: s(() => [
|
|
2390
|
+
default: s(() => [M(" " + W(e.confirmText), 1)]),
|
|
2386
2391
|
_: 1
|
|
2387
2392
|
}, 8, ["loading"])]),
|
|
2388
2393
|
_: 1
|