| | |
| | | }, |
| | | /** |
| | | * 查询实时前100笔数据 |
| | | * 参数 dev_id |
| | | * 参数 dev_id dev_name |
| | | */ |
| | | searchHistory100(data) { |
| | | // 请求后台查询结果 |
| | |
| | | |
| | | result.data = { |
| | | dev_id: batt.dev_id, |
| | | dev_name: batt.full_name, |
| | | record_time: this.record_time.format("yyyy-MM-dd hh:mm:ss"), |
| | | record_time1: this.record_time1.format("yyyy-MM-dd hh:mm:ss"), |
| | | list: list |
| | |
| | | if(res.code == 1) { |
| | | data = res.data; |
| | | } |
| | | //console.log(data); |
| | | // 格式化数据 |
| | | self.formatTreeData(data); |
| | | }); |
| | |
| | | _data.txt = _data.dev_name; |
| | | _data.active = false; |
| | | _data.open = false; |
| | | _data.full_name = _data.sys_name+"-"+_data.dev_name; |
| | | var index = this.checkDataInTree(result, _data); |
| | | if(index == -1) { |
| | | var tmp = { |
| | |
| | | result[index].children.push(_data); |
| | | } |
| | | } |
| | | console.log(result[0].children); |
| | | this.treeData = result; |
| | | }, |
| | | checkDataInTree(list, data) { |
| | |
| | | dev_name: data.txt, |
| | | pattern: this.getPattern(data.match_str), |
| | | match_type: data.match_type, |
| | | full_name: data.full_name, |
| | | configs: configs |
| | | }); |
| | | }, |
| | |
| | | num++; |
| | | } |
| | | }); |
| | | console.log(self.options); |
| | | // 设置选中的显示的内容 |
| | | self.setShowChartTille(); |
| | | // 查询后台数据 |
| | |
| | | var searchParams = { |
| | | dev_id: batt.dev_id, |
| | | table_name: this.table_name, |
| | | dev_name: batt.full_name, |
| | | }; |
| | | |
| | | // 查询后台 |
| | | this.$api.batt.searchHistory100(searchParams) |
| | | .then(function(res) { |
| | | res = JSON.parse(res.data.result); |
| | | console.log(res); |
| | | let data = []; |
| | | if(res.code == 1) { |
| | | data = res.data; |
| | |
| | | this.curDevId = data.dev_id; |
| | | this.curDevName = data.txt; |
| | | // 查询相关子站的数据 |
| | | this.$api.file.searchAllFile({dev_id: data.dev_id}) |
| | | this.$api.file.searchAllFile({dev_id: data.dev_id,dev_name: data.txt}) |
| | | .then((res) => { |
| | | let data = JSON.parse(res.data.result); |
| | | let list = []; |
| | |
| | | value: '5', |
| | | label: '删除', |
| | | }, |
| | | { |
| | | value: '11', |
| | | label: '导出' |
| | | }, |
| | | { |
| | | value: '12', |
| | | label: '查询', |
| | | } |
| | | ], |
| | | users: [], |
| | | searchParams: { |
| | |
| | | batt: { |
| | | dev_id: '', |
| | | dev_name: '', |
| | | full_name: '', |
| | | pattern: new RegExp(''), |
| | | match_type: 0, |
| | | configs: [] |