Browse Source

Merge branch 'develop' into test

test
JinxChen 1 year ago
parent
commit
366a1a7d4a
5 changed files with 119 additions and 18 deletions
  1. +7
    -1
      README.md
  2. +9
    -1
      src/api/core.js
  3. +2
    -2
      src/config/models.js
  4. +2
    -2
      src/main.js
  5. +99
    -12
      src/views/alarm/alarm-details.vue

+ 7
- 1
README.md View File

@@ -279,4 +279,10 @@ feature
- alarmDetails - alarmDetails
- 增加 涉水区域告警页面 - 增加 涉水区域告警页面
- amap.js - amap.js
- 增加 高德地图js
- 增加 高德地图js

## v1.0.33
`2023.3.27`
feature
- alarmDetails
- 增加 误报功能,设置该设备IMEI与该水域告警poi_id不做任何报警信息处理

+ 9
- 1
src/api/core.js View File

@@ -1,7 +1,7 @@
/* /*
* @Date: 2021-12-18 15:49:01 * @Date: 2021-12-18 15:49:01
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 17:04:23
* @LastEditTime: 2023-03-27 15:29:01
* @FilePath: \TelpoH5FrontendWeb\src\api\core.js * @FilePath: \TelpoH5FrontendWeb\src\api\core.js
* @description: * @description:
* b端的接口, 每次调用前先获取token * b端的接口, 每次调用前先获取token
@@ -29,6 +29,7 @@ export const APICore = {
GpsDeviceFence, //围栏 redis GpsDeviceFence, //围栏 redis
cardPackageList, //零川基础套餐列表 cardPackageList, //零川基础套餐列表
devicePayPackage, devicePayPackage,
drownReportFilterAdd,//添加过滤危险水域区域
} }
/* const headerAuth = this.$store.getters.gatewayToken; */ /* const headerAuth = this.$store.getters.gatewayToken; */
// 获取告警详情 // 获取告警详情
@@ -93,4 +94,11 @@ function devicePayPackage(imei) {
params: {imei}, params: {imei},
}) })
} }
function drownReportFilterAdd(data) {
return service({
url: `${baseUrl}/core/api/v1/Device/DrownReportFilterAdd`,
method: 'post',
data,
});
}
export default APICore; export default APICore;

+ 2
- 2
src/config/models.js View File

