merge upstream

This commit is contained in:
2025-11-10 17:28:29 +08:00
6 changed files with 1491 additions and 1393 deletions

62
api/6075/6075.js Normal file
View File

@ -0,0 +1,62 @@
import request from '@/utils/request'
export function deviceDetail(id) {
return request({
url: `/app/bjq6075/device/${id}`,
method: 'get',
})
}
// 获取设备分享详细信息
export function deviceShareId(id) {
return request({
url: `/app/bjq6075/device/getShareInfo/${id}`,
method: 'get',
})
}
// 人员信息登记
export function registerPersonInfo(data) {
return request({
url: `/app/bjq6075/device/registerPersonInfo`,
method: 'post',
data: data
})
}
// 发送信息
export function deviceSendMessage(data) {
return request({
url: `/app/bjq6075/device/sendMessage`,
method: 'post',
data: data
})
}
// 灯光模式设置
export function lightModeSettings(data) {
return request({
url: `/app/bjq6075/device/lightModeSettings`,
method: 'post',
data: data
})
}
// 激光模式设置
export function laserModeSettings(data) {
return request({
url: `/app/bjq6075/device/laserModeSettings`,
method: 'post',
data: data
})
}
// 灯光亮度设置
export function lightBrightnessSettings(data) {
return request({
url: `/app/bjq6075/device/lightBrightnessSettings`,
method: 'post',
data: data
})
}
// 地图逆解析
export function mapReverseGeocoding(data) {
return request({
url: `/app/bjq6075/device/mapReverseGeocoding`,
method: 'post',
data: data
})
}

View File

