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