Explorar el Código

wip: (dashborad) 对接企业看板API

gemercheung hace 2 años
padre
commit
9e0df0711c

+ 13 - 3
src/api/dashboard/analysis.ts

@@ -24,11 +24,11 @@ export const bulletChatApi = (params: BasicStaticsParams) =>
     },
   });
 
-//用户统计
+//企业看板
 
-export const userStaticsApi = (params: BasicStaticsParams) =>
+export const liveRoomStaticsApi = (params: BasicStaticsParams) =>
   defHttp.post<UserStaticsModel>({
-    url: Api.userStatics,
+    url: Api.liveRoomStatics,
     params,
     headers: {
       // @ts-ignore
@@ -46,6 +46,16 @@ export const bulletChatStaticsApi = (params: BasicStaticsParams) =>
     },
   });
 
+export const userStaticsApi = (params: BasicStaticsParams) =>
+  defHttp.post<UserStaticsModel>({
+    url: Api.userStatics,
+    params,
+    headers: {
+      // @ts-ignore
+      ignoreCancelToken: true,
+    },
+  });
+
 export const bulletChatExportApi = (params: BasicStaticsParams) =>
   defHttp.post<Blob>(
     {

+ 5 - 8
src/views/dashboard/analysis/enterprise.vue

@@ -29,9 +29,8 @@
   // import { useI18n } from '/@/hooks/web/useI18n';
   // import GrowCard from './components/GrowCard.vue';
   import {
-    // bulletChatApi,
-    userStaticsApi,
-    bulletChatStaticsApi,
+    liveRoomStaticsApi,
+    // bulletChatStaticsApi,
     companyChatExportApi,
   } from '/@/api/dashboard/analysis';
 
@@ -199,11 +198,11 @@
   });
 
   const [registerTable] = useTable({
-    title: '房间留言状态',
+    title: '',
     columns: columns,
     useSearchForm: true,
     formConfig: searchForm,
-    api: bulletChatStaticsApi,
+    api: liveRoomStaticsApi,
     afterFetch: function (data) {
       console.log('data', data);
 
@@ -212,9 +211,7 @@
     searchInfo: searchInfo,
   });
 
-  onMounted(async () => {
-    await userStaticsApi(searchInfo);
-  });
+  onMounted(async () => {});
   async function handleExport() {
     const data = await companyChatExportApi(searchInfo);
     const downloadBlob = new Blob([data], {

+ 1 - 1
src/views/dashboard/analysis/index.vue

@@ -176,11 +176,11 @@
     beforeFetch: (data) => {
       console.log('beforeFetch', data);
       data.time = data.time.map((item) => formatToDate(item));
+      handleStatic();
       return data;
     },
     afterFetch: function (data) {
       console.log('afterFetch', arguments);
-      handleStatic();
       return data;
     },
     searchInfo: searchInfo,