dydx-naive-ui-for-vue 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dydx-naive-ui-for-vue.js +558 -547
- package/dist/dydx-naive-ui-for-vue.umd.cjs +1 -1
- package/dist/types/index.d.ts +2605 -3
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as Gn } from "./resolver-BDxomgBZ.js";
|
|
2
|
-
import { NAutoComplete as
|
|
3
|
-
import { Fragment as W, computed as $, createBlock as
|
|
2
|
+
import { NAutoComplete as ft, NButton as B, NCascader as ct, NCheckbox as Ge, NCheckboxGroup as ke, NColorPicker as pt, NDataTable as mt, NDatePicker as yt, NDrawer as gt, NDrawerContent as ht, NDropdown as vt, NDynamicInput as bt, NDynamicTags as _t, NForm as wt, NFormItem as Ct, NGrid as xt, NGridItem as kt, NIcon as J, NImage as St, NInput as Tt, NInputNumber as Nt, NMention as Pt, NModal as Dt, NPopconfirm as Ft, NPopover as zt, NRadio as Rt, NRadioGroup as je, NRate as $t, NSelect as Ke, NSlider as It, NSpace as H, NSpin as Se, NSwitch as Ot, NTag as be, NText as Bt, NTimePicker as Ut, NTooltip as Ce, NTreeSelect as At, NUpload as Le, NUploadDragger as Mt, useMessage as Et } from "naive-ui";
|
|
3
|
+
import { Fragment as W, computed as $, createBlock as N, createCommentVNode as j, createElementBlock as K, createElementVNode as fe, createSlots as se, createTextVNode as I, createVNode as _, defineComponent as ae, guardReactiveProps as Vt, h as F, isRef as Gt, mergeProps as G, nextTick as jt, normalizeProps as Kt, onMounted as Lt, onUnmounted as Ht, openBlock as g, ref as Q, renderList as X, renderSlot as U, resolveDynamicComponent as ee, toDisplayString as A, toHandlers as Wt, unref as p, useAttrs as Te, watch as qt, withCtx as i } from "vue";
|
|
4
4
|
import * as ce from "@vicons/ionicons5";
|
|
5
|
-
import { AddOutline as
|
|
6
|
-
var
|
|
5
|
+
import { AddOutline as He, CloudUploadOutline as Ie, DownloadOutline as Jt, OpenOutline as Qt, RefreshOutline as Yt, SettingsOutline as Xt } from "@vicons/ionicons5";
|
|
6
|
+
var Zt = { style: { "margin-bottom": "12px" } }, ea = /* @__PURE__ */ ae({
|
|
7
7
|
name: "DydxUpload",
|
|
8
8
|
__name: "DydxUpload",
|
|
9
9
|
props: {
|
|
@@ -43,65 +43,65 @@ var Qt = { style: { "margin-bottom": "12px" } }, Yt = /* @__PURE__ */ ae({
|
|
|
43
43
|
"beforeUpload"
|
|
44
44
|
],
|
|
45
45
|
setup(e, { expose: t, emit: r }) {
|
|
46
|
-
const a = e, l = r, f =
|
|
46
|
+
const a = e, l = r, f = Et(), o = Q(), C = $(() => a.listType ? a.listType : a.uploadType === "image" ? "image-card" : "text"), w = $(() => a.urlPrefix ? a.fileList.map((S) => ({
|
|
47
47
|
...S,
|
|
48
48
|
url: S.url && !S.url.startsWith("http") ? a.urlPrefix + S.url : S.url
|
|
49
49
|
})) : a.fileList), v = $(() => {
|
|
50
50
|
const S = [];
|
|
51
51
|
return a.acceptTypes?.length && S.push(`支持格式:${a.acceptTypes.join(", ")}`), a.maxSize && S.push(`单个文件不超过 ${a.maxSize}MB`), a.maxCount && S.push(`最多 ${a.maxCount} 个文件`), S.join(";");
|
|
52
|
-
}),
|
|
52
|
+
}), b = $(() => {
|
|
53
53
|
if (a.accept) return a.accept;
|
|
54
54
|
if (a.acceptTypes?.length) return a.acceptTypes.join(",");
|
|
55
55
|
if (a.uploadType === "image") return "image/*";
|
|
56
56
|
}), x = $(() => {
|
|
57
|
-
const { uploadType: S, fileList:
|
|
57
|
+
const { uploadType: S, fileList: P, customUpload: z, acceptTypes: d, maxSize: u, maxCount: m, multiple: T, autoUpload: E, disabled: L, urlPrefix: O, showTip: oe, showDragger: Y, ...de } = a;
|
|
58
58
|
return de;
|
|
59
59
|
}), k = (S) => {
|
|
60
|
-
l("update:fileList", a.urlPrefix ? S.map((
|
|
61
|
-
...
|
|
62
|
-
url:
|
|
60
|
+
l("update:fileList", a.urlPrefix ? S.map((P) => ({
|
|
61
|
+
...P,
|
|
62
|
+
url: P.url?.startsWith(a.urlPrefix) ? P.url.slice(a.urlPrefix.length) : P.url
|
|
63
63
|
})) : S);
|
|
64
64
|
}, D = async ({ file: S }) => {
|
|
65
65
|
l("beforeUpload", S);
|
|
66
|
-
const
|
|
67
|
-
return
|
|
68
|
-
if (z.startsWith(".")) return
|
|
66
|
+
const P = S.file;
|
|
67
|
+
return P ? a.maxSize && P.size > a.maxSize * 1024 * 1024 ? (f.error(`文件大小不能超过 ${a.maxSize}MB`), !1) : a.acceptTypes?.length && !a.acceptTypes.some((z) => {
|
|
68
|
+
if (z.startsWith(".")) return P.name.toLowerCase().endsWith(z.toLowerCase());
|
|
69
69
|
if (z.includes("*")) {
|
|
70
|
-
const [
|
|
71
|
-
return
|
|
70
|
+
const [d] = z.split("/");
|
|
71
|
+
return P.type.startsWith(d);
|
|
72
72
|
}
|
|
73
|
-
return
|
|
74
|
-
}) ? (f.error(`只支持 ${a.acceptTypes.join(", ")} 格式`), !1) : a.maxCount && a.fileList.length >= a.maxCount ? (l("exceed", [
|
|
73
|
+
return P.type === z;
|
|
74
|
+
}) ? (f.error(`只支持 ${a.acceptTypes.join(", ")} 格式`), !1) : a.maxCount && a.fileList.length >= a.maxCount ? (l("exceed", [P]), f.error(`最多上传 ${a.maxCount} 个文件`), !1) : !0 : !0;
|
|
75
75
|
}, M = async (S) => {
|
|
76
|
-
const { file:
|
|
76
|
+
const { file: P, onProgress: z, onFinish: d, onError: u } = S;
|
|
77
77
|
if (!a.customUpload) {
|
|
78
|
-
console.warn("DydxUpload: customUpload 方法未提供"),
|
|
78
|
+
console.warn("DydxUpload: customUpload 方法未提供"), u();
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
|
-
|
|
82
|
+
P.url = await a.customUpload(P.file, (m) => {
|
|
83
83
|
z({ percent: m });
|
|
84
|
-
}),
|
|
84
|
+
}), P.status = "finished", d(), l("success", P);
|
|
85
85
|
} catch (m) {
|
|
86
|
-
|
|
86
|
+
u(), l("error", P, m);
|
|
87
87
|
}
|
|
88
88
|
}, q = () => {
|
|
89
|
-
|
|
89
|
+
o.value?.submit();
|
|
90
90
|
};
|
|
91
91
|
return t({
|
|
92
|
-
submit: () =>
|
|
93
|
-
openDialog: () =>
|
|
94
|
-
clear: () =>
|
|
95
|
-
}), (S,
|
|
96
|
-
const z = J,
|
|
92
|
+
submit: () => o.value?.submit(),
|
|
93
|
+
openDialog: () => o.value?.openOpenFileDialog(),
|
|
94
|
+
clear: () => o.value?.clear()
|
|
95
|
+
}), (S, P) => {
|
|
96
|
+
const z = J, d = Bt, u = Mt, m = B, T = Le;
|
|
97
97
|
return g(), K("div", null, [
|
|
98
|
-
|
|
98
|
+
_(T, G({
|
|
99
99
|
ref_key: "uploadRef",
|
|
100
|
-
ref:
|
|
100
|
+
ref: o
|
|
101
101
|
}, x.value, {
|
|
102
102
|
"file-list": w.value,
|
|
103
103
|
"custom-request": M,
|
|
104
|
-
accept:
|
|
104
|
+
accept: b.value,
|
|
105
105
|
max: e.maxCount,
|
|
106
106
|
multiple: e.multiple,
|
|
107
107
|
disabled: e.disabled,
|
|
@@ -110,20 +110,20 @@ var Qt = { style: { "margin-bottom": "12px" } }, Yt = /* @__PURE__ */ ae({
|
|
|
110
110
|
"onUpdate:fileList": k,
|
|
111
111
|
onBeforeUpload: D
|
|
112
112
|
}), {
|
|
113
|
-
default:
|
|
114
|
-
default:
|
|
115
|
-
fe("div",
|
|
113
|
+
default: i(() => [e.showDragger && e.uploadType !== "image" ? (g(), N(u, { key: 0 }, {
|
|
114
|
+
default: i(() => [
|
|
115
|
+
fe("div", Zt, [_(z, {
|
|
116
116
|
size: "48",
|
|
117
117
|
depth: 3
|
|
118
118
|
}, {
|
|
119
|
-
default:
|
|
119
|
+
default: i(() => [_(p(Ie))]),
|
|
120
120
|
_: 1
|
|
121
121
|
})]),
|
|
122
|
-
|
|
123
|
-
default:
|
|
122
|
+
_(d, { style: { "font-size": "16px" } }, {
|
|
123
|
+
default: i(() => [...P[0] || (P[0] = [I(" 点击或拖拽文件到此区域上传 ", -1)])]),
|
|
124
124
|
_: 1
|
|
125
125
|
}),
|
|
126
|
-
e.showTip ? (g(),
|
|
126
|
+
e.showTip ? (g(), N(d, {
|
|
127
127
|
key: 0,
|
|
128
128
|
depth: "3",
|
|
129
129
|
style: {
|
|
@@ -132,23 +132,23 @@ var Qt = { style: { "margin-bottom": "12px" } }, Yt = /* @__PURE__ */ ae({
|
|
|
132
132
|
display: "block"
|
|
133
133
|
}
|
|
134
134
|
}, {
|
|
135
|
-
default:
|
|
135
|
+
default: i(() => [I(A(v.value), 1)]),
|
|
136
136
|
_: 1
|
|
137
137
|
})) : j("", !0)
|
|
138
138
|
]),
|
|
139
139
|
_: 1
|
|
140
|
-
})) : U(S.$slots, "default", { key: 1 }, () => [e.uploadType === "image" && C.value === "image-card" ? (g(),
|
|
140
|
+
})) : U(S.$slots, "default", { key: 1 }, () => [e.uploadType === "image" && C.value === "image-card" ? (g(), N(z, {
|
|
141
141
|
key: 0,
|
|
142
142
|
size: 28
|
|
143
143
|
}, {
|
|
144
|
-
default:
|
|
144
|
+
default: i(() => [_(p(He))]),
|
|
145
145
|
_: 1
|
|
146
|
-
})) : (g(),
|
|
147
|
-
icon:
|
|
148
|
-
default:
|
|
146
|
+
})) : (g(), N(m, { key: 1 }, {
|
|
147
|
+
icon: i(() => [_(z, null, {
|
|
148
|
+
default: i(() => [_(p(Ie))]),
|
|
149
149
|
_: 1
|
|
150
150
|
})]),
|
|
151
|
-
default:
|
|
151
|
+
default: i(() => [I(" " + A(e.uploadType === "image" ? "上传图片" : "上传文件"), 1)]),
|
|
152
152
|
_: 1
|
|
153
153
|
}))])]),
|
|
154
154
|
_: 3
|
|
@@ -161,16 +161,16 @@ var Qt = { style: { "margin-bottom": "12px" } }, Yt = /* @__PURE__ */ ae({
|
|
|
161
161
|
"default-upload",
|
|
162
162
|
"list-type"
|
|
163
163
|
]),
|
|
164
|
-
!e.autoUpload && w.value.length > 0 ? (g(),
|
|
164
|
+
!e.autoUpload && w.value.length > 0 ? (g(), N(m, {
|
|
165
165
|
key: 0,
|
|
166
166
|
type: "primary",
|
|
167
167
|
onClick: q,
|
|
168
168
|
style: { "margin-top": "8px" }
|
|
169
169
|
}, {
|
|
170
|
-
default:
|
|
170
|
+
default: i(() => [...P[1] || (P[1] = [I(" 开始上传 ", -1)])]),
|
|
171
171
|
_: 1
|
|
172
172
|
})) : j("", !0),
|
|
173
|
-
e.showTip && !(e.showDragger && e.uploadType !== "image") ? (g(),
|
|
173
|
+
e.showTip && !(e.showDragger && e.uploadType !== "image") ? (g(), N(d, {
|
|
174
174
|
key: 1,
|
|
175
175
|
depth: "3",
|
|
176
176
|
style: {
|
|
@@ -179,13 +179,13 @@ var Qt = { style: { "margin-bottom": "12px" } }, Yt = /* @__PURE__ */ ae({
|
|
|
179
179
|
display: "block"
|
|
180
180
|
}
|
|
181
181
|
}, {
|
|
182
|
-
default:
|
|
182
|
+
default: i(() => [I(A(v.value), 1)]),
|
|
183
183
|
_: 1
|
|
184
184
|
})) : j("", !0)
|
|
185
185
|
]);
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
}),
|
|
188
|
+
}), pe = ea, ta = /* @__PURE__ */ ae({
|
|
189
189
|
name: "DydxIconSelect",
|
|
190
190
|
__name: "DydxIconSelect",
|
|
191
191
|
props: {
|
|
@@ -206,27 +206,27 @@ var Qt = { style: { "margin-bottom": "12px" } }, Yt = /* @__PURE__ */ ae({
|
|
|
206
206
|
setup(e, { emit: t }) {
|
|
207
207
|
const r = e, a = t, l = Object.keys(ce), f = $(() => {
|
|
208
208
|
let v = l;
|
|
209
|
-
return r.iconStyle === "outline" ? v = l.filter((
|
|
210
|
-
label:
|
|
211
|
-
value:
|
|
209
|
+
return r.iconStyle === "outline" ? v = l.filter((b) => b.endsWith("Outline")) : r.iconStyle === "sharp" ? v = l.filter((b) => b.endsWith("Sharp")) : r.iconStyle === "filled" && (v = l.filter((b) => !b.endsWith("Outline") && !b.endsWith("Sharp"))), v.map((b) => ({
|
|
210
|
+
label: b,
|
|
211
|
+
value: b
|
|
212
212
|
}));
|
|
213
|
-
}),
|
|
214
|
-
const
|
|
215
|
-
return F("div", { style: "display: flex; align-items: center; gap: 8px;" }, [F(J, { size: 18 }, () => F(
|
|
213
|
+
}), o = (v) => {
|
|
214
|
+
const b = ce[v.value];
|
|
215
|
+
return F("div", { style: "display: flex; align-items: center; gap: 8px;" }, [F(J, { size: 18 }, () => F(b)), F("span", { style: "flex: 1; overflow: hidden; text-overflow: ellipsis;" }, v.label)]);
|
|
216
216
|
}, C = ({ option: v }) => {
|
|
217
|
-
const
|
|
218
|
-
return F("div", { style: "display: flex; align-items: center; gap: 4px;" }, [F(J, { size: 16 }, () => F(
|
|
217
|
+
const b = ce[v.value];
|
|
218
|
+
return F("div", { style: "display: flex; align-items: center; gap: 4px;" }, [F(J, { size: 16 }, () => F(b)), v.label]);
|
|
219
219
|
}, w = (v) => {
|
|
220
220
|
a("update:value", v);
|
|
221
221
|
};
|
|
222
|
-
return (v,
|
|
222
|
+
return (v, b) => (g(), N(p(Ke), {
|
|
223
223
|
value: e.value,
|
|
224
224
|
options: f.value,
|
|
225
225
|
placeholder: e.placeholder,
|
|
226
226
|
disabled: e.disabled,
|
|
227
227
|
clearable: e.clearable,
|
|
228
228
|
filterable: e.filterable,
|
|
229
|
-
"render-label":
|
|
229
|
+
"render-label": o,
|
|
230
230
|
"render-tag": C,
|
|
231
231
|
"virtual-scroll": "",
|
|
232
232
|
"onUpdate:value": w
|
|
@@ -239,93 +239,93 @@ var Qt = { style: { "margin-bottom": "12px" } }, Yt = /* @__PURE__ */ ae({
|
|
|
239
239
|
"filterable"
|
|
240
240
|
]));
|
|
241
241
|
}
|
|
242
|
-
}),
|
|
243
|
-
const
|
|
244
|
-
input:
|
|
245
|
-
"input-number":
|
|
246
|
-
select:
|
|
247
|
-
"date-picker":
|
|
248
|
-
"time-picker":
|
|
249
|
-
switch:
|
|
250
|
-
slider:
|
|
251
|
-
"radio-group":
|
|
252
|
-
"checkbox-group":
|
|
253
|
-
cascader:
|
|
254
|
-
"tree-select":
|
|
255
|
-
upload:
|
|
256
|
-
rate:
|
|
257
|
-
"color-picker":
|
|
258
|
-
"auto-complete":
|
|
259
|
-
"dynamic-input":
|
|
260
|
-
"dynamic-tags":
|
|
261
|
-
mention:
|
|
262
|
-
"image-upload":
|
|
263
|
-
"file-upload":
|
|
264
|
-
"icon-select":
|
|
242
|
+
}), Ne = ta;
|
|
243
|
+
const aa = {
|
|
244
|
+
input: Tt,
|
|
245
|
+
"input-number": Nt,
|
|
246
|
+
select: Ke,
|
|
247
|
+
"date-picker": yt,
|
|
248
|
+
"time-picker": Ut,
|
|
249
|
+
switch: Ot,
|
|
250
|
+
slider: It,
|
|
251
|
+
"radio-group": je,
|
|
252
|
+
"checkbox-group": ke,
|
|
253
|
+
cascader: ct,
|
|
254
|
+
"tree-select": At,
|
|
255
|
+
upload: Le,
|
|
256
|
+
rate: $t,
|
|
257
|
+
"color-picker": pt,
|
|
258
|
+
"auto-complete": ft,
|
|
259
|
+
"dynamic-input": bt,
|
|
260
|
+
"dynamic-tags": _t,
|
|
261
|
+
mention: Pt,
|
|
262
|
+
"image-upload": pe,
|
|
263
|
+
"file-upload": pe,
|
|
264
|
+
"icon-select": Ne
|
|
265
265
|
};
|
|
266
|
-
var
|
|
267
|
-
function
|
|
268
|
-
var t =
|
|
266
|
+
var ra = typeof global == "object" && global && global.Object === Object && global, na = ra, la = typeof self == "object" && self && self.Object === Object && self, oa = na || la || Function("return this")(), Pe = oa, ia = Pe.Symbol, te = ia, We = Object.prototype, sa = We.hasOwnProperty, ua = We.toString, ie = te ? te.toStringTag : void 0;
|
|
267
|
+
function da(e) {
|
|
268
|
+
var t = sa.call(e, ie), r = e[ie];
|
|
269
269
|
try {
|
|
270
270
|
e[ie] = void 0;
|
|
271
271
|
var a = !0;
|
|
272
272
|
} catch {
|
|
273
273
|
}
|
|
274
|
-
var l =
|
|
274
|
+
var l = ua.call(e);
|
|
275
275
|
return a && (t ? e[ie] = r : delete e[ie]), l;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
278
|
-
function
|
|
279
|
-
return
|
|
277
|
+
var fa = da, ca = Object.prototype.toString;
|
|
278
|
+
function pa(e) {
|
|
279
|
+
return ca.call(e);
|
|
280
280
|
}
|
|
281
|
-
var
|
|
282
|
-
function
|
|
283
|
-
return e == null ? e === void 0 ?
|
|
281
|
+
var ma = pa, ya = "[object Null]", ga = "[object Undefined]", Oe = te ? te.toStringTag : void 0;
|
|
282
|
+
function ha(e) {
|
|
283
|
+
return e == null ? e === void 0 ? ga : ya : Oe && Oe in Object(e) ? fa(e) : ma(e);
|
|
284
284
|
}
|
|
285
|
-
var qe =
|
|
286
|
-
function
|
|
285
|
+
var qe = ha;
|
|
286
|
+
function va(e) {
|
|
287
287
|
return e != null && typeof e == "object";
|
|
288
288
|
}
|
|
289
|
-
var
|
|
290
|
-
function
|
|
291
|
-
return typeof e == "symbol" ||
|
|
289
|
+
var ba = va, _a = "[object Symbol]";
|
|
290
|
+
function wa(e) {
|
|
291
|
+
return typeof e == "symbol" || ba(e) && qe(e) == _a;
|
|
292
292
|
}
|
|
293
|
-
var
|
|
294
|
-
function
|
|
293
|
+
var De = wa;
|
|
294
|
+
function Ca(e, t) {
|
|
295
295
|
for (var r = -1, a = e == null ? 0 : e.length, l = Array(a); ++r < a; ) l[r] = t(e[r], r, e);
|
|
296
296
|
return l;
|
|
297
297
|
}
|
|
298
|
-
var
|
|
298
|
+
var xa = Ca, ka = Array.isArray, Fe = ka, Sa = 1 / 0, Be = te ? te.prototype : void 0, Ue = Be ? Be.toString : void 0;
|
|
299
299
|
function Je(e) {
|
|
300
300
|
if (typeof e == "string") return e;
|
|
301
|
-
if (
|
|
302
|
-
if (
|
|
301
|
+
if (Fe(e)) return xa(e, Je) + "";
|
|
302
|
+
if (De(e)) return Ue ? Ue.call(e) : "";
|
|
303
303
|
var t = e + "";
|
|
304
|
-
return t == "0" && 1 / e == -
|
|
304
|
+
return t == "0" && 1 / e == -Sa ? "-0" : t;
|
|
305
305
|
}
|
|
306
|
-
var
|
|
307
|
-
function
|
|
306
|
+
var Ta = Je;
|
|
307
|
+
function Na(e) {
|
|
308
308
|
var t = typeof e;
|
|
309
309
|
return e != null && (t == "object" || t == "function");
|
|
310
310
|
}
|
|
311
|
-
var
|
|
312
|
-
function
|
|
313
|
-
if (!
|
|
311
|
+
var me = Na, Pa = "[object AsyncFunction]", Da = "[object Function]", Fa = "[object GeneratorFunction]", za = "[object Proxy]";
|
|
312
|
+
function Ra(e) {
|
|
313
|
+
if (!me(e)) return !1;
|
|
314
314
|
var t = qe(e);
|
|
315
|
-
return t ==
|
|
315
|
+
return t == Da || t == Fa || t == Pa || t == za;
|
|
316
316
|
}
|
|
317
|
-
var
|
|
318
|
-
var e = /[^.]+$/.exec(
|
|
317
|
+
var $a = Ra, Ia = Pe["__core-js_shared__"], _e = Ia, Ae = (function() {
|
|
318
|
+
var e = /[^.]+$/.exec(_e && _e.keys && _e.keys.IE_PROTO || "");
|
|
319
319
|
return e ? "Symbol(src)_1." + e : "";
|
|
320
320
|
})();
|
|
321
|
-
function
|
|
322
|
-
return !!
|
|
321
|
+
function Oa(e) {
|
|
322
|
+
return !!Ae && Ae in e;
|
|
323
323
|
}
|
|
324
|
-
var
|
|
325
|
-
function
|
|
324
|
+
var Ba = Oa, Ua = Function.prototype.toString;
|
|
325
|
+
function Aa(e) {
|
|
326
326
|
if (e != null) {
|
|
327
327
|
try {
|
|
328
|
-
return
|
|
328
|
+
return Ua.call(e);
|
|
329
329
|
} catch {
|
|
330
330
|
}
|
|
331
331
|
try {
|
|
@@ -335,83 +335,83 @@ function Ia(e) {
|
|
|
335
335
|
}
|
|
336
336
|
return "";
|
|
337
337
|
}
|
|
338
|
-
var
|
|
339
|
-
function
|
|
340
|
-
return !
|
|
338
|
+
var Ma = Aa, Ea = /[\\^$.*+?()[\]{}|]/g, Va = /^\[object .+?Constructor\]$/, Ga = Function.prototype, ja = Object.prototype, Ka = Ga.toString, La = ja.hasOwnProperty, Ha = RegExp("^" + Ka.call(La).replace(Ea, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
339
|
+
function Wa(e) {
|
|
340
|
+
return !me(e) || Ba(e) ? !1 : ($a(e) ? Ha : Va).test(Ma(e));
|
|
341
341
|
}
|
|
342
|
-
var
|
|
343
|
-
function
|
|
342
|
+
var qa = Wa;
|
|
343
|
+
function Ja(e, t) {
|
|
344
344
|
return e?.[t];
|
|
345
345
|
}
|
|
346
|
-
var
|
|
347
|
-
function
|
|
348
|
-
var r =
|
|
349
|
-
return
|
|
346
|
+
var Qa = Ja;
|
|
347
|
+
function Ya(e, t) {
|
|
348
|
+
var r = Qa(e, t);
|
|
349
|
+
return qa(r) ? r : void 0;
|
|
350
350
|
}
|
|
351
|
-
var
|
|
351
|
+
var ze = Ya, Xa = (function() {
|
|
352
352
|
try {
|
|
353
|
-
var e =
|
|
353
|
+
var e = ze(Object, "defineProperty");
|
|
354
354
|
return e({}, "", {}), e;
|
|
355
355
|
} catch {
|
|
356
356
|
}
|
|
357
|
-
})(),
|
|
358
|
-
function
|
|
357
|
+
})(), Me = Xa, Za = 9007199254740991, er = /^(?:0|[1-9]\d*)$/;
|
|
358
|
+
function tr(e, t) {
|
|
359
359
|
var r = typeof e;
|
|
360
|
-
return t = t ??
|
|
360
|
+
return t = t ?? Za, !!t && (r == "number" || r != "symbol" && er.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
361
361
|
}
|
|
362
|
-
var
|
|
363
|
-
function
|
|
364
|
-
t == "__proto__" &&
|
|
362
|
+
var ar = tr;
|
|
363
|
+
function rr(e, t, r) {
|
|
364
|
+
t == "__proto__" && Me ? Me(e, t, {
|
|
365
365
|
configurable: !0,
|
|
366
366
|
enumerable: !0,
|
|
367
367
|
value: r,
|
|
368
368
|
writable: !0
|
|
369
369
|
}) : e[t] = r;
|
|
370
370
|
}
|
|
371
|
-
var
|
|
372
|
-
function
|
|
371
|
+
var nr = rr;
|
|
372
|
+
function lr(e, t) {
|
|
373
373
|
return e === t || e !== e && t !== t;
|
|
374
374
|
}
|
|
375
|
-
var Qe =
|
|
376
|
-
function
|
|
375
|
+
var Qe = lr, or = Object.prototype.hasOwnProperty;
|
|
376
|
+
function ir(e, t, r) {
|
|
377
377
|
var a = e[t];
|
|
378
|
-
(!(
|
|
378
|
+
(!(or.call(e, t) && Qe(a, r)) || r === void 0 && !(t in e)) && nr(e, t, r);
|
|
379
379
|
}
|
|
380
|
-
var
|
|
381
|
-
function
|
|
382
|
-
if (
|
|
380
|
+
var sr = ir, ur = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, dr = /^\w*$/;
|
|
381
|
+
function fr(e, t) {
|
|
382
|
+
if (Fe(e)) return !1;
|
|
383
383
|
var r = typeof e;
|
|
384
|
-
return r == "number" || r == "symbol" || r == "boolean" || e == null ||
|
|
384
|
+
return r == "number" || r == "symbol" || r == "boolean" || e == null || De(e) ? !0 : dr.test(e) || !ur.test(e) || t != null && e in Object(t);
|
|
385
385
|
}
|
|
386
|
-
var
|
|
387
|
-
function
|
|
386
|
+
var cr = fr, pr = ze(Object, "create"), ue = pr;
|
|
387
|
+
function mr() {
|
|
388
388
|
this.__data__ = ue ? ue(null) : {}, this.size = 0;
|
|
389
389
|
}
|
|
390
|
-
var
|
|
391
|
-
function
|
|
390
|
+
var yr = mr;
|
|
391
|
+
function gr(e) {
|
|
392
392
|
var t = this.has(e) && delete this.__data__[e];
|
|
393
393
|
return this.size -= t ? 1 : 0, t;
|
|
394
394
|
}
|
|
395
|
-
var
|
|
396
|
-
function
|
|
395
|
+
var hr = gr, vr = "__lodash_hash_undefined__", br = Object.prototype.hasOwnProperty;
|
|
396
|
+
function _r(e) {
|
|
397
397
|
var t = this.__data__;
|
|
398
398
|
if (ue) {
|
|
399
399
|
var r = t[e];
|
|
400
|
-
return r ===
|
|
400
|
+
return r === vr ? void 0 : r;
|
|
401
401
|
}
|
|
402
|
-
return
|
|
402
|
+
return br.call(t, e) ? t[e] : void 0;
|
|
403
403
|
}
|
|
404
|
-
var
|
|
405
|
-
function
|
|
404
|
+
var wr = _r, Cr = Object.prototype.hasOwnProperty;
|
|
405
|
+
function xr(e) {
|
|
406
406
|
var t = this.__data__;
|
|
407
|
-
return ue ? t[e] !== void 0 :
|
|
407
|
+
return ue ? t[e] !== void 0 : Cr.call(t, e);
|
|
408
408
|
}
|
|
409
|
-
var
|
|
410
|
-
function
|
|
409
|
+
var kr = xr, Sr = "__lodash_hash_undefined__";
|
|
410
|
+
function Tr(e, t) {
|
|
411
411
|
var r = this.__data__;
|
|
412
|
-
return this.size += this.has(e) ? 0 : 1, r[e] = ue && t === void 0 ?
|
|
412
|
+
return this.size += this.has(e) ? 0 : 1, r[e] = ue && t === void 0 ? Sr : t, this;
|
|
413
413
|
}
|
|
414
|
-
var
|
|
414
|
+
var Nr = Tr;
|
|
415
415
|
function re(e) {
|
|
416
416
|
var t = -1, r = e == null ? 0 : e.length;
|
|
417
417
|
for (this.clear(); ++t < r; ) {
|
|
@@ -419,40 +419,40 @@ function re(e) {
|
|
|
419
419
|
this.set(a[0], a[1]);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
re.prototype.clear =
|
|
423
|
-
re.prototype.delete =
|
|
424
|
-
re.prototype.get =
|
|
425
|
-
re.prototype.has =
|
|
426
|
-
re.prototype.set =
|
|
427
|
-
var
|
|
428
|
-
function
|
|
422
|
+
re.prototype.clear = yr;
|
|
423
|
+
re.prototype.delete = hr;
|
|
424
|
+
re.prototype.get = wr;
|
|
425
|
+
re.prototype.has = kr;
|
|
426
|
+
re.prototype.set = Nr;
|
|
427
|
+
var Ee = re;
|
|
428
|
+
function Pr() {
|
|
429
429
|
this.__data__ = [], this.size = 0;
|
|
430
430
|
}
|
|
431
|
-
var
|
|
432
|
-
function
|
|
431
|
+
var Dr = Pr;
|
|
432
|
+
function Fr(e, t) {
|
|
433
433
|
for (var r = e.length; r--; ) if (Qe(e[r][0], t)) return r;
|
|
434
434
|
return -1;
|
|
435
435
|
}
|
|
436
|
-
var
|
|
437
|
-
function
|
|
438
|
-
var t = this.__data__, r =
|
|
439
|
-
return r < 0 ? !1 : (r == t.length - 1 ? t.pop() :
|
|
436
|
+
var ye = Fr, zr = Array.prototype.splice;
|
|
437
|
+
function Rr(e) {
|
|
438
|
+
var t = this.__data__, r = ye(t, e);
|
|
439
|
+
return r < 0 ? !1 : (r == t.length - 1 ? t.pop() : zr.call(t, r, 1), --this.size, !0);
|
|
440
440
|
}
|
|
441
|
-
var
|
|
442
|
-
function
|
|
443
|
-
var t = this.__data__, r =
|
|
441
|
+
var $r = Rr;
|
|
442
|
+
function Ir(e) {
|
|
443
|
+
var t = this.__data__, r = ye(t, e);
|
|
444
444
|
return r < 0 ? void 0 : t[r][1];
|
|
445
445
|
}
|
|
446
|
-
var
|
|
447
|
-
function
|
|
448
|
-
return
|
|
446
|
+
var Or = Ir;
|
|
447
|
+
function Br(e) {
|
|
448
|
+
return ye(this.__data__, e) > -1;
|
|
449
449
|
}
|
|
450
|
-
var
|
|
451
|
-
function
|
|
452
|
-
var r = this.__data__, a =
|
|
450
|
+
var Ur = Br;
|
|
451
|
+
function Ar(e, t) {
|
|
452
|
+
var r = this.__data__, a = ye(r, e);
|
|
453
453
|
return a < 0 ? (++this.size, r.push([e, t])) : r[a][1] = t, this;
|
|
454
454
|
}
|
|
455
|
-
var
|
|
455
|
+
var Mr = Ar;
|
|
456
456
|
function ne(e) {
|
|
457
457
|
var t = -1, r = e == null ? 0 : e.length;
|
|
458
458
|
for (this.clear(); ++t < r; ) {
|
|
@@ -460,48 +460,48 @@ function ne(e) {
|
|
|
460
460
|
this.set(a[0], a[1]);
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
ne.prototype.clear =
|
|
464
|
-
ne.prototype.delete =
|
|
465
|
-
ne.prototype.get =
|
|
466
|
-
ne.prototype.has =
|
|
467
|
-
ne.prototype.set =
|
|
468
|
-
var
|
|
469
|
-
function
|
|
463
|
+
ne.prototype.clear = Dr;
|
|
464
|
+
ne.prototype.delete = $r;
|
|
465
|
+
ne.prototype.get = Or;
|
|
466
|
+
ne.prototype.has = Ur;
|
|
467
|
+
ne.prototype.set = Mr;
|
|
468
|
+
var Er = ne, Vr = ze(Pe, "Map"), Gr = Vr;
|
|
469
|
+
function jr() {
|
|
470
470
|
this.size = 0, this.__data__ = {
|
|
471
|
-
hash: new
|
|
472
|
-
map: new (
|
|
473
|
-
string: new
|
|
471
|
+
hash: new Ee(),
|
|
472
|
+
map: new (Gr || Er)(),
|
|
473
|
+
string: new Ee()
|
|
474
474
|
};
|
|
475
475
|
}
|
|
476
|
-
var
|
|
477
|
-
function
|
|
476
|
+
var Kr = jr;
|
|
477
|
+
function Lr(e) {
|
|
478
478
|
var t = typeof e;
|
|
479
479
|
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
|
|
480
480
|
}
|
|
481
|
-
var
|
|
482
|
-
function
|
|
481
|
+
var Hr = Lr;
|
|
482
|
+
function Wr(e, t) {
|
|
483
483
|
var r = e.__data__;
|
|
484
|
-
return
|
|
484
|
+
return Hr(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map;
|
|
485
485
|
}
|
|
486
|
-
var
|
|
487
|
-
function
|
|
488
|
-
var t =
|
|
486
|
+
var ge = Wr;
|
|
487
|
+
function qr(e) {
|
|
488
|
+
var t = ge(this, e).delete(e);
|
|
489
489
|
return this.size -= t ? 1 : 0, t;
|
|
490
490
|
}
|
|
491
|
-
var
|
|
492
|
-
function
|
|
493
|
-
return
|
|
491
|
+
var Jr = qr;
|
|
492
|
+
function Qr(e) {
|
|
493
|
+
return ge(this, e).get(e);
|
|
494
494
|
}
|
|
495
|
-
var
|
|
496
|
-
function
|
|
497
|
-
return
|
|
495
|
+
var Yr = Qr;
|
|
496
|
+
function Xr(e) {
|
|
497
|
+
return ge(this, e).has(e);
|
|
498
498
|
}
|
|
499
|
-
var
|
|
500
|
-
function
|
|
501
|
-
var r =
|
|
499
|
+
var Zr = Xr;
|
|
500
|
+
function en(e, t) {
|
|
501
|
+
var r = ge(this, e), a = r.size;
|
|
502
502
|
return r.set(e, t), this.size += r.size == a ? 0 : 1, this;
|
|
503
503
|
}
|
|
504
|
-
var
|
|
504
|
+
var tn = en;
|
|
505
505
|
function le(e) {
|
|
506
506
|
var t = -1, r = e == null ? 0 : e.length;
|
|
507
507
|
for (this.clear(); ++t < r; ) {
|
|
@@ -509,84 +509,84 @@ function le(e) {
|
|
|
509
509
|
this.set(a[0], a[1]);
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
le.prototype.clear =
|
|
513
|
-
le.prototype.delete =
|
|
514
|
-
le.prototype.get =
|
|
515
|
-
le.prototype.has =
|
|
516
|
-
le.prototype.set =
|
|
517
|
-
var Ye = le,
|
|
518
|
-
function
|
|
519
|
-
if (typeof e != "function" || t != null && typeof t != "function") throw new TypeError(
|
|
512
|
+
le.prototype.clear = Kr;
|
|
513
|
+
le.prototype.delete = Jr;
|
|
514
|
+
le.prototype.get = Yr;
|
|
515
|
+
le.prototype.has = Zr;
|
|
516
|
+
le.prototype.set = tn;
|
|
517
|
+
var Ye = le, an = "Expected a function";
|
|
518
|
+
function Re(e, t) {
|
|
519
|
+
if (typeof e != "function" || t != null && typeof t != "function") throw new TypeError(an);
|
|
520
520
|
var r = function() {
|
|
521
521
|
var a = arguments, l = t ? t.apply(this, a) : a[0], f = r.cache;
|
|
522
522
|
if (f.has(l)) return f.get(l);
|
|
523
|
-
var
|
|
524
|
-
return r.cache = f.set(l,
|
|
523
|
+
var o = e.apply(this, a);
|
|
524
|
+
return r.cache = f.set(l, o) || f, o;
|
|
525
525
|
};
|
|
526
|
-
return r.cache = new (
|
|
526
|
+
return r.cache = new (Re.Cache || Ye)(), r;
|
|
527
527
|
}
|
|
528
|
-
|
|
529
|
-
var
|
|
530
|
-
function
|
|
531
|
-
var t =
|
|
532
|
-
return r.size ===
|
|
528
|
+
Re.Cache = Ye;
|
|
529
|
+
var rn = Re, nn = 500;
|
|
530
|
+
function ln(e) {
|
|
531
|
+
var t = rn(e, function(a) {
|
|
532
|
+
return r.size === nn && r.clear(), a;
|
|
533
533
|
}), r = t.cache;
|
|
534
534
|
return t;
|
|
535
535
|
}
|
|
536
|
-
var
|
|
536
|
+
var on = ln, sn = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, un = /\\(\\)?/g, dn = on(function(e) {
|
|
537
537
|
var t = [];
|
|
538
|
-
return e.charCodeAt(0) === 46 && t.push(""), e.replace(
|
|
539
|
-
t.push(l ? f.replace(
|
|
538
|
+
return e.charCodeAt(0) === 46 && t.push(""), e.replace(sn, function(r, a, l, f) {
|
|
539
|
+
t.push(l ? f.replace(un, "$1") : a || r);
|
|
540
540
|
}), t;
|
|
541
|
-
}),
|
|
542
|
-
function
|
|
543
|
-
return e == null ? "" :
|
|
541
|
+
}), fn = dn;
|
|
542
|
+
function cn(e) {
|
|
543
|
+
return e == null ? "" : Ta(e);
|
|
544
544
|
}
|
|
545
|
-
var
|
|
546
|
-
function
|
|
547
|
-
return
|
|
545
|
+
var pn = cn;
|
|
546
|
+
function mn(e, t) {
|
|
547
|
+
return Fe(e) ? e : cr(e, t) ? [e] : fn(pn(e));
|
|
548
548
|
}
|
|
549
|
-
var Xe =
|
|
550
|
-
function
|
|
551
|
-
if (typeof e == "string" ||
|
|
549
|
+
var Xe = mn, yn = 1 / 0;
|
|
550
|
+
function gn(e) {
|
|
551
|
+
if (typeof e == "string" || De(e)) return e;
|
|
552
552
|
var t = e + "";
|
|
553
|
-
return t == "0" && 1 / e == -
|
|
553
|
+
return t == "0" && 1 / e == -yn ? "-0" : t;
|
|
554
554
|
}
|
|
555
|
-
var Ze =
|
|
556
|
-
function
|
|
555
|
+
var Ze = gn;
|
|
556
|
+
function hn(e, t) {
|
|
557
557
|
t = Xe(t, e);
|
|
558
558
|
for (var r = 0, a = t.length; e != null && r < a; ) e = e[Ze(t[r++])];
|
|
559
559
|
return r && r == a ? e : void 0;
|
|
560
560
|
}
|
|
561
|
-
var
|
|
562
|
-
function
|
|
563
|
-
var a = e == null ? void 0 :
|
|
561
|
+
var vn = hn;
|
|
562
|
+
function bn(e, t, r) {
|
|
563
|
+
var a = e == null ? void 0 : vn(e, t);
|
|
564
564
|
return a === void 0 ? r : a;
|
|
565
565
|
}
|
|
566
|
-
var
|
|
567
|
-
function
|
|
568
|
-
if (!
|
|
566
|
+
var _n = bn;
|
|
567
|
+
function wn(e, t, r, a) {
|
|
568
|
+
if (!me(e)) return e;
|
|
569
569
|
t = Xe(t, e);
|
|
570
|
-
for (var l = -1, f = t.length,
|
|
570
|
+
for (var l = -1, f = t.length, o = f - 1, C = e; C != null && ++l < f; ) {
|
|
571
571
|
var w = Ze(t[l]), v = r;
|
|
572
572
|
if (w === "__proto__" || w === "constructor" || w === "prototype") return e;
|
|
573
|
-
if (l !=
|
|
574
|
-
var
|
|
575
|
-
v = a ? a(
|
|
573
|
+
if (l != o) {
|
|
574
|
+
var b = C[w];
|
|
575
|
+
v = a ? a(b, w, C) : void 0, v === void 0 && (v = me(b) ? b : ar(t[l + 1]) ? [] : {});
|
|
576
576
|
}
|
|
577
|
-
|
|
577
|
+
sr(C, w, v), C = C[w];
|
|
578
578
|
}
|
|
579
579
|
return e;
|
|
580
580
|
}
|
|
581
|
-
var
|
|
582
|
-
function
|
|
583
|
-
return e == null ? e :
|
|
581
|
+
var Cn = wn;
|
|
582
|
+
function xn(e, t, r) {
|
|
583
|
+
return e == null ? e : Cn(e, t, r);
|
|
584
584
|
}
|
|
585
|
-
var
|
|
586
|
-
const
|
|
587
|
-
|
|
585
|
+
var kn = xn;
|
|
586
|
+
const Ve = (e, t) => _n(e, t), Sn = (e, t, r) => {
|
|
587
|
+
kn(e, t, r);
|
|
588
588
|
};
|
|
589
|
-
var
|
|
589
|
+
var Tn = /* @__PURE__ */ ae({
|
|
590
590
|
name: "DydxNaiveForm",
|
|
591
591
|
__name: "DydxNaiveForm",
|
|
592
592
|
props: {
|
|
@@ -640,7 +640,7 @@ var xn = /* @__PURE__ */ ae({
|
|
|
640
640
|
"validate"
|
|
641
641
|
],
|
|
642
642
|
setup(e, { expose: t, emit: r }) {
|
|
643
|
-
const a = e, l = r, f = Q(),
|
|
643
|
+
const a = e, l = r, f = Q(), o = $(() => ({
|
|
644
644
|
type: "primary",
|
|
645
645
|
text: "提交",
|
|
646
646
|
loading: a.loading,
|
|
@@ -658,7 +658,7 @@ var xn = /* @__PURE__ */ ae({
|
|
|
658
658
|
showRequireMark: a.showRequireMark,
|
|
659
659
|
requireMarkPlacement: a.requireMarkPlacement,
|
|
660
660
|
...a.formProps
|
|
661
|
-
})),
|
|
661
|
+
})), b = $(() => ({
|
|
662
662
|
cols: 24,
|
|
663
663
|
xGap: a.xGap,
|
|
664
664
|
yGap: a.yGap,
|
|
@@ -666,13 +666,13 @@ var xn = /* @__PURE__ */ ae({
|
|
|
666
666
|
...a.gridProps,
|
|
667
667
|
responsive: "self"
|
|
668
668
|
})), x = (n) => {
|
|
669
|
-
const
|
|
670
|
-
return
|
|
669
|
+
const s = n.type || "input";
|
|
670
|
+
return s === "custom" ? n.component : aa[s];
|
|
671
671
|
}, k = (n) => typeof n.disabled == "function" ? n.disabled(a.model) : n.disabled, D = (n) => {
|
|
672
|
-
const
|
|
673
|
-
if (
|
|
672
|
+
const s = { ...n.props };
|
|
673
|
+
if (s.placeholder !== void 0) return s;
|
|
674
674
|
const y = typeof n.label == "string" ? n.label : "";
|
|
675
|
-
if (!y) return
|
|
675
|
+
if (!y) return s;
|
|
676
676
|
const h = n.type || "input", V = [
|
|
677
677
|
"input",
|
|
678
678
|
"textarea",
|
|
@@ -686,29 +686,29 @@ var xn = /* @__PURE__ */ ae({
|
|
|
686
686
|
"time-picker",
|
|
687
687
|
"color-picker"
|
|
688
688
|
];
|
|
689
|
-
return V.includes(h) ?
|
|
689
|
+
return V.includes(h) ? s.placeholder = `请输入${y}` : Z.includes(h) && (s.placeholder = `请选择${y}`), s;
|
|
690
690
|
}, M = (n) => {
|
|
691
|
-
const
|
|
691
|
+
const s = n.type === "custom" ? "modelValue" : "value";
|
|
692
692
|
return {
|
|
693
|
-
[n.modelPropName ||
|
|
693
|
+
[n.modelPropName || s]: z(n.name),
|
|
694
694
|
...D(n),
|
|
695
695
|
disabled: k(n)
|
|
696
696
|
};
|
|
697
697
|
}, q = (n) => {
|
|
698
|
-
const
|
|
699
|
-
return { [n.modelEventName || `update:${y}`]: (h) =>
|
|
698
|
+
const s = n.type === "custom" ? "modelValue" : "value", y = n.modelPropName || s;
|
|
699
|
+
return { [n.modelEventName || `update:${y}`]: (h) => d(n.name, h) };
|
|
700
700
|
}, S = (n) => {
|
|
701
701
|
if (!n) return {};
|
|
702
|
-
const { options:
|
|
702
|
+
const { options: s, labelField: y, valueField: h, ...V } = n;
|
|
703
703
|
return V;
|
|
704
|
-
},
|
|
704
|
+
}, P = (n) => {
|
|
705
705
|
if (!n) return {};
|
|
706
|
-
const { text:
|
|
706
|
+
const { text: s, ...y } = n;
|
|
707
707
|
return y;
|
|
708
|
-
}, z = (n) =>
|
|
709
|
-
|
|
710
|
-
},
|
|
711
|
-
let
|
|
708
|
+
}, z = (n) => Ve(a.model, n), d = (n, s) => {
|
|
709
|
+
Sn(a.model, n, s), l("update:model", a.model);
|
|
710
|
+
}, u = (n) => {
|
|
711
|
+
let s = typeof n.rule == "function" ? n.rule(a.model) : n.rule;
|
|
712
712
|
const y = !n.noRequired;
|
|
713
713
|
if (y) {
|
|
714
714
|
const h = {
|
|
@@ -716,11 +716,11 @@ var xn = /* @__PURE__ */ ae({
|
|
|
716
716
|
message: `${typeof n.label == "string" ? n.label : "此项"}不能为空`,
|
|
717
717
|
trigger: "blur"
|
|
718
718
|
};
|
|
719
|
-
|
|
719
|
+
s ? s = Array.isArray(s) ? [h, ...s] : [h, s] : s = h;
|
|
720
720
|
}
|
|
721
721
|
return {
|
|
722
722
|
label: typeof n.label == "string" ? n.label : void 0,
|
|
723
|
-
rule:
|
|
723
|
+
rule: s,
|
|
724
724
|
showRequireMark: y ? void 0 : !1,
|
|
725
725
|
...n.formItemProps
|
|
726
726
|
};
|
|
@@ -734,11 +734,11 @@ var xn = /* @__PURE__ */ ae({
|
|
|
734
734
|
}, T = (n) => {
|
|
735
735
|
if (typeof n == "number" || typeof n == "string") return n;
|
|
736
736
|
if (typeof n == "object") {
|
|
737
|
-
const
|
|
737
|
+
const s = [];
|
|
738
738
|
return Object.entries(m).forEach(([y, h]) => {
|
|
739
739
|
const V = n[y];
|
|
740
|
-
V !== void 0 &&
|
|
741
|
-
}),
|
|
740
|
+
V !== void 0 && s.push(`${h}:${V}`);
|
|
741
|
+
}), s.length === 0 ? 24 : s.join(" ");
|
|
742
742
|
}
|
|
743
743
|
return 24;
|
|
744
744
|
}, E = (n) => ({
|
|
@@ -746,9 +746,9 @@ var xn = /* @__PURE__ */ ae({
|
|
|
746
746
|
offset: n.offset
|
|
747
747
|
}), L = async (...n) => {
|
|
748
748
|
await f.value.validate(...n);
|
|
749
|
-
},
|
|
749
|
+
}, O = async (n, s) => {
|
|
750
750
|
const y = Array.isArray(n) ? n : [n];
|
|
751
|
-
await f.value.validate(
|
|
751
|
+
await f.value.validate(s, (h) => y.some((V) => h.key === V));
|
|
752
752
|
}, oe = () => f.value?.restoreValidation(), Y = () => {
|
|
753
753
|
oe(), l("reset");
|
|
754
754
|
}, de = async () => {
|
|
@@ -757,134 +757,134 @@ var xn = /* @__PURE__ */ ae({
|
|
|
757
757
|
} catch (n) {
|
|
758
758
|
l("validate", n);
|
|
759
759
|
}
|
|
760
|
-
},
|
|
760
|
+
}, $e = () => {
|
|
761
761
|
Y();
|
|
762
762
|
};
|
|
763
763
|
return t({
|
|
764
764
|
formRef: f.value,
|
|
765
765
|
validate: L,
|
|
766
|
-
validateField:
|
|
766
|
+
validateField: O,
|
|
767
767
|
restoreValidation: oe,
|
|
768
768
|
getFormData: () => a.model,
|
|
769
769
|
setFormData: (n) => Object.assign(a.model, n),
|
|
770
|
-
getFieldValue: (n) =>
|
|
771
|
-
setFieldValue: (n,
|
|
770
|
+
getFieldValue: (n) => Ve(a.model, n),
|
|
771
|
+
setFieldValue: (n, s) => d(n, s),
|
|
772
772
|
resetFields: Y,
|
|
773
773
|
getFormItemInst: (n) => f.value?.getFormItemInst?.(n)
|
|
774
|
-
}), (n,
|
|
775
|
-
const y =
|
|
774
|
+
}), (n, s) => {
|
|
775
|
+
const y = Ct, h = kt, V = B, Z = xt, ve = wt;
|
|
776
776
|
return g(), K(W, null, [
|
|
777
777
|
U(n.$slots, "header", { model: a.model }),
|
|
778
|
-
|
|
779
|
-
default:
|
|
778
|
+
_(p(Se), { show: a.loading }, {
|
|
779
|
+
default: i(() => [_(ve, G({
|
|
780
780
|
ref_key: "formRef",
|
|
781
781
|
ref: f,
|
|
782
782
|
model: a.model
|
|
783
783
|
}, v.value), {
|
|
784
|
-
default:
|
|
785
|
-
default:
|
|
786
|
-
default:
|
|
784
|
+
default: i(() => [_(Z, Kt(Vt(b.value)), {
|
|
785
|
+
default: i(() => [(g(!0), K(W, null, X(w.value, (c) => (g(), N(h, G({ key: c.name }, { ref_for: !0 }, E(c)), {
|
|
786
|
+
default: i(() => [c.type === "slot" ? U(n.$slots, c.slot || c.name, {
|
|
787
787
|
key: 0,
|
|
788
788
|
model: a.model,
|
|
789
789
|
schema: c
|
|
790
|
-
}) : (g(),
|
|
790
|
+
}) : (g(), N(y, G({
|
|
791
791
|
key: 1,
|
|
792
792
|
path: c.name
|
|
793
|
-
}, { ref_for: !0 },
|
|
794
|
-
default:
|
|
793
|
+
}, { ref_for: !0 }, u(c)), se({
|
|
794
|
+
default: i(() => [U(n.$slots, `field-${c.name}`, {
|
|
795
795
|
model: a.model,
|
|
796
796
|
schema: c,
|
|
797
797
|
value: z(c.name),
|
|
798
|
-
setValue: (R) =>
|
|
799
|
-
}, () => [c.type === "radio-group" && c.props?.options ? (g(),
|
|
798
|
+
setValue: (R) => d(c.name, R)
|
|
799
|
+
}, () => [c.type === "radio-group" && c.props?.options ? (g(), N(p(je), G({
|
|
800
800
|
key: 0,
|
|
801
801
|
value: z(c.name),
|
|
802
|
-
"onUpdate:value": (R) =>
|
|
802
|
+
"onUpdate:value": (R) => d(c.name, R)
|
|
803
803
|
}, { ref_for: !0 }, S(c.props)), {
|
|
804
|
-
default:
|
|
805
|
-
default:
|
|
804
|
+
default: i(() => [_(p(H), null, {
|
|
805
|
+
default: i(() => [(g(!0), K(W, null, X(c.props.options, (R) => (g(), N(p(Rt), {
|
|
806
806
|
key: R[c.props.valueField || "value"],
|
|
807
807
|
value: R[c.props.valueField || "value"],
|
|
808
808
|
disabled: R.disabled
|
|
809
809
|
}, {
|
|
810
|
-
default:
|
|
810
|
+
default: i(() => [I(A(R[c.props.labelField || "label"]), 1)]),
|
|
811
811
|
_: 2
|
|
812
812
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
813
813
|
_: 2
|
|
814
814
|
}, 1024)]),
|
|
815
815
|
_: 2
|
|
816
|
-
}, 1040, ["value", "onUpdate:value"])) : c.type === "checkbox-group" && c.props?.options ? (g(),
|
|
816
|
+
}, 1040, ["value", "onUpdate:value"])) : c.type === "checkbox-group" && c.props?.options ? (g(), N(p(ke), G({
|
|
817
817
|
key: 1,
|
|
818
818
|
value: z(c.name),
|
|
819
|
-
"onUpdate:value": (R) =>
|
|
819
|
+
"onUpdate:value": (R) => d(c.name, R)
|
|
820
820
|
}, { ref_for: !0 }, S(c.props)), {
|
|
821
|
-
default:
|
|
822
|
-
default:
|
|
821
|
+
default: i(() => [_(p(H), null, {
|
|
822
|
+
default: i(() => [(g(!0), K(W, null, X(c.props.options, (R) => (g(), N(p(Ge), {
|
|
823
823
|
key: R[c.props.valueField || "value"],
|
|
824
824
|
value: R[c.props.valueField || "value"],
|
|
825
825
|
disabled: R.disabled
|
|
826
826
|
}, {
|
|
827
|
-
default:
|
|
827
|
+
default: i(() => [I(A(R[c.props.labelField || "label"]), 1)]),
|
|
828
828
|
_: 2
|
|
829
829
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
830
830
|
_: 2
|
|
831
831
|
}, 1024)]),
|
|
832
832
|
_: 2
|
|
833
|
-
}, 1040, ["value", "onUpdate:value"])) : c.type === "switch" ? (g(),
|
|
833
|
+
}, 1040, ["value", "onUpdate:value"])) : c.type === "switch" ? (g(), N(ee(x(c)), G({
|
|
834
834
|
key: 2,
|
|
835
835
|
value: z(c.name),
|
|
836
|
-
"onUpdate:value": (R) =>
|
|
836
|
+
"onUpdate:value": (R) => d(c.name, R)
|
|
837
837
|
}, { ref_for: !0 }, c.props, { disabled: k(c) }), null, 16, [
|
|
838
838
|
"value",
|
|
839
839
|
"onUpdate:value",
|
|
840
840
|
"disabled"
|
|
841
|
-
])) : c.type === "image-upload" || c.type === "file-upload" ? (g(),
|
|
841
|
+
])) : c.type === "image-upload" || c.type === "file-upload" ? (g(), N(ee(x(c)), G({
|
|
842
842
|
key: 3,
|
|
843
843
|
"file-list": z(c.name) || [],
|
|
844
|
-
"onUpdate:fileList": (R) =>
|
|
844
|
+
"onUpdate:fileList": (R) => d(c.name, R),
|
|
845
845
|
"upload-type": c.type === "image-upload" ? "image" : "file"
|
|
846
846
|
}, { ref_for: !0 }, c.props, { disabled: k(c) }), null, 16, [
|
|
847
847
|
"file-list",
|
|
848
848
|
"onUpdate:fileList",
|
|
849
849
|
"upload-type",
|
|
850
850
|
"disabled"
|
|
851
|
-
])) : (g(),
|
|
851
|
+
])) : (g(), N(ee(x(c)), G({
|
|
852
852
|
key: 4,
|
|
853
853
|
ref_for: !0
|
|
854
|
-
}, M(c),
|
|
854
|
+
}, M(c), Wt(q(c))), null, 16))])]),
|
|
855
855
|
_: 2
|
|
856
856
|
}, [typeof c.label == "function" ? {
|
|
857
857
|
name: "label",
|
|
858
|
-
fn:
|
|
858
|
+
fn: i(() => [(g(), N(ee(c.label)))]),
|
|
859
859
|
key: "0"
|
|
860
860
|
} : void 0]), 1040, ["path"]))]),
|
|
861
861
|
_: 2
|
|
862
|
-
}, 1040))), 128)), a.showFooter ? (g(),
|
|
862
|
+
}, 1040))), 128)), a.showFooter ? (g(), N(h, {
|
|
863
863
|
key: 0,
|
|
864
864
|
span: a.footerSpan
|
|
865
865
|
}, {
|
|
866
|
-
default:
|
|
866
|
+
default: i(() => [U(n.$slots, "footer", {
|
|
867
867
|
model: a.model,
|
|
868
868
|
validate: L,
|
|
869
869
|
reset: Y
|
|
870
|
-
}, () => [
|
|
871
|
-
default:
|
|
872
|
-
C.value.hidden ? j("", !0) : (g(),
|
|
873
|
-
default:
|
|
870
|
+
}, () => [_(p(H), { justify: a.footerAlign }, {
|
|
871
|
+
default: i(() => [
|
|
872
|
+
C.value.hidden ? j("", !0) : (g(), N(V, G({ key: 0 }, P(C.value), { onClick: $e }), {
|
|
873
|
+
default: i(() => [I(A(C.value.text), 1)]),
|
|
874
874
|
_: 1
|
|
875
875
|
}, 16)),
|
|
876
|
-
|
|
877
|
-
default:
|
|
876
|
+
o.value.hidden ? j("", !0) : (g(), N(V, G({ key: 1 }, P(o.value), { onClick: de }), {
|
|
877
|
+
default: i(() => [I(A(o.value.text), 1)]),
|
|
878
878
|
_: 1
|
|
879
879
|
}, 16)),
|
|
880
|
-
(g(!0), K(W, null, X(a.extraButtons, (c) => (g(),
|
|
880
|
+
(g(!0), K(W, null, X(a.extraButtons, (c) => (g(), N(V, {
|
|
881
881
|
key: c.text,
|
|
882
882
|
type: c.type,
|
|
883
883
|
size: c.size,
|
|
884
884
|
disabled: c.disabled,
|
|
885
885
|
onClick: c.onClick
|
|
886
886
|
}, {
|
|
887
|
-
default:
|
|
887
|
+
default: i(() => [I(A(c.text), 1)]),
|
|
888
888
|
_: 2
|
|
889
889
|
}, 1032, [
|
|
890
890
|
"type",
|
|
@@ -907,89 +907,89 @@ var xn = /* @__PURE__ */ ae({
|
|
|
907
907
|
], 64);
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
|
-
}),
|
|
911
|
-
function
|
|
912
|
-
const { maxVisible: t = -1, buttons: r = [], showView: a = !0, showEdit: l = !0, showDelete: f = !0, viewConfig:
|
|
910
|
+
}), he = Tn;
|
|
911
|
+
function Nn(e) {
|
|
912
|
+
const { maxVisible: t = -1, buttons: r = [], showView: a = !0, showEdit: l = !0, showDelete: f = !0, viewConfig: o, editConfig: C, deleteConfig: w, onView: v, onEdit: b, onDelete: x } = e, k = (u, m, T, E) => m ? u ? typeof u.show == "function" ? u.show(T, E) : u.show !== !1 : !0 : !1, D = (u, m, T) => u ? typeof u.disabled == "function" ? u.disabled(m, T) : u.disabled === !0 : !1, M = (u, m, T) => typeof u.show == "function" ? u.show(m, T) : u.show !== !1, q = (u, m, T) => typeof u.disabled == "function" ? u.disabled(m, T) : u.disabled === !0, S = (u, m, T) => typeof u == "function" ? u(m) : u || T, P = (u) => {
|
|
913
913
|
const m = F(B, {
|
|
914
|
-
type:
|
|
914
|
+
type: u.type,
|
|
915
915
|
size: "small",
|
|
916
|
-
disabled:
|
|
917
|
-
onClick:
|
|
918
|
-
}, { default: () =>
|
|
919
|
-
return
|
|
916
|
+
disabled: u.disabled,
|
|
917
|
+
onClick: u.confirm ? void 0 : u.onClick
|
|
918
|
+
}, { default: () => u.label });
|
|
919
|
+
return u.confirm ? F(Ft, { onPositiveClick: u.onClick }, {
|
|
920
920
|
trigger: () => m,
|
|
921
|
-
default: () =>
|
|
921
|
+
default: () => u.confirm
|
|
922
922
|
}) : m;
|
|
923
|
-
}, z = (
|
|
924
|
-
const m =
|
|
923
|
+
}, z = (u) => {
|
|
924
|
+
const m = u.map((E) => ({
|
|
925
925
|
label: E.label,
|
|
926
926
|
key: E.key,
|
|
927
927
|
disabled: E.disabled
|
|
928
928
|
}));
|
|
929
|
-
return F(
|
|
929
|
+
return F(vt, {
|
|
930
930
|
options: m,
|
|
931
931
|
trigger: "click",
|
|
932
932
|
onSelect: (E) => {
|
|
933
|
-
|
|
933
|
+
u.find((L) => L.key === E)?.onClick();
|
|
934
934
|
}
|
|
935
935
|
}, { default: () => F(B, { size: "small" }, { default: () => "更多" }) });
|
|
936
936
|
};
|
|
937
937
|
return {
|
|
938
|
-
renderActions: (
|
|
938
|
+
renderActions: (u, m) => {
|
|
939
939
|
const T = [];
|
|
940
|
-
if (k(
|
|
940
|
+
if (k(o, a, u, m) && T.push({
|
|
941
941
|
key: "__view__",
|
|
942
|
-
label:
|
|
942
|
+
label: o?.label || "查看",
|
|
943
943
|
type: "info",
|
|
944
|
-
disabled: D(
|
|
944
|
+
disabled: D(o, u, m),
|
|
945
945
|
onClick: () => v?.({
|
|
946
|
-
row:
|
|
946
|
+
row: u,
|
|
947
947
|
index: m
|
|
948
948
|
})
|
|
949
|
-
}), k(C, l,
|
|
949
|
+
}), k(C, l, u, m) && T.push({
|
|
950
950
|
key: "__edit__",
|
|
951
951
|
label: C?.label || "编辑",
|
|
952
952
|
type: "primary",
|
|
953
|
-
disabled: D(C,
|
|
954
|
-
onClick: () =>
|
|
955
|
-
row:
|
|
953
|
+
disabled: D(C, u, m),
|
|
954
|
+
onClick: () => b?.({
|
|
955
|
+
row: u,
|
|
956
956
|
index: m
|
|
957
957
|
})
|
|
958
|
-
}), k(w, f,
|
|
958
|
+
}), k(w, f, u, m) && T.push({
|
|
959
959
|
key: "__delete__",
|
|
960
960
|
label: w?.label || "删除",
|
|
961
961
|
type: "error",
|
|
962
|
-
disabled: D(w,
|
|
963
|
-
confirm: S(w?.confirm,
|
|
962
|
+
disabled: D(w, u, m),
|
|
963
|
+
confirm: S(w?.confirm, u, "确定删除此记录吗?"),
|
|
964
964
|
onClick: () => x?.({
|
|
965
|
-
row:
|
|
965
|
+
row: u,
|
|
966
966
|
index: m
|
|
967
967
|
})
|
|
968
|
-
}), r.forEach((
|
|
969
|
-
M(
|
|
970
|
-
key:
|
|
971
|
-
label:
|
|
972
|
-
type:
|
|
973
|
-
disabled: q(
|
|
974
|
-
confirm:
|
|
975
|
-
onClick: () =>
|
|
968
|
+
}), r.forEach((O) => {
|
|
969
|
+
M(O, u, m) && T.push({
|
|
970
|
+
key: O.key,
|
|
971
|
+
label: O.label,
|
|
972
|
+
type: O.type || "default",
|
|
973
|
+
disabled: q(O, u, m),
|
|
974
|
+
confirm: O.confirm ? S(O.confirm, u, "确定执行此操作吗?") : void 0,
|
|
975
|
+
onClick: () => O.onClick?.(u, m)
|
|
976
976
|
});
|
|
977
977
|
}), t === -1 || T.length <= t) return F(H, {
|
|
978
978
|
size: "small",
|
|
979
979
|
wrap: !1
|
|
980
|
-
}, () => T.map((
|
|
980
|
+
}, () => T.map((O) => P(O)));
|
|
981
981
|
if (t === 0) return z(T);
|
|
982
982
|
const E = T.slice(0, t), L = T.slice(t);
|
|
983
983
|
return F(H, {
|
|
984
984
|
size: "small",
|
|
985
985
|
wrap: !1
|
|
986
|
-
}, () => [...E.map((
|
|
986
|
+
}, () => [...E.map((O) => P(O)), z(L)]);
|
|
987
987
|
},
|
|
988
988
|
isButtonVisible: M,
|
|
989
989
|
isButtonDisabled: q
|
|
990
990
|
};
|
|
991
991
|
}
|
|
992
|
-
var
|
|
992
|
+
var Pn = (e) => {
|
|
993
993
|
if (!e) return "";
|
|
994
994
|
try {
|
|
995
995
|
const t = new URL(e).pathname.split("/").pop() || "";
|
|
@@ -1010,18 +1010,18 @@ var Sn = (e) => {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
}, {
|
|
1012
1012
|
default: () => f,
|
|
1013
|
-
icon: () => F(J, { size: 14 }, () => F(
|
|
1013
|
+
icon: () => F(J, { size: 14 }, () => F(Qt))
|
|
1014
1014
|
});
|
|
1015
1015
|
}, at = (e, t) => {
|
|
1016
1016
|
if (!e) return "-";
|
|
1017
|
-
const r = String(e), a = t?.width ?? 60, l = t?.height ?? 60, f = t?.radius ?? 4,
|
|
1018
|
-
return F(
|
|
1017
|
+
const r = String(e), a = t?.width ?? 60, l = t?.height ?? 60, f = t?.radius ?? 4, o = t?.fallback;
|
|
1018
|
+
return F(St, {
|
|
1019
1019
|
src: r,
|
|
1020
1020
|
width: typeof a == "number" ? a : void 0,
|
|
1021
1021
|
height: typeof l == "number" ? l : void 0,
|
|
1022
1022
|
objectFit: "cover",
|
|
1023
1023
|
previewDisabled: !1,
|
|
1024
|
-
fallbackSrc:
|
|
1024
|
+
fallbackSrc: o,
|
|
1025
1025
|
style: {
|
|
1026
1026
|
width: typeof a == "string" ? a : `${a}px`,
|
|
1027
1027
|
height: typeof l == "string" ? l : `${l}px`,
|
|
@@ -1031,11 +1031,11 @@ var Sn = (e) => {
|
|
|
1031
1031
|
});
|
|
1032
1032
|
}, rt = (e, t, r) => {
|
|
1033
1033
|
if (!e) return "-";
|
|
1034
|
-
const a = String(e), l = r?.getFileName ? r.getFileName(a, t) :
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1034
|
+
const a = String(e), l = r?.getFileName ? r.getFileName(a, t) : Pn(a), f = () => {
|
|
1035
|
+
const o = document.createElement("a");
|
|
1036
|
+
o.href = a, o.download = l, o.target = "_blank", o.rel = "noopener noreferrer", document.body.appendChild(o), o.click(), document.body.removeChild(o);
|
|
1037
1037
|
};
|
|
1038
|
-
return F(
|
|
1038
|
+
return F(Ce, { trigger: "hover" }, {
|
|
1039
1039
|
trigger: () => F(B, {
|
|
1040
1040
|
text: !0,
|
|
1041
1041
|
type: "primary",
|
|
@@ -1049,7 +1049,7 @@ var Sn = (e) => {
|
|
|
1049
1049
|
display: "inline-block",
|
|
1050
1050
|
verticalAlign: "middle"
|
|
1051
1051
|
} }, l),
|
|
1052
|
-
icon: () => F(J, { size: 14 }, () => F(
|
|
1052
|
+
icon: () => F(J, { size: 14 }, () => F(Jt))
|
|
1053
1053
|
}),
|
|
1054
1054
|
default: () => l
|
|
1055
1055
|
});
|
|
@@ -1060,25 +1060,28 @@ var Sn = (e) => {
|
|
|
1060
1060
|
size: t?.size ?? 20,
|
|
1061
1061
|
color: t?.color
|
|
1062
1062
|
}, () => F(a)) : r;
|
|
1063
|
-
},
|
|
1063
|
+
}, xe = (e, t, r = "label", a = "value") => {
|
|
1064
1064
|
if (e == null) return "-";
|
|
1065
|
-
if (!t || t.length === 0) return F(
|
|
1066
|
-
const l = t.find((f) =>
|
|
1065
|
+
if (!t || t.length === 0) return F(be, { size: "small" }, () => String(e));
|
|
1066
|
+
const l = t.find((f) => {
|
|
1067
|
+
const o = f[a];
|
|
1068
|
+
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;
|
|
1069
|
+
});
|
|
1067
1070
|
if (l) {
|
|
1068
|
-
const f = l,
|
|
1069
|
-
return F(
|
|
1071
|
+
const f = l, o = f[r];
|
|
1072
|
+
return F(be, {
|
|
1070
1073
|
size: "small",
|
|
1071
1074
|
...Object.keys(l).reduce((C, w) => (w !== r && w !== a && (C[w] = f[w]), C), {})
|
|
1072
|
-
}, () =>
|
|
1075
|
+
}, () => o);
|
|
1073
1076
|
}
|
|
1074
|
-
return F(
|
|
1077
|
+
return F(be, { size: "small" }, () => String(e));
|
|
1075
1078
|
}, lt = (e, t, r = "label", a = "value") => e == null ? "-" : Array.isArray(e) ? F(H, {
|
|
1076
1079
|
size: "small",
|
|
1077
1080
|
wrap: !0
|
|
1078
1081
|
}, () => e.map((l, f) => {
|
|
1079
|
-
const
|
|
1080
|
-
return typeof
|
|
1081
|
-
})) :
|
|
1082
|
+
const o = xe(l, t, r, a);
|
|
1083
|
+
return typeof o == "string" ? F("span", { key: f }, o) : o;
|
|
1084
|
+
})) : xe(e, t, r, a);
|
|
1082
1085
|
const ot = (e, t, r) => {
|
|
1083
1086
|
switch (r.columnType || "text") {
|
|
1084
1087
|
case "link":
|
|
@@ -1104,26 +1107,26 @@ function Hn() {
|
|
|
1104
1107
|
renderLink: tt,
|
|
1105
1108
|
renderImage: at,
|
|
1106
1109
|
renderFile: rt,
|
|
1107
|
-
renderTag:
|
|
1110
|
+
renderTag: xe,
|
|
1108
1111
|
renderTags: lt,
|
|
1109
1112
|
renderIcon: nt
|
|
1110
1113
|
};
|
|
1111
1114
|
}
|
|
1112
|
-
function
|
|
1113
|
-
const { columns: t, actionColumn: r, onView: a, onEdit: l, onDelete: f } = e,
|
|
1114
|
-
if ("title" in
|
|
1115
|
-
if (typeof
|
|
1116
|
-
if (typeof
|
|
1115
|
+
function Dn(e) {
|
|
1116
|
+
const { columns: t, actionColumn: r, onView: a, onEdit: l, onDelete: f } = e, o = (d) => "key" in d && d.key ? String(d.key) : "type" in d ? `__${d.type}__` : "", C = (d) => {
|
|
1117
|
+
if ("title" in d) {
|
|
1118
|
+
if (typeof d.title == "string") return d.title;
|
|
1119
|
+
if (typeof d.title == "function") return "自定义列";
|
|
1117
1120
|
}
|
|
1118
|
-
return d
|
|
1119
|
-
}, w = (
|
|
1120
|
-
key: d
|
|
1121
|
-
title: C(
|
|
1122
|
-
visible: x.value.includes(d
|
|
1123
|
-
configurable: v(
|
|
1121
|
+
return o(d);
|
|
1122
|
+
}, w = (d) => "defaultVisible" in d ? d.defaultVisible !== !1 : !0, v = (d) => "type" in d && (d.type === "selection" || d.type === "expand") ? !1 : "configurable" in d ? d.configurable !== !1 : !0, b = () => t.filter((d) => w(d)).map((d) => o(d)).filter(Boolean), x = Q(b()), k = $(() => t.filter((d) => o(d) && v(d)).map((d) => ({
|
|
1123
|
+
key: o(d),
|
|
1124
|
+
title: C(d),
|
|
1125
|
+
visible: x.value.includes(o(d)),
|
|
1126
|
+
configurable: v(d)
|
|
1124
1127
|
}))), D = () => {
|
|
1125
1128
|
if (r?.show === !1) return null;
|
|
1126
|
-
const { renderActions:
|
|
1129
|
+
const { renderActions: d } = Nn({
|
|
1127
1130
|
...r,
|
|
1128
1131
|
onView: a,
|
|
1129
1132
|
onEdit: l,
|
|
@@ -1135,42 +1138,42 @@ function Tn(e) {
|
|
|
1135
1138
|
width: r?.width || 180,
|
|
1136
1139
|
minWidth: r?.minWidth,
|
|
1137
1140
|
fixed: r?.fixed !== !1 ? r?.fixed || "right" : void 0,
|
|
1138
|
-
render: (
|
|
1141
|
+
render: (u, m) => d(u, m)
|
|
1139
1142
|
};
|
|
1140
|
-
}, M = (
|
|
1141
|
-
if ("columnType" in
|
|
1142
|
-
const
|
|
1143
|
+
}, M = (d) => {
|
|
1144
|
+
if ("columnType" in d && it(d)) {
|
|
1145
|
+
const u = d, m = u.key;
|
|
1143
1146
|
return {
|
|
1144
|
-
...
|
|
1145
|
-
render: (T) => ot(m ? T[m] : void 0, T,
|
|
1147
|
+
...d,
|
|
1148
|
+
render: (T) => ot(m ? T[m] : void 0, T, u)
|
|
1146
1149
|
};
|
|
1147
1150
|
}
|
|
1148
|
-
return
|
|
1151
|
+
return d;
|
|
1149
1152
|
};
|
|
1150
1153
|
return {
|
|
1151
1154
|
mergedColumns: $(() => {
|
|
1152
|
-
const
|
|
1153
|
-
const T =
|
|
1155
|
+
const d = t.filter((m) => {
|
|
1156
|
+
const T = o(m);
|
|
1154
1157
|
return "type" in m && (m.type === "selection" || m.type === "expand") || !T ? !0 : x.value.includes(T);
|
|
1155
|
-
}).map((m) => M(m)),
|
|
1156
|
-
return
|
|
1158
|
+
}).map((m) => M(m)), u = D();
|
|
1159
|
+
return u && d.push(u), d;
|
|
1157
1160
|
}),
|
|
1158
1161
|
configurableColumns: k,
|
|
1159
1162
|
visibleColumnKeys: x,
|
|
1160
|
-
setVisibleColumnKeys: (
|
|
1161
|
-
x.value =
|
|
1163
|
+
setVisibleColumnKeys: (d) => {
|
|
1164
|
+
x.value = d;
|
|
1162
1165
|
},
|
|
1163
1166
|
resetColumnSetting: () => {
|
|
1164
|
-
x.value =
|
|
1167
|
+
x.value = b();
|
|
1165
1168
|
},
|
|
1166
1169
|
getVisibleColumnKeys: () => [...x.value]
|
|
1167
1170
|
};
|
|
1168
1171
|
}
|
|
1169
|
-
var
|
|
1172
|
+
var Fn = {
|
|
1170
1173
|
page: "page",
|
|
1171
1174
|
pageSize: "pageSize",
|
|
1172
1175
|
itemCount: "itemCount"
|
|
1173
|
-
},
|
|
1176
|
+
}, we = {
|
|
1174
1177
|
pageSizes: [
|
|
1175
1178
|
10,
|
|
1176
1179
|
20,
|
|
@@ -1180,20 +1183,20 @@ var Pn = {
|
|
|
1180
1183
|
showSizePicker: !0,
|
|
1181
1184
|
showQuickJumper: !0
|
|
1182
1185
|
};
|
|
1183
|
-
function
|
|
1186
|
+
function zn(e) {
|
|
1184
1187
|
const { pagination: t, fieldNames: r, onUpdatePagination: a, onPageChange: l } = e, f = () => ({
|
|
1185
|
-
...
|
|
1188
|
+
...Fn,
|
|
1186
1189
|
...r
|
|
1187
|
-
}),
|
|
1190
|
+
}), o = (k) => {
|
|
1188
1191
|
if (!(t === !1 || !t))
|
|
1189
1192
|
return t[f()[k]];
|
|
1190
1193
|
}, C = $(() => t === !1 || !t ? !1 : {
|
|
1191
|
-
page:
|
|
1192
|
-
pageSize:
|
|
1193
|
-
itemCount:
|
|
1194
|
-
pageSizes: t.pageSizes ??
|
|
1195
|
-
showSizePicker: t.showSizePicker ??
|
|
1196
|
-
showQuickJumper: t.showQuickJumper ??
|
|
1194
|
+
page: o("page") ?? 1,
|
|
1195
|
+
pageSize: o("pageSize") ?? 10,
|
|
1196
|
+
itemCount: o("itemCount"),
|
|
1197
|
+
pageSizes: t.pageSizes ?? we.pageSizes,
|
|
1198
|
+
showSizePicker: t.showSizePicker ?? we.showSizePicker,
|
|
1199
|
+
showQuickJumper: t.showQuickJumper ?? we.showQuickJumper,
|
|
1197
1200
|
prefix: t.prefix,
|
|
1198
1201
|
suffix: t.suffix
|
|
1199
1202
|
}), w = (k) => {
|
|
@@ -1224,10 +1227,10 @@ function Nn(e) {
|
|
|
1224
1227
|
getFieldNames: f
|
|
1225
1228
|
};
|
|
1226
1229
|
}
|
|
1227
|
-
var
|
|
1230
|
+
var Rn = {
|
|
1228
1231
|
key: 0,
|
|
1229
1232
|
class: "dydx-table__toolbar"
|
|
1230
|
-
},
|
|
1233
|
+
}, $n = { class: "dydx-table__column-setting" }, In = { class: "dydx-table__column-setting-header" }, On = /* @__PURE__ */ ae({
|
|
1231
1234
|
inheritAttrs: !1,
|
|
1232
1235
|
__name: "DydxNaiveTable",
|
|
1233
1236
|
props: {
|
|
@@ -1274,55 +1277,55 @@ var Dn = {
|
|
|
1274
1277
|
"delete"
|
|
1275
1278
|
],
|
|
1276
1279
|
setup(e, { expose: t, emit: r }) {
|
|
1277
|
-
const a = e, l = r, f =
|
|
1278
|
-
const y = getComputedStyle(
|
|
1279
|
-
return
|
|
1280
|
-
},
|
|
1281
|
-
let y =
|
|
1280
|
+
const a = e, l = r, f = Te(), o = Q(null), C = Q(void 0), w = $(() => !f.maxHeight), v = (s) => {
|
|
1281
|
+
const y = getComputedStyle(s);
|
|
1282
|
+
return s.clientHeight <= 0 ? !1 : !!(parseFloat(y.flexGrow) > 0 || y.height && y.height !== "auto" && y.height !== "0px" || y.maxHeight && y.maxHeight !== "none" && y.maxHeight !== "0px" || y.overflowY === "auto" || y.overflowY === "scroll");
|
|
1283
|
+
}, b = (s) => {
|
|
1284
|
+
let y = s.parentElement;
|
|
1282
1285
|
for (; y && y !== document.body; ) {
|
|
1283
1286
|
if (v(y)) return y;
|
|
1284
1287
|
y = y.parentElement;
|
|
1285
1288
|
}
|
|
1286
1289
|
return null;
|
|
1287
1290
|
}, x = () => {
|
|
1288
|
-
w.value &&
|
|
1289
|
-
const
|
|
1290
|
-
if (!
|
|
1291
|
-
const y =
|
|
1291
|
+
w.value && jt(() => {
|
|
1292
|
+
const s = o.value;
|
|
1293
|
+
if (!s) return;
|
|
1294
|
+
const y = b(s);
|
|
1292
1295
|
if (!y) {
|
|
1293
1296
|
C.value = void 0;
|
|
1294
1297
|
return;
|
|
1295
1298
|
}
|
|
1296
|
-
const h = y.getBoundingClientRect(), V =
|
|
1299
|
+
const h = y.getBoundingClientRect(), V = s.getBoundingClientRect(), Z = s.querySelector(".dydx-table__toolbar"), ve = Z ? Z.offsetHeight + 16 : 0, c = V.top - h.top, R = y.clientHeight - c - ve;
|
|
1297
1300
|
R > 200 ? C.value = R : C.value = void 0;
|
|
1298
1301
|
});
|
|
1299
1302
|
}, k = $(() => f.maxHeight ? f.maxHeight : C.value);
|
|
1300
|
-
|
|
1303
|
+
Lt(() => {
|
|
1301
1304
|
x(), window.addEventListener("resize", x);
|
|
1302
|
-
}),
|
|
1305
|
+
}), Ht(() => {
|
|
1303
1306
|
window.removeEventListener("resize", x);
|
|
1304
1307
|
});
|
|
1305
|
-
const D = Q(null), { mergedColumns: M, configurableColumns: q, visibleColumnKeys: S, setVisibleColumnKeys:
|
|
1308
|
+
const D = Q(null), { mergedColumns: M, configurableColumns: q, visibleColumnKeys: S, setVisibleColumnKeys: P, resetColumnSetting: z, getVisibleColumnKeys: d } = Dn({
|
|
1306
1309
|
columns: a.columns,
|
|
1307
1310
|
actionColumn: a.actionColumn,
|
|
1308
|
-
onView: (
|
|
1309
|
-
onEdit: (
|
|
1310
|
-
onDelete: (
|
|
1311
|
-
}), { paginationConfig:
|
|
1311
|
+
onView: (s) => l("view", s),
|
|
1312
|
+
onEdit: (s) => l("edit", s),
|
|
1313
|
+
onDelete: (s) => l("delete", s)
|
|
1314
|
+
}), { paginationConfig: u, handlePageChange: m, handlePageSizeChange: T } = zn({
|
|
1312
1315
|
get pagination() {
|
|
1313
1316
|
return a.pagination;
|
|
1314
1317
|
},
|
|
1315
1318
|
get fieldNames() {
|
|
1316
1319
|
return a.paginationFieldNames;
|
|
1317
1320
|
},
|
|
1318
|
-
onUpdatePagination: (
|
|
1319
|
-
onPageChange: (
|
|
1321
|
+
onUpdatePagination: (s) => l("update:pagination", s),
|
|
1322
|
+
onPageChange: (s) => l("pageChange", s)
|
|
1320
1323
|
});
|
|
1321
|
-
|
|
1322
|
-
l("update:visibleColumns",
|
|
1324
|
+
qt(S, (s) => {
|
|
1325
|
+
l("update:visibleColumns", s);
|
|
1323
1326
|
});
|
|
1324
|
-
const E = $(() => a.showAdd || a.leftButtons?.length || a.showRefresh || a.showColumnSetting || a.rightButtons?.length), L = $(() => typeof a.rowKey == "function" ? a.rowKey : (
|
|
1325
|
-
l("update:checkedRowKeys",
|
|
1327
|
+
const E = $(() => a.showAdd || a.leftButtons?.length || a.showRefresh || a.showColumnSetting || a.rightButtons?.length), L = $(() => typeof a.rowKey == "function" ? a.rowKey : (s) => s[a.rowKey]), O = (s) => {
|
|
1328
|
+
l("update:checkedRowKeys", s, a.data.filter((y) => s.includes(L.value(y))));
|
|
1326
1329
|
}, oe = () => {
|
|
1327
1330
|
a.onAdd?.();
|
|
1328
1331
|
}, Y = () => {
|
|
@@ -1336,130 +1339,130 @@ var Dn = {
|
|
|
1336
1339
|
refresh: () => {
|
|
1337
1340
|
Y();
|
|
1338
1341
|
},
|
|
1339
|
-
getVisibleColumnKeys:
|
|
1340
|
-
setVisibleColumnKeys:
|
|
1342
|
+
getVisibleColumnKeys: d,
|
|
1343
|
+
setVisibleColumnKeys: P,
|
|
1341
1344
|
resetColumnSetting: z,
|
|
1342
|
-
scrollTo: (
|
|
1343
|
-
D.value?.scrollTo(
|
|
1345
|
+
scrollTo: (s) => {
|
|
1346
|
+
D.value?.scrollTo(s);
|
|
1344
1347
|
}
|
|
1345
|
-
}), (
|
|
1348
|
+
}), (s, y) => (g(), K("div", {
|
|
1346
1349
|
ref_key: "containerRef",
|
|
1347
|
-
ref:
|
|
1350
|
+
ref: o,
|
|
1348
1351
|
class: "dydx-table"
|
|
1349
|
-
}, [E.value ? (g(), K("div",
|
|
1352
|
+
}, [E.value ? (g(), K("div", Rn, [_(p(H), {
|
|
1350
1353
|
class: "dydx-table__toolbar-left",
|
|
1351
1354
|
size: 12
|
|
1352
1355
|
}, {
|
|
1353
|
-
default:
|
|
1354
|
-
e.showAdd ? (g(),
|
|
1356
|
+
default: i(() => [
|
|
1357
|
+
e.showAdd ? (g(), N(p(B), {
|
|
1355
1358
|
key: 0,
|
|
1356
1359
|
type: "primary",
|
|
1357
1360
|
onClick: oe
|
|
1358
1361
|
}, {
|
|
1359
|
-
icon:
|
|
1360
|
-
default:
|
|
1362
|
+
icon: i(() => [U(s.$slots, "add-icon", {}, () => [_(p(J), null, {
|
|
1363
|
+
default: i(() => [_(p(He))]),
|
|
1361
1364
|
_: 1
|
|
1362
1365
|
})], !0)]),
|
|
1363
|
-
default:
|
|
1366
|
+
default: i(() => [I(" " + A(e.addButtonText), 1)]),
|
|
1364
1367
|
_: 3
|
|
1365
1368
|
})) : j("", !0),
|
|
1366
|
-
(g(!0), K(W, null, X(e.leftButtons, (h) => (g(), K(W, { key: h.key }, [h.show !== !1 ? (g(),
|
|
1369
|
+
(g(!0), K(W, null, X(e.leftButtons, (h) => (g(), K(W, { key: h.key }, [h.show !== !1 ? (g(), N(p(B), {
|
|
1367
1370
|
key: 0,
|
|
1368
1371
|
type: h.type,
|
|
1369
1372
|
disabled: h.disabled,
|
|
1370
1373
|
onClick: h.onClick
|
|
1371
1374
|
}, se({
|
|
1372
|
-
default:
|
|
1375
|
+
default: i(() => [I(" " + A(h.label), 1)]),
|
|
1373
1376
|
_: 2
|
|
1374
1377
|
}, [h.icon ? {
|
|
1375
1378
|
name: "icon",
|
|
1376
|
-
fn:
|
|
1379
|
+
fn: i(() => [(g(), N(ee(h.icon)))]),
|
|
1377
1380
|
key: "0"
|
|
1378
1381
|
} : void 0]), 1032, [
|
|
1379
1382
|
"type",
|
|
1380
1383
|
"disabled",
|
|
1381
1384
|
"onClick"
|
|
1382
1385
|
])) : j("", !0)], 64))), 128)),
|
|
1383
|
-
U(
|
|
1386
|
+
U(s.$slots, "toolbar-left", {}, void 0, !0)
|
|
1384
1387
|
]),
|
|
1385
1388
|
_: 3
|
|
1386
|
-
}),
|
|
1389
|
+
}), _(p(H), {
|
|
1387
1390
|
class: "dydx-table__toolbar-right",
|
|
1388
1391
|
size: 8
|
|
1389
1392
|
}, {
|
|
1390
|
-
default:
|
|
1391
|
-
U(
|
|
1392
|
-
(g(!0), K(W, null, X(e.rightButtons, (h) => (g(), K(W, { key: h.key }, [h.show !== !1 ? (g(),
|
|
1393
|
+
default: i(() => [
|
|
1394
|
+
U(s.$slots, "toolbar-right", {}, void 0, !0),
|
|
1395
|
+
(g(!0), K(W, null, X(e.rightButtons, (h) => (g(), K(W, { key: h.key }, [h.show !== !1 ? (g(), N(p(B), {
|
|
1393
1396
|
key: 0,
|
|
1394
1397
|
type: h.type,
|
|
1395
1398
|
disabled: h.disabled,
|
|
1396
1399
|
onClick: h.onClick
|
|
1397
1400
|
}, se({
|
|
1398
|
-
default:
|
|
1401
|
+
default: i(() => [I(" " + A(h.label), 1)]),
|
|
1399
1402
|
_: 2
|
|
1400
1403
|
}, [h.icon ? {
|
|
1401
1404
|
name: "icon",
|
|
1402
|
-
fn:
|
|
1405
|
+
fn: i(() => [(g(), N(ee(h.icon)))]),
|
|
1403
1406
|
key: "0"
|
|
1404
1407
|
} : void 0]), 1032, [
|
|
1405
1408
|
"type",
|
|
1406
1409
|
"disabled",
|
|
1407
1410
|
"onClick"
|
|
1408
1411
|
])) : j("", !0)], 64))), 128)),
|
|
1409
|
-
e.showRefresh ? (g(),
|
|
1412
|
+
e.showRefresh ? (g(), N(p(Ce), {
|
|
1410
1413
|
key: 0,
|
|
1411
1414
|
trigger: "hover"
|
|
1412
1415
|
}, {
|
|
1413
|
-
trigger:
|
|
1416
|
+
trigger: i(() => [_(p(B), {
|
|
1414
1417
|
circle: "",
|
|
1415
1418
|
class: "dydx-table__icon-btn",
|
|
1416
1419
|
onClick: Y
|
|
1417
1420
|
}, {
|
|
1418
|
-
icon:
|
|
1419
|
-
default:
|
|
1421
|
+
icon: i(() => [_(p(J), null, {
|
|
1422
|
+
default: i(() => [_(p(Yt))]),
|
|
1420
1423
|
_: 1
|
|
1421
1424
|
})]),
|
|
1422
1425
|
_: 1
|
|
1423
1426
|
})]),
|
|
1424
|
-
default:
|
|
1427
|
+
default: i(() => [y[1] || (y[1] = I(" 刷新 ", -1))]),
|
|
1425
1428
|
_: 1
|
|
1426
1429
|
})) : j("", !0),
|
|
1427
|
-
e.showColumnSetting ? (g(),
|
|
1430
|
+
e.showColumnSetting ? (g(), N(p(zt), {
|
|
1428
1431
|
key: 1,
|
|
1429
1432
|
trigger: "click",
|
|
1430
1433
|
placement: "bottom-end"
|
|
1431
1434
|
}, {
|
|
1432
|
-
trigger:
|
|
1433
|
-
trigger:
|
|
1435
|
+
trigger: i(() => [_(p(Ce), { trigger: "hover" }, {
|
|
1436
|
+
trigger: i(() => [_(p(B), {
|
|
1434
1437
|
circle: "",
|
|
1435
1438
|
class: "dydx-table__icon-btn"
|
|
1436
1439
|
}, {
|
|
1437
|
-
icon:
|
|
1438
|
-
default:
|
|
1440
|
+
icon: i(() => [_(p(J), null, {
|
|
1441
|
+
default: i(() => [_(p(Xt))]),
|
|
1439
1442
|
_: 1
|
|
1440
1443
|
})]),
|
|
1441
1444
|
_: 1
|
|
1442
1445
|
})]),
|
|
1443
|
-
default:
|
|
1446
|
+
default: i(() => [y[2] || (y[2] = I(" 列设置 ", -1))]),
|
|
1444
1447
|
_: 1
|
|
1445
1448
|
})]),
|
|
1446
|
-
default:
|
|
1449
|
+
default: i(() => [fe("div", $n, [fe("div", In, [y[4] || (y[4] = fe("span", null, "列设置", -1)), _(p(B), {
|
|
1447
1450
|
text: "",
|
|
1448
1451
|
size: "small",
|
|
1449
1452
|
type: "primary",
|
|
1450
1453
|
onClick: p(z)
|
|
1451
1454
|
}, {
|
|
1452
|
-
default:
|
|
1455
|
+
default: i(() => [...y[3] || (y[3] = [I(" 重置 ", -1)])]),
|
|
1453
1456
|
_: 1
|
|
1454
|
-
}, 8, ["onClick"])]),
|
|
1457
|
+
}, 8, ["onClick"])]), _(p(ke), {
|
|
1455
1458
|
value: p(S),
|
|
1456
|
-
"onUpdate:value": y[0] || (y[0] = (h) =>
|
|
1459
|
+
"onUpdate:value": y[0] || (y[0] = (h) => Gt(S) ? S.value = h : null)
|
|
1457
1460
|
}, {
|
|
1458
|
-
default:
|
|
1461
|
+
default: i(() => [_(p(H), {
|
|
1459
1462
|
vertical: "",
|
|
1460
1463
|
size: 8
|
|
1461
1464
|
}, {
|
|
1462
|
-
default:
|
|
1465
|
+
default: i(() => [(g(!0), K(W, null, X(p(q), (h) => (g(), N(p(Ge), {
|
|
1463
1466
|
key: h.key,
|
|
1464
1467
|
value: h.key,
|
|
1465
1468
|
label: h.title
|
|
@@ -1472,21 +1475,21 @@ var Dn = {
|
|
|
1472
1475
|
})) : j("", !0)
|
|
1473
1476
|
]),
|
|
1474
1477
|
_: 3
|
|
1475
|
-
})])) : j("", !0),
|
|
1478
|
+
})])) : j("", !0), _(p(mt), G({
|
|
1476
1479
|
ref_key: "dataTableRef",
|
|
1477
1480
|
ref: D,
|
|
1478
1481
|
data: e.data,
|
|
1479
1482
|
columns: p(M),
|
|
1480
1483
|
"row-key": L.value,
|
|
1481
1484
|
loading: e.loading,
|
|
1482
|
-
pagination: p(
|
|
1485
|
+
pagination: p(u),
|
|
1483
1486
|
remote: e.remote,
|
|
1484
1487
|
"checked-row-keys": e.checkedRowKeys,
|
|
1485
1488
|
"max-height": k.value
|
|
1486
1489
|
}, p(f), {
|
|
1487
1490
|
"onUpdate:page": p(m),
|
|
1488
1491
|
"onUpdate:pageSize": p(T),
|
|
1489
|
-
"onUpdate:checkedRowKeys":
|
|
1492
|
+
"onUpdate:checkedRowKeys": O
|
|
1490
1493
|
}), null, 16, [
|
|
1491
1494
|
"data",
|
|
1492
1495
|
"columns",
|
|
@@ -1500,11 +1503,11 @@ var Dn = {
|
|
|
1500
1503
|
"onUpdate:pageSize"
|
|
1501
1504
|
])], 512));
|
|
1502
1505
|
}
|
|
1503
|
-
}),
|
|
1506
|
+
}), Bn = (e, t) => {
|
|
1504
1507
|
const r = e.__vccOpts || e;
|
|
1505
1508
|
for (const [a, l] of t) r[a] = l;
|
|
1506
1509
|
return r;
|
|
1507
|
-
},
|
|
1510
|
+
}, st = /* @__PURE__ */ Bn(On, [["__scopeId", "data-v-af2504e6"]]), Un = /* @__PURE__ */ ae({
|
|
1508
1511
|
name: "DydxFormModal",
|
|
1509
1512
|
inheritAttrs: !1,
|
|
1510
1513
|
__name: "DydxFormModal",
|
|
@@ -1538,19 +1541,19 @@ var Dn = {
|
|
|
1538
1541
|
"cancel"
|
|
1539
1542
|
],
|
|
1540
1543
|
setup(e, { expose: t, emit: r }) {
|
|
1541
|
-
const a = e, l = r, f =
|
|
1544
|
+
const a = e, l = r, f = Te(), o = Q(), C = $(() => a.title ? a.title : `${a.model[a.rowKey] ? "编辑" : "新增"}${a.subtitle}`), w = $(() => ({ width: typeof a.width == "number" ? `${a.width}px` : a.width })), v = () => {
|
|
1542
1545
|
l("update:show", !1), l("cancel");
|
|
1543
|
-
},
|
|
1546
|
+
}, b = async () => {
|
|
1544
1547
|
try {
|
|
1545
|
-
await
|
|
1548
|
+
await o.value?.validate(), l("confirm", a.model);
|
|
1546
1549
|
} catch {
|
|
1547
1550
|
}
|
|
1548
1551
|
};
|
|
1549
1552
|
return t({
|
|
1550
|
-
getFormRef: () =>
|
|
1551
|
-
validate: () =>
|
|
1552
|
-
resetFields: () =>
|
|
1553
|
-
}), (x, k) => (g(),
|
|
1553
|
+
getFormRef: () => o.value,
|
|
1554
|
+
validate: () => o.value?.validate(),
|
|
1555
|
+
resetFields: () => o.value?.resetFields()
|
|
1556
|
+
}), (x, k) => (g(), N(p(Dt), G({
|
|
1554
1557
|
show: e.show,
|
|
1555
1558
|
preset: "card",
|
|
1556
1559
|
title: C.value,
|
|
@@ -1559,24 +1562,24 @@ var Dn = {
|
|
|
1559
1562
|
}, p(f), { "onUpdate:show": k[0] || (k[0] = (D) => l("update:show", D)) }), se({ _: 2 }, [
|
|
1560
1563
|
x.$slots.header ? {
|
|
1561
1564
|
name: "header",
|
|
1562
|
-
fn:
|
|
1565
|
+
fn: i(() => [U(x.$slots, "header")]),
|
|
1563
1566
|
key: "0"
|
|
1564
1567
|
} : void 0,
|
|
1565
1568
|
x.$slots["header-extra"] ? {
|
|
1566
1569
|
name: "header-extra",
|
|
1567
|
-
fn:
|
|
1570
|
+
fn: i(() => [U(x.$slots, "header-extra")]),
|
|
1568
1571
|
key: "1"
|
|
1569
1572
|
} : void 0,
|
|
1570
1573
|
x.$slots.default ? {
|
|
1571
1574
|
name: "default",
|
|
1572
|
-
fn:
|
|
1575
|
+
fn: i(() => [U(x.$slots, "default")]),
|
|
1573
1576
|
key: "2"
|
|
1574
1577
|
} : {
|
|
1575
1578
|
name: "default",
|
|
1576
|
-
fn:
|
|
1577
|
-
default:
|
|
1579
|
+
fn: i(() => [_(p(Se), { show: e.loading }, {
|
|
1580
|
+
default: i(() => [_(p(he), {
|
|
1578
1581
|
ref_key: "formRef",
|
|
1579
|
-
ref:
|
|
1582
|
+
ref: o,
|
|
1580
1583
|
schemas: e.schemas,
|
|
1581
1584
|
model: e.model,
|
|
1582
1585
|
cols: e.cols,
|
|
@@ -1600,23 +1603,23 @@ var Dn = {
|
|
|
1600
1603
|
},
|
|
1601
1604
|
x.$slots.footer ? {
|
|
1602
1605
|
name: "footer",
|
|
1603
|
-
fn:
|
|
1606
|
+
fn: i(() => [U(x.$slots, "footer")]),
|
|
1604
1607
|
key: "4"
|
|
1605
1608
|
} : {
|
|
1606
1609
|
name: "footer",
|
|
1607
|
-
fn:
|
|
1608
|
-
default:
|
|
1610
|
+
fn: i(() => [_(p(H), { justify: "end" }, {
|
|
1611
|
+
default: i(() => [e.showCancel ? (g(), N(p(B), {
|
|
1609
1612
|
key: 0,
|
|
1610
1613
|
onClick: v
|
|
1611
1614
|
}, {
|
|
1612
|
-
default:
|
|
1615
|
+
default: i(() => [I(A(e.cancelText), 1)]),
|
|
1613
1616
|
_: 1
|
|
1614
|
-
})) : j("", !0),
|
|
1617
|
+
})) : j("", !0), _(p(B), {
|
|
1615
1618
|
type: "primary",
|
|
1616
1619
|
loading: e.loading,
|
|
1617
|
-
onClick:
|
|
1620
|
+
onClick: b
|
|
1618
1621
|
}, {
|
|
1619
|
-
default:
|
|
1622
|
+
default: i(() => [I(A(e.confirmText), 1)]),
|
|
1620
1623
|
_: 1
|
|
1621
1624
|
}, 8, ["loading"])]),
|
|
1622
1625
|
_: 1
|
|
@@ -1625,7 +1628,7 @@ var Dn = {
|
|
|
1625
1628
|
},
|
|
1626
1629
|
x.$slots.action ? {
|
|
1627
1630
|
name: "action",
|
|
1628
|
-
fn:
|
|
1631
|
+
fn: i(() => [U(x.$slots, "action")]),
|
|
1629
1632
|
key: "6"
|
|
1630
1633
|
} : void 0
|
|
1631
1634
|
]), 1040, [
|
|
@@ -1634,7 +1637,7 @@ var Dn = {
|
|
|
1634
1637
|
"style"
|
|
1635
1638
|
]));
|
|
1636
1639
|
}
|
|
1637
|
-
}),
|
|
1640
|
+
}), ut = Un, An = /* @__PURE__ */ ae({
|
|
1638
1641
|
name: "DydxFormDrawer",
|
|
1639
1642
|
inheritAttrs: !1,
|
|
1640
1643
|
__name: "DydxFormDrawer",
|
|
@@ -1669,38 +1672,38 @@ var Dn = {
|
|
|
1669
1672
|
"cancel"
|
|
1670
1673
|
],
|
|
1671
1674
|
setup(e, { expose: t, emit: r }) {
|
|
1672
|
-
const a = e, l = r, f =
|
|
1675
|
+
const a = e, l = r, f = Te(), o = Q(), C = $(() => a.title ? a.title : `${a.model[a.rowKey] ? "编辑" : "新增"}${a.subtitle}`), w = () => {
|
|
1673
1676
|
l("update:show", !1), l("cancel");
|
|
1674
1677
|
}, v = async () => {
|
|
1675
1678
|
try {
|
|
1676
|
-
await
|
|
1679
|
+
await o.value?.validate(), l("confirm", a.model);
|
|
1677
1680
|
} catch {
|
|
1678
1681
|
}
|
|
1679
1682
|
};
|
|
1680
1683
|
return t({
|
|
1681
|
-
getFormRef: () =>
|
|
1682
|
-
validate: () =>
|
|
1683
|
-
resetFields: () =>
|
|
1684
|
-
}), (
|
|
1684
|
+
getFormRef: () => o.value,
|
|
1685
|
+
validate: () => o.value?.validate(),
|
|
1686
|
+
resetFields: () => o.value?.resetFields()
|
|
1687
|
+
}), (b, x) => (g(), N(p(gt), G({
|
|
1685
1688
|
show: e.show,
|
|
1686
1689
|
width: e.width,
|
|
1687
1690
|
placement: e.placement,
|
|
1688
1691
|
"mask-closable": !1
|
|
1689
1692
|
}, p(f), { "onUpdate:show": x[0] || (x[0] = (k) => l("update:show", k)) }), {
|
|
1690
|
-
default:
|
|
1693
|
+
default: i(() => [_(p(ht), {
|
|
1691
1694
|
title: C.value,
|
|
1692
1695
|
closable: "",
|
|
1693
1696
|
onClose: w
|
|
1694
|
-
}, se({ _: 2 }, [
|
|
1697
|
+
}, se({ _: 2 }, [b.$slots.default ? {
|
|
1695
1698
|
name: "default",
|
|
1696
|
-
fn:
|
|
1699
|
+
fn: i(() => [U(b.$slots, "default")]),
|
|
1697
1700
|
key: "0"
|
|
1698
1701
|
} : {
|
|
1699
1702
|
name: "default",
|
|
1700
|
-
fn:
|
|
1701
|
-
default:
|
|
1703
|
+
fn: i(() => [_(p(Se), { show: e.loading }, {
|
|
1704
|
+
default: i(() => [_(p(he), {
|
|
1702
1705
|
ref_key: "formRef",
|
|
1703
|
-
ref:
|
|
1706
|
+
ref: o,
|
|
1704
1707
|
schemas: e.schemas,
|
|
1705
1708
|
model: e.model,
|
|
1706
1709
|
cols: e.cols,
|
|
@@ -1721,25 +1724,25 @@ var Dn = {
|
|
|
1721
1724
|
_: 1
|
|
1722
1725
|
}, 8, ["show"])]),
|
|
1723
1726
|
key: "1"
|
|
1724
|
-
},
|
|
1727
|
+
}, b.$slots.footer ? {
|
|
1725
1728
|
name: "footer",
|
|
1726
|
-
fn:
|
|
1729
|
+
fn: i(() => [U(b.$slots, "footer")]),
|
|
1727
1730
|
key: "2"
|
|
1728
1731
|
} : {
|
|
1729
1732
|
name: "footer",
|
|
1730
|
-
fn:
|
|
1731
|
-
default:
|
|
1733
|
+
fn: i(() => [_(p(H), { justify: "end" }, {
|
|
1734
|
+
default: i(() => [e.showCancel ? (g(), N(p(B), {
|
|
1732
1735
|
key: 0,
|
|
1733
1736
|
onClick: w
|
|
1734
1737
|
}, {
|
|
1735
|
-
default:
|
|
1738
|
+
default: i(() => [I(A(e.cancelText), 1)]),
|
|
1736
1739
|
_: 1
|
|
1737
|
-
})) : j("", !0),
|
|
1740
|
+
})) : j("", !0), _(p(B), {
|
|
1738
1741
|
type: "primary",
|
|
1739
1742
|
loading: e.loading,
|
|
1740
1743
|
onClick: v
|
|
1741
1744
|
}, {
|
|
1742
|
-
default:
|
|
1745
|
+
default: i(() => [I(A(e.confirmText), 1)]),
|
|
1743
1746
|
_: 1
|
|
1744
1747
|
}, 8, ["loading"])]),
|
|
1745
1748
|
_: 1
|
|
@@ -1753,29 +1756,37 @@ var Dn = {
|
|
|
1753
1756
|
"placement"
|
|
1754
1757
|
]));
|
|
1755
1758
|
}
|
|
1756
|
-
}),
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1759
|
+
}), dt = An, Mn = [
|
|
1760
|
+
he,
|
|
1761
|
+
st,
|
|
1762
|
+
ut,
|
|
1763
|
+
dt,
|
|
1764
|
+
pe,
|
|
1765
|
+
Ne
|
|
1763
1766
|
], En = (e) => {
|
|
1764
1767
|
Mn.forEach((t) => {
|
|
1765
1768
|
t.name && e.component(t.name, t);
|
|
1766
1769
|
});
|
|
1767
|
-
}, Wn = {
|
|
1770
|
+
}, Wn = {
|
|
1771
|
+
install: En,
|
|
1772
|
+
DydxNaiveForm: he,
|
|
1773
|
+
DydxNaiveTable: st,
|
|
1774
|
+
DydxFormModal: ut,
|
|
1775
|
+
DydxFormDrawer: dt,
|
|
1776
|
+
DydxUpload: pe,
|
|
1777
|
+
DydxIconSelect: Ne
|
|
1778
|
+
};
|
|
1768
1779
|
export {
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1780
|
+
dt as DydxFormDrawer,
|
|
1781
|
+
ut as DydxFormModal,
|
|
1782
|
+
Ne as DydxIconSelect,
|
|
1783
|
+
he as DydxNaiveForm,
|
|
1784
|
+
st as DydxNaiveTable,
|
|
1774
1785
|
Gn as DydxNaiveUIResolver,
|
|
1775
|
-
|
|
1786
|
+
pe as DydxUpload,
|
|
1776
1787
|
Wn as default,
|
|
1777
1788
|
Hn as useColumnRender,
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1789
|
+
Dn as useColumns,
|
|
1790
|
+
zn as usePagination,
|
|
1791
|
+
Nn as useTableActions
|
|
1781
1792
|
};
|