feat: 微调设备状态模块样式,首页接口容错处理,梳理api文档资源

main
donghao 1 month ago
parent c70c88468a
commit 0cad00f421

@ -1,4 +1,4 @@
# .env.production # .env.production
NODE_ENV = production NODE_ENV = production
VITE_APP_ENV = production VITE_APP_ENV = production
VITE_APP_BASE_API = https://api.production.com VITE_APP_BASE_API = http://127.0.0.1:8000

@ -53,7 +53,7 @@
``` ```
![alt text](微信图片_20250306134728.png) ![alt text](localFiles/微信图片_20250306134728.png)
# 检测总量汇总接口文档 # 检测总量汇总接口文档
@ -117,7 +117,7 @@
"errorMessage": "" "errorMessage": ""
} }
``` ```
![alt text](1741680039157.png) ![alt text](localFiles/1741680039157.png)
# 设备信息接口文档 # 设备信息接口文档
## 1. 接口基本信息 ## 1. 接口基本信息
@ -181,7 +181,7 @@
"errorMessage": "" "errorMessage": ""
} }
``` ```
![alt text](1741680066982.png) ![alt text](localFiles/1741680066982.png)
# 车体检测问题分布接口文档 # 车体检测问题分布接口文档
## 1. 接口基本信息 ## 1. 接口基本信息
@ -294,7 +294,7 @@
"errorMessage": "" "errorMessage": ""
} }
``` ```
![alt text](1741680094060.png) ![alt text](localFiles/1741680094060.png)
# 实时监控画面接口文档 # 实时监控画面接口文档
## 1. 接口基本信息 ## 1. 接口基本信息
@ -334,4 +334,4 @@
"errorMessage": "" "errorMessage": ""
} }
``` ```
![alt text](1741680112113.png) ![alt text](localFiles/1741680112113.png)

@ -73,7 +73,7 @@
"errorMessage": "" "errorMessage": ""
} }
``` ```
![alt text](image-1.png) ![alt text](localFiles/image-1.png)
## 二、设备历史视频列表接口 ## 二、设备历史视频列表接口
### 2.1 接口基本信息 ### 2.1 接口基本信息
@ -131,7 +131,7 @@
"errorMessage": "" "errorMessage": ""
} }
``` ```
![alt text](image-2.png) ![alt text](localFiles/image-2.png)
# 撑杆监测模块Pole Monitor接口文档 # 撑杆监测模块Pole Monitor接口文档
@ -217,7 +217,7 @@
"errorMessage": "" "errorMessage": ""
} }
``` ```
![alt text](image-3.png) ![alt text](localFiles/image-3.png)
## 二、撑杆监测详情接口 ## 二、撑杆监测详情接口
### 2.1 接口基本信息 ### 2.1 接口基本信息
@ -300,7 +300,7 @@
"errorMessage": "" "errorMessage": ""
} }
``` ```
![alt text](image-4.png) ![alt text](localFiles/image-4.png)
# 外观监测模块Appearance Monitor接口文档 # 外观监测模块Appearance Monitor接口文档
## 一、外观监测分页列表接口 ## 一、外观监测分页列表接口
@ -386,7 +386,7 @@
"errorMessage": "" "errorMessage": ""
} }
``` ```
![alt text](image-5.png) ![alt text](localFiles/image-5.png)
# 外观监测模块Appearance Monitor接口文档 # 外观监测模块Appearance Monitor接口文档
@ -472,4 +472,4 @@
"errorMessage": "" "errorMessage": ""
} }
``` ```
![alt text](image-6.png) ![alt text](localFiles/image-6.png)

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd * @Author: donghao donghao@supervision.ltd
* @Date: 2025-03-06 17:57:05 * @Date: 2025-03-06 17:57:05
* @LastEditors: donghao donghao@supervision.ltd * @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2025-03-12 19:16:05 * @LastEditTime: 2025-03-18 11:08:34
* @FilePath: \5G-Loading-Bay-Web\index.html * @FilePath: \5G-Loading-Bay-Web\index.html
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
@ -13,11 +13,11 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>监控平台</title> <title>监控平台</title>
<script src="/public/adapter.min.js"></script>
<script src="/public/webrtcstreamer.js"></script>
</head> </head>
<body> <body>
<script type="module" src="/adapter.min.js"></script>
<script type="module" src="/webrtcstreamer.js"></script>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
</body> </body>

