100Jbug修改

This commit is contained in:
fengerli
2026-03-04 09:58:06 +08:00
parent 569c7cf0b4
commit 8c6bd79410

View File

@ -231,9 +231,6 @@
deviceUpdateVolume, deviceUpdateVolume,
deviceVoiceBroadcast deviceVoiceBroadcast
} from '@/api/100J/HBY100-J.js' } from '@/api/100J/HBY100-J.js'
import {
deviceShareId
} from '@/api/6170/deviceControl.js'
var these = null; var these = null;
import Common from '@/utils/Common.js' import Common from '@/utils/Common.js'
const pagePath = "/pages/100/HBY100"; const pagePath = "/pages/100/HBY100";
@ -241,6 +238,7 @@
data() { data() {
return { return {
mqttClient: null, mqttClient: null,
activePermissions: [], // 存储当前设备的权限数组
Status: { Status: {
isRightIconVisible: false, isRightIconVisible: false,
navTitle: '', navTitle: '',
@ -249,6 +247,7 @@
curr: 0, curr: 0,
total: 0, total: 0,
pageHide: false, pageHide: false,
Pop: { Pop: {
showPop: false, //是否显示弹窗 showPop: false, //是否显示弹窗
popType: 'custom', popType: 'custom',
@ -580,13 +579,13 @@
}) })
}) })
console.log(data, 'datatatatat'); console.log(data, 'datatatatat');
// 分享接口
if (these.Status.apiType === 'listA') { if (these.Status.apiType === 'listA') {
these.fetchDeviceDetail(data.data.id) these.fetchDeviceDetail(data.data.id)
} else { } else {
console.log('走到这里了没'); these.fetchDeviceDetail(data.data.deviceId)
// 分享权限详情
these.fetchSharedDeviceDetail(data.data.id)
} }
}); });
this.createThrottledFunctions(); this.createThrottledFunctions();
@ -638,17 +637,13 @@
} }
}) })
}, },
// 获取分享设备详情 // 检查权限的方法
async fetchSharedDeviceDetail(id) { hasPermission(permissionCode) {
try { // 如果还在加载中直接返回false
const res = await deviceShareId(id) if (this.pageLoading) return false
if (res.code == 200) { // 如果不是分享设备,默认有全部权限
console.log(this.deviceInfo,'this.deviceInfo'); if (!this.isSharedDevice) return true
this.deviceInfo=res.data return this.activePermissions.includes(permissionCode)
}
} catch (error) {
}
}, },
handleRightClick(item, s) { handleRightClick(item, s) {
if (item && item.callback) { if (item && item.callback) {
@ -858,28 +853,8 @@
this.formData.sta_VoiceType = val; this.formData.sta_VoiceType = val;
// 模式类型为7时才去判断 // 模式类型为7时才去判断
console.log(val, 'valllll'); console.log(val, 'valllll');
const voiceStrobeAlarm = this.deviceInfo?.voiceStrobeAlarm ?? 0; // 兜底0避免undefined
const isVoiceOperate = val === '7' || val === '-1'; // 标记是否是语音开启/关闭操作 const isVoiceOperate = val === '7' || val === '-1'; // 标记是否是语音开启/关闭操作
if (voiceStrobeAlarm === 0 && isVoiceOperate) { if (this.deviceInfo.voiceStrobeAlarm == 1) {
let data = {
deviceId: this.deviceInfo.deviceId,
voiceBroadcast: Number(this.formData.sta_VoiceType) === -1 ? 0 : 1
}
deviceVoiceBroadcast(data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: res.msg,
icon: 'none'
});
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
})
} else if (this.deviceInfo.voiceStrobeAlarm == 1) {
console.log('走到这里了没');
// 如果强制报警已经开启了,那么切换下面的模式需要时,需要触发报警指令 // 如果强制报警已经开启了,那么切换下面的模式需要时,需要触发报警指令
const data = { const data = {
deviceIds: [this.deviceInfo.deviceId], deviceIds: [this.deviceInfo.deviceId],
@ -900,8 +875,26 @@
}); });
} }
}) })
} else if (isVoiceOperate) {
console.log('我是谁');
let data = {
deviceId: this.deviceInfo.deviceId,
voiceBroadcast: Number(this.formData.sta_VoiceType) === -1 ? 0 : 1
}
deviceVoiceBroadcast(data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: res.msg,
icon: 'none'
});
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
})
} }
}, },
// 报警模式 // 报警模式
sosSetting(item) { sosSetting(item) {