cloud-web-corejs 1.1.0-dev.34 → 1.1.0-dev.36

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 (35) hide show
  1. package/bin/core-resources.js +16 -0
  2. package/docs/child-app/README.md +6 -3
  3. package/docs/child-app/activiti-resources.md +63 -0
  4. package/docs/child-app/generate-prompt.md +7 -1
  5. package/docs/child-app/luckysheet-resources.md +80 -0
  6. package/docs/child-app/public-resources-plan.md +288 -0
  7. package/docs/child-app/resources-implementation.md +101 -0
  8. package/docs/child-app/tinymce-resources.md +88 -0
  9. package/docs/child-app/validation.md +4 -3
  10. package/package.json +10 -2
  11. package/resource-tools/index.js +126 -0
  12. package/src/app-bootstrap.js +7 -2
  13. package/src/components/Tinymce/dynamicLoadScript.js +51 -59
  14. package/src/components/Tinymce/index.vue +382 -339
  15. package/src/components/code-editor/index.vue +361 -343
  16. package/src/components/luckysheet/loadResources.js +64 -0
  17. package/src/components/luckysheet/view.vue +239 -210
  18. package/src/components/onlineTalk/index.vue +2 -2
  19. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +34 -3
  20. package/src/layout/components/Sidebar/default.vue +17 -16
  21. package/src/utils/chunkLoadError.js +24 -0
  22. package/src/utils/featureResources.js +57 -0
  23. package/src/views/bd/setting/form_template/mixins/list.js +7 -6
  24. package/src/views/bd/setting/form_template/mixins/list2.js +412 -411
  25. package/src/views/bd/setting/form_template/mixins/wf_list.js +431 -430
  26. package/src/views/user/form/form_template/list.vue +527 -506
  27. package/src/views/user/wf/wf_manage/wfContentDialog.vue +65 -40
  28. package/src/views/user/wf/wf_obj_config/activiti_wf.vue +134 -133
  29. package/src/views/user/wf/wf_obj_config/list.vue +747 -746
  30. package/src/views/user/wf/wf_obj_config/list_form.vue +374 -373
  31. package/templates/child-app/README.md +2 -0
  32. package/templates/child-app/core-resources.config.js +15 -0
  33. package/templates/child-app/gitignore +1 -0
  34. package/templates/child-app/package.json +5 -0
  35. package/templates/child-app/vue.config.js +2 -1
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Webpack async chunk load error helpers.
3
+ *
4
+ * Keep this module dependency-free so dialogs and route loaders can share the
5
+ * same detection without pulling UI code into a chunk.
6
+ */
7
+ export function isChunkLoadError(error) {
8
+ const name = (error && error.name) || "";
9
+ const message = (error && error.message) || String(error || "");
10
+ return (
11
+ name === "ChunkLoadError"
12
+ || /Loading (CSS )?chunk .* failed/i.test(message)
13
+ || /ChunkLoadError/i.test(message)
14
+ || /Failed to fetch dynamically imported module/i.test(message)
15
+ || /页面资源加载失败/i.test(message)
16
+ );
17
+ }
18
+
19
+ export function getChunkLoadErrorMessage(error, resourceName = "页面资源") {
20
+ if (isChunkLoadError(error)) {
21
+ return `${resourceName}加载失败,可能系统已发布新版本,请刷新页面后重试`;
22
+ }
23
+ return `${resourceName}加载失败,请稍后重试`;
24
+ }
@@ -0,0 +1,57 @@
1
+ /* global __CORE_RESOURCES__ */
2
+ // Keep unmanaged legacy applications working. Managed starters fail explicitly
3
+ // when a feature/mode was not declared, instead of issuing hidden 404 requests.
4
+ export function codeEditorResourcePath(mode) {
5
+ const config = typeof __CORE_RESOURCES__ === "undefined" ? null : __CORE_RESOURCES__;
6
+ const feature = config && config.features.codeEditor;
7
+ if (config && !feature) throw new Error("CodeEditor 未启用资源,请配置 codeEditor 并运行 npm run resources:prepare");
8
+ if (feature && feature.modes !== "*" && !feature.modes.includes(mode)) {
9
+ throw new Error(`CodeEditor 资源未包含模式 ${mode},请使用 full 配置并重新构建`);
10
+ }
11
+ return resolveResourceBase((feature && feature.basePath) || "base/ace/src-min-noconflict/");
12
+ }
13
+
14
+ export function richTextResourcePath(locale) {
15
+ const config = typeof __CORE_RESOURCES__ === "undefined" ? null : __CORE_RESOURCES__;
16
+ const feature = config && config.features.richText;
17
+ if (config && !feature) throw new Error("TinyMCE 未启用资源,请配置 richText 并运行 npm run resources:prepare");
18
+ if (feature && !feature.locales.includes(locale)) throw new Error(`TinyMCE 资源未包含语言 ${locale}`);
19
+ return resolveResourceBase((feature && feature.basePath) || "base/tinymce/");
20
+ }
21
+
22
+ export function spreadsheetResourcePath() {
23
+ const config = typeof __CORE_RESOURCES__ === "undefined" ? null : __CORE_RESOURCES__;
24
+ const feature = config && config.features.spreadsheet;
25
+ if (config && !feature) throw new Error("Luckysheet 未启用资源,请配置 spreadsheet 并运行 npm run resources:prepare");
26
+ return resolveResourceBase((feature && feature.basePath) || "luckysheet/");
27
+ }
28
+
29
+ export function workflowDesignerResourcePath() {
30
+ const config = typeof __CORE_RESOURCES__ === "undefined" ? null : __CORE_RESOURCES__;
31
+ const feature = config && config.features.workflowDesigner;
32
+ if (config && !feature) throw new Error("Activiti 未启用资源,请配置 workflowDesigner 并运行 npm run resources:prepare");
33
+ const base = resolveResourceBase((feature && feature.basePath) || "activiti-explorer/");
34
+ if (window.__POWERED_BY_QIANKUN__) {
35
+ throw new Error("Activiti 5.17 依赖真实父窗口回调,只支持主应用或非 qiankun 的同源页面");
36
+ }
37
+ return base;
38
+ }
39
+
40
+ export function workflowDesignerUrl({ wfType, serviceId, modelId, baseApi }) {
41
+ const resourceBase = workflowDesignerResourcePath();
42
+ window.sysParamForWf = {
43
+ webPrefix: new URL("../", resourceBase).href.replace(/\/$/, ""),
44
+ baseApi,
45
+ };
46
+ const url = new URL("modeler.html", resourceBase);
47
+ url.searchParams.set("wfType", wfType);
48
+ url.searchParams.set("serviceId", serviceId);
49
+ url.searchParams.set("modelId", modelId);
50
+ return url.href;
51
+ }
52
+
53
+ function resolveResourceBase(relative) {
54
+ const base = window.__POWERED_BY_QIANKUN__ && window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__
55
+ ? window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ : (window.WEB_PREFIX || "") + "/";
56
+ return new URL(relative, new URL(base, window.location.href)).href;
57
+ }
@@ -24,6 +24,7 @@ import {
24
24
  getDesignerLayoutType,
25
25
  isH5FormTemplate,
26
26
  } from "@base/views/bd/setting/form_template/formTemplateType.js";
27
+ import { workflowDesignerUrl } from "@base/utils/featureResources";
27
28
 
28
29
  let modules = {};
29
30
  modules = {
@@ -546,12 +547,12 @@ modules = {
546
547
  openWfDesignDialog(actModelId) {
547
548
  //wfType 0:单据流程,1:场景流程
548
549
  let serviceId = this.currentRow.serviceName;
549
- this.wfUrl =
550
- WEB_PREFIX +
551
- "/activiti-explorer/modeler.html?wfType=0&serviceId=" +
552
- serviceId +
553
- "&modelId=" +
554
- actModelId;
550
+ this.wfUrl = workflowDesignerUrl({
551
+ wfType: 0,
552
+ serviceId,
553
+ modelId: actModelId,
554
+ baseApi: process.env.VUE_APP_BASE_API,
555
+ });
555
556
  this.dialogActiveName = "first";
556
557
  this.showWfDialog = true;
557
558
  },