@lingshugroup/web-plus 1.7.9 → 1.7.11
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/chart/config/template/bar/index.cjs +1 -1
- package/lib/packages/ls-components/components/chart/config/template/bar/index.js +89 -65
- package/lib/packages/ls-components/components/chart/config/template/bar/index.js.br +0 -0
- package/lib/packages/ls-components/components/chart/config/template/bar/index.js.gz +0 -0
- package/lib/packages/ls-components/components/chart/config/template/line/index.cjs +1 -1
- package/lib/packages/ls-components/components/chart/config/template/line/index.js +102 -85
- package/lib/packages/ls-components/components/chart/config/template/line/index.js.br +0 -0
- package/lib/packages/ls-components/components/chart/config/template/line/index.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 +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 +64 -63
- 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_pdf/composable/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_pdf/composable/index.js +68 -66
- package/lib/packages/ls-components/components/preview_pdf/composable/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/composable/index.js.gz +0 -0
- package/lib/packages/ls-components/components/tooltip/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/tooltip/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/tooltip/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/tooltip/Index.vue/index2.js +25 -25
- package/lib/packages/ls-components/components/tooltip/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/tooltip/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/tree/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/tree/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/tree/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/tree/Index.vue/index2.js +35 -31
- package/lib/packages/ls-components/components/tree/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/tree/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/upload/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js +2 -2
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.gz +0 -0
- package/lib/types/components/chart/types.d.ts +2 -0
- package/lib/types/components/preview_pdf/Pdf.vue.d.ts +1 -0
- package/lib/types/components/preview_pdf/composable.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,36 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
import { numberFixed as
|
|
4
|
-
import { BG_COLOR_MAP as k, DEF_THEME as l, BAR_COLOR_MAP as
|
|
5
|
-
const D = /* @__PURE__ */
|
|
6
|
-
const { name:
|
|
7
|
-
return ` ${
|
|
8
|
-
}, "setTooltipFormat"), R = /* @__PURE__ */
|
|
9
|
-
let { legend: e, legendIcon: t, tooltip: n = "shadow", theme:
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
let
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var f = (o, e) => M(o, "name", { value: e, configurable: !0 });
|
|
3
|
+
import { numberFixed as A, formatChartAxis as $ } from "../../../../_utils/utils/index.js";
|
|
4
|
+
import { BG_COLOR_MAP as k, DEF_THEME as l, BAR_COLOR_MAP as I, TOOLTIP_COLOR_MAP as O, FONT_COLOR_MAP as w, BG_BAR_COLOR_MAP as _, SPLIT_LINE_COLOR as C } from "../../base/index.js";
|
|
5
|
+
const D = /* @__PURE__ */ f((o, e, t, n, r, a, m) => {
|
|
6
|
+
const { name: c, seriesName: u, value: s, color: p } = o, i = n == 0 ? `<div class="name">${c}</div>` : "", d = e && s !== "-" && u !== "temp" ? `<span class="serise-name">${e ? u : ""}</span>` : "", h = s !== "-" && u !== "temp" ? `<span class="value">${a ? a(s, m) : s || s == 0 ? s : "-"}</span>` : "", x = s !== "-" && u !== "temp" ? `<div class="content-badge ${t}" style="background-color: ${typeof p == "string" ? p : r};"></div>` : "";
|
|
7
|
+
return ` ${i} <div class="content"> <div class="serise-wrap"> ${x} ${d} </div> ${h} </div> `;
|
|
8
|
+
}, "setTooltipFormat"), R = /* @__PURE__ */ f((o) => {
|
|
9
|
+
let { legend: e, legendIcon: t, tooltip: n = "shadow", theme: r, tooltipFormatter: a, barColorList: m, tooltipValueFormatter: c } = o;
|
|
10
|
+
const u = m || I[r || l][0];
|
|
11
|
+
return a = a || function(s) {
|
|
12
|
+
let p = `<div class="ls-bar-tooltip-wrap ${r}">`;
|
|
13
|
+
return s.forEach((i, d) => {
|
|
14
|
+
p += D(
|
|
15
|
+
i,
|
|
16
|
+
!!e,
|
|
17
|
+
t,
|
|
18
|
+
d,
|
|
19
|
+
u,
|
|
20
|
+
c,
|
|
21
|
+
i.dataIndex
|
|
22
|
+
);
|
|
23
|
+
}), p + "</div>";
|
|
16
24
|
}, n ? {
|
|
17
25
|
trigger: "axis",
|
|
18
26
|
axisPointer: {
|
|
19
27
|
type: n,
|
|
20
28
|
z: 1,
|
|
21
29
|
label: {
|
|
22
|
-
color:
|
|
30
|
+
color: O[r || l].color
|
|
23
31
|
}
|
|
24
32
|
},
|
|
25
33
|
textStyle: {
|
|
26
|
-
color:
|
|
34
|
+
color: w[r || l]
|
|
27
35
|
},
|
|
28
36
|
padding: 12,
|
|
29
|
-
backgroundColor:
|
|
30
|
-
extraCssText: `box-shadow: ${
|
|
31
|
-
formatter:
|
|
37
|
+
backgroundColor: O[r || l].bgColor,
|
|
38
|
+
extraCssText: `box-shadow: ${O[r || l].shadowColor};`,
|
|
39
|
+
formatter: a
|
|
32
40
|
} : null;
|
|
33
|
-
}, "setTooltip"),
|
|
41
|
+
}, "setTooltip"), F = /* @__PURE__ */ f((o) => {
|
|
34
42
|
const { legend: e, legendIcon: t = "rect", theme: n } = o;
|
|
35
43
|
return {
|
|
36
44
|
type: "scroll",
|
|
@@ -39,7 +47,7 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
|
|
|
39
47
|
itemWidth: 12,
|
|
40
48
|
itemHeight: 10,
|
|
41
49
|
textStyle: {
|
|
42
|
-
color:
|
|
50
|
+
color: w[n || l],
|
|
43
51
|
fontSize: 12,
|
|
44
52
|
height: 10,
|
|
45
53
|
rich: {
|
|
@@ -49,7 +57,7 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
|
|
|
49
57
|
}
|
|
50
58
|
}
|
|
51
59
|
};
|
|
52
|
-
}, "setLegend"),
|
|
60
|
+
}, "setLegend"), H = /* @__PURE__ */ f((o) => {
|
|
53
61
|
const { dataZoom: e } = o, t = {
|
|
54
62
|
left: "3%",
|
|
55
63
|
right: "3%",
|
|
@@ -58,19 +66,19 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
|
|
|
58
66
|
containLabel: !0
|
|
59
67
|
};
|
|
60
68
|
return e === "vertical" && delete t.right, e === "horizontal" && delete t.bottom, t;
|
|
61
|
-
}, "setGrid"),
|
|
62
|
-
const { axisData: n, seriesData:
|
|
63
|
-
let
|
|
69
|
+
}, "setGrid"), B = /* @__PURE__ */ f((o, e, t) => {
|
|
70
|
+
const { axisData: n, seriesData: r } = o, { axis: a = "x", theme: m, lineBar: c, dynamicAxis: u, type: s } = e;
|
|
71
|
+
let p = [
|
|
64
72
|
{
|
|
65
|
-
type:
|
|
73
|
+
type: a == t ? "category" : "value",
|
|
66
74
|
axisTick: {
|
|
67
75
|
show: !1
|
|
68
76
|
},
|
|
69
77
|
axisLine: {
|
|
70
|
-
show:
|
|
78
|
+
show: a == t,
|
|
71
79
|
lineStyle: {
|
|
72
80
|
width: 1,
|
|
73
|
-
color:
|
|
81
|
+
color: w[m || l]
|
|
74
82
|
}
|
|
75
83
|
},
|
|
76
84
|
axisLabel: {
|
|
@@ -79,19 +87,19 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
|
|
|
79
87
|
splitLine: {
|
|
80
88
|
lineStyle: {
|
|
81
89
|
type: "dashed",
|
|
82
|
-
color:
|
|
90
|
+
color: C[m || l]
|
|
83
91
|
}
|
|
84
92
|
},
|
|
85
|
-
data:
|
|
93
|
+
data: a == t ? n : []
|
|
86
94
|
}
|
|
87
95
|
];
|
|
88
|
-
if (
|
|
96
|
+
if (a !== t && (c && (p = a == "x" ? [
|
|
89
97
|
{
|
|
90
98
|
type: "value",
|
|
91
99
|
splitLine: {
|
|
92
100
|
show: !1,
|
|
93
101
|
lineStyle: {
|
|
94
|
-
color:
|
|
102
|
+
color: C[m || l]
|
|
95
103
|
}
|
|
96
104
|
}
|
|
97
105
|
},
|
|
@@ -99,7 +107,7 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
|
|
|
99
107
|
type: "value",
|
|
100
108
|
splitLine: {
|
|
101
109
|
lineStyle: {
|
|
102
|
-
color:
|
|
110
|
+
color: C[m || l],
|
|
103
111
|
type: "dashed",
|
|
104
112
|
width: 2,
|
|
105
113
|
dashOffset: 2
|
|
@@ -111,17 +119,17 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
|
|
|
111
119
|
type: "value"
|
|
112
120
|
}
|
|
113
121
|
]), u)) {
|
|
114
|
-
let
|
|
115
|
-
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
return
|
|
122
|
+
let i = [];
|
|
123
|
+
s === "multiple" && (!c || a == "y" && c) && (i = (r || []).reduce((d, h) => d.concat(h.data), [])), p.map((d, h) => {
|
|
124
|
+
var b;
|
|
125
|
+
s === "multiple" ? c && a == "x" && (i = (((b = (r || [])[h]) == null ? void 0 : b.data) || []).map((S) => A(S))) : i = (r || []).map((S) => A(S)), i = i.filter((S) => S > 0);
|
|
126
|
+
const x = Math.max(...i), y = Math.min(...i), { aInterval: g, aMax: v, aMin: L } = $(x, y);
|
|
127
|
+
return d.min = L, d.max = v, d.interval = g, d;
|
|
120
128
|
});
|
|
121
129
|
}
|
|
122
|
-
return
|
|
123
|
-
}, "setAxis"), T = /* @__PURE__ */
|
|
124
|
-
const { dataZoom: e, dataZoomColorOut: t, dataZoomColorIn: n, theme:
|
|
130
|
+
return p;
|
|
131
|
+
}, "setAxis"), T = /* @__PURE__ */ f((o) => {
|
|
132
|
+
const { dataZoom: e, dataZoomColorOut: t, dataZoomColorIn: n, theme: r } = o;
|
|
125
133
|
return e ? [
|
|
126
134
|
{
|
|
127
135
|
show: !0,
|
|
@@ -143,7 +151,7 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
|
|
|
143
151
|
// },
|
|
144
152
|
// borderColor: null,
|
|
145
153
|
textStyle: {
|
|
146
|
-
color:
|
|
154
|
+
color: w[r || l]
|
|
147
155
|
}
|
|
148
156
|
},
|
|
149
157
|
{
|
|
@@ -159,79 +167,88 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
|
|
|
159
167
|
showDataShadow: !0
|
|
160
168
|
}
|
|
161
169
|
] : null;
|
|
162
|
-
}, "setDataZoom"), Z = /* @__PURE__ */
|
|
170
|
+
}, "setDataZoom"), Z = /* @__PURE__ */ f((o, e) => {
|
|
163
171
|
const { seriesData: t } = o, {
|
|
164
172
|
type: n = "simple",
|
|
165
|
-
showBarFont:
|
|
166
|
-
labelPosition:
|
|
167
|
-
smooth:
|
|
168
|
-
areaStyle:
|
|
173
|
+
showBarFont: r = !0,
|
|
174
|
+
labelPosition: a = "inside",
|
|
175
|
+
smooth: m = !0,
|
|
176
|
+
areaStyle: c = void 0,
|
|
169
177
|
showBackground: u,
|
|
170
|
-
theme:
|
|
171
|
-
name:
|
|
172
|
-
lineBar:
|
|
173
|
-
axis:
|
|
174
|
-
symbol:
|
|
178
|
+
theme: s,
|
|
179
|
+
name: p,
|
|
180
|
+
lineBar: i,
|
|
181
|
+
axis: d,
|
|
182
|
+
symbol: h = "circle",
|
|
183
|
+
seriesLabelFormatter: x
|
|
175
184
|
} = e;
|
|
176
|
-
return n === "multiple" ? (t || []).map((
|
|
177
|
-
const
|
|
178
|
-
name:
|
|
179
|
-
type:
|
|
180
|
-
symbol:
|
|
181
|
-
emphasis:
|
|
185
|
+
return n === "multiple" ? (t || []).map((y, g) => {
|
|
186
|
+
const v = {
|
|
187
|
+
name: y.name,
|
|
188
|
+
type: y.type,
|
|
189
|
+
symbol: h,
|
|
190
|
+
emphasis: y.emphasis || {
|
|
182
191
|
focus: "series"
|
|
183
192
|
},
|
|
184
|
-
smooth:
|
|
185
|
-
areaStyle:
|
|
193
|
+
smooth: m,
|
|
194
|
+
areaStyle: c || null,
|
|
186
195
|
label: {
|
|
187
|
-
show:
|
|
188
|
-
position:
|
|
196
|
+
show: r,
|
|
197
|
+
position: a,
|
|
198
|
+
formatter: x || function(L) {
|
|
199
|
+
const b = L.value;
|
|
200
|
+
return b !== 0 ? b : "";
|
|
201
|
+
}
|
|
189
202
|
},
|
|
190
203
|
showBackground: u,
|
|
191
204
|
backgroundStyle: {
|
|
192
|
-
color:
|
|
205
|
+
color: _[s || l]
|
|
193
206
|
},
|
|
194
|
-
itemStyle:
|
|
195
|
-
data:
|
|
207
|
+
itemStyle: y.itemStyle || {},
|
|
208
|
+
data: y.data || []
|
|
196
209
|
};
|
|
197
|
-
return
|
|
210
|
+
return i && (d !== "y" && g === 1 ? v.yAxisIndex = g : v.yAxisIndex && delete v.yAxisIndex), v;
|
|
198
211
|
}) : [
|
|
199
212
|
{
|
|
200
|
-
name:
|
|
213
|
+
name: p,
|
|
201
214
|
label: {
|
|
202
|
-
show:
|
|
203
|
-
position:
|
|
215
|
+
show: r,
|
|
216
|
+
position: a,
|
|
217
|
+
formatter: x || function(y) {
|
|
218
|
+
const g = y.value;
|
|
219
|
+
return g !== 0 ? g : "";
|
|
220
|
+
}
|
|
204
221
|
},
|
|
205
222
|
showBackground: u,
|
|
206
223
|
backgroundStyle: {
|
|
207
|
-
color:
|
|
224
|
+
color: _[s || l]
|
|
208
225
|
},
|
|
209
226
|
data: t || [],
|
|
210
|
-
smooth:
|
|
211
|
-
symbol:
|
|
227
|
+
smooth: m,
|
|
228
|
+
symbol: h,
|
|
212
229
|
// 设置填充透明度
|
|
213
|
-
areaStyle:
|
|
230
|
+
areaStyle: c || null,
|
|
214
231
|
type: "line"
|
|
215
232
|
}
|
|
216
233
|
];
|
|
217
|
-
}, "setSeries"), E = /* @__PURE__ */
|
|
218
|
-
const { theme: t, barColorList: n } = e,
|
|
234
|
+
}, "setSeries"), E = /* @__PURE__ */ f((o, e) => {
|
|
235
|
+
const { theme: t, barColorList: n } = e, r = {
|
|
219
236
|
textStyle: {},
|
|
220
237
|
backgroundColor: k[t || l],
|
|
221
|
-
color: n ||
|
|
222
|
-
legend:
|
|
223
|
-
grid:
|
|
224
|
-
xAxis:
|
|
225
|
-
yAxis:
|
|
238
|
+
color: n || I[t || l],
|
|
239
|
+
legend: F(e),
|
|
240
|
+
grid: H(e),
|
|
241
|
+
xAxis: B(o, e, "x"),
|
|
242
|
+
yAxis: B(o, e, "y"),
|
|
226
243
|
series: Z(o, e),
|
|
227
244
|
dataZoom: T(e)
|
|
228
|
-
},
|
|
229
|
-
return
|
|
245
|
+
}, a = R(e);
|
|
246
|
+
return a && (r.tooltip = a), r;
|
|
230
247
|
}, "setOption");
|
|
231
248
|
function P(o = {}, e = {}) {
|
|
232
249
|
return E(o, e);
|
|
233
250
|
}
|
|
234
|
-
|
|
251
|
+
f(P, "dealOption");
|
|
235
252
|
export {
|
|
236
253
|
P as dealOption
|
|
237
254
|
};
|
|
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-083051d7"]]);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-083051d7"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var D=Object.defineProperty;var n=(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"),
|
|
1
|
+
"use strict";var D=Object.defineProperty;var n=(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"),M=,/* empty css */T=,/* empty css */h=,/* empty css */$=,/* empty css */I=,/* empty css */F={class:"opt-wrap"},j={key:0,class:"page-wrap"},O={class:"num-wrap"},U={key:1,class:"size-wrap"},A={class:"num-wrap"},G={class:"pdf-content"},H={key:1,class:"infinite-list-wrapper",style:{overflow:"auto"}},J=["infinite-scroll-disabled"],K=e.defineComponent({name:"LSPdf"}),Q=e.defineComponent({...K,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=M.useNamespace("pdf"),E=v.b(),_=e.ref(void 0),l=e.ref(1),a=e.ref(0),t=e.ref(1),c=e.ref(!0),C=e.ref(!1),r=p,k=m;e.watch(()=>r.source,()=>{V()},{immediate:!0,deep:!0});const B=e.computed(()=>c.value?"取消分页":"分页展示");async function V(){if(r.source)try{const{pdf:s,processLoadingTask:o,pages:i}=T.usePDF(r.source,r.cMapUrlPath,{onError:d});await o(r.source),_.value=s.value,a.value=i.value,g()}catch{d()}finally{C.value=!0}}n(V,"initPdf");const b=n(()=>{C.value=!1,r.onClose&&r.onClose(),k("update:source")},"closeFunc");function P(){l.value>1&&l.value--}n(P,"prevPdf");function w(){l.value<a.value&&l.value++}n(w,"nextPdf");function N(s){s===0?t.value=t.value>.25?t.value-.25:t.value:t.value=t.value<2?t.value+.25:t.value}n(N,"scalePdf");const y=e.ref(!1),u=e.ref(0),S=n(()=>{if(u.value>=a.value){y.value=!0;return}u.value++},"load");function L(){c.value=!c.value,c.value||(y.value=!1,u.value=a.value>10?10:a.value)}n(L,"changePagition");function g(){k("loadComplete")}n(g,"loadComplete");function d(){k("loadError")}return n(d,"loadError"),(s,o)=>{const i=e.resolveComponent("LSButton"),x=e.resolveComponent("LSIcon"),z=$.ElScrollbar,q=I.ElInfiniteScroll;return e.unref(C)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(E))},[e.createElementVNode("div",F,[e.unref(c)?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(i,{type:"primary",size:"small",disabled:e.unref(l)==1,onClick:P},{default:e.withCtx(()=>o[2]||(o[2]=[e.createTextVNode("上一页")])),_:1},8,["disabled"]),e.createElementVNode("span",O,e.toDisplayString(e.unref(l))+" / "+e.toDisplayString(e.unref(a)),1),e.createVNode(i,{type:"primary",size:"small",disabled:e.unref(l)==e.unref(a),onClick:w},{default:e.withCtx(()=>o[3]||(o[3]=[e.createTextVNode("下一页")])),_:1},8,["disabled"])])):e.createCommentVNode("",!0),s.showSize?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(i,{type:"primary",icon:"Minus",size:"small",disabled:e.unref(t)==.25,onClick:o[0]||(o[0]=f=>N(0))},null,8,["disabled"]),e.createElementVNode("span",A,e.toDisplayString(e.unref(t)*100)+"%",1),e.createVNode(i,{type:"primary",icon:"Plus",size:"small",disabled:e.unref(t)==2,onClick:o[1]||(o[1]=f=>N(1))},null,8,["disabled"])])):e.createCommentVNode("",!0),e.createVNode(i,{type:"primary",size:"small",onClick:L},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(B)),1)]),_:1}),e.createElementVNode("span",{class:e.normalizeClass([e.unref(v).e("btn"),e.unref(v).e("close")]),onClick:b},[e.createVNode(x,{name:"Close",size:26})],2)]),e.createElementVNode("div",G,[e.unref(c)?(e.openBlock(),e.createBlock(h.default,e.mergeProps({key:0},s.$attrs,{pdf:e.unref(_),page:e.unref(l),scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])):(e.openBlock(),e.createElementBlock("div",H,[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(h.default,e.mergeProps({ref_for:!0},s.$attrs,{pdf:e.unref(_),page:f,scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])]))),128))],8,J)),[[q,S]])]),_:1})]))])],2)):e.createCommentVNode("",!0)}}});exports.default=Q;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var l = (
|
|
1
|
+
var K = Object.defineProperty;
|
|
2
|
+
var l = (h, k) => K(h, "name", { value: k, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { defineComponent as
|
|
6
|
+
import { defineComponent as D, ref as s, watch as Q, computed as R, resolveComponent as N, unref as e, openBlock as n, createElementBlock as p, normalizeClass as $, createElementVNode as m, createVNode as i, withCtx as C, createTextVNode as S, toDisplayString as g, createCommentVNode as x, createBlock as W, mergeProps as M, 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
|
-
import
|
|
9
|
+
import V from "../pdfs/PdfItem.vue/index.js";
|
|
10
10
|
import { ElScrollbar as te } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/scrollbar/index/index.js";
|
|
11
11
|
import { ElInfiniteScroll as le } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/infinite-scroll/index/index.js";
|
|
12
|
-
const
|
|
12
|
+
const ae = { class: "opt-wrap" }, se = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "page-wrap"
|
|
15
15
|
}, ne = { class: "num-wrap" }, ie = {
|
|
@@ -19,69 +19,70 @@ const se = { class: "opt-wrap" }, ae = {
|
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "infinite-list-wrapper",
|
|
21
21
|
style: { overflow: "auto" }
|
|
22
|
-
}, de = ["infinite-scroll-disabled"], pe =
|
|
22
|
+
}, de = ["infinite-scroll-disabled"], pe = D({
|
|
23
23
|
name: "LSPdf"
|
|
24
|
-
}), we = /* @__PURE__ */
|
|
24
|
+
}), we = /* @__PURE__ */ D({
|
|
25
25
|
...pe,
|
|
26
26
|
props: {
|
|
27
27
|
source: {},
|
|
28
28
|
onClose: {},
|
|
29
|
-
showSize: { type: Boolean, default: !0 }
|
|
29
|
+
showSize: { type: Boolean, default: !0 },
|
|
30
|
+
cMapUrlPath: {}
|
|
30
31
|
},
|
|
31
32
|
emits: ["annotation", "highlight", "loaded", "textLoaded", "annotationLoaded", "xfaLoaded", "loadComplete", "loadError", "update:source"],
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
() =>
|
|
33
|
+
setup(h, { emit: k }) {
|
|
34
|
+
const b = ee("pdf"), F = b.b(), w = s(void 0), a = s(1), r = s(0), o = s(1), f = s(!0), L = s(!1), c = h, P = k;
|
|
35
|
+
Q(
|
|
36
|
+
() => c.source,
|
|
36
37
|
() => {
|
|
37
|
-
|
|
38
|
+
T();
|
|
38
39
|
},
|
|
39
40
|
{
|
|
40
41
|
immediate: !0,
|
|
41
42
|
deep: !0
|
|
42
43
|
}
|
|
43
44
|
);
|
|
44
|
-
const
|
|
45
|
-
async function
|
|
46
|
-
if (
|
|
45
|
+
const I = R(() => f.value ? "取消分页" : "分页展示");
|
|
46
|
+
async function T() {
|
|
47
|
+
if (c.source)
|
|
47
48
|
try {
|
|
48
|
-
const { pdf:
|
|
49
|
+
const { pdf: u, processLoadingTask: t, pages: d } = oe(c.source, c.cMapUrlPath, {
|
|
49
50
|
onError: _
|
|
50
51
|
});
|
|
51
|
-
await t(
|
|
52
|
+
await t(c.source), w.value = u.value, r.value = d.value, E();
|
|
52
53
|
} catch {
|
|
53
54
|
_();
|
|
54
55
|
} finally {
|
|
55
56
|
L.value = !0;
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
l(
|
|
59
|
-
const
|
|
60
|
-
L.value = !1,
|
|
59
|
+
l(T, "initPdf");
|
|
60
|
+
const U = /* @__PURE__ */ l(() => {
|
|
61
|
+
L.value = !1, c.onClose && c.onClose(), P("update:source");
|
|
61
62
|
}, "closeFunc");
|
|
62
|
-
function
|
|
63
|
-
|
|
63
|
+
function j() {
|
|
64
|
+
a.value > 1 && a.value--;
|
|
64
65
|
}
|
|
65
|
-
l(
|
|
66
|
-
function
|
|
67
|
-
|
|
66
|
+
l(j, "prevPdf");
|
|
67
|
+
function O() {
|
|
68
|
+
a.value < r.value && a.value++;
|
|
68
69
|
}
|
|
69
|
-
l(
|
|
70
|
-
function B(
|
|
71
|
-
|
|
70
|
+
l(O, "nextPdf");
|
|
71
|
+
function B(u) {
|
|
72
|
+
u === 0 ? o.value = o.value > 0.25 ? o.value - 0.25 : o.value : o.value = o.value < 2 ? o.value + 0.25 : o.value;
|
|
72
73
|
}
|
|
73
74
|
l(B, "scalePdf");
|
|
74
|
-
const z =
|
|
75
|
+
const z = s(!1), v = s(0), q = /* @__PURE__ */ l(() => {
|
|
75
76
|
if (v.value >= r.value) {
|
|
76
77
|
z.value = !0;
|
|
77
78
|
return;
|
|
78
79
|
}
|
|
79
80
|
v.value++;
|
|
80
81
|
}, "load");
|
|
81
|
-
function
|
|
82
|
-
|
|
82
|
+
function A() {
|
|
83
|
+
f.value = !f.value, f.value || (z.value = !1, v.value = r.value > 10 ? 10 : r.value);
|
|
83
84
|
}
|
|
84
|
-
l(
|
|
85
|
+
l(A, "changePagition");
|
|
85
86
|
function E() {
|
|
86
87
|
P("loadComplete");
|
|
87
88
|
}
|
|
@@ -89,31 +90,31 @@ const se = { class: "opt-wrap" }, ae = {
|
|
|
89
90
|
function _() {
|
|
90
91
|
P("loadError");
|
|
91
92
|
}
|
|
92
|
-
return l(_, "loadError"), (
|
|
93
|
-
const
|
|
94
|
-
return e(L) ? (n(),
|
|
93
|
+
return l(_, "loadError"), (u, t) => {
|
|
94
|
+
const d = N("LSButton"), G = N("LSIcon"), H = te, J = le;
|
|
95
|
+
return e(L) ? (n(), p("div", {
|
|
95
96
|
key: 0,
|
|
96
|
-
class: $(e(
|
|
97
|
+
class: $(e(F))
|
|
97
98
|
}, [
|
|
98
|
-
m("div",
|
|
99
|
-
e(
|
|
100
|
-
i(
|
|
99
|
+
m("div", ae, [
|
|
100
|
+
e(f) ? (n(), p("div", se, [
|
|
101
|
+
i(d, {
|
|
101
102
|
type: "primary",
|
|
102
103
|
size: "small",
|
|
103
|
-
disabled: e(
|
|
104
|
-
onClick:
|
|
104
|
+
disabled: e(a) == 1,
|
|
105
|
+
onClick: j
|
|
105
106
|
}, {
|
|
106
107
|
default: C(() => t[2] || (t[2] = [
|
|
107
108
|
S("上一页")
|
|
108
109
|
])),
|
|
109
110
|
_: 1
|
|
110
111
|
}, 8, ["disabled"]),
|
|
111
|
-
m("span", ne, g(e(
|
|
112
|
-
i(
|
|
112
|
+
m("span", ne, g(e(a)) + " / " + g(e(r)), 1),
|
|
113
|
+
i(d, {
|
|
113
114
|
type: "primary",
|
|
114
115
|
size: "small",
|
|
115
|
-
disabled: e(
|
|
116
|
-
onClick:
|
|
116
|
+
disabled: e(a) == e(r),
|
|
117
|
+
onClick: O
|
|
117
118
|
}, {
|
|
118
119
|
default: C(() => t[3] || (t[3] = [
|
|
119
120
|
S("下一页")
|
|
@@ -121,8 +122,8 @@ const se = { class: "opt-wrap" }, ae = {
|
|
|
121
122
|
_: 1
|
|
122
123
|
}, 8, ["disabled"])
|
|
123
124
|
])) : x("", !0),
|
|
124
|
-
|
|
125
|
-
i(
|
|
125
|
+
u.showSize ? (n(), p("div", ie, [
|
|
126
|
+
i(d, {
|
|
126
127
|
type: "primary",
|
|
127
128
|
icon: "Minus",
|
|
128
129
|
size: "small",
|
|
@@ -130,7 +131,7 @@ const se = { class: "opt-wrap" }, ae = {
|
|
|
130
131
|
onClick: t[0] || (t[0] = (y) => B(0))
|
|
131
132
|
}, null, 8, ["disabled"]),
|
|
132
133
|
m("span", re, g(e(o) * 100) + "%", 1),
|
|
133
|
-
i(
|
|
134
|
+
i(d, {
|
|
134
135
|
type: "primary",
|
|
135
136
|
icon: "Plus",
|
|
136
137
|
size: "small",
|
|
@@ -138,45 +139,45 @@ const se = { class: "opt-wrap" }, ae = {
|
|
|
138
139
|
onClick: t[1] || (t[1] = (y) => B(1))
|
|
139
140
|
}, null, 8, ["disabled"])
|
|
140
141
|
])) : x("", !0),
|
|
141
|
-
i(
|
|
142
|
+
i(d, {
|
|
142
143
|
type: "primary",
|
|
143
144
|
size: "small",
|
|
144
|
-
onClick:
|
|
145
|
+
onClick: A
|
|
145
146
|
}, {
|
|
146
147
|
default: C(() => [
|
|
147
|
-
S(g(e(
|
|
148
|
+
S(g(e(I)), 1)
|
|
148
149
|
]),
|
|
149
150
|
_: 1
|
|
150
151
|
}),
|
|
151
152
|
m("span", {
|
|
152
|
-
class: $([e(
|
|
153
|
-
onClick:
|
|
153
|
+
class: $([e(b).e("btn"), e(b).e("close")]),
|
|
154
|
+
onClick: U
|
|
154
155
|
}, [
|
|
155
|
-
i(
|
|
156
|
+
i(G, {
|
|
156
157
|
name: "Close",
|
|
157
158
|
size: 26
|
|
158
159
|
})
|
|
159
160
|
], 2)
|
|
160
161
|
]),
|
|
161
162
|
m("div", ce, [
|
|
162
|
-
e(
|
|
163
|
+
e(f) ? (n(), W(V, M({ key: 0 }, u.$attrs, {
|
|
163
164
|
pdf: e(w),
|
|
164
|
-
page: e(
|
|
165
|
+
page: e(a),
|
|
165
166
|
scale: e(o),
|
|
166
167
|
onLoadComplete: E,
|
|
167
168
|
onLoadError: _
|
|
168
|
-
}), null, 16, ["pdf", "page", "scale"])) : (n(),
|
|
169
|
-
i(
|
|
169
|
+
}), null, 16, ["pdf", "page", "scale"])) : (n(), p("div", ue, [
|
|
170
|
+
i(H, { height: "calc(100vh - 48px)" }, {
|
|
170
171
|
default: C(() => [
|
|
171
|
-
X((n(),
|
|
172
|
+
X((n(), p("ul", {
|
|
172
173
|
"infinite-scroll-disabled": e(z),
|
|
173
174
|
class: "infinite-list"
|
|
174
175
|
}, [
|
|
175
|
-
(n(!0),
|
|
176
|
+
(n(!0), p(Y, null, Z(e(v), (y) => (n(), p("li", {
|
|
176
177
|
key: y,
|
|
177
178
|
class: "infinite-list-item"
|
|
178
179
|
}, [
|
|
179
|
-
i(
|
|
180
|
+
i(V, M({ ref_for: !0 }, u.$attrs, {
|
|
180
181
|
pdf: e(w),
|
|
181
182
|
page: y,
|
|
182
183
|
scale: e(o),
|
|
@@ -185,7 +186,7 @@ const se = { class: "opt-wrap" }, ae = {
|
|
|
185
186
|
}), null, 16, ["pdf", "page", "scale"])
|
|
186
187
|
]))), 128))
|
|
187
188
|
], 8, de)), [
|
|
188
|
-
[
|
|
189
|
+
[J, q]
|
|
189
190
|
])
|
|
190
191
|
]),
|
|
191
192
|
_: 1
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var N=Object.defineProperty;var l=(s,g)=>N(s,"name",{value:g,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("pdfjs-dist"),O=require("../../../../../node_modules/.pnpm/pdfjs-dist@4.8.69/node_modules/pdfjs-dist/build/pdf.worker.min/index.cjs"),f=require("vue"),P=require("../pdfs/destination/index.cjs"),I=require("../pdfs/miscellaneous/index.cjs");function q(s){b.GlobalWorkerOptions.workerSrc=s}l(q,"configWorker");function A(s,g,i={onProgress:void 0,onPassword:void 0,onError:void 0,password:""}){var S;(S=b.GlobalWorkerOptions)!=null&&S.workerSrc||q(O.default);const D=f.shallowRef(),u=f.shallowRef(),k=f.shallowRef(0),R=f.shallowRef({});function v(c){u.value&&u.value.destroy();const o=b.getDocument(g?{url:c,cMapUrl:g,cMapPacked:!0}:c);if(i.onProgress&&(o.onProgress=i.onProgress),i.onPassword)o.onPassword=i.onPassword;else if(i.password){const e=l(r=>{r(i.password??"")},"onPassword");o.onPassword=e}return o.promise.then(async e=>{u.value=e,D.value=e.loadingTask,k.value=e.numPages;const r=await e.getMetadata(),a=await e.getAttachments(),n=await e.getJSActions(),d=await e.getOutline();R.value={metadata:r,attachments:a,javascript:n,outline:d}},e=>{typeof i.onError=="function"&&i.onError(e)})}l(v,"processLoadingTask");async function x(c){var t;const o=await((t=D.value)==null?void 0:t.promise);if(!o)return null;const e=await P.getDestinationArray(o,c),r=await P.getDestinationRef(o,e);if(!r||!e)return null;const a=await o.getPageIndex(r),n=e[1].name,d=e.slice(2),p=P.isSpecLike(d)?P.getLocation(n,d):null;return{pageIndex:a,location:p??{type:"Fit",spec:[]}}}l(x,"getPDFDestination");async function E(c="filename"){var n;if(!u.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const o=await((n=u.value)==null?void 0:n.saveDocument()),e=new Blob([o],{type:"application/pdf"}),r=URL.createObjectURL(e),a=document.createElement("a");document.body.appendChild(a),a.href=r,a.download=c,a.style.display="none",a.click(),setTimeout(()=>{URL.revokeObjectURL(r),document.body.removeChild(a)},10)}l(E,"download");async function F(c=150,o="filename"){var C,T;if(!u.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const e=await((C=u.value)==null?void 0:C.saveDocument()),a=await b.getDocument(e.buffer).promise,n=c/72,d=96/72,p=await I.createIframe(),t=p.contentWindow;t.document.title=o;const U=[...Array(a.numPages).keys()].map(y=>y+1);for(const y of U){const h=await a.getPage(y),m=h.getViewport({scale:1});y===1&&I.addStylesToIframe(t,m.width*n/d,m.height*n/d);const w=document.createElement("canvas");w.width=m.width*n,w.height=m.height*n;const L=w.cloneNode();t==null||t.document.body.appendChild(L),await(h==null?void 0:h.render({canvasContext:w.getContext("2d"),intent:"print",transform:[n,0,0,n,0,0],viewport:m}).promise),(T=L.getContext("2d"))==null||T.drawImage(w,0,0)}t==null||t.focus(),t==null||t.print(),document.body.removeChild(p)}return l(F,"print"),f.isRef(s)?(s.value&&v(s.value),f.watch(s,()=>{s.value&&v(s.value)})):s&&v(s),{pdf:D,pages:k,info:R,print:F,download:E,getPDFDestination:x,processLoadingTask:v}}l(A,"usePDF");exports.usePDF=A;
|