Explorar o código

每小时发送量

wuyi hai 1 ano
pai
achega
22a5b7c848
Modificáronse 1 ficheiros con 22 adicións e 3 borrados
  1. 22 3
      src/views/StatisticsView.vue

+ 22 - 3
src/views/StatisticsView.vue

@@ -1,17 +1,25 @@
 <template>
     <div class="an" :style="{}">
-        <ElButton :icon="Refresh" @click="codeStatistics()"></ElButton>
+        <ElButton :icon="Refresh" @click="refresh()"></ElButton>
     </div>
     <div class="myTable" :style="{width:'100%',marginTop:'20px'}">
         <ElTable :data="tableData" stripe show-summary>
             <ElTableColumn prop="channel" label="渠道" align="center" />
             <ElTableColumn label="取码量" align="center">
                 <ElTableColumn prop="yesterdayData" label="昨日数据" align="center" sortable />
-                <ElTableColumn prop="todayData" label="今日数据" align="center" sortable  />
+                <ElTableColumn prop="todayData" label="今日数据" align="center" sortable />
             </ElTableColumn>
             <ElTableColumn prop="balance" label="余额" align="center" />
         </ElTable>
     </div>
+    <div class="myTable" :style="{width:'100%',marginTop:'20px'}">
+        <ElTable :data="hourSentData" stripe show-summary>
+            <ElTableColumn label="每小时发送量" align="center">
+                <ElTableColumn prop="hour" label="时间" align="center" />
+                <ElTableColumn prop="sent" label="发送量" align="center" />
+            </ElTableColumn>
+        </ElTable>
+    </div>
 </template>
 
 <script setup>
@@ -22,11 +30,18 @@ import { Refresh } from '@vicons/tabler'
 const isAdmin = inject('isAdmin')
 const tableData = ref([])
 const balanceData = ref([])
+const hourSentData = ref([])
 
 onMounted(() => {
     codeStatistics()
+    hourSentStatistics()
 })
 
+async function refresh() {
+    codeStatistics()
+    hourSentStatistics()
+}
+
 async function codeStatistics() {
     tableData.value = await http.get(`/task/codeStatistics`)
     balanceData.value = await http.get(`/task/balanceStatistics`)
@@ -37,7 +52,11 @@ async function codeStatistics() {
             item.balance = '-'
         }
     })
-    console.log(tableData.value)
 }
 
+async function hourSentStatistics() {
+    hourSentData.value = await http.get(`/task/hourSentStatistics`)
+}
+
+
 </script>