resolver-egretimp-plus 0.0.38 → 0.0.41

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.38",
3
+ "version": "0.0.41",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -1,9 +1,11 @@
1
1
  import { computed, defineAsyncComponent, getCurrentInstance, inject, onBeforeMount, provide, ref } from 'vue'
2
- import { getComponentPropsKeys, hasOwn } from './utils/index.js'
2
+ import { commonPropsType, getComponentPropsKeys, hasOwn } from './utils/index.js'
3
3
  import { useVmodels } from './hooks/index.js'
4
4
  import { getRenderComponentProps, generateFormItemPolyfill } from './utils/index.js'
5
5
  import rulesDriver from './rules/rulesDriver'
6
6
  import { penddingRules } from './rules/ruleUtils.js'
7
+ import { useRoute } from 'vue-router'
8
+ import { executeEventOrchestration } from './components/helper/eventOrchestration.js'
7
9
 
8
10
  export default {
9
11
  name: 'AnalysisComponent',
@@ -39,9 +41,29 @@ export default {
39
41
  },
40
42
  emits: ['update:modelValue'],
41
43
  setup(props, { emit, attrs }) {
44
+ const currentAttrs = computed(() => {
45
+ const ret = {
46
+ ...attrs
47
+ }
48
+ delete ret.onClick
49
+ return ret
50
+ })
51
+ const route = useRoute()
52
+ const routeQuery= route?.query
53
+ const hireRelatMapRules = inject('hireRelatMapRules')
54
+ const components = inject('components')
55
+ const dataLoad = inject('dataLoad')
56
+ const rootForm = inject('rootForm')
57
+ const _axiosInstance = inject('_axiosInstance')
58
+ const confirmInstance = inject('_confirmInstance')
59
+ const openChildDialogInstance = inject('_openChildDialogInstance')
60
+ const messageCb = inject('_messageCb')
61
+ const messageInstance = inject('_messageInstance')
62
+
42
63
  const selects = inject('selects')
43
64
  // 当前组件的实例
44
65
  const instance = getCurrentInstance()
66
+ const appContext = instance?.appContext
45
67
  props.config.wrapVm = instance
46
68
  const refFn = e => {
47
69
  // 具体渲染的组件
@@ -142,8 +164,39 @@ export default {
142
164
  const _isH5 = inject('_isH5')
143
165
  const lang = inject('lang')
144
166
  const rootValue = inject('rootValue')
167
+ const onClick = (e) => {
168
+ e.stopPropagation()
169
+ const context = {
170
+ props,
171
+ dynamicMapComp,
172
+ hireRelatMapRules,
173
+ components,
174
+ selects,
175
+ rootValue: rootValue?.value,
176
+ dataLoad,
177
+ rootForm,
178
+ routeQuery,
179
+ appContext
180
+ }
181
+ attrs?.onClick?.call(context, e) // 如果配置中有点击事件
182
+
183
+ executeEventOrchestration({
184
+ props,
185
+ axiosInstance: _axiosInstance?.value,
186
+ rootValue: rootValue?.value,
187
+ confirmInstance: confirmInstance?.value,
188
+ dynamicMapComp,
189
+ openChildDialog: openChildDialogInstance?.value,
190
+ messageInstance: messageInstance?.value,
191
+ messageCb,
192
+ lang: lang?.value,
193
+ appContext
194
+ })
195
+ }
145
196
  return () => {
146
197
  const compProps = getRenderComponentProps({config: props.config, props, component: props.component, modelValue, selects})
198
+ const compPropsOnClick = compProps?.onClick
199
+ delete compProps.onClick
147
200
  const formItemPolyfill = generateFormItemPolyfill(props.config, lang.value, compProps, _isH5?.value, {
148
201
  lang,
149
202
  rootValue,
@@ -152,14 +205,15 @@ export default {
152
205
  }) // 生成formItem()的辅助函数
153
206
  return formItemPolyfill(
154
207
  <currentComponent.value
155
- ref={refFn}
156
- onVnodeMounted={onVnodeMounted}
157
- onVnodeUnmounted={onVnodeUnmounted}
158
- {...attrs}
159
- {...componentProps.value}
160
- {...compProps}
161
- {...vModelObjs}
162
- ></currentComponent.value>
208
+ ref={refFn}
209
+ onVnodeMounted={onVnodeMounted}
210
+ onVnodeUnmounted={onVnodeUnmounted}
211
+ {...currentAttrs.value}
212
+ onClick={(e) => {onClick(e);compPropsOnClick?.(e)}}
213
+ {...componentProps.value}
214
+ {...compProps}
215
+ {...vModelObjs}
216
+ ></currentComponent.value>
163
217
  )
164
218
  }
165
219
  }
@@ -2,3 +2,4 @@ export const QUERY_PAGE_CONFIG_DATA = '/sa-lcp/api/v1/pageConfig/queryPageConfig
2
2
  export const LCP_LOGIN = '/sa-lcp/login'
3
3
  export const GET_SYS_PARAM_CACHE = '/sa-lcp/api/v1/sysparam/getSysParamCache'
4
4
  export const REFRESH_TOKEN = '/sa-lcp/changePwd/refreshToken'
5
+ export const DATA_VALID_RULE_EXECUTE = '/sa-lcp/api/v1/validate/dataValidRuleExecute'
@@ -0,0 +1,53 @@
1
+ import confirmInstance from './src/index.vue'
2
+ import { createVNode, render } from 'vue'
3
+
4
+ let instance = null
5
+
6
+ export function confirmDialog(content, title, opts = {}, appContext) {
7
+ const options = {
8
+ ...opts,
9
+ content,
10
+ title
11
+ }
12
+ let resolver = null
13
+ let inject = null
14
+ const cancelFn = () => {
15
+ inject && inject()
16
+ }
17
+ const confirmFn = () => {
18
+ resolver && resolver()
19
+ }
20
+ const retPromise = new Promise((reso, inj) => {
21
+ resolver = reso
22
+ inject = inj
23
+ })
24
+ if (instance) {
25
+ Object.keys(options).forEach(key => {
26
+ instance.props[key] = options[key]
27
+ })
28
+ instance.props.cancel = cancelFn
29
+ instance.props.confirm = confirmFn
30
+ instance.vm.exposed.dialogVisible.value = true
31
+ return retPromise
32
+ }
33
+ const container = document.createElement('div')
34
+ const vnode = createVNode(confirmInstance, {
35
+ ...options,
36
+ cancel: cancelFn,
37
+ confirm: confirmFn
38
+ })
39
+ appContext && (vnode.appContext = appContext)
40
+ render(vnode, container)
41
+ document.body.appendChild(container.firstElementChild)
42
+
43
+ instance = {
44
+ vnode,
45
+ vm: vnode.component,
46
+ props: vnode.component?.props,
47
+ close: () => {
48
+ vnode.component.exposed.dialogVisible.value = false
49
+ }
50
+ }
51
+ vnode.component.exposed.dialogVisible.value = true
52
+ return retPromise
53
+ }
@@ -0,0 +1,54 @@
1
+ <script setup>
2
+ import { computed, ref } from 'vue';
3
+
4
+ const props = defineProps({
5
+ title: String,
6
+ content: String,
7
+ confirm: {
8
+ type: Function,
9
+ default: () => {}
10
+ },
11
+ cancel: {
12
+ type: Function,
13
+ default: () => {}
14
+ },
15
+ showCancelButton: {
16
+ type: Boolean,
17
+ default: true
18
+ },
19
+ type: String
20
+ })
21
+ const dialogType = computed(() => {
22
+ return props.showCancelButton === false ? 'confirm' : 'modal'
23
+ })
24
+ const dialogVisible = ref(true)
25
+
26
+ const confirm = () => {
27
+ props.confirm()
28
+ dialogVisible.value = false
29
+ }
30
+
31
+ const cancel = () => {
32
+ props.cancel()
33
+ dialogVisible.value = false
34
+ }
35
+
36
+
37
+ defineExpose({
38
+ dialogVisible
39
+ })
40
+ </script>
41
+ <template>
42
+ <cmi-dialog
43
+ :type="dialogType"
44
+ :zIndex="10000"
45
+ :open="dialogVisible"
46
+ :title="props.title"
47
+ :content="props.content"
48
+ @confirm="confirm"
49
+ @cancel="cancel"
50
+ />
51
+ </template>
52
+
53
+ <style lang="scss">
54
+ </style>
@@ -1,16 +1,16 @@
1
+ import { DATA_VALID_RULE_EXECUTE } from "../../api/builtIn"
1
2
  import { getRelateConfigKeys } from "../../rules/ruleUtils"
2
- import { resultToast } from "../../utils/respone"
3
- import { openChildDialog } from "../childDialog"
3
+ import { RESULT_CODE, resultToast } from "../../utils/respone"
4
4
 
5
- export async function dispatchClickEvents ({serviceList = [], axiosInstance, dynamicMapComp, rootValue, dynamicHireRelat, messageInstance}) {
5
+ export async function dispatchClickEvents ({serviceList = [], axiosInstance, dynamicMapComp, rootValue, dynamicHireRelat, messageCb, compConfig, messageInstance}) {
6
6
  const dynamicMapCompKeys = Object.keys(dynamicMapComp)
7
7
  for (let i = 0; i < serviceList.length; i++) {
8
8
  const service = serviceList[i]
9
- dispatchClickEvent(service, {dynamicMapComp, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageInstance})
9
+ dispatchClickEvent(service, {dynamicMapComp, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageCb, compConfig, messageInstance})
10
10
  }
11
11
  }
12
12
 
13
- export async function dispatchClickEvent(service, { dynamicMapComp, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageInstance }) {
13
+ export async function dispatchClickEvent(service, { dynamicMapComp, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageCb, compConfig, messageInstance }) {
14
14
  let reqData = rootValue
15
15
  let tableConfig = null
16
16
  if (service.transactionType == '1') {
@@ -22,12 +22,12 @@ export async function dispatchClickEvent(service, { dynamicMapComp, rootValue, d
22
22
  }
23
23
  }
24
24
  const url = service.serviceCode
25
- const ret = await (axiosInstance.value && axiosInstance.value({
25
+ const ret = await (axiosInstance && axiosInstance({
26
26
  url,
27
27
  method: "post",
28
28
  data: reqData
29
29
  }))
30
- if (!resultToast(ret?.data, messageInstance)) {
30
+ if (!resultToast(ret?.data, messageInstance, {messageCb, service, compConfig})) {
31
31
  await Promise.reject()
32
32
  return
33
33
  }
@@ -111,6 +111,7 @@ export function openDailg({
111
111
  dynamicMapComp,
112
112
  dynamicHireRelat,
113
113
  lang,
114
+ openChildDialog,
114
115
  appContext,
115
116
  }) {
116
117
  const busiIdentityId = pagePopupMap.popupBusiIdentityId
@@ -148,7 +149,7 @@ export function openDailg({
148
149
  }
149
150
  dialogClose = openChildDialog({
150
151
  busiIdentityId,
151
- axiosInstance: axiosInstance?.value,
152
+ axiosInstance: axiosInstance,
152
153
  lang,
153
154
  loadEvnetsReq: reqData,
154
155
  polyfillConfigs,
@@ -157,3 +158,115 @@ export function openDailg({
157
158
  }
158
159
  }, appContext)
159
160
  }
161
+
162
+ // 数据校验服务
163
+ export async function executeDataValid(validConfig, { dynamicMapComp, mixinServiceConfig, rootValue, axiosInstance, lang}) {
164
+ let reqData = rootValue || {}
165
+ const url = DATA_VALID_RULE_EXECUTE
166
+ const ret = await (axiosInstance && axiosInstance({
167
+ url,
168
+ method: "post",
169
+ data: {
170
+ pmHandleBusinessIdentity: {
171
+ busiIdentityId: validConfig.busiIdentityId,
172
+ pageMetaId: validConfig.pageMetaId,
173
+ tenantId: validConfig.tenantId,
174
+ mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
175
+ },
176
+ ...reqData
177
+ }
178
+ }))
179
+ const result = ret.data || {}
180
+ const resultCode = result.resultCode
181
+ const resultMessage = result?.resultMessage || ''
182
+ let type = ''
183
+ let weakFlag = false
184
+
185
+ if (RESULT_CODE.SUCCESS !== resultCode) {
186
+ switch (resultCode) {
187
+ case RESULT_CODE.WARNING:
188
+ type = 'warning'
189
+ weakFlag = true
190
+ break;
191
+ case RESULT_CODE.ERROR:
192
+ type = 'error'
193
+ weakFlag = false
194
+ break;
195
+ case RESULT_CODE.INFO:
196
+ type = 'info'
197
+ break;
198
+ case RESULT_CODE.OTHER:
199
+ type = 'error'
200
+ break;
201
+ default:
202
+ type = 'error'
203
+ break;
204
+ }
205
+ }
206
+ // if (validConfig?.validationType === '2') {
207
+ // weakFlag = true
208
+ // }
209
+ return new Promise((resolver, inject) => {
210
+ confirmInstance(resultMessage, lang?.indexOf('zh') > -1 ? '提示' : 'Hint', {
211
+ type,
212
+ showCancelButton: weakFlag
213
+ }).then(() => {
214
+ if (!weakFlag) {
215
+ resolver(false)
216
+ } else {
217
+ resolver(true)
218
+ }
219
+ }).catch(() => {
220
+ inject(false)
221
+ })
222
+ })
223
+ }
224
+
225
+ export async function executeEventOrchestration({props, axiosInstance, rootValue, confirmInstance, dynamicMapComp, messageInstance, openChildDialog, messageCb, lang, appContext } = {}) {
226
+ const lcpPageRuleVOLis = props.config?.lcpPageRuleVOList || []
227
+ const PageServiceMapVOList = props.config.lcpPageServiceMapVOList || []
228
+ const mixinServiceConfig = PageServiceMapVOList.find(service => service.serviceType === '1')
229
+ if (lcpPageRuleVOLis?.length && mixinServiceConfig) {
230
+ // for(let i = 0; i < lcpPageRuleVOLis.length; i++) {
231
+ // 数据校验服务
232
+ const validConfig = lcpPageRuleVOLis[0]
233
+ const valid = await executeDataValid(validConfig, {
234
+ dynamicMapComp,
235
+ rootValue,
236
+ axiosInstance,
237
+ mixinServiceConfig,
238
+ lang
239
+ })
240
+ if (!valid) {
241
+ return
242
+ }
243
+ // }
244
+ }
245
+ if (PageServiceMapVOList?.length) {
246
+ const dynamicHireRelat = props.config?.dynamicHireRelat
247
+ dispatchClickEvents({
248
+ serviceList: PageServiceMapVOList,
249
+ axiosInstance,
250
+ rootValue,
251
+ dynamicMapComp,
252
+ dynamicHireRelat,
253
+ messageInstance,
254
+ messageCb,
255
+ compConfig: props.config
256
+ })
257
+ }
258
+ const lcpPagePopupMapVO = props.config.lcpPagePopupMapVO
259
+ if (lcpPagePopupMapVO) {
260
+ const dynamicHireRelat = props.config?.dynamicHireRelat
261
+ openDailg({
262
+ pagePopupMap: lcpPagePopupMapVO,
263
+ axiosInstance,
264
+ dynamicMapComp,
265
+ dynamicHireRelat,
266
+ appContext,
267
+ lang,
268
+ messageCb,
269
+ openChildDialog
270
+ })
271
+ }
272
+ }
@@ -2,7 +2,7 @@
2
2
  import { defineProps, inject, getCurrentInstance, computed, useAttrs } from 'vue'
3
3
  import { commonPropsType } from '../../utils/index.js'
4
4
  import { useRoute } from 'vue-router'
5
- import { dispatchClickEvents } from '../helper/button.js';
5
+ import { dispatchClickEvents } from '../helper/eventOrchestration.js';
6
6
 
7
7
  const appContext = getCurrentInstance()?.appContext
8
8
 
@@ -20,6 +20,7 @@ const checkboxGroupProps = computed(() => {
20
20
 
21
21
  const checkboxProps = computed(() => {
22
22
  return {
23
+ label: lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
23
24
  size: props?.config?.size,
24
25
  disabled: props.disabled,
25
26
  block: props?.config?.block === '1',
@@ -50,6 +51,7 @@ const onSigleChange = ({ detail }) => {
50
51
  <template>
51
52
  <cmi-checkbox-group :value="modeValue" @change="onChange" v-if="props.options && props.options.length" v-bind="{...checkboxGroupProps, ...attrs}">
52
53
  <cmi-checkbox
54
+ class="mr-20"
53
55
  v-for="option in props.options" :key="option.columnValue"
54
56
  :disabled="option.columnStatus == '0' || option.columnStatus == '2'"
55
57
  :name="option.columnValue" :label="lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc"
@@ -57,7 +59,12 @@ const onSigleChange = ({ detail }) => {
57
59
  {{lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc}}
58
60
  </cmi-checkbox>
59
61
  </cmi-checkbox-group>
60
- <cmi-checkbox v-else v-bind="{...checkboxProps, ...attrs}" :checked="modeValue === '1'" :value="modeValue" @change="onSigleChange">
62
+ <cmi-checkbox v-else v-bind="{...attrs, ...checkboxProps}" :checked="modeValue === '1'" :value="modeValue" @change="onSigleChange">
61
63
  {{ label }}
62
64
  </cmi-checkbox>
63
- </template>
65
+ </template>
66
+ <style lang="scss" scoped>
67
+ .mr-20 {
68
+ margin-right: 20px;
69
+ }
70
+ </style>
@@ -0,0 +1,30 @@
1
+ <script setup>
2
+ import { computed, defineProps, inject } from 'vue'
3
+ import { commonPropsType } from '../../utils/index.js'
4
+
5
+ const lang = inject('lang')
6
+ const props = defineProps({
7
+ ...commonPropsType,
8
+ })
9
+ const dividerProps = computed(() => {
10
+ return {
11
+ direction: props.config?.direction,
12
+ borderStyle: props.config?.borderStyle,
13
+ borderwidth: props.config?.borderwidth,
14
+ position: props.config?.position,
15
+ }
16
+ })
17
+ const modelValue = defineModel()
18
+
19
+ const label = computed(() => {
20
+ return modelValue.value || (lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn)
21
+ })
22
+ </script>
23
+
24
+ <template>
25
+ <cmi-divider
26
+ v-bind="{...dividerProps}"
27
+ >
28
+ {{ label }}
29
+ </cmi-divider>
30
+ </template>
@@ -5,7 +5,7 @@ import { commonPropsType } from '../../utils/index.js'
5
5
  const modelValue = defineModel()
6
6
  const props = defineProps({
7
7
  ...commonPropsType,
8
- isMutiple: [String, Boolean]
8
+ multiple: [String, Boolean]
9
9
  })
10
10
  const attrs = useAttrs()
11
11
  const lang = inject('lang')
@@ -47,7 +47,7 @@ const value = computed({
47
47
 
48
48
  const selectProps = computed(() => {
49
49
  return {
50
- label: lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
50
+ // label: lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
51
51
  value: value.value,
52
52
  disabled: props.disabled,
53
53
  clearable: props.clearable,
@@ -8,8 +8,6 @@ import { ElButton } from 'element-plus'
8
8
  import { defineProps, inject, getCurrentInstance, computed, useAttrs } from 'vue'
9
9
  import { commonPropsType } from '../../utils/index.js'
10
10
  import { useRoute } from 'vue-router'
11
- import { dispatchClickEvents, openDailg } from '../helper/button.js';
12
- import { getRelateConfigKeys } from '../../rules/ruleUtils.js';
13
11
 
14
12
  defineOptions({
15
13
  inheritAttrs: false
@@ -64,7 +62,6 @@ const label = computed(() => {
64
62
  const route = useRoute()
65
63
  const buttonActions = inject('buttonActions', {})
66
64
 
67
- const messageInstance = inject('_messageInstance')
68
65
  const dynamicMapComp = inject('dynamicMapComp')
69
66
  const hireRelatMapRules = inject('hireRelatMapRules')
70
67
  const components = inject('components')
@@ -72,11 +69,12 @@ const selects = inject('selects')
72
69
  const rootValue = inject('rootValue')
73
70
  const dataLoad = inject('dataLoad')
74
71
  const rootForm = inject('rootForm')
75
- const _axiosInstance = inject('_axiosInstance')
72
+
76
73
  const routeQuery= route?.query
77
74
 
78
- const buttonAction = (...arg) => {
79
- attrs?.onClick?.(...arg) // 如果配置中有点击事件
75
+ const buttonAction = async (...arg) => {
76
+ attrs?.onClick?.(...arg)
77
+
80
78
  const actionKey = props.config?.clickActionKey || props.config?.buttonActionKey || props.config?.hireRelat
81
79
  const actionFn = buttonActions[actionKey]
82
80
  actionFn && actionFn(props, {
@@ -84,34 +82,10 @@ const buttonAction = (...arg) => {
84
82
  hireRelatMapRules,
85
83
  components,
86
84
  selects,
87
- rootValue,
85
+ rootValue: rootValue?.value,
88
86
  dataLoad,
89
87
  rootForm,
90
88
  routeQuery
91
89
  }, appContext)
92
- const PageServiceMapVOList = props.config.lcpPageServiceMapVOList
93
- if (PageServiceMapVOList?.length) {
94
- const dynamicHireRelat = props.config?.dynamicHireRelat
95
- dispatchClickEvents({
96
- serviceList: PageServiceMapVOList,
97
- axiosInstance: _axiosInstance,
98
- rootValue: rootValue?.value,
99
- dynamicMapComp,
100
- dynamicHireRelat,
101
- messageInstance: messageInstance?.value
102
- })
103
- }
104
- const lcpPagePopupMapVO = props.config.lcpPagePopupMapVO
105
- if (lcpPagePopupMapVO) {
106
- const dynamicHireRelat = props.config?.dynamicHireRelat
107
- openDailg({
108
- pagePopupMap: lcpPagePopupMapVO,
109
- axiosInstance: _axiosInstance,
110
- dynamicMapComp,
111
- dynamicHireRelat,
112
- appContext,
113
- lang: lang?.value
114
- })
115
- }
116
90
  }
117
91
  </script>
@@ -18,13 +18,15 @@ export function usePageConfig() {
18
18
  isH5,
19
19
  rootValue,
20
20
  axiosInstance,
21
- messageInstance
21
+ messageInstance,
22
+ messageCb
22
23
  }) {
23
24
  const { pageConfig, mapComp, hireRelatMapRules } = parsePageConfig({
24
25
  config, lang, polyfillConfigs, instance, isH5,
25
26
  rootValue,
26
27
  axiosInstance,
27
- messageInstance
28
+ messageInstance,
29
+ messageCb
28
30
  })
29
31
  pageConfigRef.value = pageConfig
30
32
  hireRelatMapRulesRef.value = hireRelatMapRules
@@ -53,6 +55,12 @@ export function useBuildInData(messageTipInstance, loadingInstance) {
53
55
  cb(pageConfig.value)
54
56
  getSelects(ret.data.result?.pmBusinessIdentityVO?.tenantId)
55
57
  return
58
+ } else {
59
+ if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
60
+ loadingInstance.finish()
61
+ } else if (loadingInstance.hide && typeof loadingInstance.hide === 'function') {
62
+ loadingInstance.hide()
63
+ }
56
64
  }
57
65
  }).catch(() => {
58
66
  if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
@@ -70,6 +78,12 @@ export function useBuildInData(messageTipInstance, loadingInstance) {
70
78
  if (resultToast(ret.data, messageTipInstance, { noSuccessIip: true })) {
71
79
  selects.value = JSON.parse(ret.data.result || '{}')
72
80
  return
81
+ } else {
82
+ if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
83
+ loadingInstance.finish()
84
+ } else if (loadingInstance.hide && typeof loadingInstance.hide === 'function') {
85
+ loadingInstance.hide()
86
+ }
73
87
  }
74
88
  }).finally(() => {
75
89
  if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
package/src/index.jsx CHANGED
@@ -82,10 +82,24 @@ export default {
82
82
  type: [Object, Function],
83
83
  default: () => null
84
84
  },
85
+ openChildDialogInstance: {
86
+ type: [Function],
87
+ default: () => {
88
+ return () => {}
89
+ }
90
+ },
91
+ confirmInstance: {
92
+ type: [Object, Function],
93
+ default: () => {
94
+ return () => {}
95
+ }
96
+ },
85
97
  loadEvnetsReq: {
86
98
  type: Object,
87
99
  default: () => ({})
88
- }
100
+ },
101
+ // 提示语的回调
102
+ messageCb: Function,
89
103
  },
90
104
  setup(props, { emit, attrs, expose }) {
91
105
  const rootStore = reactive({})
@@ -120,7 +134,8 @@ export default {
120
134
  isH5: props.isH5,
121
135
  rootValue: props.modelValue,
122
136
  axiosInstance,
123
- messageInstance: props.messageInstance
137
+ messageInstance: props.messageInstance,
138
+ messageCb: props.messageCb
124
139
  })
125
140
  // 触发加载事件执行
126
141
  executeLoadServices(
@@ -146,7 +161,8 @@ export default {
146
161
  isH5: props.isH5,
147
162
  rootValue: props.modelValue,
148
163
  axiosInstance,
149
- messageInstance: props.messageInstance
164
+ messageInstance: props.messageInstance,
165
+ messageCb: props.messageCb
150
166
  })
151
167
  executeLoadServices(
152
168
  props.config?.pmPageServiceMapVOList || [],
@@ -163,7 +179,10 @@ export default {
163
179
  )
164
180
  })
165
181
 
182
+ provide('_messageCb', props.messageCb)
166
183
  provide('_rootStore', rootStore)
184
+ provide('_openChildDialogInstance', toRef(props, 'openChildDialogInstance'))
185
+ provide('_confirmInstance', toRef(props, 'confirmInstance'))
167
186
  provide('_messageInstance', toRef(props, 'messageInstance'))
168
187
  provide('_loadingInstance', toRef(props, 'loadingInstance'))
169
188
  provide('_getNativeComps', props.getNativeComps)