1
0
forked from dyf/APP

地图打点动态数据加载,

This commit is contained in:
fengerli
2025-08-05 19:02:04 +08:00
parent d19dc91223
commit 6c5a702ff9
10 changed files with 208 additions and 86 deletions

View File

@ -35,11 +35,13 @@
<!-- 强制报警提示弹框 -->
<CustomPopup v-if="popupType === 'force'" :show="showPopupFlag" popupBorder="1rpx solid rgba(224, 52, 52, 0.3)"
:message="popupMessage" icon="/static/images/6170/bj.png" :confirm-text="popupConfirmText"
:show-cancel="false" @confirm="onPopupConfirm" confirmBtnBg="rgba(224, 52, 52, 1)" confirmBtnColor="#fff" />
:show-cancel="false" @close="onclosePopup" @confirm="onPopupConfirm" confirmBtnBg="rgba(224, 52, 52, 1)"
confirmBtnColor="#fff" />
<!-- 解除报警 -->
<CustomPopup v-if="popupType === 'cancel'" :show="showPopupFlag" popupBorder="1rpx solid rgba(224, 52, 52, 0.3)"
:message="popupMessage" icon="/static/images/6170/svg.png" :confirm-text="popupConfirmText"
:show-cancel="false" @confirm="onPopupConfirm" confirmBtnBg="rgba(224, 52, 52, 1)" confirmBtnColor="#fff" />
:show-cancel="false" @close="onclosePopup" @confirm="onPopupConfirm" confirmBtnBg="rgba(224, 52, 52, 1)"
confirmBtnColor="#fff" />
</view>
</template>
@ -49,8 +51,8 @@
deviceInfo,
} from '@/api/common/index.js'
import {
deviceSendMessage
} from '@/api/6170/deviceControl.js'
deviceSendAlarmMessage
} from '@/api/6170/callPolice.js'
export default {
components: {
CustomPopup
@ -64,6 +66,7 @@
popupMessage: '确认要对所选设备开启强制报警?',
popupConfirmText: '确认',
popupType: 'force', // 'force' or 'cancel'
pendingAlarmAction: ''
}
},
computed: {
@ -72,6 +75,9 @@
}
},
methods: {
onclosePopup() {
this.showPopupFlag = false
},
toggleSelect(index) {
this.deviceList[index].checked = !this.deviceList[index].checked
this.$forceUpdate()
@ -122,6 +128,8 @@
this.popupType = 'force';
this.popupMessage = '确认要对所选设备开启强制报警?';
this.showPopupFlag = true;
this.pendingAlarmAction = 1
},
// 解除报警
cancelAlarm() {
@ -136,6 +144,8 @@
this.popupType = 'cancel';
this.popupMessage = '确认要解除所选设备的报警状态?';
this.showPopupFlag = true;
this.pendingAlarmAction = 1
},
sendAlarmCommand(type) {
const selectedDevices = this.deviceList.filter(item => item.checked);
@ -143,12 +153,20 @@
let data = {
deviceIds: deviceIds,
commandType: type // '强制或者解除'
instructValue: this.pendingAlarmAction, // '强制或者解除'
}
deviceSendMessage(data).then((res) => {
deviceSendAlarmMessage(data).then((res) => {
if (res.code == 200) {
this.showPopupFlag = true;
uni.showToast({
title: res.msg,
icon: 'none'
});
this.showPopupFlag = false
setTimeout(() => {
uni.navigateBack()
}, 500)
} else {
uni.showToast({
title: res.msg,
@ -159,10 +177,8 @@
},
// 点击确认状态
onPopupConfirm() {
this.showPopupFlag = false
uni.navigateBack()
console.log('用户点击了确定')
this.sendAlarmCommand(this.popupType);
// 处理确认逻辑
},
},