@epxing/core 5.3.0-beta.1 → 5.3.0-beta.3

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.
Files changed (149) hide show
  1. package/API.md +30 -27
  2. package/README.md +5 -4
  3. package/dist/.cache/route-chart-release/frontend/frame/public/js/ecStat.min.js +4 -0
  4. package/dist/.cache/route-chart-release/frontend/frame/public/js/echarts-wordcloud.min.js +4 -0
  5. package/dist/.cache/route-chart-release/frontend/frame/public/js/echarts.min.js +4 -0
  6. package/dist/_virtual/_plugin-vue_export-helper.js +10 -0
  7. package/dist/_virtual/jsencrypt.min.js +1 -1
  8. package/dist/assets/ecStat.min-BrTYPOXX.js +1 -0
  9. package/dist/assets/echarts-wordcloud.min-nWR4Hzny.js +3 -0
  10. package/dist/assets/echarts.min-DROS9E5X.js +45 -0
  11. package/dist/assets/role_select-DTqRlFNz.webp +0 -0
  12. package/dist/{_vendor → frontend/frame/_vendor}/.pnpm/jsencrypt@3.5.4/_vendor/jsencrypt/bin/jsencrypt.min.js +1 -1
  13. package/dist/src/Container.js +1 -0
  14. package/dist/src/RootApp.js +54 -0
  15. package/dist/src/api/config.js +1 -0
  16. package/dist/src/api/createHttp.js +7 -0
  17. package/dist/src/api/index.js +1 -0
  18. package/dist/src/app-layout.js +1 -0
  19. package/dist/src/app-ui-settings.js +49 -0
  20. package/dist/src/app.js +1 -0
  21. package/dist/src/axios.js +11 -15
  22. package/dist/src/capture-ref.js +1 -0
  23. package/dist/src/chart-runtime-assets.js +9 -0
  24. package/dist/src/components/draggable/index.js +1 -0
  25. package/dist/src/create-app.js +4 -6
  26. package/dist/src/directives/clickoutside.js +1 -0
  27. package/dist/src/directives/global.js +1 -0
  28. package/dist/src/index.js +3 -0
  29. package/dist/src/lazy-library.js +1 -0
  30. package/dist/src/loadComponent.js +3 -2
  31. package/dist/src/loadLibrary.js +1 -0
  32. package/dist/src/menu-route.js +12 -0
  33. package/dist/src/mixins/component.js +4 -0
  34. package/dist/src/mixins/custom-option.js +1 -0
  35. package/dist/src/mixins/el-locale.js +1 -0
  36. package/dist/src/mixins/global.js +1 -0
  37. package/dist/src/mixins/index.js +1 -0
  38. package/dist/src/mixins/methods-to-prototype.js +1 -0
  39. package/dist/src/mixins/optimized-global.js +1 -0
  40. package/dist/src/mixins/popper.js +1 -0
  41. package/dist/src/navigation-context.js +47 -0
  42. package/dist/src/navigation.js +44 -12
  43. package/dist/src/package-install.js +4 -2
  44. package/dist/src/plugins/element-plus.js +9 -8
  45. package/dist/src/plugins/i18n.js +1 -0
  46. package/dist/src/plugins/library-locale.js +1 -0
  47. package/dist/src/progress-bar.js +1 -0
  48. package/dist/src/public-api.js +5 -2
  49. package/dist/src/register-components.js +1 -0
  50. package/dist/src/remote-deps.js +1 -0
  51. package/dist/src/route-components.js +9 -0
  52. package/dist/src/router/config.js +8 -8
  53. package/dist/src/router/index.js +1 -0
  54. package/dist/src/router/public.js +1 -0
  55. package/dist/src/runtime-services.js +2 -1
  56. package/dist/src/runtime-utils/fieldFactory.js +1 -0
  57. package/dist/src/runtime-utils/meta.js +4 -0
  58. package/dist/src/runtime-utils/pdf.viewer.js +32 -15
  59. package/dist/src/runtime-utils/util.js +30 -5
  60. package/dist/src/shallow-same.js +1 -0
  61. package/dist/src/shared-packages.js +2 -3
  62. package/dist/src/store/actions.js +1 -0
  63. package/dist/src/store/create-store.js +1 -0
  64. package/dist/src/store/index.js +1 -0
  65. package/dist/src/store/lru.js +1 -0
  66. package/dist/src/store/modules/config.js +1 -0
  67. package/dist/src/store/modules/file.js +1 -0
  68. package/dist/src/store/modules/index.js +1 -0
  69. package/dist/src/store/modules/list.js +26 -3
  70. package/dist/src/store/modules/locale.js +1 -0
  71. package/dist/src/store/modules/meta.js +50 -7
  72. package/dist/src/store/modules/page.js +1 -0
  73. package/dist/src/store/modules/router.js +1 -0
  74. package/dist/src/store/modules/tabs.js +1 -0
  75. package/dist/src/store/modules/user.js +1 -0
  76. package/dist/src/style-presets.js +5 -4
  77. package/dist/src/ui-settings.js +91 -18
  78. package/dist/src/viewport.js +1 -0
  79. package/dist/src/views/App.js +48 -0
  80. package/dist/src/views/AppRoleSelect.js +233 -0
  81. package/dist/src/views/Error.js +210 -0
  82. package/dist/src/views/Module.js +173 -0
  83. package/dist/src/vue.bus.js +1 -0
  84. package/dist/src/vue2-cancel-token-compat.js +1 -0
  85. package/dist/src/vue2-remote-shim.js +1 -0
  86. package/dist/src/vue2-render-compat.js +1 -0
  87. package/dist/src/vue2-select-style-compat.js +1 -0
  88. package/dist/src/watermark.js +1 -0
  89. package/dist/src/xss.js +1 -0
  90. package/dist/src/z-index.js +1 -0
  91. package/dist/style.css +251 -0
  92. package/package.json +6 -5
  93. package/src/RootApp.vue +75 -0
  94. package/src/api/createHttp.js +7 -0
  95. package/src/api/index.js +47 -47
  96. package/src/app-ui-settings.js +31 -0
  97. package/src/axios.js +311 -318
  98. package/src/chart-runtime-assets.js +7 -0
  99. package/src/create-app.js +3 -7
  100. package/src/index.js +28 -28
  101. package/src/install.js +157 -157
  102. package/src/loadComponent.js +187 -187
  103. package/src/loadLibrary.js +99 -99
  104. package/src/menu-route.js +12 -1
  105. package/src/mixins/component.js +1464 -1461
  106. package/src/navigation-context.js +49 -0
  107. package/src/navigation.js +208 -176
  108. package/src/package-install.js +2 -1
  109. package/src/plugins/element-plus.js +302 -302
  110. package/src/plugins/frame.js +178 -178
  111. package/src/public-api.js +1 -0
  112. package/src/route-components.js +7 -0
  113. package/src/router/config.js +861 -864
  114. package/src/router/public.js +1 -1
  115. package/src/runtime-services.js +1 -1
  116. package/src/runtime-utils/fieldFactory.js +179 -179
  117. package/src/runtime-utils/meta.js +399 -378
  118. package/src/runtime-utils/pdf.viewer.js +672 -644
  119. package/src/runtime-utils/util.js +1357 -1330
  120. package/src/shared-packages.js +1 -3
  121. package/src/store/modules/config.js +351 -351
  122. package/src/store/modules/list.js +30 -3
  123. package/src/store/modules/locale.js +236 -236
  124. package/src/store/modules/meta.js +314 -265
  125. package/src/style-presets.js +4 -4
  126. package/src/ui-settings.js +84 -23
  127. package/src/views/App.vue +53 -0
  128. package/src/views/AppRoleSelect.vue +334 -0
  129. package/src/views/Error.vue +63 -0
  130. package/src/views/Module.vue +210 -0
  131. package/src/xss.js +26 -26
  132. package/types/app.d.ts +10 -10
  133. package/types/axios.d.ts +1 -1
  134. package/types/component-mixin.d.ts +1 -1
  135. package/types/field-factory.d.ts +1 -1
  136. package/types/global-mixin.d.ts +1 -1
  137. package/types/http.d.ts +1 -1
  138. package/types/index.d.ts +3 -0
  139. package/types/meta.d.ts +1 -1
  140. package/types/navigation.d.ts +21 -21
  141. package/types/pdf-viewer.d.ts +1 -1
  142. package/types/runtime.d.ts +13 -13
  143. package/types/store.d.ts +1 -1
  144. package/types/util.d.ts +2 -2
  145. /package/dist/{build → .cache/route-chart-release/frontend/frame/build}/stubs/empty-components.js +0 -0
  146. /package/dist/{src → .cache/route-chart-release/frontend/frame/src}/element-icons.names.js +0 -0
  147. /package/dist/{src → .cache/route-chart-release/frontend/frame/src}/element-plus.lazy.js +0 -0
  148. /package/dist/{_vendor → frontend/frame/_vendor}/.pnpm/element-plus@2.14.3_vue@3.5.39_typescript@5.9.3_/_vendor/element-plus/dist/locale/en.js +0 -0
  149. /package/dist/{_vendor → frontend/frame/_vendor}/.pnpm/element-plus@2.14.3_vue@3.5.39_typescript@5.9.3_/_vendor/element-plus/dist/locale/zh-cn.js +0 -0
