|
@@ -1,8 +1,12 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <div id="data-view">
|
|
|
+ <div id="data-view" >
|
|
|
<div class="main-header">
|
|
|
<div class="mh-middle">数字健康社区定位系统</div>
|
|
|
+ <div class="mh-right">
|
|
|
+ <img src="./img/quanping.png" alt="" @click="toggleFullscreen" v-if="!isFullscreen">
|
|
|
+ <img src="./img/tuichuquanping.png" alt="" @click="toggleFullscreen" v-if="isFullscreen">
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="main">
|
|
|
<div class="left">
|
|
@@ -17,12 +21,28 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="left-under">
|
|
|
- <div class="under-title"><b>在库设备数量</b></div>
|
|
|
- <dv-border-box-8 class="under-box">
|
|
|
- <Left-Chart-99 title="我是我是"></Left-Chart-99>
|
|
|
- <Left-Chart-99 title="我是我是"></Left-Chart-99>
|
|
|
- <Left-Chart-99 title="我是我是"></Left-Chart-99>
|
|
|
- <Left-Chart-99 title="我是我是"></Left-Chart-99>
|
|
|
+ <div class="under-title"><b>告警处理完成</b></div>
|
|
|
+ <dv-border-box-8 class="under-box" v-if="flag">
|
|
|
+ <Left-Chart-99
|
|
|
+ title="SOS报警处理"
|
|
|
+ :value="percentData.alarmSOS"
|
|
|
+ ></Left-Chart-99>
|
|
|
+ <Left-Chart-99
|
|
|
+ title="电子围栏报警"
|
|
|
+ :value="percentData.alarmRail"
|
|
|
+ ></Left-Chart-99>
|
|
|
+ <Left-Chart-99
|
|
|
+ title="跌倒报警"
|
|
|
+ :value="percentData.alarmFall"
|
|
|
+ ></Left-Chart-99>
|
|
|
+ <Left-Chart-99
|
|
|
+ title="设备在线率"
|
|
|
+ :value="percentData.alarmStauts"
|
|
|
+ ></Left-Chart-99>
|
|
|
+ <Left-Chart-99
|
|
|
+ title="全部报警"
|
|
|
+ :value="percentData.alarmAll"
|
|
|
+ ></Left-Chart-99>
|
|
|
</dv-border-box-8>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -49,6 +69,8 @@ import RightChart2 from "./RightChart2";
|
|
|
import BottomCharts from "./BottomCharts";
|
|
|
import equMap from "./Maps.vue";
|
|
|
|
|
|
+import { percent, alarmList } from "@/api/system/datav";
|
|
|
+
|
|
|
export default {
|
|
|
name: "DataView",
|
|
|
components: {
|
|
@@ -65,35 +87,93 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- mapLoading:false,
|
|
|
+ mapLoading: false,
|
|
|
+ percentData: {},
|
|
|
+ flag: false,
|
|
|
+ isFullscreen:false,// 初始状态为非全屏
|
|
|
};
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.initData();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ toggleFullscreen() {
|
|
|
+ if (this.isFullscreen) {
|
|
|
+ // 退出全屏模式
|
|
|
+ if (document.exitFullscreen) {
|
|
|
+ document.exitFullscreen();
|
|
|
+ } else if (document.mozCancelFullScreen) {
|
|
|
+ document.mozCancelFullScreen();
|
|
|
+ } else if (document.webkitExitFullscreen) {
|
|
|
+ document.webkitExitFullscreen();
|
|
|
+ }
|
|
|
+ this.isFullscreen=false;
|
|
|
+ } else {
|
|
|
+ // 进入全屏模式
|
|
|
+ const content = document.querySelector('#data-view');
|
|
|
+ // console.log(content,888);
|
|
|
+ // return
|
|
|
+ if (content.requestFullscreen) {
|
|
|
+ content.requestFullscreen();
|
|
|
+ } else if (content.mozRequestFullScreen) {
|
|
|
+ content.mozRequestFullScreen();
|
|
|
+ } else if (content.webkitRequestFullscreen) {
|
|
|
+ content.webkitRequestFullscreen();
|
|
|
+ }
|
|
|
+ this.isFullscreen=true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ initData() {
|
|
|
+ percent().then((res) => {
|
|
|
+ this.percentData = res.data;
|
|
|
+ this.flag = true;
|
|
|
+ console.log("我刚执行");
|
|
|
+ });
|
|
|
+ },
|
|
|
initMap(AMap) {
|
|
|
this.AMap = AMap;
|
|
|
this.map = new AMap.Map("map", {
|
|
|
// 设置地图容器id
|
|
|
// viewMode: "3D", // 是否为3D地图模式
|
|
|
- zoom: 3, // 初始化地图级别
|
|
|
+ zoom: 5, // 初始化地图级别
|
|
|
center: [105.602725, 37.076636], // 初始化地图中心点位置
|
|
|
});
|
|
|
this.clickMarker = new this.AMap.Marker();
|
|
|
- this.addMapMarkers(this.AMap, {
|
|
|
- equList: [
|
|
|
- { lng: 105.602725, lat: 37.076636 },
|
|
|
- { lng: 113.8098755478859, lat: 34.75219686835205 },
|
|
|
- ],
|
|
|
+ alarmList().then((res) => {
|
|
|
+ const data = res.data;
|
|
|
+ // console.log(data, 777);
|
|
|
+ this.addMapMarkers(this.AMap, data);
|
|
|
});
|
|
|
+ // this.addMapMarkers(this.AMap, {
|
|
|
+ // equList: [
|
|
|
+ // { lng: 105.602725, lat: 37.076636 },
|
|
|
+ // { lng: 113.8098755478859, lat: 34.75219686835205 },
|
|
|
+ // ],
|
|
|
+ // });
|
|
|
// this.getEquMap();
|
|
|
// 暂时放这里
|
|
|
- this.map.on("click", (e) => {
|
|
|
- console.log(e, "e");
|
|
|
- this.regeoCode(e.lnglat);
|
|
|
- });
|
|
|
+ // this.map.on("click", (e) => {
|
|
|
+ // console.log(e, "e");
|
|
|
+ // this.regeoCode(e.lnglat);
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ getCalss(type) {
|
|
|
+ console.log(type, "111");
|
|
|
+ let icon = "";
|
|
|
+ switch (type) {
|
|
|
+ case 16:
|
|
|
+ icon = require(`./img/sos.png`);
|
|
|
+ break;
|
|
|
+ case 25:
|
|
|
+ // 围栏
|
|
|
+ icon = require(`./img/weilan.png`);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return icon;
|
|
|
},
|
|
|
// 地图覆盖物
|
|
|
addMapMarkers(AMap, data) {
|
|
|
- // console.log(data,'data');
|
|
|
+ console.log(data, "data");
|
|
|
// // 项目中心点
|
|
|
// const centerMarker = new AMap.Marker({
|
|
|
// position: new AMap.LngLat(data.projectLng, data.projectLat),
|
|
@@ -102,15 +182,40 @@ export default {
|
|
|
// });
|
|
|
// 设备分布点
|
|
|
this.markers = [];
|
|
|
- data.equList.forEach((item) => {
|
|
|
+ let icon = "";
|
|
|
+ data.forEach((item) => {
|
|
|
+ // this.getCalss(item.alarm_type);
|
|
|
+
|
|
|
+ switch (item.alarm_type) {
|
|
|
+ case 16:
|
|
|
+ icon = require(`./img/sos.png`);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 17:
|
|
|
+ // 跌倒
|
|
|
+ icon = require(`./img/didian.png`);
|
|
|
+ break;
|
|
|
+ case 22:
|
|
|
+ // 心率
|
|
|
+ icon = require(`./img/xinlv.png`);
|
|
|
+ break;
|
|
|
+ case 24:
|
|
|
+ icon = require(`./img/shebei.png`);
|
|
|
+ break;
|
|
|
+ case 25:
|
|
|
+ // 围栏
|
|
|
+ icon = require(`./img/weilan.png`);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ // console.log("执行了");
|
|
|
+ // console.log("icon", icon);
|
|
|
const marker = new AMap.Marker({
|
|
|
- position: new AMap.LngLat(item.lng, item.lat),
|
|
|
+ position: new AMap.LngLat(item.gps_long, item.gps_lat),
|
|
|
offset: new AMap.Pixel(-13, -30),
|
|
|
- // icon: require(`@/assets/map-icon/${item.classifyCode}-${
|
|
|
+ // icon: require(`./img/${item.alarm_type}-${
|
|
|
// item.online === 0 ? "GRAY" : item.flag ? "DEFAULT" : "DANGER"
|
|
|
// }.png`),
|
|
|
- icon: "https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
|
|
|
- anchor: "bottom-center",
|
|
|
+ icon: icon,
|
|
|
extData: {
|
|
|
id: item.id,
|
|
|
equNo: item.equNo,
|
|
@@ -121,70 +226,69 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
this.markers.push(marker);
|
|
|
- this.map.add(marker);
|
|
|
+ // this.map.add(marker);
|
|
|
});
|
|
|
- // console.log('this.markers',this.markers);
|
|
|
- // const overlayGroups = new AMap.OverlayGroup(this.markers);
|
|
|
- // // 比例尺
|
|
|
- // // const scale = new AMap.Scale();
|
|
|
+ const overlayGroups = new AMap.OverlayGroup(this.markers);
|
|
|
+ // 比例尺
|
|
|
+ const scale = new AMap.Scale();
|
|
|
|
|
|
- // this.map.add(overlayGroups);
|
|
|
+ this.map.add(overlayGroups);
|
|
|
// this.map.add(centerMarker);
|
|
|
- // this.map.addControl(scale);
|
|
|
-
|
|
|
- // // 鼠标点击marker弹出自定义的信息窗体
|
|
|
- // overlayGroups.eachOverlay((overlay, index, collections) => {
|
|
|
- // const extData = overlay.getExtData();
|
|
|
- // overlay.on("click", () => {
|
|
|
- // const params = {
|
|
|
- // netCode: extData.netCode,
|
|
|
- // equNo: extData.equNo,
|
|
|
- // };
|
|
|
- // getEquInfo(params).then((res) => {
|
|
|
- // const info = res.data;
|
|
|
- // const id = extData.id;
|
|
|
- // const currentMarker = this.markers.find(
|
|
|
- // (item) => item._opts.extData.id === id
|
|
|
- // );
|
|
|
- // currentMarker.setIcon(
|
|
|
- // require(`@/assets/map-icon/${extData.classifyCode}-${
|
|
|
- // info.online === 0 ? "GRAY" : extData.flag ? "DEFAULT" : "DANGER"
|
|
|
- // }.png`)
|
|
|
- // );
|
|
|
- // const onlineEnum = {
|
|
|
- // 0: "离线",
|
|
|
- // 1: "在线",
|
|
|
- // };
|
|
|
- // info.projectName = data.projectName;
|
|
|
- // const infoWindow = new AMap.InfoWindow({
|
|
|
- // content: `<div class="equ-info-box">
|
|
|
- // <p class="equ-info-item"><span class="label">设备编号</span><span class="value" id="equNo">${
|
|
|
- // info.equNo
|
|
|
- // }</span></p>
|
|
|
- // <p class="equ-info-item"><span class="label">当前设备状态</span><span class="value tag">${
|
|
|
- // onlineEnum[info.online]
|
|
|
- // }</span></p>
|
|
|
- // <p class="equ-info-item"><span class="label">累计报警次数</span><span class="value link" onclick="goNextPage(this, 'alarmStat')" data-equNo="${
|
|
|
- // info.equNo
|
|
|
- // }" data-name="${info.projectName}">${
|
|
|
- // info.alarmTotal
|
|
|
- // }</span></p>
|
|
|
- // <p class="equ-info-item"><span class="label">最近定位时间</span><span class="value">${
|
|
|
- // info.positionTime
|
|
|
- // }</span></p>
|
|
|
- // <p class="equ-info-item"><span class="label">TBox品牌</span><span class="value">${
|
|
|
- // info.brand
|
|
|
- // }</span></p>
|
|
|
- // <p class="equ-info-item"><span class="label">TBox编号</span><span class="value">${
|
|
|
- // info.gpsId
|
|
|
- // }</span></p>
|
|
|
- // </div>`,
|
|
|
- // anchor: "top-center",
|
|
|
- // });
|
|
|
- // infoWindow.open(this.map, overlay.getPosition());
|
|
|
- // });
|
|
|
- // });
|
|
|
- // });
|
|
|
+ this.map.addControl(scale);
|
|
|
+
|
|
|
+ // 鼠标点击marker弹出自定义的信息窗体
|
|
|
+ overlayGroups.eachOverlay((overlay, index, collections) => {
|
|
|
+ const extData = overlay.getExtData();
|
|
|
+ overlay.on("click", () => {
|
|
|
+ data.forEach((item) => {
|
|
|
+ console.log(item, "item");
|
|
|
+ const infoWindow = new AMap.InfoWindow({
|
|
|
+ content: `<div class="equ-info-box">
|
|
|
+ <p class="equ-info-item"><span class="label-type">【${
|
|
|
+ item.alarm_msg
|
|
|
+ }】</span></p>
|
|
|
+ <p class="equ-info-item"><span class="label">姓名</span><span class="value tag">${
|
|
|
+ item.name ? item.name : ""
|
|
|
+ }</span></p>
|
|
|
+ <p class="equ-info-item"><span class="label">手机号</span><span class="value">${
|
|
|
+ item.telno?item.telno:''
|
|
|
+ }</span></p>
|
|
|
+ <p class="equ-info-item"><span class="label">所在位置</span><span class="value">${
|
|
|
+ item.address?item.address:''
|
|
|
+ }</span></p>
|
|
|
+ <p class="equ-info-item"><span class="label">告警时间</span><span class="value">${
|
|
|
+ item.createtime?item.createtime:''
|
|
|
+ }</span></p>
|
|
|
+ </div>`,
|
|
|
+ anchor: "top-center",
|
|
|
+ });
|
|
|
+ infoWindow.open(this.map, overlay.getPosition());
|
|
|
+ });
|
|
|
+
|
|
|
+ // const params = {
|
|
|
+ // netCode: extData.netCode,
|
|
|
+ // equNo: extData.equNo,
|
|
|
+ // };
|
|
|
+ // getEquInfo(params).then((res) => {
|
|
|
+ // const info = res.data;
|
|
|
+ // const id = extData.id;
|
|
|
+ // const currentMarker = this.markers.find(
|
|
|
+ // (item) => item._opts.extData.id === id
|
|
|
+ // );
|
|
|
+ // currentMarker.setIcon(
|
|
|
+ // require(`@/assets/map-icon/${extData.classifyCode}-${
|
|
|
+ // info.online === 0 ? "GRAY" : extData.flag ? "DEFAULT" : "DANGER"
|
|
|
+ // }.png`)
|
|
|
+ // );
|
|
|
+ // const onlineEnum = {
|
|
|
+ // 0: "离线",
|
|
|
+ // 1: "在线",
|
|
|
+ // };
|
|
|
+ // info.projectName = data.projectName;
|
|
|
+
|
|
|
+ // });
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
// // 地图的3km圆
|
|
|
// const circle = new AMap.Circle({
|
|
@@ -214,6 +318,7 @@ export default {
|
|
|
background: url(../../assets/image/bg.png);
|
|
|
background-size: 100% 100%;
|
|
|
background-repeat: no-repeat;
|
|
|
+ overflow: auto;
|
|
|
|
|
|
// #dv-full-screen-container {
|
|
|
// background-image: url("./img/bg.png");
|
|
@@ -229,12 +334,12 @@ export default {
|
|
|
padding-right: 10px;
|
|
|
.left {
|
|
|
width: 70%;
|
|
|
- .left-top{
|
|
|
+ .left-top {
|
|
|
display: flex;
|
|
|
- .top-left{
|
|
|
+ .top-left {
|
|
|
width: 30%;
|
|
|
}
|
|
|
- .top-right{
|
|
|
+ .top-right {
|
|
|
width: 70%;
|
|
|
}
|
|
|
}
|
|
@@ -271,9 +376,10 @@ export default {
|
|
|
|
|
|
.main-header {
|
|
|
height: 80px;
|
|
|
+ width: 100%;
|
|
|
display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: flex-start;
|
|
|
+ // justify-content: center;
|
|
|
+ // align-items: flex-start;
|
|
|
|
|
|
.mh-left {
|
|
|
font-size: 20px;
|
|
@@ -287,11 +393,71 @@ export default {
|
|
|
.mh-middle {
|
|
|
color: #1ae1e6;
|
|
|
font-size: 24px;
|
|
|
+ flex: 1;
|
|
|
+ margin-left:40%;
|
|
|
}
|
|
|
+ .mh-right{
|
|
|
+ width: 5%;
|
|
|
+ margin-top:2%;
|
|
|
+ img{
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // .mh-left,
|
|
|
+ // .mh-right {
|
|
|
+ // width: 450px;
|
|
|
+ // }
|
|
|
+ }
|
|
|
|
|
|
- .mh-left,
|
|
|
- .mh-right {
|
|
|
- width: 450px;
|
|
|
+ ::v-deep.top-center {
|
|
|
+ // background-color: pink;
|
|
|
+ }
|
|
|
+ ::v-deep.amap-info-content {
|
|
|
+ // background-color: #1ae1e6;
|
|
|
+ }
|
|
|
+ ::v-deep.amap-info-sharp {
|
|
|
+ // background-color: #1ae1e6;
|
|
|
+ }
|
|
|
+ ::v-deep.equ-info-box {
|
|
|
+ padding: 6px 0 6px 8px;
|
|
|
+ .equ-info-item {
|
|
|
+ margin: 0;
|
|
|
+ // margin-bottom: 8px;
|
|
|
+ .label-type {
|
|
|
+ color: #f00404;
|
|
|
+ }
|
|
|
+ &.flex {
|
|
|
+ display: flex;
|
|
|
+ .value {
|
|
|
+ &:not(.copy) {
|
|
|
+ width: 200px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .label {
|
|
|
+ display: inline-block;
|
|
|
+ width: 60px;
|
|
|
+ font-size: 13px;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+ .value {
|
|
|
+ color: #505050;
|
|
|
+ &.link {
|
|
|
+ color: #409eff;
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover {
|
|
|
+ text-decoration: underline;
|
|
|
+ user-select: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &.copy {
|
|
|
+ padding: 0 15px;
|
|
|
+ color: #409eff;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|