Compare commits
6 Commits
7735abc2a1
...
9b6a5e095c
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b6a5e095c | |||
| 3fecf3380a | |||
| 943d98dd40 | |||
| 7d657d4429 | |||
| 1fc02b5f5a | |||
| d62d3f734a |
@ -24,10 +24,68 @@ export function deviceDeleteAudioFile(params) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新语音,使用语音
|
||||||
|
export function deviceUpdateVoice(data) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/updateVoice`,
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
// 100J信息
|
// 100J信息
|
||||||
export function deviceDetail(id) {
|
export function deviceDetail(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/app/hby100/device/${id}`,
|
url: `/app/hby100j/device/${id}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
// 爆闪模式
|
||||||
|
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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 语音播放
|
||||||
|
export function deviceVoiceBroadcast(data) {
|
||||||
|
return request({
|
||||||
|
url: `/app/hby100j/device/voiceBroadcast`,
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
@ -2,13 +2,13 @@
|
|||||||
const config = {
|
const config = {
|
||||||
// 开发环境
|
// 开发环境
|
||||||
development: {
|
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: '',
|
API_PREFIX: '',
|
||||||
// MQTT 配置
|
// MQTT 配置
|
||||||
MQTT_HOST: 'www.cnxhyc.com',
|
MQTT_HOST: '47.120.79.150',
|
||||||
MQTT_PORT: 8083,
|
MQTT_PORT: 9083,
|
||||||
MQTT_USERNAME: 'admin',
|
MQTT_USERNAME: 'admin',
|
||||||
MQTT_PASSWORD: '#YtvpSfCNG'
|
MQTT_PASSWORD: '#YtvpSfCNG'
|
||||||
},
|
},
|
||||||
// 生产环境
|
// 生产环境
|
||||||
production: {
|
production: {
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
<view class="row">
|
<view class="row">
|
||||||
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
|
<image class="img" src="/static/images/6155/DeviceDetail/time.png" mode="aspectFit"></image>
|
||||||
<view class="txt">
|
<view class="txt">
|
||||||
<view class="bigTxt">{{ deviceInfo.batteryRemainingTime || '0' }}分钟
|
<view class="bigTxt"> {{ Math.floor((Number(deviceInfo.batteryRemainingTime)||0)/60) }}小时 {{ (Number(deviceInfo.batteryRemainingTime)||0)%60 }}分钟
|
||||||
</view>
|
</view>
|
||||||
<view class="smallTxt">续航时间</view>
|
<view class="smallTxt">续航时间</view>
|
||||||
</view>
|
</view>
|
||||||
@ -40,29 +40,29 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<text class="lbl">设备状态</text>
|
<text class="lbl">设备状态</text>
|
||||||
<text
|
<text class="value">{{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus
|
||||||
class="value status-running">{{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus === 2 ? '故障' : '在线' }}</text>
|
=== 2 ? '故障' : '在线' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="info-row">
|
||||||
<text class="lbl">定位信息</text>
|
<text class="info-label" style="display: flex; align-items: center;">定位信息</text>
|
||||||
|
<view class="info-value status-running" @click="gpsPosition(deviceInfo)">
|
||||||
<view class="info-value status-running">
|
<view class="info-value status-running">
|
||||||
<view class="info-value status-running">
|
{{ deviceInfo && deviceInfo.longitude ? Number(deviceInfo.longitude).toFixed(4) : '' }}
|
||||||
{{ deviceInfo && deviceInfo.longitude ? Number(deviceInfo.longitude).toFixed(4) : '' }}
|
{{ deviceInfo && deviceInfo.latitude ? Number(deviceInfo.latitude).toFixed(4) : '' }}
|
||||||
{{ deviceInfo && deviceInfo.latitude ? Number(deviceInfo.latitude).toFixed(4) : '' }}
|
|
||||||
</view>
|
|
||||||
<view class="info-value status-running locationGPS">
|
|
||||||
<!-- <uni-icons @click="toggleForm" type="location" size="17" color="rgba(255, 255, 255, 0.8)"
|
|
||||||
style="vertical-align: bottom;" /> -->
|
|
||||||
{{ deviceInfo.address }}
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="info-value status-running locationGPS">
|
||||||
|
<uni-icons type="location" size="17"
|
||||||
|
color="rgba(255, 255, 255, 0.8)" style="vertical-align: bottom;" />
|
||||||
|
{{ deviceInfo.address }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<view class="lampMode">
|
<view class="lampMode">
|
||||||
<view class="sosContent">
|
<view class="sosContent">
|
||||||
<view class="btnSos openSos center" :class="{ active: formData.sta_SOSType === 1 }"
|
<view class="btnSos openSos center" :class="{ active: formData.sta_SOSType === 1 }"
|
||||||
@click="sosSetting(1)">
|
@click="sosSetting(1)">
|
||||||
{{ formData.sta_SOSType === 1 ? '报警中' : '强制报警' }}
|
{{ deviceInfo.voiceStrobeAlarm === 1 ? '报警中' : '强制报警' }}
|
||||||
</view>
|
</view>
|
||||||
<view class="btnSos closeSos center" @click="sosSetting(0)">解除</view>
|
<view class="btnSos closeSos center" @click="sosSetting(0)">解除</view>
|
||||||
</view>
|
</view>
|
||||||
@ -80,7 +80,7 @@
|
|||||||
<view class="arrow" @click.stop="openVolume(item, index)" v-if="item.show"
|
<view class="arrow" @click.stop="openVolume(item, index)" v-if="item.show"
|
||||||
v-for="item, index in dic.sta_VoiceType" :class="{
|
v-for="item, index in dic.sta_VoiceType" :class="{
|
||||||
'active': formData.sta_VoiceType === item.key,
|
'active': formData.sta_VoiceType === item.key,
|
||||||
'displayNone': !Status.usrToggle && index > 3
|
'displayNone': !Status.usrToggle && index > 2
|
||||||
}">
|
}">
|
||||||
<view class="outCircle">
|
<view class="outCircle">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
@ -97,19 +97,18 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="lampMode">
|
<view class="lampMode">
|
||||||
<view class="mode fleft " v-on:click.stop="openVolume(null, '8')"
|
<view class="mode fleft " v-on:click.stop="openVolume(null, '7')"
|
||||||
:class="{ 'active': formData.sta_VoiceType === '8' }">
|
:class="{ 'active': formData.sta_VoiceType === '7' }">
|
||||||
<view class="leftImg">
|
<view class="leftImg">
|
||||||
<image class="img" :class="{ 'displayNone': formData.sta_VoiceType === '8' }"
|
<image class="img" :class="{ 'displayNone': formData.sta_VoiceType === '7' }"
|
||||||
src="/static/images/common/play.png" mode="aspectFit"></image>
|
src="/static/images/common/play.png" mode="aspectFit"></image>
|
||||||
<image class="img" :class="{ 'displayNone': formData.sta_VoiceType !== '8' }"
|
<image class="img" :class="{ 'displayNone': formData.sta_VoiceType !== '7' }"
|
||||||
src="/static/images/common/pauseActive.png" mode="aspectFit"></image>
|
src="/static/images/common/pauseActive.png" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="rightTxt">
|
<view class="rightTxt">
|
||||||
<text class="bigTxt">播放语音</text>
|
<text class="bigTxt">播放语音</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="mode fleft marginLeft" v-on:click.stop="audioManager(deviceInfo)">
|
<view class="mode fleft marginLeft" v-on:click.stop="audioManager(deviceInfo)">
|
||||||
<view class="leftImg">
|
<view class="leftImg">
|
||||||
<image class="img" src="/static/images/common/uploadCloud.png" mode="aspectFit"></image>
|
<image class="img" src="/static/images/common/uploadCloud.png" mode="aspectFit"></image>
|
||||||
@ -149,39 +148,33 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="header paddingTop0">
|
<view class="header paddingTop0">
|
||||||
<text class="sliderTxt">亮度</text>
|
<text class="sliderTxt">亮度</text>
|
||||||
<text class="sliderVal">{{ formData.sta_LightDimmer }}%</text>
|
<text class="sliderVal">{{ formData.lightBrightness }}%</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="slider-container">
|
<view class="slider-container">
|
||||||
<slider min="10" max="100" step="10" :disabled="false" :value="formData.sta_LightDimmer"
|
<slider min="10" max="100" step="10" :disabled="false" :value="formData.lightBrightness"
|
||||||
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
|
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
|
||||||
@change="onBrightnessChanging" @changing="onBrightnessChanging" class="custom-slider" />
|
@change="onBrightnessChanging" @changing="onBrightnessChanging" class="custom-slider" />
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="header paddingTop0">
|
<view class="header paddingTop0">
|
||||||
<text class="sliderTxt">频率</text>
|
<text class="sliderTxt">频率</text>
|
||||||
<text class="sliderVal">{{ formData.sta_LightFreq }}HZ</text>
|
<text class="sliderVal">{{ formData.strobeFrequency }}HZ</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="slider-container">
|
<view class="slider-container">
|
||||||
<slider min="0.5" max="10" step="0.5" :disabled="false" :value="formData.sta_LightFreq"
|
<slider min="0.5" max="10" step="0.5" :disabled="false" :value="formData.strobeFrequency"
|
||||||
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
|
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
|
||||||
@change="onFreqChanging" @changing="onFreqChanging" class="custom-slider" />
|
@change="onFreqChanging" @changing="onFreqChanging" class="custom-slider" />
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="header paddingTop0">
|
<view class="header paddingTop0">
|
||||||
<text class="sliderTxt">音量</text>
|
<text class="sliderTxt">音量</text>
|
||||||
<text class="sliderVal">{{ formData.sta_VoiceVolume }}</text>
|
<text class="sliderVal">{{ formData.volume }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="slider-container">
|
<view class="slider-container">
|
||||||
<slider min="1" max="8" step="1" :disabled="false" :value="formData.sta_VoiceVolume"
|
<slider min="10" max="100" step="1" :disabled="false" :value="formData.volume" activeColor="#bbe600"
|
||||||
activeColor="#bbe600" backgroundColor="#686767" block-size="20" block-color="#ffffffde"
|
backgroundColor="#686767" block-size="20" block-color="#ffffffde" @change="onVolumeChanging"
|
||||||
@change="onVolumeChanging" @changing="onVolumeChanging" class="custom-slider" />
|
@changing="onVolumeChanging" class="custom-slider" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="proinfo lamp">
|
<view class="proinfo lamp">
|
||||||
<text class="title">产品信息</text>
|
<text class="title">产品信息</text>
|
||||||
<view class="itemcontent">
|
<view class="itemcontent">
|
||||||
@ -202,7 +195,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 弹窗通知 -->
|
<!-- 弹窗通知 -->
|
||||||
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
|
<MessagePopup :visible="Status.Pop.showPop" :type="Status.Pop.popType" :bgColor="Status.Pop.bgColor"
|
||||||
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
|
:borderColor="Status.Pop.borderColor" :textColor="Status.Pop.textColor"
|
||||||
@ -219,6 +211,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import gbk from '@/utils/gbk.js'
|
import gbk from '@/utils/gbk.js'
|
||||||
|
import MqttClient from '@/utils/mqtt.js';
|
||||||
import {
|
import {
|
||||||
showLoading,
|
showLoading,
|
||||||
hideLoading,
|
hideLoading,
|
||||||
@ -228,7 +221,13 @@
|
|||||||
baseURL
|
baseURL
|
||||||
} from '@/utils/request.js';
|
} from '@/utils/request.js';
|
||||||
import {
|
import {
|
||||||
deviceDetail
|
deviceDetail,
|
||||||
|
deviceStrobeMode,
|
||||||
|
deviceForceAlarmActivation,
|
||||||
|
deviceStrobeFrequency,
|
||||||
|
deviceLightAdjustment,
|
||||||
|
deviceUpdateVolume,
|
||||||
|
deviceVoiceBroadcast
|
||||||
} from '@/api/100J/HBY100-J.js'
|
} from '@/api/100J/HBY100-J.js'
|
||||||
var these = null;
|
var these = null;
|
||||||
import Common from '@/utils/Common.js'
|
import Common from '@/utils/Common.js'
|
||||||
@ -236,6 +235,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
mqttClient: null,
|
||||||
Status: {
|
Status: {
|
||||||
isRightIconVisible: false,
|
isRightIconVisible: false,
|
||||||
navTitle: '',
|
navTitle: '',
|
||||||
@ -305,11 +305,11 @@
|
|||||||
macAddress: '',
|
macAddress: '',
|
||||||
bleStatu: false,
|
bleStatu: false,
|
||||||
sta_address: '',
|
sta_address: '',
|
||||||
sta_VoiceType: '',
|
sta_VoiceType: '0',
|
||||||
sta_VoiceVolume: 1,
|
volume: 10,
|
||||||
sta_LightType: '',
|
sta_LightType: '',
|
||||||
sta_LightFreq: 0.5,
|
strobeFrequency: 0.5,
|
||||||
sta_LightDimmer: 10,
|
lightBrightness: 10,
|
||||||
sta_system: '',
|
sta_system: '',
|
||||||
warnTime: 0,
|
warnTime: 0,
|
||||||
sta_SOSType: 0
|
sta_SOSType: 0
|
||||||
@ -321,8 +321,8 @@
|
|||||||
name: '消防',
|
name: '消防',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
"2": {
|
"0": {
|
||||||
key: "2",
|
key: "0",
|
||||||
name: '公安',
|
name: '公安',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
@ -336,8 +336,8 @@
|
|||||||
name: '市政',
|
name: '市政',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
"5": {
|
"2": {
|
||||||
key: "5",
|
key: "2",
|
||||||
name: '应急',
|
name: '应急',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
@ -346,60 +346,60 @@
|
|||||||
name: '医疗',
|
name: '医疗',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
"7": {
|
"5": {
|
||||||
key: "7",
|
key: "5",
|
||||||
name: '铁道',
|
name: '铁道',
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
"8": {
|
"7": {
|
||||||
key: "8",
|
key: "7",
|
||||||
name: 'app语音',
|
name: 'app语音',
|
||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
"0": {
|
"-1": {
|
||||||
key: "0",
|
key: "-1",
|
||||||
name: '关闭',
|
name: '关闭',
|
||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
sta_LightType: [{
|
sta_LightType: [{
|
||||||
key: "1",
|
|
||||||
name: '红蓝',
|
|
||||||
show: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "2",
|
|
||||||
name: '红闪',
|
|
||||||
show: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "3",
|
|
||||||
name: '黄闪',
|
|
||||||
show: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "4",
|
|
||||||
name: '蓝闪',
|
|
||||||
show: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "5",
|
|
||||||
name: '红流水',
|
|
||||||
show: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "6",
|
key: "6",
|
||||||
name: '黄流水',
|
name: '红蓝交替',
|
||||||
show: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "7",
|
|
||||||
name: '蓝流水',
|
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "0",
|
key: "0",
|
||||||
|
name: '红闪',
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "2",
|
||||||
|
name: '黄闪',
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "1",
|
||||||
|
name: '蓝闪',
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "3",
|
||||||
|
name: '红色顺时针',
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "4",
|
||||||
|
name: '黄色顺时针',
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "5",
|
||||||
|
name: '红蓝顺时针',
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "-1",
|
||||||
name: '关闭',
|
name: '关闭',
|
||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
@ -452,6 +452,7 @@
|
|||||||
these.Status.navTitle = data.data.deviceName;
|
these.Status.navTitle = data.data.deviceName;
|
||||||
these.Status.apiType = data.apiType;
|
these.Status.apiType = data.apiType;
|
||||||
these.Status.isRightIconVisible = these.Status.apiType === 'listA';
|
these.Status.isRightIconVisible = these.Status.apiType === 'listA';
|
||||||
|
|
||||||
if (data.apiType !== 'listA') {
|
if (data.apiType !== 'listA') {
|
||||||
Common.getdeviceShareId(data.data.id).then(res => {
|
Common.getdeviceShareId(data.data.id).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
@ -462,9 +463,24 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.mqttClient = new MqttClient();
|
||||||
|
// this.mqttClient.connect(() => {
|
||||||
|
// // 订阅来自设备的状态更新
|
||||||
|
// const statusTopic = `status/894078/HBY100/${data.data.deviceImei}`;
|
||||||
|
// this.mqttClient.subscribe(statusTopic, (payload) => {
|
||||||
|
// try {
|
||||||
|
// // 解析MQTT返回的payload
|
||||||
|
// const payloadObj = typeof payload === 'string' ? JSON.parse(
|
||||||
|
// payload) : payload;
|
||||||
|
// } catch (e) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
console.log(data, 'datatatatat');
|
console.log(data, 'datatatatat');
|
||||||
these.fetchDeviceDetail(data.data.id)
|
these.fetchDeviceDetail(data.data.id)
|
||||||
});
|
});
|
||||||
|
this.createThrottledFunctions();
|
||||||
|
|
||||||
},
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
@ -476,12 +492,36 @@
|
|||||||
computed: {
|
computed: {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
createThrottledFunctions() {
|
||||||
|
// 创建节流函数
|
||||||
|
this.throttledBrightnessChange = this.throttle(this.handleBrightnessChange, 500);
|
||||||
|
this.throttledFreqChange = this.throttle(this.handleFreqChange, 500);
|
||||||
|
this.throttledVolumeChange = this.throttle(this.handleVolumeChange, 500);
|
||||||
|
},
|
||||||
// 获取设备详情(普通详情)
|
// 获取设备详情(普通详情)
|
||||||
fetchDeviceDetail(id) {
|
fetchDeviceDetail(id) {
|
||||||
deviceDetail(id).then((res) => {
|
deviceDetail(id).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.deviceInfo = res.data
|
const validData = Object.fromEntries(
|
||||||
|
Object.entries(res.data).filter(([key, value]) => {
|
||||||
|
// 过滤规则:值为 null/undefined/0 的字段都不参与合并
|
||||||
|
return value !== null && value !== undefined && value !== 0;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
Object.assign(this.formData, validData);
|
||||||
|
this.deviceInfo = res.data;
|
||||||
|
// 0 红色爆闪,1 蓝色爆闪,2 黄色爆闪,3,红色顺时针旋转爆闪,4黄色顺时针旋转爆闪,5,红蓝顺时针旋转爆闪,6 红蓝交替爆闪
|
||||||
|
this.formData.sta_LightType = (res.data.strobeMode ?? 0) + ''
|
||||||
|
// 0爆闪关闭, 1爆闪开启
|
||||||
|
const strobeEnable = res.data.strobeEnable ?? 0;
|
||||||
|
this.formData.sta_LightType = strobeEnable === 1 ? 1 : -1;
|
||||||
|
if (res.data.alarmMode == 7) {
|
||||||
|
this.formData.sta_VoiceType = res.data.voiceStrobeAlarm ?? 0;
|
||||||
|
} else {
|
||||||
|
this.formData.sta_VoiceType = res.data.alarmMode + ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -502,9 +542,9 @@
|
|||||||
},
|
},
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
let json = {
|
let json = {
|
||||||
persissonType: '670'
|
persissonType: '100J'
|
||||||
};
|
};
|
||||||
|
Object.assign(json, this.deviceInfo);
|
||||||
res.eventChannel.emit('share', {
|
res.eventChannel.emit('share', {
|
||||||
data: json
|
data: json
|
||||||
});
|
});
|
||||||
@ -513,21 +553,11 @@
|
|||||||
},
|
},
|
||||||
// 语音管理
|
// 语音管理
|
||||||
audioManager(item) {
|
audioManager(item) {
|
||||||
|
this.formData.sta_VoiceType = -1
|
||||||
if (this.Status.apiType !== 'listA') {}
|
if (this.Status.apiType !== 'listA') {}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/100J/audioManager/AudioList',
|
url: '/pages/100J/audioManager/AudioList',
|
||||||
events: {
|
events: {},
|
||||||
audioApply: function(id) {
|
|
||||||
//应用某个语音时,将数据发送给设备
|
|
||||||
console.log("准备发送数据", id);
|
|
||||||
showLoading(these, {
|
|
||||||
text: '准备发送数据'
|
|
||||||
});
|
|
||||||
these.audioData.hexs = uni.getStorageSync(Common.pcmStorageKey + "_" + id);
|
|
||||||
console.log("hexs.length=", these.audioData.hexs.length)
|
|
||||||
these.HoldYouHand();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// 页面跳转成功后的回调函数
|
// 页面跳转成功后的回调函数
|
||||||
res.eventChannel.emit('deviceData', {
|
res.eventChannel.emit('deviceData', {
|
||||||
@ -538,18 +568,154 @@
|
|||||||
},
|
},
|
||||||
//频率
|
//频率
|
||||||
onFreqChanging(e) {
|
onFreqChanging(e) {
|
||||||
this.formData.sta_LightFreq = e.detail.value;
|
this.formData.strobeFrequency = e.detail.value;
|
||||||
|
this.throttledFreqChange(e.detail.value);
|
||||||
},
|
},
|
||||||
//音量
|
//音量
|
||||||
onVolumeChanging(e) {
|
onVolumeChanging(e) {
|
||||||
this.formData.sta_VoiceVolume = e.detail.value;
|
this.formData.volume = e.detail.value;
|
||||||
|
this.throttledVolumeChange(e.detail.value);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 亮度调节
|
// 亮度调节
|
||||||
onBrightnessChanging(e) {
|
onBrightnessChanging(e) {
|
||||||
this.formData.sta_LightDimmer = e.detail.value;
|
this.formData.lightBrightness = e.detail.value;
|
||||||
|
this.throttledBrightnessChange(e.detail.value);
|
||||||
},
|
},
|
||||||
|
// 亮度调节
|
||||||
|
handleBrightnessChange(brightnessValue) {
|
||||||
|
let data = {
|
||||||
|
deviceId: this.deviceInfo.deviceId,
|
||||||
|
brightness: brightnessValue
|
||||||
|
};
|
||||||
|
console.log('发送亮度调节请求:', data);
|
||||||
|
deviceLightAdjustment(data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
console.log('亮度调节成功');
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg || '调节失败',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 频率调节
|
||||||
|
handleFreqChange(freqValue) {
|
||||||
|
let data = {
|
||||||
|
deviceId: this.deviceInfo.deviceId,
|
||||||
|
frequency: freqValue
|
||||||
|
};
|
||||||
|
|
||||||
|
deviceStrobeFrequency(data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg || '调节失败',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((err) => {});
|
||||||
|
},
|
||||||
|
// 音量调节处理函数
|
||||||
|
handleVolumeChange(volumeValue) {
|
||||||
|
let data = {
|
||||||
|
deviceId: this.deviceInfo.deviceId,
|
||||||
|
volume: volumeValue
|
||||||
|
};
|
||||||
|
deviceUpdateVolume(data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((err) => {});
|
||||||
|
},
|
||||||
|
// 节流函数
|
||||||
|
throttle(func, delay = 500) {
|
||||||
|
let timer = null;
|
||||||
|
let lastArgs = null;
|
||||||
|
let lastThis = null;
|
||||||
|
return function(...args) {
|
||||||
|
lastArgs = args;
|
||||||
|
lastThis = this;
|
||||||
|
if (!timer) {
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
timer = null;
|
||||||
|
func.apply(lastThis, lastArgs);
|
||||||
|
}, delay);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
},
|
||||||
|
// *******定位******
|
||||||
|
gpsPosition(item) {
|
||||||
|
// 添加调试日志
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/common/map/index',
|
||||||
|
events: {
|
||||||
|
ack: function(data) {}
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
res.eventChannel.emit('Map', {
|
||||||
|
data: item
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 警示灯开关闭
|
||||||
lightTypeSet(item, index) {
|
lightTypeSet(item, index) {
|
||||||
this.formData.sta_LightType = item.key;
|
let val = item.key;
|
||||||
|
// 切换选中/取消选中逻辑
|
||||||
|
if (this.formData.sta_LightType === val) {
|
||||||
|
val = '-1';
|
||||||
|
}
|
||||||
|
this.formData.sta_LightType = val;
|
||||||
|
let data = {
|
||||||
|
deviceId: this.deviceInfo.deviceId,
|
||||||
|
// 开启/关闭:选中模式时传1,关闭时传0
|
||||||
|
enable: val === '-1' ? 0 : 1,
|
||||||
|
// 0 红色爆闪,1 蓝色爆闪,2 黄色爆闪,3,红色顺时针旋转爆闪,4黄色顺时针旋转爆闪,5,红蓝顺时针旋转爆闪,6 红蓝交替爆闪
|
||||||
|
mode: item.key
|
||||||
|
};
|
||||||
|
deviceStrobeMode(data).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
const tipText = data.enable === 1 ? '开启成功' : '关闭成功';
|
||||||
|
uni.showToast({
|
||||||
|
title: tipText,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 报警模式
|
// 报警模式
|
||||||
setUsrToggle() {
|
setUsrToggle() {
|
||||||
@ -557,22 +723,48 @@
|
|||||||
},
|
},
|
||||||
// 播放语音
|
// 播放语音
|
||||||
openVolume(item, index) {
|
openVolume(item, index) {
|
||||||
if (item) {
|
if (!item) {
|
||||||
console.log(item.key, 'keyyy');
|
item = this.dic.sta_VoiceType[index];
|
||||||
this.formData.sta_VoiceType = item.key;
|
|
||||||
} else if (index === '8') { // 点击“播放语音”的场景
|
|
||||||
this.formData.sta_VoiceType = '8';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
let val = item.key;
|
||||||
|
if (this.formData.sta_VoiceType === val) {
|
||||||
|
val = '-1';
|
||||||
|
}
|
||||||
|
this.formData.sta_VoiceType = val;
|
||||||
|
console.log(this.formData.sta_VoiceType, 'this.formData.sta_VoiceType')
|
||||||
|
// 模式类型为7时才去判断
|
||||||
|
if (val === '7' || val === '-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'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 报警模式
|
// 报警模式
|
||||||
sosSetting(item) {
|
sosSetting(item) {
|
||||||
|
console.log(this.deviceInfo, '44444');
|
||||||
|
console.log(item, 'tent');
|
||||||
const isClose = item === 0;
|
const isClose = item === 0;
|
||||||
if (!this.Status) this.Status = {};
|
if (!this.Status) this.Status = {};
|
||||||
if (!this.Status.Pop) this.Status.Pop = {
|
if (!this.Status.Pop) this.Status.Pop = {
|
||||||
showPop: false
|
showPop: false
|
||||||
};
|
};
|
||||||
//弹窗配置
|
|
||||||
|
// 弹窗配置
|
||||||
this.Status.Pop = {
|
this.Status.Pop = {
|
||||||
...this.Status.Pop,
|
...this.Status.Pop,
|
||||||
showPop: true,
|
showPop: true,
|
||||||
@ -583,10 +775,31 @@
|
|||||||
showCancel: true,
|
showCancel: true,
|
||||||
buttonCancelText: '取消',
|
buttonCancelText: '取消',
|
||||||
okCallback: () => {
|
okCallback: () => {
|
||||||
this.formData.sta_SOSType = item;
|
console.log(this.formData.sta_SOSType, 'this.formData.sta_SOSType');
|
||||||
uni.showToast({
|
this.formData.sta_SOSType = isClose ? 0 : 1;
|
||||||
title: isClose ? '声光报警已解除' : '强制报警已开启',
|
const data = {
|
||||||
icon: 'none'
|
deviceIds: [this.deviceInfo.deviceId],
|
||||||
|
// 声光报警开关:关闭传0,开启传1
|
||||||
|
voiceStrobeAlarm: isClose ? 0 : 1,
|
||||||
|
mode: this.formData.sta_VoiceType
|
||||||
|
};
|
||||||
|
deviceForceAlarmActivation(data).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: isClose ? '声光报警已解除' : '强制报警已开启',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请求失败,请重试',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -597,7 +810,6 @@
|
|||||||
bleStateBreak() {},
|
bleStateBreak() {},
|
||||||
bleStateRecovry() {},
|
bleStateRecovry() {},
|
||||||
previewImg(img) {},
|
previewImg(img) {},
|
||||||
|
|
||||||
bleValueNotify: function(receive, device, path, recArr) { //订阅消息
|
bleValueNotify: function(receive, device, path, recArr) { //订阅消息
|
||||||
if (receive.deviceId !== this.formData.deviceId) {
|
if (receive.deviceId !== this.formData.deviceId) {
|
||||||
return;
|
return;
|
||||||
@ -792,14 +1004,14 @@
|
|||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
background: rgba(26, 26, 26, 1);
|
background: rgba(26, 26, 26, 1);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 14rpx 0rpx;
|
padding: 15rpx 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.eqinfo .item {
|
.eqinfo .item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
padding: 0rpx 28rpx;
|
/* padding: 0rpx 28rpx; */
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@ -824,11 +1036,18 @@
|
|||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
||||||
letter-spacing: 0.07px;
|
letter-spacing: 0.07px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.eqinfo .info-value {
|
||||||
|
/* margin-top: 30rpx; */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .eqinfo .status-running {
|
||||||
|
color: rgba(174, 214, 0, 1);
|
||||||
|
} */
|
||||||
|
|
||||||
.lamp {
|
.lamp {
|
||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
}
|
}
|
||||||
@ -1530,4 +1749,32 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
|
.info-row {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-label {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: rgba(255, 255, 255, 0.87);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: rgba(255, 255, 255, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-running {
|
||||||
|
/* color: rgba(255, 255, 255, 0.6); */
|
||||||
|
text-align: end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locationGPS {
|
||||||
|
width: 88%;
|
||||||
|
text-align: end;
|
||||||
|
float: right;
|
||||||
|
line-height: 45rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -4,31 +4,33 @@
|
|||||||
:down="downOption" :fixed="false" :style="{ height: mescrollHeight + 'px' }">
|
:down="downOption" :fixed="false" :style="{ height: mescrollHeight + 'px' }">
|
||||||
<uni-swipe-action ref="swipeAction">
|
<uni-swipe-action ref="swipeAction">
|
||||||
<view v-for="(item, index) in dataListA" class="li" :key="index" :ref="'swipeItem_' + index">
|
<view v-for="(item, index) in dataListA" class="li" :key="index" :ref="'swipeItem_' + index">
|
||||||
<view class="itemIcon center" :class="{'displayNone':!Status.isEdit,'check':isCheck(item,index)}"
|
<view class="itemIcon center"
|
||||||
v-on:click.stop="checkToggle(item,index)">
|
:class="{ 'displayNone': !Status.isEdit, 'check': isCheck(item, index) }"
|
||||||
<image class="img" :class="{'displayNone':!isCheck(item,index)}"
|
v-on:click.stop="checkToggle(item, index)">
|
||||||
|
<image class="img" :class="{ 'displayNone': !isCheck(item, index) }"
|
||||||
src="/static/images/common/gou.png" mode="aspectFit"></image>
|
src="/static/images/common/gou.png" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="itemMain " :class="{'Edit':Status.isEdit}">
|
<view class="itemMain " :class="{ 'Edit': Status.isEdit }">
|
||||||
<uni-swipe-action-item :right-options="Options" @click="handleSwipeClick($event, item, index)"
|
<uni-swipe-action-item :right-options="Options" @click="handleSwipeClick($event, item, index)"
|
||||||
class="device-card ">
|
class="device-card ">
|
||||||
<view @click.stop="handleFile(item,index)">
|
<view @click.stop="handleFile(item, index)">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="itemLeft ">
|
<view class="itemLeft ">
|
||||||
<view class="title">{{ item.fileNameExt }}</view>
|
<view class="title">{{ item.fileNameExt }}</view>
|
||||||
<view class="smallTitle">
|
<view class="smallTitle">
|
||||||
<!-- 展示前端生成的时间 -->
|
<!-- 展示前端生成的时间 -->
|
||||||
<text>{{item.createTime || Common.DateFormat(new Date(), "yyyy年MM月dd日")}}</text>
|
<text>{{ item.createTime || Common.DateFormat(new Date(),
|
||||||
<text v-show="item.duration">{{item.duration}}秒</text>
|
"yyyy年MM月dd日") }}</text>
|
||||||
<image :class="{'displayNone':!item.fileUrl}" class="img"
|
<text v-show="item.duration">{{ item.duration }}秒</text>
|
||||||
|
<image :class="{ 'displayNone': !item.fileUrl }" class="img"
|
||||||
src="/static/images/100/volume.png" mode="aspectFit"
|
src="/static/images/100/volume.png" mode="aspectFit"
|
||||||
@click.stop="play(item,index)"></image>
|
@click.stop="play(item, index)"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="itemRight ">
|
<view class="itemRight ">
|
||||||
<view class="btn" @click.stop="Apply(item,index)"
|
<view class="btn" @click.stop="Apply(item, index)"
|
||||||
:class="{'active':item.isApply,'btn-default':!item.isApply}">
|
:class="{ 'active': item.useStatus, 'btn-default': !item.useStatus }">
|
||||||
{{item.isApply ?'使用中':'使用'}}
|
{{ item.useStatus == 1 ? '使用中' : '使用' }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="clear"></view>
|
<view class="clear"></view>
|
||||||
@ -40,7 +42,7 @@
|
|||||||
</uni-swipe-action>
|
</uni-swipe-action>
|
||||||
</mescroll-uni>
|
</mescroll-uni>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<view class="addContent" :class="{'displayNone':Status.isEdit}">
|
<view class="addContent" :class="{ 'displayNone': Status.isEdit }">
|
||||||
<view class="addItem" @click="gotoRecord('Record')">
|
<view class="addItem" @click="gotoRecord('Record')">
|
||||||
<view class="imgContent center">
|
<view class="imgContent center">
|
||||||
<image class="img" src="/static/images/100/record.png" mode="aspectFit"></image>
|
<image class="img" src="/static/images/100/record.png" mode="aspectFit"></image>
|
||||||
@ -60,7 +62,7 @@
|
|||||||
<view class="txt">文字转语音</view>
|
<view class="txt">文字转语音</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="editContent" :class="{'displayNone':!Status.isEdit}">
|
<view class="editContent" :class="{ 'displayNone': !Status.isEdit }">
|
||||||
<view class="btn-del" @click.stop="delCheckList()">删除</view>
|
<view class="btn-del" @click.stop="delCheckList()">删除</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -80,6 +82,12 @@
|
|||||||
<audio :src="cPlay.src" :id="cPlay.Id" :name="cPlay.name" author="">
|
<audio :src="cPlay.src" :id="cPlay.Id" :name="cPlay.name" author="">
|
||||||
</view> -->
|
</view> -->
|
||||||
<global-loading ref="loading"></global-loading>
|
<global-loading ref="loading"></global-loading>
|
||||||
|
<!-- 圆形进度条 + 全屏遮罩层(升级中显示) -->
|
||||||
|
<view v-if="isUpdating" class="mask-layer">
|
||||||
|
<view class="circle-progress-box">
|
||||||
|
<progress :percent="updateProgress" activeColor="#bbe600" backgroundColor="#686767" :border-radius='22' show-info stroke-width="15" class="custom-progress" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -91,10 +99,12 @@
|
|||||||
var timeout = null;
|
var timeout = null;
|
||||||
import MescrollUni from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-uni.vue'
|
import MescrollUni from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-uni.vue'
|
||||||
import BleTool from '@/utils/BleHelper.js'
|
import BleTool from '@/utils/BleHelper.js'
|
||||||
|
import MqttClient from '@/utils/mqtt.js';
|
||||||
import {
|
import {
|
||||||
deviceVoliceList,
|
deviceVoliceList,
|
||||||
videRenameAudioFile,
|
videRenameAudioFile,
|
||||||
deviceDeleteAudioFile
|
deviceDeleteAudioFile,
|
||||||
|
deviceUpdateVoice
|
||||||
} from '@/api/100J/HBY100-J.js'
|
} from '@/api/100J/HBY100-J.js'
|
||||||
import {
|
import {
|
||||||
showLoading,
|
showLoading,
|
||||||
@ -113,6 +123,7 @@
|
|||||||
isEdit: false,
|
isEdit: false,
|
||||||
playState: '',
|
playState: '',
|
||||||
playPath: '',
|
playPath: '',
|
||||||
|
mqttClient: null,
|
||||||
Pop: {
|
Pop: {
|
||||||
showPop: false, //是否显示弹窗
|
showPop: false, //是否显示弹窗
|
||||||
popType: 'custom',
|
popType: 'custom',
|
||||||
@ -185,9 +196,6 @@
|
|||||||
createTime: "", //创建时间
|
createTime: "", //创建时间
|
||||||
fileUrl: "", //本地地址
|
fileUrl: "", //本地地址
|
||||||
fileUrl: "", //网络地址
|
fileUrl: "", //网络地址
|
||||||
statu: "", //状态,是否公开
|
|
||||||
isApply: "" //是否使用中
|
|
||||||
|
|
||||||
},
|
},
|
||||||
cPlay: {
|
cPlay: {
|
||||||
Id: "", //编号
|
Id: "", //编号
|
||||||
@ -195,9 +203,10 @@
|
|||||||
createTime: "", //创建时间
|
createTime: "", //创建时间
|
||||||
fileUrl: "", //本地地址
|
fileUrl: "", //本地地址
|
||||||
fileUrl: "", //网络地址
|
fileUrl: "", //网络地址
|
||||||
statu: "", //状态,是否公开
|
},
|
||||||
isApply: "" //是否使用中
|
updateProgress: 0, // 升级进度,0-100
|
||||||
}
|
isUpdating: false, // 是否正在升级(控制进度条显示/隐藏)
|
||||||
|
mqttSubscribeSuccess: false // MQTT订阅是否成功
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@ -208,7 +217,7 @@
|
|||||||
console.log(rec, 'ressss');
|
console.log(rec, 'ressss');
|
||||||
this.blue = rec.ble;
|
this.blue = rec.ble;
|
||||||
this.device = rec.data;
|
this.device = rec.data;
|
||||||
this.getinitData(rec.data.deviceId,true)
|
this.getinitData(rec.data.deviceId, true)
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -216,11 +225,14 @@
|
|||||||
console.log("页面返回")
|
console.log("页面返回")
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
console.log("页面卸载了");
|
// 页面卸载时断开MQTT连接
|
||||||
|
if (this.mqttClient) {
|
||||||
|
this.mqttClient.disconnect();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//语音管理列表
|
//语音管理列表
|
||||||
getinitData(val,isLoadMore = false) {
|
getinitData(val, isLoadMore = false) {
|
||||||
let data = {
|
let data = {
|
||||||
deviceId: this.device.deviceId
|
deviceId: this.device.deviceId
|
||||||
}
|
}
|
||||||
@ -456,41 +468,72 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Apply(item, index) {
|
Apply(item, index) {
|
||||||
if (item.isApply) {
|
this.mqttClient = new MqttClient();
|
||||||
return;
|
this.updateProgress = 0;
|
||||||
|
this.isUpdating = true;
|
||||||
|
let data = {
|
||||||
|
id: item.id
|
||||||
}
|
}
|
||||||
let task = () => {
|
deviceUpdateVoice(data).then((RES) => {
|
||||||
let fileList = uni.getStorageSync(Common.audioStorageKey);
|
if (RES.code == 200) {
|
||||||
for (let i = 0; i < these.dataListA.length; i++) {
|
this.updateProgress = 0;
|
||||||
let ele = these.dataListA[i];
|
this.isUpdating = true;
|
||||||
if (i === index) {
|
this.mqttClient.connect(() => {
|
||||||
these.$set(these.dataListA[index], "isApply", true);
|
// 订阅来自设备的状态更新
|
||||||
fileList.find(v => {
|
const statusTopic = `status/894078/HBY100/${this.device.deviceImei}`;
|
||||||
if (!v.devices) {
|
this.mqttClient.subscribe(statusTopic, (payload) => {
|
||||||
v.devices = [];
|
console.log(payload, 'payloadpayloadpayload');
|
||||||
}
|
try {
|
||||||
if (v.Id == ele.Id) {
|
// 解析MQTT返回的payload
|
||||||
v.devices.push(these.device.id);
|
const payloadObj = typeof payload === 'string' ? JSON.parse(
|
||||||
return true;
|
payload) : payload;
|
||||||
} else {
|
// 取出进度值(用可选链避免字段不存在报错)
|
||||||
for (let j = 0; j < v.devices.length; j++) {
|
const progress = payloadObj.data?.progress;
|
||||||
if (v.devices[j] === these.device.id) {
|
if (progress !== undefined && !isNaN(progress) && progress >=
|
||||||
v.devices.splice(j, 1);
|
0 && progress <= 100) {
|
||||||
break
|
this.updateProgress = progress;
|
||||||
};
|
console.log('当前升级进度:', progress + '%');
|
||||||
|
// 进度到100%时,触发升级完成逻辑
|
||||||
|
if (progress === 100) {
|
||||||
|
clearTimeout(this.upgradeTimer);
|
||||||
|
uni.showToast({
|
||||||
|
title: '升级完成!',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
this.isUpdating = false;
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack();
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
clearTimeout(this.upgradeTimer);
|
||||||
|
console.error('解析MQTT payload失败:', e);
|
||||||
}
|
}
|
||||||
return false;
|
})
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
these.$set(these.dataListA[i], "isApply", false);
|
uni.showToast({
|
||||||
}
|
title: RES.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
console.log("状态修改完成");
|
})
|
||||||
eventChannel.emit('audioApply', item.Id);
|
this.upgradeTimer = setTimeout(() => {
|
||||||
console.log("返回上一页");
|
// 超时后执行:隐藏进度条+提示超时+重置进度
|
||||||
uni.navigateBack();
|
uni.showToast({
|
||||||
}
|
title: '升级进度同步超时',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
this.isUpdating = false; // 关闭进度条
|
||||||
|
this.updateProgress = 0; // 重置进度值
|
||||||
|
// 可选:如果需要取消MQTT订阅,加这行(根据需求选择)
|
||||||
|
// this.mqttClient.unsubscribe(statusTopic);
|
||||||
|
}, 6000); // 6000ms = 6秒,时间可直接修改
|
||||||
},
|
},
|
||||||
closePop: function() {
|
closePop: function() {
|
||||||
this.Status.Pop.showPop = false;
|
this.Status.Pop.showPop = false;
|
||||||
@ -596,7 +639,18 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="less">
|
||||||
|
.custom-progress{
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
.custom-progress .uni-progress-bar{
|
||||||
|
border-radius: 10rpx !important;
|
||||||
|
}
|
||||||
|
.custom-progress .uni-progress-info{
|
||||||
|
color: #BBE600;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
.popup-prompt {
|
.popup-prompt {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 40rpx;
|
margin-top: 40rpx;
|
||||||
@ -633,8 +687,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.li .itemMain {}
|
|
||||||
|
|
||||||
.li .item {
|
.li .item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
@ -837,4 +889,28 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 全屏遮罩层:半透明黑色,覆盖整个页面,禁止底层滚动/点击 */
|
||||||
|
.mask-layer {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
|
/* 半透明黑,可调整透明度 */
|
||||||
|
z-index: 9999;
|
||||||
|
/* 遮罩层层级拉满,确保在最上层 */
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
/* 让内部圆形进度条垂直+水平居中 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 圆形进度条容器 */
|
||||||
|
.circle-progress-box {
|
||||||
|
position: relative;
|
||||||
|
width: 70%;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -55,12 +55,19 @@
|
|||||||
import {
|
import {
|
||||||
deviceInfo,
|
deviceInfo,
|
||||||
} from '@/api/common/index.js'
|
} from '@/api/common/index.js'
|
||||||
|
// 1. 导入所有需要的报警接口
|
||||||
import {
|
import {
|
||||||
deviceSendAlarmMessage
|
deviceSendAlarmMessage, //6170对应类型接口
|
||||||
|
deviceDefaultAlarm
|
||||||
} from '@/api/6170/callPolice.js'
|
} from '@/api/6170/callPolice.js'
|
||||||
|
import {
|
||||||
|
deviceForceAlarmActivation
|
||||||
|
} from '@/api/100J/HBY100-J.js'
|
||||||
|
// BJQ100J 对应的接口
|
||||||
import {
|
import {
|
||||||
deviceRealTimeStatus //设备状态
|
deviceRealTimeStatus //设备状态
|
||||||
} from '@/api/6170/deviceControl.js'
|
} from '@/api/6170/deviceControl.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
CustomPopup
|
CustomPopup
|
||||||
@ -74,12 +81,34 @@
|
|||||||
popupConfirmText: '确认',
|
popupConfirmText: '确认',
|
||||||
popupType: 'force', // 'force' or 'cancel'
|
popupType: 'force', // 'force' or 'cancel'
|
||||||
pendingAlarmAction: '',
|
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: {
|
computed: {
|
||||||
selectedDeviceIds() {
|
selectedDeviceIds() {
|
||||||
return this.deviceList.filter(item => item.checked).map(item => item.id);
|
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: {
|
methods: {
|
||||||
@ -93,15 +122,19 @@
|
|||||||
// 全选/取消全选
|
// 全选/取消全选
|
||||||
selectAll() {
|
selectAll() {
|
||||||
console.log('123');
|
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 => {
|
this.deviceList.forEach(item => {
|
||||||
item.checked = !allSelected;
|
// 离线设备不修改checked状态
|
||||||
|
if (item.onlineStatus === 1) {
|
||||||
|
item.checked = !allSelected;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
// 获取设备列表
|
// 获取设备列表
|
||||||
getData(deviceType) {
|
getData(deviceType) {
|
||||||
|
console.log(deviceType, 'deviceTypedeviceType');
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let data = {
|
let data = {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -127,7 +160,7 @@
|
|||||||
const selectedDevices = this.deviceList.filter(item => item.checked)
|
const selectedDevices = this.deviceList.filter(item => item.checked)
|
||||||
if (selectedDevices.length === 0) {
|
if (selectedDevices.length === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择一个设备',
|
title: '请选择一个在线设备',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -136,14 +169,13 @@
|
|||||||
this.popupMessage = '确认要对所选设备开启强制报警?';
|
this.popupMessage = '确认要对所选设备开启强制报警?';
|
||||||
this.showPopupFlag = true;
|
this.showPopupFlag = true;
|
||||||
this.pendingAlarmAction = 1
|
this.pendingAlarmAction = 1
|
||||||
|
|
||||||
},
|
},
|
||||||
// 解除报警
|
// 解除报警
|
||||||
cancelAlarm() {
|
cancelAlarm() {
|
||||||
const selectedDevices = this.deviceList.filter(item => item.checked);
|
const selectedDevices = this.deviceList.filter(item => item.checked);
|
||||||
if (selectedDevices.length === 0) {
|
if (selectedDevices.length === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择一个设备',
|
title: '请选择一个在线设备',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -153,61 +185,61 @@
|
|||||||
this.showPopupFlag = true;
|
this.showPopupFlag = true;
|
||||||
this.pendingAlarmAction = 0
|
this.pendingAlarmAction = 0
|
||||||
},
|
},
|
||||||
// 确认
|
//动态调用对应接口
|
||||||
async sendAlarmCommand() {
|
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);
|
||||||
const isAlarming = this.pendingAlarmAction == 1;
|
const isAlarming = this.pendingAlarmAction == 1;
|
||||||
|
if (selectedDevices.length === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请选择在线设备',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: isAlarming ? '设备报警中...' : '解除报警中...',
|
title: isAlarming ? '设备报警中...' : '解除报警中...',
|
||||||
mask: true
|
mask: true
|
||||||
});
|
});
|
||||||
// 2. 准备请求数据
|
// 获取当前typeName对应的接口和参数配置
|
||||||
const batchId = generateShortId();
|
const {
|
||||||
const data = {
|
sendApi,
|
||||||
deviceIds: deviceIds,
|
statusTypeName
|
||||||
|
} = this.currentApiConfig;
|
||||||
|
// 准备请求数据
|
||||||
|
// const batchId = generateShortId();
|
||||||
|
const requestData = {
|
||||||
|
deviceIds: deviceIds,
|
||||||
typeName: this.sendInfo.typeName,
|
typeName: this.sendInfo.typeName,
|
||||||
deviceImeiList: deviceImeiList,
|
deviceImeiList: deviceImeiList,
|
||||||
batchId: batchId,
|
// batchId: batchId,
|
||||||
instructValue: this.pendingAlarmAction == 1 ? '1' : '0'
|
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({
|
uni.showToast({
|
||||||
title: registerRes.msg,
|
title: isAlarming ? '强制报警开启成功' : '报警已解除',
|
||||||
icon: 'none'
|
icon: 'success'
|
||||||
})
|
|
||||||
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'
|
|
||||||
});
|
});
|
||||||
this.showPopupFlag = false
|
this.showPopupFlag = false
|
||||||
uni.$emit('deviceStatusUpdate', {});
|
uni.$emit('deviceStatusUpdate', {});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 500)
|
}, 500)
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: registerRes.msg || '状态查询失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error('报警操作异常:', error);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: error.message,
|
title: '网络异常,请重试',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
@ -217,7 +249,6 @@
|
|||||||
// 点击确认状态
|
// 点击确认状态
|
||||||
onPopupConfirm() {
|
onPopupConfirm() {
|
||||||
this.sendAlarmCommand(this.popupType);
|
this.sendAlarmCommand(this.popupType);
|
||||||
// 处理确认逻辑
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
@ -227,7 +258,6 @@
|
|||||||
this.getData(data.data.id)
|
this.getData(data.data.id)
|
||||||
this.sendInfo = data.data
|
this.sendInfo = data.data
|
||||||
});
|
});
|
||||||
// 如果需要向调用页面返回数据,可以触发 'ack' 事件
|
|
||||||
eventChannel.emit('ack', {})
|
eventChannel.emit('ack', {})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -236,7 +266,7 @@
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.container {
|
.container {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color:rgb(18, 18, 18);
|
background-color: rgb(18, 18, 18);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
|
||||||
|
|||||||
@ -18,11 +18,11 @@
|
|||||||
<image src="/static/images/common/more.png" mode="aspectFit" class="more"></image>
|
<image src="/static/images/common/more.png" mode="aspectFit" class="more"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="sendFlex" v-if="activeTab && activeTab.id !== ''&& activeTabInfo.communicationMode==0 || activeTabInfo.communicationMode==2">
|
<!-- <view class="sendFlex" v-if="activeTab && activeTab.id !== ''&& activeTabInfo.communicationMode==0 || activeTabInfo.communicationMode==2">
|
||||||
<view class="callpolice" @click="callpolice">报警</view>
|
<view class="callpolice" @click="callpolice">报警</view>
|
||||||
<view class="Sendmessage" @click="location">位置</view>
|
<view class="Sendmessage" @click="location">位置</view>
|
||||||
<view class="Sendmessage" @click="handleSend">发送信息</view>
|
<view class="Sendmessage" @click="handleSend" v-if="activeTabInfo.typeName!=='HBY100-J'">发送信息</view>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- <scroll-view class="device-list" scroll-y @scrolltolower="onScrollToLower" :lower-threshold="100" style="height:80vh;"> -->
|
<!-- <scroll-view class="device-list" scroll-y @scrolltolower="onScrollToLower" :lower-threshold="100" style="height:80vh;"> -->
|
||||||
<mescroll-uni class="device-list" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption"
|
<mescroll-uni class="device-list" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption"
|
||||||
:down="downOption" :fixed="false" :style="{ height: mescrollHeight + 'px' }">
|
:down="downOption" :fixed="false" :style="{ height: mescrollHeight + 'px' }">
|
||||||
|
|||||||
@ -307,21 +307,21 @@ export default {
|
|||||||
value: "50",
|
value: "50",
|
||||||
label: "报警模式",
|
label: "报警模式",
|
||||||
checked: false,
|
checked: false,
|
||||||
type: ['100']
|
type: ['100','100J']
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
value: "51",
|
value: "51",
|
||||||
label: "警示灯",
|
label: "警示灯",
|
||||||
checked: false,
|
checked: false,
|
||||||
type: ['100']
|
type: ['100','100J']
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
value: "52",
|
value: "52",
|
||||||
label: "语音管理",
|
label: "语音管理",
|
||||||
checked: false,
|
checked: false,
|
||||||
type: ['100']
|
type: ['100','100J']
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -342,6 +342,12 @@ export default {
|
|||||||
checked: false,
|
checked: false,
|
||||||
type: ['4877']
|
type: ['4877']
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: "56",
|
||||||
|
label: "灯光类型设置",
|
||||||
|
checked: false,
|
||||||
|
type: ['100J']
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
let arr = [];
|
let arr = [];
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import config from '../config/index.js';
|
import config from '../config/index.js';
|
||||||
export const env = 'development'; //production development //开发of线上 改这里就行
|
export const env = 'production'; //production development //开发of线上 改这里就行
|
||||||
const BASE = config[env];
|
const BASE = config[env];
|
||||||
const request = (options) => {
|
const request = (options) => {
|
||||||
console.log("options" + JSON.stringify(options), BASE.BASE_URL)
|
console.log("options" + JSON.stringify(options), BASE.BASE_URL)
|
||||||
@ -22,7 +22,7 @@ const request = (options) => {
|
|||||||
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(options.data[key])}`)
|
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(options.data[key])}`)
|
||||||
.join('&');
|
.join('&');
|
||||||
url += `?${params}`;
|
url += `?${params}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
url: url,
|
url: url,
|
||||||
|
|||||||
Reference in New Issue
Block a user