dydx-naive-ui-for-vue 0.1.21 → 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,47 +43,47 @@ 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 [d] =
|
|
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
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
|
-
u(), l("error",
|
|
86
|
+
u(), l("error", N, m);
|
|
87
87
|
}
|
|
88
88
|
}, q = () => {
|
|
89
89
|
o.value?.submit();
|
|
@@ -92,38 +92,38 @@ var Zt = { style: { "margin-bottom": "12px" } }, ea = /* @__PURE__ */ ae({
|
|
|
92
92
|
submit: () => o.value?.submit(),
|
|
93
93
|
openDialog: () => o.value?.openOpenFileDialog(),
|
|
94
94
|
clear: () => o.value?.clear()
|
|
95
|
-
}), (
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
|
|
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
100
|
ref: o
|
|
101
|
-
},
|
|
102
|
-
"file-list":
|
|
103
|
-
"custom-request":
|
|
104
|
-
accept:
|
|
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: i(() => [e.showDragger && e.uploadType !== "image" ? (
|
|
113
|
+
default: i(() => [e.showDragger && e.uploadType !== "image" ? (y(), T(u, { key: 0 }, {
|
|
114
114
|
default: i(() => [
|
|
115
|
-
fe("div",
|
|
115
|
+
fe("div", ra, [b(F, {
|
|
116
116
|
size: "48",
|
|
117
117
|
depth: 3
|
|
118
118
|
}, {
|
|
119
|
-
default: i(() => [
|
|
119
|
+
default: i(() => [b(p(Be))]),
|
|
120
120
|
_: 1
|
|
121
121
|
})]),
|
|
122
|
-
|
|
123
|
-
default: i(() => [...
|
|
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: i(() => [
|
|
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: i(() => [
|
|
144
|
+
default: i(() => [b(p(qe))]),
|
|
145
145
|
_: 1
|
|
146
|
-
})) : (
|
|
147
|
-
icon: i(() => [
|
|
148
|
-
default: i(() => [
|
|
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: i(() => [
|
|
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: i(() => [...
|
|
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: i(() => [
|
|
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
|
-
}), o = (
|
|
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
229
|
"render-label": o,
|
|
230
|
-
"render-tag":
|
|
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);
|
|
280
|
+
}
|
|
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
284
|
}
|
|
285
|
-
var
|
|
286
|
-
function
|
|
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
|
|
317
|
+
var Ua = Ba, Aa = Pe["__core-js_shared__"], _e = Aa, Ee = (function() {
|
|
318
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 (
|
|
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
523
|
var o = e.apply(this, a);
|
|
524
|
-
return r.cache =
|
|
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 (
|
|
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
573
|
if (l != o) {
|
|
574
|
-
var
|
|
575
|
-
|
|
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
|
-
})),
|
|
668
|
+
})), C = (n) => {
|
|
669
669
|
const s = n.type || "input";
|
|
670
|
-
return s === "custom" ? n.component :
|
|
671
|
-
},
|
|
670
|
+
return s === "custom" ? n.component : oa[s];
|
|
671
|
+
}, x = (n) => typeof n.disabled == "function" ? n.disabled(a.model) : n.disabled, P = (n) => {
|
|
672
672
|
const s = { ...n.props };
|
|
673
673
|
if (s.placeholder !== void 0) return s;
|
|
674
|
-
const
|
|
675
|
-
if (!
|
|
676
|
-
const
|
|
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
|
-
},
|
|
689
|
+
return V.includes(I) ? s.placeholder = `请输入${g}` : oe.includes(I) && (s.placeholder = `请选择${g}`), s;
|
|
690
|
+
}, E = (n) => {
|
|
691
691
|
const s = n.type === "custom" ? "modelValue" : "value";
|
|
692
692
|
return {
|
|
693
|
-
[n.modelPropName || s]:
|
|
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 s = n.type === "custom" ? "modelValue" : "value",
|
|
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: s, labelField:
|
|
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: s, ...
|
|
707
|
-
return
|
|
708
|
-
},
|
|
709
|
-
|
|
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
710
|
}, u = (n) => {
|
|
711
711
|
let s = typeof n.rule == "function" ? n.rule(a.model) : n.rule;
|
|
712
|
-
const
|
|
713
|
-
if (
|
|
714
|
-
const
|
|
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
|
-
s ? s = Array.isArray(s) ? [
|
|
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
723
|
rule: s,
|
|
724
|
-
showRequireMark:
|
|
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
737
|
const s = [];
|
|
738
|
-
return Object.entries(m).forEach(([
|
|
739
|
-
const V = n[
|
|
740
|
-
V !== void 0 && s.push(`${
|
|
738
|
+
return Object.entries(m).forEach(([g, I]) => {
|
|
739
|
+
const V = n[g];
|
|
740
|
+
V !== void 0 && s.push(`${I}:${V}`);
|
|
741
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
|
|
748
|
+
await c.value.validate(...n);
|
|
749
749
|
}, O = async (n, s) => {
|
|
750
|
-
const
|
|
751
|
-
await
|
|
752
|
-
},
|
|
753
|
-
|
|
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) =>
|
|
770
|
+
getFieldValue: (n) => je(a.model, n),
|
|
771
771
|
setFieldValue: (n, s) => d(n, s),
|
|
772
|
-
resetFields:
|
|
773
|
-
getFormItemInst: (n) =>
|
|
772
|
+
resetFields: le,
|
|
773
|
+
getFormItemInst: (n) => c.value?.getFormItemInst?.(n)
|
|
774
774
|
}), (n, s) => {
|
|
775
|
-
const
|
|
776
|
-
return
|
|
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
|
-
|
|
779
|
-
default: i(() => [
|
|
778
|
+
b(p(Se), { show: a.loading }, {
|
|
779
|
+
default: i(() => [b(ve, G({
|
|
780
780
|
ref_key: "formRef",
|
|
781
|
-
ref:
|
|
781
|
+
ref: c,
|
|
782
782
|
model: a.model
|
|
783
|
-
},
|
|
784
|
-
default: i(() => [
|
|
785
|
-
default: i(() => [(
|
|
786
|
-
default: i(() => [
|
|
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 }, u(
|
|
794
|
-
default: i(() => [U(n.$slots, `field-${
|
|
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: i(() => [
|
|
805
|
-
default: i(() => [(
|
|
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: i(() => [
|
|
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: i(() => [
|
|
822
|
-
default: i(() => [(
|
|
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: i(() => [
|
|
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: i(() => [(
|
|
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
866
|
default: i(() => [U(n.$slots, "footer", {
|
|
867
867
|
model: a.model,
|
|
868
868
|
validate: L,
|
|
869
|
-
reset:
|
|
870
|
-
}, () => [
|
|
869
|
+
reset: le
|
|
870
|
+
}, () => [b(p(K), { justify: a.footerAlign }, {
|
|
871
871
|
default: i(() => [
|
|
872
|
-
|
|
873
|
-
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
|
-
o.value.hidden ? j("", !0) : (
|
|
877
|
-
default: i(() => [
|
|
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: i(() => [
|
|
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 =
|
|
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
914
|
type: u.type,
|
|
915
915
|
size: "small",
|
|
916
916
|
disabled: u.disabled,
|
|
917
917
|
onClick: u.confirm ? void 0 : u.onClick
|
|
918
918
|
}, { default: () => u.label });
|
|
919
|
-
return u.confirm ?
|
|
919
|
+
return u.confirm ? D(It, { onPositiveClick: u.onClick }, {
|
|
920
920
|
trigger: () => m,
|
|
921
921
|
default: () => u.confirm
|
|
922
922
|
}) : m;
|
|
923
|
-
},
|
|
924
|
-
const m = u.map((
|
|
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
|
-
u.find((L) => L.key ===
|
|
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
938
|
renderActions: (u, m) => {
|
|
939
|
-
const
|
|
940
|
-
if (
|
|
939
|
+
const S = [];
|
|
940
|
+
if (x(o, a, u, m) && S.push({
|
|
941
941
|
key: "__view__",
|
|
942
942
|
label: o?.label || "查看",
|
|
943
943
|
type: "info",
|
|
944
|
-
disabled:
|
|
945
|
-
onClick: () =>
|
|
944
|
+
disabled: P(o, u, m),
|
|
945
|
+
onClick: () => h?.({
|
|
946
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: () =>
|
|
953
|
+
disabled: P(w, u, m),
|
|
954
|
+
onClick: () => v?.({
|
|
955
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: () =>
|
|
962
|
+
disabled: P(_, u, m),
|
|
963
|
+
confirm: k(_?.confirm, u, "确定删除此记录吗?"),
|
|
964
|
+
onClick: () => C?.({
|
|
965
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
973
|
disabled: q(O, u, m),
|
|
974
|
-
confirm: O.confirm ?
|
|
974
|
+
confirm: O.confirm ? k(O.confirm, u, "确定执行此操作吗?") : void 0,
|
|
975
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,24 +998,24 @@ 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,
|
|
@@ -1025,23 +1025,23 @@ var Pn = (e) => {
|
|
|
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) :
|
|
1034
|
+
const a = String(e), l = r?.getFileName ? r.getFileName(a, t) : Rn(a), c = () => {
|
|
1035
1035
|
const o = document.createElement("a");
|
|
1036
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,88 +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((
|
|
1067
|
-
const o =
|
|
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
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
1069
|
});
|
|
1070
1070
|
if (l) {
|
|
1071
|
-
const
|
|
1072
|
-
return
|
|
1071
|
+
const c = l, o = c[r];
|
|
1072
|
+
return D(be, {
|
|
1073
1073
|
size: "small",
|
|
1074
|
-
...Object.keys(l).reduce((
|
|
1074
|
+
...Object.keys(l).reduce((w, _) => (_ !== r && _ !== a && (w[_] = c[_]), w), {})
|
|
1075
1075
|
}, () => o);
|
|
1076
1076
|
}
|
|
1077
|
-
return
|
|
1078
|
-
},
|
|
1077
|
+
return D(be, { size: "small" }, () => String(e));
|
|
1078
|
+
}, it = (e, t, r = "label", a = "value") => e == null ? "-" : Array.isArray(e) ? D(K, {
|
|
1079
1079
|
size: "small",
|
|
1080
1080
|
wrap: !0
|
|
1081
|
-
}, () => e.map((l,
|
|
1081
|
+
}, () => e.map((l, c) => {
|
|
1082
1082
|
const o = xe(l, t, r, a);
|
|
1083
|
-
return typeof o == "string" ?
|
|
1083
|
+
return typeof o == "string" ? D("span", { key: c }, o) : o;
|
|
1084
1084
|
})) : xe(e, t, r, a);
|
|
1085
|
-
const
|
|
1085
|
+
const st = (e, t, r) => {
|
|
1086
1086
|
switch (r.columnType || "text") {
|
|
1087
1087
|
case "link":
|
|
1088
|
-
return
|
|
1088
|
+
return rt(e, t, r.linkConfig);
|
|
1089
1089
|
case "image":
|
|
1090
|
-
return
|
|
1090
|
+
return nt(e, r.imageConfig);
|
|
1091
1091
|
case "file":
|
|
1092
|
-
return
|
|
1092
|
+
return lt(e, t, r.fileConfig);
|
|
1093
1093
|
case "tag":
|
|
1094
|
-
return
|
|
1094
|
+
return it(e, r.tagOptions, r.tagLabelField || "label", r.tagValueField || "value");
|
|
1095
1095
|
case "icon":
|
|
1096
|
-
return
|
|
1096
|
+
return ot(e, r.iconConfig);
|
|
1097
1097
|
case "text":
|
|
1098
1098
|
default:
|
|
1099
|
-
return
|
|
1099
|
+
return at(e);
|
|
1100
1100
|
}
|
|
1101
|
-
},
|
|
1102
|
-
function
|
|
1101
|
+
}, ut = (e) => e.render ? !1 : !!(e.columnType && e.columnType !== "text");
|
|
1102
|
+
function Qn() {
|
|
1103
1103
|
return {
|
|
1104
|
-
renderColumnContent:
|
|
1105
|
-
shouldAutoRender:
|
|
1106
|
-
renderText:
|
|
1107
|
-
renderLink:
|
|
1108
|
-
renderImage:
|
|
1109
|
-
renderFile:
|
|
1104
|
+
renderColumnContent: st,
|
|
1105
|
+
shouldAutoRender: ut,
|
|
1106
|
+
renderText: at,
|
|
1107
|
+
renderLink: rt,
|
|
1108
|
+
renderImage: nt,
|
|
1109
|
+
renderFile: lt,
|
|
1110
1110
|
renderTag: xe,
|
|
1111
|
-
renderTags:
|
|
1112
|
-
renderIcon:
|
|
1111
|
+
renderTags: it,
|
|
1112
|
+
renderIcon: ot
|
|
1113
1113
|
};
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1116
|
-
const { columns: t, actionColumn: r, onView: a, onEdit: l, onDelete:
|
|
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
1117
|
if ("title" in d) {
|
|
1118
1118
|
if (typeof d.title == "string") return d.title;
|
|
1119
1119
|
if (typeof d.title == "function") return "自定义列";
|
|
1120
1120
|
}
|
|
1121
1121
|
return o(d);
|
|
1122
|
-
},
|
|
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
1123
|
key: o(d),
|
|
1124
|
-
title:
|
|
1125
|
-
visible:
|
|
1126
|
-
configurable:
|
|
1127
|
-
}))),
|
|
1124
|
+
title: w(d),
|
|
1125
|
+
visible: C.value.includes(o(d)),
|
|
1126
|
+
configurable: h(d)
|
|
1127
|
+
}))), P = () => {
|
|
1128
1128
|
if (r?.show === !1) return null;
|
|
1129
|
-
const { renderActions: d } =
|
|
1129
|
+
const { renderActions: d } = zn({
|
|
1130
1130
|
...r,
|
|
1131
1131
|
onView: a,
|
|
1132
1132
|
onEdit: l,
|
|
1133
|
-
onDelete:
|
|
1133
|
+
onDelete: c
|
|
1134
1134
|
});
|
|
1135
1135
|
return {
|
|
1136
1136
|
key: "__actions__",
|
|
@@ -1140,12 +1140,12 @@ function Dn(e) {
|
|
|
1140
1140
|
fixed: r?.fixed !== !1 ? r?.fixed || "right" : void 0,
|
|
1141
1141
|
render: (u, m) => d(u, m)
|
|
1142
1142
|
};
|
|
1143
|
-
},
|
|
1144
|
-
if ("columnType" in d &&
|
|
1143
|
+
}, E = (d) => {
|
|
1144
|
+
if ("columnType" in d && ut(d)) {
|
|
1145
1145
|
const u = d, m = u.key;
|
|
1146
1146
|
return {
|
|
1147
1147
|
...d,
|
|
1148
|
-
render: (
|
|
1148
|
+
render: (S) => st(m ? S[m] : void 0, S, u)
|
|
1149
1149
|
};
|
|
1150
1150
|
}
|
|
1151
1151
|
return d;
|
|
@@ -1153,23 +1153,23 @@ function Dn(e) {
|
|
|
1153
1153
|
return {
|
|
1154
1154
|
mergedColumns: $(() => {
|
|
1155
1155
|
const d = t.filter((m) => {
|
|
1156
|
-
const
|
|
1157
|
-
return "type" in m && (m.type === "selection" || m.type === "expand") || !
|
|
1158
|
-
}).map((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
1159
|
return u && d.push(u), d;
|
|
1160
1160
|
}),
|
|
1161
|
-
configurableColumns:
|
|
1162
|
-
visibleColumnKeys:
|
|
1161
|
+
configurableColumns: x,
|
|
1162
|
+
visibleColumnKeys: C,
|
|
1163
1163
|
setVisibleColumnKeys: (d) => {
|
|
1164
|
-
|
|
1164
|
+
C.value = d;
|
|
1165
1165
|
},
|
|
1166
1166
|
resetColumnSetting: () => {
|
|
1167
|
-
|
|
1167
|
+
C.value = v();
|
|
1168
1168
|
},
|
|
1169
|
-
getVisibleColumnKeys: () => [...
|
|
1169
|
+
getVisibleColumnKeys: () => [...C.value]
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
|
-
var
|
|
1172
|
+
var In = {
|
|
1173
1173
|
page: "page",
|
|
1174
1174
|
pageSize: "pageSize",
|
|
1175
1175
|
itemCount: "itemCount"
|
|
@@ -1183,14 +1183,14 @@ var Fn = {
|
|
|
1183
1183
|
showSizePicker: !0,
|
|
1184
1184
|
showQuickJumper: !0
|
|
1185
1185
|
};
|
|
1186
|
-
function
|
|
1187
|
-
const { pagination: t, fieldNames: r, onUpdatePagination: a, onPageChange: l } = e,
|
|
1188
|
-
...
|
|
1186
|
+
function On(e) {
|
|
1187
|
+
const { pagination: t, fieldNames: r, onUpdatePagination: a, onPageChange: l } = e, c = () => ({
|
|
1188
|
+
...In,
|
|
1189
1189
|
...r
|
|
1190
|
-
}), o = (
|
|
1190
|
+
}), o = (x) => {
|
|
1191
1191
|
if (!(t === !1 || !t))
|
|
1192
|
-
return t[
|
|
1193
|
-
},
|
|
1192
|
+
return t[c()[x]];
|
|
1193
|
+
}, w = $(() => t === !1 || !t ? !1 : {
|
|
1194
1194
|
page: o("page") ?? 1,
|
|
1195
1195
|
pageSize: o("pageSize") ?? 10,
|
|
1196
1196
|
itemCount: o("itemCount"),
|
|
@@ -1199,38 +1199,38 @@ function zn(e) {
|
|
|
1199
1199
|
showQuickJumper: t.showQuickJumper ?? we.showQuickJumper,
|
|
1200
1200
|
prefix: t.prefix,
|
|
1201
1201
|
suffix: t.suffix
|
|
1202
|
-
}),
|
|
1202
|
+
}), _ = (x) => {
|
|
1203
1203
|
if (t === !1 || !t) return {};
|
|
1204
|
-
const
|
|
1205
|
-
return
|
|
1206
|
-
},
|
|
1207
|
-
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();
|
|
1208
1208
|
return {
|
|
1209
|
-
[
|
|
1210
|
-
[
|
|
1211
|
-
[
|
|
1209
|
+
[P.page]: x[P.page],
|
|
1210
|
+
[P.pageSize]: x[P.pageSize],
|
|
1211
|
+
[P.itemCount]: x[P.itemCount]
|
|
1212
1212
|
};
|
|
1213
1213
|
};
|
|
1214
1214
|
return {
|
|
1215
|
-
paginationConfig:
|
|
1216
|
-
handlePageChange: (
|
|
1217
|
-
const
|
|
1218
|
-
a?.(
|
|
1215
|
+
paginationConfig: w,
|
|
1216
|
+
handlePageChange: (x) => {
|
|
1217
|
+
const P = _({ page: x });
|
|
1218
|
+
a?.(P), l?.(h(P));
|
|
1219
1219
|
},
|
|
1220
|
-
handlePageSizeChange: (
|
|
1221
|
-
const
|
|
1220
|
+
handlePageSizeChange: (x) => {
|
|
1221
|
+
const P = _({
|
|
1222
1222
|
page: 1,
|
|
1223
|
-
pageSize:
|
|
1223
|
+
pageSize: x
|
|
1224
1224
|
});
|
|
1225
|
-
a?.(
|
|
1225
|
+
a?.(P), l?.(h(P));
|
|
1226
1226
|
},
|
|
1227
|
-
getFieldNames:
|
|
1227
|
+
getFieldNames: c
|
|
1228
1228
|
};
|
|
1229
1229
|
}
|
|
1230
|
-
var
|
|
1230
|
+
var Bn = {
|
|
1231
1231
|
key: 0,
|
|
1232
1232
|
class: "dydx-table__toolbar"
|
|
1233
|
-
},
|
|
1233
|
+
}, Un = { class: "dydx-table__column-setting" }, An = { class: "dydx-table__column-setting-header" }, Mn = /* @__PURE__ */ te({
|
|
1234
1234
|
inheritAttrs: !1,
|
|
1235
1235
|
__name: "DydxNaiveTable",
|
|
1236
1236
|
props: {
|
|
@@ -1249,19 +1249,23 @@ var Rn = {
|
|
|
1249
1249
|
actionColumn: {},
|
|
1250
1250
|
showAdd: {
|
|
1251
1251
|
type: Boolean,
|
|
1252
|
-
default: !
|
|
1252
|
+
default: !0
|
|
1253
1253
|
},
|
|
1254
1254
|
addButtonText: { default: "新增" },
|
|
1255
1255
|
onAdd: {},
|
|
1256
1256
|
leftButtons: { default: () => [] },
|
|
1257
1257
|
showRefresh: {
|
|
1258
1258
|
type: Boolean,
|
|
1259
|
-
default: !
|
|
1259
|
+
default: !0
|
|
1260
1260
|
},
|
|
1261
1261
|
onRefresh: {},
|
|
1262
1262
|
showColumnSetting: {
|
|
1263
1263
|
type: Boolean,
|
|
1264
|
-
default: !
|
|
1264
|
+
default: !0
|
|
1265
|
+
},
|
|
1266
|
+
showToolbar: {
|
|
1267
|
+
type: Boolean,
|
|
1268
|
+
default: !0
|
|
1265
1269
|
},
|
|
1266
1270
|
rightButtons: { default: () => [] },
|
|
1267
1271
|
pagination: { type: [Boolean, Object] },
|
|
@@ -1277,195 +1281,195 @@ var Rn = {
|
|
|
1277
1281
|
"delete"
|
|
1278
1282
|
],
|
|
1279
1283
|
setup(e, { expose: t, emit: r }) {
|
|
1280
|
-
const a = e, l = r,
|
|
1281
|
-
const
|
|
1282
|
-
return
|
|
1283
|
-
},
|
|
1284
|
-
let
|
|
1285
|
-
for (;
|
|
1286
|
-
if (
|
|
1287
|
-
|
|
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;
|
|
1288
1292
|
}
|
|
1289
1293
|
return null;
|
|
1290
|
-
},
|
|
1291
|
-
|
|
1292
|
-
const
|
|
1293
|
-
if (!
|
|
1294
|
-
const
|
|
1295
|
-
if (!
|
|
1296
|
-
|
|
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;
|
|
1297
1301
|
return;
|
|
1298
1302
|
}
|
|
1299
|
-
const
|
|
1300
|
-
|
|
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;
|
|
1301
1305
|
});
|
|
1302
|
-
},
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
}),
|
|
1306
|
-
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);
|
|
1307
1311
|
});
|
|
1308
|
-
const
|
|
1312
|
+
const P = Q(null), { mergedColumns: E, configurableColumns: q, visibleColumnKeys: k, setVisibleColumnKeys: N, resetColumnSetting: F, getVisibleColumnKeys: d } = $n({
|
|
1309
1313
|
columns: a.columns,
|
|
1310
1314
|
actionColumn: a.actionColumn,
|
|
1311
|
-
onView: (
|
|
1312
|
-
onEdit: (
|
|
1313
|
-
onDelete: (
|
|
1314
|
-
}), { paginationConfig: u, handlePageChange: m, handlePageSizeChange:
|
|
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({
|
|
1315
1319
|
get pagination() {
|
|
1316
1320
|
return a.pagination;
|
|
1317
1321
|
},
|
|
1318
1322
|
get fieldNames() {
|
|
1319
1323
|
return a.paginationFieldNames;
|
|
1320
1324
|
},
|
|
1321
|
-
onUpdatePagination: (
|
|
1322
|
-
onPageChange: (
|
|
1325
|
+
onUpdatePagination: (n) => l("update:pagination", n),
|
|
1326
|
+
onPageChange: (n) => l("pageChange", n)
|
|
1323
1327
|
});
|
|
1324
|
-
|
|
1325
|
-
l("update:visibleColumns",
|
|
1328
|
+
Xt(k, (n) => {
|
|
1329
|
+
l("update:visibleColumns", n);
|
|
1326
1330
|
});
|
|
1327
|
-
const
|
|
1328
|
-
l("update:checkedRowKeys",
|
|
1329
|
-
},
|
|
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 = () => {
|
|
1330
1334
|
a.onAdd?.();
|
|
1331
|
-
},
|
|
1335
|
+
}, X = () => {
|
|
1332
1336
|
a.onRefresh?.();
|
|
1333
1337
|
};
|
|
1334
1338
|
return t({
|
|
1335
|
-
getTableInstance: () =>
|
|
1339
|
+
getTableInstance: () => P.value,
|
|
1336
1340
|
clearChecked: () => {
|
|
1337
1341
|
l("update:checkedRowKeys", [], []);
|
|
1338
1342
|
},
|
|
1339
1343
|
refresh: () => {
|
|
1340
|
-
|
|
1344
|
+
X();
|
|
1341
1345
|
},
|
|
1342
1346
|
getVisibleColumnKeys: d,
|
|
1343
|
-
setVisibleColumnKeys:
|
|
1344
|
-
resetColumnSetting:
|
|
1345
|
-
scrollTo: (
|
|
1346
|
-
|
|
1347
|
+
setVisibleColumnKeys: N,
|
|
1348
|
+
resetColumnSetting: F,
|
|
1349
|
+
scrollTo: (n) => {
|
|
1350
|
+
P.value?.scrollTo(n);
|
|
1347
1351
|
}
|
|
1348
|
-
}), (
|
|
1352
|
+
}), (n, s) => (y(), H("div", {
|
|
1349
1353
|
ref_key: "containerRef",
|
|
1350
1354
|
ref: o,
|
|
1351
1355
|
class: "dydx-table"
|
|
1352
|
-
}, [
|
|
1356
|
+
}, [a.showToolbar ? (y(), H("div", Bn, [b(p(K), {
|
|
1353
1357
|
class: "dydx-table__toolbar-left",
|
|
1354
1358
|
size: 12
|
|
1355
1359
|
}, {
|
|
1356
1360
|
default: i(() => [
|
|
1357
|
-
e.showAdd ? (
|
|
1361
|
+
e.showAdd ? (y(), T(p(B), {
|
|
1358
1362
|
key: 0,
|
|
1359
1363
|
type: "primary",
|
|
1360
|
-
onClick:
|
|
1364
|
+
onClick: O
|
|
1361
1365
|
}, {
|
|
1362
|
-
icon: i(() => [U(
|
|
1363
|
-
default: i(() => [
|
|
1366
|
+
icon: i(() => [U(n.$slots, "add-icon", {}, () => [b(p(J), null, {
|
|
1367
|
+
default: i(() => [b(p(qe))]),
|
|
1364
1368
|
_: 1
|
|
1365
1369
|
})], !0)]),
|
|
1366
|
-
default: i(() => [
|
|
1370
|
+
default: i(() => [R(" " + M(e.addButtonText), 1)]),
|
|
1367
1371
|
_: 3
|
|
1368
1372
|
})) : j("", !0),
|
|
1369
|
-
(
|
|
1373
|
+
(y(!0), H(W, null, Y(e.leftButtons, (g) => (y(), H(W, { key: g.key }, [g.show !== !1 ? (y(), T(p(B), {
|
|
1370
1374
|
key: 0,
|
|
1371
|
-
type:
|
|
1372
|
-
disabled:
|
|
1373
|
-
onClick:
|
|
1375
|
+
type: g.type,
|
|
1376
|
+
disabled: g.disabled,
|
|
1377
|
+
onClick: g.onClick
|
|
1374
1378
|
}, se({
|
|
1375
|
-
default: i(() => [
|
|
1379
|
+
default: i(() => [R(" " + M(g.label), 1)]),
|
|
1376
1380
|
_: 2
|
|
1377
|
-
}, [
|
|
1381
|
+
}, [g.icon ? {
|
|
1378
1382
|
name: "icon",
|
|
1379
|
-
fn: i(() => [(
|
|
1383
|
+
fn: i(() => [(y(), T(Z(g.icon)))]),
|
|
1380
1384
|
key: "0"
|
|
1381
1385
|
} : void 0]), 1032, [
|
|
1382
1386
|
"type",
|
|
1383
1387
|
"disabled",
|
|
1384
1388
|
"onClick"
|
|
1385
1389
|
])) : j("", !0)], 64))), 128)),
|
|
1386
|
-
U(
|
|
1390
|
+
U(n.$slots, "toolbar-left", {}, void 0, !0)
|
|
1387
1391
|
]),
|
|
1388
1392
|
_: 3
|
|
1389
|
-
}),
|
|
1393
|
+
}), b(p(K), {
|
|
1390
1394
|
class: "dydx-table__toolbar-right",
|
|
1391
1395
|
size: 8
|
|
1392
1396
|
}, {
|
|
1393
1397
|
default: i(() => [
|
|
1394
|
-
U(
|
|
1395
|
-
(
|
|
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), {
|
|
1396
1400
|
key: 0,
|
|
1397
|
-
type:
|
|
1398
|
-
disabled:
|
|
1399
|
-
onClick:
|
|
1401
|
+
type: g.type,
|
|
1402
|
+
disabled: g.disabled,
|
|
1403
|
+
onClick: g.onClick
|
|
1400
1404
|
}, se({
|
|
1401
|
-
default: i(() => [
|
|
1405
|
+
default: i(() => [R(" " + M(g.label), 1)]),
|
|
1402
1406
|
_: 2
|
|
1403
|
-
}, [
|
|
1407
|
+
}, [g.icon ? {
|
|
1404
1408
|
name: "icon",
|
|
1405
|
-
fn: i(() => [(
|
|
1409
|
+
fn: i(() => [(y(), T(Z(g.icon)))]),
|
|
1406
1410
|
key: "0"
|
|
1407
1411
|
} : void 0]), 1032, [
|
|
1408
1412
|
"type",
|
|
1409
1413
|
"disabled",
|
|
1410
1414
|
"onClick"
|
|
1411
1415
|
])) : j("", !0)], 64))), 128)),
|
|
1412
|
-
e.showRefresh ? (
|
|
1416
|
+
e.showRefresh ? (y(), T(p(Ce), {
|
|
1413
1417
|
key: 0,
|
|
1414
1418
|
trigger: "hover"
|
|
1415
1419
|
}, {
|
|
1416
|
-
trigger: i(() => [
|
|
1420
|
+
trigger: i(() => [b(p(B), {
|
|
1417
1421
|
circle: "",
|
|
1418
1422
|
class: "dydx-table__icon-btn",
|
|
1419
|
-
onClick:
|
|
1423
|
+
onClick: X
|
|
1420
1424
|
}, {
|
|
1421
|
-
icon: i(() => [
|
|
1422
|
-
default: i(() => [
|
|
1425
|
+
icon: i(() => [b(p(J), null, {
|
|
1426
|
+
default: i(() => [b(p(ta))]),
|
|
1423
1427
|
_: 1
|
|
1424
1428
|
})]),
|
|
1425
1429
|
_: 1
|
|
1426
1430
|
})]),
|
|
1427
|
-
default: i(() => [
|
|
1431
|
+
default: i(() => [s[1] || (s[1] = R(" 刷新 ", -1))]),
|
|
1428
1432
|
_: 1
|
|
1429
1433
|
})) : j("", !0),
|
|
1430
|
-
e.showColumnSetting ? (
|
|
1434
|
+
e.showColumnSetting ? (y(), T(p(Ot), {
|
|
1431
1435
|
key: 1,
|
|
1432
1436
|
trigger: "click",
|
|
1433
1437
|
placement: "bottom-end"
|
|
1434
1438
|
}, {
|
|
1435
|
-
trigger: i(() => [
|
|
1436
|
-
trigger: i(() => [
|
|
1439
|
+
trigger: i(() => [b(p(Ce), { trigger: "hover" }, {
|
|
1440
|
+
trigger: i(() => [b(p(B), {
|
|
1437
1441
|
circle: "",
|
|
1438
1442
|
class: "dydx-table__icon-btn"
|
|
1439
1443
|
}, {
|
|
1440
|
-
icon: i(() => [
|
|
1441
|
-
default: i(() => [
|
|
1444
|
+
icon: i(() => [b(p(J), null, {
|
|
1445
|
+
default: i(() => [b(p(aa))]),
|
|
1442
1446
|
_: 1
|
|
1443
1447
|
})]),
|
|
1444
1448
|
_: 1
|
|
1445
1449
|
})]),
|
|
1446
|
-
default: i(() => [
|
|
1450
|
+
default: i(() => [s[2] || (s[2] = R(" 列设置 ", -1))]),
|
|
1447
1451
|
_: 1
|
|
1448
1452
|
})]),
|
|
1449
|
-
default: i(() => [fe("div",
|
|
1453
|
+
default: i(() => [fe("div", Un, [fe("div", An, [s[4] || (s[4] = fe("span", null, "列设置", -1)), b(p(B), {
|
|
1450
1454
|
text: "",
|
|
1451
1455
|
size: "small",
|
|
1452
1456
|
type: "primary",
|
|
1453
|
-
onClick: p(
|
|
1457
|
+
onClick: p(F)
|
|
1454
1458
|
}, {
|
|
1455
|
-
default: i(() => [...
|
|
1459
|
+
default: i(() => [...s[3] || (s[3] = [R(" 重置 ", -1)])]),
|
|
1456
1460
|
_: 1
|
|
1457
|
-
}, 8, ["onClick"])]),
|
|
1458
|
-
value: p(
|
|
1459
|
-
"onUpdate:value":
|
|
1461
|
+
}, 8, ["onClick"])]), b(p(ke), {
|
|
1462
|
+
value: p(k),
|
|
1463
|
+
"onUpdate:value": s[0] || (s[0] = (g) => Lt(k) ? k.value = g : null)
|
|
1460
1464
|
}, {
|
|
1461
|
-
default: i(() => [
|
|
1465
|
+
default: i(() => [b(p(K), {
|
|
1462
1466
|
vertical: "",
|
|
1463
1467
|
size: 8
|
|
1464
1468
|
}, {
|
|
1465
|
-
default: i(() => [(
|
|
1466
|
-
key:
|
|
1467
|
-
value:
|
|
1468
|
-
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
|
|
1469
1473
|
}, null, 8, ["value", "label"]))), 128))]),
|
|
1470
1474
|
_: 1
|
|
1471
1475
|
})]),
|
|
@@ -1475,21 +1479,21 @@ var Rn = {
|
|
|
1475
1479
|
})) : j("", !0)
|
|
1476
1480
|
]),
|
|
1477
1481
|
_: 3
|
|
1478
|
-
})])) : j("", !0),
|
|
1482
|
+
})])) : j("", !0), b(p(vt), G({
|
|
1479
1483
|
ref_key: "dataTableRef",
|
|
1480
|
-
ref:
|
|
1484
|
+
ref: P,
|
|
1481
1485
|
data: e.data,
|
|
1482
|
-
columns: p(
|
|
1483
|
-
"row-key":
|
|
1486
|
+
columns: p(E),
|
|
1487
|
+
"row-key": A.value,
|
|
1484
1488
|
loading: e.loading,
|
|
1485
1489
|
pagination: p(u),
|
|
1486
1490
|
remote: e.remote,
|
|
1487
1491
|
"checked-row-keys": e.checkedRowKeys,
|
|
1488
|
-
"max-height":
|
|
1489
|
-
}, p(
|
|
1492
|
+
"max-height": x.value
|
|
1493
|
+
}, p(c), {
|
|
1490
1494
|
"onUpdate:page": p(m),
|
|
1491
|
-
"onUpdate:pageSize": p(
|
|
1492
|
-
"onUpdate:checkedRowKeys":
|
|
1495
|
+
"onUpdate:pageSize": p(S),
|
|
1496
|
+
"onUpdate:checkedRowKeys": L
|
|
1493
1497
|
}), null, 16, [
|
|
1494
1498
|
"data",
|
|
1495
1499
|
"columns",
|
|
@@ -1503,11 +1507,11 @@ var Rn = {
|
|
|
1503
1507
|
"onUpdate:pageSize"
|
|
1504
1508
|
])], 512));
|
|
1505
1509
|
}
|
|
1506
|
-
}),
|
|
1510
|
+
}), En = (e, t) => {
|
|
1507
1511
|
const r = e.__vccOpts || e;
|
|
1508
1512
|
for (const [a, l] of t) r[a] = l;
|
|
1509
1513
|
return r;
|
|
1510
|
-
},
|
|
1514
|
+
}, dt = /* @__PURE__ */ En(Mn, [["__scopeId", "data-v-41718586"]]), Vn = /* @__PURE__ */ te({
|
|
1511
1515
|
name: "DydxFormModal",
|
|
1512
1516
|
inheritAttrs: !1,
|
|
1513
1517
|
__name: "DydxFormModal",
|
|
@@ -1541,9 +1545,9 @@ var Rn = {
|
|
|
1541
1545
|
"cancel"
|
|
1542
1546
|
],
|
|
1543
1547
|
setup(e, { expose: t, emit: r }) {
|
|
1544
|
-
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 = () => {
|
|
1545
1549
|
l("update:show", !1), l("cancel");
|
|
1546
|
-
},
|
|
1550
|
+
}, v = async () => {
|
|
1547
1551
|
try {
|
|
1548
1552
|
await o.value?.validate(), l("confirm", a.model);
|
|
1549
1553
|
} catch {
|
|
@@ -1553,31 +1557,31 @@ var Rn = {
|
|
|
1553
1557
|
getFormRef: () => o.value,
|
|
1554
1558
|
validate: () => o.value?.validate(),
|
|
1555
1559
|
resetFields: () => o.value?.resetFields()
|
|
1556
|
-
}), (
|
|
1560
|
+
}), (C, x) => (y(), T(p($t), G({
|
|
1557
1561
|
show: e.show,
|
|
1558
1562
|
preset: "card",
|
|
1559
|
-
title:
|
|
1560
|
-
style:
|
|
1563
|
+
title: w.value,
|
|
1564
|
+
style: _.value,
|
|
1561
1565
|
"mask-closable": !1
|
|
1562
|
-
}, p(
|
|
1563
|
-
|
|
1566
|
+
}, p(c), { "onUpdate:show": x[0] || (x[0] = (P) => l("update:show", P)) }), se({ _: 2 }, [
|
|
1567
|
+
C.$slots.header ? {
|
|
1564
1568
|
name: "header",
|
|
1565
|
-
fn: i(() => [U(
|
|
1569
|
+
fn: i(() => [U(C.$slots, "header")]),
|
|
1566
1570
|
key: "0"
|
|
1567
1571
|
} : void 0,
|
|
1568
|
-
|
|
1572
|
+
C.$slots["header-extra"] ? {
|
|
1569
1573
|
name: "header-extra",
|
|
1570
|
-
fn: i(() => [U(
|
|
1574
|
+
fn: i(() => [U(C.$slots, "header-extra")]),
|
|
1571
1575
|
key: "1"
|
|
1572
1576
|
} : void 0,
|
|
1573
|
-
|
|
1577
|
+
C.$slots.default ? {
|
|
1574
1578
|
name: "default",
|
|
1575
|
-
fn: i(() => [U(
|
|
1579
|
+
fn: i(() => [U(C.$slots, "default")]),
|
|
1576
1580
|
key: "2"
|
|
1577
1581
|
} : {
|
|
1578
1582
|
name: "default",
|
|
1579
|
-
fn: i(() => [
|
|
1580
|
-
default: i(() => [
|
|
1583
|
+
fn: i(() => [b(p(Se), { show: e.loading }, {
|
|
1584
|
+
default: i(() => [b(p(he), {
|
|
1581
1585
|
ref_key: "formRef",
|
|
1582
1586
|
ref: o,
|
|
1583
1587
|
schemas: e.schemas,
|
|
@@ -1601,34 +1605,34 @@ var Rn = {
|
|
|
1601
1605
|
}, 8, ["show"])]),
|
|
1602
1606
|
key: "3"
|
|
1603
1607
|
},
|
|
1604
|
-
|
|
1608
|
+
C.$slots.footer ? {
|
|
1605
1609
|
name: "footer",
|
|
1606
|
-
fn: i(() => [U(
|
|
1610
|
+
fn: i(() => [U(C.$slots, "footer")]),
|
|
1607
1611
|
key: "4"
|
|
1608
1612
|
} : {
|
|
1609
1613
|
name: "footer",
|
|
1610
|
-
fn: i(() => [
|
|
1611
|
-
default: i(() => [e.showCancel ? (
|
|
1614
|
+
fn: i(() => [b(p(K), { justify: "end" }, {
|
|
1615
|
+
default: i(() => [e.showCancel ? (y(), T(p(B), {
|
|
1612
1616
|
key: 0,
|
|
1613
|
-
onClick:
|
|
1617
|
+
onClick: h
|
|
1614
1618
|
}, {
|
|
1615
|
-
default: i(() => [
|
|
1619
|
+
default: i(() => [R(M(e.cancelText), 1)]),
|
|
1616
1620
|
_: 1
|
|
1617
|
-
})) : j("", !0),
|
|
1621
|
+
})) : j("", !0), b(p(B), {
|
|
1618
1622
|
type: "primary",
|
|
1619
1623
|
loading: e.loading,
|
|
1620
|
-
onClick:
|
|
1624
|
+
onClick: v
|
|
1621
1625
|
}, {
|
|
1622
|
-
default: i(() => [
|
|
1626
|
+
default: i(() => [R(M(e.confirmText), 1)]),
|
|
1623
1627
|
_: 1
|
|
1624
1628
|
}, 8, ["loading"])]),
|
|
1625
1629
|
_: 1
|
|
1626
1630
|
})]),
|
|
1627
1631
|
key: "5"
|
|
1628
1632
|
},
|
|
1629
|
-
|
|
1633
|
+
C.$slots.action ? {
|
|
1630
1634
|
name: "action",
|
|
1631
|
-
fn: i(() => [U(
|
|
1635
|
+
fn: i(() => [U(C.$slots, "action")]),
|
|
1632
1636
|
key: "6"
|
|
1633
1637
|
} : void 0
|
|
1634
1638
|
]), 1040, [
|
|
@@ -1637,7 +1641,7 @@ var Rn = {
|
|
|
1637
1641
|
"style"
|
|
1638
1642
|
]));
|
|
1639
1643
|
}
|
|
1640
|
-
}),
|
|
1644
|
+
}), ft = Vn, Gn = /* @__PURE__ */ te({
|
|
1641
1645
|
name: "DydxFormDrawer",
|
|
1642
1646
|
inheritAttrs: !1,
|
|
1643
1647
|
__name: "DydxFormDrawer",
|
|
@@ -1672,9 +1676,9 @@ var Rn = {
|
|
|
1672
1676
|
"cancel"
|
|
1673
1677
|
],
|
|
1674
1678
|
setup(e, { expose: t, emit: r }) {
|
|
1675
|
-
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}`), _ = () => {
|
|
1676
1680
|
l("update:show", !1), l("cancel");
|
|
1677
|
-
},
|
|
1681
|
+
}, h = async () => {
|
|
1678
1682
|
try {
|
|
1679
1683
|
await o.value?.validate(), l("confirm", a.model);
|
|
1680
1684
|
} catch {
|
|
@@ -1684,24 +1688,24 @@ var Rn = {
|
|
|
1684
1688
|
getFormRef: () => o.value,
|
|
1685
1689
|
validate: () => o.value?.validate(),
|
|
1686
1690
|
resetFields: () => o.value?.resetFields()
|
|
1687
|
-
}), (
|
|
1691
|
+
}), (v, C) => (y(), T(p(_t), G({
|
|
1688
1692
|
show: e.show,
|
|
1689
1693
|
width: e.width,
|
|
1690
1694
|
placement: e.placement,
|
|
1691
1695
|
"mask-closable": !1
|
|
1692
|
-
}, p(
|
|
1693
|
-
default: i(() => [
|
|
1694
|
-
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,
|
|
1695
1699
|
closable: "",
|
|
1696
|
-
onClose:
|
|
1697
|
-
}, se({ _: 2 }, [
|
|
1700
|
+
onClose: _
|
|
1701
|
+
}, se({ _: 2 }, [v.$slots.default ? {
|
|
1698
1702
|
name: "default",
|
|
1699
|
-
fn: i(() => [U(
|
|
1703
|
+
fn: i(() => [U(v.$slots, "default")]),
|
|
1700
1704
|
key: "0"
|
|
1701
1705
|
} : {
|
|
1702
1706
|
name: "default",
|
|
1703
|
-
fn: i(() => [
|
|
1704
|
-
default: i(() => [
|
|
1707
|
+
fn: i(() => [b(p(Se), { show: e.loading }, {
|
|
1708
|
+
default: i(() => [b(p(he), {
|
|
1705
1709
|
ref_key: "formRef",
|
|
1706
1710
|
ref: o,
|
|
1707
1711
|
schemas: e.schemas,
|
|
@@ -1724,25 +1728,25 @@ var Rn = {
|
|
|
1724
1728
|
_: 1
|
|
1725
1729
|
}, 8, ["show"])]),
|
|
1726
1730
|
key: "1"
|
|
1727
|
-
},
|
|
1731
|
+
}, v.$slots.footer ? {
|
|
1728
1732
|
name: "footer",
|
|
1729
|
-
fn: i(() => [U(
|
|
1733
|
+
fn: i(() => [U(v.$slots, "footer")]),
|
|
1730
1734
|
key: "2"
|
|
1731
1735
|
} : {
|
|
1732
1736
|
name: "footer",
|
|
1733
|
-
fn: i(() => [
|
|
1734
|
-
default: i(() => [e.showCancel ? (
|
|
1737
|
+
fn: i(() => [b(p(K), { justify: "end" }, {
|
|
1738
|
+
default: i(() => [e.showCancel ? (y(), T(p(B), {
|
|
1735
1739
|
key: 0,
|
|
1736
|
-
onClick:
|
|
1740
|
+
onClick: _
|
|
1737
1741
|
}, {
|
|
1738
|
-
default: i(() => [
|
|
1742
|
+
default: i(() => [R(M(e.cancelText), 1)]),
|
|
1739
1743
|
_: 1
|
|
1740
|
-
})) : j("", !0),
|
|
1744
|
+
})) : j("", !0), b(p(B), {
|
|
1741
1745
|
type: "primary",
|
|
1742
1746
|
loading: e.loading,
|
|
1743
|
-
onClick:
|
|
1747
|
+
onClick: h
|
|
1744
1748
|
}, {
|
|
1745
|
-
default: i(() => [
|
|
1749
|
+
default: i(() => [R(M(e.confirmText), 1)]),
|
|
1746
1750
|
_: 1
|
|
1747
1751
|
}, 8, ["loading"])]),
|
|
1748
1752
|
_: 1
|
|
@@ -1756,37 +1760,37 @@ var Rn = {
|
|
|
1756
1760
|
"placement"
|
|
1757
1761
|
]));
|
|
1758
1762
|
}
|
|
1759
|
-
}),
|
|
1763
|
+
}), ct = Gn, jn = [
|
|
1760
1764
|
he,
|
|
1761
|
-
st,
|
|
1762
|
-
ut,
|
|
1763
1765
|
dt,
|
|
1766
|
+
ft,
|
|
1767
|
+
ct,
|
|
1764
1768
|
pe,
|
|
1765
1769
|
Ne
|
|
1766
|
-
],
|
|
1767
|
-
|
|
1770
|
+
], Hn = (e) => {
|
|
1771
|
+
jn.forEach((t) => {
|
|
1768
1772
|
t.name && e.component(t.name, t);
|
|
1769
1773
|
});
|
|
1770
|
-
},
|
|
1771
|
-
install:
|
|
1774
|
+
}, Yn = {
|
|
1775
|
+
install: Hn,
|
|
1772
1776
|
DydxNaiveForm: he,
|
|
1773
|
-
DydxNaiveTable:
|
|
1774
|
-
DydxFormModal:
|
|
1775
|
-
DydxFormDrawer:
|
|
1777
|
+
DydxNaiveTable: dt,
|
|
1778
|
+
DydxFormModal: ft,
|
|
1779
|
+
DydxFormDrawer: ct,
|
|
1776
1780
|
DydxUpload: pe,
|
|
1777
1781
|
DydxIconSelect: Ne
|
|
1778
1782
|
};
|
|
1779
1783
|
export {
|
|
1780
|
-
|
|
1781
|
-
|
|
1784
|
+
ct as DydxFormDrawer,
|
|
1785
|
+
ft as DydxFormModal,
|
|
1782
1786
|
Ne as DydxIconSelect,
|
|
1783
1787
|
he as DydxNaiveForm,
|
|
1784
|
-
|
|
1785
|
-
|
|
1788
|
+
dt as DydxNaiveTable,
|
|
1789
|
+
Ln as DydxNaiveUIResolver,
|
|
1786
1790
|
pe as DydxUpload,
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1791
|
+
Yn as default,
|
|
1792
|
+
Qn as useColumnRender,
|
|
1793
|
+
$n as useColumns,
|
|
1794
|
+
On as usePagination,
|
|
1795
|
+
zn as useTableActions
|
|
1792
1796
|
};
|