| | |
| | | <template> |
| | | +<template> |
| | | <div style="width:100%"> |
| | | <div class="topSelect"> |
| | | <el-cascader |
| | |
| | | :value="item.value" |
| | | /> |
| | | </el-select> --> |
| | | <el-radio-group v-model="radio1" style="margin-left:20px"> |
| | | <!-- <el-radio-group v-model="radio1" style="margin-left:20px"> |
| | | <el-radio-button label="日报" /> |
| | | <el-radio-button label="月报" /> |
| | | <el-radio-button label="月报" /> --> |
| | | <!-- <el-radio-button label="年报" /> |
| | | <el-radio-button label="自定义" /> --> |
| | | </el-radio-group> |
| | | <component :is="dataType" style="padding-left:0;margin-left:20px;width:160px" @sendPickerChild="showPickerChild" /> |
| | | <!-- </el-radio-group> --> |
| | | <el-select v-model="radio1" placeholder="请选择" style="margin-left:20px"> |
| | | <el-option |
| | | v-for="item in options1" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <component :is="dataType" class="select11" style="padding-left:0;margin-left:20px;width:160px" @sendPickerChild="showPickerChild" /> |
| | | <!--查询按钮--> |
| | | <el-button @click="selectData" class="btn1">查询</el-button> |
| | | </div> |
| | |
| | | } |
| | | } |
| | | export default { |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | | // import 引入的组件需要注入到对象中才能使用props |
| | | components: { |
| | | LineChart, |
| | | DatePicker, |
| | |
| | | // newMac2:'', |
| | | newSensor: [], |
| | | radio1: '日报', |
| | | unit: 1, |
| | | unit: 0, |
| | | type: 'select', |
| | | newLineChartData: { |
| | | series: [], |
| | |
| | | defaultData: [], |
| | | newListData: [], |
| | | chartSensorName: '', |
| | | middleData: [] |
| | | middleData: [], |
| | | options1:[ |
| | | |
| | | { |
| | | label:'日报', |
| | | value:'日报' |
| | | } |
| | | , { |
| | | label:'月报', |
| | | value:'月报' |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | // 计算属性 类似于data概念 |
| | |
| | | radio1(nv, ov) { |
| | | if (nv === '日报') { |
| | | this.dataType = 'HourPicker' |
| | | this.unit = 1 |
| | | this.unit = 0 |
| | | } else if (nv === '月报') { |
| | | this.dataType = 'DatePicker' |
| | | this.unit = 3 |
| | | this.unit = 1 |
| | | } |
| | | // else if (nv === '年报') { |
| | | // this.dataType = 'MouthPicker' |
| | |
| | | for (let i = 0; i < this.defaultData.length; i++) { |
| | | this.options.push({ value: this.defaultData[i].name, label: this.defaultData[i].name }) |
| | | this.options[i].children = [] |
| | | if (this.defaultData[i].devices) { |
| | | for (let j = 0; j < this.defaultData[i].devices.length; j++) { |
| | | this.options[i].children.push({ value: [this.defaultData[i].devices[j].name, this.defaultData[i].devices[j].mac], label: this.defaultData[i].devices[j].name }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | |
| | | title: [] |
| | | } |
| | | this.newXData = [] |
| | | this.$request({ |
| | | url: '/dataDisplay/sensorComparisonDisplay', |
| | | this.$request({ // dataDisplay/sensorComparisonDisplayV2 |
| | | url: '/dataDisplay/sensorComparisonDisplayV2', |
| | | method: 'post', |
| | | data: { |
| | | mac: this.newMac1[0], |
| | | sensors: this.value1, |
| | | sensorCodes: this.value1, |
| | | reportType: this.unit, |
| | | time: this.newData |
| | | times: this.newData |
| | | } |
| | | }).then((res) => { |
| | | // console.log('获得时间对应因子数据') |
| | | // console.log(res) |
| | | console.log(res, 111) |
| | | this.middleData = JSON.parse(JSON.stringify(res.data)) |
| | | const data = res.data |
| | | // 无量纲算法 |
| | |
| | | // 大数组sort升序方法 |
| | | data.sort(this.compare('sort', true)) |
| | | // 给折线图数据添加遍历 |
| | | |
| | | // for (let i = 0; i < data.length; i++) { |
| | | // newLineChartData.series.push({ data: [], name: '', type: 'line' }) |
| | | // newLineChartData.series[i].name = data[i].name |
| | |
| | | newLineChartData.series[i].name = data[i].name |
| | | newLineChartData.title.push(data[i].name) |
| | | for (let j = 0; j < data[i].timeValueList.length; j++) { |
| | | // console.log(data); |
| | | data[i].timeValueList[j].value = data[i].timeValueList[j].value * data[i].Factor |
| | | newLineChartData.series[i].data.push({ value: 0, data0: 0 }) |
| | | newLineChartData.series[i].data[j].value = data[i].timeValueList[j].value |
| | |
| | | } |
| | | } |
| | | this.lineChartData = newLineChartData |
| | | // console.log(newLineChartData.series[0].name); |
| | | }).catch((err) => { |
| | | console.log(err) |
| | | }) |
| | |
| | | margin-left: 1%; |
| | | height: 40px; |
| | | } |
| | | .select11{ |
| | | width: 20% !important |
| | | } |
| | | /deep/.el-date-editor .el-range-separator{ |
| | | width: 11% |
| | | } |
| | | </style> |