@lingshugroup/web-plus 2.4.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.css +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.gz +0 -0
- package/lib/packages/ls-components/components/icon/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/icon/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/icon/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/icon/Index.vue/index2.js +16 -15
- package/lib/packages/ls-components/components/icon/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/icon/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index.js +2 -2
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.js +54 -39
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.js +30 -27
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_image/Image.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_image/Image.vue/index.js +2 -2
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.js +132 -131
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_image/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_image/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/preview_image/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview_image/Index.vue/index2.js +33 -30
- package/lib/packages/ls-components/components/preview_image/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_image/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index.js +1 -1
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.js +31 -27
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index.js +3 -3
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js +132 -116
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index.js +3 -3
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.js +25 -22
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index.js +1 -1
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.js +124 -108
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.js.gz +0 -0
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var l = (
|
|
1
|
+
var V = Object.defineProperty;
|
|
2
|
+
var l = (r, t) => V(r, "name", { value: t, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import { defineComponent as v, mergeModels as f, useModel as _, createElementBlock as P, createCommentVNode as h, openBlock as a, normalizeClass as S, unref as e, createBlock as k, createElementVNode as g, mergeProps as s, withCtx as B, createVNode as x, renderSlot as M } from "vue";
|
|
5
|
+
import m from "../Xlsx.vue/index.js";
|
|
6
|
+
import N from "../../_hooks/usePreviewHook/index.js";
|
|
7
7
|
import { lsPreviewProp as X } from "../../_constants/previewType/index.js";
|
|
8
|
-
import { ElWatermark as
|
|
8
|
+
import { ElWatermark as $ } from "../../../../../node_modules/.pnpm/element-plus@2.10.7_vue@3.5.18_typescript@5.9.2_/node_modules/element-plus/es/components/watermark/index/index.js";
|
|
9
9
|
import w from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
|
|
10
|
-
const A =
|
|
10
|
+
const A = { class: "ls-preview-extra" }, W = v({
|
|
11
11
|
name: "LSPreviewXlsx"
|
|
12
|
-
}),
|
|
13
|
-
...
|
|
12
|
+
}), I = /* @__PURE__ */ v({
|
|
13
|
+
...W,
|
|
14
14
|
name: "LSPreviewXlsx",
|
|
15
15
|
components: {
|
|
16
|
-
LSXlsx:
|
|
16
|
+
LSXlsx: m
|
|
17
17
|
},
|
|
18
18
|
inheritAttrs: !1,
|
|
19
19
|
props: /* @__PURE__ */ f(X, {
|
|
@@ -23,34 +23,37 @@ const A = C({
|
|
|
23
23
|
modelModifiers: {}
|
|
24
24
|
}),
|
|
25
25
|
emits: /* @__PURE__ */ f(["loadComplete", "loadError"], ["update:modelValue"]),
|
|
26
|
-
setup(
|
|
27
|
-
const n = t,
|
|
26
|
+
setup(r, { emit: t }) {
|
|
27
|
+
const n = t, C = r, d = _(r, "modelValue"), { comClass: E, defAttrs: i, closeLoading: p, watermarkStyle: L } = N(C, d), c = /* @__PURE__ */ l(() => {
|
|
28
28
|
p(), n("loadComplete");
|
|
29
29
|
}, "loadComplete"), u = /* @__PURE__ */ l(() => {
|
|
30
30
|
p(), n("loadError");
|
|
31
31
|
}, "loadError");
|
|
32
|
-
return (
|
|
33
|
-
const
|
|
34
|
-
return
|
|
32
|
+
return (o, b) => {
|
|
33
|
+
const y = $;
|
|
34
|
+
return d.value ? (a(), P("div", {
|
|
35
35
|
key: 0,
|
|
36
|
-
class:
|
|
36
|
+
class: S(e(E))
|
|
37
37
|
}, [
|
|
38
|
-
|
|
38
|
+
o.showWatermark ? (a(), k(y, s({ key: 0 }, o.watermarkOption, { style: e(L) }), {
|
|
39
39
|
default: B(() => [
|
|
40
|
-
|
|
40
|
+
x(m, s(e(w)(e(i), o.$attrs), {
|
|
41
41
|
onLoadComplete: c,
|
|
42
42
|
onLoadError: u
|
|
43
43
|
}), null, 16)
|
|
44
44
|
]),
|
|
45
45
|
_: 1
|
|
46
|
-
}, 16, ["style"])) : (a(), k(
|
|
46
|
+
}, 16, ["style"])) : (a(), k(m, s({ key: 1 }, e(w)(e(i), o.$attrs), {
|
|
47
47
|
onLoadComplete: c,
|
|
48
48
|
onLoadError: u
|
|
49
|
-
}), null, 16))
|
|
50
|
-
|
|
49
|
+
}), null, 16)),
|
|
50
|
+
g("div", A, [
|
|
51
|
+
M(o.$slots, "extra", {}, void 0, !0)
|
|
52
|
+
])
|
|
53
|
+
], 2)) : h("", !0);
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
56
|
});
|
|
54
57
|
export {
|
|
55
|
-
|
|
58
|
+
I as default
|
|
56
59
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-2de14eeb"]]);exports.default=u;
|
|
@@ -2,7 +2,7 @@ import o from "./index2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
|
|
5
|
-
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2de14eeb"]]);
|
|
6
6
|
export {
|
|
7
7
|
s as default
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Q=Object.defineProperty;var c=(v,x)=>Q(v,"name",{value:x,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),W=/* empty css */Y=/* empty css */I=/* empty css */L=/* empty css */Z=/* empty css */V=/* empty css */ee=require("luckyexcel"),n=;/* empty css */;/* empty css */;/* empty css */;/* empty css */const j=/* empty css */te=e.defineComponent({name:"LSXlsx"}),oe=e.defineComponent({...te,props:Y.xlsxProps,emits:I.previewEmits,setup(v,{emit:x}){const f=W.useNamespace("xlsx"),A=f.b(),w=v,l=x,h=e.useAttrs(),R=e.computed(()=>h["has-download"]||h.hasDownload),P=e.computed(()=>h["download-loading"]||h.downloadLoading||!1);e.watch(()=>w.source,t=>{if(t){const{size:o}=t||{};o/1024/1024<=n.fileSizeLimit?$(t):w.hasPagination?U(t):(j.ElMessage.error(`文件大小超过 ${n.fileSizeLimit} MB,加载失败!`),l("loadComplete"))}},{immediate:!0,deep:!0});const E=e.ref(!1);function _(){const t=document.scripts;for(let o=0;o<t.length;o++)if(t[o].src.includes("luckysheet"))return!0;return!1}c(_,"isLuckySheet");const X=c(()=>{w.onClose&&w.onClose(),l("update:source",[])},"closeFunc");async function $(t){let o=!1;if(await b(t))try{ee.transformExcelToLucky(t,function(r){if(r.sheets==null){l("loadError");return}window.luckysheet.destroy(),window.luckysheet.create({data:r.sheets,title:r.info.name,...n.luckysheetConfig}),o=!0,l("loadComplete")});let a=setTimeout(()=>{o||(j.ElMessage.error(I.fileEmpty),l("loadError"),clearTimeout(a))},6e3)}catch{l("loadError")}}c($,"initXlsx");function O(t){const o=Math.min(0+n.rowsPerBatch,t.length),a=t.slice(0,o);let r=0;const s=[[]];return window.luckysheet.transToCellData(a).forEach(i=>{const{r:m}=i;r!==m&&(r=m,s[r]=[]),s[r].push(i)}),s}c(O,"getSheetData");async function U(t){if(await e.nextTick(),!!await b(t))try{const o=new FileReader;o.onload=async function(a){var z,N;const r=V.read(a.target.result,{type:"binary",dense:!0});let s=0;const i=(r.SheetNames||[]).map(u=>({name:u,data:V.utils.sheet_to_json(r.Sheets[u],{header:1})})),m=e.ref((z=i[s])==null?void 0:z.name),p=e.ref((N=i[s])==null?void 0:N.data);let y=p.value.length,D=0;const J=(i||[]).map((u,k)=>({name:u.name,index:k+1,status:"1",order:k,data:O(u.data)}));function T(){if(D*n.rowsPerBatch>=y)return;const u=D*n.rowsPerBatch,k=Math.min(u+n.rowsPerBatch,y),K=p.value.slice(u,k);let g=0;const q=[[]];if(window.luckysheet.transToCellData(K).forEach(C=>{const{r:d}=C;g!==d&&(g=d,q[g]=[]),q[g].push(C)}),E.value)window.luckysheet.updataSheet({data:[{name:m,index:s+1,status:"1",order:s,data:q}]});else{window.luckysheet.destroy();const C={...n.luckysheetConfig,hook:{sheetActivate(d){var S,F,M;if(s!=d){s=d-1,m.value=(S=i[s])==null?void 0:S.name,p.value=((F=i[s])==null?void 0:F.data)||[],y=p.value.length;const B=(M=document.getElementById("luckysheet"))==null?void 0:M.querySelector('.spage-number button[data-page="1"]');B==null||B.click()}},onTogglePager(d){const{page:S}=d;D=S-1,T()}}};window.luckysheet.create({data:J,pager:{pageIndex:1,total:y,pageSize:n.rowsPerBatch,showTotal:!0,showSkip:!0,showPN:!0,prevPage:"",nextPage:"",totalTxt:""},...C}),E.value=!0}l("loadComplete")}c(T,"loadBatch"),T()},o.readAsArrayBuffer(t)}catch{l("loadError")}}c(U,"initXlsxLarge");async function b(t){return!t||!Z.isFile(t)?!1:(_()||(await L.loadCss(n.cssList),await L.loadJs(n.jsList)),!0)}c(b,"initLuckySheet");function G(){E.value&&window.luckysheet.destroy(),_()&&(L.removeCss(n.cssList),L.removeJs(n.jsList))}c(G,"resetLuckySheet");function H(){l("download",h.downloadData)}return c(H,"onDownload"),e.onBeforeUnmount(()=>{G()}),(t,o)=>{const a=e.resolveComponent("LSIcon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(A))},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(f).e("btn"),e.unref(f).e("close")]),onClick:X},[e.createVNode(a,{name:"Close",size:24,color:"#FFF"})],2),e.unref(R)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(f).e("btn"),e.unref(f).e("download")]),onClick:H},[e.createVNode(a,{class:e.normalizeClass({"is-loading":e.unref(P)}),name:`${e.unref(P)?"Loading":"Download"}`,size:24,color:"#FFF"},null,8,["class","name"])],2)):e.createCommentVNode("",!0),o[0]||(o[0]=e.createElementVNode("div",{id:"luckysheet",class:"luckysheet-wrap"},null,-1))],2)}}});exports.default=oe;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import { useNamespace as
|
|
5
|
-
import { xlsxProps as
|
|
6
|
-
import { previewEmits as
|
|
7
|
-
import { loadCss as
|
|
8
|
-
import { isFile as
|
|
9
|
-
import { read as
|
|
10
|
-
import
|
|
11
|
-
import { fileSizeLimit as
|
|
1
|
+
var re = Object.defineProperty;
|
|
2
|
+
var r = (x, D) => re(x, "name", { value: D, configurable: !0 });
|
|
3
|
+
import { defineComponent as K, useAttrs as se, computed as R, watch as ce, ref as F, nextTick as le, onBeforeUnmount as ie, resolveComponent as ue, createElementBlock as V, openBlock as X, normalizeClass as L, unref as i, createElementVNode as j, createCommentVNode as de, createVNode as $ } from "vue";
|
|
4
|
+
import { useNamespace as me } from "../../_hooks/useNamespace/index.js";
|
|
5
|
+
import { xlsxProps as fe } from "../types/index.js";
|
|
6
|
+
import { previewEmits as he, fileEmpty as pe } from "../../_constants/previewType/index.js";
|
|
7
|
+
import { loadCss as we, loadJs as ye, removeCss as ke, removeJs as ge } from "../../_utils/utils/index.js";
|
|
8
|
+
import { isFile as Ce } from "../../_utils/check/index.js";
|
|
9
|
+
import { read as Se, utils as Le } from "../../../../../node_modules/.pnpm/xlsx@0.18.5/node_modules/xlsx/xlsx/index.js";
|
|
10
|
+
import xe from "luckyexcel";
|
|
11
|
+
import { fileSizeLimit as q, luckysheetConfig as U, rowsPerBatch as h, cssList as G, jsList as H } from "../config/index.js";
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
14
|
/* empty css */
|
|
15
|
-
import { ElMessage as
|
|
16
|
-
const
|
|
15
|
+
import { ElMessage as J } from "../../../../../node_modules/.pnpm/element-plus@2.10.7_vue@3.5.18_typescript@5.9.2_/node_modules/element-plus/es/components/message/index/index.js";
|
|
16
|
+
const De = K({
|
|
17
17
|
name: "LSXlsx"
|
|
18
|
-
}),
|
|
19
|
-
...
|
|
20
|
-
props:
|
|
21
|
-
emits:
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
() =>
|
|
18
|
+
}), Ve = /* @__PURE__ */ K({
|
|
19
|
+
...De,
|
|
20
|
+
props: fe,
|
|
21
|
+
emits: he,
|
|
22
|
+
setup(x, { emit: D }) {
|
|
23
|
+
const d = me("xlsx"), O = d.b(), p = x, s = D, m = se(), Q = R(() => m["has-download"] || m.hasDownload), T = R(() => m["download-loading"] || m.downloadLoading || !1);
|
|
24
|
+
ce(
|
|
25
|
+
() => p.source,
|
|
26
26
|
(e) => {
|
|
27
27
|
if (e) {
|
|
28
28
|
const { size: t } = e || {};
|
|
29
|
-
t / 1024 / 1024 <=
|
|
29
|
+
t / 1024 / 1024 <= q ? Y(e) : p.hasPagination ? ee(e) : (J.error(`文件大小超过 ${q} MB,加载失败!`), s("loadComplete"));
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
{
|
|
@@ -34,124 +34,124 @@ const we = q({
|
|
|
34
34
|
deep: !0
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
|
-
const
|
|
38
|
-
function
|
|
37
|
+
const E = F(!1);
|
|
38
|
+
function B() {
|
|
39
39
|
const e = document.scripts;
|
|
40
40
|
for (let t = 0; t < e.length; t++)
|
|
41
41
|
if (e[t].src.includes("luckysheet"))
|
|
42
42
|
return !0;
|
|
43
43
|
return !1;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
45
|
+
r(B, "isLuckySheet");
|
|
46
|
+
const W = /* @__PURE__ */ r(() => {
|
|
47
|
+
p.onClose && p.onClose(), s("update:source", []);
|
|
48
48
|
}, "closeFunc");
|
|
49
|
-
async function
|
|
49
|
+
async function Y(e) {
|
|
50
50
|
let t = !1;
|
|
51
|
-
if (await
|
|
51
|
+
if (await N(e))
|
|
52
52
|
try {
|
|
53
|
-
|
|
53
|
+
xe.transformExcelToLucky(
|
|
54
54
|
e,
|
|
55
|
-
function(
|
|
56
|
-
if (
|
|
57
|
-
|
|
55
|
+
function(a) {
|
|
56
|
+
if (a.sheets == null) {
|
|
57
|
+
s("loadError");
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
window.luckysheet.destroy(), window.luckysheet.create({
|
|
61
|
-
data:
|
|
62
|
-
title:
|
|
63
|
-
...
|
|
64
|
-
}), t = !0,
|
|
61
|
+
data: a.sheets,
|
|
62
|
+
title: a.info.name,
|
|
63
|
+
...U
|
|
64
|
+
}), t = !0, s("loadComplete");
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
|
-
let
|
|
68
|
-
t || (
|
|
67
|
+
let n = setTimeout(() => {
|
|
68
|
+
t || (J.error(pe), s("loadError"), clearTimeout(n));
|
|
69
69
|
}, 6e3);
|
|
70
70
|
} catch {
|
|
71
|
-
|
|
71
|
+
s("loadError");
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
function
|
|
76
|
-
const t = Math.min(0 +
|
|
77
|
-
let
|
|
74
|
+
r(Y, "initXlsx");
|
|
75
|
+
function Z(e) {
|
|
76
|
+
const t = Math.min(0 + h, e.length), n = e.slice(0, t);
|
|
77
|
+
let a = 0;
|
|
78
78
|
const o = [[]];
|
|
79
|
-
return window.luckysheet.transToCellData(
|
|
80
|
-
const { r:
|
|
81
|
-
|
|
79
|
+
return window.luckysheet.transToCellData(n).forEach((c) => {
|
|
80
|
+
const { r: f } = c;
|
|
81
|
+
a !== f && (a = f, o[a] = []), o[a].push(c);
|
|
82
82
|
}), o;
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
async function
|
|
86
|
-
if (await
|
|
84
|
+
r(Z, "getSheetData");
|
|
85
|
+
async function ee(e) {
|
|
86
|
+
if (await le(), !!await N(e))
|
|
87
87
|
try {
|
|
88
88
|
const t = new FileReader();
|
|
89
|
-
t.onload = async function(
|
|
90
|
-
var
|
|
91
|
-
const
|
|
89
|
+
t.onload = async function(n) {
|
|
90
|
+
var z, I;
|
|
91
|
+
const a = Se(n.target.result, {
|
|
92
92
|
type: "binary",
|
|
93
93
|
dense: !0
|
|
94
94
|
});
|
|
95
95
|
let o = 0;
|
|
96
|
-
const c = (
|
|
96
|
+
const c = (a.SheetNames || []).map((l) => ({
|
|
97
97
|
name: l,
|
|
98
|
-
data:
|
|
99
|
-
})),
|
|
100
|
-
let
|
|
101
|
-
const
|
|
98
|
+
data: Le.sheet_to_json(a.Sheets[l], { header: 1 })
|
|
99
|
+
})), f = F((z = c[o]) == null ? void 0 : z.name), w = F((I = c[o]) == null ? void 0 : I.data);
|
|
100
|
+
let y = w.value.length, v = 0;
|
|
101
|
+
const ae = (c || []).map((l, k) => ({
|
|
102
102
|
name: l.name,
|
|
103
|
-
index:
|
|
103
|
+
index: k + 1,
|
|
104
104
|
status: "1",
|
|
105
|
-
order:
|
|
106
|
-
data:
|
|
105
|
+
order: k,
|
|
106
|
+
data: Z(l.data)
|
|
107
107
|
}));
|
|
108
|
-
function
|
|
109
|
-
if (
|
|
110
|
-
const l =
|
|
111
|
-
let
|
|
112
|
-
const
|
|
113
|
-
if (window.luckysheet.transToCellData(
|
|
114
|
-
const { r:
|
|
115
|
-
|
|
116
|
-
}),
|
|
108
|
+
function P() {
|
|
109
|
+
if (v * h >= y) return;
|
|
110
|
+
const l = v * h, k = Math.min(l + h, y), ne = w.value.slice(l, k);
|
|
111
|
+
let g = 0;
|
|
112
|
+
const _ = [[]];
|
|
113
|
+
if (window.luckysheet.transToCellData(ne).forEach((C) => {
|
|
114
|
+
const { r: u } = C;
|
|
115
|
+
g !== u && (g = u, _[g] = []), _[g].push(C);
|
|
116
|
+
}), E.value)
|
|
117
117
|
window.luckysheet.updataSheet({
|
|
118
118
|
data: [
|
|
119
119
|
{
|
|
120
|
-
name:
|
|
120
|
+
name: f,
|
|
121
121
|
index: o + 1,
|
|
122
122
|
status: "1",
|
|
123
123
|
order: o,
|
|
124
|
-
data:
|
|
124
|
+
data: _
|
|
125
125
|
}
|
|
126
126
|
]
|
|
127
127
|
});
|
|
128
128
|
else {
|
|
129
129
|
window.luckysheet.destroy();
|
|
130
|
-
const
|
|
131
|
-
...
|
|
130
|
+
const C = {
|
|
131
|
+
...U,
|
|
132
132
|
hook: {
|
|
133
|
-
sheetActivate(
|
|
134
|
-
var
|
|
135
|
-
if (o !=
|
|
136
|
-
o =
|
|
137
|
-
const
|
|
138
|
-
|
|
133
|
+
sheetActivate(u) {
|
|
134
|
+
var S, A, M;
|
|
135
|
+
if (o != u) {
|
|
136
|
+
o = u - 1, f.value = (S = c[o]) == null ? void 0 : S.name, w.value = ((A = c[o]) == null ? void 0 : A.data) || [], y = w.value.length;
|
|
137
|
+
const b = (M = document.getElementById("luckysheet")) == null ? void 0 : M.querySelector('.spage-number button[data-page="1"]');
|
|
138
|
+
b == null || b.click();
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
|
-
onTogglePager(
|
|
142
|
-
const { page:
|
|
143
|
-
|
|
141
|
+
onTogglePager(u) {
|
|
142
|
+
const { page: S } = u;
|
|
143
|
+
v = S - 1, P();
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
147
|
window.luckysheet.create({
|
|
148
|
-
data:
|
|
148
|
+
data: ae,
|
|
149
149
|
pager: {
|
|
150
150
|
pageIndex: 1,
|
|
151
151
|
//当前页码,必填
|
|
152
|
-
total:
|
|
152
|
+
total: y,
|
|
153
153
|
//数据总条数,必填
|
|
154
|
-
pageSize:
|
|
154
|
+
pageSize: h,
|
|
155
155
|
//每页显示多少条数据,默认10条
|
|
156
156
|
showTotal: !0,
|
|
157
157
|
// 是否显示总数,默认关闭:false
|
|
@@ -166,43 +166,59 @@ const we = q({
|
|
|
166
166
|
totalTxt: ""
|
|
167
167
|
// 数据总条数文字描述,默认"总共:{total}"
|
|
168
168
|
},
|
|
169
|
-
...
|
|
170
|
-
}),
|
|
169
|
+
...C
|
|
170
|
+
}), E.value = !0;
|
|
171
171
|
}
|
|
172
|
-
|
|
172
|
+
s("loadComplete");
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
r(P, "loadBatch"), P();
|
|
175
175
|
}, t.readAsArrayBuffer(e);
|
|
176
176
|
} catch {
|
|
177
|
-
|
|
177
|
+
s("loadError");
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
|
|
181
|
-
async function
|
|
182
|
-
return !e || !
|
|
180
|
+
r(ee, "initXlsxLarge");
|
|
181
|
+
async function N(e) {
|
|
182
|
+
return !e || !Ce(e) ? !1 : (B() || (await we(G), await ye(H)), !0);
|
|
183
183
|
}
|
|
184
|
-
|
|
185
|
-
function
|
|
186
|
-
|
|
184
|
+
r(N, "initLuckySheet");
|
|
185
|
+
function te() {
|
|
186
|
+
E.value && window.luckysheet.destroy(), B() && (ke(G), ge(H));
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
r(te, "resetLuckySheet");
|
|
189
|
+
function oe() {
|
|
190
|
+
s("download", m.downloadData);
|
|
191
|
+
}
|
|
192
|
+
return r(oe, "onDownload"), ie(() => {
|
|
193
|
+
te();
|
|
190
194
|
}), (e, t) => {
|
|
191
|
-
const
|
|
192
|
-
return
|
|
193
|
-
class:
|
|
195
|
+
const n = ue("LSIcon");
|
|
196
|
+
return X(), V("div", {
|
|
197
|
+
class: L(i(O))
|
|
194
198
|
}, [
|
|
195
|
-
|
|
196
|
-
class:
|
|
197
|
-
onClick:
|
|
199
|
+
j("div", {
|
|
200
|
+
class: L([i(d).e("btn"), i(d).e("close")]),
|
|
201
|
+
onClick: W
|
|
198
202
|
}, [
|
|
199
|
-
|
|
203
|
+
$(n, {
|
|
200
204
|
name: "Close",
|
|
201
205
|
size: 24,
|
|
202
206
|
color: "#FFF"
|
|
203
207
|
})
|
|
204
208
|
], 2),
|
|
205
|
-
|
|
209
|
+
i(Q) ? (X(), V("div", {
|
|
210
|
+
key: 0,
|
|
211
|
+
class: L([i(d).e("btn"), i(d).e("download")]),
|
|
212
|
+
onClick: oe
|
|
213
|
+
}, [
|
|
214
|
+
$(n, {
|
|
215
|
+
class: L({ "is-loading": i(T) }),
|
|
216
|
+
name: `${i(T) ? "Loading" : "Download"}`,
|
|
217
|
+
size: 24,
|
|
218
|
+
color: "#FFF"
|
|
219
|
+
}, null, 8, ["class", "name"])
|
|
220
|
+
], 2)) : de("", !0),
|
|
221
|
+
t[0] || (t[0] = j("div", {
|
|
206
222
|
id: "luckysheet",
|
|
207
223
|
class: "luckysheet-wrap"
|
|
208
224
|
}, null, -1))
|
|
@@ -211,5 +227,5 @@ const we = q({
|
|
|
211
227
|
}
|
|
212
228
|
});
|
|
213
229
|
export {
|
|
214
|
-
|
|
230
|
+
Ve as default
|
|
215
231
|
};
|
|
Binary file
|
|
Binary file
|