resolver-egretimp-plus 0.0.63 → 0.0.65
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 -0
- package/dist/h5/index.js +1796 -1
- package/dist/h5/index.js.LICENSE.txt +42 -0
- package/dist/web/index.js +1796 -1
- package/dist/web/index.js.LICENSE.txt +42 -0
- package/package.json +5 -1
- package/scripts/webpack.config.js +1 -0
- package/src/analysisComponent.jsx +4 -0
- package/src/components/packages-H5/CustomComponentTableH5.vue +103 -6
- package/src/components/packages-web/CustomComponentTable.jsx +2 -2
- package/src/hooks/mock.js +5877 -378
- package/src/hooks/pageConfig.js +2 -2
- package/src/hooks/testcomp.js +0 -0
- package/src/utils/loadModule.js +48 -0
- package/src/utils/render.jsx +11 -0
- package/src/utils/vue3-sfc-loader.js +1831 -0
|
@@ -5,4 +5,46 @@
|
|
|
5
5
|
* Copyright (c) 2013, salesforce.com
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/*!
|
|
9
|
+
* The buffer module from node.js, for the browser.
|
|
10
|
+
*
|
|
11
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
12
|
+
* @license MIT
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*!
|
|
16
|
+
* The buffer module from node.js, for the browser.
|
|
17
|
+
*
|
|
18
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
19
|
+
* @license MIT
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
23
|
+
|
|
24
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
25
|
+
|
|
8
26
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @vue/compiler-core v3.4.15
|
|
30
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
31
|
+
* @license MIT
|
|
32
|
+
**/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @vue/compiler-dom v3.4.15
|
|
36
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
37
|
+
* @license MIT
|
|
38
|
+
**/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @vue/compiler-sfc v3.4.15
|
|
42
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
43
|
+
* @license MIT
|
|
44
|
+
**/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @vue/shared v3.4.15
|
|
48
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
49
|
+
* @license MIT
|
|
50
|
+
**/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resolver-egretimp-plus",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.65",
|
|
4
4
|
"description": "交付体验渲染",
|
|
5
5
|
"main": "./dist/web/index.js",
|
|
6
6
|
"module": "./dist/web/index.js",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
".": "./dist/web/index.js",
|
|
9
9
|
"./h5": "./dist/h5/index.js",
|
|
10
10
|
"./web": "./dist/web/index.js",
|
|
11
|
+
"./const": "./dist/const/index.js",
|
|
11
12
|
"./*": "./*"
|
|
12
13
|
},
|
|
13
14
|
"scripts": {
|
|
@@ -50,5 +51,8 @@
|
|
|
50
51
|
"vue3-quill": "^0.3.1",
|
|
51
52
|
"webpack": "^5.90.0",
|
|
52
53
|
"webpack-cli": "^5.1.4"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"vue3-sfc-loader": "^0.9.5"
|
|
53
57
|
}
|
|
54
58
|
}
|
|
@@ -117,6 +117,9 @@ export default {
|
|
|
117
117
|
const componentProps = ref({})
|
|
118
118
|
if (typeof props.component === 'function') {
|
|
119
119
|
props.component()?.then(res => {
|
|
120
|
+
if (props.config.isCustomComp) {
|
|
121
|
+
debugger
|
|
122
|
+
}
|
|
120
123
|
const obj = {}
|
|
121
124
|
if (res?.default?.emits) {
|
|
122
125
|
initVmodels(res?.default?.emits)
|
|
@@ -155,6 +158,7 @@ export default {
|
|
|
155
158
|
config.dynamicMapComp = dynamicMapComp
|
|
156
159
|
config.dynamicHireRelat = parent?.dynamicHireRelat ? `${parent?.dynamicHireRelat}${hasOwn(props.config, 'rowIndex') ? `[${props.config.rowIndex}]` : ''}->${(props.config.metaCode || '')}` : props.config.metaCode
|
|
157
160
|
config.dynamicHireRelat && (dynamicMapComp[props.config.dynamicHireRelat] = props.config)
|
|
161
|
+
return parent
|
|
158
162
|
})
|
|
159
163
|
|
|
160
164
|
// props.config.parent = parent
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { commonPropsType } from '../../utils/index.js'
|
|
3
|
-
import { computed, inject, ref, useAttrs, watch } from 'vue'
|
|
2
|
+
import { commonPropsType, hasOwn } from '../../utils/index.js'
|
|
3
|
+
import { computed, inject, reactive, ref, useAttrs, watch } from 'vue'
|
|
4
4
|
|
|
5
5
|
const attrs = useAttrs()
|
|
6
6
|
const lang = inject('lang')
|
|
@@ -10,15 +10,101 @@ const props = defineProps({
|
|
|
10
10
|
})
|
|
11
11
|
const tableData = ref([])
|
|
12
12
|
const modelValue = defineModel()
|
|
13
|
+
|
|
14
|
+
const isFrontPage = computed(() => {
|
|
15
|
+
return props.config?.frontPageFlag === '1'
|
|
16
|
+
})
|
|
13
17
|
const tableProps = computed(() => {
|
|
14
18
|
return {
|
|
15
19
|
stripe: props.config?.stripe === '1',
|
|
16
20
|
card: props.config?.displayType === 'card',
|
|
17
21
|
display: props.config?.display,
|
|
18
|
-
open: props.config?.
|
|
22
|
+
open: props.config?.defaultOpenFlag === '1',
|
|
19
23
|
showlandscape: props.config?.showLandscape === '1',
|
|
20
24
|
}
|
|
21
25
|
})
|
|
26
|
+
const page = reactive({
|
|
27
|
+
pageNum: 1,
|
|
28
|
+
pageSize: 3,
|
|
29
|
+
total: 0,
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const normalTableData = computed(() => {
|
|
33
|
+
return !isFrontPage.value ?
|
|
34
|
+
tableData.value :
|
|
35
|
+
tableData.value.slice((page.pageNum - 1) * page.pageSize, page.pageNum * page.pageSize)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const normalPageTotal = computed(() => {
|
|
39
|
+
return !isFrontPage.value ? page.total : (tableData.value?.length || 0)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const paginationProps = computed(() => {
|
|
43
|
+
return {
|
|
44
|
+
pagesizes: props.config?.pagesizes || [3, 10, 20, 50],
|
|
45
|
+
showHomeEnd: hasOwn(props.config, 'showHomeEnd') ? props.config.showHomeEnd === '1' : hasOwn(props.config, 'show-home-end') ? props.config['show-home-end'] === '1' : true,
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
const pagenationEvents = computed(() => {
|
|
49
|
+
const ret = {
|
|
50
|
+
onSizeChange: (e) => {
|
|
51
|
+
if (attrs.onSizeChange) {
|
|
52
|
+
attrs.onSizeChange?.(e)
|
|
53
|
+
}
|
|
54
|
+
page.pageSize = e?.detail?.value || 3
|
|
55
|
+
},
|
|
56
|
+
onCurrentChange: (e) => {
|
|
57
|
+
if (attrs.onCurrentChange) {
|
|
58
|
+
attrs.onCurrentChange?.(e)
|
|
59
|
+
}
|
|
60
|
+
page.pageNum = e?.detail?.value || 1
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return ret
|
|
64
|
+
})
|
|
65
|
+
// 是否配置分页功能 ====== start======
|
|
66
|
+
const pageable = computed(() => {
|
|
67
|
+
return props.config?.pageable === '1'
|
|
68
|
+
})
|
|
69
|
+
const pageAlign = computed(() => {
|
|
70
|
+
return props.config?.pageAlign
|
|
71
|
+
})
|
|
72
|
+
const PAGE_LEFT = 'left'
|
|
73
|
+
const PAGE_CENTER = 'center'
|
|
74
|
+
const PAGE_RIGHT = 'right'
|
|
75
|
+
const pageAlignEnmu = {
|
|
76
|
+
[PAGE_LEFT]: 'flex-start',
|
|
77
|
+
[PAGE_RIGHT]: 'flex-end',
|
|
78
|
+
[PAGE_CENTER]: 'center'
|
|
79
|
+
}
|
|
80
|
+
// 页码变动
|
|
81
|
+
watch(() => page.pageNum, (val) => {
|
|
82
|
+
const fn = props.config?.currentChange
|
|
83
|
+
const ret = fn && fn(val, props, page)
|
|
84
|
+
if (ret) {
|
|
85
|
+
if (isPromise(ret)) {
|
|
86
|
+
ret.then((res) => {
|
|
87
|
+
res && (modelValue.value = res)
|
|
88
|
+
})
|
|
89
|
+
} else {
|
|
90
|
+
modelValue.value = ret
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
// 页面大小变动
|
|
95
|
+
watch(() => page.pageSize, (val) => {
|
|
96
|
+
const fn = props.config?.sizeChange
|
|
97
|
+
const ret = fn && fn(val, props, page)
|
|
98
|
+
if (ret) {
|
|
99
|
+
if (isPromise(ret)) {
|
|
100
|
+
ret.then((res) => {
|
|
101
|
+
res && (modelValue.value = res)
|
|
102
|
+
})
|
|
103
|
+
} else {
|
|
104
|
+
modelValue.value = ret
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
})
|
|
22
108
|
|
|
23
109
|
const pmPageMetaList = computed(() => {
|
|
24
110
|
return (props.config.pmPageMetaList || [])
|
|
@@ -36,15 +122,15 @@ const getTableColumnProps = (config) => {
|
|
|
36
122
|
|
|
37
123
|
watch(modelValue, (val) => {
|
|
38
124
|
setTimeout(() => {
|
|
39
|
-
tableData.value = val || (tableProps.value.card ? [
|
|
125
|
+
tableData.value = val || (tableProps.value.card ? [] : [])
|
|
40
126
|
}, 100);
|
|
41
|
-
tableRef.value?.setTableData(val
|
|
127
|
+
tableRef.value?.setTableData((val && val.length) ? val : [{}])
|
|
42
128
|
}, {
|
|
43
129
|
immediate: true
|
|
44
130
|
})
|
|
45
131
|
</script>
|
|
46
132
|
<template>
|
|
47
|
-
<cmi-table ref="tableRef" :key="`${tableProps.card}${tableProps.display}`" v-bind="tableProps" :data="
|
|
133
|
+
<cmi-table ref="tableRef" :key="`${tableProps.card}${tableProps.display}`" v-bind="tableProps" :data="normalTableData">
|
|
48
134
|
<cmi-table-column
|
|
49
135
|
v-for="column in pmPageMetaList" :key="column.metaCode"
|
|
50
136
|
v-bind="{
|
|
@@ -54,5 +140,16 @@ watch(modelValue, (val) => {
|
|
|
54
140
|
>
|
|
55
141
|
</cmi-table-column>
|
|
56
142
|
</cmi-table>
|
|
143
|
+
<div v-if="pageable" :style="{'justify-content': pageAlignEnmu[pageAlign || PAGE_RIGHT]}" style="margin-bottom: 12px;">
|
|
144
|
+
<cmi-pagination
|
|
145
|
+
:key="normalPageTotal"
|
|
146
|
+
v-bind="{...paginationProps, ...pagenationEvents}"
|
|
147
|
+
@sizeChange="pagenationEvents.onSizeChange"
|
|
148
|
+
@currentChange="pagenationEvents.onCurrentChange"
|
|
149
|
+
:total="normalPageTotal"
|
|
150
|
+
:pagesize="page.pageSize"
|
|
151
|
+
:current="page.pageNum"
|
|
152
|
+
/>
|
|
153
|
+
</div>
|
|
57
154
|
</template>
|
|
58
155
|
<style></style>
|
|
@@ -106,7 +106,7 @@ export default {
|
|
|
106
106
|
const nextList = tableColumnConfigs.value.slice(idx + 1)
|
|
107
107
|
const nextConfig = nextList.find(config => config.displayType === DISPLAY_SHOW)
|
|
108
108
|
const props = Object.keys(ElTableColumn.props).reduce((ret, key) => {
|
|
109
|
-
if (config
|
|
109
|
+
if (hasOwn(config, key)) {
|
|
110
110
|
ret[key] = config[key]
|
|
111
111
|
}
|
|
112
112
|
return ret
|
|
@@ -305,7 +305,7 @@ export default {
|
|
|
305
305
|
|
|
306
306
|
// 是否配置分页功能 ====== start======
|
|
307
307
|
const pageable = computed(() => {
|
|
308
|
-
return props.config?.pageable
|
|
308
|
+
return props.config?.pageable === '1'
|
|
309
309
|
})
|
|
310
310
|
const pageAlign = computed(() => {
|
|
311
311
|
return props.config?.pageAlign
|