| | |
| | | <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> |
| | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | |
| | | |
| | | <script> |
| | | import { GetChartByDate } from "@/api/count/chart"; |
| | | const echarts = require("echarts/lib/echarts"); |
| | |
| | | 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({ |
| | |
| | | height: 580px; |
| | | background-color: #fff; |
| | | } |
| | | </style> |
| | | |
| | | |
| | | |
| | | </style> |