瀏覽代碼

import chart

docs_0727
lb 1 年之前
父節點
當前提交
62ab300c60
共有 2 個文件被更改,包括 26 次插入4 次删除
  1. +14
    -2
      src/views/modules/pms/carHistory/components/configs/chart.js
  2. +12
    -2
      src/views/modules/pms/carHistory/components/temperatureDialog.vue

+ 14
- 2
src/views/modules/pms/carHistory/components/configs/chart.js 查看文件

@@ -1,3 +1,15 @@
export default {
}
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
data: [150, 230, 224, 218, 135, 147, 260],
type: 'line'
}
]
};

+ 12
- 2
src/views/modules/pms/carHistory/components/temperatureDialog.vue 查看文件

@@ -28,8 +28,8 @@
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
<div class="temp-chart">
<div id="temp-chart" class="temp-chart__inner" />
<div class="temp-chart" style="height: 300px;">
<div id="temp-chart" class="temp-chart__inner" style="height: 100%;" />
</div>
</el-dialog>
</template>
@@ -38,6 +38,7 @@
import BaseListTable from "@/components/BaseListTable.vue";
import chartConfig from "./configs/chart";
import tableConfig from "./configs/tableProps";
import * as echarts from "echarts";

export default {
name: "TemperatureDialog",
@@ -62,6 +63,13 @@ export default {
this.refreshLayoutKey = Math.random();
},
mounted() {},
watch: {
dataList: {
handler: function (val) {
this.drawChart(val);
},
},
},
methods: {
init(id) {
this.hisId = id;
@@ -108,6 +116,8 @@ export default {
},
drawChart() {
// 根据 dataList 绘制折线图
if (!this.chart) this.chart = echarts.init(document.getElementById("temp-chart"));
this.chart.setOption(this.chartConfig);
},
handleOperate() {},
handlePageChange(page) {


Loading…
取消
儲存