@@ -1,4 +1,4 @@
1
- import { __module as jsencrypt_min$1 } from "../../../../../../_virtual/jsencrypt.min2.js";
1
+ import { __module as jsencrypt_min$1 } from "../../../../../../../../_virtual/jsencrypt.min2.js";
2
2
  var jsencrypt_min = jsencrypt_min$1.exports;
3
3
  var hasRequiredJsencrypt_min;
4
4
  function requireJsencrypt_min() {
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  import { mapState } from "vuex";
2
3
  import { evalWith } from "@epxing/utils/src/eval-with";
3
4
  import { isCustomOption } from "./mixins/custom-option.js";
@@ -0,0 +1,54 @@
1
+ import '../style.css';
2
+ import { migrateLegacyTheme, initTheme } from "./ui-settings.js";
3
+ import storage from "@epxing/utils/src/storage";
4
+ import { resolveComponent, openBlock, createElementBlock, createBlock } from "vue";
5
+ /* empty css */
6
+ import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
7
+ const _sfc_main = {
8
+ name: "epx-root-app",
9
+ computed: {
10
+ routeViewKey() {
11
+ const route = this.$route;
12
+ if (route.name === "system") {
13
+ return JSON.stringify([route.name, route.params.client, route.params.system]);
14
+ }
15
+ if (route.name === "wikiSite" || route.name === "wikiView") {
16
+ return JSON.stringify([route.name, route.params.client, route.params.system, route.params.wiki || route.query.w]);
17
+ }
18
+ return route.meta && route.meta.refresh !== false ? route.path : this.routeKeyName;
19
+ },
20
+ // b17a2b119 把根 key 从 $route.name 改成了本计算属性,但**没把它加上**——
21
+ // 于是 refresh:false 的路由 key 恒为 undefined,每次渲染刷一条
22
+ // [Vue warn]: Property "routeKeyName" was accessed during render but is not defined。
23
+ // 实际效果是「所有 refresh:false 路由共用一个空 key」,比设计更粗:
24
+ // help / client / defaultApp 也跟着不重挂了。这里补回该提交的原意——
25
+ // 只在菜单族内归一,其余仍用 $route.name(即改动前的行为)。
26
+ routeKeyName() {
27
+ const name = this.$route.name;
28
+ if (name === "app1" || name === "appMenu") return "app";
29
+ if (name === "hall" || name === "hallMenu") return "hall";
30
+ return name;
31
+ }
32
+ },
33
+ created() {
34
+ migrateLegacyTheme(storage.get("epx_frame_theme"));
35
+ initTheme();
36
+ },
37
+ mounted() {
38
+ const that = this;
39
+ window.addEventListener("resize", that.$_.debounce(() => {
40
+ that.$store.commit("GET_VIEWPORT");
41
+ }, 200));
42
+ }
43
+ };
44
+ const _hoisted_1 = { class: "epx-app-root" };
45
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
46
+ const _component_router_view = resolveComponent("router-view");
47
+ return openBlock(), createElementBlock("div", _hoisted_1, [
48
+ (openBlock(), createBlock(_component_router_view, { key: $options.routeViewKey }))
49
+ ]);
50
+ }
51
+ const Root = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-80523e3c"]]);
52
+ export {
53
+ Root as default
54
+ };
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  const api = {
2
3
  // 通用请求
3
4
  $request: {
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import axios from "../axios.js";
2
3
  import { ensureIcons, collectIconNames } from "@epxing/icons/src/runtime.mjs";
3
4
  const MENU_ACTIONS = /* @__PURE__ */ new Set([
@@ -163,6 +164,12 @@ const createHttp = (config) => {
163
164
  if (meta.serverCode && !options.domainContext) {
164
165
  projectName = meta.serverCode;
165
166
  }
167
+ if (router.currentRoute.value.name === "hall") {
168
+ const { clientCode: clientCode2, systemCode } = meta;
169
+ if (clientCode2) clientId = clientCode2;
170
+ if (systemCode) sysId = systemCode;
171
+ if (entityId.includes("@system@")) entityId = `${entityId.split("@")[0]}@${sysId}@${clientId}`;
172
+ }
166
173
  } else if (router.currentRoute.value.name === "hall") {
167
174
  const isSystemEntity = entityId.includes("@system@") || entityId.length === 32;
168
175
  if (action !== "getMeta" && action !== "getSystemInfo" && isSystemEntity) {
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { getConfiguredRuntimeService } from "../runtime-services.js";
2
3
  import axios from "../axios.js";
3
4
  import api from "./config.js";
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  function getAppNavMode(appConfig = {}, pageConfig = {}) {
2
3
  let config = {};
3
4
  try {
@@ -0,0 +1,49 @@
1
+ import '../style.css';
2
+ import { DEFAULTS, LEGACY_RADIUS_AXIS, LEGACY_DENSITY_AXIS } from "./ui-settings.js";
3
+ const APP_UI_KEYS = [
4
+ "themeMode",
5
+ "themeColor",
6
+ "customTheme",
7
+ "menuAccordion",
8
+ "showLogo",
9
+ "breadcrumb",
10
+ "sidebarDark",
11
+ "styleRadius",
12
+ "styleFont",
13
+ "styleDensity",
14
+ "styleElevation",
15
+ "componentSize",
16
+ "tabsPosition",
17
+ "tabsStyle",
18
+ "tabsKeepAlive",
19
+ "pageAnim",
20
+ "progressBar",
21
+ "pageLoading"
22
+ ];
23
+ function resolveAppUiDefaults(config = {}, pageConfig = {}) {
24
+ var _a;
25
+ const legacy = { ...pageConfig, ...config };
26
+ const result = {};
27
+ for (const key of APP_UI_KEYS) {
28
+ if (legacy[key] !== void 0 && legacy[key] !== null) result[key] = legacy[key];
29
+ }
30
+ if (result.styleRadius === void 0 && legacy.borderRadius !== void 0) {
31
+ result.styleRadius = LEGACY_RADIUS_AXIS[legacy.borderRadius] || "";
32
+ }
33
+ if (result.styleDensity === void 0 && legacy.componentMargin !== void 0) {
34
+ result.styleDensity = LEGACY_DENSITY_AXIS[legacy.componentMargin] || "";
35
+ }
36
+ for (const key of APP_UI_KEYS) {
37
+ if (((_a = config.uiDefaults) == null ? void 0 : _a[key]) !== void 0 && config.uiDefaults[key] !== null) result[key] = config.uiDefaults[key];
38
+ }
39
+ return result;
40
+ }
41
+ function createAppUiDraft(config = {}) {
42
+ const defaults = resolveAppUiDefaults(config);
43
+ return Object.fromEntries(APP_UI_KEYS.map((key) => [key, defaults[key] ?? DEFAULTS[key]]));
44
+ }
45
+ export {
46
+ APP_UI_KEYS,
47
+ createAppUiDraft,
48
+ resolveAppUiDefaults
49
+ };
package/dist/src/app.js CHANGED
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  import { __vitePreload as __epxPackagePreload } from "../_virtual/preload-helper.js";
2
3
  let _app = null;
3
4
  let compatModulePromise = null;
package/dist/src/axios.js CHANGED
@@ -1,10 +1,11 @@
1
+ import '../style.css';
1
2
  import { __vitePreload as __epxPackagePreload } from "../_virtual/preload-helper.js";
2
3
  import axios$1 from "axios";
3
4
  import util from "./runtime-utils/util.js";
4
5
  import { getXsrfToken, setXsrfToken } from "@epxing/utils/src/storage";
5
6
  import { consumeUrlToken, setStoredToken, removeStoredToken, getStoredToken } from "@epxing/utils/src/token-storage";
6
7
  import { ElMessage } from "element-plus/es/components/message/index.mjs";
7
- import { MENU_ROUTE_ALIAS, roleStorage } from "./menu-route.js";
8
+ import { resolveRouteRole } from "./menu-route.js";
8
9
  let message = null;
9
10
  let timer = null;
10
11
  const normalizeBearerToken = (authorization) => {
@@ -51,10 +52,11 @@ let encryptedAesKey = null;
51
52
  const ensureCrypto = () => {
52
53
  if (cryptoReadyPromise) return cryptoReadyPromise;
53
54
  cryptoReadyPromise = (async () => {
54
- const [CryptoJS, jsEncryptModule] = await Promise.all([
55
+ const [cryptoModule, jsEncryptModule] = await Promise.all([
55
56
  __epxPackagePreload(() => import("crypto-js"), true ? [] : void 0, import.meta.url),
56
57
  __epxPackagePreload(() => import("../_virtual/jsencrypt.min.js").then((n) => n.j), true ? [] : void 0, import.meta.url)
57
58
  ]);
59
+ const CryptoJS = "default" in cryptoModule ? cryptoModule.default : cryptoModule;
58
60
  const JSEncrypt = jsEncryptModule.default;
59
61
  let rsaKey = window.store.state.config.decryptKey.rsaKey;
60
62
  if (!rsaKey) {
@@ -78,7 +80,7 @@ const init = () => {
78
80
  instance.defaults.xsrfCookieName = null;
79
81
  axios$1.defaults.xsrfCookieName = null;
80
82
  instance.interceptors.request.use(async (config) => {
81
- var _a;
83
+ var _a, _b, _c, _d, _e;
82
84
  const legacyCancelToken = config.cancelToken;
83
85
  if ((typeof __EPX_VUE2_COMPAT__ === "undefined" || __EPX_VUE2_COMPAT__) && window.__EPX_VUE2_COMPAT__ !== false && legacyCancelToken && typeof legacyCancelToken.subscribe !== "function" && typeof ((_a = legacyCancelToken.promise) == null ? void 0 : _a.then) === "function") {
84
86
  const { adaptLegacyCancelToken } = await __epxPackagePreload(async () => {
@@ -90,28 +92,21 @@ const init = () => {
90
92
  if (window.IP) {
91
93
  config.baseURL = window.IP;
92
94
  }
93
- let name = null;
94
- let params = {};
95
- if (window.router) {
96
- params = window.router.currentRoute.value.params;
97
- name = window.router.currentRoute.value.name;
98
- }
99
95
  const locationUrl = window.location.hash.split("?")[0];
96
+ const currentRoute = (_c = (_b = window.router) == null ? void 0 : _b.currentRoute) == null ? void 0 : _c.value;
97
+ const route = (currentRoute == null ? void 0 : currentRoute.name) ? currentRoute : ((_e = (_d = window.router) == null ? void 0 : _d.resolve) == null ? void 0 : _e.call(_d, locationUrl.slice(1))) || currentRoute;
98
+ const { name = null, params = {} } = route || {};
100
99
  var reg = /(app\/role\/select|hall\/role\/select|app|hall\/login|hall|login|system|client|service\/setting|recruit\/register)\/(\w+)\/?([\w-]+)?\/(\w+)\/?([\w-_]+)?/;
101
100
  var regResult = reg.exec(locationUrl);
102
101
  const regClientCode = regResult ? RegExp.$2 === "login" ? RegExp.$3 : RegExp.$2 : null;
103
102
  const regSystemCode = regResult ? RegExp.$3 : null;
104
103
  const regAppCode = regResult ? RegExp.$1 === "hall" ? "FM_SERVICE_HALL" : RegExp.$4 : null;
105
- const regRoleCode = regResult ? RegExp.$1 === "hall" ? RegExp.$3 : RegExp.$1 === "system" ? RegExp.$4 : RegExp.$5 : null;
106
104
  const { clientConfig = {}, appConfig = {}, temporaryRole } = window.store.state.config;
107
105
  const { CODE: CLIENT_CODE = "" } = clientConfig;
108
106
  const { CODE: APP_CODE = "", EXTEND_OF_COMPETENCE } = appConfig;
109
107
  const clientCode = params.client || regClientCode || CLIENT_CODE;
110
108
  const appCode = params.app || APP_CODE || regAppCode;
111
- let roleCode = params.role || regRoleCode || "";
112
- if (MENU_ROUTE_ALIAS[name]) {
113
- roleCode = params.role || roleStorage.get(regClientCode, regSystemCode) || "";
114
- }
109
+ let roleCode = resolveRouteRole({ params: { ...params, client: clientCode, system: params.client ? params.system : regSystemCode } });
115
110
  if (name === "Config") roleCode = "SYSTEM";
116
111
  const token = consumeUrlToken(clientCode ? clientCode + "-token" : "");
117
112
  if (window.IP && token) {
@@ -181,7 +176,8 @@ const init = () => {
181
176
  if (data.responseEncrypt) {
182
177
  const key = response.config.encryptAesKey;
183
178
  const iv = response.config.encryptIv;
184
- return __epxPackagePreload(() => import("crypto-js"), true ? [] : void 0, import.meta.url).then((CryptoJS) => {
179
+ return __epxPackagePreload(() => import("crypto-js"), true ? [] : void 0, import.meta.url).then((cryptoModule) => {
180
+ const CryptoJS = "default" in cryptoModule ? cryptoModule.default : cryptoModule;
185
181
  const decrypted = CryptoJS.AES.decrypt(data.data, key, {
186
182
  iv,
187
183
  mode: CryptoJS.mode.CBC,
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  function captureRef(vm, name) {
2
3
  const setter = (el) => {
3
4
  const inst = vm && vm.$;
@@ -0,0 +1,9 @@
1
+ import '../style.css';
2
+ import echartsUrl from "../.cache/route-chart-release/frontend/frame/public/js/echarts.min.js";
3
+ import ecStatUrl from "../.cache/route-chart-release/frontend/frame/public/js/ecStat.min.js";
4
+ import { default as default2 } from "../.cache/route-chart-release/frontend/frame/public/js/echarts-wordcloud.min.js";
5
+ const chartRuntimeAssets = [echartsUrl, ecStatUrl];
6
+ export {
7
+ chartRuntimeAssets as default,
8
+ default2 as wordcloudUrl
9
+ };
@@ -1,3 +1,4 @@
1
+ import '../../../style.css';
1
2
  import { __vitePreload as __epxPackagePreload } from "../../../_virtual/preload-helper.js";
2
3
  import { Comment, h, Fragment } from "vue";
3
4
  const containerRegistry = /* @__PURE__ */ new WeakMap();
@@ -1,10 +1,8 @@
1
- import { createApp, h } from "vue";
2
- import { createRouter, createWebHashHistory, RouterView } from "vue-router";
1
+ import '../style.css';
2
+ import { createApp } from "vue";
3
+ import { createRouter, createWebHashHistory } from "vue-router";
3
4
  import { createFrameStore } from "./store/create-store.js";
4
- const Root = {
5
- name: "EpxCoreApp",
6
- render: () => h("div", { class: "epx-app-root" }, [h(RouterView)])
7
- };
5
+ import Root from "./RootApp.js";
8
6
  function createCoreApp(options, corePlugin) {
9
7
  const {
10
8
  rootComponent = Root,
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  const nodeList = [];
2
3
  const ctx = "@@clickoutsideContext";
3
4
  let startClick;
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  const directive = {
2
3
  install(Vue, options = { time: 1500 }) {
3
4
  Vue.directive("longpress", {
package/dist/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  import * as src_publicApi from "./public-api.js";
2
3
  import * as utils from "@epxing/utils/src/public";
3
4
  import * as Vue from "vue";
@@ -20,6 +21,7 @@ import { createFrameStore, createStoreModules, storeModules } from "./store/crea
20
21
  import { getApp, registerComponent, resolveComponent, setApp } from "./app.js";
21
22
  import { default as default11 } from "./mixins/index.js";
22
23
  import { default as default12 } from "./navigation.js";
24
+ import { default as default13 } from "./route-components.js";
23
25
  function publishCoreRuntime() {
24
26
  publishSharedPackage("@epxing/core", { ...src_publicApi, installCore, createCore, createApp, publishCoreRuntime, default: EpxCore });
25
27
  publishSharedPackage("@epxing/utils", utils);
@@ -68,6 +70,7 @@ export {
68
70
  registerComponent,
69
71
  registerRouteComponents,
70
72
  resolveComponent,
73
+ default13 as routeComponents,
71
74
  default10 as routerConfig,
72
75
  runExpByScope,
73
76
  setApp,
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  import { defineAsyncComponent } from "vue";
2
3
  const winLibs = () => {
3
4
  if (typeof window === "undefined") return {};
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  import { __vitePreload as __epxPackagePreload } from "../_virtual/preload-helper.js";
2
3
  import { loadBusinessComponents } from "./runtime-services.js";
3
4
  import { defineAsyncComponent } from "vue";
@@ -14,8 +15,8 @@ function injectRemoteCss(href) {
14
15
  const strictPacks = () => typeof window !== "undefined" && window.EPX_DISABLE_LAZY_PACKS;
15
16
  const optionalGroupCache = {};
16
17
  const OPTIONAL_GROUPS = {
17
- dashboard: () => __epxPackagePreload(() => import("../build/stubs/empty-components.js"), true ? [] : void 0, import.meta.url),
18
- designer: () => __epxPackagePreload(() => import("../build/stubs/empty-components.js"), true ? [] : void 0, import.meta.url)
18
+ dashboard: () => __epxPackagePreload(() => import("../.cache/route-chart-release/frontend/frame/build/stubs/empty-components.js"), true ? [] : void 0, import.meta.url),
19
+ designer: () => __epxPackagePreload(() => import("../.cache/route-chart-release/frontend/frame/build/stubs/empty-components.js"), true ? [] : void 0, import.meta.url)
19
20
  };
20
21
  function loadOptionalGroup(app, which) {
21
22
  if (strictPacks()) return Promise.resolve({});
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  import util from "./runtime-utils/util.js";
2
3
  import client from "./api/index.js";
3
4
  import ensureRemoteDeps from "./remote-deps.js";
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  import { shallowRef } from "vue";
2
3
  function getMenuKey(menu) {
3
4
  if (!menu) return "";
@@ -65,9 +66,19 @@ const MENU_ROUTE_ALIAS = { appMenu: "app1", hallMenu: "hall" };
65
66
  function effectiveRouteName(name) {
66
67
  return MENU_ROUTE_ALIAS[name] || name;
67
68
  }
69
+ function getRouteMenuKey(route) {
70
+ var _a, _b;
71
+ const key = ((_a = route.params) == null ? void 0 : _a.menuKey) || (effectiveRouteName(route.name) === "system" ? (_b = route.query) == null ? void 0 : _b.menuKey : "");
72
+ return typeof key === "string" ? key : "";
73
+ }
68
74
  function menuLocation(route, key, query) {
69
75
  const q = query !== void 0 ? query : route.query;
70
76
  const { client, system, app } = route.params || {};
77
+ if (effectiveRouteName(route.name) === "system") {
78
+ const systemQuery = { ...q };
79
+ delete systemQuery.menuKey;
80
+ return { name: "system", params: { client, system, menuKey: key }, query: systemQuery };
81
+ }
71
82
  if (effectiveRouteName(route.name) === "hall") {
72
83
  return { name: "hallMenu", params: { client, menuKey: key }, query: q };
73
84
  }
@@ -79,6 +90,7 @@ export {
79
90
  findMenuByKey,
80
91
  findMenuPath,
81
92
  getMenuKey,
93
+ getRouteMenuKey,
82
94
  menuLocation,
83
95
  resolveRouteRole,
84
96
  roleStorage
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { mapGetters, mapState } from "vuex";
2
3
  import { evalWith } from "@epxing/utils/src/eval-with";
3
4
  import util from "../runtime-utils/util.js";
@@ -1200,15 +1201,18 @@ const component = {
1200
1201
  if (component2 instanceof Promise) {
1201
1202
  await component2;
1202
1203
  }
1204
+ if (this._isBeingDestroyed || this._isDestroyed) return;
1203
1205
  if (this.$metaId && !this.$meta) {
1204
1206
  await this.$store.dispatch({
1205
1207
  type: "ADD_META",
1206
1208
  metaId: this.$metaId
1207
1209
  });
1208
1210
  }
1211
+ if (this._isBeingDestroyed || this._isDestroyed) return;
1209
1212
  this.$componentStatus = "init";
1210
1213
  this.initComponent(this.$component);
1211
1214
  this.$nextTick(() => {
1215
+ if (this._isBeingDestroyed || this._isDestroyed) return;
1212
1216
  if (this.$el) {
1213
1217
  const compId = this.isPage ? this.$pageId : this.compId;
1214
1218
  if (this.$el.classList) {
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  const EPX_OPTION_KEYS = ["Config", "Preview", "parent", "destory"];
2
3
  const VUE_OPTION_KEYS = ["name", "mixins", "inject", "provide", "_Ctor", "__file", "_base", "_compiled", "beforeCreate", "created", "berforeMount", "beforeMount", "mounted", "beforeUpdate", "updated", "beforeDestroy", "destroyed", "beforeUnmount", "unmounted", "activated", "deactivated", "errorCaptured", "renderTracked", "renderTriggered", "serverPrefetch", "props", "data", "methods", "computed", "watch", "components", "directives", "filters", "render", "staticRenderFns", "setup", "emits", "expose", "inheritAttrs", "compatConfig", "extends", "el", "template", "delimiters", ...EPX_OPTION_KEYS];
3
4
  function isCustomOption(key, value) {
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { epConfig } from "../plugins/element-plus.js";
2
3
  function t(path, fallback = "") {
3
4
  const value = String(path).split(".").reduce((o, k) => o == null ? o : o[k], epConfig.locale);
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { mapGetters, mapState } from "vuex";
2
3
  import { isCustomOption } from "./custom-option.js";
3
4
  import { evalWith } from "@epxing/utils/src/eval-with";
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import component from "./component.js";
2
3
  import global from "./global.js";
3
4
  const index = {
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { isSafeFn } from "@epxing/utils/src/security";
2
3
  import { evalWith } from "@epxing/utils/src/eval-with";
3
4
  import nav, { activateMenu } from "../navigation.js";
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import global from "./global.js";
2
3
  const INSTANCE_METHOD_NAMES = ["commonAction", "downloadFile", "$setPageConfig", "$setCompConfigs"];
3
4
  const instanceMethods = INSTANCE_METHOD_NAMES.reduce((methods, name) => {
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { createPopper } from "@popperjs/core";
2
3
  import { nextZIndex } from "../z-index.js";
3
4
  const stop = (e) => e.stopPropagation();
@@ -0,0 +1,47 @@
1
+ import '../style.css';
2
+ import { findMenuPath, effectiveRouteName, resolveRouteRole } from "./menu-route.js";
3
+ const fields = ["moduleId", "pageId", "component", "metaId", "flag", "showMenu"];
4
+ function storageKey(route, menuId, userId) {
5
+ const name = effectiveRouteName(route.name);
6
+ if (name !== "app1" && name !== "hall") return "";
7
+ const { client, system, app } = route.params || {};
8
+ return "epx_nav_context:" + JSON.stringify([name, client, system, app, resolveRouteRole(route), userId, menuId]);
9
+ }
10
+ function saveMenuContext(route, menu, context, userId = "") {
11
+ const key = storageKey(route, menu.ID, userId);
12
+ if (!key) return;
13
+ try {
14
+ if (!(context == null ? void 0 : context.moduleId)) {
15
+ window.sessionStorage.removeItem(key);
16
+ return;
17
+ }
18
+ const saved = {};
19
+ for (const field of fields) {
20
+ const value = context[field];
21
+ if (typeof value === "string" || typeof value === "boolean") saved[field] = value;
22
+ }
23
+ window.sessionStorage.setItem(key, JSON.stringify(saved));
24
+ } catch (error) {
25
+ }
26
+ }
27
+ function readMenuContext(route, menu, menus, userId = "") {
28
+ const key = storageKey(route, menu.ID, userId);
29
+ if (!key) return null;
30
+ try {
31
+ const saved = JSON.parse(window.sessionStorage.getItem(key) || "null");
32
+ if (!saved) return null;
33
+ const path = findMenuPath(menus, menu.ID);
34
+ const root = path.find((item) => item.ID === saved.moduleId);
35
+ if (!root || (root.MAIN_PAGE || "") !== (saved.pageId || "")) {
36
+ window.sessionStorage.removeItem(key);
37
+ return null;
38
+ }
39
+ return saved;
40
+ } catch (error) {
41
+ return null;
42
+ }
43
+ }
44
+ export {
45
+ readMenuContext,
46
+ saveMenuContext
47
+ };
@@ -1,7 +1,9 @@
1
+ import '../style.css';
1
2
  import { nextTick } from "vue";
2
3
  import { runtimeRouter, runtimeStore } from "./runtime-services.js";
3
- import { roleStorage, findMenuByKey, getMenuKey, menuLocation, effectiveRouteName } from "./menu-route.js";
4
- import { MENU_ROUTE_ALIAS, findMenuPath, resolveRouteRole } from "./menu-route.js";
4
+ import { roleStorage, findMenuByKey, getMenuKey, getRouteMenuKey, menuLocation, effectiveRouteName, resolveRouteRole } from "./menu-route.js";
5
+ import { MENU_ROUTE_ALIAS, findMenuPath } from "./menu-route.js";
6
+ import { readMenuContext, saveMenuContext } from "./navigation-context.js";
5
7
  function findNavId(menus = [], menuId, parent) {
6
8
  for (let i = 0; i < menus.length; i++) {
7
9
  const menu = menus[i];
@@ -14,8 +16,19 @@ function findNavId(menus = [], menuId, parent) {
14
16
  }
15
17
  }
16
18
  let lastSyncedKey = null;
19
+ const navigationUserId = () => {
20
+ var _a, _b, _c, _d;
21
+ return ((_b = (_a = runtimeStore.state.user) == null ? void 0 : _a.user) == null ? void 0 : _b.id) || ((_d = (_c = runtimeStore.state.user) == null ? void 0 : _c.userInfo) == null ? void 0 : _d.ID) || "";
22
+ };
17
23
  function activateMenu(menuId, extraProps = {}, { syncUrl = true, replaceUrl = false, query } = {}) {
18
24
  const appMenus = runtimeStore.state.config.appMenus || [];
25
+ if (effectiveRouteName(runtimeRouter.currentRoute.value.name) === "system") {
26
+ const menu = findMenuByKey(appMenus, menuId);
27
+ if (!menu) return false;
28
+ nextTick(activateHome);
29
+ if (syncUrl) syncMenuUrl(menu, { replace: replaceUrl, query });
30
+ return true;
31
+ }
19
32
  const topLevel = appMenus.find((m) => m.ID === menuId);
20
33
  let menuNode = null;
21
34
  let params = null;
@@ -61,16 +74,17 @@ function activateMenu(menuId, extraProps = {}, { syncUrl = true, replaceUrl = fa
61
74
  }
62
75
  runtimeStore.commit("DESTORY_TAB", params.key);
63
76
  nextTick(() => runtimeStore.commit("CREATE_TAB", params));
64
- if (syncUrl) syncMenuUrl(menuNode, { replace: replaceUrl, query });
77
+ if (syncUrl) syncMenuUrl(menuNode, { replace: replaceUrl, query, context: params });
65
78
  return true;
66
79
  }
67
- function syncMenuUrl(menu, { replace = false, query } = {}) {
80
+ function syncMenuUrl(menu, { replace = false, query, context } = {}) {
68
81
  const key = menu && menu.ID;
69
82
  if (!key || !/^[0-9A-Fa-f]{32}$/.test(key)) return;
70
83
  const route = runtimeRouter.currentRoute.value;
71
84
  const name = effectiveRouteName(route.name);
72
- if (name !== "app1" && name !== "hall") return;
73
- if (route.params.menuKey === key && query === void 0) return;
85
+ if (name !== "app1" && name !== "hall" && name !== "system") return;
86
+ saveMenuContext(route, menu, context, navigationUserId());
87
+ if (getRouteMenuKey(route) === key && query === void 0) return;
74
88
  lastSyncedKey = key;
75
89
  const loc = menuLocation(route, key, query);
76
90
  (replace ? runtimeRouter.replace(loc) : runtimeRouter.push(loc)).catch(() => {
@@ -80,13 +94,16 @@ const ignoreNavFailure = () => {
80
94
  };
81
95
  function clearMenuUrl({ replace = false } = {}) {
82
96
  const route = runtimeRouter.currentRoute.value;
83
- if (!route.params || !route.params.menuKey) return;
97
+ if (!getRouteMenuKey(route)) return;
84
98
  const { client, system, app } = route.params;
85
- const loc = effectiveRouteName(route.name) === "hall" ? { name: "hall", params: { client }, query: route.query } : { name: "app1", params: { client, system, app }, query: route.query };
99
+ const name = effectiveRouteName(route.name);
100
+ const query = { ...route.query };
101
+ if (name === "system") delete query.menuKey;
102
+ const loc = name === "system" ? { name: "system", params: { client, system, role: resolveRouteRole(route) }, query } : name === "hall" ? { name: "hall", params: { client }, query: route.query } : { name: "app1", params: { client, system, app }, query: route.query };
86
103
  (replace ? runtimeRouter.replace(loc) : runtimeRouter.push(loc)).catch(ignoreNavFailure);
87
104
  }
88
105
  function activateFromRoute(route) {
89
- const key = route.params && route.params.menuKey;
106
+ const key = getRouteMenuKey(route);
90
107
  if (!key) return false;
91
108
  if (key === lastSyncedKey) {
92
109
  lastSyncedKey = null;
@@ -97,6 +114,20 @@ function activateFromRoute(route) {
97
114
  console.warn(`[nav] 菜单直达:找不到 menuKey=${key}(权限变化或编号已改),落应用首页`);
98
115
  return false;
99
116
  }
117
+ const context = readMenuContext(route, menu, runtimeStore.state.config.appMenus || [], navigationUserId());
118
+ if (context) {
119
+ const params = {
120
+ ...context,
121
+ key: "default-" + context.moduleId,
122
+ component: context.component || "module-index-page",
123
+ title: menu.NAME_ALIAS || menu.NAME || menu.text,
124
+ // 来源容器与目标相同时沿用独立入口,避免额外生成一层侧栏。
125
+ ...context.moduleId !== menu.ID ? { activeMenuId: menu.ID, activeMenuPageId: menu.MAIN_PAGE } : {}
126
+ };
127
+ runtimeStore.commit("DESTORY_TAB", params.key);
128
+ nextTick(() => runtimeStore.commit("CREATE_TAB", params));
129
+ return true;
130
+ }
100
131
  return activateMenu(menu.ID, {}, { syncUrl: false });
101
132
  }
102
133
  function activateHome() {
@@ -116,16 +147,16 @@ const nav = {
116
147
  }
117
148
  return activateMenu(menu.ID, {}, { syncUrl: true, replaceUrl: replace, query });
118
149
  },
119
- /** 生成某菜单的可分享 URL(含 /m/:key,不含 role——打开者用自己的角色) */
150
+ /** 生成包含菜单 ID 的分享地址;角色由打开者自己的登录上下文恢复。 */
120
151
  menuUrl(keyOrId, query) {
121
152
  const menu = findMenuByKey(runtimeStore.state.config.appMenus || [], String(keyOrId));
122
153
  if (!menu) return "";
123
- const loc = menuLocation(runtimeRouter.currentRoute.value, getMenuKey(menu), query);
154
+ const loc = menuLocation(runtimeRouter.currentRoute.value, menu.ID, query);
124
155
  return window.location.origin + window.location.pathname + runtimeRouter.resolve(loc).href;
125
156
  },
126
157
  /** 当前 URL 上的菜单键(无则 '') */
127
158
  currentMenuKey() {
128
- return (runtimeRouter.currentRoute.value.params || {}).menuKey || "";
159
+ return getRouteMenuKey(runtimeRouter.currentRoute.value);
129
160
  },
130
161
  getMenuKey,
131
162
  findMenuByKey,
@@ -143,6 +174,7 @@ export {
143
174
  findMenuByKey,
144
175
  findMenuPath,
145
176
  getMenuKey,
177
+ getRouteMenuKey,
146
178
  menuLocation,
147
179
  nav,
148
180
  resolveRouteRole,
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  import newXss from "./xss.js";
2
3
  import * as lodash from "lodash-es";
3
4
  import axios from "./axios.js";
@@ -13,18 +14,19 @@ import I18n from "./plugins/i18n.js";
13
14
  import installElementPlus from "./plugins/element-plus.js";
14
15
  import { setApp } from "./app.js";
15
16
  import { configureRuntime } from "./runtime-services.js";
17
+ import routeComponents from "./route-components.js";
16
18
  import { installGlobalMethods } from "./mixins/methods-to-prototype.js";
17
19
  import optimizedGlobalMixin from "./mixins/optimized-global.js";
18
20
  import loadComponentFactory from "./loadComponent.js";
19
21
  import nav from "./navigation.js";
20
- /* empty css */
22
+ /* empty css */
21
23
  import "element-plus/theme-chalk/dark/css-vars.css";
22
24
  const installed = /* @__PURE__ */ new WeakMap();
23
25
  function installCore(app, options = {}) {
24
26
  if (installed.has(app)) return installed.get(app);
25
27
  const { store, router, http = client, plugins = [], components = {} } = options;
26
28
  if (!store || !router) throw new TypeError("[epx/core] install 需要 store 和 router;可用 createFrameStore() 创建框架 store");
27
- configureRuntime({ ...options, http });
29
+ configureRuntime({ ...options, http, routeComponents: { ...routeComponents, ...options.routeComponents } });
28
30
  setApp(app);
29
31
  window.store = store;
30
32
  window.router = router;