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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resolver-egretimp-plus",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -51,20 +51,41 @@ const validate = inject('_validate', () => {})
51
51
  const routeQuery= route?.query
52
52
 
53
53
  const buttonAction = (...arg) => {
54
- attrs?.onClick?.(...arg) // 如果配置中有点击事件
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
- actionFn && actionFn(props, {
58
- dynamicMapComp,
59
- hireRelatMapRules,
60
- components,
61
- selects,
62
- rootValue,
63
- dataLoad,
64
- rootForm,
65
- routeQuery,
66
- validate
67
- }, appContext)
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
- attrs?.onClick?.(...arg)
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
- actionFn && actionFn(props, {
82
- dynamicMapComp,
83
- hireRelatMapRules,
84
- components,
85
- selects,
86
- rootValue: rootValue?.value,
87
- dataLoad,
88
- rootForm,
89
- routeQuery,
90
- validate
91
- }, appContext)
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>