resolver-egretimp-plus 0.1.138 → 0.1.140

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/index.js CHANGED
@@ -2,7 +2,6 @@ export { default as Renderer} from './src/renderer.jsx'
2
2
  import { normalPageConfigs } from './src/components/helper/resolver.js'
3
3
  import { commonPropsType } from './src/utils/index.js'
4
4
 
5
-
6
5
  const componentPropsType = Object.keys(commonPropsType).reduce((ret, key) => {
7
6
  ret[key] = {
8
7
  ...commonPropsType[key]
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.140",
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 {
@@ -494,7 +496,7 @@ export default {
494
496
  return []
495
497
  }
496
498
  // 进行统计的计算
497
- const row = (tableData.value || []).reduce((total, row) => {
499
+ const row = (modelValue.value || []).reduce((total, row) => {
498
500
  normalTotalCodes.value.forEach(codeInfo => {
499
501
  const { code, totalFn } = codeInfo
500
502
  total[code] = totalFn(total[code], row[code], row)
@@ -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
  })
@@ -1,7 +1,7 @@
1
1
  import { ElSelect, ElOption, ElSelectV2 } from 'element-plus'
2
2
  import { computed, inject, onMounted, watch} from 'vue'
3
3
  import { commonPropsType, hasOwn, isArray, isNumber, isPlainObject, isString, VALUE_TYPES } from '../../utils/index.js'
4
- import OptionsDefault from '../options/optionsDefault.vue'
4
+ import OptionsDefault from '../options/OptionsDefault.vue'
5
5
 
6
6
  export default {
7
7
  inheritAttrs: false,
@@ -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 {
@@ -1029,7 +1029,8 @@ function generateFormItemPc (config, lang, compProps, params,) {
1029
1029
  let isFormItem = false
1030
1030
  let props = {}
1031
1031
  let propsKeys
1032
- let slotName = 'default'
1032
+ let formContentSlot = 'default'
1033
+ let formLabelSlot = 'label'
1033
1034
  let formItemComp = resolveComponent('el-form-item')
1034
1035
  if (formItemComp) {
1035
1036
  isFormItem = true
@@ -1044,7 +1045,10 @@ function generateFormItemPc (config, lang, compProps, params,) {
1044
1045
  }
1045
1046
  if (isFormItem) {
1046
1047
  if (config.formItemSlot === 'label') {
1047
- slotName = 'label'
1048
+ formContentSlot = 'label'
1049
+ }
1050
+ if (config.formItemLabelSlot === 'content' || config.formItemLabelSlot === 'default') {
1051
+ formLabelSlot = 'default'
1048
1052
  }
1049
1053
  props = {
1050
1054
  ...props,
@@ -1098,9 +1102,11 @@ function generateFormItemPc (config, lang, compProps, params,) {
1098
1102
  const slots = {
1099
1103
  error: (info) => createFormLabelErrorTip(info, config, lang)
1100
1104
  }
1101
- slots[slotName] = () => node
1102
- if (isFormItem && slotName !== 'label') {
1103
- slots.label = () => createFormLable(config, lang)
1105
+ slots[formContentSlot] = () => node
1106
+ if (isFormItem) {
1107
+ if (formContentSlot !== 'label' || formLabelSlot !== 'label') {
1108
+ slots[formLabelSlot] = () => createFormLable(config, lang)
1109
+ }
1104
1110
  }
1105
1111
 
1106
1112
  return (