@ -2,7 +2,7 @@
const config = { const config = {
// 开发环境 // 开发环境
development: { development: {
BASE_URL: 'http://192.168.110.56:8000', BASE_URL: 'http://192.168.2.23:8000',
API_PREFIX: '', API_PREFIX: '',
// MQTT 配置 // MQTT 配置
MQTT_HOST: 'www.cnxhyc.com', MQTT_HOST: 'www.cnxhyc.com',

View File

@ -8,7 +8,7 @@
<custom-navbar :title="navTitle" :showBack="true" color="#FFFFFF" :rightIcons="[ <custom-navbar :title="navTitle" :showBack="true" color="#FFFFFF" :rightIcons="[
{src: '/static/images/210/ls.png'}, {src: '/static/images/210/ls.png'},
...(isRightIconVisible ? [{src: '/static/images/common/shape.png'}] : []) ...(isRightIconVisible ? [{src: '/static/images/common/shape.png'}] : [])
]" @right-click="shareUp" @icon-click="handleIconClick"></custom-navbar> ]" @icon-click="handleIconClick"></custom-navbar>
<view class="device-detail-container" :style="{ paddingTop: navBarHeight + 'px' }"> <view class="device-detail-container" :style="{ paddingTop: navBarHeight + 'px' }">
<!-- 设备电量信息 --> <!-- 设备电量信息 -->
@ -40,28 +40,29 @@
<view class="info-card"> <view class="info-card">
<view class="info-row"> <view class="info-row">
<text class="info-label">IMEI号</text> <text class="info-label">IMEI号</text>
<text class="info-value status-running">123488756</text> <text class="info-value status-running">{{deviceInfo.deviceImei}}</text>
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="info-label">设备状态</text> <text class="info-label">设备状态</text>
<text class="info-value status-running">运行中</text> <text class="info-value status-running">{{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus === 2 ? '故障' : '在线' }}</text>
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="info-label">定位信息</text> <text class="info-label">定位信息</text>
<view class="info-value status-running" @click="gpsPosition"> <view class="info-value status-running" @click="gpsPosition">
<view class="info-value status-running">114.72 30.28</view> <view class="info-value status-running"> {{ deviceInfo && deviceInfo.longitude ? Number(deviceInfo.longitude).toFixed(4) : '' }}
{{ deviceInfo && deviceInfo.latitude ? Number(deviceInfo.latitude).toFixed(4) : '' }}</view>
<view class="info-value status-running"> <view class="info-value status-running">
<uni-icons @click="toggleForm" type="location" size="17" <uni-icons @click="toggleForm" type="location" size="17"
color="rgba(255, 255, 255, 0.8)" style="vertical-align: bottom;" /> color="rgba(255, 255, 255, 0.8)" style="vertical-align: bottom;" />
深圳市龙华区富源晟 {{ deviceInfo.address || '/'}}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="info-card"> <view class="info-card">
<view class="info-row"> <view class="info-row">
<text class="info-label">海拔高度 2666m</text> <text class="info-label">海拔高度 {{deviceInfo.altitude}}m</text>
<text class="info-value status-running">相对高度123m</text> <text class="info-value status-running">相对高度{{deviceInfo.relativeAltitude}}m</text>
</view> </view>
</view> </view>
<!-- 灯光模式选择 --> <!-- 灯光模式选择 -->
@ -95,11 +96,11 @@
</view> </view>
</view> </view>
<view class="mode-v1"> <view class="mode-v1">
<view class="mode-v2" @click="selectMode('main')"> <view class="mode-v2" @click="audible">
<image src="/static/images/210/zd.png" class="setIMG"></image> <image src="/static/images/210/zd.png" class="setIMG"></image>
<view> <view>
<view class="battery-v2">声光报警</view> <view class="battery-v2">声光报警</view>
<view class="mode-v3">{{ currentMainMode }}</view> <!-- <view class="mode-v3">{{ currentMainMode }}</view> -->
</view> </view>
</view> </view>
</view> </view>
@ -180,11 +181,10 @@
<view class="agreement-mask" v-if="lightModeA" @click.stop="closePopup"> <view class="agreement-mask" v-if="lightModeA" @click.stop="closePopup">
<!-- 灯光模式弹窗 --> <!-- 灯光模式弹窗 -->
<view class="agreement-popup" @click.stop> <view class="agreement-popup" @click.stop>
<!-- 标题 -->
<view class="popup-title"> {{ popupTitle }}</view> <view class="popup-title"> {{ popupTitle }}</view>
<view class="popup-content"> <view class="popup-content">
<view v-for="(item, index) in items" :key="index"> <view v-for="(item, index) in items" :key="index">
<view class="item" :class="{ 'selected': item.selected }"> <view class="item" :class="{ 'selected': item.selected }" @click="onItemClick(index)">
<image :src="item.image" class="setIMG"></image> <image :src="item.image" class="setIMG"></image>
{{ item.text }} {{ item.text }}
</view> </view>
@ -259,7 +259,6 @@
confirm() { confirm() {
return true; // 直接关闭 return true; // 直接关闭
} }
}, },
// 上传开机log // 上传开机log
logo: { logo: {
@ -285,10 +284,22 @@
showCancel: true showCancel: true
}, },
confirm() { confirm() {
return true; // 直接关闭 return true;
} }
}, },
// 声光报警
audibleAlarm: {
config: {
icon: '/static/images/210/bj_1.png',
message: '确定开启设备声光报警?',
confirmBtnBg: 'rgba(255, 200, 78, 1)',
popupBorder:'1rpx solid rgba(255, 200, 78, 0.3)',
showCancel: true
},
confirm() {
return true;
}
}
} }
import MqttClient from '@/utils/mqtt.js'; import MqttClient from '@/utils/mqtt.js';
@ -300,7 +311,7 @@
lightModeSettings, //灯光模式设置 lightModeSettings, //灯光模式设置
laserModeSettings, //激光模式设置 laserModeSettings, //激光模式设置
mapReverseGeocoding //地图逆解析 mapReverseGeocoding //地图逆解析
} from '@/api/6170/deviceControl.js' } from '@/api/6075/6075.js'
import { import {
baseURL, baseURL,
getToken, getToken,
@ -318,6 +329,9 @@
}, },
currentMainMode: '强光', // 主灯当前模式 currentMainMode: '强光', // 主灯当前模式
currentSubMode: '泛光', // 辅灯当前模式 currentSubMode: '泛光', // 辅灯当前模式
currentlaserMode: '关闭',
isLaserOn: false,
popupTitle: '',
lightModeC: false, lightModeC: false,
pageLoading: true, pageLoading: true,
mainMode: 'string', mainMode: 'string',
@ -357,9 +371,6 @@
computedDeviceId() { computedDeviceId() {
return this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId; return this.apiType === 'listA' ? this.deviceID : this.itemInfo.deviceId;
}, },
popupTitle() {
return this.modeType === 'main' ? '主灯模式' : '辅灯模式';
}
}, },
methods: { methods: {
// 点击弹框外的区域关闭 // 点击弹框外的区域关闭
@ -399,15 +410,6 @@
case 1: case 1:
this.uploadStartup(); this.uploadStartup();
break; break;
case 2:
this.automaticAlarm();
break;
case 3:
this.manualAlarm();
break;
case 5:
this.alarmTime();
break;
} }
}, },
@ -426,11 +428,23 @@
lasermode() { lasermode() {
this.lightModeC = true this.lightModeC = true
}, },
// 声光报警
audible() {
this.showPopup('audibleAlarm');
},
handleDisagree() {
this.lightModeC = false
},
// 取消按钮
handleBtn() {
this.lightModeC = false
},
// 主灯模式 // 主灯模式
selectMode(type) { selectMode(type) {
this.modeType = type; this.modeType = type;
this.lightModeA = true; this.lightModeA = true;
if (type === 'main') { if (type === 'main') {
this.popupTitle = '主灯模式'
this.items = [{ this.items = [{
text: '强光', text: '强光',
selected: this.currentMainMode === '强光', // 修正匹配条件 selected: this.currentMainMode === '强光', // 修正匹配条件
@ -477,33 +491,34 @@
]; ];
// 辅灯 // 辅灯
} else if (type === 'sub') { } else if (type === 'sub') {
this.popupTitle = '辅灯模式'
this.items = [{ this.items = [{
text: '泛光', text: '泛光',
selected: this.currentMainMode === '泛光', // 修正匹配条件 selected: this.currentSubMode === '泛光', // 修正匹配条件
image: '/static/images/6075/fg.png', image: '/static/images/6075/fg.png',
instructValue: '1' instructValue: '1'
}, },
{ {
text: '泛光爆闪', text: '泛光爆闪',
selected: this.currentMainMode === '泛光爆闪', selected: this.currentSubMode === '泛光爆闪',
image: '/static/images/6075/fg.png', image: '/static/images/6075/fg.png',
instructValue: '2' instructValue: '2'
}, },
{ {
text: '警示灯', text: '警示灯',
selected: this.currentMainMode === '警示灯', selected: this.currentSubMode === '警示灯',
image: '/static/images/6075/jsg.png', image: '/static/images/6075/jsg.png',
instructValue: '3' instructValue: '3'
}, },
{ {
text: '警示灯/泛光', text: '警示灯/泛光',
selected: this.currentMainMode === '警示灯/泛光', selected: this.currentSubMode === '警示灯/泛光',
image: '/static/images/6075/jsg.png', image: '/static/images/6075/jsg.png',
instructValue: '4' instructValue: '4'
}, },
{ {
text: '关闭灯光', text: '关闭灯光',
selected: this.currentMainMode === '关闭灯光', selected: this.currentSubMode === '关闭灯光',
image: '/static/images/6170/close.png', image: '/static/images/6170/close.png',
instructValue: '0', instructValue: '0',
} }
@ -515,6 +530,25 @@
toggleForm() { toggleForm() {
this.isFormExpanded = !this.isFormExpanded; this.isFormExpanded = !this.isFormExpanded;
}, },
onItemClick(index) {
console.log(index, 'index');
const item = this.items[index];
this.selectedItemIndex = index;
this.items = this.items.map((item, i) => ({
...item,
selected: i === index
}));
this.pendingMainMode = item.text;
// 主灯
this.currentMainMode = item.text;
// 辅灯
this.currentSubMode = item.text;
},
// 灯光模式的确认
handleSumbit() {
this.lightModeA = false
},
// 上传开机画面 // 上传开机画面
uploadStartup() { uploadStartup() {
this.lightModeB = true this.lightModeB = true
@ -538,19 +572,23 @@
}); });
return; return;
} }
this.selectedImage = res.tempFilePaths[0]; let that = this;
console.log('选择的图片:', res); uni.navigateTo({
//this.file = res.tempFiles[0].file url: "/pages/6155/ImgCrop",
events: {
ImgCutOverPath: function(data) {
that.selectedImage = data.picPath;
}
}, },
fail: (err) => { success(ev) {
console.error('选择图片失败:', err); ev.eventChannel.emit('checkImg', {
uni.showToast({ data: res.tempFiles[0].path,
title: '选择图片失败',
icon: 'none'
}); });
} }
}); });
}, },
});
},
// 上传开机画面确认按键 // 上传开机画面确认按键
handleupload() { handleupload() {
if (!this.selectedImage) { if (!this.selectedImage) {
@ -618,7 +656,7 @@
// 历史记录 // 历史记录
if (index === 0) { if (index === 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/210/historyRecords/index', url: '/pages/670/History',
events: { events: {
ack: function(data) {} ack: function(data) {}
}, },
@ -630,24 +668,22 @@
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/6170/share/index', url: '/pages/common/share/index',
events: { events: {
ack: function(data) {} ack: function(data) {}
}, },
success: (res) => { success: (res) => {
let json = {
persissonType: '670'
};
Object.assign(json, this.device);
res.eventChannel.emit('share', { res.eventChannel.emit('share', {
data: this.itemInfo, data: json
}); });
} }
}) })
} }
}, },
// 分享
shareUp() {
},
// 操作说明 // 操作说明
operatingInst() { operatingInst() {
uni.navigateTo({ uni.navigateTo({

View File

@ -815,7 +815,6 @@
ack: function(data) {} ack: function(data) {}
}, },
success: (res) => { success: (res) => {
debugger;
let json = { let json = {
persissonType: '670' persissonType: '670'
}; };

View File

@ -240,6 +240,7 @@
console.log(data, 'data1t111'); console.log(data, 'data1t111');
this.itemInfo = data.data; this.itemInfo = data.data;
this.permissions=Common.getPermissions(this.itemInfo.persissonType); this.permissions=Common.getPermissions(this.itemInfo.persissonType);
console.log(this.itemInfo.persissonType,'this.itemInfo.persissonType');
}) })
} }
}; };