@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.
- package/API.md +30 -27
- package/README.md +5 -4
- package/dist/.cache/route-chart-release/frontend/frame/public/js/ecStat.min.js +4 -0
- package/dist/.cache/route-chart-release/frontend/frame/public/js/echarts-wordcloud.min.js +4 -0
- package/dist/.cache/route-chart-release/frontend/frame/public/js/echarts.min.js +4 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +10 -0
- package/dist/_virtual/jsencrypt.min.js +1 -1
- package/dist/assets/ecStat.min-BrTYPOXX.js +1 -0
- package/dist/assets/echarts-wordcloud.min-nWR4Hzny.js +3 -0
- package/dist/assets/echarts.min-DROS9E5X.js +45 -0
- package/dist/assets/role_select-DTqRlFNz.webp +0 -0
- package/dist/{_vendor → frontend/frame/_vendor}/.pnpm/jsencrypt@3.5.4/_vendor/jsencrypt/bin/jsencrypt.min.js +1 -1
- package/dist/src/Container.js +1 -0
- package/dist/src/RootApp.js +54 -0
- package/dist/src/api/config.js +1 -0
- package/dist/src/api/createHttp.js +7 -0
- package/dist/src/api/index.js +1 -0
- package/dist/src/app-layout.js +1 -0
- package/dist/src/app-ui-settings.js +49 -0
- package/dist/src/app.js +1 -0
- package/dist/src/axios.js +11 -15
- package/dist/src/capture-ref.js +1 -0
- package/dist/src/chart-runtime-assets.js +9 -0
- package/dist/src/components/draggable/index.js +1 -0
- package/dist/src/create-app.js +4 -6
- package/dist/src/directives/clickoutside.js +1 -0
- package/dist/src/directives/global.js +1 -0
- package/dist/src/index.js +3 -0
- package/dist/src/lazy-library.js +1 -0
- package/dist/src/loadComponent.js +3 -2
- package/dist/src/loadLibrary.js +1 -0
- package/dist/src/menu-route.js +12 -0
- package/dist/src/mixins/component.js +4 -0
- package/dist/src/mixins/custom-option.js +1 -0
- package/dist/src/mixins/el-locale.js +1 -0
- package/dist/src/mixins/global.js +1 -0
- package/dist/src/mixins/index.js +1 -0
- package/dist/src/mixins/methods-to-prototype.js +1 -0
- package/dist/src/mixins/optimized-global.js +1 -0
- package/dist/src/mixins/popper.js +1 -0
- package/dist/src/navigation-context.js +47 -0
- package/dist/src/navigation.js +44 -12
- package/dist/src/package-install.js +4 -2
- package/dist/src/plugins/element-plus.js +9 -8
- package/dist/src/plugins/i18n.js +1 -0
- package/dist/src/plugins/library-locale.js +1 -0
- package/dist/src/progress-bar.js +1 -0
- package/dist/src/public-api.js +5 -2
- package/dist/src/register-components.js +1 -0
- package/dist/src/remote-deps.js +1 -0
- package/dist/src/route-components.js +9 -0
- package/dist/src/router/config.js +8 -8
- package/dist/src/router/index.js +1 -0
- package/dist/src/router/public.js +1 -0
- package/dist/src/runtime-services.js +2 -1
- package/dist/src/runtime-utils/fieldFactory.js +1 -0
- package/dist/src/runtime-utils/meta.js +4 -0
- package/dist/src/runtime-utils/pdf.viewer.js +32 -15
- package/dist/src/runtime-utils/util.js +30 -5
- package/dist/src/shallow-same.js +1 -0
- package/dist/src/shared-packages.js +2 -3
- package/dist/src/store/actions.js +1 -0
- package/dist/src/store/create-store.js +1 -0
- package/dist/src/store/index.js +1 -0
- package/dist/src/store/lru.js +1 -0
- package/dist/src/store/modules/config.js +1 -0
- package/dist/src/store/modules/file.js +1 -0
- package/dist/src/store/modules/index.js +1 -0
- package/dist/src/store/modules/list.js +26 -3
- package/dist/src/store/modules/locale.js +1 -0
- package/dist/src/store/modules/meta.js +50 -7
- package/dist/src/store/modules/page.js +1 -0
- package/dist/src/store/modules/router.js +1 -0
- package/dist/src/store/modules/tabs.js +1 -0
- package/dist/src/store/modules/user.js +1 -0
- package/dist/src/style-presets.js +5 -4
- package/dist/src/ui-settings.js +91 -18
- package/dist/src/viewport.js +1 -0
- package/dist/src/views/App.js +48 -0
- package/dist/src/views/AppRoleSelect.js +233 -0
- package/dist/src/views/Error.js +210 -0
- package/dist/src/views/Module.js +173 -0
- package/dist/src/vue.bus.js +1 -0
- package/dist/src/vue2-cancel-token-compat.js +1 -0
- package/dist/src/vue2-remote-shim.js +1 -0
- package/dist/src/vue2-render-compat.js +1 -0
- package/dist/src/vue2-select-style-compat.js +1 -0
- package/dist/src/watermark.js +1 -0
- package/dist/src/xss.js +1 -0
- package/dist/src/z-index.js +1 -0
- package/dist/style.css +251 -0
- package/package.json +6 -5
- package/src/RootApp.vue +75 -0
- package/src/api/createHttp.js +7 -0
- package/src/api/index.js +47 -47
- package/src/app-ui-settings.js +31 -0
- package/src/axios.js +311 -318
- package/src/chart-runtime-assets.js +7 -0
- package/src/create-app.js +3 -7
- package/src/index.js +28 -28
- package/src/install.js +157 -157
- package/src/loadComponent.js +187 -187
- package/src/loadLibrary.js +99 -99
- package/src/menu-route.js +12 -1
- package/src/mixins/component.js +1464 -1461
- package/src/navigation-context.js +49 -0
- package/src/navigation.js +208 -176
- package/src/package-install.js +2 -1
- package/src/plugins/element-plus.js +302 -302
- package/src/plugins/frame.js +178 -178
- package/src/public-api.js +1 -0
- package/src/route-components.js +7 -0
- package/src/router/config.js +861 -864
- package/src/router/public.js +1 -1
- package/src/runtime-services.js +1 -1
- package/src/runtime-utils/fieldFactory.js +179 -179
- package/src/runtime-utils/meta.js +399 -378
- package/src/runtime-utils/pdf.viewer.js +672 -644
- package/src/runtime-utils/util.js +1357 -1330
- package/src/shared-packages.js +1 -3
- package/src/store/modules/config.js +351 -351
- package/src/store/modules/list.js +30 -3
- package/src/store/modules/locale.js +236 -236
- package/src/store/modules/meta.js +314 -265
- package/src/style-presets.js +4 -4
- package/src/ui-settings.js +84 -23
- package/src/views/App.vue +53 -0
- package/src/views/AppRoleSelect.vue +334 -0
- package/src/views/Error.vue +63 -0
- package/src/views/Module.vue +210 -0
- package/src/xss.js +26 -26
- package/types/app.d.ts +10 -10
- package/types/axios.d.ts +1 -1
- package/types/component-mixin.d.ts +1 -1
- package/types/field-factory.d.ts +1 -1
- package/types/global-mixin.d.ts +1 -1
- package/types/http.d.ts +1 -1
- package/types/index.d.ts +3 -0
- package/types/meta.d.ts +1 -1
- package/types/navigation.d.ts +21 -21
- package/types/pdf-viewer.d.ts +1 -1
- package/types/runtime.d.ts +13 -13
- package/types/store.d.ts +1 -1
- package/types/util.d.ts +2 -2
- /package/dist/{build → .cache/route-chart-release/frontend/frame/build}/stubs/empty-components.js +0 -0
- /package/dist/{src → .cache/route-chart-release/frontend/frame/src}/element-icons.names.js +0 -0
- /package/dist/{src → .cache/route-chart-release/frontend/frame/src}/element-plus.lazy.js +0 -0
- /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
- /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
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as jsencrypt_min$1 } from "
|
|
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() {
|
package/dist/src/Container.js
CHANGED
|
@@ -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
|
+
};
|
package/dist/src/api/config.js
CHANGED
|
@@ -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) {
|
package/dist/src/api/index.js
CHANGED
package/dist/src/app-layout.js
CHANGED
|
@@ -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
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 {
|
|
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 [
|
|
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.
|
|
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((
|
|
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,
|
package/dist/src/capture-ref.js
CHANGED
|
@@ -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
|
+
};
|
package/dist/src/create-app.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
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
|
-
|
|
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,
|
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,
|
package/dist/src/lazy-library.js
CHANGED
|
@@ -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("
|
|
18
|
-
designer: () => __epxPackagePreload(() => import("
|
|
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({});
|
package/dist/src/loadLibrary.js
CHANGED
package/dist/src/menu-route.js
CHANGED
|
@@ -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) {
|
package/dist/src/mixins/index.js
CHANGED
|
@@ -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
|
+
};
|
package/dist/src/navigation.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
|
97
|
+
if (!getRouteMenuKey(route)) return;
|
|
84
98
|
const { client, system, app } = route.params;
|
|
85
|
-
const
|
|
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
|
|
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
|
-
/**
|
|
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,
|
|
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
|
|
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;
|