resolver-egretimp-plus 0.1.115 → 0.1.116

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.
@@ -569,34 +569,42 @@ function normalizeNumberString(numStr) {
569
569
  }
570
570
 
571
571
 
572
- export function getPathVal(obj = {}, path) {
572
+ export function getPathVal(obj = {}, path, separator = '.') {
573
573
  let paths = path
574
574
  if (typeof path === 'string') {
575
- paths = path.split('.')
575
+ paths = path.split(separator)
576
576
  }
577
577
  return paths.reduce((ret, key) => {
578
578
  if (ret) {
579
+ const match = key.match(/^(\w+)\[(\d+)\]/)
580
+ if (match) {
581
+ return ret[match[1]]?.[match[2]]
582
+ }
579
583
  return ret[key]
580
584
  }
581
585
  return null
582
586
  }, obj) ?? ''
583
587
  }
584
- export function assignmentPathVal(obj = {}, path, val) {
585
- let paths = path
586
- if (typeof path === 'string') {
587
- paths = path.split('.')
588
- }
589
- let currentObj = obj
590
- paths.forEach((item, idx) => {
591
- if (idx + 1 === paths.length) {
592
- currentObj[item] = val ?? ''
593
- } else {
594
- if (!currentObj[item]) {
595
- currentObj[item] = {}
588
+
589
+ export function assignmentPathVal(obj = {}, path, val, separator = '.') {
590
+ if (path && obj) {
591
+ let beginObj = obj
592
+ if (isRef(obj)) {
593
+ beginObj = obj.value
594
+ }
595
+ const keyArr = path.split(separator)
596
+ keyArr.reduce((ret, code, idx) => {
597
+ if (idx === keyArr.length - 1) {
598
+ ret[code] = val
599
+ } else {
600
+ !ret[code] && (ret[code] = {})
596
601
  }
597
- currentObj = currentObj[item]
602
+ return ret[code]
603
+ }, beginObj)
604
+ if (isRef(obj)) {
605
+ obj.value = beginObj
598
606
  }
599
- })
607
+ }
600
608
  }
601
609
 
602
610
  export function eleIsOverflow(e) {
@@ -46,6 +46,7 @@ export const NOT_NEED_FORM_ITEM_META_TYPE = [
46
46
  ]
47
47
  export const EXECTE_CLICK_EVENT_COMPONENTS = ['ElInput', 'ElButton', 'CmiInput', 'CmiButton', 'ElText']
48
48
  export const TRANS_CELL_COMPONETS = ['CmiInput', 'CmiSelect', 'CmiPicker']
49
+ export const CYCLE_COMPONETS = ['CustomComponentCycle', 'CustomComponentCycleTabPane', 'CustomComponentTable']
49
50
  export const NOT_NEED_COL_ITEM_META_TYPE = ['CustomComponentTabPane', 'CustomComponentDialog', 'CustomComponentCol', 'CustomComponentTabPaneH5']
50
51
  export const MULTI_PAGE_META_LIST_TYPES = ['CustomComponentTable']
51
52
  export const SPECIAL_SET_FULL_WIDTH_ITEM_META_TYPE = ['el-select', 'el-date-picker', 'el-time-picker', 'el-time-select', 'el-cascader', 'el-input-number', 'CustomComponentTree', 'CustomComponentSteps']
@@ -25,7 +25,8 @@ import {
25
25
  TRANS_CELL_COMPONETS,
26
26
  MODE,
27
27
 
28
- isHidden
28
+ isHidden,
29
+ CYCLE_COMPONETS
29
30
  } from './const.js'
30
31
  import { preserveCheck } from './preserveFunc.js'
31
32
  import { isArray, isFunction, isString } from './is.js'
@@ -355,6 +356,11 @@ function getTableServices(lcpPageServiceMapVOList = [], { dynamicMapComp, dynami
355
356
  }
356
357
  return []
357
358
  }
359
+
360
+ export function isCycleConfig(config) {
361
+ return findComponent(CYCLE_COMPONETS, config.renderby) !== -1 || findComponent(CYCLE_COMPONETS, config.metaType) !== -1
362
+ }
363
+
358
364
  function parsePolyfillConfigs({ polyfillConfigs, instance, parentRootValue, parentDynamicMapComp}, config) {
359
365
  const hireRelat = config.hireRelat
360
366
  const findKeys = Object.keys(polyfillConfigs || {}).filter(key => hireRelat.endsWith(key))
@@ -61,14 +61,18 @@ watch(lasetLimitIdx, (val) => {
61
61
  }
62
62
  if (index === val) {
63
63
  if (item.metaType === 'cmi-cell') {
64
- item.borderHidden = '1'
64
+ if (!showCollapseBtn.value) {
65
+ item.borderHidden = '1'
66
+ }
65
67
  }
66
68
  }
67
69
  }
68
70
  })
69
71
  if (val === -1) {
70
72
  if (lastShowPageMeteItem.value?.metaType === 'cmi-cell') {
71
- lastShowPageMeteItem.value.borderHidden = '1'
73
+ if (!showCollapseBtn.value) {
74
+ lastShowPageMeteItem.value.borderHidden = '1'
75
+ }
72
76
  }
73
77
  }
74
78
  }, {
@@ -1,14 +1,18 @@
1
1
  <template>
2
- <span class="custom-component-plain" :class="classObj" @click="clickAction">{{ props.formatter?.(value) ?? value }}</span>
2
+ <span class="custom-component-plain" :class="classObj" @click.stop.self="clickAction">{{ props.formatter?.(value) ?? value }}</span>
3
3
  </template>
4
4
  <script setup>
5
5
  import { findComponent } from '../../utils/common';
6
6
  import { commonPropsType, PLAIN_TYPE_OPTIONS_COLUMNS } from '../../utils/const' // 这边不能用utils/index去引用,因为这个组件在utils/render.js中被引入了,会造成循环引用
7
- import { computed, defineModel, defineProps, inject, getCurrentInstance, watch, nextTick } from 'vue'
7
+ import { computed, defineModel, inject, getCurrentInstance, watch, nextTick } from 'vue'
8
8
  import dayjs from 'dayjs'
9
9
  import { isNaN } from '../../utils/is';
10
10
  import { useFormItem } from 'element-plus'
11
11
 
12
+ defineOptions({
13
+ inheritAttrs: false
14
+ })
15
+
12
16
  const { formItem: elFormItem } = useFormItem()
13
17
  const modelValue = defineModel()
14
18
  const props = defineProps({
@@ -390,44 +390,44 @@ export default {
390
390
  * multiPmPageMetaList值主要作用是区分列的每一行都需要有单独的config,接口配置返回的只是列的配置,
391
391
  * 所以这边需要单独再坐下处理
392
392
  */
393
- const rowColumnConfgsMap = new Map()
394
- watch(() => {
395
- return tableData?.value?.length
396
- }, (length) => {
397
- let list = []
398
- if (length) {
399
- const newVal = tableData.value
400
- list = newVal?.map?.((row, idx) => {
401
- const columnsCgs = rowColumnConfgsMap.get(row)
402
- if (columnsCgs) {
403
- columnsCgs.forEach(config => {
404
- config.rowIndex = idx
405
- })
406
- return columnsCgs
407
- } else {
408
- const retColumnConfigs = tableColumnConfigs.value.map((config, relIdx) => {
409
- const ret = cloneDeep(config)
410
- if (ret.width && !ret.columnWidth) {
411
- ret.columnWidth = ret.width
412
- delete ret.width
413
- }
414
- ret.columnId = generateUniqueId()
415
- ret.rowIndex = idx
416
- ret.isColumn = true
417
- ret.refConfig = props?.config?.pmPageMetaList?.[relIdx]
418
- ret.parent = props?.config // 这边手动设置一下,防止组件复用的时候不会刷新,造成parent的丢失
419
- return ret
420
- })
421
- rowColumnConfgsMap.set(row, retColumnConfigs)
422
- return retColumnConfigs
423
- }
424
- })
425
- }
426
- definePrivatelyProp(props.config, 'multiPmPageMetaList', list)
427
- }, {
428
- immediate: true,
429
- deep: true,
430
- })
393
+ // const rowColumnConfgsMap = new Map()
394
+ // watch(() => {
395
+ // return tableData?.value?.length
396
+ // }, (length) => {
397
+ // let list = []
398
+ // if (length) {
399
+ // const newVal = tableData.value
400
+ // list = newVal?.map?.((row, idx) => {
401
+ // const columnsCgs = rowColumnConfgsMap.get(row)
402
+ // if (columnsCgs) {
403
+ // columnsCgs.forEach(config => {
404
+ // config.rowIndex = idx
405
+ // })
406
+ // return columnsCgs
407
+ // } else {
408
+ // const retColumnConfigs = tableColumnConfigs.value.map((config, relIdx) => {
409
+ // const ret = cloneDeep(config)
410
+ // if (ret.width && !ret.columnWidth) {
411
+ // ret.columnWidth = ret.width
412
+ // delete ret.width
413
+ // }
414
+ // ret.columnId = generateUniqueId()
415
+ // ret.rowIndex = idx
416
+ // ret.isColumn = true
417
+ // ret.refConfig = props?.config?.pmPageMetaList?.[relIdx]
418
+ // ret.parent = props?.config // 这边手动设置一下,防止组件复用的时候不会刷新,造成parent的丢失
419
+ // return ret
420
+ // })
421
+ // rowColumnConfgsMap.set(row, retColumnConfigs)
422
+ // return retColumnConfigs
423
+ // }
424
+ // })
425
+ // }
426
+ // definePrivatelyProp(props.config, 'multiPmPageMetaList', list)
427
+ // }, {
428
+ // immediate: true,
429
+ // deep: true,
430
+ // })
431
431
  // 统计行定义 ====start======
432
432
  const totalMetaCodes = computed(() => {
433
433
  return props.config?.totalMetaCodes || []
@@ -702,6 +702,7 @@ export default {
702
702
  } else {
703
703
  // const config = columnConfg
704
704
  const config = multiPmPageMetaList.value?.[$index]?.[configIdx]
705
+ debugger
705
706
  retVnode = (
706
707
  tableColumnNotRender(config) ? null :
707
708
  <Renderer key={`${config.columnId}-${config.rowIndex}`} class="error-tip-block" rowScope={{row, $index}} modelValue={getValue($index)} onUpdate:modelValue={(val) => { onUpdateModelValue(val, $index) }} config={config}></Renderer>
@@ -767,7 +768,7 @@ export default {
767
768
  )
768
769
  }
769
770
  return (
770
- <ElTable {...tableProps.value} {...sliceTableEvents.value}
771
+ multiPmPageMetaList.value?.length ? <ElTable {...tableProps.value} {...sliceTableEvents.value}
771
772
  ref={(e) => {tableRef.value = e}}
772
773
  highlight-current-row={selectable.value || tableProps.value?.highlightCurrentRow ? true : false}
773
774
  onCurrentChange={selectable.value || tableProps.value?.highlightCurrentRow ? currentChange : () => {}}
@@ -784,7 +785,7 @@ export default {
784
785
  )
785
786
  })
786
787
  }
787
- </ElTable>
788
+ </ElTable> : null
788
789
  )
789
790
  }
790
791
 
package/src-bak/index.jsx CHANGED
@@ -1,4 +1,4 @@
1
- import { provide, toRef, watch, computed, ref, defineExpose, reactive, getCurrentInstance, toRaw, onMounted } from "vue"
1
+ import { provide, toRef, watch, computed, ref, defineExpose, reactive, getCurrentInstance, toRaw, onMounted, nextTick } from "vue"
2
2
  import Renderer from './renderer.jsx'
3
3
  // import './style/index.scss'
4
4
  import { usePageConfig } from './hooks/pageConfig'
@@ -404,15 +404,18 @@ export default {
404
404
  }
405
405
  })
406
406
 
407
- setTimeout(() => {
408
- if (modelValue.value?.contractTab?.tabPane4?.dictContractCard?.supplierContractInformation) {
409
- modelValue.value.contractTab.tabPane4.dictContractCard.supplierContractInformation.mksReasonOfSupplierList.splice(1, 1)
410
- }
411
- debugger
412
- }, 5000)
413
- setInterval(() => {
414
- console.log('=====pageConfigRef:', pageConfigRef.value)
415
- }, 3000);
407
+ // setTimeout(() => {
408
+ // if (modelValue.value?.contractTab?.tabPane4?.dictContractCard?.supplierContractInformation) {
409
+ // modelValue.value.contractTab.tabPane4.dictContractCard.supplierContractInformation.mksReasonOfSupplierList.splice(1, 1)
410
+ // }
411
+ // debugger
412
+ // Promise.resolve().then(() => {
413
+ // debugger
414
+ // })
415
+ // }, 5000)
416
+ // setInterval(() => {
417
+ // console.log('=====pageConfigRef:', pageConfigRef.value)
418
+ // }, 3000);
416
419
  onMounted(() => {
417
420
  if (props.openBpm) {
418
421
  initBpm(props.bpmMessage, props.bpmActions, props.bpmConfigs, {
@@ -428,13 +431,13 @@ export default {
428
431
  bpmInstance?.insertBtn?.(props.bpmBtns, props.bpmBtnPosition)
429
432
  }
430
433
  })
431
- // return () => {
432
- // if (!pageConfigRef.value) {
433
- // return null
434
- // }
435
- // return (
436
- // <Renderer {...attrs} mode={props.mode} v-model={modelValue.value} config={pageConfigRef.value}></Renderer>
437
- // )
438
- // }
434
+ return () => {
435
+ if (!pageConfigRef.value) {
436
+ return null
437
+ }
438
+ return (
439
+ <Renderer {...attrs} mode={props.mode} v-model={modelValue.value} config={pageConfigRef.value}></Renderer>
440
+ )
441
+ }
439
442
  }
440
443
  }
@@ -103,6 +103,26 @@ function splitRelat(relat) {
103
103
  }
104
104
  }
105
105
 
106
+ function helpOfValueTable({ rule, _mapComp, config}) {
107
+ const events = rule.pmRuleTargetEventVoList.filter(ev => ev.eventId)
108
+ const willDisEvents = events.filter(ev => {
109
+ const { targetObj: target, targetObjVal } = ev
110
+ if (
111
+ config.isColumn &&
112
+ config.hireRelat && target &&
113
+ config.hireRelat.replace(/->\w*$/, '') === target.replace(/->\w*$/, '')
114
+ ) {
115
+ return true
116
+ }
117
+ return false
118
+ })
119
+ if (willDisEvents) {
120
+ config.refConfig._validTableConfig = () => {
121
+
122
+ }
123
+ }
124
+ }
125
+
106
126
  export function runClickRules(rules, isInit) {
107
127
  rules = rules || []
108
128
  if (rules && rules.length) {
@@ -114,5 +134,6 @@ export function runClickRules(rules, isInit) {
114
134
  }
115
135
  }
116
136
 
137
+
117
138
  export { generateConfigsHireRelat } from './ruleUtils'
118
139
  export { getCodeMapRules } from './parseCondition.js'
@@ -198,7 +198,7 @@ export function normalConfig({
198
198
  hireRelat,
199
199
  parent: null, // 这个是执行过程中,动态获取的
200
200
  dynamicHireRelat, // 这个也是执行过程中,动态获取的层级
201
- _rootValue: rootValue
201
+ _rootValue: rootValue,
202
202
  }
203
203
  let extendAttrObj = parseExtendAttr(config)
204
204
  let extendObj = {
@@ -274,9 +274,9 @@ export function normalConfig({
274
274
  config._unPageMetaListWatch?.() // 删除当前的监听
275
275
  const unWatch = watch(() => getPathVal(unref(config._rootValue), config.dynamicHireRelat, '->')?.length, (val) => {
276
276
  config?._unWatchs?.forEach(un => un?.()) // 删除子级的PmPageMetaList监听
277
- if (config.metaId == "366008") {
278
- debugger
279
- }
277
+ // if (config.metaId == "366008") {
278
+ // debugger
279
+ // }
280
280
  const list = getPathVal(unref(config._rootValue), config.dynamicHireRelat, '->')
281
281
  if (list && list.length) {
282
282
  config.multiPmPageMetaList = list.map((row, idx) => {
@@ -307,7 +307,7 @@ export function normalConfig({
307
307
  })
308
308
  }
309
309
  }, {
310
- immediate: true
310
+ immediate: true,
311
311
  })
312
312
  // 这边先执行,因为当前的_unWatchs里面只放子级的watch
313
313
  unWatchsList?.forEach(list => {