dydx-naive-ui-for-vue 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dydx-naive-ui-for-vue.js +328 -324
- package/dist/dydx-naive-ui-for-vue.umd.cjs +1 -1
- package/package.json +12 -17
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Xn } from "./resolver-BDxomgBZ.js";
|
|
2
|
-
import { NAutoComplete as bt, NButton as E, NCascader as _t, NCheckbox as Ke, NCheckboxGroup as
|
|
3
|
-
import { Fragment as J, computed as I, createBlock as
|
|
2
|
+
import { NAutoComplete as bt, NButton as E, NCascader as _t, NCheckbox as Ke, NCheckboxGroup as Te, NColorPicker as wt, NDataTable as Ct, NDatePicker as xt, NDrawer as kt, NDrawerContent as St, NDropdown as Nt, NDynamicInput as Tt, NDynamicTags as Dt, NForm as Pt, NFormItem as Ft, NGrid as zt, NGridItem as Ot, NIcon as A, NImage as Rt, NInput as It, NInputNumber as $t, NMention as Bt, NModal as Ut, NPopconfirm as At, NPopover as Mt, NRadio as Et, NRadioGroup as Le, NRate as Vt, NSelect as We, NSlider as jt, NSpace as q, NSpin as De, NSwitch as Gt, NTag as Ce, NText as Ht, NTimePicker as Kt, NTooltip as Se, NTreeSelect as Lt, NUpload as qe, NUploadDragger as Wt, useMessage as qt } from "naive-ui";
|
|
3
|
+
import { Fragment as J, computed as I, createBlock as N, createCommentVNode as L, createElementBlock as W, createElementVNode as pe, createSlots as de, createTextVNode as R, createVNode as y, defineComponent as ne, guardReactiveProps as Jt, h as v, isRef as Qt, mergeProps as K, nextTick as Yt, normalizeProps as Xt, onMounted as Zt, onUnmounted as ea, openBlock as m, ref as Y, renderList as ee, renderSlot as V, resolveDynamicComponent as ae, toDisplayString as G, toHandlers as ta, unref as u, useAttrs as Pe, watch as Je, withCtx as o } from "vue";
|
|
4
4
|
import * as me from "@vicons/ionicons5";
|
|
5
5
|
import { AddOutline as Qe, CheckmarkOutline as Ye, CloseOutline as Xe, CloudUploadOutline as Ue, CreateOutline as aa, DownloadOutline as ra, EyeOutline as na, OpenOutline as la, RefreshOutline as Ze, SearchCircleOutline as oa, SettingsOutline as ia, TrashOutline as sa } from "@vicons/ionicons5";
|
|
6
6
|
var ua = { style: { "margin-bottom": "12px" } }, da = /* @__PURE__ */ ne({
|
|
@@ -43,27 +43,27 @@ var ua = { style: { "margin-bottom": "12px" } }, da = /* @__PURE__ */ ne({
|
|
|
43
43
|
"beforeUpload"
|
|
44
44
|
],
|
|
45
45
|
setup(e, { expose: t, emit: r }) {
|
|
46
|
-
const a = e, l = r, c = qt(), i = Y(),
|
|
47
|
-
...
|
|
48
|
-
url:
|
|
46
|
+
const a = e, l = r, c = qt(), i = Y(), C = I(() => a.listType ? a.listType : a.uploadType === "image" ? "image-card" : "text"), b = I(() => a.urlPrefix ? a.fileList.map((T) => ({
|
|
47
|
+
...T,
|
|
48
|
+
url: T.url && !T.url.startsWith("http") ? a.urlPrefix + T.url : T.url
|
|
49
49
|
})) : a.fileList), g = I(() => {
|
|
50
|
-
const
|
|
51
|
-
return a.acceptTypes?.length &&
|
|
52
|
-
}),
|
|
50
|
+
const T = [];
|
|
51
|
+
return a.acceptTypes?.length && T.push(`支持格式:${a.acceptTypes.join(", ")}`), a.maxSize && T.push(`单个文件不超过 ${a.maxSize}MB`), a.maxCount && T.push(`最多 ${a.maxCount} 个文件`), T.join(";");
|
|
52
|
+
}), _ = I(() => {
|
|
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
|
+
}), D = I(() => {
|
|
57
|
+
const { uploadType: T, fileList: F, customUpload: z, acceptTypes: d, maxSize: s, maxCount: p, multiple: S, autoUpload: j, disabled: X, urlPrefix: B, showTip: Z, showDragger: _e, ...se } = a;
|
|
58
58
|
return se;
|
|
59
|
-
}),
|
|
60
|
-
l("update:fileList", a.urlPrefix ?
|
|
59
|
+
}), P = (T) => {
|
|
60
|
+
l("update:fileList", a.urlPrefix ? T.map((F) => ({
|
|
61
61
|
...F,
|
|
62
62
|
url: F.url?.startsWith(a.urlPrefix) ? F.url.slice(a.urlPrefix.length) : F.url
|
|
63
|
-
})) :
|
|
64
|
-
}, k = async ({ file:
|
|
65
|
-
l("beforeUpload",
|
|
66
|
-
const F =
|
|
63
|
+
})) : T);
|
|
64
|
+
}, k = async ({ file: T }) => {
|
|
65
|
+
l("beforeUpload", T);
|
|
66
|
+
const F = T.file;
|
|
67
67
|
return F ? a.maxSize && F.size > a.maxSize * 1024 * 1024 ? (c.error(`文件大小不能超过 ${a.maxSize}MB`), !1) : a.acceptTypes?.length && !a.acceptTypes.some((z) => {
|
|
68
68
|
if (z.startsWith(".")) return F.name.toLowerCase().endsWith(z.toLowerCase());
|
|
69
69
|
if (z.includes("*")) {
|
|
@@ -72,8 +72,8 @@ var ua = { style: { "margin-bottom": "12px" } }, da = /* @__PURE__ */ ne({
|
|
|
72
72
|
}
|
|
73
73
|
return F.type === z;
|
|
74
74
|
}) ? (c.error(`只支持 ${a.acceptTypes.join(", ")} 格式`), !1) : a.maxCount && a.fileList.length >= a.maxCount ? (l("exceed", [F]), c.error(`最多上传 ${a.maxCount} 个文件`), !1) : !0 : !0;
|
|
75
|
-
}, M = async (
|
|
76
|
-
const { file: F, onProgress: z, onFinish: d, onError: s } =
|
|
75
|
+
}, M = async (T) => {
|
|
76
|
+
const { file: F, onProgress: z, onFinish: d, onError: s } = T;
|
|
77
77
|
if (!a.customUpload) {
|
|
78
78
|
console.warn("DydxUpload: customUpload 方法未提供"), s();
|
|
79
79
|
return;
|
|
@@ -92,25 +92,25 @@ var ua = { style: { "margin-bottom": "12px" } }, da = /* @__PURE__ */ ne({
|
|
|
92
92
|
submit: () => i.value?.submit(),
|
|
93
93
|
openDialog: () => i.value?.openOpenFileDialog(),
|
|
94
94
|
clear: () => i.value?.clear()
|
|
95
|
-
}), (
|
|
95
|
+
}), (T, F) => {
|
|
96
96
|
const z = A, d = Ht, s = Wt, p = E, S = qe;
|
|
97
97
|
return m(), W("div", null, [
|
|
98
98
|
y(S, K({
|
|
99
99
|
ref_key: "uploadRef",
|
|
100
100
|
ref: i
|
|
101
|
-
},
|
|
102
|
-
"file-list":
|
|
101
|
+
}, D.value, {
|
|
102
|
+
"file-list": b.value,
|
|
103
103
|
"custom-request": M,
|
|
104
|
-
accept:
|
|
104
|
+
accept: _.value,
|
|
105
105
|
max: e.maxCount,
|
|
106
106
|
multiple: e.multiple,
|
|
107
107
|
disabled: e.disabled,
|
|
108
108
|
"default-upload": e.autoUpload,
|
|
109
|
-
"list-type":
|
|
110
|
-
"onUpdate:fileList":
|
|
109
|
+
"list-type": C.value,
|
|
110
|
+
"onUpdate:fileList": P,
|
|
111
111
|
onBeforeUpload: k
|
|
112
112
|
}), {
|
|
113
|
-
default: o(() => [e.showDragger && e.uploadType !== "image" ? (m(),
|
|
113
|
+
default: o(() => [e.showDragger && e.uploadType !== "image" ? (m(), N(s, { key: 0 }, {
|
|
114
114
|
default: o(() => [
|
|
115
115
|
pe("div", ua, [y(z, {
|
|
116
116
|
size: "48",
|
|
@@ -123,7 +123,7 @@ var ua = { style: { "margin-bottom": "12px" } }, da = /* @__PURE__ */ ne({
|
|
|
123
123
|
default: o(() => [...F[0] || (F[0] = [R(" 点击或拖拽文件到此区域上传 ", -1)])]),
|
|
124
124
|
_: 1
|
|
125
125
|
}),
|
|
126
|
-
e.showTip ? (m(),
|
|
126
|
+
e.showTip ? (m(), N(d, {
|
|
127
127
|
key: 0,
|
|
128
128
|
depth: "3",
|
|
129
129
|
style: {
|
|
@@ -132,23 +132,23 @@ var ua = { style: { "margin-bottom": "12px" } }, da = /* @__PURE__ */ ne({
|
|
|
132
132
|
display: "block"
|
|
133
133
|
}
|
|
134
134
|
}, {
|
|
135
|
-
default: o(() => [R(
|
|
135
|
+
default: o(() => [R(G(g.value), 1)]),
|
|
136
136
|
_: 1
|
|
137
137
|
})) : L("", !0)
|
|
138
138
|
]),
|
|
139
139
|
_: 1
|
|
140
|
-
})) : V(
|
|
140
|
+
})) : V(T.$slots, "default", { key: 1 }, () => [e.uploadType === "image" && C.value === "image-card" ? (m(), N(z, {
|
|
141
141
|
key: 0,
|
|
142
142
|
size: 28
|
|
143
143
|
}, {
|
|
144
144
|
default: o(() => [y(u(Qe))]),
|
|
145
145
|
_: 1
|
|
146
|
-
})) : (m(),
|
|
146
|
+
})) : (m(), N(p, { key: 1 }, {
|
|
147
147
|
icon: o(() => [y(z, null, {
|
|
148
148
|
default: o(() => [y(u(Ue))]),
|
|
149
149
|
_: 1
|
|
150
150
|
})]),
|
|
151
|
-
default: o(() => [R(" " +
|
|
151
|
+
default: o(() => [R(" " + G(e.uploadType === "image" ? "上传图片" : "上传文件"), 1)]),
|
|
152
152
|
_: 1
|
|
153
153
|
}))])]),
|
|
154
154
|
_: 3
|
|
@@ -161,7 +161,7 @@ var ua = { style: { "margin-bottom": "12px" } }, da = /* @__PURE__ */ ne({
|
|
|
161
161
|
"default-upload",
|
|
162
162
|
"list-type"
|
|
163
163
|
]),
|
|
164
|
-
!e.autoUpload &&
|
|
164
|
+
!e.autoUpload && b.value.length > 0 ? (m(), N(p, {
|
|
165
165
|
key: 0,
|
|
166
166
|
type: "primary",
|
|
167
167
|
onClick: Q,
|
|
@@ -170,7 +170,7 @@ var ua = { style: { "margin-bottom": "12px" } }, da = /* @__PURE__ */ ne({
|
|
|
170
170
|
default: o(() => [...F[1] || (F[1] = [R(" 开始上传 ", -1)])]),
|
|
171
171
|
_: 1
|
|
172
172
|
})) : L("", !0),
|
|
173
|
-
e.showTip && !(e.showDragger && e.uploadType !== "image") ? (m(),
|
|
173
|
+
e.showTip && !(e.showDragger && e.uploadType !== "image") ? (m(), N(d, {
|
|
174
174
|
key: 1,
|
|
175
175
|
depth: "3",
|
|
176
176
|
style: {
|
|
@@ -179,7 +179,7 @@ var ua = { style: { "margin-bottom": "12px" } }, da = /* @__PURE__ */ ne({
|
|
|
179
179
|
display: "block"
|
|
180
180
|
}
|
|
181
181
|
}, {
|
|
182
|
-
default: o(() => [R(
|
|
182
|
+
default: o(() => [R(G(g.value), 1)]),
|
|
183
183
|
_: 1
|
|
184
184
|
})) : L("", !0)
|
|
185
185
|
]);
|
|
@@ -206,20 +206,20 @@ var ua = { style: { "margin-bottom": "12px" } }, da = /* @__PURE__ */ ne({
|
|
|
206
206
|
setup(e, { emit: t }) {
|
|
207
207
|
const r = e, a = t, l = Object.keys(me), c = I(() => {
|
|
208
208
|
let g = l;
|
|
209
|
-
return r.iconStyle === "outline" ? g = l.filter((
|
|
210
|
-
label:
|
|
211
|
-
value:
|
|
209
|
+
return r.iconStyle === "outline" ? g = l.filter((_) => _.endsWith("Outline")) : r.iconStyle === "sharp" ? g = l.filter((_) => _.endsWith("Sharp")) : r.iconStyle === "filled" && (g = l.filter((_) => !_.endsWith("Outline") && !_.endsWith("Sharp"))), g.map((_) => ({
|
|
210
|
+
label: _,
|
|
211
|
+
value: _
|
|
212
212
|
}));
|
|
213
213
|
}), i = (g) => {
|
|
214
|
-
const
|
|
215
|
-
return
|
|
216
|
-
},
|
|
217
|
-
const
|
|
218
|
-
return
|
|
219
|
-
},
|
|
214
|
+
const _ = me[g.value];
|
|
215
|
+
return v("div", { style: "display: flex; align-items: center; gap: 8px;" }, [v(A, { size: 18 }, () => v(_)), v("span", { style: "flex: 1; overflow: hidden; text-overflow: ellipsis;" }, g.label)]);
|
|
216
|
+
}, C = ({ option: g }) => {
|
|
217
|
+
const _ = me[g.value];
|
|
218
|
+
return v("div", { style: "display: flex; align-items: center; gap: 4px;" }, [v(A, { size: 16 }, () => v(_)), g.label]);
|
|
219
|
+
}, b = (g) => {
|
|
220
220
|
a("update:value", g);
|
|
221
221
|
};
|
|
222
|
-
return (g,
|
|
222
|
+
return (g, _) => (m(), N(u(We), {
|
|
223
223
|
value: e.value,
|
|
224
224
|
options: c.value,
|
|
225
225
|
placeholder: e.placeholder,
|
|
@@ -227,9 +227,9 @@ var ua = { style: { "margin-bottom": "12px" } }, da = /* @__PURE__ */ ne({
|
|
|
227
227
|
clearable: e.clearable,
|
|
228
228
|
filterable: e.filterable,
|
|
229
229
|
"render-label": i,
|
|
230
|
-
"render-tag":
|
|
230
|
+
"render-tag": C,
|
|
231
231
|
"virtual-scroll": "",
|
|
232
|
-
"onUpdate:value":
|
|
232
|
+
"onUpdate:value": b
|
|
233
233
|
}, null, 8, [
|
|
234
234
|
"value",
|
|
235
235
|
"options",
|
|
@@ -246,18 +246,18 @@ const ca = {
|
|
|
246
246
|
select: We,
|
|
247
247
|
"date-picker": xt,
|
|
248
248
|
"time-picker": Kt,
|
|
249
|
-
switch:
|
|
250
|
-
slider:
|
|
249
|
+
switch: Gt,
|
|
250
|
+
slider: jt,
|
|
251
251
|
"radio-group": Le,
|
|
252
|
-
"checkbox-group":
|
|
252
|
+
"checkbox-group": Te,
|
|
253
253
|
cascader: _t,
|
|
254
254
|
"tree-select": Lt,
|
|
255
255
|
upload: qe,
|
|
256
256
|
rate: Vt,
|
|
257
|
-
"color-picker":
|
|
257
|
+
"color-picker": wt,
|
|
258
258
|
"auto-complete": bt,
|
|
259
|
-
"dynamic-input":
|
|
260
|
-
"dynamic-tags":
|
|
259
|
+
"dynamic-input": Tt,
|
|
260
|
+
"dynamic-tags": Dt,
|
|
261
261
|
mention: Bt,
|
|
262
262
|
"image-upload": ye,
|
|
263
263
|
"file-upload": ye,
|
|
@@ -274,21 +274,21 @@ function _a(e) {
|
|
|
274
274
|
var l = ba.call(e);
|
|
275
275
|
return a && (t ? e[ue] = r : delete e[ue]), l;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
277
|
+
var wa = _a, Ca = Object.prototype.toString;
|
|
278
278
|
function xa(e) {
|
|
279
|
-
return
|
|
279
|
+
return Ca.call(e);
|
|
280
280
|
}
|
|
281
|
-
var ka = xa, Sa = "[object Null]",
|
|
282
|
-
function
|
|
283
|
-
return e == null ? e === void 0 ?
|
|
281
|
+
var ka = xa, Sa = "[object Null]", Na = "[object Undefined]", Ae = re ? re.toStringTag : void 0;
|
|
282
|
+
function Ta(e) {
|
|
283
|
+
return e == null ? e === void 0 ? Na : Sa : Ae && Ae in Object(e) ? wa(e) : ka(e);
|
|
284
284
|
}
|
|
285
|
-
var tt =
|
|
286
|
-
function
|
|
285
|
+
var tt = Ta;
|
|
286
|
+
function Da(e) {
|
|
287
287
|
return e != null && typeof e == "object";
|
|
288
288
|
}
|
|
289
|
-
var
|
|
289
|
+
var Pa = Da, Fa = "[object Symbol]";
|
|
290
290
|
function za(e) {
|
|
291
|
-
return typeof e == "symbol" ||
|
|
291
|
+
return typeof e == "symbol" || Pa(e) && tt(e) == Fa;
|
|
292
292
|
}
|
|
293
293
|
var Oe = za;
|
|
294
294
|
function Oa(e, t) {
|
|
@@ -309,12 +309,12 @@ function Ua(e) {
|
|
|
309
309
|
return e != null && (t == "object" || t == "function");
|
|
310
310
|
}
|
|
311
311
|
var ge = Ua, Aa = "[object AsyncFunction]", Ma = "[object Function]", Ea = "[object GeneratorFunction]", Va = "[object Proxy]";
|
|
312
|
-
function
|
|
312
|
+
function ja(e) {
|
|
313
313
|
if (!ge(e)) return !1;
|
|
314
314
|
var t = tt(e);
|
|
315
315
|
return t == Ma || t == Ea || t == Aa || t == Va;
|
|
316
316
|
}
|
|
317
|
-
var
|
|
317
|
+
var Ga = ja, Ha = ze["__core-js_shared__"], xe = Ha, Ve = (function() {
|
|
318
318
|
var e = /[^.]+$/.exec(xe && xe.keys && xe.keys.IE_PROTO || "");
|
|
319
319
|
return e ? "Symbol(src)_1." + e : "";
|
|
320
320
|
})();
|
|
@@ -337,7 +337,7 @@ function qa(e) {
|
|
|
337
337
|
}
|
|
338
338
|
var Ja = qa, Qa = /[\\^$.*+?()[\]{}|]/g, Ya = /^\[object .+?Constructor\]$/, Xa = Function.prototype, Za = Object.prototype, er = Xa.toString, tr = Za.hasOwnProperty, ar = RegExp("^" + er.call(tr).replace(Qa, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
339
339
|
function rr(e) {
|
|
340
|
-
return !ge(e) || La(e) ? !1 : (
|
|
340
|
+
return !ge(e) || La(e) ? !1 : (Ga(e) ? ar : Ya).test(Ja(e));
|
|
341
341
|
}
|
|
342
342
|
var nr = rr;
|
|
343
343
|
function lr(e, t) {
|
|
@@ -354,14 +354,14 @@ var Ie = ir, sr = (function() {
|
|
|
354
354
|
return e({}, "", {}), e;
|
|
355
355
|
} catch {
|
|
356
356
|
}
|
|
357
|
-
})(),
|
|
357
|
+
})(), je = sr, ur = 9007199254740991, dr = /^(?:0|[1-9]\d*)$/;
|
|
358
358
|
function fr(e, t) {
|
|
359
359
|
var r = typeof e;
|
|
360
360
|
return t = t ?? ur, !!t && (r == "number" || r != "symbol" && dr.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
361
361
|
}
|
|
362
362
|
var cr = fr;
|
|
363
363
|
function pr(e, t, r) {
|
|
364
|
-
t == "__proto__" &&
|
|
364
|
+
t == "__proto__" && je ? je(e, t, {
|
|
365
365
|
configurable: !0,
|
|
366
366
|
enumerable: !0,
|
|
367
367
|
value: r,
|
|
@@ -378,28 +378,28 @@ function hr(e, t, r) {
|
|
|
378
378
|
(!(gr.call(e, t) && rt(a, r)) || r === void 0 && !(t in e)) && mr(e, t, r);
|
|
379
379
|
}
|
|
380
380
|
var vr = hr, br = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, _r = /^\w*$/;
|
|
381
|
-
function
|
|
381
|
+
function wr(e, t) {
|
|
382
382
|
if (Re(e)) return !1;
|
|
383
383
|
var r = typeof e;
|
|
384
384
|
return r == "number" || r == "symbol" || r == "boolean" || e == null || Oe(e) ? !0 : _r.test(e) || !br.test(e) || t != null && e in Object(t);
|
|
385
385
|
}
|
|
386
|
-
var
|
|
386
|
+
var Cr = wr, xr = Ie(Object, "create"), fe = xr;
|
|
387
387
|
function kr() {
|
|
388
388
|
this.__data__ = fe ? fe(null) : {}, this.size = 0;
|
|
389
389
|
}
|
|
390
390
|
var Sr = kr;
|
|
391
|
-
function
|
|
391
|
+
function Nr(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
|
|
395
|
+
var Tr = Nr, Dr = "__lodash_hash_undefined__", Pr = Object.prototype.hasOwnProperty;
|
|
396
396
|
function Fr(e) {
|
|
397
397
|
var t = this.__data__;
|
|
398
398
|
if (fe) {
|
|
399
399
|
var r = t[e];
|
|
400
|
-
return r ===
|
|
400
|
+
return r === Dr ? void 0 : r;
|
|
401
401
|
}
|
|
402
|
-
return
|
|
402
|
+
return Pr.call(t, e) ? t[e] : void 0;
|
|
403
403
|
}
|
|
404
404
|
var zr = Fr, Or = Object.prototype.hasOwnProperty;
|
|
405
405
|
function Rr(e) {
|
|
@@ -420,11 +420,11 @@ function le(e) {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
le.prototype.clear = Sr;
|
|
423
|
-
le.prototype.delete =
|
|
423
|
+
le.prototype.delete = Tr;
|
|
424
424
|
le.prototype.get = zr;
|
|
425
425
|
le.prototype.has = Ir;
|
|
426
426
|
le.prototype.set = Ur;
|
|
427
|
-
var
|
|
427
|
+
var Ge = le;
|
|
428
428
|
function Ar() {
|
|
429
429
|
this.__data__ = [], this.size = 0;
|
|
430
430
|
}
|
|
@@ -434,11 +434,11 @@ function Er(e, t) {
|
|
|
434
434
|
return -1;
|
|
435
435
|
}
|
|
436
436
|
var he = Er, Vr = Array.prototype.splice;
|
|
437
|
-
function
|
|
437
|
+
function jr(e) {
|
|
438
438
|
var t = this.__data__, r = he(t, e);
|
|
439
439
|
return r < 0 ? !1 : (r == t.length - 1 ? t.pop() : Vr.call(t, r, 1), --this.size, !0);
|
|
440
440
|
}
|
|
441
|
-
var
|
|
441
|
+
var Gr = jr;
|
|
442
442
|
function Hr(e) {
|
|
443
443
|
var t = this.__data__, r = he(t, e);
|
|
444
444
|
return r < 0 ? void 0 : t[r][1];
|
|
@@ -461,16 +461,16 @@ function oe(e) {
|
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
oe.prototype.clear = Mr;
|
|
464
|
-
oe.prototype.delete =
|
|
464
|
+
oe.prototype.delete = Gr;
|
|
465
465
|
oe.prototype.get = Kr;
|
|
466
466
|
oe.prototype.has = Wr;
|
|
467
467
|
oe.prototype.set = Jr;
|
|
468
468
|
var Qr = oe, Yr = Ie(ze, "Map"), Xr = Yr;
|
|
469
469
|
function Zr() {
|
|
470
470
|
this.size = 0, this.__data__ = {
|
|
471
|
-
hash: new
|
|
471
|
+
hash: new Ge(),
|
|
472
472
|
map: new (Xr || Qr)(),
|
|
473
|
-
string: new
|
|
473
|
+
string: new Ge()
|
|
474
474
|
};
|
|
475
475
|
}
|
|
476
476
|
var en = Zr;
|
|
@@ -538,43 +538,43 @@ var hn = gn, vn = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)
|
|
|
538
538
|
return e.charCodeAt(0) === 46 && t.push(""), e.replace(vn, function(r, a, l, c) {
|
|
539
539
|
t.push(l ? c.replace(bn, "$1") : a || r);
|
|
540
540
|
}), t;
|
|
541
|
-
}),
|
|
542
|
-
function
|
|
541
|
+
}), wn = _n;
|
|
542
|
+
function Cn(e) {
|
|
543
543
|
return e == null ? "" : Ba(e);
|
|
544
544
|
}
|
|
545
|
-
var xn =
|
|
545
|
+
var xn = Cn;
|
|
546
546
|
function kn(e, t) {
|
|
547
|
-
return Re(e) ? e :
|
|
547
|
+
return Re(e) ? e : Cr(e, t) ? [e] : wn(xn(e));
|
|
548
548
|
}
|
|
549
549
|
var lt = kn, Sn = 1 / 0;
|
|
550
|
-
function
|
|
550
|
+
function Nn(e) {
|
|
551
551
|
if (typeof e == "string" || Oe(e)) return e;
|
|
552
552
|
var t = e + "";
|
|
553
553
|
return t == "0" && 1 / e == -Sn ? "-0" : t;
|
|
554
554
|
}
|
|
555
|
-
var ot =
|
|
556
|
-
function
|
|
555
|
+
var ot = Nn;
|
|
556
|
+
function Tn(e, t) {
|
|
557
557
|
t = lt(t, e);
|
|
558
558
|
for (var r = 0, a = t.length; e != null && r < a; ) e = e[ot(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 Dn = Tn;
|
|
562
|
+
function Pn(e, t, r) {
|
|
563
|
+
var a = e == null ? void 0 : Dn(e, t);
|
|
564
564
|
return a === void 0 ? r : a;
|
|
565
565
|
}
|
|
566
|
-
var Fn =
|
|
566
|
+
var Fn = Pn;
|
|
567
567
|
function zn(e, t, r, a) {
|
|
568
568
|
if (!ge(e)) return e;
|
|
569
569
|
t = lt(t, e);
|
|
570
|
-
for (var l = -1, c = t.length, i = c - 1,
|
|
571
|
-
var
|
|
572
|
-
if (
|
|
570
|
+
for (var l = -1, c = t.length, i = c - 1, C = e; C != null && ++l < c; ) {
|
|
571
|
+
var b = ot(t[l]), g = r;
|
|
572
|
+
if (b === "__proto__" || b === "constructor" || b === "prototype") return e;
|
|
573
573
|
if (l != i) {
|
|
574
|
-
var
|
|
575
|
-
g = a ? a(
|
|
574
|
+
var _ = C[b];
|
|
575
|
+
g = a ? a(_, b, C) : void 0, g === void 0 && (g = ge(_) ? _ : cr(t[l + 1]) ? [] : {});
|
|
576
576
|
}
|
|
577
|
-
vr(
|
|
577
|
+
vr(C, b, g), C = C[b];
|
|
578
578
|
}
|
|
579
579
|
return e;
|
|
580
580
|
}
|
|
@@ -645,25 +645,25 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
645
645
|
],
|
|
646
646
|
setup(e, { expose: t, emit: r }) {
|
|
647
647
|
const a = e, l = r, c = Y(), i = Y();
|
|
648
|
-
let
|
|
648
|
+
let C = !1;
|
|
649
649
|
Je(() => a.model, (n) => {
|
|
650
|
-
!
|
|
650
|
+
console.log("[DydxNaiveForm] watch 触发, isInitialized:", C, "newModel:", JSON.stringify(n)), !C && n && (i.value = JSON.parse(JSON.stringify(n)), C = !0, console.log("[DydxNaiveForm] 初始状态已保存:", JSON.stringify(i.value)));
|
|
651
651
|
}, {
|
|
652
652
|
immediate: !0,
|
|
653
653
|
deep: !1
|
|
654
654
|
});
|
|
655
|
-
const
|
|
655
|
+
const b = I(() => ({
|
|
656
656
|
type: "primary",
|
|
657
657
|
text: "搜索",
|
|
658
658
|
loading: a.loading,
|
|
659
|
-
renderIcon: () =>
|
|
659
|
+
renderIcon: () => v(A, null, { default: () => v(oa) }),
|
|
660
660
|
...a.submitButton
|
|
661
661
|
})), g = I(() => ({
|
|
662
662
|
type: "default",
|
|
663
663
|
text: "重置",
|
|
664
|
-
renderIcon: () =>
|
|
664
|
+
renderIcon: () => v(A, null, { default: () => v(Ze) }),
|
|
665
665
|
...a.resetButton
|
|
666
|
-
})),
|
|
666
|
+
})), _ = I(() => a.schemas.filter((n) => !(typeof n.hidden == "function" ? n.hidden(a.model) : n.hidden))), D = I(() => ({
|
|
667
667
|
labelWidth: a.labelWidth,
|
|
668
668
|
labelAlign: a.labelAlign,
|
|
669
669
|
labelPlacement: a.labelPlacement,
|
|
@@ -672,7 +672,7 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
672
672
|
showRequireMark: a.showRequireMark,
|
|
673
673
|
requireMarkPlacement: a.requireMarkPlacement,
|
|
674
674
|
...a.formProps
|
|
675
|
-
})),
|
|
675
|
+
})), P = I(() => ({
|
|
676
676
|
cols: 24,
|
|
677
677
|
xGap: a.xGap,
|
|
678
678
|
yGap: a.yGap,
|
|
@@ -680,13 +680,13 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
680
680
|
...a.gridProps,
|
|
681
681
|
responsive: "self"
|
|
682
682
|
})), k = (n) => {
|
|
683
|
-
const
|
|
684
|
-
return
|
|
683
|
+
const h = n.type || "input";
|
|
684
|
+
return h === "custom" ? n.component : ca[h];
|
|
685
685
|
}, M = (n) => typeof n.disabled == "function" ? n.disabled(a.model) : n.disabled, Q = (n) => {
|
|
686
|
-
const
|
|
687
|
-
if (
|
|
686
|
+
const h = { ...n.props };
|
|
687
|
+
if (h.placeholder !== void 0) return h;
|
|
688
688
|
const $ = typeof n.label == "string" ? n.label : "";
|
|
689
|
-
if (!$) return
|
|
689
|
+
if (!$) return h;
|
|
690
690
|
const U = n.type || "input", H = [
|
|
691
691
|
"input",
|
|
692
692
|
"textarea",
|
|
@@ -700,29 +700,29 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
700
700
|
"time-picker",
|
|
701
701
|
"color-picker"
|
|
702
702
|
];
|
|
703
|
-
return H.includes(U) ?
|
|
704
|
-
},
|
|
705
|
-
const
|
|
703
|
+
return H.includes(U) ? h.placeholder = `请输入${$}` : te.includes(U) && (h.placeholder = `请选择${$}`), h;
|
|
704
|
+
}, T = (n) => {
|
|
705
|
+
const h = n.type === "custom" ? "modelValue" : "value";
|
|
706
706
|
return {
|
|
707
|
-
[n.modelPropName ||
|
|
707
|
+
[n.modelPropName || h]: s(n.name),
|
|
708
708
|
...Q(n),
|
|
709
709
|
disabled: M(n)
|
|
710
710
|
};
|
|
711
711
|
}, F = (n) => {
|
|
712
|
-
const
|
|
712
|
+
const h = n.type === "custom" ? "modelValue" : "value", $ = n.modelPropName || h;
|
|
713
713
|
return { [n.modelEventName || `update:${$}`]: (U) => p(n.name, U) };
|
|
714
714
|
}, z = (n) => {
|
|
715
715
|
if (!n) return {};
|
|
716
|
-
const { options:
|
|
716
|
+
const { options: h, labelField: $, valueField: U, ...H } = n;
|
|
717
717
|
return H;
|
|
718
718
|
}, d = (n) => {
|
|
719
719
|
if (!n) return {};
|
|
720
|
-
const { text:
|
|
720
|
+
const { text: h, ...$ } = n;
|
|
721
721
|
return $;
|
|
722
|
-
}, s = (n) => He(a.model, n), p = (n,
|
|
723
|
-
$n(a.model, n,
|
|
722
|
+
}, s = (n) => He(a.model, n), p = (n, h) => {
|
|
723
|
+
$n(a.model, n, h), l("update:model", a.model);
|
|
724
724
|
}, S = (n) => {
|
|
725
|
-
let
|
|
725
|
+
let h = typeof n.rule == "function" ? n.rule(a.model) : n.rule;
|
|
726
726
|
const $ = !n.noRequired && !a.disableDefaultRequired;
|
|
727
727
|
if ($) {
|
|
728
728
|
const U = {
|
|
@@ -730,15 +730,15 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
730
730
|
message: `${typeof n.label == "string" ? n.label : "此项"}不能为空`,
|
|
731
731
|
trigger: "blur"
|
|
732
732
|
};
|
|
733
|
-
|
|
733
|
+
h ? h = Array.isArray(h) ? [U, ...h] : [U, h] : h = U;
|
|
734
734
|
}
|
|
735
735
|
return {
|
|
736
736
|
label: typeof n.label == "string" ? n.label : void 0,
|
|
737
|
-
rule:
|
|
737
|
+
rule: h,
|
|
738
738
|
showRequireMark: $ ? void 0 : !1,
|
|
739
739
|
...n.formItemProps
|
|
740
740
|
};
|
|
741
|
-
},
|
|
741
|
+
}, j = {
|
|
742
742
|
xs: 0,
|
|
743
743
|
s: 640,
|
|
744
744
|
m: 1024,
|
|
@@ -748,11 +748,11 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
748
748
|
}, X = (n) => {
|
|
749
749
|
if (typeof n == "number" || typeof n == "string") return n;
|
|
750
750
|
if (typeof n == "object") {
|
|
751
|
-
const
|
|
752
|
-
return Object.entries(
|
|
751
|
+
const h = [];
|
|
752
|
+
return Object.entries(j).forEach(([$, U]) => {
|
|
753
753
|
const H = n[$];
|
|
754
|
-
H !== void 0 &&
|
|
755
|
-
}),
|
|
754
|
+
H !== void 0 && h.push(`${U}:${H}`);
|
|
755
|
+
}), h.length === 0 ? 24 : h.join(" ");
|
|
756
756
|
}
|
|
757
757
|
return 24;
|
|
758
758
|
}, B = (n) => ({
|
|
@@ -760,18 +760,22 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
760
760
|
offset: n.offset
|
|
761
761
|
}), Z = async (...n) => {
|
|
762
762
|
await c.value.validate(...n);
|
|
763
|
-
}, _e = async (n,
|
|
763
|
+
}, _e = async (n, h) => {
|
|
764
764
|
const $ = Array.isArray(n) ? n : [n];
|
|
765
|
-
await c.value.validate(
|
|
765
|
+
await c.value.validate(h, (U) => $.some((H) => U.key === H));
|
|
766
766
|
}, se = () => c.value?.restoreValidation(), ce = () => {
|
|
767
|
-
|
|
768
|
-
|
|
767
|
+
if (console.log("[DydxNaiveForm] resetFields 被调用"), console.log("[DydxNaiveForm] 当前 model:", JSON.stringify(a.model)), console.log("[DydxNaiveForm] initialModel:", JSON.stringify(i.value)), se(), i.value !== void 0) {
|
|
768
|
+
const n = JSON.parse(JSON.stringify(i.value));
|
|
769
|
+
Object.keys(a.model).forEach((h) => delete a.model[h]), Object.assign(a.model, n), console.log("[DydxNaiveForm] 重置后 model:", JSON.stringify(a.model)), l("update:model", a.model);
|
|
770
|
+
} else console.warn("[DydxNaiveForm] initialModel 为空,无法重置");
|
|
771
|
+
l("reset");
|
|
772
|
+
}, x = async () => {
|
|
769
773
|
try {
|
|
770
774
|
await Z(), l("submit", a.model);
|
|
771
775
|
} catch (n) {
|
|
772
776
|
l("validate", n);
|
|
773
777
|
}
|
|
774
|
-
},
|
|
778
|
+
}, w = () => {
|
|
775
779
|
ce();
|
|
776
780
|
};
|
|
777
781
|
return t({
|
|
@@ -784,26 +788,26 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
784
788
|
Object.assign(a.model, n), l("update:model", a.model);
|
|
785
789
|
},
|
|
786
790
|
getFieldValue: (n) => He(a.model, n),
|
|
787
|
-
setFieldValue: (n,
|
|
791
|
+
setFieldValue: (n, h) => p(n, h),
|
|
788
792
|
resetFields: ce,
|
|
789
793
|
getFormItemInst: (n) => c.value?.getFormItemInst?.(n)
|
|
790
|
-
}), (n,
|
|
791
|
-
const $ = Ft, U = Ot, H = E, te = zt,
|
|
794
|
+
}), (n, h) => {
|
|
795
|
+
const $ = Ft, U = Ot, H = E, te = zt, we = Pt;
|
|
792
796
|
return m(), W(J, null, [
|
|
793
797
|
V(n.$slots, "header", { model: a.model }),
|
|
794
|
-
y(u(
|
|
795
|
-
default: o(() => [y(
|
|
798
|
+
y(u(De), { show: a.loading }, {
|
|
799
|
+
default: o(() => [y(we, K({
|
|
796
800
|
ref_key: "formRef",
|
|
797
801
|
ref: c,
|
|
798
802
|
model: a.model
|
|
799
|
-
},
|
|
800
|
-
default: o(() => [y(te, Xt(Jt(
|
|
801
|
-
default: o(() => [(m(!0), W(J, null, ee(
|
|
803
|
+
}, D.value), {
|
|
804
|
+
default: o(() => [y(te, Xt(Jt(P.value)), {
|
|
805
|
+
default: o(() => [(m(!0), W(J, null, ee(_.value, (f) => (m(), N(U, K({ key: f.name }, { ref_for: !0 }, B(f)), {
|
|
802
806
|
default: o(() => [f.type === "slot" ? V(n.$slots, f.slot || f.name, {
|
|
803
807
|
key: 0,
|
|
804
808
|
model: a.model,
|
|
805
809
|
schema: f
|
|
806
|
-
}) : (m(),
|
|
810
|
+
}) : (m(), N($, K({
|
|
807
811
|
key: 1,
|
|
808
812
|
path: f.name
|
|
809
813
|
}, { ref_for: !0 }, S(f)), de({
|
|
@@ -812,41 +816,41 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
812
816
|
schema: f,
|
|
813
817
|
value: s(f.name),
|
|
814
818
|
setValue: (O) => p(f.name, O)
|
|
815
|
-
}, () => [f.type === "radio-group" && f.props?.options ? (m(),
|
|
819
|
+
}, () => [f.type === "radio-group" && f.props?.options ? (m(), N(u(Le), K({
|
|
816
820
|
key: 0,
|
|
817
821
|
value: s(f.name),
|
|
818
822
|
"onUpdate:value": (O) => p(f.name, O)
|
|
819
823
|
}, { ref_for: !0 }, z(f.props)), {
|
|
820
824
|
default: o(() => [y(u(q), null, {
|
|
821
|
-
default: o(() => [(m(!0), W(J, null, ee(f.props.options, (O) => (m(),
|
|
825
|
+
default: o(() => [(m(!0), W(J, null, ee(f.props.options, (O) => (m(), N(u(Et), {
|
|
822
826
|
key: O[f.props.valueField || "value"],
|
|
823
827
|
value: O[f.props.valueField || "value"],
|
|
824
828
|
disabled: O.disabled
|
|
825
829
|
}, {
|
|
826
|
-
default: o(() => [R(
|
|
830
|
+
default: o(() => [R(G(O[f.props.labelField || "label"]), 1)]),
|
|
827
831
|
_: 2
|
|
828
832
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
829
833
|
_: 2
|
|
830
834
|
}, 1024)]),
|
|
831
835
|
_: 2
|
|
832
|
-
}, 1040, ["value", "onUpdate:value"])) : f.type === "checkbox-group" && f.props?.options ? (m(),
|
|
836
|
+
}, 1040, ["value", "onUpdate:value"])) : f.type === "checkbox-group" && f.props?.options ? (m(), N(u(Te), K({
|
|
833
837
|
key: 1,
|
|
834
838
|
value: s(f.name),
|
|
835
839
|
"onUpdate:value": (O) => p(f.name, O)
|
|
836
840
|
}, { ref_for: !0 }, z(f.props)), {
|
|
837
841
|
default: o(() => [y(u(q), null, {
|
|
838
|
-
default: o(() => [(m(!0), W(J, null, ee(f.props.options, (O) => (m(),
|
|
842
|
+
default: o(() => [(m(!0), W(J, null, ee(f.props.options, (O) => (m(), N(u(Ke), {
|
|
839
843
|
key: O[f.props.valueField || "value"],
|
|
840
844
|
value: O[f.props.valueField || "value"],
|
|
841
845
|
disabled: O.disabled
|
|
842
846
|
}, {
|
|
843
|
-
default: o(() => [R(
|
|
847
|
+
default: o(() => [R(G(O[f.props.labelField || "label"]), 1)]),
|
|
844
848
|
_: 2
|
|
845
849
|
}, 1032, ["value", "disabled"]))), 128))]),
|
|
846
850
|
_: 2
|
|
847
851
|
}, 1024)]),
|
|
848
852
|
_: 2
|
|
849
|
-
}, 1040, ["value", "onUpdate:value"])) : f.type === "switch" ? (m(),
|
|
853
|
+
}, 1040, ["value", "onUpdate:value"])) : f.type === "switch" ? (m(), N(ae(k(f)), K({
|
|
850
854
|
key: 2,
|
|
851
855
|
value: s(f.name),
|
|
852
856
|
"onUpdate:value": (O) => p(f.name, O)
|
|
@@ -854,7 +858,7 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
854
858
|
"value",
|
|
855
859
|
"onUpdate:value",
|
|
856
860
|
"disabled"
|
|
857
|
-
])) : f.type === "image-upload" || f.type === "file-upload" ? (m(),
|
|
861
|
+
])) : f.type === "image-upload" || f.type === "file-upload" ? (m(), N(ae(k(f)), K({
|
|
858
862
|
key: 3,
|
|
859
863
|
"file-list": s(f.name) || [],
|
|
860
864
|
"onUpdate:fileList": (O) => p(f.name, O),
|
|
@@ -864,18 +868,18 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
864
868
|
"onUpdate:fileList",
|
|
865
869
|
"upload-type",
|
|
866
870
|
"disabled"
|
|
867
|
-
])) : (m(),
|
|
871
|
+
])) : (m(), N(ae(k(f)), K({
|
|
868
872
|
key: 4,
|
|
869
873
|
ref_for: !0
|
|
870
|
-
},
|
|
874
|
+
}, T(f), ta(F(f))), null, 16))])]),
|
|
871
875
|
_: 2
|
|
872
876
|
}, [typeof f.label == "function" ? {
|
|
873
877
|
name: "label",
|
|
874
|
-
fn: o(() => [(m(),
|
|
878
|
+
fn: o(() => [(m(), N(ae(f.label)))]),
|
|
875
879
|
key: "0"
|
|
876
880
|
} : void 0]), 1040, ["path"]))]),
|
|
877
881
|
_: 2
|
|
878
|
-
}, 1040))), 128)), a.showFooter ? (m(),
|
|
882
|
+
}, 1040))), 128)), a.showFooter ? (m(), N(U, {
|
|
879
883
|
key: 0,
|
|
880
884
|
span: a.footerSpan
|
|
881
885
|
}, {
|
|
@@ -885,22 +889,22 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
885
889
|
reset: ce
|
|
886
890
|
}, () => [y(u(q), { justify: a.footerAlign }, {
|
|
887
891
|
default: o(() => [
|
|
888
|
-
g.value.hidden ? L("", !0) : (m(),
|
|
889
|
-
default: o(() => [R(
|
|
892
|
+
g.value.hidden ? L("", !0) : (m(), N(H, K({ key: 0 }, d(g.value), { onClick: w }), {
|
|
893
|
+
default: o(() => [R(G(g.value.text), 1)]),
|
|
890
894
|
_: 1
|
|
891
895
|
}, 16)),
|
|
892
|
-
|
|
893
|
-
default: o(() => [R(
|
|
896
|
+
b.value.hidden ? L("", !0) : (m(), N(H, K({ key: 1 }, d(b.value), { onClick: x }), {
|
|
897
|
+
default: o(() => [R(G(b.value.text), 1)]),
|
|
894
898
|
_: 1
|
|
895
899
|
}, 16)),
|
|
896
|
-
(m(!0), W(J, null, ee(a.extraButtons, (f) => (m(),
|
|
900
|
+
(m(!0), W(J, null, ee(a.extraButtons, (f) => (m(), N(H, {
|
|
897
901
|
key: f.text,
|
|
898
902
|
type: f.type,
|
|
899
903
|
size: f.size,
|
|
900
904
|
disabled: f.disabled,
|
|
901
905
|
onClick: f.onClick
|
|
902
906
|
}, {
|
|
903
|
-
default: o(() => [R(
|
|
907
|
+
default: o(() => [R(G(f.text), 1)]),
|
|
904
908
|
_: 2
|
|
905
909
|
}, 1032, [
|
|
906
910
|
"type",
|
|
@@ -925,63 +929,63 @@ var Bn = /* @__PURE__ */ ne({
|
|
|
925
929
|
}
|
|
926
930
|
}), be = Bn;
|
|
927
931
|
function Un(e) {
|
|
928
|
-
const { maxVisible: t = -1, buttons: r = [], showView: a = !0, showEdit: l = !0, showDelete: c = !0, viewConfig: i, editConfig:
|
|
929
|
-
const p =
|
|
932
|
+
const { maxVisible: t = -1, buttons: r = [], showView: a = !0, showEdit: l = !0, showDelete: c = !0, viewConfig: i, editConfig: C, deleteConfig: b, onView: g, onEdit: _, onDelete: D } = e, P = (s, p, S, j) => p ? s ? typeof s.show == "function" ? s.show(S, j) : s.show !== !1 : !0 : !1, k = (s, p, S) => s ? typeof s.disabled == "function" ? s.disabled(p, S) : s.disabled === !0 : !1, M = (s, p, S) => typeof s.show == "function" ? s.show(p, S) : s.show !== !1, Q = (s, p, S) => typeof s.disabled == "function" ? s.disabled(p, S) : s.disabled === !0, T = (s, p, S) => typeof s == "function" ? s(p) : s || S, F = (s) => {
|
|
933
|
+
const p = v(E, {
|
|
930
934
|
type: s.type,
|
|
931
935
|
size: "small",
|
|
932
936
|
disabled: s.disabled,
|
|
933
937
|
onClick: s.confirm ? void 0 : s.onClick,
|
|
934
938
|
renderIcon: s.icon
|
|
935
939
|
}, { default: () => s.label });
|
|
936
|
-
return s.confirm ?
|
|
940
|
+
return s.confirm ? v(At, { onPositiveClick: s.onClick }, {
|
|
937
941
|
trigger: () => p,
|
|
938
942
|
default: () => s.confirm
|
|
939
943
|
}) : p;
|
|
940
944
|
}, z = (s) => {
|
|
941
|
-
const p = s.map((
|
|
942
|
-
label:
|
|
943
|
-
key:
|
|
944
|
-
disabled:
|
|
945
|
+
const p = s.map((j) => ({
|
|
946
|
+
label: j.label,
|
|
947
|
+
key: j.key,
|
|
948
|
+
disabled: j.disabled
|
|
945
949
|
}));
|
|
946
|
-
return
|
|
950
|
+
return v(Nt, {
|
|
947
951
|
options: p,
|
|
948
952
|
trigger: "click",
|
|
949
|
-
onSelect: (
|
|
950
|
-
s.find((X) => X.key ===
|
|
953
|
+
onSelect: (j) => {
|
|
954
|
+
s.find((X) => X.key === j)?.onClick();
|
|
951
955
|
}
|
|
952
|
-
}, { default: () =>
|
|
956
|
+
}, { default: () => v(E, { size: "small" }, { default: () => "更多" }) });
|
|
953
957
|
};
|
|
954
958
|
return {
|
|
955
959
|
renderActions: (s, p) => {
|
|
956
960
|
const S = [];
|
|
957
|
-
if (
|
|
961
|
+
if (P(i, a, s, p) && S.push({
|
|
958
962
|
key: "__view__",
|
|
959
963
|
label: i?.label || "查看",
|
|
960
964
|
type: "info",
|
|
961
965
|
disabled: k(i, s, p),
|
|
962
|
-
icon: () =>
|
|
966
|
+
icon: () => v(A, null, { default: () => v(na) }),
|
|
963
967
|
onClick: () => g?.({
|
|
964
968
|
row: s,
|
|
965
969
|
index: p
|
|
966
970
|
})
|
|
967
|
-
}),
|
|
971
|
+
}), P(C, l, s, p) && S.push({
|
|
968
972
|
key: "__edit__",
|
|
969
|
-
label:
|
|
973
|
+
label: C?.label || "编辑",
|
|
970
974
|
type: "primary",
|
|
971
|
-
disabled: k(
|
|
972
|
-
icon: () =>
|
|
973
|
-
onClick: () =>
|
|
975
|
+
disabled: k(C, s, p),
|
|
976
|
+
icon: () => v(A, null, { default: () => v(aa) }),
|
|
977
|
+
onClick: () => _?.({
|
|
974
978
|
row: s,
|
|
975
979
|
index: p
|
|
976
980
|
})
|
|
977
|
-
}),
|
|
981
|
+
}), P(b, c, s, p) && S.push({
|
|
978
982
|
key: "__delete__",
|
|
979
|
-
label:
|
|
983
|
+
label: b?.label || "删除",
|
|
980
984
|
type: "error",
|
|
981
|
-
disabled: k(
|
|
982
|
-
confirm:
|
|
983
|
-
icon: () =>
|
|
984
|
-
onClick: () =>
|
|
985
|
+
disabled: k(b, s, p),
|
|
986
|
+
confirm: T(b?.confirm, s, "确定删除此记录吗?"),
|
|
987
|
+
icon: () => v(A, null, { default: () => v(sa) }),
|
|
988
|
+
onClick: () => D?.({
|
|
985
989
|
row: s,
|
|
986
990
|
index: p
|
|
987
991
|
})
|
|
@@ -991,20 +995,20 @@ function Un(e) {
|
|
|
991
995
|
label: B.label,
|
|
992
996
|
type: B.type || "default",
|
|
993
997
|
disabled: Q(B, s, p),
|
|
994
|
-
confirm: B.confirm ?
|
|
998
|
+
confirm: B.confirm ? T(B.confirm, s, "确定执行此操作吗?") : void 0,
|
|
995
999
|
icon: B.icon,
|
|
996
1000
|
onClick: () => B.onClick?.(s, p)
|
|
997
1001
|
});
|
|
998
|
-
}), t === -1 || S.length <= t) return
|
|
1002
|
+
}), t === -1 || S.length <= t) return v(q, {
|
|
999
1003
|
size: "small",
|
|
1000
1004
|
wrap: !1
|
|
1001
1005
|
}, () => S.map((B) => F(B)));
|
|
1002
1006
|
if (t === 0) return z(S);
|
|
1003
|
-
const
|
|
1004
|
-
return
|
|
1007
|
+
const j = S.slice(0, t), X = S.slice(t);
|
|
1008
|
+
return v(q, {
|
|
1005
1009
|
size: "small",
|
|
1006
1010
|
wrap: !1
|
|
1007
|
-
}, () => [...
|
|
1011
|
+
}, () => [...j.map((B) => F(B)), z(X)]);
|
|
1008
1012
|
},
|
|
1009
1013
|
isButtonVisible: M,
|
|
1010
1014
|
isButtonDisabled: Q
|
|
@@ -1023,7 +1027,7 @@ var An = (e) => {
|
|
|
1023
1027
|
if (!e) return "-";
|
|
1024
1028
|
const a = String(e), l = r?.newWindow !== !1;
|
|
1025
1029
|
let c;
|
|
1026
|
-
return r?.text ? c = typeof r.text == "function" ? r.text(t) : r.text : c = a,
|
|
1030
|
+
return r?.text ? c = typeof r.text == "function" ? r.text(t) : r.text : c = a, v(E, {
|
|
1027
1031
|
text: !0,
|
|
1028
1032
|
type: "primary",
|
|
1029
1033
|
onClick: () => {
|
|
@@ -1031,12 +1035,12 @@ var An = (e) => {
|
|
|
1031
1035
|
}
|
|
1032
1036
|
}, {
|
|
1033
1037
|
default: () => c,
|
|
1034
|
-
icon: () =>
|
|
1038
|
+
icon: () => v(A, { size: 14 }, () => v(la))
|
|
1035
1039
|
});
|
|
1036
1040
|
}, ut = (e, t) => {
|
|
1037
1041
|
if (!e) return "-";
|
|
1038
1042
|
const r = String(e), a = t?.width ?? 60, l = t?.height ?? 60, c = t?.radius ?? 4, i = t?.fallback;
|
|
1039
|
-
return
|
|
1043
|
+
return v(Rt, {
|
|
1040
1044
|
src: r,
|
|
1041
1045
|
width: typeof a == "number" ? a : void 0,
|
|
1042
1046
|
height: typeof l == "number" ? l : void 0,
|
|
@@ -1056,13 +1060,13 @@ var An = (e) => {
|
|
|
1056
1060
|
const i = document.createElement("a");
|
|
1057
1061
|
i.href = a, i.download = l, i.target = "_blank", i.rel = "noopener noreferrer", document.body.appendChild(i), i.click(), document.body.removeChild(i);
|
|
1058
1062
|
};
|
|
1059
|
-
return
|
|
1060
|
-
trigger: () =>
|
|
1063
|
+
return v(Se, { trigger: "hover" }, {
|
|
1064
|
+
trigger: () => v(E, {
|
|
1061
1065
|
text: !0,
|
|
1062
1066
|
type: "primary",
|
|
1063
1067
|
onClick: c
|
|
1064
1068
|
}, {
|
|
1065
|
-
default: () =>
|
|
1069
|
+
default: () => v("span", { style: {
|
|
1066
1070
|
maxWidth: "150px",
|
|
1067
1071
|
overflow: "hidden",
|
|
1068
1072
|
textOverflow: "ellipsis",
|
|
@@ -1070,39 +1074,39 @@ var An = (e) => {
|
|
|
1070
1074
|
display: "inline-block",
|
|
1071
1075
|
verticalAlign: "middle"
|
|
1072
1076
|
} }, l),
|
|
1073
|
-
icon: () =>
|
|
1077
|
+
icon: () => v(A, { size: 14 }, () => v(ra))
|
|
1074
1078
|
}),
|
|
1075
1079
|
default: () => l
|
|
1076
1080
|
});
|
|
1077
1081
|
}, ft = (e, t) => {
|
|
1078
1082
|
if (!e) return "-";
|
|
1079
1083
|
const r = String(e), a = me[r];
|
|
1080
|
-
return a ?
|
|
1084
|
+
return a ? v(A, {
|
|
1081
1085
|
size: t?.size ?? 20,
|
|
1082
1086
|
color: t?.color
|
|
1083
|
-
}, () =>
|
|
1084
|
-
},
|
|
1087
|
+
}, () => v(a)) : r;
|
|
1088
|
+
}, Ne = (e, t, r = "label", a = "value") => {
|
|
1085
1089
|
if (e == null) return "-";
|
|
1086
|
-
if (!t || t.length === 0) return
|
|
1090
|
+
if (!t || t.length === 0) return v(Ce, { size: "small" }, () => String(e));
|
|
1087
1091
|
const l = t.find((c) => {
|
|
1088
1092
|
const i = c[a];
|
|
1089
1093
|
return i === e || String(i) === String(e) ? !0 : typeof i == "number" && !isNaN(Number(e)) ? i === Number(e) : typeof e == "number" && !isNaN(Number(i)) ? Number(i) === e : typeof i == "boolean" ? i === (e === "true" || e === !0) : typeof e == "boolean" ? (i === "true" || i === !0) === e : !1;
|
|
1090
1094
|
});
|
|
1091
1095
|
if (l) {
|
|
1092
1096
|
const c = l, i = c[r];
|
|
1093
|
-
return
|
|
1097
|
+
return v(Ce, {
|
|
1094
1098
|
size: "small",
|
|
1095
|
-
...Object.keys(l).reduce((
|
|
1099
|
+
...Object.keys(l).reduce((C, b) => (b !== r && b !== a && (C[b] = c[b]), C), {})
|
|
1096
1100
|
}, () => i);
|
|
1097
1101
|
}
|
|
1098
|
-
return
|
|
1099
|
-
}, ct = (e, t, r = "label", a = "value") => e == null ? "-" : Array.isArray(e) ?
|
|
1102
|
+
return v(Ce, { size: "small" }, () => String(e));
|
|
1103
|
+
}, ct = (e, t, r = "label", a = "value") => e == null ? "-" : Array.isArray(e) ? v(q, {
|
|
1100
1104
|
size: "small",
|
|
1101
1105
|
wrap: !0
|
|
1102
1106
|
}, () => e.map((l, c) => {
|
|
1103
|
-
const i =
|
|
1104
|
-
return typeof i == "string" ?
|
|
1105
|
-
})) :
|
|
1107
|
+
const i = Ne(l, t, r, a);
|
|
1108
|
+
return typeof i == "string" ? v("span", { key: c }, i) : i;
|
|
1109
|
+
})) : Ne(e, t, r, a);
|
|
1106
1110
|
const pt = (e, t, r) => {
|
|
1107
1111
|
switch (r.columnType || "text") {
|
|
1108
1112
|
case "link":
|
|
@@ -1128,22 +1132,22 @@ function al() {
|
|
|
1128
1132
|
renderLink: st,
|
|
1129
1133
|
renderImage: ut,
|
|
1130
1134
|
renderFile: dt,
|
|
1131
|
-
renderTag:
|
|
1135
|
+
renderTag: Ne,
|
|
1132
1136
|
renderTags: ct,
|
|
1133
1137
|
renderIcon: ft
|
|
1134
1138
|
};
|
|
1135
1139
|
}
|
|
1136
1140
|
function Mn(e) {
|
|
1137
|
-
const { columns: t, actionColumn: r, onView: a, onEdit: l, onDelete: c } = e, i = (d) => "key" in d && d.key ? String(d.key) : "type" in d ? `__${d.type}__` : "",
|
|
1141
|
+
const { columns: t, actionColumn: r, onView: a, onEdit: l, onDelete: c } = e, i = (d) => "key" in d && d.key ? String(d.key) : "type" in d ? `__${d.type}__` : "", C = (d) => {
|
|
1138
1142
|
if ("title" in d) {
|
|
1139
1143
|
if (typeof d.title == "string") return d.title;
|
|
1140
1144
|
if (typeof d.title == "function") return "自定义列";
|
|
1141
1145
|
}
|
|
1142
1146
|
return i(d);
|
|
1143
|
-
},
|
|
1147
|
+
}, b = (d) => "defaultVisible" in d ? d.defaultVisible !== !1 : !0, g = (d) => "type" in d && (d.type === "selection" || d.type === "expand") ? !1 : "configurable" in d ? d.configurable !== !1 : !0, _ = () => t.filter((d) => b(d)).map((d) => i(d)).filter(Boolean), D = Y(_()), P = I(() => t.filter((d) => i(d) && g(d)).map((d) => ({
|
|
1144
1148
|
key: i(d),
|
|
1145
|
-
title:
|
|
1146
|
-
visible:
|
|
1149
|
+
title: C(d),
|
|
1150
|
+
visible: D.value.includes(i(d)),
|
|
1147
1151
|
configurable: g(d)
|
|
1148
1152
|
}))), k = () => {
|
|
1149
1153
|
if (r?.show === !1) return null;
|
|
@@ -1180,19 +1184,19 @@ function Mn(e) {
|
|
|
1180
1184
|
mergedColumns: I(() => {
|
|
1181
1185
|
const d = t.filter((p) => {
|
|
1182
1186
|
const S = i(p);
|
|
1183
|
-
return "type" in p && (p.type === "selection" || p.type === "expand") || !S ? !0 :
|
|
1187
|
+
return "type" in p && (p.type === "selection" || p.type === "expand") || !S ? !0 : D.value.includes(S);
|
|
1184
1188
|
}).map((p) => M(p)), s = k();
|
|
1185
1189
|
return s && d.push(s), d;
|
|
1186
1190
|
}),
|
|
1187
|
-
configurableColumns:
|
|
1188
|
-
visibleColumnKeys:
|
|
1191
|
+
configurableColumns: P,
|
|
1192
|
+
visibleColumnKeys: D,
|
|
1189
1193
|
setVisibleColumnKeys: (d) => {
|
|
1190
|
-
|
|
1194
|
+
D.value = d;
|
|
1191
1195
|
},
|
|
1192
1196
|
resetColumnSetting: () => {
|
|
1193
|
-
|
|
1197
|
+
D.value = _();
|
|
1194
1198
|
},
|
|
1195
|
-
getVisibleColumnKeys: () => [...
|
|
1199
|
+
getVisibleColumnKeys: () => [...D.value]
|
|
1196
1200
|
};
|
|
1197
1201
|
}
|
|
1198
1202
|
var En = {
|
|
@@ -1213,10 +1217,10 @@ function Vn(e) {
|
|
|
1213
1217
|
const { pagination: t, fieldNames: r, onUpdatePagination: a, onPageChange: l } = e, c = () => ({
|
|
1214
1218
|
...En,
|
|
1215
1219
|
...r
|
|
1216
|
-
}), i = (
|
|
1220
|
+
}), i = (P) => {
|
|
1217
1221
|
if (!(t === !1 || !t))
|
|
1218
|
-
return t[c()[
|
|
1219
|
-
},
|
|
1222
|
+
return t[c()[P]];
|
|
1223
|
+
}, C = I(() => t === !1 || !t ? !1 : {
|
|
1220
1224
|
page: i("page") ?? 1,
|
|
1221
1225
|
pageSize: i("pageSize") ?? 10,
|
|
1222
1226
|
itemCount: i("itemCount"),
|
|
@@ -1225,38 +1229,38 @@ function Vn(e) {
|
|
|
1225
1229
|
showQuickJumper: t.showQuickJumper ?? ke.showQuickJumper,
|
|
1226
1230
|
prefix: t.prefix,
|
|
1227
1231
|
suffix: t.suffix
|
|
1228
|
-
}),
|
|
1232
|
+
}), b = (P) => {
|
|
1229
1233
|
if (t === !1 || !t) return {};
|
|
1230
1234
|
const k = c(), M = { ...t };
|
|
1231
|
-
return
|
|
1232
|
-
}, g = (
|
|
1235
|
+
return P.page !== void 0 && (M[k.page] = P.page), P.pageSize !== void 0 && (M[k.pageSize] = P.pageSize), M;
|
|
1236
|
+
}, g = (P) => {
|
|
1233
1237
|
const k = c();
|
|
1234
1238
|
return {
|
|
1235
|
-
[k.page]:
|
|
1236
|
-
[k.pageSize]:
|
|
1237
|
-
[k.itemCount]:
|
|
1239
|
+
[k.page]: P[k.page],
|
|
1240
|
+
[k.pageSize]: P[k.pageSize],
|
|
1241
|
+
[k.itemCount]: P[k.itemCount]
|
|
1238
1242
|
};
|
|
1239
1243
|
};
|
|
1240
1244
|
return {
|
|
1241
|
-
paginationConfig:
|
|
1242
|
-
handlePageChange: (
|
|
1243
|
-
const k =
|
|
1245
|
+
paginationConfig: C,
|
|
1246
|
+
handlePageChange: (P) => {
|
|
1247
|
+
const k = b({ page: P });
|
|
1244
1248
|
a?.(k), l?.(g(k));
|
|
1245
1249
|
},
|
|
1246
|
-
handlePageSizeChange: (
|
|
1247
|
-
const k =
|
|
1250
|
+
handlePageSizeChange: (P) => {
|
|
1251
|
+
const k = b({
|
|
1248
1252
|
page: 1,
|
|
1249
|
-
pageSize:
|
|
1253
|
+
pageSize: P
|
|
1250
1254
|
});
|
|
1251
1255
|
a?.(k), l?.(g(k));
|
|
1252
1256
|
},
|
|
1253
1257
|
getFieldNames: c
|
|
1254
1258
|
};
|
|
1255
1259
|
}
|
|
1256
|
-
var
|
|
1260
|
+
var jn = {
|
|
1257
1261
|
key: 0,
|
|
1258
1262
|
class: "dydx-table__toolbar"
|
|
1259
|
-
},
|
|
1263
|
+
}, Gn = { class: "dydx-table__column-setting" }, Hn = { class: "dydx-table__column-setting-header" }, Kn = /* @__PURE__ */ ne({
|
|
1260
1264
|
inheritAttrs: !1,
|
|
1261
1265
|
__name: "DydxNaiveTable",
|
|
1262
1266
|
props: {
|
|
@@ -1307,40 +1311,40 @@ var Gn = {
|
|
|
1307
1311
|
"delete"
|
|
1308
1312
|
],
|
|
1309
1313
|
setup(e, { expose: t, emit: r }) {
|
|
1310
|
-
const a = e, l = r, c =
|
|
1311
|
-
const
|
|
1312
|
-
return
|
|
1313
|
-
},
|
|
1314
|
-
let
|
|
1315
|
-
for (;
|
|
1316
|
-
if (g(
|
|
1317
|
-
|
|
1314
|
+
const a = e, l = r, c = Pe(), i = Y(null), C = Y(void 0), b = I(() => !c.maxHeight), g = (x) => {
|
|
1315
|
+
const w = getComputedStyle(x);
|
|
1316
|
+
return x.clientHeight <= 0 ? !1 : !!(parseFloat(w.flexGrow) > 0 || w.height && w.height !== "auto" && w.height !== "0px" || w.maxHeight && w.maxHeight !== "none" && w.maxHeight !== "0px" || w.overflowY === "auto" || w.overflowY === "scroll");
|
|
1317
|
+
}, _ = (x) => {
|
|
1318
|
+
let w = x.parentElement;
|
|
1319
|
+
for (; w && w !== document.body; ) {
|
|
1320
|
+
if (g(w)) return w;
|
|
1321
|
+
w = w.parentElement;
|
|
1318
1322
|
}
|
|
1319
1323
|
return null;
|
|
1320
|
-
},
|
|
1321
|
-
|
|
1322
|
-
const
|
|
1323
|
-
if (!
|
|
1324
|
-
const
|
|
1325
|
-
if (!
|
|
1326
|
-
|
|
1324
|
+
}, D = () => {
|
|
1325
|
+
b.value && Yt(() => {
|
|
1326
|
+
const x = i.value;
|
|
1327
|
+
if (!x) return;
|
|
1328
|
+
const w = _(x);
|
|
1329
|
+
if (!w) {
|
|
1330
|
+
C.value = void 0;
|
|
1327
1331
|
return;
|
|
1328
1332
|
}
|
|
1329
|
-
const n = getComputedStyle(
|
|
1330
|
-
Be > 200 ?
|
|
1333
|
+
const n = getComputedStyle(w), h = parseFloat(n.paddingTop), $ = parseFloat(n.paddingBottom), U = w.getBoundingClientRect(), H = x.getBoundingClientRect(), te = x.querySelector(".dydx-table__toolbar"), we = te ? te.offsetHeight + 16 : 0, f = x.querySelector(".n-data-table-thead"), O = f ? f.offsetHeight : 40, vt = H.top - (U.top + h), Be = w.clientHeight - h - $ - vt - we - O;
|
|
1334
|
+
Be > 200 ? C.value = Be : C.value = void 0;
|
|
1331
1335
|
});
|
|
1332
|
-
},
|
|
1336
|
+
}, P = I(() => c.maxHeight ? c.maxHeight : C.value);
|
|
1333
1337
|
Zt(() => {
|
|
1334
|
-
|
|
1338
|
+
D(), window.addEventListener("resize", D);
|
|
1335
1339
|
}), ea(() => {
|
|
1336
|
-
window.removeEventListener("resize",
|
|
1340
|
+
window.removeEventListener("resize", D);
|
|
1337
1341
|
});
|
|
1338
|
-
const k = Y(null), { mergedColumns: M, configurableColumns: Q, visibleColumnKeys:
|
|
1342
|
+
const k = Y(null), { mergedColumns: M, configurableColumns: Q, visibleColumnKeys: T, setVisibleColumnKeys: F, resetColumnSetting: z, getVisibleColumnKeys: d } = Mn({
|
|
1339
1343
|
columns: a.columns,
|
|
1340
1344
|
actionColumn: a.actionColumn,
|
|
1341
|
-
onView: (
|
|
1342
|
-
onEdit: (
|
|
1343
|
-
onDelete: (
|
|
1345
|
+
onView: (x) => l("view", x),
|
|
1346
|
+
onEdit: (x) => l("edit", x),
|
|
1347
|
+
onDelete: (x) => l("delete", x)
|
|
1344
1348
|
}), { paginationConfig: s, handlePageChange: p, handlePageSizeChange: S } = Vn({
|
|
1345
1349
|
get pagination() {
|
|
1346
1350
|
return a.pagination;
|
|
@@ -1348,14 +1352,14 @@ var Gn = {
|
|
|
1348
1352
|
get fieldNames() {
|
|
1349
1353
|
return a.paginationFieldNames;
|
|
1350
1354
|
},
|
|
1351
|
-
onUpdatePagination: (
|
|
1352
|
-
onPageChange: (
|
|
1355
|
+
onUpdatePagination: (x) => l("update:pagination", x),
|
|
1356
|
+
onPageChange: (x) => l("pageChange", x)
|
|
1353
1357
|
});
|
|
1354
|
-
Je(
|
|
1355
|
-
l("update:visibleColumns",
|
|
1358
|
+
Je(T, (x) => {
|
|
1359
|
+
l("update:visibleColumns", x);
|
|
1356
1360
|
});
|
|
1357
|
-
const
|
|
1358
|
-
l("update:checkedRowKeys",
|
|
1361
|
+
const j = I(() => typeof a.rowKey == "function" ? a.rowKey : (x) => x[a.rowKey]), X = (x) => {
|
|
1362
|
+
l("update:checkedRowKeys", x, a.data.filter((w) => x.includes(j.value(w))));
|
|
1359
1363
|
}, B = () => {
|
|
1360
1364
|
a.onAdd?.();
|
|
1361
1365
|
}, Z = () => {
|
|
@@ -1372,48 +1376,48 @@ var Gn = {
|
|
|
1372
1376
|
getVisibleColumnKeys: d,
|
|
1373
1377
|
setVisibleColumnKeys: F,
|
|
1374
1378
|
resetColumnSetting: z,
|
|
1375
|
-
scrollTo: (
|
|
1376
|
-
k.value?.scrollTo(
|
|
1379
|
+
scrollTo: (x) => {
|
|
1380
|
+
k.value?.scrollTo(x);
|
|
1377
1381
|
}
|
|
1378
|
-
}), (
|
|
1382
|
+
}), (x, w) => (m(), W("div", {
|
|
1379
1383
|
ref_key: "containerRef",
|
|
1380
1384
|
ref: i,
|
|
1381
1385
|
class: "dydx-table"
|
|
1382
|
-
}, [a.showToolbar ? (m(), W("div",
|
|
1386
|
+
}, [a.showToolbar ? (m(), W("div", jn, [y(u(q), {
|
|
1383
1387
|
class: "dydx-table__toolbar-left",
|
|
1384
1388
|
size: 12
|
|
1385
1389
|
}, {
|
|
1386
1390
|
default: o(() => [
|
|
1387
|
-
e.showAdd ? (m(),
|
|
1391
|
+
e.showAdd ? (m(), N(u(E), {
|
|
1388
1392
|
key: 0,
|
|
1389
1393
|
type: "primary",
|
|
1390
1394
|
onClick: B
|
|
1391
1395
|
}, {
|
|
1392
|
-
icon: o(() => [V(
|
|
1396
|
+
icon: o(() => [V(x.$slots, "add-icon", {}, () => [y(u(A), null, {
|
|
1393
1397
|
default: o(() => [y(u(Qe))]),
|
|
1394
1398
|
_: 1
|
|
1395
1399
|
})], !0)]),
|
|
1396
|
-
default: o(() => [R(" " +
|
|
1400
|
+
default: o(() => [R(" " + G(e.addButtonText), 1)]),
|
|
1397
1401
|
_: 3
|
|
1398
1402
|
})) : L("", !0),
|
|
1399
|
-
(m(!0), W(J, null, ee(e.leftButtons, (n) => (m(), W(J, { key: n.key }, [n.show !== !1 ? (m(),
|
|
1403
|
+
(m(!0), W(J, null, ee(e.leftButtons, (n) => (m(), W(J, { key: n.key }, [n.show !== !1 ? (m(), N(u(E), {
|
|
1400
1404
|
key: 0,
|
|
1401
1405
|
type: n.type,
|
|
1402
1406
|
disabled: n.disabled,
|
|
1403
1407
|
onClick: n.onClick
|
|
1404
1408
|
}, de({
|
|
1405
|
-
default: o(() => [R(" " +
|
|
1409
|
+
default: o(() => [R(" " + G(n.label), 1)]),
|
|
1406
1410
|
_: 2
|
|
1407
1411
|
}, [n.icon ? {
|
|
1408
1412
|
name: "icon",
|
|
1409
|
-
fn: o(() => [(m(),
|
|
1413
|
+
fn: o(() => [(m(), N(ae(n.icon)))]),
|
|
1410
1414
|
key: "0"
|
|
1411
1415
|
} : void 0]), 1032, [
|
|
1412
1416
|
"type",
|
|
1413
1417
|
"disabled",
|
|
1414
1418
|
"onClick"
|
|
1415
1419
|
])) : L("", !0)], 64))), 128)),
|
|
1416
|
-
V(
|
|
1420
|
+
V(x.$slots, "toolbar-left", {}, void 0, !0)
|
|
1417
1421
|
]),
|
|
1418
1422
|
_: 3
|
|
1419
1423
|
}), y(u(q), {
|
|
@@ -1421,25 +1425,25 @@ var Gn = {
|
|
|
1421
1425
|
size: 8
|
|
1422
1426
|
}, {
|
|
1423
1427
|
default: o(() => [
|
|
1424
|
-
V(
|
|
1425
|
-
(m(!0), W(J, null, ee(e.rightButtons, (n) => (m(), W(J, { key: n.key }, [n.show !== !1 ? (m(),
|
|
1428
|
+
V(x.$slots, "toolbar-right", {}, void 0, !0),
|
|
1429
|
+
(m(!0), W(J, null, ee(e.rightButtons, (n) => (m(), W(J, { key: n.key }, [n.show !== !1 ? (m(), N(u(E), {
|
|
1426
1430
|
key: 0,
|
|
1427
1431
|
type: n.type,
|
|
1428
1432
|
disabled: n.disabled,
|
|
1429
1433
|
onClick: n.onClick
|
|
1430
1434
|
}, de({
|
|
1431
|
-
default: o(() => [R(" " +
|
|
1435
|
+
default: o(() => [R(" " + G(n.label), 1)]),
|
|
1432
1436
|
_: 2
|
|
1433
1437
|
}, [n.icon ? {
|
|
1434
1438
|
name: "icon",
|
|
1435
|
-
fn: o(() => [(m(),
|
|
1439
|
+
fn: o(() => [(m(), N(ae(n.icon)))]),
|
|
1436
1440
|
key: "0"
|
|
1437
1441
|
} : void 0]), 1032, [
|
|
1438
1442
|
"type",
|
|
1439
1443
|
"disabled",
|
|
1440
1444
|
"onClick"
|
|
1441
1445
|
])) : L("", !0)], 64))), 128)),
|
|
1442
|
-
e.showRefresh ? (m(),
|
|
1446
|
+
e.showRefresh ? (m(), N(u(Se), {
|
|
1443
1447
|
key: 0,
|
|
1444
1448
|
trigger: "hover"
|
|
1445
1449
|
}, {
|
|
@@ -1454,10 +1458,10 @@ var Gn = {
|
|
|
1454
1458
|
})]),
|
|
1455
1459
|
_: 1
|
|
1456
1460
|
})]),
|
|
1457
|
-
default: o(() => [
|
|
1461
|
+
default: o(() => [w[1] || (w[1] = R(" 刷新 ", -1))]),
|
|
1458
1462
|
_: 1
|
|
1459
1463
|
})) : L("", !0),
|
|
1460
|
-
e.showColumnSetting ? (m(),
|
|
1464
|
+
e.showColumnSetting ? (m(), N(u(Mt), {
|
|
1461
1465
|
key: 1,
|
|
1462
1466
|
trigger: "click",
|
|
1463
1467
|
placement: "bottom-end"
|
|
@@ -1473,26 +1477,26 @@ var Gn = {
|
|
|
1473
1477
|
})]),
|
|
1474
1478
|
_: 1
|
|
1475
1479
|
})]),
|
|
1476
|
-
default: o(() => [
|
|
1480
|
+
default: o(() => [w[2] || (w[2] = R(" 列设置 ", -1))]),
|
|
1477
1481
|
_: 1
|
|
1478
1482
|
})]),
|
|
1479
|
-
default: o(() => [pe("div",
|
|
1483
|
+
default: o(() => [pe("div", Gn, [pe("div", Hn, [w[4] || (w[4] = pe("span", null, "列设置", -1)), y(u(E), {
|
|
1480
1484
|
text: "",
|
|
1481
1485
|
size: "small",
|
|
1482
1486
|
type: "primary",
|
|
1483
1487
|
onClick: u(z)
|
|
1484
1488
|
}, {
|
|
1485
|
-
default: o(() => [...
|
|
1489
|
+
default: o(() => [...w[3] || (w[3] = [R(" 重置 ", -1)])]),
|
|
1486
1490
|
_: 1
|
|
1487
|
-
}, 8, ["onClick"])]), y(u(
|
|
1488
|
-
value: u(
|
|
1489
|
-
"onUpdate:value":
|
|
1491
|
+
}, 8, ["onClick"])]), y(u(Te), {
|
|
1492
|
+
value: u(T),
|
|
1493
|
+
"onUpdate:value": w[0] || (w[0] = (n) => Qt(T) ? T.value = n : null)
|
|
1490
1494
|
}, {
|
|
1491
1495
|
default: o(() => [y(u(q), {
|
|
1492
1496
|
vertical: "",
|
|
1493
1497
|
size: 8
|
|
1494
1498
|
}, {
|
|
1495
|
-
default: o(() => [(m(!0), W(J, null, ee(u(Q), (n) => (m(),
|
|
1499
|
+
default: o(() => [(m(!0), W(J, null, ee(u(Q), (n) => (m(), N(u(Ke), {
|
|
1496
1500
|
key: n.key,
|
|
1497
1501
|
value: n.key,
|
|
1498
1502
|
label: n.title
|
|
@@ -1505,17 +1509,17 @@ var Gn = {
|
|
|
1505
1509
|
})) : L("", !0)
|
|
1506
1510
|
]),
|
|
1507
1511
|
_: 3
|
|
1508
|
-
})])) : L("", !0), y(u(
|
|
1512
|
+
})])) : L("", !0), y(u(Ct), K({
|
|
1509
1513
|
ref_key: "dataTableRef",
|
|
1510
1514
|
ref: k,
|
|
1511
1515
|
data: e.data,
|
|
1512
1516
|
columns: u(M),
|
|
1513
|
-
"row-key":
|
|
1517
|
+
"row-key": j.value,
|
|
1514
1518
|
loading: e.loading,
|
|
1515
1519
|
pagination: u(s),
|
|
1516
1520
|
remote: e.remote,
|
|
1517
1521
|
"checked-row-keys": e.checkedRowKeys,
|
|
1518
|
-
"max-height":
|
|
1522
|
+
"max-height": P.value
|
|
1519
1523
|
}, u(c), {
|
|
1520
1524
|
"onUpdate:page": u(p),
|
|
1521
1525
|
"onUpdate:pageSize": u(S),
|
|
@@ -1571,9 +1575,9 @@ var Gn = {
|
|
|
1571
1575
|
"cancel"
|
|
1572
1576
|
],
|
|
1573
1577
|
setup(e, { expose: t, emit: r }) {
|
|
1574
|
-
const a = e, l = r, c =
|
|
1578
|
+
const a = e, l = r, c = Pe(), i = Y(), C = I(() => a.title ? a.title : `${a.model[a.rowKey] ? "编辑" : "新增"}${a.subtitle}`), b = I(() => ({ width: typeof a.width == "number" ? `${a.width}px` : a.width })), g = () => {
|
|
1575
1579
|
l("update:show", !1), l("cancel");
|
|
1576
|
-
},
|
|
1580
|
+
}, _ = async () => {
|
|
1577
1581
|
try {
|
|
1578
1582
|
await i.value?.validate(), l("confirm", a.model);
|
|
1579
1583
|
} catch {
|
|
@@ -1583,30 +1587,30 @@ var Gn = {
|
|
|
1583
1587
|
getFormRef: () => i.value,
|
|
1584
1588
|
validate: () => i.value?.validate(),
|
|
1585
1589
|
resetFields: () => i.value?.resetFields()
|
|
1586
|
-
}), (
|
|
1590
|
+
}), (D, P) => (m(), N(u(Ut), K({
|
|
1587
1591
|
show: e.show,
|
|
1588
1592
|
preset: "card",
|
|
1589
|
-
title:
|
|
1590
|
-
style:
|
|
1593
|
+
title: C.value,
|
|
1594
|
+
style: b.value,
|
|
1591
1595
|
"mask-closable": !1
|
|
1592
|
-
}, u(c), { "onUpdate:show":
|
|
1593
|
-
|
|
1596
|
+
}, u(c), { "onUpdate:show": P[0] || (P[0] = (k) => l("update:show", k)) }), de({ _: 2 }, [
|
|
1597
|
+
D.$slots.header ? {
|
|
1594
1598
|
name: "header",
|
|
1595
|
-
fn: o(() => [V(
|
|
1599
|
+
fn: o(() => [V(D.$slots, "header")]),
|
|
1596
1600
|
key: "0"
|
|
1597
1601
|
} : void 0,
|
|
1598
|
-
|
|
1602
|
+
D.$slots["header-extra"] ? {
|
|
1599
1603
|
name: "header-extra",
|
|
1600
|
-
fn: o(() => [V(
|
|
1604
|
+
fn: o(() => [V(D.$slots, "header-extra")]),
|
|
1601
1605
|
key: "1"
|
|
1602
1606
|
} : void 0,
|
|
1603
|
-
|
|
1607
|
+
D.$slots.default ? {
|
|
1604
1608
|
name: "default",
|
|
1605
|
-
fn: o(() => [V(
|
|
1609
|
+
fn: o(() => [V(D.$slots, "default")]),
|
|
1606
1610
|
key: "2"
|
|
1607
1611
|
} : {
|
|
1608
1612
|
name: "default",
|
|
1609
|
-
fn: o(() => [y(u(
|
|
1613
|
+
fn: o(() => [y(u(De), { show: e.loading }, {
|
|
1610
1614
|
default: o(() => [y(u(be), {
|
|
1611
1615
|
ref_key: "formRef",
|
|
1612
1616
|
ref: i,
|
|
@@ -1631,14 +1635,14 @@ var Gn = {
|
|
|
1631
1635
|
}, 8, ["show"])]),
|
|
1632
1636
|
key: "3"
|
|
1633
1637
|
},
|
|
1634
|
-
|
|
1638
|
+
D.$slots.footer ? {
|
|
1635
1639
|
name: "footer",
|
|
1636
|
-
fn: o(() => [V(
|
|
1640
|
+
fn: o(() => [V(D.$slots, "footer")]),
|
|
1637
1641
|
key: "4"
|
|
1638
1642
|
} : {
|
|
1639
1643
|
name: "footer",
|
|
1640
1644
|
fn: o(() => [y(u(q), { justify: "end" }, {
|
|
1641
|
-
default: o(() => [e.showCancel ? (m(),
|
|
1645
|
+
default: o(() => [e.showCancel ? (m(), N(u(E), {
|
|
1642
1646
|
key: 0,
|
|
1643
1647
|
onClick: g
|
|
1644
1648
|
}, {
|
|
@@ -1646,27 +1650,27 @@ var Gn = {
|
|
|
1646
1650
|
default: o(() => [y(u(Xe))]),
|
|
1647
1651
|
_: 1
|
|
1648
1652
|
})]),
|
|
1649
|
-
default: o(() => [R(" " +
|
|
1653
|
+
default: o(() => [R(" " + G(e.cancelText), 1)]),
|
|
1650
1654
|
_: 1
|
|
1651
1655
|
})) : L("", !0), y(u(E), {
|
|
1652
1656
|
type: "primary",
|
|
1653
1657
|
loading: e.loading,
|
|
1654
|
-
onClick:
|
|
1658
|
+
onClick: _
|
|
1655
1659
|
}, {
|
|
1656
1660
|
icon: o(() => [y(u(A), null, {
|
|
1657
1661
|
default: o(() => [y(u(Ye))]),
|
|
1658
1662
|
_: 1
|
|
1659
1663
|
})]),
|
|
1660
|
-
default: o(() => [R(" " +
|
|
1664
|
+
default: o(() => [R(" " + G(e.confirmText), 1)]),
|
|
1661
1665
|
_: 1
|
|
1662
1666
|
}, 8, ["loading"])]),
|
|
1663
1667
|
_: 1
|
|
1664
1668
|
})]),
|
|
1665
1669
|
key: "5"
|
|
1666
1670
|
},
|
|
1667
|
-
|
|
1671
|
+
D.$slots.action ? {
|
|
1668
1672
|
name: "action",
|
|
1669
|
-
fn: o(() => [V(
|
|
1673
|
+
fn: o(() => [V(D.$slots, "action")]),
|
|
1670
1674
|
key: "6"
|
|
1671
1675
|
} : void 0
|
|
1672
1676
|
]), 1040, [
|
|
@@ -1710,7 +1714,7 @@ var Gn = {
|
|
|
1710
1714
|
"cancel"
|
|
1711
1715
|
],
|
|
1712
1716
|
setup(e, { expose: t, emit: r }) {
|
|
1713
|
-
const a = e, l = r, c =
|
|
1717
|
+
const a = e, l = r, c = Pe(), i = Y(), C = I(() => a.title ? a.title : `${a.model[a.rowKey] ? "编辑" : "新增"}${a.subtitle}`), b = () => {
|
|
1714
1718
|
l("update:show", !1), l("cancel");
|
|
1715
1719
|
}, g = async () => {
|
|
1716
1720
|
try {
|
|
@@ -1722,23 +1726,23 @@ var Gn = {
|
|
|
1722
1726
|
getFormRef: () => i.value,
|
|
1723
1727
|
validate: () => i.value?.validate(),
|
|
1724
1728
|
resetFields: () => i.value?.resetFields()
|
|
1725
|
-
}), (
|
|
1729
|
+
}), (_, D) => (m(), N(u(kt), K({
|
|
1726
1730
|
show: e.show,
|
|
1727
1731
|
width: e.width,
|
|
1728
1732
|
placement: e.placement,
|
|
1729
1733
|
"mask-closable": !1
|
|
1730
|
-
}, u(c), { "onUpdate:show":
|
|
1734
|
+
}, u(c), { "onUpdate:show": D[0] || (D[0] = (P) => l("update:show", P)) }), {
|
|
1731
1735
|
default: o(() => [y(u(St), {
|
|
1732
|
-
title:
|
|
1736
|
+
title: C.value,
|
|
1733
1737
|
closable: "",
|
|
1734
|
-
onClose:
|
|
1735
|
-
}, de({ _: 2 }, [
|
|
1738
|
+
onClose: b
|
|
1739
|
+
}, de({ _: 2 }, [_.$slots.default ? {
|
|
1736
1740
|
name: "default",
|
|
1737
|
-
fn: o(() => [V(
|
|
1741
|
+
fn: o(() => [V(_.$slots, "default")]),
|
|
1738
1742
|
key: "0"
|
|
1739
1743
|
} : {
|
|
1740
1744
|
name: "default",
|
|
1741
|
-
fn: o(() => [y(u(
|
|
1745
|
+
fn: o(() => [y(u(De), { show: e.loading }, {
|
|
1742
1746
|
default: o(() => [y(u(be), {
|
|
1743
1747
|
ref_key: "formRef",
|
|
1744
1748
|
ref: i,
|
|
@@ -1762,22 +1766,22 @@ var Gn = {
|
|
|
1762
1766
|
_: 1
|
|
1763
1767
|
}, 8, ["show"])]),
|
|
1764
1768
|
key: "1"
|
|
1765
|
-
},
|
|
1769
|
+
}, _.$slots.footer ? {
|
|
1766
1770
|
name: "footer",
|
|
1767
|
-
fn: o(() => [V(
|
|
1771
|
+
fn: o(() => [V(_.$slots, "footer")]),
|
|
1768
1772
|
key: "2"
|
|
1769
1773
|
} : {
|
|
1770
1774
|
name: "footer",
|
|
1771
1775
|
fn: o(() => [y(u(q), { justify: "end" }, {
|
|
1772
|
-
default: o(() => [e.showCancel ? (m(),
|
|
1776
|
+
default: o(() => [e.showCancel ? (m(), N(u(E), {
|
|
1773
1777
|
key: 0,
|
|
1774
|
-
onClick:
|
|
1778
|
+
onClick: b
|
|
1775
1779
|
}, {
|
|
1776
1780
|
icon: o(() => [y(u(A), null, {
|
|
1777
1781
|
default: o(() => [y(u(Xe))]),
|
|
1778
1782
|
_: 1
|
|
1779
1783
|
})]),
|
|
1780
|
-
default: o(() => [R(" " +
|
|
1784
|
+
default: o(() => [R(" " + G(e.cancelText), 1)]),
|
|
1781
1785
|
_: 1
|
|
1782
1786
|
})) : L("", !0), y(u(E), {
|
|
1783
1787
|
type: "primary",
|
|
@@ -1788,7 +1792,7 @@ var Gn = {
|
|
|
1788
1792
|
default: o(() => [y(u(Ye))]),
|
|
1789
1793
|
_: 1
|
|
1790
1794
|
})]),
|
|
1791
|
-
default: o(() => [R(" " +
|
|
1795
|
+
default: o(() => [R(" " + G(e.confirmText), 1)]),
|
|
1792
1796
|
_: 1
|
|
1793
1797
|
}, 8, ["loading"])]),
|
|
1794
1798
|
_: 1
|