|
@@ -86,7 +86,7 @@
|
|
|
|
|
|
<div class="d-l-con-icon">
|
|
|
<div class="icon-con" :class="{on:iconCurrentIndex==item.resourceTable}"
|
|
|
- v-for="(item,index) in resourcesCountList" v-on:click="selectResourcesByLabel(item.type, searchName)">
|
|
|
+ v-for="(item,index) in resourcesList" v-on:click="fireControlViewPoint(item.type, '')">
|
|
|
<!--v-on:click="selectResourcesByLabel(item.label)">-->
|
|
|
<!--v-on:click="indentleftSetMarkers(item.resourceTable)">-->
|
|
|
<div class="iconfont icon icon-normal" :class="item.icon" :style="'background:' + item.bg"></div>
|
|
@@ -478,6 +478,7 @@
|
|
|
import {
|
|
|
selectConfigKey
|
|
|
} from "@/api/system/config";
|
|
|
+ import { fireControlViewList, fireControlViewPoint } from '@/api/datacenter'
|
|
|
|
|
|
let echarts = require('echarts')
|
|
|
export default {
|
|
@@ -517,7 +518,6 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
// 初始化地图数据
|
|
|
this.getSuperMapUrl();
|
|
|
this.getLatestNotice()
|
|
@@ -566,7 +566,7 @@
|
|
|
otherTotal: '',
|
|
|
readyFinish: '',
|
|
|
readySure: '',
|
|
|
- resourcesCountList: [],
|
|
|
+ resourcesList: [],
|
|
|
total: '',
|
|
|
aiTotal_pre: '',
|
|
|
newReport_pre: '',
|
|
@@ -665,35 +665,147 @@
|
|
|
},
|
|
|
//查询各类资源的数量
|
|
|
getResourcesCount() {
|
|
|
- let that = this
|
|
|
- getResourcesCount().then(res => {
|
|
|
- this.resourcesCountList = res.data;
|
|
|
- this.resourcesCountList.forEach(function(data, index) {
|
|
|
- let icon = 'sj' + '-' + 'icon' + '-' + data.type.replaceAll("_", "-").replaceAll("@", "-");
|
|
|
- that.$set(that.resourcesCountList[index], 'icon', icon);
|
|
|
- that.$set(that.resourcesCountList[index], 'bg', getIconBg(icon));
|
|
|
- })
|
|
|
- //数据自动落点开始
|
|
|
- let maxCount = 100; //落点数超过这个数的资源不落点
|
|
|
- let list = res.data;
|
|
|
- let counts = [];
|
|
|
- let points = [];
|
|
|
- let types = [];
|
|
|
- for (let i = 0; i < list.length; i++) { //获取符合要求的类型及数量
|
|
|
- if (list[i].num <= maxCount) {
|
|
|
- counts.push(list[i].num);
|
|
|
- points.push({
|
|
|
- "type": list[i].type,
|
|
|
- "count": list[i].num
|
|
|
- });
|
|
|
- types.push(list[i].type);
|
|
|
+ let that = this;
|
|
|
+ fireControlViewList("jiaotong").then(function (res) {
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
+ if(res.data[i].type !='centerdata_t_forest_fireteam'){
|
|
|
+ that.resourcesList.push(res.data[i]);
|
|
|
}
|
|
|
}
|
|
|
- for (let i = 0; i < types.length; i++) {
|
|
|
- that.selectResourcesByLabel(types[i], '所有');
|
|
|
+ //截取data.resourceTable字段中“_”分隔符最后一个作为关键字,重新拼接成前端需要的图标:class,格式sj-icon-xxxx,将其set回原数组
|
|
|
+ that.resourcesList.forEach(function (data, index) {
|
|
|
+ let icon =
|
|
|
+ "sj" +
|
|
|
+ "-" +
|
|
|
+ "icon" +
|
|
|
+ "-" +
|
|
|
+ data.type.replaceAll("_", "-").replaceAll("@", "-");
|
|
|
+ console.log("icon_" + (index + 1) + "=", icon);
|
|
|
+ that.$set(that.resourcesList[index], "icon", icon);
|
|
|
+ //每个图标对应固定颜色
|
|
|
+ that.$set(that.resourcesList[index], "bg", getIconBg(icon));
|
|
|
+ });
|
|
|
+ console.log(that.resourcesList)
|
|
|
+ that.fireControlViewPoint("jiaotong", "");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fireControlViewPoint(resourceTable, name) {
|
|
|
+ // 搜索框
|
|
|
+ if (name == "" || name == null || name == undefined) {
|
|
|
+ name = "";
|
|
|
+ } else {
|
|
|
+ this.showSearch = true;
|
|
|
+ }
|
|
|
+ console.log("name=", name);
|
|
|
+ console.log("this.showSearch=", this.showSearch);
|
|
|
+ if(resourceTable == this.resourceTable){
|
|
|
+ resourceTable = "jiaotong"
|
|
|
+ }
|
|
|
+ let that = this;
|
|
|
+ that.resourceTable = resourceTable;
|
|
|
+ that.markersList = [];
|
|
|
+ that.source = [];
|
|
|
+ fireControlViewPoint(resourceTable, name,"").then((res) => {
|
|
|
+ let pointList = res.data.pointList;
|
|
|
+ that.deptGroupList = res.data.deptList;
|
|
|
+ if (res.data.deptList != null && res.data.deptList.length > 0) {
|
|
|
+ for (let i = 0; i < res.data.deptList.length; i++) {
|
|
|
+ let aa = [
|
|
|
+ res.data.deptList[i].deptName,
|
|
|
+ res.data.deptList[i].count,
|
|
|
+ ];
|
|
|
+ that.source.push(aa);
|
|
|
+ }
|
|
|
}
|
|
|
- //数据自动落点结束
|
|
|
- })
|
|
|
+
|
|
|
+ if (res.data.pointList != null && res.data.pointList.length > 0) {
|
|
|
+ for (let i = 0; i < res.data.pointList.length; i++) {
|
|
|
+ if(res.data.pointList[i].indexName != 'centerdata_t_forest_fireteam'){
|
|
|
+ let markersMap = {
|
|
|
+ lng: res.data.pointList[i].longitude,
|
|
|
+ lat: res.data.pointList[i].latitude,
|
|
|
+ icon: "marker",
|
|
|
+ bindPopupHtml: "",
|
|
|
+ click: "",
|
|
|
+ name: i,
|
|
|
+ keepBindPopup: false,
|
|
|
+ isAggregation: false,
|
|
|
+ };
|
|
|
+ that.markersList.push(
|
|
|
+ this.getMarkersMap(
|
|
|
+ resourceTable == "jiaotong" ? res.data.pointList[i].indexName:resourceTable,
|
|
|
+ markersMap,
|
|
|
+ res.data.pointList[i]
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // if (this.showSearch == true) {
|
|
|
+ // this.dataChat();
|
|
|
+ // }
|
|
|
+ that.$refs.supermap.clearM(false);
|
|
|
+ that.$refs.supermap.setMarkers(that.markersList);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getMarkersMap(resourceTable, markersMap, item) {
|
|
|
+ let icon = "sj-icon-map-"+resourceTable.replaceAll("_", "-");
|
|
|
+ console.log(icon)
|
|
|
+ markersMap.lng = item.longitude;
|
|
|
+ markersMap.lat = item.latitude;
|
|
|
+ markersMap.click = "sewageOutletClick";
|
|
|
+ markersMap.parameter = item;
|
|
|
+ markersMap.icon = icon;
|
|
|
+ markersMap.bindPopupHtml =
|
|
|
+ '<div class="map-tip">' +
|
|
|
+ "<span>" +
|
|
|
+ ' <div class="d-l-con">' +
|
|
|
+ ' <div class="d-l-l-text">' +
|
|
|
+ " <h4>经纬度:" +
|
|
|
+ (item.longitude ? item.longitude : "") +
|
|
|
+ "," +
|
|
|
+ (item.latitude ? item.latitude : "") +
|
|
|
+ "</h4>" +
|
|
|
+ " </div>" +
|
|
|
+ " </div>" +
|
|
|
+ " </span>" +
|
|
|
+ "<span>" +
|
|
|
+ ' <div class="d-l-con">' +
|
|
|
+ ' <div class="d-l-l-text">' +
|
|
|
+ " <h4>名称:" +
|
|
|
+ (item.name ? item.name : "") +
|
|
|
+ "</h4>" +
|
|
|
+ " </div>" +
|
|
|
+ " </div>" +
|
|
|
+ " </span>" +
|
|
|
+ "<span>" +
|
|
|
+ ' <div class="d-l-con">' +
|
|
|
+ ' <div class="d-l-l-text">' +
|
|
|
+ " <h4>地址:" +
|
|
|
+ (item.address ? item.address : "") +
|
|
|
+ "</h4>" +
|
|
|
+ " </div>" +
|
|
|
+ " </div>" +
|
|
|
+ " </span>" +
|
|
|
+ "<span>" +
|
|
|
+ ' <div class="d-l-con">' +
|
|
|
+ ' <div class="d-l-l-text">' +
|
|
|
+ " <h4>联系人:" +
|
|
|
+ (item.contacts ? item.contacts : "") +
|
|
|
+ "</h4>" +
|
|
|
+ " </div>" +
|
|
|
+ " </div>" +
|
|
|
+ " </span>" +
|
|
|
+ "<span>" +
|
|
|
+ ' <div class="d-l-con">' +
|
|
|
+ ' <div class="d-l-l-text">' +
|
|
|
+ " <h4>联系电话:" +
|
|
|
+ (item.phone ? item.phone : "") +
|
|
|
+ "</h4>" +
|
|
|
+ " </div>" +
|
|
|
+ " </div>" +
|
|
|
+ " </span></div>";
|
|
|
+ return markersMap;
|
|
|
},
|
|
|
//点击左侧某资源,将该资源进行落点
|
|
|
selectResourcesByLabel(label, name) {
|
|
@@ -714,7 +826,7 @@
|
|
|
console.log("res.data=", res.data)
|
|
|
// this.resourcesList = res.data;
|
|
|
this.resourcesList = res.data.resourceList;
|
|
|
- this.initMarkers(this.resourcesList, label.split('_').slice(-1));
|
|
|
+ this.initMarkers(this.resourcesList, label.replaceAll("_", "-"));
|
|
|
// this.initMarkers(this.resourcesList);
|
|
|
})
|
|
|
},
|
|
@@ -739,9 +851,9 @@
|
|
|
// markersMap.icon = 'traffic-resources-' + type;
|
|
|
// alert(type+"=type")
|
|
|
// alert(this.resourcesList[i].label+"=this.resourcesList[i].label")
|
|
|
- markersMap.icon = 'traffic-resources-' + this.resourcesList[i].label;
|
|
|
- markersMap.icon = 'traffic-resources-' + (type ? type == "sign" ? "warning_sign" : type : this
|
|
|
- .resourcesList[i].label);
|
|
|
+ markersMap.icon = 'sj-icon-map-' + type;
|
|
|
+ console.log(markersMap.icon)
|
|
|
+ //markersMap.icon = 'sj-icon-map-centerdata-t-' +
|
|
|
markersMap.parameter = this.resourcesList[i].id + "," + this.resourcesList[i].label;
|
|
|
markersMap.parameter = this.resourcesList[i].id + "," + (type ? type : this.resourcesList[i].label);
|
|
|
markersMap.click = '';
|
|
@@ -839,6 +951,7 @@
|
|
|
}, 2000)
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
getMenuEventType() {
|
|
|
let that = this
|
|
|
getMenuEventType().then(res => {
|