设备发送
This commit is contained in:
@ -66,7 +66,6 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
deviceList: [],
|
deviceList: [],
|
||||||
messageToSend: '', //发送信息
|
|
||||||
showPopupFlag: false,
|
showPopupFlag: false,
|
||||||
popupTitle: '',
|
popupTitle: '',
|
||||||
popupMessage: '确认要对所选设备开启强制报警?',
|
popupMessage: '确认要对所选设备开启强制报警?',
|
||||||
@ -88,12 +87,12 @@
|
|||||||
* @param {string} batchId - 批次ID
|
* @param {string} batchId - 批次ID
|
||||||
* @param {number} [interval=1000] - 轮询间隔(毫秒)
|
* @param {number} [interval=1000] - 轮询间隔(毫秒)
|
||||||
*/
|
*/
|
||||||
async getdeviceSTatus(val, batchId, interval =800) {
|
async getdeviceSTatus(val, batchId, interval = 800) {
|
||||||
let retries = 0;
|
let retries = 0;
|
||||||
const checkStatus = async () => {
|
const checkStatus = async () => {
|
||||||
try {
|
try {
|
||||||
const data = {
|
const data = {
|
||||||
functionMode: val, //批量的传2
|
functionMode: val, //批量的传2
|
||||||
batchId: batchId,
|
batchId: batchId,
|
||||||
typeName: this.sendInfo.typeName,
|
typeName: this.sendInfo.typeName,
|
||||||
deviceImei: this.sendInfo.deviceImei
|
deviceImei: this.sendInfo.deviceImei
|
||||||
@ -163,7 +162,6 @@
|
|||||||
// 强制报警
|
// 强制报警
|
||||||
forceAlarm() {
|
forceAlarm() {
|
||||||
const selectedDevices = this.deviceList.filter(item => item.checked)
|
const selectedDevices = this.deviceList.filter(item => item.checked)
|
||||||
const deviceIds = selectedDevices.map(item => item.id);
|
|
||||||
if (selectedDevices.length === 0) {
|
if (selectedDevices.length === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择一个设备',
|
title: '请选择一个设备',
|
||||||
@ -192,25 +190,25 @@
|
|||||||
this.showPopupFlag = true;
|
this.showPopupFlag = true;
|
||||||
this.pendingAlarmAction = 0
|
this.pendingAlarmAction = 0
|
||||||
},
|
},
|
||||||
async sendAlarmCommand(type) {
|
// 确认
|
||||||
|
async sendAlarmCommand() {
|
||||||
const selectedDevices = this.deviceList.filter(item => item.checked);
|
const selectedDevices = this.deviceList.filter(item => item.checked);
|
||||||
const deviceIds = selectedDevices.map(item => item.id);
|
const deviceIds = selectedDevices.map(item => item.id);
|
||||||
const deviceImeiList = selectedDevices.map(item => item.deviceImei);
|
const deviceImeiList = selectedDevices.map(item => item.deviceImei);
|
||||||
let loadingShown = false;
|
const isAlarming = this.pendingAlarmAction == 1;
|
||||||
try {
|
try {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '报警中...',
|
title: isAlarming ? '设备报警中...' : '解除报警中...',
|
||||||
mask: true
|
mask: true
|
||||||
});
|
});
|
||||||
loadingShown = true;
|
|
||||||
// 2. 准备请求数据
|
// 2. 准备请求数据
|
||||||
const batchId = generateShortId();
|
const batchId = generateShortId();
|
||||||
const data = {
|
const data = {
|
||||||
sendMsg: this.messageToSend,
|
|
||||||
deviceIds: deviceIds,
|
deviceIds: deviceIds,
|
||||||
batchId: batchId,
|
batchId: batchId,
|
||||||
typeName: this.sendInfo.typeName,
|
typeName: this.sendInfo.typeName,
|
||||||
deviceImeiList: deviceImeiList
|
deviceImeiList: deviceImeiList,
|
||||||
|
instructValue: this.pendingAlarmAction == 1 ? '1' : '0'
|
||||||
};
|
};
|
||||||
// 3.人员信息
|
// 3.人员信息
|
||||||
const registerRes = await deviceSendAlarmMessage(data);
|
const registerRes = await deviceSendAlarmMessage(data);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -31,7 +31,7 @@
|
|||||||
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
|
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
|
||||||
<uni-swipe-action-item :right-options="Options"
|
<uni-swipe-action-item :right-options="Options"
|
||||||
@click="handleSwipeClick($event, item, index)" class="device-card"
|
@click="handleSwipeClick($event, item, index)" class="device-card"
|
||||||
:style="{ border: item.communicationMode==0 && item.onlineStatus==0 && item.alarmStatus==1 ? '1px solid rgba(224, 52, 52, 1)' : 'none' }">
|
:style="{ border: item.communicationMode==0 && item.onlineStatus==1 && item.alarmStatus==1 ? '1px solid rgba(224, 52, 52, 1)' : 'none' }">
|
||||||
<view @click.stop="handleFile(item)">
|
<view @click.stop="handleFile(item)">
|
||||||
<view class="device-header">
|
<view class="device-header">
|
||||||
<view class="deviceIMG">
|
<view class="deviceIMG">
|
||||||
@ -54,7 +54,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="device-callpolice"
|
<view class="device-callpolice"
|
||||||
v-if="item.communicationMode==0 && item.onlineStatus==0 && item.alarmStatus==1">
|
v-if="item.communicationMode==0 && item.onlineStatus==1 && item.alarmStatus==1">
|
||||||
报警中</view>
|
报警中</view>
|
||||||
<view v-if="item.communicationMode==1">
|
<view v-if="item.communicationMode==1">
|
||||||
<view class="device-status online">已连接</view>
|
<view class="device-status online">已连接</view>
|
||||||
|
Reference in New Issue
Block a user