Commit edf3e55d authored by xinzhedeai's avatar xinzhedeai

左侧设备背景图

parent 704c0637
......@@ -51,9 +51,9 @@ export const getCarLogList = async (): Promise<any> => await axios.get('home/car
// 修改报警状态
export const setAlarmStatusApi = async (command: string): Promise<any> => await axios.put(`/home/sound/${command}`, data);
export const setAlarmStatusApi = async (command: string): Promise<any> => await axios.post(`/home/sound/${command}`);
// 获取报警状态
export const getAlarmStatusApi = async (): Promise<any> => await axios.get('/home/sound/status');
export const getAlarmStatusApi = async (): Promise<any> => await axios.get('/home/alarm/status');
// export const getOnlineAlarmList = async (): Promise<any> => await axios.get('/home/online/alarm/list');
// export const getOnlineAlarmList = async (): Promise<any> => await axios.get('/home/online/alarm/list');
......
......@@ -54,7 +54,28 @@ const fetchDeviceStatus = async () => {
try {
const response = await getDeviceStatusInfo();
if (response.data.code == 200) {
deviceStatusList.value = response.data.data;
// 处理数据,添加color属性
const processedList = response.data.data.map((item: any) => {
let color = '';
switch (item.name) {
case '在线监测':
color = 'cyan';
break;
case '视频监测':
color = 'yellow';
break;
case '人员定位':
color = 'blue';
break;
case '车辆定位':
color = 'green';
break;
default:
color = ''; // 默认空值,可根据实际需求设置默认颜色
}
return { ...item, color };
});
deviceStatusList.value = processedList;
} else {
message.error(response.data.msg);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment