cloud-web-corejs 1.1.0-dev.33 → 1.1.0-dev.35

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 (58) hide show
  1. package/README.md +38 -0
  2. package/bin/core-resources.js +16 -0
  3. package/bin/create-child-app.js +34 -0
  4. package/docs/child-app/README.md +95 -0
  5. package/docs/child-app/activiti-resources.md +63 -0
  6. package/docs/child-app/generate-prompt.md +55 -0
  7. package/docs/child-app/luckysheet-resources.md +80 -0
  8. package/docs/child-app/public-resources-plan.md +288 -0
  9. package/docs/child-app/resources-implementation.md +101 -0
  10. package/docs/child-app/tinymce-resources.md +88 -0
  11. package/docs/child-app/validation.md +34 -0
  12. package/docs/qiankun/346/216/245/345/205/245/345/215/217/350/256/256.md +298 -0
  13. package/docs/qiankun/350/257/246/346/203/205/346/211/277/350/275/275/345/255/220/345/272/224/347/224/250/345/257/271/346/216/245/346/270/205/345/215/225.md +111 -0
  14. package/package.json +18 -2
  15. package/resource-tools/index.js +126 -0
  16. package/src/app-bootstrap.js +7 -2
  17. package/src/components/Tinymce/dynamicLoadScript.js +51 -59
  18. package/src/components/Tinymce/index.vue +382 -339
  19. package/src/components/code-editor/index.vue +361 -343
  20. package/src/components/luckysheet/loadResources.js +64 -0
  21. package/src/components/luckysheet/view.vue +239 -210
  22. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +34 -3
  23. package/src/utils/featureResources.js +57 -0
  24. package/src/views/bd/setting/form_template/mixins/list.js +7 -6
  25. package/src/views/bd/setting/form_template/mixins/list2.js +412 -411
  26. package/src/views/bd/setting/form_template/mixins/wf_list.js +431 -430
  27. package/src/views/user/form/form_template/list.vue +513 -512
  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/.env +3 -0
  32. package/templates/child-app/README.md +49 -0
  33. package/templates/child-app/app.config.js +6 -0
  34. package/templates/child-app/babel.config.js +1 -0
  35. package/templates/child-app/core-resources.config.js +15 -0
  36. package/templates/child-app/gitignore +7 -0
  37. package/templates/child-app/package.json +34 -0
  38. package/templates/child-app/public/index.html +12 -0
  39. package/templates/child-app/src/assets/401_images/401.gif +0 -0
  40. package/templates/child-app/src/assets/404_images/404.png +0 -0
  41. package/templates/child-app/src/assets/404_images/404_cloud.png +0 -0
  42. package/templates/child-app/src/assets/logo.png +0 -0
  43. package/templates/child-app/src/corejsConfig.js +2 -0
  44. package/templates/child-app/src/icons/index.js +2 -0
  45. package/templates/child-app/src/icons/svg/child-demo.svg +1 -0
  46. package/templates/child-app/src/layout/index.vue +4 -0
  47. package/templates/child-app/src/main.js +5 -0
  48. package/templates/child-app/src/prefixConfig.js +13 -0
  49. package/templates/child-app/src/resources/css/login.scss +29 -0
  50. package/templates/child-app/src/resources/images/bg-login5.jpg +0 -0
  51. package/templates/child-app/src/resources/images/home-img.png +0 -0
  52. package/templates/child-app/src/router/modules/customer.js +3 -0
  53. package/templates/child-app/src/settings.js +24 -0
  54. package/templates/child-app/src/styles/app.scss +2 -0
  55. package/templates/child-app/src/views/demo/detail.vue +19 -0
  56. package/templates/child-app/src/views/demo/list.vue +38 -0
  57. package/templates/child-app/src/views/user/login/index.vue +18 -0
  58. package/templates/child-app/vue.config.js +107 -0