Before

Width:  |  Height:  |  Size: 551 KiB

After

Width:  |  Height:  |  Size: 551 KiB

Before

Width:  |  Height:  |  Size: 478 KiB

After

Width:  |  Height:  |  Size: 478 KiB

Before

Width:  |  Height:  |  Size: 591 KiB

After

Width:  |  Height:  |  Size: 591 KiB

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Before

Width:  |  Height:  |  Size: 699 KiB

After

Width:  |  Height:  |  Size: 699 KiB

Before

Width:  |  Height:  |  Size: 2.7 MiB

After

Width:  |  Height:  |  Size: 2.7 MiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Before

Width:  |  Height:  |  Size: 991 KiB

After

Width:  |  Height:  |  Size: 991 KiB

Before

Width:  |  Height:  |  Size: 398 KiB

After

Width:  |  Height:  |  Size: 398 KiB

@ -4,18 +4,17 @@
border: none !important; border: none !important;
background-color: transparent; background-color: transparent;
} }
/* 去掉表头下边框 */ /* 去掉表头下边框 */
.el-table__header-wrapper thead th { .el-table__header-wrapper thead th {
border-bottom: none !important; border-bottom: none !important;
border: none !important; border: none !important;
} }
/* 去掉单元格边框 */ /* 去掉单元格边框 */
.el-table td, .el-table td,
.el-table th.is-leaf { .el-table th.is-leaf {
border-bottom: none !important; border-bottom: none !important;
border: none !important; border: none !important;
} }
/* 去掉纵向分割线 */ /* 去掉纵向分割线 */
.el-table--border::after, .el-table--border::after,
@ -33,6 +32,7 @@
.el-table th { .el-table th {
border-right: none !important; border-right: none !important;
border: none !important; border: none !important;
border-collapse: collapse !important;
} }
.el-scrollbar__view { .el-scrollbar__view {
@ -47,19 +47,35 @@
cursor: pointer; cursor: pointer;
.el-table__body { .el-table__body {
background: transparent; background: transparent;
border-collapse: collapse !important;
border: none !important;
tr { tr {
color: #fff; color: #fff;
background: transparent; background: transparent;
&:hover td { &:hover td {
background-color: transparent; background: transparent !important;
} }
&:hover { &:hover {
color: #37DBFF; color: #37dbff;
background: linear-gradient( 90deg, rgba(30,54,88,0) 0%, #0C4FAD 53%, rgba(65,117,190,0) 100%); background: linear-gradient(
} 90deg,
&.selected-row{ rgba(30, 54, 88, 0) 0%,
color: #37DBFF; #0c4fad 53%,
background: linear-gradient( 90deg, rgba(30,54,88,0) 0%, #0C4FAD 53%, rgba(65,117,190,0) 100%); rgba(65, 117, 190, 0) 100%
);
}
&.selected-row {
color: #37dbff;
background: linear-gradient(
90deg,
rgba(30, 54, 88, 0) 0%,
#0c4fad 53%,
rgba(65, 117, 190, 0) 100%
);
// border-top: 1px solid;
// border-bottom: 1px solid;
// border-image: linear-gradient(90deg, rgba(12, 24, 64, 0), rgba(69, 174, 250, 1), rgba(102, 102, 102, 0));
} }
} }
} }
@ -75,7 +91,7 @@
} }
} }
} }
.fixed_pagination{ .fixed_pagination {
padding: 12px 20px 0; padding: 12px 20px 0;
} }
/* full_table */ /* full_table */
@ -86,6 +102,7 @@
.baseTable_box { .baseTable_box {
cursor: default; cursor: default;
.el-table__body { .el-table__body {
border: none !important;
background: linear-gradient(90deg, #082050 0%, #02102a 100%); background: linear-gradient(90deg, #082050 0%, #02102a 100%);
tr { tr {
color: #fff; color: #fff;
@ -96,8 +113,12 @@
&:nth-child(even) { &:nth-child(even) {
background: linear-gradient(90deg, #102d65 0%, #081736 100%); background: linear-gradient(90deg, #102d65 0%, #081736 100%);
} }
&:hover {
border: none !important;
}
&:hover td { &:hover td {
background-color: transparent; background-color: transparent;
} }
} }
} }
@ -113,7 +134,7 @@
} }
} }
} }
.fixed_pagination{ .fixed_pagination {
padding: 28px 20px; padding: 28px 20px;
} }
} }

