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