resolver-egretimp-plus 0.0.106 → 0.0.108

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.106",
3
+ "version": "0.0.108",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -86,9 +86,17 @@ export default {
86
86
  if (props.config.onMounted) {
87
87
  let onMounted = props.config.onMounted
88
88
  if (typeof onMounted === 'string') {
89
- onMounted = eval(`(function({props, e, selects}) {
90
- ${props.config.onMounted}
91
- })`)
89
+ try {
90
+ onMounted = eval(`(function({props, e, selects}) {
91
+ try {
92
+ ${props.config.onMounted}
93
+ } catch (error) {
94
+ console.error('error===:', props, error)
95
+ }
96
+ })`)
97
+ } catch (error) {
98
+ console.error('error===:',props, error)
99
+ }
92
100
  }
93
101
  typeof onMounted === 'function' && onMounted({props, e, selects})
94
102
  }
@@ -3,6 +3,7 @@ import { computed, defineAsyncComponent, ref } from 'vue';
3
3
  import { ElDialog } from 'element-plus';
4
4
  import zhCn from 'element-plus/es/locale/lang/zh-cn'
5
5
  import en from 'element-plus/es/locale/lang/en'
6
+ import { hasOwn } from '../../../utils';
6
7
  const Resolver = defineAsyncComponent(() => import('../../../resolver-web.vue'))
7
8
 
8
9
  const props = defineProps({
@@ -76,7 +77,9 @@ const dialogStyle = computed(() => {
76
77
 
77
78
  const dialogProps = computed(() => {
78
79
  const ret = Object.keys(ElDialog.props).reduce((ret, key) => {
79
- ret[key] = props.dialogProps[key]
80
+ if (hasOwn(props.dialogProps, key)) {
81
+ ret[key] = props.dialogProps[key]
82
+ }
80
83
  return ret
81
84
  }, {})
82
85
  return ret
@@ -104,6 +107,7 @@ defineExpose({
104
107
  <ElConfigProvider :locale="locale">
105
108
  <ElDialog class="open-child-frame"
106
109
  :close-on-click-modal="false"
110
+ :show-close="false"
107
111
  v-bind="dialogProps"
108
112
  :width="dialogWidth"
109
113
  v-model="dialogVisible"
@@ -284,17 +284,7 @@ export function openDailg({
284
284
  initOutParamData(outParamMappingList, {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat, outResult: outData})
285
285
  dialogClose?.()
286
286
 
287
- // 定义的请求后钩子
288
- const afterOpenDialog = compConfig?.afterOpenDialog
289
- afterOpenDialog && afterOpenDialog({
290
- dynamicMapComp,
291
- rootValue,
292
- dynamicHireRelat,
293
- compConfig,
294
- pagePopupMap,
295
- inputParams: reqData,
296
- outputParams: outData
297
- })
287
+ toAfterOpenDialog(outData)
298
288
  }
299
289
  }
300
290
  }
@@ -305,6 +295,7 @@ export function openDailg({
305
295
  return {
306
296
  onClick() {
307
297
  dialogClose?.()
298
+ toAfterOpenDialog()
308
299
  }
309
300
  }
310
301
  }
@@ -344,10 +335,30 @@ export function openDailg({
344
335
  toOpenDialog()
345
336
  }
346
337
 
338
+ function toAfterOpenDialog(outputParams) {
339
+ // 定义的请求后钩子
340
+ const afterOpenDialog = compConfig?.afterOpenDialog
341
+ afterOpenDialog && afterOpenDialog({
342
+ dynamicMapComp,
343
+ rootValue,
344
+ dynamicHireRelat,
345
+ compConfig,
346
+ pagePopupMap,
347
+ inputParams: reqData,
348
+ outputParams,
349
+ })
350
+ }
351
+
347
352
  function toOpenDialog() {
348
353
  dialogClose = openChildDialog({
354
+
349
355
  buttonActions,
350
- dialogProps,
356
+ dialogProps: {
357
+ ...(dialogProps || {}),
358
+ beforeClose: () => {
359
+ toAfterOpenDialog()
360
+ },
361
+ },
351
362
  parentRootValue: rootValue,
352
363
  selectionsObj,
353
364
  busiIdentityId,
@@ -47,7 +47,7 @@ function toCollapse() {
47
47
  </script>
48
48
  <template>
49
49
  <cmi-card v-bind="{...cmiProps, ...attrs}">
50
- <div slot="content" :style="{'background-color': cmiProps.cardbgcolor}">
50
+ <div slot="content">
51
51
  <Renderer :config="showPageMeteList" v-model="modelValue"></Renderer>
52
52
  <div v-if="showCollapseBtn" class="collapse-wrap">
53
53
  <cmi-button type="text" size="small" @click="toCollapse">
@@ -62,9 +62,4 @@ function toCollapse() {
62
62
  display: flex;
63
63
  justify-content: end;
64
64
  }
65
- cmi-card {
66
- cmi-form-item {
67
- background-color: transparent;
68
- }
69
- }
70
65
  </style>
@@ -53,7 +53,7 @@ const normalPageTotal = computed(() => {
53
53
  const paginationProps = computed(() => {
54
54
  return {
55
55
  pagesizes: props.config?.pagesizes || [3, 10, 20, 50],
56
- showHomeEnd: hasOwn(props.config, 'showHomeEnd') ? props.config.showHomeEnd === '1' : hasOwn(props.config, 'show-home-end') ? props.config['show-home-end'] === '1' : false,
56
+ showHomeEnd: hasOwn(props.config, 'showHomeEnd') ? props.config.showHomeEnd === '1' : hasOwn(props.config, 'show-home-end') ? props.config['show-home-end'] === '1' : true,
57
57
  }
58
58
  })
59
59
  const pagenationEvents = computed(() => {
@@ -213,10 +213,9 @@ function normalTableRowValue(row) {
213
213
  >
214
214
  </cmi-table-column>
215
215
  </cmi-table>
216
- <div v-if="pageable && normalPageTotal > 3" :style="{'display': 'flex', 'justify-content': pageAlignEnmu[pageAlign || PAGE_CENTER]}" style="margin-bottom: 12px;">
216
+ <div v-if="pageable && normalPageTotal > 3" :style="{'justify-content': pageAlignEnmu[pageAlign || PAGE_RIGHT]}" style="margin-bottom: 12px;">
217
217
  <cmi-pagination
218
218
  :key="normalPageTotal"
219
- style="border-radius: 8px;border: 1px solid rgba(219,219,219,1);"
220
219
  v-bind="{...paginationProps, ...pagenationEvents}"
221
220
  @sizeChange="pagenationEvents.onSizeChange"
222
221
  @currentChange="pagenationEvents.onCurrentChange"
@@ -66,22 +66,25 @@ let promiseReject = null
66
66
  // 初始化handlePromise为一个计算属性,为了获取引用次数
67
67
  let referenceCount = 0
68
68
  let handleProValue = null
69
- props.config.handlePromise = computed({
70
- get() {
71
- referenceCount ++
72
- return handleProValue
73
- },
74
- set(val) {
75
- referenceCount = 0
76
- handleProValue = val
77
- }
78
- })
69
+ function initHandlePromise() {
70
+ props.config.handlePromise = computed({
71
+ get() {
72
+ referenceCount ++
73
+ return handleProValue
74
+ },
75
+ set(val) {
76
+ referenceCount = 0
77
+ handleProValue = val
78
+ }
79
+ })
80
+ }
79
81
 
80
82
  const dialogValue = computed({
81
83
  get() {
82
84
  const val = props?.config?.dialogVisible
83
85
  if (showCloseButton.value || showConfirmButton.value) {
84
86
  if (val) {
87
+ initHandlePromise()
85
88
  props.config.handlePromise = new Promise((res, rej) => {
86
89
  promiseResolve = res
87
90
  promiseReject = rej
@@ -142,6 +145,9 @@ const toConfirm = async () => {
142
145
  if (res) {
143
146
  dialogValue.value = false
144
147
  }
148
+ if (!res) {
149
+ initHandlePromise()
150
+ }
145
151
  props.config.handlePromise = new Promise((res, rej) => {
146
152
  promiseResolve = res
147
153
  promiseReject = rej
@@ -161,6 +167,9 @@ const toClose = async () => {
161
167
  if (res) {
162
168
  dialogValue.value = false
163
169
  }
170
+ if (!res) {
171
+ initHandlePromise()
172
+ }
164
173
  props.config.handlePromise = new Promise((res, rej) => {
165
174
  promiseResolve = res
166
175
  promiseReject = rej