|
|
@@ -15,6 +15,20 @@
|
|
|
<div class="amap-demo" id="mapContainer2"></div>
|
|
|
<div class="searchbox">
|
|
|
<el-select
|
|
|
+ v-model="point_type"
|
|
|
+ placeholder="请选择"
|
|
|
+ size="mini"
|
|
|
+ @change="handlePointTypeChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in pointTypeOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select
|
|
|
v-model="typevalue"
|
|
|
placeholder="请选择设备类型"
|
|
|
size="mini"
|
|
|
@@ -56,20 +70,7 @@
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <el-select
|
|
|
- v-model="point_type"
|
|
|
- placeholder="请选择监测点类型"
|
|
|
- size="mini"
|
|
|
- @change="handlePointTypeChange"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in pointTypeOptions"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+
|
|
|
<el-select
|
|
|
v-model="inoffvalue"
|
|
|
placeholder="请选择所在监测点"
|
|
|
@@ -216,7 +217,8 @@
|
|
|
style="cursor: pointer"
|
|
|
></p>
|
|
|
<div class="tishi" :style="{ width: width }" v-if="baseinfo.length == 0">
|
|
|
- <p>请点击设备标点,查看设备详情</p>
|
|
|
+ <!-- <p>请点击设备标点,查看设备详情</p> -->
|
|
|
+ <p>暂无数据</p>
|
|
|
</div>
|
|
|
<div
|
|
|
v-else
|
|
|
@@ -357,7 +359,7 @@ export default {
|
|
|
return {
|
|
|
pietf: false,
|
|
|
width: '0px',
|
|
|
- point_type: '1', //监测点类型 1 表示 林木害虫监测点。2 表示 实蝇监测点
|
|
|
+ point_type: '', //监测点类型 1 表示 林木害虫监测点。2 表示 实蝇监测点
|
|
|
pointTypeOptions: pointTypeOptions,
|
|
|
inoffvalue: '', //监测点 选择
|
|
|
inoffoptions: [], //监测点列表
|
|
|
@@ -508,7 +510,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
initmap() {
|
|
|
- // console.log();
|
|
|
+ console.log('----------- init map');
|
|
|
var map = new AMap.Map(document.getElementById('mapContainer2'), {
|
|
|
center: this.center,
|
|
|
resizeEnable: true,
|
|
|
@@ -533,7 +535,7 @@ export default {
|
|
|
// console.log(e);
|
|
|
// });
|
|
|
this.map = map;
|
|
|
- this.pestboxloading = false;
|
|
|
+ this.getbaselist();
|
|
|
},
|
|
|
getbaselist() {
|
|
|
// this.pestboxloading = true
|
|
|
@@ -549,6 +551,7 @@ export default {
|
|
|
type_id: this.typevalue // 非必传(num) 3测报灯 4诱捕器 6监控 搜索项
|
|
|
})
|
|
|
}).then(res => {
|
|
|
+ this.pestboxloading = false;
|
|
|
// this.init(res.data.data);
|
|
|
console.log(res.data.data);
|
|
|
var resdata = res.data.data;
|
|
|
@@ -592,7 +595,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
setmak(data) {
|
|
|
- if (data.device_type_id === 6) {
|
|
|
+ if (
|
|
|
+ data.device_type_id === 6 ||
|
|
|
+ !this.deviceTypeDataSource[data.device_type_id]
|
|
|
+ ) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -636,7 +642,7 @@ export default {
|
|
|
// }
|
|
|
|
|
|
var iconInstance = new AMap.Icon({
|
|
|
- size: new AMap.Size(200, 200), // 图标尺寸
|
|
|
+ size: new AMap.Size(20, 20), // 图标尺寸
|
|
|
imageSize: new AMap.Size(20, 20),
|
|
|
image: icon // Icon的图像
|
|
|
});
|
|
|
@@ -666,6 +672,8 @@ export default {
|
|
|
},
|
|
|
handlePointTypeChange() {
|
|
|
this.inoffvalue = '';
|
|
|
+ this.typevalue = '';
|
|
|
+ this.gettype();
|
|
|
this.getmon2();
|
|
|
this.search();
|
|
|
},
|
|
|
@@ -705,7 +713,10 @@ export default {
|
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
|
url:
|
|
|
- '/api/api_gateway?method=monitor_manage.home_map.home_map_device_type'
|
|
|
+ '/api/api_gateway?method=monitor_manage.home_map.home_map_device_type',
|
|
|
+ data: this.qs.stringify({
|
|
|
+ point_type: this.point_type
|
|
|
+ })
|
|
|
}).then(res => {
|
|
|
// console.log(res.data.data);
|
|
|
this.typeoptions =
|
|
|
@@ -719,9 +730,6 @@ export default {
|
|
|
);
|
|
|
|
|
|
this.deviceTypeDataSource = normalization(deviceData, 'type_id');
|
|
|
-
|
|
|
- this.initmap();
|
|
|
- this.getbaselist();
|
|
|
});
|
|
|
},
|
|
|
getbaseinfo(d_id) {
|
|
|
@@ -737,6 +745,10 @@ export default {
|
|
|
// console.log(res.data.data);
|
|
|
this.loading = false;
|
|
|
this.baseinfo = res.data.data;
|
|
|
+ if (!this.baseinfo.length) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (this.baseinfo[0].device_info) {
|
|
|
// console.log(this.baseinfo[0].device_info.hlsHd)
|
|
|
let hlsHd = this.baseinfo[0].device_info.hlsHd;
|
|
|
@@ -1059,6 +1071,9 @@ export default {
|
|
|
this.gettype();
|
|
|
this.getmon2();
|
|
|
this.gettracklist_data();
|
|
|
+ setTimeout(() => {
|
|
|
+ this.initmap();
|
|
|
+ }, 1000);
|
|
|
},
|
|
|
beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
updated() {}, //生命周期 - 更新之后
|