@yeepay/yee-boss-ui 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +671 -664
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { ConfigProvider as xt, message as He, Descriptions as qe, Tooltip as
|
|
1
|
+
import { inject as Oe, defineComponent as oe, computed as u, provide as Qe, openBlock as a, createBlock as M, unref as s, withCtx as S, createElementVNode as E, normalizeStyle as he, renderSlot as U, reactive as Ie, onBeforeUnmount as Ce, mergeProps as Z, createElementBlock as h, Fragment as _e, renderList as Se, createTextVNode as ie, toDisplayString as D, normalizeClass as ye, createCommentVNode as z, useTemplateRef as xe, shallowRef as R, onMounted as Re, onUpdated as vt, watch as ke, nextTick as Te, ref as mt, createVNode as te, withModifiers as yt, useSlots as ze, onUnmounted as ht, withDirectives as gt, vShow as bt, toHandlers as wt, createSlots as Me, normalizeProps as ve, guardReactiveProps as me, h as Xe, useModel as Ue, useAttrs as Ze, useId as _t, mergeModels as je } from "vue";
|
|
2
|
+
import { ConfigProvider as xt, message as He, Descriptions as qe, Tooltip as re, Upload as kt, Image as Ct, DatePicker as $t, Input as St, Select as Ve, Button as se, Modal as et, Drawer as Tt } from "ant-design-vue";
|
|
3
3
|
import { r as Bt, t as Ft, a as Et } from "./tokens-Dw6w0SSs.js";
|
|
4
4
|
import { d as qn, l as Gn } from "./tokens-Dw6w0SSs.js";
|
|
5
5
|
import { CheckOutlined as Rt, CopyOutlined as Ot, FullscreenExitOutlined as tt, FullscreenOutlined as ot, DownloadOutlined as Mt, CloseOutlined as Vt } from "@ant-design/icons-vue";
|
|
6
6
|
import { VxeTable as zt, VxeColumn as Nt, VxeColgroup as Pt, VxeGrid as nt, VxeToolbar as Ht, VxeUI as Ee } from "vxe-table";
|
|
7
|
-
import { VxeButton as Lt, VxeCheckbox as At, VxeIcon as Ut, VxeInput as jt, VxeLoading as
|
|
7
|
+
import { VxeButton as Lt, VxeCheckbox as At, VxeIcon as Ut, VxeInput as jt, VxeLoading as Dt, VxeModal as It, VxeNumberInput as Yt, VxePager as Wt, VxeRadioGroup as qt, VxeSelect as Gt } from "vxe-pc-ui";
|
|
8
8
|
const Vn = "--yee-content-height", Ne = /* @__PURE__ */ Symbol("platform-theme");
|
|
9
9
|
function zn() {
|
|
10
|
-
const o =
|
|
10
|
+
const o = Oe(Ne);
|
|
11
11
|
if (!o)
|
|
12
12
|
throw new Error("usePlatformTheme 必须在 PlatformConfigProvider 内使用。");
|
|
13
13
|
return o;
|
|
14
14
|
}
|
|
15
|
-
const Kt = ["data-theme"], Jt = /* @__PURE__ */
|
|
15
|
+
const Kt = ["data-theme"], Jt = /* @__PURE__ */ oe({
|
|
16
16
|
name: "PlatformConfigProvider",
|
|
17
17
|
__name: "PlatformConfigProvider",
|
|
18
18
|
props: {
|
|
19
19
|
theme: { default: () => ({}) }
|
|
20
20
|
},
|
|
21
21
|
setup(o) {
|
|
22
|
-
const t = o, e = u(() => Bt(t.theme)), n = u(() => Ft(e.value)),
|
|
23
|
-
return Qe(Ne, e), (x,
|
|
22
|
+
const t = o, e = u(() => Bt(t.theme)), n = u(() => Ft(e.value)), v = u(() => Et(e.value));
|
|
23
|
+
return Qe(Ne, e), (x, p) => (a(), M(s(xt), {
|
|
24
24
|
"prefix-cls": "yee",
|
|
25
25
|
theme: n.value
|
|
26
26
|
}, {
|
|
27
|
-
default:
|
|
28
|
-
|
|
27
|
+
default: S(() => [
|
|
28
|
+
E("div", {
|
|
29
29
|
class: "yee-ui-platform-theme",
|
|
30
30
|
"data-theme": e.value.mode,
|
|
31
|
-
style: he(
|
|
31
|
+
style: he(v.value)
|
|
32
32
|
}, [
|
|
33
|
-
|
|
33
|
+
U(x.$slots, "default", {}, void 0, !0)
|
|
34
34
|
], 12, Kt)
|
|
35
35
|
]),
|
|
36
36
|
_: 3
|
|
37
37
|
}, 8, ["theme"]));
|
|
38
38
|
}
|
|
39
|
-
}),
|
|
39
|
+
}), ue = (o, t) => {
|
|
40
40
|
const e = o.__vccOpts || o;
|
|
41
|
-
for (const [n,
|
|
42
|
-
e[n] =
|
|
41
|
+
for (const [n, v] of t)
|
|
42
|
+
e[n] = v;
|
|
43
43
|
return e;
|
|
44
|
-
}, Nn = /* @__PURE__ */
|
|
44
|
+
}, Nn = /* @__PURE__ */ ue(Jt, [["__scopeId", "data-v-0b569e8c"]]);
|
|
45
45
|
async function Qt(o) {
|
|
46
46
|
if (!o) return !1;
|
|
47
47
|
try {
|
|
@@ -78,7 +78,7 @@ const Be = {
|
|
|
78
78
|
}, Xt = { class: "yee-ui-descriptions__item" }, Zt = { class: "yee-ui-descriptions__content-row" }, eo = { class: "yee-ui-descriptions__value yee-ui-descriptions__value--ellipsis" }, to = {
|
|
79
79
|
key: 1,
|
|
80
80
|
class: "yee-ui-descriptions__value"
|
|
81
|
-
}, oo = ["aria-label", "disabled", "onClick"], no = /* @__PURE__ */
|
|
81
|
+
}, oo = ["aria-label", "disabled", "onClick"], no = /* @__PURE__ */ oe({
|
|
82
82
|
name: "YeeDescriptions",
|
|
83
83
|
__name: "YeeDescriptions",
|
|
84
84
|
props: {
|
|
@@ -91,11 +91,11 @@ const Be = {
|
|
|
91
91
|
title: {}
|
|
92
92
|
},
|
|
93
93
|
setup(o) {
|
|
94
|
-
const t = o, e = u(() => t.bordered ?? !1), n = u(() => t.colon ?? !0),
|
|
95
|
-
function b(B,
|
|
96
|
-
return B.name ?? `${B.label}-${
|
|
94
|
+
const t = o, e = u(() => t.bordered ?? !1), n = u(() => t.colon ?? !0), v = u(() => t.column ?? 3), x = u(() => t.layout ?? "horizontal"), p = u(() => t.size ?? "default"), m = Ie(/* @__PURE__ */ new Set()), C = /* @__PURE__ */ new Set();
|
|
95
|
+
function b(B, k) {
|
|
96
|
+
return B.name ?? `${B.label}-${k}`;
|
|
97
97
|
}
|
|
98
|
-
async function T(B,
|
|
98
|
+
async function T(B, k) {
|
|
99
99
|
const c = String(B.value ?? "");
|
|
100
100
|
if (!c.trim()) {
|
|
101
101
|
Be.warning("没有可复制的内容");
|
|
@@ -105,61 +105,61 @@ const Be = {
|
|
|
105
105
|
Be.error("复制失败");
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
108
|
+
m.add(k), Be.success("已复制");
|
|
109
|
+
const w = setTimeout(() => {
|
|
110
|
+
m.delete(k), C.delete(w);
|
|
111
111
|
}, 1500);
|
|
112
|
-
|
|
112
|
+
C.add(w);
|
|
113
113
|
}
|
|
114
114
|
return Ce(() => {
|
|
115
|
-
|
|
116
|
-
}), (B,
|
|
115
|
+
C.forEach((B) => clearTimeout(B)), C.clear();
|
|
116
|
+
}), (B, k) => (a(), M(s(qe), Z({
|
|
117
117
|
class: "yee-ui-descriptions",
|
|
118
118
|
bordered: e.value,
|
|
119
119
|
colon: n.value,
|
|
120
|
-
column:
|
|
120
|
+
column: v.value,
|
|
121
121
|
layout: x.value,
|
|
122
|
-
size:
|
|
122
|
+
size: p.value
|
|
123
123
|
}, t.title === void 0 ? {} : { title: t.title }), {
|
|
124
|
-
default:
|
|
125
|
-
(a(!0), h(_e, null,
|
|
126
|
-
key: b(c,
|
|
124
|
+
default: S(() => [
|
|
125
|
+
(a(!0), h(_e, null, Se(o.items, (c, w) => (a(), M(s(qe).Item, {
|
|
126
|
+
key: b(c, w),
|
|
127
127
|
label: c.label,
|
|
128
128
|
span: c.span ?? 1
|
|
129
129
|
}, {
|
|
130
|
-
default:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
c.ellipsis ? (a(), M(s(
|
|
130
|
+
default: S(() => [
|
|
131
|
+
E("div", Xt, [
|
|
132
|
+
E("div", Zt, [
|
|
133
|
+
c.ellipsis ? (a(), M(s(re), {
|
|
134
134
|
key: 0,
|
|
135
135
|
title: String(c.value ?? "")
|
|
136
136
|
}, {
|
|
137
|
-
default:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
ie(
|
|
137
|
+
default: S(() => [
|
|
138
|
+
E("span", eo, [
|
|
139
|
+
U(B.$slots, `content-${c.name ?? c.label}`, { item: c }, () => [
|
|
140
|
+
ie(D(c.value), 1)
|
|
141
141
|
], !0)
|
|
142
142
|
])
|
|
143
143
|
]),
|
|
144
144
|
_: 2
|
|
145
145
|
}, 1032, ["title"])) : (a(), h("span", to, [
|
|
146
|
-
|
|
147
|
-
ie(
|
|
146
|
+
U(B.$slots, `content-${c.name ?? c.label}`, { item: c }, () => [
|
|
147
|
+
ie(D(c.value), 1)
|
|
148
148
|
], !0)
|
|
149
149
|
])),
|
|
150
|
-
c.copyable ? (a(), M(s(
|
|
150
|
+
c.copyable ? (a(), M(s(re), {
|
|
151
151
|
key: 2,
|
|
152
|
-
title:
|
|
152
|
+
title: m.has(b(c, w)) ? "已复制" : "复制"
|
|
153
153
|
}, {
|
|
154
|
-
default:
|
|
155
|
-
|
|
156
|
-
class: ye(["yee-ui-descriptions__copy", { "yee-ui-descriptions__copy--copied":
|
|
157
|
-
"aria-label":
|
|
158
|
-
disabled:
|
|
154
|
+
default: S(() => [
|
|
155
|
+
E("button", {
|
|
156
|
+
class: ye(["yee-ui-descriptions__copy", { "yee-ui-descriptions__copy--copied": m.has(b(c, w)) }]),
|
|
157
|
+
"aria-label": m.has(b(c, w)) ? "已复制" : "复制",
|
|
158
|
+
disabled: m.has(b(c, w)),
|
|
159
159
|
type: "button",
|
|
160
|
-
onClick: (N) => T(c, b(c,
|
|
160
|
+
onClick: (N) => T(c, b(c, w))
|
|
161
161
|
}, [
|
|
162
|
-
|
|
162
|
+
m.has(b(c, w)) ? (a(), M(s(Rt), { key: 0 })) : (a(), M(s(Ot), { key: 1 }))
|
|
163
163
|
], 10, oo)
|
|
164
164
|
]),
|
|
165
165
|
_: 2
|
|
@@ -169,7 +169,7 @@ const Be = {
|
|
|
169
169
|
key: 0,
|
|
170
170
|
class: "yee-ui-descriptions__info",
|
|
171
171
|
style: he(c.infoStyle)
|
|
172
|
-
},
|
|
172
|
+
}, D(c.info), 5)) : z("", !0)
|
|
173
173
|
])
|
|
174
174
|
]),
|
|
175
175
|
_: 2
|
|
@@ -178,7 +178,7 @@ const Be = {
|
|
|
178
178
|
_: 3
|
|
179
179
|
}, 16, ["bordered", "colon", "column", "layout", "size"]));
|
|
180
180
|
}
|
|
181
|
-
}), Pn = /* @__PURE__ */
|
|
181
|
+
}), Pn = /* @__PURE__ */ ue(no, [["__scopeId", "data-v-91a3a5f3"]]), ao = ["aria-expanded", "role", "tabindex"], lo = /* @__PURE__ */ oe({
|
|
182
182
|
inheritAttrs: !1,
|
|
183
183
|
name: "YeeEllipsisText",
|
|
184
184
|
__name: "YeeEllipsisText",
|
|
@@ -198,82 +198,82 @@ const Be = {
|
|
|
198
198
|
},
|
|
199
199
|
emits: ["expandChange"],
|
|
200
200
|
setup(o, { emit: t }) {
|
|
201
|
-
const e = o, n = t,
|
|
202
|
-
const
|
|
203
|
-
return !
|
|
201
|
+
const e = o, n = t, v = Oe(Ne, void 0), x = xe("text"), p = R(!1), m = R(!1), C = R(0), b = u(() => Number.isFinite(e.line) ? Math.max(1, Math.floor(e.line)) : 1), T = u(() => Number.isFinite(e.ellipsisThreshold) ? Math.max(0, e.ellipsisThreshold) : 3), B = u(() => typeof e.maxWidth == "number" ? `${e.maxWidth}px` : e.maxWidth), k = u(() => {
|
|
202
|
+
const $ = { maxWidth: B.value };
|
|
203
|
+
return !m.value && b.value > 1 && ($.webkitLineClamp = b.value), $;
|
|
204
204
|
}), c = u(() => ({
|
|
205
205
|
"yee-ui-ellipsis-text--expandable": e.expand,
|
|
206
|
-
"yee-ui-ellipsis-text--expanded":
|
|
207
|
-
"yee-ui-ellipsis-text--multi-line": !
|
|
208
|
-
"yee-ui-ellipsis-text--single-line": !
|
|
209
|
-
})),
|
|
210
|
-
const
|
|
211
|
-
return
|
|
206
|
+
"yee-ui-ellipsis-text--expanded": m.value,
|
|
207
|
+
"yee-ui-ellipsis-text--multi-line": !m.value && b.value > 1,
|
|
208
|
+
"yee-ui-ellipsis-text--single-line": !m.value && b.value === 1
|
|
209
|
+
})), w = u(() => e.tooltipMaxWidth !== void 0 ? e.tooltipMaxWidth : C.value > 0 ? C.value + 24 : void 0), N = u(() => {
|
|
210
|
+
const $ = {};
|
|
211
|
+
return w.value !== void 0 && ($.maxWidth = `${w.value}px`), $;
|
|
212
212
|
}), P = u(() => {
|
|
213
|
-
const
|
|
213
|
+
const $ = {
|
|
214
214
|
...e.tooltipOverlayStyle,
|
|
215
215
|
backgroundColor: I.value,
|
|
216
|
-
color: e.tooltipColor ||
|
|
217
|
-
fontSize: e.tooltipFontSize === void 0 ?
|
|
216
|
+
color: e.tooltipColor || v?.value.tokens.popoverForeground || "var(--yee-popover-foreground)",
|
|
217
|
+
fontSize: e.tooltipFontSize === void 0 ? v ? `${v.value.tokens.fontSize}px` : "var(--yee-font-size)" : `${e.tooltipFontSize}px`
|
|
218
218
|
};
|
|
219
|
-
return
|
|
220
|
-
}), I = u(() => e.tooltipBackgroundColor ||
|
|
219
|
+
return w.value !== void 0 && ($.maxWidth = `${w.value}px`), $;
|
|
220
|
+
}), I = u(() => e.tooltipBackgroundColor || v?.value.tokens.popover || "var(--yee-popover)"), f = u(() => e.tooltip && !m.value && (!e.tooltipWhenEllipsis || p.value)), d = u(() => f.value ? {} : { open: !1 });
|
|
221
221
|
let l;
|
|
222
|
-
function
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
227
|
-
|
|
222
|
+
function O() {
|
|
223
|
+
const $ = x.value;
|
|
224
|
+
if (!$) return;
|
|
225
|
+
const L = $.getBoundingClientRect().width || $.clientWidth;
|
|
226
|
+
if (C.value = Math.ceil(L), !e.tooltipWhenEllipsis || m.value || !$.textContent?.trim()) {
|
|
227
|
+
p.value = !1;
|
|
228
228
|
return;
|
|
229
229
|
}
|
|
230
|
-
const
|
|
231
|
-
|
|
230
|
+
const K = b.value === 1 ? $.scrollWidth - $.clientWidth : $.scrollHeight - $.clientHeight;
|
|
231
|
+
p.value = K > T.value;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
e.expand && (
|
|
233
|
+
function H() {
|
|
234
|
+
e.expand && (m.value = !m.value, n("expandChange", m.value), Te(O));
|
|
235
235
|
}
|
|
236
|
-
function Y(
|
|
237
|
-
!e.expand ||
|
|
236
|
+
function Y($) {
|
|
237
|
+
!e.expand || $.key !== "Enter" && $.key !== " " || ($.preventDefault(), H());
|
|
238
238
|
}
|
|
239
239
|
return Re(() => {
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
}), vt(
|
|
243
|
-
|
|
240
|
+
const $ = x.value;
|
|
241
|
+
$ && typeof ResizeObserver < "u" && (l = new ResizeObserver(O), l.observe($)), O();
|
|
242
|
+
}), vt(O), ke(() => e.expand, ($) => {
|
|
243
|
+
$ || (m.value = !1);
|
|
244
244
|
}), Ce(() => {
|
|
245
245
|
l?.disconnect(), l = void 0;
|
|
246
|
-
}), (
|
|
246
|
+
}), ($, L) => (a(), M(s(re), Z(d.value, {
|
|
247
247
|
color: I.value,
|
|
248
248
|
"overlay-inner-style": P.value,
|
|
249
249
|
"overlay-style": N.value,
|
|
250
250
|
placement: e.placement
|
|
251
251
|
}), {
|
|
252
|
-
title:
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
title: S(() => [
|
|
253
|
+
U($.$slots, "tooltip", {}, () => [
|
|
254
|
+
U($.$slots, "default", {}, void 0, !0)
|
|
255
255
|
], !0)
|
|
256
256
|
]),
|
|
257
|
-
default:
|
|
258
|
-
|
|
259
|
-
"aria-expanded": e.expand ?
|
|
257
|
+
default: S(() => [
|
|
258
|
+
E("div", Z({ ref: "text" }, $.$attrs, {
|
|
259
|
+
"aria-expanded": e.expand ? m.value : void 0,
|
|
260
260
|
class: ["yee-ui-ellipsis-text", c.value],
|
|
261
261
|
role: e.expand ? "button" : void 0,
|
|
262
|
-
style:
|
|
262
|
+
style: k.value,
|
|
263
263
|
tabindex: e.expand ? 0 : void 0,
|
|
264
|
-
onClick:
|
|
264
|
+
onClick: H,
|
|
265
265
|
onKeydown: Y
|
|
266
266
|
}), [
|
|
267
|
-
|
|
267
|
+
U($.$slots, "default", {}, void 0, !0)
|
|
268
268
|
], 16, ao)
|
|
269
269
|
]),
|
|
270
270
|
_: 3
|
|
271
271
|
}, 16, ["color", "overlay-inner-style", "overlay-style", "placement"]));
|
|
272
272
|
}
|
|
273
|
-
}), Hn = /* @__PURE__ */
|
|
273
|
+
}), Hn = /* @__PURE__ */ ue(lo, [["__scopeId", "data-v-ce34466f"]]), io = { class: "yee-ui-file-upload" }, so = {
|
|
274
274
|
key: 1,
|
|
275
275
|
class: "yee-ui-file-upload__empty"
|
|
276
|
-
}, ro = /* @__PURE__ */
|
|
276
|
+
}, ro = /* @__PURE__ */ oe({
|
|
277
277
|
name: "YeeFileUpload",
|
|
278
278
|
__name: "YeeFileUpload",
|
|
279
279
|
props: {
|
|
@@ -291,150 +291,150 @@ const Be = {
|
|
|
291
291
|
},
|
|
292
292
|
emits: ["fileRemoved", "fileSelect", "update:fileList", "uploadSuccess", "uploadingChange"],
|
|
293
293
|
setup(o, { expose: t, emit: e }) {
|
|
294
|
-
const n = o,
|
|
295
|
-
height:
|
|
296
|
-
width:
|
|
294
|
+
const n = o, v = e, x = mt([]), p = R(!1), m = R(""), C = u(() => n.fileList ?? []), b = u(() => n.height ?? 100), T = u(() => n.manual ?? !1), B = u(() => n.maxCount ?? 10), k = u(() => n.maxSize ?? 20), c = u(() => n.multiple ?? !1), w = u(() => n.readonly ?? !1), N = u(() => n.uploadText ?? "上传文件"), P = u(() => n.width ?? 100), I = u(() => ({
|
|
295
|
+
height: d(b.value),
|
|
296
|
+
width: d(P.value)
|
|
297
297
|
})), f = u(() => x.value.some((r) => r.status === "uploading"));
|
|
298
298
|
ke(
|
|
299
|
-
|
|
299
|
+
C,
|
|
300
300
|
(r) => {
|
|
301
301
|
x.value = r.map((y) => ({ ...y }));
|
|
302
302
|
},
|
|
303
303
|
{ immediate: !0 }
|
|
304
|
-
), ke(f, (r) =>
|
|
305
|
-
function
|
|
304
|
+
), ke(f, (r) => v("uploadingChange", r), { immediate: !0 });
|
|
305
|
+
function d(r) {
|
|
306
306
|
return typeof r == "number" ? `${r}px` : r;
|
|
307
307
|
}
|
|
308
308
|
function l() {
|
|
309
|
-
|
|
309
|
+
v("update:fileList", x.value.map((r) => ({ ...r })));
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function O(r) {
|
|
312
312
|
return r < 1024 ? `${r}B` : r < 1024 * 1024 ? `${(r / 1024).toFixed(2)}KB` : `${(r / (1024 * 1024)).toFixed(2)}MB`;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
return r.size <=
|
|
314
|
+
function H(r) {
|
|
315
|
+
return r.size <= k.value * 1024 * 1024 ? !1 : (Be.error(`文件大小不能超过 ${k.value}MB,当前为 ${O(r.size)}`), !0);
|
|
316
316
|
}
|
|
317
317
|
function Y(r) {
|
|
318
318
|
return r.type?.startsWith("image/") ?? /\.(avif|gif|jpe?g|png|svg|webp)(\?.*)?$/i.test(r.url ?? "");
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function $(r) {
|
|
321
321
|
if (r.url) {
|
|
322
322
|
if (Y(r)) {
|
|
323
|
-
|
|
323
|
+
m.value = r.url, p.value = !0;
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
326
|
window.open(r.url, "_blank", "noopener,noreferrer");
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
|
|
329
|
+
function L(r) {
|
|
330
|
+
p.value = r;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
r.status = "done", r.percent = 100, y?.name && (r.name = y.name), y?.url && (r.url = y.url), l(),
|
|
332
|
+
function K(r, y, A) {
|
|
333
|
+
r.status = "done", r.percent = 100, y?.name && (r.name = y.name), y?.url && (r.url = y.url), l(), A(y), v("uploadSuccess");
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
r.status = "error", l(),
|
|
335
|
+
function F(r, y, A) {
|
|
336
|
+
r.status = "error", l(), A(y);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Q(r, y, A, ce) {
|
|
339
339
|
const le = x.value.find((J) => J.uid === y);
|
|
340
340
|
if (!le) return;
|
|
341
341
|
if (le.status = "uploading", le.percent = 0, l(), !n.customRequest) {
|
|
342
342
|
const J = new Error("未配置 customRequest");
|
|
343
|
-
Be.error(J.message),
|
|
343
|
+
Be.error(J.message), F(le, J, ce);
|
|
344
344
|
return;
|
|
345
345
|
}
|
|
346
346
|
let we = !1;
|
|
347
|
-
const
|
|
347
|
+
const $e = {
|
|
348
348
|
file: r,
|
|
349
349
|
onError: (J) => {
|
|
350
|
-
we || (we = !0,
|
|
350
|
+
we || (we = !0, F(le, J, ce));
|
|
351
351
|
},
|
|
352
352
|
onProgress: (J) => {
|
|
353
353
|
we || (le.percent = Math.min(100, Math.max(0, J)), l());
|
|
354
354
|
},
|
|
355
355
|
onSuccess: (J) => {
|
|
356
|
-
we || (we = !0,
|
|
356
|
+
we || (we = !0, K(le, J, A));
|
|
357
357
|
},
|
|
358
358
|
uid: y
|
|
359
359
|
};
|
|
360
360
|
try {
|
|
361
|
-
Promise.resolve(n.customRequest(
|
|
362
|
-
|
|
361
|
+
Promise.resolve(n.customRequest($e)).catch((J) => {
|
|
362
|
+
$e.onError(J instanceof Error ? J : new Error("上传失败"));
|
|
363
363
|
});
|
|
364
364
|
} catch (J) {
|
|
365
|
-
|
|
365
|
+
$e.onError(J instanceof Error ? J : new Error("上传失败"));
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
const
|
|
369
|
-
function
|
|
368
|
+
const ne = (r) => H(r) || T.value ? !1 : n.customRequest ? !0 : (Be.error("未配置 customRequest"), !1);
|
|
369
|
+
function ae(r) {
|
|
370
370
|
const y = r.file instanceof File ? r.file : void 0;
|
|
371
|
-
if (!y ||
|
|
371
|
+
if (!y || H(y)) {
|
|
372
372
|
r.onError?.(new Error("文件大小超过限制"));
|
|
373
373
|
return;
|
|
374
374
|
}
|
|
375
|
-
const
|
|
376
|
-
|
|
375
|
+
const A = y.uid ?? String(Date.now());
|
|
376
|
+
Q(y, A, r.onSuccess ?? (() => {
|
|
377
377
|
}), r.onError ?? (() => {
|
|
378
378
|
}));
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
if (x.value = r.fileList.map((
|
|
380
|
+
function fe(r) {
|
|
381
|
+
if (x.value = r.fileList.map((A) => ({ ...A })), l(), !T.value) return;
|
|
382
382
|
const y = x.value.at(-1);
|
|
383
|
-
y?.originFileObj instanceof File &&
|
|
383
|
+
y?.originFileObj instanceof File && v("fileSelect", { file: y.originFileObj, uid: y.uid });
|
|
384
384
|
}
|
|
385
385
|
function ge(r) {
|
|
386
|
-
|
|
386
|
+
v("fileRemoved", r);
|
|
387
387
|
}
|
|
388
388
|
function be(r, y) {
|
|
389
|
-
const
|
|
390
|
-
|
|
389
|
+
const A = x.value.find((ce) => ce.uid === r);
|
|
390
|
+
A && K(A, y, () => {
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
393
|
function Fe(r) {
|
|
394
|
-
const y = x.value.find((
|
|
395
|
-
y &&
|
|
394
|
+
const y = x.value.find((A) => A.uid === r);
|
|
395
|
+
y && F(y, new Error("上传失败"), () => {
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function G() {
|
|
399
399
|
return x.value.flatMap((r) => r.originFileObj instanceof File ? [r.originFileObj] : []);
|
|
400
400
|
}
|
|
401
|
-
return t({ addError: Fe, addResult: be, getFiles:
|
|
402
|
-
!
|
|
403
|
-
"before-upload":
|
|
404
|
-
"custom-request":
|
|
401
|
+
return t({ addError: Fe, addResult: be, getFiles: G }), (r, y) => (a(), h("div", io, [
|
|
402
|
+
!w.value || x.value.length > 0 ? (a(), M(s(kt), Z({ key: 0 }, o.accept ? { accept: o.accept } : {}, {
|
|
403
|
+
"before-upload": ne,
|
|
404
|
+
"custom-request": ae,
|
|
405
405
|
"file-list": x.value,
|
|
406
406
|
"max-count": B.value,
|
|
407
407
|
multiple: c.value,
|
|
408
|
-
"show-upload-list": { showRemoveIcon: !
|
|
408
|
+
"show-upload-list": { showRemoveIcon: !w.value },
|
|
409
409
|
"list-type": "picture-card",
|
|
410
|
-
onChange:
|
|
411
|
-
onPreview:
|
|
410
|
+
onChange: fe,
|
|
411
|
+
onPreview: $,
|
|
412
412
|
onRemove: ge
|
|
413
413
|
}), {
|
|
414
|
-
default:
|
|
415
|
-
!
|
|
414
|
+
default: S(() => [
|
|
415
|
+
!w.value && x.value.length < B.value ? (a(), h("div", {
|
|
416
416
|
key: 0,
|
|
417
417
|
class: "yee-ui-file-upload__trigger",
|
|
418
418
|
style: he(I.value)
|
|
419
419
|
}, [
|
|
420
|
-
y[0] || (y[0] =
|
|
420
|
+
y[0] || (y[0] = E("span", {
|
|
421
421
|
class: "yee-ui-file-upload__trigger-sign",
|
|
422
422
|
"aria-hidden": "true"
|
|
423
423
|
}, "+", -1)),
|
|
424
|
-
|
|
424
|
+
E("span", null, D(N.value), 1)
|
|
425
425
|
], 4)) : z("", !0)
|
|
426
426
|
]),
|
|
427
427
|
_: 1
|
|
428
428
|
}, 16, ["file-list", "max-count", "multiple", "show-upload-list"])) : (a(), h("span", so, "暂无文件")),
|
|
429
|
-
|
|
429
|
+
m.value ? (a(), M(s(Ct), {
|
|
430
430
|
key: 2,
|
|
431
431
|
class: "yee-ui-file-upload__preview",
|
|
432
|
-
preview: { visible:
|
|
433
|
-
src:
|
|
432
|
+
preview: { visible: p.value, onVisibleChange: L },
|
|
433
|
+
src: m.value
|
|
434
434
|
}, null, 8, ["preview", "src"])) : z("", !0)
|
|
435
435
|
]));
|
|
436
436
|
}
|
|
437
|
-
}), Ln = /* @__PURE__ */
|
|
437
|
+
}), Ln = /* @__PURE__ */ ue(ro, [["__scopeId", "data-v-43728986"]]), Ge = {
|
|
438
438
|
aac: "audio",
|
|
439
439
|
avif: "image",
|
|
440
440
|
bmp: "image",
|
|
@@ -511,8 +511,8 @@ function Ae(o) {
|
|
|
511
511
|
function po(o, t, e) {
|
|
512
512
|
const n = Ae(e);
|
|
513
513
|
if (n) return n;
|
|
514
|
-
const
|
|
515
|
-
return
|
|
514
|
+
const v = typeof File < "u" && o instanceof File || typeof Blob < "u" && o instanceof Blob ? Ae(o.type) : void 0;
|
|
515
|
+
return v || (Ae(fo(t || at(o))) ?? "unsupported");
|
|
516
516
|
}
|
|
517
517
|
function vo(o) {
|
|
518
518
|
return typeof Blob < "u" && o instanceof Blob || o instanceof ArrayBuffer;
|
|
@@ -522,29 +522,29 @@ function Ke(o) {
|
|
|
522
522
|
}
|
|
523
523
|
const mo = 50 * 1024 * 1024, yo = 200, ho = 50;
|
|
524
524
|
function go(o, t, e) {
|
|
525
|
-
const n =
|
|
526
|
-
function
|
|
525
|
+
const n = R("idle"), v = R(""), x = R(""), p = R(""), m = R(""), C = R(""), b = R([]), T = R([]), B = R(""), k = R(""), c = R(!1), w = R({ kind: "unsupported", fileName: "" }), N = R(), P = R(0), I = R(), f = u(() => o.source ?? o.url), d = u(() => String(o.fileName ?? "").trim() || at(f.value) || "未命名文件"), l = u(() => w.value.kind), O = u(() => n.value === "loading"), H = u(() => n.value === "ready"), Y = u(() => n.value === "error"), $ = u(() => n.value === "unsupported");
|
|
526
|
+
function L() {
|
|
527
527
|
N.value && (URL.revokeObjectURL(N.value), N.value = void 0);
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function K() {
|
|
530
530
|
I.value?.abort(), I.value = void 0;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
|
|
532
|
+
function F() {
|
|
533
|
+
K(), L(), n.value = "idle", v.value = "", x.value = "", p.value = "", m.value = "", C.value = "", b.value = [], T.value = [], B.value = "", k.value = "", c.value = !1, w.value = { kind: "unsupported", fileName: d.value };
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
const
|
|
537
|
-
return N.value =
|
|
535
|
+
function Q(i) {
|
|
536
|
+
const g = URL.createObjectURL(Ke(i));
|
|
537
|
+
return N.value = g, g;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function ne() {
|
|
540
540
|
const i = f.value;
|
|
541
|
-
return typeof i == "string" ? i.trim() : vo(i) ?
|
|
541
|
+
return typeof i == "string" ? i.trim() : vo(i) ? Q(i) : "";
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function ae() {
|
|
544
544
|
const i = Number(o.maxFileSize);
|
|
545
545
|
return Number.isFinite(i) && i > 0 ? i : mo;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function fe() {
|
|
548
548
|
const i = Number(o.maxRows);
|
|
549
549
|
return Number.isFinite(i) && i > 0 ? Math.floor(i) : yo;
|
|
550
550
|
}
|
|
@@ -553,89 +553,89 @@ function go(o, t, e) {
|
|
|
553
553
|
return Number.isFinite(i) && i > 0 ? Math.floor(i) : ho;
|
|
554
554
|
}
|
|
555
555
|
function be(i) {
|
|
556
|
-
if (i >
|
|
557
|
-
throw new Error(`文件超过 ${Math.round(
|
|
556
|
+
if (i > ae())
|
|
557
|
+
throw new Error(`文件超过 ${Math.round(ae() / 1024 / 1024)}MB 限制`);
|
|
558
558
|
}
|
|
559
559
|
function Fe() {
|
|
560
|
-
|
|
560
|
+
K(), P.value += 1;
|
|
561
561
|
const i = typeof AbortController == "function" ? new AbortController() : void 0;
|
|
562
562
|
return I.value = i, { token: P.value, signal: i?.signal };
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function G(i) {
|
|
565
565
|
return i === P.value;
|
|
566
566
|
}
|
|
567
567
|
async function r(i) {
|
|
568
568
|
if (!i.ok) throw new Error(`文件加载失败(${i.status})`);
|
|
569
|
-
const
|
|
570
|
-
Number.isFinite(
|
|
569
|
+
const g = Number(i.headers.get("content-length"));
|
|
570
|
+
Number.isFinite(g) && be(g);
|
|
571
571
|
const _ = await i.arrayBuffer();
|
|
572
572
|
return be(_.byteLength), _;
|
|
573
573
|
}
|
|
574
574
|
async function y(i) {
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
const
|
|
578
|
-
return be(
|
|
575
|
+
const g = f.value;
|
|
576
|
+
if (g instanceof Blob || g instanceof ArrayBuffer) {
|
|
577
|
+
const j = Ke(g);
|
|
578
|
+
return be(j.size), j.arrayBuffer();
|
|
579
579
|
}
|
|
580
|
-
const _ = typeof
|
|
580
|
+
const _ = typeof g == "string" ? g.trim() : "";
|
|
581
581
|
if (!_) throw new Error("未提供文件地址或文件内容");
|
|
582
582
|
const V = {};
|
|
583
583
|
return i && (V.signal = i), r(await fetch(_, V));
|
|
584
584
|
}
|
|
585
|
-
async function
|
|
586
|
-
const
|
|
587
|
-
return new TextDecoder().decode(
|
|
585
|
+
async function A(i) {
|
|
586
|
+
const g = await y(i);
|
|
587
|
+
return new TextDecoder().decode(g).replace(/^\uFEFF/, "");
|
|
588
588
|
}
|
|
589
|
-
async function
|
|
590
|
-
const
|
|
591
|
-
return (typeof
|
|
589
|
+
async function ce(i) {
|
|
590
|
+
const g = await import("./purify.es-HJ4qIUVZ.js");
|
|
591
|
+
return (typeof g.default == "function" ? g.default(typeof window > "u" ? void 0 : window) : g.default).sanitize(i);
|
|
592
592
|
}
|
|
593
593
|
async function le(i) {
|
|
594
|
-
const
|
|
594
|
+
const g = await A(i), [_, V] = await Promise.all([
|
|
595
595
|
import("./marked.esm-DaHdfxOj.js"),
|
|
596
596
|
import("./purify.es-HJ4qIUVZ.js")
|
|
597
|
-
]),
|
|
598
|
-
|
|
597
|
+
]), j = _.marked.parse(g, { breaks: !0, gfm: !0 }), q = typeof V.default == "function" ? V.default(typeof window > "u" ? void 0 : window) : V.default;
|
|
598
|
+
p.value = q.sanitize(j);
|
|
599
599
|
}
|
|
600
600
|
async function we(i) {
|
|
601
|
-
|
|
601
|
+
m.value = await ce(await A(i));
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
let
|
|
603
|
+
function $e(i) {
|
|
604
|
+
let g = "";
|
|
605
605
|
for (let V = 0; V < i.length; V += 32768)
|
|
606
|
-
|
|
607
|
-
return btoa(
|
|
606
|
+
g += String.fromCharCode(...i.subarray(V, V + 32768));
|
|
607
|
+
return btoa(g);
|
|
608
608
|
}
|
|
609
609
|
function J(i) {
|
|
610
|
-
let
|
|
610
|
+
let g;
|
|
611
611
|
if (typeof i.content == "string")
|
|
612
|
-
|
|
612
|
+
g = i.encoding === "base64" ? i.content.replace(/\s/g, "") : $e(new TextEncoder().encode(i.content));
|
|
613
613
|
else {
|
|
614
614
|
const _ = i.content instanceof Uint8Array ? i.content : new Uint8Array(i.content);
|
|
615
|
-
|
|
615
|
+
g = $e(_);
|
|
616
616
|
}
|
|
617
|
-
return `data:${i.mimeType || "application/octet-stream"};base64,${
|
|
617
|
+
return `data:${i.mimeType || "application/octet-stream"};base64,${g}`;
|
|
618
618
|
}
|
|
619
619
|
function Pe(i) {
|
|
620
|
-
const
|
|
620
|
+
const g = i.trim().replace(/^cid:/i, "").replace(/^<|>$/g, "");
|
|
621
621
|
try {
|
|
622
|
-
return decodeURIComponent(
|
|
622
|
+
return decodeURIComponent(g).toLowerCase();
|
|
623
623
|
} catch {
|
|
624
|
-
return
|
|
624
|
+
return g.toLowerCase();
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
function st(i,
|
|
627
|
+
function st(i, g) {
|
|
628
628
|
const _ = /* @__PURE__ */ new Map();
|
|
629
|
-
for (const
|
|
630
|
-
if (!/^image\//i.test(
|
|
631
|
-
const q = J(
|
|
632
|
-
|
|
629
|
+
for (const j of g) {
|
|
630
|
+
if (!/^image\//i.test(j.mimeType)) continue;
|
|
631
|
+
const q = J(j);
|
|
632
|
+
j.contentId && _.set(Pe(j.contentId), q), j.filename && _.set(Pe(j.filename), q);
|
|
633
633
|
}
|
|
634
634
|
if (!_.size || typeof DOMParser > "u") return i;
|
|
635
635
|
const V = new DOMParser().parseFromString(i, "text/html");
|
|
636
|
-
return V.querySelectorAll("[src]").forEach((
|
|
637
|
-
const q =
|
|
638
|
-
X &&
|
|
636
|
+
return V.querySelectorAll("[src]").forEach((j) => {
|
|
637
|
+
const q = j.getAttribute("src") ?? "", W = Pe(/^cid:/i.test(q) ? q.slice(4) : q), X = _.get(W);
|
|
638
|
+
X && j.setAttribute("src", X);
|
|
639
639
|
}), V.body.innerHTML;
|
|
640
640
|
}
|
|
641
641
|
function rt(i) {
|
|
@@ -646,26 +646,26 @@ function go(o, t, e) {
|
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
648
|
function ut(i) {
|
|
649
|
-
const
|
|
650
|
-
let W = [], X = "",
|
|
651
|
-
for (let
|
|
652
|
-
const pe =
|
|
653
|
-
pe === '"' ?
|
|
654
|
-
` || pe === "\r") && !
|
|
655
|
-
` && (
|
|
649
|
+
const g = i.replace(/^\uFEFF/, ""), _ = g.split(/\r?\n/, 1)[0] ?? "", j = [" ", ",", ";"].map((ee) => ({ candidate: ee, count: _.split(ee).length - 1 })).sort((ee, pe) => pe.count - ee.count)[0]?.candidate ?? ",", q = [];
|
|
650
|
+
let W = [], X = "", de = !1;
|
|
651
|
+
for (let ee = 0; ee < g.length; ee += 1) {
|
|
652
|
+
const pe = g[ee], We = g[ee + 1];
|
|
653
|
+
pe === '"' ? de && We === '"' ? (X += '"', ee += 1) : de = !de : pe === j && !de ? (W.push(X), X = "") : (pe === `
|
|
654
|
+
` || pe === "\r") && !de ? (pe === "\r" && We === `
|
|
655
|
+
` && (ee += 1), W.push(X), q.push(W), W = [], X = "") : X += pe;
|
|
656
656
|
}
|
|
657
657
|
return (X || W.length) && (W.push(X), q.push(W)), q;
|
|
658
658
|
}
|
|
659
659
|
async function ct(i) {
|
|
660
|
-
const
|
|
661
|
-
if (!
|
|
662
|
-
const q =
|
|
660
|
+
const g = await import("./xlsx-CF422ARu.js"), _ = g.read(await y(i), { type: "array" }), V = _.SheetNames[0], j = V ? _.Sheets[V] : void 0;
|
|
661
|
+
if (!j) throw new Error("Excel 文件没有可展示的工作表");
|
|
662
|
+
const q = g.utils.sheet_to_json(j, {
|
|
663
663
|
defval: "",
|
|
664
664
|
header: 1,
|
|
665
665
|
raw: !1
|
|
666
|
-
}), W =
|
|
667
|
-
c.value = q.length > W || q.some((
|
|
668
|
-
cells:
|
|
666
|
+
}), W = fe(), X = ge();
|
|
667
|
+
c.value = q.length > W || q.some((de) => de.length > X), b.value = q.slice(0, W).map((de) => ({
|
|
668
|
+
cells: de.slice(0, X).map((ee) => String(ee ?? ""))
|
|
669
669
|
}));
|
|
670
670
|
}
|
|
671
671
|
async function dt(i) {
|
|
@@ -680,38 +680,38 @@ function go(o, t, e) {
|
|
|
680
680
|
{ label: "收件人", value: V(_.to) || "-" },
|
|
681
681
|
{ label: "主题", value: _.subject || "-" },
|
|
682
682
|
{ label: "时间", value: _.date || "-" }
|
|
683
|
-
],
|
|
684
|
-
const
|
|
685
|
-
B.value = q ? st(q,
|
|
683
|
+
], k.value = _.text || "";
|
|
684
|
+
const j = _.attachments, q = _.html ? await ce(_.html) : "";
|
|
685
|
+
B.value = q ? st(q, j) : "";
|
|
686
686
|
}
|
|
687
|
-
async function ft(i,
|
|
688
|
-
if (await Te(), !
|
|
687
|
+
async function ft(i, g) {
|
|
688
|
+
if (await Te(), !G(i)) return;
|
|
689
689
|
const _ = t.docxContainer.value;
|
|
690
690
|
if (!_) throw new Error("DOCX 预览容器未就绪");
|
|
691
|
-
const V = await import("./docx-preview.min-lCFRKxYn.js").then((
|
|
692
|
-
_.replaceChildren(), await V.renderAsync(await y(
|
|
691
|
+
const V = await import("./docx-preview.min-lCFRKxYn.js").then((j) => j.d);
|
|
692
|
+
_.replaceChildren(), await V.renderAsync(await y(g), _, void 0, {
|
|
693
693
|
breakPages: !0,
|
|
694
694
|
ignoreWidth: !1,
|
|
695
695
|
inWrapper: !0
|
|
696
696
|
});
|
|
697
697
|
}
|
|
698
|
-
async function pt(i,
|
|
699
|
-
if (i === "text" && (
|
|
700
|
-
const V = ut(await
|
|
701
|
-
c.value = V.length >
|
|
698
|
+
async function pt(i, g, _) {
|
|
699
|
+
if (i === "text" && (C.value = await A(_)), i === "json" && (C.value = rt(await A(_))), i === "xml" && (C.value = await A(_)), i === "csv") {
|
|
700
|
+
const V = ut(await A(_)), j = fe(), q = ge();
|
|
701
|
+
c.value = V.length > j || V.some((W) => W.length > q), b.value = V.slice(0, j).map((W) => ({
|
|
702
702
|
cells: W.slice(0, q)
|
|
703
703
|
}));
|
|
704
704
|
}
|
|
705
|
-
i === "markdown" && await le(_), i === "html" && await we(_), i === "spreadsheet" && await ct(_), i === "eml" && await dt(_), i === "docx" && await ft(
|
|
705
|
+
i === "markdown" && await le(_), i === "html" && await we(_), i === "spreadsheet" && await ct(_), i === "eml" && await dt(_), i === "docx" && await ft(g, _);
|
|
706
706
|
}
|
|
707
707
|
async function Ye() {
|
|
708
|
-
|
|
708
|
+
F();
|
|
709
709
|
const i = f.value;
|
|
710
710
|
if (i === void 0 || i === "") return;
|
|
711
|
-
const
|
|
712
|
-
if (
|
|
711
|
+
const g = po(i, o.fileName, o.fileType);
|
|
712
|
+
if (w.value = { kind: g, fileName: d.value }, x.value = ne(), g === "unsupported") {
|
|
713
713
|
n.value = "unsupported", e("unsupported", {
|
|
714
|
-
kind:
|
|
714
|
+
kind: g,
|
|
715
715
|
message: "该文件类型暂不支持在线预览"
|
|
716
716
|
});
|
|
717
717
|
return;
|
|
@@ -719,16 +719,16 @@ function go(o, t, e) {
|
|
|
719
719
|
const _ = Fe();
|
|
720
720
|
n.value = "loading";
|
|
721
721
|
try {
|
|
722
|
-
if (["image", "pdf", "video", "audio"].includes(
|
|
722
|
+
if (["image", "pdf", "video", "audio"].includes(g))
|
|
723
723
|
n.value = "ready";
|
|
724
724
|
else {
|
|
725
|
-
if (await pt(
|
|
725
|
+
if (await pt(g, _.token, _.signal), !G(_.token)) return;
|
|
726
726
|
n.value = "ready";
|
|
727
727
|
}
|
|
728
|
-
e("load", { kind:
|
|
728
|
+
e("load", { kind: g, fileName: d.value });
|
|
729
729
|
} catch (V) {
|
|
730
|
-
if (!
|
|
731
|
-
n.value = "error",
|
|
730
|
+
if (!G(_.token)) return;
|
|
731
|
+
n.value = "error", v.value = V instanceof Error ? V.message : "文件预览失败", e("error", { kind: g, message: v.value, cause: V });
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
return ke(
|
|
@@ -738,36 +738,36 @@ function go(o, t, e) {
|
|
|
738
738
|
},
|
|
739
739
|
{ immediate: !0 }
|
|
740
740
|
), Ce(() => {
|
|
741
|
-
P.value += 1,
|
|
741
|
+
P.value += 1, K(), L();
|
|
742
742
|
}), {
|
|
743
743
|
displayUrl: x,
|
|
744
744
|
emailHtml: B,
|
|
745
745
|
emailMeta: T,
|
|
746
|
-
emailText:
|
|
747
|
-
errorMessage:
|
|
748
|
-
fileName:
|
|
749
|
-
htmlContent:
|
|
746
|
+
emailText: k,
|
|
747
|
+
errorMessage: v,
|
|
748
|
+
fileName: d,
|
|
749
|
+
htmlContent: m,
|
|
750
750
|
isError: Y,
|
|
751
|
-
isLoading:
|
|
752
|
-
isReady:
|
|
753
|
-
isUnsupported:
|
|
751
|
+
isLoading: O,
|
|
752
|
+
isReady: H,
|
|
753
|
+
isUnsupported: $,
|
|
754
754
|
kind: l,
|
|
755
755
|
load: Ye,
|
|
756
|
-
markdownHtml:
|
|
756
|
+
markdownHtml: p,
|
|
757
757
|
status: n,
|
|
758
758
|
tableRows: b,
|
|
759
|
-
textContent:
|
|
759
|
+
textContent: C,
|
|
760
760
|
truncated: c
|
|
761
761
|
};
|
|
762
762
|
}
|
|
763
763
|
const bo = ["aria-busy"], wo = {
|
|
764
764
|
key: 0,
|
|
765
765
|
class: "yee-ui-file-preview__header"
|
|
766
|
-
}, _o = ["title"], xo = { class: "yee-ui-file-preview__header-actions" }, ko = ["aria-label", "aria-pressed"], Co = ["aria-label", "aria-busy", "disabled"],
|
|
766
|
+
}, _o = ["title"], xo = { class: "yee-ui-file-preview__header-actions" }, ko = ["aria-label", "aria-pressed"], Co = ["aria-label", "aria-busy", "disabled"], $o = {
|
|
767
767
|
key: 1,
|
|
768
768
|
class: "yee-ui-file-preview__download-error",
|
|
769
769
|
role: "alert"
|
|
770
|
-
},
|
|
770
|
+
}, So = {
|
|
771
771
|
key: 2,
|
|
772
772
|
class: "yee-ui-file-preview__empty"
|
|
773
773
|
}, To = {
|
|
@@ -800,10 +800,10 @@ const bo = ["aria-busy"], wo = {
|
|
|
800
800
|
}, jo = {
|
|
801
801
|
key: 0,
|
|
802
802
|
class: "yee-ui-file-preview__email-meta"
|
|
803
|
-
},
|
|
803
|
+
}, Do = ["srcdoc", "title"], Io = {
|
|
804
804
|
key: 2,
|
|
805
805
|
class: "yee-ui-file-preview__text"
|
|
806
|
-
}, Yo = /* @__PURE__ */
|
|
806
|
+
}, Yo = /* @__PURE__ */ oe({
|
|
807
807
|
name: "YeeFilePreview",
|
|
808
808
|
__name: "YeeFilePreview",
|
|
809
809
|
props: {
|
|
@@ -821,68 +821,68 @@ const bo = ["aria-busy"], wo = {
|
|
|
821
821
|
},
|
|
822
822
|
emits: ["load", "error", "unsupported", "download"],
|
|
823
823
|
setup(o, { emit: t }) {
|
|
824
|
-
const e = o, n = t,
|
|
824
|
+
const e = o, n = t, v = xe("previewContainer"), x = xe("docxContainer"), p = R(!1), m = R(""), C = R(!1), {
|
|
825
825
|
displayUrl: b,
|
|
826
826
|
emailHtml: T,
|
|
827
827
|
emailMeta: B,
|
|
828
|
-
emailText:
|
|
828
|
+
emailText: k,
|
|
829
829
|
errorMessage: c,
|
|
830
|
-
fileName:
|
|
830
|
+
fileName: w,
|
|
831
831
|
htmlContent: N,
|
|
832
832
|
isError: P,
|
|
833
833
|
isLoading: I,
|
|
834
834
|
isReady: f,
|
|
835
|
-
isUnsupported:
|
|
835
|
+
isUnsupported: d,
|
|
836
836
|
kind: l,
|
|
837
|
-
markdownHtml:
|
|
838
|
-
tableRows:
|
|
837
|
+
markdownHtml: O,
|
|
838
|
+
tableRows: H,
|
|
839
839
|
textContent: Y,
|
|
840
|
-
truncated:
|
|
841
|
-
} = go(e, { docxContainer: x }, n),
|
|
840
|
+
truncated: $
|
|
841
|
+
} = go(e, { docxContainer: x }, n), L = u(() => e.height === void 0 || e.height === null || e.height === "" ? {} : {
|
|
842
842
|
height: typeof e.height == "number" ? `${e.height}px` : e.height
|
|
843
|
-
}),
|
|
843
|
+
}), K = u(() => !!b.value), F = u(() => ["image", "pdf", "video", "audio"].includes(l.value)), Q = u(() => l.value === "csv" || l.value === "spreadsheet"), ne = u(() => l.value === "eml");
|
|
844
844
|
ke(
|
|
845
845
|
() => [e.source, e.url, e.fileName, e.fileType],
|
|
846
846
|
() => {
|
|
847
|
-
|
|
847
|
+
m.value = "";
|
|
848
848
|
}
|
|
849
849
|
);
|
|
850
|
-
function
|
|
850
|
+
function ae() {
|
|
851
851
|
n("error", {
|
|
852
852
|
kind: l.value,
|
|
853
853
|
message: "文件预览失败"
|
|
854
854
|
});
|
|
855
855
|
}
|
|
856
|
-
async function
|
|
857
|
-
if (!b.value ||
|
|
858
|
-
|
|
859
|
-
let
|
|
856
|
+
async function fe() {
|
|
857
|
+
if (!b.value || C.value) return;
|
|
858
|
+
m.value = "", C.value = !0;
|
|
859
|
+
let G = b.value, r = !1;
|
|
860
860
|
try {
|
|
861
|
-
if (!/^(?:blob:|data:)/i.test(
|
|
862
|
-
const
|
|
863
|
-
if (!
|
|
864
|
-
|
|
861
|
+
if (!/^(?:blob:|data:)/i.test(G)) {
|
|
862
|
+
const A = await fetch(G);
|
|
863
|
+
if (!A.ok) throw new Error(`文件下载失败(${A.status})`);
|
|
864
|
+
G = URL.createObjectURL(await A.blob()), r = !0;
|
|
865
865
|
}
|
|
866
866
|
const y = document.createElement("a");
|
|
867
|
-
y.href =
|
|
867
|
+
y.href = G, y.download = w.value, y.rel = "noopener noreferrer", document.body.appendChild(y), y.click(), y.remove(), r && window.setTimeout(() => URL.revokeObjectURL(G), 0), n("download");
|
|
868
868
|
} catch (y) {
|
|
869
|
-
|
|
869
|
+
m.value = y instanceof Error ? y.message : "文件下载失败", n("error", {
|
|
870
870
|
kind: l.value,
|
|
871
|
-
message:
|
|
871
|
+
message: m.value,
|
|
872
872
|
cause: y
|
|
873
873
|
});
|
|
874
874
|
} finally {
|
|
875
|
-
|
|
875
|
+
C.value = !1;
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
878
|
function ge() {
|
|
879
|
-
|
|
879
|
+
p.value = document.fullscreenElement === v.value;
|
|
880
880
|
}
|
|
881
881
|
async function be() {
|
|
882
|
-
const
|
|
883
|
-
if (
|
|
882
|
+
const G = v.value;
|
|
883
|
+
if (G)
|
|
884
884
|
try {
|
|
885
|
-
document.fullscreenElement ===
|
|
885
|
+
document.fullscreenElement === G ? await document.exitFullscreen() : G.requestFullscreen ? await G.requestFullscreen() : p.value = !p.value;
|
|
886
886
|
} catch (r) {
|
|
887
887
|
n("error", {
|
|
888
888
|
kind: l.value,
|
|
@@ -891,7 +891,7 @@ const bo = ["aria-busy"], wo = {
|
|
|
891
891
|
});
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
|
-
function Fe(
|
|
894
|
+
function Fe(G) {
|
|
895
895
|
return {
|
|
896
896
|
audio: "音频",
|
|
897
897
|
csv: "CSV",
|
|
@@ -907,116 +907,116 @@ const bo = ["aria-busy"], wo = {
|
|
|
907
907
|
unsupported: "文件",
|
|
908
908
|
video: "视频",
|
|
909
909
|
xml: "XML"
|
|
910
|
-
}[
|
|
910
|
+
}[G];
|
|
911
911
|
}
|
|
912
912
|
return Re(() => {
|
|
913
913
|
document.addEventListener("fullscreenchange", ge);
|
|
914
914
|
}), Ce(() => {
|
|
915
|
-
document.removeEventListener("fullscreenchange", ge), document.fullscreenElement ===
|
|
915
|
+
document.removeEventListener("fullscreenchange", ge), document.fullscreenElement === v.value && document.exitFullscreen().catch(() => {
|
|
916
916
|
});
|
|
917
|
-
}), (
|
|
917
|
+
}), (G, r) => (a(), h("section", {
|
|
918
918
|
ref_key: "previewContainer",
|
|
919
|
-
ref:
|
|
920
|
-
class: ye([{ "yee-ui-file-preview--fullscreen":
|
|
921
|
-
style: he(
|
|
919
|
+
ref: v,
|
|
920
|
+
class: ye([{ "yee-ui-file-preview--fullscreen": p.value }, "yee-ui-file-preview"]),
|
|
921
|
+
style: he(L.value),
|
|
922
922
|
"aria-busy": s(I)
|
|
923
923
|
}, [
|
|
924
|
-
o.showHeader &&
|
|
925
|
-
|
|
924
|
+
o.showHeader && K.value ? (a(), h("header", wo, [
|
|
925
|
+
E("div", {
|
|
926
926
|
class: "yee-ui-file-preview__name",
|
|
927
|
-
title: s(
|
|
928
|
-
},
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
title:
|
|
927
|
+
title: s(w)
|
|
928
|
+
}, D(s(w)), 9, _o),
|
|
929
|
+
E("div", xo, [
|
|
930
|
+
te(s(re), {
|
|
931
|
+
title: p.value ? "退出全屏" : "进入全屏"
|
|
932
932
|
}, {
|
|
933
|
-
default:
|
|
934
|
-
|
|
935
|
-
"aria-label":
|
|
936
|
-
"aria-pressed":
|
|
933
|
+
default: S(() => [
|
|
934
|
+
E("button", {
|
|
935
|
+
"aria-label": p.value ? "退出全屏" : "进入全屏",
|
|
936
|
+
"aria-pressed": p.value,
|
|
937
937
|
class: "yee-ui-file-preview__header-action",
|
|
938
938
|
type: "button",
|
|
939
939
|
onClick: be
|
|
940
940
|
}, [
|
|
941
|
-
|
|
941
|
+
p.value ? (a(), M(s(tt), { key: 0 })) : (a(), M(s(ot), { key: 1 }))
|
|
942
942
|
], 8, ko)
|
|
943
943
|
]),
|
|
944
944
|
_: 1
|
|
945
945
|
}, 8, ["title"]),
|
|
946
|
-
o.showDownload ? (a(), M(s(
|
|
946
|
+
o.showDownload ? (a(), M(s(re), {
|
|
947
947
|
key: 0,
|
|
948
|
-
title:
|
|
948
|
+
title: C.value ? "下载中..." : "下载"
|
|
949
949
|
}, {
|
|
950
|
-
default:
|
|
951
|
-
|
|
952
|
-
"aria-label":
|
|
953
|
-
"aria-busy":
|
|
950
|
+
default: S(() => [
|
|
951
|
+
E("button", {
|
|
952
|
+
"aria-label": C.value ? "下载中" : "下载",
|
|
953
|
+
"aria-busy": C.value,
|
|
954
954
|
class: "yee-ui-file-preview__header-action",
|
|
955
|
-
disabled:
|
|
955
|
+
disabled: C.value,
|
|
956
956
|
type: "button",
|
|
957
957
|
onClick: r[0] || (r[0] = (y) => {
|
|
958
|
-
|
|
958
|
+
fe();
|
|
959
959
|
})
|
|
960
960
|
}, [
|
|
961
|
-
|
|
961
|
+
te(s(Mt))
|
|
962
962
|
], 8, Co)
|
|
963
963
|
]),
|
|
964
964
|
_: 1
|
|
965
965
|
}, 8, ["title"])) : z("", !0)
|
|
966
966
|
])
|
|
967
967
|
])) : z("", !0),
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
968
|
+
m.value ? (a(), h("div", $o, D(m.value), 1)) : z("", !0),
|
|
969
|
+
K.value ? s(I) && !F.value && s(l) !== "docx" ? (a(), h("div", To, "文件加载中...")) : s(P) ? (a(), h("div", Bo, [
|
|
970
|
+
E("span", null, D(s(c) || "文件预览失败"), 1),
|
|
971
971
|
o.showDownload ? (a(), h("button", {
|
|
972
972
|
key: 0,
|
|
973
973
|
class: "yee-ui-file-preview__retry",
|
|
974
974
|
type: "button",
|
|
975
975
|
onClick: r[1] || (r[1] = (y) => {
|
|
976
|
-
|
|
976
|
+
fe();
|
|
977
977
|
})
|
|
978
978
|
}, " 下载查看 ")) : z("", !0)
|
|
979
|
-
])) : s(
|
|
980
|
-
|
|
979
|
+
])) : s(d) ? (a(), h("div", Fo, [
|
|
980
|
+
E("span", null, "暂不支持预览 " + D(Fe(s(l))) + " 文件", 1),
|
|
981
981
|
o.showDownload ? (a(), h("button", {
|
|
982
982
|
key: 0,
|
|
983
983
|
class: "yee-ui-file-preview__retry",
|
|
984
984
|
type: "button",
|
|
985
985
|
onClick: r[2] || (r[2] = (y) => {
|
|
986
|
-
|
|
986
|
+
fe();
|
|
987
987
|
})
|
|
988
988
|
}, " 下载查看 ")) : z("", !0)
|
|
989
|
-
])) : s(f) ||
|
|
989
|
+
])) : s(f) || F.value || s(l) === "docx" ? (a(), h(_e, { key: 6 }, [
|
|
990
990
|
s(l) === "image" ? (a(), h("img", {
|
|
991
991
|
key: 0,
|
|
992
992
|
class: "yee-ui-file-preview__image",
|
|
993
993
|
src: s(b),
|
|
994
994
|
alt: o.alt,
|
|
995
|
-
onError:
|
|
995
|
+
onError: ae
|
|
996
996
|
}, null, 40, Eo)) : s(l) === "pdf" ? (a(), h("iframe", {
|
|
997
997
|
key: 1,
|
|
998
998
|
class: "yee-ui-file-preview__frame",
|
|
999
999
|
src: s(b),
|
|
1000
1000
|
title: o.alt,
|
|
1001
|
-
onError:
|
|
1001
|
+
onError: ae
|
|
1002
1002
|
}, null, 40, Ro)) : s(l) === "video" ? (a(), h("video", {
|
|
1003
1003
|
key: 2,
|
|
1004
1004
|
class: "yee-ui-file-preview__video",
|
|
1005
1005
|
src: s(b),
|
|
1006
1006
|
controls: "",
|
|
1007
1007
|
preload: "metadata",
|
|
1008
|
-
onError:
|
|
1008
|
+
onError: ae
|
|
1009
1009
|
}, " 您的浏览器不支持视频预览,请下载查看。 ", 40, Oo)) : s(l) === "audio" ? (a(), h("audio", {
|
|
1010
1010
|
key: 3,
|
|
1011
1011
|
class: "yee-ui-file-preview__audio",
|
|
1012
1012
|
src: s(b),
|
|
1013
1013
|
controls: "",
|
|
1014
1014
|
preload: "metadata",
|
|
1015
|
-
onError:
|
|
1016
|
-
}, null, 40, Mo)) : s(l) === "text" || s(l) === "json" || s(l) === "xml" ? (a(), h("pre", Vo,
|
|
1015
|
+
onError: ae
|
|
1016
|
+
}, null, 40, Mo)) : s(l) === "text" || s(l) === "json" || s(l) === "xml" ? (a(), h("pre", Vo, D(s(Y)), 1)) : s(l) === "markdown" ? (a(), h("article", {
|
|
1017
1017
|
key: 5,
|
|
1018
1018
|
class: "yee-ui-file-preview__markdown",
|
|
1019
|
-
innerHTML: s(
|
|
1019
|
+
innerHTML: s(O)
|
|
1020
1020
|
}, null, 8, zo)) : s(l) === "html" ? (a(), h("iframe", {
|
|
1021
1021
|
key: 6,
|
|
1022
1022
|
class: "yee-ui-file-preview__frame yee-ui-file-preview__frame--html",
|
|
@@ -1028,24 +1028,24 @@ const bo = ["aria-busy"], wo = {
|
|
|
1028
1028
|
ref_key: "docxContainer",
|
|
1029
1029
|
ref: x,
|
|
1030
1030
|
class: "yee-ui-file-preview__docx"
|
|
1031
|
-
}, null, 512)) :
|
|
1032
|
-
s(
|
|
1033
|
-
|
|
1034
|
-
(a(!0), h(_e, null,
|
|
1035
|
-
(a(!0), h(_e, null,
|
|
1036
|
-
key: `${
|
|
1037
|
-
},
|
|
1031
|
+
}, null, 512)) : Q.value ? (a(), h("div", Po, [
|
|
1032
|
+
s(H).length ? (a(), h("table", Ho, [
|
|
1033
|
+
E("tbody", null, [
|
|
1034
|
+
(a(!0), h(_e, null, Se(s(H), (y, A) => (a(), h("tr", { key: A }, [
|
|
1035
|
+
(a(!0), h(_e, null, Se(y.cells, (ce, le) => (a(), h("td", {
|
|
1036
|
+
key: `${A}-${le}`
|
|
1037
|
+
}, D(ce), 1))), 128))
|
|
1038
1038
|
]))), 128))
|
|
1039
1039
|
])
|
|
1040
1040
|
])) : (a(), h("div", Lo, "暂无可展示的数据")),
|
|
1041
|
-
s(
|
|
1042
|
-
])) :
|
|
1041
|
+
s($) ? (a(), h("div", Ao, "预览内容已截断,可下载查看完整文件。")) : z("", !0)
|
|
1042
|
+
])) : ne.value ? (a(), h("div", Uo, [
|
|
1043
1043
|
s(B).length ? (a(), h("dl", jo, [
|
|
1044
|
-
(a(!0), h(_e, null,
|
|
1044
|
+
(a(!0), h(_e, null, Se(s(B), (y) => (a(), h(_e, {
|
|
1045
1045
|
key: y.label
|
|
1046
1046
|
}, [
|
|
1047
|
-
|
|
1048
|
-
|
|
1047
|
+
E("dt", null, D(y.label), 1),
|
|
1048
|
+
E("dd", null, D(y.value), 1)
|
|
1049
1049
|
], 64))), 128))
|
|
1050
1050
|
])) : z("", !0),
|
|
1051
1051
|
s(T) ? (a(), h("iframe", {
|
|
@@ -1054,12 +1054,12 @@ const bo = ["aria-busy"], wo = {
|
|
|
1054
1054
|
srcdoc: s(T),
|
|
1055
1055
|
sandbox: "",
|
|
1056
1056
|
title: o.alt
|
|
1057
|
-
}, null, 8,
|
|
1057
|
+
}, null, 8, Do)) : (a(), h("pre", Io, D(s(k) || "暂无可展示的邮件正文"), 1))
|
|
1058
1058
|
])) : z("", !0)
|
|
1059
|
-
], 64)) : z("", !0) : (a(), h("div",
|
|
1059
|
+
], 64)) : z("", !0) : (a(), h("div", So, "请选择文件"))
|
|
1060
1060
|
], 14, bo));
|
|
1061
1061
|
}
|
|
1062
|
-
}), An = /* @__PURE__ */
|
|
1062
|
+
}), An = /* @__PURE__ */ ue(Yo, [["__scopeId", "data-v-2a474289"]]), Wo = { class: "yee-ui-form__fields" }, qo = { class: "yee-ui-form__label" }, Go = { class: "yee-ui-form__actions" }, Ko = /* @__PURE__ */ oe({
|
|
1063
1063
|
name: "YeeForm",
|
|
1064
1064
|
__name: "YeeForm",
|
|
1065
1065
|
props: {
|
|
@@ -1069,101 +1069,101 @@ const bo = ["aria-busy"], wo = {
|
|
|
1069
1069
|
options: {}
|
|
1070
1070
|
},
|
|
1071
1071
|
setup(o) {
|
|
1072
|
-
const t = o, e =
|
|
1072
|
+
const t = o, e = $t.RangePicker, n = R(t.options.collapsed ?? !0);
|
|
1073
1073
|
t.api.configure(t.options);
|
|
1074
|
-
const
|
|
1075
|
-
function x(
|
|
1076
|
-
return t.api.getFieldValue(
|
|
1074
|
+
const v = u(() => t.api.schema.value.filter((k) => !k.hide));
|
|
1075
|
+
function x(k) {
|
|
1076
|
+
return t.api.getFieldValue(k.fieldName);
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1079
|
-
const c = x(
|
|
1078
|
+
function p(k) {
|
|
1079
|
+
const c = x(k);
|
|
1080
1080
|
return {
|
|
1081
|
-
...
|
|
1081
|
+
...k.componentProps,
|
|
1082
1082
|
...c === void 0 ? {} : { value: c }
|
|
1083
1083
|
};
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1086
|
-
t.api.setFieldValue(
|
|
1085
|
+
function m(k, c) {
|
|
1086
|
+
t.api.setFieldValue(k.fieldName, c), t.options.submitOnChange && b();
|
|
1087
1087
|
}
|
|
1088
|
-
async function
|
|
1088
|
+
async function C() {
|
|
1089
1089
|
t.api.resetForm(), await t.onReset?.();
|
|
1090
1090
|
}
|
|
1091
1091
|
async function b() {
|
|
1092
1092
|
await t.onSubmit?.(t.api.getValues());
|
|
1093
1093
|
}
|
|
1094
|
-
function T(
|
|
1095
|
-
|
|
1094
|
+
function T(k) {
|
|
1095
|
+
k.key === "Enter" && t.options.submitOnEnter && (k.preventDefault(), b());
|
|
1096
1096
|
}
|
|
1097
1097
|
function B() {
|
|
1098
1098
|
n.value = !n.value, t.options.handleCollapsedChange?.(n.value);
|
|
1099
1099
|
}
|
|
1100
|
-
return (
|
|
1100
|
+
return (k, c) => (a(), h("form", {
|
|
1101
1101
|
class: "yee-ui-form",
|
|
1102
1102
|
onKeydown: T,
|
|
1103
1103
|
onSubmit: yt(b, ["prevent"])
|
|
1104
1104
|
}, [
|
|
1105
|
-
|
|
1106
|
-
(a(!0), h(_e, null,
|
|
1107
|
-
key:
|
|
1105
|
+
E("div", Wo, [
|
|
1106
|
+
(a(!0), h(_e, null, Se(v.value, (w) => (a(), h("label", {
|
|
1107
|
+
key: w.fieldName,
|
|
1108
1108
|
class: "yee-ui-form__field"
|
|
1109
1109
|
}, [
|
|
1110
|
-
|
|
1111
|
-
|
|
1110
|
+
E("span", qo, D(w.label), 1),
|
|
1111
|
+
w.component === "Input" ? (a(), M(s(St), Z({
|
|
1112
1112
|
key: 0,
|
|
1113
1113
|
ref_for: !0
|
|
1114
|
-
},
|
|
1115
|
-
"onUpdate:value": (N) =>
|
|
1116
|
-
}), null, 16, ["onUpdate:value"])) :
|
|
1114
|
+
}, p(w), {
|
|
1115
|
+
"onUpdate:value": (N) => m(w, N)
|
|
1116
|
+
}), null, 16, ["onUpdate:value"])) : w.component === "Select" ? (a(), M(s(Ve), Z({
|
|
1117
1117
|
key: 1,
|
|
1118
1118
|
ref_for: !0
|
|
1119
|
-
},
|
|
1120
|
-
"onUpdate:value": (N) =>
|
|
1121
|
-
}), null, 16, ["onUpdate:value"])) : (a(), M(s(e),
|
|
1119
|
+
}, p(w), {
|
|
1120
|
+
"onUpdate:value": (N) => m(w, N)
|
|
1121
|
+
}), null, 16, ["onUpdate:value"])) : (a(), M(s(e), Z({
|
|
1122
1122
|
key: 2,
|
|
1123
1123
|
ref_for: !0
|
|
1124
|
-
},
|
|
1125
|
-
"onUpdate:value": (N) =>
|
|
1124
|
+
}, p(w), {
|
|
1125
|
+
"onUpdate:value": (N) => m(w, N)
|
|
1126
1126
|
}), null, 16, ["onUpdate:value"]))
|
|
1127
1127
|
]))), 128))
|
|
1128
1128
|
]),
|
|
1129
|
-
|
|
1130
|
-
|
|
1129
|
+
E("div", Go, [
|
|
1130
|
+
te(s(se), {
|
|
1131
1131
|
"html-type": "button",
|
|
1132
|
-
onClick:
|
|
1132
|
+
onClick: C
|
|
1133
1133
|
}, {
|
|
1134
|
-
default:
|
|
1134
|
+
default: S(() => [...c[0] || (c[0] = [
|
|
1135
1135
|
ie(" 重置 ", -1)
|
|
1136
1136
|
])]),
|
|
1137
1137
|
_: 1
|
|
1138
1138
|
}),
|
|
1139
|
-
|
|
1139
|
+
te(s(se), {
|
|
1140
1140
|
type: "primary",
|
|
1141
1141
|
"html-type": "submit"
|
|
1142
1142
|
}, {
|
|
1143
|
-
default:
|
|
1143
|
+
default: S(() => [...c[1] || (c[1] = [
|
|
1144
1144
|
ie(" 查询 ", -1)
|
|
1145
1145
|
])]),
|
|
1146
1146
|
_: 1
|
|
1147
1147
|
}),
|
|
1148
|
-
o.options.showCollapseButton ? (a(), M(s(
|
|
1148
|
+
o.options.showCollapseButton ? (a(), M(s(se), {
|
|
1149
1149
|
key: 0,
|
|
1150
1150
|
type: "link",
|
|
1151
1151
|
"html-type": "button",
|
|
1152
1152
|
onClick: B
|
|
1153
1153
|
}, {
|
|
1154
|
-
default:
|
|
1155
|
-
ie(
|
|
1154
|
+
default: S(() => [
|
|
1155
|
+
ie(D(n.value ? "展开" : "收起"), 1)
|
|
1156
1156
|
]),
|
|
1157
1157
|
_: 1
|
|
1158
1158
|
})) : z("", !0)
|
|
1159
1159
|
])
|
|
1160
1160
|
], 32));
|
|
1161
1161
|
}
|
|
1162
|
-
}), Jo = /* @__PURE__ */
|
|
1162
|
+
}), Jo = /* @__PURE__ */ ue(Ko, [["__scopeId", "data-v-92583f28"]]);
|
|
1163
1163
|
class Qo {
|
|
1164
|
-
schema =
|
|
1164
|
+
schema = R([]);
|
|
1165
1165
|
initialValues = {};
|
|
1166
|
-
values =
|
|
1166
|
+
values = Ie({});
|
|
1167
1167
|
configure(t) {
|
|
1168
1168
|
this.schema.value = t.schema.map((e) => ({ ...e })), this.initialValues = { ...t.initialValues }, this.resetForm();
|
|
1169
1169
|
}
|
|
@@ -1198,7 +1198,7 @@ class Xo {
|
|
|
1198
1198
|
state;
|
|
1199
1199
|
grid;
|
|
1200
1200
|
constructor(t) {
|
|
1201
|
-
this.state =
|
|
1201
|
+
this.state = R(t), this.searchFormVisible = R(t.showSearchForm ?? !0);
|
|
1202
1202
|
}
|
|
1203
1203
|
mount(t) {
|
|
1204
1204
|
this.grid = t;
|
|
@@ -1229,7 +1229,7 @@ class Xo {
|
|
|
1229
1229
|
this.grid = void 0;
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
|
-
const lt = /* @__PURE__ */ Symbol("yee-page-auto-content-height"), Zo = /* @__PURE__ */
|
|
1232
|
+
const lt = /* @__PURE__ */ Symbol("yee-page-auto-content-height"), Zo = /* @__PURE__ */ oe({
|
|
1233
1233
|
inheritAttrs: !1,
|
|
1234
1234
|
name: "VxeTooltip",
|
|
1235
1235
|
__name: "YeeGridTooltip",
|
|
@@ -1255,112 +1255,114 @@ const lt = /* @__PURE__ */ Symbol("yee-page-auto-content-height"), Zo = /* @__PU
|
|
|
1255
1255
|
},
|
|
1256
1256
|
emits: ["update:modelValue"],
|
|
1257
1257
|
setup(o, { expose: t, emit: e }) {
|
|
1258
|
-
const n = o,
|
|
1259
|
-
let
|
|
1260
|
-
function
|
|
1261
|
-
if (!(
|
|
1262
|
-
return typeof
|
|
1263
|
-
}
|
|
1264
|
-
const
|
|
1265
|
-
const
|
|
1266
|
-
return !
|
|
1267
|
-
height: `${Math.max(
|
|
1268
|
-
left: `${
|
|
1258
|
+
const n = o, v = e, x = re, p = Ie({ visible: !1 }), m = xe("tooltip"), C = R(), b = R(""), T = R(), B = R(!1);
|
|
1259
|
+
let k;
|
|
1260
|
+
function c(F) {
|
|
1261
|
+
if (!(F === void 0 || F === ""))
|
|
1262
|
+
return typeof F == "number" ? `${F}px` : F;
|
|
1263
|
+
}
|
|
1264
|
+
const w = u(() => {
|
|
1265
|
+
const F = C.value;
|
|
1266
|
+
return !F || !p.visible ? { display: "none" } : {
|
|
1267
|
+
height: `${Math.max(F.height, 1)}px`,
|
|
1268
|
+
left: `${F.left}px`,
|
|
1269
1269
|
pointerEvents: "none",
|
|
1270
1270
|
position: "fixed",
|
|
1271
|
-
top: `${
|
|
1272
|
-
width: `${Math.max(
|
|
1271
|
+
top: `${F.top}px`,
|
|
1272
|
+
width: `${Math.max(F.width, 1)}px`
|
|
1273
1273
|
};
|
|
1274
|
-
}),
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1274
|
+
}), N = u(() => ({
|
|
1275
|
+
cursor: n.enterable ? "text" : void 0,
|
|
1276
|
+
height: c(n.height),
|
|
1277
|
+
maxHeight: c(n.maxHeight),
|
|
1278
|
+
maxWidth: c(n.maxWidth),
|
|
1279
|
+
minHeight: c(n.minHeight),
|
|
1280
|
+
minWidth: c(n.minWidth),
|
|
1281
|
+
userSelect: n.enterable ? "text" : void 0,
|
|
1282
|
+
width: c(n.width)
|
|
1283
|
+
})), P = u(() => ({
|
|
1282
1284
|
...n.popupClassName ? { overlayClassName: n.popupClassName } : {},
|
|
1283
|
-
...m.content ? {} : { title: String(T.value) },
|
|
1284
1285
|
...n.zIndex === void 0 ? {} : { zIndex: Number(n.zIndex) }
|
|
1285
1286
|
}));
|
|
1286
|
-
function
|
|
1287
|
-
return
|
|
1288
|
-
}
|
|
1289
|
-
function
|
|
1290
|
-
return
|
|
1291
|
-
}
|
|
1292
|
-
function
|
|
1293
|
-
const
|
|
1294
|
-
if (!
|
|
1295
|
-
return
|
|
1296
|
-
const Q =
|
|
1297
|
-
return
|
|
1287
|
+
function I(F) {
|
|
1288
|
+
return F.closest("body") ?? document.body;
|
|
1289
|
+
}
|
|
1290
|
+
function f(F) {
|
|
1291
|
+
return F || (typeof n.selector == "string" ? document.querySelector(n.selector) ?? void 0 : n.selector);
|
|
1292
|
+
}
|
|
1293
|
+
function d() {
|
|
1294
|
+
const F = T.value;
|
|
1295
|
+
if (!F?.isConnected)
|
|
1296
|
+
return H();
|
|
1297
|
+
const Q = F.getBoundingClientRect();
|
|
1298
|
+
return C.value = {
|
|
1298
1299
|
height: Q.height,
|
|
1299
1300
|
left: Q.left,
|
|
1300
1301
|
top: Q.top,
|
|
1301
1302
|
width: Q.width
|
|
1302
|
-
}, Te(() =>
|
|
1303
|
+
}, Te(() => m.value?.forcePopupAlign?.());
|
|
1303
1304
|
}
|
|
1304
|
-
function
|
|
1305
|
-
const
|
|
1306
|
-
return
|
|
1305
|
+
function l(F, Q) {
|
|
1306
|
+
const ne = f(F);
|
|
1307
|
+
return ne ? (T.value = ne, b.value = Q ?? n.content ?? "", B.value = !0, p.visible = !0, v("update:modelValue", !0), d()) : Te();
|
|
1307
1308
|
}
|
|
1308
|
-
function
|
|
1309
|
-
const
|
|
1310
|
-
return
|
|
1309
|
+
function O(F, Q, ne) {
|
|
1310
|
+
const ae = F.currentTarget instanceof HTMLElement ? F.currentTarget : void 0;
|
|
1311
|
+
return l(Q ?? ae, ne);
|
|
1311
1312
|
}
|
|
1312
|
-
function
|
|
1313
|
-
return
|
|
1313
|
+
function H() {
|
|
1314
|
+
return B.value = !1, T.value = void 0, C.value = void 0, p.visible = !1, v("update:modelValue", !1), Te();
|
|
1314
1315
|
}
|
|
1315
|
-
function
|
|
1316
|
-
|
|
1316
|
+
function Y(F) {
|
|
1317
|
+
F && k && (clearTimeout(k), k = void 0), B.value = F;
|
|
1317
1318
|
}
|
|
1318
|
-
function
|
|
1319
|
-
return
|
|
1319
|
+
function $() {
|
|
1320
|
+
return B.value;
|
|
1320
1321
|
}
|
|
1321
|
-
function
|
|
1322
|
-
|
|
1322
|
+
function L() {
|
|
1323
|
+
p.visible && d();
|
|
1323
1324
|
}
|
|
1324
|
-
function
|
|
1325
|
-
|
|
1326
|
-
|
|
1325
|
+
function K() {
|
|
1326
|
+
Y(!1), n.enterable && (k = setTimeout(() => {
|
|
1327
|
+
k = void 0, B.value || H();
|
|
1327
1328
|
}, n.leaveDelay ?? 0));
|
|
1328
1329
|
}
|
|
1329
1330
|
return Re(() => {
|
|
1330
|
-
window.addEventListener("resize",
|
|
1331
|
+
window.addEventListener("resize", L), window.addEventListener("scroll", L, !0), n.modelValue && l(void 0, n.content);
|
|
1331
1332
|
}), Ce(() => {
|
|
1332
|
-
|
|
1333
|
+
k && clearTimeout(k), window.removeEventListener("resize", L), window.removeEventListener("scroll", L, !0);
|
|
1333
1334
|
}), t({
|
|
1334
|
-
close:
|
|
1335
|
-
isActived:
|
|
1336
|
-
open:
|
|
1337
|
-
openByEvent:
|
|
1338
|
-
reactData:
|
|
1339
|
-
setActived:
|
|
1340
|
-
toVisible:
|
|
1341
|
-
updatePlacement:
|
|
1342
|
-
}), (
|
|
1335
|
+
close: H,
|
|
1336
|
+
isActived: $,
|
|
1337
|
+
open: l,
|
|
1338
|
+
openByEvent: O,
|
|
1339
|
+
reactData: p,
|
|
1340
|
+
setActived: Y,
|
|
1341
|
+
toVisible: l,
|
|
1342
|
+
updatePlacement: d
|
|
1343
|
+
}), (F, Q) => (a(), M(s(x), Z({ ref: "tooltip" }, P.value, {
|
|
1343
1344
|
arrow: n.isArrow !== !1,
|
|
1344
|
-
"get-popup-container":
|
|
1345
|
-
open:
|
|
1346
|
-
"overlay-inner-style":
|
|
1345
|
+
"get-popup-container": I,
|
|
1346
|
+
open: p.visible,
|
|
1347
|
+
"overlay-inner-style": N.value,
|
|
1347
1348
|
placement: "top"
|
|
1348
1349
|
}), {
|
|
1349
|
-
title:
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1350
|
+
title: S(() => [
|
|
1351
|
+
E("div", {
|
|
1352
|
+
class: "yee-ui-grid-tooltip-content",
|
|
1353
|
+
onMouseenter: Q[0] || (Q[0] = (ne) => n.enterable && Y(!0)),
|
|
1354
|
+
onMouseleave: K
|
|
1353
1355
|
}, [
|
|
1354
|
-
|
|
1355
|
-
ie(
|
|
1356
|
+
U(F.$slots, "content", {}, () => [
|
|
1357
|
+
ie(D(b.value), 1)
|
|
1356
1358
|
])
|
|
1357
1359
|
], 32)
|
|
1358
1360
|
]),
|
|
1359
|
-
default:
|
|
1360
|
-
|
|
1361
|
+
default: S(() => [
|
|
1362
|
+
E("span", {
|
|
1361
1363
|
"aria-hidden": "true",
|
|
1362
1364
|
class: "yee-ui-grid-tooltip-anchor",
|
|
1363
|
-
style: he(
|
|
1365
|
+
style: he(w.value)
|
|
1364
1366
|
}, null, 4)
|
|
1365
1367
|
]),
|
|
1366
1368
|
_: 3
|
|
@@ -1368,23 +1370,23 @@ const lt = /* @__PURE__ */ Symbol("yee-page-auto-content-height"), Zo = /* @__PU
|
|
|
1368
1370
|
}
|
|
1369
1371
|
});
|
|
1370
1372
|
let Je = !1;
|
|
1371
|
-
const
|
|
1373
|
+
const De = /* @__PURE__ */ new Set();
|
|
1372
1374
|
function en() {
|
|
1373
1375
|
const o = Ee.modal.confirm.bind(Ee.modal);
|
|
1374
1376
|
Ee.modal.confirm = ((t, e, n) => {
|
|
1375
|
-
const
|
|
1376
|
-
if ((typeof
|
|
1377
|
-
const
|
|
1378
|
-
if (
|
|
1379
|
-
const
|
|
1380
|
-
return
|
|
1377
|
+
const v = typeof t == "object" && t !== null ? t : typeof n == "object" && n !== null ? n : void 0;
|
|
1378
|
+
if ((typeof v?.className == "string" ? v.className.split(/\s+/) : []).includes("vxe-table--ignore-clear")) {
|
|
1379
|
+
const p = [...De], m = p[p.length - 1];
|
|
1380
|
+
if (m) {
|
|
1381
|
+
const C = typeof v?.content == "string" ? v.content : String(v?.content ?? t);
|
|
1382
|
+
return m(C);
|
|
1381
1383
|
}
|
|
1382
1384
|
}
|
|
1383
1385
|
return o(t, e, n);
|
|
1384
1386
|
});
|
|
1385
1387
|
}
|
|
1386
1388
|
function tn(o) {
|
|
1387
|
-
return
|
|
1389
|
+
return De.add(o), () => De.delete(o);
|
|
1388
1390
|
}
|
|
1389
1391
|
function it() {
|
|
1390
1392
|
if (Je) return;
|
|
@@ -1398,8 +1400,8 @@ function it() {
|
|
|
1398
1400
|
At,
|
|
1399
1401
|
Ut,
|
|
1400
1402
|
jt,
|
|
1401
|
-
It,
|
|
1402
1403
|
Dt,
|
|
1404
|
+
It,
|
|
1403
1405
|
Yt,
|
|
1404
1406
|
Wt,
|
|
1405
1407
|
qt,
|
|
@@ -1413,7 +1415,7 @@ const on = {
|
|
|
1413
1415
|
}, nn = { class: "yee-ui-grid__table-container" }, an = {
|
|
1414
1416
|
key: 0,
|
|
1415
1417
|
class: "yee-ui-grid__title"
|
|
1416
|
-
}, ln = /* @__PURE__ */
|
|
1418
|
+
}, ln = /* @__PURE__ */ oe({
|
|
1417
1419
|
name: "YeeGrid",
|
|
1418
1420
|
__name: "YeeGrid",
|
|
1419
1421
|
props: {
|
|
@@ -1422,12 +1424,12 @@ const on = {
|
|
|
1422
1424
|
tableTitleHelp: {}
|
|
1423
1425
|
},
|
|
1424
1426
|
setup(o) {
|
|
1425
|
-
const t = o, e =
|
|
1427
|
+
const t = o, e = ze(), n = xe("gridRef"), v = Oe(Ne), x = Oe(lt, void 0), [p, m] = et.useModal();
|
|
1426
1428
|
it();
|
|
1427
|
-
const
|
|
1428
|
-
|
|
1429
|
+
const C = tn((d) => new Promise((l) => {
|
|
1430
|
+
p.confirm({
|
|
1429
1431
|
title: "恢复默认列配置",
|
|
1430
|
-
content:
|
|
1432
|
+
content: d,
|
|
1431
1433
|
centered: !0,
|
|
1432
1434
|
okText: "确认",
|
|
1433
1435
|
cancelText: "取消",
|
|
@@ -1436,14 +1438,14 @@ const on = {
|
|
|
1436
1438
|
onOk: () => l("confirm"),
|
|
1437
1439
|
onCancel: () => l("cancel")
|
|
1438
1440
|
});
|
|
1439
|
-
})), b = u(() => t.api.state.value), T = u(() => b.value.formOptions), B = u(() => !!(t.tableTitle || e["table-title"] || e["toolbar-actions"] || e["toolbar-tools"])),
|
|
1441
|
+
})), b = u(() => t.api.state.value), T = u(() => b.value.formOptions), B = u(() => !!(t.tableTitle || e["table-title"] || e["toolbar-actions"] || e["toolbar-tools"])), k = u(() => Object.keys(e).filter((d) => ![
|
|
1440
1442
|
"empty",
|
|
1441
1443
|
"loading",
|
|
1442
1444
|
"table-title",
|
|
1443
1445
|
"toolbar-actions",
|
|
1444
1446
|
"toolbar-tools"
|
|
1445
|
-
].includes(
|
|
1446
|
-
const
|
|
1447
|
+
].includes(d))), c = u(() => x?.value ?? !1), w = u(() => {
|
|
1448
|
+
const d = b.value.gridOptions, l = d.proxyConfig, O = l?.ajax?.query, H = d.toolbarConfig, Y = d.pagerConfig;
|
|
1447
1449
|
return {
|
|
1448
1450
|
align: "left",
|
|
1449
1451
|
border: "inner",
|
|
@@ -1452,10 +1454,15 @@ const on = {
|
|
|
1452
1454
|
showOverflow: "tooltip",
|
|
1453
1455
|
size: "medium",
|
|
1454
1456
|
...c.value ? { height: "auto" } : {},
|
|
1455
|
-
...
|
|
1457
|
+
...d,
|
|
1456
1458
|
columnConfig: {
|
|
1457
1459
|
resizable: !0,
|
|
1458
|
-
...
|
|
1460
|
+
...d.columnConfig
|
|
1461
|
+
},
|
|
1462
|
+
tooltipConfig: {
|
|
1463
|
+
enterable: !0,
|
|
1464
|
+
leaveDelay: 300,
|
|
1465
|
+
...d.tooltipConfig
|
|
1459
1466
|
},
|
|
1460
1467
|
...Y ? {
|
|
1461
1468
|
pagerConfig: {
|
|
@@ -1483,30 +1490,30 @@ const on = {
|
|
|
1483
1490
|
...l.ajax ? {
|
|
1484
1491
|
ajax: {
|
|
1485
1492
|
...l.ajax,
|
|
1486
|
-
...
|
|
1487
|
-
query: (
|
|
1493
|
+
...O ? {
|
|
1494
|
+
query: ($) => O($, t.api.formApi.getValues())
|
|
1488
1495
|
} : {}
|
|
1489
1496
|
}
|
|
1490
1497
|
} : {}
|
|
1491
1498
|
}
|
|
1492
1499
|
} : {},
|
|
1493
|
-
...
|
|
1500
|
+
...H || B.value ? {
|
|
1494
1501
|
toolbarConfig: {
|
|
1495
1502
|
custom: !0,
|
|
1496
1503
|
refresh: !0,
|
|
1497
1504
|
zoom: !0,
|
|
1498
|
-
...
|
|
1505
|
+
...H,
|
|
1499
1506
|
slots: {
|
|
1500
1507
|
...t.tableTitle || e["table-title"] || e["toolbar-actions"] ? { buttons: "toolbarActions" } : {},
|
|
1501
|
-
...e["toolbar-tools"] ||
|
|
1508
|
+
...e["toolbar-tools"] || H?.search ? { tools: "toolbarTools" } : {}
|
|
1502
1509
|
}
|
|
1503
1510
|
}
|
|
1504
1511
|
} : {}
|
|
1505
1512
|
};
|
|
1506
1513
|
}), N = u(() => b.value.gridEvents ?? {});
|
|
1507
1514
|
ke(
|
|
1508
|
-
() =>
|
|
1509
|
-
(
|
|
1515
|
+
() => v?.value.mode ?? "light",
|
|
1516
|
+
(d) => Ee.setTheme(d),
|
|
1510
1517
|
{ immediate: !0 }
|
|
1511
1518
|
);
|
|
1512
1519
|
async function P() {
|
|
@@ -1515,14 +1522,14 @@ const on = {
|
|
|
1515
1522
|
async function I() {
|
|
1516
1523
|
await t.api.reload();
|
|
1517
1524
|
}
|
|
1518
|
-
function f(
|
|
1519
|
-
typeof l != "number" && typeof l != "string" ||
|
|
1525
|
+
function f(d, l) {
|
|
1526
|
+
typeof l != "number" && typeof l != "string" || d.setPageSizeByEvent(new Event("change"), l);
|
|
1520
1527
|
}
|
|
1521
1528
|
return Re(() => {
|
|
1522
1529
|
n.value && t.api.mount(n.value);
|
|
1523
1530
|
}), ht(() => {
|
|
1524
|
-
|
|
1525
|
-
}), (
|
|
1531
|
+
C(), t.api.unmount();
|
|
1532
|
+
}), (d, l) => (a(), h("section", {
|
|
1526
1533
|
class: ye(["yee-ui-grid", { "yee-ui-grid--fill-page-content": c.value }])
|
|
1527
1534
|
}, [
|
|
1528
1535
|
T.value ? gt((a(), M(Jo, {
|
|
@@ -1535,22 +1542,22 @@ const on = {
|
|
|
1535
1542
|
[bt, o.api.searchFormVisible.value]
|
|
1536
1543
|
]) : z("", !0),
|
|
1537
1544
|
T.value && b.value.separator !== !1 ? (a(), h("div", on)) : z("", !0),
|
|
1538
|
-
|
|
1539
|
-
|
|
1545
|
+
E("div", nn, [
|
|
1546
|
+
te(s(nt), Z({
|
|
1540
1547
|
ref_key: "gridRef",
|
|
1541
1548
|
ref: n,
|
|
1542
1549
|
class: "yee-ui-grid__table"
|
|
1543
|
-
},
|
|
1544
|
-
toolbarActions:
|
|
1545
|
-
|
|
1550
|
+
}, w.value, wt(N.value)), Me({
|
|
1551
|
+
toolbarActions: S((O) => [
|
|
1552
|
+
U(d.$slots, "table-title", {}, () => [
|
|
1546
1553
|
o.tableTitle ? (a(), h("div", an, [
|
|
1547
|
-
ie(
|
|
1548
|
-
o.tableTitleHelp ? (a(), M(s(
|
|
1554
|
+
ie(D(o.tableTitle) + " ", 1),
|
|
1555
|
+
o.tableTitleHelp ? (a(), M(s(re), {
|
|
1549
1556
|
key: 0,
|
|
1550
1557
|
title: o.tableTitleHelp
|
|
1551
1558
|
}, {
|
|
1552
|
-
default:
|
|
1553
|
-
|
|
1559
|
+
default: S(() => [...l[0] || (l[0] = [
|
|
1560
|
+
E("span", {
|
|
1554
1561
|
class: "yee-ui-grid__help",
|
|
1555
1562
|
tabindex: "0"
|
|
1556
1563
|
}, "?", -1)
|
|
@@ -1559,62 +1566,62 @@ const on = {
|
|
|
1559
1566
|
}, 8, ["title"])) : z("", !0)
|
|
1560
1567
|
])) : z("", !0)
|
|
1561
1568
|
], !0),
|
|
1562
|
-
|
|
1569
|
+
U(d.$slots, "toolbar-actions", ve(me(O)), void 0, !0)
|
|
1563
1570
|
]),
|
|
1564
|
-
toolbarTools:
|
|
1565
|
-
|
|
1571
|
+
toolbarTools: S((O) => [
|
|
1572
|
+
U(d.$slots, "toolbar-tools", ve(me(O)), void 0, !0)
|
|
1566
1573
|
]),
|
|
1567
|
-
pagerSizes:
|
|
1568
|
-
|
|
1574
|
+
pagerSizes: S(({ $pager: O, options: H, pageSize: Y }) => [
|
|
1575
|
+
te(s(Ve), {
|
|
1569
1576
|
class: "yee-ui-grid__page-size",
|
|
1570
|
-
options:
|
|
1577
|
+
options: H,
|
|
1571
1578
|
value: Y,
|
|
1572
|
-
onChange: (
|
|
1579
|
+
onChange: ($) => f(O, $)
|
|
1573
1580
|
}, null, 8, ["options", "value", "onChange"])
|
|
1574
1581
|
]),
|
|
1575
|
-
empty:
|
|
1576
|
-
|
|
1577
|
-
l[1] || (l[1] =
|
|
1582
|
+
empty: S(() => [
|
|
1583
|
+
U(d.$slots, "empty", {}, () => [
|
|
1584
|
+
l[1] || (l[1] = E("div", { class: "yee-ui-grid__empty" }, "暂无数据", -1))
|
|
1578
1585
|
], !0)
|
|
1579
1586
|
]),
|
|
1580
1587
|
_: 2
|
|
1581
1588
|
}, [
|
|
1582
|
-
|
|
1583
|
-
name:
|
|
1584
|
-
fn:
|
|
1585
|
-
|
|
1589
|
+
Se(k.value, (O) => ({
|
|
1590
|
+
name: O,
|
|
1591
|
+
fn: S((H) => [
|
|
1592
|
+
U(d.$slots, O, ve(me(H)), void 0, !0)
|
|
1586
1593
|
])
|
|
1587
1594
|
}))
|
|
1588
1595
|
]), 1040)
|
|
1589
1596
|
]),
|
|
1590
|
-
|
|
1597
|
+
te(s(m))
|
|
1591
1598
|
], 2));
|
|
1592
1599
|
}
|
|
1593
|
-
}), sn = /* @__PURE__ */
|
|
1600
|
+
}), sn = /* @__PURE__ */ ue(ln, [["__scopeId", "data-v-efa010c8"]]);
|
|
1594
1601
|
function Un(o) {
|
|
1595
1602
|
it();
|
|
1596
1603
|
const t = new Xo(o), e = sn;
|
|
1597
|
-
return [
|
|
1604
|
+
return [oe({
|
|
1598
1605
|
name: "YeeGrid",
|
|
1599
1606
|
inheritAttrs: !1,
|
|
1600
1607
|
props: {
|
|
1601
1608
|
tableTitle: String,
|
|
1602
1609
|
tableTitleHelp: String
|
|
1603
1610
|
},
|
|
1604
|
-
setup(
|
|
1611
|
+
setup(v, { attrs: x, slots: p }) {
|
|
1605
1612
|
return Ce(() => t.unmount()), () => Xe(e, {
|
|
1606
1613
|
...x,
|
|
1607
1614
|
api: t,
|
|
1608
|
-
...
|
|
1609
|
-
...
|
|
1610
|
-
},
|
|
1615
|
+
...v.tableTitle ? { tableTitle: v.tableTitle } : {},
|
|
1616
|
+
...v.tableTitleHelp ? { tableTitleHelp: v.tableTitleHelp } : {}
|
|
1617
|
+
}, p);
|
|
1611
1618
|
}
|
|
1612
1619
|
}), t];
|
|
1613
1620
|
}
|
|
1614
1621
|
const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui-modal__title" }, dn = {
|
|
1615
1622
|
key: 1,
|
|
1616
1623
|
class: "yee-ui-modal__header-actions"
|
|
1617
|
-
}, fn = { class: "yee-ui-modal__body" }, pn = { class: "yee-ui-modal__footer" }, vn = { class: "yee-ui-modal__header" }, mn = ["id"], yn = { class: "yee-ui-modal__title" }, hn = { class: "yee-ui-modal__header-actions" }, gn = { class: "yee-ui-modal__body" }, bn = { class: "yee-ui-modal__footer" }, wn = /* @__PURE__ */
|
|
1624
|
+
}, fn = { class: "yee-ui-modal__body" }, pn = { class: "yee-ui-modal__footer" }, vn = { class: "yee-ui-modal__header" }, mn = ["id"], yn = { class: "yee-ui-modal__title" }, hn = { class: "yee-ui-modal__header-actions" }, gn = { class: "yee-ui-modal__body" }, bn = { class: "yee-ui-modal__footer" }, wn = /* @__PURE__ */ oe({
|
|
1618
1625
|
inheritAttrs: !1,
|
|
1619
1626
|
name: "YeeModal",
|
|
1620
1627
|
__name: "YeeModal",
|
|
@@ -1642,11 +1649,11 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1642
1649
|
}),
|
|
1643
1650
|
emits: /* @__PURE__ */ je(["cancel", "close", "confirm", "update:fullscreen"], ["update:open"]),
|
|
1644
1651
|
setup(o, { emit: t }) {
|
|
1645
|
-
const e = o, n = t,
|
|
1646
|
-
const
|
|
1652
|
+
const e = o, n = t, v = Ue(o, "open"), x = Ue(e, "fullscreen"), p = Ze(), m = ze(), C = _t(), b = u(() => e.type === "drawer"), T = u(() => !b.value && x.value), B = u(() => !!(e.title || m.header)), k = u(() => B.value || e.closable), c = u(() => B.value || e.fullscreenButton || e.closable), w = u(() => T.value ? "退出全屏" : "进入全屏"), N = u(() => {
|
|
1653
|
+
const L = Object.prototype.hasOwnProperty.call(e.wrapProps ?? {}, "aria-labelledby");
|
|
1647
1654
|
return {
|
|
1648
1655
|
...e.wrapProps,
|
|
1649
|
-
"aria-labelledby":
|
|
1656
|
+
"aria-labelledby": L ? e.wrapProps?.["aria-labelledby"] : B.value ? C : void 0
|
|
1650
1657
|
};
|
|
1651
1658
|
}), P = u(() => {
|
|
1652
1659
|
if (T.value)
|
|
@@ -1660,96 +1667,96 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1660
1667
|
};
|
|
1661
1668
|
});
|
|
1662
1669
|
function I() {
|
|
1663
|
-
const { style:
|
|
1664
|
-
return
|
|
1670
|
+
const { style: L, ...K } = p;
|
|
1671
|
+
return K;
|
|
1665
1672
|
}
|
|
1666
1673
|
function f() {
|
|
1667
|
-
return [
|
|
1674
|
+
return [p.style, e.style].filter(Boolean);
|
|
1668
1675
|
}
|
|
1669
|
-
function
|
|
1670
|
-
return [
|
|
1676
|
+
function d() {
|
|
1677
|
+
return [p.style, e.style, P.value].filter(Boolean);
|
|
1671
1678
|
}
|
|
1672
|
-
const l = () =>
|
|
1673
|
-
function
|
|
1674
|
-
n("cancel",
|
|
1679
|
+
const l = () => m.closeIcon?.() ?? p.closeIcon ?? Xe(Vt);
|
|
1680
|
+
function O(L) {
|
|
1681
|
+
n("cancel", L), v.value = !1;
|
|
1675
1682
|
}
|
|
1676
|
-
function
|
|
1677
|
-
n("confirm",
|
|
1683
|
+
function H(L) {
|
|
1684
|
+
n("confirm", L);
|
|
1678
1685
|
}
|
|
1679
1686
|
function Y() {
|
|
1680
1687
|
n("close");
|
|
1681
1688
|
}
|
|
1682
|
-
function
|
|
1689
|
+
function $() {
|
|
1683
1690
|
x.value = !x.value;
|
|
1684
1691
|
}
|
|
1685
|
-
return (
|
|
1692
|
+
return (L, K) => b.value ? (a(), M(s(Tt), Z({ key: 0 }, I(), {
|
|
1686
1693
|
class: "yee-ui-modal-drawer",
|
|
1687
1694
|
closable: !1,
|
|
1688
1695
|
"destroy-on-close": e.destroyOnClose,
|
|
1689
1696
|
keyboard: e.keyboard,
|
|
1690
1697
|
"mask-closable": e.maskClosable,
|
|
1691
|
-
open:
|
|
1698
|
+
open: v.value,
|
|
1692
1699
|
style: f(),
|
|
1693
1700
|
width: e.width,
|
|
1694
|
-
onAfterOpenChange:
|
|
1695
|
-
onClose:
|
|
1696
|
-
}),
|
|
1697
|
-
footer:
|
|
1698
|
-
|
|
1699
|
-
L
|
|
1700
|
-
e.showCancelButton ? (a(), M(s(
|
|
1701
|
+
onAfterOpenChange: K[0] || (K[0] = (F) => !F && Y()),
|
|
1702
|
+
onClose: O
|
|
1703
|
+
}), Me({
|
|
1704
|
+
footer: S(() => [
|
|
1705
|
+
E("div", pn, [
|
|
1706
|
+
U(L.$slots, "footer", {}, () => [
|
|
1707
|
+
e.showCancelButton ? (a(), M(s(se), {
|
|
1701
1708
|
key: 0,
|
|
1702
|
-
onClick:
|
|
1709
|
+
onClick: O
|
|
1703
1710
|
}, {
|
|
1704
|
-
default:
|
|
1705
|
-
ie(
|
|
1711
|
+
default: S(() => [
|
|
1712
|
+
ie(D(e.cancelButtonText), 1)
|
|
1706
1713
|
]),
|
|
1707
1714
|
_: 1
|
|
1708
1715
|
})) : z("", !0),
|
|
1709
|
-
e.showConfirmButton ? (a(), M(s(
|
|
1716
|
+
e.showConfirmButton ? (a(), M(s(se), {
|
|
1710
1717
|
key: 1,
|
|
1711
1718
|
loading: e.confirmButtonLoading,
|
|
1712
1719
|
type: "primary",
|
|
1713
|
-
onClick:
|
|
1720
|
+
onClick: H
|
|
1714
1721
|
}, {
|
|
1715
|
-
default:
|
|
1716
|
-
ie(
|
|
1722
|
+
default: S(() => [
|
|
1723
|
+
ie(D(e.confirmButtonText), 1)
|
|
1717
1724
|
]),
|
|
1718
1725
|
_: 1
|
|
1719
1726
|
}, 8, ["loading"])) : z("", !0)
|
|
1720
1727
|
], !0)
|
|
1721
1728
|
])
|
|
1722
1729
|
]),
|
|
1723
|
-
default:
|
|
1724
|
-
|
|
1725
|
-
L
|
|
1730
|
+
default: S(() => [
|
|
1731
|
+
E("div", fn, [
|
|
1732
|
+
U(L.$slots, "default", {}, void 0, !0)
|
|
1726
1733
|
])
|
|
1727
1734
|
]),
|
|
1728
1735
|
_: 2
|
|
1729
1736
|
}, [
|
|
1730
|
-
|
|
1737
|
+
k.value ? {
|
|
1731
1738
|
name: "title",
|
|
1732
|
-
fn:
|
|
1733
|
-
|
|
1739
|
+
fn: S(() => [
|
|
1740
|
+
E("div", rn, [
|
|
1734
1741
|
B.value ? (a(), h("div", {
|
|
1735
1742
|
key: 0,
|
|
1736
|
-
id: s(
|
|
1743
|
+
id: s(C),
|
|
1737
1744
|
class: "yee-ui-modal__heading"
|
|
1738
1745
|
}, [
|
|
1739
|
-
L
|
|
1740
|
-
|
|
1746
|
+
U(L.$slots, "header", {}, () => [
|
|
1747
|
+
E("span", cn, D(e.title), 1)
|
|
1741
1748
|
], !0)
|
|
1742
1749
|
], 8, un)) : z("", !0),
|
|
1743
1750
|
e.closable ? (a(), h("div", dn, [
|
|
1744
|
-
|
|
1751
|
+
te(s(se), {
|
|
1745
1752
|
"aria-label": "关闭",
|
|
1746
1753
|
class: "yee-ui-modal__header-action",
|
|
1747
1754
|
size: "small",
|
|
1748
1755
|
type: "text",
|
|
1749
|
-
onClick:
|
|
1756
|
+
onClick: O
|
|
1750
1757
|
}, {
|
|
1751
|
-
default:
|
|
1752
|
-
|
|
1758
|
+
default: S(() => [
|
|
1759
|
+
te(l)
|
|
1753
1760
|
]),
|
|
1754
1761
|
_: 1
|
|
1755
1762
|
})
|
|
@@ -1758,7 +1765,7 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1758
1765
|
]),
|
|
1759
1766
|
key: "0"
|
|
1760
1767
|
} : void 0
|
|
1761
|
-
]), 1040, ["destroy-on-close", "keyboard", "mask-closable", "open", "style", "width"])) : (a(), M(s(et),
|
|
1768
|
+
]), 1040, ["destroy-on-close", "keyboard", "mask-closable", "open", "style", "width"])) : (a(), M(s(et), Z({ key: 1 }, I(), {
|
|
1762
1769
|
centered: T.value ? !1 : e.centered,
|
|
1763
1770
|
class: {
|
|
1764
1771
|
"yee-ui-modal": !0,
|
|
@@ -1768,74 +1775,74 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1768
1775
|
"destroy-on-close": e.destroyOnClose,
|
|
1769
1776
|
keyboard: e.keyboard,
|
|
1770
1777
|
"mask-closable": e.maskClosable,
|
|
1771
|
-
open:
|
|
1772
|
-
style:
|
|
1778
|
+
open: v.value,
|
|
1779
|
+
style: d(),
|
|
1773
1780
|
width: T.value ? "100vw" : e.width,
|
|
1774
1781
|
"wrap-props": N.value,
|
|
1775
1782
|
onAfterClose: Y,
|
|
1776
|
-
onCancel:
|
|
1777
|
-
}),
|
|
1778
|
-
footer:
|
|
1779
|
-
|
|
1780
|
-
L
|
|
1781
|
-
e.showCancelButton ? (a(), M(s(
|
|
1783
|
+
onCancel: O
|
|
1784
|
+
}), Me({
|
|
1785
|
+
footer: S(() => [
|
|
1786
|
+
E("div", bn, [
|
|
1787
|
+
U(L.$slots, "footer", {}, () => [
|
|
1788
|
+
e.showCancelButton ? (a(), M(s(se), {
|
|
1782
1789
|
key: 0,
|
|
1783
|
-
onClick:
|
|
1790
|
+
onClick: O
|
|
1784
1791
|
}, {
|
|
1785
|
-
default:
|
|
1786
|
-
ie(
|
|
1792
|
+
default: S(() => [
|
|
1793
|
+
ie(D(e.cancelButtonText), 1)
|
|
1787
1794
|
]),
|
|
1788
1795
|
_: 1
|
|
1789
1796
|
})) : z("", !0),
|
|
1790
|
-
e.showConfirmButton ? (a(), M(s(
|
|
1797
|
+
e.showConfirmButton ? (a(), M(s(se), {
|
|
1791
1798
|
key: 1,
|
|
1792
1799
|
loading: e.confirmButtonLoading,
|
|
1793
1800
|
type: "primary",
|
|
1794
|
-
onClick:
|
|
1801
|
+
onClick: H
|
|
1795
1802
|
}, {
|
|
1796
|
-
default:
|
|
1797
|
-
ie(
|
|
1803
|
+
default: S(() => [
|
|
1804
|
+
ie(D(e.confirmButtonText), 1)
|
|
1798
1805
|
]),
|
|
1799
1806
|
_: 1
|
|
1800
1807
|
}, 8, ["loading"])) : z("", !0)
|
|
1801
1808
|
], !0)
|
|
1802
1809
|
])
|
|
1803
1810
|
]),
|
|
1804
|
-
default:
|
|
1805
|
-
|
|
1806
|
-
L
|
|
1811
|
+
default: S(() => [
|
|
1812
|
+
E("div", gn, [
|
|
1813
|
+
U(L.$slots, "default", {}, void 0, !0)
|
|
1807
1814
|
])
|
|
1808
1815
|
]),
|
|
1809
1816
|
_: 2
|
|
1810
1817
|
}, [
|
|
1811
1818
|
c.value ? {
|
|
1812
1819
|
name: "title",
|
|
1813
|
-
fn:
|
|
1814
|
-
|
|
1820
|
+
fn: S(() => [
|
|
1821
|
+
E("div", vn, [
|
|
1815
1822
|
B.value ? (a(), h("div", {
|
|
1816
1823
|
key: 0,
|
|
1817
|
-
id: s(
|
|
1824
|
+
id: s(C),
|
|
1818
1825
|
class: "yee-ui-modal__heading"
|
|
1819
1826
|
}, [
|
|
1820
|
-
L
|
|
1821
|
-
|
|
1827
|
+
U(L.$slots, "header", {}, () => [
|
|
1828
|
+
E("span", yn, D(e.title), 1)
|
|
1822
1829
|
], !0)
|
|
1823
1830
|
], 8, mn)) : z("", !0),
|
|
1824
|
-
|
|
1825
|
-
e.fullscreenButton ? (a(), M(s(
|
|
1831
|
+
E("div", hn, [
|
|
1832
|
+
e.fullscreenButton ? (a(), M(s(re), {
|
|
1826
1833
|
key: 0,
|
|
1827
|
-
title:
|
|
1834
|
+
title: w.value
|
|
1828
1835
|
}, {
|
|
1829
|
-
default:
|
|
1830
|
-
|
|
1831
|
-
"aria-label":
|
|
1836
|
+
default: S(() => [
|
|
1837
|
+
te(s(se), {
|
|
1838
|
+
"aria-label": w.value,
|
|
1832
1839
|
"aria-pressed": T.value,
|
|
1833
1840
|
class: "yee-ui-modal__header-action",
|
|
1834
1841
|
size: "small",
|
|
1835
1842
|
type: "text",
|
|
1836
|
-
onClick:
|
|
1843
|
+
onClick: $
|
|
1837
1844
|
}, {
|
|
1838
|
-
default:
|
|
1845
|
+
default: S(() => [
|
|
1839
1846
|
T.value ? (a(), M(s(tt), { key: 0 })) : (a(), M(s(ot), { key: 1 }))
|
|
1840
1847
|
]),
|
|
1841
1848
|
_: 1
|
|
@@ -1843,16 +1850,16 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1843
1850
|
]),
|
|
1844
1851
|
_: 1
|
|
1845
1852
|
}, 8, ["title"])) : z("", !0),
|
|
1846
|
-
e.closable ? (a(), M(s(
|
|
1853
|
+
e.closable ? (a(), M(s(se), {
|
|
1847
1854
|
key: 1,
|
|
1848
1855
|
"aria-label": "关闭",
|
|
1849
1856
|
class: "yee-ui-modal__header-action",
|
|
1850
1857
|
size: "small",
|
|
1851
1858
|
type: "text",
|
|
1852
|
-
onClick:
|
|
1859
|
+
onClick: O
|
|
1853
1860
|
}, {
|
|
1854
|
-
default:
|
|
1855
|
-
|
|
1861
|
+
default: S(() => [
|
|
1862
|
+
te(l)
|
|
1856
1863
|
]),
|
|
1857
1864
|
_: 1
|
|
1858
1865
|
})) : z("", !0)
|
|
@@ -1863,7 +1870,7 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1863
1870
|
} : void 0
|
|
1864
1871
|
]), 1040, ["centered", "class", "destroy-on-close", "keyboard", "mask-closable", "open", "style", "width", "wrap-props"]));
|
|
1865
1872
|
}
|
|
1866
|
-
}), jn = /* @__PURE__ */
|
|
1873
|
+
}), jn = /* @__PURE__ */ ue(wn, [["__scopeId", "data-v-6cb12c49"]]), _n = { class: "yee-ui-page__heading" }, xn = {
|
|
1867
1874
|
key: 0,
|
|
1868
1875
|
class: "yee-ui-page__title"
|
|
1869
1876
|
}, kn = {
|
|
@@ -1872,7 +1879,7 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1872
1879
|
}, Cn = {
|
|
1873
1880
|
key: 0,
|
|
1874
1881
|
class: "yee-ui-page__extra"
|
|
1875
|
-
},
|
|
1882
|
+
}, $n = /* @__PURE__ */ oe({
|
|
1876
1883
|
name: "YeePage",
|
|
1877
1884
|
__name: "YeePage",
|
|
1878
1885
|
props: {
|
|
@@ -1885,29 +1892,29 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1885
1892
|
title: {}
|
|
1886
1893
|
},
|
|
1887
1894
|
setup(o) {
|
|
1888
|
-
const t = o, e =
|
|
1889
|
-
Qe(lt,
|
|
1890
|
-
const x =
|
|
1895
|
+
const t = o, e = ze(), n = u(() => !!(t.description || t.title || e.description || e.extra || e.title)), v = u(() => t.autoContentHeight);
|
|
1896
|
+
Qe(lt, v);
|
|
1897
|
+
const x = R(0), p = R(0), m = R(!1), C = xe("headerRef"), b = xe("footerRef");
|
|
1891
1898
|
let T;
|
|
1892
1899
|
function B() {
|
|
1893
|
-
const P =
|
|
1894
|
-
x.value !== P && (x.value = P),
|
|
1900
|
+
const P = C.value?.offsetHeight ?? 0, I = b.value?.offsetHeight ?? 0;
|
|
1901
|
+
x.value !== P && (x.value = P), p.value !== I && (p.value = I);
|
|
1895
1902
|
}
|
|
1896
|
-
function
|
|
1897
|
-
T?.disconnect(), T = void 0, !(typeof ResizeObserver > "u") && (T = new ResizeObserver(B),
|
|
1903
|
+
function k() {
|
|
1904
|
+
T?.disconnect(), T = void 0, !(typeof ResizeObserver > "u") && (T = new ResizeObserver(B), C.value && T.observe(C.value), b.value && T.observe(b.value));
|
|
1898
1905
|
}
|
|
1899
1906
|
async function c() {
|
|
1900
1907
|
if (T?.disconnect(), T = void 0, !t.autoContentHeight) {
|
|
1901
|
-
|
|
1908
|
+
m.value = !1;
|
|
1902
1909
|
return;
|
|
1903
1910
|
}
|
|
1904
|
-
await Te(), B(),
|
|
1911
|
+
await Te(), B(), m.value = !0, k();
|
|
1905
1912
|
}
|
|
1906
|
-
const
|
|
1913
|
+
const w = u(() => ({
|
|
1907
1914
|
"--yee-page-height-offset": typeof t.heightOffset == "number" ? `${t.heightOffset}px` : t.heightOffset
|
|
1908
1915
|
})), N = u(() => t.autoContentHeight ? {
|
|
1909
|
-
height: `calc(100% - ${x.value}px - ${
|
|
1910
|
-
overflowY:
|
|
1916
|
+
height: `calc(100% - ${x.value}px - ${p.value}px)`,
|
|
1917
|
+
overflowY: m.value ? "auto" : "hidden"
|
|
1911
1918
|
} : {});
|
|
1912
1919
|
return ke(
|
|
1913
1920
|
[() => t.autoContentHeight, n, () => !!e.footer],
|
|
@@ -1919,31 +1926,31 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1919
1926
|
c();
|
|
1920
1927
|
}), Ce(() => T?.disconnect()), (P, I) => (a(), h("section", {
|
|
1921
1928
|
class: ye(["yee-ui-page", { "yee-ui-page--auto-height": o.autoContentHeight }]),
|
|
1922
|
-
style: he(
|
|
1929
|
+
style: he(w.value)
|
|
1923
1930
|
}, [
|
|
1924
1931
|
n.value ? (a(), h("header", {
|
|
1925
1932
|
key: 0,
|
|
1926
1933
|
ref_key: "headerRef",
|
|
1927
|
-
ref:
|
|
1934
|
+
ref: C,
|
|
1928
1935
|
class: ye(["yee-ui-page__header", o.headerClass])
|
|
1929
1936
|
}, [
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
o.title ? (a(), h("h1", xn,
|
|
1937
|
+
E("div", _n, [
|
|
1938
|
+
U(P.$slots, "title", {}, () => [
|
|
1939
|
+
o.title ? (a(), h("h1", xn, D(o.title), 1)) : z("", !0)
|
|
1933
1940
|
], !0),
|
|
1934
|
-
|
|
1935
|
-
o.description ? (a(), h("p", kn,
|
|
1941
|
+
U(P.$slots, "description", {}, () => [
|
|
1942
|
+
o.description ? (a(), h("p", kn, D(o.description), 1)) : z("", !0)
|
|
1936
1943
|
], !0)
|
|
1937
1944
|
]),
|
|
1938
1945
|
P.$slots.extra ? (a(), h("div", Cn, [
|
|
1939
|
-
|
|
1946
|
+
U(P.$slots, "extra", {}, void 0, !0)
|
|
1940
1947
|
])) : z("", !0)
|
|
1941
1948
|
], 2)) : z("", !0),
|
|
1942
|
-
|
|
1949
|
+
E("main", {
|
|
1943
1950
|
class: ye(["yee-ui-page__content", o.contentClass]),
|
|
1944
1951
|
style: he(N.value)
|
|
1945
1952
|
}, [
|
|
1946
|
-
|
|
1953
|
+
U(P.$slots, "default", {}, void 0, !0)
|
|
1947
1954
|
], 6),
|
|
1948
1955
|
P.$slots.footer ? (a(), h("footer", {
|
|
1949
1956
|
key: 1,
|
|
@@ -1951,11 +1958,11 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1951
1958
|
ref: b,
|
|
1952
1959
|
class: ye(["yee-ui-page__footer", o.footerClass])
|
|
1953
1960
|
}, [
|
|
1954
|
-
|
|
1961
|
+
U(P.$slots, "footer", {}, void 0, !0)
|
|
1955
1962
|
], 2)) : z("", !0)
|
|
1956
1963
|
], 6));
|
|
1957
1964
|
}
|
|
1958
|
-
}),
|
|
1965
|
+
}), Dn = /* @__PURE__ */ ue($n, [["__scopeId", "data-v-ff8fc3a1"]]), Sn = { class: "yee-ui-select__option-label" }, Tn = /* @__PURE__ */ oe({
|
|
1959
1966
|
inheritAttrs: !1,
|
|
1960
1967
|
name: "YeeSelect",
|
|
1961
1968
|
__name: "YeeSelect",
|
|
@@ -1968,118 +1975,118 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
1968
1975
|
}),
|
|
1969
1976
|
emits: ["update:value"],
|
|
1970
1977
|
setup(o) {
|
|
1971
|
-
const t = o, e = Ue(o, "value"), n = Ze(),
|
|
1978
|
+
const t = o, e = Ue(o, "value"), n = Ze(), v = ze(), x = R(!1), p = u(() => ({
|
|
1972
1979
|
label: t.fieldNames?.label ?? "label",
|
|
1973
1980
|
options: t.fieldNames?.options ?? "options",
|
|
1974
1981
|
value: t.fieldNames?.value ?? "value"
|
|
1975
|
-
})),
|
|
1982
|
+
})), m = u(() => n.class), C = u(() => n.style), b = u(() => {
|
|
1976
1983
|
const f = {};
|
|
1977
|
-
for (const [
|
|
1978
|
-
|
|
1984
|
+
for (const [d, l] of Object.entries(n))
|
|
1985
|
+
d !== "class" && d !== "style" && d !== "onDropdownVisibleChange" && (f[d] = l);
|
|
1979
1986
|
return f;
|
|
1980
|
-
}), T = u(() => !
|
|
1987
|
+
}), T = u(() => !v.default && !v.option);
|
|
1981
1988
|
function B(f) {
|
|
1982
|
-
const
|
|
1983
|
-
if (typeof
|
|
1984
|
-
|
|
1989
|
+
const d = n.onDropdownVisibleChange;
|
|
1990
|
+
if (typeof d == "function") {
|
|
1991
|
+
d(f);
|
|
1985
1992
|
return;
|
|
1986
1993
|
}
|
|
1987
|
-
|
|
1994
|
+
d?.forEach((l) => l?.(f));
|
|
1988
1995
|
}
|
|
1989
|
-
function
|
|
1996
|
+
function k(f) {
|
|
1990
1997
|
x.value = f, B(f);
|
|
1991
1998
|
}
|
|
1992
1999
|
function c(f) {
|
|
1993
2000
|
return typeof f == "number" || typeof f == "string" ? String(f) : "";
|
|
1994
2001
|
}
|
|
1995
|
-
function
|
|
2002
|
+
function w(f, d) {
|
|
1996
2003
|
if (f)
|
|
1997
2004
|
for (const l of f) {
|
|
1998
|
-
const
|
|
1999
|
-
if (
|
|
2000
|
-
const Y = l[
|
|
2001
|
-
if (Y ===
|
|
2005
|
+
const O = l[p.value.options], H = w(O, d);
|
|
2006
|
+
if (H) return H;
|
|
2007
|
+
const Y = l[p.value.value];
|
|
2008
|
+
if (Y === d || String(Y) === String(d)) return l;
|
|
2002
2009
|
}
|
|
2003
2010
|
}
|
|
2004
2011
|
function N(f) {
|
|
2005
|
-
return f ? c(f[
|
|
2012
|
+
return f ? c(f[p.value.label]) || c(f.title) || c(f[p.value.value]) : "";
|
|
2006
2013
|
}
|
|
2007
2014
|
const P = u(() => {
|
|
2008
2015
|
const f = e.value;
|
|
2009
2016
|
if (!(f == null || f === ""))
|
|
2010
|
-
return Array.isArray(f) ? f.map((
|
|
2017
|
+
return Array.isArray(f) ? f.map((d) => N(w(t.options, d)) || c(d)).filter(Boolean).join("、") || void 0 : N(w(t.options, f)) || c(f) || void 0;
|
|
2011
2018
|
});
|
|
2012
2019
|
function I(f) {
|
|
2013
2020
|
return N(f);
|
|
2014
2021
|
}
|
|
2015
|
-
return (f,
|
|
2016
|
-
default:
|
|
2017
|
-
|
|
2018
|
-
class: ye(["yee-ui-select",
|
|
2019
|
-
style: he(
|
|
2022
|
+
return (f, d) => (a(), M(s(re), Z(x.value ? { open: !1 } : {}, { title: P.value }), {
|
|
2023
|
+
default: S(() => [
|
|
2024
|
+
E("div", {
|
|
2025
|
+
class: ye(["yee-ui-select", m.value]),
|
|
2026
|
+
style: he(C.value)
|
|
2020
2027
|
}, [
|
|
2021
|
-
T.value ? (a(), M(s(
|
|
2028
|
+
T.value ? (a(), M(s(Ve), Z({
|
|
2022
2029
|
key: 0,
|
|
2023
2030
|
value: e.value,
|
|
2024
|
-
"onUpdate:value":
|
|
2031
|
+
"onUpdate:value": d[0] || (d[0] = (l) => e.value = l)
|
|
2025
2032
|
}, b.value, {
|
|
2026
|
-
"field-names":
|
|
2033
|
+
"field-names": p.value,
|
|
2027
2034
|
options: o.options,
|
|
2028
|
-
onDropdownVisibleChange:
|
|
2035
|
+
onDropdownVisibleChange: k
|
|
2029
2036
|
}), {
|
|
2030
|
-
option:
|
|
2031
|
-
|
|
2037
|
+
option: S((l) => [
|
|
2038
|
+
te(s(re), {
|
|
2032
2039
|
title: I(l),
|
|
2033
2040
|
placement: "left"
|
|
2034
2041
|
}, {
|
|
2035
|
-
default:
|
|
2036
|
-
|
|
2042
|
+
default: S(() => [
|
|
2043
|
+
E("span", Sn, D(I(l)), 1)
|
|
2037
2044
|
]),
|
|
2038
2045
|
_: 2
|
|
2039
2046
|
}, 1032, ["title"])
|
|
2040
2047
|
]),
|
|
2041
2048
|
_: 1
|
|
2042
|
-
}, 16, ["value", "field-names", "options"])) : (a(), M(s(
|
|
2049
|
+
}, 16, ["value", "field-names", "options"])) : (a(), M(s(Ve), Z({
|
|
2043
2050
|
key: 1,
|
|
2044
2051
|
value: e.value,
|
|
2045
|
-
"onUpdate:value":
|
|
2052
|
+
"onUpdate:value": d[1] || (d[1] = (l) => e.value = l)
|
|
2046
2053
|
}, b.value, {
|
|
2047
|
-
"field-names":
|
|
2054
|
+
"field-names": p.value,
|
|
2048
2055
|
options: o.options,
|
|
2049
|
-
onDropdownVisibleChange:
|
|
2050
|
-
}),
|
|
2056
|
+
onDropdownVisibleChange: k
|
|
2057
|
+
}), Me({ _: 2 }, [
|
|
2051
2058
|
f.$slots.default ? {
|
|
2052
2059
|
name: "default",
|
|
2053
|
-
fn:
|
|
2054
|
-
|
|
2060
|
+
fn: S((l) => [
|
|
2061
|
+
U(f.$slots, "default", ve(me(l)), void 0, !0)
|
|
2055
2062
|
]),
|
|
2056
2063
|
key: "0"
|
|
2057
2064
|
} : void 0,
|
|
2058
2065
|
f.$slots.option ? {
|
|
2059
2066
|
name: "option",
|
|
2060
|
-
fn:
|
|
2061
|
-
|
|
2067
|
+
fn: S((l) => [
|
|
2068
|
+
U(f.$slots, "option", ve(me(l)), void 0, !0)
|
|
2062
2069
|
]),
|
|
2063
2070
|
key: "1"
|
|
2064
2071
|
} : void 0,
|
|
2065
2072
|
f.$slots.tagRender ? {
|
|
2066
2073
|
name: "tagRender",
|
|
2067
|
-
fn:
|
|
2068
|
-
|
|
2074
|
+
fn: S((l) => [
|
|
2075
|
+
U(f.$slots, "tagRender", ve(me(l)), void 0, !0)
|
|
2069
2076
|
]),
|
|
2070
2077
|
key: "2"
|
|
2071
2078
|
} : void 0,
|
|
2072
2079
|
f.$slots.dropdownRender ? {
|
|
2073
2080
|
name: "dropdownRender",
|
|
2074
|
-
fn:
|
|
2075
|
-
|
|
2081
|
+
fn: S((l) => [
|
|
2082
|
+
U(f.$slots, "dropdownRender", ve(me(l)), void 0, !0)
|
|
2076
2083
|
]),
|
|
2077
2084
|
key: "3"
|
|
2078
2085
|
} : void 0,
|
|
2079
2086
|
f.$slots.notFoundContent ? {
|
|
2080
2087
|
name: "notFoundContent",
|
|
2081
|
-
fn:
|
|
2082
|
-
|
|
2088
|
+
fn: S((l) => [
|
|
2089
|
+
U(f.$slots, "notFoundContent", ve(me(l)), void 0, !0)
|
|
2083
2090
|
]),
|
|
2084
2091
|
key: "4"
|
|
2085
2092
|
} : void 0
|
|
@@ -2089,7 +2096,7 @@ const rn = { class: "yee-ui-modal__header" }, un = ["id"], cn = { class: "yee-ui
|
|
|
2089
2096
|
_: 3
|
|
2090
2097
|
}, 16, ["title"]));
|
|
2091
2098
|
}
|
|
2092
|
-
}),
|
|
2099
|
+
}), In = /* @__PURE__ */ ue(Tn, [["__scopeId", "data-v-028e2b2a"]]);
|
|
2093
2100
|
export {
|
|
2094
2101
|
Vn as CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT,
|
|
2095
2102
|
Nn as PlatformConfigProvider,
|
|
@@ -2101,8 +2108,8 @@ export {
|
|
|
2101
2108
|
Qo as YeeFormApi,
|
|
2102
2109
|
Xo as YeeGridApi,
|
|
2103
2110
|
jn as YeeModal,
|
|
2104
|
-
|
|
2105
|
-
|
|
2111
|
+
Dn as YeePage,
|
|
2112
|
+
In as YeeSelect,
|
|
2106
2113
|
qn as darkThemeTokens,
|
|
2107
2114
|
Gn as lightThemeTokens,
|
|
2108
2115
|
Ne as platformThemeKey,
|