2022-04-08 02:42:44 +00:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="workbench">
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<div class="md:flex">
|
|
|
|
|
|
<el-card class="!border-none mb-4 md:mr-4" shadow="never">
|
2022-04-08 02:42:44 +00:00
|
|
|
|
<template #header>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<span class="card-title">版本信息</span>
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
<div>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<div class="flex leading-9">
|
2022-09-16 08:17:08 +00:00
|
|
|
|
<div class="w-20 flex-none">当前版本</div>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<span> {{ workbenchData.version.version }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="flex leading-9">
|
2022-09-16 08:17:08 +00:00
|
|
|
|
<div class="w-20 flex-none">基于框架</div>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<span> {{ workbenchData.version.based }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="flex leading-9">
|
2022-09-16 08:17:08 +00:00
|
|
|
|
<div class="w-20 felx-none">获取渠道</div>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<div>
|
|
|
|
|
|
<a :href="workbenchData.version.channel.website" target="_blank">
|
|
|
|
|
|
<el-button type="success" size="small">官网</el-button>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
<a
|
|
|
|
|
|
class="ml-3"
|
|
|
|
|
|
:href="workbenchData.version.channel.gitee"
|
|
|
|
|
|
target="_blank"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-button type="danger" size="small">Gitee</el-button>
|
|
|
|
|
|
</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-card>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<el-card class="!border-none mb-4 flex-1" shadow="never">
|
2022-04-08 02:42:44 +00:00
|
|
|
|
<template #header>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<span class="card-title">今日数据</span>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<span class="text-tx-secondary text-xs ml-4">
|
|
|
|
|
|
更新时间:{{ workbenchData.today.time }}
|
|
|
|
|
|
</span>
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<div class="flex flex-wrap">
|
|
|
|
|
|
<div class="w-1/2 md:w-1/4">
|
|
|
|
|
|
<div class="leading-10">访问量(人)</div>
|
|
|
|
|
|
<div class="text-6xl">{{ workbenchData.today.todayVisits }}</div>
|
|
|
|
|
|
<div class="text-tx-secondary text-xs">
|
|
|
|
|
|
总访问量:{{ workbenchData.today.totalVisits }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="w-1/2 md:w-1/4">
|
|
|
|
|
|
<div class="leading-10">销售额(元)</div>
|
|
|
|
|
|
<div class="text-6xl">{{ workbenchData.today.todaySales }}</div>
|
|
|
|
|
|
<div class="text-tx-secondary text-xs">
|
|
|
|
|
|
总销售额:{{ workbenchData.today.totalSales }}
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<div class="w-1/2 md:w-1/4">
|
|
|
|
|
|
<div class="leading-10">订单量(笔)</div>
|
|
|
|
|
|
<div class="text-6xl">{{ workbenchData.today.todayOrder }}</div>
|
|
|
|
|
|
<div class="text-tx-secondary text-xs">
|
|
|
|
|
|
总订单量:{{ workbenchData.today.totalOrder }}
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<div class="w-1/2 md:w-1/4">
|
|
|
|
|
|
<div class="leading-10">新增用户</div>
|
|
|
|
|
|
<div class="text-6xl">{{ workbenchData.today.todayUsers }}</div>
|
|
|
|
|
|
<div class="text-tx-secondary text-xs">
|
|
|
|
|
|
总访用户:{{ workbenchData.today.totalUsers }}
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
</div>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<div class="function mb-4">
|
|
|
|
|
|
<el-card class="flex-1 !border-none" shadow="never">
|
2022-04-08 02:42:44 +00:00
|
|
|
|
<template #header>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<span>常用功能</span>
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</template>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<div class="flex flex-wrap">
|
|
|
|
|
|
<div
|
2022-04-08 02:42:44 +00:00
|
|
|
|
v-for="item in workbenchData.menu"
|
2022-08-12 10:44:09 +00:00
|
|
|
|
class="md:w-[12.5%] w-1/4 flex flex-col items-center"
|
2022-04-08 02:42:44 +00:00
|
|
|
|
:key="item"
|
2022-08-12 10:44:09 +00:00
|
|
|
|
>
|
|
|
|
|
|
<router-link :to="item.url" class="mb-3 flex flex-col items-center">
|
|
|
|
|
|
<img width="40" height="40" :src="item.image" />
|
|
|
|
|
|
<div class="mt-2">{{ item.name }}</div>
|
|
|
|
|
|
</router-link>
|
|
|
|
|
|
</div>
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
</div>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<div class="md:flex">
|
|
|
|
|
|
<el-card class="flex-1 !border-none md:mr-4 mb-4" shadow="never">
|
2022-04-08 02:42:44 +00:00
|
|
|
|
<template #header>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<span>访问量趋势图</span>
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</template>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<div>
|
|
|
|
|
|
<v-charts
|
|
|
|
|
|
style="height: 350px"
|
|
|
|
|
|
:option="workbenchData.visitorOption"
|
|
|
|
|
|
:autoresize="true"
|
|
|
|
|
|
/>
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-card>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<el-card class="!border-none mb-4" shadow="never">
|
2022-04-08 02:42:44 +00:00
|
|
|
|
<template #header>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<span>服务支持</span>
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</template>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<div>
|
|
|
|
|
|
<div v-for="(item, index) in workbenchData.support" :key="index">
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="flex items-center pb-10 pt-10"
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
'border-b border-br': index == 0
|
|
|
|
|
|
}"
|
|
|
|
|
|
>
|
|
|
|
|
|
<img width="120" height="120" class="flex-none" :src="item.image" />
|
|
|
|
|
|
<div class="ml-2">
|
|
|
|
|
|
<div>{{ item.title }}</div>
|
|
|
|
|
|
<div class="text-tx-regular text-xs mt-4">{{ item.desc }}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</div>
|
2022-08-12 10:44:09 +00:00
|
|
|
|
</el-card>
|
2022-04-08 02:42:44 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
2022-08-12 10:44:09 +00:00
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
import { getWorkbench } from '@/api/app'
|
|
|
|
|
|
import vCharts from 'vue-echarts'
|
|
|
|
|
|
import menu_admin from './image/menu_admin.png'
|
|
|
|
|
|
import menu_role from './image/menu_role.png'
|
|
|
|
|
|
import menu_dept from './image/menu_dept.png'
|
|
|
|
|
|
import menu_dict from './image/menu_dict.png'
|
|
|
|
|
|
import menu_generator from './image/menu_generator.png'
|
|
|
|
|
|
import menu_file from './image/menu_file.png'
|
|
|
|
|
|
import menu_auth from './image/menu_auth.png'
|
|
|
|
|
|
import menu_web from './image/menu_web.png'
|
|
|
|
|
|
import qq_group from './image/qq_group.png'
|
|
|
|
|
|
import customer_service from './image/customer_service.png'
|
|
|
|
|
|
// 表单数据
|
|
|
|
|
|
const workbenchData: any = reactive({
|
|
|
|
|
|
version: {
|
|
|
|
|
|
version: '', // 版本号
|
|
|
|
|
|
website: '', // 官网
|
|
|
|
|
|
based: '',
|
|
|
|
|
|
channel: {
|
|
|
|
|
|
gitee: '',
|
|
|
|
|
|
website: ''
|
2022-04-08 02:42:44 +00:00
|
|
|
|
}
|
2022-08-12 10:44:09 +00:00
|
|
|
|
},
|
|
|
|
|
|
support: [
|
|
|
|
|
|
{
|
|
|
|
|
|
image: qq_group,
|
|
|
|
|
|
title: '扫码进入QQ交流群',
|
|
|
|
|
|
desc: '疑难疑点 进入QQ群'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
image: customer_service,
|
|
|
|
|
|
title: '添加企业客服微信',
|
|
|
|
|
|
desc: '想了解更多请添加客服'
|
2022-04-08 02:42:44 +00:00
|
|
|
|
}
|
2022-08-12 10:44:09 +00:00
|
|
|
|
],
|
|
|
|
|
|
today: {}, // 今日数据
|
|
|
|
|
|
menu: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '管理员',
|
|
|
|
|
|
image: menu_admin,
|
|
|
|
|
|
url: '/permission/admin'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '角色管理',
|
|
|
|
|
|
image: menu_role,
|
|
|
|
|
|
url: '/permission/role'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '部门管理',
|
|
|
|
|
|
image: menu_dept,
|
|
|
|
|
|
url: '/organization/department'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '字典管理',
|
|
|
|
|
|
image: menu_dict,
|
|
|
|
|
|
url: '/setting/dict'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '代码生成器',
|
|
|
|
|
|
image: menu_generator,
|
|
|
|
|
|
url: '/dev_tools/code'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '素材中心',
|
|
|
|
|
|
image: menu_file,
|
|
|
|
|
|
url: '/material/index'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '菜单权限',
|
|
|
|
|
|
image: menu_auth,
|
|
|
|
|
|
url: '/permission/menu'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '网站信息',
|
|
|
|
|
|
image: menu_web,
|
|
|
|
|
|
url: '/setting/website/information'
|
2022-04-08 02:42:44 +00:00
|
|
|
|
}
|
2022-08-12 10:44:09 +00:00
|
|
|
|
], // 常用功能
|
|
|
|
|
|
visitor: [], // 访问量
|
|
|
|
|
|
article: [], // 文章阅读量
|
2022-04-08 02:42:44 +00:00
|
|
|
|
|
2022-08-12 10:44:09 +00:00
|
|
|
|
visitorOption: {
|
|
|
|
|
|
xAxis: {
|
|
|
|
|
|
type: 'category',
|
|
|
|
|
|
data: [0]
|
|
|
|
|
|
},
|
|
|
|
|
|
yAxis: {
|
|
|
|
|
|
type: 'value'
|
|
|
|
|
|
},
|
|
|
|
|
|
legend: {
|
|
|
|
|
|
data: ['访问量']
|
|
|
|
|
|
},
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
// 点的颜色。
|
|
|
|
|
|
color: 'red'
|
|
|
|
|
|
},
|
|
|
|
|
|
tooltip: {
|
|
|
|
|
|
trigger: 'axis'
|
|
|
|
|
|
},
|
|
|
|
|
|
series: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '访问量',
|
|
|
|
|
|
data: [0],
|
|
|
|
|
|
type: 'line',
|
|
|
|
|
|
smooth: true
|
2022-04-08 02:42:44 +00:00
|
|
|
|
}
|
2022-08-12 10:44:09 +00:00
|
|
|
|
]
|
2022-04-08 02:42:44 +00:00
|
|
|
|
}
|
2022-08-12 10:44:09 +00:00
|
|
|
|
})
|
2022-04-08 02:42:44 +00:00
|
|
|
|
|
2022-08-12 10:44:09 +00:00
|
|
|
|
// 获取工作台主页数据
|
|
|
|
|
|
const getData = async () => {
|
|
|
|
|
|
const res = await getWorkbench()
|
|
|
|
|
|
workbenchData.version = res.version
|
|
|
|
|
|
workbenchData.today = res.today
|
|
|
|
|
|
workbenchData.visitor = res.visitor
|
2022-04-08 02:42:44 +00:00
|
|
|
|
|
2022-08-12 10:44:09 +00:00
|
|
|
|
// 清空echarts 数据
|
|
|
|
|
|
workbenchData.visitorOption.xAxis.data = []
|
|
|
|
|
|
workbenchData.visitorOption.series[0].data = []
|
|
|
|
|
|
|
|
|
|
|
|
// 写入从后台拿来的数据
|
|
|
|
|
|
workbenchData.visitorOption.xAxis.data = res.visitor.date
|
|
|
|
|
|
workbenchData.visitorOption.series[0].data = res.visitor.list
|
2022-04-08 02:42:44 +00:00
|
|
|
|
}
|
2022-08-12 10:44:09 +00:00
|
|
|
|
|
|
|
|
|
|
getData()
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style>
|