<template> <div class="app-container detail" style="background-color: rgb(238, 241, 245);"> <div style="padding-top: 10px;background: #fff;height: 100%;"> <el-row> <el-col :span="24" style="padding-left: 15px;"> <div style="height: 45px;" @click="$router.go(-1)"> <el-button size="medium" type="text" style="font-size: 18px; color: rgb(7, 63, 112);float: left;">返回 </el-button> <div style="float: left;margin-top: 8px;margin-left: 5px;"><img src="../../../assets/logo/fanhui.png" style="width: 25px;" alt=""></div> </div> </el-col> </el-row> <el-row style="padding-left: 50px;"> <el-col :span="6"> <el-form ref="form" v-model="form" style="width: 100%;"> <el-form-item label="设备类型:" prop="deviceType"> <font>{{form.deviceType}}</font> </el-form-item> <el-form-item label="设备编号:" prop="deviceCode"> <font>{{form.deviceCode}}</font> </el-form-item> </el-form> </el-col> <el-col :span="6"> <el-form ref="form" v-model="form" style="width: 100%;"> <el-form-item label="报警类型:" prop="alarmType"> <font>{{form.alarmType}}</font> </el-form-item> <el-form-item label="报警值:" prop="alarmValue"> <font>{{form.alarmValue}}</font> </el-form-item> </el-form> </el-col> <el-col :span="6"> <el-form ref="form" v-model="form" style="width: 100%;"> <el-form-item label="报警开始时间:" prop="startTime"> <font>{{form.startTime}}</font> </el-form-item> <el-form-item label="报警结束时间:" prop="updateTime"> <font>{{form.endTime}}</font> </el-form-item> </el-form> </el-col> <el-col :span="6"> <el-form ref="form" v-model="form" style="width: 100%;"> <el-form-item label="工单编号:" prop="orderId"> <!-- <font>{{form.orderId}}</font> --> <template slot-scope="scope"> <el-button type="text" @click="showDetail(form.orderId)">{{form.orderId}}</el-button> </template> </el-form-item> <el-form-item label="处理状态:" prop="dealStatus"> <font v-if="form.orderId == null || form.orderId == ''">未生成工单</font> <font v-if="(form.dealStatus == null || form.dealStatus == '') && form.orderId != null && form.orderId != ''"> 暂未处理</font> <font v-if="form.dealStatus == 1">不需处理</font> <font v-if="form.dealStatus == 2">已处理完成</font> <font v-if="form.dealStatus == 3">未处理完成</font> </el-form-item> </el-form> </el-col> </el-row> <el-divider></el-divider> <el-row> <el-col :span="16" style="padding: 10px;"> <div style="width: 100%;float: left;height: 100%;" v-if="form.deviceType != '管道'"> <el-table :data="dataListdetail" style="width: 100%"> <el-table-column label="设备名称" align="center" prop="deviceName" /> <el-table-column label="设备编号" align="center" prop="deviceCode" /> <el-table-column label="设备类型" align="center" prop="deviceType" > <template slot-scope="scope"> <span v-if="scope.row.deviceType == 1">调压阀</span> <span v-if="scope.row.deviceType == 2">阀门井</span> <span v-if="scope.row.deviceType == 3">流量计</span> <span v-if="scope.row.deviceType == 4">压力表</span> </template> </el-table-column> <el-table-column label="设备型号" align="center" prop="deviceModel" /> </el-table> <el-table :data="dataListdetail" style="width: 100%;margin-top: 20px;"> <el-table-column label="物联网编号" align="center" prop="iotNo" /> <el-table-column label="所在地址" align="center" prop="deviceAddr" /> <el-table-column label="联系人" align="center" prop="linkman" /> <el-table-column label="联系电话" align="center" prop="phone" /> </el-table> <el-table :data="dataListdetail" style="width: 100%;margin-top: 20px;"> <el-table-column label="安装日期" align="center" prop="installationTime" /> <el-table-column label="最后巡检日期" align="center" prop="inspectionTime" /> <el-table-column label="图片" align="center" prop="iconUrl" > <template slot-scope="scope"> <el-image :src="scope.row.iconUrl" :preview-src-list="[scope.row.iconUrl]" v-if="scope.row.iconUrl != '' && scope.row.iconUrl != null" style="width: 16px;"></el-image> </template> </el-table-column> </el-table> </div> <div style="width: 100%;float: left;height: 100%;" v-if="form.deviceType == '管道'"> <el-table :data="dataListdetail" style="width: 100%"> <el-table-column label="管道名称" align="center" prop="pipeName" /> <el-table-column label="管道编号" align="center" prop="pipeCode" /> <el-table-column label="管道类型" align="center" prop="pipeType" > <template slot-scope="scope"> <span v-if="scope.row.pipeType == 1">地埋管线</span> <span v-if="scope.row.pipeType == 2">地表管线</span> </template> </el-table-column> </el-table> <el-table :data="dataListdetail" style="width: 100%;margin-top: 20px;"> <el-table-column label="管道压力" align="center" prop="pipePressure" > <template slot-scope="scope"> <span v-if="scope.row.pipePressure == 1">低压</span> <span v-if="scope.row.pipePressure == 2">中压</span> <span v-if="scope.row.pipePressure == 3">次高压</span> <span v-if="scope.row.pipePressure == 4">高压</span> </template> </el-table-column> <el-table-column label="管道长度" align="center" prop="pipeLength" /> <el-table-column label="管道地址" align="center" prop="pipeAddr" /> </el-table> <el-table :data="dataListdetail" style="width: 100%;margin-top: 20px;"> <el-table-column label="安装日期" align="center" prop="installationTime" /> <el-table-column label="最后巡检日期" align="center" prop="inspectionTime" /> <el-table-column label="图片" align="center" prop="iconUrl" > <template slot-scope="scope"> <el-image :src="scope.row.iconUrl" :preview-src-list="[scope.row.iconUrl]" v-if="scope.row.iconUrl != '' && scope.row.iconUrl != null" style="width: 16px;"></el-image> </template> </el-table-column> </el-table> </div> </el-col> <el-col :span="8" style="padding: 10px;padding-left: 0px;"> <div id="marbox" style="width: 100%;height: 304px; border: 1px solid rgb(218, 213, 213);float: right;"> <div style="width: 100%;height: 100%" id="container"></div> </div> </el-col> </el-row> <template v-if="$route.query.deviceType!='管道'"> <el-row v-if="form.deviceType != '压力表'"> <el-col :span="12" style="padding: 10px;"> <div id="main1" style="height:300px;background-color: rgb(247 247 247);padding: 5px;"> <div v-if="form.deviceReportDataList == null" class="div-null"> <p>暂无数据</p> </div> </div> </el-col> <el-col :span="12" style="padding: 10px;"> <div id="main2" style="height:300px;background-color: rgb(247 247 247);padding: 5px;"> <div v-if="form.deviceReportDataList == null" class="div-null"> <p>暂无数据</p> </div> </div> </el-col> </el-row> <el-row> <el-col :span="12" style="padding: 10px;" v-if="form.deviceType != '压力表'"> <div id="main3" style="height:300px;background-color: rgb(247 247 247);padding: 5px;"> <div v-if="form.deviceReportDataList == null" class="div-null"> <p>暂无数据</p> </div> </div> </el-col> <el-col :span="12" style="padding: 10px;"> <div id="main4" style="height:300px;background-color: rgb(247 247 247);padding: 5px;"> <div v-if="form.deviceReportDataList == null" class="div-null"> <p>暂无数据</p> </div> </div> </el-col> </el-row> </template> </div> </div> </template> <script> import { getDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm"; import { deviceTree } from "@/api/device/deviceInfo"; import gaodeMap from "utils/gaodeMap.js"; import { map, DEVICE_TYPE } from "utils/gaodeMap.js"; import { inspectorList } from "@/api/system/user"; import echarts from 'echarts'; export default { name: "DeviceAlarm", components: { }, data() { return { dataListdetail: [], alarmId:'', // 折线图标题 title: "", // 表单参数 form: { }, rule: { }, }; }, created() { // 如果是跳转来的,则接受初始化参数 this.alarmId = +this.$route.query.alarmId; this.getDetail(); }, mounted() { let gaoMap = new gaodeMap("石家庄"); this.gaoMap = gaoMap; }, methods: { initData(getData1, getData2, getData3) { // 基于准备好的dom,初始化echarts实例 var myChart1 = echarts.init(document.getElementById('main1')); // 绘制图表 myChart1.setOption({ title: { text: '标况流量、工况流量' }, tooltip: { trigger: 'axis' }, legend: { data: ['标况流量', '工况流量'] }, xAxis: { type: 'category', // data: this.dataX, // data: ['23', '44', '77', '34', '56', '88', '38', '68', '55', '99', '44', '33'], data: getData3, boundaryGap: false, //控制日期是否在中间显示 axisLabel: { show: true, //是否显示日期 interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度 textStyle: { color: '#000', //日期的颜色 fontSize: 12 //字体的大小 } }, axisLine: { lineStyle: { color: '#ccc' // x轴的颜色 } } }, yAxis: { type: 'value', axisLabel: { formatter: '{value}', textStyle: { color: '#000' //数字的颜色 }, inside: false //控制数据是否在内侧还是外侧显示 }, axisLine: { lineStyle: { color: '#ccc' // 折线的颜色 } } }, series: [ { // data: this.dataY, name: '标况流量', // data: [820, 232, 901, 534, 1290, 330, 1320, 345, 654, 189, 980, 234], data: getData1, type: 'line', symbol: 'circle', //是否显示实心的折线圆点 smooth: true, //让折线有弧度 symbolSize: 7, //折线圆点的大小 itemStyle: { normal: { color: '#efc883', //折线点的颜色 lineStyle: { color: '#efc883' //折线的颜色 }, label: { show: true } //是否在折线点上显示数字 } } }, { // data: this.dataY, name: '工况流量', // data: [500, 600, 700, 300, 1100, 130, 1200, 820, 932, 901, 934, 1290], data: getData2, type: 'line', symbol: 'circle', //是否显示实心的折线圆点 smooth: true, //让折线有弧度 symbolSize: 7, //折线圆点的大小 itemStyle: { normal: { color: '#053B6A', //折线点的颜色 lineStyle: { color: '#053B6A' //折线的颜色 }, label: { show: true } //是否在折线点上显示数字 } } } ] }); }, drawPieChart(getData4, getData5, getData3) { // 基于准备好的dom,初始化echarts实例 var myChart2 = echarts.init(document.getElementById('main2')); // 绘制图表 myChart2.setOption({ title: { text: '标况累积量、工况累积量' }, tooltip: { trigger: 'axis' }, legend: { data: ['标况累积量', '工况累积量'] }, xAxis: { type: 'category', // data: this.dataX, data: getData3, boundaryGap: false, //控制日期是否在中间显示 axisLabel: { show: true, //是否显示日期 interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度 textStyle: { color: '#000', //日期的颜色 fontSize: 12 //字体的大小 } }, axisLine: { lineStyle: { color: '#ccc' // x轴的颜色 } } }, yAxis: { type: 'value', axisLabel: { formatter: '{value}', textStyle: { color: '#000' //数字的颜色 }, inside: false //控制数据是否在内侧还是外侧显示 }, axisLine: { lineStyle: { color: '#ccc' // 折线的颜色 } } }, series: [ { // data: this.dataY, name: '标况累积量', data: getData4, type: 'line', symbol: 'circle', //是否显示实心的折线圆点 smooth: true, //让折线有弧度 symbolSize: 7, //折线圆点的大小 itemStyle: { normal: { color: '#efc883', //折线点的颜色 lineStyle: { color: '#efc883' //折线的颜色 }, label: { show: true } //是否在折线点上显示数字 } } }, { // data: this.dataY, name: '工况累积量', data: getData5, type: 'line', symbol: 'circle', //是否显示实心的折线圆点 smooth: true, //让折线有弧度 symbolSize: 7, //折线圆点的大小 itemStyle: { normal: { color: '#053B6A', //折线点的颜色 lineStyle: { color: '#053B6A' //折线的颜色 }, label: { show: true } //是否在折线点上显示数字 } } } ] }); }, main3(getData6, getData3) { // 基于准备好的dom,初始化echarts实例 var myChart3 = echarts.init(document.getElementById('main3')); // 绘制图表 myChart3.setOption({ title: { text: '温度' }, tooltip: { trigger: 'axis' }, legend: { data: ['温度'] }, xAxis: { type: 'category', // data: this.dataX, data: getData3, boundaryGap: false, //控制日期是否在中间显示 axisLabel: { show: true, //是否显示日期 interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度 textStyle: { color: '#000', //日期的颜色 fontSize: 12 //字体的大小 } }, axisLine: { lineStyle: { color: '#ccc' // x轴的颜色 } } }, yAxis: { type: 'value', axisLabel: { formatter: '{value}', textStyle: { color: '#000' //数字的颜色 }, inside: false //控制数据是否在内侧还是外侧显示 }, axisLine: { lineStyle: { color: '#ccc' // 折线的颜色 } } }, series: [ { // data: this.dataY, name: '温度', data: getData6, type: 'line', symbol: 'circle', //是否显示实心的折线圆点 smooth: true, //让折线有弧度 symbolSize: 7, //折线圆点的大小 itemStyle: { normal: { color: '#efc883', //折线点的颜色 lineStyle: { color: '#efc883' //折线的颜色 }, label: { show: true } //是否在折线点上显示数字 } } } ] }); }, main4(getData7, getData3) { // 基于准备好的dom,初始化echarts实例 var myChart4 = echarts.init(document.getElementById('main4')); // 绘制图表 myChart4.setOption({ title: { text: '压力' }, tooltip: { trigger: 'axis' }, legend: { data: ['压力'] }, xAxis: { type: 'category', // data: this.dataX, data: getData3, boundaryGap: false, //控制日期是否在中间显示 axisLabel: { show: true, //是否显示日期 interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度 textStyle: { color: '#000', //日期的颜色 fontSize: 12 //字体的大小 } }, axisLine: { lineStyle: { color: '#ccc' // x轴的颜色 } } }, yAxis: { type: 'value', axisLabel: { formatter: '{value}', textStyle: { color: '#000' //数字的颜色 }, inside: false //控制数据是否在内侧还是外侧显示 }, axisLine: { lineStyle: { color: '#ccc' // 折线的颜色 } } }, series: [ { // data: this.dataY, name: '压力', data: getData7, type: 'line', symbol: 'circle', //是否显示实心的折线圆点 smooth: true, //让折线有弧度 symbolSize: 7, //折线圆点的大小 itemStyle: { normal: { color: '#efc883', //折线点的颜色 lineStyle: { color: '#efc883' //折线的颜色 }, label: { show: true } //是否在折线点上显示数字 } } } ] }); }, /** 详细信息跳转 */ showDetail(orderId) { this.$router.push({ path: '/workOrder/detail', query:{ orderId : orderId } }) //带参跳转 }, getDetail (){ getDeviceAlarm(this.alarmId).then(response =>{ this.form = response.data; console.log("this.form", this.form); if(this.form.pipeList != null){ let pipe = this.form.pipeList[0]; console.log("pipe", pipe); this.dataListdetail.push(pipe); this.gaoMap.onlyLine(pipe); } if(this.form.deviceList != null){ let device = this.form.deviceList[0]; console.log("device", device); this.dataListdetail.push(device); this.gaoMap.resetMapCenter([device.longitude, device.latitude]); this.gaoMap.addMarker(DEVICE_TYPE.WORKORDER, device); } var getData1 = []; var getData2 = []; var getData3 = []; var getData4 = []; var getData5 = []; var getData6 = []; var getData7 = []; //先进行赋值 for (let i = 0; i < this.form.deviceReportDataList.length; i++) { getData1.push(this.form.deviceReportDataList[i].standardConditionFlow) getData2.push(this.form.deviceReportDataList[i].workingConditionFlow) getData3.push(this.form.deviceReportDataList[i].reportTime) getData4.push(this.form.deviceReportDataList[i].standardConditionAccumulation) getData5.push(this.form.deviceReportDataList[i].workingConditionAccumulation) getData6.push(this.form.deviceReportDataList[i].temperature) getData7.push(this.form.deviceReportDataList[i].pressure) } this.initData(getData1, getData2, getData3); this.drawPieChart(getData4, getData5, getData3); this.main3(getData6, getData3); this.main4(getData7, getData3); console.log(this.form.deviceReportDataList) console.log("getData1", getData1) console.log("getData2", getData2) console.log("getData3", getData3) if(this.form.orderType == '1') { // 获取设备列表树 let data = { key1: this.form.deviceInfoList, key2: this.form.pipeList }; deviceTree(data).then(response => { this.deviceOptions[0].childList = response.data; }); } }); }, } } </script> <style> .div-null { width: 100%; height: 300px; text-align: center; line-height: 250px; } .el-tree-node__content { width: 150px; } .el-divider--horizontal { display: block; height: 1px; width: 100%; margin: 20px 0; } .feedbackTime-div { float: left; margin-left: 150px; margin-top: 10px; } .feedbackTime { height: 120px; width: 120px; float: left; margin-left: 15px; margin-top: 5px; margin-bottom: 15px; display: flex; justify-content: center; align-items: center; } .el-card__body { padding: 5px 20px 20px 20px; } .detail .el-form { width: 20%; } .detail .el-form-item { margin-bottom: 0px; } .el-tree { margin-top: 5px; } .avatar-uploader { width: 25%; float: left; } .avatar-uploader .el-upload { border: 1px dashed #d9d9d9; border-radius: 6px; cursor: pointer; position: relative; overflow: hidden; } .avatar-uploader .el-upload:hover { border-color: #409EFF; } .avatar-uploader-icon { font-size: 28px; color: #8c939d; width: 178px; height: 178px; line-height: 178px; text-align: center; } .avatar { width: 178px; height: 178px; display: block; } li { font-size: 15px; font-weight: 900; } </style>