|
|
@ -1,391 +1,113 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<doc-alert title="商城手册(功能开启)" url="https://doc.iocoder.cn/mall/build/" />
|
|
|
|
<el-card shadow="never">
|
|
|
|
|
|
|
|
<el-skeleton :loading="loading" animated>
|
|
|
|
|
|
|
|
<el-row :gutter="16" justify="space-between">
|
|
|
|
|
|
|
|
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
|
|
|
|
|
|
|
<div class="flex items-center">
|
|
|
|
|
|
|
|
<el-avatar :src="avatar" :size="70" class="mr-16px">
|
|
|
|
|
|
|
|
<img src="@/assets/imgs/avatar.gif" alt="" />
|
|
|
|
|
|
|
|
</el-avatar>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<div class="text-20px">
|
|
|
|
|
|
|
|
{{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mt-10px text-14px text-gray-500">
|
|
|
|
|
|
|
|
{{ t('workplace.toady') }},20℃ - 32℃!
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
|
|
|
|
|
|
|
<div class="h-70px flex items-center justify-end lt-sm:mt-10px">
|
|
|
|
|
|
|
|
<div class="px-8px text-right">
|
|
|
|
|
|
|
|
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.project') }}</div>
|
|
|
|
|
|
|
|
<CountTo
|
|
|
|
|
|
|
|
class="text-20px"
|
|
|
|
|
|
|
|
:start-val="0"
|
|
|
|
|
|
|
|
:end-val="totalSate.project"
|
|
|
|
|
|
|
|
:duration="2600"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<el-divider direction="vertical" />
|
|
|
|
|
|
|
|
<div class="px-8px text-right">
|
|
|
|
|
|
|
|
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.toDo') }}</div>
|
|
|
|
|
|
|
|
<CountTo
|
|
|
|
|
|
|
|
class="text-20px"
|
|
|
|
|
|
|
|
:start-val="0"
|
|
|
|
|
|
|
|
:end-val="totalSate.todo"
|
|
|
|
|
|
|
|
:duration="2600"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<el-divider direction="vertical" border-style="dashed" />
|
|
|
|
|
|
|
|
<div class="px-8px text-right">
|
|
|
|
|
|
|
|
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.access') }}</div>
|
|
|
|
|
|
|
|
<CountTo
|
|
|
|
|
|
|
|
class="text-20px"
|
|
|
|
|
|
|
|
:start-val="0"
|
|
|
|
|
|
|
|
:end-val="totalSate.access"
|
|
|
|
|
|
|
|
:duration="2600"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
</el-skeleton>
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-row class="mt-8px" :gutter="8" justify="space-between">
|
|
|
|
|
|
|
|
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-8px">
|
|
|
|
|
|
|
|
<el-card shadow="never">
|
|
|
|
|
|
|
|
<template #header>
|
|
|
|
|
|
|
|
<div class="h-3 flex justify-between">
|
|
|
|
|
|
|
|
<span>{{ t('workplace.project') }}</span>
|
|
|
|
|
|
|
|
<el-link
|
|
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
|
|
:underline="false"
|
|
|
|
|
|
|
|
href="https://github.com/yudaocode"
|
|
|
|
|
|
|
|
target="_blank"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ t('action.more') }}
|
|
|
|
|
|
|
|
</el-link>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<el-skeleton :loading="loading" animated>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col
|
|
|
|
|
|
|
|
v-for="(item, index) in projects"
|
|
|
|
|
|
|
|
:key="`card-${index}`"
|
|
|
|
|
|
|
|
:xl="8"
|
|
|
|
|
|
|
|
:lg="8"
|
|
|
|
|
|
|
|
:md="8"
|
|
|
|
|
|
|
|
:sm="24"
|
|
|
|
|
|
|
|
:xs="24"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-card shadow="hover" class="mr-5px mt-5px">
|
|
|
|
|
|
|
|
<div class="flex items-center">
|
|
|
|
|
|
|
|
<Icon :icon="item.icon" :size="25" class="mr-8px" />
|
|
|
|
|
|
|
|
<span class="text-16px">{{ item.name }}</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mt-12px text-9px text-gray-400">{{ t(item.message) }}</div>
|
|
|
|
|
|
|
|
<div class="mt-12px flex justify-between text-12px text-gray-400">
|
|
|
|
|
|
|
|
<span>{{ item.personal }}</span>
|
|
|
|
|
|
|
|
<span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
</el-skeleton>
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-card shadow="never" class="mt-8px">
|
|
|
|
<div class="flex flex-col">
|
|
|
|
<el-skeleton :loading="loading" animated>
|
|
|
|
<!-- 数据对照 -->
|
|
|
|
<el-row :gutter="20" justify="space-between">
|
|
|
|
<el-row :gutter="16" class="row">
|
|
|
|
<el-col :xl="10" :lg="10" :md="24" :sm="24" :xs="24">
|
|
|
|
<el-col :md="6" :sm="12" :xs="24" :loading="loading">
|
|
|
|
<el-card shadow="hover" class="mb-8px">
|
|
|
|
<ComparisonCard
|
|
|
|
<el-skeleton :loading="loading" animated>
|
|
|
|
tag="今日"
|
|
|
|
<Echart :options="pieOptionsData" :height="280" />
|
|
|
|
title="销售额"
|
|
|
|
</el-skeleton>
|
|
|
|
prefix="¥"
|
|
|
|
</el-card>
|
|
|
|
:decimals="2"
|
|
|
|
</el-col>
|
|
|
|
:value="fenToYuan(orderComparison?.value?.orderPayPrice || 0)"
|
|
|
|
<el-col :xl="14" :lg="14" :md="24" :sm="24" :xs="24">
|
|
|
|
:reference="fenToYuan(orderComparison?.reference?.orderPayPrice || 0)"
|
|
|
|
<el-card shadow="hover" class="mb-8px">
|
|
|
|
/>
|
|
|
|
<el-skeleton :loading="loading" animated>
|
|
|
|
</el-col>
|
|
|
|
<Echart :options="barOptionsData" :height="280" />
|
|
|
|
<el-col :md="6" :sm="12" :xs="24" :loading="loading">
|
|
|
|
</el-skeleton>
|
|
|
|
<ComparisonCard
|
|
|
|
</el-card>
|
|
|
|
tag="今日"
|
|
|
|
</el-col>
|
|
|
|
title="用户访问量"
|
|
|
|
</el-row>
|
|
|
|
:value="userComparison?.value?.visitUserCount || 0"
|
|
|
|
</el-skeleton>
|
|
|
|
:reference="userComparison?.reference?.visitUserCount || 0"
|
|
|
|
</el-card>
|
|
|
|
/>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-8px">
|
|
|
|
<el-col :md="6" :sm="12" :xs="24" :loading="loading">
|
|
|
|
<el-card shadow="never">
|
|
|
|
<ComparisonCard
|
|
|
|
<template #header>
|
|
|
|
tag="今日"
|
|
|
|
<div class="h-3 flex justify-between">
|
|
|
|
title="订单量"
|
|
|
|
<span>{{ t('workplace.shortcutOperation') }}</span>
|
|
|
|
:value="orderComparison?.value?.orderPayCount || 0"
|
|
|
|
</div>
|
|
|
|
:reference="orderComparison?.reference?.orderPayCount || 0"
|
|
|
|
</template>
|
|
|
|
/>
|
|
|
|
<el-skeleton :loading="loading" animated>
|
|
|
|
</el-col>
|
|
|
|
<el-row>
|
|
|
|
<el-col :md="6" :sm="12" :xs="24" :loading="loading">
|
|
|
|
<el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-8px">
|
|
|
|
<ComparisonCard
|
|
|
|
<div class="flex items-center">
|
|
|
|
tag="今日"
|
|
|
|
<Icon :icon="item.icon" class="mr-8px" />
|
|
|
|
title="新增用户"
|
|
|
|
<el-link type="default" :underline="false" @click="setWatermark(item.name)">
|
|
|
|
:value="userComparison?.value?.registerUserCount || 0"
|
|
|
|
{{ item.name }}
|
|
|
|
:reference="userComparison?.reference?.registerUserCount || 0"
|
|
|
|
</el-link>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="16" class="row">
|
|
|
|
</el-skeleton>
|
|
|
|
<el-col :md="12">
|
|
|
|
</el-card>
|
|
|
|
<!-- 快捷入口 -->
|
|
|
|
<el-card shadow="never" class="mt-8px">
|
|
|
|
<ShortcutCard />
|
|
|
|
<template #header>
|
|
|
|
</el-col>
|
|
|
|
<div class="h-3 flex justify-between">
|
|
|
|
<el-col :md="12">
|
|
|
|
<span>{{ t('workplace.notice') }}</span>
|
|
|
|
<!-- 运营数据 -->
|
|
|
|
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>
|
|
|
|
<OperationDataCard />
|
|
|
|
</div>
|
|
|
|
</el-col>
|
|
|
|
</template>
|
|
|
|
</el-row>
|
|
|
|
<el-skeleton :loading="loading" animated>
|
|
|
|
<el-row :gutter="16" class="mb-4">
|
|
|
|
<div v-for="(item, index) in notice" :key="`dynamics-${index}`">
|
|
|
|
<el-col :md="18" :sm="24">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<!-- 会员概览 -->
|
|
|
|
<el-avatar :src="avatar" :size="35" class="mr-16px">
|
|
|
|
<MemberFunnelCard />
|
|
|
|
<img src="@/assets/imgs/avatar.gif" alt="" />
|
|
|
|
</el-col>
|
|
|
|
</el-avatar>
|
|
|
|
<el-col :md="6" :sm="24">
|
|
|
|
<div>
|
|
|
|
<!-- 会员终端 -->
|
|
|
|
<div class="text-14px">
|
|
|
|
<MemberTerminalCard />
|
|
|
|
<Highlight :keys="item.keys.map((v) => t(v))">
|
|
|
|
</el-col>
|
|
|
|
{{ item.type }} : {{ item.title }}
|
|
|
|
</el-row>
|
|
|
|
</Highlight>
|
|
|
|
<!-- 交易量趋势 -->
|
|
|
|
</div>
|
|
|
|
<TradeTrendCard class="mb-4" />
|
|
|
|
<div class="mt-16px text-12px text-gray-400">
|
|
|
|
<!-- 会员统计 -->
|
|
|
|
{{ formatTime(item.date, 'yyyy-MM-dd') }}
|
|
|
|
<MemberStatisticsCard />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<el-divider />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-skeleton>
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { set } from 'lodash-es'
|
|
|
|
import * as TradeStatisticsApi from '@/api/mall/statistics/trade'
|
|
|
|
import { EChartsOption } from 'echarts'
|
|
|
|
import * as MemberStatisticsApi from '@/api/mall/statistics/member'
|
|
|
|
import { formatTime } from '@/utils'
|
|
|
|
import { DataComparisonRespVO } from '@/api/mall/statistics/common'
|
|
|
|
|
|
|
|
import { TradeOrderSummaryRespVO } from '@/api/mall/statistics/trade'
|
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
|
import { MemberCountRespVO } from '@/api/mall/statistics/member'
|
|
|
|
import { useWatermark } from '@/hooks/web/useWatermark'
|
|
|
|
import { fenToYuan } from '@/utils'
|
|
|
|
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
|
|
|
|
import ComparisonCard from './components/ComparisonCard.vue'
|
|
|
|
import { pieOptions, barOptions } from './echarts-data'
|
|
|
|
import MemberStatisticsCard from './components/MemberStatisticsCard.vue'
|
|
|
|
|
|
|
|
import OperationDataCard from './components/OperationDataCard.vue'
|
|
|
|
defineOptions({ name: 'Home' })
|
|
|
|
import ShortcutCard from './components/ShortcutCard.vue'
|
|
|
|
|
|
|
|
import TradeTrendCard from './components/TradeTrendCard.vue'
|
|
|
|
const { t } = useI18n()
|
|
|
|
import MemberTerminalCard from '@/views/mall/statistics/member/components/MemberTerminalCard.vue'
|
|
|
|
const userStore = useUserStore()
|
|
|
|
import MemberFunnelCard from '@/views/mall/statistics/member/components/MemberFunnelCard.vue'
|
|
|
|
const { setWatermark } = useWatermark()
|
|
|
|
|
|
|
|
const loading = ref(true)
|
|
|
|
|
|
|
|
const avatar = userStore.getUser.avatar
|
|
|
|
|
|
|
|
const username = userStore.getUser.nickname
|
|
|
|
|
|
|
|
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
|
|
|
|
|
|
|
|
// 获取统计数
|
|
|
|
|
|
|
|
let totalSate = reactive<WorkplaceTotal>({
|
|
|
|
|
|
|
|
project: 0,
|
|
|
|
|
|
|
|
access: 0,
|
|
|
|
|
|
|
|
todo: 0
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getCount = async () => {
|
|
|
|
|
|
|
|
const data = {
|
|
|
|
|
|
|
|
project: 40,
|
|
|
|
|
|
|
|
access: 2340,
|
|
|
|
|
|
|
|
todo: 10
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
totalSate = Object.assign(totalSate, data)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取项目数
|
|
|
|
/** 商城首页 */
|
|
|
|
let projects = reactive<Project[]>([])
|
|
|
|
defineOptions({ name: 'MallHome' })
|
|
|
|
const getProject = async () => {
|
|
|
|
|
|
|
|
const data = [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'ruoyi-vue-pro',
|
|
|
|
|
|
|
|
icon: 'akar-icons:github-fill',
|
|
|
|
|
|
|
|
message: 'https://github.com/YunaiV/ruoyi-vue-pro',
|
|
|
|
|
|
|
|
personal: 'Spring Boot 单体架构',
|
|
|
|
|
|
|
|
time: new Date()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'yudao-ui-admin-vue3',
|
|
|
|
|
|
|
|
icon: 'logos:vue',
|
|
|
|
|
|
|
|
message: 'https://github.com/yudaocode/yudao-ui-admin-vue3',
|
|
|
|
|
|
|
|
personal: 'Vue3 + element-plus',
|
|
|
|
|
|
|
|
time: new Date()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'yudao-ui-admin-vben',
|
|
|
|
|
|
|
|
icon: 'logos:vue',
|
|
|
|
|
|
|
|
message: 'https://github.com/yudaocode/yudao-ui-admin-vben',
|
|
|
|
|
|
|
|
personal: 'Vue3 + vben(antd)',
|
|
|
|
|
|
|
|
time: new Date()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'yudao-cloud',
|
|
|
|
|
|
|
|
icon: 'akar-icons:github',
|
|
|
|
|
|
|
|
message: 'https://github.com/YunaiV/yudao-cloud',
|
|
|
|
|
|
|
|
personal: 'Spring Cloud 微服务架构',
|
|
|
|
|
|
|
|
time: new Date()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'yudao-ui-mall-uniapp',
|
|
|
|
|
|
|
|
icon: 'logos:vue',
|
|
|
|
|
|
|
|
message: 'https://github.com/yudaocode/yudao-ui-admin-uniapp',
|
|
|
|
|
|
|
|
personal: 'Vue3 + uniapp',
|
|
|
|
|
|
|
|
time: new Date()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'yudao-ui-admin-vue2',
|
|
|
|
|
|
|
|
icon: 'logos:vue',
|
|
|
|
|
|
|
|
message: 'https://github.com/yudaocode/yudao-ui-admin-vue2',
|
|
|
|
|
|
|
|
personal: 'Vue2 + element-ui',
|
|
|
|
|
|
|
|
time: new Date()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
projects = Object.assign(projects, data)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取通知公告
|
|
|
|
|
|
|
|
let notice = reactive<Notice[]>([])
|
|
|
|
|
|
|
|
const getNotice = async () => {
|
|
|
|
|
|
|
|
const data = [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
title: '系统支持 JDK 8/17/21,Vue 2/3',
|
|
|
|
|
|
|
|
type: '通知',
|
|
|
|
|
|
|
|
keys: ['通知', '8', '17', '21', '2', '3'],
|
|
|
|
|
|
|
|
date: new Date()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
title: '后端提供 Spring Boot 2.7/3.2 + Cloud 双架构',
|
|
|
|
|
|
|
|
type: '公告',
|
|
|
|
|
|
|
|
keys: ['公告', 'Boot', 'Cloud'],
|
|
|
|
|
|
|
|
date: new Date()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
title: '全部开源,个人与企业可 100% 直接使用,无需授权',
|
|
|
|
|
|
|
|
type: '通知',
|
|
|
|
|
|
|
|
keys: ['通知', '无需授权'],
|
|
|
|
|
|
|
|
date: new Date()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
title: '国内使用最广泛的快速开发平台,超 300+ 人贡献',
|
|
|
|
|
|
|
|
type: '公告',
|
|
|
|
|
|
|
|
keys: ['公告', '最广泛'],
|
|
|
|
|
|
|
|
date: new Date()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
notice = Object.assign(notice, data)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取快捷入口
|
|
|
|
const loading = ref(true) // 加载中
|
|
|
|
let shortcut = reactive<Shortcut[]>([])
|
|
|
|
const orderComparison = ref<DataComparisonRespVO<TradeOrderSummaryRespVO>>() // 交易对照数据
|
|
|
|
|
|
|
|
const userComparison = ref<DataComparisonRespVO<MemberCountRespVO>>() // 用户对照数据
|
|
|
|
const getShortcut = async () => {
|
|
|
|
|
|
|
|
const data = [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'Github',
|
|
|
|
|
|
|
|
icon: 'akar-icons:github-fill',
|
|
|
|
|
|
|
|
url: 'github.io'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'Vue',
|
|
|
|
|
|
|
|
icon: 'logos:vue',
|
|
|
|
|
|
|
|
url: 'vuejs.org'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'Vite',
|
|
|
|
|
|
|
|
icon: 'vscode-icons:file-type-vite',
|
|
|
|
|
|
|
|
url: 'https://vitejs.dev/'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'Angular',
|
|
|
|
|
|
|
|
icon: 'logos:angular-icon',
|
|
|
|
|
|
|
|
url: 'github.io'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'React',
|
|
|
|
|
|
|
|
icon: 'logos:react',
|
|
|
|
|
|
|
|
url: 'github.io'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'Webpack',
|
|
|
|
|
|
|
|
icon: 'logos:webpack',
|
|
|
|
|
|
|
|
url: 'github.io'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
shortcut = Object.assign(shortcut, data)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 用户来源
|
|
|
|
/** 查询交易对照卡片数据 */
|
|
|
|
const getUserAccessSource = async () => {
|
|
|
|
const getOrderComparison = async () => {
|
|
|
|
const data = [
|
|
|
|
orderComparison.value = await TradeStatisticsApi.getOrderComparison()
|
|
|
|
{ value: 335, name: 'analysis.directAccess' },
|
|
|
|
|
|
|
|
{ value: 310, name: 'analysis.mailMarketing' },
|
|
|
|
|
|
|
|
{ value: 234, name: 'analysis.allianceAdvertising' },
|
|
|
|
|
|
|
|
{ value: 135, name: 'analysis.videoAdvertising' },
|
|
|
|
|
|
|
|
{ value: 1548, name: 'analysis.searchEngines' }
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
set(
|
|
|
|
|
|
|
|
pieOptionsData,
|
|
|
|
|
|
|
|
'legend.data',
|
|
|
|
|
|
|
|
data.map((v) => t(v.name))
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
pieOptionsData!.series![0].data = data.map((v) => {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
name: t(v.name),
|
|
|
|
|
|
|
|
value: v.value
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const barOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 周活跃量
|
|
|
|
/** 查询会员用户数量对照卡片数据 */
|
|
|
|
const getWeeklyUserActivity = async () => {
|
|
|
|
const getUserCountComparison = async () => {
|
|
|
|
const data = [
|
|
|
|
userComparison.value = await MemberStatisticsApi.getUserCountComparison()
|
|
|
|
{ value: 13253, name: 'analysis.monday' },
|
|
|
|
|
|
|
|
{ value: 34235, name: 'analysis.tuesday' },
|
|
|
|
|
|
|
|
{ value: 26321, name: 'analysis.wednesday' },
|
|
|
|
|
|
|
|
{ value: 12340, name: 'analysis.thursday' },
|
|
|
|
|
|
|
|
{ value: 24643, name: 'analysis.friday' },
|
|
|
|
|
|
|
|
{ value: 1322, name: 'analysis.saturday' },
|
|
|
|
|
|
|
|
{ value: 1324, name: 'analysis.sunday' }
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
set(
|
|
|
|
|
|
|
|
barOptionsData,
|
|
|
|
|
|
|
|
'xAxis.data',
|
|
|
|
|
|
|
|
data.map((v) => t(v.name))
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
set(barOptionsData, 'series', [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: t('analysis.activeQuantity'),
|
|
|
|
|
|
|
|
data: data.map((v) => v.value),
|
|
|
|
|
|
|
|
type: 'bar'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const getAllApi = async () => {
|
|
|
|
/** 初始化 **/
|
|
|
|
await Promise.all([
|
|
|
|
onMounted(async () => {
|
|
|
|
getCount(),
|
|
|
|
loading.value = true
|
|
|
|
getProject(),
|
|
|
|
await Promise.all([getOrderComparison(), getUserCountComparison()])
|
|
|
|
getNotice(),
|
|
|
|
|
|
|
|
getShortcut(),
|
|
|
|
|
|
|
|
getUserAccessSource(),
|
|
|
|
|
|
|
|
getWeeklyUserActivity()
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
loading.value = false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
getAllApi()
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
.row {
|
|
|
|
|
|
|
|
.el-col {
|
|
|
|
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|