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