@lingshugroup/web-plus 1.0.26 → 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/README.md +1 -1
- 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/breadcrumb/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/breadcrumb/Index.vue/index.js +3 -3
- package/lib/packages/ls-components/components/breadcrumb/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/breadcrumb/Index.vue/index2.js +39 -36
- package/lib/packages/ls-components/components/breadcrumb/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/breadcrumb/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/breadcrumb/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/breadcrumb/types/index.js +13 -5
- package/lib/packages/ls-components/components/form/FormItem.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/FormItem.vue/index.js +2 -2
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js +315 -310
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/form/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/types/index.js +5 -1
- package/lib/packages/ls-components/components/form/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/form/types/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 +2 -2
- package/lib/packages/ls-components/components/preview/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview/Index.vue/index2.js +45 -45
- 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
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var o=Object.defineProperty;var e=(a,l)=>o(a,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../_utils/runtime/index.cjs"),r=t.buildProps({formData:{type:Object,default:e(()=>({}),"default"),required:!0},formItems:{type:Array,default:e(()=>[],"default"),required:!0},column:{type:Number,default:1},loading:{type:Boolean,default:!1},showBtnLoading:{type:Boolean,default:!0},read:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showButtons:{type:Boolean,default:!0},buttonsClass:{type:String,default:""},showReset:{type:Boolean,default:!0},showSubmit:{type:Boolean,default:!0},confirmText:{type:String,default:"确认"},resetText:{type:String,default:"重置"},confirmClassName:{type:String,default:""},colon:{type:Boolean,default:!1},labelWidth:{type:[String,Number],default:"auto"},labelEmpty:{type:String,default:"--"},hasDefReadStyle:{type:Boolean,default:!1},hideColumn:{type:Boolean,default:!1}}),u=t.buildProps({isValue:{type:Boolean,default:!1},value:{type:[String,Number,Boolean,Object,Array]},type:{type:String,values:["label","input","textarea","number","radio","checkbox","select","date","datetimerange","timePicker","timeSelect","cascader","multipleCascader","switch","inputRange","inputNumberRange","slot","itemSlot"]},label:{type:String,default:""},prop:{type:[String,Array],default:""},rules:{type:Object,default:e(()=>{},"default")},className:{type:String,default:""},labelClass:{type:String,default:""},labelIconClass:{type:String,default:""},tooltip:{type:String,default:""},options:{type:Array,default:e(()=>[],"default")},attrs:{type:Object,default:e(()=>{},"default")},listeners:{type:Object,default:e(()=>{},"default")},colon:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},read:{type:Boolean,default:!1},labelEmpty:{type:String,default:"--"},labelNumber:{type:Boolean,default:!1},dateFormat:{type:String,default:"YYYY-MM-DD HH:mm:ss"},formatReadValue:{type:Function},rangeSeparator:{type:String,default:"~"},rangeProps:{type:Array,default:e(()=>["start","end"],"default")},radioType:{type:String,default:""},isRow:{type:Boolean,default:!1},selectAll:{type:Boolean,default:!0},index:{type:Number,default:0},slotKey:{type:String,default:""}});exports.lsFormItemProps=u;exports.lsFormProps=r;
|
|
@@ -158,7 +158,7 @@ const d = t({
|
|
|
158
158
|
},
|
|
159
159
|
colon: {
|
|
160
160
|
type: Boolean,
|
|
161
|
-
default: !
|
|
161
|
+
default: !1
|
|
162
162
|
},
|
|
163
163
|
disabled: {
|
|
164
164
|
type: Boolean,
|
|
@@ -206,6 +206,10 @@ const d = t({
|
|
|
206
206
|
index: {
|
|
207
207
|
type: Number,
|
|
208
208
|
default: 0
|
|
209
|
+
},
|
|
210
|
+
slotKey: {
|
|
211
|
+
type: String,
|
|
212
|
+
default: ""
|
|
209
213
|
}
|
|
210
214
|
});
|
|
211
215
|
export {
|
|
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-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
|
|
4
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fb93ca95"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
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
|
|
2
|
-
var
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import { useNamespace as
|
|
5
|
-
import { lsPreviewProp as
|
|
6
|
-
import { ElLoading as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
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__ */
|
|
18
|
+
props: /* @__PURE__ */ x(j, {
|
|
19
19
|
modelValue: {
|
|
20
20
|
type: Boolean
|
|
21
21
|
},
|
|
22
22
|
modelModifiers: {}
|
|
23
23
|
}),
|
|
24
|
-
emits: /* @__PURE__ */
|
|
25
|
-
setup(s, { emit:
|
|
26
|
-
const
|
|
27
|
-
zoomSize:
|
|
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
|
-
}),
|
|
29
|
+
}), M = $("preview").b(), a = V({
|
|
30
30
|
image: null,
|
|
31
31
|
docx: null,
|
|
32
32
|
xlsx: null,
|
|
33
33
|
pdf: null
|
|
34
|
-
}),
|
|
35
|
-
|
|
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
|
-
(
|
|
38
|
-
|
|
37
|
+
(t) => {
|
|
38
|
+
t && g();
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
immediate: !0,
|
|
42
42
|
deep: !0
|
|
43
43
|
}
|
|
44
|
-
),
|
|
44
|
+
), k(
|
|
45
45
|
() => e.source,
|
|
46
|
-
(
|
|
47
|
-
|
|
46
|
+
(t) => {
|
|
47
|
+
f.source = t;
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
immediate: !0,
|
|
51
51
|
deep: !0
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
function
|
|
55
|
-
switch (e.needLoading && (
|
|
54
|
+
function g() {
|
|
55
|
+
switch (d.value = "", e.needLoading && (u.value = q.service(e.loadingOption)), e.type) {
|
|
56
56
|
case "image":
|
|
57
|
-
|
|
57
|
+
a.value.image = c(() => import("../components/Image.vue/index.js"));
|
|
58
58
|
break;
|
|
59
59
|
case "docx":
|
|
60
|
-
|
|
60
|
+
a.value.docx = c(() => import("../components/Docx.vue/index.js"));
|
|
61
61
|
break;
|
|
62
62
|
case "xlsx":
|
|
63
|
-
|
|
63
|
+
a.value.xlsx = c(() => import("../components/Xlsx.vue/index.js"));
|
|
64
64
|
break;
|
|
65
65
|
case "pdf":
|
|
66
|
-
|
|
66
|
+
a.value.pdf = c(() => import("../components/Pdf.vue/index.js"));
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
const i = /* @__PURE__ */
|
|
72
|
-
e.needLoading &&
|
|
73
|
-
}, "closeLoading"),
|
|
74
|
-
i(),
|
|
75
|
-
}, "loadComplete"),
|
|
76
|
-
i(),
|
|
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 &&
|
|
80
|
-
}),
|
|
78
|
+
return I(() => {
|
|
79
|
+
r.value && e.type && g();
|
|
80
|
+
}), N(() => {
|
|
81
81
|
i();
|
|
82
|
-
}), (
|
|
82
|
+
}), (t, H) => r.value ? (L(), R("div", {
|
|
83
83
|
key: 0,
|
|
84
|
-
class:
|
|
84
|
+
class: S(n(M))
|
|
85
85
|
}, [
|
|
86
|
-
|
|
87
|
-
onLoadComplete:
|
|
88
|
-
onLoadError:
|
|
89
|
-
}), null, 16)) :
|
|
90
|
-
], 2)) :
|
|
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
|
-
|
|
94
|
+
Y as default
|
|
95
95
|
};
|
|
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
|