@lingshugroup/web-plus 1.0.27 → 1.0.28

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.br CHANGED
Binary file
package/lib/index.css.gz CHANGED
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<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;
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 < s && (i = c(i + r, n)), {
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
@@ -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-e5106f97"]]);exports.default=u;
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-fb93ca95"]]);exports.default=u;
@@ -1,7 +1,7 @@
1
1
  import o from "./index2.js";
2
2
  /* empty css */
3
3
  import r from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e5106f97"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fb93ca95"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";var k=Object.defineProperty;var l=(a,c)=>k(a,"name",{value:c,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),x=require("../../_hooks/useNamespace/index.cjs"),P=require("../types/index.cjs"),q=require("element-plus"),y=require("../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.cjs"),L=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:c}){const d=c,o=a,{type:n,zoomSize:v}=e.toRefs(o),r=e.useModel(a,"modelValue"),m=e.reactive({zoomSize:v,source:""}),g=x.useNamespace("preview").b(),t=e.shallowRef({image:null,docx:null,xlsx:null,pdf:null}),u=e.ref(),p=e.computed(()=>(n==null?void 0:n.value)&&t[n==null?void 0:n.value]);e.watch(()=>r==null?void 0:r.value,s=>{s&&f()},{immediate:!0,deep:!0}),e.watch(()=>o.source,s=>{m.source=s},{immediate:!0,deep:!0});function f(){switch(o.needLoading&&(u.value=q.ElLoading.service(o.loadingOption)),o.type){case"image":t.image=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Image.vue/index.cjs")));break;case"docx":t.docx=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Docx.vue/index.cjs")));break;case"xlsx":t.xlsx=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Xlsx.vue/index.cjs")));break;case"pdf":t.pdf=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Pdf.vue/index.cjs")));break}}l(f,"openLoading");const i=l(()=>{o.needLoading&&u.value&&u.value.close()},"closeLoading"),C=l(()=>{i(),d("loadComplete")},"loadComplete"),h=l(()=>{i(),d("loadError")},"loadError");return e.onBeforeMount(()=>{r.value&&o.type&&f()}),e.onBeforeUnmount(()=>{i()}),(s,B)=>r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(g))},[e.unref(p)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(p)),e.mergeProps({key:0},e.unref(y.default)(e.unref(m),s.$attrs),{onLoadComplete:C,onLoadError:h}),null,16)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}});exports.default=L;
