resolver-egretimp-plus 0.1.108 → 0.1.110

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.
@@ -8,7 +8,7 @@ const props = defineProps({
8
8
  busiIdentityId: String,
9
9
  selects: {
10
10
  type: Object,
11
- default: () => ({})
11
+ default: () => ({_default: true})
12
12
  },
13
13
  getNativeComps: {
14
14
  type: Function,
@@ -38,43 +38,51 @@ const props = defineProps({
38
38
  type: Object,
39
39
  default: () => ({})
40
40
  },
41
+ // 外部传入的config
42
+ nativeConfig: [Object, Array]
41
43
  })
44
+ const selectsLoad = ref(true)
42
45
  defineOptions({
43
46
  inheritAttrs: false
44
47
  })
45
- const loadSelects = ref({})
46
48
  const attrs = useAttrs()
47
- const allSelects = computed(() => {
48
- return {
49
- ...loadSelects.value,
50
- ...(props.selects || {})
51
- }
52
- })
49
+
53
50
  initInterceptors(props.messageInstance)
54
51
  const { getPageConfig, pageConfig, selects } = useBuildInData({messageInstance: props.messageInstance, loadingInstance: props.loadingInstance, requestTraceId: props.requestTraceId})
55
- getPageConfig({
56
- busiIdentityId: props.busiIdentityId,
57
- queryPageMeta: '1',
58
- queryPageService: '1',
59
- ...(props.builtPolyfillReq || {}),
60
- ...(props.loadConfigReq || {})
61
- }, {
62
- configCb: (pageConfig) => {
63
- // 配置数据加载完成事件 'loadedConfigCompeted'
64
- attrs?.onLoadedConfigCompeted?.(pageConfig)
65
- },
66
- selectsCb: (selects) => {
67
- // 配置数据加载完成事件 'loadedConfigCompeted'
68
- // Object.keys(selects || {}).forEach(key => {
69
- // props.selects[key] = selects[key]
70
- // })
71
- loadSelects.value = selects
72
- attrs?.onLoadedSelectsCompeted?.(allSelects.value)
73
- },
74
- selectPolyReq: {
75
- ...(props.builtPolyfillReq || {}),
52
+ if (!props.nativeConfig) {
53
+ if (props.selects?._default) {
54
+ // 没有传selects对象的时候,在selectsCb中设置props.selects属性,是不会响应式的,所以这边需要进行逻辑控制
55
+ selectsLoad.value = false
76
56
  }
77
- })
57
+ getPageConfig({
58
+ busiIdentityId: props.busiIdentityId,
59
+ queryPageMeta: '1',
60
+ queryPageService: '1',
61
+ ...(props.builtPolyfillReq || {}),
62
+ ...(props.loadConfigReq || {})
63
+ }, {
64
+ configCb: (pageConfig) => {
65
+ // 配置数据加载完成事件 'loadedConfigCompeted'
66
+ attrs?.onLoadedConfigCompeted?.(pageConfig)
67
+ },
68
+ selectsCb: (selects) => {
69
+ // 配置数据加载完成事件 'loadedConfigCompeted'
70
+ Object.keys(selects || {}).forEach(key => {
71
+ props.selects[key] = selects[key]
72
+ })
73
+ attrs?.onLoadedSelectsCompeted?.(props.selects)
74
+ if (props.selects?._default) {
75
+ // 没有传selects对象的时候,在selectsCb中设置props.selects属性,是不会响应式的,所以这边需要进行逻辑控制
76
+ selectsLoad.value = true
77
+ }
78
+ },
79
+ selectPolyReq: {
80
+ ...(props.builtPolyfillReq || {}),
81
+ }
82
+ })
83
+ } else {
84
+ pageConfig.value = props.nativeConfig
85
+ }
78
86
 
79
87
  const resolverRef = ref(null)
80
88
  defineExpose({
@@ -106,7 +114,7 @@ defineExpose({
106
114
  </script>
107
115
  <template>
108
116
  <Resolver
109
- v-if="pageConfig"
117
+ v-if="pageConfig && selectsLoad"
110
118
  ref="resolverRef"
111
119
  v-bind="attrs"
112
120
  :loadingInstance="props.loadingInstance"
@@ -114,7 +122,7 @@ defineExpose({
114
122
  :getNativeComps="props.getNativeComps"
115
123
  :copyModal="props.copyModal"
116
124
  :config="pageConfig || null"
117
- :selects="allSelects"
125
+ :selects="props.selects"
118
126
  :builtPolyfillReq="props.builtPolyfillReq"
119
127
  :requestTraceId="props.requestTraceId"
120
128
  ></Resolver>
@@ -1,5 +1,5 @@
1
1
  @mixin hiddenColumn {
2
- .hidden-column {
2
+ .hidden-column.hidden-column {
3
3
  border: none;
4
4
  overflow: hidden;
5
5
  // display: none;
@@ -156,15 +156,41 @@
156
156
  }
157
157
  // table-v2
158
158
  .table-border {
159
+ --el-table-header-bg-color: #f5f6f7;
160
+ --el-table-header-text-color: #646a73;
161
+
159
162
  border: 1px solid var(--el-table-border-color);
160
163
  border-radius: var(--boder-radius);
161
164
  overflow: hidden;
162
165
 
163
- }
164
- .el-table-v2__header-cell,.el-table-v2__row-cell {
165
- border-right: var(--el-table-border);
166
- &:last-of-type {
167
- border-right: none;
166
+ .el-table-v2__header-cell,.el-table-v2__row-cell {
167
+ border-right: var(--el-table-border);
168
+ &:last-of-type {
169
+ border-right: none;
170
+ }
171
+ }
172
+
173
+ .table-head-cell {
174
+ // background-color: var(--el-table-header-bg-color);
175
+ font-weight: 400;
176
+ padding: 0;
177
+ }
178
+ .table-body-cell {
179
+ padding: 0;
180
+ }
181
+ .table-v2-cell {
182
+ padding: 0 16px;
183
+ width: 100%;
184
+ }
185
+ .table-v2-common-row {
186
+ border-bottom: none;
187
+ }
188
+ .table-v2-striped {
189
+ background-color: var(--el-fill-color-lighter);
190
+ }
191
+ .el-table-v2__header-row {
192
+ background-color: var(--el-table-header-bg-color);
193
+ padding-inline-end: unset;
168
194
  }
169
195
  }
170
196
  .flex-grow-import {
@@ -597,4 +597,64 @@ export function assignmentPathVal(obj = {}, path, val) {
597
597
  currentObj = currentObj[item]
598
598
  }
599
599
  })
600
- }
600
+ }
601
+
602
+ export function eleIsOverflow(e) {
603
+ // 判断是否text-overflow, 如果是就显示tooltip
604
+ const cellChild = e.target
605
+ if (!cellChild.childNodes.length) {
606
+ return
607
+ }
608
+ // use range width instead of scrollWidth to determine whether the text is overflowing
609
+ // to address a potential FireFox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1074543#c3
610
+ const range = document.createRange()
611
+ range.setStart(cellChild, 0)
612
+ range.setEnd(cellChild, cellChild.childNodes.length)
613
+
614
+ let { width: rangeWidth, height: rangeHeight } = range.getBoundingClientRect()
615
+ const offsetWidth = rangeWidth - Math.floor(rangeWidth)
616
+ let { width: cellChildWidth, height: cellChildHeight } = cellChild.getBoundingClientRect()
617
+ cellChildWidth = Math.ceil(cellChildWidth)
618
+ if (offsetWidth < 0.001) {
619
+ rangeWidth = Math.floor(rangeWidth)
620
+ }
621
+ const offsetHeight = rangeHeight - Math.floor(rangeHeight)
622
+ if (offsetHeight < 0.001) {
623
+ rangeHeight = Math.floor(rangeHeight)
624
+ }
625
+
626
+ const { top, left, right, bottom } = getPadding(cellChild)
627
+ const horizontalPadding = left + right
628
+ const verticalPadding = top + bottom
629
+
630
+ let ret = {}
631
+ if (
632
+ isGreaterThan(rangeWidth + horizontalPadding, cellChildWidth) ||
633
+ isGreaterThan(rangeHeight + verticalPadding, cellChildHeight) ||
634
+ // When using a high-resolution screen, it is possible that a returns cellChild.scrollWidth value of 1921 and
635
+ // cellChildWidth returns a value of 1920.994140625. #16856 #16673
636
+ isGreaterThan(cellChild.scrollWidth, cellChildWidth)
637
+ ) {
638
+ ret.overflow = true
639
+ ret.content = cellChild.innerText || cellChild.textContent
640
+ }
641
+ return ret
642
+ }
643
+
644
+ function getPadding(el) {
645
+ const style = window.getComputedStyle(el, null)
646
+ const paddingLeft = Number.parseInt(style.paddingLeft, 10) || 0
647
+ const paddingRight = Number.parseInt(style.paddingRight, 10) || 0
648
+ const paddingTop = Number.parseInt(style.paddingTop, 10) || 0
649
+ const paddingBottom = Number.parseInt(style.paddingBottom, 10) || 0
650
+ return {
651
+ left: paddingLeft,
652
+ right: paddingRight,
653
+ top: paddingTop,
654
+ bottom: paddingBottom,
655
+ }
656
+ }
657
+
658
+ function isGreaterThan(a, b, epsilon = 0.01) {
659
+ return a - b > epsilon
660
+ }
@@ -199,7 +199,6 @@ export function normalConfig({
199
199
  parent: null, // 这个是执行过程中,动态获取的
200
200
  dynamicHireRelat: '', // 这个也是执行过程中,动态获取的层级
201
201
  }
202
-
203
202
  let extendAttrObj = parseExtendAttr(config)
204
203
  let extendObj = {
205
204
  removeCol: findComponent(NOT_NEED_COL_ITEM_META_TYPE, extendAttrObj.renderby) !== -1 || findComponent(NOT_NEED_COL_ITEM_META_TYPE, metaType) !== -1,
@@ -449,6 +448,7 @@ export function getComponentForConfig({messageInstance, config, disabled, getNat
449
448
  renderbyComp = <div>not component</div>
450
449
  }
451
450
  }
451
+
452
452
  component = renderbyComp || component
453
453
  }
454
454
  return component
@@ -809,7 +809,7 @@ function getFormItemExtendProps(config, lang, params, compProps) {
809
809
  }
810
810
  }
811
811
 
812
- function getFormItemRule(config, lang, params, compProps) {
812
+ export function getFormItemRule(config, lang, params, compProps) {
813
813
  const required = config.requiredFlag == '1'
814
814
  const onlyRequiredFlag = config.onlyRequiredFlag
815
815
  let trigger = ['blur', 'change']