|
|
@@ -16,7 +16,22 @@
|
|
|
<div class="equipTypebox">
|
|
|
<div class="equipTypeBody">
|
|
|
<div class="equipTypeList">
|
|
|
- <div v-for="(item,index) in equipType" @click="changeEquip(index,item)" @mouseover='mouseOve(index,item)' @mouseleave='mouseOut(index,item)' :key="item.type" :class="[currSelectType==item.type?'active':'']" >{{item.name}}</div>
|
|
|
+ <div v-for="(item,index) in equipType"
|
|
|
+ @click="changeEquip(index,item)"
|
|
|
+ @mouseover='mouseOve(index,item)'
|
|
|
+ @mouseleave='mouseOut(index,item)'
|
|
|
+ :key="item.type"
|
|
|
+ :class="[currSelectType==item.type?'active':'']"
|
|
|
+ >
|
|
|
+ <img v-if="!item.type" :src="tabIcon[0]" alt="" width="25px" class="tabIcon">
|
|
|
+ <img v-else :src="tabIcon[item.type]" alt="" height="25px" width="25px" class="tabIcon">
|
|
|
+
|
|
|
+ <img v-if="!item.type" :src="tabHoverIcon[0]" alt="" width="25px" class="hoverIcon">
|
|
|
+ <img v-else :src="tabHoverIcon[item.type]" alt="" height="25px" width="25px" class="hoverIcon">
|
|
|
+
|
|
|
+ {{item.name}}
|
|
|
+ <!-- {{item.name+`${item.type}`}} -->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div :style="'left:'+equipStyleLeft+'px'" class="equipHighLight"></div>
|
|
|
</div>
|
|
|
@@ -71,7 +86,7 @@
|
|
|
</button>
|
|
|
</template>
|
|
|
<template v-slot:inner>
|
|
|
- <equip-info v-if="hackReset" :equipId="queryInfo.equip_id" :equipType='detailsShow'>
|
|
|
+ <equip-info v-if="hackReset" @getNowState='getNowState' :equipId="queryInfo.equip_id" :d_id="queryInfo.d_id" :equipType='detailsShow'>
|
|
|
<template v-solt:equipStateInner></template>
|
|
|
</equip-info>
|
|
|
<div class="equipData">
|
|
|
@@ -107,7 +122,7 @@
|
|
|
</button>
|
|
|
</template>
|
|
|
<template v-slot:inner>
|
|
|
- <equip-info v-if="hackReset" :equipId="queryInfo.equip_id" :equipType='detailsShow'>
|
|
|
+ <equip-info v-if="hackReset" @getNowState='getNowState' :equipId="queryInfo.equip_id" :d_id="queryInfo.d_id" :equipType='detailsShow'>
|
|
|
<template v-solt:equipStateInner></template>
|
|
|
</equip-info>
|
|
|
<div class="equipData">
|
|
|
@@ -143,7 +158,7 @@
|
|
|
</button>
|
|
|
</template>
|
|
|
<template v-slot:inner>
|
|
|
- <equip-info v-if="hackReset" :equipId="queryInfo.equip_id" :equipType='detailsShow'>
|
|
|
+ <equip-info v-if="hackReset" @getNowState='getNowState' :equipId="queryInfo.equip_id" :d_id="queryInfo.d_id" :equipType='detailsShow'>
|
|
|
<template v-solt:equipStateInner></template>
|
|
|
</equip-info>
|
|
|
<div class="equipData">
|
|
|
@@ -179,7 +194,7 @@
|
|
|
</button>
|
|
|
</template>
|
|
|
<template v-slot:inner>
|
|
|
- <equip-info v-if="hackReset" :equipId='queryInfo.equip_id' :equipType='detailsShow'>
|
|
|
+ <equip-info v-if="hackReset" @getNowState='getNowState' :equipId='queryInfo.equip_id' :d_id="queryInfo.d_id" :equipType='detailsShow'>
|
|
|
<template v-solt:equipStateInner></template>
|
|
|
</equip-info>
|
|
|
<div class="equipData">
|
|
|
@@ -258,7 +273,7 @@
|
|
|
</button>
|
|
|
</template>
|
|
|
<template v-slot:inner>
|
|
|
- <equip-info v-if="hackReset" @child-event="setTimeDialogShow" :equipId='queryInfo.equip_id' :equipType='detailsShow'>
|
|
|
+ <equip-info v-if="hackReset" @child-event="setTimeDialogShow" @getNowState='getNowState' :d_id="queryInfo.d_id" :equipId='queryInfo.equip_id' :equipType='detailsShow'>
|
|
|
<template v-solt:equipStateInner></template>
|
|
|
</equip-info>
|
|
|
<div class="equipData">
|
|
|
@@ -272,7 +287,7 @@
|
|
|
:name="pages.name"
|
|
|
>
|
|
|
<!-- <keep-alive> -->
|
|
|
- <components :is="pages.name" :equipId="queryInfo.equip_id" :d_id="queryInfo.d_id" :equipType='detailsShow' v-if="pages.name == nowPage && hackReset"></components>
|
|
|
+ <components :is="pages.name" :equipId="queryInfo.equip_id" :d_id="queryInfo.d_id" :equipType='detailsShow' ref="child7" v-if="pages.name == nowPage && hackReset"></components>
|
|
|
<!-- </keep-alive> -->
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
@@ -328,6 +343,7 @@ import qxzEquipHistoryDate from './equipHistoryDateQxz' //气象站设备历史
|
|
|
import twentyFourHistoryDate from './twentyFourHistoryDate' //气象站24小时数据
|
|
|
import cbdTabPhoto from './cbdPhoto/cbdTabPhoto' //测报灯图片
|
|
|
import cbdTabPestStat from './cbdTabPestStat' //测报灯害虫统计
|
|
|
+import bzyTabPhoto from './bzyPhoto/bzyTabPhoto' //测报灯图片
|
|
|
export default {
|
|
|
//import引入的组件需要注入到对象中才能使用
|
|
|
components: {
|
|
|
@@ -343,6 +359,7 @@ export default {
|
|
|
twentyFourHistoryDate,
|
|
|
cbdTabPhoto,
|
|
|
cbdTabPestStat,
|
|
|
+ bzyTabPhoto,
|
|
|
},
|
|
|
data() {
|
|
|
//这里存放数据
|
|
|
@@ -385,6 +402,27 @@ export default {
|
|
|
// name:"杀虫灯"
|
|
|
// },
|
|
|
],
|
|
|
+ tabIcon:[
|
|
|
+ require('@/assets/images/home/mapIcon/icon0.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/icon0.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/icon2.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/icon3.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/icon4.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/icon5.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/icon6.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/icon7.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/icon9.png'),
|
|
|
+ ],
|
|
|
+ tabHoverIcon:[
|
|
|
+ require('@/assets/images/home/mapIcon/hover0.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/hover0.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/hover2.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/hover3.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/hover4.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/hover5.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/hover6.png'),
|
|
|
+ require('@/assets/images/home/mapIcon/hover7.png'),
|
|
|
+ ],
|
|
|
currSelectType:0,
|
|
|
currSelectSite:0,
|
|
|
equipStyleLeft:0,
|
|
|
@@ -394,53 +432,93 @@ export default {
|
|
|
geocoder:null,
|
|
|
equipStyleObject:[
|
|
|
{
|
|
|
- url: require("@/assets/images/home/mapView/scd.png"), // 设别类型0
|
|
|
- size: new AMap.Size(25, 15), // 图标大小
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon2.png"), // 设别类型0
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
+ anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon2.png"), // 设别类型1
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
},
|
|
|
{
|
|
|
- url: require("@/assets/images/home/mapView/scd.png"), // 设别类型1
|
|
|
- size: new AMap.Size(25, 15), // 图标大小
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon2.png"), // 设别类型2
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
},
|
|
|
{
|
|
|
- url: require("@/assets/images/home/mapView/scd.png"), // 设别类型2
|
|
|
- size: new AMap.Size(25, 15), // 图标大小
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon3.png"), // 设别类型3
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
},
|
|
|
{
|
|
|
- url: require("@/assets/images/home/mapView/cbd.png"), // 设别类型3
|
|
|
- size: new AMap.Size(25, 15), // 图标大小
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon4.png"), // 设别类型4
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
},
|
|
|
{
|
|
|
- url: require("@/assets/images/home/mapView/xyq.png"), // 设别类型4
|
|
|
- size: new AMap.Size(25, 15), // 图标大小
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon5.png"), // 设别类型5
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
},
|
|
|
{
|
|
|
- url: require("@/assets/images/home/mapView/qxz.png"), // 设别类型5
|
|
|
- size: new AMap.Size(25, 15), // 图标大小
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon6.png"), // 设别类型6
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
},
|
|
|
{
|
|
|
- url: require("@/assets/images/home/mapView/jk.png"), // 设别类型6
|
|
|
- size: new AMap.Size(25, 15), // 图标大小
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon7.png"), // 设别类型7
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
},
|
|
|
{
|
|
|
- url: require("@/assets/images/home/mapView/bzy.png"), // 设别类型7
|
|
|
- size: new AMap.Size(25, 15), // 图标大小
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon7.png"), // 设别类型8
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
},
|
|
|
{
|
|
|
- url: require("@/assets/images/home/mapView/bzy.png"), // 设别类型8
|
|
|
- size: new AMap.Size(25, 15), // 图标大小
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon9.png"), // 设别类型9
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
},
|
|
|
{
|
|
|
- url: require("@/assets/images/home/mapView/tccb.png"), // 设别类型9
|
|
|
- size: new AMap.Size(25, 15), // 图标大小
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon2Off.png"), // 设别类型2 index-10
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
+ anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon3Off.png"), // 设别类型3 index-11
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
+ anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon4Off.png"), // 设别类型4 index-12
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
+ anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon5Off.png"), // 设别类型5 index-13
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
+ anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon6Off.png"), // 设别类型6 index-14
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
+ anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon7Off.png"), // 设别类型7 index-15
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
+ anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon7Off.png"), // 设别类型8 index-16
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
+ anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
+ },
|
|
|
+ {
|
|
|
+ url: require("@/assets/images/home/mapIcon/icon9Off.png"), // 设别类型9 index-17
|
|
|
+ size: new AMap.Size(35, 35), // 图标大小
|
|
|
anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
|
|
|
},
|
|
|
],
|
|
|
@@ -509,6 +587,9 @@ export default {
|
|
|
name:"equipState",
|
|
|
label:"实时状态",
|
|
|
},{
|
|
|
+ name:"bzyTabPhoto",
|
|
|
+ label:"查看图片",
|
|
|
+ },{
|
|
|
name:"equipHistoryDate",
|
|
|
label:"历史数据",
|
|
|
}],
|
|
|
@@ -584,7 +665,7 @@ export default {
|
|
|
zIndex: 101,
|
|
|
});
|
|
|
this.map.add(this.tileLayer1);
|
|
|
- this.map.add(this.tileLayer2);
|
|
|
+ // this.map.add(this.tileLayer2);
|
|
|
},
|
|
|
getUserEquipType(){
|
|
|
this.$axios({
|
|
|
@@ -674,39 +755,40 @@ export default {
|
|
|
this.getEquipList(item.type)
|
|
|
},
|
|
|
mouseOve(index,item){
|
|
|
- this.equipStyleLeft = 80*index
|
|
|
+ this.equipStyleLeft = 100*index
|
|
|
},
|
|
|
mouseOut(index,item){
|
|
|
if(item.type!=this.currSelectType){
|
|
|
- this.equipStyleLeft = 80*this.currSelectSite
|
|
|
+ this.equipStyleLeft = 100*this.currSelectSite
|
|
|
}
|
|
|
},
|
|
|
iconFormat(equip_ip, item) {
|
|
|
switch (equip_ip + "") {
|
|
|
case "2":
|
|
|
- item.icon = require("@/assets/images/home/mapView/scd.png");
|
|
|
+ item.icon = require("@/assets/images/home/mapIcon/icon2.png");
|
|
|
break;
|
|
|
case "3":
|
|
|
- item.icon = require("@/assets/images/home/mapView/cbd.png");
|
|
|
+ item.icon = require("@/assets/images/home/mapIcon/icon3.png");
|
|
|
break;
|
|
|
case "4":
|
|
|
- item.icon = require("@/assets/images/home/mapView/xyq.png");
|
|
|
+ item.icon = require("@/assets/images/home/mapIcon/icon4.png");
|
|
|
break;
|
|
|
case "5":
|
|
|
- item.icon = require("@/assets/images/home/mapView/qxz.png");
|
|
|
+ item.icon = require("@/assets/images/home/mapIcon/icon5.png");
|
|
|
break;
|
|
|
case "6":
|
|
|
- item.icon = require("@/assets/images/home/mapView/jk.png");
|
|
|
+ item.icon = require("@/assets/images/home/mapIcon/icon6.png");
|
|
|
break;
|
|
|
case "7":
|
|
|
- item.icon = require("@/assets/images/home/mapView/bzy.png");
|
|
|
+ item.icon = require("@/assets/images/home/mapIcon/icon7.png");
|
|
|
break;
|
|
|
case "9":
|
|
|
- item.icon = require("@/assets/images/home/mapView/tccb.png");
|
|
|
+ item.icon = require("@/assets/images/home/mapIcon/icon9.png");
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
getEquipList(type) {
|
|
|
+ this.equipListloading = true;
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=home.homes.equip_map_location",
|
|
|
@@ -716,11 +798,18 @@ export default {
|
|
|
user_id:this.user_id
|
|
|
}),
|
|
|
}).then((res) => {
|
|
|
+ this.equipListloading = false;
|
|
|
if (res.data.message == "") {
|
|
|
let data = res.data.data;
|
|
|
+ var index = 0;
|
|
|
this.equipListCurr = data.map((item) => {
|
|
|
this.iconFormat(item.device_type_id, item);
|
|
|
- item.style = item.device_type_id; //设备类型 2杀虫灯,3测报灯,4智能性诱,5气象站,6监控设备,7孢子仪,8性诱设备
|
|
|
+ if(item.device_status == 1){
|
|
|
+ item.style = item.device_type_id; //设备类型 2杀虫灯,3测报灯,4智能性诱,5气象站,6监控设备,7孢子仪,8性诱设备
|
|
|
+ }else{
|
|
|
+ item.style = parseInt(item.device_type_id)+8; //设备类型 2杀虫灯,3测报灯,4智能性诱,5气象站,6监控设备,7孢子仪,8性诱设备
|
|
|
+ }
|
|
|
+ item.index = index++;
|
|
|
if (item.gps_type == 1) {
|
|
|
//GPS
|
|
|
item.lnglat = wgs84togcj02(item.lng, item.lat);
|
|
|
@@ -734,11 +823,12 @@ export default {
|
|
|
}
|
|
|
this.massMarks = new AMap.MassMarks(this.equipListCurr, {
|
|
|
zIndex: 199, // 海量点图层叠加的顺序
|
|
|
- zooms: [3, 19], // 在指定地图缩放级别范围内展示海量点图层
|
|
|
+ // zooms: [3, 19], // 在指定地图缩放级别范围内展示海量点图层
|
|
|
style: this.equipStyleObject, // 设置样式对象
|
|
|
});
|
|
|
this.massMarks.setMap(this.map);
|
|
|
this.massMarks.on("click", (e) => {
|
|
|
+ document.getElementById("equipListBox").scrollTop = 87*e.data.index;
|
|
|
this.equipMarkerClick(e.data);
|
|
|
// this.openInfo(e.data);
|
|
|
});
|
|
|
@@ -752,6 +842,8 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.hackReset = true
|
|
|
})
|
|
|
+ console.log(item);
|
|
|
+
|
|
|
this.equipShow = true; //图标上设备信息框
|
|
|
this.equipsVisible = true; //右侧设备弹框
|
|
|
this.detailsShow = item.device_type_id; //右侧弹框根据不同设备类型,显示设备信息
|
|
|
@@ -945,6 +1037,15 @@ export default {
|
|
|
sidebarClear(val){
|
|
|
this.sidebarComponents = ''
|
|
|
},
|
|
|
+ // 设备刷新请求实时状态
|
|
|
+ getNowState(){
|
|
|
+ if(this.nowPage == 'equipState' || this.nowPage == 'qxzEquipState' ){
|
|
|
+ // console.log(`child${this.detailsShow}`);
|
|
|
+ // console.log(this.$refs[`child${this.detailsShow}`][0]);
|
|
|
+
|
|
|
+ this.$refs[`child${this.detailsShow}`][0].equipStateSet(this.queryInfo.equip_id, this.queryInfo.type);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {},
|
|
|
@@ -1008,24 +1109,40 @@ export default {
|
|
|
justify-content: space-around;
|
|
|
align-items: center;
|
|
|
>div{
|
|
|
- width: 80px;
|
|
|
+ width: 100px;
|
|
|
text-align: center;
|
|
|
border-radius: 20px;
|
|
|
cursor: pointer;
|
|
|
+ >img{
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+ .hoverIcon{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
}
|
|
|
>div.active{
|
|
|
- // background: #0195ff;
|
|
|
- // color:#eee;
|
|
|
+ .tabIcon{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ .hoverIcon{
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
}
|
|
|
>div:hover{
|
|
|
// color: #eee;
|
|
|
+ .tabIcon{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ .hoverIcon{
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.equipHighLight{
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
height: 32px;
|
|
|
- width: 80px;
|
|
|
+ width: 100px;
|
|
|
border-radius: 20px;
|
|
|
background: #0195ff;
|
|
|
z-index: 0;
|