@kengic/vue 0.0.2-beta.23 → 0.0.2-beta.24
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/index.js +71 -27
- package/dist/src/consts/index.d.ts +2 -1
- package/dist/src/utils/app.util.d.ts +17 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,39 +1,80 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Button as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as l, createVNode as s, openBlock as a, createElementBlock as S, Fragment as W, createElementVNode as g, toDisplayString as $, unref as c, withCtx as w, createTextVNode as C } from "vue";
|
|
2
|
+
import { Button as d } from "ant-design-vue";
|
|
3
|
+
const m = l({
|
|
4
4
|
props: {
|
|
5
5
|
name: String
|
|
6
6
|
},
|
|
7
7
|
setup(e) {
|
|
8
|
-
return () =>
|
|
8
|
+
return () => s(d, {
|
|
9
9
|
type: "ghost"
|
|
10
10
|
}, {
|
|
11
11
|
default: () => [e.name]
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
}),
|
|
14
|
+
}), E = /* @__PURE__ */ l({
|
|
15
15
|
__name: "ComponentA",
|
|
16
16
|
props: {
|
|
17
17
|
msg: String
|
|
18
18
|
},
|
|
19
19
|
setup(e) {
|
|
20
|
-
return (n, t) => (a(),
|
|
20
|
+
return (n, t) => (a(), S(W, null, [g("div", null, "Hello " + $(e.msg) + "!", 1), s(c(d), {
|
|
21
21
|
type: "primary"
|
|
22
22
|
}, {
|
|
23
|
-
default:
|
|
23
|
+
default: w(() => [C("CLICK")]),
|
|
24
24
|
_: 1
|
|
25
|
-
}),
|
|
25
|
+
}), s(c(m), {
|
|
26
26
|
name: "FOO"
|
|
27
27
|
})], 64));
|
|
28
28
|
}
|
|
29
|
-
}),
|
|
29
|
+
}), u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
30
30
|
__proto__: null,
|
|
31
|
-
ComponentA:
|
|
32
|
-
B:
|
|
31
|
+
ComponentA: E,
|
|
32
|
+
B: m
|
|
33
33
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
34
|
-
var
|
|
35
|
-
const
|
|
36
|
-
function
|
|
34
|
+
var r = /* @__PURE__ */ ((e) => (e.WMS = "wms", e.MES = "mes", e.WCS = "wcs", e.SYS = "sys", e))(r || {});
|
|
35
|
+
const f = ["wms", "mes", "wcs", "sys"];
|
|
36
|
+
function y(e, n) {
|
|
37
|
+
var t, o, i;
|
|
38
|
+
switch (n) {
|
|
39
|
+
case r.WMS:
|
|
40
|
+
return (t = e == null ? void 0 : e.startsWith(`/${r.WMS}`)) != null ? t : !1;
|
|
41
|
+
case r.MES:
|
|
42
|
+
return (o = e == null ? void 0 : e.startsWith(`/${r.MES}`)) != null ? o : !1;
|
|
43
|
+
case r.WCS:
|
|
44
|
+
return (i = e == null ? void 0 : e.startsWith(`/${r.WCS}`)) != null ? i : !1;
|
|
45
|
+
case r.SYS:
|
|
46
|
+
return !(e != null && e.startsWith(`/${r.WMS}`)) && !(e != null && e.startsWith(`/${r.MES}`)) && !(e != null && e.startsWith(`/${r.WCS}`));
|
|
47
|
+
default:
|
|
48
|
+
throw new Error(`\u672A\u77E5\u6A21\u5757: ${n}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function k(e) {
|
|
52
|
+
const n = f.find((t) => y(e, t));
|
|
53
|
+
if (n)
|
|
54
|
+
return n;
|
|
55
|
+
throw new Error(`\u5730\u5740\u65E0\u6CD5\u5339\u914D\u6A21\u5757. \u5730\u5740: ${e}`);
|
|
56
|
+
}
|
|
57
|
+
function _(e) {
|
|
58
|
+
let n = "";
|
|
59
|
+
switch (e) {
|
|
60
|
+
case r.WMS:
|
|
61
|
+
n = `/${e}/views/adrmst`;
|
|
62
|
+
break;
|
|
63
|
+
case r.MES:
|
|
64
|
+
n = `/${e}/about/index`;
|
|
65
|
+
break;
|
|
66
|
+
case r.WCS:
|
|
67
|
+
n = `/${e}/about/index`;
|
|
68
|
+
break;
|
|
69
|
+
case r.SYS:
|
|
70
|
+
n = "/about/index";
|
|
71
|
+
break;
|
|
72
|
+
default:
|
|
73
|
+
throw new Error(`\u672A\u77E5\u6A21\u5757: ${e}`);
|
|
74
|
+
}
|
|
75
|
+
return n;
|
|
76
|
+
}
|
|
77
|
+
function A(e) {
|
|
37
78
|
const n = [];
|
|
38
79
|
return e.forEach((t) => {
|
|
39
80
|
[
|
|
@@ -42,21 +83,24 @@ function S(e) {
|
|
|
42
83
|
"/online/cgformTreeList/:id",
|
|
43
84
|
"/online/cgreport/:id",
|
|
44
85
|
"/online/graphreport/chart/:code"
|
|
45
|
-
].includes(t.path) &&
|
|
46
|
-
n.push({ ...t, path: `/${
|
|
47
|
-
}), t.children &&
|
|
86
|
+
].includes(t.path) && f.forEach((o) => {
|
|
87
|
+
n.push({ ...t, path: `/${o}${t.path}` });
|
|
88
|
+
}), t.children && A(t.children);
|
|
48
89
|
}), [...e, ...n];
|
|
49
90
|
}
|
|
50
|
-
function
|
|
51
|
-
for (const n in
|
|
52
|
-
e.component(n,
|
|
91
|
+
function b(e) {
|
|
92
|
+
for (const n in u)
|
|
93
|
+
e.component(n, u[n]);
|
|
53
94
|
}
|
|
54
|
-
const
|
|
95
|
+
const B = { install: b };
|
|
55
96
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
97
|
+
m as B,
|
|
98
|
+
E as ComponentA,
|
|
99
|
+
f as KG_APPS,
|
|
100
|
+
r as KG_APPS_ENUM,
|
|
101
|
+
A as addOnlineRoutesForAllApps,
|
|
102
|
+
B as default,
|
|
103
|
+
k as getAppByPath,
|
|
104
|
+
_ as getAppIndexPath,
|
|
105
|
+
y as isPathInApp
|
|
62
106
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { KG_APPS_ENUM } from '../consts';
|
|
2
|
+
/**
|
|
3
|
+
* 判断某个路径是否属于某个模块.
|
|
4
|
+
* @param path 路径.
|
|
5
|
+
* @param app 模块.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isPathInApp(path: string | undefined | null, app: KG_APPS_ENUM): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 根据地址获取模块.
|
|
10
|
+
* @param path 地址.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAppByPath(path: string): KG_APPS_ENUM;
|
|
13
|
+
/**
|
|
14
|
+
* 获取模块首页地址.
|
|
15
|
+
* @param app 模块.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getAppIndexPath(app: KG_APPS_ENUM): string;
|