@@ -1,11 +1,11 @@
/* /*
* @Date: 2021-11-20 10:26:39 * @Date: 2021-11-20 10:26:39
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @LastEditTime: 2023-03-24 18:07:12
* @LastEditTime: 2023-03-27 16:19:56
* @FilePath: \TelpoH5FrontendWeb\src\config\models.js * @FilePath: \TelpoH5FrontendWeb\src\config\models.js
* @description: * @description:
*/ */
export const VERSION_MODEL = '1.0.32F'; //版本号
export const VERSION_MODEL = '1.0.33F'; //版本号
export const IMAGE_URL = { export const IMAGE_URL = {
production: 'http://zfb.ssjlai.com/web/', production: 'http://zfb.ssjlai.com/web/',
test: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/',


+ 2
- 2
src/main.js View File

@@ -1,7 +1,7 @@
/* /*
* @Date: 2022-01-19 10:08:26 * @Date: 2022-01-19 10:08:26
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @LastEditTime: 2023-03-24 17:54:06
* @LastEditTime: 2023-03-27 16:04:16
* @FilePath: \TelpoH5FrontendWeb\src\main.js * @FilePath: \TelpoH5FrontendWeb\src\main.js
* @description: * @description:
*/ */
@@ -101,7 +101,7 @@ Vue.config.productionTip = false;
Vue.config.devtools = true; Vue.config.devtools = true;
// 全局配置 loading // 全局配置 loading
Toast.setDefaultOptions('success', { Toast.setDefaultOptions('success', {
duration: 1500,
duration: 2500,
forbidClick: true, forbidClick: true,
}); });
Toast.setDefaultOptions('loading', { Toast.setDefaultOptions('loading', {


+ 99
- 12
src/views/alarm/alarm-details.vue View File

@@ -1,19 +1,19 @@
<template> <template>
<div class="alarm-container">
<van-nav-bar :title="title" left-arrow :border="true" @click-left="onNavBack"></van-nav-bar>
<div class="alarm-container" v-show="isPageShow">
<van-nav-bar :title="title" :left-arrow="false" :border="true" @click-left="onNavBack"></van-nav-bar>
<div id="details_map" class="details_map" style="width: 100%;height: 100vh"></div> <div id="details_map" class="details_map" style="width: 100%;height: 100vh"></div>
<div class="notice">{{ alarm.message + '' }}</div> <div class="notice">{{ alarm.message + '' }}</div>
<div class="refresh">
<div class="refresh" @click="onRefresh">
<van-icon name="replay" size="25"/> <van-icon name="replay" size="25"/>
<span>刷新</span> <span>刷新</span>
</div> </div>
<div class="bottom"> <div class="bottom">
<div class="address"> <div class="address">
<div class="title"> <div class="title">
<p>{{ alarm.address }}</p>
<p>{{ params.address }}</p>
</div> </div>
<div class="time"> <div class="time">
<span>{{ alarm.time }}</span>
<span>{{ params.time }}</span>
</div> </div>
</div> </div>
<div class="action"> <div class="action">
@@ -41,8 +41,11 @@


<script> <script>
import MapLoader from "@/config/amap.js"; import MapLoader from "@/config/amap.js";
import APICore from "@/api/core";
import { isNotNull } from "@/utils/index";
export default { export default {
name: 'alarm-details', name: 'alarm-details',
inject: ["reload"],
data(){ data(){
return { return {
title: '进入涉水区域警报', title: '进入涉水区域警报',
@@ -75,20 +78,57 @@ export default {
mapAppList: [ mapAppList: [
{ name: "高德地图", wakeUpUrl: "https://uri.amap.com/marker?", number: 0 }, { name: "高德地图", wakeUpUrl: "https://uri.amap.com/marker?", number: 0 },
{ name: "腾讯地图", wakeUpUrl: "https://apis.map.qq.com/tools/poimarker?", number: 1 } { name: "腾讯地图", wakeUpUrl: "https://apis.map.qq.com/tools/poimarker?", number: 1 }
]
],
params: {
imei: '',
poiId: '',
title: '',
lng: '',
lat: '',
address: '',
status: true,
time: ''
},
isPageShow: null,
} }
}, },
created() { created() {
this.initAmap()
this.getAuth();
this.getParams();
//this.initAmap();
}, },
methods: { methods: {
// 获取b端接口的token
getAuth() {
let manufactorId = "5bf13062-a41e-4d00-ba14-1101aad12650";
APICore.getAuth({ manufactorId: manufactorId }).then(res => {
this.$store.commit("gatewayToken", res.data.data);
});
},
getParams() {
let params = this.$route.query;
if (isNotNull(params)) {
console.log("params", params);
this.params = {...params};
this.isPageShow = true;
this.initAmap();
console.log("this.params", this.params);
} else {
this.$dialog.confirm({
message: '跳转参数错误,请联系管理员',
showCancelButton: false
})
this.isPageShow = false;
}
},
onNavBack() {}, onNavBack() {},
// 初始化地图 // 初始化地图
initAmap() { initAmap() {
this.$toast.loading('地图加载中');
MapLoader(false, [ 'AMap.PolyEditor', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.Geolocation' ]).then( MapLoader(false, [ 'AMap.PolyEditor', 'AMap.MouseTool', 'AMap.Geocoder', 'AMap.Geolocation' ]).then(
AMap => { AMap => {
this.map.instance = new AMap.Map("details_map", { this.map.instance = new AMap.Map("details_map", {
center: this.map.center,
center: [this.params.lng, this.params.lat],
resizeEnable: this.map.resizeEnable, resizeEnable: this.map.resizeEnable,
zoom: this.map.zoom, zoom: this.map.zoom,
zoomEnable: true zoomEnable: true
@@ -97,12 +137,16 @@ export default {
extensions: "all" extensions: "all"
}); });
this.initCenterMarker(); this.initCenterMarker();
this.$toast.success('地图加载完成');
}, },
err => { err => {
this.$toast.clear(); this.$toast.clear();
console.log("加载地图失败:::", err); console.log("加载地图失败:::", err);
} }
); );
setTimeout(() => {
this.$toast.clear();
}, 5000)
}, },
// 初始化marker // 初始化marker
initCenterMarker() { initCenterMarker() {
@@ -176,8 +220,45 @@ export default {
if(name === 'goHere') { if(name === 'goHere') {
// 根据选择的地图跳转不同地图app的url // 根据选择的地图跳转不同地图app的url
this.actionSheetShow = true; this.actionSheetShow = true;
} else {
this.$dialog({
title: '',
message: '是否永不提示',
showCancelButton: true,
closeOnClickOverlay: true,
}).then(() => {
// 调取接口设置该设备IMEI与该水域告警poi_id不做任何报警信息处理
this.drownReportFilterAdd();
}).catch(() => {
console.log("取消");
})
} }
}, },
drownReportFilterAdd() {
this.$toast.loading('设置中');
let reqBody = {
...this.params
};
reqBody['status'] = true;
delete reqBody.message;
delete reqBody.time;
console.log("请求的参数", reqBody);
APICore.drownReportFilterAdd(reqBody).then(res => {
console.log("res", res);
let data = res.data;
if(data.code === 0) {
this.$toast.success('设置成功')
};
}).catch(error => {
this.$dialog.confirm({
message: `${error.message}`
});
}).finally(() => {
setTimeout(() => {
this.$toast.clear();
},1500)
})
},
onSelect(item) { onSelect(item) {
if(item.number === 0) { if(item.number === 0) {
// 高德 // 高德
@@ -187,16 +268,19 @@ export default {
} }
}, },
wakeUpGaodeMap(wakeUpUrl) { wakeUpGaodeMap(wakeUpUrl) {
const position = this.alarm.glng + ',' +this.alarm.glat;
const name = this.alarm.address;
const position = this.params.lng + ',' +this.params.lat;
const name = this.params.address;
window.location.href = `${wakeUpUrl}position=${position}&name=${name}&callnative=1`; window.location.href = `${wakeUpUrl}position=${position}&name=${name}&callnative=1`;
}, },
wakeUpTencentMap(wakeUpUrl) { wakeUpTencentMap(wakeUpUrl) {
const position = this.alarm.glat + ',' + this.alarm.glng ;
const address = this.alarm.address;
const position = this.params.lat + ',' + this.params.lng ;
const address = this.params.address;
const key = 'UHFBZ-I5ECQ-GSA5B-GW3UW-V2NL5-A3FNY'; const key = 'UHFBZ-I5ECQ-GSA5B-GW3UW-V2NL5-A3FNY';
const myAppName = 'ssjlqqmap'; const myAppName = 'ssjlqqmap';
window.location.href = `${wakeUpUrl}type=0&marker=coord:${position};title:${address};addr:${address}&key=${key}&referer=${myAppName}`; window.location.href = `${wakeUpUrl}type=0&marker=coord:${position};title:${address};addr:${address}&key=${key}&referer=${myAppName}`;
},
onRefresh() {
this.reload();
} }
} }
} }
@@ -271,11 +355,14 @@ export default {
} }
} }
.bottom { .bottom {
width: 100%;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
background-color: $background; background-color: $background;
z-index: 999; z-index: 999;
padding-bottom: constant(safe-area-inset-bottom); //* 兼容 iOS<11.2 */
padding-bottom: env(safe-area-inset-bottom); ///* 兼容iOS>= 11.2 */
.address { .address {
padding: 10px; padding: 10px;
display: flex; display: flex;


Loading…
Cancel
Save