|
@@ -1,21 +1,8 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <a-card title="任务统计" v-if="state.statistics.length !== 0" >
|
|
|
|
|
- <a-row justify="center">
|
|
|
|
|
- <a-col
|
|
|
|
|
- v-for="item in state.statistics"
|
|
|
|
|
- :key="item.key"
|
|
|
|
|
- :xs="12" :sm="12" :md="6" :lg="8" :xl="4"
|
|
|
|
|
- >
|
|
|
|
|
- <div class="statistic" >
|
|
|
|
|
- <span class="count" :style="{color: item.color}" >{{item.value}}</span>
|
|
|
|
|
- <span>台</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="label" >
|
|
|
|
|
- {{item.label}}
|
|
|
|
|
- </div>
|
|
|
|
|
- </a-col>
|
|
|
|
|
- </a-row>
|
|
|
|
|
- </a-card>
|
|
|
|
|
|
|
+ <StatisticsTemplate
|
|
|
|
|
+ title="规则统计"
|
|
|
|
|
+ :list="state.TaskCount"
|
|
|
|
|
+ />
|
|
|
<a-card style="margin-top: 20px;" >
|
|
<a-card style="margin-top: 20px;" >
|
|
|
<a-row justify="space-between" >
|
|
<a-row justify="space-between" >
|
|
|
<a-col span="12" >
|
|
<a-col span="12" >
|
|
@@ -277,7 +264,7 @@ const state = reactive({
|
|
|
deviceList: [],
|
|
deviceList: [],
|
|
|
deviceModalVisible: false,
|
|
deviceModalVisible: false,
|
|
|
taskId: '',
|
|
taskId: '',
|
|
|
- statistics: []
|
|
|
|
|
|
|
+ TaskCount: []
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const modalRef = reactive({
|
|
const modalRef = reactive({
|
|
@@ -350,7 +337,6 @@ const ok = () => {
|
|
|
modalRef.taskConfig.cmdParameters.forEach(item => {
|
|
modalRef.taskConfig.cmdParameters.forEach(item => {
|
|
|
obj[item.paramLabel] = item.dataUnit
|
|
obj[item.paramLabel] = item.dataUnit
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
modalRef.taskConfig.cmdParameters = obj
|
|
modalRef.taskConfig.cmdParameters = obj
|
|
|
}
|
|
}
|
|
|
console.log(modalRef)
|
|
console.log(modalRef)
|
|
@@ -401,17 +387,14 @@ const getDeviceList = async () => {
|
|
|
|
|
|
|
|
const getStatistics = async () => {
|
|
const getStatistics = async () => {
|
|
|
const { data } = await TaskController.statistics()
|
|
const { data } = await TaskController.statistics()
|
|
|
- if (data == null) {
|
|
|
|
|
- state.statistics = []
|
|
|
|
|
- } else {
|
|
|
|
|
- state.statistics = Object.keys(data).map(key => {
|
|
|
|
|
- const item = TaskController.taskStatisticsMap.get(key)
|
|
|
|
|
- return {
|
|
|
|
|
- ...item,
|
|
|
|
|
- value: data[key]
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ state.TaskCount = Object.keys(data).map(key => {
|
|
|
|
|
+ const item = TaskController.taskStatisticsMap.get(key)
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ value: data[key]
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log('11', state.TaskCount)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const getTaskById = async (id: string) => {
|
|
const getTaskById = async (id: string) => {
|