1
+ "use strict";var x=Object.defineProperty;var l=(a,u)=>x(a,"name",{value:u,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),P=require("../../_hooks/useNamespace/index.cjs"),q=require("../types/index.cjs"),y=require("element-plus"),M=require("../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.cjs"),L=e.defineComponent({name:"LSPreview",inheritAttrs:!1,__name:"Index",props:e.mergeModels(q.lsPreviewProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["loadComplete","loadError"],["update:modelValue"]),setup(a,{emit:u}){const m=u,o=a,{type:r,zoomSize:g}=e.toRefs(o),n=e.useModel(a,"modelValue"),p=e.reactive({zoomSize:g,source:""}),C=P.useNamespace("preview").b(),t=e.shallowRef({image:null,docx:null,xlsx:null,pdf:null}),c=e.ref(),v=e.computed(()=>(r==null?void 0:r.value)&&t.value[r==null?void 0:r.value]),i=e.ref();e.watch(()=>n==null?void 0:n.value,s=>{s&&f()},{immediate:!0,deep:!0}),e.watch(()=>o.source,s=>{p.source=s},{immediate:!0,deep:!0});function f(){switch(i.value="",o.needLoading&&(c.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}}l(f,"openLoading");const d=l(()=>{o.needLoading&&c.value&&c.value.close()},"closeLoading"),h=l(()=>{d(),m("loadComplete")},"loadComplete"),k=l(()=>{d(),i.value="文件加载失败,请检查文件是否已损坏!",console.error(i.value),m("loadError")},"loadError");return e.onBeforeMount(()=>{n.value&&o.type&&f()}),e.onBeforeUnmount(()=>{d()}),(s,b)=>n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(C))},[e.unref(v)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v)),e.mergeProps({key:0},e.unref(M.default)(e.unref(p),s.$attrs),{onLoadComplete:h,onLoadError:k}),null,16)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}});exports.default=L;
@@ -1,11 +1,11 @@
1
- var w = Object.defineProperty;
2
- var a = (s, c) => w(s, "name", { value: c, configurable: !0 });
3
- import { defineComponent as M, mergeModels as g, toRefs as b, useModel as y, reactive as P, shallowRef as z, ref as A, computed as V, watch as x, defineAsyncComponent as m, onBeforeMount as _, onBeforeUnmount as I, openBlock as C, createElementBlock as N, normalizeClass as R, unref as l, createBlock as S, resolveDynamicComponent as D, mergeProps as O, createCommentVNode as k } from "vue";
4
- import { useNamespace as U } from "../../_hooks/useNamespace/index.js";
5
- import { lsPreviewProp as $ } from "../types/index.js";
6
- import { ElLoading as j } from "element-plus";
7
- import q from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
8
- const X = /* @__PURE__ */ M({
1
+ var b = Object.defineProperty;
2
+ var l = (s, m) => b(s, "name", { value: m, configurable: !0 });
3
+ import { defineComponent as y, mergeModels as x, toRefs as P, useModel as z, reactive as A, shallowRef as V, ref as C, computed as _, watch as k, defineAsyncComponent as c, 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 B } 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
+ import F from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
8
+ const Y = /* @__PURE__ */ y({
9
9
  name: "LSPreview",
10
10
  // components: {
11
11
  // LSImage,
@@ -15,81 +15,81 @@ const X = /* @__PURE__ */ M({
15
15
  // },
16
16
  inheritAttrs: !1,
17
17
  __name: "Index",
18
- props: /* @__PURE__ */ g($, {
18
+ props: /* @__PURE__ */ x(j, {
19
19
  modelValue: {
20
20
  type: Boolean
21
21
  },
22
22
  modelModifiers: {}
23
23
  }),
24
- emits: /* @__PURE__ */ g(["loadComplete", "loadError"], ["update:modelValue"]),
25
- setup(s, { emit: c }) {
26
- const u = c, e = s, { type: o, zoomSize: L } = b(e), r = y(s, "modelValue"), p = P({
27
- zoomSize: L,
24
+ emits: /* @__PURE__ */ x(["loadComplete", "loadError"], ["update:modelValue"]),
25
+ setup(s, { emit: m }) {
26
+ const p = m, e = s, { type: o, zoomSize: E } = P(e), r = z(s, "modelValue"), f = A({
27
+ zoomSize: E,
28
28
  source: ""
29
- }), B = U("preview").b(), t = z({
29
+ }), M = $("preview").b(), a = V({
30
30
  image: null,
31
31
  docx: null,
32
32
  xlsx: null,
33
33
  pdf: null
34
- }), d = A(), f = V(() => (o == null ? void 0 : o.value) && t[o == null ? void 0 : o.value]);
35
- x(
34
+ }), u = C(), v = _(() => (o == null ? void 0 : o.value) && a.value[o == null ? void 0 : o.value]), d = C();
35
+ k(
36
36
  () => r == null ? void 0 : r.value,
37
- (n) => {
38
- n && v();
37
+ (t) => {
38
+ t && g();
39
39
  },
40
40
  {
41
41
  immediate: !0,
42
42
  deep: !0
43
43
  }
44
- ), x(
44
+ ), k(
45
45
  () => e.source,
46
- (n) => {
47
- p.source = n;
46
+ (t) => {
47
+ f.source = t;
48
48
  },
49
49
  {
50
50
  immediate: !0,
51
51
  deep: !0
52
52
  }
53
53
  );
54
- function v() {
55
- switch (e.needLoading && (d.value = j.service(e.loadingOption)), e.type) {
54
+ function g() {
55
+ switch (d.value = "", e.needLoading && (u.value = q.service(e.loadingOption)), e.type) {
56
56
  case "image":
57
- t.image = m(() => import("../components/Image.vue/index.js"));
57
+ a.value.image = c(() => import("../components/Image.vue/index.js"));
58
58
  break;
59
59
  case "docx":
60
- t.docx = m(() => import("../components/Docx.vue/index.js"));
60
+ a.value.docx = c(() => import("../components/Docx.vue/index.js"));
61
61
  break;
62
62
  case "xlsx":
63
- t.xlsx = m(() => import("../components/Xlsx.vue/index.js"));
63
+ a.value.xlsx = c(() => import("../components/Xlsx.vue/index.js"));
64
64
  break;
65
65
  case "pdf":
66
- t.pdf = m(() => import("../components/Pdf.vue/index.js"));
66
+ a.value.pdf = c(() => import("../components/Pdf.vue/index.js"));
67
67
  break;
68
68
  }
69
69
  }
70
- a(v, "openLoading");
71
- const i = /* @__PURE__ */ a(() => {
72
- e.needLoading && d.value && d.value.close();
73
- }, "closeLoading"), E = /* @__PURE__ */ a(() => {
74
- i(), u("loadComplete");
75
- }, "loadComplete"), h = /* @__PURE__ */ a(() => {
76
- i(), u("loadError");
70
+ l(g, "openLoading");
71
+ const i = /* @__PURE__ */ l(() => {
72
+ e.needLoading && u.value && u.value.close();
73
+ }, "closeLoading"), h = /* @__PURE__ */ l(() => {
74
+ i(), p("loadComplete");
75
+ }, "loadComplete"), w = /* @__PURE__ */ l(() => {
76
+ i(), d.value = "文件加载失败,请检查文件是否已损坏!", console.error(d.value), p("loadError");
77
77
  }, "loadError");
78
- return _(() => {
79
- r.value && e.type && v();
80
- }), I(() => {
78
+ return I(() => {
79
+ r.value && e.type && g();
80
+ }), N(() => {
81
81
  i();
82
- }), (n, G) => r.value ? (C(), N("div", {
82
+ }), (t, H) => r.value ? (L(), R("div", {
83
83
  key: 0,
84
- class: R(l(B))
84
+ class: S(n(M))
85
85
  }, [
86
- l(f) ? (C(), S(D(l(f)), O({ key: 0 }, l(q)(l(p), n.$attrs), {
87
- onLoadComplete: E,
88
- onLoadError: h
89
- }), null, 16)) : k("", !0)
90
- ], 2)) : k("", !0);
86
+ n(v) ? (L(), D(O(n(v)), U({ key: 0 }, n(F)(n(f), t.$attrs), {
87
+ onLoadComplete: h,
88
+ onLoadError: w
89
+ }), null, 16)) : B("", !0)
90
+ ], 2)) : B("", !0);
91
91
  }
92
92
  });
93
93
  export {
94
- X as default
94
+ Y as default
95
95
  };
@@ -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-cc9e3931"]]);exports.default=u;
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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cc9e3931"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-34d31382"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";var D=Object.defineProperty;var o=(f,p)=>D(f,"name",{value:p,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 */B=,/* 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(f,{emit:p}){const m=F.useNamespace("pdf"),E=m.b(),v=e.ref(void 0),n=e.ref(1),l=e.ref(0),t=e.ref(1),r=e.ref(!0),_=e.ref(!1),s=f,C=p;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:i,pages:y}=T.usePDF(s.source);await i(s.source),v.value=a.value,l.value=y.value}finally{_.value=!0}}o(b,"initPdf");const w=o(()=>{_.value=!1,s.onClose&&s.onClose(),C("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 g(a){a===0?t.value=t.value>.25?t.value-.25:t.value:t.value=t.value<2?t.value+.25:t.value}o(g,"scalePdf");const k=e.ref(!1),u=e.ref(0),L=o(()=>{if(u.value>=l.value){k.value=!0;return}u.value++},"load");function x(){r.value=!r.value,r.value||(k.value=!1,u.value=l.value>10?10:l.value)}o(x,"changePagition");function h(){C("loadComplete")}o(h,"loadComplete");function N(){C("loadError")}return o(N,"loadError"),(a,i)=>{const y=e.resolveComponent("LSIcon"),c=e.resolveComponent("LSButton"),z=$.ElScrollbar,q=I.ElInfiniteScroll;return e.unref(_)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(E))},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(m).e("btn"),e.unref(m).e("close")]),onClick:w},[e.createVNode(y,{name:"Close",size:24,color:"#FFF"})],2),e.createElementVNode("div",M,[e.unref(r)?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(c,{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(c,{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(c,{type:"primary",icon:"Minus",size:"small",disabled:e.unref(t)==.25,onClick:i[0]||(i[0]=d=>g(0))},null,8,["disabled"]),e.createElementVNode("span",G,e.toDisplayString(e.unref(t)*100)+"%",1),e.createVNode(c,{type:"primary",icon:"Plus",size:"small",disabled:e.unref(t)==2,onClick:i[1]||(i[1]=d=>g(1))},null,8,["disabled"])])):e.createCommentVNode("",!0),e.createVNode(c,{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(B.default,e.mergeProps({key:0},a.$attrs,{pdf:e.unref(v),page:e.unref(n),scale:e.unref(t),onLoadComplete:h,onLoadError:N}),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(k),class:"infinite-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),d=>(e.openBlock(),e.createElementBlock("li",{key:d,class:"infinite-list-item"},[e.createVNode(B.default,e.mergeProps({ref_for:!0},a.$attrs,{pdf:e.unref(v),page:d,scale:e.unref(t),onLoadComplete:h,onLoadError:N}),null,16,["pdf","page","scale"])]))),128))],8,K)),[[q,L]])]),_:1})]))])],2)):e.createCommentVNode("",!0)}}});exports.default=R;
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 = (h, g) => Q(h, "name", { value: g, configurable: !0 });
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 y, createTextVNode as S, toDisplayString as C, createCommentVNode as E, createBlock as W, mergeProps as V, withDirectives as X, Fragment as Y, renderList as Z } from "vue";
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(h, { emit: g }) {
33
- const k = ee("pdf"), T = k.b(), b = a(void 0), l = a(1), i = a(0), o = a(1), u = a(!0), w = a(!1), d = h, L = g;
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: z } = oe(d.source);
49
- await p(d.source), b.value = r.value, i.value = z.value;
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
- w.value = !0;
55
+ L.value = !0;
52
56
  }
53
57
  }
54
58
  t(j, "initPdf");
55
59
  const O = /* @__PURE__ */ t(() => {
56
- w.value = !1, d.onClose && d.onClose(), L("update:source");
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 x(r) {
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(x, "scalePdf");
70
- const P = a(!1), v = a(0), G = /* @__PURE__ */ t(() => {
73
+ t(F, "scalePdf");
74
+ const z = a(!1), v = a(0), G = /* @__PURE__ */ t(() => {
71
75
  if (v.value >= i.value) {
72
- P.value = !0;
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 || (P.value = !1, v.value = i.value > 10 ? 10 : i.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 B() {
82
- L("loadComplete");
85
+ function E() {
86
+ P("loadComplete");
83
87
  }
84
- t(B, "loadComplete");
85
- function F() {
86
- L("loadError");
88
+ t(E, "loadComplete");
89
+ function _() {
90
+ P("loadError");
87
91
  }
88
- return t(F, "loadError"), (r, p) => {
89
- const z = N("LSIcon"), f = N("LSButton"), J = te, K = le;
90
- return e(w) ? (s(), c("div", {
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(k).e("btn"), e(k).e("close")]),
99
+ class: $([e(b).e("btn"), e(b).e("close")]),
96
100
  onClick: O
97
101
  }, [
98
- n(z, {
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: y(() => [
113
- S("上一页")
116
+ default: C(() => [
117
+ x("上一页")
114
118
  ]),
115
119
  _: 1
116
120
  }, 8, ["disabled"]),
117
- m("span", ne, C(e(l)) + " / " + C(e(i)), 1),
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: y(() => [
125
- S("下一页")
128
+ default: C(() => [
129
+ x("下一页")
126
130
  ]),
127
131
  _: 1
128
132
  }, 8, ["disabled"])
129
- ])) : E("", !0),
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] = (_) => x(0))
140
+ onClick: p[0] || (p[0] = (y) => F(0))
137
141
  }, null, 8, ["disabled"]),
138
- m("span", re, C(e(o) * 100) + "%", 1),
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] = (_) => x(1))
148
+ onClick: p[1] || (p[1] = (y) => F(1))
145
149
  }, null, 8, ["disabled"])
146
- ])) : E("", !0),
150
+ ])) : B("", !0),
147
151
  n(f, {
148
152
  type: "primary",
149
153
  size: "small",
150
154
  onClick: H
151
155
  }, {
152
- default: y(() => [
153
- S(C(e(M)), 1)
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(b),
164
+ pdf: e(w),
161
165
  page: e(l),
162
166
  scale: e(o),
163
- onLoadComplete: B,
164
- onLoadError: F
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: y(() => [
171
+ default: C(() => [
168
172
  X((s(), c("ul", {
169
- "infinite-scroll-disabled": e(P),
173
+ "infinite-scroll-disabled": e(z),
170
174
  class: "infinite-list"
171
175
  }, [
172
- (s(!0), c(Y, null, Z(e(v), (_) => (s(), c("li", {
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(b),
178
- page: _,
181
+ pdf: e(w),
182
+ page: y,
179
183
  scale: e(o),
180
- onLoadComplete: B,
181
- onLoadError: F
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)) : E("", !0);
196
+ ], 2)) : B("", !0);
193
197
  };
194
198
  }
195
199
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingshugroup/web-plus",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "零数科技前端UI组件库(Vue3)",
5
5
  "type": "module",
6
6
  "main": "./lib/index/index.cjs",