@lingshugroup/web-plus 2.0.0 → 2.0.1
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/preview_pdf/Pdf.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index.js +2 -2
- 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 +101 -90
- 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/package.json +1 -1
package/lib/index.css.br
CHANGED
|
Binary file
|
package/lib/index.css.gz
CHANGED
|
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-08af0b20"]]);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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-08af0b20"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var T=Object.defineProperty;var a=(p,m)=>T(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"),$=,/* empty css */I=,/* empty css */E=,/* empty css */F=,/* empty css */j=,/* empty css */O={class:"opt-wrap"},U={key:0,class:"page-wrap"},A={class:"num-wrap"},G={key:1,class:"size-wrap"},H={class:"num-wrap"},J={class:"pdf-content"},K={key:1,class:"infinite-list-wrapper",style:{overflow:"auto"}},Q=["infinite-scroll-disabled"],R=e.defineComponent({name:"LSPdf"}),W=e.defineComponent({...R,props:{source:{},onClose:{},showSize:{type:Boolean,default:!0},cMapUrlPath:{}},emits:["annotation","highlight","loaded","textLoaded","annotationLoaded","xfaLoaded","loadComplete","loadError","update:source"],setup(p,{emit:m}){const v=$.useNamespace("pdf"),P=v.b(),_=e.ref(void 0),l=e.ref(1),r=e.ref(0),t=e.ref(1),s=e.ref(!0),C=e.ref(!1),N=e.useAttrs(),B=e.computed(()=>N["init-no-pagination"]||N.initNoPagination);e.watch(B,o=>{s.value=!o},{immediate:!0,deep:!0});const i=p,k=m;e.watch(()=>i.source,o=>{o&&b()},{immediate:!0,deep:!0});const V=e.computed(()=>s.value?"取消分页":"分页展示");async function b(){if(i.source)try{const{pdf:o,processLoadingTask:n,pages:c}=I.usePDF(i.source,i.cMapUrlPath,{onError:d});await n(i.source),_.value=o.value,r.value=c.value,y()}catch{d()}finally{C.value=!0}}a(b,"initPdf");const w=a(()=>{C.value=!1,i.onClose&&i.onClose(),k("update:source")},"closeFunc");function S(){l.value>1&&l.value--}a(S,"prevPdf");function L(){l.value<r.value&&l.value++}a(L,"nextPdf");function h(o){o===0?t.value=t.value>.25?t.value-.25:t.value:t.value=t.value<2?t.value+.25:t.value}a(h,"scalePdf");const g=e.ref(!1),u=e.ref(0),x=a(()=>{if(u.value>=r.value){g.value=!0;return}u.value++},"load");function z(){s.value=!s.value,s.value||(g.value=!1,u.value=r.value>10?10:r.value)}a(z,"changePagition");function y(){k("loadComplete")}a(y,"loadComplete");function d(){k("loadError")}return a(d,"loadError"),(o,n)=>{const c=e.resolveComponent("LSButton"),q=e.resolveComponent("LSIcon"),D=F.ElScrollbar,M=j.ElInfiniteScroll;return e.unref(C)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(P))},[e.createElementVNode("div",O,[e.unref(s)?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(c,{type:"primary",size:"small",disabled:e.unref(l)==1,onClick:S},{default:e.withCtx(()=>n[2]||(n[2]=[e.createTextVNode("上一页")])),_:1,__:[2]},8,["disabled"]),e.createElementVNode("span",A,e.toDisplayString(e.unref(l))+" / "+e.toDisplayString(e.unref(r)),1),e.createVNode(c,{type:"primary",size:"small",disabled:e.unref(l)==e.unref(r),onClick:L},{default:e.withCtx(()=>n[3]||(n[3]=[e.createTextVNode("下一页")])),_:1,__:[3]},8,["disabled"])])):e.createCommentVNode("",!0),o.showSize?(e.openBlock(),e.createElementBlock("div",G,[e.createVNode(c,{type:"primary",icon:"Minus",size:"small",disabled:e.unref(t)==.25,onClick:n[0]||(n[0]=f=>h(0))},null,8,["disabled"]),e.createElementVNode("span",H,e.toDisplayString(e.unref(t)*100)+"%",1),e.createVNode(c,{type:"primary",icon:"Plus",size:"small",disabled:e.unref(t)==2,onClick:n[1]||(n[1]=f=>h(1))},null,8,["disabled"])])):e.createCommentVNode("",!0),e.createVNode(c,{type:"primary",size:"small",onClick:z},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)),1)]),_:1}),e.createElementVNode("span",{class:e.normalizeClass([e.unref(v).e("btn"),e.unref(v).e("close")]),onClick:w},[e.createVNode(q,{name:"Close",size:26})],2)]),e.createElementVNode("div",J,[e.unref(s)?(e.openBlock(),e.createBlock(E.default,e.mergeProps({key:0},o.$attrs,{pdf:e.unref(_),page:e.unref(l),scale:e.unref(t),onLoadComplete:y,onLoadError:d}),null,16,["pdf","page","scale"])):(e.openBlock(),e.createElementBlock("div",K,[e.createVNode(D,{height:"calc(100vh - 48px)"},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("ul",{"infinite-scroll-disabled":e.unref(g),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},o.$attrs,{pdf:e.unref(_),page:f,scale:e.unref(t),onLoadComplete:y,onLoadError:d}),null,16,["pdf","page","scale"])]))),128))],8,Q)),[[M,x]])]),_:1})]))])],2)):e.createCommentVNode("",!0)}}});exports.default=W;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var X = Object.defineProperty;
|
|
2
|
+
var s = (h, k) => X(h, "name", { value: k, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { defineComponent as
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
import { usePDF as
|
|
9
|
-
import
|
|
10
|
-
import { ElScrollbar as
|
|
11
|
-
import { ElInfiniteScroll as
|
|
12
|
-
const
|
|
6
|
+
import { defineComponent as T, ref as n, useAttrs as Y, computed as $, watch as M, resolveComponent as V, createElementBlock as f, createCommentVNode as S, unref as e, openBlock as i, normalizeClass as D, createElementVNode as m, createVNode as r, withCtx as C, createTextVNode as N, toDisplayString as g, createBlock as Z, mergeProps as F, withDirectives as ee, Fragment as te, renderList as oe } from "vue";
|
|
7
|
+
import { useNamespace as ae } from "../../_hooks/useNamespace/index.js";
|
|
8
|
+
import { usePDF as se } from "../composable/index.js";
|
|
9
|
+
import I from "../pdfs/PdfItem.vue/index.js";
|
|
10
|
+
import { ElScrollbar as le } from "../../../../../node_modules/.pnpm/element-plus@2.10.4_vue@3.5.17_typescript@5.8.3_/node_modules/element-plus/es/components/scrollbar/index/index.js";
|
|
11
|
+
import { ElInfiniteScroll as ne } from "../../../../../node_modules/.pnpm/element-plus@2.10.4_vue@3.5.17_typescript@5.8.3_/node_modules/element-plus/es/components/infinite-scroll/index/index.js";
|
|
12
|
+
const ie = { class: "opt-wrap" }, re = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "page-wrap"
|
|
15
|
-
},
|
|
15
|
+
}, ce = { class: "num-wrap" }, ue = {
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "size-wrap"
|
|
18
|
-
},
|
|
18
|
+
}, de = { class: "num-wrap" }, pe = { class: "pdf-content" }, fe = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "infinite-list-wrapper",
|
|
21
21
|
style: { overflow: "auto" }
|
|
22
|
-
},
|
|
22
|
+
}, me = ["infinite-scroll-disabled"], ve = T({
|
|
23
23
|
name: "LSPdf"
|
|
24
|
-
}),
|
|
25
|
-
...
|
|
24
|
+
}), ze = /* @__PURE__ */ T({
|
|
25
|
+
...ve,
|
|
26
26
|
props: {
|
|
27
27
|
source: {},
|
|
28
28
|
onClose: {},
|
|
@@ -31,164 +31,175 @@ const ae = { class: "opt-wrap" }, se = {
|
|
|
31
31
|
},
|
|
32
32
|
emits: ["annotation", "highlight", "loaded", "textLoaded", "annotationLoaded", "xfaLoaded", "loadComplete", "loadError", "update:source"],
|
|
33
33
|
setup(h, { emit: k }) {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
(
|
|
38
|
-
|
|
34
|
+
const P = ae("pdf"), U = P.b(), b = n(void 0), l = n(1), c = n(0), t = n(1), u = n(!0), w = n(!1), x = Y(), j = $(() => x["init-no-pagination"] || x.initNoPagination);
|
|
35
|
+
M(
|
|
36
|
+
j,
|
|
37
|
+
(o) => {
|
|
38
|
+
u.value = !o;
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
immediate: !0,
|
|
42
42
|
deep: !0
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
const d = h, L = k;
|
|
46
|
+
M(
|
|
47
|
+
() => d.source,
|
|
48
|
+
(o) => {
|
|
49
|
+
o && O();
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
immediate: !0,
|
|
53
|
+
deep: !0
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
const A = $(() => u.value ? "取消分页" : "分页展示");
|
|
57
|
+
async function O() {
|
|
58
|
+
if (d.source)
|
|
48
59
|
try {
|
|
49
|
-
const { pdf:
|
|
60
|
+
const { pdf: o, processLoadingTask: a, pages: p } = se(d.source, d.cMapUrlPath, {
|
|
50
61
|
onError: _
|
|
51
62
|
});
|
|
52
|
-
await
|
|
63
|
+
await a(d.source), b.value = o.value, c.value = p.value, E();
|
|
53
64
|
} catch {
|
|
54
65
|
_();
|
|
55
66
|
} finally {
|
|
56
|
-
|
|
67
|
+
w.value = !0;
|
|
57
68
|
}
|
|
58
69
|
}
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
70
|
+
s(O, "initPdf");
|
|
71
|
+
const q = /* @__PURE__ */ s(() => {
|
|
72
|
+
w.value = !1, d.onClose && d.onClose(), L("update:source");
|
|
62
73
|
}, "closeFunc");
|
|
63
|
-
function
|
|
64
|
-
|
|
74
|
+
function G() {
|
|
75
|
+
l.value > 1 && l.value--;
|
|
65
76
|
}
|
|
66
|
-
|
|
67
|
-
function
|
|
68
|
-
|
|
77
|
+
s(G, "prevPdf");
|
|
78
|
+
function H() {
|
|
79
|
+
l.value < c.value && l.value++;
|
|
69
80
|
}
|
|
70
|
-
|
|
71
|
-
function B(
|
|
72
|
-
|
|
81
|
+
s(H, "nextPdf");
|
|
82
|
+
function B(o) {
|
|
83
|
+
o === 0 ? t.value = t.value > 0.25 ? t.value - 0.25 : t.value : t.value = t.value < 2 ? t.value + 0.25 : t.value;
|
|
73
84
|
}
|
|
74
|
-
|
|
75
|
-
const z = n(!1), v = n(0),
|
|
85
|
+
s(B, "scalePdf");
|
|
86
|
+
const z = n(!1), v = n(0), J = /* @__PURE__ */ s(() => {
|
|
76
87
|
if (v.value >= c.value) {
|
|
77
88
|
z.value = !0;
|
|
78
89
|
return;
|
|
79
90
|
}
|
|
80
91
|
v.value++;
|
|
81
92
|
}, "load");
|
|
82
|
-
function
|
|
83
|
-
|
|
93
|
+
function K() {
|
|
94
|
+
u.value = !u.value, u.value || (z.value = !1, v.value = c.value > 10 ? 10 : c.value);
|
|
84
95
|
}
|
|
85
|
-
|
|
96
|
+
s(K, "changePagition");
|
|
86
97
|
function E() {
|
|
87
|
-
|
|
98
|
+
L("loadComplete");
|
|
88
99
|
}
|
|
89
|
-
|
|
100
|
+
s(E, "loadComplete");
|
|
90
101
|
function _() {
|
|
91
|
-
|
|
102
|
+
L("loadError");
|
|
92
103
|
}
|
|
93
|
-
return
|
|
94
|
-
const
|
|
95
|
-
return e(
|
|
104
|
+
return s(_, "loadError"), (o, a) => {
|
|
105
|
+
const p = V("LSButton"), Q = V("LSIcon"), R = le, W = ne;
|
|
106
|
+
return e(w) ? (i(), f("div", {
|
|
96
107
|
key: 0,
|
|
97
|
-
class:
|
|
108
|
+
class: D(e(U))
|
|
98
109
|
}, [
|
|
99
|
-
m("div",
|
|
100
|
-
e(
|
|
101
|
-
r(
|
|
110
|
+
m("div", ie, [
|
|
111
|
+
e(u) ? (i(), f("div", re, [
|
|
112
|
+
r(p, {
|
|
102
113
|
type: "primary",
|
|
103
114
|
size: "small",
|
|
104
|
-
disabled: e(
|
|
105
|
-
onClick:
|
|
115
|
+
disabled: e(l) == 1,
|
|
116
|
+
onClick: G
|
|
106
117
|
}, {
|
|
107
|
-
default: C(() =>
|
|
108
|
-
|
|
118
|
+
default: C(() => a[2] || (a[2] = [
|
|
119
|
+
N("上一页")
|
|
109
120
|
])),
|
|
110
121
|
_: 1,
|
|
111
122
|
__: [2]
|
|
112
123
|
}, 8, ["disabled"]),
|
|
113
|
-
m("span",
|
|
114
|
-
r(
|
|
124
|
+
m("span", ce, g(e(l)) + " / " + g(e(c)), 1),
|
|
125
|
+
r(p, {
|
|
115
126
|
type: "primary",
|
|
116
127
|
size: "small",
|
|
117
|
-
disabled: e(
|
|
118
|
-
onClick:
|
|
128
|
+
disabled: e(l) == e(c),
|
|
129
|
+
onClick: H
|
|
119
130
|
}, {
|
|
120
|
-
default: C(() =>
|
|
121
|
-
|
|
131
|
+
default: C(() => a[3] || (a[3] = [
|
|
132
|
+
N("下一页")
|
|
122
133
|
])),
|
|
123
134
|
_: 1,
|
|
124
135
|
__: [3]
|
|
125
136
|
}, 8, ["disabled"])
|
|
126
137
|
])) : S("", !0),
|
|
127
|
-
|
|
128
|
-
r(
|
|
138
|
+
o.showSize ? (i(), f("div", ue, [
|
|
139
|
+
r(p, {
|
|
129
140
|
type: "primary",
|
|
130
141
|
icon: "Minus",
|
|
131
142
|
size: "small",
|
|
132
|
-
disabled: e(
|
|
133
|
-
onClick:
|
|
143
|
+
disabled: e(t) == 0.25,
|
|
144
|
+
onClick: a[0] || (a[0] = (y) => B(0))
|
|
134
145
|
}, null, 8, ["disabled"]),
|
|
135
|
-
m("span",
|
|
136
|
-
r(
|
|
146
|
+
m("span", de, g(e(t) * 100) + "%", 1),
|
|
147
|
+
r(p, {
|
|
137
148
|
type: "primary",
|
|
138
149
|
icon: "Plus",
|
|
139
150
|
size: "small",
|
|
140
|
-
disabled: e(
|
|
141
|
-
onClick:
|
|
151
|
+
disabled: e(t) == 2,
|
|
152
|
+
onClick: a[1] || (a[1] = (y) => B(1))
|
|
142
153
|
}, null, 8, ["disabled"])
|
|
143
154
|
])) : S("", !0),
|
|
144
|
-
r(
|
|
155
|
+
r(p, {
|
|
145
156
|
type: "primary",
|
|
146
157
|
size: "small",
|
|
147
|
-
onClick:
|
|
158
|
+
onClick: K
|
|
148
159
|
}, {
|
|
149
160
|
default: C(() => [
|
|
150
|
-
|
|
161
|
+
N(g(e(A)), 1)
|
|
151
162
|
]),
|
|
152
163
|
_: 1
|
|
153
164
|
}),
|
|
154
165
|
m("span", {
|
|
155
|
-
class:
|
|
156
|
-
onClick:
|
|
166
|
+
class: D([e(P).e("btn"), e(P).e("close")]),
|
|
167
|
+
onClick: q
|
|
157
168
|
}, [
|
|
158
|
-
r(
|
|
169
|
+
r(Q, {
|
|
159
170
|
name: "Close",
|
|
160
171
|
size: 26
|
|
161
172
|
})
|
|
162
173
|
], 2)
|
|
163
174
|
]),
|
|
164
|
-
m("div",
|
|
165
|
-
e(
|
|
166
|
-
pdf: e(
|
|
167
|
-
page: e(
|
|
168
|
-
scale: e(
|
|
175
|
+
m("div", pe, [
|
|
176
|
+
e(u) ? (i(), Z(I, F({ key: 0 }, o.$attrs, {
|
|
177
|
+
pdf: e(b),
|
|
178
|
+
page: e(l),
|
|
179
|
+
scale: e(t),
|
|
169
180
|
onLoadComplete: E,
|
|
170
181
|
onLoadError: _
|
|
171
|
-
}), null, 16, ["pdf", "page", "scale"])) : (i(),
|
|
172
|
-
r(
|
|
182
|
+
}), null, 16, ["pdf", "page", "scale"])) : (i(), f("div", fe, [
|
|
183
|
+
r(R, { height: "calc(100vh - 48px)" }, {
|
|
173
184
|
default: C(() => [
|
|
174
|
-
|
|
185
|
+
ee((i(), f("ul", {
|
|
175
186
|
"infinite-scroll-disabled": e(z),
|
|
176
187
|
class: "infinite-list"
|
|
177
188
|
}, [
|
|
178
|
-
(i(!0),
|
|
189
|
+
(i(!0), f(te, null, oe(e(v), (y) => (i(), f("li", {
|
|
179
190
|
key: y,
|
|
180
191
|
class: "infinite-list-item"
|
|
181
192
|
}, [
|
|
182
|
-
r(
|
|
183
|
-
pdf: e(
|
|
193
|
+
r(I, F({ ref_for: !0 }, o.$attrs, {
|
|
194
|
+
pdf: e(b),
|
|
184
195
|
page: y,
|
|
185
|
-
scale: e(
|
|
196
|
+
scale: e(t),
|
|
186
197
|
onLoadComplete: E,
|
|
187
198
|
onLoadError: _
|
|
188
199
|
}), null, 16, ["pdf", "page", "scale"])
|
|
189
200
|
]))), 128))
|
|
190
|
-
], 8,
|
|
191
|
-
[
|
|
201
|
+
], 8, me)), [
|
|
202
|
+
[W, J]
|
|
192
203
|
])
|
|
193
204
|
]),
|
|
194
205
|
_: 1
|
|
@@ -200,5 +211,5 @@ const ae = { class: "opt-wrap" }, se = {
|
|
|
200
211
|
}
|
|
201
212
|
});
|
|
202
213
|
export {
|
|
203
|
-
|
|
214
|
+
ze as default
|
|
204
215
|
};
|
|
Binary file
|
|
Binary file
|