@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,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { __vitePreload as __epxPackagePreload } from "../../_virtual/preload-helper.js";
2
3
  import { reactive, defineAsyncComponent, h } from "vue";
3
4
  import { provideGlobalConfig } from "element-plus/es/components/config-provider/index.mjs";
@@ -6,8 +7,8 @@ import { ElMessageBox } from "element-plus/es/components/message-box/index.mjs";
6
7
  import { ElLoadingDirective, ElLoading } from "element-plus/es/components/loading/index.mjs";
7
8
  import { ElNotification } from "element-plus/es/components/notification/index.mjs";
8
9
  import { ElInfiniteScroll } from "element-plus/es/components/infinite-scroll/index.mjs";
9
- import zh_cn_default from "../../_vendor/.pnpm/element-plus@2.14.3_vue@3.5.39_typescript@5.9.3_/_vendor/element-plus/dist/locale/zh-cn.js";
10
- import en_default from "../../_vendor/.pnpm/element-plus@2.14.3_vue@3.5.39_typescript@5.9.3_/_vendor/element-plus/dist/locale/en.js";
10
+ import zh_cn_default from "../../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";
11
+ import en_default from "../../frontend/frame/_vendor/.pnpm/element-plus@2.14.3_vue@3.5.39_typescript@5.9.3_/_vendor/element-plus/dist/locale/en.js";
11
12
  import { ElAvatar } from "element-plus/es/components/avatar/index.mjs";
12
13
  import { ElButton } from "element-plus/es/components/button/index.mjs";
13
14
  import { ElCard } from "element-plus/es/components/card/index.mjs";
@@ -26,12 +27,12 @@ import { ElTabs, ElTabPane } from "element-plus/es/components/tabs/index.mjs";
26
27
  import { ElCheckbox } from "element-plus/es/components/checkbox/index.mjs";
27
28
  import { ElIcon } from "element-plus/es/components/icon/index.mjs";
28
29
  import "element-plus/dist/index.css";
29
- /* empty css */
30
- /* empty css */
31
- /* empty css */
32
- /* empty css */
33
- import epLazy from "../element-plus.lazy.js";
34
- import iconNames from "../element-icons.names.js";
30
+ /* empty css */
31
+ /* empty css */
32
+ /* empty css */
33
+ /* empty css */
34
+ import epLazy from "../../.cache/route-chart-release/frontend/frame/src/element-plus.lazy.js";
35
+ import iconNames from "../../.cache/route-chart-release/frontend/frame/src/element-icons.names.js";
35
36
  const EN_LOCALE_CODES = /* @__PURE__ */ new Set(["011", "en", "en-us"]);
