|
@@ -82,6 +82,7 @@
|
|
|
import tableC from "./components/table"
|
|
|
/*----------------------------------接口引入-----------------------------------*/
|
|
|
import { ref,onMounted } from "vue";
|
|
|
+import { count, list } from '@/api/index/index'
|
|
|
/*----------------------------------store引入----------------------------------*/
|
|
|
/*----------------------------------公共方法引入--------------------------------*/
|
|
|
import { initMap, markers, labelState } from "@/assets/js/baiduMap.js";
|
|
@@ -94,15 +95,15 @@ import sheBei from "@/assets/images/sheBei.png";
|
|
|
const mode = ref(1)//1:列表模式 2:地图模式
|
|
|
const siteState = ref([]) //true:站点显示 false:站点隐藏
|
|
|
const statistics = ref([
|
|
|
- { num:1, img:zhanDian, text:'站点总数', color:'#2ACDDA'},
|
|
|
- { num:2, img:liXian, text:'离线站总数', color:'#AAA' },
|
|
|
- { num:3, img:weiChuLi, text:'未处理告警数', color:'#FFB00A' },
|
|
|
- { num:4, img:sheBei, text:'设备数', color:'#2FA6FF' }
|
|
|
+ { num:0, img:zhanDian, text:'站点总数', color:'#2ACDDA'},
|
|
|
+ { num:0, img:liXian, text:'离线站总数', color:'#AAA' },
|
|
|
+ { num:0, img:weiChuLi, text:'未处理告警数', color:'#FFB00A' },
|
|
|
+ { num:0, img:sheBei, text:'设备数', color:'#2FA6FF' }
|
|
|
])
|
|
|
const markerArray = ref([
|
|
|
- { longitude:121.486647, latitude:31.220165, name:"公司名称",state:0,tatal:100,alert:4,tel:"13120222222",address:"公司地址"},
|
|
|
- { longitude:121.486647, latitude:31.010165, name:"公司名称2",state:1,tatal:10,alert:2,tel:"13120222222",address:"公司地址"},
|
|
|
- { longitude:121.486647, latitude:30.010165, name:"公司名称3",state:0,tatal:1,alert:0,tel:"13120222222",address:"公司地址"}
|
|
|
+ // { longitude:121.486647, latitude:31.220165, name:"公司名称",state:0,tatal:100,alert:4,tel:"13120222222",address:"公司地址"},
|
|
|
+ // { longitude:121.486647, latitude:31.010165, name:"公司名称2",state:1,tatal:10,alert:2,tel:"13120222222",address:"公司地址"},
|
|
|
+ // { longitude:121.486647, latitude:30.010165, name:"公司名称3",state:0,tatal:1,alert:0,tel:"13120222222",address:"公司地址"}
|
|
|
]) //点标记集
|
|
|
const dian = ref([])
|
|
|
|
|
@@ -154,13 +155,14 @@ const tableData = ref([
|
|
|
])
|
|
|
/*----------------------------------方法声明-----------------------------------*/
|
|
|
onMounted(() => {
|
|
|
- init()
|
|
|
+ init()
|
|
|
})
|
|
|
|
|
|
//初始化
|
|
|
function init(){
|
|
|
initMap()
|
|
|
- site(1)
|
|
|
+ getSiteCount() //统计
|
|
|
+ getSaDian() //撒点
|
|
|
}
|
|
|
/**
|
|
|
* 切换模式
|
|
@@ -186,10 +188,21 @@ function site(val){
|
|
|
//站点隐现(全部/在线/告警)
|
|
|
if(siteState.value.includes(1)){
|
|
|
dian.value = []
|
|
|
- //站点在线并告警 / 所有站点
|
|
|
- if(siteState.value.includes(2) && siteState.value.includes(3) || !siteState.value.includes(2) && !siteState.value.includes(3)){
|
|
|
+ //所有站点
|
|
|
+ if(!siteState.value.includes(2) && !siteState.value.includes(3)){
|
|
|
markers(markerArray.value)
|
|
|
}
|
|
|
+ //站点在线和告警
|
|
|
+ if(siteState.value.includes(2) && siteState.value.includes(3)){
|
|
|
+ let arrN = []
|
|
|
+ for(let i=0;i<markerArray.value.length;i++){
|
|
|
+ if(markerArray.value[i].deviceStatus == 0 || markerArray.value[i].deviceStatus == 77){
|
|
|
+ arrN.push(markerArray.value[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(arrN)
|
|
|
+ markers(arrN)
|
|
|
+ }
|
|
|
//告警设备隐现(离线)
|
|
|
if(siteState.value.includes(2) && !siteState.value.includes(3)){
|
|
|
for(let i=0;i<markerArray.value.length;i++){
|
|
@@ -212,6 +225,7 @@ function site(val){
|
|
|
if(!siteState.value.includes(1)){
|
|
|
markers()
|
|
|
}
|
|
|
+ console.log(siteState.value)
|
|
|
}
|
|
|
//文本标注隐现4
|
|
|
if(siteState.value.includes(4)){
|
|
@@ -224,6 +238,31 @@ function site(val){
|
|
|
labelState()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 站点状态
|
|
|
+*/
|
|
|
+function getSiteCount(){
|
|
|
+ count().then(res => {
|
|
|
+ statistics.value[0].num = res.data.count
|
|
|
+ statistics.value[1].num = res.data.offLineCount
|
|
|
+ statistics.value[2].num = res.data.deviceCount
|
|
|
+ statistics.value[3].num = res.data.siteDeviceCount
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 站点撒点
|
|
|
+*/
|
|
|
+function getSaDian(val){
|
|
|
+ list({ siteStatus: val}).then(res => {
|
|
|
+ markerArray.value = res.data
|
|
|
+ site(1)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.SiteDistribution{
|
|
@@ -385,7 +424,6 @@ function site(val){
|
|
|
box-shadow: 0px 3px 7px 0px rgba(0,0,0,0.07);
|
|
|
margin-top:35px;
|
|
|
margin-left:-26px;
|
|
|
- // background: linear-gradient(to bottom right, #fff, #fff);
|
|
|
.BMap_bubble_center,.BMap_bubble_content,.boxs{
|
|
|
width:270px !important;
|
|
|
}
|
|
@@ -396,6 +434,10 @@ function site(val){
|
|
|
font-size: 16px;
|
|
|
line-height: 40px;
|
|
|
padding-left:20px;
|
|
|
+ width:85%;
|
|
|
+ white-space: nowrap; /* 确保文本不会换行 */
|
|
|
+ overflow: hidden; /* 隐藏超出容器的部分 */
|
|
|
+ text-overflow: ellipsis; /* 显示省略号来代表被修剪的文本 */
|
|
|
}
|
|
|
.content{
|
|
|
padding:0 20px 4px;
|
|
@@ -410,6 +452,12 @@ function site(val){
|
|
|
>div:nth-child(1){
|
|
|
border-top:none;
|
|
|
}
|
|
|
+ >div:nth-child(5){
|
|
|
+ div:nth-child(2){
|
|
|
+ width:85%;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|