resolver-egretimp-plus 0.1.113 → 0.1.115

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 (219) hide show
  1. package/dist/h5/index.js +1 -1
  2. package/dist/theme/element/index.css +1 -1
  3. package/dist/theme/element/src/components/common.scss +4 -0
  4. package/dist/theme/element/src/components/text.scss +17 -0
  5. package/dist/web/index.js +2 -2
  6. package/package.json +1 -1
  7. package/src/analysisComponent.jsx +2 -1
  8. package/src/components/helper/table.jsx +26 -23
  9. package/src/components/packages-H5/CustomComponentCollapseH5.vue +6 -2
  10. package/src/components/packages-web/ElText.jsx +0 -1
  11. package/src/theme/element/components/common.scss +4 -0
  12. package/src/theme/element/components/text.scss +17 -0
  13. package/src-bak/analysisComponent.jsx +343 -0
  14. package/src-bak/api/builtIn.js +10 -0
  15. package/src-bak/bpm/bpmInstance.js +388 -0
  16. package/src-bak/bpm/udc-sdk-esm/cjs/impl/application.js +8 -0
  17. package/src-bak/bpm/udc-sdk-esm/cjs/impl/component.js +97 -0
  18. package/src-bak/bpm/udc-sdk-esm/cjs/impl/datasource.js +88 -0
  19. package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/index.js +3 -0
  20. package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/UdcComponent.js +76 -0
  21. package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/index.js +201 -0
  22. package/src-bak/bpm/udc-sdk-esm/cjs/impl/index.js +69 -0
  23. package/src-bak/bpm/udc-sdk-esm/cjs/impl/page.js +56 -0
  24. package/src-bak/bpm/udc-sdk-esm/cjs/impl/utils.js +76 -0
  25. package/src-bak/bpm/udc-sdk-esm/cjs/index.js +46 -0
  26. package/src-bak/bpm/udc-sdk-esm/cjs/utils.js +21 -0
  27. package/src-bak/components/childDialog/index.js +39 -0
  28. package/src-bak/components/childDialog/src/index.vue +185 -0
  29. package/src-bak/components/cmiFormItem/index.js +1 -0
  30. package/src-bak/components/cmiFormItem/src/index.vue +112 -0
  31. package/src-bak/components/confirmInstance-H5/index.js +53 -0
  32. package/src-bak/components/confirmInstance-H5/src/index.vue +54 -0
  33. package/src-bak/components/helper/FormPolyfill.jsx +25 -0
  34. package/src-bak/components/helper/calcTooltip.jsx +134 -0
  35. package/src-bak/components/helper/dock.js +141 -0
  36. package/src-bak/components/helper/eventOrchestration.js +763 -0
  37. package/src-bak/components/helper/resolver.js +163 -0
  38. package/src-bak/components/helper/table.jsx +103 -0
  39. package/src-bak/components/icons/date.vue +33 -0
  40. package/src-bak/components/icons/info.vue +62 -0
  41. package/src-bak/components/icons/loading.vue +19 -0
  42. package/src-bak/components/icons/question-filled.vue +8 -0
  43. package/src-bak/components/loading/index.js +6 -0
  44. package/src-bak/components/loading/loading.js +98 -0
  45. package/src-bak/components/loading/loading.scss +74 -0
  46. package/src-bak/components/loading/loading.vue +89 -0
  47. package/src-bak/components/loadingComponent/LoadingComponent.vue +33 -0
  48. package/src-bak/components/modal/index.js +9 -0
  49. package/src-bak/components/modal/modal.scss +195 -0
  50. package/src-bak/components/modal/modal.vue +201 -0
  51. package/src-bak/components/options/OptionsDefault.vue +47 -0
  52. package/src-bak/components/packages-H5/CmiButton.vue +120 -0
  53. package/src-bak/components/packages-H5/CmiCalendar.vue +152 -0
  54. package/src-bak/components/packages-H5/CmiCell.vue +87 -0
  55. package/src-bak/components/packages-H5/CmiCheckbox.vue +82 -0
  56. package/src-bak/components/packages-H5/CmiDatetimePicker.vue +98 -0
  57. package/src-bak/components/packages-H5/CmiDivider.vue +30 -0
  58. package/src-bak/components/packages-H5/CmiDropdownMenu.vue +58 -0
  59. package/src-bak/components/packages-H5/CmiInput.vue +69 -0
  60. package/src-bak/components/packages-H5/CmiLink.vue +28 -0
  61. package/src-bak/components/packages-H5/CmiPicker.vue +229 -0
  62. package/src-bak/components/packages-H5/CmiRadio.vue +29 -0
  63. package/src-bak/components/packages-H5/CmiSearch.vue +39 -0
  64. package/src-bak/components/packages-H5/CmiSelect.vue +84 -0
  65. package/src-bak/components/packages-H5/CustomComponentCardH5.vue +129 -0
  66. package/src-bak/components/packages-H5/CustomComponentColH5.vue +8 -0
  67. package/src-bak/components/packages-H5/CustomComponentCollapseH5.vue +137 -0
  68. package/src-bak/components/packages-H5/CustomComponentFormLayoutH5.vue +54 -0
  69. package/src-bak/components/packages-H5/CustomComponentTabPaneH5.vue +38 -0
  70. package/src-bak/components/packages-H5/CustomComponentTableH5.vue +352 -0
  71. package/src-bak/components/packages-H5/CustomComponentTabsH5.vue +170 -0
  72. package/src-bak/components/packages-web/CustomComponentCard.vue +40 -0
  73. package/src-bak/components/packages-web/CustomComponentCol.vue +66 -0
  74. package/src-bak/components/packages-web/CustomComponentCollapse.vue +164 -0
  75. package/src-bak/components/packages-web/CustomComponentCycle.vue +95 -0
  76. package/src-bak/components/packages-web/CustomComponentCycleTabPane.vue +155 -0
  77. package/src-bak/components/packages-web/CustomComponentDialog.vue +192 -0
  78. package/src-bak/components/packages-web/CustomComponentEditor.vue +50 -0
  79. package/src-bak/components/packages-web/CustomComponentFileExport.vue +60 -0
  80. package/src-bak/components/packages-web/CustomComponentFileImport.vue +60 -0
  81. package/src-bak/components/packages-web/CustomComponentFormLayout.vue +65 -0
  82. package/src-bak/components/packages-web/CustomComponentGrid.vue +29 -0
  83. package/src-bak/components/packages-web/CustomComponentGridCol.vue +29 -0
  84. package/src-bak/components/packages-web/CustomComponentInputDialog.vue +144 -0
  85. package/src-bak/components/packages-web/CustomComponentNativeTabPane.vue +84 -0
  86. package/src-bak/components/packages-web/CustomComponentPlain.vue +243 -0
  87. package/src-bak/components/packages-web/CustomComponentRow.vue +83 -0
  88. package/src-bak/components/packages-web/CustomComponentSelectEmployees.vue +203 -0
  89. package/src-bak/components/packages-web/CustomComponentSendMail.vue +62 -0
  90. package/src-bak/components/packages-web/CustomComponentSteps.vue +41 -0
  91. package/src-bak/components/packages-web/CustomComponentTabPane.vue +20 -0
  92. package/src-bak/components/packages-web/CustomComponentTable.jsx +813 -0
  93. package/src-bak/components/packages-web/CustomComponentTabs.vue +126 -0
  94. package/src-bak/components/packages-web/CustomComponentTree.vue +28 -0
  95. package/src-bak/components/packages-web/ElButton.vue +146 -0
  96. package/src-bak/components/packages-web/ElCheckbox.vue +97 -0
  97. package/src-bak/components/packages-web/ElDatePicker.vue +93 -0
  98. package/src-bak/components/packages-web/ElInput copy.jsx +393 -0
  99. package/src-bak/components/packages-web/ElInput.jsx +312 -0
  100. package/src-bak/components/packages-web/ElInputNumber.vue +81 -0
  101. package/src-bak/components/packages-web/ElPagination.vue +61 -0
  102. package/src-bak/components/packages-web/ElRadio.vue +47 -0
  103. package/src-bak/components/packages-web/ElSelect.jsx +249 -0
  104. package/src-bak/components/packages-web/ElSelect_bak.vue +155 -0
  105. package/src-bak/components/packages-web/ElText.jsx +187 -0
  106. package/src-bak/components/packages-web/ElTextaa.vue +169 -0
  107. package/src-bak/components/packages-web/ElTimePicker.vue +39 -0
  108. package/src-bak/components/patchComponents-H5.js +46 -0
  109. package/src-bak/components/patchComponents-web.js +46 -0
  110. package/src-bak/components/simpleFormItemPc/index.js +1 -0
  111. package/src-bak/components/simpleFormItemPc/src/index.vue +94 -0
  112. package/src-bak/components/table/index.ts +29 -0
  113. package/src-bak/components/table/src/composables/use-scrollbar.ts +30 -0
  114. package/src-bak/components/table/src/config.ts +256 -0
  115. package/src-bak/components/table/src/filter-panel.vue +260 -0
  116. package/src-bak/components/table/src/h-helper.ts +34 -0
  117. package/src-bak/components/table/src/layout-observer.ts +78 -0
  118. package/src-bak/components/table/src/store/current.ts +85 -0
  119. package/src-bak/components/table/src/store/expand.ts +76 -0
  120. package/src-bak/components/table/src/store/helper.ts +74 -0
  121. package/src-bak/components/table/src/store/index.ts +246 -0
  122. package/src-bak/components/table/src/store/tree.ts +230 -0
  123. package/src-bak/components/table/src/store/watcher.ts +543 -0
  124. package/src-bak/components/table/src/table/defaults.ts +402 -0
  125. package/src-bak/components/table/src/table/key-render-helper.ts +27 -0
  126. package/src-bak/components/table/src/table/style-helper.ts +378 -0
  127. package/src-bak/components/table/src/table/utils-helper.ts +47 -0
  128. package/src-bak/components/table/src/table-body/defaults.ts +52 -0
  129. package/src-bak/components/table/src/table-body/events-helper.ts +203 -0
  130. package/src-bak/components/table/src/table-body/index.ts +119 -0
  131. package/src-bak/components/table/src/table-body/render-helper.ts +283 -0
  132. package/src-bak/components/table/src/table-body/styles-helper.ts +164 -0
  133. package/src-bak/components/table/src/table-column/defaults.ts +237 -0
  134. package/src-bak/components/table/src/table-column/index.ts +202 -0
  135. package/src-bak/components/table/src/table-column/render-helper.ts +214 -0
  136. package/src-bak/components/table/src/table-column/watcher-helper.ts +88 -0
  137. package/src-bak/components/table/src/table-footer/index.ts +128 -0
  138. package/src-bak/components/table/src/table-footer/mapState-helper.ts +33 -0
  139. package/src-bak/components/table/src/table-footer/style-helper.ts +51 -0
  140. package/src-bak/components/table/src/table-header/event-helper.ts +213 -0
  141. package/src-bak/components/table/src/table-header/index.ts +244 -0
  142. package/src-bak/components/table/src/table-header/style.helper.ts +119 -0
  143. package/src-bak/components/table/src/table-header/utils-helper.ts +94 -0
  144. package/src-bak/components/table/src/table-layout.ts +259 -0
  145. package/src-bak/components/table/src/table.vue +389 -0
  146. package/src-bak/components/table/src/tableColumn.ts +3 -0
  147. package/src-bak/components/table/src/tokens.ts +5 -0
  148. package/src-bak/components/table/src/util.ts +521 -0
  149. package/src-bak/components/table/style/css.ts +5 -0
  150. package/src-bak/components/table/style/index.ts +5 -0
  151. package/src-bak/components/tabs/index.js +8 -0
  152. package/src-bak/components/tabs/src/constants.js +23 -0
  153. package/src-bak/components/tabs/src/tab-bar.js +8 -0
  154. package/src-bak/components/tabs/src/tab-bar.vue +92 -0
  155. package/src-bak/components/tabs/src/tab-nav.jsx +424 -0
  156. package/src-bak/components/tabs/src/tab-pane.js +16 -0
  157. package/src-bak/components/tabs/src/tab-pane.vue +80 -0
  158. package/src-bak/components/tabs/src/tabs.jsx +223 -0
  159. package/src-bak/components/tabs/style/css.js +2 -0
  160. package/src-bak/components/tabs/style/index.js +2 -0
  161. package/src-bak/components/thirdPartyFrame/index.js +32 -0
  162. package/src-bak/components/thirdPartyFrame/src/ThirdPartyFrame.vue +125 -0
  163. package/src-bak/enums/index.js +16 -0
  164. package/src-bak/hooks/configLoad.js +45 -0
  165. package/src-bak/hooks/index.js +189 -0
  166. package/src-bak/hooks/mock.js +6960 -0
  167. package/src-bak/hooks/pageConfig.js +127 -0
  168. package/src-bak/index.jsx +440 -0
  169. package/src-bak/renderer.jsx +77 -0
  170. package/src-bak/resolver-H5.vue +88 -0
  171. package/src-bak/resolver-common.vue +129 -0
  172. package/src-bak/resolver-web.vue +91 -0
  173. package/src-bak/rules/eventsSupplement.js +573 -0
  174. package/src-bak/rules/parseCondition.js +378 -0
  175. package/src-bak/rules/ruleUtils.js +273 -0
  176. package/src-bak/rules/rulesDriver.js +118 -0
  177. package/src-bak/rulesImp/events.js +588 -0
  178. package/src-bak/rulesImp/index.js +33 -0
  179. package/src-bak/rulesImp/ruleInstance.js +231 -0
  180. package/src-bak/rulesImp/ruleUtils.js +124 -0
  181. package/src-bak/theme/element/components/button.scss +122 -0
  182. package/src-bak/theme/element/components/card.scss +8 -0
  183. package/src-bak/theme/element/components/checkbox.scss +19 -0
  184. package/src-bak/theme/element/components/collapse.scss +174 -0
  185. package/src-bak/theme/element/components/common.scss +30 -0
  186. package/src-bak/theme/element/components/cycle.scss +0 -0
  187. package/src-bak/theme/element/components/date.scss +13 -0
  188. package/src-bak/theme/element/components/dialog.scss +44 -0
  189. package/src-bak/theme/element/components/form.scss +104 -0
  190. package/src-bak/theme/element/components/index.scss +55 -0
  191. package/src-bak/theme/element/components/input.scss +36 -0
  192. package/src-bak/theme/element/components/message.scss +48 -0
  193. package/src-bak/theme/element/components/pagination.scss +47 -0
  194. package/src-bak/theme/element/components/popper.scss +3 -0
  195. package/src-bak/theme/element/components/radio.scss +40 -0
  196. package/src-bak/theme/element/components/scrollbar.scss +14 -0
  197. package/src-bak/theme/element/components/select.scss +82 -0
  198. package/src-bak/theme/element/components/steps.scss +6 -0
  199. package/{src/components/styles/CustomComponenTable.scss → src-bak/theme/element/components/table.scss} +90 -13
  200. package/src-bak/theme/element/components/tabs.scss +128 -0
  201. package/src-bak/theme/element/components/tag.scss +6 -0
  202. package/{src/components/styles → src-bak/theme/element/components}/text.scss +3 -3
  203. package/src-bak/theme/element/components/textarea.scss +3 -0
  204. package/src-bak/theme/element/components/tree.scss +0 -0
  205. package/src-bak/theme/element/index.scss +55 -0
  206. package/src-bak/utils/cipher.js +141 -0
  207. package/src-bak/utils/common.js +664 -0
  208. package/src-bak/utils/const.js +259 -0
  209. package/src-bak/utils/defaultVal.js +92 -0
  210. package/src-bak/utils/dom.js +36 -0
  211. package/src-bak/utils/format.js +19 -0
  212. package/src-bak/utils/index.js +4 -0
  213. package/src-bak/utils/is.js +74 -0
  214. package/src-bak/utils/loadModule.js +75 -0
  215. package/src-bak/utils/preserveFunc.js +33 -0
  216. package/src-bak/utils/render.jsx +1138 -0
  217. package/src-bak/utils/request.js +136 -0
  218. package/src-bak/utils/respone.js +70 -0
  219. package/src-bak/utils/valid.js +89 -0
