|
@@ -57,8 +57,8 @@
|
|
|
format="YYYY-MM-DD"
|
|
|
/>
|
|
|
</div>
|
|
|
- <a-button @click="getData(true)" type="primary">确认</a-button>
|
|
|
- <a-button @click="export" type="primary">导出</a-button>
|
|
|
+ <a-button style="margin-right:20px" @click="getData" type="primary">确认</a-button>
|
|
|
+ <a-button @click="exporFile" type="primary">导出</a-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class="echartList">
|
|
@@ -87,6 +87,7 @@
|
|
|
import { Input, DatePicker, Card } from 'ant-design-vue';
|
|
|
import VisitAnalysisBar from './VisitAnalysisBar.vue';
|
|
|
import VisitAnalysis from './VisitAnalysis.vue';
|
|
|
+ import { exportElsxFile, } from '/@/utils/file/download';
|
|
|
const { RangePicker } = DatePicker;
|
|
|
import type { Dayjs } from 'dayjs';
|
|
|
import dayjs from 'dayjs';
|
|
@@ -114,7 +115,7 @@
|
|
|
async function getData(type) {
|
|
|
try {
|
|
|
loading.value = true;
|
|
|
- if (type) {
|
|
|
+ if (type == true) {
|
|
|
let { roomCount, shareCount, visitCount, visitManCount } = await roomData({});
|
|
|
topData.roomCount = roomCount
|
|
|
topData.shareCount = shareCount
|
|
@@ -128,11 +129,10 @@
|
|
|
roomTitle: roomTitle.value,
|
|
|
timeList: selectTime.value,
|
|
|
});
|
|
|
- viewStaticsData.value = userMsgManList
|
|
|
- shareStaticsData.value = userShareList
|
|
|
- bulletChatAmountsData.value = userMsgManList
|
|
|
- userAmountData.value = userMsgCountList
|
|
|
- console.log('visitData', visitData);
|
|
|
+ viewStaticsData.value = userVisitList//用户浏览量
|
|
|
+ shareStaticsData.value = userShareList//用户分享数
|
|
|
+ bulletChatAmountsData.value = userMsgCountList//留言总数
|
|
|
+ userAmountData.value = userMsgManList//留言人数
|
|
|
loading.value = false;
|
|
|
} catch (error) {
|
|
|
loading.value = false;
|
|
@@ -152,6 +152,26 @@
|
|
|
function calendarPriceRangeChange(date) {
|
|
|
selectPriceDate.value = date[0];
|
|
|
}
|
|
|
+ function exporFile(){
|
|
|
+ let fileTile = '带看数据统计'
|
|
|
+ let fields = {
|
|
|
+ 'time':'日期',
|
|
|
+ 'kj':'用户浏览量',
|
|
|
+ 'kk':'用户分享数',
|
|
|
+ 'ss':'留言总人数',
|
|
|
+ 'dy':'留言总数',
|
|
|
+ }
|
|
|
+ let data = viewStaticsData.value.map((ele,index) => {
|
|
|
+ return {
|
|
|
+ 'time':ele.dataKey,
|
|
|
+ 'kj':ele.dataCount|| 0,
|
|
|
+ 'kk':shareStaticsData.value && shareStaticsData.value[index]?.dataCount || 0,
|
|
|
+ 'ss':bulletChatAmountsData.value && bulletChatAmountsData.value[index]?.dataCount || 0,
|
|
|
+ 'dy':userAmountData.value && userAmountData.value[index]?.dataCount || 0,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ exportElsxFile(data,fields,fileTile)
|
|
|
+ }
|
|
|
onMounted(() => {
|
|
|
getData(true);
|
|
|
});
|