import chart
This commit is contained in:
		@@ -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'
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
};
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user