resolver-egretimp-plus 0.0.49 → 0.0.50
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/package.json
CHANGED
|
@@ -51,20 +51,41 @@ const validate = inject('_validate', () => {})
|
|
|
51
51
|
const routeQuery= route?.query
|
|
52
52
|
|
|
53
53
|
const buttonAction = (...arg) => {
|
|
54
|
-
|
|
54
|
+
const lastClick = () => {
|
|
55
|
+
attrs?.onClick?.(...arg) // 如果配置中有点击事件
|
|
56
|
+
}
|
|
55
57
|
const actionKey = props.config?.clickActionKey || props.config?.buttonActionKey || props.config?.hireRelat
|
|
56
58
|
const actionFn = buttonActions[actionKey]
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
if (actionFn) {
|
|
60
|
+
const ret = actionFn(props, {
|
|
61
|
+
dynamicMapComp,
|
|
62
|
+
hireRelatMapRules,
|
|
63
|
+
components,
|
|
64
|
+
selects,
|
|
65
|
+
rootValue: rootValue?.value,
|
|
66
|
+
dataLoad,
|
|
67
|
+
rootForm,
|
|
68
|
+
routeQuery,
|
|
69
|
+
validate,
|
|
70
|
+
lastClick
|
|
71
|
+
}, appContext)
|
|
72
|
+
|
|
73
|
+
if (ret !== null && ret !== undefined) {
|
|
74
|
+
if (isPromise(ret)) {
|
|
75
|
+
ret.then(res => {
|
|
76
|
+
if (res) {
|
|
77
|
+
lastClick()
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
} else {
|
|
81
|
+
if (ret) {
|
|
82
|
+
lastClick()
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
lastClick()
|
|
87
|
+
}
|
|
88
|
+
}
|
|
68
89
|
}
|
|
69
90
|
</script>
|
|
70
91
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<script setup>
|
|
7
7
|
import { ElButton } from 'element-plus'
|
|
8
8
|
import { defineProps, inject, getCurrentInstance, computed, useAttrs } from 'vue'
|
|
9
|
-
import { commonPropsType } from '../../utils/index.js'
|
|
9
|
+
import { commonPropsType, isPromise } from '../../utils/index.js'
|
|
10
10
|
import { useRoute } from 'vue-router'
|
|
11
11
|
|
|
12
12
|
defineOptions({
|
|
@@ -74,20 +74,40 @@ const validate = inject('_validate', () => {})
|
|
|
74
74
|
const routeQuery= route?.query
|
|
75
75
|
|
|
76
76
|
const buttonAction = async (...arg) => {
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const lastClick = () => {
|
|
78
|
+
attrs?.onClick?.(...arg)
|
|
79
|
+
}
|
|
79
80
|
const actionKey = props.config?.clickActionKey || props.config?.buttonActionKey || props.config?.hireRelat
|
|
80
81
|
const actionFn = buttonActions[actionKey]
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
if (actionFn) {
|
|
83
|
+
const ret = actionFn(props, {
|
|
84
|
+
dynamicMapComp,
|
|
85
|
+
hireRelatMapRules,
|
|
86
|
+
components,
|
|
87
|
+
selects,
|
|
88
|
+
rootValue: rootValue?.value,
|
|
89
|
+
dataLoad,
|
|
90
|
+
rootForm,
|
|
91
|
+
routeQuery,
|
|
92
|
+
validate,
|
|
93
|
+
lastClick
|
|
94
|
+
}, appContext)
|
|
95
|
+
|
|
96
|
+
if (ret !== null && ret !== undefined) {
|
|
97
|
+
if (isPromise(ret)) {
|
|
98
|
+
ret.then(res => {
|
|
99
|
+
if (res) {
|
|
100
|
+
lastClick()
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
} else {
|
|
104
|
+
if (ret) {
|
|
105
|
+
lastClick()
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
lastClick()
|
|
110
|
+
}
|
|
111
|
+
}
|
|
92
112
|
}
|
|
93
113
|
</script>
|