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