|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<Card :title="title" :loading="loading">
|
|
|
<template #extra>
|
|
|
- <condition type="2" @change="Search" :typeShow="true" @expor="handleExport" />
|
|
|
+ <condition :type="title=='管理中心用户活跃度统计'?'0':'2'" :typeShow="title=='管理中心用户活跃度统计'" @change="Search" @expor="handleExport" />
|
|
|
</template>
|
|
|
<div ref="chartRef" :style="{ height, width }"></div>
|
|
|
</Card>
|
|
@@ -15,6 +15,7 @@
|
|
|
import { ref, Ref, watch, onMounted, reactive } from 'vue';
|
|
|
import { volumeTrend, qjuserTrend } from '/@/api/statistics/index';
|
|
|
import condition from '../components/condition.vue';
|
|
|
+ import dayjs from 'dayjs';
|
|
|
import { useECharts } from '/@/hooks/web/useECharts';
|
|
|
import { exportElsxFile, } from '/@/utils/file/download';
|
|
|
const props = defineProps({
|
|
@@ -23,11 +24,10 @@
|
|
|
});
|
|
|
const value = ref(1);
|
|
|
const SearchData = reactive({
|
|
|
- startTime: '',
|
|
|
- endTime: '',
|
|
|
- dataType: 2,
|
|
|
- type: 2,
|
|
|
- timeType: 'month',
|
|
|
+ startTime: dayjs().subtract(6,'month').format('YYYY-MM-DD'),
|
|
|
+ endTime: dayjs().format('YYYY-MM-DD'),
|
|
|
+ timeType: props.title == '云容量趋势分析'?'month':'day',
|
|
|
+ infoType: props.title == '云容量趋势分析'?'add':'all',
|
|
|
});
|
|
|
const options = ref<SelectProps['options']>([
|
|
|
{
|
|
@@ -59,10 +59,16 @@
|
|
|
}
|
|
|
function Search(val) {
|
|
|
console.log('Search',val)
|
|
|
+ let timeStr = {
|
|
|
+ 0:'day',
|
|
|
+ 1:'week',
|
|
|
+ 2:'month',
|
|
|
+ }
|
|
|
const { startTime, endTime, dataType, type } = val;
|
|
|
+ SearchData.timeType = timeStr[dataType] || 'month'
|
|
|
SearchData.startTime = startTime;
|
|
|
SearchData.endTime = endTime;
|
|
|
- SearchData.type = dataType;
|
|
|
+ SearchData.infoType = props.title == '管理中心用户活跃度统计'?'all':type == '0'?'add':'all';
|
|
|
getAddUser();
|
|
|
}
|
|
|
function handleExport(){
|
|
@@ -81,21 +87,16 @@
|
|
|
}
|
|
|
async function getAddUser() {
|
|
|
let xdata = [], yData=[]
|
|
|
- let timeStr = {
|
|
|
- 0:'day',
|
|
|
- 1:'week',
|
|
|
- 2:'month',
|
|
|
- }
|
|
|
- SearchData.timeType = timeStr[SearchData.type] || 'month'
|
|
|
- let apiSrc = props.title=='云容量趋势分析'?qjuserTrend:volumeTrend
|
|
|
- const data = await apiSrc(SearchData);
|
|
|
- data.map(ele => {
|
|
|
- xdata.push(ele.groupKey)
|
|
|
- yData.push(ele.count)
|
|
|
- })
|
|
|
- yixStringData.value = xdata
|
|
|
- viewStaticsData.value = yData
|
|
|
- handlesetOptions()
|
|
|
+ let apiSrc = props.title=='云容量趋势分析'?volumeTrend:qjuserTrend
|
|
|
+ let res = await apiSrc(SearchData);
|
|
|
+ const data = res.reverse()
|
|
|
+ data.map(ele => {
|
|
|
+ xdata.push(ele.groupKey)
|
|
|
+ yData.push(ele.count)
|
|
|
+ })
|
|
|
+ yixStringData.value = xdata
|
|
|
+ viewStaticsData.value = yData
|
|
|
+ handlesetOptions()
|
|
|
}
|
|
|
function handlesetOptions() {
|
|
|
setOptions({
|