ecinc-cloud-mappaio 9.6.186 → 9.7.1

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/index.js CHANGED
@@ -1,12 +1,20 @@
1
- // 导入单个组件
1
+ // =============================================================
2
+ // 移动端整合包:核心组件同步注册 + 重型组件异步全局注册(chunk 级按需加载)
3
+ // 业务模板可直接使用 <RichtextEditor /> <PdfTools /> <BodyFile /> 等全局组件
4
+ // 首次渲染时才下载对应 chunk
5
+ // =============================================================
6
+
2
7
  import $lang from './lang/index'
3
8
  import app from '../../common/app/index'
4
9
  import auth from '../../common/auth/index'
5
10
  import eventBus from '../../common/eventBus/index'
6
11
  import user from '../../common/user/index'
7
12
 
8
- import wfengine from '../../ecwflow/wfengine/index'
13
+ import $hequest from '../../common/request/index'
14
+ import $store from '../../common/store/index'
15
+ import $webSocket from '../../common/websocket/index'
9
16
 
17
+ // ---------- 核心组件(首屏必需,install 时同步注册) ----------
10
18
  import Building from '../../ecmapp/Building/index'
11
19
  import FooterButtonGroup from '../../ecmapp/FooterButtonGroup/index'
12
20
  import FloatButtonGroup from '../../ecmapp/FloatButtonGroup/index'
@@ -15,25 +23,52 @@ import WV from '../../ecmapp/NativeWebView/index'
15
23
  import SelectDialog from '../../ecmapp/SelectDialog/index'
16
24
  import DataTable from '../../ecmapp/DataTable/index'
17
25
  import InnerTable from '../../ecmapp/InnerTable/index'
18
- import PdfTools from '../../ecmapp/PdfTools'
19
26
  import { Basicform, DatetimeField, FileField, InputField, SelectField, SwitchField, TextareaField, IdeaField } from '../../ecmapp/Basicform/index'
27
+ import DatetimeRange from '../../ecmapp/DatetimeRange/index'
20
28
  import WfStatus from '../../ecmapp/WfStatus/index'
21
- import { Attachment, BodyFile, HandleIdea, SelectOuterDeputy, SubmitHandle, SubmitDialog, ShortcutProcessing, WfNodelogList, WriteToReadIdea } from '../../ecmapp/Wflowform'
22
- import RichtextEditor from '../../ecmapp/RichtextEditor/index'
29
+
23
30
  import '../../common/directive/index'
24
31
  import '../../ecmapp/Directive/index'
25
32
 
26
- // 以数组的结构保存组件,便于遍历
27
- const components = [app, auth, eventBus, user, Building, Basicform, DatetimeField, FileField, InputField, SelectField, SwitchField, TextareaField, IdeaField, DataTable, InnerTable, FooterButtonGroup, FloatButtonGroup, WV, SelectDialog, WfStatus, wfengine, Attachment, BodyFile, HandleIdea, SelectOuterDeputy, SubmitHandle, SubmitDialog, ShortcutProcessing, WfNodelogList, WriteToReadIdea, PopupDialog, PdfTools, RichtextEditor]
33
+ const components = [app, auth, eventBus, user, Building, Basicform, DatetimeField, FileField, InputField, SelectField, SwitchField, TextareaField, IdeaField, DatetimeRange, DataTable, InnerTable, FooterButtonGroup, FloatButtonGroup, WV, SelectDialog, WfStatus, PopupDialog]
34
+
35
+ // ---------- 重型组件异步全局注册清单(chunk 级按需加载) ----------
36
+ const asyncComponents = [
37
+ // ========== ecmapp 业务功能 ==========
38
+ ['PdfTools', () => import(/* webpackChunkName: "m-pdf" */ '../../ecmapp/PdfTools')],
39
+ ['RichtextEditor', () => import(/* webpackChunkName: "m-richtext" */ '../../ecmapp/RichtextEditor/index')],
40
+
41
+ // ========== ecmapp/Wflowform 工作流表单子组件 → chunk: m-wflow-form ==========
42
+ ['Attachment', () => import(/* webpackChunkName: "m-wflow-form" */ '../../ecmapp/Wflowform').then((m) => m.Attachment)],
43
+ ['BodyFile', () => import(/* webpackChunkName: "m-wflow-form" */ '../../ecmapp/Wflowform').then((m) => m.BodyFile)],
44
+ ['HandleIdea', () => import(/* webpackChunkName: "m-wflow-form" */ '../../ecmapp/Wflowform').then((m) => m.HandleIdea)],
45
+ ['SelectOuterDeputy', () => import(/* webpackChunkName: "m-wflow-form" */ '../../ecmapp/Wflowform').then((m) => m.SelectOuterDeputy)],
46
+ ['SubmitHandle', () => import(/* webpackChunkName: "m-wflow-form" */ '../../ecmapp/Wflowform').then((m) => m.SubmitHandle)],
47
+ ['SubmitDialog', () => import(/* webpackChunkName: "m-wflow-form" */ '../../ecmapp/Wflowform').then((m) => m.SubmitDialog)],
48
+ ['ShortcutProcessing', () => import(/* webpackChunkName: "m-wflow-form" */ '../../ecmapp/Wflowform').then((m) => m.ShortcutProcessing)],
49
+ ['WfNodelogList', () => import(/* webpackChunkName: "m-wflow-form" */ '../../ecmapp/Wflowform').then((m) => m.WfNodelogList)],
50
+ ['WriteToReadIdea', () => import(/* webpackChunkName: "m-wflow-form" */ '../../ecmapp/Wflowform').then((m) => m.WriteToReadIdea)]
51
+ ]
28
52
 
