修改后台默认主页内容
This commit is contained in:
parent
5f7fa198ca
commit
cff0b3d326
@ -0,0 +1,45 @@
|
||||
package com.ruoyi.cms.controller;
|
||||
|
||||
import com.ruoyi.cms.domain.vo.ServerVo;
|
||||
import com.ruoyi.cms.service.IndexInfoService;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 统计系统
|
||||
*/
|
||||
@RequestMapping("/indexInfo")
|
||||
@RestController
|
||||
public class IndexInfoController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IndexInfoService infoService;
|
||||
|
||||
@Autowired
|
||||
private RuoYiConfig ruoYiConfig;
|
||||
|
||||
/**
|
||||
* 统计栏目、内容、大赛、参数人数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping()
|
||||
public AjaxResult getIndexInfo(){
|
||||
return success(infoService.getSiteStat());
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统信息
|
||||
*/
|
||||
@GetMapping("/server")
|
||||
public AjaxResult getServerInfo(){
|
||||
ServerVo serverVo = new ServerVo();
|
||||
serverVo.setName(ruoYiConfig.getName());
|
||||
serverVo.setVersion(ruoYiConfig.getVersion());
|
||||
return success(serverVo);
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.ruoyi.cms.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ServerVo {
|
||||
|
||||
/** 项目名称 */
|
||||
private String name;
|
||||
|
||||
/** 版本 */
|
||||
private String version;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.ruoyi.cms.domain.vo;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 统计类
|
||||
*/
|
||||
@Data
|
||||
public class SiteStatVo extends BaseEntity {
|
||||
|
||||
/** 栏目数量 */
|
||||
private Long categoryCount;
|
||||
|
||||
/** 文章数量 */
|
||||
private Long contentCount;
|
||||
|
||||
/** 大赛数量 */
|
||||
private Long competitionCount;
|
||||
|
||||
/** 参赛人员数量 */
|
||||
private Long studentCount;
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cms.domain.vo.SiteStatVo;
|
||||
|
||||
/**
|
||||
* 统计系统
|
||||
*/
|
||||
public interface IndexInfoService {
|
||||
|
||||
public SiteStatVo getSiteStat();
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cms.domain.CmsCategory;
|
||||
import com.ruoyi.cms.domain.CmsContent;
|
||||
import com.ruoyi.cms.domain.HitCompetition;
|
||||
import com.ruoyi.cms.domain.HitRegistrationStudentInfo;
|
||||
import com.ruoyi.cms.domain.vo.SiteStatVo;
|
||||
import com.ruoyi.cms.mapper.CmsCategoryMapper;
|
||||
import com.ruoyi.cms.mapper.CmsContentMapper;
|
||||
import com.ruoyi.cms.mapper.HitCompetitionMapper;
|
||||
import com.ruoyi.cms.mapper.HitRegistrationStudentInfoMapper;
|
||||
import com.ruoyi.cms.service.IndexInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class IndexInfoServiceImpl implements IndexInfoService {
|
||||
|
||||
@Autowired
|
||||
private CmsContentMapper contentMapper;
|
||||
|
||||
@Autowired
|
||||
private CmsCategoryMapper categoryMapper;
|
||||
|
||||
@Autowired
|
||||
private HitCompetitionMapper competitionMapper;
|
||||
|
||||
@Autowired
|
||||
private HitRegistrationStudentInfoMapper studentInfoMapper;
|
||||
|
||||
@Override
|
||||
public SiteStatVo getSiteStat() {
|
||||
SiteStatVo siteStatVo = new SiteStatVo();
|
||||
siteStatVo.setCategoryCount(categoryMapper.selectCount(new QueryWrapper<CmsCategory>().eq("is_disable", 0)));
|
||||
siteStatVo.setContentCount(contentMapper.selectCount(new QueryWrapper<CmsContent>().eq("del_flag", 0)));
|
||||
siteStatVo.setCompetitionCount(competitionMapper.selectCount(new QueryWrapper<HitCompetition>()));
|
||||
siteStatVo.setStudentCount(studentInfoMapper.selectCount(new QueryWrapper<HitRegistrationStudentInfo>()));
|
||||
return siteStatVo;
|
||||
}
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
# 项目相关配置
|
||||
ruoyi:
|
||||
# 名称
|
||||
name: RuoYi
|
||||
name: 后台管理系统
|
||||
# 版本
|
||||
version: 3.8.8
|
||||
version: 1.2.1
|
||||
# 版权年份
|
||||
copyrightYear: 2024
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
|
@ -1,9 +1,9 @@
|
||||
# 项目相关配置
|
||||
ruoyi:
|
||||
# 名称
|
||||
name: RuoYi
|
||||
name: 后台管理系统
|
||||
# 版本
|
||||
version: 3.8.8
|
||||
version: 1.2.1
|
||||
# 版权年份
|
||||
copyrightYear: 2024
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
|
@ -5,57 +5,87 @@
|
||||
<mapper namespace="com.ruoyi.cms.mapper.CmsContentMapper">
|
||||
|
||||
<resultMap type="CmsContent" id="CmsContentResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="categoryId" column="category_id" />
|
||||
<result property="contentType" column="content_type" />
|
||||
<result property="contentTitle" column="content_title" />
|
||||
<result property="contentImg" column="content_img" />
|
||||
<result property="contentDetail" column="content_detail" />
|
||||
<result property="source" column="source" />
|
||||
<result property="sourceUrl" column="source_url" />
|
||||
<result property="original" column="original" />
|
||||
<result property="author" column="author" />
|
||||
<result property="editor" column="editor" />
|
||||
<result property="summary" column="summary" />
|
||||
<result property="status" column="status" />
|
||||
<result property="publishDate" column="publish_date" />
|
||||
<result property="offlineDate" column="offline_date" />
|
||||
<result property="isAccessory" column="is_accessory" />
|
||||
<result property="accessoryUrl" column="accessory_url" javaType="java.util.List" typeHandler="com.ruoyi.system.handler.MysqlTypeHandler" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="imageUrl" column="image_url" javaType="java.util.List" typeHandler="com.ruoyi.system.handler.MysqlTypeHandler"/>
|
||||
<result property="videoUrl" column="video_url" javaType="java.util.List" typeHandler="com.ruoyi.system.handler.MysqlTypeHandler"/>
|
||||
<result property="id" column="id"/>
|
||||
<result property="categoryId" column="category_id"/>
|
||||
<result property="contentType" column="content_type"/>
|
||||
<result property="contentTitle" column="content_title"/>
|
||||
<result property="contentImg" column="content_img"/>
|
||||
<result property="contentDetail" column="content_detail"/>
|
||||
<result property="source" column="source"/>
|
||||
<result property="sourceUrl" column="source_url"/>
|
||||
<result property="original" column="original"/>
|
||||
<result property="author" column="author"/>
|
||||
<result property="editor" column="editor"/>
|
||||
<result property="summary" column="summary"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="publishDate" column="publish_date"/>
|
||||
<result property="offlineDate" column="offline_date"/>
|
||||
<result property="isAccessory" column="is_accessory"/>
|
||||
<result property="accessoryUrl" column="accessory_url" javaType="java.util.List"
|
||||
typeHandler="com.ruoyi.system.handler.MysqlTypeHandler"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="imageUrl" column="image_url" javaType="java.util.List"
|
||||
typeHandler="com.ruoyi.system.handler.MysqlTypeHandler"/>
|
||||
<result property="videoUrl" column="video_url" javaType="java.util.List"
|
||||
typeHandler="com.ruoyi.system.handler.MysqlTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCmsContentVo">
|
||||
select id, category_id, content_type,image_url, video_url, content_title, content_img, content_detail, source, source_url, original, author, editor, summary, status, publish_date, offline_date, is_accessory, accessory_url, remark, del_flag, create_time, create_by, update_time, update_by from cms_content
|
||||
select id,
|
||||
category_id,
|
||||
content_type,
|
||||
image_url,
|
||||
video_url,
|
||||
content_title,
|
||||
content_img,
|
||||
content_detail,
|
||||
source,
|
||||
source_url,
|
||||
original,
|
||||
author,
|
||||
editor,
|
||||
summary,
|
||||
status,
|
||||
publish_date,
|
||||
offline_date,
|
||||
is_accessory,
|
||||
accessory_url,
|
||||
remark,
|
||||
del_flag,
|
||||
create_time,
|
||||
create_by,
|
||||
update_time,
|
||||
update_by
|
||||
from cms_content
|
||||
</sql>
|
||||
|
||||
<select id="selectCmsContentList" parameterType="CmsContent" resultMap="CmsContentResult">
|
||||
<include refid="selectCmsContentVo"/>
|
||||
<where>
|
||||
<if test="categoryId != null "> and category_id = #{categoryId}</if>
|
||||
<if test="contentType != null "> and content_type = #{contentType}</if>
|
||||
<if test="contentTitle != null and contentTitle != ''"> and content_title like concat('%', #{contentTitle}, '%')</if>
|
||||
<if test="contentImg != null and contentImg != ''"> and content_img = #{contentImg}</if>
|
||||
<if test="contentDetail != null and contentDetail != ''"> and content_detail = #{contentDetail}</if>
|
||||
<if test="source != null and source != ''"> and source = #{source}</if>
|
||||
<if test="sourceUrl != null and sourceUrl != ''"> and source_url = #{sourceUrl}</if>
|
||||
<if test="original != null "> and original = #{original}</if>
|
||||
<if test="author != null and author != ''"> and author = #{author}</if>
|
||||
<if test="editor != null and editor != ''"> and editor = #{editor}</if>
|
||||
<if test="summary != null and summary != ''"> and summary = #{summary}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="publishDate != null "> and publish_date = #{publishDate}</if>
|
||||
<if test="offlineDate != null "> and offline_date = #{offlineDate}</if>
|
||||
<if test="isAccessory != null "> and is_accessory = #{isAccessory}</if>
|
||||
<if test="accessoryUrl != null and accessoryUrl != ''"> and accessory_url = #{accessoryUrl}</if>
|
||||
<if test="delFlag != null"> and del_flag = #{delFlag}</if>
|
||||
<if test="categoryId != null ">and category_id = #{categoryId}</if>
|
||||
<if test="contentType != null ">and content_type = #{contentType}</if>
|
||||
<if test="contentTitle != null and contentTitle != ''">and content_title like concat('%', #{contentTitle},
|
||||
'%')
|
||||
</if>
|
||||
<if test="contentImg != null and contentImg != ''">and content_img = #{contentImg}</if>
|
||||
<if test="contentDetail != null and contentDetail != ''">and content_detail = #{contentDetail}</if>
|
||||
<if test="source != null and source != ''">and source = #{source}</if>
|
||||
<if test="sourceUrl != null and sourceUrl != ''">and source_url = #{sourceUrl}</if>
|
||||
<if test="original != null ">and original = #{original}</if>
|
||||
<if test="author != null and author != ''">and author = #{author}</if>
|
||||
<if test="editor != null and editor != ''">and editor = #{editor}</if>
|
||||
<if test="summary != null and summary != ''">and summary = #{summary}</if>
|
||||
<if test="status != null ">and status = #{status}</if>
|
||||
<if test="publishDate != null ">and publish_date = #{publishDate}</if>
|
||||
<if test="offlineDate != null ">and offline_date = #{offlineDate}</if>
|
||||
<if test="isAccessory != null ">and is_accessory = #{isAccessory}</if>
|
||||
<if test="accessoryUrl != null and accessoryUrl != ''">and accessory_url = #{accessoryUrl}</if>
|
||||
<if test="delFlag != null">and del_flag = #{delFlag}</if>
|
||||
</where>
|
||||
order by create_time desc, update_time desc
|
||||
</select>
|
||||
@ -111,51 +141,59 @@
|
||||
<if test="publishDate != null">#{publishDate},</if>
|
||||
<if test="offlineDate != null">#{offlineDate},</if>
|
||||
<if test="isAccessory != null and isAccessory != ''">#{isAccessory},</if>
|
||||
<if test="accessoryUrl != null and accessoryUrl.size() != 0">#{accessoryUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},</if>
|
||||
<if test="accessoryUrl != null and accessoryUrl.size() != 0">
|
||||
#{accessoryUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},
|
||||
</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="imageUrl != null and imageUrl.size() != 0">#{imageUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},</if>
|
||||
<if test="videoUrl != null and videoUrl.size() != 0">#{videoUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},</if>
|
||||
<if test="imageUrl != null and imageUrl.size() != 0">
|
||||
#{imageUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},
|
||||
</if>
|
||||
<if test="videoUrl != null and videoUrl.size() != 0">
|
||||
#{videoUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCmsContent" parameterType="CmsContent">
|
||||
update cms_content
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="categoryId != null">category_id = #{categoryId},</if>
|
||||
<if test="contentType != null">content_type = #{contentType},</if>
|
||||
<if test="contentTitle != null and contentTitle != ''">content_title = #{contentTitle},</if>
|
||||
<if test="contentImg != null and contentImg != ''">content_img = #{contentImg},</if>
|
||||
<if test="contentDetail != null and contentDetail != '' ">content_detail = #{contentDetail},</if>
|
||||
<if test="source != null and source != ''">source = #{source},</if>
|
||||
<if test="sourceUrl != null and sourceUrl != ''">source_url = #{sourceUrl},</if>
|
||||
<if test="original != null and original != ''">original = #{original},</if>
|
||||
<if test="author != null and author != ''">author = #{author},</if>
|
||||
<if test="editor != null and editor != ''">editor = #{editor},</if>
|
||||
<if test="summary != null and summary != ''">summary = #{summary},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="publishDate != null">publish_date = #{publishDate},</if>
|
||||
<if test="offlineDate != null">offline_date = #{offlineDate},</if>
|
||||
<if test="isAccessory != null and isAccessory != ''">is_accessory = #{isAccessory},</if>
|
||||
<if test="accessoryUrl != null and accessoryUrl.size() != 0">accessory_url = #{accessoryUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="imageUrl != null and imageUrl.size() != 0">image_url = #{imageUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},</if>
|
||||
<if test="videoUrl != null and videoUrl.size() != 0">video_url = #{videoUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},</if>
|
||||
category_id = #{categoryId},
|
||||
content_type = #{contentType},
|
||||
content_title = #{contentTitle},
|
||||
content_img = #{contentImg},
|
||||
content_detail = #{contentDetail},
|
||||
source = #{source},
|
||||
source_url = #{sourceUrl},
|
||||
original = #{original},
|
||||
author = #{author},
|
||||
editor = #{editor},
|
||||
summary = #{summary},
|
||||
status = #{status},
|
||||
publish_date = #{publishDate},
|
||||
offline_date = #{offlineDate},
|
||||
is_accessory = #{isAccessory},
|
||||
accessory_url = #{accessoryUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},
|
||||
remark = #{remark},
|
||||
del_flag = #{delFlag},
|
||||
create_time = #{createTime},
|
||||
create_by = #{createBy},
|
||||
update_time = #{updateTime},
|
||||
update_by = #{updateBy},
|
||||
image_url = #{imageUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},
|
||||
video_url = #{videoUrl,jdbcType=OTHER,typeHandler=com.ruoyi.system.handler.MysqlTypeHandler},
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCmsContentById" parameterType="Long">
|
||||
delete from cms_content where id = #{id}
|
||||
delete
|
||||
from cms_content
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCmsContentByIds" parameterType="String">
|
||||
|
16
ruoyi-ui/src/api/cms/indexInfo.js
Normal file
16
ruoyi-ui/src/api/cms/indexInfo.js
Normal file
@ -0,0 +1,16 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
export function getSiteStatData() {
|
||||
return request({
|
||||
url: '/indexInfo',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getCmsConfiguration() {
|
||||
return request({
|
||||
url: '/indexInfo/server',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
1
ruoyi-ui/src/assets/icons/svg/content.svg
Normal file
1
ruoyi-ui/src/assets/icons/svg/content.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM7 6H11V10H7V6ZM7 12H17V14H7V12ZM7 16H17V18H7V16ZM13 7H17V9H13V7Z"></path></svg>
|
After Width: | Height: | Size: 287 B |
1
ruoyi-ui/src/assets/icons/svg/treelog.svg
Normal file
1
ruoyi-ui/src/assets/icons/svg/treelog.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 2C10.5523 2 11 2.44772 11 3V7C11 7.55228 10.5523 8 10 8H8V10H13V9C13 8.44772 13.4477 8 14 8H20C20.5523 8 21 8.44772 21 9V13C21 13.5523 20.5523 14 20 14H14C13.4477 14 13 13.5523 13 13V12H8V18H13V17C13 16.4477 13.4477 16 14 16H20C20.5523 16 21 16.4477 21 17V21C21 21.5523 20.5523 22 20 22H14C13.4477 22 13 21.5523 13 21V20H7C6.44772 20 6 19.5523 6 19V8H4C3.44772 8 3 7.55228 3 7V3C3 2.44772 3.44772 2 4 2H10ZM19 18H15V20H19V18ZM19 10H15V12H19V10ZM9 4H5V6H9V4Z"></path></svg>
|
After Width: | Height: | Size: 545 B |
216
ruoyi-ui/src/views/dashboard/cmsInfo/index.vue
Normal file
216
ruoyi-ui/src/views/dashboard/cmsInfo/index.vue
Normal file
@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<div class="site-container mb10">
|
||||
<el-card shadow="hover">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>数据统计</span>
|
||||
</div>
|
||||
<div class="body">
|
||||
<el-row :gutter="15" class="mt10">
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" v-loading="siteStatLoading">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<svg-icon icon-class="treelog" class-name="cc-card-panel-icon" />
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-statistic title="栏目数">
|
||||
<template slot="formatter"> {{ siteStat.categoryCount }} </template>
|
||||
</el-statistic>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" v-loading="siteStatLoading">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<svg-icon icon-class="content" class-name="cc-card-panel-icon" />
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-statistic title="内容数">
|
||||
<template slot="formatter"> {{ siteStat.contentCount }} </template>
|
||||
</el-statistic>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" v-loading="siteStatLoading">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<svg-icon icon-class="druid" class-name="cc-card-panel-icon" />
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-statistic title="大赛数">
|
||||
<template slot="formatter"> {{ siteStat.competitionCount }} </template>
|
||||
</el-statistic>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="hover" v-loading="siteStatLoading">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<svg-icon icon-class="form" class-name="cc-card-panel-icon" />
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-statistic title="参赛人数">
|
||||
<template slot="formatter"> {{ siteStat.studentCount }} </template>
|
||||
</el-statistic>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
</style>
|
||||
<script>
|
||||
import { getSiteStatData } from "@/api/cms/indexInfo";
|
||||
|
||||
export default {
|
||||
name: "CMSSiteStatOverview",
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
siteStatLoading: false,
|
||||
siteStat: {
|
||||
categoryCount: 0,
|
||||
contentCount: 0,
|
||||
competitionCount: 0,
|
||||
studentCount: 0,
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loadSiteStatData();
|
||||
},
|
||||
methods: {
|
||||
loadSiteStatData() {
|
||||
this.siteStatLoading = true;
|
||||
getSiteStatData().then(response => {
|
||||
this.siteStatLoading = false
|
||||
this.siteStat = response.data
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cc-card-panel-icon {
|
||||
font-size: 48px;
|
||||
color: #40c9c6
|
||||
}
|
||||
.panel-group {
|
||||
margin-top: 18px;
|
||||
|
||||
.card-panel-col {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.card-panel {
|
||||
height: 108px;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
color: #666;
|
||||
background: #fff;
|
||||
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
|
||||
border-color: rgba(0, 0, 0, .05);
|
||||
|
||||
&:hover {
|
||||
.card-panel-icon-wrapper {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.icon-people {
|
||||
background: #40c9c6;
|
||||
}
|
||||
|
||||
.icon-message {
|
||||
background: #36a3f7;
|
||||
}
|
||||
|
||||
.icon-money {
|
||||
background: #f4516c;
|
||||
}
|
||||
|
||||
.icon-shopping {
|
||||
background: #34bfa3
|
||||
}
|
||||
}
|
||||
|
||||
.icon-people {
|
||||
color: #40c9c6;
|
||||
}
|
||||
|
||||
.icon-message {
|
||||
color: #36a3f7;
|
||||
}
|
||||
|
||||
.icon-money {
|
||||
color: #f4516c;
|
||||
}
|
||||
|
||||
.icon-shopping {
|
||||
color: #34bfa3
|
||||
}
|
||||
|
||||
.card-panel-icon-wrapper {
|
||||
float: left;
|
||||
margin: 14px 0 0 14px;
|
||||
padding: 16px;
|
||||
transition: all 0.38s ease-out;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.card-panel-icon {
|
||||
float: left;
|
||||
font-size: 48px;
|
||||
}
|
||||
|
||||
.card-panel-description {
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
margin: 26px;
|
||||
margin-left: 0px;
|
||||
|
||||
.card-panel-text {
|
||||
line-height: 18px;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
font-size: 16px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.card-panel-num {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:550px) {
|
||||
.card-panel-description {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.card-panel-icon-wrapper {
|
||||
float: none !important;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0 !important;
|
||||
|
||||
.svg-icon {
|
||||
display: block;
|
||||
margin: 14px auto !important;
|
||||
float: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,68 +1,44 @@
|
||||
<!--<template>-->
|
||||
<!-- <div class="dashboard-container">-->
|
||||
<!-- <el-card shadow="hover" class="mb10">-->
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
<!-- <span>应用信息</span>-->
|
||||
<!-- </div>-->
|
||||
<!--<!– <div class="el-table el-table--enable-row-hover el-table--medium">–>-->
|
||||
<!--<!– <table cellspacing="0" style="width: 100%;">–>-->
|
||||
<!--<!– <tbody>–>-->
|
||||
<!--<!– <tr>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf"><div class="cell attrname">{{ $t('Monitor.Server.AppName') }}</div></td>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf"><div class="cell">{{ serverInfo.app.name }} [ {{ serverInfo.app.alias }} ] </div></td>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf"><div class="cell attrname">{{ $t('Monitor.Server.AppVersion') }}</div></td>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf"><div class="cell">{{ serverInfo.app.version }}</div></td>–>-->
|
||||
<!--<!– </tr>–>-->
|
||||
<!--<!– <tr>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf"><div class="cell attrname">{{ $t('Monitor.Server.JVMStartTime') }}</div></td>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf"><div class="cell">{{ serverInfo.startTime }}</div></td>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf"><div class="cell attrname">{{ $t('Monitor.Server.JVMRunTime') }}</div></td>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf"><div class="cell">{{ serverInfo.runTime }}</div></td>–>-->
|
||||
<!--<!– </tr>–>-->
|
||||
<!--<!– <tr>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf"><div class="cell attrname">{{ $t('CMS.Dashboard.PublishStrategy') }}</div></td>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf" colspan="3"><div class="cell">{{ config.publishStrategy }}</div></td>–>-->
|
||||
<!--<!– </tr>–>-->
|
||||
<!--<!– <tr>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf"><div class="cell attrname">{{ $t('CMS.Dashboard.ResourceRoot') }}</div></td>–>-->
|
||||
<!--<!– <td class="el-table__cell is-leaf" colspan="3"><div class="cell">{{ config.resourceRoot }}</div></td>–>-->
|
||||
<!--<!– </tr>–>-->
|
||||
<!--<!– </tbody>–>-->
|
||||
<!--<!– </table>–>-->
|
||||
<!--<!– </div>–>-->
|
||||
<!-- </el-card>-->
|
||||
<template>
|
||||
<div class="dashboard-container">
|
||||
<el-card shadow="hover" class="mb10">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>应用信息</span>
|
||||
</div>
|
||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||
<table cellspacing="0" style="width: 100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="el-table__cell is-leaf"><div class="cell attrname">应用名称</div></td>
|
||||
<td class="el-table__cell is-leaf"><div class="cell">{{config.name}}</div></td>
|
||||
<td class="el-table__cell is-leaf"><div class="cell attrname">应用版本号</div></td>
|
||||
<td class="el-table__cell is-leaf"><div class="cell">{{ config.version }}</div></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- </div>-->
|
||||
<!--</template>-->
|
||||
<!--<script>-->
|
||||
<!--import { getDashboardServerInfo } from "@/api/monitor/server";-->
|
||||
<!--import { getCmsConfiguration } from "@/api/contentcore/dashboard";-->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getCmsConfiguration} from '@/api/cms/indexInfo'
|
||||
|
||||
<!--export default {-->
|
||||
<!-- name: "ServerInfoDashboard",-->
|
||||
<!-- data () {-->
|
||||
<!-- return {-->
|
||||
<!-- serverInfo: {-->
|
||||
<!-- app: {}-->
|
||||
<!-- },-->
|
||||
<!-- config:{}-->
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- created() {-->
|
||||
<!-- this.loadServerInfo();-->
|
||||
<!-- this.loadCmsConfiguration();-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- loadServerInfo() {-->
|
||||
<!-- getDashboardServerInfo().then(response => {-->
|
||||
<!-- this.serverInfo = response.data;-->
|
||||
<!-- })-->
|
||||
<!-- },-->
|
||||
<!-- loadCmsConfiguration() {-->
|
||||
<!-- getCmsConfiguration().then(response => {-->
|
||||
<!-- this.config = response.data;-->
|
||||
<!-- })-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--};-->
|
||||
<!--</script>-->
|
||||
export default {
|
||||
name: "ServerInfoDashboard",
|
||||
data () {
|
||||
return {
|
||||
config:{}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loadServerInfo();
|
||||
},
|
||||
methods: {
|
||||
loadServerInfo() {
|
||||
getCmsConfiguration().then(response => {
|
||||
this.config = response.data;
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -4,9 +4,15 @@
|
||||
<el-col :span="24">
|
||||
<user-info></user-info>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<cms-info></cms-info>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<shortcut></shortcut>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<server-info></server-info>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
@ -14,12 +20,16 @@
|
||||
<script>
|
||||
import SysUserInfo from '@/views/dashboard/userInfo'
|
||||
import SysShortcut from '@/views/dashboard/shortcut'
|
||||
import CmsInfo from '@/views/dashboard/cmsInfo'
|
||||
import ServerInfo from '@/views/dashboard/serverInfo'
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
components: {
|
||||
'user-info': SysUserInfo,
|
||||
'shortcut': SysShortcut,
|
||||
'cms-info': CmsInfo,
|
||||
'server-info': ServerInfo
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user