控制中心添加670的控制,大屏页面问题
This commit is contained in:
@ -6,10 +6,10 @@ VITE_APP_ENV = 'development'
|
|||||||
|
|
||||||
# 开发环境
|
# 开发环境
|
||||||
#VITE_APP_BASE_API = 'https://fuyuanshen.com/backend'
|
#VITE_APP_BASE_API = 'https://fuyuanshen.com/backend'
|
||||||
VITE_APP_BASE_API = 'https://www.cnxhyc.com/jq'
|
# VITE_APP_BASE_API = 'https://www.cnxhyc.com/jq'
|
||||||
|
VITE_APP_BASE_API = 'http://192.168.110.56:8000'
|
||||||
#代永飞接口
|
#代永飞接口
|
||||||
#VITE_APP_BASE_API = 'http://192.168.2.23:8000'
|
# VITE_APP_BASE_API = 'http://457102h2d6.qicp.vip:24689'
|
||||||
|
|
||||||
|
|
||||||
# 应用访问路径 例如使用前缀 /admin/
|
# 应用访问路径 例如使用前缀 /admin/
|
||||||
|
|||||||
@ -26,6 +26,14 @@ function SosSetting (data: any) {
|
|||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
//批量强制报警
|
||||||
|
function SosSettingBatch(data:any){
|
||||||
|
return request({
|
||||||
|
url: `/api/xinghan/device/SOSGradeSettingsBatch`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//静电探测档位控制
|
//静电探测档位控制
|
||||||
function staticPowerSetting (data: any) {
|
function staticPowerSetting (data: any) {
|
||||||
@ -62,5 +70,6 @@ export default {
|
|||||||
SosSetting:SosSetting,
|
SosSetting:SosSetting,
|
||||||
staticPowerSetting:staticPowerSetting,
|
staticPowerSetting:staticPowerSetting,
|
||||||
deviceRealTimeStatus:deviceRealTimeStatus,
|
deviceRealTimeStatus:deviceRealTimeStatus,
|
||||||
SendMessage:SendMessage
|
SendMessage:SendMessage,
|
||||||
|
SosSettingBatch:SosSettingBatch
|
||||||
};
|
};
|
||||||
@ -65,7 +65,8 @@ function AddPoint(point, index, dragEnd, click, iconImg) {
|
|||||||
title: point.isAlarming ? '正在报警:' + point.deviceName : point.deviceName,
|
title: point.isAlarming ? '正在报警:' + point.deviceName : point.deviceName,
|
||||||
text: index,
|
text: index,
|
||||||
class: 'point',
|
class: 'point',
|
||||||
extData: point
|
extData: point,
|
||||||
|
anchor:'bottom-center'
|
||||||
});
|
});
|
||||||
marker.setMap(map);
|
marker.setMap(map);
|
||||||
|
|
||||||
@ -102,25 +103,7 @@ function setCenter(lon, latitude) {
|
|||||||
|
|
||||||
function calcCenter() {
|
function calcCenter() {
|
||||||
|
|
||||||
if (!layPoints || layPoints.length === 0) {
|
|
||||||
throw new Error("坐标数组不能为空");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算所有经度和纬度的总和
|
|
||||||
const total = layPoints.reduce((sum, point) => {
|
|
||||||
return {
|
|
||||||
lng: sum.lng + parseFloat(point.lng),
|
|
||||||
lat: sum.lat + parseFloat(point.lat)
|
|
||||||
};
|
|
||||||
}, { lng: 0, lat: 0 });
|
|
||||||
|
|
||||||
// 计算平均值得到中心点
|
|
||||||
const center = {
|
|
||||||
lng: total.lng / layPoints.length,
|
|
||||||
lat: total.lat / layPoints.length
|
|
||||||
};
|
|
||||||
|
|
||||||
return center;
|
|
||||||
}
|
}
|
||||||
//画多边形
|
//画多边形
|
||||||
function DrawPoy(points) {
|
function DrawPoy(points) {
|
||||||
@ -179,6 +162,7 @@ function DrawPoy(points) {
|
|||||||
}
|
}
|
||||||
//画圆形
|
//画圆形
|
||||||
function DrawCicle(points, raduis, dragEnd) {
|
function DrawCicle(points, raduis, dragEnd) {
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!map) {
|
if (!map) {
|
||||||
reject("map未初始化");
|
reject("map未初始化");
|
||||||
@ -201,7 +185,7 @@ function DrawCicle(points, raduis, dragEnd) {
|
|||||||
reject("圆的中心点不正确")
|
reject("圆的中心点不正确")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
layPoints.push({ lng: coordinates[0].lng, lat: points.coordinates[0].lat });
|
|
||||||
let circle = new AMap.Circle({
|
let circle = new AMap.Circle({
|
||||||
center: [points.coordinates[0].lng, points.coordinates[0].lat],
|
center: [points.coordinates[0].lng, points.coordinates[0].lat],
|
||||||
radius: raduis ? raduis : 1000, //半径
|
radius: raduis ? raduis : 1000, //半径
|
||||||
@ -217,6 +201,7 @@ function DrawCicle(points, raduis, dragEnd) {
|
|||||||
zIndex: 50,
|
zIndex: 50,
|
||||||
})
|
})
|
||||||
map.add(circle);
|
map.add(circle);
|
||||||
|
layPoints.push({ lng: points.coordinates[0].lng, lat: points.coordinates[0].lat });
|
||||||
resolve("添加圆成功");
|
resolve("添加圆成功");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -472,6 +472,16 @@ const getList = () => {
|
|||||||
Status.sosMode = res.data.staSOSGrade;
|
Status.sosMode = res.data.staSOSGrade;
|
||||||
Status.staticPower = res.data.staDetectGrade;
|
Status.staticPower = res.data.staDetectGrade;
|
||||||
Status.lightMode = res.data.staLightGrade;
|
Status.lightMode = res.data.staLightGrade;
|
||||||
|
if(!deviceDetail.value.personnelInfo){
|
||||||
|
deviceDetail.value.personnelInfo={
|
||||||
|
'id': null,
|
||||||
|
'deviceId': null,
|
||||||
|
'name': null,
|
||||||
|
'position': null,
|
||||||
|
'unitName': null,
|
||||||
|
'code': null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -538,6 +548,8 @@ const sendTextMessage = async () => {
|
|||||||
batchId: ''
|
batchId: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
api.SendMessage(json).then((res) => {
|
api.SendMessage(json).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
ElMessage.closeAll();
|
ElMessage.closeAll();
|
||||||
|
|||||||
@ -165,6 +165,8 @@ import apiTypeAll from '@/api/equipmentManagement/device/index';
|
|||||||
import { deviceQuery, deviceVO } from '@/api/controlCenter/controlPanel/types';
|
import { deviceQuery, deviceVO } from '@/api/controlCenter/controlPanel/types';
|
||||||
import Amap from "./components/map.vue";
|
import Amap from "./components/map.vue";
|
||||||
import { generateShortId, getDeviceStatus } from '@/utils/function';
|
import { generateShortId, getDeviceStatus } from '@/utils/function';
|
||||||
|
import eqControl from '@/api/controlCenter/controlPanel/eqControl';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute(); // 新增:用于获取URL中的query参数
|
const route = useRoute(); // 新增:用于获取URL中的query参数
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
@ -380,6 +382,7 @@ const submitForm = async () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
||||||
sendTextLoading.value = true;
|
sendTextLoading.value = true;
|
||||||
// 2. 准备请求数据
|
// 2. 准备请求数据
|
||||||
const deviceIds = ids.value.map(item => item.id);
|
const deviceIds = ids.value.map(item => item.id);
|
||||||
@ -392,10 +395,11 @@ const submitForm = async () => {
|
|||||||
typeName: typeName,
|
typeName: typeName,
|
||||||
batchId: batchId,
|
batchId: batchId,
|
||||||
deviceImeiList: deviceImeiList,
|
deviceImeiList: deviceImeiList,
|
||||||
sendMsg: form.value.messageToSend
|
sendMsg: form.value.messageToSend,
|
||||||
|
instructValue:""
|
||||||
};
|
};
|
||||||
// 3.人员信息
|
// 3.人员信息
|
||||||
const registerRes = await api.deviceSendMessage(data);
|
const registerRes = await eqControl.deviceSendMessage(data);
|
||||||
if (registerRes.code !== 200) {
|
if (registerRes.code !== 200) {
|
||||||
proxy?.$modal.msgWarning(registerRes.msg)
|
proxy?.$modal.msgWarning(registerRes.msg)
|
||||||
return
|
return
|
||||||
@ -454,9 +458,10 @@ const forceAlarm = async () => {
|
|||||||
typeName: typeName,
|
typeName: typeName,
|
||||||
batchId: batchId,
|
batchId: batchId,
|
||||||
deviceImeiList: deviceImeiList,
|
deviceImeiList: deviceImeiList,
|
||||||
instructValue: '1', //强制报警1,解除报警0
|
instructValue: '1' //强制报警1,解除报警0
|
||||||
|
|
||||||
}
|
}
|
||||||
const registerRes = await api.sendAlarmMessage(data);
|
const registerRes = await eqControl.sendAlarmMessage(data);
|
||||||
if (registerRes.code !== 200) {
|
if (registerRes.code !== 200) {
|
||||||
proxy?.$modal.msgWarning(registerRes.msg)
|
proxy?.$modal.msgWarning(registerRes.msg)
|
||||||
return
|
return
|
||||||
|
|||||||
@ -35,8 +35,6 @@
|
|||||||
<div class="input" @click.stop="showCheck('showCheckType')">
|
<div class="input" @click.stop="showCheck('showCheckType')">
|
||||||
<div>{{ devType }}</div>
|
<div>{{ devType }}</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="iconContent">
|
<div class="iconContent">
|
||||||
<div class="arrow">
|
<div class="arrow">
|
||||||
<el-icon v-show="!Status.showCheckType"><CaretBottom /></el-icon>
|
<el-icon v-show="!Status.showCheckType"><CaretBottom /></el-icon>
|
||||||
@ -46,7 +44,6 @@
|
|||||||
<el-icon><CloseBold /></el-icon>
|
<el-icon><CloseBold /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ul" :class="Status.showCheckType ? '' : 'displayNone'">
|
<div class="ul" :class="Status.showCheckType ? '' : 'displayNone'">
|
||||||
<div
|
<div
|
||||||
@ -362,9 +359,7 @@ function getPoints() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Promise.allSettled(promise).then((res) => {
|
Promise.allSettled(promise).then((res) => {
|
||||||
// map.setFitView();
|
map.setFitView();
|
||||||
let center=map.calcCenter();
|
|
||||||
map.setCenter(center.lng,center.lat);
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.error('接口getDeviceLocationInfo出现了未知的异常', res);
|
console.error('接口getDeviceLocationInfo出现了未知的异常', res);
|
||||||
@ -390,7 +385,7 @@ function getTypes() {
|
|||||||
if (res.data.length) {
|
if (res.data.length) {
|
||||||
types.value = res.data.map((v) => {
|
types.value = res.data.map((v) => {
|
||||||
return {
|
return {
|
||||||
value: v.id,
|
value: v.deviceTypeId,
|
||||||
label: v.typeName
|
label: v.typeName
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -520,6 +515,7 @@ function showCheck(type) {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
map.initMap(hideCheck).then((res) => {
|
map.initMap(hideCheck).then((res) => {
|
||||||
|
getPoints();
|
||||||
setInterval(getPoints, 300000);
|
setInterval(getPoints, 300000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user