|  |  |  | 
|---|
|  |  |  | :picker-options="pickerOptions" | 
|---|
|  |  |  | end-placeholder="结束日期" | 
|---|
|  |  |  | style="margin-left: 1rem" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </el-date-picker> | 
|---|
|  |  |  | /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <el-button type="primary" @click="toExcel()" style="margin-left: 20px" | 
|---|
|  |  |  | >导出</el-button | 
|---|
|  |  |  | <el-button | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | style="margin-left: 20px" | 
|---|
|  |  |  | @click="toExcel()" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-button @click="exportMon">查询</el-button> | 
|---|
|  |  |  | 导出 | 
|---|
|  |  |  | </el-button> | 
|---|
|  |  |  | <el-button @click="exportMon"> | 
|---|
|  |  |  | 查询 | 
|---|
|  |  |  | </el-button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <el-table :data="dateList" id="exportTab" style="margin-top: 20px" border max-height="800"> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | id="exportTab" | 
|---|
|  |  |  | :data="dateList" | 
|---|
|  |  |  | style="margin-top: 20px" | 
|---|
|  |  |  | border | 
|---|
|  |  |  | max-height="800" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | v-for="item in columnList" | 
|---|
|  |  |  | :key="item" | 
|---|
|  |  |  | :prop="item" | 
|---|
|  |  |  | :label="item" | 
|---|
|  |  |  | width="180px" | 
|---|
|  |  |  | :key="item" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | // import 引入的组件需要注入到对象中才能使用props | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | // 这里存放数据 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | props: { multiple: true }, | 
|---|
|  |  |  | 
|---|
|  |  |  | // newMac2:'', | 
|---|
|  |  |  | newSensor: [], | 
|---|
|  |  |  | timevalue: [], | 
|---|
|  |  |  | columnList: [], //表头的数组 | 
|---|
|  |  |  | columnList: [], // 表头的数组 | 
|---|
|  |  |  | dateList: [], | 
|---|
|  |  |  | pickerOptions: { | 
|---|
|  |  |  | disabledDate: (time) => { | 
|---|
|  |  |  | 
|---|
|  |  |  | computed: {}, | 
|---|
|  |  |  | // 监控data中的数据变化 | 
|---|
|  |  |  | watch: { | 
|---|
|  |  |  | newMac(newVal, oldval) { | 
|---|
|  |  |  | newMac (newVal, oldval) { | 
|---|
|  |  |  | this.newMac1 = [] | 
|---|
|  |  |  | this.newMac1.push(newVal[1][1]) | 
|---|
|  |  |  | this.getSensor() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | value(n, o) { | 
|---|
|  |  |  | value (n, o) { | 
|---|
|  |  |  | this.value1 = [] | 
|---|
|  |  |  | for (let i = 0; i < n.length; i++) { | 
|---|
|  |  |  | this.value1.push(n[i][0]) | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 生命周期 - 创建完成(可以访问当前 this 实例) | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 生命周期 - 挂载完成(可以访问 DOM 元素) | 
|---|
|  |  |  | mounted() {}, | 
|---|
|  |  |  | beforeCreate() {}, // 生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount() {}, // 生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate() {}, // 生命周期 - 更新之前 | 
|---|
|  |  |  | updated() {}, // 生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy() {}, // 生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed() {}, // 生命周期 - 销毁完成 | 
|---|
|  |  |  | activated() {}, | 
|---|
|  |  |  | mounted () {}, | 
|---|
|  |  |  | beforeCreate () {}, // 生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount () {}, // 生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate () {}, // 生命周期 - 更新之前 | 
|---|
|  |  |  | updated () {}, // 生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy () {}, // 生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed () {}, // 生命周期 - 销毁完成 | 
|---|
|  |  |  | activated () {}, | 
|---|
|  |  |  | // 方法集合 | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | // 请求左侧设备数据 | 
|---|
|  |  |  | getData() { | 
|---|
|  |  |  | getData () { | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | url: '/monitorPoint/queryMonitorPoints', | 
|---|
|  |  |  | method: 'get', | 
|---|
|  |  |  | 
|---|
|  |  |  | label: this.defaultData[i].name, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.options[i].children = [] | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 通过mac号获得因子 | 
|---|
|  |  |  | getSensor() { | 
|---|
|  |  |  | getSensor () { | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | url: '/deviceInfo/getMacSensors', | 
|---|
|  |  |  | method: 'post', | 
|---|
|  |  |  | 
|---|
|  |  |  | console.log(err) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | exportMon() { | 
|---|
|  |  |  | exportMon () { | 
|---|
|  |  |  | console.log(this.timevalue) | 
|---|
|  |  |  | if (this.newMac == '') { | 
|---|
|  |  |  | this.$message.warning('请选择站点') | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$message.warning('请选择因子') | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.dateList = [] | 
|---|
|  |  |  | this.columnList = [] | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | toExcel() { | 
|---|
|  |  |  | toExcel () { | 
|---|
|  |  |  | let wb = XLSX.utils.table_to_book(document.querySelector('#exportTab'), { | 
|---|
|  |  |  | sheet: '分组表', | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ws | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | setExlStyle(data) { | 
|---|
|  |  |  | setExlStyle (data) { | 
|---|
|  |  |  | let borderAll = { | 
|---|
|  |  |  | //单元格外侧框线 | 
|---|
|  |  |  | // 单元格外侧框线 | 
|---|
|  |  |  | top: { | 
|---|
|  |  |  | style: 'thin', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | data[key].s = { | 
|---|
|  |  |  | border: borderAll, | 
|---|
|  |  |  | alignment: { | 
|---|
|  |  |  | horizontal: 'center', //水平居中对齐 | 
|---|
|  |  |  | horizontal: 'center', // 水平居中对齐 | 
|---|
|  |  |  | vertical: 'center', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | font: { | 
|---|
|  |  |  | 
|---|
|  |  |  | <div style="padding: 20px"> | 
|---|
|  |  |  | <el-card> | 
|---|
|  |  |  | <div style="display: flex"> | 
|---|
|  |  |  | <div class="timee" style="margin-top: 0.5rem"> | 
|---|
|  |  |  | <div | 
|---|
|  |  |  | class="timee" | 
|---|
|  |  |  | style="margin-top: 0.5rem" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | {{ time }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="margin-left: 1.5rem"> | 
|---|
|  |  |  | 
|---|
|  |  |  | :props="props" | 
|---|
|  |  |  | collapse-tags | 
|---|
|  |  |  | clearable | 
|---|
|  |  |  | @change="changeYz" | 
|---|
|  |  |  | placeholder="选择设备" | 
|---|
|  |  |  | style="width: 25rem" | 
|---|
|  |  |  | ></el-cascader> | 
|---|
|  |  |  | @change="changeYz" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="margin-left: 1.5rem"> | 
|---|
|  |  |  | <span>选择因子:</span> | 
|---|
|  |  |  | 
|---|
|  |  |  | collapse-tags | 
|---|
|  |  |  | clearable | 
|---|
|  |  |  | @change="res" | 
|---|
|  |  |  | ></el-cascader> | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="margin-left: 1.5rem"> | 
|---|
|  |  |  | <el-button type="primary" @click="Equisel">查询</el-button> | 
|---|
|  |  |  | <el-button | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | @click="Equisel" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | 查询 | 
|---|
|  |  |  | </el-button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </el-card> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | :data="dateList" | 
|---|
|  |  |  | style="margin-top: 20px" | 
|---|
|  |  |  | border | 
|---|
|  |  |  | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | v-for="item in columnList" | 
|---|
|  |  |  | :key="item" | 
|---|
|  |  |  | :prop="item" | 
|---|
|  |  |  | :label="item" | 
|---|
|  |  |  | width="180px" | 
|---|
|  |  |  | :key="item" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等) | 
|---|
|  |  |  | // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等) | 
|---|
|  |  |  | // 例如:import《组件名称》from'《组件路径》'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | //import 引入的组件需要注入到对象中才能使用 | 
|---|
|  |  |  | // import 引入的组件需要注入到对象中才能使用 | 
|---|
|  |  |  | components: {}, | 
|---|
|  |  |  | props: {}, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | //这里存放数据 | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | // 这里存放数据 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | time: '', | 
|---|
|  |  |  | props: { multiple: true }, | 
|---|
|  |  |  | defaultData: [], | 
|---|
|  |  |  | options: [], | 
|---|
|  |  |  | newSensor:[], | 
|---|
|  |  |  | newMac:'', | 
|---|
|  |  |  | newMac1:[], | 
|---|
|  |  |  | value:'', | 
|---|
|  |  |  | value1:'', | 
|---|
|  |  |  | columnList: [], //表头的数组 | 
|---|
|  |  |  | newSensor: [], | 
|---|
|  |  |  | newMac: '', | 
|---|
|  |  |  | newMac1: [], | 
|---|
|  |  |  | value: '', | 
|---|
|  |  |  | value1: '', | 
|---|
|  |  |  | columnList: [], // 表头的数组 | 
|---|
|  |  |  | dateList: [], | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | computed: {}, | 
|---|
|  |  |  | // 监控data中的数据变化 | 
|---|
|  |  |  | watch: { | 
|---|
|  |  |  | newMac(newVal, oldval) { | 
|---|
|  |  |  | newMac (newVal, oldval) { | 
|---|
|  |  |  | this.newMac1 = [] | 
|---|
|  |  |  | for (let i = 0; i < newVal.length; i++) { | 
|---|
|  |  |  | // console.log(newVal[i], 111) | 
|---|
|  |  |  | 
|---|
|  |  |  | this.getSensor() | 
|---|
|  |  |  | console.log(this.newMac1) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | value(n, o) { | 
|---|
|  |  |  | value (n, o) { | 
|---|
|  |  |  | this.value1 = [] | 
|---|
|  |  |  | for (let i = 0; i < n.length; i++) { | 
|---|
|  |  |  | this.value1.push(n[i][0]) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | //方法集合 | 
|---|
|  |  |  | // 生命周期 - 创建完成(可以访问当前 this 实例) | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | this.time = this.dateTypeFormat('YYYY-mm-dd HH:MM:SS', new Date()) | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 生命周期 - 挂载完成(可以访问 DOM 元素) | 
|---|
|  |  |  | mounted () {}, | 
|---|
|  |  |  | beforeCreate () {}, // 生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount () {}, // 生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate () {}, // 生命周期 - 更新之前 | 
|---|
|  |  |  | updated () {}, // 生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy () {}, // 生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed () {}, // 生命周期 - 销毁完成 | 
|---|
|  |  |  | activated () {}, | 
|---|
|  |  |  | // 方法集合 | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | res(res){ | 
|---|
|  |  |  | console.log(res.toString()); | 
|---|
|  |  |  | res (res) { | 
|---|
|  |  |  | console.log(res.toString()) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getData() { | 
|---|
|  |  |  | getData () { | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | url: '/monitorPoint/queryMonitorPoints', | 
|---|
|  |  |  | method: 'get', | 
|---|
|  |  |  | 
|---|
|  |  |  | label: this.defaultData[i].name, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.options[i].children = [] | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | console.log(error) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeYz(){ | 
|---|
|  |  |  | this.getSensor(); | 
|---|
|  |  |  | changeYz () { | 
|---|
|  |  |  | this.getSensor() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getSensor() { | 
|---|
|  |  |  | getSensor () { | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | url: '/deviceInfo/getMacSensors', | 
|---|
|  |  |  | method: 'post', | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .then((result) => { | 
|---|
|  |  |  | console.log(result); | 
|---|
|  |  |  | console.log(result) | 
|---|
|  |  |  | var sensor = result.data | 
|---|
|  |  |  | for (var i in sensor) { | 
|---|
|  |  |  | this.newSensor.push({ value: i, label: sensor[i] }) | 
|---|
|  |  |  | 
|---|
|  |  |  | console.log(err) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | Equisel(){ | 
|---|
|  |  |  | Equisel () { | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | url:'', | 
|---|
|  |  |  | method:'post', | 
|---|
|  |  |  | data:{ | 
|---|
|  |  |  | time:this.time, | 
|---|
|  |  |  | zhan:this.newMac1, | 
|---|
|  |  |  | sensorCode:this.value1 | 
|---|
|  |  |  | url: '', | 
|---|
|  |  |  | method: 'post', | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | time: this.time, | 
|---|
|  |  |  | zhan: this.newMac1, | 
|---|
|  |  |  | sensorCode: this.value1 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }).then((res)=>{ | 
|---|
|  |  |  | console.log(res); | 
|---|
|  |  |  | }).then((res) => { | 
|---|
|  |  |  | console.log(res) | 
|---|
|  |  |  | this.tableData = res.data | 
|---|
|  |  |  | console.log(this.tableData, 'this.tableData') | 
|---|
|  |  |  | for (let key in this.tableData[0]) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | //生命周期 - 创建完成(可以访问当前 this 实例) | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | this.time = this.dateTypeFormat('YYYY-mm-dd HH:MM:SS', new Date()) | 
|---|
|  |  |  | this.getData(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | //生命周期 - 挂载完成(可以访问 DOM 元素) | 
|---|
|  |  |  | mounted() {}, | 
|---|
|  |  |  | beforeCreate() {}, //生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount() {}, //生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate() {}, //生命周期 - 更新之前 | 
|---|
|  |  |  | updated() {}, //生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy() {}, //生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed() {}, //生命周期 - 销毁完成 | 
|---|
|  |  |  | activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发 | 
|---|
|  |  |  | }, // 如果页面有keep-alive缓存功能,这个函数会触发 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <style scoped> | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | 
|---|
|  |  |  | :props="props" | 
|---|
|  |  |  | collapse-tags | 
|---|
|  |  |  | clearable | 
|---|
|  |  |  | ></el-cascader> | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div> | 
|---|
|  |  |  | <el-select | 
|---|
|  |  |  | 
|---|
|  |  |  | :key="item.value" | 
|---|
|  |  |  | :label="item.label" | 
|---|
|  |  |  | :value="item.value" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </el-option> | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <component | 
|---|
|  |  |  | :is="dataType" | 
|---|
|  |  |  | style="padding-left: 0; margin-left: 20px; width: 160px" | 
|---|
|  |  |  | @sendPickerChild="showPickerChild" | 
|---|
|  |  |  | class="select11" | 
|---|
|  |  |  | @sendPickerChild="showPickerChild" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- <el-button type="primary" @click="toExcel()" style="margin-left: 20px" | 
|---|
|  |  |  | 
|---|
|  |  |  | <el-dropdown | 
|---|
|  |  |  | split-button | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | style="margin-left: 20px" | 
|---|
|  |  |  | @click="toExcel()" | 
|---|
|  |  |  | @command="handleCommand" | 
|---|
|  |  |  | style="margin-left: 20px" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | 导出 | 
|---|
|  |  |  | <el-dropdown-menu slot="dropdown"> | 
|---|
|  |  |  | <el-dropdown-item command="expNew">导出(新)</el-dropdown-item> | 
|---|
|  |  |  | <el-dropdown-item command="expNew"> | 
|---|
|  |  |  | 导出(新) | 
|---|
|  |  |  | </el-dropdown-item> | 
|---|
|  |  |  | </el-dropdown-menu> | 
|---|
|  |  |  | </el-dropdown> | 
|---|
|  |  |  | <el-button @click="exportMon" style="margin-left: 10px">查询</el-button> | 
|---|
|  |  |  | <el-button | 
|---|
|  |  |  | style="margin-left: 10px" | 
|---|
|  |  |  | @click="exportMon" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | 查询 | 
|---|
|  |  |  | </el-button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | :data="dateList" | 
|---|
|  |  |  | id="exportTab" | 
|---|
|  |  |  | :data="dateList" | 
|---|
|  |  |  | style="margin-top: 20px" | 
|---|
|  |  |  | border | 
|---|
|  |  |  | max-height="800" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | v-for="item in columnList" | 
|---|
|  |  |  | :key="item" | 
|---|
|  |  |  | :prop="item" | 
|---|
|  |  |  | :label="item" | 
|---|
|  |  |  | width="180px" | 
|---|
|  |  |  | :key="item" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <!-- <el-table-column | 
|---|
|  |  |  | v-for="item in columnList" | 
|---|
|  |  |  | :prop="item.props" | 
|---|
|  |  |  | 
|---|
|  |  |  | TimePicker1, | 
|---|
|  |  |  | HourPicker1, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | // 这里存放数据 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | props: { multiple: true }, | 
|---|
|  |  |  | 
|---|
|  |  |  | newMac: '', | 
|---|
|  |  |  | newMac1: [], | 
|---|
|  |  |  | newSensor: [] /* 因子数组 */, | 
|---|
|  |  |  | columnList: [], //表头的数组 | 
|---|
|  |  |  | columnList: [], // 表头的数组 | 
|---|
|  |  |  | dateList: [], | 
|---|
|  |  |  | timevalue: [], | 
|---|
|  |  |  | select1: '日报', | 
|---|
|  |  |  | 
|---|
|  |  |  | computed: {}, | 
|---|
|  |  |  | // 监控data中的数据变化 | 
|---|
|  |  |  | watch: { | 
|---|
|  |  |  | select1(nv, ov) { | 
|---|
|  |  |  | select1 (nv, ov) { | 
|---|
|  |  |  | if (nv === '日报') { | 
|---|
|  |  |  | this.dataType = 'HourPicker' | 
|---|
|  |  |  | this.unit = 'day' | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 监听设备的数据更新 | 
|---|
|  |  |  | newMac(newVal, oldval) { | 
|---|
|  |  |  | newMac (newVal, oldval) { | 
|---|
|  |  |  | this.newMac1 = [] | 
|---|
|  |  |  | for (let i = 0; i < newVal.length; i++) { | 
|---|
|  |  |  | // console.log(newVal[i], 111) | 
|---|
|  |  |  | 
|---|
|  |  |  | // 监听dataType的数据更新 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 生命周期 - 创建完成(可以访问当前 this 实例) | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 生命周期 - 挂载完成(可以访问 DOM 元素) | 
|---|
|  |  |  | // mounted() { | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  | beforeCreate() {}, // 生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount() {}, // 生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate() {}, // 生命周期 - 更新之前 | 
|---|
|  |  |  | updated() {}, // 生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy() {}, // 生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed() {}, // 生命周期 - 销毁完成 | 
|---|
|  |  |  | activated() {}, | 
|---|
|  |  |  | beforeCreate () {}, // 生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount () {}, // 生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate () {}, // 生命周期 - 更新之前 | 
|---|
|  |  |  | updated () {}, // 生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy () {}, // 生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed () {}, // 生命周期 - 销毁完成 | 
|---|
|  |  |  | activated () {}, | 
|---|
|  |  |  | // 方法集合 | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | handleCommand(command) { | 
|---|
|  |  |  | handleCommand (command) { | 
|---|
|  |  |  | if (this.newMac1 == '') { | 
|---|
|  |  |  | this.$message.warning('请选择站点') | 
|---|
|  |  |  | return | 
|---|
|  |  |  | 
|---|
|  |  |  | this.getOutExcel('列表数据导出.xlsx', res) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getOutExcel(fileName, res) { | 
|---|
|  |  |  | getOutExcel (fileName, res) { | 
|---|
|  |  |  | let blob = new Blob([res], { type: 'application/x-xls' }) | 
|---|
|  |  |  | if (window.navigator.msSaveOrOpenBlob) { | 
|---|
|  |  |  | //兼容 IE & EDGE | 
|---|
|  |  |  | // 兼容 IE & EDGE | 
|---|
|  |  |  | navigator.msSaveBlob(blob, fileName) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | var link = document.createElement('a') | 
|---|
|  |  |  | 
|---|
|  |  |  | const url = window.URL || window.webkitURL || window.moxURL | 
|---|
|  |  |  | // 创建下载链接 | 
|---|
|  |  |  | link.href = url.createObjectURL(blob) | 
|---|
|  |  |  | //命名下载名称 | 
|---|
|  |  |  | // 命名下载名称 | 
|---|
|  |  |  | link.download = fileName | 
|---|
|  |  |  | //点击触发下载 | 
|---|
|  |  |  | // 点击触发下载 | 
|---|
|  |  |  | link.click() | 
|---|
|  |  |  | //下载完成进行释放 | 
|---|
|  |  |  | // 下载完成进行释放 | 
|---|
|  |  |  | url.revokeObjectURL(link.href) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | showPickerChild(data) { | 
|---|
|  |  |  | showPickerChild (data) { | 
|---|
|  |  |  | this.newData = data | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getData() { | 
|---|
|  |  |  | getData () { | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | url: '/monitorPoint/queryMonitorPoints', | 
|---|
|  |  |  | method: 'get', | 
|---|
|  |  |  | 
|---|
|  |  |  | label: this.defaultData[i].name, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.options[i].children = [] | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 通过设备号获得因子数据 | 
|---|
|  |  |  | getSensor() { | 
|---|
|  |  |  | getSensor () { | 
|---|
|  |  |  | this.newSensor = [] | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | url: '/deviceInfo/getMacSensors', | 
|---|
|  |  |  | 
|---|
|  |  |  | console.log(err) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | exportMon() { | 
|---|
|  |  |  | exportMon () { | 
|---|
|  |  |  | if (this.newMac1 == '') { | 
|---|
|  |  |  | this.$message.warning('请选择站点') | 
|---|
|  |  |  | return | 
|---|
|  |  |  | 
|---|
|  |  |  | times: this.newData instanceof Array ? this.newData : [this.newData], | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }).then((res) => { | 
|---|
|  |  |  | //console.log(res, 11) | 
|---|
|  |  |  | // console.log(res, 11) | 
|---|
|  |  |  | this.tableData = res.data | 
|---|
|  |  |  | for (let key in this.tableData[0]) { | 
|---|
|  |  |  | this.columnList.push(key) | 
|---|
|  |  |  | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | toExcel() { | 
|---|
|  |  |  | toExcel () { | 
|---|
|  |  |  | let wb = XLSX.utils.table_to_book(document.querySelector('#exportTab'), { | 
|---|
|  |  |  | sheet: '分组表', | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ws | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | setExlStyle(data) { | 
|---|
|  |  |  | setExlStyle (data) { | 
|---|
|  |  |  | let borderAll = { | 
|---|
|  |  |  | //单元格外侧框线 | 
|---|
|  |  |  | // 单元格外侧框线 | 
|---|
|  |  |  | top: { | 
|---|
|  |  |  | style: 'thin', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | data[key].s = { | 
|---|
|  |  |  | border: borderAll, | 
|---|
|  |  |  | alignment: { | 
|---|
|  |  |  | horizontal: 'center', //水平居中对齐 | 
|---|
|  |  |  | horizontal: 'center', // 水平居中对齐 | 
|---|
|  |  |  | vertical: 'center', | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | font: { | 
|---|
|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <div style="width: 100%; height: 100%; margin:0 auto"> | 
|---|
|  |  |  | <div class="topSelect"> | 
|---|
|  |  |  | <el-cascader v-model="newMac" :options="options" clearable placeholder="选择设备" style="width: 354px" /> | 
|---|
|  |  |  | <el-cascader v-model="value" :options="newSensor" :props="props" collapse-tags clearable placeholder="选择因子" | 
|---|
|  |  |  | style="margin-left: 20px" /> | 
|---|
|  |  |  | <el-cascader | 
|---|
|  |  |  | v-model="newMac" | 
|---|
|  |  |  | :options="options" | 
|---|
|  |  |  | clearable | 
|---|
|  |  |  | placeholder="选择设备" | 
|---|
|  |  |  | style="width: 354px" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-cascader | 
|---|
|  |  |  | v-model="value" | 
|---|
|  |  |  | :options="newSensor" | 
|---|
|  |  |  | :props="props" | 
|---|
|  |  |  | collapse-tags | 
|---|
|  |  |  | clearable | 
|---|
|  |  |  | placeholder="选择因子" | 
|---|
|  |  |  | style="margin-left: 20px" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <!-- <el-select v-model="value" placeholder="选择因子"> | 
|---|
|  |  |  | <el-option | 
|---|
|  |  |  | v-for="item in newSensor" | 
|---|
|  |  |  | 
|---|
|  |  |  | <!-- <el-radio-button label="年报" /> | 
|---|
|  |  |  | <el-radio-button label="自定义" /> --> | 
|---|
|  |  |  | <!-- </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 | 
|---|
|  |  |  | 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-select> | 
|---|
|  |  |  | <component :is="dataType" class="select11" style="padding-left: 0; margin-left: 20px; width: 160px" | 
|---|
|  |  |  | @sendPickerChild="showPickerChild" /> | 
|---|
|  |  |  | <component | 
|---|
|  |  |  | :is="dataType" | 
|---|
|  |  |  | class="select11" | 
|---|
|  |  |  | style="padding-left: 0; margin-left: 20px; width: 160px" | 
|---|
|  |  |  | @sendPickerChild="showPickerChild" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <!--查询按钮--> | 
|---|
|  |  |  | <el-button @click="selectData" class="btn1">查询</el-button> | 
|---|
|  |  |  | <el-button | 
|---|
|  |  |  | class="btn1" | 
|---|
|  |  |  | @click="selectData" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | 查询 | 
|---|
|  |  |  | </el-button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!-- <div class="topTitle"> | 
|---|
|  |  |  | <div style="position:absolute">(单位:ug/m³)</div> | 
|---|
|  |  |  | <div style="text-align: center;width: 100%;">{{ newData }}·{{ newMac?newMac[0]:'' }}·{{ newMac?newMac[newMac.length - 1][0]:'' }}·{{ value |sensorFilter }}·趋势图</div> | 
|---|
|  |  |  | </div> --> | 
|---|
|  |  |  | <LineChart :chart-data="lineChartData" style="height: 40rem;" /> | 
|---|
|  |  |  | <LineChart | 
|---|
|  |  |  | :chart-data="lineChartData" | 
|---|
|  |  |  | style="height: 40rem;" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | props: { | 
|---|
|  |  |  | // defaultData: Array | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | // 这里存放数据 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | dataType: 'HourPicker', | 
|---|
|  |  |  | 
|---|
|  |  |  | computed: {}, | 
|---|
|  |  |  | // 监控data中的数据变化 | 
|---|
|  |  |  | watch: { | 
|---|
|  |  |  | newMac(newVal, oldval) { | 
|---|
|  |  |  | newMac (newVal, oldval) { | 
|---|
|  |  |  | this.newMac1 = [] | 
|---|
|  |  |  | // for (let i = 0; i < newVal.length; i++) { | 
|---|
|  |  |  | //   this.newMac1.push(newVal[i][1][1]) | 
|---|
|  |  |  | 
|---|
|  |  |  | //   this.getSensor() | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | value(n, o) { | 
|---|
|  |  |  | value (n, o) { | 
|---|
|  |  |  | this.value1 = [] | 
|---|
|  |  |  | for (let i = 0; i < n.length; i++) { | 
|---|
|  |  |  | this.value1.push(n[i][0]) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | radio1(nv, ov) { | 
|---|
|  |  |  | radio1 (nv, ov) { | 
|---|
|  |  |  | if (nv === '日报') { | 
|---|
|  |  |  | this.dataType = 'HourPicker' | 
|---|
|  |  |  | this.unit = 0 | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 生命周期 - 创建完成(可以访问当前 this 实例) | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 生命周期 - 挂载完成(可以访问 DOM 元素) | 
|---|
|  |  |  | mounted() { }, | 
|---|
|  |  |  | beforeCreate() { }, // 生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount() { }, // 生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate() { }, // 生命周期 - 更新之前 | 
|---|
|  |  |  | updated() { }, // 生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy() { }, // 生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed() { }, // 生命周期 - 销毁完成 | 
|---|
|  |  |  | activated() { }, | 
|---|
|  |  |  | mounted () { }, | 
|---|
|  |  |  | beforeCreate () { }, // 生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount () { }, // 生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate () { }, // 生命周期 - 更新之前 | 
|---|
|  |  |  | updated () { }, // 生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy () { }, // 生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed () { }, // 生命周期 - 销毁完成 | 
|---|
|  |  |  | activated () { }, | 
|---|
|  |  |  | // 方法集合 | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | // 请求左侧设备数据 | 
|---|
|  |  |  | getData() { | 
|---|
|  |  |  | getData () { | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | url: '/monitorPoint/queryMonitorPoints', | 
|---|
|  |  |  | method: 'get', | 
|---|
|  |  |  | 
|---|
|  |  |  | label: this.defaultData[i].name, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.options[i].children = [] | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 通过mac号获得因子 | 
|---|
|  |  |  | getSensor() { | 
|---|
|  |  |  | getSensor () { | 
|---|
|  |  |  | // 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] | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 查询 | 
|---|
|  |  |  | selectData() { | 
|---|
|  |  |  | selectData () { | 
|---|
|  |  |  | var newLineChartData = { | 
|---|
|  |  |  | series: [], | 
|---|
|  |  |  | xAxis: [], | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | for (var i = 0; i < data.length; i++) { | 
|---|
|  |  |  | newLineChartData.series.push({ | 
|---|
|  |  |  | data: [], name: '', type: 'line', triggerLineEvent: true, | 
|---|
|  |  |  | emphasis: { focus: 'series' }, lineStyle: { width: 4 } | 
|---|
|  |  |  | data: [], | 
|---|
|  |  |  | name: '', | 
|---|
|  |  |  | type: 'line', | 
|---|
|  |  |  | triggerLineEvent: true, | 
|---|
|  |  |  | emphasis: { focus: 'series' }, | 
|---|
|  |  |  | lineStyle: { width: 4 } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | // newLineChartData.yAxis.push({}) | 
|---|
|  |  |  | newLineChartData.series[i].name = data[i].name | 
|---|
|  |  |  | newLineChartData.title.push(data[i].name); | 
|---|
|  |  |  | newLineChartData.title.push(data[i].name) | 
|---|
|  |  |  | for (var j = 0; j < data[i].timeValueList.length; j++) { | 
|---|
|  |  |  | newLineChartData.series[i].data.push(data[i].timeValueList[j].value) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 获得子组件时间选择器传递的数据 | 
|---|
|  |  |  | showPickerChild(data) { | 
|---|
|  |  |  | showPickerChild (data) { | 
|---|
|  |  |  | // var newLineChartData = { | 
|---|
|  |  |  | //   series: [], | 
|---|
|  |  |  | //   xAxis: [], | 
|---|
|  |  |  | 
|---|
|  |  |  | // }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 获取最大值 | 
|---|
|  |  |  | getMaxValue(arr) { | 
|---|
|  |  |  | getMaxValue (arr) { | 
|---|
|  |  |  | // return Math.max.apply(null, arr) | 
|---|
|  |  |  | return Math.max(...arr) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 对比排序函数 | 
|---|
|  |  |  | compare(property, desc) { | 
|---|
|  |  |  | compare (property, desc) { | 
|---|
|  |  |  | return (a, b) => { | 
|---|
|  |  |  | var value1 = a[property] | 
|---|
|  |  |  | var value2 = b[property] | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 过滤图表因子名称 | 
|---|
|  |  |  | filterSensorName() { | 
|---|
|  |  |  | filterSensorName () { | 
|---|
|  |  |  | this.chartSensorName = this.$options.filters.sensorFilter( | 
|---|
|  |  |  | this.chartSensorKey[0].sensorCode | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | 
|---|
|  |  |  | style="width: 21rem" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <div> | 
|---|
|  |  |  | <el-radio-group v-model="select1" style="margin-left: 20px"> | 
|---|
|  |  |  | <el-radio-group | 
|---|
|  |  |  | v-model="select1" | 
|---|
|  |  |  | style="margin-left: 20px" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-radio-button label="小时报" /> | 
|---|
|  |  |  | <el-radio-button label="日报" /> | 
|---|
|  |  |  | <el-radio-button label="周报" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | <component | 
|---|
|  |  |  | :is="dataType" | 
|---|
|  |  |  | style="padding-left: 0; margin-left: 30px" | 
|---|
|  |  |  | @sendPickerChild="showPickerChild" | 
|---|
|  |  |  | class="select11" | 
|---|
|  |  |  | @sendPickerChild="showPickerChild" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-date-picker | 
|---|
|  |  |  | v-if="dateDisplay" | 
|---|
|  |  |  | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-button | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | @click="getReportForm()" | 
|---|
|  |  |  | style="margin-left: 10px" | 
|---|
|  |  |  | >查询</el-button | 
|---|
|  |  |  | @click="getReportForm()" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-button type="primary" @click="exportExcel()">报表导出</el-button> | 
|---|
|  |  |  | 查询 | 
|---|
|  |  |  | </el-button> | 
|---|
|  |  |  | <el-button | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | @click="exportExcel()" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | 报表导出 | 
|---|
|  |  |  | </el-button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="topTitle"> | 
|---|
|  |  |  | 
|---|
|  |  |  | :stripe="true" | 
|---|
|  |  |  | @sort-change="changeTableSort" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column prop="rank" label="排名" align="center" /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="rank" | 
|---|
|  |  |  | label="排名" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="deviceName" | 
|---|
|  |  |  | label="设备" | 
|---|
|  |  |  | 
|---|
|  |  |  | width="180" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column prop="time" label="时间" width="180" align="center" /> | 
|---|
|  |  |  | <el-table-column prop="aqi" label="AQI" sortable align="center" /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="time" | 
|---|
|  |  |  | label="时间" | 
|---|
|  |  |  | width="180" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="aqi" | 
|---|
|  |  |  | label="AQI" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="comIndex" | 
|---|
|  |  |  | label="综合指数" | 
|---|
|  |  |  | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column prop="a34004" label="PM2.5" sortable align="center" /> | 
|---|
|  |  |  | <el-table-column prop="a34002" label="PM10" sortable align="center" /> | 
|---|
|  |  |  | <el-table-column prop="a21026" label="SO2" sortable align="center" /> | 
|---|
|  |  |  | <el-table-column prop="a21004" label="NO2" sortable align="center" /> | 
|---|
|  |  |  | <el-table-column prop="a21005" label="CO" sortable align="center" /> | 
|---|
|  |  |  | <el-table-column prop="a05024" label="O3_8H" sortable align="center" /> | 
|---|
|  |  |  | <el-table-column prop="a99054" label="TVOC" sortable align="center" /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="a34004" | 
|---|
|  |  |  | label="PM2.5" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="a34002" | 
|---|
|  |  |  | label="PM10" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="a21026" | 
|---|
|  |  |  | label="SO2" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="a21004" | 
|---|
|  |  |  | label="NO2" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="a21005" | 
|---|
|  |  |  | label="CO" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="a05024" | 
|---|
|  |  |  | label="O3_8H" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="a99054" | 
|---|
|  |  |  | label="TVOC" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | weekPicker, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | props: {}, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | // 这里存放数据 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | newData: [], | 
|---|
|  |  |  | 
|---|
|  |  |  | computed: {}, | 
|---|
|  |  |  | // 监控data中的数据变化 | 
|---|
|  |  |  | watch: { | 
|---|
|  |  |  | select1(nv, ov) { | 
|---|
|  |  |  | select1 (nv, ov) { | 
|---|
|  |  |  | if (nv === '日报') { | 
|---|
|  |  |  | this.dataType = 'HourPicker' | 
|---|
|  |  |  | this.unit = 1 | 
|---|
|  |  |  | 
|---|
|  |  |  | this.dateDisplay = false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | newMac(newVal, oldval) { | 
|---|
|  |  |  | newMac (newVal, oldval) { | 
|---|
|  |  |  | this.newMac1 = [] | 
|---|
|  |  |  | for (let i = 0; i < newVal.length; i++) { | 
|---|
|  |  |  | // console.log(newVal[i], 111) | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 生命周期 - 创建完成(可以访问当前 this 实例) | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 生命周期 - 挂载完成(可以访问 DOM 元素) | 
|---|
|  |  |  | mounted() {}, | 
|---|
|  |  |  | beforeCreate() {}, // 生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount() {}, // 生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate() {}, // 生命周期 - 更新之前 | 
|---|
|  |  |  | updated() {}, // 生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy() {}, // 生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed() {}, // 生命周期 - 销毁完成 | 
|---|
|  |  |  | activated() {}, | 
|---|
|  |  |  | mounted () {}, | 
|---|
|  |  |  | beforeCreate () {}, // 生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount () {}, // 生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate () {}, // 生命周期 - 更新之前 | 
|---|
|  |  |  | updated () {}, // 生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy () {}, // 生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed () {}, // 生命周期 - 销毁完成 | 
|---|
|  |  |  | activated () {}, | 
|---|
|  |  |  | // 方法集合 | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | showPickerChild(data) { | 
|---|
|  |  |  | showPickerChild (data) { | 
|---|
|  |  |  | this.newData = data | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 重新添加rank排名(当表格的排序条件发生变化的时候会触发该事件) | 
|---|
|  |  |  | changeTableSort() { | 
|---|
|  |  |  | changeTableSort () { | 
|---|
|  |  |  | var sortTableData = this.$refs.mytable.tableData | 
|---|
|  |  |  | // console.log(this.$refs.mytable.tableData, 111) | 
|---|
|  |  |  | for (let i = 0; i < sortTableData.length; i++) { | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 导出报表 | 
|---|
|  |  |  | exportExcel() { | 
|---|
|  |  |  | exportExcel () { | 
|---|
|  |  |  | /* generate workbook object from table */ | 
|---|
|  |  |  | var xlsxParam = { raw: true } // 导出的内容只做解析,不进行格式转换 | 
|---|
|  |  |  | var wb = XLSX.utils.table_to_book( | 
|---|
|  |  |  | 
|---|
|  |  |  | return wbout | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 请求站点信息 | 
|---|
|  |  |  | getData() { | 
|---|
|  |  |  | getData () { | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | url: '/monitorPoint/queryMonitorPoints', | 
|---|
|  |  |  | method: 'get', | 
|---|
|  |  |  | 
|---|
|  |  |  | label: this.defaultData[i].name, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.options[i].children = [] | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 请求报表数据 | 
|---|
|  |  |  | getReportForm() { | 
|---|
|  |  |  | getReportForm () { | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | url: '/dataDisplay/monitorPointDataDisplay', | 
|---|
|  |  |  | method: 'post', | 
|---|
|  |  |  | 
|---|
|  |  |  | style="width: 21rem" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <div> | 
|---|
|  |  |  | <el-radio-group v-model="select1" style="margin-left: 20px"> | 
|---|
|  |  |  | <el-radio-group | 
|---|
|  |  |  | v-model="select1" | 
|---|
|  |  |  | style="margin-left: 20px" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-radio-button label="日报" /> | 
|---|
|  |  |  | <el-radio-button label="周报" /> | 
|---|
|  |  |  | <el-radio-button label="月报" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | <component | 
|---|
|  |  |  | :is="dataType" | 
|---|
|  |  |  | style="padding-left: 0; margin-left: 30px" | 
|---|
|  |  |  | @sendPickerChild="showPickerChild" | 
|---|
|  |  |  | class="select11" | 
|---|
|  |  |  | @sendPickerChild="showPickerChild" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-date-picker | 
|---|
|  |  |  | v-if="dateDisplay" | 
|---|
|  |  |  | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-button | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | @click="getReportForm()" | 
|---|
|  |  |  | style="margin-left: 10px" | 
|---|
|  |  |  | >查询</el-button | 
|---|
|  |  |  | @click="getReportForm()" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-button type="primary" @click="exportExcel()">报表导出</el-button> | 
|---|
|  |  |  | 查询 | 
|---|
|  |  |  | </el-button> | 
|---|
|  |  |  | <el-button | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | @click="exportExcel()" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | 报表导出 | 
|---|
|  |  |  | </el-button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="topTitle"> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | :data="tableData" | 
|---|
|  |  |  | id="exportTabs" | 
|---|
|  |  |  | :data="tableData" | 
|---|
|  |  |  | max-height="730" | 
|---|
|  |  |  | @sort-change="changeTableSort" | 
|---|
|  |  |  | style="width: 100%" | 
|---|
|  |  |  | @sort-change="changeTableSort" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column prop="name" label="站点名称" align="center"> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="综合指数" align="center"> | 
|---|
|  |  |  | <el-table-column prop="composite" label="指数" align="center"> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.composite !== 0 ? scope.row.composite : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="name" | 
|---|
|  |  |  | label="站点名称" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="综合指数" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="composite" | 
|---|
|  |  |  | label="指数" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.composite !== 0 ? scope.row.composite : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="排名" | 
|---|
|  |  |  | 
|---|
|  |  |  | prop="compositeNum" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.compositeNum !== 0 ? scope.row.compositeNum : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.compositeNum !== 0 ? scope.row.compositeNum : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="PM2.5" align="center"> | 
|---|
|  |  |  | <el-table-column prop="pm25" label="浓度" align="center"> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.pm25 !== 0 ? scope.row.pm25 : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="PM2.5" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="pm25" | 
|---|
|  |  |  | label="浓度" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.pm25 !== 0 ? scope.row.pm25 : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="排名" align="center" prop="pm25Num" sortable> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.pm25Num !== 0 ? scope.row.pm25Num : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="排名" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | prop="pm25Num" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.pm25Num !== 0 ? scope.row.pm25Num : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="PM10" align="center"> | 
|---|
|  |  |  | <el-table-column prop="pm10" label="浓度" align="center"> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.pm10 !== 0 ? scope.row.pm10 : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="PM10" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="pm10" | 
|---|
|  |  |  | label="浓度" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.pm10 !== 0 ? scope.row.pm10 : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="排名" align="center" prop="pm10Num" sortable> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.pm10Num !== 0 ? scope.row.pm10Num : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="排名" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | prop="pm10Num" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.pm10Num !== 0 ? scope.row.pm10Num : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="SO2" align="center"> | 
|---|
|  |  |  | <el-table-column prop="so2" label="浓度" align="center"> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.so2 !== 0 ? scope.row.so2 : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="SO2" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="so2" | 
|---|
|  |  |  | label="浓度" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.so2 !== 0 ? scope.row.so2 : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="排名" align="center" prop="so2Num" sortable> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.so2Num !== 0 ? scope.row.so2Num : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="排名" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | prop="so2Num" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.so2Num !== 0 ? scope.row.so2Num : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="NO2" align="center"> | 
|---|
|  |  |  | <el-table-column prop="no2" label="浓度" align="center"> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.no2 !== 0 ? scope.row.no2 : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="NO2" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="no2" | 
|---|
|  |  |  | label="浓度" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.no2 !== 0 ? scope.row.no2 : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="排名" align="center" prop="no2Num" sortable> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.no2Num !== 0 ? scope.row.no2Num : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="排名" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | prop="no2Num" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.no2Num !== 0 ? scope.row.no2Num : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="CO" align="center"> | 
|---|
|  |  |  | <el-table-column prop="co" label="浓度" align="center"> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.co !== 0 ? scope.row.co : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="CO" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="co" | 
|---|
|  |  |  | label="浓度" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.co !== 0 ? scope.row.co : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="排名" align="center" prop="conum" sortable> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.conum !== 0 ? scope.row.conum : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="排名" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | prop="conum" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.conum !== 0 ? scope.row.conum : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="O3" align="center"> | 
|---|
|  |  |  | <el-table-column prop="o3" label="浓度" align="center"> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.o3 !== 0 ? scope.row.o3 : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="O3" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="o3" | 
|---|
|  |  |  | label="浓度" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.o3 !== 0 ? scope.row.o3 : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="排名" align="center" prop="o3Num" sortable> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.o3Num !== 0 ? scope.row.o3Num : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="排名" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | prop="o3Num" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.o3Num !== 0 ? scope.row.o3Num : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="TVOC" align="center"> | 
|---|
|  |  |  | <el-table-column prop="tovc" label="浓度" align="center"> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.tovc !== 0 ? scope.row.tovc : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="TVOC" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | prop="tovc" | 
|---|
|  |  |  | label="浓度" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.tovc !== 0 ? scope.row.tovc : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="排名" align="center" prop="tovcnum" sortable> | 
|---|
|  |  |  | <template slot-scope="scope">{{ | 
|---|
|  |  |  | scope.row.tovcnum !== 0 ? scope.row.tovcnum : '--' | 
|---|
|  |  |  | }}</template> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | label="排名" | 
|---|
|  |  |  | align="center" | 
|---|
|  |  |  | prop="tovcnum" | 
|---|
|  |  |  | sortable | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template slot-scope="scope"> | 
|---|
|  |  |  | {{ | 
|---|
|  |  |  | scope.row.tovcnum !== 0 ? scope.row.tovcnum : '--' | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | 
|---|
|  |  |  | weekPicker, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | props: {}, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | // 这里存放数据 | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | newData: [], | 
|---|
|  |  |  | 
|---|
|  |  |  | computed: {}, | 
|---|
|  |  |  | // 监控data中的数据变化 | 
|---|
|  |  |  | watch: { | 
|---|
|  |  |  | select1(nv, ov) { | 
|---|
|  |  |  | select1 (nv, ov) { | 
|---|
|  |  |  | if (nv === '日报') { | 
|---|
|  |  |  | this.dataType = 'HourPicker' | 
|---|
|  |  |  | this.unit = 1 | 
|---|
|  |  |  | 
|---|
|  |  |  | this.dateDisplay = false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | newMac(newVal, oldval) { | 
|---|
|  |  |  | newMac (newVal, oldval) { | 
|---|
|  |  |  | this.newMac1 = [] | 
|---|
|  |  |  | for (let i = 0; i < newVal.length; i++) { | 
|---|
|  |  |  | // console.log(newVal[i], 111) | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 生命周期 - 创建完成(可以访问当前 this 实例) | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 生命周期 - 挂载完成(可以访问 DOM 元素) | 
|---|
|  |  |  | mounted() {}, | 
|---|
|  |  |  | beforeCreate() {}, // 生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount() {}, // 生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate() {}, // 生命周期 - 更新之前 | 
|---|
|  |  |  | updated() {}, // 生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy() {}, // 生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed() {}, // 生命周期 - 销毁完成 | 
|---|
|  |  |  | activated() {}, | 
|---|
|  |  |  | mounted () {}, | 
|---|
|  |  |  | beforeCreate () {}, // 生命周期 - 创建之前 | 
|---|
|  |  |  | beforeMount () {}, // 生命周期 - 挂载之前 | 
|---|
|  |  |  | beforeUpdate () {}, // 生命周期 - 更新之前 | 
|---|
|  |  |  | updated () {}, // 生命周期 - 更新之后 | 
|---|
|  |  |  | beforeDestroy () {}, // 生命周期 - 销毁之前 | 
|---|
|  |  |  | destroyed () {}, // 生命周期 - 销毁完成 | 
|---|
|  |  |  | activated () {}, | 
|---|
|  |  |  | // 方法集合 | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | showPickerChild(data) { | 
|---|
|  |  |  | showPickerChild (data) { | 
|---|
|  |  |  | this.newData = data | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 重新添加rank排名(当表格的排序条件发生变化的时候会触发该事件) | 
|---|
|  |  |  | changeTableSort() { | 
|---|
|  |  |  | changeTableSort () { | 
|---|
|  |  |  | var sortTableData = this.$refs.mytable.tableData | 
|---|
|  |  |  | // console.log(this.$refs.mytable.tableData, 111) | 
|---|
|  |  |  | for (let i = 0; i < sortTableData.length; i++) { | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 导出报表 | 
|---|
|  |  |  | exportExcel() { | 
|---|
|  |  |  | exportExcel () { | 
|---|
|  |  |  | /* generate workbook object from table */ | 
|---|
|  |  |  | var xlsxParam = { raw: true } // 导出的内容只做解析,不进行格式转换 | 
|---|
|  |  |  | var wb = XLSX.utils.table_to_book( | 
|---|
|  |  |  | 
|---|
|  |  |  | return wbout | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 请求站点信息 | 
|---|
|  |  |  | getData() { | 
|---|
|  |  |  | getData () { | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | url: '/monitorPoint/queryMonitorPoints', | 
|---|
|  |  |  | method: 'get', | 
|---|
|  |  |  | 
|---|
|  |  |  | label: this.defaultData[i].name, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.options[i].children = [] | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 请求报表数据 | 
|---|
|  |  |  | getReportForm() { | 
|---|
|  |  |  | getReportForm () { | 
|---|
|  |  |  | console.log(this.newData) | 
|---|
|  |  |  | this.$request({ | 
|---|
|  |  |  | // url: '/monitorPoint/listMonitoring', | 
|---|