diff --git a/src/api/dashboard.ts b/src/api/dashboard.ts
index 10e7f4d..b3a70f6 100644
--- a/src/api/dashboard.ts
+++ b/src/api/dashboard.ts
@@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2025-03-07 15:09:18
* @LastEditors: donghao donghao@supervision.ltd
- * @LastEditTime: 2025-03-14 11:14:15
+ * @LastEditTime: 2025-08-26 16:54:54
* @FilePath: \5G-Loading-Bay-Web\src\api\dashboard.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -94,3 +94,14 @@ export const getVehiclManagementApi = (params: any) => {
export const getBeforeMonitorDetailApi = (params: any) => {
return request.get(`/api/v1/record/before_arrive_record_list/`, params);
};
+
+
+// 图表统计1 type有appearance、pole、distance。dateType有day、hour分别对应日和时
+export const getRecordAmountDataApi = (params: any) => {
+ return request.get(`/api/v1/record/get_record_amount_data/`, params);
+};
+
+// 图表统计2 ?type=pole&dateType=day 这个是日异常类型的接口
+export const getRecordFaultTypeAmountDataApi = (params: any) => {
+ return request.get(`/api/v1/record/get_record_fault_type_amount_data/`, params);
+};
\ No newline at end of file
diff --git a/src/components/Charts/appearanceDailyAlertChart.vue b/src/components/Charts/appearanceDailyAlertChart.vue
index e202adb..d6d95ce 100644
--- a/src/components/Charts/appearanceDailyAlertChart.vue
+++ b/src/components/Charts/appearanceDailyAlertChart.vue
@@ -2,95 +2,145 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2025-08-14 10:33:46
* @LastEditors: donghao donghao@supervision.ltd
- * @LastEditTime: 2025-08-20 14:35:52
+ * @LastEditTime: 2025-08-27 16:22:40
* @FilePath: \5G-Web\src\components\Charts\appearanceDailyAlertChart.vue
* @Description: 外观日告警统计
-->
-
+
diff --git a/src/components/Charts/appearanceDailyDetectionChart.vue b/src/components/Charts/appearanceDailyDetectionChart.vue
index eb6bee0..a9e3c4a 100644
--- a/src/components/Charts/appearanceDailyDetectionChart.vue
+++ b/src/components/Charts/appearanceDailyDetectionChart.vue
@@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2025-08-14 10:33:22
* @LastEditors: donghao donghao@supervision.ltd
- * @LastEditTime: 2025-08-20 16:03:07
+ * @LastEditTime: 2025-08-26 17:09:24
* @FilePath: \5G-Web\src\components\Charts\appearanceDailyDetectionChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -11,79 +11,88 @@ import * as echarts from "echarts";
const props = defineProps({
datas: {
- type: Array as PropType[]>,
- default: () => [],
+ type: Object,
+ default: () => {},
},
});
function initChart() {
const chartDom = document.getElementById("appearanceDailyDetectionChart");
const mainChart = echarts.init(chartDom);
- const data1 = [
- {
- name: "1日",
- value: 175,
- },
- {
- name: "2日",
- value: 148,
- },
- {
- name: "3日",
- value: 195,
- },
- {
- name: "4日",
- value: 115,
- },
- {
- name: "5日",
- value: 148,
- },
- {
- name: "6日",
- value: 95,
- },
- {
- name: "7日",
- value: 56,
- },
- {
- name: "8日",
- value: 45,
- },
- {
- name: "9日",
- value: 15,
- },
- {
- name: "10日",
- value: 48,
- },
- {
- name: "11日",
- value: 95,
- },
- {
- name: "12日",
- value: 128,
- },
- {
- name: "13日",
- value: 34,
- },
- {
- name: "14日",
- value: 123,
- },
- {
- name: "15日",
- value: 175,
- },
- {
- name: "16日",
- value: 148,
- },
- ];
+ let finalData = [];
+
+ for (let key in props.datas) {
+ finalData.push({
+ name: key + "日",
+ value: props.datas[key],
+ });
+ }
+ // TODO 转移到mock数据中
+ // const finalData = [
+ // {
+ // name: "1日",
+ // value: 175,
+ // },
+ // {
+ // name: "2日",
+ // value: 148,
+ // },
+ // {
+ // name: "3日",
+ // value: 195,
+ // },
+ // {
+ // name: "4日",
+ // value: 115,
+ // },
+ // {
+ // name: "5日",
+ // value: 148,
+ // },
+ // {
+ // name: "6日",
+ // value: 95,
+ // },
+ // {
+ // name: "7日",
+ // value: 56,
+ // },
+ // {
+ // name: "8日",
+ // value: 45,
+ // },
+ // {
+ // name: "9日",
+ // value: 15,
+ // },
+ // {
+ // name: "10日",
+ // value: 48,
+ // },
+ // {
+ // name: "11日",
+ // value: 95,
+ // },
+ // {
+ // name: "12日",
+ // value: 128,
+ // },
+ // {
+ // name: "13日",
+ // value: 34,
+ // },
+ // {
+ // name: "14日",
+ // value: 123,
+ // },
+ // {
+ // name: "15日",
+ // value: 175,
+ // },
+ // {
+ // name: "16日",
+ // value: 148,
+ // },
+ // ];
const createSvg = (shadowColor, shadowBlur) => `
`;
-
const svgString = createSvg("rgba(7, 131, 250, 1)", 8);
const svg = new Blob([svgString], { type: "image/svg+xml;charset=utf-8" });
const barWidth = 16;
@@ -119,7 +127,7 @@ function initChart() {
const insetShadowUrl = DOMURL.createObjectURL(svg);
let xAxisData = [];
let seriesData1 = [];
- data1.forEach((item) => {
+ finalData.forEach((item) => {
xAxisData.push(item.name);
seriesData1.push(item.value);
});
@@ -211,9 +219,17 @@ function initChart() {
mainChart.setOption(option);
}
-onMounted(() => {
- initChart();
-});
+watch(
+ () => props.datas,
+ (newVal) => {
+ if (newVal) {
+ initChart();
+ }
+ },
+ {
+ deep: true,
+ }
+);
@@ -221,6 +237,6 @@ onMounted(() => {
class="main-chart"
ref="mainChartRef"
id="appearanceDailyDetectionChart"
- style="width: 100%; height: 100%"
+ style="width: 862px; height: 100%"
>
diff --git a/src/components/Charts/diggerDailyDistanceChart.vue b/src/components/Charts/diggerDailyDistanceChart.vue
index 76663d6..f74de54 100644
--- a/src/components/Charts/diggerDailyDistanceChart.vue
+++ b/src/components/Charts/diggerDailyDistanceChart.vue
@@ -1,79 +1,92 @@
-
+
diff --git a/src/components/Charts/diggerHourlyDistanceChart.vue b/src/components/Charts/diggerHourlyDistanceChart.vue
index 7d2de45..e464fac 100644
--- a/src/components/Charts/diggerHourlyDistanceChart.vue
+++ b/src/components/Charts/diggerHourlyDistanceChart.vue
@@ -1,5 +1,11 @@
-
+
diff --git a/src/components/Charts/dvDeviceInfoChart.vue b/src/components/Charts/dvDeviceInfoChart.vue
new file mode 100644
index 0000000..3c66c3d
--- /dev/null
+++ b/src/components/Charts/dvDeviceInfoChart.vue
@@ -0,0 +1,231 @@
+
+
+
+
+
diff --git a/src/components/Charts/poleDailyAlertChart.vue b/src/components/Charts/poleDailyAlertChart.vue
index 5332c8c..11be35e 100644
--- a/src/components/Charts/poleDailyAlertChart.vue
+++ b/src/components/Charts/poleDailyAlertChart.vue
@@ -1,139 +1,71 @@
+
-
+
diff --git a/src/components/Charts/poleDailyDetectionChart.vue b/src/components/Charts/poleDailyDetectionChart.vue
index ae56d29..c6d352d 100644
--- a/src/components/Charts/poleDailyDetectionChart.vue
+++ b/src/components/Charts/poleDailyDetectionChart.vue
@@ -1,206 +1,222 @@
-
+
diff --git a/src/styles/common.scss b/src/styles/common.scss
index 40c75a7..284da0c 100644
--- a/src/styles/common.scss
+++ b/src/styles/common.scss
@@ -233,7 +233,7 @@
padding-bottom: 1px;
}
.fg-footer-charts-content {
- overflow: hidden;
+ // overflow: hidden;
max-width: 100%;
height: 195px;
// background-color: red;
diff --git a/src/views/dashboard/AppearanceMonitor.vue b/src/views/dashboard/AppearanceMonitor.vue
index c34cbcb..3dcaf8d 100644
--- a/src/views/dashboard/AppearanceMonitor.vue
+++ b/src/views/dashboard/AppearanceMonitor.vue
@@ -11,6 +11,8 @@ import {
getAppearanceMonitorApi,
getAppearanceMonitorDetailApi,
getBeforeMonitorDetailApi,
+ getRecordAmountDataApi,
+ getRecordFaultTypeAmountDataApi
} from "@/api/dashboard";
import { isSuccessApi } from "@/utils/forApi";
import { useWebSocketStore } from "@/stores/websocketStore";
@@ -19,6 +21,8 @@ import { useWebSocketStore } from "@/stores/websocketStore";
const isAlarmOpen = ref(false); //详情弹窗
const isDeleteOpen = ref(false); //删除弹窗
const websocketStore = useWebSocketStore();
+
+
// 监听 messages 的变化
watch(
() => websocketStore.messages,
@@ -97,6 +101,10 @@ const searchForm = reactive({
});
const dataLoading = ref(true);
+const recordAmountData = ref({}); // 日检出量记录数据
+const recordFaultData = ref({}); // 日告警分类记录数据
+
+
// 文件详情
const getFileList = async () => {
try {
@@ -173,6 +181,36 @@ const getList = async () => {
console.error("获取数据失败:", error);
}
};
+// 图表统计1
+const fetchRecordAmountData = async () => {
+ try {
+ const res = await getRecordAmountDataApi({
+ type: "appearance",
+ dateType: "day",
+ });
+ console.log(res.data, "fetchRecordAmountData_data");
+ if (isSuccessApi(res)) {
+ recordAmountData.value = res.data;
+ }
+ } catch (error) {
+ console.error("获取数据失败:", error);
+ }
+}
+// 图表统计2
+const fetchRecordFaultTypeAmountData = async () => {
+ try {
+ const res = await getRecordFaultTypeAmountDataApi({
+ type: "appearance",
+ dateType: "day",
+ });
+ console.log(res.data, "fetchRecordFaultTypeAmountData_data");
+ if (isSuccessApi(res)) {
+ recordFaultData.value = res.data;
+ }
+ } catch (error) {
+ console.error("获取数据失败:", error);
+ }
+}
// 查询方法
const handleQuery = () => {
@@ -231,6 +269,8 @@ onBeforeRouteLeave(() => {
onMounted(() => {
getList();
+ fetchRecordAmountData()
+ fetchRecordFaultTypeAmountData()
});
@@ -341,13 +381,13 @@ onMounted(() => {
diff --git a/src/views/dashboard/DiggerMonitor.vue b/src/views/dashboard/DiggerMonitor.vue
index cdf15d5..b3108bb 100644
--- a/src/views/dashboard/DiggerMonitor.vue
+++ b/src/views/dashboard/DiggerMonitor.vue
@@ -11,6 +11,7 @@ import {
getAppearanceMonitorDetailApi,
getBeforeMonitorDetailApi,
deleteAppearanceMonitorApi,
+ getRecordAmountDataApi,
} from "@/api/dashboard";
import { isSuccessApi } from "@/utils/forApi";
import { useWebSocketStore } from "@/stores/websocketStore";
@@ -18,6 +19,9 @@ import { useWebSocketStore } from "@/stores/websocketStore";
const isAlarmOpen = ref(false); //详情弹窗
const isDeleteOpen = ref(false); //删除弹窗
const websocketStore = useWebSocketStore();
+
+const recordDistanceHourData = ref({}); // 分时距离报警
+const recordDistanceDayData = ref({}); // 日距离告警
// 监听 messages 的变化
watch(
() => websocketStore.messages,
@@ -147,6 +151,36 @@ const getList = async () => {
console.error("获取数据失败:", error);
}
};
+// 图表统计1
+const fetchRecordHourData = async () => {
+ try {
+ const res = await getRecordAmountDataApi({
+ type: "distance",
+ dateType: "hour",
+ });
+ console.log(res.data, "fetchRecordHourData_data");
+ if (isSuccessApi(res)) {
+ recordDistanceHourData.value = res.data;
+ }
+ } catch (error) {
+ console.error("获取数据失败:", error);
+ }
+};
+// 图表统计2
+const fetchRecordDayData = async () => {
+ try {
+ const res = await getRecordAmountDataApi({
+ type: "distance",
+ dateType: "day",
+ });
+ console.log(res.data, "fetchRecordDayData_data");
+ if (isSuccessApi(res)) {
+ recordDistanceDayData.value = res.data;
+ }
+ } catch (error) {
+ console.error("获取数据失败:", error);
+ }
+};
// 查询方法
const handleQuery = () => {
@@ -217,6 +251,8 @@ onBeforeRouteLeave(() => {
onMounted(() => {
getList();
+ fetchRecordHourData();
+ fetchRecordDayData();
});
@@ -345,13 +381,13 @@ onMounted(() => {
diff --git a/src/views/dashboard/PoleMonitor.vue b/src/views/dashboard/PoleMonitor.vue
index 7e72306..c23ffcc 100644
--- a/src/views/dashboard/PoleMonitor.vue
+++ b/src/views/dashboard/PoleMonitor.vue
@@ -12,6 +12,8 @@ import VideoExport from "./components/VideoExport.vue";
import {
getAppearanceMonitorApi,
getAppearanceMonitorDetailApi,
+ getRecordAmountDataApi,
+ getRecordFaultTypeAmountDataApi
} from "@/api/dashboard";
import { isSuccessApi } from "@/utils/forApi";
import { useWebSocketStore } from "@/stores/websocketStore";
@@ -83,7 +85,9 @@ const isPointOpen = ref(false); //点云弹窗
const isAlarmOpen = ref(false); //详情弹窗
const isDeleteOpen = ref(false); //删除弹窗
const websocketStore = useWebSocketStore();
-const dailyDetectionData = ref[]>([]); // 每日检测数据;
+
+const recordAmountData = ref({}); // 日检出量记录数据
+const recordFaultData = ref({}); // 日告警分类记录数据
// 监听 messages 的变化
watch(
() => websocketStore.messages,
@@ -158,6 +162,36 @@ const getList = async () => {
console.error("获取数据失败:", error);
}
};
+// 图表统计1
+const fetchRecordAmountData = async () => {
+ try {
+ const res = await getRecordAmountDataApi({
+ type: "pole",
+ dateType: "day",
+ });
+ console.log(res.data, "fetchRecordAmountData_data");
+ if (isSuccessApi(res)) {
+ recordAmountData.value = res.data;
+ }
+ } catch (error) {
+ console.error("获取数据失败:", error);
+ }
+}
+// 图表统计2
+const fetchRecordFaultTypeAmountData = async () => {
+ try {
+ const res = await getRecordFaultTypeAmountDataApi({
+ type: "pole",
+ dateType: "day",
+ });
+ console.log(res.data, "fetchRecordFaultTypeAmountData_data");
+ if (isSuccessApi(res)) {
+ recordFaultData.value = res.data;
+ }
+ } catch (error) {
+ console.error("获取数据失败:", error);
+ }
+}
// 查询方法
const handleQuery = () => {
@@ -215,6 +249,8 @@ onBeforeRouteLeave(() => {
});
onMounted(() => {
getList();
+ fetchRecordAmountData()
+ fetchRecordFaultTypeAmountData()
});
@@ -325,13 +361,13 @@ onMounted(() => {
diff --git a/src/views/dashboard/components/DeviceStatus.vue b/src/views/dashboard/components/DeviceStatus.vue
index 8ce5ac5..c111b0a 100644
--- a/src/views/dashboard/components/DeviceStatus.vue
+++ b/src/views/dashboard/components/DeviceStatus.vue
@@ -57,7 +57,9 @@ const deviceStatusOptions = ref[]>([
diff --git a/src/views/dashboard/components/待删除PieChart.vue b/src/views/dashboard/components/待删除PieChart.vue
new file mode 100644
index 0000000..637519f
--- /dev/null
+++ b/src/views/dashboard/components/待删除PieChart.vue
@@ -0,0 +1,92 @@
+
+
+
+
diff --git a/src/views/dashboard/components/待删除PieChartSmall.vue b/src/views/dashboard/components/待删除PieChartSmall.vue
new file mode 100644
index 0000000..729ec9a
--- /dev/null
+++ b/src/views/dashboard/components/待删除PieChartSmall.vue
@@ -0,0 +1,92 @@
+
+
+
+