resolver-egretimp-plus 0.0.258 → 0.0.260

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.258",
3
+ "version": "0.0.260",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <ElText v-bind="{...attrs, ...elRowProps,}" @click="clickAction" >
3
- {{ labelDesc }}
4
- </ElText>
2
+ <!-- <ElText v-bind="{...attrs, ...elTextProps}">{{ labelDesc }}</ElText> -->
3
+ <renderNode></renderNode>
5
4
  </template>
6
5
  <script setup>
7
6
  import { ElText } from 'element-plus'
8
7
  import { computed, defineProps, inject, getCurrentInstance, useAttrs } from 'vue'
9
8
  import { commonPropsType } from '../../utils/index.js'
9
+ import { h } from 'vue'
10
10
 
11
11
  const lang = inject('lang')
12
12
  const modelValue = defineModel()
@@ -14,19 +14,29 @@ const appContext = getCurrentInstance()?.appContext
14
14
  const props = defineProps({
15
15
  ...commonPropsType,
16
16
  ...ElText.props,
17
- fontSize: [String, Number]
17
+ fontSize: [String, Number],
18
+ needWrap: {
19
+ type: [String, Number],
20
+ default: '0'
21
+ },
18
22
  })
19
23
  const attrs = useAttrs()
20
24
 
21
25
  const normalVal = computed(() => {
22
- const findItem = props?.options?.find(item => item.columnValue == modelValue.value)
26
+ let val = (modelValue.value !== null && modelValue.value !== undefined) ? modelValue.value : ''
27
+ try {
28
+ val = JSON.stringify(val)
29
+ } catch (error) {
30
+ val = ''
31
+ }
32
+ const findItem = props?.options?.find(item => item.columnValue == val)
23
33
  if (findItem) {
24
34
  return lang?.value?.indexOf('zh') > -1 ? findItem.columnDesc_zh : findItem.columnDesc
25
35
  }
26
- return modelValue.value
36
+ return val
27
37
  })
28
38
 
29
- const elRowProps = computed(() => {
39
+ const elTextProps = computed(() => {
30
40
  const result = Object.keys(ElText.props).reduce((ret, key) => {
31
41
  ret[key] = props[key]
32
42
  return ret
@@ -38,6 +48,23 @@ const buttonActions = inject('buttonActions', {})
38
48
  const labelDesc = computed(() => {
39
49
  return normalVal.value
40
50
  })
51
+ const renderNode = computed(() => {
52
+ const textNode = h(ElText, {
53
+ ...attrs,
54
+ ...elTextProps.value,
55
+ onClick: () => {
56
+ clickAction()
57
+ }
58
+ }, labelDesc.value)
59
+ if (props.needWrap == '1') {
60
+ return h('div', {
61
+ class: 'cust-input-wrap',
62
+ }, [textNode])
63
+ } else {
64
+ return textNode
65
+ }
66
+ })
67
+
41
68
  const dynamicMapComp = inject('dynamicMapComp')
42
69
  const hireRelatMapRules = inject('hireRelatMapRules')
43
70
  const components = inject('components')
@@ -61,3 +88,19 @@ const clickAction = (e) => {
61
88
  }, appContext)
62
89
  }
63
90
  </script>
91
+ <style lang="scss" scoped>
92
+ .cust-input-wrap {
93
+ display: flex;
94
+ width: 100%;
95
+ align-items: center;
96
+ justify-content: space-between;
97
+ min-height: 32px;
98
+ line-height: 24px;
99
+ padding: 1px 11px;
100
+ box-sizing: border-box;
101
+ border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
102
+ box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color)) inset;
103
+ background: var(--el-disabled-bg-color);
104
+ cursor: 'not-allowed';
105
+ }
106
+ </style>
@@ -54,17 +54,17 @@ getPageConfig({
54
54
  },
55
55
  selectsCb: (selects) => {
56
56
  // 配置数据加载完成事件 'loadedConfigCompeted'
57
- attrs?.onLoadedSelectsCompeted?.(selects)
57
+ Object.keys(selects || {}).forEach(key => {
58
+ props.selects[key] = selects[key]
59
+ })
60
+ attrs?.onLoadedSelectsCompeted?.(props.selects)
58
61
  },
59
62
  selectPolyReq: {
60
63
  ...(props.builtPolyfillReq || {}),
61
64
  }
62
65
  })
63
66
  const allSelects = computed(() => {
64
- return {
65
- ...props.selects,
66
- ...selects.value
67
- }
67
+ return props.selects
68
68
  })
69
69
 
70
70
  const resolverRef = ref(null)