resolver-egretimp-plus 0.1.75 → 0.1.77
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/dist/const/index.js +1 -1
- package/dist/h5/index.js +18 -18
- package/dist/web/index.js +1 -1
- package/package.json +1 -1
- package/src/analysisComponent.jsx +2 -0
- package/src/components/packages-H5/CustomComponentCardH5.vue +67 -8
- package/src/components/packages-H5/CustomComponentTabPaneH5.vue +10 -6
- package/src/components/packages-H5/CustomComponentTabsH5.vue +52 -14
- package/src/hooks/configLoad.js +45 -0
- package/src/utils/const.js +1 -0
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import { executeEventOrchestration } from './components/helper/eventOrchestratio
|
|
|
9
9
|
import { useRouter } from 'vue-router'
|
|
10
10
|
import { onErrorCaptured } from 'vue'
|
|
11
11
|
import LoadingComponent from './components/loadingComponent/LoadingComponent.vue'
|
|
12
|
+
import { useConfigLoad } from './hooks/configLoad.js'
|
|
12
13
|
|
|
13
14
|
export default {
|
|
14
15
|
name: 'AnalysisComponent',
|
|
@@ -51,6 +52,7 @@ export default {
|
|
|
51
52
|
delete ret.onClick
|
|
52
53
|
return ret
|
|
53
54
|
})
|
|
55
|
+
useConfigLoad(props.config)
|
|
54
56
|
const ruleExecuter = inject('_ruleExecuter')
|
|
55
57
|
const dialogReq = inject('_dialogReq', {})
|
|
56
58
|
const requestTraceId = inject('requestTraceId')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed, inject, ref, resolveComponent, useAttrs } from "vue";
|
|
2
|
+
import { computed, inject, onMounted, ref, resolveComponent, useAttrs, watch } from "vue";
|
|
3
3
|
import Renderer from '../../renderer.jsx'
|
|
4
4
|
import { commonPropsType, DISPLAY_HIDDEN, hasOwn } from '../../utils/index.js'
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ const props = defineProps({
|
|
|
13
13
|
cardbgcolor: String,
|
|
14
14
|
})
|
|
15
15
|
|
|
16
|
-
const collapseLimt =
|
|
16
|
+
const collapseLimt = ref(Number.MAX_VALUE)
|
|
17
17
|
const isCollapse = ref(true)
|
|
18
18
|
const attrs = useAttrs()
|
|
19
19
|
const lang = inject('lang')
|
|
@@ -28,15 +28,61 @@ const cmiProps = computed(() => {
|
|
|
28
28
|
}
|
|
29
29
|
})
|
|
30
30
|
|
|
31
|
+
const propCollapseLimt = computed(() => {
|
|
32
|
+
return props.config?.collapseLimt || 5
|
|
33
|
+
})
|
|
34
|
+
|
|
31
35
|
const pmPageMetaList = computed(() => {
|
|
32
|
-
return props.config?.pmPageMetaList
|
|
36
|
+
return props.config?.pmPageMetaList || []
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const showPageMeteList = computed(() => {
|
|
40
|
+
return pmPageMetaList.value.filter(item => item.displayType != DISPLAY_HIDDEN && item.hidden != '1')
|
|
33
41
|
})
|
|
42
|
+
|
|
43
|
+
const lastShowPageMeteItem = computed(() => {
|
|
44
|
+
return showPageMeteList.value?.length ? showPageMeteList.value[showPageMeteList.value.length - 1] : null
|
|
45
|
+
})
|
|
46
|
+
|
|
34
47
|
const showCollapseBtn = computed(() => {
|
|
35
|
-
return
|
|
48
|
+
return showPageMeteList.value?.length > collapseLimt.value
|
|
36
49
|
})
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// 定位到最后显示的组件在折叠组件中的索引
|
|
53
|
+
const lasetLimitIdx = computed(() => {
|
|
54
|
+
const limt = isCollapse.value ? collapseLimt.value : Number.MAX_VALUE
|
|
55
|
+
return pmPageMetaList.value?.findIndex(item => item == showPageMeteList.value[limt - 1])
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
// 通过监听最后一个显示组件的索引,控制那些组件隐藏(通过collapseHidden控制隐藏)
|
|
59
|
+
watch(lasetLimitIdx, (val) => {
|
|
60
|
+
pmPageMetaList.value?.forEach((item, index) => {
|
|
61
|
+
item.collapseHidden = '0'
|
|
62
|
+
if (item.metaType === 'cmi-cell') {
|
|
63
|
+
item.borderHidden = '0'
|
|
64
|
+
}
|
|
65
|
+
if (val > -1) {
|
|
66
|
+
if (index > val) {
|
|
67
|
+
item.collapseHidden = '1'
|
|
68
|
+
}
|
|
69
|
+
if (index === val) {
|
|
70
|
+
if (item.metaType === 'cmi-cell') {
|
|
71
|
+
item.borderHidden = '1'
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
if (val === -1) {
|
|
77
|
+
if (lastShowPageMeteItem.value?.metaType === 'cmi-cell') {
|
|
78
|
+
lastShowPageMeteItem.value.borderHidden = '1'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
immediate: true
|
|
39
83
|
})
|
|
84
|
+
|
|
85
|
+
|
|
40
86
|
const collapseLabel = computed(() => {
|
|
41
87
|
const isCh = lang?.value?.indexOf('zh') > -1
|
|
42
88
|
return isCollapse.value ? (isCh ? '更多' : 'More') : (isCh ? '收起' : 'Close')
|
|
@@ -44,11 +90,24 @@ const collapseLabel = computed(() => {
|
|
|
44
90
|
function toCollapse() {
|
|
45
91
|
isCollapse.value = !isCollapse.value
|
|
46
92
|
}
|
|
93
|
+
|
|
94
|
+
onMounted(() => {
|
|
95
|
+
watch(() => props.config._componentLoad, (val) => {
|
|
96
|
+
if (val) {
|
|
97
|
+
collapseLimt.value = propCollapseLimt.value
|
|
98
|
+
watch(propCollapseLimt, (val) => {
|
|
99
|
+
collapseLimt.value = val
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
immediate: true
|
|
104
|
+
})
|
|
105
|
+
})
|
|
47
106
|
</script>
|
|
48
107
|
<template>
|
|
49
|
-
<cmi-card v-bind="{...
|
|
108
|
+
<cmi-card v-bind="{...attrs, ...cmiProps}">
|
|
50
109
|
<div slot="content" :style="{'background-color': cmiProps.cardbgcolor}">
|
|
51
|
-
<Renderer :config="
|
|
110
|
+
<Renderer :config="pmPageMetaList" v-model="modelValue"></Renderer>
|
|
52
111
|
<div v-if="showCollapseBtn" class="collapse-wrap">
|
|
53
112
|
<cmi-button type="text" size="small" @click="toCollapse">
|
|
54
113
|
{{ collapseLabel }}
|
|
@@ -2,20 +2,24 @@
|
|
|
2
2
|
import { computed, inject, useAttrs } from 'vue'
|
|
3
3
|
import Renderer from '../../renderer.jsx'
|
|
4
4
|
import { commonPropsType } from '../../utils/index.js'
|
|
5
|
+
import { useConfigLoad } from '../../hooks/configLoad.js'
|
|
5
6
|
const lang = inject('lang')
|
|
6
7
|
const props = defineProps({
|
|
7
8
|
...commonPropsType,
|
|
8
9
|
})
|
|
10
|
+
useConfigLoad(props.config)
|
|
9
11
|
const attrs = useAttrs()
|
|
10
12
|
const tabProps = computed(() => {
|
|
11
13
|
return {
|
|
12
|
-
label: props
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
label: lang.value.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
|
|
15
|
+
// label: props?.config?.hidden == '1' ?
|
|
16
|
+
// '' :
|
|
17
|
+
// lang.value.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
|
|
15
18
|
name: props.config?.metaCode,
|
|
16
|
-
disabled: props
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
disabled: props.config?.editFlag == '0'
|
|
20
|
+
// disabled: props?.config?.hidden == '1' ?
|
|
21
|
+
// true :
|
|
22
|
+
// props.config?.editFlag == '0'
|
|
19
23
|
}
|
|
20
24
|
})
|
|
21
25
|
const modelValue = defineModel()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed, inject, useAttrs } from 'vue'
|
|
3
|
-
import { commonPropsType, hasOwn } from '../../utils/index.js'
|
|
2
|
+
import { computed, inject, nextTick, onMounted, ref, useAttrs, watch } from 'vue'
|
|
3
|
+
import { commonPropsType, getUuid, hasOwn } from '../../utils/index.js'
|
|
4
4
|
import Renderer from '../../renderer.jsx'
|
|
5
5
|
import CustomComponentTabPaneH5 from './CustomComponentTabPaneH5.vue'
|
|
6
6
|
|
|
@@ -8,28 +8,34 @@ const props = defineProps({
|
|
|
8
8
|
...commonPropsType,
|
|
9
9
|
})
|
|
10
10
|
|
|
11
|
+
const uuid = getUuid()
|
|
11
12
|
const lang = inject('lang')
|
|
12
13
|
const attrs = useAttrs()
|
|
13
14
|
const modelValue = defineModel()
|
|
14
15
|
const tabpanes = computed(() => {
|
|
15
|
-
return
|
|
16
|
+
return props.config.pmPageMetaList || []
|
|
17
|
+
})
|
|
18
|
+
const tabpanesOfHidden = computed(() => {
|
|
19
|
+
return tabpanes.value?.map(item => item.hidden)
|
|
16
20
|
})
|
|
17
21
|
|
|
22
|
+
const activeNameModel = ref(null)
|
|
18
23
|
const activeNames = computed({
|
|
19
24
|
get() {
|
|
20
|
-
const
|
|
21
|
-
const
|
|
25
|
+
const showTabpanes = tabpanes.value.filter(item => item.hidden != '1')
|
|
26
|
+
const currentTab = showTabpanes.find(tab => tab.defaultShowFlag == '1')
|
|
27
|
+
const currentCycleTab = showTabpanes.find(tab => tab.currentCode)
|
|
22
28
|
if (currentTab) {
|
|
23
29
|
return currentTab?.isCycle == '1' ? `${currentTab.metaCode}-0` : currentTab.metaCode
|
|
24
30
|
}
|
|
25
31
|
if (currentCycleTab) {
|
|
26
32
|
return currentCycleTab.currentCode
|
|
27
33
|
}
|
|
28
|
-
if (
|
|
29
|
-
if (assertMetaType(
|
|
30
|
-
return `${
|
|
34
|
+
if (showTabpanes[0]) {
|
|
35
|
+
if (assertMetaType(showTabpanes[0], 'CustomComponentCycleTabPaneH5') || showTabpanes[0]?.isCycle == '1') {
|
|
36
|
+
return `${showTabpanes[0].metaCode}-0`
|
|
31
37
|
} else {
|
|
32
|
-
return
|
|
38
|
+
return showTabpanes[0].metaCode
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
41
|
},
|
|
@@ -54,7 +60,7 @@ const activeNames = computed({
|
|
|
54
60
|
})
|
|
55
61
|
const tabProps = computed(() => {
|
|
56
62
|
return {
|
|
57
|
-
activekey: activeNames.value,
|
|
63
|
+
activekey: activeNameModel.value || activeNames.value,
|
|
58
64
|
sticky: props.config?.sticky == '1',
|
|
59
65
|
offsettop: (props.config?.offsetTop || '0') + 'vw',
|
|
60
66
|
type: props.config.displayType || props.config.tabType,
|
|
@@ -90,13 +96,45 @@ const customClass = computed(() => {
|
|
|
90
96
|
function assertMetaType(config, metaType) {
|
|
91
97
|
return config.renderby === metaType || config.metaType === metaType
|
|
92
98
|
}
|
|
99
|
+
|
|
100
|
+
onMounted(() => {
|
|
101
|
+
// 控制 nav 头 可以支持设置hidden的时候的效果 ====start====
|
|
102
|
+
watch(() => props.config._componentLoad, (val) => {
|
|
103
|
+
setTimeout(() => {
|
|
104
|
+
if (val) {
|
|
105
|
+
watch(tabpanesOfHidden, (hids) => {
|
|
106
|
+
const navList = document.getElementById(uuid)?.shadowRoot?.querySelectorAll('cmi-tab-nav')
|
|
107
|
+
hids?.forEach((hidden, idx) => {
|
|
108
|
+
if (navList?.[idx]?.style) {
|
|
109
|
+
if (hidden == '1') {
|
|
110
|
+
navList[idx].style.display = 'none'
|
|
111
|
+
} else {
|
|
112
|
+
navList[idx].style.display = 'inline-flex'
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
activeNameModel.value = 'void'
|
|
118
|
+
nextTick(() => {
|
|
119
|
+
activeNameModel.value = null
|
|
120
|
+
})
|
|
121
|
+
}, {
|
|
122
|
+
immediate: true
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
}, 300);
|
|
126
|
+
}, {
|
|
127
|
+
immediate: true
|
|
128
|
+
})
|
|
129
|
+
// 控制 nav 头 可以支持设置hidden的时候的效果 ====end====
|
|
130
|
+
})
|
|
93
131
|
</script>
|
|
94
132
|
|
|
95
133
|
<template>
|
|
96
|
-
<cmi-tabs :class="customClass" v-bind="{...attrs, ...tabProps}">
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
>
|
|
134
|
+
<cmi-tabs :id="uuid" :class="customClass" v-bind="{...attrs, ...tabProps}">
|
|
135
|
+
<!-- <Renderer :config="tabpanes" v-model="modelValue"></Renderer> -->
|
|
136
|
+
<!-- 只能用下面这种方式写,移动端这个组件 内容嵌套多层级,就显示不出来 -->
|
|
137
|
+
<CustomComponentTabPaneH5 v-for="tabpane in tabpanes" :config="tabpane" :key="tabpane.metaId">
|
|
100
138
|
<Renderer :config="tabpane?.pmPageMetaList || []" :additionConfigs="[tabpane]" :modelValue="getValue(tabpane.metaCode)" @update:modelValue="(val) => { onUpdateModelValue(val, tabpane.metaCode) }"></Renderer>
|
|
101
139
|
</CustomComponentTabPaneH5>
|
|
102
140
|
</cmi-tabs>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { definePrivatelyProp, findComponent, NOT_LOAD_CHILD_TYPE } from "../utils"
|
|
2
|
+
import { inject, onMounted, provide } from "vue"
|
|
3
|
+
|
|
4
|
+
const CONFIG_LOAD_KEY = Symbol()
|
|
5
|
+
export const useConfigLoad = (config) => {
|
|
6
|
+
const injectLoadFn = inject(CONFIG_LOAD_KEY) // 加载父组件传递下来的 加载完成的 回调函数
|
|
7
|
+
const loadFn = (childConfig) => {
|
|
8
|
+
const multiPmPageMetaList = config.multiPmPageMetaList
|
|
9
|
+
const pmPageMetaList = config.pmPageMetaList
|
|
10
|
+
// if (config.metaCode == 'rackRental') {
|
|
11
|
+
// debugger
|
|
12
|
+
// }
|
|
13
|
+
if (multiPmPageMetaList && multiPmPageMetaList.length) {
|
|
14
|
+
const allLoad = multiPmPageMetaList.every(configList => configList.every(config => config._componentLoad))
|
|
15
|
+
if (allLoad) {
|
|
16
|
+
config._componentLoad = true
|
|
17
|
+
injectLoadFn?.(config)
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
const allLoad = pmPageMetaList.every(config => config._componentLoad)
|
|
21
|
+
if (allLoad) {
|
|
22
|
+
config._componentLoad = true
|
|
23
|
+
injectLoadFn?.(config)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
provide(CONFIG_LOAD_KEY, loadFn)
|
|
28
|
+
|
|
29
|
+
onMounted(() => {
|
|
30
|
+
const multiPmPageMetaList = config.multiPmPageMetaList
|
|
31
|
+
const pmPageMetaList = config.pmPageMetaList
|
|
32
|
+
|
|
33
|
+
if (
|
|
34
|
+
(
|
|
35
|
+
(!multiPmPageMetaList || multiPmPageMetaList.length === 0) &&
|
|
36
|
+
(!pmPageMetaList || pmPageMetaList.length === 0)
|
|
37
|
+
) ||
|
|
38
|
+
config.renderby ||
|
|
39
|
+
findComponent(NOT_LOAD_CHILD_TYPE, config.metaType) !== -1
|
|
40
|
+
) {
|
|
41
|
+
config._componentLoad = true
|
|
42
|
+
injectLoadFn?.(config)
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}
|
package/src/utils/const.js
CHANGED
|
@@ -15,6 +15,7 @@ export const VALUE_TYPES = {
|
|
|
15
15
|
OBJECT: 'object',
|
|
16
16
|
STRING: 'string',
|
|
17
17
|
}
|
|
18
|
+
export const NOT_LOAD_CHILD_TYPE = ['CustomComponentTableH5']
|
|
18
19
|
export const NOT_LOG_EFFECT_TYPE = ['CustomComponentTabs', 'CustomComponentTabPane', 'CustomComponentCycleTabPane', 'CustomComponentCollapse', 'CustomComponentTabPaneH5']
|
|
19
20
|
export const FORM_META_TYPE = 'CustomComponentFormLayout'
|
|
20
21
|
export const FORM_META_TYPE_H5 = 'CustomComponentFormLayoutH5'
|