@@ -1,59 +1,51 @@
1
- let callbacks = []
2
-
3
- function loadedTinymce() {
4
- // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144
5
- // check is successfully downloaded script
6
- return window.tinymce
7
- }
8
-
9
- const dynamicLoadScript = (src, callback) => {
10
- const existingScript = document.getElementById(src)
11
- const cb = callback || function() {}
12
-
13
- if (!existingScript) {
14
- const script = document.createElement('script')
15
- script.src = src // src url for the third-party library being loaded.
16
- script.id = src
17
- document.body.appendChild(script)
18
- callbacks.push(cb)
19
- const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd
20
- onEnd(script)
21
- }
22
-
23
- if (existingScript && cb) {
24
- if (loadedTinymce()) {
25
- cb(null, existingScript)
26
- } else {
27
- callbacks.push(cb)
28
- }
29
- }
30
-
31
- function stdOnEnd(script) {
32
- script.onload = function() {
33
- // this.onload = null here is necessary
34
- // because even IE9 works not like others
35
- this.onerror = this.onload = null
36
- for (const cb of callbacks) {
37
- cb(null, script)
38
- }
39
- callbacks = null
40
- }
41
- script.onerror = function() {
42
- this.onerror = this.onload = null
43
- cb(new Error('Failed to load ' + src), script)
44
- }
45
- }
46
-
47
- function ieOnEnd(script) {
48
- script.onreadystatechange = function() {
49
- if (this.readyState !== 'complete' && this.readyState !== 'loaded') return
50
- this.onreadystatechange = null
51
- for (const cb of callbacks) {
52
- cb(null, script) // there is no way to catch loading errors in IE8
53
- }
54
- callbacks = null
55
- }
56
- }
57
- }
58
-
59
- export default dynamicLoadScript
1
+ // Requests are shared only within this application's module scope.
2
+ const pending = new Map();
3
+ let loadedSource = "";
4
+
5
+ export function loadTinymce(src) {
6
+ if (pending.has(src)) return pending.get(src);
7
+ if (window.tinymce) {
8
+ const expectedBase = new URL(".", src).href.replace(/\/$/, "");
9
+ const actualBase = new URL(window.tinymce.baseURL || "/", window.location.href).href.replace(/\/$/, "");
10
+ if (String(window.tinymce.majorVersion) !== "4" || String(window.tinymce.minorVersion) !== "9.2"
11
+ || (loadedSource !== src && actualBase !== expectedBase)) {
12
+ return Promise.reject(new Error(`TinyMCE 已存在不同版本或来源的全局实例,拒绝覆盖:${src}`));
13
+ }
14
+ return Promise.resolve(window.tinymce);
15
+ }
16
+ const promise = new Promise((resolve, reject) => {
17
+ const script = document.createElement("script");
18
+ script.src = src;
19
+ script.dataset.coreResource = "richText";
20
+ let settled = false;
21
+ const timer = setTimeout(() => finish(new Error(`TinyMCE 加载超时:${src}`)), 30000);
22
+ function finish(error) {
23
+ if (settled) return;
24
+ settled = true;
25
+ clearTimeout(timer);
26
+ script.onload = script.onerror = null;
27
+ if (error) {
28
+ if (script.parentNode) script.parentNode.removeChild(script);
29
+ reject(error);
30
+ } else {
31
+ loadedSource = src;
32
+ resolve(window.tinymce);
33
+ }
34
+ }
35
+ script.onload = () => {
36
+ if (!window.tinymce || String(window.tinymce.majorVersion) !== "4" || String(window.tinymce.minorVersion) !== "9.2") {
37
+ finish(new Error(`TinyMCE 脚本未提供兼容的 4.9.2 实例:${src}`));
38
+ } else finish();
39
+ };
40
+ script.onerror = () => finish(new Error(`TinyMCE 加载失败:${src}`));
41
+ document.body.appendChild(script);
42
+ });
43
+ pending.set(src, promise);
44
+ const clear = () => pending.delete(src);
45
+ promise.then(clear, clear);
46
+ return promise;
47
+ }
48
+
49
+ export default function load(src, callback) {
50
+ loadTinymce(src).then(() => callback(null), error => callback(error));
51
+ }