|
|
@ -77,7 +77,7 @@
|
|
|
|
<div class="w-[200px] bg_title bg_title_2"></div>
|
|
|
|
<div class="w-[200px] bg_title bg_title_2"></div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template #extra>
|
|
|
|
<template #extra>
|
|
|
|
<el-select v-model="searchForm.name" placeholder="时间" class="custom-select">
|
|
|
|
<el-select v-model="searchForm.car" placeholder="时间" class="custom-select" @change="getCarFault()">
|
|
|
|
<el-option label="1月" value="1"></el-option>
|
|
|
|
<el-option label="1月" value="1"></el-option>
|
|
|
|
<el-option label="2月" value="2"></el-option>
|
|
|
|
<el-option label="2月" value="2"></el-option>
|
|
|
|
<el-option label="3月" value="3"></el-option>
|
|
|
|
<el-option label="3月" value="3"></el-option>
|
|
|
@ -115,7 +115,7 @@
|
|
|
|
<div class="w-[200px] bg_title bg_title_3"></div>
|
|
|
|
<div class="w-[200px] bg_title bg_title_3"></div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template #extra>
|
|
|
|
<template #extra>
|
|
|
|
<el-select v-model="searchForm.name" placeholder="时间" class="custom-select">
|
|
|
|
<el-select v-model="searchForm.pole" placeholder="时间" class="custom-select" @change="getPoleFault()">
|
|
|
|
<el-option label="1月" value="1"></el-option>
|
|
|
|
<el-option label="1月" value="1"></el-option>
|
|
|
|
<el-option label="2月" value="2"></el-option>
|
|
|
|
<el-option label="2月" value="2"></el-option>
|
|
|
|
<el-option label="3月" value="3"></el-option>
|
|
|
|
<el-option label="3月" value="3"></el-option>
|
|
|
@ -134,10 +134,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="chart-container">
|
|
|
|
<div class="chart-container">
|
|
|
|
<PieChartSmall
|
|
|
|
<PieChartSmall
|
|
|
|
:data="[
|
|
|
|
:data="poleFaultTotal"
|
|
|
|
{ value: 65, name: '撑杆断裂' },
|
|
|
|
|
|
|
|
{ value: 35, name: '撑杆弯曲' },
|
|
|
|
|
|
|
|
]"
|
|
|
|
|
|
|
|
:colors="['#9DFFF3', '#FFA179']"
|
|
|
|
:colors="['#9DFFF3', '#FFA179']"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -156,8 +153,14 @@
|
|
|
|
</ContentHeader>
|
|
|
|
</ContentHeader>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="monitor-images">
|
|
|
|
<div class="monitor-images">
|
|
|
|
<img src="https://picsum.photos/300/200?random=1" alt="监控画面" />
|
|
|
|
<div class="monitor-images-left">
|
|
|
|
<img src="https://picsum.photos/300/200?random=2" alt="监控画面" />
|
|
|
|
<img :src="imageFault[0].url" alt="监控画面" />
|
|
|
|
|
|
|
|
<div class="fault-info">{{ imageFault[0].fault_type }}</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="monitor-images-right">
|
|
|
|
|
|
|
|
<img :src="imageFault[1].url" alt="监控画面" />
|
|
|
|
|
|
|
|
<div class="fault-info">{{ imageFault[1].fault_type }}</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -171,7 +174,7 @@ 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 } from '@/api/dashboard';
|
|
|
|
import { getDataOverviewApi,getDeviceInfowApi,getRecordFaultApi,getRealTimeApi } from '@/api/dashboard';
|
|
|
|
|
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
defineOptions({
|
|
|
|
name: "DataOverviewWrap"
|
|
|
|
name: "DataOverviewWrap"
|
|
|
@ -192,9 +195,8 @@ const deviceStatus = ref({
|
|
|
|
outlineCount: 10
|
|
|
|
outlineCount: 10
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const searchForm = reactive({
|
|
|
|
const searchForm = reactive({
|
|
|
|
name: "",
|
|
|
|
car: "1",
|
|
|
|
status: "",
|
|
|
|
pole: "1",
|
|
|
|
faultType: "",
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const deviceTotal = ref(0);
|
|
|
|
const deviceTotal = ref(0);
|
|
|
|
const carDevice = ref({});
|
|
|
|
const carDevice = ref({});
|
|
|
@ -202,6 +204,7 @@ const poleDevice = ref({});
|
|
|
|
const excavatorDevice = ref({});
|
|
|
|
const excavatorDevice = ref({});
|
|
|
|
const carFaultTotal = ref([]);
|
|
|
|
const carFaultTotal = ref([]);
|
|
|
|
const poleFaultTotal = ref([]);
|
|
|
|
const poleFaultTotal = 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
|
|
|
@ -232,9 +235,20 @@ const getDeviceInfo = async () => {
|
|
|
|
console.error('获取设备信息出错:', error);
|
|
|
|
console.error('获取设备信息出错:', error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const getRecordFault = async () => {
|
|
|
|
const getPoleFault = async () => {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const res = await getRecordFaultApi({dateType: 'month',value: searchForm.pole,type:"pole"});
|
|
|
|
|
|
|
|
const { data } = res;
|
|
|
|
|
|
|
|
poleFaultTotal.value = data;
|
|
|
|
|
|
|
|
// deviceStatus.value = data
|
|
|
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
console.error('获取设备信息出错:', error);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const getCarFault = async () => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const res = await getRecordFaultApi({dateType: 'month',value: 1,type:"appearance"});
|
|
|
|
const res = await getRecordFaultApi({dateType: 'month',value: searchForm.car,type:"appearance"});
|
|
|
|
const { data } = res;
|
|
|
|
const { data } = res;
|
|
|
|
carFaultTotal.value = data;
|
|
|
|
carFaultTotal.value = data;
|
|
|
|
// deviceStatus.value = data
|
|
|
|
// deviceStatus.value = data
|
|
|
@ -243,10 +257,24 @@ const getRecordFault = async () => {
|
|
|
|
console.error('获取设备信息出错:', error);
|
|
|
|
console.error('获取设备信息出错:', error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getRealTime = async () => {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const res = await getRealTimeApi({deviceType: ''});
|
|
|
|
|
|
|
|
const { data } = res;
|
|
|
|
|
|
|
|
imageFault.value = data;
|
|
|
|
|
|
|
|
// deviceStatus.value = data
|
|
|
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
console.error('获取设备信息出错:', error);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
getList()
|
|
|
|
getList()
|
|
|
|
getDeviceInfo()
|
|
|
|
getDeviceInfo()
|
|
|
|
getRecordFault()
|
|
|
|
getCarFault()
|
|
|
|
|
|
|
|
getPoleFault()
|
|
|
|
|
|
|
|
getRealTime()
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|