resolver-egretimp-plus 0.0.45 → 0.0.46

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.45",
3
+ "version": "0.0.46",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -2,7 +2,6 @@
2
2
  import { defineProps, inject, getCurrentInstance, computed, useAttrs } from 'vue'
3
3
  import { commonPropsType } from '../../utils/index.js'
4
4
  import { useRoute } from 'vue-router'
5
- import { dispatchClickEvents } from '../helper/eventOrchestration.js';
6
5
 
7
6
  const appContext = getCurrentInstance()?.appContext
8
7
 
@@ -41,7 +40,6 @@ const label = computed(() => {
41
40
  const route = useRoute()
42
41
  const buttonActions = inject('buttonActions', {})
43
42
 
44
- const messageInstance = inject('_messageInstance')
45
43
  const dynamicMapComp = inject('dynamicMapComp')
46
44
  const hireRelatMapRules = inject('hireRelatMapRules')
47
45
  const components = inject('components')
@@ -49,12 +47,11 @@ const selects = inject('selects')
49
47
  const rootValue = inject('rootValue')
50
48
  const dataLoad = inject('dataLoad')
51
49
  const rootForm = inject('rootForm')
52
- const _axiosInstance = inject('_axiosInstance')
53
50
  const routeQuery= route?.query
54
51
 
55
52
 
56
- const buttonAction = () => {
57
- attrs?.onClick?.(e) // 如果配置中有点击事件
53
+ const buttonAction = (...arg) => {
54
+ attrs?.onClick?.(...arg) // 如果配置中有点击事件
58
55
  const actionKey = props.config?.clickActionKey || props.config?.buttonActionKey || props.config?.hireRelat
59
56
  const actionFn = buttonActions[actionKey]
60
57
  actionFn && actionFn(props, {
@@ -67,16 +64,6 @@ const buttonAction = () => {
67
64
  rootForm,
68
65
  routeQuery
69
66
  }, appContext)
70
-
71
- const PageServiceMapVOList = props.config.lcpPageServiceMapVOList
72
- if (PageServiceMapVOList?.length) {
73
- dispatchClickEvents({
74
- serviceList: PageServiceMapVOList,
75
- axiosInstance: _axiosInstance,
76
- reqData: rootValue?.value,
77
- messageInstance
78
- })
79
- }
80
67
  }
81
68
  </script>
82
69
 
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
- import { computed, inject, resolveComponent, useAttrs } from "vue";
2
+ import { computed, inject, ref, resolveComponent, useAttrs } from "vue";
3
3
  import Renderer from '../../renderer.jsx'
4
- import { commonPropsType, hasOwn } from '../../utils/index.js'
4
+ import { commonPropsType, DISPLAY_HIDDEN, hasOwn } from '../../utils/index.js'
5
5
 
6
6
  const modelValue = defineModel()
7
7
  const props = defineProps({
@@ -12,6 +12,9 @@ const props = defineProps({
12
12
  noborder: [Boolean, String],
13
13
  cardbgcolor: String,
14
14
  })
15
+
16
+ const collapseLimt = 5
17
+ const isCollapse = ref(true)
15
18
  const attrs = useAttrs()
16
19
  const lang = inject('lang')
17
20
  const cmiProps = computed(() => {
@@ -27,17 +30,35 @@ const cmiProps = computed(() => {
27
30
  const pmPageMetaList = computed(() => {
28
31
  return props.config?.pmPageMetaList?.filter(item => !item.collapseSlot) || []
29
32
  })
30
-
33
+ const showCollapseBtn = computed(() => {
34
+ return pmPageMetaList.value.filter(item => item.displayType != DISPLAY_HIDDEN)?.length > collapseLimt
35
+ })
36
+ const showPageMeteList = computed(() => {
37
+ return pmPageMetaList.value.filter(item => item.displayType != DISPLAY_HIDDEN).slice(0, isCollapse.value ? collapseLimt : Number.MAX_VALUE)
38
+ })
39
+ const collapseLabel = computed(() => {
40
+ const isCh = lang?.value?.indexOf('zh') > -1
41
+ return isCollapse.value ? (isCh ? '更多' : 'More') : (isCh ? '收起' : 'Close')
42
+ })
43
+ function toCollapse() {
44
+ isCollapse.value = !isCollapse.value
45
+ }
31
46
  </script>
32
47
  <template>
33
- <div style="">
34
-
35
- </div>
36
48
  <cmi-card v-bind="{...cmiProps, ...attrs}">
37
49
  <div slot="content">
38
- <Renderer :config="pmPageMetaList" v-model="modelValue"></Renderer>
50
+ <Renderer :config="showPageMeteList" v-model="modelValue"></Renderer>
51
+ <div v-if="showCollapseBtn" class="collapse-wrap">
52
+ <cmi-button type="text" size="small" @click="toCollapse">
53
+ {{ collapseLabel }}
54
+ </cmi-button>
55
+ </div>
39
56
  </div>
40
57
  </cmi-card>
41
58
  </template>
42
59
  <style lang="scss">
60
+ .collapse-wrap {
61
+ display: flex;
62
+ justify-content: end;
63
+ }
43
64
  </style>
@@ -1,12 +1,14 @@
1
1
  <script setup>
2
2
  import Renderer from '../../renderer.jsx'
3
- import { computed, inject, useAttrs, defineEmits, defineProps } from 'vue'
4
- import { commonPropsType } from '../../utils/index.js'
3
+ import { computed, inject, useAttrs, defineEmits, defineProps, ref } from 'vue'
4
+ import { commonPropsType, DISPLAY_HIDDEN } from '../../utils/index.js'
5
5
 
6
6
  defineOptions({
7
7
  inheritAttrs: false
8
8
  })
9
9
 
10
+ const collapseLimt = 5
11
+ const isCollapse = ref(true)
10
12
  const modelValue = defineModel()
11
13
  const attrs = useAttrs()
12
14
  const lang = inject('lang')
@@ -25,13 +27,46 @@ const collapseProps = computed(() => {
25
27
  const pmPageMetaList = computed(() => {
26
28
  return props.config?.pmPageMetaList?.filter(item => !item.collapseSlot) || []
27
29
  })
30
+ const showCollapseBtn = computed(() => {
31
+ return pmPageMetaList.value.filter(item => item.displayType != DISPLAY_HIDDEN)?.length > collapseLimt
32
+ })
33
+ const showPageMeteList = computed(() => {
34
+ return pmPageMetaList.value.filter(item => item.displayType != DISPLAY_HIDDEN).slice(0, isCollapse.value ? collapseLimt : Number.MAX_VALUE)
35
+ })
36
+ const collapseLabel = computed(() => {
37
+ const isCh = lang?.value?.indexOf('zh') > -1
38
+ return isCollapse.value ? (isCh ? '更多' : 'More') : (isCh ? '收起' : 'Close')
39
+ })
40
+ function toCollapse() {
41
+ isCollapse.value = !isCollapse.value
42
+ }
28
43
  </script>
29
44
 
30
45
  <template>
31
46
  <cmi-collapse v-bind="{...attrs, ...collapseProps}">
32
- <Renderer :config="pmPageMetaList" v-model="modelValue"></Renderer>
47
+ <div class="render-wrap">
48
+ <Renderer :config="showPageMeteList" v-model="modelValue"></Renderer>
49
+ </div>
50
+ <div v-if="showCollapseBtn" class="collapse-wrap">
51
+ <cmi-button type="text" size="small" @click="toCollapse">
52
+ {{ collapseLabel }}
53
+ </cmi-button>
54
+ </div>
33
55
  </cmi-collapse>
34
56
  </template>
35
57
 
36
58
  <style lang="scss">
59
+ .render-wrap {
60
+ div:last-child {
61
+ cmi-cell {
62
+ &::after {
63
+ display: none;
64
+ }
65
+ }
66
+ }
67
+ }
68
+ .collapse-wrap {
69
+ display: flex;
70
+ justify-content: end;
71
+ }
37
72
  </style>
@@ -367,7 +367,7 @@ export default {
367
367
  {
368
368
  tableColumnConfigs.value.map((columnConfg, configIdx) => {
369
369
  return columnConfg.displayType == DISPLAY_HIDDEN ? null : (
370
- <ElTableColumn key={columnConfg.requiredFlag} {...getTableColumnProps(columnConfg, configIdx)}>
370
+ <ElTableColumn key={columnConfg.requiredFlag + columnConfg.metaCode} {...getTableColumnProps(columnConfg, configIdx)}>
371
371
  {{
372
372
  header: () => (
373
373
  <span className='head-span' title={lang.value.indexOf('zh') > -1 ? columnConfg.metaNameZh : columnConfg.metaNameEn}>
@@ -167,9 +167,6 @@ export function normalConfig({
167
167
  }
168
168
 
169
169
  let extendAttrObj = parseExtendAttr(config)
170
- if (metaType == 'cmi-card') {
171
- debugger
172
- }
173
170
  let extendObj = {
174
171
  removeCol: findComponent(NOT_NEED_COL_ITEM_META_TYPE, extendAttrObj.renderby) !== -1 || findComponent(NOT_NEED_COL_ITEM_META_TYPE, metaType) !== -1,
175
172
  needformItem: (findComponent(NOT_NEED_FORM_ITEM_META_TYPE, extendAttrObj.renderby) !== -1 || findComponent(NOT_NEED_FORM_ITEM_META_TYPE, metaType) !== -1) ? false : needformItem, // 表示这个配置项对应的渲染组件是否需要formItem进行包装 移动端是cmi-form-item