内容bug修复
This commit is contained in:
parent
8b4a0d0009
commit
a9481db8e5
@ -5,10 +5,7 @@ import com.ruoyi.common.annotation.Anonymous;
|
||||
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.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@Anonymous
|
||||
@ -29,4 +26,14 @@ public class CMSContentAPI extends BaseController {
|
||||
return success(contentService.selectCmsContentById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/search")
|
||||
public AjaxResult searchContent(@RequestParam("query") String query){
|
||||
return success(contentService.searchContent(query));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -86,7 +86,6 @@ public class CmsContentController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CmsContent cmsContent)
|
||||
{
|
||||
System.out.println(cmsContent);
|
||||
return toAjax(cmsContentService.insertCmsContent(cmsContent));
|
||||
}
|
||||
|
||||
|
@ -1,20 +1,44 @@
|
||||
package com.ruoyi.cms.core;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.ruoyi.cms.domain.CmsCategory;
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 新增NewTreeSelect类继承TreeSelect
|
||||
* 增加构造方法使用TreeSelect
|
||||
* 新增NewTreeSelect
|
||||
*/
|
||||
public class NewTreeSelect extends TreeSelect {
|
||||
@Data
|
||||
public class NewTreeSelect{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 节点ID */
|
||||
private Long id;
|
||||
|
||||
/** 节点名称 */
|
||||
private String label;
|
||||
|
||||
/** 跳转路径 */
|
||||
private String jumpUrl;
|
||||
|
||||
/** 子节点 */
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<NewTreeSelect> children;
|
||||
|
||||
public NewTreeSelect()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public NewTreeSelect(CmsCategory category)
|
||||
{
|
||||
super.setId(category.getId());
|
||||
super.setLabel(category.getCategoryName());
|
||||
super.setChildren(category.getChildren().stream().map(NewTreeSelect::new).collect(Collectors.toList()));
|
||||
this.id = category.getId();
|
||||
this.label = category.getCategoryName();
|
||||
this.jumpUrl = category.getCategoryUrl();
|
||||
this.children = category.getChildren().stream().map(NewTreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
@ -54,11 +54,11 @@ public class HitRegistrationStudentInfo extends BaseEntity
|
||||
|
||||
/** 领队教师ID集合 */
|
||||
@Excel(name = "领队教师ID集合")
|
||||
private List<String> leaderIds;
|
||||
private List<Long> leaderIds;
|
||||
|
||||
/** 指导老师ID集合 */
|
||||
@Excel(name = "指导老师ID集合")
|
||||
private List<String> guideIds;
|
||||
private List<Long> guideIds;
|
||||
|
||||
/** 逻辑删除0未删除1真删除 */
|
||||
private Integer delFlag;
|
||||
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.cms.core.NewTreeSelect;
|
||||
import com.ruoyi.cms.domain.CmsCategory;
|
||||
import com.ruoyi.cms.domain.CmsContent;
|
||||
import com.ruoyi.cms.domain.vo.CMSCategoryVo;
|
||||
@ -83,7 +84,7 @@ public interface ICmsCategoryService extends IService<CmsCategory>
|
||||
* @param category 栏目信息
|
||||
* @return 栏目树信息集合
|
||||
*/
|
||||
public List<TreeSelect> selectCmsCategoryTreeList(CmsCategory category);
|
||||
public List<NewTreeSelect> selectCmsCategoryTreeList(CmsCategory category);
|
||||
|
||||
/**
|
||||
* 构建前端所需要树结构
|
||||
@ -99,7 +100,7 @@ public interface ICmsCategoryService extends IService<CmsCategory>
|
||||
* @param categorys 栏目列表
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
public List<TreeSelect> buildCmsCategoryTreeSelect(List<CmsCategory> categorys);
|
||||
public List<NewTreeSelect> buildCmsCategoryTreeSelect(List<CmsCategory> categorys);
|
||||
|
||||
/**
|
||||
* 获取栏目下的子栏目及文章
|
||||
|
@ -72,4 +72,11 @@ public interface ICmsContentService extends IService<CmsContent>
|
||||
* @return
|
||||
*/
|
||||
int changeContentByIds(Long[] ids, String username);
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
List<CmsContent> searchContent(String query);
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ public class CmsCategoryServiceImpl extends ServiceImpl<CmsCategoryMapper, CmsCa
|
||||
* @return 栏目树信息集合
|
||||
*/
|
||||
@Override
|
||||
public List<TreeSelect> selectCmsCategoryTreeList(CmsCategory category) {
|
||||
public List<NewTreeSelect> selectCmsCategoryTreeList(CmsCategory category) {
|
||||
List<CmsCategory> categorys = SpringUtils.getAopProxy(this).selectCmsCategoryList(category);
|
||||
return buildCmsCategoryTreeSelect(categorys);
|
||||
}
|
||||
@ -170,7 +170,7 @@ public class CmsCategoryServiceImpl extends ServiceImpl<CmsCategoryMapper, CmsCa
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
@Override
|
||||
public List<TreeSelect> buildCmsCategoryTreeSelect(List<CmsCategory> categorys) {
|
||||
public List<NewTreeSelect> buildCmsCategoryTreeSelect(List<CmsCategory> categorys) {
|
||||
List<CmsCategory> categoryTrees = buildCmsCategoryTree(categorys);
|
||||
return categoryTrees.stream().map(NewTreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import io.swagger.models.auth.In;
|
||||
@ -165,4 +166,20 @@ public class CmsContentServiceImpl extends ServiceImpl<CmsContentMapper, CmsCont
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
public List<CmsContent> searchContent(String query){
|
||||
List<CmsContent> list = baseMapper.selectList(new QueryWrapper<CmsContent>()
|
||||
.like("content_title", query)
|
||||
.or()
|
||||
.like("content_detail", query)
|
||||
.or()
|
||||
.like("summary", query)
|
||||
);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,10 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
@ -23,6 +20,9 @@ import com.ruoyi.common.utils.file.MimeTypeUtils;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 个人信息 业务处理
|
||||
*
|
||||
@ -38,6 +38,9 @@ public class SysProfileController extends BaseController
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private ISysMenuService menuService;
|
||||
|
||||
/**
|
||||
* 个人信息
|
||||
*/
|
||||
@ -134,4 +137,15 @@ public class SysProfileController extends BaseController
|
||||
}
|
||||
return error("上传图片异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户的菜单
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/shortcuts")
|
||||
public AjaxResult getHomeShortcuts(){
|
||||
List<SysMenu> sysMenus = menuService.selectMenuList(SecurityUtils.getLoginUser().getUserId());
|
||||
List<SysMenu> menus = menuService.getHomeShortcuts(sysMenus);
|
||||
return success(menus);
|
||||
}
|
||||
}
|
||||
|
@ -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">
|
||||
|
@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||
<if test="isFrame != null "> and is_frame = #{isFrame}</if>
|
||||
<if test="isDisable != null "> and is_disable = #{isDisable}</if>
|
||||
and del_flag = 0
|
||||
</where>
|
||||
order by parent_id, category_sort
|
||||
</select>
|
||||
|
@ -141,4 +141,6 @@ public interface ISysMenuService
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkMenuNameUnique(SysMenu menu);
|
||||
|
||||
List<SysMenu> getHomeShortcuts(List<SysMenu> sysMenus);
|
||||
}
|
||||
|
@ -1,13 +1,8 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
@ -27,12 +22,11 @@ import com.ruoyi.system.service.ISysMenuService;
|
||||
|
||||
/**
|
||||
* 菜单 业务层处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class SysMenuServiceImpl implements ISysMenuService
|
||||
{
|
||||
public class SysMenuServiceImpl implements ISysMenuService {
|
||||
public static final String PREMISSION_STRING = "perms[\"{0}\"]";
|
||||
|
||||
@Autowired
|
||||
@ -46,33 +40,28 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 根据用户查询系统菜单列表
|
||||
*
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysMenu> selectMenuList(Long userId)
|
||||
{
|
||||
public List<SysMenu> selectMenuList(Long userId) {
|
||||
return selectMenuList(new SysMenu(), userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统菜单列表
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 菜单列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysMenu> selectMenuList(SysMenu menu, Long userId)
|
||||
{
|
||||
public List<SysMenu> selectMenuList(SysMenu menu, Long userId) {
|
||||
List<SysMenu> menuList = null;
|
||||
// 管理员显示所有菜单信息
|
||||
if (SysUser.isAdmin(userId))
|
||||
{
|
||||
if (SysUser.isAdmin(userId)) {
|
||||
menuList = menuMapper.selectMenuList(menu);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
menu.getParams().put("userId", userId);
|
||||
menuList = menuMapper.selectMenuListByUserId(menu);
|
||||
}
|
||||
@ -81,19 +70,16 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 根据用户ID查询权限
|
||||
*
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 权限列表
|
||||
*/
|
||||
@Override
|
||||
public Set<String> selectMenuPermsByUserId(Long userId)
|
||||
{
|
||||
public Set<String> selectMenuPermsByUserId(Long userId) {
|
||||
List<String> perms = menuMapper.selectMenuPermsByUserId(userId);
|
||||
Set<String> permsSet = new HashSet<>();
|
||||
for (String perm : perms)
|
||||
{
|
||||
if (StringUtils.isNotEmpty(perm))
|
||||
{
|
||||
for (String perm : perms) {
|
||||
if (StringUtils.isNotEmpty(perm)) {
|
||||
permsSet.addAll(Arrays.asList(perm.trim().split(",")));
|
||||
}
|
||||
}
|
||||
@ -102,19 +88,16 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 根据角色ID查询权限
|
||||
*
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @return 权限列表
|
||||
*/
|
||||
@Override
|
||||
public Set<String> selectMenuPermsByRoleId(Long roleId)
|
||||
{
|
||||
public Set<String> selectMenuPermsByRoleId(Long roleId) {
|
||||
List<String> perms = menuMapper.selectMenuPermsByRoleId(roleId);
|
||||
Set<String> permsSet = new HashSet<>();
|
||||
for (String perm : perms)
|
||||
{
|
||||
if (StringUtils.isNotEmpty(perm))
|
||||
{
|
||||
for (String perm : perms) {
|
||||
if (StringUtils.isNotEmpty(perm)) {
|
||||
permsSet.addAll(Arrays.asList(perm.trim().split(",")));
|
||||
}
|
||||
}
|
||||
@ -123,20 +106,16 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单
|
||||
*
|
||||
*
|
||||
* @param userId 用户名称
|
||||
* @return 菜单列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId)
|
||||
{
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId) {
|
||||
List<SysMenu> menus = null;
|
||||
if (SecurityUtils.isAdmin(userId))
|
||||
{
|
||||
if (SecurityUtils.isAdmin(userId)) {
|
||||
menus = menuMapper.selectMenuTreeAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
menus = menuMapper.selectMenuTreeByUserId(userId);
|
||||
}
|
||||
return getChildPerms(menus, 0);
|
||||
@ -144,29 +123,26 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 根据角色ID查询菜单树信息
|
||||
*
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @return 选中菜单列表
|
||||
*/
|
||||
@Override
|
||||
public List<Long> selectMenuListByRoleId(Long roleId)
|
||||
{
|
||||
public List<Long> selectMenuListByRoleId(Long roleId) {
|
||||
SysRole role = roleMapper.selectRoleById(roleId);
|
||||
return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建前端路由所需要的菜单
|
||||
*
|
||||
*
|
||||
* @param menus 菜单列表
|
||||
* @return 路由列表
|
||||
*/
|
||||
@Override
|
||||
public List<RouterVo> buildMenus(List<SysMenu> menus)
|
||||
{
|
||||
public List<RouterVo> buildMenus(List<SysMenu> menus) {
|
||||
List<RouterVo> routers = new LinkedList<RouterVo>();
|
||||
for (SysMenu menu : menus)
|
||||
{
|
||||
for (SysMenu menu : menus) {
|
||||
RouterVo router = new RouterVo();
|
||||
router.setHidden("1".equals(menu.getVisible()));
|
||||
router.setName(getRouteName(menu));
|
||||
@ -175,14 +151,11 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
router.setQuery(menu.getQuery());
|
||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
|
||||
List<SysMenu> cMenus = menu.getChildren();
|
||||
if (StringUtils.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
|
||||
router.setAlwaysShow(true);
|
||||
router.setRedirect("noRedirect");
|
||||
router.setChildren(buildMenus(cMenus));
|
||||
}
|
||||
else if (isMenuFrame(menu))
|
||||
{
|
||||
} else if (isMenuFrame(menu)) {
|
||||
router.setMeta(null);
|
||||
List<RouterVo> childrenList = new ArrayList<RouterVo>();
|
||||
RouterVo children = new RouterVo();
|
||||
@ -193,9 +166,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
children.setQuery(menu.getQuery());
|
||||
childrenList.add(children);
|
||||
router.setChildren(childrenList);
|
||||
}
|
||||
else if (menu.getParentId().intValue() == 0 && isInnerLink(menu))
|
||||
{
|
||||
} else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) {
|
||||
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
|
||||
router.setPath("/");
|
||||
List<RouterVo> childrenList = new ArrayList<RouterVo>();
|
||||
@ -215,27 +186,23 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 构建前端所需要树结构
|
||||
*
|
||||
*
|
||||
* @param menus 菜单列表
|
||||
* @return 树结构列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysMenu> buildMenuTree(List<SysMenu> menus)
|
||||
{
|
||||
public List<SysMenu> buildMenuTree(List<SysMenu> menus) {
|
||||
List<SysMenu> returnList = new ArrayList<SysMenu>();
|
||||
List<Long> tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList());
|
||||
for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext();)
|
||||
{
|
||||
for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext(); ) {
|
||||
SysMenu menu = (SysMenu) iterator.next();
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(menu.getParentId()))
|
||||
{
|
||||
if (!tempList.contains(menu.getParentId())) {
|
||||
recursionFn(menus, menu);
|
||||
returnList.add(menu);
|
||||
}
|
||||
}
|
||||
if (returnList.isEmpty())
|
||||
{
|
||||
if (returnList.isEmpty()) {
|
||||
returnList = menus;
|
||||
}
|
||||
return returnList;
|
||||
@ -243,104 +210,95 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 构建前端所需要下拉树结构
|
||||
*
|
||||
*
|
||||
* @param menus 菜单列表
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
@Override
|
||||
public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus)
|
||||
{
|
||||
public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus) {
|
||||
List<SysMenu> menuTrees = buildMenuTree(menus);
|
||||
return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据菜单ID查询信息
|
||||
*
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 菜单信息
|
||||
*/
|
||||
@Override
|
||||
public SysMenu selectMenuById(Long menuId)
|
||||
{
|
||||
public SysMenu selectMenuById(Long menuId) {
|
||||
return menuMapper.selectMenuById(menuId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否存在菜单子节点
|
||||
*
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean hasChildByMenuId(Long menuId)
|
||||
{
|
||||
public boolean hasChildByMenuId(Long menuId) {
|
||||
int result = menuMapper.hasChildByMenuId(menuId);
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询菜单使用数量
|
||||
*
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkMenuExistRole(Long menuId)
|
||||
{
|
||||
public boolean checkMenuExistRole(Long menuId) {
|
||||
int result = roleMenuMapper.checkMenuExistRole(menuId);
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存菜单信息
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMenu(SysMenu menu)
|
||||
{
|
||||
public int insertMenu(SysMenu menu) {
|
||||
return menuMapper.insertMenu(menu);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存菜单信息
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMenu(SysMenu menu)
|
||||
{
|
||||
public int updateMenu(SysMenu menu) {
|
||||
return menuMapper.updateMenu(menu);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜单管理信息
|
||||
*
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMenuById(Long menuId)
|
||||
{
|
||||
public int deleteMenuById(Long menuId) {
|
||||
return menuMapper.deleteMenuById(menuId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验菜单名称是否唯一
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkMenuNameUnique(SysMenu menu)
|
||||
{
|
||||
public boolean checkMenuNameUnique(SysMenu menu) {
|
||||
Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
|
||||
SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId());
|
||||
if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -348,15 +306,13 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 获取路由名称
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 路由名称
|
||||
*/
|
||||
public String getRouteName(SysMenu menu)
|
||||
{
|
||||
public String getRouteName(SysMenu menu) {
|
||||
// 非外链并且是一级目录(类型为目录)
|
||||
if (isMenuFrame(menu))
|
||||
{
|
||||
if (isMenuFrame(menu)) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
return getRouteName(menu.getRouteName(), menu.getPath());
|
||||
@ -364,40 +320,35 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 获取路由名称,如没有配置路由名称则取路由地址
|
||||
*
|
||||
*
|
||||
* @param routerName 路由名称
|
||||
* @param path 路由地址
|
||||
* @param path 路由地址
|
||||
* @return 路由名称(驼峰格式)
|
||||
*/
|
||||
public String getRouteName(String name, String path)
|
||||
{
|
||||
public String getRouteName(String name, String path) {
|
||||
String routerName = StringUtils.isNotEmpty(name) ? name : path;
|
||||
return StringUtils.capitalize(routerName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取路由地址
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 路由地址
|
||||
*/
|
||||
public String getRouterPath(SysMenu menu)
|
||||
{
|
||||
public String getRouterPath(SysMenu menu) {
|
||||
String routerPath = menu.getPath();
|
||||
// 内链打开外网方式
|
||||
if (menu.getParentId().intValue() != 0 && isInnerLink(menu))
|
||||
{
|
||||
if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
|
||||
routerPath = innerLinkReplaceEach(routerPath);
|
||||
}
|
||||
// 非外链并且是一级目录(类型为目录)
|
||||
if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
|
||||
&& UserConstants.NO_FRAME.equals(menu.getIsFrame()))
|
||||
{
|
||||
&& UserConstants.NO_FRAME.equals(menu.getIsFrame())) {
|
||||
routerPath = "/" + menu.getPath();
|
||||
}
|
||||
// 非外链并且是一级目录(类型为菜单)
|
||||
else if (isMenuFrame(menu))
|
||||
{
|
||||
else if (isMenuFrame(menu)) {
|
||||
routerPath = "/";
|
||||
}
|
||||
return routerPath;
|
||||
@ -405,23 +356,17 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 获取组件信息
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 组件信息
|
||||
*/
|
||||
public String getComponent(SysMenu menu)
|
||||
{
|
||||
public String getComponent(SysMenu menu) {
|
||||
String component = UserConstants.LAYOUT;
|
||||
if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) {
|
||||
component = menu.getComponent();
|
||||
}
|
||||
else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu))
|
||||
{
|
||||
} else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
|
||||
component = UserConstants.INNER_LINK;
|
||||
}
|
||||
else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu))
|
||||
{
|
||||
} else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) {
|
||||
component = UserConstants.PARENT_VIEW;
|
||||
}
|
||||
return component;
|
||||
@ -429,54 +374,48 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 是否为菜单内部跳转
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isMenuFrame(SysMenu menu)
|
||||
{
|
||||
public boolean isMenuFrame(SysMenu menu) {
|
||||
return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType())
|
||||
&& menu.getIsFrame().equals(UserConstants.NO_FRAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为内链组件
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isInnerLink(SysMenu menu)
|
||||
{
|
||||
public boolean isInnerLink(SysMenu menu) {
|
||||
return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath());
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为parent_view组件
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isParentView(SysMenu menu)
|
||||
{
|
||||
public boolean isParentView(SysMenu menu) {
|
||||
return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据父节点的ID获取所有子节点
|
||||
*
|
||||
* @param list 分类表
|
||||
*
|
||||
* @param list 分类表
|
||||
* @param parentId 传入的父节点ID
|
||||
* @return String
|
||||
*/
|
||||
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId)
|
||||
{
|
||||
public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
|
||||
List<SysMenu> returnList = new ArrayList<SysMenu>();
|
||||
for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();)
|
||||
{
|
||||
for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext(); ) {
|
||||
SysMenu t = (SysMenu) iterator.next();
|
||||
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
|
||||
if (t.getParentId() == parentId)
|
||||
{
|
||||
if (t.getParentId() == parentId) {
|
||||
recursionFn(list, t);
|
||||
returnList.add(t);
|
||||
}
|
||||
@ -486,19 +425,16 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
*
|
||||
*
|
||||
* @param list 分类表
|
||||
* @param t 子节点
|
||||
* @param t 子节点
|
||||
*/
|
||||
private void recursionFn(List<SysMenu> list, SysMenu t)
|
||||
{
|
||||
private void recursionFn(List<SysMenu> list, SysMenu t) {
|
||||
// 得到子节点列表
|
||||
List<SysMenu> childList = getChildList(list, t);
|
||||
t.setChildren(childList);
|
||||
for (SysMenu tChild : childList)
|
||||
{
|
||||
if (hasChild(list, tChild))
|
||||
{
|
||||
for (SysMenu tChild : childList) {
|
||||
if (hasChild(list, tChild)) {
|
||||
recursionFn(list, tChild);
|
||||
}
|
||||
}
|
||||
@ -507,15 +443,12 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
/**
|
||||
* 得到子节点列表
|
||||
*/
|
||||
private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t)
|
||||
{
|
||||
private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) {
|
||||
List<SysMenu> tlist = new ArrayList<SysMenu>();
|
||||
Iterator<SysMenu> it = list.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
while (it.hasNext()) {
|
||||
SysMenu n = (SysMenu) it.next();
|
||||
if (n.getParentId().longValue() == t.getMenuId().longValue())
|
||||
{
|
||||
if (n.getParentId().longValue() == t.getMenuId().longValue()) {
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
@ -525,19 +458,43 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
/**
|
||||
* 判断是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<SysMenu> list, SysMenu t)
|
||||
{
|
||||
private boolean hasChild(List<SysMenu> list, SysMenu t) {
|
||||
return getChildList(list, t).size() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 内链域名特殊字符替换
|
||||
*
|
||||
*
|
||||
* @return 替换后的内链域名
|
||||
*/
|
||||
public String innerLinkReplaceEach(String path)
|
||||
{
|
||||
return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", ":" },
|
||||
new String[] { "", "", "", "/", "/" });
|
||||
public String innerLinkReplaceEach(String path) {
|
||||
return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", ":"},
|
||||
new String[]{"", "", "", "/", "/"});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户的菜单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SysMenu> getHomeShortcuts(List<SysMenu> sysMenus) {
|
||||
// 取出所有非按钮的
|
||||
List<SysMenu> result = sysMenus.stream()
|
||||
.filter(item -> !item.getMenuType().equals("F"))
|
||||
.filter(item -> item.getVisible().equals("0"))
|
||||
.collect(Collectors.toList());
|
||||
// 取出所有一级菜单,转成map,id为key,path为value
|
||||
Map<Long, String> parent = result.stream()
|
||||
.filter(item -> item.getMenuType().equals("M"))
|
||||
.collect(Collectors.toMap(SysMenu::getMenuId, SysMenu::getPath));
|
||||
// 取出所有二级菜单,拼接path
|
||||
List<SysMenu> menus = result.stream()
|
||||
.filter(item -> item.getMenuType().equals("C"))
|
||||
.map(item -> {
|
||||
item.setPath(parent.get(item.getParentId()) + "/" + item.getPath());
|
||||
return item;
|
||||
}).collect(Collectors.toList());
|
||||
return menus;
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,12 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 若依管理系统
|
||||
VUE_APP_TITLE = 后台管理系统
|
||||
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
# 若依管理系统/开发环境
|
||||
VUE_APP_BASE_API = 'https://f382b38516.zicp.fun'
|
||||
# VUE_APP_BASE_API = 'https://f382b38516.zicp.fun'
|
||||
VUE_APP_BASE_API = 'http://localhost:8080'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
@ -134,3 +134,19 @@ export function deptTreeSelect() {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
export function getHomeUserInfo() {
|
||||
return request({
|
||||
url: "/system/user/profile",
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
// 获取当前用户的菜单信息
|
||||
export function getHomeShortcuts() {
|
||||
return request({
|
||||
url: "/system/user/profile/shortcuts",
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
filterable
|
||||
default-first-option
|
||||
remote
|
||||
placeholder="Search"
|
||||
placeholder="搜索"
|
||||
class="header-search-select"
|
||||
@change="change"
|
||||
>
|
||||
|
@ -9,19 +9,19 @@
|
||||
<template v-if="device!=='mobile'">
|
||||
<search id="header-search" class="right-menu-item" />
|
||||
|
||||
<el-tooltip content="源码地址" effect="dark" placement="bottom">
|
||||
<ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">-->
|
||||
<!-- <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
|
||||
<el-tooltip content="文档地址" effect="dark" placement="bottom">
|
||||
<ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">-->
|
||||
<!-- <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||
<!-- <screenfull id="screenfull" class="right-menu-item hover-effect" />-->
|
||||
|
||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">-->
|
||||
<!-- <size-select id="size-select" class="right-menu-item hover-effect" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
|
||||
</template>
|
||||
|
||||
@ -34,9 +34,9 @@
|
||||
<router-link to="/user/profile">
|
||||
<el-dropdown-item>个人中心</el-dropdown-item>
|
||||
</router-link>
|
||||
<el-dropdown-item @click.native="setting = true">
|
||||
<span>布局设置</span>
|
||||
</el-dropdown-item>
|
||||
<!-- <el-dropdown-item @click.native="setting = true">-->
|
||||
<!-- <span>布局设置</span>-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<el-dropdown-item divided @click.native="logout">
|
||||
<span>退出登录</span>
|
||||
</el-dropdown-item>
|
||||
|
@ -1,14 +1,18 @@
|
||||
<template>
|
||||
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
||||
<div class="sidebar-logo-container" :class="{'collapse':collapse}"
|
||||
:style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
||||
<transition name="sidebarLogoFade">
|
||||
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
||||
</router-link>
|
||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
||||
</router-link>
|
||||
<router-link key="expand" class="sidebar-logo-link" to="/">
|
||||
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
||||
</router-link>
|
||||
<!-- <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">-->
|
||||
<!-- <img v-if="logo" :src="logo" class="sidebar-logo" />-->
|
||||
<!-- <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>-->
|
||||
<!-- </router-link>-->
|
||||
<!-- <router-link v-else key="expand" class="sidebar-logo-link" to="/">-->
|
||||
<!-- <img v-if="logo" :src="logo" class="sidebar-logo" />-->
|
||||
<!-- <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>-->
|
||||
<!-- </router-link>-->
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="grid-btn-bar bg-purple-white">
|
||||
<el-button plain type="success" size="mini" icon="el-icon-edit" @click="handleSave">保存</el-button>
|
||||
<el-button plain type="success" size="mini" icon="el-icon-edit" @click="handlerSaveBefore">保存</el-button>
|
||||
<el-button plain type="primary" size="mini" icon="el-icon-s-promotion" @click="handlePublish">发布</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -238,28 +238,33 @@ export default {
|
||||
// 发布
|
||||
handlePublish() {
|
||||
this.form.status = "1"
|
||||
this.form.publishDate = this.formatTimer(new Date())
|
||||
this.handleSave();
|
||||
},
|
||||
//保存
|
||||
handlerSaveBefore(){
|
||||
this.form.status = this.form.id !== null ? "3" : "0"
|
||||
this.handleSave();
|
||||
},
|
||||
// 新增
|
||||
handleSave() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.$modal.loading("正在" + (this.form.status == "0" ? "保存" : "发布") + "内容,请稍候...");
|
||||
this.$modal.loading("正在" + (this.form.status !== "1" ? "保存" : "发布") + "内容,请稍候...");
|
||||
// if:修改,else:新增
|
||||
if (this.form.id != null) {
|
||||
this.form.status = "3"
|
||||
if (this.form.id !== null) {
|
||||
this.changeUrl()
|
||||
updateContent(this.form).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$modal.msgSuccess(this.form.status == "0" ? "保存成功" : "发布成功");
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess(this.form.status !== "1" ? "保存成功" : "发布成功");
|
||||
this.reset()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.changeUrl()
|
||||
addContent(this.form).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$modal.msgSuccess(this.form.status == "0" ? "保存成功" : "发布成功");
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess(this.form.status !== "1" ? "保存成功" : "发布成功");
|
||||
this.reset()
|
||||
}
|
||||
})
|
||||
@ -290,6 +295,21 @@ export default {
|
||||
this.form.videoUrl = this.StrToArr(this.form.videoUrl)
|
||||
}
|
||||
},
|
||||
formatTimer: function(value) {
|
||||
let date = new Date(value);
|
||||
let y = date.getFullYear();
|
||||
let MM = date.getMonth() + 1;
|
||||
MM = MM < 10 ? "0" + MM : MM;
|
||||
let d = date.getDate();
|
||||
d = d < 10 ? "0" + d : d;
|
||||
let h = date.getHours();
|
||||
h = h < 10 ? "0" + h : h;
|
||||
let m = date.getMinutes();
|
||||
m = m < 10 ? "0" + m : m;
|
||||
let s = date.getSeconds();
|
||||
s = s < 10 ? "0" + s : s;
|
||||
return y + "-" + MM + "-" + d + " " + h + ":" + m;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
68
ruoyi-ui/src/views/dashboard/serverInfo/index.vue
Normal file
68
ruoyi-ui/src/views/dashboard/serverInfo/index.vue
Normal file
@ -0,0 +1,68 @@
|
||||
<!--<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>-->
|
||||
|
||||
<!-- </div>-->
|
||||
<!--</template>-->
|
||||
<!--<script>-->
|
||||
<!--import { getDashboardServerInfo } from "@/api/monitor/server";-->
|
||||
<!--import { getCmsConfiguration } from "@/api/contentcore/dashboard";-->
|
||||
|
||||
<!--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>-->
|
64
ruoyi-ui/src/views/dashboard/shortcut/index.vue
Normal file
64
ruoyi-ui/src/views/dashboard/shortcut/index.vue
Normal file
@ -0,0 +1,64 @@
|
||||
<template>
|
||||
<div class="home-shortcut-container">
|
||||
<el-card shadow="hover" class="mb10">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>快捷方式</span>
|
||||
</div>
|
||||
<div class="body">
|
||||
<el-card v-for="shortcut in shortcuts" :key="shortcut.router" shadow="hover" :body-style="{ padding: '0 10px' }" style="float: left;margin-right:10px;margin-bottom:10px;">
|
||||
<el-link class="shortcut-link" @click="handleShortcutRedirect(shortcut.path)">
|
||||
<svg-icon :icon-class="shortcut.icon" class-name="card-panel-icon"></svg-icon>
|
||||
<div class="shortcut-text">
|
||||
<span>{{ shortcut.menuName }}</span>
|
||||
</div>
|
||||
</el-link>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getHomeShortcuts } from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
name: "ShortcutDashboard",
|
||||
data () {
|
||||
return {
|
||||
shortcuts: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loadShortcuts();
|
||||
},
|
||||
methods: {
|
||||
loadShortcuts() {
|
||||
getHomeShortcuts().then(response => {
|
||||
console.log(response)
|
||||
this.shortcuts = response.data;
|
||||
})
|
||||
},
|
||||
handleShortcutRedirect(router) {
|
||||
this.$router.push({ path: router })
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.home-shortcut-container .shortcut-link {
|
||||
display: block;
|
||||
padding: 10px 10px;
|
||||
text-align: center;
|
||||
width: 165px;
|
||||
}
|
||||
.home-shortcut-container .card-panel-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
padding: 5px;
|
||||
}
|
||||
.home-shortcut-container .shortcut-text {
|
||||
padding-top: 5px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
86
ruoyi-ui/src/views/dashboard/userInfo/index.vue
Normal file
86
ruoyi-ui/src/views/dashboard/userInfo/index.vue
Normal file
@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<div class="home-user-info-container">
|
||||
<el-card class="box-card" shadow="hover">
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="2">
|
||||
<div class="div-avatar">
|
||||
<img :src="userInfo.avatar" class="home-user-avatar" />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="22">
|
||||
<div class="user-info-header">欢迎回来<router-link to="/user/profile">{{ userInfo.nickName }}</router-link></div>
|
||||
<div class="user-info-detail">
|
||||
<i class="el-icon-time"> 上次登录时间<span>{{ parseTime(userInfo.loginDate, "{y}-{m}-{d} {h}:{m}:{s}") }}</span></i>
|
||||
<i class="el-icon-map-location">上次登录IP<span>{{ userInfo.loginIp }}</span></i>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getHomeUserInfo } from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
name: "UserInfoDashboard",
|
||||
data () {
|
||||
return {
|
||||
userInfo: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loadUserInfo();
|
||||
},
|
||||
methods: {
|
||||
loadUserInfo() {
|
||||
getHomeUserInfo().then(response => {
|
||||
this.userInfo = response.data;
|
||||
if (this.userInfo.avatar && this.userInfo.avatar != '') {
|
||||
this.userInfo.avatar = process.env.VUE_APP_BASE_API + this.userInfo.avatar;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.home-user-info-container {
|
||||
padding: 10px 0;
|
||||
}
|
||||
.home-user-info-container .el-card__body {
|
||||
padding: 10px 10px 5px 10px;
|
||||
}
|
||||
.home-user-info-container .div-avatar {
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
.home-user-info-container .home-user-avatar {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.home-user-info-container .user-info-header {
|
||||
font-size: 16px;
|
||||
padding: 12px 0;
|
||||
color: #5a5e66;
|
||||
}
|
||||
.home-user-info-container .user-info-header a {
|
||||
color: #409eff;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.home-user-info-container .user-info-detail {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: #6a6b6e;
|
||||
}
|
||||
.home-user-info-container .user-info-detail i {
|
||||
margin-right: 15px;
|
||||
}
|
||||
.home-user-info-container .user-info-detail i span {
|
||||
color: #909399;
|
||||
padding-left: 5px;
|
||||
}
|
||||
</style>
|
@ -59,7 +59,7 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['competition:competition:add']"
|
||||
v-hasPermi="['hit:hitCompetition:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -70,7 +70,7 @@
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['competition:competition:edit']"
|
||||
v-hasPermi="['hit:hitCompetition:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -81,7 +81,7 @@
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['competition:competition:remove']"
|
||||
v-hasPermi="['hit:hitCompetition:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -91,7 +91,7 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['competition:competition:export']"
|
||||
v-hasPermi="['hit:hitCompetition:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
@ -132,14 +132,14 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['competition:competition:edit']"
|
||||
v-hasPermi="['hit:hitCompetition:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['competition:competition:remove']"
|
||||
v-hasPermi="['hit:hitCompetition:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -108,7 +108,7 @@
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['registrationStudentInfo:registrationStudentInfo:remove']"
|
||||
v-hasPermi="['hit:hitRegistrationStudentInfo:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
@ -118,7 +118,7 @@
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['registrationStudentInfo:registrationStudentInfo:export']"
|
||||
v-hasPermi="['hit:hitRegistrationStudentInfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
@ -177,7 +177,7 @@
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['registrationStudentInfo:registrationStudentInfo:remove']"
|
||||
v-hasPermi="['hit:hitRegistrationStudentInfo:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -286,8 +286,9 @@ export default {
|
||||
listHitRegistrationStudentInfo(this.queryParams).then(response => {
|
||||
this.HitRegistrationStudentInfoList = response.rows;
|
||||
this.HitRegistrationStudentInfoList.forEach(item => {
|
||||
item.leaderNames = item.leaderNames.join(",")
|
||||
item.guideNames = item.guideNames.join(",")
|
||||
console.log(item)
|
||||
if (item.leaderNames !== null) item.leaderNames = item.leaderNames.join(",");
|
||||
if (item.guideNames !== null) item.guideNames = item.guideNames.join(",");
|
||||
})
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<h3 class="title">若依后台管理系统</h3>
|
||||
<h3 class="title">后台管理系统</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model="loginForm.username"
|
||||
@ -56,7 +56,7 @@
|
||||
</el-form>
|
||||
<!-- 底部 -->
|
||||
<div class="el-login-footer">
|
||||
<span>Copyright © 2018-2024 ruoyi.vip All Rights Reserved.</span>
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -72,8 +72,8 @@ export default {
|
||||
return {
|
||||
codeUrl: "",
|
||||
loginForm: {
|
||||
username: "admin",
|
||||
password: "admin123",
|
||||
username: "",
|
||||
password: "",
|
||||
rememberMe: false,
|
||||
code: "",
|
||||
uuid: ""
|
||||
|
Loading…
Reference in New Issue
Block a user