resolver-egretimp-plus 0.0.234 → 0.0.235
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 +2 -2
- package/dist/web/index.js +2 -2
- package/package.json +1 -1
- package/src/components/helper/resolver.js +38 -3
- package/src/index.jsx +11 -0
- package/src/rules/eventsSupplement.js +2 -2
package/package.json
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import rulesDriver from "../../rules/rulesDriver"
|
|
2
2
|
import { penddingRules } from "../../rules/ruleUtils"
|
|
3
|
-
import { hasOwn } from "../../utils"
|
|
3
|
+
import { hasOwn, isPlainObject } from "../../utils"
|
|
4
4
|
import { resultToast } from "../../utils/respone"
|
|
5
5
|
|
|
6
|
-
export async function executeLoadServices(services = [], {
|
|
6
|
+
export async function executeLoadServices(services = [], {
|
|
7
|
+
alongLoad,
|
|
8
|
+
requestTraceId,
|
|
9
|
+
businessIdentityReqData = {},
|
|
10
|
+
axiosInstance,
|
|
11
|
+
messageInstance,
|
|
12
|
+
reqData,
|
|
13
|
+
respCb,
|
|
14
|
+
loadEventsBefore,
|
|
15
|
+
notLoadCb
|
|
16
|
+
}) {
|
|
7
17
|
if (!alongLoad && reqData?.notLoad) {
|
|
8
18
|
notLoadCb && notLoadCb()
|
|
9
19
|
return
|
|
@@ -33,7 +43,7 @@ export async function executeLoadServices(services = [], { alongLoad, requestTra
|
|
|
33
43
|
},
|
|
34
44
|
...(reqData || {})
|
|
35
45
|
}
|
|
36
|
-
|
|
46
|
+
let reqConfig = {
|
|
37
47
|
url,
|
|
38
48
|
method: httpMethod,
|
|
39
49
|
data: reqResult
|
|
@@ -42,6 +52,31 @@ export async function executeLoadServices(services = [], { alongLoad, requestTra
|
|
|
42
52
|
reqConfig.params = reqResult
|
|
43
53
|
delete reqConfig.data
|
|
44
54
|
}
|
|
55
|
+
|
|
56
|
+
if (loadEventsBefore && typeof loadEventsBefore === 'function') {
|
|
57
|
+
let beforeRequestRet = true
|
|
58
|
+
if (loadEventsBefore) {
|
|
59
|
+
beforeRequestRet = loadEventsBefore({
|
|
60
|
+
reqConfig,
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
if (beforeRequestRet !== null && beforeRequestRet !== undefined) {
|
|
64
|
+
if (isPromise(beforeRequestRet)) {
|
|
65
|
+
beforeRequestRet = await beforeRequestRet
|
|
66
|
+
if (beforeRequestRet === false) {
|
|
67
|
+
return
|
|
68
|
+
}
|
|
69
|
+
if (isPlainObject(beforeRequestRet)) {
|
|
70
|
+
reqConfig = beforeRequestRet
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
if (beforeRequestRet === false) {
|
|
74
|
+
console.warn('请求中断')
|
|
75
|
+
return
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
45
80
|
|
|
46
81
|
const ret = await (axiosInstance.value && axiosInstance.value(reqConfig))
|
|
47
82
|
if (resultToast(ret.data, messageInstance, { noSuccessIip: true })) {
|
package/src/index.jsx
CHANGED
|
@@ -105,6 +105,10 @@ export default {
|
|
|
105
105
|
type: Function,
|
|
106
106
|
default: null
|
|
107
107
|
},
|
|
108
|
+
loadEventsBefore: {
|
|
109
|
+
type: Function,
|
|
110
|
+
default: null
|
|
111
|
+
},
|
|
108
112
|
// 在弹框里面的页面,通过弹窗传染的请求数据
|
|
109
113
|
dialogReq: {
|
|
110
114
|
type: Object,
|
|
@@ -191,6 +195,13 @@ export default {
|
|
|
191
195
|
notLoadCb: () => {
|
|
192
196
|
nativeDataLoad.value = true
|
|
193
197
|
},
|
|
198
|
+
loadEventsBefore: ({
|
|
199
|
+
reqConfig,
|
|
200
|
+
}) => {
|
|
201
|
+
if (props.loadEventsBefore && typeof props.loadEventsBefore === 'function') {
|
|
202
|
+
return props.loadEventsAfter({reqConfig})
|
|
203
|
+
}
|
|
204
|
+
},
|
|
194
205
|
respCb: (result) => {
|
|
195
206
|
let val = result
|
|
196
207
|
if (props.loadEventsAfter && typeof props.loadEventsAfter === 'function') {
|
|
@@ -106,10 +106,10 @@ const allInitEvents = {
|
|
|
106
106
|
configs.forEach(labelInfo => {
|
|
107
107
|
if (!labelInfo) return
|
|
108
108
|
let val = ''
|
|
109
|
-
if (valArrTypes.includes(labelInfo.labelType)) {
|
|
109
|
+
if (valArrTypes.includes(labelInfo.metaType || labelInfo.labelType)) {
|
|
110
110
|
val = []
|
|
111
111
|
}
|
|
112
|
-
if (valBooleanTypes.includes(labelInfo.labelType)) {
|
|
112
|
+
if (valBooleanTypes.includes(labelInfo.metaType || labelInfo.labelType)) {
|
|
113
113
|
val = false
|
|
114
114
|
}
|
|
115
115
|
hasOwn(labelInfo, 'refValue') && (labelInfo.refValue = val)
|