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