lambo-design-bi 0.0.140 → 0.0.142

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.
@@ -4,7 +4,7 @@
4
4
  <el-row class="custom-row"
5
5
  :gutter="(widget.options && widget.options.gutter) ? parseInt(widget.options.gutter) : 0">
6
6
  <template v-for="(item, index) in widget.widgets">
7
- <component :is="getWidgetName(item)" :widget="item" :key="index" :params="params">
7
+ <component :is="getWidgetNameSync(item)" :widget="item" :key="index" :params="params">
8
8
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
9
9
  <slot :name="slot" v-bind="scope" />
10
10
  </template>
@@ -14,10 +14,10 @@
14
14
  </div>
15
15
  </template>
16
16
  <script>
17
- import { getWidgetName } from '../util/widget-map'
17
+ import { getWidgetNameSync } from '../util/widget-map'
18
18
 
19
19
  export default {
20
- name: "BiRow",
20
+ name: 'BiRow',
21
21
  components: {},
22
22
  props: {
23
23
  widget: {
@@ -35,7 +35,7 @@ export default {
35
35
  }
36
36
  },
37
37
  methods: {
38
- getWidgetName
38
+ getWidgetNameSync
39
39
  },
40
40
  created() {
41
41
 
@@ -2,9 +2,9 @@ import BiPage from "../page/index.vue"
2
2
  import BiRow from "../layout/row.vue"
3
3
  import BiCol from "../layout/col.vue"
4
4
  import BiContainerCard from "../container/card/card-widget.vue"
5
- import BiPagingTable from "../table/paging-table.vue"
6
5
  import BiNumIndex from "../num/index.vue"
7
6
  import BiDetailTable from "../table/detail-table.vue"
7
+ import BiPagingTable from "../table/paging-table.vue"
8
8
  import BiEmpty from "../../../pub/empty/index.vue"
9
9
 
10
10
  /**
@@ -39,3 +39,21 @@ export function getWidgetName(item) {
39
39
  return WIDGET_MAP['_empty']
40
40
  }
41
41
  }
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambo-design-bi",
3
- "version": "0.0.140",
3
+ "version": "0.0.142",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "finch",