|
@@ -75,24 +75,30 @@
|
|
|
<a-row :gutter="20" style="margin-bottom: 30px">
|
|
|
<a-col :span="12">
|
|
|
<a-card :title="t('statistic.top5')" :bordered="false">
|
|
|
- <ul class="topic-list">
|
|
|
+ <ul class="topic-list" v-if="takeLookList?.length">
|
|
|
<li v-for="top in takeLookList" :key="top.dataKey">
|
|
|
<p>
|
|
|
<span>{{ top.dataKey }}</span> <span>{{ top.dataCount }}</span>
|
|
|
</p>
|
|
|
</li>
|
|
|
</ul>
|
|
|
+ <div class="topic-list-empty" v-else>
|
|
|
+ <a-empty />
|
|
|
+ </div>
|
|
|
</a-card>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-card :title="t('statistic.mTop5')" :bordered="false">
|
|
|
- <ul class="topic-list">
|
|
|
+ <ul class="topic-list" v-if="danmakuList?.length">
|
|
|
<li v-for="top in danmakuList" :key="top.dataKey">
|
|
|
<p>
|
|
|
<span>{{ top.dataKey }}</span> <span>{{ top.dataCount }}</span>
|
|
|
</p>
|
|
|
</li>
|
|
|
</ul>
|
|
|
+ <div class="topic-list-empty" v-else>
|
|
|
+ <a-empty />
|
|
|
+ </div>
|
|
|
</a-card>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -132,16 +138,23 @@
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
-
|
|
|
- <div id="chart-2" class="chart"></div>
|
|
|
+ <!-- userVisitList?.length -->
|
|
|
+ <div id="chart-2" class="chart" v-if="userVisitList?.length"></div>
|
|
|
+ <div class="chart-empty" v-else>
|
|
|
+ <a-empty />
|
|
|
+ </div>
|
|
|
</a-card>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
<a-row>
|
|
|
<a-col :span="24">
|
|
|
<a-card title="">
|
|
|
- <div id="chart-3" class="chart"></div>
|
|
|
+ <div id="chart-3" class="chart" v-if="userMsgManList?.length"></div>
|
|
|
+ <div class="chart-empty" v-else>
|
|
|
+ <a-empty />
|
|
|
+ </div>
|
|
|
</a-card>
|
|
|
+
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</div>
|
|
@@ -211,10 +224,10 @@ const initTab = async () => {
|
|
|
if (unref(userMsgCountList)?.length || unref(userMsgManList)?.length) {
|
|
|
initRoomMsgChart()
|
|
|
}
|
|
|
- setTimeout(()=>{
|
|
|
- handleResize();
|
|
|
- console.log('render');
|
|
|
- },1000)
|
|
|
+ setTimeout(() => {
|
|
|
+ handleResize()
|
|
|
+ console.log('render')
|
|
|
+ }, 1000)
|
|
|
}
|
|
|
// const initOnlineChart = () => {
|
|
|
// const chart1 = document.getElementById('chart-1')
|
|
@@ -285,7 +298,7 @@ const initRoomVisitChart = () => {
|
|
|
Math.min.apply(Math, ch1Y) === 0 ? 0 : Math.min.apply(Math, ch1Y)
|
|
|
|
|
|
if (chart) {
|
|
|
- if (!roomUseVisitChart) {
|
|
|
+ if (ch1?.length || ch2?.length) {
|
|
|
roomUseVisitChart = echarts.init(chart)
|
|
|
}
|
|
|
// 绘制图表
|
|
@@ -383,7 +396,7 @@ const initRoomMsgChart = () => {
|
|
|
Math.min.apply(Math, ch1Y) === 0 ? 0 : Math.min.apply(Math, ch1Y)
|
|
|
|
|
|
if (chart) {
|
|
|
- if (!roomMsgChart) {
|
|
|
+ if (ch1?.length || ch2?.length) {
|
|
|
roomMsgChart = echarts.init(chart)
|
|
|
}
|
|
|
// 绘制图表
|
|
@@ -546,6 +559,12 @@ const handleFinish = async () => {
|
|
|
.ant-card-body:has(.topic-list) {
|
|
|
min-height: 308px;
|
|
|
}
|
|
|
+.topic-list-empty {
|
|
|
+ min-height: 260px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
.topic-list {
|
|
|
list-style: none;
|
|
|
padding: 0;
|
|
@@ -590,4 +609,10 @@ const handleFinish = async () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.chart-empty{
|
|
|
+ min-height: 500px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
</style>
|