resolver-egretimp-plus 0.0.162 → 0.0.164

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.162",
3
+ "version": "0.0.164",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -68,6 +68,7 @@ export default {
68
68
  const openChildDialogInstance = inject('_openChildDialogInstance')
69
69
  const messageCb = inject('_messageCb')
70
70
  const messageInstance = inject('_messageInstance')
71
+ const builtPolyfillReq = inject('_builtPolyfillReq')
71
72
 
72
73
  const selects = inject('selects')
73
74
  // 当前组件的实例
@@ -243,6 +244,7 @@ export default {
243
244
  }
244
245
  executeEventOrchestration({
245
246
  ...params,
247
+ builtPolyfillReq,
246
248
  components,
247
249
  props,
248
250
  requestTraceId: requestTraceId?.value,
@@ -445,6 +445,7 @@ export async function executeDataValid(validConfig, {
445
445
  compConfig,
446
446
  mixinServiceConfig,
447
447
  rootValue,
448
+ builtPolyfillReq,
448
449
  axiosInstance,
449
450
  lang
450
451
  }) {
@@ -471,6 +472,7 @@ export async function executeDataValid(validConfig, {
471
472
  aid_language: lang,
472
473
  requestTraceId,
473
474
  ...reqData,
475
+ ...(builtPolyfillReq || {}),
474
476
  pmHandleBusinessIdentity: {
475
477
  busiIdentityId: validConfig.busiIdentityId,
476
478
  pageMetaId: validConfig.pageMetaId,
@@ -541,6 +543,8 @@ function closePage(lcpPageClosedMapVO) {
541
543
  }
542
544
 
543
545
  export async function executeEventOrchestration({
546
+ beforeDataValidRequestService,
547
+ afterDataValidRequestService,
544
548
  beforeRequestService,
545
549
  afterRequestService,
546
550
  beforeOpenDialog,
@@ -560,6 +564,7 @@ export async function executeEventOrchestration({
560
564
  openChildDialog,
561
565
  messageCb,
562
566
  lang,
567
+ builtPolyfillReq,
563
568
  appContext
564
569
  } = {}) {
565
570
  const lcpPageRuleVOLis = props.config?.lcpPageRuleVOList || []
@@ -598,23 +603,51 @@ export async function executeEventOrchestration({
598
603
  }
599
604
  }
600
605
  if (lcpPageRuleVOLis?.length) {
601
- // 数据校验服务
602
- const validConfig = lcpPageRuleVOLis[0]
603
- const valid = await executeDataValid(validConfig, {
604
- dynamicMapComp,
605
- requestTraceId,
606
- rootValue,
607
- axiosInstance,
608
- mixinServiceConfig,
609
- compConfig: props.config,
610
- confirmInstance,
611
- beforeRequestService: normalBeforeRequestService,
612
- afterRequestService: normalAfterRequestService,
613
- lang
614
- })
615
- if (!valid) {
616
- return
606
+ let normalBeforeDataValidRequestService
607
+ let normalAfterDataValidRequestService
608
+ const configBeforeDataValidRequestService = props.config?.beforeDataValidRequestService
609
+ if (configBeforeDataValidRequestService || beforeDataValidRequestService) {
610
+ normalBeforeDataValidRequestService = async (...arg) => {
611
+ let beforeRequestServiceRet = true
612
+ if (beforeDataValidRequestService) {
613
+ beforeRequestServiceRet = beforeDataValidRequestService?.(...arg)
614
+ }
615
+ const beforeRequestServiceRetValid = await beforeRequestServiceRet
616
+ if (beforeRequestServiceRetValid === false) {
617
+ return false
618
+ }
619
+ if (configBeforeDataValidRequestService) {
620
+ return configBeforeDataValidRequestService?.(...arg)
621
+ } else {
622
+ return true
623
+ }
617
624
  }
625
+ }
626
+ const configAfterDataValidRequestService = props.config?.afterDataValidRequestService
627
+ if (configAfterDataValidRequestService || afterDataValidRequestService) {
628
+ normalAfterDataValidRequestService = (...arg) => {
629
+ afterDataValidRequestService?.(...arg)
630
+ configAfterDataValidRequestService?.(...arg)
631
+ }
632
+ }
633
+ // 数据校验服务
634
+ const validConfig = lcpPageRuleVOLis[0]
635
+ const valid = await executeDataValid(validConfig, {
636
+ dynamicMapComp,
637
+ requestTraceId,
638
+ rootValue,
639
+ axiosInstance,
640
+ mixinServiceConfig,
641
+ compConfig: props.config,
642
+ confirmInstance,
643
+ builtPolyfillReq,
644
+ beforeRequestService: normalBeforeDataValidRequestService,
645
+ afterRequestService: normalAfterDataValidRequestService,
646
+ lang
647
+ })
648
+ if (!valid) {
649
+ return
650
+ }
618
651
  }
619
652
 
620
653
  if (PageServiceMapVOList?.length) {
@@ -79,6 +79,11 @@ const tableEvents = computed(() => {
79
79
  if (attrs.onRowclick) {
80
80
  attrs.onRowclick?.(e)
81
81
  }
82
+ },
83
+ onTogglelandscape: (e) => {
84
+ if (attrs.onTogglelandscape) {
85
+ attrs.onTogglelandscape?.(e)
86
+ }
82
87
  }
83
88
  }
84
89
  return ret
@@ -213,7 +218,7 @@ function normalTableRowValue(row) {
213
218
  }
214
219
  </script>
215
220
  <template>
216
- <cmi-table ref="tableRef" :key="tableKey" v-bind="tableProps" @rowclick="tableEvents.onRowclick">
221
+ <cmi-table ref="tableRef" :key="tableKey" v-bind="tableProps" @rowclick="tableEvents.onRowclick" @togglelandscape="tableEvents.onTogglelandscape">
217
222
  <cmi-table-column
218
223
  v-for="column in pmPageMetaList" :key="column.metaCode"
219
224
  v-bind="{
@@ -48,7 +48,7 @@ export function usePageConfig() {
48
48
 
49
49
  export function useBuildInData({ messageInstance, loadingInstance, requestTraceId }) {
50
50
  const pageConfig = ref(null)
51
- function getPageConfig(reqData, { configCb, selectsCb}) {
51
+ function getPageConfig(reqData, { configCb, selectsCb, selectPolyReq}) {
52
52
  if (loadingInstance.start && typeof loadingInstance.start === 'function') {
53
53
  loadingInstance.start()
54
54
  } else if (loadingInstance.show && typeof loadingInstance.show === 'function') {
@@ -63,7 +63,10 @@ export function useBuildInData({ messageInstance, loadingInstance, requestTraceI
63
63
  } catch (error) {
64
64
  console.error(error)
65
65
  }
66
- getSelects(ret.data.result?.pmBusinessIdentityVO?.tenantId, selectsCb)
66
+ getSelects({
67
+ tenantId: ret.data.result?.pmBusinessIdentityVO?.tenantId,
68
+ ...(selectPolyReq || {})
69
+ }, selectsCb)
67
70
  return
68
71
  } else {
69
72
  if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
@@ -81,9 +84,9 @@ export function useBuildInData({ messageInstance, loadingInstance, requestTraceI
81
84
  })
82
85
  }
83
86
  const selects = ref({})
84
- function getSelects(tenantId, selectsCb) {
87
+ function getSelects(req, selectsCb) {
85
88
  buildInRequest(GET_SYS_PARAM_CACHE, {
86
- tenantId
89
+ ...(req || {})
87
90
  }).then(ret => {
88
91
  if (resultToast(ret.data, messageInstance, { noSuccessIip: true })) {
89
92
  selects.value = JSON.parse(ret.data.result || '{}')
package/src/index.jsx CHANGED
@@ -132,6 +132,11 @@ export default {
132
132
  type: Object,
133
133
  default: () => ({})
134
134
  },
135
+ // 外部传入,给所有的内置接口的额外参数
136
+ builtPolyfillReq: {
137
+ type: Object,
138
+ default: () => ({})
139
+ },
135
140
  },
136
141
  emits: ['update:modelValue', 'rootStoreChange'],
137
142
  setup(props, { emit, attrs, expose }) {
@@ -220,6 +225,8 @@ export default {
220
225
  })
221
226
  toExecuteLoadServices()
222
227
  })
228
+
229
+ provide('_builtPolyfillReq', props.builtPolyfillReq)
223
230
  provide('_loadModuleCache', props.loadModuleCache)
224
231
  provide('_ruleExecuter', ruleExecuter)
225
232
  provide('_toExecuteLoadServices', toExecuteLoadServices)
@@ -28,7 +28,12 @@ const props = defineProps({
28
28
  loadConfigReq: {
29
29
  type: Object,
30
30
  default: () => ({})
31
- }
31
+ },
32
+ // 外部传入,给所有的内置接口的额外参数
33
+ builtPolyfillReq: {
34
+ type: Object,
35
+ default: () => ({})
36
+ },
32
37
  })
33
38
  defineOptions({
34
39
  inheritAttrs: false
@@ -40,6 +45,7 @@ getPageConfig({
40
45
  busiIdentityId: props.busiIdentityId,
41
46
  queryPageMeta: '1',
42
47
  queryPageService: '1',
48
+ ...(props.builtPolyfillReq || {}),
43
49
  ...(props.loadConfigReq || {})
44
50
  }, {
45
51
  configCb: (pageConfig) => {
@@ -50,6 +56,9 @@ getPageConfig({
50
56
  // 配置数据加载完成事件 'loadedConfigCompeted'
51
57
  attrs?.onLoadedSelectsCompeted?.(selects)
52
58
  },
59
+ selectPolyReq: {
60
+ ...(props.builtPolyfillReq || {}),
61
+ }
53
62
  })
54
63
  const allSelects = computed(() => {
55
64
  return {
@@ -89,6 +98,7 @@ defineExpose({
89
98
  :getNativeComps="props.getNativeComps"
90
99
  :config="pageConfig || null"
91
100
  :selects="allSelects"
101
+ :builtPolyfillReq="props.builtPolyfillReq"
92
102
  :requestTraceId="props.requestTraceId"
93
103
  ></Resolver>
94
104
  </template>