|
@@ -54,7 +54,7 @@
|
|
|
import VisitAnalysis from './components/VisitAnalysis.vue';
|
|
|
import VisitAnalysisBar from './components/VisitAnalysisBar.vue';
|
|
|
import {
|
|
|
- // bulletChatApi,
|
|
|
+ bulletChatApi,
|
|
|
userStaticsApi,
|
|
|
bulletChatStaticsApi,
|
|
|
bulletChatExportApi,
|
|
@@ -69,32 +69,12 @@
|
|
|
const loading = ref(true);
|
|
|
// UserStaticsModel
|
|
|
|
|
|
- const viewStaticsData = ref<StaticItemType[]>([
|
|
|
- // { date: '2022-08-21', amount: 1111 },
|
|
|
- // { date: '2022-08-22', amount: 9000 },
|
|
|
- // { date: '2022-08-23', amount: 1311 },
|
|
|
- // { date: '2022-08-24', amount: 1311 },
|
|
|
- ]);
|
|
|
+ const viewStaticsData = ref<StaticItemType[]>([]);
|
|
|
|
|
|
- const shareStaticsData = ref<StaticItemType[]>([
|
|
|
- // { date: '2022-08-21', amount: 100 },
|
|
|
- // { date: '2022-08-22', amount: 101 },
|
|
|
- // { date: '2022-08-23', amount: 1921 },
|
|
|
- // { date: '2022-08-24', amount: 1311 },
|
|
|
- ]);
|
|
|
+ const shareStaticsData = ref<StaticItemType[]>([]);
|
|
|
|
|
|
- const bulletChatAmountsData = ref<StaticItemType[]>([
|
|
|
- // { date: '2022-08-21', amount: 1020 },
|
|
|
- // { date: '2022-08-22', amount: 15201 },
|
|
|
- // { date: '2022-08-23', amount: 192221 },
|
|
|
- // { date: '2022-08-24', amount: 1711 },
|
|
|
- ]);
|
|
|
- const userAmountData = ref<StaticItemType[]>([
|
|
|
- // { date: '2022-08-21', amount: 222 },
|
|
|
- // { date: '2022-08-22', amount: 1212 },
|
|
|
- // { date: '2022-08-23', amount: 3289 },
|
|
|
- // { date: '2022-08-24', amount: 20 },
|
|
|
- ]);
|
|
|
+ const bulletChatAmountsData = ref<StaticItemType[]>([]);
|
|
|
+ const userAmountData = ref<StaticItemType[]>([]);
|
|
|
// const { t } = useI18n();
|
|
|
|
|
|
const columns: BasicColumn[] = [
|
|
@@ -136,6 +116,7 @@
|
|
|
field: 'liveRoomId',
|
|
|
label: '全部房间',
|
|
|
component: 'ApiSelect',
|
|
|
+ required: true,
|
|
|
colProps: {
|
|
|
xl: 5,
|
|
|
xxl: 5,
|
|
@@ -165,6 +146,7 @@
|
|
|
},
|
|
|
componentProps: {
|
|
|
format: 'YYYY-MM-DD',
|
|
|
+ showTime: false,
|
|
|
disabledDate(current) {
|
|
|
// console.log('current', current, date);
|
|
|
return current && current > dateUtil().endOf('day');
|
|
@@ -189,21 +171,42 @@
|
|
|
columns: columns,
|
|
|
useSearchForm: true,
|
|
|
formConfig: searchForm,
|
|
|
- api: bulletChatStaticsApi,
|
|
|
+ immediate: false,
|
|
|
+ api: bulletChatApi,
|
|
|
+ beforeFetch: (data) => {
|
|
|
+ console.log('beforeFetch', data);
|
|
|
+ data.time = data.time.map((item) => formatToDate(item));
|
|
|
+ return data;
|
|
|
+ },
|
|
|
afterFetch: function (data) {
|
|
|
- console.log('afterFetch', data);
|
|
|
+ console.log('afterFetch', arguments);
|
|
|
+ handleStatic();
|
|
|
return data;
|
|
|
},
|
|
|
searchInfo: searchInfo,
|
|
|
});
|
|
|
|
|
|
- onMounted(async () => {
|
|
|
- const data = await userStaticsApi(searchInfo);
|
|
|
- viewStaticsData.value = data.viewStatics || [];
|
|
|
- viewStaticsData.value = data.shareStatics || [];
|
|
|
- loading.value = false;
|
|
|
+ onMounted(() => {
|
|
|
+ handleStatic();
|
|
|
});
|
|
|
|
|
|
+ async function handleStatic() {
|
|
|
+ try {
|
|
|
+ loading.value = true;
|
|
|
+ const sData = await userStaticsApi(searchInfo);
|
|
|
+ const bData = await bulletChatStaticsApi(searchInfo);
|
|
|
+ console.log('sData', sData);
|
|
|
+ console.log('bData', sData);
|
|
|
+ viewStaticsData.value = sData.viewStatics;
|
|
|
+ shareStaticsData.value = sData.shareStatics;
|
|
|
+ userAmountData.value = bData.userAmount;
|
|
|
+ bulletChatAmountsData.value = bData.bulletChatAmounts;
|
|
|
+ loading.value = false;
|
|
|
+ } catch (error) {
|
|
|
+ loading.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
async function handleExport() {
|
|
|
const data = await bulletChatExportApi(searchInfo);
|
|
|
const downloadBlob = new Blob([data], {
|