@kengic/vue 0.0.2-beta.31 → 0.0.2-beta.32
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/dist/kengic-vue.js +116 -95
- package/dist/src/utils/file.util.d.ts +15 -1
- package/package.json +1 -1
package/dist/kengic-vue.js
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as v, createVNode as $, openBlock as _, createElementBlock as V, Fragment as Z, createElementVNode as G, toDisplayString as z, unref as O, withCtx as J, createTextVNode as H } from "vue";
|
|
2
2
|
import { Button as D } from "ant-design-vue";
|
|
3
|
-
const X =
|
|
3
|
+
const X = v({
|
|
4
4
|
props: {
|
|
5
5
|
name: String
|
|
6
6
|
},
|
|
7
7
|
setup(e) {
|
|
8
|
-
return () =>
|
|
8
|
+
return () => $(D, {
|
|
9
9
|
type: "ghost"
|
|
10
10
|
}, {
|
|
11
11
|
default: () => [e.name]
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
}),
|
|
14
|
+
}), de = /* @__PURE__ */ v({
|
|
15
15
|
__name: "ComponentA",
|
|
16
16
|
props: {
|
|
17
17
|
msg: String
|
|
18
18
|
},
|
|
19
19
|
setup(e) {
|
|
20
|
-
return (
|
|
20
|
+
return (t, o) => (_(), V(Z, null, [G("div", null, "Hello " + z(e.msg) + "!", 1), $(O(D), {
|
|
21
21
|
type: "primary"
|
|
22
22
|
}, {
|
|
23
|
-
default:
|
|
23
|
+
default: J(() => [H("CLICK")]),
|
|
24
24
|
_: 1
|
|
25
|
-
}),
|
|
25
|
+
}), $(O(X), {
|
|
26
26
|
name: "FOO"
|
|
27
27
|
})], 64));
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
var
|
|
31
|
-
const
|
|
32
|
-
function q(e,
|
|
33
|
-
var
|
|
34
|
-
switch (
|
|
35
|
-
case
|
|
36
|
-
return (
|
|
37
|
-
case
|
|
38
|
-
return (
|
|
39
|
-
case
|
|
40
|
-
return (
|
|
41
|
-
case
|
|
42
|
-
return !(e != null && e.startsWith(`/${
|
|
30
|
+
var c = /* @__PURE__ */ ((e) => (e.WMS = "wms", e.MES = "mes", e.WCS = "wcs", e.SYS = "sys", e))(c || {});
|
|
31
|
+
const P = ["wms", "mes", "wcs", "sys"];
|
|
32
|
+
function q(e, t) {
|
|
33
|
+
var o, n, l;
|
|
34
|
+
switch (t) {
|
|
35
|
+
case c.WMS:
|
|
36
|
+
return (o = e == null ? void 0 : e.startsWith(`/${c.WMS}`)) != null ? o : !1;
|
|
37
|
+
case c.MES:
|
|
38
|
+
return (n = e == null ? void 0 : e.startsWith(`/${c.MES}`)) != null ? n : !1;
|
|
39
|
+
case c.WCS:
|
|
40
|
+
return (l = e == null ? void 0 : e.startsWith(`/${c.WCS}`)) != null ? l : !1;
|
|
41
|
+
case c.SYS:
|
|
42
|
+
return !(e != null && e.startsWith(`/${c.WMS}`)) && !(e != null && e.startsWith(`/${c.MES}`)) && !(e != null && e.startsWith(`/${c.WCS}`));
|
|
43
43
|
default:
|
|
44
|
-
throw new Error(`\u672A\u77E5\u6A21\u5757: ${
|
|
44
|
+
throw new Error(`\u672A\u77E5\u6A21\u5757: ${t}`);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
return
|
|
47
|
+
function we(e) {
|
|
48
|
+
const t = P.find((o) => q(e, o));
|
|
49
|
+
if (t)
|
|
50
|
+
return t;
|
|
51
51
|
throw new Error(`\u5730\u5740\u65E0\u6CD5\u5339\u914D\u6A21\u5757. \u5730\u5740: ${e}`);
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
let
|
|
53
|
+
function he(e) {
|
|
54
|
+
let t = "";
|
|
55
55
|
switch (e) {
|
|
56
|
-
case
|
|
57
|
-
|
|
56
|
+
case c.WMS:
|
|
57
|
+
t = `/${e}/views/adrmst`;
|
|
58
58
|
break;
|
|
59
|
-
case
|
|
60
|
-
|
|
59
|
+
case c.MES:
|
|
60
|
+
t = `/${e}/about/index`;
|
|
61
61
|
break;
|
|
62
|
-
case
|
|
63
|
-
|
|
62
|
+
case c.WCS:
|
|
63
|
+
t = `/${e}/about/index`;
|
|
64
64
|
break;
|
|
65
|
-
case
|
|
66
|
-
|
|
65
|
+
case c.SYS:
|
|
66
|
+
t = "/about/index";
|
|
67
67
|
break;
|
|
68
68
|
default:
|
|
69
69
|
throw new Error(`\u672A\u77E5\u6A21\u5757: ${e}`);
|
|
70
70
|
}
|
|
71
|
-
return
|
|
71
|
+
return t;
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* filesize
|
|
@@ -77,7 +77,7 @@ function $e(e) {
|
|
|
77
77
|
* @license BSD-3-Clause
|
|
78
78
|
* @version 10.0.6
|
|
79
79
|
*/
|
|
80
|
-
const Q = "array", ee = "bit", Y = "bits", te = "byte",
|
|
80
|
+
const Q = "array", ee = "bit", Y = "bits", te = "byte", L = "bytes", B = "", ie = "exponent", ne = "function", w = "iec", oe = "Invalid number", re = "Invalid rounding method", y = "jedec", se = "object", p = ".", ce = "round", le = "s", ue = "kbit", fe = "kB", be = " ", me = "string", ge = "0", C = {
|
|
81
81
|
symbol: {
|
|
82
82
|
iec: {
|
|
83
83
|
bits: ["bit", "Kibit", "Mibit", "Gibit", "Tibit", "Pibit", "Eibit", "Zibit", "Yibit"],
|
|
@@ -93,82 +93,103 @@ const Q = "array", ee = "bit", Y = "bits", te = "byte", R = "bytes", m = "", ie
|
|
|
93
93
|
jedec: ["", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta"]
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
function
|
|
97
|
-
bits:
|
|
98
|
-
pad:
|
|
99
|
-
base:
|
|
100
|
-
round:
|
|
101
|
-
locale:
|
|
102
|
-
localeOptions:
|
|
103
|
-
separator:
|
|
104
|
-
spacer:
|
|
105
|
-
symbols:
|
|
106
|
-
standard:
|
|
107
|
-
output:
|
|
108
|
-
fullform:
|
|
109
|
-
fullforms:
|
|
110
|
-
exponent:
|
|
111
|
-
roundingMethod:
|
|
112
|
-
precision:
|
|
96
|
+
function Be(e, {
|
|
97
|
+
bits: t = !1,
|
|
98
|
+
pad: o = !1,
|
|
99
|
+
base: n = -1,
|
|
100
|
+
round: l = 2,
|
|
101
|
+
locale: u = B,
|
|
102
|
+
localeOptions: m = {},
|
|
103
|
+
separator: f = B,
|
|
104
|
+
spacer: S = be,
|
|
105
|
+
symbols: h = {},
|
|
106
|
+
standard: s = B,
|
|
107
|
+
output: A = me,
|
|
108
|
+
fullform: j = !1,
|
|
109
|
+
fullforms: I = [],
|
|
110
|
+
exponent: M = -1,
|
|
111
|
+
roundingMethod: F = ce,
|
|
112
|
+
precision: E = 0
|
|
113
113
|
} = {}) {
|
|
114
|
-
let
|
|
115
|
-
|
|
116
|
-
const
|
|
114
|
+
let r = M, g = Number(e), i = [], b = 0, N = B;
|
|
115
|
+
n === -1 && s.length === 0 ? (n = 10, s = y) : n === -1 && s.length > 0 ? (s = s === w ? w : y, n = s === w ? 2 : 10) : (n = n === 2 ? 2 : 10, s = n === 10 || s === y ? y : w);
|
|
116
|
+
const d = n === 10 ? 1e3 : 1024, U = j === !0, T = g < 0, W = Math[F];
|
|
117
117
|
if (typeof e != "bigint" && isNaN(e))
|
|
118
118
|
throw new TypeError(oe);
|
|
119
|
-
if (typeof
|
|
119
|
+
if (typeof W !== ne)
|
|
120
120
|
throw new TypeError(re);
|
|
121
|
-
if (
|
|
122
|
-
return
|
|
123
|
-
if (
|
|
124
|
-
|
|
121
|
+
if (T && (g = -g), (r === -1 || isNaN(r)) && (r = Math.floor(Math.log(g) / Math.log(d)), r < 0 && (r = 0)), r > 8 && (E > 0 && (E += 8 - r), r = 8), A === ie)
|
|
122
|
+
return r;
|
|
123
|
+
if (g === 0)
|
|
124
|
+
i[0] = 0, N = i[1] = C.symbol[s][t ? Y : L][r];
|
|
125
125
|
else {
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
b = g / (n === 2 ? Math.pow(2, r * 10) : Math.pow(1e3, r)), t && (b = b * 8, b >= d && r < 8 && (b = b / d, r++));
|
|
127
|
+
const a = Math.pow(10, r > 0 ? l : 0);
|
|
128
|
+
i[0] = W(b * a) / a, i[0] === d && r < 8 && M === -1 && (i[0] = 1, r++), N = i[1] = n === 10 && r === 1 ? t ? ue : fe : C.symbol[s][t ? Y : L][r];
|
|
129
129
|
}
|
|
130
|
-
if (
|
|
131
|
-
const
|
|
132
|
-
|
|
130
|
+
if (T && (i[0] = -i[0]), E > 0 && (i[0] = i[0].toPrecision(E)), i[1] = h[i[1]] || i[1], u === !0 ? i[0] = i[0].toLocaleString() : u.length > 0 ? i[0] = i[0].toLocaleString(u, m) : f.length > 0 && (i[0] = i[0].toString().replace(p, f)), o && Number.isInteger(i[0]) === !1 && l > 0) {
|
|
131
|
+
const a = f || p, R = i[0].toString().split(a), x = R[1] || B, k = x.length, K = l - k;
|
|
132
|
+
i[0] = `${R[0]}${a}${x.padEnd(k + K, ge)}`;
|
|
133
133
|
}
|
|
134
|
-
return
|
|
135
|
-
value:
|
|
136
|
-
symbol:
|
|
137
|
-
exponent:
|
|
138
|
-
unit:
|
|
139
|
-
} :
|
|
134
|
+
return U && (i[1] = I[r] ? I[r] : C.fullform[s][r] + (t ? ee : te) + (i[0] === 1 ? B : le)), A === Q ? i : A === se ? {
|
|
135
|
+
value: i[0],
|
|
136
|
+
symbol: i[1],
|
|
137
|
+
exponent: r,
|
|
138
|
+
unit: N
|
|
139
|
+
} : i.join(S);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
const
|
|
143
|
-
return Number.isNaN(
|
|
141
|
+
function Ae(e) {
|
|
142
|
+
const t = Number(e);
|
|
143
|
+
return Number.isNaN(t) || t <= 0 ? "0 KB" : String(Be(t)).toUpperCase();
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
function ae(e, t, o = 512) {
|
|
146
|
+
let n = e;
|
|
147
|
+
n.startsWith("data:") && (n = e.split("base64,")[1]);
|
|
148
|
+
const l = atob(n), u = [];
|
|
149
|
+
for (let m = 0; m < l.length; m += o) {
|
|
150
|
+
const f = l.slice(m, m + o), S = new Array(f.length);
|
|
151
|
+
for (let s = 0; s < f.length; s++)
|
|
152
|
+
S[s] = f.charCodeAt(s);
|
|
153
|
+
const h = new Uint8Array(S);
|
|
154
|
+
u.push(h);
|
|
155
|
+
}
|
|
156
|
+
return new Blob(u, { type: t });
|
|
157
|
+
}
|
|
158
|
+
function Ne(e, t, o) {
|
|
159
|
+
let n;
|
|
160
|
+
typeof e == "string" ? n = new Blob([ae(e, o)], { type: o }) : n = new Blob([e], { type: o });
|
|
161
|
+
const l = URL.createObjectURL(n), u = document.createElement("a");
|
|
162
|
+
document.body.appendChild(u), u.setAttribute("style", "display:none"), u.setAttribute("href", l), u.setAttribute("download", t), u.click(), URL.revokeObjectURL(l);
|
|
163
|
+
}
|
|
164
|
+
function ye(e) {
|
|
165
|
+
const t = [];
|
|
166
|
+
return e.forEach((o) => {
|
|
148
167
|
[
|
|
149
168
|
"/online/copyform/:code",
|
|
150
169
|
"/online/cgformList/:id",
|
|
151
170
|
"/online/cgformTreeList/:id",
|
|
152
171
|
"/online/cgreport/:id",
|
|
153
172
|
"/online/graphreport/chart/:code"
|
|
154
|
-
].includes(
|
|
155
|
-
|
|
156
|
-
...
|
|
157
|
-
path: `/${
|
|
158
|
-
name: `${
|
|
159
|
-
id: `${
|
|
173
|
+
].includes(o.path) && P.forEach((n) => {
|
|
174
|
+
t.push({
|
|
175
|
+
...o,
|
|
176
|
+
path: `/${n}${o.path}`,
|
|
177
|
+
name: `${n}-${o.name}`,
|
|
178
|
+
id: `${n}-${o.id}`
|
|
160
179
|
});
|
|
161
|
-
}),
|
|
162
|
-
}), [...e, ...
|
|
180
|
+
}), o.children && (o.children = ye(o.children));
|
|
181
|
+
}), [...e, ...t];
|
|
163
182
|
}
|
|
164
183
|
export {
|
|
165
184
|
X as B,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
185
|
+
de as ComponentA,
|
|
186
|
+
P as KG_APPS,
|
|
187
|
+
c as KG_APPS_ENUM,
|
|
188
|
+
ye as addOnlineRoutesForAllApps,
|
|
189
|
+
ae as base64toBlob,
|
|
190
|
+
Ne as downloadFile,
|
|
191
|
+
we as getAppByPath,
|
|
192
|
+
he as getAppIndexPath,
|
|
193
|
+
Ae as getFileSize,
|
|
173
194
|
q as isPathInApp
|
|
174
195
|
};
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 根据'文件大小数值'获取'文件大小文本'.
|
|
3
3
|
* @param size 文件大小数值.
|
|
4
4
|
*/
|
|
5
5
|
export declare function getFileSize(size: any): string;
|
|
6
|
+
/**
|
|
7
|
+
* base64 转换为 blob.
|
|
8
|
+
* @param base64 base64 字符串.
|
|
9
|
+
* @param contentType 文件类型.
|
|
10
|
+
* @param sliceSize 分块大小.
|
|
11
|
+
*/
|
|
12
|
+
export declare function base64toBlob(base64: string, contentType: string, sliceSize?: number): Blob;
|
|
13
|
+
/**
|
|
14
|
+
* 下载文件.
|
|
15
|
+
* @param data 文件数据.
|
|
16
|
+
* @param fileName 文件名称, 包含后缀.
|
|
17
|
+
* @param contentType 文件类型.
|
|
18
|
+
*/
|
|
19
|
+
export declare function downloadFile(data: string | BlobPart, fileName: string, contentType: string): void;
|