|
|
|
@ -10,10 +10,10 @@
|
|
|
|
|
</template>
|
|
|
|
|
<template #extra>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" class="month-btn" @click="activeBtn = '月'" :class="{ 'active-btn': activeBtn === '月' }">
|
|
|
|
|
<el-button type="primary" class="month-btn" @click="getList('month')" :class="{ 'active-btn': activeBtn === 'month' }">
|
|
|
|
|
月
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button class="week-btn" @click="activeBtn = '周'" :class="{ 'active-btn': activeBtn === '周' }">
|
|
|
|
|
<el-button class="week-btn" @click="getList('week')" :class="{ 'active-btn': activeBtn === 'week' }">
|
|
|
|
|
周
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
@ -46,13 +46,13 @@
|
|
|
|
|
<div class="device-icon"></div>
|
|
|
|
|
<div class="device-count">
|
|
|
|
|
<div>设备总数</div>
|
|
|
|
|
<div class="count-number">37</div>
|
|
|
|
|
<div class="count-number">{{ deviceTotal }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="device-list">
|
|
|
|
|
<div class="device-card">
|
|
|
|
|
<div class="mb-3">车体检测设备: 12</div>
|
|
|
|
|
<DeviceStatus :deviceStatus="deviceStatus" />
|
|
|
|
|
<div class="mb-3">车体检测设备: {{ carDevice.total }}</div>
|
|
|
|
|
<DeviceStatus :deviceStatus="carDevice" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="device-card">
|
|
|
|
|
<div class="mb-3">撑杆检测设备: 10</div>
|
|
|
|
@ -178,16 +178,17 @@ import BarChart from "./components/BarChart.vue";
|
|
|
|
|
import PieChart from "./components/PieChart.vue";
|
|
|
|
|
import PieChartSmall from "./components/PieChartSmall.vue";
|
|
|
|
|
import DeviceStatus from "./components/DeviceStatus.vue";
|
|
|
|
|
import { getDataOverviewApi,getDeviceInfowApi } from '@/api/dashboard';
|
|
|
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
|
name: "DataOverviewWrap"
|
|
|
|
|
});
|
|
|
|
|
const xData = ref(["1月", "2月", "3月", "4月", "5月"]);
|
|
|
|
|
const legendArr = ["车体检测", "撑杆检测"];
|
|
|
|
|
const datas = [
|
|
|
|
|
const datas = ref([
|
|
|
|
|
[1528, 1266.02, 2468.39, 2982.67, 3165.91],
|
|
|
|
|
[2844.44, 6505.07, 8016.12, 6350.87, 1474.61],
|
|
|
|
|
];
|
|
|
|
|
]);
|
|
|
|
|
const colorArr = [
|
|
|
|
|
["#3B9FFE", "#5070F2"],
|
|
|
|
|
["#FFDA8D", "#FFAC06"],
|
|
|
|
@ -202,8 +203,39 @@ const searchForm = reactive({
|
|
|
|
|
status: "",
|
|
|
|
|
faultType: "",
|
|
|
|
|
});
|
|
|
|
|
const activeBtn = ref("月");
|
|
|
|
|
const deviceTotal = ref(0);
|
|
|
|
|
const carDevice = ref({});
|
|
|
|
|
const activeBtn = ref("month");
|
|
|
|
|
const getList = async (dateType:string = "month") => {
|
|
|
|
|
activeBtn.value = dateType
|
|
|
|
|
const res = await getDataOverviewApi({ dateType })
|
|
|
|
|
const { data } = await res
|
|
|
|
|
datas.value[0] = data.appearance
|
|
|
|
|
datas.value[1] = data.pole
|
|
|
|
|
if(dateType === "month") {
|
|
|
|
|
xData.value = data.dateArr.map((item:any) => {if(dateType === 'month') {
|
|
|
|
|
return item+'月'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
xData.value = ["周一","周二","周三","周四","周五","周六","周日"]
|
|
|
|
|
}
|
|
|
|
|
// console.log(data, 'getList_data')
|
|
|
|
|
};
|
|
|
|
|
const getDeviceInfo = async () => {
|
|
|
|
|
try {
|
|
|
|
|
const res = await getDeviceInfowApi();
|
|
|
|
|
const { data } = res;
|
|
|
|
|
deviceTotal.value = data.deviceTotal;
|
|
|
|
|
carDevice.value = data.appearance;
|
|
|
|
|
// deviceStatus.value = data
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取设备信息出错:', error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getList()
|
|
|
|
|
getDeviceInfo()
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|