| | |
| | | options: {}, |
| | | drawer: false, |
| | | showChartTitle: [], |
| | | table_name: new Date().format('yyyy-MM-dd'), |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | // 设置选中的显示的内容 |
| | | self.setShowChartTille(); |
| | | // 查询后台数据 |
| | | self.searchHistoryTimeRange(); |
| | | }); |
| | | }, |
| | | searchHistoryTimeRange() { |
| | | let batt = this.$store.state.batt; |
| | | if(batt.dev_id == "") { |
| | | return; |
| | | } |
| | | // 构造查询条件 |
| | | let searchParams = { |
| | | dev_id: batt.dev_id, |
| | | }; |
| | | let self = this; |
| | | this.$api.batt.searchHistoryTimeRange(searchParams) |
| | | .then(function(res) { |
| | | res = JSON.parse(res.data.result); |
| | | self.table_name = new Date().format('yyyy-MM-dd'); |
| | | if(res.code == 1) { |
| | | self.table_name = res.data[1]; |
| | | } |
| | | // 请求前100笔数据 |
| | | self.searchHistory100(); |
| | | }); |
| | | }, |
| | |
| | | var self = this; |
| | | // 构造查询条件 |
| | | var searchParams = { |
| | | dev_id: batt.dev_id |
| | | dev_id: batt.dev_id, |
| | | table_name: this.table_name, |
| | | }; |
| | | |
| | | // 查询后台 |