gemercheung 2 년 전
부모
커밋
df9c13bbce
4개의 변경된 파일40개의 추가작업 그리고 14개의 파일을 삭제
  1. 1 0
      src/components.d.ts
  2. 2 2
      src/views/room/edit-room/index.vue
  3. 36 11
      src/views/statistic/tab/tab1.vue
  4. 1 1
      src/views/statistic/tab/tab3.vue

+ 1 - 0
src/components.d.ts

@@ -13,6 +13,7 @@ declare module '@vue/runtime-core' {
     ACol: typeof import('ant-design-vue/es')['Col']
     AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
     ADropdown: typeof import('ant-design-vue/es')['Dropdown']
+    AEmpty: typeof import('ant-design-vue/es')['Empty']
     AForm: typeof import('ant-design-vue/es')['Form']
     AFormItem: typeof import('ant-design-vue/es')['FormItem']
     AInput: typeof import('ant-design-vue/es')['Input']

+ 2 - 2
src/views/room/edit-room/index.vue

@@ -151,14 +151,14 @@
                   Modal.confirm({
                     centered: true,
                     title: () => t('room.authTipTitle'),
-                    icon: () => createVNode(ExclamationCircleOutlined),
+                    icon:false,
                     //@ts-ignore
                     cancelButtonProps: { style: { display: 'none' } },
                     cancelText: false,
                     content: () =>
                       createVNode(
                         'div',
-                        { style: 'color:red;' },
+                        { style: 'color:#000;' },
                         t('room.authTipContent')
                       ),
                     class: 'test'

+ 36 - 11
src/views/statistic/tab/tab1.vue

@@ -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>

+ 1 - 1
src/views/statistic/tab/tab3.vue

@@ -132,7 +132,7 @@ const columns: TableColumnProps[] = [
   {
     title: t('statistic.departure'),
     dataIndex: 'lastOutRoomTime',
-    sorter: true
+    sorter: false
   },
   {
     title: t('statistic.amount'),