36
37
  function elementPlusLocale(lang) {
37
38
  return EN_LOCALE_CODES.has(String(lang || "").toLowerCase()) ? en_default : zh_cn_default;
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { reactive } from "vue";
2
3
  class I18n {
3
4
  constructor({ locale = "zh-CN", messages = {}, fallbackMessages = {} }) {
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { setElementPlusLocale } from "./element-plus.js";
2
3
  import moment from "@epxing/utils/src/moment-compat";
3
4
  const LOCALE_CONFIGS = {
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  import NProgress from "nprogress";
2
3
  import { watch } from "vue";
3
4
  import uiSettings from "./ui-settings.js";
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  import { installCore } from "./package-install.js";
2
3
  import { default as default2 } from "./mixins/component.js";
3
4
  import { default as default3 } from "./mixins/global.js";
@@ -13,7 +14,8 @@ import { createFrameRouter, default as default11 } from "./router/public.js";
13
14
  import { createEventBus, getEventBus } from "./vue.bus.js";
14
15
  import { getApp, registerComponent, resolveComponent, setApp } from "./app.js";
15
16
  import { configureRuntime, registerRouteComponents } from "./runtime-services.js";
16
- import { default as default12 } from "./navigation.js";
17
+ import { default as default12 } from "./route-components.js";
18
+ import { default as default13 } from "./navigation.js";
17
19
  export {
18
20
  default2 as ComponentMixin,
19
21
  default8 as FieldFactory,
@@ -36,10 +38,11 @@ export {
36
38
  default6 as http,
37
39
  installCore,
38
40
  default4 as mixins,
39
- default12 as nav,
41
+ default13 as nav,
40
42
  registerComponent,
41
43
  registerRouteComponents,
42
44
  resolveComponent,
45
+ default12 as routeComponents,
43
46
  default11 as routerConfig,
44
47
  runExpByScope,
45
48
  setApp,
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  function installComponents(app, components, { byKey = false } = {}) {
2
3
  const safeApp = new Proxy(app, {
3
4
  get(target, key) {
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  const depsUrl = (jsUrl) => {
2
3
  const noQuery = String(jsUrl).replace(/\?.*$/, "");
3
4
  return noQuery.replace(/\.[^./]+$/, ".deps.json");
@@ -0,0 +1,9 @@
1
+ import '../style.css';
2
+ import App from "./views/App.js";
3
+ import Module from "./views/Module.js";
4
+ import AppRoleSelect from "./views/AppRoleSelect.js";
5
+ import Error from "./views/Error.js";
6
+ const routeComponents = { App, Module, AppRoleSelect, Error };
7
+ export {
8
+ routeComponents as default
9
+ };
@@ -1,3 +1,5 @@
1
+ import '../../style.css';
2
+ import { restoreChatWikiRoute } from "@epxing/utils/src/wiki-path";
1
3
  import { runtimeRouteComponent, getRuntimeService, runtimeStore } from "../runtime-services.js";
2
4
  import { isEmpty } from "lodash-es";
3
5
  import util from "../runtime-utils/util.js";
@@ -9,7 +11,6 @@ import { setElementPlusLocale } from "../plugins/element-plus.js";
9
11
  import { MENU_ROUTE_ALIAS, roleStorage, effectiveRouteName } from "../menu-route.js";
10
12
  const Page = runtimeRouteComponent("Page");
11
13
  const Login = runtimeRouteComponent("Login");
12
- const QyWechat = runtimeRouteComponent("QyWechat");
13
14
  const App = runtimeRouteComponent("App");
14
15
  const WikiSitePage = runtimeRouteComponent("WikiSitePage");
15
16
  const Module = runtimeRouteComponent("Module");
@@ -238,9 +239,11 @@ const routes = [
238
239
  props: (route) => ({ query: route.query })
239
240
  },
240
241
  {
241
- path: "/system/:client/:system/:role?",
242
+ // 32 位菜单 ID 与旧角色编号消歧;旧的 /system/.../SYSTEM 地址仍可使用。
243
+ path: "/system/:client/:system/:menuKey([0-9A-Fa-f]{32})?/:role?",
242
244
  name: "system",
243
245
  component: App,
246
+ meta: { refresh: false },
244
247
  props: (route) => ({ query: route.query })
245
248
  },
246
249
  {
@@ -316,11 +319,6 @@ const routes = [
316
319
  component: App,
317
320
  props: (route) => ({ query: route.query })
318
321
  },
319
- {
320
- path: "/qywechat",
321
- name: "qywechat",
322
- component: QyWechat
323
- },
324
322
  {
325
323
  // 旧形态 /m/:menuKey 链接兼容:重定向到无 /m/ 的新形态
326
324
  path: "/app/:client/:system/:app/m/:menuKey",
@@ -343,6 +341,8 @@ const routes = [
343
341
  }
344
342
  ];
345
343
  const beforeEach = async (to, from, next) => {
344
+ const restoredWikiRoute = restoreChatWikiRoute(to);
345
+ if (restoredWikiRoute) return next(restoredWikiRoute);
346
346
  try {
347
347
  subscribeToLogout();
348
348
  return await runBeforeEach(to, from, next);
@@ -365,7 +365,7 @@ const runBeforeEach = async (to, from, rawNext) => {
365
365
  }
366
366
  return rawNext(location);
367
367
  };
368
- const isMenuRoute = !!MENU_ROUTE_ALIAS[to.name];
368
+ const isMenuRoute = !!MENU_ROUTE_ALIAS[to.name] || to.name === "system" && !!to.params.menuKey;
369
369
  if (isMenuRoute) {
370
370
  const storedRole = roleStorage.get(to.params.client, to.params.system);
371
371
  to = { ...to, name: effectiveRouteName(to.name), params: { ...to.params, role: to.params.role || storedRole || void 0 } };
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { createRouter, createWebHistory, createWebHashHistory } from "vue-router";
2
3
  import routes, { beforeEach } from "./config.js";
3
4
  let mode = "hash";
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { createRouter, createWebHashHistory } from "vue-router";
2
3
  import routes, { beforeEach } from "./config.js";
3
4
  const routerConfig = { routes, beforeEach };
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  const services = /* @__PURE__ */ Object.create(null);
2
3
  const routeComponents = /* @__PURE__ */ new Map();
3
4
  let businessLoader;
@@ -33,7 +34,7 @@ function registerRouteComponents(components) {
33
34
  function runtimeRouteComponent(name) {
34
35
  return async () => {
35
36
  const component = routeComponents.get(name);
36
- if (!component) throw new Error(`[epx/core] 路由组件 ${name} 尚未注册,请安装 component/business 或传入 routeComponents`);
37
+ if (!component) throw new Error(`[epx/core] 路由组件 ${name} 尚未注册,请安装提供该页面的 components/business 包或传入 routeComponents`);
37
38
  return component;
38
39
  };
39
40
  }
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { runtimeStore } from "../runtime-services.js";
2
3
  import { ADD_META, ADD_LIST } from "../store/actions.js";
3
4
  import { isString } from "lodash-es";
@@ -1,4 +1,6 @@
1
+ import '../../style.css';
1
2
  import util from "./util.js";
3
+ const appliedLanguage = /* @__PURE__ */ new WeakMap();
2
4
  class Meta {
3
5
  constructor(props = {}) {
4
6
  var me = this;
@@ -55,6 +57,8 @@ class Meta {
55
57
  }
56
58
  getAttributes() {
57
59
  const currentLanguage = util.getCurrentLanguage();
60
+ if (appliedLanguage.get(this) === currentLanguage) return this.attributes;
61
+ appliedLanguage.set(this, currentLanguage);
58
62
  for (const key in this.attributes) {
59
63
  const item = this.attributes[key];
60
64
  for (const key2 in item.languageMap) {
@@ -1,5 +1,11 @@
1
+ import '../../style.css';
1
2
  import util from "./util.js";
2
3
  const DEFAULT_CACHE_SIZE = 10;
4
+ const MAX_CANVAS_PIXELS = 16777216;
5
+ function releaseCanvas(canvas) {
6
+ canvas.width = 0;
7
+ canvas.height = 0;
8
+ }
3
9
  function binarySearchFirstItem(items, condition) {
4
10
  var minIndex = 0;
5
11
  var maxIndex = items.length - 1;
@@ -166,18 +172,18 @@ class PdfViewer {
166
172
  }
167
173
  this.scrollState = null;
168
174
  for (const item of this.pages) {
169
- if (item.div && item.div.parentNode) item.div.parentNode.removeChild(item.div);
175
+ if (!item.div) continue;
176
+ for (const canvas of item.div.querySelectorAll("canvas")) releaseCanvas(canvas);
177
+ if (item.div.parentNode) item.div.parentNode.removeChild(item.div);
170
178
  }
171
179
  this.pages = [];
172
180
  this.loadViews = [];
173
181
  this.searchTextArr = [];
174
- if (this.pdfDocument) {
175
- try {
176
- this.pdfDocument.destroy();
177
- } catch (e) {
178
- }
179
- this.pdfDocument = null;
182
+ if (this.loadingTask) {
183
+ this.loadingTask.destroy();
184
+ this.loadingTask = null;
180
185
  }
186
+ this.pdfDocument = null;
181
187
  }
182
188
  async searchTextInPDF(searchText) {
183
189
  const numPages = this.pdfDocument.numPages;
@@ -295,12 +301,16 @@ class PdfViewer {
295
301
  pageRotate: 0
296
302
  };
297
303
  await this.loadPdf();
298
- return this.pdfJs.getDocument({
304
+ if (this.destroyed) return;
305
+ this.loadingTask = this.pdfJs.getDocument({
299
306
  url: this.pdfConfig.url,
300
307
  cMapUrl: this.pdfConfig.cMapUrl,
301
308
  cMapPacked: this.pdfConfig.cMapPacked
302
- }).promise.then((pdfDocument) => {
309
+ });
310
+ return this.loadingTask.promise.then((pdfDocument) => {
303
311
  this.load(pdfDocument);
312
+ }).catch((err) => {
313
+ if (!this.destroyed) throw err;
304
314
  });
305
315
  }
306
316
  load(pdfDocument) {
@@ -423,6 +433,7 @@ class PdfViewer {
423
433
  if (node.className.includes("pdf-viewer-loading")) {
424
434
  node.style.display = "block";
425
435
  } else {
436
+ if (node.tagName === "CANVAS") releaseCanvas(node);
426
437
  div.removeChild(node);
427
438
  }
428
439
  }
@@ -434,18 +445,18 @@ class PdfViewer {
434
445
  if (div.getAttribute("data-loaded")) continue;
435
446
  div.setAttribute("data-loaded", true);
436
447
  this.pdfDocument.getPage(item.view.id).then((page) => {
448
+ if (this.destroyed) return;
437
449
  const canvas = document.createElement("canvas");
438
450
  const ctx = canvas.getContext("2d", {
439
451
  alpha: false
440
452
  });
441
453
  const initViewport = page.getViewport({ scale: 1 });
442
- let scale = 1;
443
- if (this.pdfConfig.zoom === "page-width") {
444
- scale = Math.ceil(document.body.offsetWidth / initViewport.width);
445
- } else {
446
- scale = this.pdfConfig.zoom;
447
- }
448
454
  const rotation = (this.pdfConfig.pageRotate + initViewport.rotation) % 360;
455
+ const baseViewport = page.getViewport({ scale: 1, rotation });
456
+ const cssWidth = div.clientWidth || this.pdfConfig.viewerContainer.offsetWidth || baseViewport.width;
457
+ let scale = cssWidth / baseViewport.width * (window.devicePixelRatio || 1);
458
+ const pixels = baseViewport.width * baseViewport.height * scale * scale;
459
+ if (pixels > MAX_CANVAS_PIXELS) scale *= Math.sqrt(MAX_CANVAS_PIXELS / pixels);
449
460
  const viewport = page.getViewport({ scale, rotation });
450
461
  canvas.width = viewport.width;
451
462
  canvas.height = viewport.height;
@@ -458,11 +469,17 @@ class PdfViewer {
458
469
  };
459
470
  var renderTask = page.render(renderContext);
460
471
  renderTask.promise.then(() => {
472
+ if (this.destroyed) {
473
+ releaseCanvas(canvas);
474
+ return;
475
+ }
461
476
  const loading = item.view.div.querySelector(".pdf-viewer-loading");
462
477
  loading.style.display = "none";
463
478
  item.view.div.appendChild(canvas);
464
479
  this.loadViews.push(item.view);
465
480
  cb && cb();
481
+ }, () => {
482
+ releaseCanvas(canvas);
466
483
  });
467
484
  });
468
485
  }
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { __vitePreload as __epxPackagePreload } from "../../_virtual/preload-helper.js";
2
3
  import storage, { getXsrfToken } from "@epxing/utils/src/storage";
3
4
  import { setStoredToken, getStoredToken, removeStoredToken, consumeUrlToken } from "@epxing/utils/src/token-storage";
@@ -6,6 +7,8 @@ import * as formula from "@epxing/utils/src/formula";
6
7
  import { evalWith } from "@epxing/utils/src/eval-with";
7
8
  import { useVuePlugin, getApp } from "../app.js";
8
9
  import { resolveRouteRole } from "../menu-route.js";
10
+ import chartRuntimeAssets from "../chart-runtime-assets.js";
11
+ import wordcloudUrl from "../../.cache/route-chart-release/frontend/frame/public/js/echarts-wordcloud.min.js";
9
12
  const installingLibraries = /* @__PURE__ */ new Map();
10
13
  class Util {
11
14
  constructor() {
@@ -584,7 +587,8 @@ class Util {
584
587
  }
585
588
  script.onerror = function() {
586
589
  console.error("[util.loadJS] 加载失败:" + url);
587
- callback();
590
+ if (options.onerror) options.onerror(new Error("脚本加载失败:" + url));
591
+ else callback();
588
592
  };
589
593
  script.src = url;
590
594
  document.getElementsByTagName("head")[0].appendChild(script);
@@ -787,7 +791,7 @@ class Util {
787
791
  const publicPath = this.getPublicPath();
788
792
  const jsDir = this.getStaticJsDir();
789
793
  if (plugin === "luckysheet") {
790
- const loadPromise = loadFile([publicPath + "luckysheet/pluginsCss.css", publicPath + "luckysheet/plugins.css", publicPath + "luckysheet/luckysheet.css", publicPath + "/luckysheet/iconfont.css", publicPath + "luckysheet/plugin.js", publicPath + "luckysheet/luckysheet.umd.js"]).then(() => globalThis.luckysheet);
794
+ const loadPromise = loadFile([publicPath + "luckysheet/pluginsCss.css", publicPath + "luckysheet/plugins.css", publicPath + "luckysheet/luckysheet.css", publicPath + "luckysheet/iconfont.css", publicPath + "luckysheet/plugin.js", publicPath + "luckysheet/luckysheet.umd.js"]).then(() => globalThis.luckysheet);
791
795
  this.loadPlugins[plugin] = loadPromise;
792
796
  return loadPromise;
793
797
  } else if (plugin === "BMap") {
@@ -827,7 +831,26 @@ class Util {
827
831
  this.loadPlugins[plugin] = loadPromise;
828
832
  return loadPromise;
829
833
  } else if (plugin === "echarts") {
830
- const loadPromise = loadFile([publicPath + jsDir + "echarts.min.js?v=6.0.0-full", publicPath + jsDir + "ecStat.min.js"]).then(() => globalThis.echarts);
834
+ const files = window.STATIC_JS_DIR ? [publicPath + jsDir + "echarts.min.js?v=6.0.0-full", publicPath + jsDir + "ecStat.min.js"] : chartRuntimeAssets;
835
+ const loadPromise = Promise.all(files.map((url) => new Promise((resolve, reject) => {
836
+ this.loadJS({ url, callback: resolve, onerror: reject });
837
+ }))).then(() => {
838
+ if (!globalThis.echarts || !globalThis.ecStat) throw new Error("图表资源加载失败,请检查 ECharts 和 ecStat 脚本");
839
+ return globalThis.echarts;
840
+ }).catch((error) => {
841
+ delete this.loadPlugins[plugin];
842
+ throw error;
843
+ });
844
+ this.loadPlugins[plugin] = loadPromise;
845
+ return loadPromise;
846
+ } else if (plugin === "echarts-wordcloud") {
847
+ const url = window.STATIC_JS_DIR ? publicPath + jsDir + "echarts-wordcloud.min.js" : wordcloudUrl;
848
+ const loadPromise = new Promise((resolve, reject) => {
849
+ this.loadJS({ url, callback: resolve, onerror: reject });
850
+ }).catch((error) => {
851
+ delete this.loadPlugins[plugin];
852
+ throw error;
853
+ });
831
854
  this.loadPlugins[plugin] = loadPromise;
832
855
  return loadPromise;
833
856
  } else if (plugin === "pdf") {
@@ -1053,7 +1076,8 @@ class Util {
1053
1076
  }
1054
1077
  encrypt(content, key, { type } = {}) {
1055
1078
  if (type === "aes") {
1056
- return __epxPackagePreload(() => import("crypto-js"), true ? [] : void 0, import.meta.url).then((CryptoJS) => {
1079
+ return __epxPackagePreload(() => import("crypto-js"), true ? [] : void 0, import.meta.url).then((cryptoModule) => {
1080
+ const CryptoJS = "default" in cryptoModule ? cryptoModule.default : cryptoModule;
1057
1081
  const base64Key = atob(key);
1058
1082
  const aesKey = CryptoJS.enc.Utf8.parse(base64Key.toString(CryptoJS.enc.Utf8));
1059
1083
  const encrypted = CryptoJS.AES.encrypt(content, aesKey, {
@@ -1073,7 +1097,8 @@ class Util {
1073
1097
  }
1074
1098
  decrypt(content, { type, key }) {
1075
1099
  if (type === "aes") {
1076
- return __epxPackagePreload(() => import("crypto-js"), true ? [] : void 0, import.meta.url).then((CryptoJS) => {
1100
+ return __epxPackagePreload(() => import("crypto-js"), true ? [] : void 0, import.meta.url).then((cryptoModule) => {
1101
+ const CryptoJS = "default" in cryptoModule ? cryptoModule.default : cryptoModule;
1077
1102
  const base64Key = atob(key);
1078
1103
  const aesKey = CryptoJS.enc.Utf8.parse(base64Key.toString(CryptoJS.enc.Utf8));
1079
1104
  const decrypted = CryptoJS.AES.decrypt(content, aesKey, {
@@ -1,3 +1,4 @@
1
+ import '../style.css';
1
2
  function shallowSame(a, b) {
2
3
  if (a === b) return true;
3
4
  if (!a || !b || typeof a !== "object" || typeof b !== "object") return false;
@@ -1,11 +1,10 @@
1
+ import '../style.css';
1
2
  import { installComponents } from "./register-components.js";
2
3
  function publishSharedPackage(name, api) {
3
4
  const registry = globalThis.__EPX_PACKAGES__ || (globalThis.__EPX_PACKAGES__ = /* @__PURE__ */ Object.create(null));
4
5
  const namespace = registry[name] || (registry[name] = {});
5
6
  Object.assign(namespace, api);
6
- if (name === "@epxing/component" || name === "@epxing/components") {
7
- registry["@epxing/component"] = namespace;
8
- registry["@epxing/components"] = namespace;
7
+ if (name === "@epxing/components") {
9
8
  if (!namespace.install) namespace.install = (app) => installComponents(app, Object.fromEntries(
10
9
  Object.entries(namespace).filter(([key]) => key !== "install" && key !== "default")
11
10
  ));
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  const ADD_LIST = "ADD_LIST";
2
3
  const ADD_OBJECT_COUNT = "ADD_OBJECT_COUNT";
3
4
  const ADD_OBJECT = "ADD_OBJECT";
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { createStore } from "vuex";
2
3
  import modules from "./modules/index.js";
3
4
  function cloneState(value) {
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  import { createStore } from "vuex";
2
3
  import modules from "./modules/index.js";
3
4
  const store = createStore({
@@ -1,3 +1,4 @@
1
+ import '../../style.css';
1
2
  const DEFAULTS = {
2
3
  soft: 50,
3
4
  // 软上限:超过之后开始回收冷数据
@@ -1,3 +1,4 @@
1
+ import '../../../style.css';
1
2
  import { GET_MENU, GET_APP_CONFIG, GET_SYSTEM_CONFIG, GET_VIEWPORT, SWITCH_MENU_SHOW, CLEAR_MENU } from "../actions.js";
2
3
  import { ElMessage } from "element-plus/es/components/message/index.mjs";
3
4
  import client from "../../api/index.js";
@@ -1,3 +1,4 @@
1
+ import '../../../style.css';
1
2
  import client from "../../api/index.js";
2
3
  const ADD_FILE = "ADD_FILE";
3
4
  const file = {
@@ -1,3 +1,4 @@
1
+ import '../../../style.css';
1
2
  import config from "./config.js";
2
3
  import file from "./file.js";
3
4
  import list from "./list.js";
@@ -1,7 +1,19 @@
1
- import { markRaw } from "vue";
1
+ import '../../../style.css';
2
+ import { reactive, markRaw } from "vue";
2
3
  import client from "../../api/index.js";
3
4
  import { ADD_TAG, ADD_LIST, ADD_OBJECT_COUNT, ADD_OBJECT } from "../actions.js";
4
5
  import { touchKeys, prune, touch } from "../lru.js";
6
+ const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
7
+ const lists = reactive({});
8
+ const listSignals = /* @__PURE__ */ new Map();
9
+ const signalOf = (key) => {
10
+ let signal = listSignals.get(key);
11
+ if (!signal) {
12
+ signal = reactive({ version: 0 });
13
+ listSignals.set(key, signal);
14
+ }
15
+ return signal;
16
+ };
5
17
  const formatData = (array, values = [], list2) => {
6
18
  return array.map((item) => {
7
19
  item.defaultIndex = 0;
@@ -34,7 +46,7 @@ const markPayloadRaw = (data) => {
34
46
  };
35
47
  const list = {
36
48
  state: {
37
- lists: {},
49
+ lists,
38
50
  treeList: {},
39
51
  objects: {},
40
52
  object_counts: {},
@@ -43,6 +55,7 @@ const list = {
43
55
  },
44
56
  getters: {
45
57
  getCodeById: (state) => (id) => {
58
+ signalOf(id).version;
46
59
  const list2 = state.lists[id];
47
60
  if (list2) {
48
61
  touch("lists", id);
@@ -68,12 +81,22 @@ const list = {
68
81
  getTagListByMetaId: (state) => (id) => state.tags[id]
69
82
  },
70
83
  mutations: {
84
+ // 逐 key 写入并只通知该 key 的信号,不整体替换 lists
71
85
  [ADD_LIST](state, data) {
72
86
  touchKeys("lists", Object.keys(data));
73
- state.lists = prune("lists", { ...state.lists, ...markPayloadRaw(data) }, LIMITS.lists);
87
+ const rawData = markPayloadRaw(data);
88
+ for (const key in rawData) {
89
+ state.lists[key] = rawData[key];
90
+ signalOf(key).version++;
91
+ }
92
+ const keep = prune("lists", { ...state.lists }, LIMITS.lists);
93
+ for (const key in state.lists) {
94
+ if (!hasOwn(keep, key)) delete state.lists[key];
95
+ }
74
96
  },
75
97
  "DELETE_LIST"(state, payload) {
76
98
  delete state.lists[payload.key];
99
+ signalOf(payload.key).version++;
77
100
  },
78
101
  "ADD_TREE_LIST"(state, data) {
79
102
  touchKeys("treeList", Object.keys(data));
@@ -1,3 +1,4 @@
1
+ import '../../../style.css';
1
2
  import client from "../../api/index.js";
2
3
  import util from "../../runtime-utils/util.js";
3
4
  import storage from "@epxing/utils/src/storage";
@@ -1,9 +1,31 @@
1
- import { markRaw } from "vue";
1
+ import '../../../style.css';
2
+ import { reactive, markRaw, toRaw } from "vue";
2
3
  import client from "../../api/index.js";
3
4
  import Meta from "../../runtime-utils/meta.js";
4
5
  import { ADD_META } from "../actions.js";
5
6
  import { touch, touchKeys, prune } from "../lru.js";
6
7
  const ADD_SIMPLE_META = "ADD_SIMPLE_META";
8
+ const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
9
+ const metas = reactive({});
10
+ const metaAliases = /* @__PURE__ */ new WeakMap();
11
+ const aliasesOf = (state) => {
12
+ const cache = toRaw(state.metas);
13
+ if (!metaAliases.has(cache)) metaAliases.set(cache, {});
14
+ return metaAliases.get(cache);
15
+ };
16
+ const metaSignals = /* @__PURE__ */ new Map();
17
+ const signalOf = (key) => {
18
+ let signal = metaSignals.get(key);
19
+ if (!signal) {
20
+ signal = reactive({ version: 0 });
21
+ metaSignals.set(key, signal);
22
+ }
23
+ return signal;
24
+ };
25
+ const notifyMeta = (key) => {
26
+ const signal = metaSignals.get(key);
27
+ if (signal) signal.version++;
28
+ };
7
29
  const ADD_META_RELATION_FIELDS = "ADD_META_RELATION_FIELDS";
8
30
  const ADD_META_VIEW_FIELDS = "ADD_META_VIEW_FIELDS";
9
31
  const LIMITS = {
@@ -11,9 +33,9 @@ const LIMITS = {
11
33
  metaRelationFields: { soft: 50, hard: 120 },
12
34
  metaViewFields: { soft: 50, hard: 200 }
13
35
  };
14
- const findMeta = (metas, matcher) => {
15
- for (const key in metas) {
16
- const item = metas[key];
36
+ const findMeta = (metas2, matcher) => {
37
+ for (const key in metas2) {
38
+ const item = metas2[key];
17
39
  if (item && matcher(item)) {
18
40
  touch("metas", key);
19
41
  return item;
@@ -45,7 +67,7 @@ const formatFields = (arr, flag = "") => {
45
67
  };
46
68
  const meta = {
47
69
  state: {
48
- metas: {},
70
+ metas,
49
71
  simpleMetas: {},
50
72
  metaStatus: {},
51
73
  simpleMetaStatus: {},
@@ -55,9 +77,24 @@ const meta = {
55
77
  metaViewFieldStatus: {}
56
78
  },
57
79
  mutations: {
80
+ // 逐 key 写入并只通知该 key(及其别名)的信号,不整体替换 metas
58
81
  [ADD_META](state, data) {
59
82
  touchKeys("metas", Object.keys(data));
60
- state.metas = prune("metas", { ...state.metas, ...data }, LIMITS.metas);
83
+ const metaAlias = aliasesOf(state);
84
+ for (const key in data) {
85
+ const meta2 = data[key];
86
+ state.metas[key] = meta2;
87
+ const aliases = [meta2.id, meta2.code, `${meta2.code}@${meta2.systemCode}@${meta2.clientCode}`];
88
+ aliases.forEach((alias) => {
89
+ if (alias && alias !== key) metaAlias[alias] = key;
90
+ });
91
+ notifyMeta(key);
92
+ aliases.forEach(notifyMeta);
93
+ }
94
+ const keep = prune("metas", { ...state.metas }, LIMITS.metas);
95
+ for (const key in state.metas) {
96
+ if (!hasOwn(keep, key)) delete state.metas[key];
97
+ }
61
98
  },
62
99
  [ADD_SIMPLE_META](state, data) {
63
100
  state.simpleMetas = { ...state.simpleMetas, ...data };
@@ -73,12 +110,18 @@ const meta = {
73
110
  },
74
111
  getters: {
75
112
  getMetaById: (state) => (id) => {
113
+ signalOf(id).version;
76
114
  const meta2 = state.metas[id];
77
115
  if (meta2) touch("metas", id);
78
116
  return meta2;
79
117
  },
80
118
  getMeta: (state) => (id) => {
81
- return findMeta(state.metas, (item) => item.id === id || item.code === id || item.code + "@" + item.systemCode + "@" + item.clientCode === id);
119
+ if (!id) return void 0;
120
+ signalOf(id).version;
121
+ const key = hasOwn(state.metas, id) ? id : aliasesOf(state)[id];
122
+ const meta2 = key ? state.metas[key] : void 0;
123
+ if (meta2) touch("metas", key);
124
+ return meta2;
82
125
  },
83
126
  getSimpleMeta: (state) => (id) => {
84
127
  return state.simpleMetas[id] || findMeta(state.metas, (item) => item.id === id || item.code === id);
@@ -1,3 +1,4 @@
1
+ import '../../../style.css';
1
2
  import { markRaw } from "vue";
2
3
  import client from "../../api/index.js";
3
4
  import Page from "@epxing/utils/src/page";
@@ -1,3 +1,4 @@
1
+ import '../../../style.css';
1
2
  import { SET_ROUTER_RELOAD, SET_ROUTER_QUERY, DELETE_MENU_ROUTER, POP_MENU_ROUTER, PUSH_MENU_ROUTER, DELETE_MODULE_ROUTER, POP_MODULE_ROUTER, PUSH_MODULE_ROUTER, CLEAR_TABS_ROUTER, CLEAR_ROUTER, DELETE_ROUTER, PICK_ROUTER, SET_ROUTER, PUSH_ROUTER } from "../actions.js";
2
3
  const router = {
3
4
  state: {
@@ -1,3 +1,4 @@
1
+ import '../../../style.css';
1
2
  import { SET_TAB_QUERY, CLEAR_TAG_TABS, CLEAR_TABS, DESTORY_TAG_TAB, DESTORY_TAB, SELECT_TAB, CREATE_TAB } from "../actions.js";
2
3
  const DELETE_TABS = "DELETE_TABS";
3
4
  const randomString = () => {