29
53
  // 定义 install 方法
30
54
  const install = function (Vue) {
31
55
  if (install.installed) return
32
56
  install.installed = true
33
- // 遍历并注册全局组件
57
+
58
+ // 1. 同步注册核心组件
34
59
  components.map((component) => {
35
60
  Vue.use(component)
36
61
  })
62
+
63
+ // 2. 异步全局注册重型组件(首次渲染时才下载 chunk)
64
+ asyncComponents.forEach(([name, factory]) => {
65
+ Vue.component(name, factory)
66
+ })
67
+
68
+ // 3. 异步加载工作流引擎插件(独立 chunk)
69
+ import(/* webpackChunkName: "m-wfengine" */ '../../ecwflow/wfengine/index').then((m) => {
70
+ Vue.use(m.default || m)
71
+ })
37
72
  }
38
73
 
39
74
  if (typeof window !== 'undefined' && window.Vue) {
@@ -42,24 +77,29 @@ if (typeof window !== 'undefined' && window.Vue) {
42
77
  setTimeout(() => {
43
78
  window.$alert = window.Vue.prototype.$dialog.alert
44
79
 
45
- Vue.prototype.$tx = lang.$tx
80
+ window.Vue.prototype.$tx = $lang.$tx
46
81
  window.$tx = $lang.$tx
47
82
  }, 0)
48
83
  }
49
84
 
50
85
  export const lang = $lang
51
-
52
- import $hequest from '../../common/request/index'
53
- import $store from '../../common/store/index'
54
- import $webSocket from '../../common/websocket/index'
55
-
56
86
  export const httpRequest = $hequest
57
87
  export const store = $store
58
88
  export const webSocket = $webSocket
59
89
 
60
90
  export default {
61
- // 导出的对象必须具备一个 install 方法
62
91
  install,
63
- // 组件列表
64
92
  ...components
65
93
  }
94
+
95
+ // =============================================================
96
+ // 兼容性 Module 工厂函数 export(路由/动态场景主动调用)
97
+ // =============================================================
98
+
99
+ // ---------- 工作流相关 ----------
100
+ export const WfengineModule = () => import(/* webpackChunkName: "m-wfengine" */ '../../ecwflow/wfengine/index')
101
+ export const WflowformModule = () => import(/* webpackChunkName: "m-wflow-form" */ '../../ecmapp/Wflowform')
102
+
103
+ // ---------- 重型功能(PDF/富文本,仅特定页面使用) ----------
104
+ export const PdfToolsModule = () => import(/* webpackChunkName: "m-pdf" */ '../../ecmapp/PdfTools')
105
+ export const RichtextEditorModule = () => import(/* webpackChunkName: "m-richtext" */ '../../ecmapp/RichtextEditor/index')