lw-cdp-ui 1.4.41 → 1.4.43
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/components/lwBiChart/item.vue +56 -51
- package/dist/lw-cdp-ui.esm.js +2223 -2200
- package/dist/lw-cdp-ui.umd.js +8 -8
- package/package.json +1 -1
|
@@ -2,24 +2,22 @@
|
|
|
2
2
|
<component v-if="isShow" :is="chartComponent" :rawData="rawData" :height="height" :isBi="isBi" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script
|
|
6
|
-
import { computed, provide } from 'vue'
|
|
5
|
+
<script>
|
|
7
6
|
import * as echarts from 'echarts'
|
|
8
7
|
|
|
9
|
-
import BarChart from './charts/BarChart.vue'
|
|
10
|
-
import LineChart from './charts/LineChart.vue'
|
|
11
|
-
import PieChart from './charts/PieChart.vue'
|
|
12
|
-
import AreaChart from './charts/AreaChart.vue'
|
|
13
|
-
import MetricCard from './charts/MetricCard.vue'
|
|
14
|
-
import GaugeChart from './charts/GaugeChart.vue'
|
|
15
|
-
import FunnelChart from './charts/FunnelChart.vue'
|
|
16
|
-
import ScatterChart from './charts/ScatterChart.vue'
|
|
17
|
-
import RadarChart from './charts/RadarChart.vue'
|
|
18
|
-
import MapChart from './charts/MapChart.vue'
|
|
19
|
-
import ReportTable from './charts/ReportTable.vue'
|
|
20
|
-
import ChartTitle from './charts/ChartTitle.vue'
|
|
8
|
+
import BarChart from './charts/BarChart.vue' // 柱状图
|
|
9
|
+
import LineChart from './charts/LineChart.vue' // 折线图
|
|
10
|
+
import PieChart from './charts/PieChart.vue' // 饼图
|
|
11
|
+
import AreaChart from './charts/AreaChart.vue' // 面积图
|
|
12
|
+
import MetricCard from './charts/MetricCard.vue' // 指标卡
|
|
13
|
+
import GaugeChart from './charts/GaugeChart.vue' // 仪表盘
|
|
14
|
+
import FunnelChart from './charts/FunnelChart.vue' // 漏斗图
|
|
15
|
+
import ScatterChart from './charts/ScatterChart.vue' // 散点图
|
|
16
|
+
import RadarChart from './charts/RadarChart.vue' // 雷达图
|
|
17
|
+
import MapChart from './charts/MapChart.vue' // 地图
|
|
18
|
+
import ReportTable from './charts/ReportTable.vue' // 报表
|
|
19
|
+
import ChartTitle from './charts/ChartTitle.vue' // 标题
|
|
21
20
|
|
|
22
|
-
// 组件映射表
|
|
23
21
|
const componentMap = {
|
|
24
22
|
Bar: BarChart,
|
|
25
23
|
Line: LineChart,
|
|
@@ -35,43 +33,50 @@ const componentMap = {
|
|
|
35
33
|
ChartTitle: ChartTitle
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
export default {
|
|
37
|
+
name: 'lwBiChartItem',
|
|
38
|
+
components: {
|
|
39
|
+
BarChart,
|
|
40
|
+
LineChart,
|
|
41
|
+
PieChart,
|
|
42
|
+
AreaChart,
|
|
43
|
+
MetricCard,
|
|
44
|
+
GaugeChart,
|
|
45
|
+
FunnelChart,
|
|
46
|
+
ScatterChart,
|
|
47
|
+
RadarChart,
|
|
48
|
+
MapChart,
|
|
49
|
+
ReportTable,
|
|
50
|
+
ChartTitle
|
|
43
51
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
default: '300px'
|
|
52
|
+
provide() {
|
|
53
|
+
return { echarts }
|
|
47
54
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
props: {
|
|
56
|
+
rawData: {
|
|
57
|
+
type: Object,
|
|
58
|
+
default: null
|
|
59
|
+
},
|
|
60
|
+
height: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '300px'
|
|
63
|
+
},
|
|
64
|
+
// 是否是BI数据结构 默认是true , false为普通EChart数据结构
|
|
65
|
+
isBi: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
computed: {
|
|
71
|
+
isShow() {
|
|
72
|
+
return echarts && this.rawData && ((this.rawData?.setting && this.rawData?.dataSet) || this.rawData?.option)
|
|
73
|
+
},
|
|
74
|
+
chartType() {
|
|
75
|
+
return this.rawData?.type || 'Bar'
|
|
76
|
+
},
|
|
77
|
+
chartComponent() {
|
|
78
|
+
return componentMap[this.chartType] || BarChart
|
|
79
|
+
}
|
|
58
80
|
}
|
|
59
|
-
|
|
60
|
-
})()
|
|
61
|
-
|
|
62
|
-
// 提供 echarts 实例给子组件
|
|
63
|
-
provide('echarts', echartsInstance)
|
|
64
|
-
|
|
65
|
-
// 计算属性
|
|
66
|
-
const isShow = computed(() => {
|
|
67
|
-
return props.rawData && ((props.rawData?.setting && props.rawData?.dataSet) || props.rawData?.option)
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
const chartType = computed(() => {
|
|
71
|
-
return props.rawData?.type || 'Bar'
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
const chartComponent = computed(() => {
|
|
75
|
-
return componentMap[chartType.value] || BarChart
|
|
76
|
-
})
|
|
81
|
+
}
|
|
77
82
|
</script>
|