@kengic/vue 0.0.2-beta.22 → 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 CHANGED
@@ -1,61 +1,106 @@
1
- import { defineComponent as p, createVNode as o, openBlock as a, createElementBlock as s, Fragment as m, createElementVNode as d, toDisplayString as f, unref as r, withCtx as h, createTextVNode as u } from "vue";
2
- import { Button as l } from "ant-design-vue";
3
- const i = p({
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
- setup(n) {
8
- return () => o(l, {
7
+ setup(e) {
8
+ return () => s(d, {
9
9
  type: "ghost"
10
10
  }, {
11
- default: () => [n.name]
11
+ default: () => [e.name]
12
12
  });
13
13
  }
14
- }), _ = /* @__PURE__ */ p({
14
+ }), E = /* @__PURE__ */ l({
15
15
  __name: "ComponentA",
16
16
  props: {
17
17
  msg: String
18
18
  },
19
- setup(n) {
20
- return (t, e) => (a(), s(m, null, [d("div", null, "Hello " + f(n.msg) + "!", 1), o(r(l), {
19
+ setup(e) {
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: h(() => [u("CLICK")]),
23
+ default: w(() => [C("CLICK")]),
24
24
  _: 1
25
- }), o(r(i), {
25
+ }), s(c(m), {
26
26
  name: "FOO"
27
27
  })], 64));
28
28
  }
29
- }), c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
29
+ }), u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
30
30
  __proto__: null,
31
- ComponentA: _,
32
- B: i
31
+ ComponentA: E,
32
+ B: m
33
33
  }, Symbol.toStringTag, { value: "Module" }));
34
- const g = 100, b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
35
- __proto__: null,
36
- MAGIC_NUM: g
37
- }, Symbol.toStringTag, { value: "Module" }));
38
- function y(n) {
39
- const t = [];
40
- return n.forEach((e) => {
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) {
78
+ const n = [];
79
+ return e.forEach((t) => {
41
80
  [
42
81
  "/online/copyform/:code",
43
82
  "/online/cgformList/:id",
44
83
  "/online/cgformTreeList/:id",
45
84
  "/online/cgreport/:id",
46
85
  "/online/graphreport/chart/:code"
47
- ].includes(e.path) && (e.path = `/wms${e.path}`, t.push({ ...e, path: `/mes${e.path}` }), t.push({ ...e, path: `/wcs${e.path}` })), e.children && y(e.children);
48
- }), [...n, ...t];
86
+ ].includes(t.path) && f.forEach((o) => {
87
+ n.push({ ...t, path: `/${o}${t.path}` });
88
+ }), t.children && A(t.children);
89
+ }), [...e, ...n];
49
90
  }
50
- function C(n) {
51
- for (const t in c)
52
- n.component(t, c[t]);
91
+ function b(e) {
92
+ for (const n in u)
93
+ e.component(n, u[n]);
53
94
  }
54
- const x = { install: C };
95
+ const B = { install: b };
55
96
  export {
56
- i as B,
57
- _ as ComponentA,
58
- b as MyConstants,
59
- y as addOnlineRoutesForAllApps,
60
- x as default
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
61
106
  };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * 系统所有模块.
3
+ */
4
+ export declare const enum KG_APPS_ENUM {
5
+ WMS = "wms",
6
+ MES = "mes",
7
+ WCS = "wcs",
8
+ SYS = "sys"
9
+ }
10
+ /**
11
+ * 系统所有模块.
12
+ */
13
+ export declare const KG_APPS: Array<KG_APPS_ENUM>;
@@ -2,7 +2,7 @@ import { type App } from 'vue';
2
2
  declare function install(app: App): void;
3
3
  import './assets/index.less';
4
4
  export * from './components';
5
- export * from './constants';
5
+ export * from './consts';
6
6
  export * from './utils';
7
7
  declare const _default: {
8
8
  install: typeof install;
@@ -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;
@@ -1 +1,2 @@
1
+ export * from './app.util';
1
2
  export * from './route.util';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.0.2-beta.22",
3
+ "version": "0.0.2-beta.24",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "publish:all:beta": "npm run bump-version:beta && npm run publish:all",
@@ -1 +0,0 @@
1
- export declare const MAGIC_NUM = 100;
@@ -1,2 +0,0 @@
1
- import * as MyConstants from './MyConstants';
2
- export { MyConstants };