@ -2,17 +2,17 @@
* @Author: donghao donghao@supervision.ltd * @Author: donghao donghao@supervision.ltd
* @Date: 2025-03-06 13:53:22 * @Date: 2025-03-06 13:53:22
* @LastEditors: donghao donghao@supervision.ltd * @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2025-03-10 09:59:29 * @LastEditTime: 2025-03-18 10:59:08
* @FilePath: \vite-ai\data-dashboard\src\router\index.ts * @FilePath: \vite-ai\data-dashboard\src\router\index.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
import { createRouter, createWebHistory } from "vue-router"; import { createRouter, createWebHashHistory } from "vue-router";
import { useUserStore } from "@/stores/user"; import { useUserStore } from "@/stores/user";
import { dashboardRoutes } from "./dashboard"; import { dashboardRoutes } from "./dashboard";
import { buildHierarchyTree } from "@/utils/tree"; import { buildHierarchyTree } from "@/utils/tree";
const router = createRouter({ const router = createRouter({
history: createWebHistory(), history: createWebHashHistory (),
routes: [ routes: [
{ {
path: "/login", path: "/login",
@ -34,7 +34,6 @@ const router = createRouter({
router.beforeEach((to) => { router.beforeEach((to) => {
const userStore = useUserStore(); const userStore = useUserStore();
if (to.meta.requiresAuth && !userStore.token) { if (to.meta.requiresAuth && !userStore.token) {
return "/login"; return "/login";
} }

@ -10,7 +10,8 @@
</template> </template>
<template #extra> <template #extra>
<div> <div>
<el-button type="primary" class="month-btn" @click="getList('month')" :class="{ 'active-btn': activeBtn === 'month' }"> <el-button type="primary" class="month-btn" @click="getList('month')"
:class="{ 'active-btn': activeBtn === 'month' }">
</el-button> </el-button>
<el-button class="week-btn" @click="getList('week')" :class="{ 'active-btn': activeBtn === 'week' }"> <el-button class="week-btn" @click="getList('week')" :class="{ 'active-btn': activeBtn === 'week' }">
@ -21,12 +22,7 @@
</ContentHeader> </ContentHeader>
</div> </div>
<div class="chart-container chart-container-bar"> <div class="chart-container chart-container-bar">
<BarChart <BarChart :xData="xData" :legendArr="legendArr" :datas="datas" :colorArr="colorArr" />
:xData="xData"
:legendArr="legendArr"
:datas="datas"
:colorArr="colorArr"
/>
</div> </div>
</div> </div>
<!-- 设备信息 --> <!-- 设备信息 -->
@ -51,15 +47,15 @@
</div> </div>
<div class="device-list"> <div class="device-list">
<div class="device-card"> <div class="device-card">
<div class="mb-3">车体检测设备: {{ carDevice.total }}</div> <div class="mb-3">车体检测设备: {{ carDevice?.total || 0 }}</div>
<DeviceStatus :deviceStatus="carDevice" /> <DeviceStatus :deviceStatus="carDevice" />
</div> </div>
<div class="device-card"> <div class="device-card">
<div class="mb-3">撑杆检测设备: {{ poleDevice.total }}</div> <div class="mb-3">撑杆检测设备: {{ poleDevice?.total || 0 }}</div>
<DeviceStatus :deviceStatus="poleDevice" /> <DeviceStatus :deviceStatus="poleDevice" />
</div> </div>
<div class="device-card"> <div class="device-card">
<div class="mb-3">钩机检测设备: {{ excavatorDevice.total }}</div> <div class="mb-3">钩机检测设备: {{ excavatorDevice?.total || 0 }}</div>
<DeviceStatus :deviceStatus="excavatorDevice" /> <DeviceStatus :deviceStatus="excavatorDevice" />
</div> </div>
</div> </div>
@ -95,17 +91,14 @@
</ContentHeader> </ContentHeader>
</div> </div>
<div class="chart-container chart-pie-bg"> <div class="chart-container chart-pie-bg">
<PieChart <PieChart :data="carFaultTotal" :colors="[
:data="carFaultTotal"
:colors="[
'#FF7C09', '#FF7C09',
'#0032FF', '#0032FF',
'#04FFF2', '#04FFF2',
'#D19EFF', '#D19EFF',
'#FF0103', '#FF0103',
'#9EFFF3', '#9EFFF3',
]" ]" />
/>
</div> </div>
</li> </li>
<li> <li>
@ -133,10 +126,7 @@
</ContentHeader> </ContentHeader>
</div> </div>
<div class="chart-container chart-pie-bg"> <div class="chart-container chart-pie-bg">
<PieChartSmall <PieChartSmall :data="poleFaultTotal" :colors="['#9DFFF3', '#FFA179']" />
:data="poleFaultTotal"
:colors="['#9DFFF3', '#FFA179']"
/>
</div> </div>
</li> </li>
</ul> </ul>
@ -154,11 +144,11 @@
</div> </div>
<div class="monitor-images"> <div class="monitor-images">
<div class="monitor-images-left"> <div class="monitor-images-left">
<img :src="imageFault[0]?.url" alt="监控画面" /> <img :src="imageFault[0]?.url" />
<div class="fault-info">{{ imageFault[0]?.fault_type }}</div> <div class="fault-info">{{ imageFault[0]?.fault_type }}</div>
</div> </div>
<div class="monitor-images-right"> <div class="monitor-images-right">
<img :src="imageFault[1]?.url" alt="监控画面" /> <img :src="imageFault[1]?.url"/>
<div class="fault-info">{{ imageFault[1]?.fault_type }}</div> <div class="fault-info">{{ imageFault[1]?.fault_type }}</div>
</div> </div>
</div> </div>
@ -174,7 +164,8 @@ import BarChart from "./components/BarChart.vue";
import PieChart from "./components/PieChart.vue"; import PieChart from "./components/PieChart.vue";
import PieChartSmall from "./components/PieChartSmall.vue"; import PieChartSmall from "./components/PieChartSmall.vue";
import DeviceStatus from "./components/DeviceStatus.vue"; import DeviceStatus from "./components/DeviceStatus.vue";
import { getDataOverviewApi,getDeviceInfowApi,getRecordFaultApi,getRealTimeApi } from '@/api/dashboard'; import { getDataOverviewApi, getDeviceInfowApi, getRecordFaultApi, getRealTimeApi } from '@/api/dashboard';
import { isSuccessApi } from "@/utils/forApi";
defineOptions({ defineOptions({
name: "DataOverviewWrap" name: "DataOverviewWrap"
@ -206,53 +197,63 @@ const carFaultTotal = ref([]);
const poleFaultTotal = ref([]); const poleFaultTotal = ref([]);
const imageFault = ref([]); const imageFault = ref([]);
const activeBtn = ref("month"); const activeBtn = ref("month");
const getList = async (dateType:string = "month") => { const getList = async (dateType: string = "month") => {
activeBtn.value = dateType activeBtn.value = dateType
const res = await getDataOverviewApi({ dateType }) const res = await getDataOverviewApi({ dateType })
const { data } = await res if (isSuccessApi(res)) {
const { data } = res
datas.value[0] = data.appearance datas.value[0] = data.appearance
datas.value[1] = data.pole datas.value[1] = data.pole
if(dateType === "month") { if (dateType === "month") {
xData.value = data.dateArr.map((item:any) => {if(dateType === 'month') { xData.value = data.dateArr.map((item: any) => {
return item+'月' if (dateType === 'month') {
return item + '月'
} }
}) })
}else { } else {
xData.value = ["周一","周二","周三","周四","周五","周六","周日"] xData.value = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
} }
// console.log(data, 'getList_data') // console.log(data, 'getList_data')
}
}; };
const getDeviceInfo = async () => { const getDeviceInfo = async () => {
try { try {
const res = await getDeviceInfowApi(); const res = await getDeviceInfowApi();
if (isSuccessApi(res)) {
const { data } = res; const { data } = res;
deviceTotal.value = data.deviceTotal; deviceTotal.value = data.deviceTotal;
carDevice.value = data.appearance; carDevice.value = data.appearance;
poleDevice.value = data.pole; poleDevice.value = data.pole;
excavatorDevice.value = data.excavator; excavatorDevice.value = data.excavator;
// deviceStatus.value = data // deviceStatus.value = data
}
} catch (error) { } catch (error) {
console.error('获取设备信息出错:', error); console.error('获取设备信息出错:', error);
} }
} }
const getPoleFault = async () => { const getPoleFault = async () => {
try { try {
const res = await getRecordFaultApi({dateType: 'month',value: searchForm.pole,type:"pole"}); const res = await getRecordFaultApi({ dateType: 'month', value: searchForm.pole, type: "pole" });
if (isSuccessApi(res)) {
const { data } = res; const { data } = res;
poleFaultTotal.value = data; poleFaultTotal.value = data;
// deviceStatus.value = data // deviceStatus.value = data
console.log(data); console.log(data);
}
} catch (error) { } catch (error) {
console.error('获取设备信息出错:', error); console.error('获取设备信息出错:', error);
} }
} }
const getCarFault = async () => { const getCarFault = async () => {
try { try {
const res = await getRecordFaultApi({dateType: 'month',value: searchForm.car,type:"appearance"}); const res = await getRecordFaultApi({ dateType: 'month', value: searchForm.car, type: "appearance" });
if (isSuccessApi(res)) {
const { data } = res; const { data } = res;
carFaultTotal.value = data; carFaultTotal.value = data;
// deviceStatus.value = data // deviceStatus.value = data
console.log(data); console.log(data);
}
} catch (error) { } catch (error) {
console.error('获取设备信息出错:', error); console.error('获取设备信息出错:', error);
} }
@ -260,11 +261,13 @@ const getCarFault = async () => {
const getRealTime = async () => { const getRealTime = async () => {
try { try {
const res = await getRealTimeApi({deviceType: ''}); const res = await getRealTimeApi({ deviceType: '' });
if (isSuccessApi(res)) {
const { data } = res; const { data } = res;
imageFault.value = data; imageFault.value = data;
// deviceStatus.value = data // deviceStatus.value = data
console.log(data); console.log(data);
}
} catch (error) { } catch (error) {
console.error('获取设备信息出错:', error); console.error('获取设备信息出错:', error);
} }

@ -1,9 +1,13 @@
.device-status-content-box{ .device-status-wrap{
height: 813px;
background-image: url("@/assets/common/device_status_bg_line.png"); background-image: url("@/assets/common/device_status_bg_line.png");
background-size: 100% 100%; background-size: 100% 100%;
background-position: bottom; background-position: bottom;
background-repeat: no-repeat; background-repeat: no-repeat;
}
.device-status-content-box{
.el-scrollbar__view { .el-scrollbar__view {
background: transparent !important; background: transparent !important;
height: 600px; height: 600px;

@ -1,5 +1,6 @@
<template> <template>
<div class="bg_basic_content"> <div class="bg_basic_content">
<div class="device-status-wrap">
<div class="device-status-header mt-[32px]"> <div class="device-status-header mt-[32px]">
<ContentHeader bgLayout="1855"> <ContentHeader bgLayout="1855">
<template #title> <template #title>
@ -47,6 +48,7 @@
<HistoryVideoModal ref="historyModalRef" v-model:value="isHistoryOpen" :info="currentRow" <HistoryVideoModal ref="historyModalRef" v-model:value="isHistoryOpen" :info="currentRow"
:historyVideos="historyVideos" @close="isHistoryOpen = false" /> :historyVideos="historyVideos" @close="isHistoryOpen = false" />
</div> </div>
</div>
</template> </template>

@ -215,8 +215,9 @@ defineExpose({ loadData })
width: 100%; width: 100%;
display: flex; display: flex;
flex: 1; flex: 1;
// border-radius: 2px; border-radius: 2px;
border: none; // border: none;
border: 1px solid rgba(8, 139, 214, 0.4);
@ -224,7 +225,7 @@ defineExpose({ loadData })
width: 100%; width: 100%;
&.is-focused { &.is-focused {
// border: 1px solid rgba(8, 139, 214, 0.4);
box-shadow: none; box-shadow: none;
} }

Loading…
Cancel
Save