# Conflicts:
#	src/views/charts/Chart2.vue
This commit is contained in:
@changcode
2022-01-18 19:44:57 +08:00
4 changed files with 125 additions and 5 deletions

View File

@@ -28,6 +28,15 @@
<div v-else style="height: 100%; width: 100%; background-color: lightcyan;"></div>
<chart-echart-line
v-else-if="isEchartsLine"
:chart-info="chartInfo"
:chart-data="chartData"
:result-type="resultType"
:query-params="queryParams"
@showLoading="showLoading"
></chart-echart-line>
</template>
</div>
</template>
@@ -38,8 +47,10 @@ import ChartNoData from './charts/ChartNoData'
import ChartTabs from './charts/ChartTabs'
import ChartMap from './charts/ChartMap'
import ChartSingleValue from './charts/ChartSingleValue'
import ChartEchartLine from './charts/ChartEchartLine'
import {
isEcharts,
isEchartsLine,
isSingleValue,
isTable,
isActiveIpTable,
@@ -77,11 +88,13 @@ export default {
Loading,
ChartNoData,
ChartTabs,
ChartMap
ChartMap,
ChartEchartLine
},
props: {
chartInfo: Object,
chartData: [Object, Array, String], // 数据在父组件查询后传入,本组件内不查询,只根据接传递的数据来渲染
resultType: Object, // 返回数据的类型
queryParams: Object, // 接口请求参数
customChartOption: Object, // 需要自定义echarts的option时传入非必须传入该值时仍需传对应格式的chartData
isFullscreen: Boolean,
@@ -112,6 +125,7 @@ export default {
setup (props) {
return {
isEcharts: isEcharts(props.chartInfo.type),
isEchartsLine: isEchartsLine(props.chartInfo.type),
isEchartsTimeBar: isEchartsTimeBar(props.chartInfo.type),
isEchartsCategoryBar: isEchartsCategoryBar(props.chartInfo.type),
isEchartsWithTable: isEchartsWithTable(props.chartInfo.type),