ooxml-excel-editor 1.3.0 → 1.3.2
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/CHANGELOG.md +161 -2
- package/README.md +9 -6
- package/core.js +2 -0
- package/dist/chunks/_commonjsHelpers-bAxELxBV.js +8 -0
- package/dist/{assets/exceljs.min-DH9BABny.js → chunks/exceljs.min-Bo1tFAdV.js} +2916 -2848
- package/dist/chunks/html2canvas.esm-CqSuKvp_.js +4871 -0
- package/dist/chunks/index-Cu1G47bB.js +10575 -0
- package/dist/chunks/index-gsLKcr47.js +29664 -0
- package/dist/chunks/index.es-aesXm4JC.js +6693 -0
- package/dist/chunks/index.es-n6H_ncuE.js +6693 -0
- package/dist/chunks/jspdf.es.min-B6-ocR7J.js +9673 -0
- package/dist/chunks/jspdf.es.min-DMfUtFJC.js +9673 -0
- package/dist/chunks/{plugin-overlay-DLb6sRhU.js → plugin-overlay-BUrPrpT2.js} +3576 -3435
- package/dist/chunks/purify.es-BK6DF412.js +683 -0
- package/dist/chunks/{toolbar-icons-BcnMin5s.js → toolbar-icons-fOm95ASq.js} +94 -79
- package/dist/components/ExcelViewer.vue.d.ts +20 -20
- package/dist/components/ExportDialog.vue.d.ts +2 -2
- package/dist/components/FilterPopup.vue.d.ts +2 -2
- package/dist/components/ViewerToolbar.vue.d.ts +6 -6
- package/dist/core.js +30 -30
- package/dist/index.js +1288 -1084
- package/dist/react.js +773 -751
- package/dist/style.css +1 -1
- package/dist/vue2.css +1 -1
- package/dist/vue2.js +7 -10431
- package/package.json +8 -13
- package/vue2.js +5 -0
- package/dist/assets/parse.worker-DIaMHX0x.js +0 -2646
package/dist/index.js
CHANGED
|
@@ -1,41 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var yl = Object.defineProperty, kl = Object.defineProperties;
|
|
2
|
+
var Cl = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var Pt = Object.getOwnPropertySymbols;
|
|
4
|
+
var xl = Object.prototype.hasOwnProperty, wl = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Dt = (r, b, f) => b in r ? yl(r, b, { enumerable: !0, configurable: !0, writable: !0, value: f }) : r[b] = f, V = (r, b) => {
|
|
6
|
+
for (var f in b || (b = {}))
|
|
7
|
+
xl.call(b, f) && Dt(r, f, b[f]);
|
|
8
|
+
if (Pt)
|
|
9
|
+
for (var f of Pt(b))
|
|
10
|
+
wl.call(b, f) && Dt(r, f, b[f]);
|
|
11
|
+
return r;
|
|
12
|
+
}, fe = (r, b) => kl(r, Cl(b));
|
|
13
|
+
import { ref as C, shallowRef as gt, defineComponent as Z, onBeforeUnmount as Ke, openBlock as v, createElementBlock as c, createElementVNode as s, createTextVNode as N, toDisplayString as F, createCommentVNode as M, withModifiers as qe, Fragment as _, renderList as pe, computed as I, normalizeClass as W, reactive as Lt, withDirectives as B, vModelRadio as Ae, vModelSelect as ft, vModelCheckbox as mt, onMounted as Je, normalizeStyle as _e, vModelText as hl, unref as S, nextTick as me, watch as L, createBlock as re, Teleport as $l, renderSlot as le, createVNode as pt } from "vue";
|
|
14
|
+
import { r as bt, l as Nt, d as Vt, f as Bt, a as Sl, h as Le, V as El, P as Tl, g as Fl, s as Il, b as Ml, c as Rl, e as Pl } from "./chunks/plugin-overlay-BUrPrpT2.js";
|
|
15
|
+
import { D as Ls, j as Ns, k as Vs, m as Bs, i as Ws, n as Hs, o as Os, q as Us, t as _s, u as Ks, v as qs, p as Js } from "./chunks/plugin-overlay-BUrPrpT2.js";
|
|
16
|
+
import { p as Wt, s as ze, T as Ue, a as Dl, i as Al, j as zl } from "./chunks/toolbar-icons-fOm95ASq.js";
|
|
17
|
+
import { definePlugin as Gs } from "./core.js";
|
|
18
|
+
function Ll() {
|
|
19
|
+
const r = C(!1), b = C(null), f = gt(null), i = C(null), y = gt(null);
|
|
20
|
+
async function g(m, p) {
|
|
21
|
+
var o;
|
|
22
|
+
r.value = !0, b.value = null, f.value && bt(f.value), f.value = null, y.value = null, i.value = { stage: "read", ratio: 0 };
|
|
10
23
|
try {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
}),
|
|
14
|
-
if (
|
|
15
|
-
if (
|
|
16
|
-
if (
|
|
17
|
-
let
|
|
18
|
-
|
|
24
|
+
const u = await Nt(m, (D, T) => {
|
|
25
|
+
i.value = { stage: "read", ratio: T ? D / T : void 0 };
|
|
26
|
+
}), R = Vt(u);
|
|
27
|
+
if (R === "xls") throw new Error("这是旧版 .xls(BIFF) 或加密文件,本预览器只支持 .xlsx/.xlsm。");
|
|
28
|
+
if (R === "not-zip") throw new Error("文件不是有效的 .xlsx(非 ZIP 包)。");
|
|
29
|
+
if (R === "empty") throw new Error("文件为空。");
|
|
30
|
+
let z = await Wt(u, (D) => {
|
|
31
|
+
i.value = D;
|
|
19
32
|
});
|
|
20
|
-
p && (
|
|
21
|
-
} catch (
|
|
22
|
-
|
|
33
|
+
p && (z = (o = p(z)) != null ? o : z), Bt(z), y.value = u.slice(0), f.value = z;
|
|
34
|
+
} catch (u) {
|
|
35
|
+
b.value = u != null && u.message && /预览器|损坏|加密|为空|ZIP/.test(u.message) ? u.message : Sl(u), console.error("[ooxml-preview] 解析失败:", u);
|
|
23
36
|
} finally {
|
|
24
|
-
|
|
37
|
+
r.value = !1, i.value = null;
|
|
25
38
|
}
|
|
26
39
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
40
|
+
function d(m, p) {
|
|
41
|
+
var o;
|
|
42
|
+
f.value && bt(f.value), y.value = null, b.value = null, i.value = null, f.value = p && (o = p(m)) != null ? o : m;
|
|
29
43
|
}
|
|
30
|
-
return { loading:
|
|
44
|
+
return { loading: r, error: b, workbook: f, load: g, loadModel: d, progress: i, sourceBuffer: y };
|
|
31
45
|
}
|
|
32
|
-
const
|
|
46
|
+
const Nl = { class: "toolbar" }, Vl = ["title"], Bl = {
|
|
33
47
|
key: 0,
|
|
34
48
|
class: "tpl"
|
|
35
|
-
},
|
|
49
|
+
}, Wl = { class: "meta" }, Hl = { class: "export-wrap" }, Ol = {
|
|
36
50
|
key: 0,
|
|
37
51
|
class: "menu"
|
|
38
|
-
},
|
|
52
|
+
}, Ul = { class: "zoom" }, _l = ["value"], Kl = ["value"], ql = ["value"], Jl = /* @__PURE__ */ Z({
|
|
39
53
|
__name: "ViewerToolbar",
|
|
40
54
|
props: {
|
|
41
55
|
fileName: {},
|
|
@@ -44,135 +58,135 @@ const El = { class: "toolbar" }, Tl = ["title"], Fl = {
|
|
|
44
58
|
zoom: {}
|
|
45
59
|
},
|
|
46
60
|
emits: ["update:zoom", "export-image", "export-pdf", "export-pdf-vector", "print", "open-settings"],
|
|
47
|
-
setup(
|
|
48
|
-
const
|
|
49
|
-
function y(
|
|
50
|
-
|
|
61
|
+
setup(r, { emit: b }) {
|
|
62
|
+
const f = b, i = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
63
|
+
function y(o) {
|
|
64
|
+
f("update:zoom", Math.min(3, Math.max(0.3, o)));
|
|
51
65
|
}
|
|
52
|
-
const
|
|
53
|
-
function
|
|
54
|
-
|
|
66
|
+
const g = C(!1);
|
|
67
|
+
function d() {
|
|
68
|
+
g.value = !g.value;
|
|
55
69
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
70
|
+
function m(o) {
|
|
71
|
+
g.value = !1, f(o === "export-image" ? "export-image" : o === "export-pdf" ? "export-pdf" : o === "export-pdf-vector" ? "export-pdf-vector" : o === "print" ? "print" : "open-settings");
|
|
58
72
|
}
|
|
59
|
-
function p(
|
|
60
|
-
var
|
|
61
|
-
(
|
|
73
|
+
function p(o) {
|
|
74
|
+
var u;
|
|
75
|
+
(u = o.target) != null && u.closest(".export-wrap") || (g.value = !1);
|
|
62
76
|
}
|
|
63
|
-
return typeof document
|
|
64
|
-
typeof document
|
|
65
|
-
}), (
|
|
66
|
-
|
|
77
|
+
return typeof document != "undefined" && document.addEventListener("click", p), Ke(() => {
|
|
78
|
+
typeof document != "undefined" && document.removeEventListener("click", p);
|
|
79
|
+
}), (o, u) => (v(), c("div", Nl, [
|
|
80
|
+
s("span", {
|
|
67
81
|
class: "file",
|
|
68
|
-
title: (
|
|
82
|
+
title: (r.fileName || "未命名工作簿") + (r.templateName ? " · 模板: " + r.templateName : "")
|
|
69
83
|
}, [
|
|
70
|
-
N(
|
|
71
|
-
|
|
72
|
-
], 8,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
84
|
+
N(F(r.fileName || "未命名工作簿"), 1),
|
|
85
|
+
r.templateName ? (v(), c("span", Bl, " · 模板: " + F(r.templateName), 1)) : M("", !0)
|
|
86
|
+
], 8, Vl),
|
|
87
|
+
s("span", Wl, F(r.sheetCount) + " 个工作表", 1),
|
|
88
|
+
u[10] || (u[10] = s("div", { class: "spacer" }, null, -1)),
|
|
89
|
+
s("div", Hl, [
|
|
90
|
+
s("button", {
|
|
77
91
|
class: "export-btn",
|
|
78
|
-
onClick:
|
|
92
|
+
onClick: qe(d, ["stop"]),
|
|
79
93
|
title: "导出 / 打印"
|
|
80
|
-
}, [...
|
|
94
|
+
}, [...u[8] || (u[8] = [
|
|
81
95
|
N(" 导出 ", -1),
|
|
82
|
-
|
|
96
|
+
s("span", { class: "caret" }, "▾", -1)
|
|
83
97
|
])]),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
onClick:
|
|
98
|
+
g.value ? (v(), c("div", Ol, [
|
|
99
|
+
s("button", {
|
|
100
|
+
onClick: u[0] || (u[0] = (R) => m("export-image"))
|
|
87
101
|
}, "导出为图片 (PNG)"),
|
|
88
|
-
|
|
89
|
-
onClick:
|
|
102
|
+
s("button", {
|
|
103
|
+
onClick: u[1] || (u[1] = (R) => m("export-pdf"))
|
|
90
104
|
}, "导出为 PDF (位图)"),
|
|
91
|
-
|
|
92
|
-
onClick:
|
|
105
|
+
s("button", {
|
|
106
|
+
onClick: u[2] || (u[2] = (R) => m("export-pdf-vector"))
|
|
93
107
|
}, "导出为 PDF (矢量·文字可选)"),
|
|
94
|
-
|
|
95
|
-
onClick:
|
|
108
|
+
s("button", {
|
|
109
|
+
onClick: u[3] || (u[3] = (R) => m("print"))
|
|
96
110
|
}, "打印…"),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
onClick:
|
|
111
|
+
u[9] || (u[9] = s("div", { class: "sep" }, null, -1)),
|
|
112
|
+
s("button", {
|
|
113
|
+
onClick: u[4] || (u[4] = (R) => m("open-settings"))
|
|
100
114
|
}, "导出设置…")
|
|
101
|
-
])) :
|
|
115
|
+
])) : M("", !0)
|
|
102
116
|
]),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
onClick:
|
|
117
|
+
s("div", Ul, [
|
|
118
|
+
s("button", {
|
|
119
|
+
onClick: u[5] || (u[5] = (R) => y(r.zoom - 0.1)),
|
|
106
120
|
title: "缩小"
|
|
107
121
|
}, "−"),
|
|
108
|
-
|
|
109
|
-
value:
|
|
110
|
-
onChange:
|
|
122
|
+
s("select", {
|
|
123
|
+
value: r.zoom,
|
|
124
|
+
onChange: u[6] || (u[6] = (R) => y(parseFloat(R.target.value)))
|
|
111
125
|
}, [
|
|
112
|
-
(v(), c(
|
|
113
|
-
key:
|
|
114
|
-
value:
|
|
115
|
-
},
|
|
116
|
-
|
|
126
|
+
(v(), c(_, null, pe(i, (R) => s("option", {
|
|
127
|
+
key: R,
|
|
128
|
+
value: R
|
|
129
|
+
}, F(Math.round(R * 100)) + "%", 9, Kl)), 64)),
|
|
130
|
+
i.includes(r.zoom) ? M("", !0) : (v(), c("option", {
|
|
117
131
|
key: 0,
|
|
118
|
-
value:
|
|
119
|
-
},
|
|
120
|
-
], 40,
|
|
121
|
-
|
|
122
|
-
onClick:
|
|
132
|
+
value: r.zoom
|
|
133
|
+
}, F(Math.round(r.zoom * 100)) + "%", 9, ql))
|
|
134
|
+
], 40, _l),
|
|
135
|
+
s("button", {
|
|
136
|
+
onClick: u[7] || (u[7] = (R) => y(r.zoom + 0.1)),
|
|
123
137
|
title: "放大"
|
|
124
138
|
}, "+")
|
|
125
139
|
])
|
|
126
140
|
]));
|
|
127
141
|
}
|
|
128
|
-
}),
|
|
129
|
-
const
|
|
130
|
-
for (const [
|
|
131
|
-
|
|
132
|
-
return
|
|
133
|
-
},
|
|
142
|
+
}), Q = (r, b) => {
|
|
143
|
+
const f = r.__vccOpts || r;
|
|
144
|
+
for (const [i, y] of b)
|
|
145
|
+
f[i] = y;
|
|
146
|
+
return f;
|
|
147
|
+
}, jl = /* @__PURE__ */ Q(Jl, [["__scopeId", "data-v-eafc1f94"]]), Gl = { class: "sheet-tabs" }, Xl = ["onClick", "title"], Zl = /* @__PURE__ */ Z({
|
|
134
148
|
__name: "SheetTabs",
|
|
135
149
|
props: {
|
|
136
150
|
workbook: {},
|
|
137
151
|
active: {}
|
|
138
152
|
},
|
|
139
153
|
emits: ["select"],
|
|
140
|
-
setup(
|
|
141
|
-
const
|
|
142
|
-
return (
|
|
143
|
-
(v(!0), c(
|
|
144
|
-
key:
|
|
145
|
-
class:
|
|
146
|
-
onClick: (p) =>
|
|
147
|
-
title:
|
|
148
|
-
},
|
|
154
|
+
setup(r, { emit: b }) {
|
|
155
|
+
const f = r, i = b, y = I(() => f.workbook.sheets.filter((g) => g.state === "visible"));
|
|
156
|
+
return (g, d) => (v(), c("div", Gl, [
|
|
157
|
+
(v(!0), c(_, null, pe(y.value, (m) => (v(), c("button", {
|
|
158
|
+
key: m.index,
|
|
159
|
+
class: W(["tab", { active: m.index === r.active }]),
|
|
160
|
+
onClick: (p) => i("select", m.index),
|
|
161
|
+
title: m.name
|
|
162
|
+
}, F(m.name), 11, Xl))), 128))
|
|
149
163
|
]));
|
|
150
164
|
}
|
|
151
|
-
}),
|
|
165
|
+
}), Ql = /* @__PURE__ */ Q(Zl, [["__scopeId", "data-v-431b6f9c"]]), Yl = {
|
|
152
166
|
class: "dlg",
|
|
153
167
|
role: "dialog",
|
|
154
168
|
"aria-label": "导出设置"
|
|
155
|
-
},
|
|
169
|
+
}, en = { class: "dlg-head" }, tn = { class: "dlg-body" }, ln = { class: "field" }, nn = { class: "opts" }, sn = ["disabled"], an = {
|
|
156
170
|
key: 0,
|
|
157
171
|
class: "hint"
|
|
158
|
-
},
|
|
172
|
+
}, on = {
|
|
159
173
|
key: 1,
|
|
160
174
|
class: "hint"
|
|
161
|
-
},
|
|
175
|
+
}, un = { class: "field" }, rn = { class: "field" }, dn = { class: "opts inline" }, vn = { class: "field" }, cn = { class: "opts" }, fn = { class: "field" }, mn = { class: "opts inline" }, pn = { class: "dlg-foot" }, gn = /* @__PURE__ */ Z({
|
|
162
176
|
__name: "ExportDialog",
|
|
163
177
|
props: {
|
|
164
178
|
selection: {},
|
|
165
179
|
sheetCount: {}
|
|
166
180
|
},
|
|
167
181
|
emits: ["close", "export"],
|
|
168
|
-
setup(
|
|
169
|
-
const
|
|
170
|
-
const p =
|
|
182
|
+
setup(r, { emit: b }) {
|
|
183
|
+
const f = r, i = b, y = I(() => {
|
|
184
|
+
const p = f.selection;
|
|
171
185
|
return !!p && !(p.top === p.bottom && p.left === p.right);
|
|
172
|
-
}),
|
|
173
|
-
const p =
|
|
174
|
-
return p ? `${
|
|
175
|
-
}),
|
|
186
|
+
}), g = I(() => {
|
|
187
|
+
const p = f.selection;
|
|
188
|
+
return p ? `${Le(p.left)}${p.top + 1}:${Le(p.right)}${p.bottom + 1}` : "";
|
|
189
|
+
}), d = Lt({
|
|
176
190
|
action: "png",
|
|
177
191
|
scope: y.value ? "selection" : "sheet",
|
|
178
192
|
scale: 2,
|
|
@@ -183,187 +197,187 @@ const El = { class: "toolbar" }, Tl = ["title"], Fl = {
|
|
|
183
197
|
fitToWidth: !0,
|
|
184
198
|
pdfVector: !1
|
|
185
199
|
});
|
|
186
|
-
function
|
|
187
|
-
|
|
200
|
+
function m(p) {
|
|
201
|
+
i("export", fe(V({}, d), { action: p }));
|
|
188
202
|
}
|
|
189
|
-
return (p,
|
|
203
|
+
return (p, o) => (v(), c("div", {
|
|
190
204
|
class: "dlg-mask",
|
|
191
|
-
onClick:
|
|
205
|
+
onClick: o[16] || (o[16] = qe((u) => i("close"), ["self"]))
|
|
192
206
|
}, [
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
207
|
+
s("div", Yl, [
|
|
208
|
+
s("div", en, [
|
|
209
|
+
o[17] || (o[17] = s("span", null, "导出 / 打印设置", -1)),
|
|
210
|
+
s("button", {
|
|
197
211
|
class: "x",
|
|
198
|
-
onClick:
|
|
212
|
+
onClick: o[0] || (o[0] = (u) => i("close")),
|
|
199
213
|
title: "关闭"
|
|
200
214
|
}, "×")
|
|
201
215
|
]),
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
class:
|
|
216
|
+
s("div", tn, [
|
|
217
|
+
s("div", ln, [
|
|
218
|
+
o[20] || (o[20] = s("label", { class: "lbl" }, "范围", -1)),
|
|
219
|
+
s("div", nn, [
|
|
220
|
+
s("label", {
|
|
221
|
+
class: W({ disabled: !y.value })
|
|
208
222
|
}, [
|
|
209
|
-
|
|
223
|
+
B(s("input", {
|
|
210
224
|
type: "radio",
|
|
211
225
|
value: "selection",
|
|
212
|
-
"onUpdate:modelValue":
|
|
226
|
+
"onUpdate:modelValue": o[1] || (o[1] = (u) => d.scope = u),
|
|
213
227
|
disabled: !y.value
|
|
214
|
-
}, null, 8,
|
|
215
|
-
[
|
|
228
|
+
}, null, 8, sn), [
|
|
229
|
+
[Ae, d.scope]
|
|
216
230
|
]),
|
|
217
|
-
|
|
218
|
-
y.value ? (v(), c("span",
|
|
231
|
+
o[18] || (o[18] = N(" 当前选区 ", -1)),
|
|
232
|
+
y.value ? (v(), c("span", an, F(g.value), 1)) : (v(), c("span", on, "(未选多格)"))
|
|
219
233
|
], 2),
|
|
220
|
-
|
|
221
|
-
|
|
234
|
+
s("label", null, [
|
|
235
|
+
B(s("input", {
|
|
222
236
|
type: "radio",
|
|
223
237
|
value: "sheet",
|
|
224
|
-
"onUpdate:modelValue":
|
|
238
|
+
"onUpdate:modelValue": o[2] || (o[2] = (u) => d.scope = u)
|
|
225
239
|
}, null, 512), [
|
|
226
|
-
[
|
|
240
|
+
[Ae, d.scope]
|
|
227
241
|
]),
|
|
228
|
-
|
|
242
|
+
o[19] || (o[19] = N(" 当前工作表", -1))
|
|
229
243
|
]),
|
|
230
|
-
|
|
231
|
-
|
|
244
|
+
s("label", null, [
|
|
245
|
+
B(s("input", {
|
|
232
246
|
type: "radio",
|
|
233
247
|
value: "all",
|
|
234
|
-
"onUpdate:modelValue":
|
|
248
|
+
"onUpdate:modelValue": o[3] || (o[3] = (u) => d.scope = u)
|
|
235
249
|
}, null, 512), [
|
|
236
|
-
[
|
|
250
|
+
[Ae, d.scope]
|
|
237
251
|
]),
|
|
238
|
-
N(" 全部工作表 (" +
|
|
252
|
+
N(" 全部工作表 (" + F(r.sheetCount) + ")", 1)
|
|
239
253
|
])
|
|
240
254
|
])
|
|
241
255
|
]),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
"onUpdate:modelValue":
|
|
246
|
-
}, [...
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
256
|
+
s("div", un, [
|
|
257
|
+
o[22] || (o[22] = s("label", { class: "lbl" }, "清晰度", -1)),
|
|
258
|
+
B(s("select", {
|
|
259
|
+
"onUpdate:modelValue": o[4] || (o[4] = (u) => d.scale = u)
|
|
260
|
+
}, [...o[21] || (o[21] = [
|
|
261
|
+
s("option", { value: 1 }, "标准 (1×)", -1),
|
|
262
|
+
s("option", { value: 2 }, "高清 (2×)", -1),
|
|
263
|
+
s("option", { value: 3 }, "超清 (3×)", -1)
|
|
250
264
|
])], 512), [
|
|
251
265
|
[
|
|
252
|
-
|
|
253
|
-
|
|
266
|
+
ft,
|
|
267
|
+
d.scale,
|
|
254
268
|
void 0,
|
|
255
269
|
{ number: !0 }
|
|
256
270
|
]
|
|
257
271
|
])
|
|
258
272
|
]),
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
273
|
+
s("div", rn, [
|
|
274
|
+
o[25] || (o[25] = s("label", { class: "lbl" }, "内容", -1)),
|
|
275
|
+
s("div", dn, [
|
|
276
|
+
s("label", null, [
|
|
277
|
+
B(s("input", {
|
|
264
278
|
type: "checkbox",
|
|
265
|
-
"onUpdate:modelValue":
|
|
279
|
+
"onUpdate:modelValue": o[5] || (o[5] = (u) => d.includeHeaders = u)
|
|
266
280
|
}, null, 512), [
|
|
267
|
-
[
|
|
281
|
+
[mt, d.includeHeaders]
|
|
268
282
|
]),
|
|
269
|
-
|
|
283
|
+
o[23] || (o[23] = N(" 含行列号", -1))
|
|
270
284
|
]),
|
|
271
|
-
|
|
272
|
-
|
|
285
|
+
s("label", null, [
|
|
286
|
+
B(s("input", {
|
|
273
287
|
type: "checkbox",
|
|
274
|
-
"onUpdate:modelValue":
|
|
288
|
+
"onUpdate:modelValue": o[6] || (o[6] = (u) => d.gridlines = u)
|
|
275
289
|
}, null, 512), [
|
|
276
|
-
[
|
|
290
|
+
[mt, d.gridlines]
|
|
277
291
|
]),
|
|
278
|
-
|
|
292
|
+
o[24] || (o[24] = N(" 网格线", -1))
|
|
279
293
|
])
|
|
280
294
|
])
|
|
281
295
|
]),
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
296
|
+
s("div", vn, [
|
|
297
|
+
o[30] || (o[30] = s("label", { class: "lbl" }, "PDF 类型", -1)),
|
|
298
|
+
s("div", cn, [
|
|
299
|
+
s("label", null, [
|
|
300
|
+
B(s("input", {
|
|
287
301
|
type: "radio",
|
|
288
302
|
value: !1,
|
|
289
|
-
"onUpdate:modelValue":
|
|
303
|
+
"onUpdate:modelValue": o[7] || (o[7] = (u) => d.pdfVector = u)
|
|
290
304
|
}, null, 512), [
|
|
291
|
-
[
|
|
305
|
+
[Ae, d.pdfVector]
|
|
292
306
|
]),
|
|
293
|
-
|
|
294
|
-
|
|
307
|
+
o[26] || (o[26] = N(" 位图 ", -1)),
|
|
308
|
+
o[27] || (o[27] = s("span", { class: "hint" }, "(完整还原观感)", -1))
|
|
295
309
|
]),
|
|
296
|
-
|
|
297
|
-
|
|
310
|
+
s("label", null, [
|
|
311
|
+
B(s("input", {
|
|
298
312
|
type: "radio",
|
|
299
313
|
value: !0,
|
|
300
|
-
"onUpdate:modelValue":
|
|
314
|
+
"onUpdate:modelValue": o[8] || (o[8] = (u) => d.pdfVector = u)
|
|
301
315
|
}, null, 512), [
|
|
302
|
-
[
|
|
316
|
+
[Ae, d.pdfVector]
|
|
303
317
|
]),
|
|
304
|
-
|
|
305
|
-
|
|
318
|
+
o[28] || (o[28] = N(" 矢量 ", -1)),
|
|
319
|
+
o[29] || (o[29] = s("span", { class: "hint" }, "(文字可选可搜·清晰·文件小;中文需注册字体,否则该格转图)", -1))
|
|
306
320
|
])
|
|
307
321
|
])
|
|
308
322
|
]),
|
|
309
|
-
|
|
310
|
-
|
|
323
|
+
s("div", fn, [
|
|
324
|
+
o[34] || (o[34] = s("label", { class: "lbl" }, [
|
|
311
325
|
N("纸张 "),
|
|
312
|
-
|
|
326
|
+
s("span", { class: "hint" }, "(PDF/打印)")
|
|
313
327
|
], -1)),
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
"onUpdate:modelValue":
|
|
317
|
-
}, [...
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
328
|
+
s("div", mn, [
|
|
329
|
+
B(s("select", {
|
|
330
|
+
"onUpdate:modelValue": o[9] || (o[9] = (u) => d.format = u)
|
|
331
|
+
}, [...o[31] || (o[31] = [
|
|
332
|
+
s("option", { value: "auto" }, "自动(跟随表)", -1),
|
|
333
|
+
s("option", { value: "a4" }, "A4", -1),
|
|
334
|
+
s("option", { value: "a3" }, "A3", -1),
|
|
335
|
+
s("option", { value: "letter" }, "Letter", -1)
|
|
322
336
|
])], 512), [
|
|
323
|
-
[
|
|
337
|
+
[ft, d.format]
|
|
324
338
|
]),
|
|
325
|
-
|
|
326
|
-
"onUpdate:modelValue":
|
|
327
|
-
}, [...
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
339
|
+
B(s("select", {
|
|
340
|
+
"onUpdate:modelValue": o[10] || (o[10] = (u) => d.orientation = u)
|
|
341
|
+
}, [...o[32] || (o[32] = [
|
|
342
|
+
s("option", { value: "auto" }, "方向: 自动", -1),
|
|
343
|
+
s("option", { value: "portrait" }, "纵向", -1),
|
|
344
|
+
s("option", { value: "landscape" }, "横向", -1)
|
|
331
345
|
])], 512), [
|
|
332
|
-
[
|
|
346
|
+
[ft, d.orientation]
|
|
333
347
|
]),
|
|
334
|
-
|
|
335
|
-
|
|
348
|
+
s("label", null, [
|
|
349
|
+
B(s("input", {
|
|
336
350
|
type: "checkbox",
|
|
337
|
-
"onUpdate:modelValue":
|
|
351
|
+
"onUpdate:modelValue": o[11] || (o[11] = (u) => d.fitToWidth = u)
|
|
338
352
|
}, null, 512), [
|
|
339
|
-
[
|
|
353
|
+
[mt, d.fitToWidth]
|
|
340
354
|
]),
|
|
341
|
-
|
|
355
|
+
o[33] || (o[33] = N(" 适应页宽", -1))
|
|
342
356
|
])
|
|
343
357
|
])
|
|
344
358
|
])
|
|
345
359
|
]),
|
|
346
|
-
|
|
347
|
-
|
|
360
|
+
s("div", pn, [
|
|
361
|
+
s("button", {
|
|
348
362
|
class: "ghost",
|
|
349
|
-
onClick:
|
|
363
|
+
onClick: o[12] || (o[12] = (u) => i("close"))
|
|
350
364
|
}, "取消"),
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
onClick:
|
|
365
|
+
o[35] || (o[35] = s("div", { class: "grow" }, null, -1)),
|
|
366
|
+
s("button", {
|
|
367
|
+
onClick: o[13] || (o[13] = (u) => m("png"))
|
|
354
368
|
}, "导出 PNG"),
|
|
355
|
-
|
|
356
|
-
onClick:
|
|
369
|
+
s("button", {
|
|
370
|
+
onClick: o[14] || (o[14] = (u) => m("pdf"))
|
|
357
371
|
}, "导出 PDF"),
|
|
358
|
-
|
|
372
|
+
s("button", {
|
|
359
373
|
class: "primary",
|
|
360
|
-
onClick:
|
|
374
|
+
onClick: o[15] || (o[15] = (u) => m("print"))
|
|
361
375
|
}, "打印…")
|
|
362
376
|
])
|
|
363
377
|
])
|
|
364
378
|
]));
|
|
365
379
|
}
|
|
366
|
-
}),
|
|
380
|
+
}), bn = /* @__PURE__ */ Q(gn, [["__scopeId", "data-v-544df24f"]]), yn = ["value"], kn = ["disabled"], Cn = ["disabled"], xn = /* @__PURE__ */ Z({
|
|
367
381
|
__name: "FindBar",
|
|
368
382
|
props: {
|
|
369
383
|
query: {},
|
|
@@ -373,70 +387,70 @@ const El = { class: "toolbar" }, Tl = ["title"], Fl = {
|
|
|
373
387
|
wholeCell: { type: Boolean }
|
|
374
388
|
},
|
|
375
389
|
emits: ["update:query", "update:matchCase", "update:wholeCell", "next", "prev", "close"],
|
|
376
|
-
setup(
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
var
|
|
380
|
-
return (
|
|
390
|
+
setup(r, { expose: b, emit: f }) {
|
|
391
|
+
const i = f, y = C(null);
|
|
392
|
+
Je(() => {
|
|
393
|
+
var d;
|
|
394
|
+
return (d = y.value) == null ? void 0 : d.focus();
|
|
381
395
|
});
|
|
382
|
-
function
|
|
383
|
-
var
|
|
384
|
-
(
|
|
385
|
-
}
|
|
386
|
-
return
|
|
387
|
-
var
|
|
388
|
-
return (
|
|
389
|
-
} }), (
|
|
396
|
+
function g(d) {
|
|
397
|
+
var m;
|
|
398
|
+
(d.ctrlKey || d.metaKey) && (d.key === "f" || d.key === "F") ? (d.preventDefault(), (m = y.value) == null || m.select()) : d.key === "Enter" ? (d.preventDefault(), d.shiftKey ? i("prev") : i("next")) : d.key === "Escape" && (d.preventDefault(), i("close"));
|
|
399
|
+
}
|
|
400
|
+
return b({ focus: () => {
|
|
401
|
+
var d;
|
|
402
|
+
return (d = y.value) == null ? void 0 : d.focus();
|
|
403
|
+
} }), (d, m) => (v(), c("div", {
|
|
390
404
|
class: "find-bar",
|
|
391
|
-
onKeydown:
|
|
405
|
+
onKeydown: m[6] || (m[6] = qe(() => {
|
|
392
406
|
}, ["stop"]))
|
|
393
407
|
}, [
|
|
394
|
-
|
|
408
|
+
s("input", {
|
|
395
409
|
ref_key: "inputEl",
|
|
396
410
|
ref: y,
|
|
397
411
|
class: "q",
|
|
398
412
|
type: "text",
|
|
399
413
|
placeholder: "查找…",
|
|
400
|
-
value:
|
|
401
|
-
onInput:
|
|
402
|
-
onKeydown:
|
|
403
|
-
}, null, 40,
|
|
404
|
-
|
|
405
|
-
class:
|
|
406
|
-
},
|
|
407
|
-
|
|
408
|
-
class:
|
|
414
|
+
value: r.query,
|
|
415
|
+
onInput: m[0] || (m[0] = (p) => i("update:query", p.target.value)),
|
|
416
|
+
onKeydown: g
|
|
417
|
+
}, null, 40, yn),
|
|
418
|
+
s("span", {
|
|
419
|
+
class: W(["count", { none: r.query && r.matchCount === 0 }])
|
|
420
|
+
}, F(r.matchCount ? `${r.current + 1}/${r.matchCount}` : r.query ? "无结果" : ""), 3),
|
|
421
|
+
s("button", {
|
|
422
|
+
class: W(["opt", { on: r.matchCase }]),
|
|
409
423
|
title: "区分大小写",
|
|
410
|
-
onClick:
|
|
424
|
+
onClick: m[1] || (m[1] = (p) => i("update:matchCase", !r.matchCase))
|
|
411
425
|
}, "Aa", 2),
|
|
412
|
-
|
|
413
|
-
class:
|
|
426
|
+
s("button", {
|
|
427
|
+
class: W(["opt", { on: r.wholeCell }]),
|
|
414
428
|
title: "全字匹配(整格相等)",
|
|
415
|
-
onClick:
|
|
429
|
+
onClick: m[2] || (m[2] = (p) => i("update:wholeCell", !r.wholeCell))
|
|
416
430
|
}, "▢", 2),
|
|
417
|
-
|
|
431
|
+
s("button", {
|
|
418
432
|
class: "nav",
|
|
419
433
|
title: "上一个 (Shift+Enter)",
|
|
420
|
-
disabled: !
|
|
421
|
-
onClick:
|
|
422
|
-
}, "▲", 8,
|
|
423
|
-
|
|
434
|
+
disabled: !r.matchCount,
|
|
435
|
+
onClick: m[3] || (m[3] = (p) => i("prev"))
|
|
436
|
+
}, "▲", 8, kn),
|
|
437
|
+
s("button", {
|
|
424
438
|
class: "nav",
|
|
425
439
|
title: "下一个 (Enter)",
|
|
426
|
-
disabled: !
|
|
427
|
-
onClick:
|
|
428
|
-
}, "▼", 8,
|
|
429
|
-
|
|
440
|
+
disabled: !r.matchCount,
|
|
441
|
+
onClick: m[4] || (m[4] = (p) => i("next"))
|
|
442
|
+
}, "▼", 8, Cn),
|
|
443
|
+
s("button", {
|
|
430
444
|
class: "close",
|
|
431
445
|
title: "关闭 (Esc)",
|
|
432
|
-
onClick:
|
|
446
|
+
onClick: m[5] || (m[5] = (p) => i("close"))
|
|
433
447
|
}, "×")
|
|
434
448
|
], 32));
|
|
435
449
|
}
|
|
436
|
-
}),
|
|
450
|
+
}), wn = /* @__PURE__ */ Q(xn, [["__scopeId", "data-v-36abc020"]]), hn = { class: "sort" }, $n = { class: "all" }, Sn = ["checked"], En = { class: "list" }, Tn = ["checked", "onChange"], Fn = ["title"], In = {
|
|
437
451
|
key: 0,
|
|
438
452
|
class: "empty"
|
|
439
|
-
},
|
|
453
|
+
}, Mn = { class: "foot" }, Rn = /* @__PURE__ */ Z({
|
|
440
454
|
__name: "FilterPopup",
|
|
441
455
|
props: {
|
|
442
456
|
values: {},
|
|
@@ -446,305 +460,308 @@ const El = { class: "toolbar" }, Tl = ["title"], Fl = {
|
|
|
446
460
|
sortDir: {}
|
|
447
461
|
},
|
|
448
462
|
emits: ["apply", "clear", "close", "sort"],
|
|
449
|
-
setup(
|
|
450
|
-
const
|
|
451
|
-
const
|
|
452
|
-
return
|
|
453
|
-
}),
|
|
454
|
-
function p(
|
|
455
|
-
|
|
456
|
-
}
|
|
457
|
-
function
|
|
458
|
-
const
|
|
459
|
-
for (const
|
|
460
|
-
}
|
|
461
|
-
function
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
const
|
|
465
|
-
function z(
|
|
466
|
-
|
|
467
|
-
}
|
|
468
|
-
return
|
|
463
|
+
setup(r, { emit: b }) {
|
|
464
|
+
const f = r, i = b, y = C(""), g = Lt(new Set(f.selected.length ? f.selected : f.values)), d = I(() => {
|
|
465
|
+
const D = y.value.trim().toLowerCase();
|
|
466
|
+
return D ? f.values.filter((T) => T.toLowerCase().includes(D)) : f.values;
|
|
467
|
+
}), m = I(() => d.value.length > 0 && d.value.every((D) => g.has(D)));
|
|
468
|
+
function p(D) {
|
|
469
|
+
g.has(D) ? g.delete(D) : g.add(D);
|
|
470
|
+
}
|
|
471
|
+
function o() {
|
|
472
|
+
const D = !m.value;
|
|
473
|
+
for (const T of d.value) D ? g.add(T) : g.delete(T);
|
|
474
|
+
}
|
|
475
|
+
function u() {
|
|
476
|
+
i("apply", [...g]);
|
|
477
|
+
}
|
|
478
|
+
const R = C(null);
|
|
479
|
+
function z(D) {
|
|
480
|
+
R.value && !R.value.contains(D.target) && i("close");
|
|
481
|
+
}
|
|
482
|
+
return Je(() => setTimeout(() => document.addEventListener("mousedown", z), 0)), Ke(() => document.removeEventListener("mousedown", z)), (D, T) => (v(), c("div", {
|
|
469
483
|
class: "filter-pop",
|
|
470
484
|
ref_key: "rootEl",
|
|
471
|
-
ref:
|
|
472
|
-
style:
|
|
473
|
-
onKeydown:
|
|
485
|
+
ref: R,
|
|
486
|
+
style: _e({ left: r.x + "px", top: r.y + "px" }),
|
|
487
|
+
onKeydown: T[5] || (T[5] = qe(() => {
|
|
474
488
|
}, ["stop"]))
|
|
475
489
|
}, [
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
class:
|
|
479
|
-
onClick:
|
|
490
|
+
s("div", hn, [
|
|
491
|
+
s("button", {
|
|
492
|
+
class: W({ on: r.sortDir === "asc" }),
|
|
493
|
+
onClick: T[0] || (T[0] = (k) => i("sort", "asc")),
|
|
480
494
|
title: "升序"
|
|
481
495
|
}, "↑ 升序", 2),
|
|
482
|
-
|
|
483
|
-
class:
|
|
484
|
-
onClick:
|
|
496
|
+
s("button", {
|
|
497
|
+
class: W({ on: r.sortDir === "desc" }),
|
|
498
|
+
onClick: T[1] || (T[1] = (k) => i("sort", "desc")),
|
|
485
499
|
title: "降序"
|
|
486
500
|
}, "↓ 降序", 2)
|
|
487
501
|
]),
|
|
488
|
-
|
|
502
|
+
B(s("input", {
|
|
489
503
|
class: "search",
|
|
490
504
|
type: "text",
|
|
491
505
|
placeholder: "搜索…",
|
|
492
|
-
"onUpdate:modelValue":
|
|
506
|
+
"onUpdate:modelValue": T[2] || (T[2] = (k) => y.value = k)
|
|
493
507
|
}, null, 512), [
|
|
494
|
-
[
|
|
508
|
+
[hl, y.value]
|
|
495
509
|
]),
|
|
496
|
-
|
|
497
|
-
|
|
510
|
+
s("label", $n, [
|
|
511
|
+
s("input", {
|
|
498
512
|
type: "checkbox",
|
|
499
|
-
checked:
|
|
500
|
-
onChange:
|
|
501
|
-
}, null, 40,
|
|
502
|
-
|
|
513
|
+
checked: m.value,
|
|
514
|
+
onChange: o
|
|
515
|
+
}, null, 40, Sn),
|
|
516
|
+
T[6] || (T[6] = N(" (全选) ", -1))
|
|
503
517
|
]),
|
|
504
|
-
|
|
505
|
-
(v(!0), c(
|
|
518
|
+
s("div", En, [
|
|
519
|
+
(v(!0), c(_, null, pe(d.value, (k) => (v(), c("label", {
|
|
506
520
|
key: k,
|
|
507
521
|
class: "row"
|
|
508
522
|
}, [
|
|
509
|
-
|
|
523
|
+
s("input", {
|
|
510
524
|
type: "checkbox",
|
|
511
|
-
checked:
|
|
512
|
-
onChange: (
|
|
513
|
-
}, null, 40,
|
|
514
|
-
|
|
525
|
+
checked: g.has(k),
|
|
526
|
+
onChange: (K) => p(k)
|
|
527
|
+
}, null, 40, Tn),
|
|
528
|
+
s("span", {
|
|
515
529
|
class: "val",
|
|
516
530
|
title: k
|
|
517
|
-
},
|
|
531
|
+
}, F(k), 9, Fn)
|
|
518
532
|
]))), 128)),
|
|
519
|
-
|
|
533
|
+
d.value.length ? M("", !0) : (v(), c("div", In, "无匹配值"))
|
|
520
534
|
]),
|
|
521
|
-
|
|
522
|
-
|
|
535
|
+
s("div", Mn, [
|
|
536
|
+
s("button", {
|
|
523
537
|
class: "link",
|
|
524
|
-
onClick:
|
|
538
|
+
onClick: T[3] || (T[3] = (k) => i("clear"))
|
|
525
539
|
}, "清除筛选"),
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
onClick:
|
|
540
|
+
T[7] || (T[7] = s("div", { class: "grow" }, null, -1)),
|
|
541
|
+
s("button", {
|
|
542
|
+
onClick: T[4] || (T[4] = (k) => i("close"))
|
|
529
543
|
}, "取消"),
|
|
530
|
-
|
|
544
|
+
s("button", {
|
|
531
545
|
class: "primary",
|
|
532
|
-
onClick:
|
|
546
|
+
onClick: u
|
|
533
547
|
}, "确定")
|
|
534
548
|
])
|
|
535
549
|
], 36));
|
|
536
550
|
}
|
|
537
|
-
}),
|
|
551
|
+
}), Pn = /* @__PURE__ */ Q(Rn, [["__scopeId", "data-v-4b0bc283"]]), Dn = { class: "tb-menu" }, An = {
|
|
538
552
|
key: 0,
|
|
539
553
|
class: "sep"
|
|
540
|
-
},
|
|
554
|
+
}, zn = ["disabled", "onClick"], Ln = ["innerHTML"], Nn = {
|
|
541
555
|
key: 1,
|
|
542
556
|
class: "ic-e"
|
|
543
|
-
},
|
|
557
|
+
}, Vn = { class: "lb" }, Bn = /* @__PURE__ */ Z({
|
|
544
558
|
__name: "ToolbarMenu",
|
|
545
559
|
props: {
|
|
546
560
|
items: {}
|
|
547
561
|
},
|
|
548
562
|
emits: ["pick"],
|
|
549
|
-
setup(
|
|
550
|
-
const
|
|
551
|
-
return (
|
|
552
|
-
(v(!0), c(
|
|
553
|
-
key:
|
|
563
|
+
setup(r, { emit: b }) {
|
|
564
|
+
const f = b;
|
|
565
|
+
return (i, y) => (v(), c("div", Dn, [
|
|
566
|
+
(v(!0), c(_, null, pe(r.items, (g) => (v(), c(_, {
|
|
567
|
+
key: g.id
|
|
554
568
|
}, [
|
|
555
|
-
|
|
569
|
+
g.type === "separator" ? (v(), c("div", An)) : (v(), c("button", {
|
|
556
570
|
key: 1,
|
|
557
|
-
class:
|
|
558
|
-
disabled:
|
|
559
|
-
onClick: (
|
|
571
|
+
class: W(["mi", { active: g.active }]),
|
|
572
|
+
disabled: g.disabled,
|
|
573
|
+
onClick: (d) => f("pick", g)
|
|
560
574
|
}, [
|
|
561
|
-
|
|
575
|
+
g.iconSvg ? (v(), c("span", {
|
|
562
576
|
key: 0,
|
|
563
577
|
class: "ic",
|
|
564
|
-
innerHTML:
|
|
565
|
-
}, null, 8,
|
|
566
|
-
|
|
567
|
-
], 10,
|
|
578
|
+
innerHTML: S(ze)(g.iconSvg)
|
|
579
|
+
}, null, 8, Ln)) : g.icon ? (v(), c("span", Nn, F(g.icon), 1)) : M("", !0),
|
|
580
|
+
s("span", Vn, F(g.label || g.id), 1)
|
|
581
|
+
], 10, zn))
|
|
568
582
|
], 64))), 128))
|
|
569
583
|
]));
|
|
570
584
|
}
|
|
571
|
-
}),
|
|
585
|
+
}), At = /* @__PURE__ */ Q(Bn, [["__scopeId", "data-v-322e2c67"]]), Wn = {
|
|
572
586
|
key: 0,
|
|
573
587
|
class: "divider"
|
|
574
|
-
},
|
|
588
|
+
}, Hn = {
|
|
575
589
|
key: 1,
|
|
576
590
|
class: "tool"
|
|
577
|
-
},
|
|
591
|
+
}, On = ["innerHTML"], Un = {
|
|
578
592
|
key: 1,
|
|
579
593
|
class: "ic-e"
|
|
580
|
-
},
|
|
594
|
+
}, _n = {
|
|
581
595
|
key: 2,
|
|
582
596
|
class: "lb"
|
|
583
|
-
},
|
|
597
|
+
}, Kn = ["innerHTML"], qn = {
|
|
584
598
|
key: 0,
|
|
585
599
|
class: "divider"
|
|
586
|
-
},
|
|
600
|
+
}, Jn = {
|
|
587
601
|
key: 1,
|
|
588
602
|
class: "dd"
|
|
589
|
-
},
|
|
603
|
+
}, jn = ["disabled", "title", "onClick"], Gn = ["innerHTML"], Xn = {
|
|
590
604
|
key: 1,
|
|
591
605
|
class: "ic-e"
|
|
592
|
-
},
|
|
606
|
+
}, Zn = {
|
|
593
607
|
key: 2,
|
|
594
608
|
class: "lb"
|
|
595
|
-
},
|
|
609
|
+
}, Qn = ["innerHTML"], Yn = {
|
|
596
610
|
key: 0,
|
|
597
611
|
class: "dd more"
|
|
598
|
-
},
|
|
612
|
+
}, es = ["innerHTML"], ts = 46, zt = 4, ls = /* @__PURE__ */ Z({
|
|
599
613
|
__name: "ActionToolbar",
|
|
600
614
|
props: {
|
|
601
615
|
items: {}
|
|
602
616
|
},
|
|
603
|
-
setup(
|
|
604
|
-
const
|
|
605
|
-
function
|
|
606
|
-
var
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
}
|
|
610
|
-
const p =
|
|
611
|
-
const
|
|
612
|
-
if (
|
|
613
|
-
let x = 0,
|
|
614
|
-
for (let O = 0; O <
|
|
615
|
-
if (x +=
|
|
616
|
-
|
|
617
|
+
setup(r) {
|
|
618
|
+
const b = r, f = C(null), i = C(null), y = C([]), g = C(0), d = C(null);
|
|
619
|
+
function m() {
|
|
620
|
+
var A, x;
|
|
621
|
+
const $ = i.value;
|
|
622
|
+
$ && (y.value = Array.from($.children).map((Y) => Y.offsetWidth), g.value = (x = (A = f.value) == null ? void 0 : A.clientWidth) != null ? x : 0);
|
|
623
|
+
}
|
|
624
|
+
const p = I(() => {
|
|
625
|
+
const $ = g.value, A = y.value;
|
|
626
|
+
if (!$ || A.length !== b.items.length) return b.items.length;
|
|
627
|
+
let x = 0, Y = !0;
|
|
628
|
+
for (let O = 0; O < b.items.length; O++)
|
|
629
|
+
if (x += A[O] + zt, x > $) {
|
|
630
|
+
Y = !1;
|
|
617
631
|
break;
|
|
618
632
|
}
|
|
619
|
-
if (
|
|
620
|
-
let
|
|
621
|
-
for (let O = 0; O <
|
|
622
|
-
|
|
623
|
-
return Math.max(0,
|
|
624
|
-
}),
|
|
625
|
-
function z(
|
|
626
|
-
|
|
627
|
-
}
|
|
628
|
-
function
|
|
629
|
-
var
|
|
630
|
-
|
|
631
|
-
}
|
|
632
|
-
function
|
|
633
|
-
var
|
|
634
|
-
|
|
635
|
-
}
|
|
636
|
-
function k(
|
|
637
|
-
|
|
638
|
-
}
|
|
639
|
-
function
|
|
640
|
-
return
|
|
641
|
-
}
|
|
642
|
-
let
|
|
643
|
-
function
|
|
644
|
-
|
|
645
|
-
}
|
|
646
|
-
return
|
|
647
|
-
|
|
648
|
-
var
|
|
649
|
-
return
|
|
650
|
-
}),
|
|
651
|
-
}),
|
|
652
|
-
|
|
653
|
-
}),
|
|
654
|
-
() =>
|
|
655
|
-
|
|
656
|
-
|
|
633
|
+
if (Y) return b.items.length;
|
|
634
|
+
let ge = ts, be = 0;
|
|
635
|
+
for (let O = 0; O < b.items.length && (ge += A[O] + zt, !(ge > $)); O++)
|
|
636
|
+
be++;
|
|
637
|
+
return Math.max(0, be);
|
|
638
|
+
}), o = I(() => b.items.slice(0, p.value)), u = I(() => b.items.slice(p.value)), R = Ue.more;
|
|
639
|
+
function z($) {
|
|
640
|
+
d.value = d.value === $ ? null : $;
|
|
641
|
+
}
|
|
642
|
+
function D($) {
|
|
643
|
+
var A;
|
|
644
|
+
$.disabled || (A = $.onClick) == null || A.call($);
|
|
645
|
+
}
|
|
646
|
+
function T($) {
|
|
647
|
+
var A;
|
|
648
|
+
$.disabled || ((A = $.items) != null && A.length ? z($.id) : (D($), d.value = null));
|
|
649
|
+
}
|
|
650
|
+
function k($) {
|
|
651
|
+
D($), d.value = null;
|
|
652
|
+
}
|
|
653
|
+
function K($) {
|
|
654
|
+
return $.iconSvg ? ze($.iconSvg) : null;
|
|
655
|
+
}
|
|
656
|
+
let q = null;
|
|
657
|
+
function ne($) {
|
|
658
|
+
f.value && !f.value.contains($.target) && (d.value = null);
|
|
659
|
+
}
|
|
660
|
+
return Je(() => {
|
|
661
|
+
me(m), q = new ResizeObserver(() => {
|
|
662
|
+
var $, A;
|
|
663
|
+
return g.value = (A = ($ = f.value) == null ? void 0 : $.clientWidth) != null ? A : 0;
|
|
664
|
+
}), f.value && q.observe(f.value), document.addEventListener("mousedown", ne);
|
|
665
|
+
}), Ke(() => {
|
|
666
|
+
q == null || q.disconnect(), document.removeEventListener("mousedown", ne);
|
|
667
|
+
}), L(
|
|
668
|
+
() => b.items.map(($) => {
|
|
669
|
+
var A;
|
|
670
|
+
return $.id + ((A = $.label) != null ? A : "");
|
|
671
|
+
}).join("|"),
|
|
672
|
+
() => me(m)
|
|
673
|
+
), ($, A) => (v(), c("div", {
|
|
657
674
|
class: "action-toolbar",
|
|
658
675
|
ref_key: "containerEl",
|
|
659
|
-
ref:
|
|
676
|
+
ref: f
|
|
660
677
|
}, [
|
|
661
|
-
|
|
678
|
+
s("div", {
|
|
662
679
|
class: "measure",
|
|
663
680
|
ref_key: "measureEl",
|
|
664
|
-
ref:
|
|
681
|
+
ref: i,
|
|
665
682
|
"aria-hidden": "true"
|
|
666
683
|
}, [
|
|
667
|
-
(v(!0), c(
|
|
684
|
+
(v(!0), c(_, null, pe(r.items, (x) => (v(), c(_, {
|
|
668
685
|
key: "m" + x.id
|
|
669
686
|
}, [
|
|
670
|
-
x.type === "separator" ? (v(), c("span",
|
|
671
|
-
|
|
687
|
+
x.type === "separator" ? (v(), c("span", Wn)) : (v(), c("button", Hn, [
|
|
688
|
+
K(x) ? (v(), c("span", {
|
|
672
689
|
key: 0,
|
|
673
690
|
class: "ic",
|
|
674
|
-
innerHTML:
|
|
675
|
-
}, null, 8,
|
|
676
|
-
x.label ? (v(), c("span",
|
|
691
|
+
innerHTML: K(x)
|
|
692
|
+
}, null, 8, On)) : x.icon ? (v(), c("span", Un, F(x.icon), 1)) : M("", !0),
|
|
693
|
+
x.label ? (v(), c("span", _n, F(x.label), 1)) : M("", !0),
|
|
677
694
|
x.items ? (v(), c("span", {
|
|
678
695
|
key: 3,
|
|
679
696
|
class: "caret",
|
|
680
|
-
innerHTML:
|
|
681
|
-
}, null, 8,
|
|
697
|
+
innerHTML: S(ze)(S(Ue).caret)
|
|
698
|
+
}, null, 8, Kn)) : M("", !0)
|
|
682
699
|
]))
|
|
683
700
|
], 64))), 128))
|
|
684
701
|
], 512),
|
|
685
|
-
(v(!0), c(
|
|
702
|
+
(v(!0), c(_, null, pe(o.value, (x) => (v(), c(_, {
|
|
686
703
|
key: x.id
|
|
687
704
|
}, [
|
|
688
|
-
x.type === "separator" ? (v(), c("span",
|
|
689
|
-
|
|
690
|
-
class:
|
|
705
|
+
x.type === "separator" ? (v(), c("span", qn)) : (v(), c("div", Jn, [
|
|
706
|
+
s("button", {
|
|
707
|
+
class: W(["tool", { active: x.active, open: d.value === x.id }]),
|
|
691
708
|
disabled: x.disabled,
|
|
692
709
|
title: x.title || x.label || x.id,
|
|
693
|
-
onClick: (
|
|
710
|
+
onClick: (Y) => T(x)
|
|
694
711
|
}, [
|
|
695
|
-
|
|
712
|
+
K(x) ? (v(), c("span", {
|
|
696
713
|
key: 0,
|
|
697
714
|
class: "ic",
|
|
698
|
-
innerHTML:
|
|
699
|
-
}, null, 8,
|
|
700
|
-
x.label ? (v(), c("span",
|
|
715
|
+
innerHTML: K(x)
|
|
716
|
+
}, null, 8, Gn)) : x.icon ? (v(), c("span", Xn, F(x.icon), 1)) : M("", !0),
|
|
717
|
+
x.label ? (v(), c("span", Zn, F(x.label), 1)) : M("", !0),
|
|
701
718
|
x.items ? (v(), c("span", {
|
|
702
719
|
key: 3,
|
|
703
720
|
class: "caret",
|
|
704
|
-
innerHTML:
|
|
705
|
-
}, null, 8,
|
|
706
|
-
], 10,
|
|
707
|
-
x.items &&
|
|
721
|
+
innerHTML: S(ze)(S(Ue).caret)
|
|
722
|
+
}, null, 8, Qn)) : M("", !0)
|
|
723
|
+
], 10, jn),
|
|
724
|
+
x.items && d.value === x.id ? (v(), re(At, {
|
|
708
725
|
key: 0,
|
|
709
726
|
items: x.items,
|
|
710
727
|
onPick: k
|
|
711
|
-
}, null, 8, ["items"])) :
|
|
728
|
+
}, null, 8, ["items"])) : M("", !0)
|
|
712
729
|
]))
|
|
713
730
|
], 64))), 128)),
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
class:
|
|
731
|
+
u.value.length ? (v(), c("div", Yn, [
|
|
732
|
+
s("button", {
|
|
733
|
+
class: W(["tool", { open: d.value === "__more" }]),
|
|
717
734
|
title: "更多",
|
|
718
|
-
onClick:
|
|
735
|
+
onClick: A[0] || (A[0] = (x) => z("__more"))
|
|
719
736
|
}, [
|
|
720
|
-
|
|
737
|
+
s("span", {
|
|
721
738
|
class: "ic",
|
|
722
|
-
innerHTML:
|
|
723
|
-
}, null, 8,
|
|
739
|
+
innerHTML: S(ze)(S(R))
|
|
740
|
+
}, null, 8, es)
|
|
724
741
|
], 2),
|
|
725
|
-
|
|
742
|
+
d.value === "__more" ? (v(), re(At, {
|
|
726
743
|
key: 0,
|
|
727
|
-
items:
|
|
744
|
+
items: u.value,
|
|
728
745
|
onPick: k
|
|
729
|
-
}, null, 8, ["items"])) :
|
|
730
|
-
])) :
|
|
746
|
+
}, null, 8, ["items"])) : M("", !0)
|
|
747
|
+
])) : M("", !0)
|
|
731
748
|
], 512));
|
|
732
749
|
}
|
|
733
|
-
}),
|
|
750
|
+
}), ns = /* @__PURE__ */ Q(ls, [["__scopeId", "data-v-0a4aa655"]]), ss = {
|
|
734
751
|
key: 0,
|
|
735
752
|
class: "export-progress-overlay",
|
|
736
753
|
role: "dialog",
|
|
737
754
|
"aria-modal": "true",
|
|
738
755
|
"aria-live": "polite"
|
|
739
|
-
},
|
|
756
|
+
}, as = { class: "card" }, os = { class: "title" }, is = { class: "row" }, us = { class: "pct" }, rs = /* @__PURE__ */ Z({
|
|
740
757
|
__name: "ExportProgressOverlay",
|
|
741
758
|
props: {
|
|
742
759
|
state: {},
|
|
743
760
|
busy: { type: Boolean }
|
|
744
761
|
},
|
|
745
762
|
emits: ["cancel"],
|
|
746
|
-
setup(
|
|
747
|
-
const
|
|
763
|
+
setup(r, { emit: b }) {
|
|
764
|
+
const f = b, i = {
|
|
748
765
|
render: "渲染中",
|
|
749
766
|
compose: "合成中",
|
|
750
767
|
paginate: "分页中",
|
|
@@ -752,53 +769,53 @@ const El = { class: "toolbar" }, Tl = ["title"], Fl = {
|
|
|
752
769
|
zip: "zip 压缩",
|
|
753
770
|
convert: "批量转换"
|
|
754
771
|
};
|
|
755
|
-
return (y,
|
|
756
|
-
var
|
|
757
|
-
return v(),
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
class:
|
|
772
|
+
return (y, g) => {
|
|
773
|
+
var d, m, p, o, u, R, z;
|
|
774
|
+
return v(), re($l, { to: "body" }, [
|
|
775
|
+
r.busy ? (v(), c("div", ss, [
|
|
776
|
+
s("div", as, [
|
|
777
|
+
s("div", os, F(((d = r.state) == null ? void 0 : d.label) || i[(p = (m = r.state) == null ? void 0 : m.stage) != null ? p : ""] || "处理中…"), 1),
|
|
778
|
+
s("div", {
|
|
779
|
+
class: W(["bar", { indeterminate: ((o = r.state) == null ? void 0 : o.ratio) == null }])
|
|
763
780
|
}, [
|
|
764
|
-
((
|
|
781
|
+
((u = r.state) == null ? void 0 : u.ratio) != null ? (v(), c("div", {
|
|
765
782
|
key: 0,
|
|
766
783
|
class: "fill",
|
|
767
|
-
style:
|
|
768
|
-
}, null, 4)) :
|
|
784
|
+
style: _e({ width: Math.round(((R = r.state.ratio) != null ? R : 0) * 100) + "%" })
|
|
785
|
+
}, null, 4)) : M("", !0)
|
|
769
786
|
], 2),
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
787
|
+
s("div", is, [
|
|
788
|
+
s("span", us, F(((z = r.state) == null ? void 0 : z.ratio) != null ? Math.round(r.state.ratio * 100) + "%" : "正在处理…"), 1),
|
|
789
|
+
s("button", {
|
|
773
790
|
class: "cancel",
|
|
774
|
-
onClick:
|
|
791
|
+
onClick: g[0] || (g[0] = (D) => f("cancel")),
|
|
775
792
|
title: "按 Esc 也可取消"
|
|
776
793
|
}, "取消")
|
|
777
794
|
])
|
|
778
795
|
])
|
|
779
|
-
])) :
|
|
796
|
+
])) : M("", !0)
|
|
780
797
|
]);
|
|
781
798
|
};
|
|
782
799
|
}
|
|
783
|
-
}),
|
|
800
|
+
}), ds = /* @__PURE__ */ Q(rs, [["__scopeId", "data-v-629027ad"]]), vs = {
|
|
784
801
|
key: 2,
|
|
785
802
|
class: "formula-bar"
|
|
786
|
-
},
|
|
803
|
+
}, cs = { class: "addr" }, fs = ["value", "title"], ms = ["title"], ps = { class: "ov-slot" }, gs = {
|
|
787
804
|
key: 3,
|
|
788
805
|
class: "state"
|
|
789
|
-
},
|
|
806
|
+
}, bs = { class: "loader" }, ys = { class: "loader-label" }, ks = { key: 0 }, Cs = { class: "loader-track" }, xs = {
|
|
790
807
|
key: 1,
|
|
791
808
|
class: "loader-fill indeterminate"
|
|
792
|
-
},
|
|
809
|
+
}, ws = {
|
|
793
810
|
key: 4,
|
|
794
811
|
class: "state error"
|
|
795
|
-
},
|
|
812
|
+
}, hs = {
|
|
796
813
|
key: 5,
|
|
797
814
|
class: "state hint"
|
|
798
|
-
},
|
|
815
|
+
}, $s = {
|
|
799
816
|
key: 3,
|
|
800
817
|
class: "status-bar"
|
|
801
|
-
},
|
|
818
|
+
}, Ss = { class: "sel" }, Es = { key: 1 }, Ts = /* @__PURE__ */ Z({
|
|
802
819
|
__name: "ExcelViewer",
|
|
803
820
|
props: {
|
|
804
821
|
src: {},
|
|
@@ -828,652 +845,838 @@ const El = { class: "toolbar" }, Tl = ["title"], Fl = {
|
|
|
828
845
|
contextMenu: { type: [Boolean, Function], default: void 0 }
|
|
829
846
|
},
|
|
830
847
|
emits: ["rendered", "error", "progress", "cell-click", "cell-dblclick", "selection-change", "sheet-change", "hyperlink-click", "cell-change", "edit-start", "edit-commit", "dim-change", "dirty-change", "image-change", "struct-change", "permission-denied", "before-context-menu", "context-menu"],
|
|
831
|
-
setup(
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
848
|
+
setup(r, { expose: b, emit: f }) {
|
|
849
|
+
const i = r, y = I(() => {
|
|
850
|
+
var e;
|
|
851
|
+
return (e = i.plugins) != null ? e : [];
|
|
852
|
+
}), g = I(
|
|
853
|
+
() => Object.assign({}, ...y.value.map((e) => e.theme || {}), i.theme || {})
|
|
854
|
+
), d = I(() => !!i.cellStyle || y.value.some((e) => e.cellStyle));
|
|
855
|
+
function m(e, l, n) {
|
|
856
|
+
let a;
|
|
857
|
+
const h = (E) => {
|
|
858
|
+
const w = E == null ? void 0 : E(e, l, n);
|
|
859
|
+
w && (a = V(V({}, a || {}), w));
|
|
840
860
|
};
|
|
841
|
-
for (const
|
|
842
|
-
return
|
|
861
|
+
for (const E of y.value) h(E.cellStyle);
|
|
862
|
+
return h(i.cellStyle), a;
|
|
843
863
|
}
|
|
844
864
|
function p(e) {
|
|
865
|
+
var n, a;
|
|
845
866
|
let l = e;
|
|
846
|
-
for (const
|
|
847
|
-
return
|
|
848
|
-
}
|
|
849
|
-
const
|
|
850
|
-
editable:
|
|
851
|
-
cellReadOnly:
|
|
852
|
-
readOnlyRanges:
|
|
853
|
-
editableTargets:
|
|
854
|
-
strictDimensions:
|
|
855
|
-
recalc:
|
|
856
|
-
formulaEngine:
|
|
867
|
+
for (const h of y.value) h.transformModel && (l = (n = h.transformModel(l)) != null ? n : l);
|
|
868
|
+
return i.transformModel && (l = (a = i.transformModel(l)) != null ? a : l), l;
|
|
869
|
+
}
|
|
870
|
+
const o = I(() => ({
|
|
871
|
+
editable: i.editable,
|
|
872
|
+
cellReadOnly: i.cellReadOnly,
|
|
873
|
+
readOnlyRanges: i.readOnlyRanges,
|
|
874
|
+
editableTargets: i.editableTargets,
|
|
875
|
+
strictDimensions: i.strictDimensions,
|
|
876
|
+
recalc: i.recalc,
|
|
877
|
+
formulaEngine: i.formulaEngine
|
|
857
878
|
}));
|
|
858
|
-
function
|
|
859
|
-
var
|
|
860
|
-
const
|
|
861
|
-
if (
|
|
862
|
-
for (const
|
|
863
|
-
const
|
|
864
|
-
if (
|
|
879
|
+
function u(e, l) {
|
|
880
|
+
var a, h;
|
|
881
|
+
const n = (a = i.editor) == null ? void 0 : a.call(i, e, l);
|
|
882
|
+
if (n) return n;
|
|
883
|
+
for (const E of y.value) {
|
|
884
|
+
const w = (h = E.editor) == null ? void 0 : h.call(E, e, l);
|
|
885
|
+
if (w) return w;
|
|
865
886
|
}
|
|
866
887
|
}
|
|
867
|
-
const
|
|
868
|
-
function
|
|
869
|
-
return e ?
|
|
888
|
+
const R = I(() => !!i.editor || y.value.some((e) => e.editor)), z = f, { loading: D, error: T, workbook: k, load: K, loadModel: q, progress: ne, sourceBuffer: $ } = Ll();
|
|
889
|
+
function A(e) {
|
|
890
|
+
return e ? Al(e) ? e : zl(e, i.jsonOptions) : null;
|
|
870
891
|
}
|
|
871
|
-
const x = C(null),
|
|
892
|
+
const x = C(null), Y = C(null), ge = I(() => {
|
|
893
|
+
var e, l;
|
|
894
|
+
return (l = (e = x.value) != null ? e : i.templateFile) != null ? l : null;
|
|
895
|
+
}), be = I(() => {
|
|
896
|
+
var e, l;
|
|
897
|
+
return (l = (e = Y.value) != null ? e : i.templateName) != null ? l : "";
|
|
898
|
+
});
|
|
872
899
|
function O(e, l) {
|
|
873
|
-
x.value = e,
|
|
900
|
+
x.value = e, Y.value = l;
|
|
874
901
|
}
|
|
875
|
-
function
|
|
902
|
+
function yt() {
|
|
876
903
|
O(null, null);
|
|
877
904
|
}
|
|
878
|
-
const
|
|
879
|
-
function
|
|
905
|
+
const kt = C(null);
|
|
906
|
+
function Ht() {
|
|
880
907
|
var e;
|
|
881
|
-
(e =
|
|
908
|
+
(e = kt.value) == null || e.click();
|
|
882
909
|
}
|
|
883
|
-
function
|
|
884
|
-
var
|
|
885
|
-
const l = (
|
|
910
|
+
function Ot(e) {
|
|
911
|
+
var n;
|
|
912
|
+
const l = (n = e.target.files) == null ? void 0 : n[0];
|
|
886
913
|
l && (O(l, l.name), e.target.value = "");
|
|
887
914
|
}
|
|
888
|
-
const
|
|
915
|
+
const Ut = I(() => {
|
|
889
916
|
var e, l;
|
|
890
|
-
return
|
|
917
|
+
return i.fileName ? i.fileName : i.workbook ? "JSON 数据" : ((l = (e = k.value) == null ? void 0 : e.sheets[0]) == null ? void 0 : l.name) || "";
|
|
891
918
|
});
|
|
892
|
-
async function
|
|
893
|
-
const l = await
|
|
894
|
-
if (
|
|
895
|
-
if (
|
|
896
|
-
if (
|
|
897
|
-
const
|
|
898
|
-
return
|
|
899
|
-
}
|
|
900
|
-
async function
|
|
901
|
-
const e =
|
|
902
|
-
if (
|
|
903
|
-
e && console.warn("[ooxml-excel-editor] :templateFile 只在 :workbook (JSON / 模型) 数据源下生效;xlsx 数据源已自带格式,模板已忽略."), await
|
|
919
|
+
async function _t(e) {
|
|
920
|
+
const l = await Nt(e), n = Vt(l);
|
|
921
|
+
if (n === "xls") throw new Error("模板文件是旧版 .xls 或加密,仅支持 .xlsx/.xlsm");
|
|
922
|
+
if (n === "not-zip") throw new Error("模板文件不是有效的 .xlsx(非 ZIP 包)");
|
|
923
|
+
if (n === "empty") throw new Error("模板文件为空");
|
|
924
|
+
const a = await Wt(l);
|
|
925
|
+
return Bt(a), a;
|
|
926
|
+
}
|
|
927
|
+
async function Ct() {
|
|
928
|
+
const e = ge.value, l = A(i.workbook);
|
|
929
|
+
if (i.src) {
|
|
930
|
+
e && console.warn("[ooxml-excel-editor] :templateFile 只在 :workbook (JSON / 模型) 数据源下生效;xlsx 数据源已自带格式,模板已忽略."), await K(i.src, p);
|
|
904
931
|
return;
|
|
905
932
|
}
|
|
906
933
|
if (l && e) {
|
|
907
934
|
try {
|
|
908
|
-
const
|
|
909
|
-
|
|
910
|
-
} catch (
|
|
911
|
-
console.error("[ooxml-excel-editor] 模板加载失败,降级为纯 JSON 渲染:",
|
|
935
|
+
const n = await _t(e), a = Dl(l, n);
|
|
936
|
+
q(a, p);
|
|
937
|
+
} catch (n) {
|
|
938
|
+
console.error("[ooxml-excel-editor] 模板加载失败,降级为纯 JSON 渲染:", n), q(l, p);
|
|
912
939
|
}
|
|
913
940
|
return;
|
|
914
941
|
}
|
|
915
942
|
if (l) {
|
|
916
|
-
|
|
943
|
+
q(l, p);
|
|
917
944
|
return;
|
|
918
945
|
}
|
|
919
|
-
e && await
|
|
946
|
+
e && await K(e, p);
|
|
920
947
|
}
|
|
921
|
-
const
|
|
922
|
-
const e =
|
|
948
|
+
const xt = I(() => {
|
|
949
|
+
const e = ne.value;
|
|
923
950
|
return e ? e.stage === "read" ? "读取文件…" : e.stage === "parse" ? "解析中…" : "构建表格…" : "";
|
|
924
|
-
}),
|
|
925
|
-
const e =
|
|
951
|
+
}), ye = I(() => {
|
|
952
|
+
const e = ne.value;
|
|
926
953
|
return e && e.ratio != null ? Math.round(e.ratio * 100) : null;
|
|
927
|
-
}),
|
|
954
|
+
}), J = C(0), j = C(1), Kt = C(null), ke = C(null), je = C(null), se = C(null), Ge = C(null), Xe = C(null), Ze = C(null), Qe = C(null), de = gt(null), qt = C({ scrollX: 0, scrollY: 0, width: 0, height: 0, zoom: 1 }), Ce = I(() => {
|
|
955
|
+
var l, n;
|
|
928
956
|
const e = k.value;
|
|
929
|
-
return e
|
|
930
|
-
}),
|
|
957
|
+
return e && (n = (l = e.sheets[J.value]) != null ? l : e.sheets[0]) != null ? n : null;
|
|
958
|
+
}), ae = C(0), Ye = C(null), et = C(null);
|
|
931
959
|
let t = null;
|
|
932
|
-
function
|
|
960
|
+
function Ne() {
|
|
933
961
|
t == null || t.render();
|
|
934
962
|
}
|
|
935
|
-
function
|
|
963
|
+
function Jt() {
|
|
936
964
|
t == null || t.measure();
|
|
937
965
|
}
|
|
938
|
-
function
|
|
939
|
-
const e =
|
|
940
|
-
!e || !l || !t || (t.rebuild(e, l,
|
|
941
|
-
theme:
|
|
942
|
-
cellStyle:
|
|
943
|
-
cellImageFit:
|
|
944
|
-
readOnlyCellStyle:
|
|
966
|
+
function tt() {
|
|
967
|
+
const e = Ce.value, l = k.value;
|
|
968
|
+
!e || !l || !t || (t.rebuild(e, l, j.value, {
|
|
969
|
+
theme: g.value,
|
|
970
|
+
cellStyle: d.value ? m : void 0,
|
|
971
|
+
cellImageFit: i.cellImageFit,
|
|
972
|
+
readOnlyCellStyle: i.readOnlyCellStyle
|
|
945
973
|
// Phase C 2026-06-08
|
|
946
|
-
}), t.setSourceBuffer(
|
|
974
|
+
}), t.setSourceBuffer($.value));
|
|
947
975
|
}
|
|
948
|
-
function
|
|
949
|
-
const e =
|
|
950
|
-
e && (
|
|
976
|
+
function jt() {
|
|
977
|
+
const e = se.value;
|
|
978
|
+
e && (oe.value = null, t == null || t.setScroll(e.scrollLeft, e.scrollTop));
|
|
951
979
|
}
|
|
952
|
-
let
|
|
953
|
-
|
|
954
|
-
|
|
980
|
+
let xe = null;
|
|
981
|
+
Je(() => {
|
|
982
|
+
Rt(), je.value && ke.value && se.value && Ye.value && et.value && Ge.value && Xe.value && Ze.value && Qe.value && (t = new El(
|
|
955
983
|
{
|
|
956
|
-
canvas:
|
|
957
|
-
renderArea:
|
|
958
|
-
scroller:
|
|
959
|
-
spacer:
|
|
960
|
-
overlays: { main:
|
|
961
|
-
editorSlot:
|
|
984
|
+
canvas: je.value,
|
|
985
|
+
renderArea: ke.value,
|
|
986
|
+
scroller: se.value,
|
|
987
|
+
spacer: Ye.value,
|
|
988
|
+
overlays: { main: Ge.value, frow: Xe.value, fcol: Ze.value, corner: Qe.value },
|
|
989
|
+
editorSlot: et.value
|
|
962
990
|
},
|
|
963
991
|
{
|
|
964
|
-
onRenderer: (e) =>
|
|
965
|
-
onRenderTick: () =>
|
|
966
|
-
onSelectionChange: () =>
|
|
967
|
-
onCellClick: (e, l,
|
|
968
|
-
onCellDblClick: (e, l,
|
|
992
|
+
onRenderer: (e) => de.value = e,
|
|
993
|
+
onRenderTick: () => ae.value++,
|
|
994
|
+
onSelectionChange: () => ee.value++,
|
|
995
|
+
onCellClick: (e, l, n) => ve("cell-click", { row: e, col: l, text: n }),
|
|
996
|
+
onCellDblClick: (e, l, n) => ve("cell-dblclick", { row: e, col: l, text: n }),
|
|
969
997
|
onHyperlink: (e, l) => {
|
|
970
|
-
|
|
998
|
+
ve("hyperlink-click", { url: e, cell: l }), i.openLinks && window.open(e, "_blank", "noopener");
|
|
971
999
|
},
|
|
972
|
-
onTooltip: (e) =>
|
|
973
|
-
onFindChange: () =>
|
|
974
|
-
onFilterChange: () =>
|
|
975
|
-
onEditEvent: (e, l) =>
|
|
1000
|
+
onTooltip: (e) => oe.value = e,
|
|
1001
|
+
onFindChange: () => it.value++,
|
|
1002
|
+
onFilterChange: () => ut.value++,
|
|
1003
|
+
onEditEvent: (e, l) => ve(e, l),
|
|
976
1004
|
onContextMenuBefore: (e) => {
|
|
977
1005
|
for (const l of y.value)
|
|
978
1006
|
if (l.contextMenu) {
|
|
979
|
-
const
|
|
980
|
-
Array.isArray(
|
|
1007
|
+
const n = l.contextMenu(e.ctx, e.items);
|
|
1008
|
+
Array.isArray(n) && e.items.splice(0, e.items.length, ...n);
|
|
981
1009
|
}
|
|
982
|
-
|
|
1010
|
+
i.contextMenu === !1 && e.preventDefault(), z("before-context-menu", e);
|
|
983
1011
|
},
|
|
984
1012
|
onContextMenuShow: (e) => z("context-menu", e)
|
|
985
1013
|
}
|
|
986
|
-
),
|
|
987
|
-
|
|
988
|
-
}),
|
|
989
|
-
}),
|
|
990
|
-
|
|
991
|
-
}),
|
|
992
|
-
|
|
993
|
-
}),
|
|
1014
|
+
), qt.value = t.view, t.fileName = i.fileName, t.setEditConfig(o.value), t.setEditorResolver(R.value ? u : void 0), t.setLightboxEnabled(i.imageLightbox !== !1), t.setContextMenuTransform(typeof i.contextMenu == "function" ? i.contextMenu : null)), ct.value && (ue = new Tl(ct.value)), Ct(), xe = new ResizeObserver(() => {
|
|
1015
|
+
Jt(), Ne();
|
|
1016
|
+
}), ke.value && xe.observe(ke.value);
|
|
1017
|
+
}), Ke(() => {
|
|
1018
|
+
xe == null || xe.disconnect(), t == null || t.dispose(), ue == null || ue.dispose(), Oe.forEach((e) => e()), k.value && bt(k.value);
|
|
1019
|
+
}), L([() => i.src, () => i.workbook, () => i.templateFile, x], () => {
|
|
1020
|
+
Ct();
|
|
1021
|
+
}), L(() => i.fileName, (e) => {
|
|
994
1022
|
t && (t.fileName = e);
|
|
995
|
-
}),
|
|
1023
|
+
}), L(o, (e) => t == null ? void 0 : t.setEditConfig(e)), L(() => i.contextMenu, (e) => t == null ? void 0 : t.setContextMenuTransform(typeof e == "function" ? e : null)), L([() => i.editor, y], () => t == null ? void 0 : t.setEditorResolver(R.value ? u : void 0)), L(() => i.cellImageFit, (e) => {
|
|
996
1024
|
e && (t == null || t.setCellImageFit(e));
|
|
997
|
-
}),
|
|
998
|
-
() => [
|
|
1025
|
+
}), L(() => i.imageLightbox, (e) => t == null ? void 0 : t.setLightboxEnabled(e !== !1)), L(
|
|
1026
|
+
() => [g.value, i.cellStyle, i.plugins],
|
|
999
1027
|
() => {
|
|
1000
|
-
|
|
1028
|
+
de.value && tt();
|
|
1001
1029
|
},
|
|
1002
1030
|
{ deep: !0 }
|
|
1003
|
-
),
|
|
1004
|
-
e && (t == null || t.clearFilterState(),
|
|
1005
|
-
}),
|
|
1031
|
+
), L(() => i.plugins, () => Rt(), { deep: !1 }), L(k, async (e) => {
|
|
1032
|
+
e && (t == null || t.clearFilterState(), J.value = e.activeSheet, await me(), tt(), z("rendered", e));
|
|
1033
|
+
}), L(J, (e) => {
|
|
1006
1034
|
const l = k.value;
|
|
1007
|
-
l != null && l.sheets[e] &&
|
|
1008
|
-
}),
|
|
1035
|
+
l != null && l.sheets[e] && ve("sheet-change", { index: e, name: l.sheets[e].name });
|
|
1036
|
+
}), L(T, (e) => {
|
|
1009
1037
|
e && z("error", e);
|
|
1010
|
-
}),
|
|
1038
|
+
}), L(ne, (e) => {
|
|
1011
1039
|
e && z("progress", e);
|
|
1012
|
-
}),
|
|
1013
|
-
var
|
|
1014
|
-
l != null && (t == null || t.resetFilter((
|
|
1015
|
-
}),
|
|
1016
|
-
const
|
|
1017
|
-
|
|
1040
|
+
}), L(J, async (e, l) => {
|
|
1041
|
+
var n;
|
|
1042
|
+
l != null && (t == null || t.resetFilter((n = k.value) == null ? void 0 : n.sheets[l])), await me(), tt();
|
|
1043
|
+
}), L(j, (e) => t == null ? void 0 : t.setZoom(e));
|
|
1044
|
+
const ee = C(0), oe = C(null), te = I(() => {
|
|
1045
|
+
var e;
|
|
1046
|
+
return ee.value, de.value, (e = t == null ? void 0 : t.getSelection()) != null ? e : null;
|
|
1047
|
+
}), lt = I(() => {
|
|
1048
|
+
ee.value;
|
|
1018
1049
|
const e = t == null ? void 0 : t.getActiveCell();
|
|
1019
|
-
return e ?
|
|
1020
|
-
}),
|
|
1021
|
-
const e =
|
|
1022
|
-
return !e || e.top === e.bottom && e.left === e.right ? "" : `${
|
|
1023
|
-
}),
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1050
|
+
return e ? Le(e.col) + (e.row + 1) : "";
|
|
1051
|
+
}), wt = I(() => {
|
|
1052
|
+
const e = te.value;
|
|
1053
|
+
return !e || e.top === e.bottom && e.left === e.right ? "" : `${Le(e.left)}${e.top + 1}:${Le(e.right)}${e.bottom + 1}`;
|
|
1054
|
+
}), ht = I(() => {
|
|
1055
|
+
var n;
|
|
1056
|
+
ee.value;
|
|
1057
|
+
const e = de.value, l = t == null ? void 0 : t.getActiveCell();
|
|
1058
|
+
return !e || !l ? "" : (n = e.cellFormula(l.row, l.col)) != null ? n : e.cellText(l.row, l.col);
|
|
1059
|
+
}), G = C(""), we = C(!1), $t = C(null);
|
|
1060
|
+
function nt() {
|
|
1061
|
+
const e = $t.value;
|
|
1030
1062
|
e && (e.style.height = "auto", e.style.height = e.scrollHeight + "px");
|
|
1031
1063
|
}
|
|
1032
|
-
function
|
|
1033
|
-
|
|
1064
|
+
function Gt(e) {
|
|
1065
|
+
G.value = e.target.value, nt();
|
|
1034
1066
|
}
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
|
|
1067
|
+
const Xt = I(() => (ee.value, ae.value, !!(t != null && t.canEditActiveCell()))), Ve = I(() => {
|
|
1068
|
+
var e;
|
|
1069
|
+
return ee.value, ae.value, (e = t == null ? void 0 : t.getCellEditString()) != null ? e : "";
|
|
1070
|
+
});
|
|
1071
|
+
L(Ve, (e) => {
|
|
1072
|
+
we.value || (G.value = e);
|
|
1073
|
+
}, { immediate: !0 }), L(G, () => me(nt));
|
|
1074
|
+
function Zt() {
|
|
1075
|
+
we.value = !0, G.value = Ve.value, me(nt);
|
|
1041
1076
|
}
|
|
1042
|
-
function
|
|
1077
|
+
function St(e) {
|
|
1043
1078
|
var l;
|
|
1044
|
-
t == null || t.commitActiveCellValue(
|
|
1079
|
+
t == null || t.commitActiveCellValue(G.value, e), we.value = !1, G.value = Ve.value, e === "down" && ((l = se.value) == null || l.focus());
|
|
1045
1080
|
}
|
|
1046
|
-
function
|
|
1081
|
+
function Qt() {
|
|
1047
1082
|
var e;
|
|
1048
|
-
|
|
1083
|
+
we.value = !1, G.value = Ve.value, (e = se.value) == null || e.focus();
|
|
1049
1084
|
}
|
|
1050
|
-
function
|
|
1051
|
-
|
|
1085
|
+
function Yt() {
|
|
1086
|
+
we.value && St();
|
|
1052
1087
|
}
|
|
1053
|
-
function
|
|
1054
|
-
e.stopPropagation(), e.key === "Enter" ? (e.preventDefault(),
|
|
1088
|
+
function el(e) {
|
|
1089
|
+
e.stopPropagation(), e.key === "Enter" ? (e.preventDefault(), St("down")) : e.key === "Escape" && (e.preventDefault(), Qt());
|
|
1055
1090
|
}
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1058
|
-
|
|
1091
|
+
const H = I(() => {
|
|
1092
|
+
var n;
|
|
1093
|
+
ee.value;
|
|
1094
|
+
const e = de.value, l = (n = t == null ? void 0 : t.getSelection()) != null ? n : null;
|
|
1059
1095
|
return e && l ? e.selectionStats(l) : null;
|
|
1060
1096
|
});
|
|
1061
|
-
function
|
|
1097
|
+
function Be(e) {
|
|
1062
1098
|
return isFinite(e) ? e.toLocaleString("en-US", { maximumFractionDigits: 2 }) : "—";
|
|
1063
1099
|
}
|
|
1064
|
-
function
|
|
1100
|
+
function tl(e) {
|
|
1065
1101
|
t == null || t.onMouseDown(e);
|
|
1066
1102
|
}
|
|
1067
|
-
function
|
|
1103
|
+
function ll(e) {
|
|
1068
1104
|
t == null || t.onContextMenu(e);
|
|
1069
1105
|
}
|
|
1070
|
-
function
|
|
1106
|
+
function nl(e) {
|
|
1071
1107
|
t == null || t.onMouseMove(e);
|
|
1072
1108
|
}
|
|
1073
|
-
function
|
|
1109
|
+
function sl(e) {
|
|
1074
1110
|
t == null || t.onMouseUp(e);
|
|
1075
1111
|
}
|
|
1076
|
-
function
|
|
1112
|
+
function al() {
|
|
1077
1113
|
t == null || t.onMouseLeave();
|
|
1078
1114
|
}
|
|
1079
|
-
function
|
|
1115
|
+
function ol(e) {
|
|
1080
1116
|
t == null || t.onDblClick(e);
|
|
1081
1117
|
}
|
|
1082
|
-
function
|
|
1118
|
+
function il(e) {
|
|
1083
1119
|
t == null || t.onKeyDown(e);
|
|
1084
1120
|
}
|
|
1085
|
-
|
|
1121
|
+
L(te, (e) => {
|
|
1086
1122
|
const l = t == null ? void 0 : t.getActiveCell();
|
|
1087
|
-
e && l &&
|
|
1123
|
+
e && l && ve("selection-change", { range: e, active: l });
|
|
1088
1124
|
});
|
|
1089
|
-
function
|
|
1090
|
-
|
|
1125
|
+
function st(e, l) {
|
|
1126
|
+
var n;
|
|
1127
|
+
return (n = t == null ? void 0 : t.rectOf(e, l)) != null ? n : null;
|
|
1091
1128
|
}
|
|
1092
|
-
function
|
|
1093
|
-
|
|
1129
|
+
function at(e) {
|
|
1130
|
+
var l;
|
|
1131
|
+
return (l = t == null ? void 0 : t.rectOfRange(e)) != null ? l : null;
|
|
1094
1132
|
}
|
|
1095
|
-
const
|
|
1096
|
-
let
|
|
1097
|
-
function
|
|
1098
|
-
|
|
1099
|
-
}
|
|
1100
|
-
function
|
|
1101
|
-
if (
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1104
|
-
const
|
|
1105
|
-
var
|
|
1106
|
-
|
|
1107
|
-
}, signal:
|
|
1108
|
-
return l(
|
|
1109
|
-
|
|
1133
|
+
const he = C(null), We = C(!1);
|
|
1134
|
+
let $e = null;
|
|
1135
|
+
function Et() {
|
|
1136
|
+
$e == null || $e.abort();
|
|
1137
|
+
}
|
|
1138
|
+
function X(e, l) {
|
|
1139
|
+
if (i.exportProgress === !1) return l(e);
|
|
1140
|
+
const n = new AbortController();
|
|
1141
|
+
$e = n, e != null && e.signal && (e.signal.aborted ? n.abort() : e.signal.addEventListener("abort", () => n.abort(), { once: !0 })), We.value = !0, he.value = null;
|
|
1142
|
+
const a = (E) => {
|
|
1143
|
+
var w;
|
|
1144
|
+
he.value = E, (w = e == null ? void 0 : e.onProgress) == null || w.call(e, E);
|
|
1145
|
+
}, h = fe(V({}, e != null ? e : {}), { onProgress: a, signal: n.signal });
|
|
1146
|
+
return l(h).finally(() => {
|
|
1147
|
+
We.value = !1, he.value = null, $e = null;
|
|
1110
1148
|
});
|
|
1111
1149
|
}
|
|
1112
|
-
const
|
|
1113
|
-
async function
|
|
1150
|
+
const ul = (e) => X(e, (l) => t.exportImage(l)), Se = (e) => X(e, (l) => t.downloadImage(l)), rl = (e) => X(e, (l) => t.exportPdf(l)), Ee = (e) => X(e, (l) => t.downloadPdf(l)), Te = (e) => X(e, (l) => t.print(l));
|
|
1151
|
+
async function Tt() {
|
|
1114
1152
|
try {
|
|
1115
|
-
await
|
|
1153
|
+
await Ee();
|
|
1116
1154
|
} catch (e) {
|
|
1117
|
-
|
|
1155
|
+
ot(e);
|
|
1118
1156
|
}
|
|
1119
1157
|
}
|
|
1120
|
-
async function
|
|
1158
|
+
async function Ft() {
|
|
1121
1159
|
try {
|
|
1122
|
-
await
|
|
1160
|
+
await Ee({ vector: !0 });
|
|
1123
1161
|
} catch (e) {
|
|
1124
|
-
|
|
1162
|
+
ot(e);
|
|
1125
1163
|
}
|
|
1126
1164
|
}
|
|
1127
|
-
function
|
|
1165
|
+
function ot(e) {
|
|
1128
1166
|
const l = (e == null ? void 0 : e.message) || String(e);
|
|
1129
|
-
console.error("[ooxml-excel-editor] 导出失败:", e), z("error", l), typeof window
|
|
1167
|
+
console.error("[ooxml-excel-editor] 导出失败:", e), z("error", l), typeof window != "undefined" && window.alert && window.alert(l);
|
|
1130
1168
|
}
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
|
|
1169
|
+
const Fe = C(!1), it = C(0), Ie = I(() => {
|
|
1170
|
+
var e;
|
|
1171
|
+
return it.value, (e = t == null ? void 0 : t.getFindState()) != null ? e : { query: "", matchCase: !1, wholeCell: !1, count: 0, index: -1 };
|
|
1172
|
+
});
|
|
1173
|
+
function It() {
|
|
1174
|
+
Fe.value = !0;
|
|
1134
1175
|
}
|
|
1135
|
-
function
|
|
1176
|
+
function Mt() {
|
|
1136
1177
|
var e;
|
|
1137
|
-
|
|
1178
|
+
Fe.value = !1, t == null || t.clearFind(), (e = se.value) == null || e.focus();
|
|
1138
1179
|
}
|
|
1139
|
-
function
|
|
1140
|
-
(e.ctrlKey || e.metaKey) && (e.key === "f" || e.key === "F") && (e.preventDefault(),
|
|
1180
|
+
function dl(e) {
|
|
1181
|
+
(e.ctrlKey || e.metaKey) && (e.key === "f" || e.key === "F") && (e.preventDefault(), It());
|
|
1141
1182
|
}
|
|
1142
|
-
const
|
|
1143
|
-
|
|
1183
|
+
const ut = C(0), ie = I(() => {
|
|
1184
|
+
var e;
|
|
1185
|
+
return ut.value, (e = t == null ? void 0 : t.getFilterPopup()) != null ? e : null;
|
|
1186
|
+
});
|
|
1187
|
+
function vl() {
|
|
1144
1188
|
t == null || t.toggleAutoFilter();
|
|
1145
1189
|
}
|
|
1146
|
-
function
|
|
1147
|
-
const e =
|
|
1190
|
+
function cl() {
|
|
1191
|
+
const e = Ce.value, l = de.value;
|
|
1148
1192
|
if (!e || !l) return;
|
|
1149
|
-
const
|
|
1150
|
-
if (
|
|
1193
|
+
const n = e.freeze;
|
|
1194
|
+
if (n.frozenRows || n.frozenCols)
|
|
1151
1195
|
e.freeze = { frozenRows: 0, frozenCols: 0 };
|
|
1152
1196
|
else {
|
|
1153
|
-
const
|
|
1154
|
-
e.freeze = { frozenRows:
|
|
1197
|
+
const a = t == null ? void 0 : t.getActiveCell();
|
|
1198
|
+
e.freeze = { frozenRows: a ? a.row : 1, frozenCols: a ? a.col : 0 };
|
|
1155
1199
|
}
|
|
1156
|
-
l.rebuildMetrics(), t == null || t.refreshContentSize(),
|
|
1200
|
+
l.rebuildMetrics(), t == null || t.refreshContentSize(), Ne();
|
|
1157
1201
|
}
|
|
1158
|
-
const
|
|
1159
|
-
async function
|
|
1160
|
-
|
|
1161
|
-
|
|
1202
|
+
const Me = C(!1);
|
|
1203
|
+
async function fl(e) {
|
|
1204
|
+
var E;
|
|
1205
|
+
Me.value = !1;
|
|
1206
|
+
const l = e.scope === "all" ? "all" : "active", n = e.scope === "selection" && (E = te.value) != null ? E : void 0, a = {
|
|
1162
1207
|
target: l,
|
|
1163
|
-
range:
|
|
1208
|
+
range: n,
|
|
1164
1209
|
scale: e.scale,
|
|
1165
1210
|
includeHeaders: e.includeHeaders,
|
|
1166
1211
|
gridlines: e.gridlines
|
|
1167
|
-
},
|
|
1168
|
-
...e.format !== "auto" ? { format: e.format } : {},
|
|
1169
|
-
...e.orientation !== "auto" ? { orientation: e.orientation } : {},
|
|
1212
|
+
}, h = fe(V(V({}, e.format !== "auto" ? { format: e.format } : {}), e.orientation !== "auto" ? { orientation: e.orientation } : {}), {
|
|
1170
1213
|
fitToWidth: e.fitToWidth
|
|
1171
|
-
};
|
|
1214
|
+
});
|
|
1172
1215
|
try {
|
|
1173
|
-
e.action === "png" ? await
|
|
1174
|
-
} catch (
|
|
1175
|
-
|
|
1216
|
+
e.action === "png" ? await Se(a) : e.action === "pdf" ? await Ee(fe(V(V({}, a), h), { vector: e.pdfVector })) : await Te(V(V({}, a), h));
|
|
1217
|
+
} catch (w) {
|
|
1218
|
+
ot(w);
|
|
1176
1219
|
}
|
|
1177
1220
|
}
|
|
1178
|
-
function
|
|
1221
|
+
function ml(e) {
|
|
1179
1222
|
t == null || t.setSelectionRange(e);
|
|
1180
1223
|
}
|
|
1181
|
-
const
|
|
1182
|
-
load: (e) =>
|
|
1224
|
+
const Re = {
|
|
1225
|
+
load: (e) => K(e, p),
|
|
1183
1226
|
getWorkbook: () => k.value,
|
|
1184
|
-
getActiveSheet: () =>
|
|
1227
|
+
getActiveSheet: () => J.value,
|
|
1185
1228
|
setActiveSheet: (e) => {
|
|
1186
1229
|
var l;
|
|
1187
|
-
(l = k.value) != null && l.sheets[e] && (
|
|
1230
|
+
(l = k.value) != null && l.sheets[e] && (J.value = e);
|
|
1231
|
+
},
|
|
1232
|
+
getSelection: () => te.value,
|
|
1233
|
+
setSelection: ml,
|
|
1234
|
+
rectOf: st,
|
|
1235
|
+
rectOfRange: at,
|
|
1236
|
+
redraw: () => Ne(),
|
|
1237
|
+
isCellEditable: (e, l) => {
|
|
1238
|
+
var n;
|
|
1239
|
+
return (n = t == null ? void 0 : t.isCellEditable(e, l)) != null ? n : !1;
|
|
1188
1240
|
},
|
|
1189
|
-
getSelection: () => Y.value,
|
|
1190
|
-
setSelection: ul,
|
|
1191
|
-
rectOf: et,
|
|
1192
|
-
rectOfRange: tt,
|
|
1193
|
-
redraw: () => De(),
|
|
1194
|
-
isCellEditable: (e, l) => (t == null ? void 0 : t.isCellEditable(e, l)) ?? !1,
|
|
1195
1241
|
setEditableTargets: (e) => t == null ? void 0 : t.setEditableTargets(e),
|
|
1196
1242
|
getEditableTargets: () => t == null ? void 0 : t.getEditableTargets(),
|
|
1197
|
-
editCell: (e, l,
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1243
|
+
editCell: (e, l, n) => {
|
|
1244
|
+
var a;
|
|
1245
|
+
return (a = t == null ? void 0 : t.editCell(e, l, n)) != null ? a : !1;
|
|
1246
|
+
},
|
|
1247
|
+
editRange: (e, l) => {
|
|
1248
|
+
var n;
|
|
1249
|
+
return (n = t == null ? void 0 : t.editRange(e, l)) != null ? n : !1;
|
|
1250
|
+
},
|
|
1251
|
+
clearRange: (e) => {
|
|
1252
|
+
var l;
|
|
1253
|
+
return (l = t == null ? void 0 : t.clearRange(e)) != null ? l : !1;
|
|
1254
|
+
},
|
|
1255
|
+
setStyle: (e, l) => {
|
|
1256
|
+
var n;
|
|
1257
|
+
return (n = t == null ? void 0 : t.setStyle(e, l)) != null ? n : !1;
|
|
1258
|
+
},
|
|
1259
|
+
getActiveFillColor: () => {
|
|
1260
|
+
var e;
|
|
1261
|
+
return (e = t == null ? void 0 : t.getActiveFillColor()) != null ? e : "#FFFFFF";
|
|
1262
|
+
},
|
|
1263
|
+
getActiveFontColor: () => {
|
|
1264
|
+
var e;
|
|
1265
|
+
return (e = t == null ? void 0 : t.getActiveFontColor()) != null ? e : "#000000";
|
|
1266
|
+
},
|
|
1267
|
+
setSelectionFill: (e) => {
|
|
1268
|
+
var l;
|
|
1269
|
+
return (l = t == null ? void 0 : t.setSelectionFill(e)) != null ? l : !1;
|
|
1270
|
+
},
|
|
1271
|
+
setSelectionFontColor: (e) => {
|
|
1272
|
+
var l;
|
|
1273
|
+
return (l = t == null ? void 0 : t.setSelectionFontColor(e)) != null ? l : !1;
|
|
1274
|
+
},
|
|
1275
|
+
getSelectionWrapState: () => {
|
|
1276
|
+
var e;
|
|
1277
|
+
return (e = t == null ? void 0 : t.getSelectionWrapState()) != null ? e : "none";
|
|
1278
|
+
},
|
|
1279
|
+
toggleWrapTextOnSelection: () => {
|
|
1280
|
+
var e;
|
|
1281
|
+
return (e = t == null ? void 0 : t.toggleWrapTextOnSelection()) != null ? e : !1;
|
|
1282
|
+
},
|
|
1283
|
+
mergeCells: (e) => {
|
|
1284
|
+
var l;
|
|
1285
|
+
return (l = t == null ? void 0 : t.mergeCells(e)) != null ? l : !1;
|
|
1286
|
+
},
|
|
1287
|
+
unmergeCells: (e) => {
|
|
1288
|
+
var l;
|
|
1289
|
+
return (l = t == null ? void 0 : t.unmergeCells(e)) != null ? l : !1;
|
|
1290
|
+
},
|
|
1291
|
+
pasteText: (e, l) => {
|
|
1292
|
+
var n;
|
|
1293
|
+
return (n = t == null ? void 0 : t.pasteText(e, l)) != null ? n : !1;
|
|
1294
|
+
},
|
|
1295
|
+
pasteRichHtml: (e, l) => {
|
|
1296
|
+
var n;
|
|
1297
|
+
return (n = t == null ? void 0 : t.pasteRichHtml(e, l)) != null ? n : !1;
|
|
1298
|
+
},
|
|
1299
|
+
pasteImageBlob: (e, l) => {
|
|
1300
|
+
var n;
|
|
1301
|
+
return (n = t == null ? void 0 : t.pasteImageBlob(e, l)) != null ? n : Promise.resolve(!1);
|
|
1302
|
+
},
|
|
1303
|
+
getImages: () => {
|
|
1304
|
+
var e;
|
|
1305
|
+
return (e = t == null ? void 0 : t.getImages()) != null ? e : [];
|
|
1306
|
+
},
|
|
1307
|
+
addImage: (e) => {
|
|
1308
|
+
var l;
|
|
1309
|
+
return (l = t == null ? void 0 : t.addImage(e)) != null ? l : -1;
|
|
1310
|
+
},
|
|
1311
|
+
removeImage: (e) => {
|
|
1312
|
+
var l;
|
|
1313
|
+
return (l = t == null ? void 0 : t.removeImage(e)) != null ? l : !1;
|
|
1314
|
+
},
|
|
1315
|
+
moveImage: (e, l, n) => {
|
|
1316
|
+
var a;
|
|
1317
|
+
return (a = t == null ? void 0 : t.moveImage(e, l, n)) != null ? a : !1;
|
|
1318
|
+
},
|
|
1319
|
+
resizeImage: (e, l, n) => {
|
|
1320
|
+
var a;
|
|
1321
|
+
return (a = t == null ? void 0 : t.resizeImage(e, l, n)) != null ? a : !1;
|
|
1322
|
+
},
|
|
1323
|
+
getCellEditString: () => {
|
|
1324
|
+
var e;
|
|
1325
|
+
return (e = t == null ? void 0 : t.getCellEditString()) != null ? e : "";
|
|
1326
|
+
},
|
|
1327
|
+
canEditActiveCell: () => {
|
|
1328
|
+
var e;
|
|
1329
|
+
return (e = t == null ? void 0 : t.canEditActiveCell()) != null ? e : !1;
|
|
1330
|
+
},
|
|
1331
|
+
commitActiveCellValue: (e, l) => {
|
|
1332
|
+
var n;
|
|
1333
|
+
return (n = t == null ? void 0 : t.commitActiveCellValue(e, l)) != null ? n : !1;
|
|
1334
|
+
},
|
|
1335
|
+
getCellImages: () => {
|
|
1336
|
+
var e;
|
|
1337
|
+
return (e = t == null ? void 0 : t.getCellImages()) != null ? e : [];
|
|
1338
|
+
},
|
|
1339
|
+
getCellImageAt: (e, l) => {
|
|
1340
|
+
var n;
|
|
1341
|
+
return (n = t == null ? void 0 : t.getCellImageAt(e, l)) != null ? n : null;
|
|
1342
|
+
},
|
|
1343
|
+
openImageLightbox: (e, l, n) => t == null ? void 0 : t.openImageLightbox(e, l, n),
|
|
1223
1344
|
setCellImageFit: (e) => t == null ? void 0 : t.setCellImageFit(e),
|
|
1224
|
-
convertImageToCell: (e, l,
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1345
|
+
convertImageToCell: (e, l, n) => {
|
|
1346
|
+
var a;
|
|
1347
|
+
return (a = t == null ? void 0 : t.convertImageToCell(e, l, n)) != null ? a : !1;
|
|
1348
|
+
},
|
|
1349
|
+
convertImageToCellAuto: (e) => {
|
|
1350
|
+
var l;
|
|
1351
|
+
return (l = t == null ? void 0 : t.convertImageToCellAuto(e)) != null ? l : !1;
|
|
1352
|
+
},
|
|
1353
|
+
convertAllImagesToCells: (e) => {
|
|
1354
|
+
var l;
|
|
1355
|
+
return (l = t == null ? void 0 : t.convertAllImagesToCells(e)) != null ? l : 0;
|
|
1356
|
+
},
|
|
1357
|
+
convertImagesInRangeToCell: (e) => X({}, async (l) => {
|
|
1358
|
+
var n, a;
|
|
1359
|
+
return (n = l.onProgress) == null || n.call(l, { stage: "convert", label: "选区浮动图批量嵌入…", ratio: void 0 }), (a = t == null ? void 0 : t.convertImagesInRangeToCell(e)) != null ? a : 0;
|
|
1230
1360
|
}),
|
|
1231
|
-
convertCellImagesInRangeToFloat: (e, l) =>
|
|
1232
|
-
var
|
|
1233
|
-
return (
|
|
1361
|
+
convertCellImagesInRangeToFloat: (e, l) => X({}, async (n) => {
|
|
1362
|
+
var a, h;
|
|
1363
|
+
return (a = n.onProgress) == null || a.call(n, { stage: "convert", label: "选区内嵌图批量浮动化…", ratio: void 0 }), (h = t == null ? void 0 : t.convertCellImagesInRangeToFloat(e, l)) != null ? h : 0;
|
|
1234
1364
|
}),
|
|
1235
|
-
openContextMenu: (e, l,
|
|
1365
|
+
openContextMenu: (e, l, n) => t == null ? void 0 : t.openContextMenu(e, l, n),
|
|
1236
1366
|
closeContextMenu: () => t == null ? void 0 : t.closeContextMenu(),
|
|
1237
|
-
convertCellImageToFloat: (e, l,
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1367
|
+
convertCellImageToFloat: (e, l, n) => {
|
|
1368
|
+
var a;
|
|
1369
|
+
return (a = t == null ? void 0 : t.convertCellImageToFloat(e, l, n)) != null ? a : !1;
|
|
1370
|
+
},
|
|
1371
|
+
insertRows: (e, l) => {
|
|
1372
|
+
var n;
|
|
1373
|
+
return (n = t == null ? void 0 : t.insertRows(e, l)) != null ? n : !1;
|
|
1374
|
+
},
|
|
1375
|
+
deleteRows: (e, l) => {
|
|
1376
|
+
var n;
|
|
1377
|
+
return (n = t == null ? void 0 : t.deleteRows(e, l)) != null ? n : !1;
|
|
1378
|
+
},
|
|
1379
|
+
insertCols: (e, l) => {
|
|
1380
|
+
var n;
|
|
1381
|
+
return (n = t == null ? void 0 : t.insertCols(e, l)) != null ? n : !1;
|
|
1382
|
+
},
|
|
1383
|
+
deleteCols: (e, l) => {
|
|
1384
|
+
var n;
|
|
1385
|
+
return (n = t == null ? void 0 : t.deleteCols(e, l)) != null ? n : !1;
|
|
1386
|
+
},
|
|
1242
1387
|
undo: () => t == null ? void 0 : t.undo(),
|
|
1243
1388
|
redo: () => t == null ? void 0 : t.redo(),
|
|
1244
|
-
canUndo: () =>
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1389
|
+
canUndo: () => {
|
|
1390
|
+
var e;
|
|
1391
|
+
return (e = t == null ? void 0 : t.canUndo()) != null ? e : !1;
|
|
1392
|
+
},
|
|
1393
|
+
canRedo: () => {
|
|
1394
|
+
var e;
|
|
1395
|
+
return (e = t == null ? void 0 : t.canRedo()) != null ? e : !1;
|
|
1396
|
+
},
|
|
1397
|
+
getEditingCell: () => {
|
|
1398
|
+
var e;
|
|
1399
|
+
return (e = t == null ? void 0 : t.getEditingCell()) != null ? e : null;
|
|
1400
|
+
},
|
|
1401
|
+
getCellSnapshot: (e, l) => {
|
|
1402
|
+
var n;
|
|
1403
|
+
return (n = t == null ? void 0 : t.getCellSnapshot(e, l)) != null ? n : null;
|
|
1404
|
+
},
|
|
1405
|
+
inspectCell: (e, l) => {
|
|
1406
|
+
var n;
|
|
1407
|
+
return (n = t == null ? void 0 : t.inspectCell(e, l)) != null ? n : null;
|
|
1408
|
+
},
|
|
1409
|
+
beginEdit: (e, l) => {
|
|
1410
|
+
var n;
|
|
1411
|
+
return (n = t == null ? void 0 : t.beginEdit(e, l)) != null ? n : !1;
|
|
1412
|
+
},
|
|
1250
1413
|
cancelEdit: () => t == null ? void 0 : t.cancelEdit(),
|
|
1251
|
-
isEditing: () =>
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1414
|
+
isEditing: () => {
|
|
1415
|
+
var e;
|
|
1416
|
+
return (e = t == null ? void 0 : t.isEditing()) != null ? e : !1;
|
|
1417
|
+
},
|
|
1418
|
+
setColumnWidth: (e, l) => {
|
|
1419
|
+
var n;
|
|
1420
|
+
return (n = t == null ? void 0 : t.setColumnWidth(e, l)) != null ? n : 0;
|
|
1421
|
+
},
|
|
1422
|
+
setRowHeight: (e, l) => {
|
|
1423
|
+
var n;
|
|
1424
|
+
return (n = t == null ? void 0 : t.setRowHeight(e, l)) != null ? n : 0;
|
|
1425
|
+
},
|
|
1426
|
+
autoFitColumns: (e) => {
|
|
1427
|
+
var l;
|
|
1428
|
+
return (l = t == null ? void 0 : t.autoFitColumns(e)) != null ? l : 0;
|
|
1429
|
+
},
|
|
1430
|
+
autoFitRows: (e) => {
|
|
1431
|
+
var l;
|
|
1432
|
+
return (l = t == null ? void 0 : t.autoFitRows(e)) != null ? l : 0;
|
|
1433
|
+
},
|
|
1434
|
+
resetColumnWidth: (e) => {
|
|
1435
|
+
var l;
|
|
1436
|
+
return (l = t == null ? void 0 : t.resetColumnWidth(e)) != null ? l : 0;
|
|
1437
|
+
},
|
|
1438
|
+
resetRowHeight: (e) => {
|
|
1439
|
+
var l;
|
|
1440
|
+
return (l = t == null ? void 0 : t.resetRowHeight(e)) != null ? l : 0;
|
|
1441
|
+
},
|
|
1442
|
+
isRecalcReady: () => {
|
|
1443
|
+
var e;
|
|
1444
|
+
return (e = t == null ? void 0 : t.isRecalcReady()) != null ? e : !1;
|
|
1445
|
+
},
|
|
1446
|
+
getVirtualExtent: () => {
|
|
1447
|
+
var e;
|
|
1448
|
+
return (e = t == null ? void 0 : t.getVirtualExtent()) != null ? e : { rows: 0, cols: 0 };
|
|
1449
|
+
},
|
|
1450
|
+
isDirty: () => {
|
|
1451
|
+
var e;
|
|
1452
|
+
return (e = t == null ? void 0 : t.isDirty()) != null ? e : !1;
|
|
1453
|
+
},
|
|
1454
|
+
resetToOriginal: () => {
|
|
1455
|
+
var e;
|
|
1456
|
+
return (e = t == null ? void 0 : t.resetToOriginal()) != null ? e : !1;
|
|
1457
|
+
},
|
|
1458
|
+
exportImage: ul,
|
|
1459
|
+
downloadImage: Se,
|
|
1460
|
+
exportPdf: rl,
|
|
1461
|
+
downloadPdf: Ee,
|
|
1462
|
+
print: Te,
|
|
1463
|
+
exportXlsx: (e) => X(e, (l) => t.exportXlsx(l)),
|
|
1464
|
+
downloadXlsx: (e) => X(e, (l) => t.downloadXlsx(l)),
|
|
1465
|
+
exportJson: (e) => {
|
|
1466
|
+
var l;
|
|
1467
|
+
return (l = t == null ? void 0 : t.exportJson(e)) != null ? l : "{}";
|
|
1468
|
+
},
|
|
1270
1469
|
downloadJson: (e) => t == null ? void 0 : t.downloadJson(e),
|
|
1271
|
-
exportCsv: (e) =>
|
|
1470
|
+
exportCsv: (e) => {
|
|
1471
|
+
var l;
|
|
1472
|
+
return (l = t == null ? void 0 : t.exportCsv(e)) != null ? l : "";
|
|
1473
|
+
},
|
|
1272
1474
|
downloadCsv: (e) => t == null ? void 0 : t.downloadCsv(e),
|
|
1273
1475
|
// ---- 数据读取(委托独立函数,自动绑 date1904 + 默认当前表) ----
|
|
1274
|
-
getCellValue: (e, l,
|
|
1275
|
-
const
|
|
1276
|
-
return
|
|
1476
|
+
getCellValue: (e, l, n) => {
|
|
1477
|
+
const a = Pe(n);
|
|
1478
|
+
return a ? Pl(a, e, l) : null;
|
|
1277
1479
|
},
|
|
1278
|
-
getCellText: (e, l,
|
|
1279
|
-
var
|
|
1280
|
-
const
|
|
1281
|
-
return
|
|
1480
|
+
getCellText: (e, l, n) => {
|
|
1481
|
+
var h, E;
|
|
1482
|
+
const a = Pe(n);
|
|
1483
|
+
return a ? Rl(a, e, l, (E = (h = k.value) == null ? void 0 : h.date1904) != null ? E : !1) : "";
|
|
1282
1484
|
},
|
|
1283
1485
|
getSheetData: (e, l) => {
|
|
1284
|
-
const
|
|
1285
|
-
return
|
|
1486
|
+
const n = Pe(l);
|
|
1487
|
+
return n ? Ml(n, rt(e)) : [];
|
|
1286
1488
|
},
|
|
1287
1489
|
getSheetJSON: (e, l) => {
|
|
1288
|
-
const
|
|
1289
|
-
return
|
|
1490
|
+
const n = Pe(l);
|
|
1491
|
+
return n ? Il(n, rt(e)) : [];
|
|
1290
1492
|
},
|
|
1291
|
-
getRangeData: (e, l,
|
|
1292
|
-
const
|
|
1293
|
-
return
|
|
1493
|
+
getRangeData: (e, l, n) => {
|
|
1494
|
+
const a = Pe(n);
|
|
1495
|
+
return a ? Fl(a, e, rt(l)) : [];
|
|
1294
1496
|
}
|
|
1295
1497
|
};
|
|
1296
|
-
function
|
|
1498
|
+
function Pe(e) {
|
|
1499
|
+
var n;
|
|
1297
1500
|
const l = k.value;
|
|
1298
|
-
return l
|
|
1501
|
+
return l && (n = l.sheets[e != null ? e : J.value]) != null ? n : null;
|
|
1299
1502
|
}
|
|
1300
|
-
function
|
|
1301
|
-
var l;
|
|
1302
|
-
return {
|
|
1503
|
+
function rt(e) {
|
|
1504
|
+
var l, n;
|
|
1505
|
+
return fe(V({}, e), { date1904: (n = (l = k.value) == null ? void 0 : l.date1904) != null ? n : !1 });
|
|
1303
1506
|
}
|
|
1304
|
-
|
|
1305
|
-
const
|
|
1306
|
-
function
|
|
1307
|
-
return { kind: "builtin",
|
|
1507
|
+
b(Re);
|
|
1508
|
+
const U = (e) => Ue[e];
|
|
1509
|
+
function P(e) {
|
|
1510
|
+
return V({ kind: "builtin" }, e);
|
|
1308
1511
|
}
|
|
1309
|
-
function
|
|
1310
|
-
var l,
|
|
1512
|
+
function pl(e) {
|
|
1513
|
+
var l, n, a, h, E;
|
|
1311
1514
|
switch (e) {
|
|
1312
1515
|
case "find":
|
|
1313
|
-
return
|
|
1516
|
+
return P({
|
|
1314
1517
|
id: e,
|
|
1315
|
-
iconSvg:
|
|
1518
|
+
iconSvg: U("find"),
|
|
1316
1519
|
label: "查找",
|
|
1317
1520
|
title: "查找 (Ctrl+F)",
|
|
1318
|
-
active:
|
|
1319
|
-
onClick: () =>
|
|
1521
|
+
active: Fe.value,
|
|
1522
|
+
onClick: () => Fe.value ? Mt() : It()
|
|
1320
1523
|
});
|
|
1321
1524
|
case "filter":
|
|
1322
|
-
return
|
|
1525
|
+
return P({
|
|
1323
1526
|
id: e,
|
|
1324
|
-
iconSvg:
|
|
1527
|
+
iconSvg: U("filter"),
|
|
1325
1528
|
label: "筛选",
|
|
1326
1529
|
title: "切换自动筛选",
|
|
1327
|
-
active: !!((l =
|
|
1328
|
-
onClick:
|
|
1530
|
+
active: !!((l = Ce.value) != null && l.autoFilterRange),
|
|
1531
|
+
onClick: vl
|
|
1329
1532
|
});
|
|
1330
1533
|
case "clear-filter":
|
|
1331
|
-
return
|
|
1534
|
+
return P({
|
|
1332
1535
|
id: e,
|
|
1333
|
-
iconSvg:
|
|
1536
|
+
iconSvg: U("clear-filter"),
|
|
1334
1537
|
label: "清除筛选",
|
|
1335
1538
|
title: "清除当前表全部筛选",
|
|
1336
1539
|
disabled: !(t != null && t.hasFilters()),
|
|
1337
1540
|
onClick: () => t == null ? void 0 : t.clearAllFilters()
|
|
1338
1541
|
});
|
|
1339
1542
|
case "copy":
|
|
1340
|
-
return
|
|
1543
|
+
return P({
|
|
1341
1544
|
id: e,
|
|
1342
|
-
iconSvg:
|
|
1545
|
+
iconSvg: U("copy"),
|
|
1343
1546
|
label: "复制",
|
|
1344
1547
|
title: "复制选区 (Ctrl+C)",
|
|
1345
|
-
disabled: !
|
|
1548
|
+
disabled: !te.value,
|
|
1346
1549
|
onClick: () => void (t == null ? void 0 : t.copySelection())
|
|
1347
1550
|
});
|
|
1348
1551
|
case "wrap-text": {
|
|
1349
|
-
const
|
|
1350
|
-
return
|
|
1552
|
+
const w = (n = t == null ? void 0 : t.getSelectionWrapState()) != null ? n : "none";
|
|
1553
|
+
return P({
|
|
1351
1554
|
id: e,
|
|
1352
|
-
iconSvg:
|
|
1555
|
+
iconSvg: U("wrap-text"),
|
|
1353
1556
|
label: "自动换行",
|
|
1354
1557
|
title: "自动换行(选区,WPS 风格 toggle)",
|
|
1355
|
-
active:
|
|
1356
|
-
disabled: !
|
|
1558
|
+
active: w === "all",
|
|
1559
|
+
disabled: !te.value || !i.editable,
|
|
1357
1560
|
onClick: () => void (t == null ? void 0 : t.toggleWrapTextOnSelection())
|
|
1358
1561
|
});
|
|
1359
1562
|
}
|
|
1360
1563
|
case "template": {
|
|
1361
|
-
const
|
|
1362
|
-
return
|
|
1564
|
+
const w = !!ge.value, De = be.value, ce = !!i.src && !i.workbook;
|
|
1565
|
+
return P({
|
|
1363
1566
|
id: e,
|
|
1364
|
-
iconSvg:
|
|
1567
|
+
iconSvg: U("template"),
|
|
1365
1568
|
label: "模板",
|
|
1366
|
-
title:
|
|
1367
|
-
active:
|
|
1368
|
-
disabled:
|
|
1569
|
+
title: ce ? "模板仅对 JSON / 模型数据源生效;当前是 .xlsx 数据源,模板不可用" : w ? `模板已加载:${De || "(未命名)"}` : "为 JSON / 模型数据源套用 .xlsx 模板的样式(边框 / 字体 / 列宽 / 合并 等);模板的文字内容会被丢弃",
|
|
1570
|
+
active: w,
|
|
1571
|
+
disabled: ce,
|
|
1369
1572
|
items: [
|
|
1370
|
-
|
|
1573
|
+
P({
|
|
1371
1574
|
id: "tpl-default",
|
|
1372
|
-
label: (
|
|
1575
|
+
label: (w ? "" : "✓ ") + "默认渲染",
|
|
1373
1576
|
title: "不套模板,数据按默认样式渲染",
|
|
1374
|
-
disabled: !
|
|
1375
|
-
onClick:
|
|
1577
|
+
disabled: !w,
|
|
1578
|
+
onClick: yt
|
|
1376
1579
|
}),
|
|
1377
|
-
|
|
1378
|
-
|
|
1580
|
+
P({ id: "tpl-sep", type: "separator" }),
|
|
1581
|
+
P({
|
|
1379
1582
|
id: "tpl-import",
|
|
1380
1583
|
label: "导入 .xlsx 模板…",
|
|
1381
1584
|
title: "选一份 .xlsx,把它的 styling(边框/字体/列宽/合并/freeze) 套到当前 JSON 数据上;模板的文字内容会被丢弃",
|
|
1382
|
-
onClick:
|
|
1585
|
+
onClick: Ht
|
|
1383
1586
|
}),
|
|
1384
|
-
|
|
1587
|
+
P({
|
|
1385
1588
|
id: "tpl-clear",
|
|
1386
1589
|
label: "清除模板",
|
|
1387
1590
|
title: "切回默认样式渲染",
|
|
1388
|
-
disabled: !
|
|
1389
|
-
onClick:
|
|
1591
|
+
disabled: !w,
|
|
1592
|
+
onClick: yt
|
|
1390
1593
|
})
|
|
1391
1594
|
]
|
|
1392
1595
|
});
|
|
1393
1596
|
}
|
|
1394
1597
|
case "image-tools": {
|
|
1395
|
-
const
|
|
1396
|
-
return
|
|
1598
|
+
const w = te.value, De = t == null ? void 0 : t.getActiveCell(), ce = ((h = (a = Ce.value) == null ? void 0 : a.images.length) != null ? h : 0) > 0;
|
|
1599
|
+
return P({
|
|
1397
1600
|
id: e,
|
|
1398
|
-
iconSvg:
|
|
1601
|
+
iconSvg: U("image-tools"),
|
|
1399
1602
|
label: "图片工具",
|
|
1400
1603
|
title: "浮动图 ⇄ 单元格内嵌图(WPS DISPIMG)互转",
|
|
1401
|
-
disabled: !
|
|
1604
|
+
disabled: !i.editable,
|
|
1402
1605
|
items: [
|
|
1403
|
-
|
|
1606
|
+
P({
|
|
1404
1607
|
id: "img-sel-to-cell",
|
|
1405
1608
|
label: "选区:浮动 → 嵌入",
|
|
1406
1609
|
title: '把选区里"中心格在选区内"的浮动图,就近嵌入',
|
|
1407
|
-
disabled: !
|
|
1408
|
-
onClick: () =>
|
|
1610
|
+
disabled: !w || !ce,
|
|
1611
|
+
onClick: () => w && (t == null ? void 0 : t.convertImagesInRangeToCell(w))
|
|
1409
1612
|
}),
|
|
1410
|
-
|
|
1613
|
+
P({
|
|
1411
1614
|
id: "img-sel-to-float",
|
|
1412
1615
|
label: "选区:嵌入 → 浮动",
|
|
1413
1616
|
title: "把选区内所有 DISPIMG 格拎成浮动图",
|
|
1414
|
-
disabled: !
|
|
1415
|
-
onClick: () =>
|
|
1617
|
+
disabled: !w,
|
|
1618
|
+
onClick: () => w && (t == null ? void 0 : t.convertCellImagesInRangeToFloat(w))
|
|
1416
1619
|
}),
|
|
1417
|
-
|
|
1418
|
-
|
|
1620
|
+
P({ id: "img-sep", type: "separator" }),
|
|
1621
|
+
P({
|
|
1419
1622
|
id: "img-all-to-cell",
|
|
1420
1623
|
label: "整表:浮动 → 嵌入",
|
|
1421
1624
|
title: "全表浮动图按几何就近嵌入各自单元格",
|
|
1422
|
-
disabled: !
|
|
1625
|
+
disabled: !ce,
|
|
1423
1626
|
onClick: () => t == null ? void 0 : t.convertAllImagesToCells()
|
|
1424
1627
|
}),
|
|
1425
|
-
|
|
1628
|
+
P({
|
|
1426
1629
|
id: "img-col-to-cell",
|
|
1427
1630
|
label: "整列:浮动 → 嵌入(活动列)",
|
|
1428
1631
|
title: "把中心落在活动列的浮动图就近嵌入",
|
|
1429
|
-
disabled: !
|
|
1430
|
-
onClick: () =>
|
|
1632
|
+
disabled: !ce || !De,
|
|
1633
|
+
onClick: () => De && (t == null ? void 0 : t.convertAllImagesToCells(De.col))
|
|
1431
1634
|
})
|
|
1432
1635
|
]
|
|
1433
1636
|
});
|
|
1434
1637
|
}
|
|
1435
1638
|
case "freeze": {
|
|
1436
|
-
const
|
|
1437
|
-
return
|
|
1639
|
+
const w = (E = Ce.value) == null ? void 0 : E.freeze;
|
|
1640
|
+
return P({
|
|
1438
1641
|
id: e,
|
|
1439
|
-
iconSvg:
|
|
1642
|
+
iconSvg: U("freeze"),
|
|
1440
1643
|
label: "冻结",
|
|
1441
1644
|
title: "冻结/取消冻结(在活动单元格)",
|
|
1442
|
-
active: !!(
|
|
1443
|
-
onClick:
|
|
1645
|
+
active: !!(w && (w.frozenRows || w.frozenCols)),
|
|
1646
|
+
onClick: cl
|
|
1444
1647
|
});
|
|
1445
1648
|
}
|
|
1446
1649
|
case "export":
|
|
1447
|
-
return
|
|
1650
|
+
return P({
|
|
1448
1651
|
id: e,
|
|
1449
|
-
iconSvg:
|
|
1652
|
+
iconSvg: U("export"),
|
|
1450
1653
|
label: "导出",
|
|
1451
1654
|
title: "导出 / 打印",
|
|
1452
1655
|
items: [
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1656
|
+
P({ id: "export-png", label: "导出为图片 (PNG)", onClick: () => void Se() }),
|
|
1657
|
+
P({ id: "export-pdf", label: "导出为 PDF (位图)", onClick: Tt }),
|
|
1658
|
+
P({ id: "export-pdf-vector", label: "导出为 PDF (矢量·文字可选)", onClick: Ft }),
|
|
1659
|
+
P({ id: "export-print", label: "打印…", onClick: () => void Te() }),
|
|
1660
|
+
P({ id: "export-sep", type: "separator" }),
|
|
1661
|
+
P({ id: "export-settings", label: "导出设置…", onClick: () => Me.value = !0 })
|
|
1459
1662
|
]
|
|
1460
1663
|
});
|
|
1461
1664
|
case "zoom":
|
|
1462
|
-
return
|
|
1665
|
+
return P({
|
|
1463
1666
|
id: e,
|
|
1464
|
-
iconSvg:
|
|
1465
|
-
label: Math.round(
|
|
1667
|
+
iconSvg: U("zoom"),
|
|
1668
|
+
label: Math.round(j.value * 100) + "%",
|
|
1466
1669
|
title: "缩放",
|
|
1467
1670
|
items: [50, 75, 100, 125, 150, 200].map(
|
|
1468
|
-
(
|
|
1671
|
+
(w) => P({ id: "zoom-" + w, label: w + "%", active: Math.round(j.value * 100) === w, onClick: () => j.value = w / 100 })
|
|
1469
1672
|
)
|
|
1470
1673
|
});
|
|
1471
1674
|
default:
|
|
1472
1675
|
return null;
|
|
1473
1676
|
}
|
|
1474
1677
|
}
|
|
1475
|
-
function
|
|
1476
|
-
var
|
|
1678
|
+
function dt(e, l) {
|
|
1679
|
+
var n, a, h;
|
|
1477
1680
|
return {
|
|
1478
1681
|
id: e.id,
|
|
1479
1682
|
type: e.type,
|
|
@@ -1481,341 +1684,342 @@ const El = { class: "toolbar" }, Tl = ["title"], Fl = {
|
|
|
1481
1684
|
icon: e.icon,
|
|
1482
1685
|
label: e.label,
|
|
1483
1686
|
title: e.title,
|
|
1484
|
-
active: !!((
|
|
1485
|
-
disabled: !!((
|
|
1486
|
-
onClick: e.onClick ? () => e.onClick(
|
|
1487
|
-
items: (
|
|
1687
|
+
active: !!((n = e.active) != null && n.call(e, Re)),
|
|
1688
|
+
disabled: !!((a = e.disabled) != null && a.call(e, Re)),
|
|
1689
|
+
onClick: e.onClick ? () => e.onClick(Re) : void 0,
|
|
1690
|
+
items: (h = e.items) == null ? void 0 : h.map((E) => dt(E, l)),
|
|
1488
1691
|
kind: l
|
|
1489
1692
|
};
|
|
1490
1693
|
}
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1694
|
+
const vt = I(() => {
|
|
1695
|
+
var n;
|
|
1696
|
+
if (ae.value, ee.value, it.value, ut.value, i.toolbar === !1) return [];
|
|
1697
|
+
const e = Array.isArray(i.toolbar) ? i.toolbar : ["find", "filter"], l = [];
|
|
1698
|
+
for (const a of e)
|
|
1699
|
+
if (typeof a == "string")
|
|
1700
|
+
if (a === "separator" || a === "|") l.push({ id: "sep-" + l.length, type: "separator", kind: "builtin" });
|
|
1497
1701
|
else {
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1702
|
+
const h = pl(a);
|
|
1703
|
+
h && l.push(h);
|
|
1500
1704
|
}
|
|
1501
1705
|
else
|
|
1502
|
-
l.push(
|
|
1503
|
-
for (const
|
|
1504
|
-
for (const
|
|
1706
|
+
l.push(dt(a, "custom"));
|
|
1707
|
+
for (const a of y.value)
|
|
1708
|
+
for (const h of (n = a.toolbar) != null ? n : []) l.push(dt(h, "plugin"));
|
|
1505
1709
|
return l;
|
|
1506
|
-
}),
|
|
1507
|
-
let
|
|
1508
|
-
function
|
|
1509
|
-
var
|
|
1510
|
-
z(e, l), (
|
|
1511
|
-
}
|
|
1512
|
-
function
|
|
1513
|
-
var
|
|
1514
|
-
|
|
1515
|
-
const e = (
|
|
1516
|
-
let
|
|
1517
|
-
|
|
1518
|
-
}, l = { viewer:
|
|
1519
|
-
for (const
|
|
1520
|
-
if (
|
|
1521
|
-
for (const [
|
|
1522
|
-
const
|
|
1523
|
-
typeof
|
|
1710
|
+
}), gl = I(() => i.toolbar !== !1 && vt.value.length > 0), He = /* @__PURE__ */ new Map();
|
|
1711
|
+
let Oe = [];
|
|
1712
|
+
function ve(e, l) {
|
|
1713
|
+
var n;
|
|
1714
|
+
z(e, l), (n = He.get(e)) == null || n.forEach((a) => a(l));
|
|
1715
|
+
}
|
|
1716
|
+
function Rt() {
|
|
1717
|
+
var n;
|
|
1718
|
+
Oe.forEach((a) => a()), Oe = [], He.clear();
|
|
1719
|
+
const e = (a, h) => {
|
|
1720
|
+
let E = He.get(a);
|
|
1721
|
+
E || He.set(a, E = /* @__PURE__ */ new Set()), E.add(h);
|
|
1722
|
+
}, l = { viewer: Re, on: e, redraw: () => Ne() };
|
|
1723
|
+
for (const a of y.value) {
|
|
1724
|
+
if (a.events)
|
|
1725
|
+
for (const [E, w] of Object.entries(a.events)) w && e(E, w);
|
|
1726
|
+
const h = (n = a.setup) == null ? void 0 : n.call(a, l);
|
|
1727
|
+
typeof h == "function" && Oe.push(h);
|
|
1524
1728
|
}
|
|
1525
1729
|
}
|
|
1526
|
-
const
|
|
1527
|
-
let
|
|
1528
|
-
function
|
|
1529
|
-
const e = { rectOf:
|
|
1530
|
-
|
|
1730
|
+
const ct = C(null);
|
|
1731
|
+
let ue = null;
|
|
1732
|
+
function bl() {
|
|
1733
|
+
const e = { rectOf: st, rectOfRange: at, tick: ae.value, workbook: k.value };
|
|
1734
|
+
ue == null || ue.render(y.value, e);
|
|
1531
1735
|
}
|
|
1532
|
-
return
|
|
1736
|
+
return L([ae, y], bl, { flush: "post" }), (e, l) => (v(), c("div", {
|
|
1533
1737
|
class: "excel-viewer",
|
|
1534
1738
|
ref_key: "rootEl",
|
|
1535
|
-
ref:
|
|
1536
|
-
onKeydown:
|
|
1739
|
+
ref: Kt,
|
|
1740
|
+
onKeydown: dl
|
|
1537
1741
|
}, [
|
|
1538
|
-
|
|
1742
|
+
S(k) ? le(e.$slots, "header", {
|
|
1539
1743
|
key: 0,
|
|
1540
|
-
workbook:
|
|
1541
|
-
zoom:
|
|
1542
|
-
setZoom: (
|
|
1543
|
-
downloadImage:
|
|
1544
|
-
downloadPdf:
|
|
1545
|
-
print:
|
|
1744
|
+
workbook: S(k),
|
|
1745
|
+
zoom: j.value,
|
|
1746
|
+
setZoom: (n) => j.value = n,
|
|
1747
|
+
downloadImage: Se,
|
|
1748
|
+
downloadPdf: Ee,
|
|
1749
|
+
print: Te
|
|
1546
1750
|
}, () => [
|
|
1547
|
-
|
|
1548
|
-
"file-name":
|
|
1549
|
-
"template-name":
|
|
1550
|
-
"sheet-count":
|
|
1551
|
-
zoom:
|
|
1552
|
-
"onUpdate:zoom": l[0] || (l[0] = (
|
|
1553
|
-
onExportImage: l[1] || (l[1] = (
|
|
1554
|
-
onExportPdf:
|
|
1555
|
-
onExportPdfVector:
|
|
1556
|
-
onPrint: l[2] || (l[2] = (
|
|
1557
|
-
onOpenSettings: l[3] || (l[3] = (
|
|
1751
|
+
pt(jl, {
|
|
1752
|
+
"file-name": Ut.value,
|
|
1753
|
+
"template-name": be.value,
|
|
1754
|
+
"sheet-count": S(k).sheets.filter((n) => n.state === "visible").length,
|
|
1755
|
+
zoom: j.value,
|
|
1756
|
+
"onUpdate:zoom": l[0] || (l[0] = (n) => j.value = n),
|
|
1757
|
+
onExportImage: l[1] || (l[1] = (n) => Se()),
|
|
1758
|
+
onExportPdf: Tt,
|
|
1759
|
+
onExportPdfVector: Ft,
|
|
1760
|
+
onPrint: l[2] || (l[2] = (n) => Te()),
|
|
1761
|
+
onOpenSettings: l[3] || (l[3] = (n) => Me.value = !0)
|
|
1558
1762
|
}, null, 8, ["file-name", "template-name", "sheet-count", "zoom"])
|
|
1559
|
-
], !0) :
|
|
1560
|
-
|
|
1763
|
+
], !0) : M("", !0),
|
|
1764
|
+
S(k) && gl.value ? le(e.$slots, "toolbar", {
|
|
1561
1765
|
key: 1,
|
|
1562
|
-
items:
|
|
1766
|
+
items: vt.value
|
|
1563
1767
|
}, () => [
|
|
1564
|
-
|
|
1565
|
-
], !0) :
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
l[15] || (l[15] =
|
|
1569
|
-
|
|
1768
|
+
pt(ns, { items: vt.value }, null, 8, ["items"])
|
|
1769
|
+
], !0) : M("", !0),
|
|
1770
|
+
S(k) ? (v(), c("div", vs, [
|
|
1771
|
+
s("span", cs, F(lt.value || "—"), 1),
|
|
1772
|
+
l[15] || (l[15] = s("span", { class: "fx" }, "fx", -1)),
|
|
1773
|
+
Xt.value ? (v(), c("textarea", {
|
|
1570
1774
|
key: 0,
|
|
1571
1775
|
ref_key: "fbEl",
|
|
1572
|
-
ref:
|
|
1776
|
+
ref: $t,
|
|
1573
1777
|
class: "content content-input",
|
|
1574
|
-
value:
|
|
1575
|
-
title:
|
|
1778
|
+
value: G.value,
|
|
1779
|
+
title: G.value,
|
|
1576
1780
|
rows: "1",
|
|
1577
1781
|
spellcheck: "false",
|
|
1578
|
-
onFocus:
|
|
1579
|
-
onInput:
|
|
1580
|
-
onKeydown:
|
|
1581
|
-
onBlur:
|
|
1582
|
-
}, null, 40,
|
|
1782
|
+
onFocus: Zt,
|
|
1783
|
+
onInput: Gt,
|
|
1784
|
+
onKeydown: el,
|
|
1785
|
+
onBlur: Yt
|
|
1786
|
+
}, null, 40, fs)) : (v(), c("span", {
|
|
1583
1787
|
key: 1,
|
|
1584
1788
|
class: "content",
|
|
1585
|
-
title:
|
|
1586
|
-
},
|
|
1587
|
-
])) :
|
|
1588
|
-
|
|
1789
|
+
title: ht.value
|
|
1790
|
+
}, F(ht.value), 9, ms))
|
|
1791
|
+
])) : M("", !0),
|
|
1792
|
+
s("div", {
|
|
1589
1793
|
class: "render-area",
|
|
1590
1794
|
ref_key: "renderAreaEl",
|
|
1591
|
-
ref:
|
|
1795
|
+
ref: ke
|
|
1592
1796
|
}, [
|
|
1593
|
-
|
|
1797
|
+
s("canvas", {
|
|
1594
1798
|
ref_key: "canvasEl",
|
|
1595
|
-
ref:
|
|
1799
|
+
ref: je,
|
|
1596
1800
|
class: "grid-canvas"
|
|
1597
1801
|
}, null, 512),
|
|
1598
|
-
|
|
1802
|
+
s("div", {
|
|
1599
1803
|
class: "ov",
|
|
1600
1804
|
ref_key: "ovMain",
|
|
1601
|
-
ref:
|
|
1805
|
+
ref: Ge
|
|
1602
1806
|
}, null, 512),
|
|
1603
|
-
|
|
1807
|
+
s("div", {
|
|
1604
1808
|
class: "ov",
|
|
1605
1809
|
ref_key: "ovFCol",
|
|
1606
|
-
ref:
|
|
1810
|
+
ref: Ze
|
|
1607
1811
|
}, null, 512),
|
|
1608
|
-
|
|
1812
|
+
s("div", {
|
|
1609
1813
|
class: "ov",
|
|
1610
1814
|
ref_key: "ovFRow",
|
|
1611
|
-
ref:
|
|
1815
|
+
ref: Xe
|
|
1612
1816
|
}, null, 512),
|
|
1613
|
-
|
|
1817
|
+
s("div", {
|
|
1614
1818
|
class: "ov",
|
|
1615
1819
|
ref_key: "ovCorner",
|
|
1616
|
-
ref:
|
|
1820
|
+
ref: Qe
|
|
1617
1821
|
}, null, 512),
|
|
1618
|
-
|
|
1822
|
+
s("div", {
|
|
1619
1823
|
class: "scroller",
|
|
1620
1824
|
ref_key: "scrollerEl",
|
|
1621
|
-
ref:
|
|
1825
|
+
ref: se,
|
|
1622
1826
|
tabindex: "0",
|
|
1623
|
-
onScroll:
|
|
1624
|
-
onMousedown:
|
|
1625
|
-
onMousemove:
|
|
1626
|
-
onMouseup:
|
|
1627
|
-
onMouseleave:
|
|
1628
|
-
onDblclick:
|
|
1629
|
-
onKeydown:
|
|
1630
|
-
onContextmenu:
|
|
1827
|
+
onScroll: jt,
|
|
1828
|
+
onMousedown: tl,
|
|
1829
|
+
onMousemove: nl,
|
|
1830
|
+
onMouseup: sl,
|
|
1831
|
+
onMouseleave: al,
|
|
1832
|
+
onDblclick: ol,
|
|
1833
|
+
onKeydown: il,
|
|
1834
|
+
onContextmenu: ll
|
|
1631
1835
|
}, [
|
|
1632
|
-
|
|
1836
|
+
s("div", {
|
|
1633
1837
|
class: "spacer",
|
|
1634
1838
|
ref_key: "spacerEl",
|
|
1635
|
-
ref:
|
|
1839
|
+
ref: Ye
|
|
1636
1840
|
}, null, 512)
|
|
1637
1841
|
], 544),
|
|
1638
|
-
|
|
1842
|
+
Fe.value && S(k) ? (v(), re(wn, {
|
|
1639
1843
|
key: 0,
|
|
1640
|
-
query:
|
|
1641
|
-
"match-count":
|
|
1642
|
-
current:
|
|
1643
|
-
"match-case":
|
|
1644
|
-
"whole-cell":
|
|
1645
|
-
"onUpdate:query": l[4] || (l[4] = (
|
|
1646
|
-
var
|
|
1647
|
-
return (
|
|
1844
|
+
query: Ie.value.query,
|
|
1845
|
+
"match-count": Ie.value.count,
|
|
1846
|
+
current: Ie.value.index,
|
|
1847
|
+
"match-case": Ie.value.matchCase,
|
|
1848
|
+
"whole-cell": Ie.value.wholeCell,
|
|
1849
|
+
"onUpdate:query": l[4] || (l[4] = (n) => {
|
|
1850
|
+
var a;
|
|
1851
|
+
return (a = S(t)) == null ? void 0 : a.setFindQuery(n);
|
|
1648
1852
|
}),
|
|
1649
|
-
"onUpdate:matchCase": l[5] || (l[5] = (
|
|
1650
|
-
var
|
|
1651
|
-
return (
|
|
1853
|
+
"onUpdate:matchCase": l[5] || (l[5] = (n) => {
|
|
1854
|
+
var a;
|
|
1855
|
+
return (a = S(t)) == null ? void 0 : a.setFindMatchCase(n);
|
|
1652
1856
|
}),
|
|
1653
|
-
"onUpdate:wholeCell": l[6] || (l[6] = (
|
|
1654
|
-
var
|
|
1655
|
-
return (
|
|
1857
|
+
"onUpdate:wholeCell": l[6] || (l[6] = (n) => {
|
|
1858
|
+
var a;
|
|
1859
|
+
return (a = S(t)) == null ? void 0 : a.setFindWholeCell(n);
|
|
1656
1860
|
}),
|
|
1657
|
-
onNext: l[7] || (l[7] = (
|
|
1658
|
-
var
|
|
1659
|
-
return (
|
|
1861
|
+
onNext: l[7] || (l[7] = (n) => {
|
|
1862
|
+
var a;
|
|
1863
|
+
return (a = S(t)) == null ? void 0 : a.findNext();
|
|
1660
1864
|
}),
|
|
1661
|
-
onPrev: l[8] || (l[8] = (
|
|
1662
|
-
var
|
|
1663
|
-
return (
|
|
1865
|
+
onPrev: l[8] || (l[8] = (n) => {
|
|
1866
|
+
var a;
|
|
1867
|
+
return (a = S(t)) == null ? void 0 : a.findPrev();
|
|
1664
1868
|
}),
|
|
1665
|
-
onClose:
|
|
1666
|
-
}, null, 8, ["query", "match-count", "current", "match-case", "whole-cell"])) :
|
|
1667
|
-
|
|
1869
|
+
onClose: Mt
|
|
1870
|
+
}, null, 8, ["query", "match-count", "current", "match-case", "whole-cell"])) : M("", !0),
|
|
1871
|
+
ie.value ? (v(), re(Pn, {
|
|
1668
1872
|
key: 1,
|
|
1669
|
-
values:
|
|
1670
|
-
selected:
|
|
1671
|
-
x:
|
|
1672
|
-
y:
|
|
1673
|
-
"sort-dir":
|
|
1674
|
-
onApply: l[9] || (l[9] = (
|
|
1675
|
-
var
|
|
1676
|
-
return (
|
|
1873
|
+
values: ie.value.values,
|
|
1874
|
+
selected: ie.value.selected,
|
|
1875
|
+
x: ie.value.x,
|
|
1876
|
+
y: ie.value.y,
|
|
1877
|
+
"sort-dir": ie.value.sortDir,
|
|
1878
|
+
onApply: l[9] || (l[9] = (n) => {
|
|
1879
|
+
var a;
|
|
1880
|
+
return (a = S(t)) == null ? void 0 : a.applyFilterSelection(n);
|
|
1677
1881
|
}),
|
|
1678
|
-
onClear: l[10] || (l[10] = (
|
|
1679
|
-
var
|
|
1680
|
-
return (
|
|
1882
|
+
onClear: l[10] || (l[10] = (n) => {
|
|
1883
|
+
var a;
|
|
1884
|
+
return (a = S(t)) == null ? void 0 : a.clearFilterColumn();
|
|
1681
1885
|
}),
|
|
1682
|
-
onClose: l[11] || (l[11] = (
|
|
1683
|
-
var
|
|
1684
|
-
return (
|
|
1886
|
+
onClose: l[11] || (l[11] = (n) => {
|
|
1887
|
+
var a;
|
|
1888
|
+
return (a = S(t)) == null ? void 0 : a.closeFilterPopup();
|
|
1685
1889
|
}),
|
|
1686
|
-
onSort: l[12] || (l[12] = (
|
|
1687
|
-
var
|
|
1688
|
-
const
|
|
1689
|
-
(
|
|
1890
|
+
onSort: l[12] || (l[12] = (n) => {
|
|
1891
|
+
var h, E, w;
|
|
1892
|
+
const a = (h = ie.value) == null ? void 0 : h.col;
|
|
1893
|
+
(E = S(t)) == null || E.closeFilterPopup(), a != null && ((w = S(t)) == null || w.sortColumn(a, n));
|
|
1690
1894
|
})
|
|
1691
|
-
}, null, 8, ["values", "selected", "x", "y", "sort-dir"])) :
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
rectOf:
|
|
1695
|
-
rectOfRange:
|
|
1696
|
-
tick:
|
|
1895
|
+
}, null, 8, ["values", "selected", "x", "y", "sort-dir"])) : M("", !0),
|
|
1896
|
+
s("div", ps, [
|
|
1897
|
+
le(e.$slots, "overlay", {
|
|
1898
|
+
rectOf: st,
|
|
1899
|
+
rectOfRange: at,
|
|
1900
|
+
tick: ae.value
|
|
1697
1901
|
}, void 0, !0),
|
|
1698
|
-
|
|
1902
|
+
s("div", {
|
|
1699
1903
|
ref_key: "pluginOvEl",
|
|
1700
|
-
ref:
|
|
1904
|
+
ref: ct
|
|
1701
1905
|
}, null, 512)
|
|
1702
1906
|
]),
|
|
1703
|
-
|
|
1907
|
+
s("div", {
|
|
1704
1908
|
class: "editor-slot",
|
|
1705
1909
|
ref_key: "editorSlotEl",
|
|
1706
|
-
ref:
|
|
1910
|
+
ref: et
|
|
1707
1911
|
}, null, 512),
|
|
1708
|
-
|
|
1912
|
+
oe.value ? (v(), c("div", {
|
|
1709
1913
|
key: 2,
|
|
1710
|
-
class:
|
|
1711
|
-
style:
|
|
1712
|
-
},
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
progress:
|
|
1716
|
-
label:
|
|
1717
|
-
pct:
|
|
1914
|
+
class: W(["cell-tooltip", oe.value.kind]),
|
|
1915
|
+
style: _e({ left: oe.value.x + "px", top: oe.value.y + "px" })
|
|
1916
|
+
}, F(oe.value.text), 7)) : M("", !0),
|
|
1917
|
+
S(D) ? (v(), c("div", gs, [
|
|
1918
|
+
le(e.$slots, "loading", {
|
|
1919
|
+
progress: S(ne),
|
|
1920
|
+
label: xt.value,
|
|
1921
|
+
pct: ye.value
|
|
1718
1922
|
}, () => [
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
N(
|
|
1722
|
-
|
|
1923
|
+
s("div", bs, [
|
|
1924
|
+
s("div", ys, [
|
|
1925
|
+
N(F(xt.value), 1),
|
|
1926
|
+
ye.value != null ? (v(), c("span", ks, F(ye.value) + "%", 1)) : M("", !0)
|
|
1723
1927
|
]),
|
|
1724
|
-
|
|
1725
|
-
|
|
1928
|
+
s("div", Cs, [
|
|
1929
|
+
ye.value != null ? (v(), c("div", {
|
|
1726
1930
|
key: 0,
|
|
1727
1931
|
class: "loader-fill",
|
|
1728
|
-
style:
|
|
1729
|
-
}, null, 4)) : (v(), c("div",
|
|
1932
|
+
style: _e({ width: ye.value + "%" })
|
|
1933
|
+
}, null, 4)) : (v(), c("div", xs))
|
|
1730
1934
|
])
|
|
1731
1935
|
])
|
|
1732
1936
|
], !0)
|
|
1733
|
-
])) :
|
|
1734
|
-
|
|
1735
|
-
N("解析失败:" +
|
|
1937
|
+
])) : S(T) ? (v(), c("div", ws, [
|
|
1938
|
+
le(e.$slots, "error", { error: S(T) }, () => [
|
|
1939
|
+
N("解析失败:" + F(S(T)), 1)
|
|
1736
1940
|
], !0)
|
|
1737
|
-
])) :
|
|
1738
|
-
|
|
1941
|
+
])) : S(k) ? M("", !0) : (v(), c("div", hs, [
|
|
1942
|
+
le(e.$slots, "empty", {}, () => [
|
|
1739
1943
|
l[16] || (l[16] = N("拖入或选择一个 .xlsx 文件", -1))
|
|
1740
1944
|
], !0)
|
|
1741
1945
|
]))
|
|
1742
1946
|
], 512),
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
stats:
|
|
1746
|
-
range:
|
|
1947
|
+
S(k) ? (v(), c("div", $s, [
|
|
1948
|
+
le(e.$slots, "statusbar", {
|
|
1949
|
+
stats: H.value,
|
|
1950
|
+
range: wt.value || lt.value
|
|
1747
1951
|
}, () => [
|
|
1748
|
-
|
|
1749
|
-
l[17] || (l[17] =
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
], 64)) :
|
|
1952
|
+
s("span", Ss, F(wt.value || lt.value), 1),
|
|
1953
|
+
l[17] || (l[17] = s("div", { class: "grow" }, null, -1)),
|
|
1954
|
+
H.value && H.value.numCount > 0 ? (v(), c(_, { key: 0 }, [
|
|
1955
|
+
s("span", null, "计数 " + F(H.value.count), 1),
|
|
1956
|
+
s("span", null, "求和 " + F(Be(H.value.sum)), 1),
|
|
1957
|
+
s("span", null, "平均 " + F(Be(H.value.avg)), 1),
|
|
1958
|
+
s("span", null, "最大 " + F(Be(H.value.max)), 1),
|
|
1959
|
+
s("span", null, "最小 " + F(Be(H.value.min)), 1)
|
|
1960
|
+
], 64)) : H.value && H.value.count > 0 ? (v(), c("span", Es, "计数 " + F(H.value.count), 1)) : M("", !0)
|
|
1757
1961
|
], !0)
|
|
1758
|
-
])) :
|
|
1759
|
-
|
|
1962
|
+
])) : M("", !0),
|
|
1963
|
+
S(k) ? (v(), re(Ql, {
|
|
1760
1964
|
key: 4,
|
|
1761
|
-
workbook:
|
|
1762
|
-
active:
|
|
1763
|
-
onSelect: l[13] || (l[13] = (
|
|
1764
|
-
}, null, 8, ["workbook", "active"])) :
|
|
1765
|
-
|
|
1965
|
+
workbook: S(k),
|
|
1966
|
+
active: J.value,
|
|
1967
|
+
onSelect: l[13] || (l[13] = (n) => J.value = n)
|
|
1968
|
+
}, null, 8, ["workbook", "active"])) : M("", !0),
|
|
1969
|
+
Me.value && S(k) ? (v(), re(bn, {
|
|
1766
1970
|
key: 5,
|
|
1767
|
-
selection:
|
|
1768
|
-
"sheet-count":
|
|
1769
|
-
onClose: l[14] || (l[14] = (
|
|
1770
|
-
onExport:
|
|
1771
|
-
}, null, 8, ["selection", "sheet-count"])) :
|
|
1772
|
-
|
|
1971
|
+
selection: te.value,
|
|
1972
|
+
"sheet-count": S(k).sheets.filter((n) => n.state === "visible").length,
|
|
1973
|
+
onClose: l[14] || (l[14] = (n) => Me.value = !1),
|
|
1974
|
+
onExport: fl
|
|
1975
|
+
}, null, 8, ["selection", "sheet-count"])) : M("", !0),
|
|
1976
|
+
s("input", {
|
|
1773
1977
|
ref_key: "templateInputEl",
|
|
1774
|
-
ref:
|
|
1978
|
+
ref: kt,
|
|
1775
1979
|
type: "file",
|
|
1776
1980
|
accept: ".xlsx,.xlsm",
|
|
1777
1981
|
hidden: "",
|
|
1778
|
-
onChange:
|
|
1982
|
+
onChange: Ot
|
|
1779
1983
|
}, null, 544),
|
|
1780
|
-
|
|
1984
|
+
r.exportProgress !== !1 ? le(e.$slots, "export-progress", {
|
|
1781
1985
|
key: 6,
|
|
1782
|
-
state:
|
|
1783
|
-
busy:
|
|
1784
|
-
cancel:
|
|
1986
|
+
state: he.value,
|
|
1987
|
+
busy: We.value,
|
|
1988
|
+
cancel: Et
|
|
1785
1989
|
}, () => [
|
|
1786
|
-
|
|
1787
|
-
state:
|
|
1788
|
-
busy:
|
|
1789
|
-
onCancel:
|
|
1990
|
+
pt(ds, {
|
|
1991
|
+
state: he.value,
|
|
1992
|
+
busy: We.value,
|
|
1993
|
+
onCancel: Et
|
|
1790
1994
|
}, null, 8, ["state", "busy"])
|
|
1791
|
-
], !0) :
|
|
1995
|
+
], !0) : M("", !0)
|
|
1792
1996
|
], 544));
|
|
1793
1997
|
}
|
|
1794
|
-
}),
|
|
1795
|
-
install(
|
|
1796
|
-
|
|
1998
|
+
}), Fs = /* @__PURE__ */ Q(Ts, [["__scopeId", "data-v-80983538"]]), Ds = {
|
|
1999
|
+
install(r) {
|
|
2000
|
+
r.component("ExcelViewer", Fs);
|
|
1797
2001
|
}
|
|
1798
2002
|
};
|
|
1799
2003
|
export {
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
2004
|
+
Ls as DEFAULT_THEME,
|
|
2005
|
+
Fs as ExcelViewer,
|
|
2006
|
+
Ns as canvasToBlob,
|
|
2007
|
+
Vs as canvasToDataURL,
|
|
2008
|
+
Bs as cellDisplayText,
|
|
2009
|
+
Ws as cellKey,
|
|
2010
|
+
Ds as default,
|
|
2011
|
+
Gs as definePlugin,
|
|
2012
|
+
Hs as downloadBlob,
|
|
2013
|
+
Os as formatValue,
|
|
2014
|
+
Us as getCell,
|
|
2015
|
+
_s as getCellStyle,
|
|
2016
|
+
Rl as getCellText,
|
|
2017
|
+
Pl as getCellValue,
|
|
2018
|
+
Fl as getRangeData,
|
|
2019
|
+
Ml as getSheetData,
|
|
2020
|
+
Ks as getWorkbookJSON,
|
|
2021
|
+
Nt as loadArrayBuffer,
|
|
2022
|
+
qs as mergeTheme,
|
|
2023
|
+
Js as parseWorkbook,
|
|
2024
|
+
Il as sheetToJSON
|
|
1821
2025
|
};
|