feat: 完善仪表盘总计区块内容
This commit is contained in:
parent
0ec5647421
commit
3440aa4faa
@ -18,6 +18,7 @@ package top.charles7c.cnadmin.monitor.mapper;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseMapper;
|
||||
import top.charles7c.cnadmin.monitor.model.entity.LogDO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardTotalVO;
|
||||
|
||||
/**
|
||||
* 系统日志 Mapper
|
||||
@ -25,4 +26,12 @@ import top.charles7c.cnadmin.monitor.model.entity.LogDO;
|
||||
* @author Charles7c
|
||||
* @since 2022/12/22 21:47
|
||||
*/
|
||||
public interface LogMapper extends BaseMapper<LogDO> {}
|
||||
public interface LogMapper extends BaseMapper<LogDO> {
|
||||
|
||||
/**
|
||||
* 查询仪表盘总计信息
|
||||
*
|
||||
* @return 总计信息
|
||||
*/
|
||||
DashboardTotalVO selectDashboardTotal();
|
||||
}
|
||||
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.model.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
/**
|
||||
* 仪表盘总计信息
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2023/9/8 21:32
|
||||
*/
|
||||
@Data
|
||||
public class DashboardTotalVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 浏览量(PV)
|
||||
*/
|
||||
@Schema(description = "浏览量(PV)", example = "88888")
|
||||
private Long pvCount;
|
||||
|
||||
/**
|
||||
* IP 数
|
||||
*/
|
||||
@Schema(description = "IP 数", example = "66666")
|
||||
private Long ipCount;
|
||||
|
||||
/**
|
||||
* 今日浏览量(PV)
|
||||
*/
|
||||
@Schema(description = "今日浏览量", example = "1234")
|
||||
private Long todayPvCount;
|
||||
|
||||
/**
|
||||
* 较昨日新增 PV(百分比)
|
||||
*/
|
||||
@Schema(description = "较昨日新增(百分比)", example = "23.4")
|
||||
private BigDecimal newPvFromYesterday;
|
||||
|
||||
/**
|
||||
* 昨日浏览量(PV)
|
||||
*/
|
||||
@JsonIgnore
|
||||
private Long yesterdayPvCount;
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardTotalVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
|
||||
/**
|
||||
* 仪表盘业务接口
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2023/9/8 21:32
|
||||
*/
|
||||
public interface DashboardService {
|
||||
|
||||
/**
|
||||
* 查询总计信息
|
||||
*
|
||||
* @return 总计信息
|
||||
*/
|
||||
DashboardTotalVO getTotal();
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
* @return 公告列表
|
||||
*/
|
||||
List<DashboardAnnouncementVO> listAnnouncement();
|
||||
}
|
@ -21,10 +21,7 @@ import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.monitor.model.query.LoginLogQuery;
|
||||
import top.charles7c.cnadmin.monitor.model.query.OperationLogQuery;
|
||||
import top.charles7c.cnadmin.monitor.model.query.SystemLogQuery;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.LoginLogVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.OperationLogVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.SystemLogDetailVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.SystemLogVO;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.*;
|
||||
|
||||
/**
|
||||
* 系统日志业务接口
|
||||
@ -75,4 +72,11 @@ public interface LogService {
|
||||
* @return 系统日志详情
|
||||
*/
|
||||
SystemLogDetailVO get(Long logId);
|
||||
|
||||
/**
|
||||
* 查询仪表盘总计信息
|
||||
*
|
||||
* @return 仪表盘总计信息
|
||||
*/
|
||||
DashboardTotalVO getDashboardTotal();
|
||||
}
|
||||
|
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.monitor.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardTotalVO;
|
||||
import top.charles7c.cnadmin.monitor.service.DashboardService;
|
||||
import top.charles7c.cnadmin.monitor.service.LogService;
|
||||
import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
import top.charles7c.cnadmin.system.service.AnnouncementService;
|
||||
|
||||
/**
|
||||
* 仪表盘业务实现
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2023/9/8 21:32
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DashboardServiceImpl implements DashboardService {
|
||||
|
||||
private final LogService logService;
|
||||
private final AnnouncementService announcementService;
|
||||
|
||||
@Override
|
||||
public DashboardTotalVO getTotal() {
|
||||
DashboardTotalVO totalVO = logService.getDashboardTotal();
|
||||
Long todayPvCount = totalVO.getTodayPvCount();
|
||||
Long yesterdayPvCount = totalVO.getYesterdayPvCount();
|
||||
BigDecimal newPvCountFromYesterday = NumberUtil.sub(todayPvCount, yesterdayPvCount);
|
||||
BigDecimal newPvFromYesterday = (0 == yesterdayPvCount) ? BigDecimal.valueOf(100)
|
||||
: NumberUtil.round(NumberUtil.mul(NumberUtil.div(newPvCountFromYesterday, yesterdayPvCount), 100), 1);
|
||||
totalVO.setNewPvFromYesterday(newPvFromYesterday);
|
||||
return totalVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DashboardAnnouncementVO> listAnnouncement() {
|
||||
return announcementService.listDashboard();
|
||||
}
|
||||
}
|
@ -145,6 +145,11 @@ public class LogServiceImpl implements LogService {
|
||||
return detailVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DashboardTotalVO getDashboardTotal() {
|
||||
return logMapper.selectDashboardTotal();
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充数据
|
||||
*
|
||||
|
@ -1,4 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="top.charles7c.cnadmin.monitor.mapper.LogMapper">
|
||||
<select id="selectDashboardTotal" resultType="top.charles7c.cnadmin.monitor.model.vo.DashboardTotalVO">
|
||||
SELECT
|
||||
(SELECT COUNT(*) FROM `sys_log`) AS pvCount,
|
||||
(SELECT COUNT(DISTINCT `client_ip`) FROM `sys_log`) AS ipCount,
|
||||
(SELECT COUNT(*) FROM `sys_log` WHERE DATE(`create_time`) = CURDATE()) AS todayPvCount,
|
||||
(SELECT COUNT(*) FROM `sys_log` WHERE DATE(`create_time`) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)) AS yesterdayPvCount
|
||||
</select>
|
||||
</mapper>
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.common.base.BaseMapper;
|
||||
import top.charles7c.cnadmin.system.model.entity.AnnouncementDO;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementDashboardVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
|
||||
/**
|
||||
* 公告 Mapper
|
||||
@ -35,5 +35,5 @@ public interface AnnouncementMapper extends BaseMapper<AnnouncementDO> {
|
||||
*
|
||||
* @return 公告列表
|
||||
*/
|
||||
List<AnnouncementDashboardVO> selectDashboardList();
|
||||
List<DashboardAnnouncementVO> selectDashboardList();
|
||||
}
|
@ -32,7 +32,7 @@ import top.charles7c.cnadmin.system.enums.AnnouncementTypeEnum;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "仪表盘公告信息")
|
||||
public class AnnouncementDashboardVO implements Serializable {
|
||||
public class DashboardAnnouncementVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -21,9 +21,9 @@ import java.util.List;
|
||||
import top.charles7c.cnadmin.common.base.BaseService;
|
||||
import top.charles7c.cnadmin.system.model.query.AnnouncementQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.AnnouncementRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementDashboardVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
|
||||
/**
|
||||
* 公告业务接口
|
||||
@ -39,5 +39,5 @@ public interface AnnouncementService
|
||||
*
|
||||
* @return 公告列表
|
||||
*/
|
||||
List<AnnouncementDashboardVO> listDashboard();
|
||||
List<DashboardAnnouncementVO> listDashboard();
|
||||
}
|
@ -27,9 +27,9 @@ import top.charles7c.cnadmin.system.mapper.AnnouncementMapper;
|
||||
import top.charles7c.cnadmin.system.model.entity.AnnouncementDO;
|
||||
import top.charles7c.cnadmin.system.model.query.AnnouncementQuery;
|
||||
import top.charles7c.cnadmin.system.model.request.AnnouncementRequest;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementDashboardVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementDetailVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementVO;
|
||||
import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
import top.charles7c.cnadmin.system.service.AnnouncementService;
|
||||
|
||||
/**
|
||||
@ -44,7 +44,7 @@ public class AnnouncementServiceImpl extends BaseServiceImpl<AnnouncementMapper,
|
||||
AnnouncementDetailVO, AnnouncementQuery, AnnouncementRequest> implements AnnouncementService {
|
||||
|
||||
@Override
|
||||
public List<AnnouncementDashboardVO> listDashboard() {
|
||||
public List<DashboardAnnouncementVO> listDashboard() {
|
||||
return baseMapper.selectDashboardList();
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
<mapper namespace="top.charles7c.cnadmin.system.mapper.AnnouncementMapper">
|
||||
|
||||
<select id="selectDashboardList"
|
||||
resultType="top.charles7c.cnadmin.system.model.vo.AnnouncementDashboardVO">
|
||||
resultType="top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO">
|
||||
SELECT
|
||||
`id`, `title`, `type`
|
||||
FROM `sys_announcement`
|
||||
|
@ -3,14 +3,25 @@ import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||
|
||||
const BASE_URL = '/dashboard';
|
||||
|
||||
export interface AnnouncementDashboardRecord {
|
||||
export interface DashboardTotalRecord {
|
||||
pvCount: number;
|
||||
ipCount: number;
|
||||
todayPvCount: number;
|
||||
newPvFromYesterday: number;
|
||||
}
|
||||
|
||||
export interface DashboardAnnouncementRecord {
|
||||
id: string;
|
||||
title: string;
|
||||
type: number;
|
||||
}
|
||||
|
||||
export function getTotal() {
|
||||
return axios.get<DashboardTotalRecord>(`${BASE_URL}/total`);
|
||||
}
|
||||
|
||||
export function listAnnouncement() {
|
||||
return axios.get<AnnouncementDashboardRecord[]>(`${BASE_URL}/announcement`);
|
||||
return axios.get<DashboardAnnouncementRecord[]>(`${BASE_URL}/announcement`);
|
||||
}
|
||||
|
||||
export interface ContentDataRecord {
|
1
continew-admin-ui/src/assets/icons/svg/data.svg
Normal file
1
continew-admin-ui/src/assets/icons/svg/data.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg width="24" height="24" viewBox="0 0 36 36" fill="none"><path d="M18 36C8.06 36 0 27.94 0 18S8.06 0 18 0s18 8.06 18 18-8.06 18-18 18z" fill="url(#svg_0d83078816__paint0_linear_0:672)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M10 11a1 1 0 00-1 1v13a1 1 0 001 1h16a1 1 0 001-1V12a1 1 0 00-1-1H10zm2.229 8.66a.2.2 0 01.038-.281l4.074-3.063a.2.2 0 01.25.007l2.357 1.99a.2.2 0 00.253.006l3.252-2.54a.2.2 0 01.277.03l.994 1.194a.2.2 0 01-.029.285l-4.497 3.57a.2.2 0 01-.25 0l-2.438-1.979a.2.2 0 00-.245-.005l-2.807 2.066a.2.2 0 01-.277-.039l-.952-1.24z" fill="#fff"/><defs><linearGradient id="svg_0d83078816__paint0_linear_0:672" x1="-6.786" y1="21.575" x2="20.433" y2="43.68" gradientUnits="userSpaceOnUse"><stop stop-color="#599AFF"/><stop offset="1" stop-color="#3D89FF"/></linearGradient></defs></svg>
|
After Width: | Height: | Size: 812 B |
1
continew-admin-ui/src/assets/icons/svg/hot.svg
Normal file
1
continew-admin-ui/src/assets/icons/svg/hot.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg width="24" height="24" viewBox="0 0 36 36" fill="none"><circle cx="18" cy="18" r="18" fill="url(#svg_2b62ab03ed__paint0_linear_0:735)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.677 8.55c.073.666-.154 1.497-.547 2.526-.981 2.573-5.63 3.229-5.63 9.993 0 .36.049.676.126.964.362 3.35 3.404 5.967 7.101 5.967 3.943 0 7.39-3.426 7.704-7 .223-2.54.003-4.697-2.106-6.561l-.432.203a3.888 3.888 0 01-.448 1.743 3.58 3.58 0 01-.26.408c-.025.037-.05.073-.079.108a3.773 3.773 0 01-.277.312c-.04.04-.078.082-.121.122-.098.09-.201.176-.308.257-.035.026-.074.051-.11.077-.096.067-.193.13-.293.19l-.128.075c-.146.08-.298.158-.465.23.091-.177.172-.362.247-.552.02-.05.036-.101.055-.152.056-.153.106-.308.15-.465l.039-.145c.051-.2.095-.404.127-.614l.003-.012a7.227 7.227 0 00-.054-2.423c-.345-1.79-1.425-3.791-3.448-5.678l-.846.427z" fill="#fff"/><ellipse cx="17.188" cy="8.5" rx=".512" ry=".5" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M23.373 14.515a.25.25 0 10-.457.204l.457-.204z" fill="#fff"/><circle cx="18" cy="18" r="18" fill="url(#svg_2b62ab03ed__paint1_linear_0:735)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M22.216 12.662c2.09 1.93 3.284 4.69 3.284 7.586C25.5 24.53 22.142 28 18 28c-4.142 0-7.5-3.47-7.5-7.752 0-5.768 6.427-7.844 6.427-12.248.191.048.38.108.563.18 2.421.95 3.773 5.44 2.854 7.942a4.395 4.395 0 001.872-3.46z" fill="#fff"/><defs><linearGradient id="svg_2b62ab03ed__paint0_linear_0:735" x1="-8.128" y1="18.956" x2="19.654" y2="44.109" gradientUnits="userSpaceOnUse"><stop stop-color="#FF8585"/><stop offset="1" stop-color="#FF5E5E"/></linearGradient><linearGradient id="svg_2b62ab03ed__paint1_linear_0:735" x1="-8.128" y1="18.956" x2="19.654" y2="44.109" gradientUnits="userSpaceOnUse"><stop stop-color="#FF8585"/><stop offset="1" stop-color="#FF5E5E"/></linearGradient></defs></svg>
|
After Width: | Height: | Size: 1.8 KiB |
1
continew-admin-ui/src/assets/icons/svg/popularity.svg
Normal file
1
continew-admin-ui/src/assets/icons/svg/popularity.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg width="24" height="24" viewBox="0 0 36 36" fill="none"><circle cx="18" cy="18" r="18" fill="url(#svg_60fdab9bf6__paint0_linear_0:667)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.677 8.55c.073.665-.154 1.497-.547 2.526-.981 2.573-5.63 3.229-5.63 9.993 0 .36.049.676.126.964.362 3.35 3.404 5.967 7.101 5.967 3.943 0 7.39-3.426 7.704-7 .223-2.54.003-4.697-2.106-6.561l-.432.203a3.888 3.888 0 01-.448 1.743 3.588 3.588 0 01-.26.408c-.025.037-.05.073-.079.108a3.773 3.773 0 01-.277.312c-.04.04-.078.082-.121.122-.098.09-.201.176-.308.257-.035.026-.074.051-.11.077a4.45 4.45 0 01-.421.265c-.146.08-.298.158-.465.23.091-.177.172-.362.247-.552.02-.05.036-.101.055-.152.056-.153.106-.308.15-.465l.039-.145c.051-.2.095-.404.127-.614l.003-.012a7.227 7.227 0 00-.054-2.423c-.345-1.79-1.425-3.791-3.448-5.678l-.846.427z" fill="#fff"/><ellipse cx="17.188" cy="8.5" rx=".512" ry=".5" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M23.373 14.515a.25.25 0 10-.457.204l.457-.204z" fill="#fff"/><circle cx="18" cy="18" r="18" fill="url(#svg_60fdab9bf6__paint1_linear_0:667)"/><rect x="8.5" y="17.5" width="4" height="9" rx="1" fill="#fff"/><rect x="16" y="9.5" width="4" height="17" rx="1" fill="#fff"/><rect x="23.5" y="13.5" width="4" height="13" rx="1" fill="#fff"/><defs><linearGradient id="svg_60fdab9bf6__paint0_linear_0:667" x1="-8.128" y1="18.956" x2="19.654" y2="44.109" gradientUnits="userSpaceOnUse"><stop stop-color="#FF8585"/><stop offset="1" stop-color="#FF5E5E"/></linearGradient><linearGradient id="svg_60fdab9bf6__paint1_linear_0:667" x1="-8.128" y1="18.956" x2="19.654" y2="44.109" gradientUnits="userSpaceOnUse"><stop stop-color="#FF8585"/><stop offset="1" stop-color="#FF5E5E"/></linearGradient></defs></svg>
|
After Width: | Height: | Size: 1.7 KiB |
1
continew-admin-ui/src/assets/icons/svg/same-city.svg
Normal file
1
continew-admin-ui/src/assets/icons/svg/same-city.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg width="24" height="24" viewBox="0 0 36 36" fill="none"><circle cx="18" cy="18" r="18" fill="url(#svg_1300b2c8f8__paint0_linear_0:785)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M21.792 13.04c0 1.401-.546 2.67-1.428 3.583.445.087.884.199 1.313.334-.88 1.037-1.415 2.424-1.415 4.008 0 1.349 1.036 3.022 2.298 4.56-1.394.255-3.267.475-5.582.475-4.39 0-7.19-.791-8.148-1.113a.472.472 0 01-.318-.525c.198-1.3 1.078-5.483 4.337-6.887.393-.17.789-.318 1.185-.447a5.118 5.118 0 01-1.87-3.988c0-2.783 2.155-5.04 4.814-5.04 2.659 0 4.814 2.257 4.814 5.04z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M25.496 25.818C24.42 24.902 22 22.642 22 20.846 22 18.538 23.6 17 26 17s4 1.923 4 3.846c0 1.506-2.452 3.955-3.517 4.947a.739.739 0 01-.987.025zm.508-3.345c.828 0 1.5-.688 1.5-1.538 0-.85-.672-1.538-1.5-1.538s-1.5.688-1.5 1.538c0 .85.672 1.539 1.5 1.539z" fill="#fff"/><defs><linearGradient id="svg_1300b2c8f8__paint0_linear_0:785" x1="-6.027" y1="16.545" x2="17.227" y2="42.116" gradientUnits="userSpaceOnUse"><stop stop-color="#5ED1D1"/><stop offset="1" stop-color="#39C4C4"/></linearGradient></defs></svg>
|
After Width: | Height: | Size: 1.1 KiB |
@ -84,12 +84,12 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import {
|
||||
AnnouncementDashboardRecord,
|
||||
DashboardAnnouncementRecord,
|
||||
listAnnouncement,
|
||||
} from '@/api/dashboard';
|
||||
} from '@/api/common/dashboard';
|
||||
import { DataRecord, get } from '@/api/system/announcement';
|
||||
|
||||
const dataList = ref<AnnouncementDashboardRecord[]>([]);
|
||||
const dataList = ref<DashboardAnnouncementRecord[]>([]);
|
||||
const dataDetail = ref<DataRecord>({});
|
||||
const detailLoading = ref(false);
|
||||
const detailVisible = ref(false);
|
||||
|
@ -3,22 +3,16 @@
|
||||
indicator-type="slider"
|
||||
show-arrow="hover"
|
||||
auto-play
|
||||
style="width: 100%; height: 170px; border-radius: 4px; overflow: hidden"
|
||||
style="width: 100%; height: 300px; border-radius: 4px; overflow: hidden"
|
||||
>
|
||||
<a-carousel-item v-for="(src, idx) in imageSrc" :key="idx">
|
||||
<div>
|
||||
<img :src="src" style="width: 100%" />
|
||||
<img :src="src" style="width: 100%" alt="QrCode" />
|
||||
</div>
|
||||
</a-carousel-item>
|
||||
</a-carousel>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const imageSrc = [
|
||||
'//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/5cc3cd1d994b7ef9db6a1f619a22addd.jpg~tplv-49unhts6dw-image.image',
|
||||
'//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/f256cbcc287139e191fecea9d255a1f0.jpg~tplv-49unhts6dw-image.image',
|
||||
'//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/b557ff0cd44146a2e471b477af2f30d0.jpg~tplv-49unhts6dw-image.image',
|
||||
'//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/665106f4bbd2a2df96eaf7aec52f7bc3.jpg~tplv-49unhts6dw-image.image',
|
||||
'//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/ea095a2c9c72b5d8f2f2818040db736d.jpg~tplv-49unhts6dw-image.image',
|
||||
];
|
||||
const imageSrc = ['https://doc.charles7c.top/qrcode.jpg'];
|
||||
</script>
|
||||
|
@ -20,7 +20,7 @@
|
||||
import { ref } from 'vue';
|
||||
import { graphic } from 'echarts';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { queryContentData, ContentDataRecord } from '@/api/dashboard';
|
||||
import { queryContentData, ContentDataRecord } from '@/api/common/dashboard';
|
||||
import useChartOption from '@/hooks/chart-option';
|
||||
import { ToolTipFormatterParams } from '@/types/echarts';
|
||||
import { AnyObject } from '@/types/global';
|
||||
|
@ -6,21 +6,17 @@
|
||||
>
|
||||
<a-space>
|
||||
<a-avatar :size="54" class="col-avatar">
|
||||
<img
|
||||
alt="avatar"
|
||||
src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/288b89194e657603ff40db39e8072640.svg~tplv-49unhts6dw-image.image"
|
||||
/>
|
||||
<svg-icon icon-class="popularity" />
|
||||
</a-avatar>
|
||||
<a-statistic
|
||||
:title="$t('workplace.onlineContent')"
|
||||
:value="373.5"
|
||||
:precision="1"
|
||||
:title="$t('workplace.pvCount')"
|
||||
:value="totalData.pvCount"
|
||||
:value-from="0"
|
||||
animation
|
||||
show-group-separator
|
||||
>
|
||||
<template #suffix>
|
||||
W+ <span class="unit">{{ $t('workplace.pecs') }}</span>
|
||||
<span class="unit">{{ $t('workplace.unit.times') }}</span>
|
||||
</template>
|
||||
</a-statistic>
|
||||
</a-space>
|
||||
@ -31,20 +27,17 @@
|
||||
>
|
||||
<a-space>
|
||||
<a-avatar :size="54" class="col-avatar">
|
||||
<img
|
||||
alt="avatar"
|
||||
src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/fdc66b07224cdf18843c6076c2587eb5.svg~tplv-49unhts6dw-image.image"
|
||||
/>
|
||||
<svg-icon icon-class="same-city" />
|
||||
</a-avatar>
|
||||
<a-statistic
|
||||
:title="$t('workplace.putIn')"
|
||||
:value="368"
|
||||
:title="$t('workplace.ipCount')"
|
||||
:value="totalData.ipCount"
|
||||
:value-from="0"
|
||||
animation
|
||||
show-group-separator
|
||||
>
|
||||
<template #suffix>
|
||||
<span class="unit">{{ $t('workplace.pecs') }}</span>
|
||||
<span class="unit">{{ $t('workplace.unit.pecs') }}</span>
|
||||
</template>
|
||||
</a-statistic>
|
||||
</a-space>
|
||||
@ -55,20 +48,17 @@
|
||||
>
|
||||
<a-space>
|
||||
<a-avatar :size="54" class="col-avatar">
|
||||
<img
|
||||
alt="avatar"
|
||||
src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/77d74c9a245adeae1ec7fb5d4539738d.svg~tplv-49unhts6dw-image.image"
|
||||
/>
|
||||
<svg-icon icon-class="hot" />
|
||||
</a-avatar>
|
||||
<a-statistic
|
||||
:title="$t('workplace.newDay')"
|
||||
:value="8874"
|
||||
:title="$t('workplace.todayPvCount')"
|
||||
:value="totalData.todayPvCount"
|
||||
:value-from="0"
|
||||
animation
|
||||
show-group-separator
|
||||
>
|
||||
<template #suffix>
|
||||
<span class="unit">{{ $t('workplace.pecs') }}</span>
|
||||
<span class="unit">{{ $t('workplace.unit.times') }}</span>
|
||||
</template>
|
||||
</a-statistic>
|
||||
</a-space>
|
||||
@ -80,19 +70,26 @@
|
||||
>
|
||||
<a-space>
|
||||
<a-avatar :size="54" class="col-avatar">
|
||||
<img
|
||||
alt="avatar"
|
||||
src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/c8b36e26d2b9bb5dbf9b74dd6d7345af.svg~tplv-49unhts6dw-image.image"
|
||||
/>
|
||||
<svg-icon icon-class="data" />
|
||||
</a-avatar>
|
||||
<a-statistic
|
||||
:title="$t('workplace.newFromYesterday')"
|
||||
:value="2.8"
|
||||
:title="$t('workplace.newPvFromYesterday')"
|
||||
:value="totalData.newPvFromYesterday"
|
||||
:precision="1"
|
||||
:value-from="0"
|
||||
animation
|
||||
>
|
||||
<template #suffix> % <icon-caret-up class="up-icon" /> </template>
|
||||
<template #suffix>
|
||||
%
|
||||
<icon-caret-up
|
||||
v-if="totalData.newPvFromYesterday > 0"
|
||||
class="up-icon"
|
||||
/>
|
||||
<icon-caret-down
|
||||
v-if="totalData.newPvFromYesterday < 0"
|
||||
class="down-icon"
|
||||
/>
|
||||
</template>
|
||||
</a-statistic>
|
||||
</a-space>
|
||||
</a-grid-item>
|
||||
@ -102,7 +99,30 @@
|
||||
</a-grid>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup></script>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { DashboardTotalRecord, getTotal } from '@/api/common/dashboard';
|
||||
|
||||
const totalData = ref<DashboardTotalRecord>({
|
||||
pvCount: 0,
|
||||
ipCount: 0,
|
||||
todayPvCount: 0,
|
||||
newPvFromYesterday: 0.0,
|
||||
});
|
||||
|
||||
/**
|
||||
* 查询总计信息
|
||||
*/
|
||||
const getData = async () => {
|
||||
try {
|
||||
const { data } = await getTotal();
|
||||
totalData.value = data;
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
}
|
||||
};
|
||||
getData();
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.arco-grid.panel {
|
||||
@ -120,6 +140,9 @@
|
||||
.up-icon {
|
||||
color: rgb(var(--red-6));
|
||||
}
|
||||
.down-icon {
|
||||
color: rgb(var(--green-6));
|
||||
}
|
||||
.unit {
|
||||
margin-left: 8px;
|
||||
color: rgb(var(--gray-8));
|
||||
|
@ -75,7 +75,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { queryPopularList } from '@/api/dashboard';
|
||||
import { queryPopularList } from '@/api/common/dashboard';
|
||||
import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||
|
||||
const type = ref('text');
|
||||
|
@ -4,10 +4,10 @@ export default {
|
||||
'workplace.balance': 'Balance (CNY)',
|
||||
'workplace.order.pending': 'Pending',
|
||||
'workplace.order.pendingRenewal': 'Renewal Order',
|
||||
'workplace.onlineContent': 'Online Content',
|
||||
'workplace.putIn': 'Put In',
|
||||
'workplace.newDay': 'Daily Additional Comments',
|
||||
'workplace.newFromYesterday': 'New From Yesterday',
|
||||
'workplace.pvCount': 'Pv Count',
|
||||
'workplace.ipCount': 'Ip Count',
|
||||
'workplace.todayPvCount': 'Today Pv Count',
|
||||
'workplace.newPvFromYesterday': 'New Pv From Yesterday',
|
||||
'workplace.minute': 'Min',
|
||||
'workplace.docs': 'Documents',
|
||||
'workplace.docs.intro': 'Project Introduction',
|
||||
@ -28,5 +28,6 @@ export default {
|
||||
'workplace.popularContent.image': 'image',
|
||||
'workplace.popularContent.video': 'video',
|
||||
'workplace.categoriesPercent': 'Categories Percent',
|
||||
'workplace.pecs': 'pecs',
|
||||
'workplace.unit.pecs': 'pecs',
|
||||
'workplace.unit.times': 'times',
|
||||
};
|
||||
|
@ -4,10 +4,10 @@ export default {
|
||||
'workplace.balance': '余额(元)',
|
||||
'workplace.order.pending': '待支付',
|
||||
'workplace.order.pendingRenewal': '待续费订单',
|
||||
'workplace.onlineContent': '线上总内容',
|
||||
'workplace.putIn': '投放中内容',
|
||||
'workplace.newDay': '日新增评论',
|
||||
'workplace.newFromYesterday': '较昨日新增',
|
||||
'workplace.pvCount': '浏览量(PV)',
|
||||
'workplace.ipCount': 'IP数',
|
||||
'workplace.todayPvCount': '今日浏览量',
|
||||
'workplace.newPvFromYesterday': '较昨日新增',
|
||||
'workplace.minute': '分钟',
|
||||
'workplace.docs': '帮助文档',
|
||||
'workplace.docs.intro': '项目简介',
|
||||
@ -28,5 +28,6 @@ export default {
|
||||
'workplace.popularContent.image': '图片',
|
||||
'workplace.popularContent.video': '视频',
|
||||
'workplace.categoriesPercent': '内容类型占比',
|
||||
'workplace.pecs': '个',
|
||||
'workplace.unit.pecs': '个',
|
||||
'workplace.unit.times': '次',
|
||||
};
|
||||
|
@ -13,7 +13,8 @@ export default {
|
||||
'realTimeMonitor.list.title.duration': 'Duration',
|
||||
'realTimeMonitor.list.title.id': 'ID',
|
||||
'realTimeMonitor.list.tip.rotations': 'Rotations ',
|
||||
'realTimeMonitor.list.tip.rest': ', The program list is not visible to viewers',
|
||||
'realTimeMonitor.list.tip.rest':
|
||||
', The program list is not visible to viewers',
|
||||
'realTimeMonitor.list.tag.auditFailed': 'Audit Failed',
|
||||
'realTimeMonitor.tab.title.liveMethod': 'Live Method',
|
||||
'realTimeMonitor.tab.title.onlinePopulation': 'Online Population',
|
||||
|
@ -30,8 +30,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import top.charles7c.cnadmin.common.model.vo.R;
|
||||
import top.charles7c.cnadmin.monitor.annotation.Log;
|
||||
import top.charles7c.cnadmin.system.model.vo.AnnouncementDashboardVO;
|
||||
import top.charles7c.cnadmin.system.service.AnnouncementService;
|
||||
import top.charles7c.cnadmin.monitor.model.vo.DashboardTotalVO;
|
||||
import top.charles7c.cnadmin.monitor.service.DashboardService;
|
||||
import top.charles7c.cnadmin.system.model.vo.DashboardAnnouncementVO;
|
||||
|
||||
/**
|
||||
* 仪表盘 API
|
||||
@ -47,11 +48,17 @@ import top.charles7c.cnadmin.system.service.AnnouncementService;
|
||||
@RequestMapping("/dashboard")
|
||||
public class DashboardController {
|
||||
|
||||
private final AnnouncementService announcementService;
|
||||
private final DashboardService dashboardService;
|
||||
|
||||
@Operation(summary = "查询总计信息", description = "查询总计信息")
|
||||
@GetMapping("/total")
|
||||
public R<DashboardTotalVO> getTotal() {
|
||||
return R.ok(dashboardService.getTotal());
|
||||
}
|
||||
|
||||
@Operation(summary = "查询公告列表", description = "查询公告列表")
|
||||
@GetMapping("/announcement")
|
||||
public R<List<AnnouncementDashboardVO>> listAnnouncement() {
|
||||
return R.ok(announcementService.listDashboard());
|
||||
public R<List<DashboardAnnouncementVO>> listAnnouncement() {
|
||||
return R.ok(dashboardService.listAnnouncement());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user