resolver-egretimp-plus 0.1.138 → 0.1.139

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.1.138",
3
+ "version": "0.1.139",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -40,6 +40,7 @@ import { commonPropsType, cloneDeep, definePrivatelyProp } from '../../utils/ind
40
40
  import { TabPane } from '../tabs'
41
41
  import { h } from 'vue'
42
42
  import { useAttrs } from 'vue'
43
+ import { normalRecoverCb } from '../../rules/rulesDriver.js'
43
44
 
44
45
  defineOptions({
45
46
  inheritAttrs: false
@@ -107,6 +108,7 @@ if (!OPEN_DATA_RULES) {
107
108
  if (rowCgs) {
108
109
  rowCgs.forEach(config => {
109
110
  config.rowIndex = idx
111
+ normalRecoverCb(config, idx)
110
112
  })
111
113
  return rowCgs
112
114
  } else {
@@ -1,11 +1,12 @@
1
1
 
2
- import { ElAutoResizer, ElPagination, ElTableV2, formContextKey } from 'element-plus'
2
+ import { ElAutoResizer, ElPagination, ElRadio, ElTableV2, formContextKey } from 'element-plus'
3
3
  import ElTable, { ElTableColumn } from '../table'
4
4
  import Renderer from '../../renderer.jsx'
5
5
  import { computed, inject, watch, h, ref, reactive, onMounted, unref } from 'vue'
6
6
  import { commonPropsType, TABLE_COLUMN_NOT_RENDER_META_TYPE, DISPLAY_SHOW, compareComponet, isPlainObject, hasOwn, cloneDeep, isPromise, isPlainColumn, generateUniqueId, calcDisable, camelize, capitalize, DISPLAY_HIDDEN, definePrivatelyProp, isArray, eleIsOverflow } from '../../utils/index.js'
7
7
  import { getCustomerTableProps, tableValidate } from '../helper/table'
8
8
  import { OPEN_TABLE_DEFAULT_PAGINATION } from '../../config'
9
+ import { normalRecoverCb } from '../../rules/rulesDriver'
9
10
  // import '../styles/CustomComponenTable.scss'
10
11
 
11
12
  export default {
@@ -408,6 +409,7 @@ export default {
408
409
  if (columnsCgs) {
409
410
  columnsCgs.forEach(config => {
410
411
  config.rowIndex = idx
412
+ normalRecoverCb(config, idx)
411
413
  })
412
414
  return columnsCgs
413
415
  } else {
@@ -661,6 +663,7 @@ export default {
661
663
  toopTip.triggerRef = null
662
664
  }
663
665
 
666
+ // 计算表头文字内容的宽度(百分比占位)
664
667
  function calcHeadContextWidth(config) {
665
668
  let jianPX = 0
666
669
  if (config.requiredFlag == '1') {
@@ -674,8 +677,33 @@ export default {
674
677
  }
675
678
  return '100%'
676
679
  }
680
+ // 计算表头容器内容的宽度(百分比占位)
681
+ function calcHeadWrapWidth(config, columnProps) {
682
+ let jianPX = 0
683
+ if (columnProps.sortable) {
684
+ jianPX += 24
685
+ }
686
+ if (jianPX) {
687
+ return `calc(100% - ${jianPX}px)`
688
+ }
689
+ return '100%'
690
+ }
677
691
 
678
- function generateCellSolts(columnConfg, configIdx) {
692
+ function generateSingleSelectColumn() {
693
+ const hasSelectionCol = tableColumnConfigs.value?.some(config => config.type === 'selection' && config.displayType != DISPLAY_HIDDEN)
694
+ return hasSelectionCol ? null : (
695
+ <ElTableColumn width="50px" className="signle-select-wrap">
696
+ <span className="selected-radio">
697
+ <ElRadio modelValue="1" value="1"></ElRadio>
698
+ </span>
699
+ <span className="not-selected-radio">
700
+ <ElRadio modelValue="" value="1"></ElRadio>
701
+ </span>
702
+ </ElTableColumn>
703
+ )
704
+ }
705
+
706
+ function generateCellSolts(columnConfg, configIdx, columnProps) {
679
707
  let headerKey = 'header'
680
708
  let cellKey = 'default'
681
709
  if (isVirtualized.value) {
@@ -685,7 +713,7 @@ export default {
685
713
  return {
686
714
  [headerKey]: () => {
687
715
  let retVnode = (
688
- <div className='head-span-new'>
716
+ <div className='head-span-new' style={{width: calcHeadWrapWidth(columnConfg, columnProps)}}>
689
717
  { columnConfg.requiredFlag == '1' ? <span style="color: rgb(245, 34, 45); margin-right: 3px;">*</span> : '' }
690
718
  <div className='head-span-text' style={{maxWidth: calcHeadContextWidth(columnConfg)}} onMouseenter={(e) => cellMouseEnenter(e)} onMouseleave={(e) => cellMouseout(e)}>
691
719
  { columnConfg.headerRender ? columnConfg.headerRender(h, { props, config: columnConfg, lang, rootValue, selects })
@@ -800,11 +828,18 @@ export default {
800
828
  onSelectionChange={handleSelectionChange}
801
829
  onSortChange={onSortChange}
802
830
  >
831
+ {
832
+ selectable.value || tableProps.value?.highlightCurrentRow ? generateSingleSelectColumn() : null
833
+ }
803
834
  {
804
835
  tableColumnConfigs.value.map((columnConfg, configIdx) => {
805
- return columnConfg.displayType == DISPLAY_HIDDEN ? null : (
806
- <ElTableColumn key={columnConfg.requiredFlag + columnConfg.metaCode} {...getTableColumnProps(columnConfg, configIdx)}>
807
- {generateCellSolts(columnConfg, configIdx)}
836
+ if (columnConfg.displayType == DISPLAY_HIDDEN) {
837
+ return null
838
+ }
839
+ const propObj = getTableColumnProps(columnConfg, configIdx)
840
+ return (
841
+ <ElTableColumn key={columnConfg.requiredFlag + columnConfg.metaCode} {...propObj}>
842
+ {generateCellSolts(columnConfg, configIdx, propObj)}
808
843
  </ElTableColumn>
809
844
  )
810
845
  })
@@ -97,7 +97,7 @@
97
97
  white-space: nowrap;
98
98
  }
99
99
  .head-span-new {
100
- width: 100%;
100
+ display: inline-block;
101
101
  .head-span-text {
102
102
  display: inline-block;
103
103
  vertical-align:bottom;
@@ -220,6 +220,26 @@
220
220
  flex-grow: 1 !important;
221
221
  }
222
222
 
223
+
224
+ .signle-select-wrap {
225
+ .selected-radio {
226
+ display: none
227
+ }
228
+ .not-selected-radio {
229
+ display: block
230
+ }
231
+ }
232
+ .current-row {
233
+ .signle-select-wrap {
234
+ .selected-radio {
235
+ display: block
236
+ }
237
+ .not-selected-radio {
238
+ display: none
239
+ }
240
+ }
241
+ }
242
+
223
243
  @include hiddenColumn;
224
244
 
225
245
  .clear-index {