From d62d3f734a726bef3573340a2b38f89138d04703 Mon Sep 17 00:00:00 2001
From: fengerli <528575642@qq.com>
Date: Wed, 4 Feb 2026 15:27:43 +0800
Subject: [PATCH 1/2] =?UTF-8?q?100J=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/100J/HBY100-J.js | 54 +-
config/index.js | 2 +-
pages/100J/HBY100-J.vue | 2754 +++++++++++++------------
pages/100J/audioManager/AudioList.vue | 98 +-
4 files changed, 1557 insertions(+), 1351 deletions(-)
diff --git a/api/100J/HBY100-J.js b/api/100J/HBY100-J.js
index 7a3ca1d..078b289 100644
--- a/api/100J/HBY100-J.js
+++ b/api/100J/HBY100-J.js
@@ -24,10 +24,60 @@ export function deviceDeleteAudioFile(params) {
})
}
+// 更新语音,使用语音
+export function deviceUpdateVoice(data) {
+ return request({
+ url: `/app/hby100j/device/updateVoice`,
+ method: 'post',
+ data:data
+ })
+}
// 100J信息
export function deviceDetail(id) {
return request({
- url: `/app/hby100/device/${id}`,
+ url: `/app/hby100j/device/${id}`,
method: 'get',
})
-}
\ No newline at end of file
+}
+// 爆闪模式
+export function deviceStrobeMode(data) {
+ return request({
+ url: `/app/hby100j/device/strobeMode`,
+ method: 'post',
+ data:data
+ })
+}
+
+// 强制报警
+export function deviceForceAlarmActivation(data) {
+ return request({
+ url: `/app/hby100j/device/forceAlarmActivation`,
+ method: 'post',
+ data:data
+ })
+}
+// 爆闪频率
+export function deviceStrobeFrequency(data) {
+ return request({
+ url: `/app/hby100j/device/strobeFrequency`,
+ method: 'post',
+ data:data
+ })
+}
+// 灯光调节亮度
+export function deviceLightAdjustment(data) {
+ return request({
+ url: `/app/hby100j/device/lightAdjustment`,
+ method: 'post',
+ data:data
+ })
+}
+
+// 调节音量
+export function deviceUpdateVolume(data) {
+ return request({
+ url: `/app/hby100j/device/updateVolume`,
+ method: 'post',
+ data:data
+ })
+}
diff --git a/config/index.js b/config/index.js
index d239f4a..3776862 100644
--- a/config/index.js
+++ b/config/index.js
@@ -2,7 +2,7 @@
const config = {
// 开发环境
development: {
- BASE_URL: 'http://192.168.110.172:8000',//http://139.224.253.23:8000
+ BASE_URL: 'http://192.168.2.34:8000',//http://139.224.253.23:8000
API_PREFIX: '',
// MQTT 配置
MQTT_HOST: 'www.cnxhyc.com',
diff --git a/pages/100J/HBY100-J.vue b/pages/100J/HBY100-J.vue
index 8731117..af09b27 100644
--- a/pages/100J/HBY100-J.vue
+++ b/pages/100J/HBY100-J.vue
@@ -40,8 +40,8 @@
设备状态
- {{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus === 2 ? '故障' : '在线' }}
+ {{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus
+ === 2 ? '故障' : '在线' }}
定位信息
@@ -51,8 +51,8 @@
{{ deviceInfo && deviceInfo.latitude ? Number(deviceInfo.latitude).toFixed(4) : '' }}
-
+
{{ deviceInfo.address }}
@@ -62,7 +62,7 @@
- {{ formData.sta_SOSType === 1 ? '报警中' : '强制报警' }}
+ {{ deviceInfo.chargeState === 1 ? '报警中' : '强制报警' }}
解除
@@ -97,19 +97,18 @@
-
+
-
-
播放语音
-
@@ -161,27 +160,21 @@
频率
{{ formData.sta_LightFreq }}HZ
-
-
-
-
-
-
产品信息
@@ -202,7 +195,6 @@
-
\ No newline at end of file
diff --git a/pages/100J/audioManager/AudioList.vue b/pages/100J/audioManager/AudioList.vue
index 5ebbf95..1396358 100644
--- a/pages/100J/audioManager/AudioList.vue
+++ b/pages/100J/audioManager/AudioList.vue
@@ -1,6 +1,6 @@
-
@@ -27,8 +27,8 @@
- {{item.isApply ?'使用中':'使用'}}
+ :class="{'active':item.useStatus,'btn-default':!item.useStatus}">
+ {{item.useStatus==1 ?'使用中':'使用'}}
@@ -94,7 +94,8 @@
import {
deviceVoliceList,
videRenameAudioFile,
- deviceDeleteAudioFile
+ deviceDeleteAudioFile,
+ deviceUpdateVoice
} from '@/api/100J/HBY100-J.js'
import {
showLoading,
@@ -185,9 +186,6 @@
createTime: "", //创建时间
fileUrl: "", //本地地址
fileUrl: "", //网络地址
- statu: "", //状态,是否公开
- isApply: "" //是否使用中
-
},
cPlay: {
Id: "", //编号
@@ -195,8 +193,6 @@
createTime: "", //创建时间
fileUrl: "", //本地地址
fileUrl: "", //网络地址
- statu: "", //状态,是否公开
- isApply: "" //是否使用中
}
}
},
@@ -208,7 +204,7 @@
console.log(rec, 'ressss');
this.blue = rec.ble;
this.device = rec.data;
- this.getinitData(rec.data.deviceId,true)
+ this.getinitData(rec.data.deviceId, true)
});
},
@@ -220,7 +216,7 @@
},
methods: {
//语音管理列表
- getinitData(val,isLoadMore = false) {
+ getinitData(val, isLoadMore = false) {
let data = {
deviceId: this.device.deviceId
}
@@ -456,40 +452,56 @@
}
},
Apply(item, index) {
- if (item.isApply) {
- return;
+ console.log(item, 'itemmm');
+ let data = {
+ id: item.id
}
- let task = () => {
- let fileList = uni.getStorageSync(Common.audioStorageKey);
- for (let i = 0; i < these.dataListA.length; i++) {
- let ele = these.dataListA[i];
- if (i === index) {
- these.$set(these.dataListA[index], "isApply", true);
- fileList.find(v => {
- if (!v.devices) {
- v.devices = [];
- }
- if (v.Id == ele.Id) {
- v.devices.push(these.device.id);
- return true;
- } else {
- for (let j = 0; j < v.devices.length; j++) {
- if (v.devices[j] === these.device.id) {
- v.devices.splice(j, 1);
- break
- };
- }
- }
- return false;
- });
- } else {
- these.$set(these.dataListA[i], "isApply", false);
- }
+ deviceUpdateVoice(data).then((RES) => {
+ if (RES.code == 200) {
+ uni.showToast({
+ title: RES.msg,
+ icon: 'none',
+ duration: 1000
+ });
+ console.log("状态修改完成");
+ // eventChannel.emit('audioApply', item.Id);
+ console.log("返回上一页");
+ setTimeout(()=>{
+ uni.navigateBack();
+ },1000)
+
}
- console.log("状态修改完成");
- eventChannel.emit('audioApply', item.Id);
- console.log("返回上一页");
- uni.navigateBack();
+
+ })
+
+ let task = () => {
+ //let fileList = uni.getStorageSync(Common.audioStorageKey);
+ // for (let i = 0; i < these.dataListA.length; i++) {
+ // let ele = these.dataListA[i];
+ // if (i === index) {
+ // these.$set(these.dataListA[index], "isApply", true);
+ // fileList.find(v => {
+ // if (!v.devices) {
+ // v.devices = [];
+ // }
+ // if (v.Id == ele.Id) {
+ // v.devices.push(these.device.id);
+ // return true;
+ // } else {
+ // for (let j = 0; j < v.devices.length; j++) {
+ // if (v.devices[j] === these.device.id) {
+ // v.devices.splice(j, 1);
+ // break
+ // };
+ // }
+ // }
+ // return false;
+ // });
+ // } else {
+ // these.$set(these.dataListA[i], "isApply", false);
+ // }
+ // }
+
}
},
closePop: function() {
From 1fc02b5f5a6c6a402fc00de40b5b039b8cd51eec Mon Sep 17 00:00:00 2001
From: fengerli <528575642@qq.com>
Date: Thu, 5 Feb 2026 11:40:56 +0800
Subject: [PATCH 2/2] =?UTF-8?q?100J=E9=A1=B5=E9=9D=A2=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/100J/HBY100-J.js | 8 +
pages/100J/HBY100-J.vue | 2898 +++++++++++++------------
pages/100J/audioManager/AudioList.vue | 2 +-
pages/6170/callPolice/index.vue | 116 +-
pages/common/index/index.vue | 6 +-
utils/Common.js | 12 +-
6 files changed, 1563 insertions(+), 1479 deletions(-)
diff --git a/api/100J/HBY100-J.js b/api/100J/HBY100-J.js
index 078b289..2666c89 100644
--- a/api/100J/HBY100-J.js
+++ b/api/100J/HBY100-J.js
@@ -81,3 +81,11 @@ export function deviceUpdateVolume(data) {
data:data
})
}
+// 语音播放
+export function deviceVoiceBroadcast(data) {
+ return request({
+ url: `/app/hby100j/device/voiceBroadcast`,
+ method: 'post',
+ data:data
+ })
+}
\ No newline at end of file
diff --git a/pages/100J/HBY100-J.vue b/pages/100J/HBY100-J.vue
index af09b27..79fd685 100644
--- a/pages/100J/HBY100-J.vue
+++ b/pages/100J/HBY100-J.vue
@@ -40,18 +40,18 @@
设备状态
- {{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus
+ {{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus
=== 2 ? '故障' : '在线' }}
定位信息
-
-
+
+
{{ deviceInfo && deviceInfo.longitude ? Number(deviceInfo.longitude).toFixed(4) : '' }}
{{ deviceInfo && deviceInfo.latitude ? Number(deviceInfo.latitude).toFixed(4) : '' }}
-
-
+
{{ deviceInfo.address }}
@@ -97,12 +97,12 @@
-
+
-
-
@@ -210,512 +210,503 @@
\ No newline at end of file
diff --git a/pages/100J/audioManager/AudioList.vue b/pages/100J/audioManager/AudioList.vue
index 1396358..5f86a66 100644
--- a/pages/100J/audioManager/AudioList.vue
+++ b/pages/100J/audioManager/AudioList.vue
@@ -1,6 +1,6 @@
-
diff --git a/pages/6170/callPolice/index.vue b/pages/6170/callPolice/index.vue
index d9ce625..0f3dec1 100644
--- a/pages/6170/callPolice/index.vue
+++ b/pages/6170/callPolice/index.vue
@@ -55,12 +55,19 @@
import {
deviceInfo,
} from '@/api/common/index.js'
+ // 1. 导入所有需要的报警接口
import {
- deviceSendAlarmMessage
+ deviceSendAlarmMessage, //6170对应类型接口
+ deviceDefaultAlarm
} from '@/api/6170/callPolice.js'
+ import {
+ deviceForceAlarmActivation
+ } from '@/api/100J/HBY100-J.js'
+ // BJQ100J 对应的接口
import {
deviceRealTimeStatus //设备状态
} from '@/api/6170/deviceControl.js'
+
export default {
components: {
CustomPopup
@@ -74,12 +81,34 @@
popupConfirmText: '确认',
popupType: 'force', // 'force' or 'cancel'
pendingAlarmAction: '',
- sendInfo: ''
+ sendInfo: '',
+ // 2. 核心:typeName 与接口的映射表
+ alarmApiMapping: {
+ 'HBY100-J': { //100J类型
+ sendApi: deviceForceAlarmActivation,
+ statusTypeName: 'FunctionAccessBatchStatusRule_BJQ100J'
+ },
+ 'BJQ6170': { //6170类型
+ sendApi: deviceSendAlarmMessage,
+ statusTypeName: 'FunctionAccessBatchStatusRule_BJQ200J'
+ }
+ },
+ loading: false,
+ total: 0
}
},
computed: {
selectedDeviceIds() {
return this.deviceList.filter(item => item.checked).map(item => item.id);
+ },
+ // 自动匹配当前typeName对应的接口配置
+ currentApiConfig() {
+ const currentTypeName = this.sendInfo.typeName || '';
+ // 匹配到则用对应配置,匹配不到用默认配置
+ return this.alarmApiMapping[currentTypeName] || {
+ sendApi: deviceDefaultAlarm,
+ statusTypeName: 'FunctionAccessBatchStatusRule_Default'
+ };
}
},
methods: {
@@ -93,15 +122,19 @@
// 全选/取消全选
selectAll() {
console.log('123');
- const allSelected = this.deviceList.every(item => item.checked);
+ // 仅对在线设备进行全选/取消
+ const allSelected = this.deviceList.every(item => item.onlineStatus === 1 && item.checked);
this.deviceList.forEach(item => {
- item.checked = !allSelected;
+ // 离线设备不修改checked状态
+ if (item.onlineStatus === 1) {
+ item.checked = !allSelected;
+ }
});
-
this.$forceUpdate();
},
// 获取设备列表
getData(deviceType) {
+ console.log(deviceType, 'deviceTypedeviceType');
this.loading = true;
let data = {
pageNum: 1,
@@ -127,7 +160,7 @@
const selectedDevices = this.deviceList.filter(item => item.checked)
if (selectedDevices.length === 0) {
uni.showToast({
- title: '请选择一个设备',
+ title: '请选择一个在线设备',
icon: 'none'
});
return;
@@ -136,14 +169,13 @@
this.popupMessage = '确认要对所选设备开启强制报警?';
this.showPopupFlag = true;
this.pendingAlarmAction = 1
-
},
// 解除报警
cancelAlarm() {
const selectedDevices = this.deviceList.filter(item => item.checked);
if (selectedDevices.length === 0) {
uni.showToast({
- title: '请选择一个设备',
+ title: '请选择一个在线设备',
icon: 'none'
});
return;
@@ -153,61 +185,61 @@
this.showPopupFlag = true;
this.pendingAlarmAction = 0
},
- // 确认
+ //动态调用对应接口
async sendAlarmCommand() {
const selectedDevices = this.deviceList.filter(item => item.checked);
const deviceIds = selectedDevices.map(item => item.id);
const deviceImeiList = selectedDevices.map(item => item.deviceImei);
const isAlarming = this.pendingAlarmAction == 1;
+ if (selectedDevices.length === 0) {
+ uni.showToast({
+ title: '请选择在线设备',
+ icon: 'none'
+ });
+ return;
+ }
try {
-
uni.showLoading({
title: isAlarming ? '设备报警中...' : '解除报警中...',
mask: true
});
- // 2. 准备请求数据
- const batchId = generateShortId();
- const data = {
- deviceIds: deviceIds,
+ // 获取当前typeName对应的接口和参数配置
+ const {
+ sendApi,
+ statusTypeName
+ } = this.currentApiConfig;
+ // 准备请求数据
+ // const batchId = generateShortId();
+ const requestData = {
+ deviceIds: deviceIds,
typeName: this.sendInfo.typeName,
deviceImeiList: deviceImeiList,
- batchId: batchId,
- instructValue: this.pendingAlarmAction == 1 ? '1' : '0'
+ // batchId: batchId,
+ voiceStrobeAlarm: this.pendingAlarmAction == 1 ? '1' : '0'
};
- const registerRes = await deviceSendAlarmMessage(data);
- if (registerRes.code !== 200) {
+ // 动态调用匹配的接口
+ const registerRes = await sendApi(requestData);
+ if (registerRes.code == 200) {
uni.showToast({
- title: registerRes.msg,
- icon: 'none'
- })
- return
- }
- // 4. 获取设备状态
- let deviceImei = this.sendInfo.deviceImei
- let typeName = this.sendInfo.typeName
- const statusRes = await getdeviceSTatus({
- functionMode: 2,
- batchId,
- typeName:'FunctionAccessBatchStatusRule',
- deviceImei,
- interval: 500
- },
- deviceRealTimeStatus
- );
- if (statusRes.data.functionAccess === 'OK') {
- uni.showToast({
- title: statusRes.msg,
- icon: 'none'
+ title: isAlarming ? '强制报警开启成功' : '报警已解除',
+ icon: 'success'
});
this.showPopupFlag = false
uni.$emit('deviceStatusUpdate', {});
setTimeout(() => {
uni.navigateBack()
}, 500)
+ } else {
+ uni.showToast({
+ title: registerRes.msg || '状态查询失败',
+ icon: 'none'
+ });
}
+
} catch (error) {
+ console.error('报警操作异常:', error);
uni.showToast({
- title: error.message,
+ title: '网络异常,请重试',
icon: 'none'
});
} finally {
@@ -217,7 +249,6 @@
// 点击确认状态
onPopupConfirm() {
this.sendAlarmCommand(this.popupType);
- // 处理确认逻辑
},
},
onLoad(options) {
@@ -227,7 +258,6 @@
this.getData(data.data.id)
this.sendInfo = data.data
});
- // 如果需要向调用页面返回数据,可以触发 'ack' 事件
eventChannel.emit('ack', {})
},
}
@@ -236,7 +266,7 @@