resolver-egretimp-plus 0.0.237 → 0.0.238

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.237",
3
+ "version": "0.0.238",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -14,7 +14,15 @@ export default {
14
14
  ...ElTable.props,
15
15
  ...ElPagination.props
16
16
  },
17
- setup(props, { expose, attrs }) {
17
+ setup(props, { expose, attrs, emit }) {
18
+ const modelValue = computed({
19
+ get() {
20
+ return props.modelValue
21
+ },
22
+ set(val) {
23
+ emit('update:modelValue', val)
24
+ }
25
+ })
18
26
  const tableProps = computed(() => {
19
27
  const porpsObj = Object.keys(ElTable.props).reduce((ret, key) => {
20
28
  if (props[key] !== undefined && props[key] !== null) {
@@ -91,13 +99,13 @@ export default {
91
99
  return props.config?.frontPageFlag == '1'
92
100
  })
93
101
  const normalPageTotal = computed(() => {
94
- return !isFrontPage.value ? page.total : ((props.refValue.value || [])?.length || 0)
102
+ return !isFrontPage.value ? page.total : ((modelValue.value || [])?.length || 0)
95
103
  })
96
104
 
97
105
  const normalTableData = computed(() => {
98
106
  return !isFrontPage.value ?
99
- (props.refValue.value || []) :
100
- (props.refValue.value || []).slice((page.pageNum - 1) * page.pageSize, page.pageNum * page.pageSize)
107
+ (modelValue.value || []) :
108
+ (modelValue.value || []).slice((page.pageNum - 1) * page.pageSize, page.pageNum * page.pageSize)
101
109
  })
102
110
 
103
111
  /** 自定义排序逻辑 ===start==== */
@@ -236,10 +244,10 @@ export default {
236
244
  return tableData.value?.[idx]
237
245
  }
238
246
  const onUpdateModelValue = (val, idx) => {
239
- if (!props.refValue.value) {
240
- props.refValue.value = []
247
+ if (!modelValue.value) {
248
+ modelValue.value = []
241
249
  }
242
- props.refValue.value[idx] = val
250
+ modelValue.value[idx] = val
243
251
  }
244
252
 
245
253
  const multiPmPageMetaList = computed(() => {
@@ -409,10 +417,10 @@ export default {
409
417
  if (ret) {
410
418
  if (isPromise(ret)) {
411
419
  ret.then((res) => {
412
- res && (props.refValue.value = res)
420
+ res && (modelValue.value = res)
413
421
  })
414
422
  } else {
415
- props.refValue.value = ret
423
+ modelValue.value = ret
416
424
  }
417
425
  }
418
426
  })
@@ -423,10 +431,10 @@ export default {
423
431
  if (ret) {
424
432
  if (isPromise(ret)) {
425
433
  ret.then((res) => {
426
- res && (props.refValue.value = res)
434
+ res && (modelValue.value = res)
427
435
  })
428
436
  } else {
429
- props.refValue.value = ret
437
+ modelValue.value = ret
430
438
  }
431
439
  }
432
440
  })
@@ -90,7 +90,11 @@ export function useVModel(config, props, emit, modelKey = 'update:modelValue') {
90
90
  // 这边的值没有变,就不用出触发下面的其他动作了
91
91
  return
92
92
  }
93
- props.modelValue[metaCode] = val
93
+ try {
94
+ props.modelValue[metaCode] = val
95
+ } catch (error) {
96
+ console.log('config', config, metaCode)
97
+ }
94
98
  }
95
99
  if (config) {
96
100
  setTimeout(() => {
@@ -476,7 +476,10 @@ export function createEmptyCopy(source, cache = new WeakMap()) {
476
476
  copy = {};
477
477
  cache.set(source, copy);
478
478
  for (const key of Object.keys(source)) {
479
- copy[key] = createEmptyCopy(source[key], cache);
479
+ const val = createEmptyCopy(source[key], cache)
480
+ if ( val !== null && val !== undefined) {
481
+ copy[key] = val
482
+ }
480
483
  }
481
484
  }
482
485
 
@@ -107,7 +107,7 @@ export const commonPropsType = {
107
107
  },
108
108
  // 组件是否展示必填标识
109
109
  onlyRequiredFlag: {
110
- type: Boolean,
110
+ type: [Boolean, String, Number],
111
111
  default: false,
112
112
  getValue(config, props, modelValue) {
113
113
  return config.onlyRequiredFlag
@@ -22,9 +22,10 @@ export default function defaultVal(config) {
22
22
  defaultVal = configDefaultVal
23
23
  }
24
24
  }
25
+ console.log(`${config.dynamicHireRelat},${config.hireRelat} to set defaultValue, ${defaultVal}`)
26
+ config.refValue = defaultVal
25
27
  } catch (error) {
26
- console.log('set default val fail, config', config)
28
+ console.log('set default val fail, config', config, error)
27
29
  }
28
- config.refValue = defaultVal
29
30
  }
30
31
  }