|
@@ -104,9 +104,33 @@
|
|
|
</a-card>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
+
|
|
|
<a-row>
|
|
|
<a-col :span="24">
|
|
|
- <a-card title="房间使用情况">
|
|
|
+ <a-card title="房间使用情况" style="overflow: hidden">
|
|
|
+ <div class="container search-container" style="min-width: 850px">
|
|
|
+ <a-form layout="inline" :model="formState" @finish="handleFinish">
|
|
|
+ <a-form-item label="房间名称" name="roomTitle">
|
|
|
+ <a-input
|
|
|
+ v-model:value="formState.roomTitle"
|
|
|
+ placeholder="房间名称"
|
|
|
+ >
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="使用时间" name="username">
|
|
|
+ <a-range-picker
|
|
|
+ :show-time="{ format: 'HH:mm' }"
|
|
|
+ format="YYYY-MM-DD HH:mm"
|
|
|
+ style="width: 80%"
|
|
|
+ v-model:value="formState.userTime"
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item>
|
|
|
+ <a-button type="primary" html-type="submit"> 确定 </a-button>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div id="chart-2" class="chart"></div>
|
|
|
</a-card>
|
|
|
</a-col>
|
|
@@ -122,7 +146,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { computed, onMounted, watch, watchEffect, unref } from 'vue'
|
|
|
+import {
|
|
|
+ computed,
|
|
|
+ onMounted,
|
|
|
+ watch,
|
|
|
+ watchEffect,
|
|
|
+ UnwrapRef,
|
|
|
+ unref,
|
|
|
+ reactive
|
|
|
+} from 'vue'
|
|
|
import Vue3Autocounter from 'vue3-autocounter'
|
|
|
import * as echarts from 'echarts'
|
|
|
import type { ECharts } from 'echarts'
|
|
@@ -142,6 +174,15 @@ const props = defineProps<{
|
|
|
current: string
|
|
|
}>()
|
|
|
|
|
|
+interface FormState {
|
|
|
+ roomTitle: string
|
|
|
+ userTime: string[]
|
|
|
+}
|
|
|
+const formState: UnwrapRef<FormState> = reactive({
|
|
|
+ roomTitle: '',
|
|
|
+ userTime: []
|
|
|
+})
|
|
|
+
|
|
|
const onelineTimeCount = computed(() => statisticStore.onlineTimeCount)
|
|
|
const userVisitList = computed(() => statisticStore.roomUseChart.userVisitList)
|
|
|
const userShareList = computed(() => statisticStore.roomUseChart.userShareList)
|
|
@@ -158,7 +199,11 @@ const initTab = async () => {
|
|
|
await statisticStore.fetchTop()
|
|
|
await statisticStore.fetchOnlineTimeCount()
|
|
|
await statisticStore.fetchHeroStatus()
|
|
|
- await statisticStore.fetchRoomVisitChart()
|
|
|
+ await statisticStore.fetchRoomVisitChart({
|
|
|
+ startTime: '',
|
|
|
+ endTime: '',
|
|
|
+ roomTitle: ''
|
|
|
+ })
|
|
|
}
|
|
|
const initOnlineChart = () => {
|
|
|
const chart1 = document.getElementById('chart-1')
|
|
@@ -222,7 +267,7 @@ const initRoomVisitChart = () => {
|
|
|
const ch1Y = ch1.map(i => i.dataCount)
|
|
|
const ch2X = ch2.map(i => i.dataKey)
|
|
|
|
|
|
- const allX = Array.from(new Set(ch1X.concat(ch2X)));
|
|
|
+ const allX = Array.from(new Set(ch1X.concat(ch2X)))
|
|
|
const ch2Y = ch2.map(i => i.dataCount)
|
|
|
const ch1Max = Math.max.apply(Math, ch1Y) + 200
|
|
|
const ch1Min =
|
|
@@ -321,7 +366,7 @@ const initRoomMsgChart = () => {
|
|
|
const ch1Y = ch1.map(i => i.dataCount)
|
|
|
const ch2X = ch2.map(i => i.dataKey)
|
|
|
const ch2Y = ch2.map(i => i.dataCount)
|
|
|
- const allX = Array.from(new Set(ch1X.concat(ch2X)));
|
|
|
+ const allX = Array.from(new Set(ch1X.concat(ch2X)))
|
|
|
const ch1Max = Math.max.apply(Math, ch1Y) + 100
|
|
|
const ch1Min =
|
|
|
Math.min.apply(Math, ch1Y) === 0 ? 0 : Math.min.apply(Math, ch1Y)
|
|
@@ -441,6 +486,16 @@ onMounted(async () => {
|
|
|
roomMsgChart.resize()
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+const handleFinish = async () => {
|
|
|
+ await statisticStore.fetchRoomVisitChart({
|
|
|
+ startTime: formState.userTime?.length ? formState.userTime[0] : '',
|
|
|
+ endTime: formState.userTime?.length ? formState.userTime[1] : '',
|
|
|
+ roomTitle: formState.roomTitle?.length ? formState.roomTitle : ''
|
|
|
+ })
|
|
|
+ initRoomVisitChart()
|
|
|
+ initRoomMsgChart()
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="less">
|
|
|
.status-number {
|