| | |
| | | <div style="width: 100%; height: 100%"> |
| | | <div class="topSelect"> |
| | | <!-- <el-cascader v-model="newMac" :options="options" clearable change-on-select :props="{ checkStrictly: true }" placeholder="选择设备" /> --> |
| | | <el-cascader |
| | | v-model="newMac" |
| | | :options="options" |
| | | :props="props" |
| | | collapse-tags |
| | | clearable |
| | | placeholder="选择设备" |
| | | style="width: 354px" |
| | | /> |
| | | <el-cascader v-model="newMac" :options="options" :props="props" collapse-tags clearable placeholder="选择设备" |
| | | style="width: 354px" /> |
| | | <!-- <div> --> |
| | | <el-select |
| | | v-model="value" |
| | | placeholder="选择因子" |
| | | style="margin-left: 20px" |
| | | > |
| | | <el-option |
| | | v-for="(item, index) in newSensor" |
| | | :key="index" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | <el-select v-model="value" placeholder="选择因子" style="margin-left: 20px"> |
| | | <el-option v-for="(item, index) in newSensor" :key="index" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | <!-- </div> --> |
| | | <!-- <el-radio-group v-model="radio1" style="margin-left:20px"> |
| | |
| | | <el-radio-button label="月报" /> |
| | | <el-radio-button label="自定义" /> |
| | | </el-radio-group> --> |
| | | <el-select |
| | | v-model="select1" |
| | | placeholder="请选择" |
| | | style="margin-left: 20px; width: 200px" |
| | | > |
| | | <el-option |
| | | v-for="item in options1" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | <el-select v-model="select1" placeholder="请选择" style="margin-left: 20px; width: 200px"> |
| | | <el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <component |
| | | :is="dataType" |
| | | style="padding-left: 0; margin-left: 20px; width: 160px" |
| | | @sendPickerChild="showPickerChild" |
| | | class="select11" |
| | | /> |
| | | <component :is="dataType" style="padding-left: 0; margin-left: 20px; width: 160px" |
| | | @sendPickerChild="showPickerChild" class="select11" /> |
| | | <!--查询按钮--> |
| | | <el-button @click="selectData" class="btn1">查询</el-button> |
| | | </div> |
| | |
| | | isSelect: false, |
| | | options1: [ |
| | | { |
| | | label: '五分钟报', |
| | | value: '五分钟报', |
| | | }, |
| | | { |
| | | label: '小时报', |
| | | value: '小时报', |
| | | }, |
| | |
| | | } |
| | | // 设备更新后,重新获取因子数据 |
| | | this.getSensor() |
| | | console.log(this.newMac1) |
| | | }, |
| | | // 监听dataType的数据更新 |
| | | select1(nv, ov) { |
| | |
| | | } else if (nv === '小时报') { |
| | | this.dataType = 'HourPicker1' |
| | | this.unit = 'hour' |
| | | } else if (nv === '五分钟报') { |
| | | this.dataType = 'HourPicker1' |
| | | this.unit = 'FiveMinute' |
| | | } else { |
| | | this.dataType = 'CustomPicker' |
| | | this.unit = 'hour' |
| | |
| | | one === 'a34002' || |
| | | one === 'a21004' || |
| | | one === 'a21026' || |
| | | one === 'a05024' || |
| | | one === 'a21001' |
| | | one === 'a05024' |
| | | ) { |
| | | this.selectyz = '(单位:ug/m³)' |
| | | } else if ( |
| | |
| | | this.selectyz = '(单位:pcs/0.1L)' |
| | | } else if (one === 'a00e13') { |
| | | this.selectyz = '(单位:db)' |
| | | } else if (one === 'a21028') { |
| | | } else if ( |
| | | one === 'a21028' || |
| | | one === 'a25002' || |
| | | one === 'a21001' || |
| | | one === 'a25005' || |
| | | one === 'a25003' |
| | | ) { |
| | | this.selectyz = '(单位:ppm)' |
| | | } |
| | | }, |
| | |
| | | // mounted() { |
| | | // |
| | | // }, |
| | | beforeCreate() {}, // 生命周期 - 创建之前 |
| | | beforeMount() {}, // 生命周期 - 挂载之前 |
| | | beforeUpdate() {}, // 生命周期 - 更新之前 |
| | | updated() {}, // 生命周期 - 更新之后 |
| | | beforeDestroy() {}, // 生命周期 - 销毁之前 |
| | | destroyed() {}, // 生命周期 - 销毁完成 |
| | | activated() {}, |
| | | beforeCreate() { }, // 生命周期 - 创建之前 |
| | | beforeMount() { }, // 生命周期 - 挂载之前 |
| | | beforeUpdate() { }, // 生命周期 - 更新之前 |
| | | updated() { }, // 生命周期 - 更新之后 |
| | | beforeDestroy() { }, // 生命周期 - 销毁之前 |
| | | destroyed() { }, // 生命周期 - 销毁完成 |
| | | activated() { }, |
| | | // 方法集合 |
| | | methods: { |
| | | // 查询数据 |
| | | selectData() { |
| | | console.log(this.newData) |
| | | var newLineChartData = { |
| | | series: [], |
| | | xAxis: [], |
| | |
| | | }) |
| | | .then((res) => { |
| | | // console.log('获得时间对应因子数据') |
| | | console.log(res) |
| | | const data = res.data |
| | | let lockLength = 0 |
| | | for (let i = 0; i < data.length; i++) { |
| | | for (let j = 0; j < data[i].deviceData.length; j++) { |
| | | // console.log(data[i].deviceData); |
| | | if (res.data[0].deviceData.length == 1) { |
| | | newLineChartData.series.push({ |
| | | data: [], |
| | | name: '', |
| | | type: 'line', |
| | | label: { |
| | | show: true, |
| | | position: 'top', |
| | | }, |
| | | }) |
| | | if (res.data[0].deviceData.length === 1) { |
| | | if (lockLength < data[i].deviceData.length) { |
| | | newLineChartData.series.push({ |
| | | data: [], |
| | | triggerLineEvent: true, |
| | | emphasis: { |
| | | focus: 'series' |
| | | }, |
| | | name: '', |
| | | type: 'line', |
| | | label: { |
| | | show: true, |
| | | position: 'top', |
| | | }, |
| | | }) |
| | | } |
| | | } else { |
| | | newLineChartData.series.push({ |
| | | data: [], |
| | | name: '', |
| | | triggerLineEvent: true, |
| | | emphasis: { focus: 'series' }, |
| | | type: 'line', |
| | | }) |
| | | } |
| | |
| | | }, |
| | | // 通过设备号获得因子数据 |
| | | getSensor() { |
| | | this.newSensor = [] |
| | | // stringMacs.su |
| | | // var newMac = this.newMac[this.newMac.length - 1][this.newMac[this.newMac.length - 1].length - 1] |
| | | // this.newMac1 = this.newMac[this.newMac.length - 1][this.newMac[this.newMac.length - 1].length - 1] |
| | |
| | | display: flex; |
| | | margin-bottom: 20px; |
| | | padding: 20px 15px 0 15px; |
| | | |
| | | span:first-child { |
| | | flex: 1; |
| | | } |
| | | |
| | | div:last-child { |
| | | width: 300px; |
| | | line-height: 40px; |
| | | padding-left: 6px; |
| | | } |
| | | } |
| | | |
| | | .topTitle { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | padding: 0 15px; |
| | | } |
| | | |
| | | .btn1 { |
| | | margin-left: 1%; |
| | | height: 40px; |
| | |
| | | .select11 { |
| | | width: 20% !important; |
| | | } |
| | | |
| | | /deep/.el-date-editor .el-range-separator { |
| | | width: 11%; |
| | | } |