|
@@ -137,20 +137,20 @@
|
|
<el-card class="chart-card" shadow="never">
|
|
<el-card class="chart-card" shadow="never">
|
|
<template #header>
|
|
<template #header>
|
|
<div class="flex items-center">
|
|
<div class="flex items-center">
|
|
- <span class="text-base font-medium text-gray-600">今日工单状态统计</span>
|
|
|
|
|
|
+ <span class="text-base font-medium text-gray-600">设备状态统计</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<el-row class="h-[220px]">
|
|
<el-row class="h-[220px]">
|
|
<el-col :span="12" class="flex flex-col items-center">
|
|
<el-col :span="12" class="flex flex-col items-center">
|
|
<div ref="writeTodayChartRef" class="h-[160px] w-full"></div>
|
|
<div ref="writeTodayChartRef" class="h-[160px] w-full"></div>
|
|
<div class="text-center mt-2">
|
|
<div class="text-center mt-2">
|
|
- <span class="text-sm text-gray-600">待执行</span>
|
|
|
|
|
|
+ <span class="text-sm text-gray-600">未填写</span>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12" class="flex flex-col items-center">
|
|
<el-col :span="12" class="flex flex-col items-center">
|
|
<div ref="finishedTodayChartRef" class="h-[160px] w-full"></div>
|
|
<div ref="finishedTodayChartRef" class="h-[160px] w-full"></div>
|
|
<div class="text-center mt-2">
|
|
<div class="text-center mt-2">
|
|
- <span class="text-sm text-gray-600">已执行</span>
|
|
|
|
|
|
+ <span class="text-sm text-gray-600">已填写</span>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -160,7 +160,7 @@
|
|
<el-card class="chart-card" shadow="never">
|
|
<el-card class="chart-card" shadow="never">
|
|
<template #header>
|
|
<template #header>
|
|
<div class="flex items-center">
|
|
<div class="flex items-center">
|
|
- <span class="text-base font-medium text-gray-600">巡检工单状态统计</span>
|
|
|
|
|
|
+ <span class="text-base font-medium text-gray-600">工单状态统计</span>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<el-row class="h-[220px]">
|
|
<el-row class="h-[220px]">
|
|
@@ -216,6 +216,7 @@ import {
|
|
IotStatisticsDeviceMessageSummaryRespVO,
|
|
IotStatisticsDeviceMessageSummaryRespVO,
|
|
IotStatisticsSummaryRespVO
|
|
IotStatisticsSummaryRespVO
|
|
} from '@/api/iot/statistics'
|
|
} from '@/api/iot/statistics'
|
|
|
|
+const { currentRoute, push } = useRouter()
|
|
import { formatDate } from '@/utils/formatTime'
|
|
import { formatDate } from '@/utils/formatTime'
|
|
import { IotStatApi } from '@/api/pms/stat'
|
|
import { IotStatApi } from '@/api/pms/stat'
|
|
|
|
|
|
@@ -371,7 +372,7 @@ const getStats = async () => {
|
|
status.value = res
|
|
status.value = res
|
|
initCharts()
|
|
initCharts()
|
|
})
|
|
})
|
|
- IotStatApi.getInspectTodayStatus().then((res) => {
|
|
|
|
|
|
+ IotStatApi.getInspectDeviceStatus().then((res) => {
|
|
todayStatus.value = res
|
|
todayStatus.value = res
|
|
initCharts()
|
|
initCharts()
|
|
})
|
|
})
|
|
@@ -390,50 +391,55 @@ const initCharts = () => {
|
|
initGaugeChart(
|
|
initGaugeChart(
|
|
writeTodayChartRef.value,
|
|
writeTodayChartRef.value,
|
|
todayStatus.value.todo === undefined ? 0 : todayStatus.value.todo,
|
|
todayStatus.value.todo === undefined ? 0 : todayStatus.value.todo,
|
|
- '#05b'
|
|
|
|
|
|
+ '#05b',
|
|
|
|
+ '设备待执行'
|
|
)
|
|
)
|
|
//已执行
|
|
//已执行
|
|
initGaugeChart(
|
|
initGaugeChart(
|
|
finishedTodayChartRef.value,
|
|
finishedTodayChartRef.value,
|
|
todayStatus.value.finished === undefined ? 0 : todayStatus.value.finished,
|
|
todayStatus.value.finished === undefined ? 0 : todayStatus.value.finished,
|
|
- '#f50'
|
|
|
|
|
|
+ '#f50',
|
|
|
|
+ '设备已执行'
|
|
)
|
|
)
|
|
- // 待执行
|
|
|
|
|
|
+ // 工单待执行
|
|
initGaugeChart(
|
|
initGaugeChart(
|
|
writeChartRef.value,
|
|
writeChartRef.value,
|
|
status.value.todo === undefined ? 0 : status.value.todo,
|
|
status.value.todo === undefined ? 0 : status.value.todo,
|
|
- '#05b'
|
|
|
|
|
|
+ '#05b',
|
|
|
|
+ '工单待执行'
|
|
)
|
|
)
|
|
- //已执行
|
|
|
|
|
|
+ //工单已执行
|
|
initGaugeChart(
|
|
initGaugeChart(
|
|
finishedChartRef.value,
|
|
finishedChartRef.value,
|
|
status.value.finished === undefined ? 0 : status.value.finished,
|
|
status.value.finished === undefined ? 0 : status.value.finished,
|
|
- '#f50'
|
|
|
|
|
|
+ '#f50',
|
|
|
|
+ '工单已执行'
|
|
)
|
|
)
|
|
// 消息量统计
|
|
// 消息量统计
|
|
//initMessageChart()
|
|
//initMessageChart()
|
|
}
|
|
}
|
|
|
|
|
|
/** 初始化仪表盘图表 */
|
|
/** 初始化仪表盘图表 */
|
|
-const initGaugeChart = (el: any, value: number, color: string) => {
|
|
|
|
- echarts.init(el).setOption({
|
|
|
|
|
|
+const initGaugeChart = (el: any, value: number, color: string, type: string) => {
|
|
|
|
+ const chart = echarts.init(el);
|
|
|
|
+ chart.setOption({
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
type: 'gauge',
|
|
type: 'gauge',
|
|
startAngle: 360,
|
|
startAngle: 360,
|
|
endAngle: 0,
|
|
endAngle: 0,
|
|
min: 0,
|
|
min: 0,
|
|
- max: statsData.value.deviceCount || 100, // 使用设备总数作为最大值
|
|
|
|
|
|
+ max: value, // 使用设备总数作为最大值
|
|
progress: {
|
|
progress: {
|
|
show: true,
|
|
show: true,
|
|
- width: 12,
|
|
|
|
|
|
+ width: 22,
|
|
itemStyle: {
|
|
itemStyle: {
|
|
color: color
|
|
color: color
|
|
}
|
|
}
|
|
},
|
|
},
|
|
axisLine: {
|
|
axisLine: {
|
|
lineStyle: {
|
|
lineStyle: {
|
|
- width: 12,
|
|
|
|
|
|
+ width: 22,
|
|
color: [[1, '#E5E7EB']]
|
|
color: [[1, '#E5E7EB']]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -454,10 +460,30 @@ const initGaugeChart = (el: any, value: number, color: string) => {
|
|
return `${value} `
|
|
return `${value} `
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- data: [{ value: value }]
|
|
|
|
|
|
+ data: [{ value: value, type: type }]
|
|
}
|
|
}
|
|
]
|
|
]
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // 添加点击事件监听器
|
|
|
|
+ chart.on('click', (params) => {
|
|
|
|
+ console.log('点击的数据值为:', params.value);
|
|
|
|
+ console.log('点击的数据类型为:', params.data.type);
|
|
|
|
+ let status = '';
|
|
|
|
+ if (params.data.type === '工单待执行') {
|
|
|
|
+ status = 'todo'
|
|
|
|
+ push({ name: 'IotInspectOrdere', params: { status} })
|
|
|
|
+ } else if (params.data.type === '工单已执行') {
|
|
|
|
+ status = 'finished'
|
|
|
|
+ push({name: 'IotInspectOrdere', params: { status} })
|
|
|
|
+ } else if (params.data.type==='设备待执行') {
|
|
|
|
+ status = 'todo'
|
|
|
|
+ push({name:'IotInspectOrderDetailStat', params:{status}})
|
|
|
|
+ } else if (params.data.type==='设备已执行'){
|
|
|
|
+ status = 'finished'
|
|
|
|
+ push({name:'IotInspectOrderDetailStat', params:{status}})
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
/** 初始化消息统计图表 */
|
|
/** 初始化消息统计图表 */
|