resolver-egretimp-plus 0.0.68 → 0.0.69

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.68",
3
+ "version": "0.0.69",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -48,6 +48,7 @@ export default {
48
48
  delete ret.onClick
49
49
  return ret
50
50
  })
51
+ const request_traceId = inject('request_traceId')
51
52
  const polyfillConfigs = inject('_polyfillConfigs', {})
52
53
  const buttonActions = inject('buttonActions', {})
53
54
  const route = useRoute()
@@ -184,6 +185,7 @@ export default {
184
185
  attrs?.onClick?.call(context, e) // 如果配置中有点击事件
185
186
  executeEventOrchestration({
186
187
  props,
188
+ request_traceId: request_traceId?.value,
187
189
  axiosInstance: _axiosInstance?.value,
188
190
  polyfillConfigs,
189
191
  rootValue: rootValue?.value,
@@ -4,16 +4,16 @@ import { getRelateConfigKeys } from "../../rules/ruleUtils"
4
4
  import { RESULT_CODE, resultToast } from "../../utils/respone"
5
5
  import { unionWith } from "../../utils/index"
6
6
 
7
- export async function dispatchClickEvents ({serviceList = [], axiosInstance, dynamicMapComp, rootValue, dynamicHireRelat, messageCb, compConfig, messageInstance}) {
7
+ export async function dispatchClickEvents ({serviceList = [], request_traceId, axiosInstance, dynamicMapComp, rootValue, dynamicHireRelat, messageCb, compConfig, messageInstance}) {
8
8
  const dynamicMapCompKeys = Object.keys(dynamicMapComp)
9
9
  const mixinServiceConfig = serviceList.find(service => service.serviceType === '1')
10
10
  for (let i = 0; i < serviceList.length; i++) {
11
11
  const service = serviceList[i]
12
- dispatchClickEvent(service, {dynamicMapComp, mixinServiceConfig, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageCb, compConfig, messageInstance})
12
+ dispatchClickEvent(service, {dynamicMapComp, request_traceId, mixinServiceConfig, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageCb, compConfig, messageInstance})
13
13
  }
14
14
  }
15
15
 
16
- export async function dispatchClickEvent(service, { dynamicMapComp, mixinServiceConfig, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageCb, compConfig, messageInstance }) {
16
+ export async function dispatchClickEvent(service, { dynamicMapComp, request_traceId, mixinServiceConfig, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageCb, compConfig, messageInstance }) {
17
17
  let reqData = rootValue || {}
18
18
  let tableConfig = null
19
19
  if (service.transactionType == '1') {
@@ -29,7 +29,9 @@ export async function dispatchClickEvent(service, { dynamicMapComp, mixinService
29
29
  url,
30
30
  method: "post",
31
31
  data: {
32
+ request_traceId,
32
33
  pmHandleBusinessIdentity: {
34
+ request_traceId,
33
35
  busiIdentityId: service.busiIdentityId,
34
36
  pageMetaId: service.pageMetaId,
35
37
  tenantId: service.tenantId,
@@ -232,14 +234,16 @@ export function openDailg({
232
234
  }
233
235
 
234
236
  // 数据校验服务
235
- export async function executeDataValid(validConfig, { dynamicMapComp, mixinServiceConfig, rootValue, axiosInstance, lang}) {
237
+ export async function executeDataValid(validConfig, { dynamicMapComp, request_traceId, mixinServiceConfig, rootValue, axiosInstance, lang}) {
236
238
  let reqData = rootValue || {}
237
239
  const url = DATA_VALID_RULE_EXECUTE
238
240
  const ret = await (axiosInstance && axiosInstance({
239
241
  url,
240
242
  method: "post",
241
243
  data: {
244
+ request_traceId,
242
245
  pmHandleBusinessIdentity: {
246
+ request_traceId,
243
247
  busiIdentityId: validConfig.busiIdentityId,
244
248
  pageMetaId: validConfig.pageMetaId,
245
249
  tenantId: validConfig.tenantId,
@@ -303,7 +307,7 @@ function closePage(lcpPageClosedMapVO) {
303
307
  }
304
308
  }
305
309
 
306
- export async function executeEventOrchestration({props, axiosInstance, polyfillConfigs, buttonActions, rootValue, confirmInstance, dynamicMapComp, messageInstance, openChildDialog, messageCb, lang, appContext } = {}) {
310
+ export async function executeEventOrchestration({props, request_traceId, axiosInstance, polyfillConfigs, buttonActions, rootValue, confirmInstance, dynamicMapComp, messageInstance, openChildDialog, messageCb, lang, appContext } = {}) {
307
311
  const lcpPageRuleVOLis = props.config?.lcpPageRuleVOList || []
308
312
  const PageServiceMapVOList = props.config.lcpPageServiceMapVOList || []
309
313
  const mixinServiceConfig = PageServiceMapVOList.find(service => service.serviceType === '1')
@@ -312,6 +316,7 @@ export async function executeEventOrchestration({props, axiosInstance, polyfillC
312
316
  const validConfig = lcpPageRuleVOLis[0]
313
317
  const valid = await executeDataValid(validConfig, {
314
318
  dynamicMapComp,
319
+ request_traceId,
315
320
  rootValue,
316
321
  axiosInstance,
317
322
  mixinServiceConfig,
@@ -327,6 +332,7 @@ export async function executeEventOrchestration({props, axiosInstance, polyfillC
327
332
  dispatchClickEvents({
328
333
  serviceList: PageServiceMapVOList,
329
334
  axiosInstance,
335
+ request_traceId,
330
336
  rootValue,
331
337
  dynamicMapComp,
332
338
  dynamicHireRelat,
@@ -1,6 +1,6 @@
1
1
  import { resultToast } from "../../utils/respone"
2
2
 
3
- export async function executeLoadServices(services = [], { axiosInstance, messageInstance, reqData, respCb }) {
3
+ export async function executeLoadServices(services = [], { request_traceId, axiosInstance, messageInstance, reqData, respCb }) {
4
4
  if (reqData?.notLoad) {
5
5
  return
6
6
  }
@@ -17,7 +17,9 @@ export async function executeLoadServices(services = [], { axiosInstance, messag
17
17
  url,
18
18
  method: "post",
19
19
  data: {
20
+ request_traceId,
20
21
  pmHandleBusinessIdentity: {
22
+ request_traceId,
21
23
  busiIdentityId: service.busiIdentityId,
22
24
  pageMetaId: service.pageMetaId,
23
25
  tenantId: service.tenantId,
@@ -62,6 +62,16 @@ const pagenationEvents = computed(() => {
62
62
  }
63
63
  return ret
64
64
  })
65
+ const tableEvents = computed(() => {
66
+ const ret = {
67
+ onRowclick: (e) => {
68
+ if (attrs.onRowclick) {
69
+ attrs.onRowclick?.(e)
70
+ }
71
+ }
72
+ }
73
+ return ret
74
+ })
65
75
  // 是否配置分页功能 ====== start======
66
76
  const pageable = computed(() => {
67
77
  return props.config?.pageable === '1'
@@ -130,7 +140,7 @@ watch(modelValue, (val) => {
130
140
  })
131
141
  </script>
132
142
  <template>
133
- <cmi-table ref="tableRef" :key="`${tableProps.card}${tableProps.display}`" v-bind="tableProps" :data="normalTableData">
143
+ <cmi-table ref="tableRef" :key="`${tableProps.card}${tableProps.display}`" v-bind="tableProps" :data="normalTableData" @rowclick="tableEvents.onRowclick">
134
144
  <cmi-table-column
135
145
  v-for="column in pmPageMetaList" :key="column.metaCode"
136
146
  v-bind="{
@@ -42,7 +42,7 @@ export function usePageConfig() {
42
42
  }
43
43
  }
44
44
 
45
- export function useBuildInData(messageTipInstance, loadingInstance) {
45
+ export function useBuildInData({ messageInstance, loadingInstance, request_traceId }) {
46
46
  const pageConfig = ref(null)
47
47
  function getPageConfig(reqData, cb) {
48
48
  if (loadingInstance.start && typeof loadingInstance.start === 'function') {
@@ -50,8 +50,8 @@ export function useBuildInData(messageTipInstance, loadingInstance) {
50
50
  } else if (loadingInstance.show && typeof loadingInstance.show === 'function') {
51
51
  loadingInstance.show()
52
52
  }
53
- buildInRequest(QUERY_PAGE_CONFIG_DATA, reqData).then(ret => {
54
- if (resultToast(ret.data, messageTipInstance, { noSuccessIip: true })) {
53
+ buildInRequest(QUERY_PAGE_CONFIG_DATA, {...reqData, request_traceId}).then(ret => {
54
+ if (resultToast(ret.data, messageInstance, { noSuccessIip: true })) {
55
55
  // pageConfig.value = normalPageConfigs(mock)
56
56
  pageConfig.value = normalPageConfigs(ret.data.result)
57
57
  cb(pageConfig.value)
@@ -77,7 +77,7 @@ export function useBuildInData(messageTipInstance, loadingInstance) {
77
77
  buildInRequest(GET_SYS_PARAM_CACHE, {
78
78
  tenantId
79
79
  }).then(ret => {
80
- if (resultToast(ret.data, messageTipInstance, { noSuccessIip: true })) {
80
+ if (resultToast(ret.data, messageInstance, { noSuccessIip: true })) {
81
81
  selects.value = JSON.parse(ret.data.result || '{}')
82
82
  return
83
83
  } else {
package/src/index.jsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import { provide, toRef, watch, computed, ref, defineExpose, reactive, getCurrentInstance } from "vue"
2
2
  import Renderer from './renderer.jsx'
3
3
  // import './style/index.scss'
4
- import { useBuildInData, usePageConfig } from './hooks/pageConfig'
4
+ import { usePageConfig } from './hooks/pageConfig'
5
5
  import { toValidate } from './utils/valid.js'
6
6
  import { MODE } from "./utils/const.js"
7
7
  import { generateRequester } from "./utils/request.js"
@@ -112,6 +112,9 @@ export default {
112
112
  },
113
113
  // 提示语的回调
114
114
  messageCb: Function,
115
+ request_traceId: {
116
+ type: String,
117
+ }
115
118
  },
116
119
  setup(props, { emit, attrs, expose }) {
117
120
  const rootStore = reactive({})
@@ -154,6 +157,7 @@ export default {
154
157
  executeLoadServices(
155
158
  props.config?.pmPageServiceMapVOList || props.config?.lcpPageServiceMapVOList || [],
156
159
  {
160
+ request_traceId: props.request_traceId,
157
161
  messageInstance: toRef(props, 'messageInstance'),
158
162
  axiosInstance,
159
163
  reqData: props.loadEvnetsReq,
@@ -181,6 +185,7 @@ export default {
181
185
  executeLoadServices(
182
186
  props.config?.pmPageServiceMapVOList || [],
183
187
  {
188
+ request_traceId: props.request_traceId,
184
189
  messageInstance: toRef(props, 'messageInstance'),
185
190
  axiosInstance,
186
191
  reqData: props.loadEvnetsReq,
@@ -218,6 +223,7 @@ export default {
218
223
  provide('_parentRootValue', props.parentRootValue)
219
224
  provide('_selectionsObj', props.selectionsObj)
220
225
  provide('_polyfillConfigs', props.polyfillConfigs)
226
+ provide('request_traceId', toRef(props, 'request_traceId')) // 所有渲染器调用的接口,都需要加次参数(生哥提)
221
227
 
222
228
  const rootForm = ref(null)
223
229
  provide('rootForm', rootForm)
@@ -5,6 +5,7 @@ import Resolver from './resolver-common.vue'
5
5
  import CmiToast from "cmid/lib/toast"
6
6
  import CmiFullLoading from "cmid/lib/fullloading"
7
7
  import { confirmDialog } from './components/confirmInstance-H5/index.js';
8
+ import { generateUniqueId } from './utils/common.js';
8
9
 
9
10
  const props = defineProps({
10
11
  loadingInstance: {
@@ -29,6 +30,10 @@ const props = defineProps({
29
30
  return () => {}
30
31
  }
31
32
  },
33
+ request_traceId: {
34
+ type: String,
35
+ default: generateUniqueId()
36
+ }
32
37
  })
33
38
 
34
39
  defineOptions({
@@ -67,5 +72,6 @@ defineExpose({
67
72
  :confirmInstance="props.confirmInstance"
68
73
  :openChildDialogInstance="props.openChildDialogInstance"
69
74
  :loadingInstance="props.loadingInstance"
75
+ :request_traceId="props.request_traceId"
70
76
  ></Resolver>
71
77
  </template>
@@ -22,13 +22,16 @@ const props = defineProps({
22
22
  type: [Object, Function],
23
23
  default: () => null
24
24
  },
25
+ request_traceId: {
26
+ type: String,
27
+ }
25
28
  })
26
29
  defineOptions({
27
30
  inheritAttrs: false
28
31
  })
29
32
  const attrs = useAttrs()
30
33
  initInterceptors(props.messageInstance)
31
- const { getPageConfig, pageConfig, selects } = useBuildInData(props.messageInstance, props.loadingInstance)
34
+ const { getPageConfig, pageConfig, selects } = useBuildInData({messageInstance: props.messageInstance, loadingInstance: props.loadingInstance, request_traceId: props.request_traceId})
32
35
  getPageConfig({
33
36
  busiIdentityId: props.busiIdentityId,
34
37
  queryPageMeta: '1',
@@ -67,5 +70,14 @@ defineExpose({
67
70
  })
68
71
  </script>
69
72
  <template>
70
- <Resolver ref="resolverRef" v-bind="attrs" :loadingInstance="props.loadingInstance" :messageInstance="props.messageInstance" :getNativeComps="props.getNativeComps" :config="pageConfig || null" :selects="allSelects"></Resolver>
73
+ <Resolver
74
+ ref="resolverRef"
75
+ v-bind="attrs"
76
+ :loadingInstance="props.loadingInstance"
77
+ :messageInstance="props.messageInstance"
78
+ :getNativeComps="props.getNativeComps"
79
+ :config="pageConfig || null"
80
+ :selects="allSelects"
81
+ :request_traceId="props.request_traceId"
82
+ ></Resolver>
71
83
  </template>
@@ -5,6 +5,7 @@ import { loadingInstance } from './components/loading'
5
5
  import { computed, ref, useAttrs } from 'vue';
6
6
  import Resolver from './resolver-common.vue'
7
7
  import { openChildDialog } from './components/childDialog';
8
+ import { generateUniqueId } from './utils/common.js';
8
9
 
9
10
  const props = defineProps({
10
11
  loadingInstance: {
@@ -28,6 +29,10 @@ const props = defineProps({
28
29
  return openChildDialog
29
30
  }
30
31
  },
32
+ request_traceId: {
33
+ type: String,
34
+ default: generateUniqueId()
35
+ }
31
36
  })
32
37
 
33
38
  defineOptions({
@@ -66,5 +71,6 @@ defineExpose({
66
71
  :confirmInstance="props.confirmInstance"
67
72
  :openChildDialogInstance="props.openChildDialogInstance"
68
73
  :loadingInstance="props.loadingInstance"
74
+ :request_traceId="props.request_traceId"
69
75
  ></Resolver>
70
76
  </template>
@@ -227,5 +227,33 @@ export function getDate(...arg) {
227
227
  }
228
228
  // 生成唯一值
229
229
  export function generateUniqueId() {
230
- return Date.now().toString(36) + Math.random().toString(36).substr(2, 5);
230
+ return `${getUuid()}-${Date.now()}`;
231
+ }
232
+
233
+ export function getUuid () {
234
+ if (typeof crypto === 'object') {
235
+ if (typeof crypto.randomUUID === 'function') {
236
+ return crypto.randomUUID();
237
+ }
238
+ if (typeof crypto.getRandomValues === 'function' && typeof Uint8Array === 'function') {
239
+ const callback = (c) => {
240
+ const num = Number(c);
241
+ return (num ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (num / 4)))).toString(16);
242
+ };
243
+ return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, callback);
244
+ }
245
+ }
246
+ let timestamp = new Date().getTime();
247
+ let perforNow = (typeof performance !== 'undefined' && performance.now && performance.now() * 1000) || 0;
248
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
249
+ let random = Math.random() * 16;
250
+ if (timestamp > 0) {
251
+ random = (timestamp + random) % 16 | 0;
252
+ timestamp = Math.floor(timestamp / 16);
253
+ } else {
254
+ random = (perforNow + random) % 16 | 0;
255
+ perforNow = Math.floor(perforNow / 16);
256
+ }
257
+ return (c === 'x' ? random : (random & 0x3) | 0x8).toString(16);
258
+ });
231
259
  }