qinxianzhangyao
2024-03-18 e3a63203c823a4b7fcb12a52769c34acdc0b7a19
src/views/standard/tijiancom/index.vue
@@ -1,25 +1,10 @@
<template>
  <div>
    <el-form
      :model="queryParams"
      ref="tableList"
      :inline="true"
      label-width="76px"
      style="margin: 10px 10px"
    >
    <el-form :model="queryParams" ref="tableList" :inline="true" label-width="76px" style="margin: 10px 10px">
      <el-form-item label="统计区间" prop="date">
        <el-date-picker
          v-model="value1"
          type="datetimerange"
          align="right"
          start-placeholder="开始日期"
          :picker-options="pickerOptions"
          end-placeholder="结束日期"
          :default-time="['00:00:00', '23:00:00']"
          format="yyyy-MM-dd HH:mm"
          value-format="yyyy-MM-dd HH:mm"
          @change="dateChangebirthday1"
        >
        <el-date-picker v-model="value1" type="datetimerange" align="right" start-placeholder="开始日期"
          :picker-options="pickerOptions" end-placeholder="结束日期" :default-time="['00:00:00', '23:00:00']"
          format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" @change="dateChangebirthday1">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
@@ -32,8 +17,8 @@
    </div>
  </div>
</template>
<script>
import { GetChartByDate } from "@/api/count/chart";
const echarts = require("echarts/lib/echarts");
@@ -101,11 +86,18 @@
          moment(res.data).format("YYYY-MM-DD 00:00:00"),
          moment(res.data).format("YYYY-MM-DD 23:59:00"),
        ];
        this.getList()
      });
    },
    getList() {
      this.queryParams.startDate = this.startTime[0];
      this.queryParams.endDate = this.startTime[1];
      if (this.value1) {
        this.queryParams.startDate = this.value1[0];
        this.queryParams.endDate = this.value1[1];
      } else {
        this.queryParams.startDate = this.startTime[0];
        this.queryParams.endDate = this.startTime[1];
      }
      let myChart = this.$echarts.init(document.getElementById("main"));
      //你进入页面先把图表渲染了  然后才获取的数据把
      myChart.setOption({
@@ -184,7 +176,4 @@
  height: 580px;
  background-color: #fff;
}
</style>
</style>