@@ -0,0 +1,127 @@
1
+ import { parsePageConfig } from "../utils"
2
+ import { ref } from 'vue'
3
+ import { buildInRequest } from "../utils/request"
4
+ import { GET_SYS_PARAM_CACHE, QUERY_PAGE_CONFIG_DATA } from "../api/builtIn"
5
+ import { normalPageConfigs } from "../components/helper/resolver"
6
+ import mock from "./mock"
7
+ import { resultToast } from "../utils/respone"
8
+
9
+ export function usePageConfig() {
10
+ const pageConfigRef = ref(null)
11
+ const hireRelatMapRulesRef = ref(null)
12
+ const mapCompRef = ref(null)
13
+ function initPageConfig({
14
+ requestTraceId,
15
+ dialogReq,
16
+ mode,
17
+ route,
18
+ router,
19
+ config,
20
+ lang,
21
+ polyfillConfigs,
22
+ instance,
23
+ isH5,
24
+ rootValue,
25
+ parentRootValue,
26
+ parentDynamicMapComp,
27
+ axiosInstance,
28
+ messageInstance,
29
+ messageCb
30
+ }) {
31
+ const { pageConfig, mapComp, hireRelatMapRules } = parsePageConfig({
32
+ requestTraceId,
33
+ dialogReq,
34
+ mode,
35
+ route,
36
+ router,
37
+ config, lang, polyfillConfigs, instance, isH5,
38
+ rootValue,
39
+ parentRootValue,
40
+ parentDynamicMapComp,
41
+ axiosInstance,
42
+ messageInstance,
43
+ messageCb
44
+ })
45
+ pageConfigRef.value = pageConfig
46
+ hireRelatMapRulesRef.value = hireRelatMapRules
47
+ mapCompRef.value = mapComp
48
+ }
49
+ return {
50
+ mapCompRef,
51
+ initPageConfig,
52
+ pageConfigRef,
53
+ hireRelatMapRulesRef,
54
+ }
55
+ }
56
+
57
+ export function useBuildInData({ messageInstance, loadingInstance, requestTraceId }) {
58
+ const pageConfig = ref(null)
59
+ function getPageConfig(reqData, { configCb, selectsCb, selectPolyReq}) {
60
+ if (loadingInstance.start && typeof loadingInstance.start === 'function') {
61
+ loadingInstance.start()
62
+ } else if (loadingInstance.show && typeof loadingInstance.show === 'function') {
63
+ loadingInstance.show()
64
+ }
65
+ buildInRequest(QUERY_PAGE_CONFIG_DATA, {...reqData, requestTraceId}).then(ret => {
66
+ if (resultToast(ret.data, messageInstance, { noSuccessIip: true })) {
67
+ // pageConfig.value = normalPageConfigs(mock)
68
+ pageConfig.value = normalPageConfigs(ret.data.result)
69
+ try {
70
+ configCb && configCb(pageConfig.value)
71
+ } catch (error) {
72
+ console.error(error)
73
+ }
74
+ getSelects({
75
+ tenantId: ret.data.result?.pmBusinessIdentityVO?.tenantId,
76
+ ...(selectPolyReq || {})
77
+ }, selectsCb)
78
+ return
79
+ } else {
80
+ if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
81
+ loadingInstance.finish()
82
+ } else if (loadingInstance.hide && typeof loadingInstance.hide === 'function') {
83
+ loadingInstance.hide()
84
+ }
85
+ }
86
+ }).catch(() => {
87
+ if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
88
+ loadingInstance.finish()
89
+ } else if (loadingInstance.hide && typeof loadingInstance.hide === 'function') {
90
+ loadingInstance.hide()
91
+ }
92
+ })
93
+ }
94
+ const selects = ref({})
95
+ function getSelects(req, selectsCb) {
96
+ buildInRequest(GET_SYS_PARAM_CACHE, {
97
+ ...(req || {})
98
+ }).then(ret => {
99
+ if (resultToast(ret.data, messageInstance, { noSuccessIip: true })) {
100
+ selects.value = JSON.parse(ret.data.result || '{}')
101
+ try {
102
+ selectsCb && selectsCb(selects.value)
103
+ } catch (error) {
104
+ console.error(error)
105
+ }
106
+ return
107
+ } else {
108
+ if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
109
+ loadingInstance.finish()
110
+ } else if (loadingInstance.hide && typeof loadingInstance.hide === 'function') {
111
+ loadingInstance.hide()
112
+ }
113
+ }
114
+ }).finally(() => {
115
+ if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
116
+ loadingInstance.finish()
117
+ } else if (loadingInstance.hide && typeof loadingInstance.hide === 'function') {
118
+ loadingInstance.hide()
119
+ }
120
+ })
121
+ }
122
+ return {
123
+ pageConfig,
124
+ getPageConfig,
125
+ selects
126
+ }
127
+ }
@@ -0,0 +1,440 @@
1
+ import { provide, toRef, watch, computed, ref, defineExpose, reactive, getCurrentInstance, toRaw, onMounted } from "vue"
2
+ import Renderer from './renderer.jsx'
3
+ // import './style/index.scss'
4
+ import { usePageConfig } from './hooks/pageConfig'
5
+ import { toValidate } from './utils/valid.js'
6
+ import { MODE } from "./utils/const.js"
7
+ import { generateRequester } from "./utils/request.js"
8
+ import { executeLoadServices, resetConfigEventInit } from "./components/helper/resolver.js"
9
+ import { createEmptyCopy, deepMerge } from "./utils/index.js"
10
+ import { initBpm, SUBMIT_TYPE, bpmInstance } from "./bpm/bpmInstance.js"
11
+ // import { RuleExecuter } from "./rulesImp/index.js"
12
+ export default {
13
+ name: 'Resolver',
14
+ props: {
15
+ // 传入的自定义组件
16
+ components: {
17
+ type: Object,
18
+ default: () => ({})
19
+ },
20
+ // 当前模式;操作:operate(默认)、详情:detail、日志:log
21
+ mode: {
22
+ type: String,
23
+ default: MODE.OPERATE, // 操作:operate(默认)、详情:detail、日志:log
24
+ },
25
+ config: {
26
+ type: [Object],
27
+ default: () => null
28
+ },
29
+ // 下拉所需要用到的枚举值
30
+ selects: {
31
+ type: Object,
32
+ default: () => ({})
33
+ },
34
+ // 这个组件通过v-model进行数据的绑定
35
+ modelValue: {
36
+ // type: [String, Number, Object],
37
+ default: null
38
+ },
39
+ // 是否可以开始执行规则初始化
40
+ dataLoad: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ // 按钮的工作集合
45
+ buttonActions: {
46
+ type: Object,
47
+ default: () => ({})
48
+ },
49
+ lang: {
50
+ type: String,
51
+ default: 'zh'
52
+ },
53
+ // 请求方法的实列
54
+ axiosInstance: {
55
+ type: [Object, Function],
56
+ default: () => null
57
+ },
58
+ // config的额外属性配置
59
+ polyfillConfigs: {
60
+ type: Object,
61
+ default: () => ({})
62
+ },
63
+ // 输入弹框组件中弹框中的组件
64
+ dialogComponents: {
65
+ type: Object,
66
+ default: () => ({})
67
+ },
68
+ axiosConfig: {
69
+ type: Object,
70
+ default: null
71
+ },
72
+ isH5: {
73
+ type: Boolean,
74
+ default: false
75
+ },
76
+ getNativeComps: {
77
+ type: Function,
78
+ default: () => ({composeComponents: {}})
79
+ },
80
+ loadingInstance: {
81
+ type: [Object, Function],
82
+ default: () => null
83
+ },
84
+ messageInstance: {
85
+ type: [Object, Function],
86
+ default: () => null
87
+ },
88
+ copyModal: {
89
+ type: [Object, Function],
90
+ default: () => null
91
+ },
92
+ openChildDialogInstance: {
93
+ type: [Function],
94
+ default: () => {
95
+ return () => {}
96
+ }
97
+ },
98
+ confirmInstance: {
99
+ type: [Object, Function],
100
+ default: () => {
101
+ return () => {}
102
+ }
103
+ },
104
+ loadEvnetsReq: {
105
+ type: Object,
106
+ default: () => ({})
107
+ },
108
+ loadEventsAfter: {
109
+ type: Function,
110
+ default: null
111
+ },
112
+ loadEventsBefore: {
113
+ type: Function,
114
+ default: null
115
+ },
116
+ // 在弹框里面的页面,通过弹窗传染的请求数据
117
+ dialogReq: {
118
+ type: Object,
119
+ default: () => ({})
120
+ },
121
+ // 加载服务中businessIdentity的额外参数
122
+ businessIdentityReqData: {
123
+ type: Object,
124
+ default: () => ({})
125
+ },
126
+ // 如果当前页面是弹框,这个是父页面传入的根数据
127
+ parentRootValue: {
128
+ type: Object,
129
+ default: () => ({})
130
+ },
131
+ // 如果当前页面是弹框,这个是父页面传入的配置
132
+ parentDynamicMapComp: {
133
+ type: Object,
134
+ default: () => ({})
135
+ },
136
+ // 如果当前页面是弹框,这个是父页面已经选中的数据,控制表格选中的禁用
137
+ selectionsObj: {
138
+ type: Object,
139
+ // selections
140
+ // primaryKeys
141
+ default: () => ({})
142
+ },
143
+ // 提示语的回调
144
+ messageCb: Function,
145
+ requestTraceId: {
146
+ type: String,
147
+ },
148
+ // 加载上传自定义组件需要的模块集合
149
+ loadModuleCache: {
150
+ type: Object,
151
+ default: () => ({})
152
+ },
153
+ // 外部传入,给所有的内置接口的额外参数
154
+ builtPolyfillReq: {
155
+ type: Object,
156
+ default: () => ({})
157
+ },
158
+ // 是否开启致远功能
159
+ openBpm: {
160
+ type: Boolean,
161
+ default: false
162
+ },
163
+ bpmMessage: {
164
+ // 传递给致远的参数
165
+ type: [Object, Function],
166
+ default: {}
167
+ },
168
+ bpmSubmitBtn: {
169
+ // 配置了保存服务的按钮;例如 a->b->c
170
+ type: [String],
171
+ default: ''
172
+ },
173
+ bpmActions: {
174
+ type: [Object],
175
+ default: {
176
+ // [SUBMIT_TYPE.SEND]: {
177
+ // formAction, // 提交为GET_FORM_DATA 时候的 动作
178
+ // postMessageData, // 传递的参数
179
+ // successAction // 提交为PROCESS_ACTION_SUCCESS 时候的 动作
180
+ // }
181
+ }
182
+ },
183
+ bpmConfigs: {
184
+ type: Object,
185
+ default: {
186
+ // getDetailReq, // 保存成功之后获取详情传递的数据
187
+ // customValidate, // 提交的时候需要的 额外的校验
188
+ // saveValidate, // 保存 时候的校验
189
+ // saveAfter // 保存成功之后的回调
190
+ }
191
+ },
192
+ bpmBtns: {
193
+ type: Array,
194
+ default: [],
195
+ },
196
+ bpmBtnPosition: {
197
+ type: Number,
198
+ default: 3
199
+ },
200
+ showCopyModal: {
201
+ // 传递给致远的参数
202
+ type: [Function],
203
+ }
204
+ },
205
+ emits: ['update:modelValue', 'rootStoreChange'],
206
+ setup(props, { emit, attrs, expose }) {
207
+ const configsSet = new Set()
208
+ const dynamicMapComp = reactive({})
209
+ const instance = getCurrentInstance()
210
+ const ruleExecuter = null
211
+ // const ruleExecuter = new RuleExecuter()
212
+ const rootStore = reactive({})
213
+ const nativeDataLoad = ref(false)
214
+ // const router = useRouter()
215
+ // const route = useRoute()
216
+ const router = {}
217
+ const route = {}
218
+ const axiosInstance = ref(props.axiosInstance)
219
+ watch(() => {
220
+ return props.axiosConfig
221
+ }, (val) => {
222
+ if (val) {
223
+ axiosInstance.value = generateRequester(val)
224
+ } else {
225
+ axiosInstance.value = props.axiosInstance
226
+ }
227
+ }, {
228
+ immediate: true
229
+ })
230
+ watch(() => rootStore, () => {
231
+ emit('rootStoreChange', rootStore)
232
+ }, { immediate: true, deep: true })
233
+
234
+ const dataLoad = computed(() => {
235
+ return props.dataLoad || nativeDataLoad.value
236
+ })
237
+ const { initPageConfig, pageConfigRef, mapCompRef, hireRelatMapRulesRef } = usePageConfig()
238
+ function toExecuteLoadServices(
239
+ clearFlag,
240
+ alongLoad,
241
+ configs
242
+ ) {
243
+ // 触发加载事件执行
244
+ const oldNativeDataload = nativeDataLoad.value
245
+ nativeDataLoad.value = false
246
+ executeLoadServices(
247
+ props.config?.pmPageServiceMapVOList || props.config?.lcpPageServiceMapVOList || [],
248
+ {
249
+ alongLoad,
250
+ requestTraceId: props.requestTraceId,
251
+ messageInstance: toRef(props, 'messageInstance'),
252
+ businessIdentityReqData: props.businessIdentityReqData,
253
+ axiosInstance,
254
+ reqData: {...props.loadEvnetsReq, ...props.dialogReq, ...(configs?.params || {})},
255
+ notLoadCb: () => {
256
+ nativeDataLoad.value = true
257
+ },
258
+ loadEventsBefore: ({
259
+ reqConfig,
260
+ }) => {
261
+ if (props.loadEventsBefore && typeof props.loadEventsBefore === 'function') {
262
+ return props.loadEventsBefore({reqConfig})
263
+ }
264
+ },
265
+ respCb: (result) => {
266
+ let val = result
267
+ if (props.loadEventsAfter && typeof props.loadEventsAfter === 'function') {
268
+ val = props.loadEventsAfter(val)
269
+ }
270
+ if (!clearFlag) {
271
+ val = deepMerge(props.modelValue, result, 'replace')
272
+ val = {...val}
273
+ }
274
+
275
+ if (oldNativeDataload) {
276
+ resetConfigEventInit(dynamicMapComp)
277
+ const emptyObj = createEmptyCopy(val)
278
+ emit('update:modelValue', emptyObj)
279
+ setTimeout(() => {
280
+ nativeDataLoad.value = true
281
+ emit('update:modelValue', val)
282
+ emit('loadEvnetsCompleted', result)
283
+ }, 20);
284
+ } else {
285
+ nativeDataLoad.value = true
286
+ emit('update:modelValue', val)
287
+ emit('loadEvnetsCompleted', result)
288
+ }
289
+ }
290
+ }
291
+ )
292
+ }
293
+ initPageConfig({
294
+ requestTraceId: props.requestTraceId,
295
+ dialogReq: props.dialogReq,
296
+ mode: props.mode,
297
+ router,
298
+ route,
299
+ config: props.config,
300
+ lang: props.lang,
301
+ polyfillConfigs: props.polyfillConfigs,
302
+ instance,
303
+ isH5: props.isH5,
304
+ rootValue: toRef(props, 'modelValue'),
305
+ parentRootValue: props.parentRootValue,
306
+ parentDynamicMapComp: props.parentDynamicMapComp,
307
+ axiosInstance: axiosInstance.value,
308
+ messageInstance: props.messageInstance,
309
+ messageCb: props.messageCb
310
+ })
311
+ toExecuteLoadServices()
312
+
313
+ watch(toRef(props, 'config'), () => {
314
+ initPageConfig({
315
+ requestTraceId: props.requestTraceId,
316
+ dialogReq: props.dialogReq,
317
+ mode: props.mode,
318
+ router,
319
+ route,
320
+ config: props.config,
321
+ lang: props.lang,
322
+ polyfillConfigs: props.polyfillConfigs,
323
+ instance,
324
+ isH5: props.isH5,
325
+ rootValue: toRef(props, 'modelValue'),
326
+ parentRootValue: props.parentRootValue,
327
+ parentDynamicMapComp: props.parentDynamicMapComp,
328
+ axiosInstance: axiosInstance.value,
329
+ messageInstance: props.messageInstance,
330
+ messageCb: props.messageCb
331
+ })
332
+ toExecuteLoadServices()
333
+ })
334
+
335
+ provide('_configsSet', configsSet)
336
+ provide('_builtPolyfillReq', props.builtPolyfillReq)
337
+ provide('_loadModuleCache', props.loadModuleCache)
338
+ provide('_ruleExecuter', ruleExecuter)
339
+ provide('_toExecuteLoadServices', toExecuteLoadServices)
340
+ provide('_dialogReq', props.dialogReq)
341
+ provide('_messageCb', props.messageCb)
342
+ provide('_rootStore', rootStore)
343
+ provide('_openChildDialogInstance', toRef(props, 'openChildDialogInstance'))
344
+ provide('_confirmInstance', toRef(props, 'confirmInstance'))
345
+ provide('_messageInstance', toRef(props, 'messageInstance'))
346
+ provide('_loadingInstance', toRef(props, 'loadingInstance'))
347
+ provide('_getNativeComps', props.getNativeComps)
348
+ provide('pageConfig', pageConfigRef)
349
+ provide('_axiosInstance', axiosInstance)
350
+ provide('dynamicMapComp', dynamicMapComp)
351
+ provide('_mapComp', mapCompRef)
352
+ provide('hireRelatMapRules', hireRelatMapRulesRef) // 组件对应的规则集合
353
+
354
+ provide('buttonActions', props.buttonActions)
355
+ provide('components', toRef(props, 'components'))
356
+ provide('selects', toRef(props, 'selects'))
357
+ provide('_rootInstance', instance)
358
+ provide('rootValue', computed({
359
+ get() {
360
+ return props.modelValue
361
+ },
362
+ set(val) {
363
+ emit('update:modelValue', val)
364
+ }
365
+ })) // 绑定进入的跟数据
366
+ provide('lang', toRef(props, 'lang'))
367
+ provide('dataLoad', dataLoad) // 是否可以开始执行规则初始化
368
+ provide('dialogComponents', props.dialogComponents) // 是否可以开始执行规则初始化
369
+ provide('_isH5', toRef(props, 'isH5')) // 是否是H5配置
370
+
371
+ provide('_parentRootValue', props.parentRootValue)
372
+ provide('_parentDynamicMapComp', props.parentDynamicMapComp)
373
+ provide('_selectionsObj', props.selectionsObj)
374
+ provide('_polyfillConfigs', props.polyfillConfigs)
375
+ provide('requestTraceId', toRef(props, 'requestTraceId')) // 所有渲染器调用的接口,都需要加次参数(生哥提)
376
+
377
+ const rootForm = ref(null)
378
+ provide('rootForm', rootForm)
379
+
380
+ const validate = (cb) => {
381
+ toValidate(rootForm, cb, dynamicMapComp)
382
+ }
383
+ provide('_validate', validate)
384
+ expose({
385
+ dynamicMapComp,
386
+ validate,
387
+ pageConfig: pageConfigRef,
388
+ rootForm,
389
+ getRequestTraceId: () => {
390
+ return props.requestTraceId
391
+ },
392
+ toExecuteLoadServices,
393
+ getBpmInstance() {
394
+ return bpmInstance
395
+ }
396
+ })
397
+
398
+ const modelValue = computed({
399
+ get() {
400
+ return props.modelValue
401
+ },
402
+ set(val) {
403
+ emit('update:modelValue', val)
404
+ }
405
+ })
406
+
407
+ setTimeout(() => {
408
+ if (modelValue.value?.contractTab?.tabPane4?.dictContractCard?.supplierContractInformation) {
409
+ modelValue.value.contractTab.tabPane4.dictContractCard.supplierContractInformation.mksReasonOfSupplierList.splice(1, 1)
410
+ }
411
+ debugger
412
+ }, 5000)
413
+ setInterval(() => {
414
+ console.log('=====pageConfigRef:', pageConfigRef.value)
415
+ }, 3000);
416
+ onMounted(() => {
417
+ if (props.openBpm) {
418
+ initBpm(props.bpmMessage, props.bpmActions, props.bpmConfigs, {
419
+ validate,
420
+ dynamicMapComp,
421
+ toExecuteLoadServices,
422
+ bpmSubmitBtn: props.bpmSubmitBtn,
423
+ calcShowCopyModal: props.showCopyModal, // 是否要开启刚开始保存之后弹框提示编码功能
424
+ copyModal: props.copyModal,
425
+ lang: toRef(props, 'lang'),
426
+ messageInstance: props.messageInstance,
427
+ })
428
+ bpmInstance?.insertBtn?.(props.bpmBtns, props.bpmBtnPosition)
429
+ }
430
+ })
431
+ // return () => {
432
+ // if (!pageConfigRef.value) {
433
+ // return null
434
+ // }
435
+ // return (
436
+ // <Renderer {...attrs} mode={props.mode} v-model={modelValue.value} config={pageConfigRef.value}></Renderer>
437
+ // )
438
+ // }
439
+ }
440
+ }
@@ -0,0 +1,77 @@
1
+ import { inject, ref, computed, provide, isReactive } from 'vue'
2
+ import { DISPLAY_SHOW, getComponentForConfig, generateLayoutPolyfill, isPlainObject, hasOwn, calcDisable, DISPLAY_HIDDEN } from './utils/index.js'
3
+ import AnalysisComponent from './analysisComponent.jsx'
4
+
5
+ export default {
6
+ name: 'Renderer',
7
+ inheritAttrs: false,
8
+ props: {
9
+ config: {
10
+ type: [Object, Array],
11
+ default: () => null
12
+ },
13
+ // 这个组件通过v-model进行数据的绑定
14
+ modelValue: {
15
+ // type: [String, Number, Object],
16
+ default: null
17
+ },
18
+ // 如果是表格中列的组件,会传入行数据,{row, $index}
19
+ rowScope: {
20
+ type: [Object],
21
+ default: () => null
22
+ },
23
+ // 当前模式;操作:operate(默认)、详情:detail、日志:log
24
+ mode: {
25
+ type: String,
26
+ default: '', // 操作:operate(默认)、详情:detail、日志:log
27
+ },
28
+ additionConfigs: {
29
+ type: Array,
30
+ default: () => []
31
+ },
32
+ },
33
+ emits: ['update:modelValue'],
34
+ setup(props, { emit, attrs }) {
35
+ const modelValue = computed({
36
+ get() {
37
+ return props.modelValue
38
+ },
39
+ set(val) {
40
+ emit('update:modelValue', val)
41
+ }
42
+ })
43
+ const messageInstance = inject('_messageInstance')
44
+ const getNativeComps = inject('_getNativeComps')
45
+ const loadModuleCache = inject('_loadModuleCache')
46
+ const _isH5 = inject('_isH5')
47
+ const injectMode = inject('injectMode', '')
48
+ const mode = props.mode || injectMode
49
+ provide('injectMode', mode)
50
+
51
+ const indectModeRef = inject('indectModeRef', ref(''))
52
+ let modelRef = computed(() => {
53
+ return props.mode || indectModeRef.value
54
+ })
55
+ provide('indectModeRef', modelRef)
56
+
57
+ return () => {
58
+ const configs = (Array.isArray(props.config) ? props.config : [props.config])
59
+ if (!configs) return null
60
+ if (!configs.length) return null
61
+ // 根据配置获取到对应的组件
62
+ return configs.map(config => {
63
+ if (config?.displayType == DISPLAY_HIDDEN) {
64
+ return null
65
+ }
66
+ const disabled = calcDisable(config, modelRef.value)
67
+ const component = getComponentForConfig({messageInstance: messageInstance?.value, config, disabled, getNativeComps, isH5: _isH5?.value, loadModuleCache})
68
+ if (component) {
69
+ const layoutPolyfill = generateLayoutPolyfill(config, disabled, _isH5?.value) // // 生成布局框(col)的辅助函数
70
+ return layoutPolyfill(
71
+ <AnalysisComponent additionConfigs={props.additionConfigs} key={`${config.metaId}-${config.rowIndex}`} component={component} config={config} {...attrs} mode={modelRef.value} rowScope={props.rowScope} v-model={modelValue.value}></AnalysisComponent>
72
+ )
73
+ }
74
+ })
75
+ }
76
+ }
77
+ }