|
@@ -28,6 +28,14 @@ const pageSize = ref(10);
|
|
|
const deviceType = ref({});
|
|
const deviceType = ref({});
|
|
|
|
|
|
|
|
const PieChartDataTwo = ref([]);
|
|
const PieChartDataTwo = ref([]);
|
|
|
|
|
+const flipDataMonthly = ref([]);
|
|
|
|
|
+const waterImmersionMonthly = ref([]);
|
|
|
|
|
+const waterLevelMonthly = ref([]);
|
|
|
|
|
+
|
|
|
|
|
+const flipDataDay = ref([]);
|
|
|
|
|
+const waterImmersionDay = ref([]);
|
|
|
|
|
+const waterLevelDay = ref([]);
|
|
|
|
|
+const DagiveanalarmDate = ref([]);
|
|
|
|
|
|
|
|
// 预览对话框
|
|
// 预览对话框
|
|
|
const previewDialogVisible = ref(false);
|
|
const previewDialogVisible = ref(false);
|
|
@@ -138,7 +146,7 @@ const fetchAlarmData = async (condition) => {
|
|
|
return data;
|
|
return data;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-// 主方法
|
|
|
|
|
|
|
+// 获取饼图数据法
|
|
|
const getyearAllDeviceInfo = () => {
|
|
const getyearAllDeviceInfo = () => {
|
|
|
try {
|
|
try {
|
|
|
const { start, end } = generateYearDateRange();
|
|
const { start, end } = generateYearDateRange();
|
|
@@ -176,6 +184,57 @@ const getyearAllDeviceInfo = () => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+//获取报警月统计数据
|
|
|
|
|
+const getobtainMonthlyData = async () => {
|
|
|
|
|
+ loading.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const { start, end } = generateYearDateRange();
|
|
|
|
|
+ const res = await request.get("/manholeData/getMonthlyDataCount", {
|
|
|
|
|
+ params: {
|
|
|
|
|
+ startDate: start,
|
|
|
|
|
+ endDate: end,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ if (res.code !== 200) {
|
|
|
|
|
+ ElMessage.error(res.msg);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ flipDataMonthly.value = res.data.alarm_status;
|
|
|
|
|
+ waterImmersionMonthly.value = res.data.water_infiltration_alarm_status;
|
|
|
|
|
+ waterLevelMonthly.value = res.data.water_level_alarm_status;
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ ElMessage.error("获取报警月统计数据失败");
|
|
|
|
|
+ console.error(error);
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ loading.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+//获取报警日统计数据
|
|
|
|
|
+const getobtainDayData = async () => {
|
|
|
|
|
+ loading.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const { start, end } = generateYearDateRange();
|
|
|
|
|
+ const res = await request.get("/manholeData/getDailyDataCountThisMonth", {});
|
|
|
|
|
+ if (res.code !== 200) {
|
|
|
|
|
+ ElMessage.error(res.msg);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const array = [...Array(res.data.alarm_status.length).keys()].map((i) => i + 1);
|
|
|
|
|
+ DagiveanalarmDate.value = array;
|
|
|
|
|
+ flipDataDay.value = res.data.alarm_status;
|
|
|
|
|
+ waterImmersionDay.value = res.data.water_infiltration_alarm_status;
|
|
|
|
|
+ waterLevelDay.value = res.data.water_level_alarm_status;
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ ElMessage.error("获取报警月统计数据失败");
|
|
|
|
|
+ console.error(error);
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ loading.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+getobtainDayData();
|
|
|
|
|
+getobtainMonthlyData();
|
|
|
getyearAllDeviceInfo();
|
|
getyearAllDeviceInfo();
|
|
|
|
|
|
|
|
const handleSearch = () => {
|
|
const handleSearch = () => {
|
|
@@ -459,21 +518,30 @@ onMounted(() => {
|
|
|
<span class="font-bold">井盖统计</span>
|
|
<span class="font-bold">井盖统计</span>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
|
|
|
- <div class="stat-card bg-blue-50 p-4 rounded-lg">
|
|
|
|
|
|
|
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4 h-100">
|
|
|
|
|
+ <div class="stat-card bg-blue-50 p-4 rounded-lg h-100">
|
|
|
<div class="text-blue-500 text-lg font-medium">报警年统计</div>
|
|
<div class="text-blue-500 text-lg font-medium">报警年统计</div>
|
|
|
<div class="h-80">
|
|
<div class="h-80">
|
|
|
<!-- <EchartsTyp></EchartsTyp> -->
|
|
<!-- <EchartsTyp></EchartsTyp> -->
|
|
|
<pieChart :message="PieChartDataTwo"></pieChart>
|
|
<pieChart :message="PieChartDataTwo"></pieChart>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="stat-card bg-green-50 p-4 rounded-lg">
|
|
|
|
|
|
|
+ <div class="stat-card bg-green-50 p-4 rounded-lg h-100">
|
|
|
<div class="text-green-500 text-lg font-medium">报警月统计</div>
|
|
<div class="text-green-500 text-lg font-medium">报警月统计</div>
|
|
|
- <EchartsTyp></EchartsTyp>
|
|
|
|
|
|
|
+ <EchartsTyp
|
|
|
|
|
+ :flipData="flipDataMonthly"
|
|
|
|
|
+ :waterImmersion="waterImmersionMonthly"
|
|
|
|
|
+ :waterLevel="waterLevelMonthly"
|
|
|
|
|
+ ></EchartsTyp>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="stat-card bg-red-50 p-4 rounded-lg">
|
|
|
|
|
|
|
+ <div class="stat-card bg-red-50 p-4 rounded-lg h-100">
|
|
|
<div class="text-red-500 text-lg font-medium">报警日统计</div>
|
|
<div class="text-red-500 text-lg font-medium">报警日统计</div>
|
|
|
- <riEcharts></riEcharts>
|
|
|
|
|
|
|
+ <riEcharts
|
|
|
|
|
+ :flipData="flipDataDay"
|
|
|
|
|
+ :waterImmersion="waterImmersionDay"
|
|
|
|
|
+ :waterLevel="waterLevelDay"
|
|
|
|
|
+ :DagiveanalarmDate="DagiveanalarmDate"
|
|
|
|
|
+ ></riEcharts>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-card>
|
|
</el-card>
|