@lingshugroup/web-plus 1.0.27 → 1.0.29
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/node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min/index.js.gz +0 -0
- package/lib/packages/ls-components/components/_utils/utils/index.cjs +1 -1
- package/lib/packages/ls-components/components/_utils/utils/index.js +1 -1
- package/lib/packages/ls-components/components/_utils/utils/index.js.br +0 -0
- package/lib/packages/ls-components/components/_utils/utils/index.js.gz +0 -0
- package/lib/packages/ls-components/components/dialog/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js +2 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview/Index.vue/index.js +3 -3
- package/lib/packages/ls-components/components/preview/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview/Index.vue/index2.js +54 -46
- package/lib/packages/ls-components/components/preview/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview/components/Pdf.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview/components/Pdf.vue/index.js +2 -2
- package/lib/packages/ls-components/components/preview/components/Pdf.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview/components/Pdf.vue/index2.js +51 -47
- package/lib/packages/ls-components/components/preview/components/Pdf.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview/components/Pdf.vue/index2.js.gz +0 -0
- package/package.json +1 -1
package/lib/index.css.br
CHANGED
|
Binary file
|
package/lib/index.css.gz
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var n=(t,e)=>a(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function f(t){if(t===null)return!0;const e=typeof t;return!!(e==="undefined"||e==="string"&&(t=t.replace(/^\s*|\s*$/g,""),t==="")||e==="number"&&Number.isNaN(t)||e==="object"&&Object.keys(t).length===0)}n(f,"isEmpty");const d=n((t=[])=>{const e=[];return t.forEach(o=>{e.push(new Promise((c,u)=>{const r=document.createElement("script");r.id=o.id,r.src=o.src,document.body.appendChild(r),r.onload=function(){c({})},r.onerror=function(){r.remove(),u({})}}))}),Promise.all(e)},"loadJs"),p=n((t=[])=>{t.forEach(e=>{const o=document.getElementById(e.id);o&&o.remove()})},"removeJs"),h=n((t=[])=>{const e=[];return t.forEach(o=>{e.push(new Promise((c,u)=>{const r=document.createElement("link");r.id=o.id,r.rel="stylesheet",r.href=o.src,document.body.appendChild(r),r.onload=function(){c({})},r.onerror=function(){r.remove(),u({})}}))}),Promise.all(e)},"loadCss"),m=n((t=[])=>{t.forEach(e=>{const o=document.getElementById(e.id);o&&o.remove()})},"removeCss");function s(t,e){return Number((Math.ceil(t*100)/100).toFixed(e||1))}n(s,"numberFixed");function b(t,e,o){const c=t,u=e;o=o||0,t=s(t,o),e=s(e,o);let r=s((t-e)/2,o);r=r==0?.1:r;let l=Math.ceil((t-e)/r);l=l==0?1:l,e<r&&(e=0);let i=s(r*l+e,o);return i
|
|
1
|
+
"use strict";var a=Object.defineProperty;var n=(t,e)=>a(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function f(t){if(t===null)return!0;const e=typeof t;return!!(e==="undefined"||e==="string"&&(t=t.replace(/^\s*|\s*$/g,""),t==="")||e==="number"&&Number.isNaN(t)||e==="object"&&Object.keys(t).length===0)}n(f,"isEmpty");const d=n((t=[])=>{const e=[];return t.forEach(o=>{e.push(new Promise((c,u)=>{const r=document.createElement("script");r.id=o.id,r.src=o.src,document.body.appendChild(r),r.onload=function(){c({})},r.onerror=function(){r.remove(),u({})}}))}),Promise.all(e)},"loadJs"),p=n((t=[])=>{t.forEach(e=>{const o=document.getElementById(e.id);o&&o.remove()})},"removeJs"),h=n((t=[])=>{const e=[];return t.forEach(o=>{e.push(new Promise((c,u)=>{const r=document.createElement("link");r.id=o.id,r.rel="stylesheet",r.href=o.src,document.body.appendChild(r),r.onload=function(){c({})},r.onerror=function(){r.remove(),u({})}}))}),Promise.all(e)},"loadCss"),m=n((t=[])=>{t.forEach(e=>{const o=document.getElementById(e.id);o&&o.remove()})},"removeCss");function s(t,e){return Number((Math.ceil(t*100)/100).toFixed(e||1))}n(s,"numberFixed");function b(t,e,o){const c=t,u=e;o=o||0,t=s(t,o),e=s(e,o);let r=s((t-e)/2,o);r=r==0?.1:r;let l=Math.ceil((t-e)/r);l=l==0?1:l,e<r&&(e=0);let i=s(r*l+e,o);return i<=c&&(i=s(i+r,o)),{aMax:i,aMin:e==0||e<u?e:s(e-r,o),aInterval:r}}n(b,"formatChartAxis");function y(t){try{return t=JSON.parse(t),t!==null&&typeof t=="object"?t.constructor===Object:!1}catch{return!1}}n(y,"isValidJSON");exports.formatChartAxis=b;exports.isEmpty=f;exports.isValidJSON=y;exports.loadCss=h;exports.loadJs=d;exports.numberFixed=s;exports.removeCss=m;exports.removeJs=p;
|
|
@@ -57,7 +57,7 @@ function m(t, e, n) {
|
|
|
57
57
|
let l = Math.ceil((t - e) / r);
|
|
58
58
|
l = l == 0 ? 1 : l, e < r && (e = 0);
|
|
59
59
|
let i = c(r * l + e, n);
|
|
60
|
-
return i
|
|
60
|
+
return i <= s && (i = c(i + r, n)), {
|
|
61
61
|
aMax: i,
|
|
62
62
|
aMin: e == 0 || e < u ? e : c(e - r, n),
|
|
63
63
|
aInterval: r
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var N=Object.defineProperty;var l=(n,a)=>N(n,"name",{value:a,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),_=,/* empty css */k=,/* empty css */s=,/* empty css */D=,/* empty css */x=,/* empty css */M=,/* empty css */P={key:1,class:"content-wrap"},$={class:"dialog-footer"},E=e.defineComponent({name:"LSDialog",inheritAttrs:!1,__name:"Index",props:e.mergeModels(k.lsDialogProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(k.lsEmitNames,["update:modelValue"]),setup(n,{expose:a,emit:S}){const r=n,i=S,v=e.useSlots(),t=e.useModel(n,"modelValue"),y=_.useNamespace("dialog").b(),d=e.ref(),u=e.ref({width:"50%",closeOnClickModal:!1,closeOnPressEscape:!1,zIndex:2e3}),c=e.ref(0);e.watch(()=>t==null?void 0:t.value,o=>{o&&r.openScroll&&p()},{immediate:!0,deep:!0});const f=e.computed(()=>s.default({txt:"取消"},r.btnCancelConfig)),m=e.computed(()=>s.default({type:"primary",txt:"确认"},r.btnConfirmConfig));function g(){t.value=!1,i("onCancel")}l(g,"handleClose");function B(){i("onConfirm")}l(B,"handleConfirm");async function p(){await e.nextTick();const o=r.hasFooter?108:60;c.value=parseInt(getComputedStyle(d.value.querySelector(".el-dialog")).height)-o}return l(p,"updateHeight"),a({updateHeight:p}),(o,
|
|
1
|
+
"use strict";var N=Object.defineProperty;var l=(n,a)=>N(n,"name",{value:a,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),_=,/* empty css */k=,/* empty css */s=,/* empty css */D=,/* empty css */x=,/* empty css */M=,/* empty css */P={key:1,class:"content-wrap"},$={class:"dialog-footer"},E=e.defineComponent({name:"LSDialog",inheritAttrs:!1,__name:"Index",props:e.mergeModels(k.lsDialogProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(k.lsEmitNames,["update:modelValue"]),setup(n,{expose:a,emit:S}){const r=n,i=S,v=e.useSlots(),t=e.useModel(n,"modelValue"),y=_.useNamespace("dialog").b(),d=e.ref(),u=e.ref({width:"50%",closeOnClickModal:!1,closeOnPressEscape:!1,zIndex:2e3,alignCenter:!0}),c=e.ref(0);e.watch(()=>t==null?void 0:t.value,o=>{o&&r.openScroll&&p()},{immediate:!0,deep:!0});const f=e.computed(()=>s.default({txt:"取消"},r.btnCancelConfig)),m=e.computed(()=>s.default({type:"primary",txt:"确认"},r.btnConfirmConfig));function g(){t.value=!1,i("onCancel")}l(g,"handleClose");function B(){i("onConfirm")}l(B,"handleConfirm");async function p(){await e.nextTick();const o=r.hasFooter?108:60;c.value=parseInt(getComputedStyle(d.value.querySelector(".el-dialog")).height)-o}return l(p,"updateHeight"),a({updateHeight:p}),(o,C)=>{const q=D.ElScrollbar,h=e.resolveComponent("LSButton"),w=x.ElDialog,V=M.vLoading;return e.openBlock(),e.createBlock(w,e.mergeProps({ref_key:"lsDialogRef",ref:d,class:e.unref(y),modelValue:t.value,"onUpdate:modelValue":C[0]||(C[0]=b=>t.value=b)},e.unref(s.default)(e.unref(u),o.$attrs),{"show-close":!o.loading,onClose:g}),e.createSlots({header:e.withCtx(()=>[e.renderSlot(o.$slots,"header")]),default:e.withCtx(()=>[o.openScroll?e.withDirectives((e.openBlock(),e.createBlock(q,e.mergeProps({key:0},e.unref(s.default)(e.unref(u),o.$attrs),{"max-height":e.unref(c)}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16,["max-height"])),[[V,o.contentLoading]]):(e.openBlock(),e.createElementBlock("div",P,[e.renderSlot(o.$slots,"default")]))]),_:2},[o.hasFooter?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",$,[e.unref(v).footer?e.renderSlot(o.$slots,"footer",{key:0}):e.createCommentVNode("",!0),o.hasCancelBtn?(e.openBlock(),e.createBlock(h,e.mergeProps({key:1},e.unref(f),{disabled:o.loading,onClick:g}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f).txt),1)]),_:1},16,["disabled"])):e.createCommentVNode("",!0),e.createVNode(h,e.mergeProps(e.unref(m),{loading:o.loading,disabled:o.loading,onClick:B}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m).txt),1)]),_:1},16,["loading","disabled"])])]),key:"0"}:void 0]),1040,["class","modelValue","show-close"])}}});exports.default=E;
|
|
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 */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 */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-a1aa0014"]]);exports.default=u;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import a from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
|
|
4
|
+
const e = /* @__PURE__ */ a(o, [["__scopeId", "data-v-a1aa0014"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var k=Object.defineProperty;var l=(a,
|
|
1
|
+
"use strict";var k=Object.defineProperty;var l=(a,i)=>k(a,"name",{value:i,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),M=,/* empty css */P=,/* empty css */y=require("element-plus");;/* empty css */;/* empty css */;/* empty css */const L=,/* empty css */B=,/* empty css */E=e.defineComponent({name:"LSPreview",inheritAttrs:!1,__name:"Index",props:e.mergeModels(P.lsPreviewProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["loadComplete","loadError"],["update:modelValue"]),setup(a,{emit:i}){const d=i,o=a,{type:r,zoomSize:g}=e.toRefs(o),n=e.useModel(a,"modelValue"),p=e.reactive({zoomSize:g,source:""}),C=M.useNamespace("preview").b(),t=e.shallowRef({image:null,docx:null,xlsx:null,pdf:null}),m=e.ref(),f=e.computed(()=>(r==null?void 0:r.value)&&t.value[r==null?void 0:r.value]),q=e.ref("文件加载失败,请检查文件是否已损坏!");let u=null;e.watch(()=>n==null?void 0:n.value,s=>{s&&v()},{immediate:!0,deep:!0}),e.watch(()=>o.source,s=>{p.source=s},{immediate:!0,deep:!0});function v(){switch(o.needLoading&&(m.value=y.ElLoading.service(o.loadingOption)),o.type){case"image":t.value.image=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Image.vue/index.cjs")));break;case"docx":t.value.docx=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Docx.vue/index.cjs")));break;case"xlsx":t.value.xlsx=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Xlsx.vue/index.cjs")));break;case"pdf":t.value.pdf=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Pdf.vue/index.cjs")));break}u=setTimeout(()=>{o.source||(L.ElMessage.error("文件加载超时,请检查文件是否存在!"),c(),n.value=!1),clearTimeout(u)},6e3)}l(v,"openLoading");const c=l(()=>{u&&clearTimeout(u),o.needLoading&&m.value&&m.value.close()},"closeLoading"),x=l(()=>{c(),d("loadComplete")},"loadComplete"),h=l(()=>{c(),console.error(q.value),d("loadError")},"loadError");return e.onBeforeMount(()=>{n.value&&o.type&&v()}),e.onBeforeUnmount(()=>{c()}),(s,w)=>n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(C))},[e.unref(f)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)),e.mergeProps({key:0},e.unref(B.default)(e.unref(p),s.$attrs),{onLoadComplete:x,onLoadError:h}),null,16)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}});exports.default=E;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import { useNamespace as
|
|
5
|
-
import { lsPreviewProp as
|
|
6
|
-
import { ElLoading as
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var l = (s, u) => y(s, "name", { value: u, configurable: !0 });
|
|
3
|
+
import { defineComponent as P, mergeModels as x, toRefs as z, useModel as A, reactive as T, shallowRef as V, ref as C, computed as _, watch as k, defineAsyncComponent as i, onBeforeMount as I, onBeforeUnmount as N, openBlock as L, createElementBlock as R, normalizeClass as S, unref as n, createBlock as D, resolveDynamicComponent as O, mergeProps as U, createCommentVNode as E } from "vue";
|
|
4
|
+
import { useNamespace as $ } from "../../_hooks/useNamespace/index.js";
|
|
5
|
+
import { lsPreviewProp as j } from "../types/index.js";
|
|
6
|
+
import { ElLoading as q } from "element-plus";
|
|
7
|
+
/* empty css */
|
|
8
|
+
/* empty css */
|
|
9
|
+
/* empty css */
|
|
10
|
+
import { ElMessage as F } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/message/index/index.js";
|
|
11
|
+
import G from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
|
|
12
|
+
const ae = /* @__PURE__ */ P({
|
|
9
13
|
name: "LSPreview",
|
|
10
14
|
// components: {
|
|
11
15
|
// LSImage,
|
|
@@ -15,81 +19,85 @@ const X = /* @__PURE__ */ M({
|
|
|
15
19
|
// },
|
|
16
20
|
inheritAttrs: !1,
|
|
17
21
|
__name: "Index",
|
|
18
|
-
props: /* @__PURE__ */
|
|
22
|
+
props: /* @__PURE__ */ x(j, {
|
|
19
23
|
modelValue: {
|
|
20
24
|
type: Boolean
|
|
21
25
|
},
|
|
22
26
|
modelModifiers: {}
|
|
23
27
|
}),
|
|
24
|
-
emits: /* @__PURE__ */
|
|
25
|
-
setup(s, { emit:
|
|
26
|
-
const
|
|
27
|
-
zoomSize:
|
|
28
|
+
emits: /* @__PURE__ */ x(["loadComplete", "loadError"], ["update:modelValue"]),
|
|
29
|
+
setup(s, { emit: u }) {
|
|
30
|
+
const p = u, e = s, { type: o, zoomSize: M } = z(e), r = A(s, "modelValue"), f = T({
|
|
31
|
+
zoomSize: M,
|
|
28
32
|
source: ""
|
|
29
|
-
}), B =
|
|
33
|
+
}), B = $("preview").b(), t = V({
|
|
30
34
|
image: null,
|
|
31
35
|
docx: null,
|
|
32
36
|
xlsx: null,
|
|
33
37
|
pdf: null
|
|
34
|
-
}), d =
|
|
35
|
-
|
|
38
|
+
}), d = C(), v = _(() => (o == null ? void 0 : o.value) && t.value[o == null ? void 0 : o.value]), h = C("文件加载失败,请检查文件是否已损坏!");
|
|
39
|
+
let m = null;
|
|
40
|
+
k(
|
|
36
41
|
() => r == null ? void 0 : r.value,
|
|
37
|
-
(
|
|
38
|
-
|
|
42
|
+
(a) => {
|
|
43
|
+
a && g();
|
|
39
44
|
},
|
|
40
45
|
{
|
|
41
46
|
immediate: !0,
|
|
42
47
|
deep: !0
|
|
43
48
|
}
|
|
44
|
-
),
|
|
49
|
+
), k(
|
|
45
50
|
() => e.source,
|
|
46
|
-
(
|
|
47
|
-
|
|
51
|
+
(a) => {
|
|
52
|
+
f.source = a;
|
|
48
53
|
},
|
|
49
54
|
{
|
|
50
55
|
immediate: !0,
|
|
51
56
|
deep: !0
|
|
52
57
|
}
|
|
53
58
|
);
|
|
54
|
-
function
|
|
55
|
-
switch (e.needLoading && (d.value =
|
|
59
|
+
function g() {
|
|
60
|
+
switch (e.needLoading && (d.value = q.service(e.loadingOption)), e.type) {
|
|
56
61
|
case "image":
|
|
57
|
-
t.image =
|
|
62
|
+
t.value.image = i(() => import("../components/Image.vue/index.js"));
|
|
58
63
|
break;
|
|
59
64
|
case "docx":
|
|
60
|
-
t.docx =
|
|
65
|
+
t.value.docx = i(() => import("../components/Docx.vue/index.js"));
|
|
61
66
|
break;
|
|
62
67
|
case "xlsx":
|
|
63
|
-
t.xlsx =
|
|
68
|
+
t.value.xlsx = i(() => import("../components/Xlsx.vue/index.js"));
|
|
64
69
|
break;
|
|
65
70
|
case "pdf":
|
|
66
|
-
t.pdf =
|
|
71
|
+
t.value.pdf = i(() => import("../components/Pdf.vue/index.js"));
|
|
67
72
|
break;
|
|
68
73
|
}
|
|
74
|
+
m = setTimeout(() => {
|
|
75
|
+
e.source || (F.error("文件加载超时,请检查文件是否存在!"), c(), r.value = !1), clearTimeout(m);
|
|
76
|
+
}, 6e3);
|
|
69
77
|
}
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
e.needLoading && d.value && d.value.close();
|
|
73
|
-
}, "closeLoading"),
|
|
74
|
-
|
|
75
|
-
}, "loadComplete"),
|
|
76
|
-
|
|
78
|
+
l(g, "openLoading");
|
|
79
|
+
const c = /* @__PURE__ */ l(() => {
|
|
80
|
+
m && clearTimeout(m), e.needLoading && d.value && d.value.close();
|
|
81
|
+
}, "closeLoading"), w = /* @__PURE__ */ l(() => {
|
|
82
|
+
c(), p("loadComplete");
|
|
83
|
+
}, "loadComplete"), b = /* @__PURE__ */ l(() => {
|
|
84
|
+
c(), console.error(h.value), p("loadError");
|
|
77
85
|
}, "loadError");
|
|
78
|
-
return
|
|
79
|
-
r.value && e.type &&
|
|
80
|
-
}),
|
|
81
|
-
|
|
82
|
-
}), (
|
|
86
|
+
return I(() => {
|
|
87
|
+
r.value && e.type && g();
|
|
88
|
+
}), N(() => {
|
|
89
|
+
c();
|
|
90
|
+
}), (a, J) => r.value ? (L(), R("div", {
|
|
83
91
|
key: 0,
|
|
84
|
-
class:
|
|
92
|
+
class: S(n(B))
|
|
85
93
|
}, [
|
|
86
|
-
|
|
87
|
-
onLoadComplete:
|
|
88
|
-
onLoadError:
|
|
89
|
-
}), null, 16)) :
|
|
90
|
-
], 2)) :
|
|
94
|
+
n(v) ? (L(), D(O(n(v)), U({ key: 0 }, n(G)(n(f), a.$attrs), {
|
|
95
|
+
onLoadComplete: w,
|
|
96
|
+
onLoadError: b
|
|
97
|
+
}), null, 16)) : E("", !0)
|
|
98
|
+
], 2)) : E("", !0);
|
|
91
99
|
}
|
|
92
100
|
});
|
|
93
101
|
export {
|
|
94
|
-
|
|
102
|
+
ae as default
|
|
95
103
|
};
|
|
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 */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 */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-34d31382"]]);exports.default=u;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../../../_virtual/_plugin-vue_export-helper/index.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-34d31382"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var D=Object.defineProperty;var o=(
|
|
1
|
+
"use strict";var D=Object.defineProperty;var o=(p,m)=>D(p,"name",{value:m,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),F=,/* empty css */T=,/* empty css */E=,/* empty css */$=,/* empty css */I=,/* empty css */M={class:"opt-wrap"},j={key:0,class:"page-wrap"},O={class:"num-wrap"},A={key:1,class:"size-wrap"},G={class:"num-wrap"},H={class:"pdf-content"},J={key:1,class:"infinite-list-wrapper",style:{overflow:"auto"}},K=["infinite-scroll-disabled"],Q=e.defineComponent({name:"LSPdf"}),R=e.defineComponent({...Q,props:{source:{},onClose:{},showSize:{type:Boolean,default:!0}},emits:["annotation","highlight","loaded","textLoaded","annotationLoaded","xfaLoaded","loadComplete","loadError","update:source"],setup(p,{emit:m}){const v=F.useNamespace("pdf"),B=v.b(),_=e.ref(void 0),n=e.ref(1),l=e.ref(0),t=e.ref(1),r=e.ref(!0),C=e.ref(!1),s=p,k=m;e.watch(()=>s.source,()=>{b()},{immediate:!0,deep:!0});const V=e.computed(()=>r.value?"取消分页":"分页展示");async function b(){if(s.source)try{const{pdf:a,processLoadingTask:c,pages:h}=T.usePDF(s.source,{onError:d});await c(s.source),_.value=a.value,l.value=h.value,g()}catch{d()}finally{C.value=!0}}o(b,"initPdf");const w=o(()=>{C.value=!1,s.onClose&&s.onClose(),k("update:source")},"closeFunc");function P(){n.value>1&&n.value--}o(P,"prevPdf");function S(){n.value<l.value&&n.value++}o(S,"nextPdf");function N(a){a===0?t.value=t.value>.25?t.value-.25:t.value:t.value=t.value<2?t.value+.25:t.value}o(N,"scalePdf");const y=e.ref(!1),u=e.ref(0),L=o(()=>{if(u.value>=l.value){y.value=!0;return}u.value++},"load");function x(){r.value=!r.value,r.value||(y.value=!1,u.value=l.value>10?10:l.value)}o(x,"changePagition");function g(){k("loadComplete")}o(g,"loadComplete");function d(){k("loadError")}return o(d,"loadError"),(a,c)=>{const h=e.resolveComponent("LSIcon"),i=e.resolveComponent("LSButton"),z=$.ElScrollbar,q=I.ElInfiniteScroll;return e.unref(C)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(B))},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(v).e("btn"),e.unref(v).e("close")]),onClick:w},[e.createVNode(h,{name:"Close",size:24,color:"#FFF"})],2),e.createElementVNode("div",M,[e.unref(r)?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(i,{type:"primary",size:"small",disabled:e.unref(n)==1,onClick:P},{default:e.withCtx(()=>[e.createTextVNode("上一页")]),_:1},8,["disabled"]),e.createElementVNode("span",O,e.toDisplayString(e.unref(n))+" / "+e.toDisplayString(e.unref(l)),1),e.createVNode(i,{type:"primary",size:"small",disabled:e.unref(n)==e.unref(l),onClick:S},{default:e.withCtx(()=>[e.createTextVNode("下一页")]),_:1},8,["disabled"])])):e.createCommentVNode("",!0),a.showSize?(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(i,{type:"primary",icon:"Minus",size:"small",disabled:e.unref(t)==.25,onClick:c[0]||(c[0]=f=>N(0))},null,8,["disabled"]),e.createElementVNode("span",G,e.toDisplayString(e.unref(t)*100)+"%",1),e.createVNode(i,{type:"primary",icon:"Plus",size:"small",disabled:e.unref(t)==2,onClick:c[1]||(c[1]=f=>N(1))},null,8,["disabled"])])):e.createCommentVNode("",!0),e.createVNode(i,{type:"primary",size:"small",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)),1)]),_:1})]),e.createElementVNode("div",H,[e.unref(r)?(e.openBlock(),e.createBlock(E.default,e.mergeProps({key:0},a.$attrs,{pdf:e.unref(_),page:e.unref(n),scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])):(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(z,{height:"calc(100vh - 48px)"},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("ul",{"infinite-scroll-disabled":e.unref(y),class:"infinite-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),f=>(e.openBlock(),e.createElementBlock("li",{key:f,class:"infinite-list-item"},[e.createVNode(E.default,e.mergeProps({ref_for:!0},a.$attrs,{pdf:e.unref(_),page:f,scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])]))),128))],8,K)),[[q,L]])]),_:1})]))])],2)):e.createCommentVNode("",!0)}}});exports.default=R;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var Q = Object.defineProperty;
|
|
2
|
-
var t = (
|
|
2
|
+
var t = (g, k) => Q(g, "name", { value: k, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { defineComponent as I, ref as a, watch as R, computed as U, resolveComponent as N, unref as e, openBlock as s, createElementBlock as c, normalizeClass as $, createElementVNode as m, createVNode as n, withCtx as
|
|
6
|
+
import { defineComponent as I, ref as a, watch as R, computed as U, resolveComponent as N, unref as e, openBlock as s, createElementBlock as c, normalizeClass as $, createElementVNode as m, createVNode as n, withCtx as C, createTextVNode as x, toDisplayString as h, createCommentVNode as B, createBlock as W, mergeProps as V, withDirectives as X, Fragment as Y, renderList as Z } from "vue";
|
|
7
7
|
import { useNamespace as ee } from "../../../_hooks/useNamespace/index.js";
|
|
8
8
|
import { usePDF as oe } from "../../composable/index.js";
|
|
9
9
|
import D from "../pdfs/PdfItem.vue/index.js";
|
|
@@ -29,8 +29,8 @@ const ae = { class: "opt-wrap" }, se = {
|
|
|
29
29
|
showSize: { type: Boolean, default: !0 }
|
|
30
30
|
},
|
|
31
31
|
emits: ["annotation", "highlight", "loaded", "textLoaded", "annotationLoaded", "xfaLoaded", "loadComplete", "loadError", "update:source"],
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
32
|
+
setup(g, { emit: k }) {
|
|
33
|
+
const b = ee("pdf"), T = b.b(), w = a(void 0), l = a(1), i = a(0), o = a(1), u = a(!0), L = a(!1), d = g, P = k;
|
|
34
34
|
R(
|
|
35
35
|
() => d.source,
|
|
36
36
|
() => {
|
|
@@ -45,15 +45,19 @@ const ae = { class: "opt-wrap" }, se = {
|
|
|
45
45
|
async function j() {
|
|
46
46
|
if (d.source)
|
|
47
47
|
try {
|
|
48
|
-
const { pdf: r, processLoadingTask: p, pages:
|
|
49
|
-
|
|
48
|
+
const { pdf: r, processLoadingTask: p, pages: S } = oe(d.source, {
|
|
49
|
+
onError: _
|
|
50
|
+
});
|
|
51
|
+
await p(d.source), w.value = r.value, i.value = S.value, E();
|
|
52
|
+
} catch {
|
|
53
|
+
_();
|
|
50
54
|
} finally {
|
|
51
|
-
|
|
55
|
+
L.value = !0;
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
t(j, "initPdf");
|
|
55
59
|
const O = /* @__PURE__ */ t(() => {
|
|
56
|
-
|
|
60
|
+
L.value = !1, d.onClose && d.onClose(), P("update:source");
|
|
57
61
|
}, "closeFunc");
|
|
58
62
|
function q() {
|
|
59
63
|
l.value > 1 && l.value--;
|
|
@@ -63,39 +67,39 @@ const ae = { class: "opt-wrap" }, se = {
|
|
|
63
67
|
l.value < i.value && l.value++;
|
|
64
68
|
}
|
|
65
69
|
t(A, "nextPdf");
|
|
66
|
-
function
|
|
70
|
+
function F(r) {
|
|
67
71
|
r === 0 ? o.value = o.value > 0.25 ? o.value - 0.25 : o.value : o.value = o.value < 2 ? o.value + 0.25 : o.value;
|
|
68
72
|
}
|
|
69
|
-
t(
|
|
70
|
-
const
|
|
73
|
+
t(F, "scalePdf");
|
|
74
|
+
const z = a(!1), v = a(0), G = /* @__PURE__ */ t(() => {
|
|
71
75
|
if (v.value >= i.value) {
|
|
72
|
-
|
|
76
|
+
z.value = !0;
|
|
73
77
|
return;
|
|
74
78
|
}
|
|
75
79
|
v.value++;
|
|
76
80
|
}, "load");
|
|
77
81
|
function H() {
|
|
78
|
-
u.value = !u.value, u.value || (
|
|
82
|
+
u.value = !u.value, u.value || (z.value = !1, v.value = i.value > 10 ? 10 : i.value);
|
|
79
83
|
}
|
|
80
84
|
t(H, "changePagition");
|
|
81
|
-
function
|
|
82
|
-
|
|
85
|
+
function E() {
|
|
86
|
+
P("loadComplete");
|
|
83
87
|
}
|
|
84
|
-
t(
|
|
85
|
-
function
|
|
86
|
-
|
|
88
|
+
t(E, "loadComplete");
|
|
89
|
+
function _() {
|
|
90
|
+
P("loadError");
|
|
87
91
|
}
|
|
88
|
-
return t(
|
|
89
|
-
const
|
|
90
|
-
return e(
|
|
92
|
+
return t(_, "loadError"), (r, p) => {
|
|
93
|
+
const S = N("LSIcon"), f = N("LSButton"), J = te, K = le;
|
|
94
|
+
return e(L) ? (s(), c("div", {
|
|
91
95
|
key: 0,
|
|
92
96
|
class: $(e(T))
|
|
93
97
|
}, [
|
|
94
98
|
m("span", {
|
|
95
|
-
class: $([e(
|
|
99
|
+
class: $([e(b).e("btn"), e(b).e("close")]),
|
|
96
100
|
onClick: O
|
|
97
101
|
}, [
|
|
98
|
-
n(
|
|
102
|
+
n(S, {
|
|
99
103
|
name: "Close",
|
|
100
104
|
size: 24,
|
|
101
105
|
color: "#FFF"
|
|
@@ -109,76 +113,76 @@ const ae = { class: "opt-wrap" }, se = {
|
|
|
109
113
|
disabled: e(l) == 1,
|
|
110
114
|
onClick: q
|
|
111
115
|
}, {
|
|
112
|
-
default:
|
|
113
|
-
|
|
116
|
+
default: C(() => [
|
|
117
|
+
x("上一页")
|
|
114
118
|
]),
|
|
115
119
|
_: 1
|
|
116
120
|
}, 8, ["disabled"]),
|
|
117
|
-
m("span", ne,
|
|
121
|
+
m("span", ne, h(e(l)) + " / " + h(e(i)), 1),
|
|
118
122
|
n(f, {
|
|
119
123
|
type: "primary",
|
|
120
124
|
size: "small",
|
|
121
125
|
disabled: e(l) == e(i),
|
|
122
126
|
onClick: A
|
|
123
127
|
}, {
|
|
124
|
-
default:
|
|
125
|
-
|
|
128
|
+
default: C(() => [
|
|
129
|
+
x("下一页")
|
|
126
130
|
]),
|
|
127
131
|
_: 1
|
|
128
132
|
}, 8, ["disabled"])
|
|
129
|
-
])) :
|
|
133
|
+
])) : B("", !0),
|
|
130
134
|
r.showSize ? (s(), c("div", ie, [
|
|
131
135
|
n(f, {
|
|
132
136
|
type: "primary",
|
|
133
137
|
icon: "Minus",
|
|
134
138
|
size: "small",
|
|
135
139
|
disabled: e(o) == 0.25,
|
|
136
|
-
onClick: p[0] || (p[0] = (
|
|
140
|
+
onClick: p[0] || (p[0] = (y) => F(0))
|
|
137
141
|
}, null, 8, ["disabled"]),
|
|
138
|
-
m("span", re,
|
|
142
|
+
m("span", re, h(e(o) * 100) + "%", 1),
|
|
139
143
|
n(f, {
|
|
140
144
|
type: "primary",
|
|
141
145
|
icon: "Plus",
|
|
142
146
|
size: "small",
|
|
143
147
|
disabled: e(o) == 2,
|
|
144
|
-
onClick: p[1] || (p[1] = (
|
|
148
|
+
onClick: p[1] || (p[1] = (y) => F(1))
|
|
145
149
|
}, null, 8, ["disabled"])
|
|
146
|
-
])) :
|
|
150
|
+
])) : B("", !0),
|
|
147
151
|
n(f, {
|
|
148
152
|
type: "primary",
|
|
149
153
|
size: "small",
|
|
150
154
|
onClick: H
|
|
151
155
|
}, {
|
|
152
|
-
default:
|
|
153
|
-
|
|
156
|
+
default: C(() => [
|
|
157
|
+
x(h(e(M)), 1)
|
|
154
158
|
]),
|
|
155
159
|
_: 1
|
|
156
160
|
})
|
|
157
161
|
]),
|
|
158
162
|
m("div", ce, [
|
|
159
163
|
e(u) ? (s(), W(D, V({ key: 0 }, r.$attrs, {
|
|
160
|
-
pdf: e(
|
|
164
|
+
pdf: e(w),
|
|
161
165
|
page: e(l),
|
|
162
166
|
scale: e(o),
|
|
163
|
-
onLoadComplete:
|
|
164
|
-
onLoadError:
|
|
167
|
+
onLoadComplete: E,
|
|
168
|
+
onLoadError: _
|
|
165
169
|
}), null, 16, ["pdf", "page", "scale"])) : (s(), c("div", ue, [
|
|
166
170
|
n(J, { height: "calc(100vh - 48px)" }, {
|
|
167
|
-
default:
|
|
171
|
+
default: C(() => [
|
|
168
172
|
X((s(), c("ul", {
|
|
169
|
-
"infinite-scroll-disabled": e(
|
|
173
|
+
"infinite-scroll-disabled": e(z),
|
|
170
174
|
class: "infinite-list"
|
|
171
175
|
}, [
|
|
172
|
-
(s(!0), c(Y, null, Z(e(v), (
|
|
173
|
-
key:
|
|
176
|
+
(s(!0), c(Y, null, Z(e(v), (y) => (s(), c("li", {
|
|
177
|
+
key: y,
|
|
174
178
|
class: "infinite-list-item"
|
|
175
179
|
}, [
|
|
176
180
|
n(D, V({ ref_for: !0 }, r.$attrs, {
|
|
177
|
-
pdf: e(
|
|
178
|
-
page:
|
|
181
|
+
pdf: e(w),
|
|
182
|
+
page: y,
|
|
179
183
|
scale: e(o),
|
|
180
|
-
onLoadComplete:
|
|
181
|
-
onLoadError:
|
|
184
|
+
onLoadComplete: E,
|
|
185
|
+
onLoadError: _
|
|
182
186
|
}), null, 16, ["pdf", "page", "scale"])
|
|
183
187
|
]))), 128))
|
|
184
188
|
], 8, de)), [
|
|
@@ -189,7 +193,7 @@ const ae = { class: "opt-wrap" }, se = {
|
|
|
189
193
|
})
|
|
190
194
|
]))
|
|
191
195
|
])
|
|
192
|
-
], 2)) :
|
|
196
|
+
], 2)) : B("", !0);
|
|
193
197
|
};
|
|
194
198
|
}
|
|
195
199
|
});
|
|
Binary file
|
|
Binary file
|