resolver-egretimp-plus 0.1.114 → 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.
- package/dist/h5/index.js +1 -1
- package/package.json +1 -1
- package/src/components/packages-H5/CustomComponentCollapseH5.vue +6 -2
- package/src-bak/analysisComponent.jsx +343 -0
- package/src-bak/api/builtIn.js +10 -0
- package/src-bak/bpm/bpmInstance.js +388 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/application.js +8 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/component.js +97 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/datasource.js +88 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/index.js +3 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/UdcComponent.js +76 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/iframe/udcSdkForIframe/index.js +201 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/index.js +69 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/page.js +56 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/impl/utils.js +76 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/index.js +46 -0
- package/src-bak/bpm/udc-sdk-esm/cjs/utils.js +21 -0
- package/src-bak/components/childDialog/index.js +39 -0
- package/src-bak/components/childDialog/src/index.vue +185 -0
- package/src-bak/components/cmiFormItem/index.js +1 -0
- package/src-bak/components/cmiFormItem/src/index.vue +112 -0
- package/src-bak/components/confirmInstance-H5/index.js +53 -0
- package/src-bak/components/confirmInstance-H5/src/index.vue +54 -0
- package/src-bak/components/helper/FormPolyfill.jsx +25 -0
- package/src-bak/components/helper/calcTooltip.jsx +134 -0
- package/src-bak/components/helper/dock.js +141 -0
- package/src-bak/components/helper/eventOrchestration.js +763 -0
- package/src-bak/components/helper/resolver.js +163 -0
- package/src-bak/components/helper/table.jsx +103 -0
- package/src-bak/components/icons/date.vue +33 -0
- package/src-bak/components/icons/info.vue +62 -0
- package/src-bak/components/icons/loading.vue +19 -0
- package/src-bak/components/icons/question-filled.vue +8 -0
- package/src-bak/components/loading/index.js +6 -0
- package/src-bak/components/loading/loading.js +98 -0
- package/src-bak/components/loading/loading.scss +74 -0
- package/src-bak/components/loading/loading.vue +89 -0
- package/src-bak/components/loadingComponent/LoadingComponent.vue +33 -0
- package/src-bak/components/modal/index.js +9 -0
- package/src-bak/components/modal/modal.scss +195 -0
- package/src-bak/components/modal/modal.vue +201 -0
- package/src-bak/components/options/OptionsDefault.vue +47 -0
- package/src-bak/components/packages-H5/CmiButton.vue +120 -0
- package/src-bak/components/packages-H5/CmiCalendar.vue +152 -0
- package/src-bak/components/packages-H5/CmiCell.vue +87 -0
- package/src-bak/components/packages-H5/CmiCheckbox.vue +82 -0
- package/src-bak/components/packages-H5/CmiDatetimePicker.vue +98 -0
- package/src-bak/components/packages-H5/CmiDivider.vue +30 -0
- package/src-bak/components/packages-H5/CmiDropdownMenu.vue +58 -0
- package/src-bak/components/packages-H5/CmiInput.vue +69 -0
- package/src-bak/components/packages-H5/CmiLink.vue +28 -0
- package/src-bak/components/packages-H5/CmiPicker.vue +229 -0
- package/src-bak/components/packages-H5/CmiRadio.vue +29 -0
- package/src-bak/components/packages-H5/CmiSearch.vue +39 -0
- package/src-bak/components/packages-H5/CmiSelect.vue +84 -0
- package/src-bak/components/packages-H5/CustomComponentCardH5.vue +129 -0
- package/src-bak/components/packages-H5/CustomComponentColH5.vue +8 -0
- package/src-bak/components/packages-H5/CustomComponentCollapseH5.vue +137 -0
- package/src-bak/components/packages-H5/CustomComponentFormLayoutH5.vue +54 -0
- package/src-bak/components/packages-H5/CustomComponentTabPaneH5.vue +38 -0
- package/src-bak/components/packages-H5/CustomComponentTableH5.vue +352 -0
- package/src-bak/components/packages-H5/CustomComponentTabsH5.vue +170 -0
- package/src-bak/components/packages-web/CustomComponentCard.vue +40 -0
- package/src-bak/components/packages-web/CustomComponentCol.vue +66 -0
- package/src-bak/components/packages-web/CustomComponentCollapse.vue +164 -0
- package/src-bak/components/packages-web/CustomComponentCycle.vue +95 -0
- package/src-bak/components/packages-web/CustomComponentCycleTabPane.vue +155 -0
- package/src-bak/components/packages-web/CustomComponentDialog.vue +192 -0
- package/src-bak/components/packages-web/CustomComponentEditor.vue +50 -0
- package/src-bak/components/packages-web/CustomComponentFileExport.vue +60 -0
- package/src-bak/components/packages-web/CustomComponentFileImport.vue +60 -0
- package/src-bak/components/packages-web/CustomComponentFormLayout.vue +65 -0
- package/src-bak/components/packages-web/CustomComponentGrid.vue +29 -0
- package/src-bak/components/packages-web/CustomComponentGridCol.vue +29 -0
- package/src-bak/components/packages-web/CustomComponentInputDialog.vue +144 -0
- package/src-bak/components/packages-web/CustomComponentNativeTabPane.vue +84 -0
- package/src-bak/components/packages-web/CustomComponentPlain.vue +243 -0
- package/src-bak/components/packages-web/CustomComponentRow.vue +83 -0
- package/src-bak/components/packages-web/CustomComponentSelectEmployees.vue +203 -0
- package/src-bak/components/packages-web/CustomComponentSendMail.vue +62 -0
- package/src-bak/components/packages-web/CustomComponentSteps.vue +41 -0
- package/src-bak/components/packages-web/CustomComponentTabPane.vue +20 -0
- package/src-bak/components/packages-web/CustomComponentTable.jsx +813 -0
- package/src-bak/components/packages-web/CustomComponentTabs.vue +126 -0
- package/src-bak/components/packages-web/CustomComponentTree.vue +28 -0
- package/src-bak/components/packages-web/ElButton.vue +146 -0
- package/src-bak/components/packages-web/ElCheckbox.vue +97 -0
- package/src-bak/components/packages-web/ElDatePicker.vue +93 -0
- package/src-bak/components/packages-web/ElInput copy.jsx +393 -0
- package/src-bak/components/packages-web/ElInput.jsx +312 -0
- package/src-bak/components/packages-web/ElInputNumber.vue +81 -0
- package/src-bak/components/packages-web/ElPagination.vue +61 -0
- package/src-bak/components/packages-web/ElRadio.vue +47 -0
- package/src-bak/components/packages-web/ElSelect.jsx +249 -0
- package/src-bak/components/packages-web/ElSelect_bak.vue +155 -0
- package/src-bak/components/packages-web/ElText.jsx +187 -0
- package/src-bak/components/packages-web/ElTextaa.vue +169 -0
- package/src-bak/components/packages-web/ElTimePicker.vue +39 -0
- package/src-bak/components/patchComponents-H5.js +46 -0
- package/src-bak/components/patchComponents-web.js +46 -0
- package/src-bak/components/simpleFormItemPc/index.js +1 -0
- package/src-bak/components/simpleFormItemPc/src/index.vue +94 -0
- package/src-bak/components/table/index.ts +29 -0
- package/src-bak/components/table/src/composables/use-scrollbar.ts +30 -0
- package/src-bak/components/table/src/config.ts +256 -0
- package/src-bak/components/table/src/filter-panel.vue +260 -0
- package/src-bak/components/table/src/h-helper.ts +34 -0
- package/src-bak/components/table/src/layout-observer.ts +78 -0
- package/src-bak/components/table/src/store/current.ts +85 -0
- package/src-bak/components/table/src/store/expand.ts +76 -0
- package/src-bak/components/table/src/store/helper.ts +74 -0
- package/src-bak/components/table/src/store/index.ts +246 -0
- package/src-bak/components/table/src/store/tree.ts +230 -0
- package/src-bak/components/table/src/store/watcher.ts +543 -0
- package/src-bak/components/table/src/table/defaults.ts +402 -0
- package/src-bak/components/table/src/table/key-render-helper.ts +27 -0
- package/src-bak/components/table/src/table/style-helper.ts +378 -0
- package/src-bak/components/table/src/table/utils-helper.ts +47 -0
- package/src-bak/components/table/src/table-body/defaults.ts +52 -0
- package/src-bak/components/table/src/table-body/events-helper.ts +203 -0
- package/src-bak/components/table/src/table-body/index.ts +119 -0
- package/src-bak/components/table/src/table-body/render-helper.ts +283 -0
- package/src-bak/components/table/src/table-body/styles-helper.ts +164 -0
- package/src-bak/components/table/src/table-column/defaults.ts +237 -0
- package/src-bak/components/table/src/table-column/index.ts +202 -0
- package/src-bak/components/table/src/table-column/render-helper.ts +214 -0
- package/src-bak/components/table/src/table-column/watcher-helper.ts +88 -0
- package/src-bak/components/table/src/table-footer/index.ts +128 -0
- package/src-bak/components/table/src/table-footer/mapState-helper.ts +33 -0
- package/src-bak/components/table/src/table-footer/style-helper.ts +51 -0
- package/src-bak/components/table/src/table-header/event-helper.ts +213 -0
- package/src-bak/components/table/src/table-header/index.ts +244 -0
- package/src-bak/components/table/src/table-header/style.helper.ts +119 -0
- package/src-bak/components/table/src/table-header/utils-helper.ts +94 -0
- package/src-bak/components/table/src/table-layout.ts +259 -0
- package/src-bak/components/table/src/table.vue +389 -0
- package/src-bak/components/table/src/tableColumn.ts +3 -0
- package/src-bak/components/table/src/tokens.ts +5 -0
- package/src-bak/components/table/src/util.ts +521 -0
- package/src-bak/components/table/style/css.ts +5 -0
- package/src-bak/components/table/style/index.ts +5 -0
- package/src-bak/components/tabs/index.js +8 -0
- package/src-bak/components/tabs/src/constants.js +23 -0
- package/src-bak/components/tabs/src/tab-bar.js +8 -0
- package/src-bak/components/tabs/src/tab-bar.vue +92 -0
- package/src-bak/components/tabs/src/tab-nav.jsx +424 -0
- package/src-bak/components/tabs/src/tab-pane.js +16 -0
- package/src-bak/components/tabs/src/tab-pane.vue +80 -0
- package/src-bak/components/tabs/src/tabs.jsx +223 -0
- package/src-bak/components/tabs/style/css.js +2 -0
- package/src-bak/components/tabs/style/index.js +2 -0
- package/src-bak/components/thirdPartyFrame/index.js +32 -0
- package/src-bak/components/thirdPartyFrame/src/ThirdPartyFrame.vue +125 -0
- package/src-bak/enums/index.js +16 -0
- package/src-bak/hooks/configLoad.js +45 -0
- package/src-bak/hooks/index.js +189 -0
- package/src-bak/hooks/mock.js +6960 -0
- package/src-bak/hooks/pageConfig.js +127 -0
- package/src-bak/index.jsx +440 -0
- package/src-bak/renderer.jsx +77 -0
- package/src-bak/resolver-H5.vue +88 -0
- package/src-bak/resolver-common.vue +129 -0
- package/src-bak/resolver-web.vue +91 -0
- package/src-bak/rules/eventsSupplement.js +573 -0
- package/src-bak/rules/parseCondition.js +378 -0
- package/src-bak/rules/ruleUtils.js +273 -0
- package/src-bak/rules/rulesDriver.js +118 -0
- package/src-bak/rulesImp/events.js +588 -0
- package/src-bak/rulesImp/index.js +33 -0
- package/src-bak/rulesImp/ruleInstance.js +231 -0
- package/src-bak/rulesImp/ruleUtils.js +124 -0
- package/src-bak/theme/element/components/button.scss +122 -0
- package/src-bak/theme/element/components/card.scss +8 -0
- package/src-bak/theme/element/components/checkbox.scss +19 -0
- package/src-bak/theme/element/components/collapse.scss +174 -0
- package/src-bak/theme/element/components/common.scss +30 -0
- package/src-bak/theme/element/components/cycle.scss +0 -0
- package/src-bak/theme/element/components/date.scss +13 -0
- package/src-bak/theme/element/components/dialog.scss +44 -0
- package/src-bak/theme/element/components/form.scss +104 -0
- package/src-bak/theme/element/components/index.scss +55 -0
- package/src-bak/theme/element/components/input.scss +36 -0
- package/src-bak/theme/element/components/message.scss +48 -0
- package/src-bak/theme/element/components/pagination.scss +47 -0
- package/src-bak/theme/element/components/popper.scss +3 -0
- package/src-bak/theme/element/components/radio.scss +40 -0
- package/src-bak/theme/element/components/scrollbar.scss +14 -0
- package/src-bak/theme/element/components/select.scss +82 -0
- package/src-bak/theme/element/components/steps.scss +6 -0
- package/src-bak/theme/element/components/table.scss +218 -0
- package/src-bak/theme/element/components/tabs.scss +128 -0
- package/src-bak/theme/element/components/tag.scss +6 -0
- package/src-bak/theme/element/components/text.scss +20 -0
- package/src-bak/theme/element/components/textarea.scss +3 -0
- package/src-bak/theme/element/components/tree.scss +0 -0
- package/src-bak/theme/element/index.scss +55 -0
- package/src-bak/utils/cipher.js +141 -0
- package/src-bak/utils/common.js +664 -0
- package/src-bak/utils/const.js +259 -0
- package/src-bak/utils/defaultVal.js +92 -0
- package/src-bak/utils/dom.js +36 -0
- package/src-bak/utils/format.js +19 -0
- package/src-bak/utils/index.js +4 -0
- package/src-bak/utils/is.js +74 -0
- package/src-bak/utils/loadModule.js +75 -0
- package/src-bak/utils/preserveFunc.js +33 -0
- package/src-bak/utils/render.jsx +1138 -0
- package/src-bak/utils/request.js +136 -0
- package/src-bak/utils/respone.js +70 -0
- package/src-bak/utils/valid.js +89 -0
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
import { isArray, isHasVal, isNull, isUndefined } from "../../utils/is"
|
|
2
|
+
import { DATA_VALID_RULE_EXECUTE } from "../../api/builtIn"
|
|
3
|
+
import { getRelateConfigKeys } from "../../rules/ruleUtils"
|
|
4
|
+
import { RESULT_CODE, resultToast } from "../../utils/respone"
|
|
5
|
+
import { assignmentPathVal, definePrivatelyProp, getPathVal, isPromise, modelValueDeepMerge, parseExtendAttr, unionWith } from "../../utils/index"
|
|
6
|
+
import { buildInRequest } from "../../utils/request"
|
|
7
|
+
import { bpmInstance } from "../../bpm/bpmInstance"
|
|
8
|
+
|
|
9
|
+
export async function dispatchClickEvents ({serviceList = [], requestTraceId, axiosInstance, dialogReq, dynamicMapComp, rootValue, dynamicHireRelat, messageCb, compConfig, messageInstance, lang, beforeRequestService, afterRequestService}) {
|
|
10
|
+
const dynamicMapCompKeys = Object.keys(dynamicMapComp)
|
|
11
|
+
const mixinServiceConfig = serviceList.find(service => service.serviceType == '1')
|
|
12
|
+
for (let i = 0; i < serviceList.length; i++) {
|
|
13
|
+
const service = serviceList[i]
|
|
14
|
+
dispatchClickEvent(service, {dynamicMapComp, requestTraceId, dialogReq, mixinServiceConfig, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageCb, compConfig, messageInstance, lang, beforeRequestService, afterRequestService})
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function dispatchClickEvent(service, {
|
|
19
|
+
dynamicMapComp, requestTraceId, dialogReq,
|
|
20
|
+
mixinServiceConfig, rootValue, dynamicMapCompKeys,
|
|
21
|
+
dynamicHireRelat, axiosInstance, messageCb, compConfig,
|
|
22
|
+
messageInstance, lang, beforeRequestService, afterRequestService
|
|
23
|
+
}) {
|
|
24
|
+
if (service.transactionType == '1') {
|
|
25
|
+
const tableConfig = getTableConfig(service.outParamMappingList, { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat })
|
|
26
|
+
if (tableConfig) {
|
|
27
|
+
definePrivatelyProp(tableConfig, 'serviceSizeChange', (val, props, page) => {
|
|
28
|
+
toExecute()
|
|
29
|
+
})
|
|
30
|
+
definePrivatelyProp(tableConfig, 'serviceCurrentChange', (val, props, page) => {
|
|
31
|
+
toExecute(false)
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// 把执行逻辑封装成一个方法
|
|
36
|
+
async function toExecute(resetPageNum = true) {
|
|
37
|
+
let reqData = rootValue || {}
|
|
38
|
+
let tableConfig = null
|
|
39
|
+
const serviceCustomProps = parseExtendAttr({extendAttr: service.extendAttr})
|
|
40
|
+
|
|
41
|
+
let normalBeforeRequestService = null
|
|
42
|
+
let normalAfterRequestService = null
|
|
43
|
+
// 定义的请求前钩子
|
|
44
|
+
const configBeforeRequestService = compConfig?.beforeRequestService
|
|
45
|
+
if (configBeforeRequestService || beforeRequestService) {
|
|
46
|
+
normalBeforeRequestService = async (...arg) => {
|
|
47
|
+
let beforeRequestServiceRet = true
|
|
48
|
+
if (beforeRequestService) {
|
|
49
|
+
beforeRequestServiceRet = beforeRequestService?.(...arg)
|
|
50
|
+
}
|
|
51
|
+
const beforeRequestServiceRetValid = await beforeRequestServiceRet
|
|
52
|
+
if (beforeRequestServiceRetValid === false) {
|
|
53
|
+
return false
|
|
54
|
+
}
|
|
55
|
+
if (configBeforeRequestService) {
|
|
56
|
+
return configBeforeRequestService?.(...arg)
|
|
57
|
+
} else {
|
|
58
|
+
return true
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// 定义的请求后钩子
|
|
63
|
+
const configAfterRequestService = compConfig?.afterRequestService
|
|
64
|
+
if (configAfterRequestService || afterRequestService) {
|
|
65
|
+
normalAfterRequestService = async (...arg) => {
|
|
66
|
+
await afterRequestService?.(...arg)
|
|
67
|
+
await configAfterRequestService?.(...arg)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (service.transactionType == '1') {
|
|
71
|
+
reqData = getReqData(service.inParamMappingList || [], {emptyUpdate: true, dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat})
|
|
72
|
+
tableConfig = getTableConfig(service.outParamMappingList, { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat })
|
|
73
|
+
if (tableConfig?.vm) {
|
|
74
|
+
if (resetPageNum) {
|
|
75
|
+
// 控制表格组件中分页变化不会出发监听
|
|
76
|
+
definePrivatelyProp(tableConfig, 'serviceCurrentChangeLoad', true)
|
|
77
|
+
tableConfig.vm.page.pageNum = 1
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
definePrivatelyProp(tableConfig, 'serviceCurrentChangeLoad', false)
|
|
80
|
+
}, 200);
|
|
81
|
+
}
|
|
82
|
+
if (!isUndefined(tableConfig.vm.page?.pageNum) && !isNull(tableConfig.vm.page?.pageNum) ) {
|
|
83
|
+
assignmentPathVal(reqData, service.pageNum || 'pageNum', tableConfig.vm.page?.pageNum)
|
|
84
|
+
}
|
|
85
|
+
if (!isUndefined(tableConfig.vm.page?.pageSize) && !isNull(tableConfig.vm.page?.pageSize) ) {
|
|
86
|
+
assignmentPathVal(reqData, service.pageSize || 'pageSize', tableConfig.vm.page?.pageSize)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
reqData = {
|
|
90
|
+
...reqData,
|
|
91
|
+
// ...dialogReq
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const url = service.serviceCode
|
|
96
|
+
const httpMethod = service.httpMethod || "post"
|
|
97
|
+
|
|
98
|
+
let reqResult = {
|
|
99
|
+
aid_language: lang,
|
|
100
|
+
requestTraceId,
|
|
101
|
+
pmHandleBusinessIdentity: {
|
|
102
|
+
busiIdentityId: service.busiIdentityId,
|
|
103
|
+
pageMetaId: service.pageMetaId,
|
|
104
|
+
tenantId: service.tenantId,
|
|
105
|
+
mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
// 控制是否需要传入默认参数 ===== start=====
|
|
110
|
+
const notDefaultParmas = serviceCustomProps?.notDefaultParmas
|
|
111
|
+
if (notDefaultParmas) {
|
|
112
|
+
reqResult = {
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const mergeObj = modelValueDeepMerge(reqResult, reqData)
|
|
116
|
+
reqResult = mergeObj
|
|
117
|
+
// 控制是否需要传入默认参数 ===== end=====
|
|
118
|
+
|
|
119
|
+
let beforeRequestServiceRet = true
|
|
120
|
+
if (normalBeforeRequestService) {
|
|
121
|
+
beforeRequestServiceRet = normalBeforeRequestService({
|
|
122
|
+
dynamicMapComp,
|
|
123
|
+
requestTraceId,
|
|
124
|
+
mixinServiceConfig,
|
|
125
|
+
rootValue,
|
|
126
|
+
dynamicHireRelat,
|
|
127
|
+
compConfig,
|
|
128
|
+
service,
|
|
129
|
+
reqData: reqResult
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
const beforeRequestServiceRetValid = await beforeRequestServiceRet
|
|
133
|
+
if (beforeRequestServiceRetValid === false) {
|
|
134
|
+
return
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const reqConfig = {
|
|
138
|
+
url,
|
|
139
|
+
method: httpMethod,
|
|
140
|
+
data: reqResult
|
|
141
|
+
}
|
|
142
|
+
if (httpMethod.toLocaleLowerCase() === 'get') {
|
|
143
|
+
reqConfig.params = reqResult
|
|
144
|
+
delete reqConfig.data
|
|
145
|
+
}
|
|
146
|
+
const ret = await (axiosInstance && axiosInstance(reqConfig))
|
|
147
|
+
if (normalAfterRequestService) {
|
|
148
|
+
await normalAfterRequestService(ret, {
|
|
149
|
+
dynamicMapComp,
|
|
150
|
+
requestTraceId,
|
|
151
|
+
mixinServiceConfig,
|
|
152
|
+
rootValue,
|
|
153
|
+
dynamicHireRelat,
|
|
154
|
+
compConfig,
|
|
155
|
+
service,
|
|
156
|
+
reqData: reqResult
|
|
157
|
+
})
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const noSuccessIip = httpMethod.toLocaleLowerCase() === 'get' || service.transactionType == '1' || serviceCustomProps?.noSuccessIip
|
|
161
|
+
const toastParmas = {
|
|
162
|
+
messageCb,
|
|
163
|
+
service,
|
|
164
|
+
compConfig,
|
|
165
|
+
noSuccessIip
|
|
166
|
+
}
|
|
167
|
+
if (serviceCustomProps.resultCodeKey) {
|
|
168
|
+
toastParmas.resultCodeKey = serviceCustomProps.resultCodeKey
|
|
169
|
+
}
|
|
170
|
+
if (!resultToast(ret?.data, messageInstance, toastParmas)) {
|
|
171
|
+
await Promise.reject()
|
|
172
|
+
return
|
|
173
|
+
}
|
|
174
|
+
// ret.data = {result: {pageTotalCount: 100, result: [{},{},{},{},{}]}}
|
|
175
|
+
initOutParamData(service.outParamMappingList, {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat, outResult: ret.data})
|
|
176
|
+
if (tableConfig?.vm) {
|
|
177
|
+
let totalObj = ret.data?.result
|
|
178
|
+
let pageTotalCountKey = service.pageTotalCount
|
|
179
|
+
const deepMatch = /^_deep:(.+)$/
|
|
180
|
+
const matchs = service.pageTotalCount?.match(deepMatch)
|
|
181
|
+
if (matchs) {
|
|
182
|
+
totalObj = ret.data
|
|
183
|
+
pageTotalCountKey = matchs[1]
|
|
184
|
+
}
|
|
185
|
+
const total = parseInt(getPathVal(totalObj || {}, pageTotalCountKey || 'pageCount'))
|
|
186
|
+
tableConfig.vm.page.total = total
|
|
187
|
+
// tableConfig.vm?.changePage(total, 'total')
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
toExecute()
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function getReqData(inParamMappingList = [], {emptyUpdate, dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat}) {
|
|
195
|
+
return inParamMappingList.reduce((ret, params) => {
|
|
196
|
+
const { orignParam = '', destParam = '' } = params
|
|
197
|
+
const configCodes = getRelateConfigKeys(dynamicMapCompKeys, orignParam, dynamicHireRelat)
|
|
198
|
+
if (configCodes.length > 1) {
|
|
199
|
+
console.error('search arg muti', params, configCodes)
|
|
200
|
+
}
|
|
201
|
+
const configCode = configCodes[0]
|
|
202
|
+
const val = dynamicMapComp?.[configCode]?.refValue
|
|
203
|
+
if (
|
|
204
|
+
(
|
|
205
|
+
(
|
|
206
|
+
isUndefined(val) ||
|
|
207
|
+
isNull(val)
|
|
208
|
+
) && emptyUpdate
|
|
209
|
+
) ||
|
|
210
|
+
(
|
|
211
|
+
!isUndefined(val) &&
|
|
212
|
+
!isNull(val)
|
|
213
|
+
)
|
|
214
|
+
) {
|
|
215
|
+
let destParamArr
|
|
216
|
+
if (destParam?.indexOf('->') !== -1) {
|
|
217
|
+
destParamArr = destParam?.split('->') || []
|
|
218
|
+
} else {
|
|
219
|
+
destParamArr = destParam?.split('.') || []
|
|
220
|
+
}
|
|
221
|
+
assignmentPathVal(ret, destParamArr, (isUndefined(val) || isNull(val)) ? '' : val)
|
|
222
|
+
}
|
|
223
|
+
return ret
|
|
224
|
+
}, {})
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function initOutParamData(outParamMappingList = [], { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat, outResult = {} }) {
|
|
228
|
+
outParamMappingList.forEach(params => {
|
|
229
|
+
const { orignParam = '', destParam = '', isList = false, primaryKeys = [] } = params
|
|
230
|
+
const configCodes = getRelateConfigKeys(dynamicMapCompKeys, destParam, dynamicHireRelat)
|
|
231
|
+
if (configCodes.length > 1) {
|
|
232
|
+
console.error('search arg muti', params, configCodes)
|
|
233
|
+
}
|
|
234
|
+
const configCode = configCodes[0]
|
|
235
|
+
const compConfig = dynamicMapComp[configCode]
|
|
236
|
+
|
|
237
|
+
if (compConfig) {
|
|
238
|
+
const orignParamArr = orignParam ? orignParam?.split('.') : []
|
|
239
|
+
let val = orignParamArr.reduce((ret, item) => {
|
|
240
|
+
if (!ret) return
|
|
241
|
+
return ret[item]
|
|
242
|
+
}, outResult)
|
|
243
|
+
if (isList) {
|
|
244
|
+
if (!isArray(val)) {
|
|
245
|
+
val = isArray(compConfig.refValue) ? compConfig.refValue : []
|
|
246
|
+
} else if (isArray(compConfig.refValue) && isArray(val)) {
|
|
247
|
+
val = unionWith(compConfig.refValue, val, (arrVal, othVal) => {
|
|
248
|
+
const ret = (primaryKeys && primaryKeys.length) ? primaryKeys.map(key => ((isHasVal(arrVal[key]) || isHasVal(othVal[key])) && arrVal[key] == othVal[key]))?.every(item => item) : false
|
|
249
|
+
return ret
|
|
250
|
+
})
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
compConfig.refValue = val
|
|
254
|
+
}
|
|
255
|
+
})
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export function getTableConfig(outParamMappingList = [], { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat }) {
|
|
259
|
+
for(let i = 0; i < outParamMappingList.length; i ++) {
|
|
260
|
+
const params = outParamMappingList[i]
|
|
261
|
+
const { destParam = '' } = params
|
|
262
|
+
const configCodes = getRelateConfigKeys(dynamicMapCompKeys, destParam, dynamicHireRelat)
|
|
263
|
+
if (configCodes.length > 1) {
|
|
264
|
+
console.error('search arg muti', params, configCodes)
|
|
265
|
+
}
|
|
266
|
+
const configCode = configCodes[0]
|
|
267
|
+
if (configCode) {
|
|
268
|
+
const compConfig = dynamicMapComp[configCode]
|
|
269
|
+
if (compConfig.metaType === 'CustomComponentTable' || compConfig.metaType === 'CustomComponentTableH5') {
|
|
270
|
+
return compConfig
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export function openDailg({
|
|
277
|
+
beforeOpenDialog,
|
|
278
|
+
afterOpenDialog,
|
|
279
|
+
middleOpenDialog,
|
|
280
|
+
components,
|
|
281
|
+
rootValue,
|
|
282
|
+
polyfillConfigs,
|
|
283
|
+
pagePopupMap,
|
|
284
|
+
axiosInstance,
|
|
285
|
+
dynamicMapComp,
|
|
286
|
+
dynamicHireRelat,
|
|
287
|
+
lang,
|
|
288
|
+
buttonActions,
|
|
289
|
+
openChildDialog,
|
|
290
|
+
appContext,
|
|
291
|
+
compConfig
|
|
292
|
+
}) {
|
|
293
|
+
const dialogProps = parseExtendAttr({extendAttr: pagePopupMap.extendAttr})
|
|
294
|
+
|
|
295
|
+
const busiIdentityId = pagePopupMap.popupBusiIdentityId
|
|
296
|
+
const dynamicMapCompKeys = Object.keys(dynamicMapComp)
|
|
297
|
+
const reqData = getReqData(pagePopupMap.inParamMappingList || [], {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat})
|
|
298
|
+
// 是表格还是list
|
|
299
|
+
const isList = pagePopupMap?.objOrList == '1'
|
|
300
|
+
|
|
301
|
+
let outParamMappingList = pagePopupMap?.outParamMappingList?.map(item => {
|
|
302
|
+
const orignParamArr = item.orignParam ? item.orignParam.split('->') : []
|
|
303
|
+
const orignParam = item.orignParam ?
|
|
304
|
+
(
|
|
305
|
+
dialogProps?.bindFormData == '1' && !isList ?
|
|
306
|
+
orignParamArr.join('.') :
|
|
307
|
+
orignParamArr[orignParamArr.length - 1]
|
|
308
|
+
)
|
|
309
|
+
: ''
|
|
310
|
+
return {
|
|
311
|
+
...item,
|
|
312
|
+
orignParam,
|
|
313
|
+
}
|
|
314
|
+
}) || []
|
|
315
|
+
let mapList = {} // 在返回的是list的数据的时候,我们支持返回数据的key跟父页面的编码不一致,所以这里需要做一个映射
|
|
316
|
+
let selectionsObj = {} // 打开弹框的时候,如果是多选表格数据,这个的作用就是回显已经选择的数据(list数据需要选择主键,也就是primaryKeyFlag)
|
|
317
|
+
|
|
318
|
+
if (isList ) {
|
|
319
|
+
const primaryKeys = []
|
|
320
|
+
mapList = outParamMappingList?.reduce((ret, item) => {
|
|
321
|
+
const { orignParam, destParam, primaryKeyFlag = '' } = item
|
|
322
|
+
const destParamArr = destParam ? destParam.split('->') : []
|
|
323
|
+
const transDestParam = destParam ? destParamArr[destParamArr.length - 1] : ''
|
|
324
|
+
ret[transDestParam] = orignParam
|
|
325
|
+
if (primaryKeyFlag == '1') {
|
|
326
|
+
primaryKeys.push(orignParam)
|
|
327
|
+
}
|
|
328
|
+
return ret
|
|
329
|
+
}, {})
|
|
330
|
+
|
|
331
|
+
outParamMappingList = [
|
|
332
|
+
{
|
|
333
|
+
orignParam: '',
|
|
334
|
+
destParam: pagePopupMap.parentTable || '',
|
|
335
|
+
primaryKeys,
|
|
336
|
+
isList: true
|
|
337
|
+
}
|
|
338
|
+
]
|
|
339
|
+
const orginTableConfig = getTableConfig(outParamMappingList, { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat })
|
|
340
|
+
selectionsObj.selections = (orginTableConfig?.refValue || [])
|
|
341
|
+
selectionsObj.primaryKeys = primaryKeys
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
let rootStore = {}
|
|
346
|
+
let rootFormData = {}
|
|
347
|
+
let dialogClose = null
|
|
348
|
+
const initPolyfillConfigs = {}
|
|
349
|
+
if (pagePopupMap.outDisplayTrigger) {
|
|
350
|
+
initPolyfillConfigs[pagePopupMap.outDisplayTrigger] = (config) => {
|
|
351
|
+
return {
|
|
352
|
+
onClick() {
|
|
353
|
+
let outResult = rootStore.tableSelectedInfo
|
|
354
|
+
if (isList) {
|
|
355
|
+
outResult = rootStore.tableSelectedInfo?.map(item => {
|
|
356
|
+
const retItem = {
|
|
357
|
+
...item
|
|
358
|
+
}
|
|
359
|
+
Object.keys(mapList).forEach(key => {
|
|
360
|
+
if (mapList[key]) {
|
|
361
|
+
retItem[key] = item[mapList[key]]
|
|
362
|
+
}
|
|
363
|
+
})
|
|
364
|
+
return retItem
|
|
365
|
+
})
|
|
366
|
+
}
|
|
367
|
+
if (dialogProps?.bindFormData == '1' && !isList) {
|
|
368
|
+
outResult = rootFormData
|
|
369
|
+
}
|
|
370
|
+
// 定义打开弹框-中间钩子
|
|
371
|
+
const configMiddleOpenDialog = compConfig?.middleOpenDialog
|
|
372
|
+
const parmasMiddleOpenDialog = middleOpenDialog
|
|
373
|
+
if (configMiddleOpenDialog || parmasMiddleOpenDialog) {
|
|
374
|
+
middleOpenDialog = async (params) => {
|
|
375
|
+
let ret = null
|
|
376
|
+
if (parmasMiddleOpenDialog) {
|
|
377
|
+
ret = parmasMiddleOpenDialog?.(params)
|
|
378
|
+
}
|
|
379
|
+
if (ret) {
|
|
380
|
+
const outputParams = await ret
|
|
381
|
+
return configMiddleOpenDialog?.({
|
|
382
|
+
...params,
|
|
383
|
+
outputParams
|
|
384
|
+
})
|
|
385
|
+
}
|
|
386
|
+
return configMiddleOpenDialog?.(params)
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
let middleOpenDialogRet = outResult
|
|
390
|
+
if (middleOpenDialog) {
|
|
391
|
+
middleOpenDialogRet = middleOpenDialog({
|
|
392
|
+
dynamicMapComp,
|
|
393
|
+
rootValue,
|
|
394
|
+
dynamicHireRelat,
|
|
395
|
+
compConfig,
|
|
396
|
+
pagePopupMap,
|
|
397
|
+
inputParams: reqData,
|
|
398
|
+
outputParams: outResult
|
|
399
|
+
}) || middleOpenDialogRet
|
|
400
|
+
}
|
|
401
|
+
if (isPromise(middleOpenDialogRet)) {
|
|
402
|
+
middleOpenDialogRet.then(res => {
|
|
403
|
+
toInitOutParams(res)
|
|
404
|
+
})
|
|
405
|
+
} else {
|
|
406
|
+
toInitOutParams(middleOpenDialogRet)
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
function toInitOutParams(outData) {
|
|
410
|
+
initOutParamData(outParamMappingList, {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat, outResult: outData})
|
|
411
|
+
dialogClose?.()
|
|
412
|
+
|
|
413
|
+
toAfterOpenDialog(outData)
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
if (pagePopupMap.closedTrigger) {
|
|
420
|
+
initPolyfillConfigs[pagePopupMap.closedTrigger] = (config) => {
|
|
421
|
+
return {
|
|
422
|
+
onClick() {
|
|
423
|
+
dialogClose?.()
|
|
424
|
+
toAfterOpenDialog()
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// 定义的弹框打开前钩子
|
|
431
|
+
const configBeforeOpenDialog = compConfig?.beforeOpenDialog
|
|
432
|
+
const paramsBeforeOpenDialog = beforeOpenDialog
|
|
433
|
+
// if (configBeforeOpenDialog || paramsBeforeOpenDialog) {
|
|
434
|
+
// }
|
|
435
|
+
beforeOpenDialog = async (...arg) => {
|
|
436
|
+
bpmInstance?.changeSlide?.(false)
|
|
437
|
+
let beforeOpenDialogRet = true
|
|
438
|
+
if (paramsBeforeOpenDialog) {
|
|
439
|
+
beforeOpenDialogRet = paramsBeforeOpenDialog?.(...arg)
|
|
440
|
+
}
|
|
441
|
+
const beforeOpenDialogRetValid = await beforeOpenDialogRet
|
|
442
|
+
if (beforeOpenDialogRetValid === false) {
|
|
443
|
+
return false
|
|
444
|
+
}
|
|
445
|
+
if (configBeforeOpenDialog) {
|
|
446
|
+
return configBeforeOpenDialog?.(...arg)
|
|
447
|
+
} else {
|
|
448
|
+
return true
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
let beforeOpenDialogRet = true
|
|
452
|
+
if (beforeOpenDialog) {
|
|
453
|
+
beforeOpenDialogRet = beforeOpenDialog({
|
|
454
|
+
dynamicMapComp,
|
|
455
|
+
rootValue,
|
|
456
|
+
dynamicHireRelat,
|
|
457
|
+
compConfig,
|
|
458
|
+
pagePopupMap,
|
|
459
|
+
inputParams: reqData
|
|
460
|
+
})
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
if (beforeOpenDialogRet !== null && beforeOpenDialogRet !== undefined) {
|
|
464
|
+
if (isPromise(beforeOpenDialogRet)) {
|
|
465
|
+
beforeOpenDialogRet.then(res => {
|
|
466
|
+
if (res !== false) {
|
|
467
|
+
toOpenDialog()
|
|
468
|
+
}
|
|
469
|
+
})
|
|
470
|
+
} else {
|
|
471
|
+
if (beforeOpenDialogRet) {
|
|
472
|
+
toOpenDialog()
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
} else {
|
|
476
|
+
toOpenDialog()
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function toAfterOpenDialog(outputParams) {
|
|
480
|
+
// 打开弹框-确认后的钩子
|
|
481
|
+
const configAfterOpenDialog = compConfig?.afterOpenDialog
|
|
482
|
+
const paramsAfterOpenDialog = afterOpenDialog
|
|
483
|
+
// if (configAfterOpenDialog || paramsAfterOpenDialog) {
|
|
484
|
+
// }
|
|
485
|
+
afterOpenDialog = async (...arg) => {
|
|
486
|
+
bpmInstance?.changeSlide?.(true)
|
|
487
|
+
paramsAfterOpenDialog?.(...arg)
|
|
488
|
+
configAfterOpenDialog?.(...arg)
|
|
489
|
+
}
|
|
490
|
+
afterOpenDialog && afterOpenDialog({
|
|
491
|
+
dynamicMapComp,
|
|
492
|
+
rootValue,
|
|
493
|
+
dynamicHireRelat,
|
|
494
|
+
compConfig,
|
|
495
|
+
pagePopupMap,
|
|
496
|
+
inputParams: reqData,
|
|
497
|
+
outputParams,
|
|
498
|
+
})
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
function toOpenDialog() {
|
|
502
|
+
dialogClose = openChildDialog({
|
|
503
|
+
|
|
504
|
+
buttonActions,
|
|
505
|
+
dialogProps: {
|
|
506
|
+
...(dialogProps || {}),
|
|
507
|
+
beforeClose: () => {
|
|
508
|
+
toAfterOpenDialog()
|
|
509
|
+
},
|
|
510
|
+
},
|
|
511
|
+
parentRootValue: rootValue,
|
|
512
|
+
parentDynamicMapComp: dynamicMapComp,
|
|
513
|
+
selectionsObj,
|
|
514
|
+
busiIdentityId,
|
|
515
|
+
axiosInstance: axiosInstance,
|
|
516
|
+
lang,
|
|
517
|
+
loadEvnetsReq: reqData,
|
|
518
|
+
initData: reqData,
|
|
519
|
+
components,
|
|
520
|
+
parentSelects: compConfig?._selects,
|
|
521
|
+
polyfillConfigs: {
|
|
522
|
+
...initPolyfillConfigs,
|
|
523
|
+
...(polyfillConfigs || {})
|
|
524
|
+
},
|
|
525
|
+
rootStoreChange: (val) => {
|
|
526
|
+
rootStore = val
|
|
527
|
+
},
|
|
528
|
+
rootDataChange: (val) => {
|
|
529
|
+
rootFormData = val
|
|
530
|
+
},
|
|
531
|
+
}, appContext)
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// 数据校验服务
|
|
536
|
+
export async function executeDataValid(validConfig, {
|
|
537
|
+
beforeDataValidRequestService,
|
|
538
|
+
afterDataValidRequestService,
|
|
539
|
+
confirmInstance,
|
|
540
|
+
dynamicMapComp,
|
|
541
|
+
requestTraceId,
|
|
542
|
+
compConfig,
|
|
543
|
+
mixinServiceConfig,
|
|
544
|
+
rootValue,
|
|
545
|
+
builtPolyfillReq,
|
|
546
|
+
axiosInstance,
|
|
547
|
+
lang
|
|
548
|
+
}) {
|
|
549
|
+
let reqData = rootValue || {}
|
|
550
|
+
const url = DATA_VALID_RULE_EXECUTE
|
|
551
|
+
let beforeRequestService
|
|
552
|
+
let afterRequestService
|
|
553
|
+
const configBeforeDataValidRequestService = compConfig?.beforeDataValidRequestService
|
|
554
|
+
if (configBeforeDataValidRequestService || beforeDataValidRequestService) {
|
|
555
|
+
beforeRequestService = async (...arg) => {
|
|
556
|
+
let beforeRequestServiceRet = true
|
|
557
|
+
if (beforeDataValidRequestService) {
|
|
558
|
+
beforeRequestServiceRet = beforeDataValidRequestService?.(...arg)
|
|
559
|
+
}
|
|
560
|
+
const beforeRequestServiceRetValid = await beforeRequestServiceRet
|
|
561
|
+
if (beforeRequestServiceRetValid === false) {
|
|
562
|
+
return false
|
|
563
|
+
}
|
|
564
|
+
if (configBeforeDataValidRequestService) {
|
|
565
|
+
return configBeforeDataValidRequestService?.(...arg)
|
|
566
|
+
} else {
|
|
567
|
+
return true
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
const configAfterDataValidRequestService = compConfig?.afterDataValidRequestService
|
|
572
|
+
if (configAfterDataValidRequestService || afterDataValidRequestService) {
|
|
573
|
+
afterRequestService = (...arg) => {
|
|
574
|
+
afterDataValidRequestService?.(...arg)
|
|
575
|
+
configAfterDataValidRequestService?.(...arg)
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
let beforeRequestServiceRet = true
|
|
580
|
+
if (beforeRequestService) {
|
|
581
|
+
beforeRequestServiceRet = beforeRequestService({
|
|
582
|
+
dynamicMapComp,
|
|
583
|
+
requestTraceId,
|
|
584
|
+
mixinServiceConfig,
|
|
585
|
+
rootValue,
|
|
586
|
+
compConfig,
|
|
587
|
+
service: validConfig,
|
|
588
|
+
reqData: reqData
|
|
589
|
+
})
|
|
590
|
+
}
|
|
591
|
+
const beforeRequestServiceRetValid = await beforeRequestServiceRet
|
|
592
|
+
if (beforeRequestServiceRetValid === false) {
|
|
593
|
+
return
|
|
594
|
+
}
|
|
595
|
+
const ret = await buildInRequest(url, {
|
|
596
|
+
aid_language: lang,
|
|
597
|
+
requestTraceId,
|
|
598
|
+
...reqData,
|
|
599
|
+
...(builtPolyfillReq || {}),
|
|
600
|
+
pmHandleBusinessIdentity: {
|
|
601
|
+
busiIdentityId: validConfig.busiIdentityId,
|
|
602
|
+
pageMetaId: validConfig.pageMetaId,
|
|
603
|
+
tenantId: validConfig.tenantId,
|
|
604
|
+
mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
|
|
605
|
+
},
|
|
606
|
+
}, {
|
|
607
|
+
method: "post",
|
|
608
|
+
})
|
|
609
|
+
let result = ret.data || {}
|
|
610
|
+
if (ret.data?.baseResponse) {
|
|
611
|
+
result = ret.data?.baseResponse
|
|
612
|
+
}
|
|
613
|
+
const resultCode = result.resultCode
|
|
614
|
+
const resultMessage = result?.resultMessage || ''
|
|
615
|
+
let type = ''
|
|
616
|
+
let weakFlag = false
|
|
617
|
+
|
|
618
|
+
if (RESULT_CODE.SUCCESS !== resultCode) {
|
|
619
|
+
switch (resultCode) {
|
|
620
|
+
case RESULT_CODE.WARNING:
|
|
621
|
+
type = 'warning'
|
|
622
|
+
weakFlag = true
|
|
623
|
+
break;
|
|
624
|
+
case RESULT_CODE.ERROR:
|
|
625
|
+
type = 'error'
|
|
626
|
+
weakFlag = false
|
|
627
|
+
break;
|
|
628
|
+
case RESULT_CODE.INFO:
|
|
629
|
+
type = 'info'
|
|
630
|
+
break;
|
|
631
|
+
case RESULT_CODE.OTHER:
|
|
632
|
+
type = 'error'
|
|
633
|
+
break;
|
|
634
|
+
default:
|
|
635
|
+
type = 'error'
|
|
636
|
+
break;
|
|
637
|
+
}
|
|
638
|
+
return new Promise((resolver, inject) => {
|
|
639
|
+
confirmInstance(resultMessage, lang?.indexOf('zh') > -1 ? '提示' : 'Hint', {
|
|
640
|
+
type,
|
|
641
|
+
showCancelButton: weakFlag
|
|
642
|
+
}).then(() => {
|
|
643
|
+
if (!weakFlag) {
|
|
644
|
+
afterRequestService && afterRequestService(ret, {valid: false})
|
|
645
|
+
resolver(false)
|
|
646
|
+
} else {
|
|
647
|
+
afterRequestService && afterRequestService(ret, {valid: true})
|
|
648
|
+
resolver(true)
|
|
649
|
+
}
|
|
650
|
+
}).catch(() => {
|
|
651
|
+
afterRequestService && afterRequestService(ret, {valid: false})
|
|
652
|
+
inject(false)
|
|
653
|
+
})
|
|
654
|
+
})
|
|
655
|
+
}
|
|
656
|
+
afterRequestService && afterRequestService(ret, {valid: true})
|
|
657
|
+
return true
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
function closePage(lcpPageClosedMapVO) {
|
|
661
|
+
if (lcpPageClosedMapVO?.closedType == '1') {
|
|
662
|
+
const top = window.top
|
|
663
|
+
top?.close()
|
|
664
|
+
} else {
|
|
665
|
+
window?.history?.back()
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
export async function executeEventOrchestration({
|
|
670
|
+
beforeDataValidRequestService,
|
|
671
|
+
afterDataValidRequestService,
|
|
672
|
+
beforeRequestService,
|
|
673
|
+
afterRequestService,
|
|
674
|
+
beforeOpenDialog,
|
|
675
|
+
afterOpenDialog,
|
|
676
|
+
middleOpenDialog,
|
|
677
|
+
components,
|
|
678
|
+
props,
|
|
679
|
+
requestTraceId,
|
|
680
|
+
axiosInstance,
|
|
681
|
+
polyfillConfigs,
|
|
682
|
+
buttonActions,
|
|
683
|
+
rootValue,
|
|
684
|
+
confirmInstance,
|
|
685
|
+
dialogReq,
|
|
686
|
+
dynamicMapComp,
|
|
687
|
+
messageInstance,
|
|
688
|
+
openChildDialog,
|
|
689
|
+
messageCb,
|
|
690
|
+
lang,
|
|
691
|
+
builtPolyfillReq,
|
|
692
|
+
appContext
|
|
693
|
+
} = {}) {
|
|
694
|
+
const PageServiceMapVOList = props.config.lcpPageServiceMapVOList || []
|
|
695
|
+
const mixinServiceConfig = PageServiceMapVOList.find(service => service.serviceType == '1')
|
|
696
|
+
const lcpPageRuleVOLis = props.config?.lcpPageRuleVOList || []
|
|
697
|
+
if (lcpPageRuleVOLis?.length) {
|
|
698
|
+
// 数据校验服务
|
|
699
|
+
const validConfig = lcpPageRuleVOLis[0]
|
|
700
|
+
const valid = await executeDataValid(validConfig, {
|
|
701
|
+
dynamicMapComp,
|
|
702
|
+
requestTraceId,
|
|
703
|
+
rootValue,
|
|
704
|
+
axiosInstance,
|
|
705
|
+
mixinServiceConfig,
|
|
706
|
+
compConfig: props.config,
|
|
707
|
+
confirmInstance,
|
|
708
|
+
builtPolyfillReq,
|
|
709
|
+
beforeDataValidRequestService,
|
|
710
|
+
afterDataValidRequestService,
|
|
711
|
+
lang
|
|
712
|
+
})
|
|
713
|
+
if (!valid) {
|
|
714
|
+
return
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
if (PageServiceMapVOList?.length) {
|
|
719
|
+
const dynamicHireRelat = props.config?.dynamicHireRelat
|
|
720
|
+
dispatchClickEvents({
|
|
721
|
+
serviceList: PageServiceMapVOList,
|
|
722
|
+
axiosInstance,
|
|
723
|
+
requestTraceId,
|
|
724
|
+
rootValue,
|
|
725
|
+
dynamicMapComp,
|
|
726
|
+
dynamicHireRelat,
|
|
727
|
+
messageInstance,
|
|
728
|
+
messageCb,
|
|
729
|
+
compConfig: props.config,
|
|
730
|
+
dialogReq,
|
|
731
|
+
lang,
|
|
732
|
+
beforeRequestService,
|
|
733
|
+
afterRequestService
|
|
734
|
+
})
|
|
735
|
+
}
|
|
736
|
+
const lcpPagePopupMapVO = props.config.lcpPagePopupMapVO
|
|
737
|
+
if (lcpPagePopupMapVO) {
|
|
738
|
+
|
|
739
|
+
const dynamicHireRelat = props.config?.dynamicHireRelat
|
|
740
|
+
openDailg({
|
|
741
|
+
beforeOpenDialog,
|
|
742
|
+
afterOpenDialog,
|
|
743
|
+
middleOpenDialog,
|
|
744
|
+
components,
|
|
745
|
+
rootValue,
|
|
746
|
+
polyfillConfigs,
|
|
747
|
+
pagePopupMap: lcpPagePopupMapVO,
|
|
748
|
+
axiosInstance,
|
|
749
|
+
dynamicMapComp,
|
|
750
|
+
dynamicHireRelat,
|
|
751
|
+
appContext,
|
|
752
|
+
lang,
|
|
753
|
+
messageCb,
|
|
754
|
+
buttonActions,
|
|
755
|
+
openChildDialog,
|
|
756
|
+
compConfig: props.config,
|
|
757
|
+
})
|
|
758
|
+
}
|
|
759
|
+
const lcpPageClosedMapVO = props.config.lcpPageClosedMapVO
|
|
760
|
+
if (lcpPageClosedMapVO) {
|
|
761
|
+
closePage(lcpPageClosedMapVO)
|
|
762
|
+
}
|
|
763
|
+
}
|