@lingshugroup/web-plus 1.5.2 → 1.7.0
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/downloadFile/index.cjs +1 -0
- package/lib/downloadFile/index.js +12 -0
- package/lib/index/index.cjs +1 -1
- package/lib/index/index.js +20 -18
- package/lib/index/index.js.br +0 -0
- package/lib/index/index.js.gz +0 -0
- 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/_hooks/useRouterHook/index.cjs +1 -1
- package/lib/packages/ls-components/components/_hooks/useRouterHook/index.js +20 -17
- package/lib/packages/ls-components/components/_hooks/useRouterHook/index.js.br +0 -0
- package/lib/packages/ls-components/components/_hooks/useRouterHook/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 +117 -64
- 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/downloadFile/Index.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/downloadFile/Index.vue/index.js +94 -0
- package/lib/packages/ls-components/components/downloadFile/Index.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/downloadFile/Index.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/downloadFile/Index.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/downloadFile/Index.vue/index2.js +4 -0
- package/lib/packages/ls-components/components/downloadFile/types/index.cjs +1 -0
- package/lib/packages/ls-components/components/downloadFile/types/index.js +46 -0
- package/lib/packages/ls-components/components/index/index.cjs +1 -1
- package/lib/packages/ls-components/components/index/index.js +35 -33
- package/lib/packages/ls-components/components/index/index.js.br +0 -0
- package/lib/packages/ls-components/components/index/index.js.gz +0 -0
- package/lib/packages/ls-components/components/menu/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/menu/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/menu/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/menu/Index.vue/index2.js +82 -48
- package/lib/packages/ls-components/components/menu/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/menu/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js +73 -50
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/menu/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/menu/types/index.js +15 -7
- package/lib/types/components/_hooks/useRouterHook.d.ts +2 -2
- package/lib/types/components/_utils/index.d.ts +2 -1
- package/lib/types/components/_utils/utils.d.ts +17 -0
- package/lib/types/components/downloadFile/Index.vue.d.ts +34 -0
- package/lib/types/components/downloadFile/index.d.ts +78 -0
- package/lib/types/components/downloadFile/types.d.ts +12 -0
- package/lib/types/components/menu/Index.vue.d.ts +7 -2
- package/lib/types/components/menu/MenuItem.vue.d.ts +3 -0
- package/lib/types/components/menu/index.d.ts +15 -3
- package/lib/types/components/menu/types.d.ts +3 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +2 -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";var
|
|
1
|
+
"use strict";var v=Object.defineProperty;var n=(o,a)=>v(o,"name",{value:a,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue-router"),M=require("vue");function f(){const o=d.useRouter(),a=d.useRoute(),y=M.ref(a),R=n((t,e)=>{const{name:u,query:s={},path:r}=t||{};e?r&&o.push({path:r,query:s}):u&&o.push({name:u,query:s})},"jumpRouteCom"),i=n(()=>a.query,"getRouteQuery");function l(t,e,u){t.bcList=u,t.children?(t.leaf&&e.push(t),t.children.forEach(s=>{const r=[...u,{title:t.title,name:t.name}];l(s,e,r)})):e.push(t)}n(l,"processMenuItems");const b=n(t=>{let e=[];return t.forEach(u=>l(u,e,[])),e},"getRouterConfig");function h(t,e,u,s){t.push({path:e.path||"",name:e.name,component:u[`${s}/${e.cpoPath}.vue`],meta:Object.assign({key:e.key,title:e.title,bcList:(e.bcList||[]).concat({title:e.title})},e.meta)})}return n(h,"addMenu"),{route:a,router:o,currentRouter:y,jumpRouteCom:R,getRouteQuery:i,getMenusByAuth:n((t,e,u,s)=>{const r=[];return b(t).forEach(c=>{var p;if(s){const m=((p=c==null?void 0:c.pCode)==null?void 0:p.toString())||"";s.includes(m)&&h(r,c,e,u)}else h(r,c,e,u)}),r},"getMenusByAuth")}}n(f,"useRouterHook");exports.default=f;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var n = (o, a) =>
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { ref as
|
|
5
|
-
function
|
|
6
|
-
const o =
|
|
1
|
+
var b = Object.defineProperty;
|
|
2
|
+
var n = (o, a) => b(o, "name", { value: a, configurable: !0 });
|
|
3
|
+
import { useRouter as i, useRoute as k } from "vue-router";
|
|
4
|
+
import { ref as B } from "vue";
|
|
5
|
+
function q() {
|
|
6
|
+
const o = i(), a = k(), m = B(a), d = /* @__PURE__ */ n((t, e) => {
|
|
7
7
|
const { name: u, query: s = {}, path: r } = t || {};
|
|
8
8
|
e ? r && o.push({
|
|
9
9
|
path: r,
|
|
@@ -35,20 +35,23 @@ function A() {
|
|
|
35
35
|
path: e.path || "",
|
|
36
36
|
name: e.name,
|
|
37
37
|
component: u[`${s}/${e.cpoPath}.vue`],
|
|
38
|
-
meta:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
meta: Object.assign(
|
|
39
|
+
{
|
|
40
|
+
key: e.key,
|
|
41
|
+
title: e.title,
|
|
42
|
+
bcList: (e.bcList || []).concat({
|
|
43
|
+
title: e.title
|
|
44
|
+
})
|
|
45
|
+
},
|
|
46
|
+
e.meta
|
|
47
|
+
)
|
|
45
48
|
});
|
|
46
49
|
}
|
|
47
50
|
return n(h, "addMenu"), {
|
|
48
51
|
route: a,
|
|
49
52
|
router: o,
|
|
50
|
-
currentRouter:
|
|
51
|
-
jumpRouteCom:
|
|
53
|
+
currentRouter: m,
|
|
54
|
+
jumpRouteCom: d,
|
|
52
55
|
getRouteQuery: y,
|
|
53
56
|
getMenusByAuth: /* @__PURE__ */ n((t, e, u, s) => {
|
|
54
57
|
const r = [];
|
|
@@ -63,7 +66,7 @@ function A() {
|
|
|
63
66
|
}, "getMenusByAuth")
|
|
64
67
|
};
|
|
65
68
|
}
|
|
66
|
-
n(
|
|
69
|
+
n(q, "useRouterHook");
|
|
67
70
|
export {
|
|
68
|
-
|
|
71
|
+
q as default
|
|
69
72
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var C=Object.defineProperty;var s=(e,t)=>C(e,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function f(e){if(e===null)return!0;const t=typeof e;return!!(t==="undefined"||t==="string"&&(e=e.replace(/^\s*|\s*$/g,""),e==="")||t==="number"&&Number.isNaN(e)||t==="object"&&Object.keys(e).length===0)}s(f,"isEmpty");function a(e,t){try{const n=new Blob([e]),c=URL.createObjectURL(n),o=document.createElement("a");o.style.display="none",o.href=c,o.download=t,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(c)}catch{}}s(a,"exportFile");function d(e){if(f(e))return"";const t=e.lastIndexOf(".");return t>=0?e.substring(t):""}s(d,"getExtension");const h=s((e=[])=>{const t=[];return e.forEach(n=>{t.push(new Promise((c,o)=>{const r=document.createElement("script");r.id=n.id,r.src=n.src,document.body.appendChild(r),r.onload=function(){c({})},r.onerror=function(){r.remove(),o({})}}))}),Promise.all(t)},"loadJs"),b=s((e=[])=>{e.forEach(t=>{const n=document.getElementById(t.id);n&&n.remove()})},"removeJs"),p=s((e=[])=>{const t=[];return e.forEach(n=>{t.push(new Promise((c,o)=>{const r=document.createElement("link");r.id=n.id,r.rel="stylesheet",r.href=n.src,document.body.appendChild(r),r.onload=function(){c({})},r.onerror=function(){r.remove(),o({})}}))}),Promise.all(t)},"loadCss"),y=s((e=[])=>{e.forEach(t=>{const n=document.getElementById(t.id);n&&n.remove()})},"removeCss");function m(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}s(m,"getRandomHexColor");function u(e,t){return Number((Math.ceil(e*100)/100).toFixed(t||1))}s(u,"numberFixed");function M(e,t,n){const c=e,o=t;n=n||0,e=u(e,n),t=u(t,n);let r=u((e-t)/2,n);r=r==0?.1:r;let i=Math.ceil((e-t)/r);i=i==0?1:i,t<r&&(t=0);let l=u(r*i+t,n);return l<=c&&(l=u(l+r,n)),{aMax:l,aMin:t==0||t<o?t:u(t-r,n),aInterval:r}}s(M,"formatChartAxis");function g(e){try{return e=JSON.parse(e),e!==null&&typeof e=="object"?e.constructor===Object:!1}catch{return!1}}s(g,"isValidJSON");function E(e){const t=e.reduce((r,i)=>r+i.byteLength,0),n=new ArrayBuffer(t),c=new Uint8Array(n);let o=0;return e.forEach(r=>{c.set(new Uint8Array(r.file),o),o+=r.byteLength}),c}s(E,"mergeBuffer");function w(e){const t=window.atob(e),n=t.length,c=new Uint8Array(n);for(let o=0;o<n;o++)c[o]=t.charCodeAt(o);return new Uint8Array(c).buffer}s(w,"fileToBuffer");const v={isEmpty:f,exportFile:a,getExtension:d,loadJs:h,removeJs:b,loadCss:p,removeCss:y,getRandomHexColor:m,numberFixed:u,isValidJSON:g,mergeBuffer:E,fileToBuffer:w};exports.default=v;exports.exportFile=a;exports.fileToBuffer=w;exports.formatChartAxis=M;exports.getExtension=d;exports.getRandomHexColor=m;exports.isEmpty=f;exports.isValidJSON=g;exports.loadCss=p;exports.loadJs=h;exports.mergeBuffer=E;exports.numberFixed=u;exports.removeCss=y;exports.removeJs=b;
|
|
@@ -1,84 +1,137 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
if (
|
|
5
|
-
const
|
|
6
|
-
return !!(
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var s = (e, t) => a(e, "name", { value: t, configurable: !0 });
|
|
3
|
+
function f(e) {
|
|
4
|
+
if (e === null) return !0;
|
|
5
|
+
const t = typeof e;
|
|
6
|
+
return !!(t === "undefined" || t === "string" && (e = e.replace(/^\s*|\s*$/g, ""), e === "") || t === "number" && Number.isNaN(e) || t === "object" && Object.keys(e).length === 0);
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
s(f, "isEmpty");
|
|
9
|
+
function d(e, t) {
|
|
10
|
+
try {
|
|
11
|
+
const r = new Blob([e]), c = URL.createObjectURL(r), o = document.createElement("a");
|
|
12
|
+
o.style.display = "none", o.href = c, o.download = t, document.body.appendChild(o), o.click(), o.remove(), URL.revokeObjectURL(c);
|
|
13
|
+
} catch {
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
s(d, "exportFile");
|
|
17
|
+
function h(e) {
|
|
18
|
+
if (f(e)) return "";
|
|
19
|
+
const t = e.lastIndexOf(".");
|
|
20
|
+
return t >= 0 ? e.substring(t) : "";
|
|
21
|
+
}
|
|
22
|
+
s(h, "getExtension");
|
|
23
|
+
const b = /* @__PURE__ */ s((e = []) => {
|
|
24
|
+
const t = [];
|
|
25
|
+
return e.forEach((r) => {
|
|
26
|
+
t.push(
|
|
27
|
+
new Promise((c, o) => {
|
|
28
|
+
const n = document.createElement("script");
|
|
29
|
+
n.id = r.id, n.src = r.src, document.body.appendChild(n), n.onload = function() {
|
|
30
|
+
c({});
|
|
31
|
+
}, n.onerror = function() {
|
|
32
|
+
n.remove(), o({});
|
|
19
33
|
};
|
|
20
34
|
})
|
|
21
35
|
);
|
|
22
|
-
}), Promise.all(
|
|
23
|
-
}, "loadJs"),
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
36
|
+
}), Promise.all(t);
|
|
37
|
+
}, "loadJs"), p = /* @__PURE__ */ s((e = []) => {
|
|
38
|
+
e.forEach((t) => {
|
|
39
|
+
const r = document.getElementById(t.id);
|
|
40
|
+
r && r.remove();
|
|
27
41
|
});
|
|
28
|
-
}, "removeJs"),
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
new Promise((
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
42
|
+
}, "removeJs"), y = /* @__PURE__ */ s((e = []) => {
|
|
43
|
+
const t = [];
|
|
44
|
+
return e.forEach((r) => {
|
|
45
|
+
t.push(
|
|
46
|
+
new Promise((c, o) => {
|
|
47
|
+
const n = document.createElement("link");
|
|
48
|
+
n.id = r.id, n.rel = "stylesheet", n.href = r.src, document.body.appendChild(n), n.onload = function() {
|
|
49
|
+
c({});
|
|
50
|
+
}, n.onerror = function() {
|
|
51
|
+
n.remove(), o({});
|
|
38
52
|
};
|
|
39
53
|
})
|
|
40
54
|
);
|
|
41
|
-
}), Promise.all(
|
|
42
|
-
}, "loadCss"),
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
55
|
+
}), Promise.all(t);
|
|
56
|
+
}, "loadCss"), g = /* @__PURE__ */ s((e = []) => {
|
|
57
|
+
e.forEach((t) => {
|
|
58
|
+
const r = document.getElementById(t.id);
|
|
59
|
+
r && r.remove();
|
|
46
60
|
});
|
|
47
61
|
}, "removeCss");
|
|
48
|
-
function
|
|
49
|
-
return
|
|
62
|
+
function m() {
|
|
63
|
+
return `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`;
|
|
50
64
|
}
|
|
51
|
-
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
s(m, "getRandomHexColor");
|
|
66
|
+
function u(e, t) {
|
|
67
|
+
return Number((Math.ceil(e * 100) / 100).toFixed(t || 1));
|
|
68
|
+
}
|
|
69
|
+
s(u, "numberFixed");
|
|
70
|
+
function C(e, t, r) {
|
|
71
|
+
const c = e, o = t;
|
|
72
|
+
r = r || 0, e = u(e, r), t = u(t, r);
|
|
73
|
+
let n = u((e - t) / 2, r);
|
|
74
|
+
n = n == 0 ? 0.1 : n;
|
|
75
|
+
let i = Math.ceil((e - t) / n);
|
|
76
|
+
i = i == 0 ? 1 : i, t < n && (t = 0);
|
|
77
|
+
let l = u(n * i + t, r);
|
|
78
|
+
return l <= c && (l = u(l + n, r)), {
|
|
79
|
+
aMax: l,
|
|
80
|
+
aMin: t == 0 || t < o ? t : u(t - n, r),
|
|
81
|
+
aInterval: n
|
|
64
82
|
};
|
|
65
83
|
}
|
|
66
|
-
|
|
67
|
-
function
|
|
84
|
+
s(C, "formatChartAxis");
|
|
85
|
+
function w(e) {
|
|
68
86
|
try {
|
|
69
|
-
return
|
|
87
|
+
return e = JSON.parse(e), e !== null && typeof e == "object" ? e.constructor === Object : !1;
|
|
70
88
|
} catch {
|
|
71
89
|
return !1;
|
|
72
90
|
}
|
|
73
91
|
}
|
|
74
|
-
|
|
92
|
+
s(w, "isValidJSON");
|
|
93
|
+
function E(e) {
|
|
94
|
+
const t = e.reduce((n, i) => n + i.byteLength, 0), r = new ArrayBuffer(t), c = new Uint8Array(r);
|
|
95
|
+
let o = 0;
|
|
96
|
+
return e.forEach((n) => {
|
|
97
|
+
c.set(new Uint8Array(n.file), o), o += n.byteLength;
|
|
98
|
+
}), c;
|
|
99
|
+
}
|
|
100
|
+
s(E, "mergeBuffer");
|
|
101
|
+
function U(e) {
|
|
102
|
+
const t = window.atob(e), r = t.length, c = new Uint8Array(r);
|
|
103
|
+
for (let o = 0; o < r; o++)
|
|
104
|
+
c[o] = t.charCodeAt(o);
|
|
105
|
+
return new Uint8Array(c).buffer;
|
|
106
|
+
}
|
|
107
|
+
s(U, "fileToBuffer");
|
|
108
|
+
const M = {
|
|
109
|
+
isEmpty: f,
|
|
110
|
+
exportFile: d,
|
|
111
|
+
getExtension: h,
|
|
112
|
+
loadJs: b,
|
|
113
|
+
removeJs: p,
|
|
114
|
+
loadCss: y,
|
|
115
|
+
removeCss: g,
|
|
116
|
+
getRandomHexColor: m,
|
|
117
|
+
numberFixed: u,
|
|
118
|
+
isValidJSON: w,
|
|
119
|
+
mergeBuffer: E,
|
|
120
|
+
fileToBuffer: U
|
|
121
|
+
};
|
|
75
122
|
export {
|
|
76
|
-
|
|
77
|
-
d as
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
123
|
+
M as default,
|
|
124
|
+
d as exportFile,
|
|
125
|
+
U as fileToBuffer,
|
|
126
|
+
C as formatChartAxis,
|
|
127
|
+
h as getExtension,
|
|
128
|
+
m as getRandomHexColor,
|
|
129
|
+
f as isEmpty,
|
|
130
|
+
w as isValidJSON,
|
|
131
|
+
y as loadCss,
|
|
132
|
+
b as loadJs,
|
|
133
|
+
E as mergeBuffer,
|
|
134
|
+
u as numberFixed,
|
|
135
|
+
g as removeCss,
|
|
136
|
+
p as removeJs
|
|
84
137
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var M=Object.defineProperty;var s=(d,m)=>M(d,"name",{value:m,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */const e=require("vue"),T=,/* empty css */C=,/* empty css */j=,/* empty css */I=e.defineComponent({name:"LSDownloadFile"}),O=e.defineComponent({...I,props:C.lsDownloadProp,emits:C.emitNames,setup(d,{expose:m,emit:w}){const D=T.useNamespace("download-file").b(),n=d,g=w,o=e.ref({strokeWidth:15,striped:!0,stripedFlow:!0,percentage:0,duration:10}),v=e.ref([]),i=e.ref([]),a=e.ref([]),h=e.ref([]),l=e.ref([]),r=e.ref(0),k=e.computed(()=>n.maxErrorNum<=a.value.length),x=e.computed(()=>i.value.length===n.chunkTotal);function y(){E()}s(y,"start");function b(){i.value=[],a.value=[],h.value=[],o.value.status="",l.value=[],r.value=0}s(b,"reset");function P(){l.value=Array.from({length:n.chunkTotal},(t,u)=>u+1)}s(P,"initChunkQueue");function _(){return Math.ceil(i.value.length/n.chunkTotal*100)}s(_,"setPercentage");async function E(){r.value==0&&(b(),P()),o.value.percentage=_(),N()}s(E,"initDownload");async function N(){if(a.value.length>0){const t=Math.max(...a.value),u=n.initRequstNum-a.value.length||0;l.value=a.value.concat(Array.from({length:u},(f,p)=>p+t+1))}l.value.forEach(t=>{q(t)})}s(N,"downloadChunk");async function q(t){r.value++;const u=t-1;v.value[u]=new AbortController;const f=v.value[u].signal;return new Promise(async(p,R)=>{const A=n.chunkDataRequestParams?Object.assign(n.chunkDataRequestParams,{chunk:t}):{id:n.recordId,chunk:t};try{const c=await n.chunkDataRequest(Object.assign(A),n.chunkDataRequestConfig||{signal:f});r.value--,h.value[u]=c,i.value.includes(t)||i.value.push(t),o.value.percentage=_(),p(c)}catch(c){a.value.includes(t)||a.value.push(t),R(c)}finally{r.value===0&&a.value.length>0||k.value?(o.value.status="exception",g("onDownloadError",{errChunk:a.value}),n.cancelUploadInLimit&&v.value.forEach(c=>c.abort())):r.value!==0&&!k.value&&l.value.length!=n.chunkTotal?q(l.value.length):x.value&&(o.value.status="success",g("onDownloadSuccess",h.value))}})}return s(q,"chunkDataRequestFunc"),e.onUnmounted(()=>{v.value.forEach(t=>t.abort())}),m({start:y}),(t,u)=>{const f=j.ElProgress;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(D))},[e.createVNode(f,e.normalizeProps(e.guardReactiveProps(Object.assign(e.unref(o),t.$attrs))),null,16)],2)}}});exports.default=O;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var o = (f, p) => j(f, "name", { value: p, configurable: !0 });
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { defineComponent as x, ref as s, computed as C, onUnmounted as F, openBlock as L, createElementBlock as M, normalizeClass as O, unref as D, createVNode as z, normalizeProps as B, guardReactiveProps as Q } from "vue";
|
|
6
|
+
import { useNamespace as S } from "../../_hooks/useNamespace/index.js";
|
|
7
|
+
import { lsDownloadProp as U, emitNames as V } from "../types/index.js";
|
|
8
|
+
import { ElProgress as W } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/progress/index/index.js";
|
|
9
|
+
const $ = x({
|
|
10
|
+
name: "LSDownloadFile"
|
|
11
|
+
}), ae = /* @__PURE__ */ x({
|
|
12
|
+
...$,
|
|
13
|
+
props: U,
|
|
14
|
+
emits: V,
|
|
15
|
+
setup(f, { expose: p, emit: y }) {
|
|
16
|
+
const E = S("download-file").b(), a = f, g = y, u = s({
|
|
17
|
+
strokeWidth: 15,
|
|
18
|
+
striped: !0,
|
|
19
|
+
stripedFlow: !0,
|
|
20
|
+
percentage: 0,
|
|
21
|
+
duration: 10
|
|
22
|
+
}), v = s([]), i = s([]), t = s([]), d = s([]), l = s([]), r = s(0), k = C(() => a.maxErrorNum <= t.value.length), P = C(() => i.value.length === a.chunkTotal);
|
|
23
|
+
function b() {
|
|
24
|
+
N();
|
|
25
|
+
}
|
|
26
|
+
o(b, "start");
|
|
27
|
+
function R() {
|
|
28
|
+
i.value = [], t.value = [], d.value = [], u.value.status = "", l.value = [], r.value = 0;
|
|
29
|
+
}
|
|
30
|
+
o(R, "reset");
|
|
31
|
+
function q() {
|
|
32
|
+
l.value = Array.from({ length: a.chunkTotal }, (e, n) => n + 1);
|
|
33
|
+
}
|
|
34
|
+
o(q, "initChunkQueue");
|
|
35
|
+
function _() {
|
|
36
|
+
return Math.ceil(i.value.length / a.chunkTotal * 100);
|
|
37
|
+
}
|
|
38
|
+
o(_, "setPercentage");
|
|
39
|
+
async function N() {
|
|
40
|
+
r.value == 0 && (R(), q()), u.value.percentage = _(), A();
|
|
41
|
+
}
|
|
42
|
+
o(N, "initDownload");
|
|
43
|
+
async function A() {
|
|
44
|
+
if (t.value.length > 0) {
|
|
45
|
+
const e = Math.max(...t.value), n = a.initRequstNum - t.value.length || 0;
|
|
46
|
+
l.value = t.value.concat(Array.from({ length: n }, (m, h) => h + e + 1));
|
|
47
|
+
}
|
|
48
|
+
l.value.forEach((e) => {
|
|
49
|
+
w(e);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
o(A, "downloadChunk");
|
|
53
|
+
async function w(e) {
|
|
54
|
+
r.value++;
|
|
55
|
+
const n = e - 1;
|
|
56
|
+
v.value[n] = new AbortController();
|
|
57
|
+
const m = v.value[n].signal;
|
|
58
|
+
return new Promise(async (h, I) => {
|
|
59
|
+
const T = a.chunkDataRequestParams ? Object.assign(a.chunkDataRequestParams, { chunk: e }) : {
|
|
60
|
+
id: a.recordId,
|
|
61
|
+
chunk: e
|
|
62
|
+
};
|
|
63
|
+
try {
|
|
64
|
+
const c = await a.chunkDataRequest(
|
|
65
|
+
Object.assign(T),
|
|
66
|
+
a.chunkDataRequestConfig || {
|
|
67
|
+
signal: m
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
r.value--, d.value[n] = c, i.value.includes(e) || i.value.push(e), u.value.percentage = _(), h(c);
|
|
71
|
+
} catch (c) {
|
|
72
|
+
t.value.includes(e) || t.value.push(e), I(c);
|
|
73
|
+
} finally {
|
|
74
|
+
r.value === 0 && t.value.length > 0 || k.value ? (u.value.status = "exception", g("onDownloadError", {
|
|
75
|
+
errChunk: t.value
|
|
76
|
+
}), a.cancelUploadInLimit && v.value.forEach((c) => c.abort())) : r.value !== 0 && !k.value && l.value.length != a.chunkTotal ? w(l.value.length) : P.value && (u.value.status = "success", g("onDownloadSuccess", d.value));
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return o(w, "chunkDataRequestFunc"), F(() => {
|
|
81
|
+
v.value.forEach((e) => e.abort());
|
|
82
|
+
}), p({ start: b }), (e, n) => {
|
|
83
|
+
const m = W;
|
|
84
|
+
return L(), M("div", {
|
|
85
|
+
class: O(D(E))
|
|
86
|
+
}, [
|
|
87
|
+
z(m, B(Q(Object.assign(D(u), e.$attrs))), null, 16)
|
|
88
|
+
], 2);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
export {
|
|
93
|
+
ae as default
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.cjs");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../_utils/runtime/index.cjs"),t=e.buildProps({recordId:{type:[String,Number],default:""},chunkTotal:{type:Number,default:0},chunkDataRequest:{type:Function,default:null},chunkDataRequestParams:{type:Object,default:null},chunkDataRequestConfig:{type:Object,default:null},initRequstNum:{type:Number,default:10},maxErrorNum:{type:Number,default:6},cancelUploadInLimit:{type:Boolean,default:!0}}),u=["onDownloadSuccess","onDownloadError"];exports.emitNames=u;exports.lsDownloadProp=t;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { buildProps as e } from "../../_utils/runtime/index.js";
|
|
2
|
+
const u = e({
|
|
3
|
+
// 数据记录id
|
|
4
|
+
recordId: {
|
|
5
|
+
type: [String, Number],
|
|
6
|
+
default: ""
|
|
7
|
+
},
|
|
8
|
+
// 下载分片总数量
|
|
9
|
+
chunkTotal: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 0
|
|
12
|
+
},
|
|
13
|
+
// 分片下载请求
|
|
14
|
+
chunkDataRequest: {
|
|
15
|
+
type: Function,
|
|
16
|
+
default: null
|
|
17
|
+
},
|
|
18
|
+
// 分片下载请求参数
|
|
19
|
+
chunkDataRequestParams: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: null
|
|
22
|
+
},
|
|
23
|
+
chunkDataRequestConfig: {
|
|
24
|
+
type: Object,
|
|
25
|
+
default: null
|
|
26
|
+
},
|
|
27
|
+
// 初始请求数量
|
|
28
|
+
initRequstNum: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 10
|
|
31
|
+
},
|
|
32
|
+
// 最大异常请求数
|
|
33
|
+
maxErrorNum: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 6
|
|
36
|
+
},
|
|
37
|
+
// 超出上限是否取消上传
|
|
38
|
+
cancelUploadInLimit: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !0
|
|
41
|
+
}
|
|
42
|
+
}), a = ["onDownloadSuccess", "onDownloadError"];
|
|
43
|
+
export {
|
|
44
|
+
a as emitNames,
|
|
45
|
+
u as lsDownloadProp
|
|
46
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var l=Object.defineProperty;var o=(t,r)=>l(t,"name",{value:r,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@element-plus/icons-vue"),i=require("../../../../button/index.cjs"),a=require("../../../../descriptions/index.cjs"),c=require("../../../../form/index.cjs"),d=require("../../../../table/index.cjs"),f=require("../../../../upload/index.cjs"),S=require("../../../../preview/index.cjs"),L=require("../../../../menu/index.cjs"),q=require("../../../../icon/index.cjs"),m=require("../../../../confirm/index.cjs"),p=require("../../../../chart/index.cjs"),b=require("../../../../breadcrumb/index.cjs"),v=require("../../../../bellMessage/index.cjs"),g=require("../../../../live/index.cjs"),w=require("../../../../tree/index.cjs"),P=require("../../../../print/index.cjs"),y=require("../../../../containerBox/index.cjs"),B=require("../../../../backTop/index.cjs"),_=require("../../../../map/index.cjs"),O=require("../../../../editor/index.cjs"),j=require("../../../../dialog/index.cjs"),x=require("../../../../layout/index.cjs"),M=require("../../../../list/index.cjs"),k=require("../../../../preview_image/index.cjs"),D=require("../../../../preview_docx/index.cjs"),F=require("../../../../preview_pdf/index.cjs"),I=require("../../../../preview_xlsx/index.cjs"),T=require("../../../../downloadFile/index.cjs");function C(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:o(()=>t[e],"get")})}}return r.default=t,Object.freeze(r)}o(C,"_interopNamespaceDefault");const E=C(s),u={LSButtonGroup:i.LSButtonGroup,LSButton:i.LSButton,LSDescriptions:a.default,LSUpload:f.default,LSPreview:S.default,LSForm:c.LSForm,LSFormItem:c.LSFormItem,LSTable:d.default,LSMenu:L.default,LSIcon:q.default,LSConfirm:m.default,LSChart:p.default,LSBreadcrumb:b.default,LSBellMessage:v.default,LSLive:g.default,LSTree:w.default,LSPrint:P.default,LSContainerBox:y.default,LSBackTop:B.default,LSMap:_.default,LSEditor:O.default,LSDialog:j.default,LSLayout:x.default,LSList:M.default,LSPreviewImage:k.default,LSPreviewDocx:D.default,LSPreviewPdf:F.default,LSPreviewXlsx:I.default,LSDownloadFile:T.default},h=o(t=>{for(const[r,e]of Object.entries(E))t.component(r,e);for(const r of Object.keys(u)){const e=u[r];t.component(e==null?void 0:e.name,e)}},"install"),G={...u,install:h};exports.default=G;
|
|
@@ -9,24 +9,25 @@ import a from "../../../../upload/index.js";
|
|
|
9
9
|
import l from "../../../../preview/index.js";
|
|
10
10
|
import u from "../../../../menu/index.js";
|
|
11
11
|
import P from "../../../../icon/index.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
12
|
+
import d from "../../../../confirm/index.js";
|
|
13
|
+
import v from "../../../../chart/index.js";
|
|
14
|
+
import w from "../../../../breadcrumb/index.js";
|
|
15
|
+
import B from "../../../../bellMessage/index.js";
|
|
16
|
+
import b from "../../../../live/index.js";
|
|
17
17
|
import k from "../../../../tree/index.js";
|
|
18
18
|
import x from "../../../../print/index.js";
|
|
19
19
|
import y from "../../../../containerBox/index.js";
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
20
|
+
import D from "../../../../backTop/index.js";
|
|
21
|
+
import I from "../../../../map/index.js";
|
|
22
|
+
import g from "../../../../editor/index.js";
|
|
23
|
+
import C from "../../../../dialog/index.js";
|
|
24
|
+
import F from "../../../../layout/index.js";
|
|
25
|
+
import M from "../../../../list/index.js";
|
|
26
|
+
import T from "../../../../preview_image/index.js";
|
|
27
|
+
import j from "../../../../preview_docx/index.js";
|
|
28
|
+
import E from "../../../../preview_pdf/index.js";
|
|
29
29
|
import O from "../../../../preview_xlsx/index.js";
|
|
30
|
+
import h from "../../../../downloadFile/index.js";
|
|
30
31
|
const t = {
|
|
31
32
|
LSButtonGroup: p,
|
|
32
33
|
LSButton: L,
|
|
@@ -38,35 +39,36 @@ const t = {
|
|
|
38
39
|
LSTable: c,
|
|
39
40
|
LSMenu: u,
|
|
40
41
|
LSIcon: P,
|
|
41
|
-
LSConfirm:
|
|
42
|
-
LSChart:
|
|
43
|
-
LSBreadcrumb:
|
|
44
|
-
LSBellMessage:
|
|
45
|
-
LSLive:
|
|
42
|
+
LSConfirm: d,
|
|
43
|
+
LSChart: v,
|
|
44
|
+
LSBreadcrumb: w,
|
|
45
|
+
LSBellMessage: B,
|
|
46
|
+
LSLive: b,
|
|
46
47
|
LSTree: k,
|
|
47
48
|
LSPrint: x,
|
|
48
49
|
LSContainerBox: y,
|
|
49
|
-
LSBackTop:
|
|
50
|
-
LSMap:
|
|
51
|
-
LSEditor:
|
|
52
|
-
LSDialog:
|
|
53
|
-
LSLayout:
|
|
54
|
-
LSList:
|
|
55
|
-
LSPreviewImage:
|
|
56
|
-
LSPreviewDocx:
|
|
57
|
-
LSPreviewPdf:
|
|
58
|
-
LSPreviewXlsx: O
|
|
59
|
-
|
|
50
|
+
LSBackTop: D,
|
|
51
|
+
LSMap: I,
|
|
52
|
+
LSEditor: g,
|
|
53
|
+
LSDialog: C,
|
|
54
|
+
LSLayout: F,
|
|
55
|
+
LSList: M,
|
|
56
|
+
LSPreviewImage: T,
|
|
57
|
+
LSPreviewDocx: j,
|
|
58
|
+
LSPreviewPdf: E,
|
|
59
|
+
LSPreviewXlsx: O,
|
|
60
|
+
LSDownloadFile: h
|
|
61
|
+
}, G = /* @__PURE__ */ i((m) => {
|
|
60
62
|
for (const [r, o] of Object.entries(f))
|
|
61
63
|
m.component(r, o);
|
|
62
64
|
for (const r of Object.keys(t)) {
|
|
63
65
|
const o = t[r];
|
|
64
66
|
m.component(o == null ? void 0 : o.name, o);
|
|
65
67
|
}
|
|
66
|
-
}, "install"),
|
|
68
|
+
}, "install"), so = {
|
|
67
69
|
...t,
|
|
68
|
-
install:
|
|
70
|
+
install: G
|
|
69
71
|
};
|
|
70
72
|
export {
|
|
71
|
-
|
|
73
|
+
so as default
|
|
72
74
|
};
|
|
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 u=,/* empty css */t=u.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 u=,/* empty css */t=u.default(e.default,[["__scopeId","data-v-c1d172e8"]]);exports.default=t;
|
|
@@ -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-c1d172e8"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var g=Object.defineProperty;var o=(c,l)=>g(c,"name",{value:l,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */;/* empty css */const s=require("vue"),N=,/* empty css */S=,/* empty css */w=,/* empty css */B=,/* empty css */E=,/* empty css */D=s.defineComponent({name:"LSMenu"}),P=s.defineComponent({...D,props:S.lsMenuProps,emits:S.lsEmitNames,setup(c,{expose:l,emit:h}){s.useCssVars(e=>({"0dc576c6":e.hoverColor}));const{currentRouter:r}=w.default(),y=N.useNamespace("menu").b(),C=c,a=h,q=s.useAttrs(),k=s.ref(!1),_=s.ref(""),u=s.ref();s.watch(()=>C.permissionList,e=>{C.needPermission&&e&&e.length>0&&m()},{immediate:!0,deep:!0}),s.watch(()=>r.value,()=>{m()},{immediate:!0,deep:!0}),s.watch(()=>q["default-active"],async e=>{e&&(await s.nextTick(),f(e.toString()))},{immediate:!0,deep:!0});function m(){if(!k.value)return;const{meta:e}=(r==null?void 0:r.value)||{};_.value=(e==null?void 0:e.key)||"1"}o(m,"initMenuSider");function L(e){a("onJump",e)}o(L,"onJump");function M(e,i){f(e),a("defineSubClick",e,i)}o(M,"defineSubClickFunc");function b(e,i){f(e),a("defineChildClick",e,i)}o(b,"defineChildClickFunc");function f(e){if(u.value){let i=!1;const d=u.value.$el.querySelectorAll(".el-sub-menu"),n=u.value.$el.querySelectorAll(".el-menu-item"),p="is-sub-active",v="is-active";n.forEach(t=>{Array.from(t.classList).includes(v)&&t.classList.remove(v),e===t.dataset.index&&(i=!0,t.classList.add(v))}),d.forEach(t=>{Array.from(t.classList).includes(p)&&t.classList.remove(p),!i&&e===t.dataset.index&&t.classList.add(p)})}}return o(f,"removeActiveClass"),s.onMounted(()=>{k.value=!0,m()}),l({lsComMenuRef:u}),(e,i)=>{const d=E.ElMenu;return s.openBlock(),s.createBlock(d,s.mergeProps({ref_key:"lsComMenuRef",ref:u},e.$attrs,{class:s.unref(y),"default-active":s.unref(_)}),{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.menuConfigList,n=>(s.openBlock(),s.createBlock(B.default,{key:n.key,item:n,"permission-list":e.permissionList,"need-permission":e.needPermission,"is-define-click":e.isDefineClick,onOnJump:L,onDefineSubClick:M,onDefineChildClick:b},{[n.iconSlot]:s.withCtx(()=>[s.renderSlot(e.$slots,n.iconSlot,{},void 0,!0)]),_:2},1032,["item","permission-list","need-permission","is-define-click"]))),128))]),_:3},16,["class","default-active"])}}});exports.default=P;
|