|
@@ -0,0 +1,549 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="en">
|
|
|
+ <head>
|
|
|
+ <meta charset="UTF-8" />
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
|
|
+ <link rel="stylesheet" href="style/reset.css" />
|
|
|
+ <link rel="stylesheet" href="style/public.css" />
|
|
|
+ <link rel="stylesheet" href="style/equipment.css" />
|
|
|
+ <link rel="stylesheet" href="font/iconfont.css" />
|
|
|
+ <title>Document</title>
|
|
|
+ </head>
|
|
|
+
|
|
|
+ <body>
|
|
|
+ <section class="s1">
|
|
|
+ <div class="s-title">
|
|
|
+ <h2>设备概况</h2>
|
|
|
+ <span class="tag">万达广场</span>
|
|
|
+ </div>
|
|
|
+ <div class="s1-title">总计设备数量 <span>200台</span></div>
|
|
|
+ <div class="e-con">
|
|
|
+ <div>
|
|
|
+ <div id="con1"></div>
|
|
|
+ <div class="con-txt">报警</div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div id="con2"></div>
|
|
|
+ <div class="con-txt">正常</div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div id="con3"></div>
|
|
|
+ <div class="con-txt">低压</div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div id="con4"></div>
|
|
|
+ <div class="con-txt">故障</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+ <div class="line"></div>
|
|
|
+
|
|
|
+ <section class="s2">
|
|
|
+ <div class="s-title">
|
|
|
+ <h2>设备趋势</h2>
|
|
|
+ <span class="tag">万达广场</span>
|
|
|
+ </div>
|
|
|
+ <div class="s2-con">
|
|
|
+ <div class="s2-left">
|
|
|
+ <div class="sl-title">设备报警时间</div>
|
|
|
+ <div class="sl-sub" style="color:#fe2a2a">1分钟前</div>
|
|
|
+ <div class="sl-title">区域负责人值班电话</div>
|
|
|
+ <div class="sl-sub">1341779846</div>
|
|
|
+ <div class="sl-title">蓬江区消防大队值班电话</div>
|
|
|
+ <div class="sl-sub">0750-8699139</div>
|
|
|
+ </div>
|
|
|
+ <div class="s2-right" id="s2-e"</div>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+ <div class="line"></div>
|
|
|
+
|
|
|
+ <section class="s3">
|
|
|
+ <div class="s-title">
|
|
|
+ <h2>设备列表</h2>
|
|
|
+ <span class="tag">丰乐社区</span>
|
|
|
+ </div>
|
|
|
+ <div class="s3-select">
|
|
|
+ <div>烟雾探测器</div>
|
|
|
+ <div>
|
|
|
+ <select value="0" name="全部" id="select">
|
|
|
+ <option value="0">全部</option>
|
|
|
+ <option value="1">正常</option>
|
|
|
+ <option value="2">报警</option>
|
|
|
+ <option value="3">低压</option>
|
|
|
+ <option value="4">故障</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="jiaotong">
|
|
|
+ <div class="jiaotong-table">
|
|
|
+ <div class="t-header">
|
|
|
+ <span>更新时间</span>
|
|
|
+ <span>状态</span>
|
|
|
+ <span>温度</span>
|
|
|
+ <span>电量</span>
|
|
|
+ <span>详情</span>
|
|
|
+ </div>
|
|
|
+ <div class="t-main">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+ <div class="line"></div>
|
|
|
+
|
|
|
+ <section class="s4">
|
|
|
+ <div class="s-title">
|
|
|
+ <h2>设备详情</h2>
|
|
|
+ <span class="tag">AGE67ioj-49</span>
|
|
|
+ </div>
|
|
|
+ <div class="s4-con">
|
|
|
+ <div class="s4-left" id="map"></div>
|
|
|
+ <div class="s4-right">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+
|
|
|
+ <script src="js/jquery-3.2.1.min.js"></script>
|
|
|
+ <script src="js/echarts.min.js"></script>
|
|
|
+ <script src="https://webapi.amap.com/maps?v=1.4.10&key=e661b00bdf2c44cccf71ef6070ef41b8"></script>
|
|
|
+ <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.6&key=e661b00bdf2c44cccf71ef6070ef41b8"></script>
|
|
|
+ <script type="text/javascript" src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ let equipment = [{
|
|
|
+ time:"19.03.27 21.23.27",
|
|
|
+ status:'正常',
|
|
|
+ temperature:"15℃",
|
|
|
+ quantity:'99%',
|
|
|
+ id:0,
|
|
|
+ detail:{
|
|
|
+ name:"AGE67ioj-49",
|
|
|
+ lanlat:[113.0842709541, 22.5944937320],
|
|
|
+ xinghao:"AllRange1",
|
|
|
+ status:"正常",
|
|
|
+ update:"1分钟前",
|
|
|
+ xinhao:"强",
|
|
|
+ quantity:'99%',
|
|
|
+ position:"丰乐社区沂水街南段东城街路口"
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ time:"19.03.27 21.23.27",
|
|
|
+ status:'低压',
|
|
|
+ temperature:"15℃",
|
|
|
+ quantity:'99%',
|
|
|
+ id:1,
|
|
|
+ detail:{
|
|
|
+ name:"AGE67ioj-49",
|
|
|
+ lanlat:[113.0842709541, 22.5944937320],
|
|
|
+ xinghao:"AllRange1",
|
|
|
+ status:"低压",
|
|
|
+ update:"1分钟前",
|
|
|
+ xinhao:"强",
|
|
|
+ quantity:'99%',
|
|
|
+ position:"丰乐社区沂水街南段东城街路口"
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ time:"19.03.27 21.23.27",
|
|
|
+ status:'故障',
|
|
|
+ temperature:"15℃",
|
|
|
+ quantity:'99%',
|
|
|
+ id:2,
|
|
|
+ detail:{
|
|
|
+ name:"AGE67ioj-49",
|
|
|
+ lanlat:[113.0842709541, 22.5944937320],
|
|
|
+ xinghao:"AllRange1",
|
|
|
+ status:"故障",
|
|
|
+ update:"1分钟前",
|
|
|
+ xinhao:"强",
|
|
|
+ quantity:'99%',
|
|
|
+ position:"丰乐社区沂水街南段东城街路口"
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ time:"19.03.27 21.23.27",
|
|
|
+ status:'报警',
|
|
|
+ temperature:"15℃",
|
|
|
+ quantity:'99%',
|
|
|
+ id:3,
|
|
|
+ detail:{
|
|
|
+ name:"AGE67ioj-49",
|
|
|
+ lanlat:[113.0842709541, 22.5944937320],
|
|
|
+ xinghao:"AllRange1",
|
|
|
+ status:"报警",
|
|
|
+ update:"1分钟前",
|
|
|
+ xinhao:"强",
|
|
|
+ quantity:'99%',
|
|
|
+ position:"丰乐社区沂水街南段东城街路口"
|
|
|
+ }
|
|
|
+ }];
|
|
|
+
|
|
|
+ (function() {
|
|
|
+ let c1 = "#fe2a2a";
|
|
|
+ let c2 = "#04cd0d";
|
|
|
+ let c3 = "#fdca3a";
|
|
|
+ let c4 = "#479eff";
|
|
|
+
|
|
|
+ let con1 = {
|
|
|
+ color: [c1, "#a3a3a3"],
|
|
|
+ title: {
|
|
|
+ text: "25%",
|
|
|
+ textStyle: {
|
|
|
+ color: "#fff",
|
|
|
+ fontSize: 12,
|
|
|
+ fontWeight: "normal"
|
|
|
+ },
|
|
|
+ subtext: "50台",
|
|
|
+ subtextStyle: {
|
|
|
+ color: c1,
|
|
|
+ fontSize: 14
|
|
|
+ },
|
|
|
+ x: "center",
|
|
|
+ y: "30%"
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: "50台",
|
|
|
+ type: "pie",
|
|
|
+ textStyle: {
|
|
|
+ color: "#999"
|
|
|
+ },
|
|
|
+ radius: ["80%", "65%"],
|
|
|
+ center: ["50%", "50%"],
|
|
|
+ avoidLabelOverlap: false,
|
|
|
+ label: {
|
|
|
+ normal: {
|
|
|
+ show: false,
|
|
|
+ position: "center"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ normal: {
|
|
|
+ show: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: [{ value: 25, name: "报警" }, { value: 75, name: "未报警" }]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+
|
|
|
+ let con2 = {
|
|
|
+ color: [c2, "#a3a3a3"],
|
|
|
+ title: {
|
|
|
+ text: "25%",
|
|
|
+ textStyle: {
|
|
|
+ color: "#fff",
|
|
|
+ fontSize: 12,
|
|
|
+ fontWeight: "normal"
|
|
|
+ },
|
|
|
+ subtext: "50台",
|
|
|
+ subtextStyle: {
|
|
|
+ color: c2,
|
|
|
+ fontSize: 14
|
|
|
+ },
|
|
|
+ x: "center",
|
|
|
+ y: "30%"
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: "50台",
|
|
|
+ type: "pie",
|
|
|
+ textStyle: {
|
|
|
+ color: "#999"
|
|
|
+ },
|
|
|
+ radius: ["80%", "65%"],
|
|
|
+ center: ["50%", "50%"],
|
|
|
+ avoidLabelOverlap: false,
|
|
|
+ label: {
|
|
|
+ normal: {
|
|
|
+ show: false,
|
|
|
+ position: "center"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ normal: {
|
|
|
+ show: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: [{ value: 25, name: "报警" }, { value: 75, name: "未报警" }]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+
|
|
|
+ let con3 = {
|
|
|
+ color: [c3, "#a3a3a3"],
|
|
|
+ title: {
|
|
|
+ text: "25%",
|
|
|
+ textStyle: {
|
|
|
+ color: "#fff",
|
|
|
+ fontSize: 12,
|
|
|
+ fontWeight: "normal"
|
|
|
+ },
|
|
|
+ subtext: "50台",
|
|
|
+ subtextStyle: {
|
|
|
+ color: c3,
|
|
|
+ fontSize: 14
|
|
|
+ },
|
|
|
+ x: "center",
|
|
|
+ y: "30%"
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: "50台",
|
|
|
+ type: "pie",
|
|
|
+ textStyle: {
|
|
|
+ color: "#999"
|
|
|
+ },
|
|
|
+ radius: ["80%", "65%"],
|
|
|
+ center: ["50%", "50%"],
|
|
|
+ avoidLabelOverlap: false,
|
|
|
+ label: {
|
|
|
+ normal: {
|
|
|
+ show: false,
|
|
|
+ position: "center"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ normal: {
|
|
|
+ show: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: [{ value: 25, name: "报警" }, { value: 75, name: "未报警" }]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+
|
|
|
+ let con4 = {
|
|
|
+ color: [c4, "#a3a3a3"],
|
|
|
+ title: {
|
|
|
+ text: "25%",
|
|
|
+ textStyle: {
|
|
|
+ color: "#fff",
|
|
|
+ fontSize: 12,
|
|
|
+ fontWeight: "normal"
|
|
|
+ },
|
|
|
+ subtext: "50台",
|
|
|
+ subtextStyle: {
|
|
|
+ color: c4,
|
|
|
+ fontSize: 14
|
|
|
+ },
|
|
|
+ x: "center",
|
|
|
+ y: "30%"
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: "50台",
|
|
|
+ type: "pie",
|
|
|
+ textStyle: {
|
|
|
+ color: "#999"
|
|
|
+ },
|
|
|
+ radius: ["80%", "65%"],
|
|
|
+ center: ["50%", "50%"],
|
|
|
+ avoidLabelOverlap: false,
|
|
|
+ label: {
|
|
|
+ normal: {
|
|
|
+ show: false,
|
|
|
+ position: "center"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ normal: {
|
|
|
+ show: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: [{ value: 25, name: "报警" }, { value: 75, name: "未报警" }]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+
|
|
|
+ let option = {
|
|
|
+ title: {
|
|
|
+ textStyle:{
|
|
|
+ color:'#fff'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ grid: {
|
|
|
+ left: '3%',
|
|
|
+ right: '4%',
|
|
|
+ bottom: '3%',
|
|
|
+ containLabel: true
|
|
|
+ },
|
|
|
+ xAxis: {
|
|
|
+ type: 'category',
|
|
|
+ boundaryGap: false,
|
|
|
+ data: ['周一','周二','周三','周四','周五','周六','周日'],
|
|
|
+ axisLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: "#ffffff"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ yAxis: {
|
|
|
+ type: 'value',
|
|
|
+ axisLine: {
|
|
|
+ lineStyle: {
|
|
|
+ color: "#ffffff"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ splitLine: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name:'邮件营销',
|
|
|
+ type:'line',
|
|
|
+ stack: '总量',
|
|
|
+ data:[120, 132, 101, 134, 90, 230, 210]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name:'联盟广告',
|
|
|
+ type:'line',
|
|
|
+ stack: '总量',
|
|
|
+ data:[220, 182, 191, 234, 290, 330, 310]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name:'视频广告',
|
|
|
+ type:'line',
|
|
|
+ stack: '总量',
|
|
|
+ data:[150, 232, 201, 154, 190, 330, 410]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name:'直接访问',
|
|
|
+ type:'line',
|
|
|
+ stack: '总量',
|
|
|
+ data:[320, 332, 301, 334, 390, 330, 320]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name:'搜索引擎',
|
|
|
+ type:'line',
|
|
|
+ stack: '总量',
|
|
|
+ data:[820, 932, 901, 934, 1290, 1330, 1320]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+
|
|
|
+ let optionChart = echarts.init(document.querySelector("#s2-e"));
|
|
|
+
|
|
|
+ let con1Chart = echarts.init(document.querySelector("#con1"));
|
|
|
+ let con2Chart = echarts.init(document.querySelector("#con2"));
|
|
|
+ let con3Chart = echarts.init(document.querySelector("#con3"));
|
|
|
+ let con4Chart = echarts.init(document.querySelector("#con4"));
|
|
|
+
|
|
|
+ optionChart.setOption(option);
|
|
|
+
|
|
|
+ con1Chart.setOption(con1);
|
|
|
+ con2Chart.setOption(con2);
|
|
|
+ con3Chart.setOption(con3);
|
|
|
+ con4Chart.setOption(con4);
|
|
|
+ var map = new AMap.Map('map', {
|
|
|
+ resizeEnable: true,
|
|
|
+ zoom:14,
|
|
|
+ center: [113.0842709541, 22.5944937320]
|
|
|
+ });
|
|
|
+ })();
|
|
|
+
|
|
|
+ let htmlTemp = ""
|
|
|
+
|
|
|
+ equipment.forEach((item,idx)=>{
|
|
|
+ htmlTemp+=`<div class="t-body ${idx===0?'active':''}" data-detail="${item.id}">
|
|
|
+ <span>${item.time}</span>
|
|
|
+ <span>${item.status}</span>
|
|
|
+ <span>${item.temperature}</span>
|
|
|
+ <span>${item.quantity}</span>
|
|
|
+ <span>...</span>
|
|
|
+ </div>`
|
|
|
+ })
|
|
|
+
|
|
|
+ let firstItem = equipment[0].detail
|
|
|
+
|
|
|
+ let htmlItem = getItemHtml(firstItem)
|
|
|
+
|
|
|
+ $('.s4-right').html(htmlItem)
|
|
|
+
|
|
|
+ $('.t-main').html(htmlTemp)
|
|
|
+
|
|
|
+ $("#select").change(function(e){
|
|
|
+ htmlTemp = ""
|
|
|
+ let val = $("#select").find("option:selected").text();
|
|
|
+ console.log(val);
|
|
|
+ if (val!=="全部") {
|
|
|
+ equipment.forEach(item=>{
|
|
|
+ if (item.status === val) {
|
|
|
+ htmlTemp+=`<div class="t-body" data-detail="${item.id}">
|
|
|
+ <span>${item.time}</span>
|
|
|
+ <span>${item.status}</span>
|
|
|
+ <span>${item.temperature}</span>
|
|
|
+ <span>${item.quantity}</span>
|
|
|
+ <span>...</span>
|
|
|
+ </div>`
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ equipment.forEach(item=>{
|
|
|
+ htmlTemp+=`<div class="t-body" data-detail="${item.id}">
|
|
|
+ <span>${item.time}</span>
|
|
|
+ <span>${item.status}</span>
|
|
|
+ <span>${item.temperature}</span>
|
|
|
+ <span>${item.quantity}</span>
|
|
|
+ <span>...</span>
|
|
|
+ </div>`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ $('.t-main').html(htmlTemp)
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.t-main').on("click",".t-body",function (e) {
|
|
|
+ let that = $(this)
|
|
|
+ let id = that.data('detail')
|
|
|
+ $('.t-main .t-body').removeClass('active')
|
|
|
+ that.addClass('active')
|
|
|
+ equipment.forEach(item=>{
|
|
|
+ if (item.id === id) {
|
|
|
+ let html = getItemHtml(item.detail)
|
|
|
+ $('.s4-right').html(html)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ function getItemHtml(item) {
|
|
|
+ return `<div class="s4-item">
|
|
|
+ <div class="s4i-l">设备型号</div>
|
|
|
+ <div class="s4i-r">${item.xinghao}</div>
|
|
|
+ </div>
|
|
|
+ <div class="s4-item">
|
|
|
+ <div class="s4i-l">设备状态</div>
|
|
|
+ <div class="s4i-r" style="color:#fe2a2a;">${item.status}</div>
|
|
|
+ </div>
|
|
|
+ <div class="s4-item">
|
|
|
+ <div class="s4i-l">更新时间</div>
|
|
|
+ <div class="s4i-r">${item.update}</div>
|
|
|
+ </div>
|
|
|
+ <div class="s4-item">
|
|
|
+ <div class="s4i-l">信号强度</div>
|
|
|
+ <div class="s4i-r">${item.xinhao}</div>
|
|
|
+ </div>
|
|
|
+ <div class="s4-item">
|
|
|
+ <div class="s4i-l">设备电量</div>
|
|
|
+ <div class="s4i-r">${item.quantity}</div>
|
|
|
+ </div>
|
|
|
+ <div class="s4-item">
|
|
|
+ <div class="s4i-l">设备位置</div>
|
|
|
+ <div class="s4i-r">${item.position}</div>
|
|
|
+ </div>`
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let arr = Array.from(document.querySelectorAll(".s1 .card")).concat(
|
|
|
+ Array.from(document.querySelectorAll(".s2 .card"))
|
|
|
+ );
|
|
|
+ arr.forEach((dom, index) => {
|
|
|
+ dom.addEventListener("click", e => {
|
|
|
+ console.log("equipmentClickHandle", index);
|
|
|
+ window.equipmentClickHandle && window.equipmentClickHandle(index);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+ </body>
|
|
|
+</html>
|