|
@@ -59,33 +59,33 @@
|
|
|
</el-row>
|
|
|
<!-- 第二行:图表行 -->
|
|
|
<el-row :gutter="16" class="mb-4">
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col :span="12">
|
|
|
<el-card class="chart-card" shadow="never">
|
|
|
<template #header>
|
|
|
<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>
|
|
|
</template>
|
|
|
<el-row class="h-[220px]">
|
|
|
- <el-col :span="6" class="flex flex-col items-center">
|
|
|
+ <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,3)">
|
|
|
<div ref="reportingChartRef" 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>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
- <el-col :span="6" class="flex flex-col items-center">
|
|
|
+ <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,1)">
|
|
|
<div ref="dealFinishedChartRef" class="h-[160px] w-full"></div>
|
|
|
<div class="text-center mt-2">
|
|
|
<span class="text-sm text-gray-600">已填写</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
- <el-col :span="6" class="flex flex-col items-center">
|
|
|
+ <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,0)">
|
|
|
<div ref="transOrderChartRef" class="h-[160px] w-full"></div>
|
|
|
<div class="text-center mt-2">
|
|
|
<span class="text-sm text-gray-600">未填写</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
- <el-col :span="6" class="flex flex-col items-center">
|
|
|
+ <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,2)">
|
|
|
<div ref="writeChartRef" class="h-[160px] w-full"></div>
|
|
|
<div class="text-center mt-2">
|
|
|
<span class="text-sm text-gray-600">填写中</span>
|
|
@@ -94,6 +94,35 @@
|
|
|
</el-row>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card class="chart-card" shadow="never">
|
|
|
+ <template #header>
|
|
|
+ <div class="flex items-center">
|
|
|
+ <span class="text-base font-medium text-gray-600">运行记录设备统计</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <el-row class="h-[220px]">
|
|
|
+ <el-col :span="6" class="flex flex-col items-center" @click="openForm(queryParams.deptId,2)">
|
|
|
+ <div ref="reportingChartRef1" class="h-[160px] w-full"></div>
|
|
|
+ <div class="text-center mt-2" >
|
|
|
+ <span class="text-sm text-gray-600">总数</span>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" class="flex flex-col items-center" @click="openForm(queryParams.deptId,1)">
|
|
|
+ <div ref="dealFinishedChartRef1" class="h-[160px] w-full"></div>
|
|
|
+ <div class="text-center mt-2">
|
|
|
+ <span class="text-sm text-gray-600">已填写</span>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" class="flex flex-col items-center" @click="openForm(queryParams.deptId,0)">
|
|
|
+ <div ref="transOrderChartRef1" class="h-[160px] w-full"></div>
|
|
|
+ <div class="text-center mt-2">
|
|
|
+ <span class="text-sm text-gray-600">待填写</span>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<!-- 第三行:消息统计行 -->
|
|
@@ -102,14 +131,13 @@
|
|
|
<el-card class="chart-card" shadow="never">
|
|
|
<template #header>
|
|
|
<div class="flex items-center justify-between">
|
|
|
- <span class="text-base font-medium text-gray-600">部门数量统计</span>
|
|
|
+ <span class="text-base font-medium text-gray-600">运行记录工单统计</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div ref="chartContainer" class="h-[300px]"></div>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="Index">
|
|
@@ -139,7 +167,8 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
import {useUserStore} from "@/store/modules/user";
|
|
|
// 导入部门数据类型
|
|
|
import { DeptTreeItem } from '@/api/system/dept'
|
|
|
-
|
|
|
+import StatisticsForm from './StatisticsForm.vue'
|
|
|
+const { push } = useRouter()
|
|
|
// 初始化echarts
|
|
|
echarts.use([
|
|
|
TooltipComponent,
|
|
@@ -178,6 +207,7 @@ const dateRange = ref<[Date, Date] | null>(null)
|
|
|
const queryParams = reactive({
|
|
|
startTime: Date.now() - 7 * 24 * 60 * 60 * 1000, // 设置默认开始时间为 7 天前
|
|
|
endTime: Date.now(), // 设置默认结束时间为当前时间
|
|
|
+ createTime: [],
|
|
|
deptId: null, // 选中的部门ID
|
|
|
status: null // 填写状态
|
|
|
})
|
|
@@ -185,9 +215,24 @@ const queryParams = reactive({
|
|
|
const handleQuery = () => {
|
|
|
// 重新获取数据
|
|
|
getStats()
|
|
|
+ getDevStats()
|
|
|
initChart()
|
|
|
}
|
|
|
|
|
|
+const formRef = ref()
|
|
|
+const openForm = (deptId?:string,isFill?:string) => {
|
|
|
+ /*const type = '填写设备明细';
|
|
|
+ const id = queryParams.deptId
|
|
|
+ formRef.value.open(type,id)*/
|
|
|
+
|
|
|
+ push({ name: 'FillOrderInfo2',params:{deptId,isFill}})
|
|
|
+}
|
|
|
+const openFill = (deptId?:string,orderStatus?:string) => {
|
|
|
+ push({ name: 'FillOrderInfo1',params:{deptId,orderStatus}})
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
const resetQuery = () => {
|
|
|
// 重置查询参数
|
|
|
queryParams.startTime = Date.now() - 7 * 24 * 60 * 60 * 1000
|
|
@@ -200,13 +245,17 @@ const resetQuery = () => {
|
|
|
initChart()
|
|
|
}
|
|
|
|
|
|
+//运行记录工单统计
|
|
|
const reportingChartRef = ref() // 在线设备统计的图表
|
|
|
const dealFinishedChartRef = ref() // 离线设备统计的图表
|
|
|
const transOrderChartRef = ref() // 待激活设备统计的图表
|
|
|
-const orderFinishChartRef = ref()
|
|
|
-const deviceMessageCountChartRef = ref() // 上下行消息量统计的图表
|
|
|
const writeChartRef = ref() // 待填写图表
|
|
|
-const finishedChartRef = ref() // 已完成图表
|
|
|
+
|
|
|
+//运行记录设备统计
|
|
|
+const reportingChartRef1 = ref() // 在线设备统计的图表
|
|
|
+const dealFinishedChartRef1 = ref() // 离线设备统计的图表
|
|
|
+const transOrderChartRef1 = ref() // 待激活设备统计的图表
|
|
|
+
|
|
|
|
|
|
// 基础统计数据
|
|
|
const statsData = ref<IotStatisticsSummaryRespVO>({
|
|
@@ -242,7 +291,7 @@ const total = ref({
|
|
|
})
|
|
|
|
|
|
const status = ref<IotStatusItem[]>([])
|
|
|
-
|
|
|
+const status1 = ref<IotStatusItem[]>([])
|
|
|
// 定义状态项接口
|
|
|
interface IotStatusItem {
|
|
|
totalCount: number
|
|
@@ -315,29 +364,54 @@ const getStats = async () => {
|
|
|
initCharts()
|
|
|
})
|
|
|
}
|
|
|
+const getDevStats = async () => {
|
|
|
+ // 获取基础统计数据
|
|
|
+ // 获取部门统计数据
|
|
|
+ IotStatApi.getDevSta(queryParams).then((res) => {
|
|
|
+ status1.value = res.totalList || [];
|
|
|
+ initChart()
|
|
|
+ initCharts()
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
/** 初始化图表 */
|
|
|
const initCharts = () => {
|
|
|
// 使用数组的第一个元素(如果存在)
|
|
|
const firstStatus = status.value[0] || {}
|
|
|
+ const firstStatus1 = status1.value[0] || {}
|
|
|
// 上报中
|
|
|
initGaugeChart(
|
|
|
reportingChartRef.value,
|
|
|
firstStatus.totalCount === undefined ? 0 : firstStatus.totalCount,
|
|
|
'#0d9'
|
|
|
)
|
|
|
+ initGaugeChart(
|
|
|
+ reportingChartRef1.value,
|
|
|
+ firstStatus1.totalCount === undefined ? 0 : firstStatus1.totalCount,
|
|
|
+ '#0d9'
|
|
|
+ )
|
|
|
// 处理完成
|
|
|
initGaugeChart(
|
|
|
dealFinishedChartRef.value,
|
|
|
firstStatus.filledCount === undefined ? 0 : firstStatus.filledCount,
|
|
|
'#f50'
|
|
|
)
|
|
|
+ initGaugeChart(
|
|
|
+ dealFinishedChartRef1.value,
|
|
|
+ firstStatus1.filledCount === undefined ? 0 : firstStatus1.filledCount,
|
|
|
+ '#f50'
|
|
|
+ )
|
|
|
// 转工单
|
|
|
initGaugeChart(
|
|
|
transOrderChartRef.value,
|
|
|
firstStatus.unfilledCount === undefined ? 0 : firstStatus.unfilledCount,
|
|
|
'#05b'
|
|
|
)
|
|
|
+ initGaugeChart(
|
|
|
+ transOrderChartRef1.value,
|
|
|
+ firstStatus1.unfilledCount === undefined ? 0 : firstStatus1.unfilledCount,
|
|
|
+ '#05b'
|
|
|
+ )
|
|
|
// 待填写
|
|
|
initGaugeChart(
|
|
|
writeChartRef.value,
|
|
@@ -525,6 +599,7 @@ const handleResize = () => {
|
|
|
onMounted(async () => {
|
|
|
queryParams.deptId = useUserStore().getUser.deptId;
|
|
|
getStats()
|
|
|
+ getDevStats();
|
|
|
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
|
|
})
|
|
|
|