lambo-design-bi 0.0.142 → 0.0.145
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/bi/widget/layout/row.vue +12 -16
- package/bi/widget/util/widget-map.js +4 -23
- package/package.json +1 -1
package/bi/widget/layout/row.vue
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
<!-- eslint-disable -->
|
|
2
1
|
<template>
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</template>
|
|
13
|
-
</el-row>
|
|
14
|
-
</div>
|
|
2
|
+
<el-row class="custom-row" :gutter="(widget.options && widget.options.gutter) ? parseInt(widget.options.gutter) : 0">
|
|
3
|
+
<template v-for="(item, index) in widget.widgets">
|
|
4
|
+
<component :is="getWidgetName(item)" :widget="item" :key="index" :params="params">
|
|
5
|
+
<template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
|
|
6
|
+
<slot :name="slot" v-bind="scope" />
|
|
7
|
+
</template>
|
|
8
|
+
</component>
|
|
9
|
+
</template>
|
|
10
|
+
</el-row>
|
|
15
11
|
</template>
|
|
16
12
|
<script>
|
|
17
|
-
import {
|
|
13
|
+
import { getWidgetName } from '../util/widget-map'
|
|
18
14
|
|
|
19
15
|
export default {
|
|
20
|
-
name:
|
|
16
|
+
name: "BiRow",
|
|
21
17
|
components: {},
|
|
22
18
|
props: {
|
|
23
19
|
widget: {
|
|
@@ -35,7 +31,7 @@ export default {
|
|
|
35
31
|
}
|
|
36
32
|
},
|
|
37
33
|
methods: {
|
|
38
|
-
|
|
34
|
+
getWidgetName
|
|
39
35
|
},
|
|
40
36
|
created() {
|
|
41
37
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import BiPage from "../page/index.vue"
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import BiEmpty from "../../../pub/empty/index.vue"
|
|
3
|
+
import BiPagingTable from "../table/paging-table.vue"
|
|
4
4
|
import BiContainerCard from "../container/card/card-widget.vue"
|
|
5
5
|
import BiNumIndex from "../num/index.vue"
|
|
6
|
+
import BiRow from "../layout/row.vue"
|
|
7
|
+
import BiCol from "../layout/col.vue"
|
|
6
8
|
import BiDetailTable from "../table/detail-table.vue"
|
|
7
|
-
import BiPagingTable from "../table/paging-table.vue"
|
|
8
|
-
import BiEmpty from "../../../pub/empty/index.vue"
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Strictly define the order to prevent circular references. For component reuse, copy new components instead of direct references.
|
|
@@ -30,7 +30,6 @@ export function getWidgetName(item) {
|
|
|
30
30
|
console.warn(`未找到type=${type}对应的组件,使用默认组件`)
|
|
31
31
|
console.log('getWidgetName item=', item)
|
|
32
32
|
console.log('getWidgetName type=', type)
|
|
33
|
-
|
|
34
33
|
if (type && Object.prototype.hasOwnProperty.call(WIDGET_MAP, type)) {
|
|
35
34
|
console.log('getWidgetName 类型包含组件但未成功获取 WIDGET_MAP[type]=', WIDGET_MAP[type])
|
|
36
35
|
} else {
|
|
@@ -39,21 +38,3 @@ export function getWidgetName(item) {
|
|
|
39
38
|
return WIDGET_MAP['_empty']
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// 同步版本(返回组件名而不是组件对象)
|
|
45
|
-
export function getWidgetNameSync(item) {
|
|
46
|
-
const type = item.type;
|
|
47
|
-
const nameMap = {
|
|
48
|
-
'20': 'BiPage',
|
|
49
|
-
'32': 'BiRow', // 返回组件名
|
|
50
|
-
'33': 'BiCol',
|
|
51
|
-
'40': 'BiContainerCard',
|
|
52
|
-
'41': 'BiNumIndex',
|
|
53
|
-
'50': 'BiPagingTable',
|
|
54
|
-
'51': 'BiDetailTable',
|
|
55
|
-
'_empty': 'BiEmpty'
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
return nameMap[type] || nameMap['_empty'];
|
|
59
|
-
}
|