Merge remote-tracking branch 'origin/main'

This commit is contained in:
zhanghan11 2024-05-06 08:34:09 +08:00
commit c173418103
46 changed files with 5207 additions and 23 deletions

View File

@ -54,6 +54,12 @@
<groupId>com.inspur</groupId>
<artifactId>inspur-quartz</artifactId>
</dependency>
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-develop</artifactId>
<version>3.8.7</version>
<scope>compile</scope>
</dependency>
<!-- 代码生成-->
<dependency>
@ -84,7 +90,12 @@
<version>3.8.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-community</artifactId>
<version>3.8.7</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

View File

@ -0,0 +1,118 @@
package com.inspur.web.controller.community;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.inspur.community.domain.vo.CommunityPostInfoVO;
import org.springframework.security.access.prepost.PreAuthorize;
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.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.inspur.common.annotation.Log;
import com.inspur.common.core.controller.BaseController;
import com.inspur.common.core.domain.AjaxResult;
import com.inspur.common.enums.BusinessType;
import com.inspur.community.domain.CommunityPostInfo;
import com.inspur.community.service.ICommunityPostInfoService;
import com.inspur.common.utils.poi.ExcelUtil;
import com.inspur.common.core.page.TableDataInfo;
/**
* 社区帖子信息Controller
*
* @author inspur
* @date 2024-04-26
*/
@RestController
@RequestMapping("/community/info")
public class CommunityPostInfoController extends BaseController
{
@Autowired
private ICommunityPostInfoService communityPostInfoService;
/**
* 查询社区帖子信息列表
*/
@PreAuthorize("@ss.hasPermi('community:info:list')")
@GetMapping("/list")
public TableDataInfo list(CommunityPostInfo communityPostInfo)
{
startPage();
List<CommunityPostInfoVO> list = communityPostInfoService.selectCommunityPostInfoList(communityPostInfo);
return getDataTable(list);
}
/**
* 导出社区帖子信息列表
*/
@PreAuthorize("@ss.hasPermi('community:info:export')")
@Log(title = "社区帖子信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CommunityPostInfo communityPostInfo)
{
List<CommunityPostInfoVO> list = communityPostInfoService.selectCommunityPostInfoList(communityPostInfo);
ExcelUtil<CommunityPostInfoVO> util = new ExcelUtil<CommunityPostInfoVO>(CommunityPostInfoVO.class);
util.exportExcel(response, list, "社区帖子信息数据");
}
/**
* 获取社区帖子信息详细信息
*/
@PreAuthorize("@ss.hasPermi('community:info:query')")
@GetMapping(value = "/{postId}")
public AjaxResult getInfo(@PathVariable("postId") String postId)
{
return success(communityPostInfoService.selectCommunityPostInfoByPostId(postId));
}
/**
* 新增社区帖子信息
*/
@PreAuthorize("@ss.hasPermi('community:info:add')")
@Log(title = "社区帖子信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CommunityPostInfo communityPostInfo)
{
return toAjax(communityPostInfoService.insertCommunityPostInfo(communityPostInfo));
}
/**
* 修改社区帖子信息
*/
@PreAuthorize("@ss.hasPermi('community:info:edit')")
@Log(title = "社区帖子信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CommunityPostInfo communityPostInfo)
{
return toAjax(communityPostInfoService.updateCommunityPostInfo(communityPostInfo));
}
/**
* 添加浏览量
*/
@Log(title = "社区帖子信息", businessType = BusinessType.UPDATE)
@PutMapping("/addViews/{postId}")
public AjaxResult addViews(@PathVariable("postId") String postId)
{
return toAjax(communityPostInfoService.addViews(postId));
}
/**
* 删除社区帖子信息
*/
@PreAuthorize("@ss.hasPermi('community:info:remove')")
@Log(title = "社区帖子信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{postIds}")
public AjaxResult remove(@PathVariable String[] postIds)
{
return toAjax(communityPostInfoService.deleteCommunityPostInfoByPostIds(postIds));
}
}

View File

@ -0,0 +1,105 @@
package com.inspur.web.controller.develop;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.inspur.develop.domain.LearningPathInfo;
import org.springframework.security.access.prepost.PreAuthorize;
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.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.inspur.common.annotation.Log;
import com.inspur.common.core.controller.BaseController;
import com.inspur.common.core.domain.AjaxResult;
import com.inspur.common.enums.BusinessType;
import com.inspur.common.utils.poi.ExcelUtil;
import com.inspur.common.core.page.TableDataInfo;
/**
* 学习路径信息Controller
*
* @author inspur
* @date 2024-04-29
*/
@RestController
@RequestMapping("/develop/learningPath")
public class LearningPathInfoController extends BaseController
{
@Autowired
private com.inspur.service.ILearningPathInfoService learningPathInfoService;
/**
* 查询学习路径信息列表
*/
@PreAuthorize("@ss.hasPermi('develop:learningPath:list')")
@GetMapping("/list")
public TableDataInfo list(LearningPathInfo learningPathInfo)
{
startPage();
List<LearningPathInfo> list = learningPathInfoService.selectLearningPathInfoList(learningPathInfo);
return getDataTable(list);
}
/**
* 导出学习路径信息列表
*/
@PreAuthorize("@ss.hasPermi('develop:learningPath:export')")
@Log(title = "学习路径信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, LearningPathInfo learningPathInfo)
{
List<LearningPathInfo> list = learningPathInfoService.selectLearningPathInfoList(learningPathInfo);
ExcelUtil<LearningPathInfo> util = new ExcelUtil<LearningPathInfo>(LearningPathInfo.class);
util.exportExcel(response, list, "学习路径信息数据");
}
/**
* 获取学习路径信息详细信息
*/
@PreAuthorize("@ss.hasPermi('develop:learningPath:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(learningPathInfoService.selectLearningPathInfoById(id));
}
/**
* 新增学习路径信息
*/
@PreAuthorize("@ss.hasPermi('develop:learningPath:add')")
@Log(title = "学习路径信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody LearningPathInfo learningPathInfo)
{
return toAjax(learningPathInfoService.insertLearningPathInfo(learningPathInfo));
}
/**
* 修改学习路径信息
*/
@PreAuthorize("@ss.hasPermi('develop:learningPath:edit')")
@Log(title = "学习路径信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody LearningPathInfo learningPathInfo)
{
return toAjax(learningPathInfoService.updateLearningPathInfo(learningPathInfo));
}
/**
* 删除学习路径信息
*/
@PreAuthorize("@ss.hasPermi('develop:learningPath:remove')")
@Log(title = "学习路径信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(learningPathInfoService.deleteLearningPathInfoByIds(ids));
}
}

View File

@ -25,14 +25,14 @@ public class BaseEntity implements Serializable
private String createBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
/** 更新者 */
private String updateBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
/** 备注 */

View File

@ -68,7 +68,7 @@ public class SFTPServicesImpl implements ISFTPServices {
public String getSaveFile(String nameInfo) {
if (StringUtils.isBlank(nameInfo))
return "other";
if (nameInfo.toLowerCase().contains("png") || nameInfo.toLowerCase().contains("jpg")) {
if (nameInfo.toLowerCase().contains("png") || nameInfo.toLowerCase().contains("jpg") || nameInfo.toLowerCase().contains("jpeg")) {
return "image";
} else if (nameInfo.contains("doc") || nameInfo.contains("xls") || nameInfo.contains("ppt")) {
return "doc";

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>inspur</artifactId>
<groupId>com.inspur</groupId>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>inspur-community</artifactId>
<description>运维社区模块</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-common</artifactId>
</dependency>
<!-- 系统模块-->
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-system</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,183 @@
package com.inspur.community.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.inspur.common.annotation.Excel;
import com.inspur.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 社区帖子信息对象 community_post_info
*
* @author zhangjunwen
* @date 2024-04-26
*/
public class CommunityPostInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String postId;
/** 帖子类型0 经验交流 1 困难求助 2 观点吐槽 3 其他 */
@Excel(name = "帖子类型0 经验交流 1 困难求助 2 观点吐槽 3 其他")
private String postType;
/** 运维领域0故障机理、1信号采集方案、2信号处理方法、3维保策略 */
@Excel(name = "运维领域0故障机理、1信号采集方案、2信号处理方法、3维保策略")
private String omField;
/** 运维行业0 纺织1 陶瓷2 化工 */
@Excel(name = "运维行业0 纺织1 陶瓷2 化工")
private String omIndustry;
/** 帖子标题 */
@Excel(name = "帖子标题")
private String postTitle;
/** 帖子内容 */
@Excel(name = "帖子内容")
private String postContent;
/** 发布时间 */
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
private Date postTime;
/** 发布人 */
@Excel(name = "发布人")
private Long userId;
/** 最后编辑时间 */
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "最后编辑时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
private Date lastEditTime;
/**
* 浏览量
*/
private String views;
/** 状态0 正常1 封禁2 删除 */
@Excel(name = "状态0 正常1 封禁2 删除")
private String status;
public void setPostId(String postId)
{
this.postId = postId;
}
public String getPostId()
{
return postId;
}
public void setPostType(String postType)
{
this.postType = postType;
}
public String getPostType()
{
return postType;
}
public void setOmField(String omField)
{
this.omField = omField;
}
public String getOmField()
{
return omField;
}
public void setOmIndustry(String omIndustry)
{
this.omIndustry = omIndustry;
}
public String getOmIndustry()
{
return omIndustry;
}
public void setPostTitle(String postTitle)
{
this.postTitle = postTitle;
}
public String getPostTitle()
{
return postTitle;
}
public void setPostContent(String postContent)
{
this.postContent = postContent;
}
public String getPostContent()
{
return postContent;
}
public void setPostTime(Date postTime)
{
this.postTime = postTime;
}
public Date getPostTime()
{
return postTime;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setLastEditTime(Date lastEditTime)
{
this.lastEditTime = lastEditTime;
}
public Date getLastEditTime()
{
return lastEditTime;
}
public String getViews() {
return views;
}
public void setViews(String views) {
this.views = views;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("postId", getPostId())
.append("postType", getPostType())
.append("omField", getOmField())
.append("omIndustry", getOmIndustry())
.append("postTitle", getPostTitle())
.append("postContent", getPostContent())
.append("postTime", getPostTime())
.append("userId", getUserId())
.append("lastEditTime", getLastEditTime())
.append("views", getViews())
.append("status", getStatus())
.toString();
}
}

View File

@ -0,0 +1,43 @@
package com.inspur.community.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.inspur.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* @Author zhangjunwen
* @create 2024/4/30
*/
@Data
public class CommunityPostInfoVO {
private String postId;
private String postType;
private String omField;
private String omIndustry;
private String postTitle;
private String postContent;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date postTime;
private Long userId;
private String userName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date lastEditTime;
private long views;
private String status;
}

View File

@ -0,0 +1,70 @@
package com.inspur.community.mapper;
import java.util.List;
import com.inspur.community.domain.CommunityPostInfo;
import com.inspur.community.domain.vo.CommunityPostInfoVO;
/**
* 社区帖子信息Mapper接口
*
* @author inspur
* @date 2024-04-26
*/
public interface CommunityPostInfoMapper
{
/**
* 查询社区帖子信息
*
* @param postId 社区帖子信息主键
* @return 社区帖子信息
*/
public CommunityPostInfoVO selectCommunityPostInfoByPostId(String postId);
/**
* 查询社区帖子信息列表
*
* @param communityPostInfo 社区帖子信息
* @return 社区帖子信息集合
*/
public List<CommunityPostInfoVO> selectCommunityPostInfoList(CommunityPostInfo communityPostInfo);
/**
* 新增社区帖子信息
*
* @param communityPostInfo 社区帖子信息
* @return 结果
*/
public int insertCommunityPostInfo(CommunityPostInfo communityPostInfo);
/**
* 修改社区帖子信息
*
* @param communityPostInfo 社区帖子信息
* @return 结果
*/
public int updateCommunityPostInfo(CommunityPostInfo communityPostInfo);
/**
* 添加浏览量
* @param postId
* @return
*/
public int addViews(String postId);
/**
* 删除社区帖子信息
*
* @param postId 社区帖子信息主键
* @return 结果
*/
public int deleteCommunityPostInfoByPostId(String postId);
/**
* 批量删除社区帖子信息
*
* @param postIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteCommunityPostInfoByPostIds(String[] postIds);
}

View File

@ -0,0 +1,70 @@
package com.inspur.community.service;
import java.util.List;
import com.inspur.community.domain.CommunityPostInfo;
import com.inspur.community.domain.vo.CommunityPostInfoVO;
/**
* 社区帖子信息Service接口
*
* @author zhangjunwen
* @date 2024-04-26
*/
public interface ICommunityPostInfoService
{
/**
* 查询社区帖子信息
*
* @param postId 社区帖子信息主键
* @return 社区帖子信息
*/
public CommunityPostInfoVO selectCommunityPostInfoByPostId(String postId);
/**
* 查询社区帖子信息列表
*
* @param communityPostInfo 社区帖子信息
* @return 社区帖子信息集合
*/
public List<CommunityPostInfoVO> selectCommunityPostInfoList(CommunityPostInfo communityPostInfo);
/**
* 新增社区帖子信息
*
* @param communityPostInfo 社区帖子信息
* @return 结果
*/
public int insertCommunityPostInfo(CommunityPostInfo communityPostInfo);
/**
* 修改社区帖子信息
*
* @param communityPostInfo 社区帖子信息
* @return 结果
*/
public int updateCommunityPostInfo(CommunityPostInfo communityPostInfo);
/**
* 添加浏览量
* @param postId
* @return
*/
public int addViews(String postId);
/**
* 批量删除社区帖子信息
*
* @param postIds 需要删除的社区帖子信息主键集合
* @return 结果
*/
public int deleteCommunityPostInfoByPostIds(String[] postIds);
/**
* 删除社区帖子信息信息
*
* @param postId 社区帖子信息主键
* @return 结果
*/
public int deleteCommunityPostInfoByPostId(String postId);
}

View File

@ -0,0 +1,113 @@
package com.inspur.community.service.impl;
import java.util.Date;
import java.util.List;
import com.inspur.common.utils.SecurityUtils;
import com.inspur.common.utils.uuid.IdUtils;
import com.inspur.community.domain.vo.CommunityPostInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.inspur.community.mapper.CommunityPostInfoMapper;
import com.inspur.community.domain.CommunityPostInfo;
import com.inspur.community.service.ICommunityPostInfoService;
/**
* 社区帖子信息Service业务层处理
*
* @author zhangjunwen
* @date 2024-04-26
*/
@Service
public class CommunityPostInfoServiceImpl implements ICommunityPostInfoService
{
@Autowired
private CommunityPostInfoMapper communityPostInfoMapper;
/**
* 查询社区帖子信息
*
* @param postId 社区帖子信息主键
* @return 社区帖子信息
*/
@Override
public CommunityPostInfoVO selectCommunityPostInfoByPostId(String postId)
{
return communityPostInfoMapper.selectCommunityPostInfoByPostId(postId);
}
/**
* 查询社区帖子信息列表
*
* @param communityPostInfo 社区帖子信息
* @return 社区帖子信息
*/
@Override
public List<CommunityPostInfoVO> selectCommunityPostInfoList(CommunityPostInfo communityPostInfo)
{
return communityPostInfoMapper.selectCommunityPostInfoList(communityPostInfo);
}
/**
* 新增社区帖子信息
*
* @param communityPostInfo 社区帖子信息
* @return 结果
*/
@Override
public int insertCommunityPostInfo(CommunityPostInfo communityPostInfo)
{
communityPostInfo.setPostId(IdUtils.simpleUUID());
communityPostInfo.setPostTime(new Date());
communityPostInfo.setUserId(SecurityUtils.getUserId());
return communityPostInfoMapper.insertCommunityPostInfo(communityPostInfo);
}
/**
* 修改社区帖子信息
*
* @param communityPostInfo 社区帖子信息
* @return 结果
*/
@Override
public int updateCommunityPostInfo(CommunityPostInfo communityPostInfo)
{
communityPostInfo.setLastEditTime(new Date());
return communityPostInfoMapper.updateCommunityPostInfo(communityPostInfo);
}
/**
* 添加浏览量
* @param postId
* @return
*/
@Override
public int addViews(String postId){
return communityPostInfoMapper.addViews(postId);
}
/**
* 批量删除社区帖子信息
*
* @param postIds 需要删除的社区帖子信息主键
* @return 结果
*/
@Override
public int deleteCommunityPostInfoByPostIds(String[] postIds)
{
return communityPostInfoMapper.deleteCommunityPostInfoByPostIds(postIds);
}
/**
* 删除社区帖子信息信息
*
* @param postId 社区帖子信息主键
* @return 结果
*/
@Override
public int deleteCommunityPostInfoByPostId(String postId)
{
return communityPostInfoMapper.deleteCommunityPostInfoByPostId(postId);
}
}

View File

@ -0,0 +1,111 @@
<?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="com.inspur.community.mapper.CommunityPostInfoMapper">
<resultMap type="CommunityPostInfoVO" id="CommunityPostInfoResult">
<result property="postId" column="post_id" />
<result property="postType" column="post_type" />
<result property="omField" column="om_field" />
<result property="omIndustry" column="om_industry" />
<result property="postTitle" column="post_title" />
<result property="postContent" column="post_content" />
<result property="postTime" column="post_time" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="lastEditTime" column="last_edit_time" />
<result property="views" column="views"/>
<result property="status" column="status" />
</resultMap>
<sql id="selectCommunityPostInfoVo">
select post_id, post_type, om_field, om_industry, post_title, post_content, post_time, a.user_id, last_edit_time,views, a.status, b.nick_name as user_name from community_post_info a
left join sys_user b on a.user_id = b.user_id
</sql>
<select id="selectCommunityPostInfoList" parameterType="CommunityPostInfo" resultMap="CommunityPostInfoResult">
<include refid="selectCommunityPostInfoVo"/>
<where>
<if test="postType != null and postType != ''"> and post_type = #{postType}</if>
<if test="omField != null and omField != ''"> and om_field = #{omField}</if>
<if test="omIndustry != null and omIndustry != ''"> and om_industry = #{omIndustry}</if>
<if test="postTitle != null and postTitle != ''"> and post_title = #{postTitle}</if>
<if test="postContent != null and postContent != ''"> and post_content = #{postContent}</if>
<if test="postTime != null "> and post_time = #{postTime}</if>
<if test="userId != null "> and a.user_id = #{userId}</if>
<if test="lastEditTime != null "> and last_edit_time = #{lastEditTime}</if>
<if test="views != null "> and views = #{views}</if>
<if test="status != null and status != ''"> and a.status = #{status}</if>
</where>
order by post_time desc
</select>
<select id="selectCommunityPostInfoByPostId" parameterType="String" resultMap="CommunityPostInfoResult">
<include refid="selectCommunityPostInfoVo"/>
where post_id = #{postId}
</select>
<insert id="insertCommunityPostInfo" parameterType="CommunityPostInfo">
insert into community_post_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="postId != null">post_id,</if>
<if test="postType != null">post_type,</if>
<if test="omField != null">om_field,</if>
<if test="omIndustry != null">om_industry,</if>
<if test="postTitle != null">post_title,</if>
<if test="postContent != null">post_content,</if>
<if test="postTime != null">post_time,</if>
<if test="userId != null">user_id,</if>
<if test="lastEditTime != null">last_edit_time,</if>
<if test="views != null">views,</if>
<if test="status != null">mstatus,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="postId != null">#{postId},</if>
<if test="postType != null">#{postType},</if>
<if test="omField != null">#{omField},</if>
<if test="omIndustry != null">#{omIndustry},</if>
<if test="postTitle != null">#{postTitle},</if>
<if test="postContent != null">#{postContent},</if>
<if test="postTime != null">#{postTime},</if>
<if test="userId != null">#{userId},</if>
<if test="lastEditTime != null">#{lastEditTime},</if>
<if test="views != null">#{views},</if>
<if test="status != null">#{status},</if>
</trim>
</insert>
<update id="updateCommunityPostInfo" parameterType="CommunityPostInfo">
update community_post_info
<trim prefix="SET" suffixOverrides=",">
<if test="postType != null">post_type = #{postType},</if>
<if test="omField != null">om_field = #{omField},</if>
<if test="omIndustry != null">om_industry = #{omIndustry},</if>
<if test="postTitle != null">post_title = #{postTitle},</if>
<if test="postContent != null">post_content = #{postContent},</if>
<if test="postTime != null">post_time = #{postTime},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="lastEditTime != null">last_edit_time = #{lastEditTime},</if>
<if test="views != null">views = #{views},</if>
<if test="status != null">status = #{status},</if>
</trim>
where post_id = #{postId}
</update>
<!--添加浏览量-->
<update id="addViews" parameterType="String">
update community_post_info set views = views + 1 where post_id = #{postId}
</update>
<delete id="deleteCommunityPostInfoByPostId" parameterType="String">
delete from community_post_info where post_id = #{postId}
</delete>
<delete id="deleteCommunityPostInfoByPostIds" parameterType="String">
delete from community_post_info where post_id in
<foreach item="postId" collection="array" open="(" separator="," close=")">
#{postId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.inspur</groupId>
<artifactId>inspur</artifactId>
<version>3.8.7</version>
</parent>
<artifactId>inspur-develop</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-common</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.0.7</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,36 @@
package com.inspur.develop.domain;
import lombok.Data;
/**
* 学习路径与课程关联表
*
* @Author xusd
* @Date 2024/4/30 14:52
**/
@Data
public class LearningPathCourse {
/**
* 学习路径id
*/
private String learningPathId;
/**
* 课程id
*/
private String courseId;
/**
* 课程名称
*/
private String courseName;
/**
* 课程类型0 在线课程1 视频课程2 培训资料
*/
private String type;
private String typeName;
}

View File

@ -0,0 +1,67 @@
package com.inspur.develop.domain;
import com.inspur.common.annotation.Excel;
import com.inspur.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 学习路径信息对象 learning_path_info
*
* @author inspur
* @date 2024-04-29
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class LearningPathInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 学习路径名称
*/
@Excel(name = "学习路径名称")
private String learningPathName;
/**
* 适用领域
*/
@Excel(name = "适用领域")
private String applicableField;
/**
* 适用人员
*/
@Excel(name = "适用人员")
private String applicablePersonnel;
/**
* 描述
*/
@Excel(name = "描述")
private String description;
/**
* 文件名称
*/
private String fileName;
/**
* sftp文件名称
*/
private String sftpFileName;
/**
* 学习路径与课程关联
*/
private List<LearningPathCourse> learningPathCourseList;
private String photoBase;
}

View File

@ -0,0 +1,40 @@
package com.inspur.develop.mapper;
import com.inspur.develop.domain.LearningPathCourse;
import java.util.List;
/**
* @Author xusd
* @Date 2024/4/30 14:56
**/
public interface LearningPathCourseMapper {
/**
* 新增学习路径课程关联
*
* @param learningPathCourse 学习路径课程关联
* @return 结果
*/
int insertLearningPathCourse(LearningPathCourse learningPathCourse);
/**
* 根据学习路径id删除学习路径与课程关联信息
*
* @Author xusd
* @Date 15:10 2024/4/30
* @param pathId 学习路径id
* @return int
*/
int deleteLearningPathCourseByPathId(String pathId);
/**
* 根据学习路径id查询学习路径与课程关联信息
*
* @Author xusd
* @Date 15:10 2024/4/30
* @param pathId 学习路径id
* @return int
*/
List<LearningPathCourse> selectLearningPathCourseByPathId(String pathId);
}

View File

@ -0,0 +1,61 @@
package com.inspur.develop.mapper;
import java.util.List;
import com.inspur.develop.domain.LearningPathInfo;
/**
* 学习路径信息Mapper接口
*
* @author inspur
* @date 2024-04-29
*/
public interface LearningPathInfoMapper
{
/**
* 查询学习路径信息
*
* @param id 学习路径信息主键
* @return 学习路径信息
*/
public LearningPathInfo selectLearningPathInfoById(String id);
/**
* 查询学习路径信息列表
*
* @param learningPathInfo 学习路径信息
* @return 学习路径信息集合
*/
public List<LearningPathInfo> selectLearningPathInfoList(LearningPathInfo learningPathInfo);
/**
* 新增学习路径信息
*
* @param learningPathInfo 学习路径信息
* @return 结果
*/
public int insertLearningPathInfo(LearningPathInfo learningPathInfo);
/**
* 修改学习路径信息
*
* @param learningPathInfo 学习路径信息
* @return 结果
*/
public int updateLearningPathInfo(LearningPathInfo learningPathInfo);
/**
* 删除学习路径信息
*
* @param id 学习路径信息主键
* @return 结果
*/
public int deleteLearningPathInfoById(String id);
/**
* 批量删除学习路径信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteLearningPathInfoByIds(String[] ids);
}

View File

@ -0,0 +1,42 @@
package com.inspur.develop.service;
import com.inspur.develop.domain.LearningPathCourse;
import java.util.List;
/**
* 学习路径与课程关联表
*
* @Author xusd
* @Date 2024/4/30 14:55
**/
public interface ILearningPathCourseService {
/**
* 新增学习路径课程关联
*
* @param learningPathCourse 学习路径课程关联
* @return 结果
*/
int insertLearningPathCourse(LearningPathCourse learningPathCourse);
/**
* 根据学习路径id删除学习路径与课程关联信息
*
* @Author xusd
* @Date 15:10 2024/4/30
* @param pathId 学习路径id
* @return int
*/
int deleteLearningPathCourseByPathId(String pathId);
/**
* 根据学习路径id查询学习路径与课程关联信息
*
* @Author xusd
* @Date 15:10 2024/4/30
* @param pathId 学习路径id
* @return int
*/
List<LearningPathCourse> selectLearningPathCourseByPathId(String pathId);
}

View File

@ -0,0 +1,61 @@
package com.inspur.service;
import java.util.List;
import com.inspur.develop.domain.LearningPathInfo;
/**
* 学习路径信息Service接口
*
* @author inspur
* @date 2024-04-29
*/
public interface ILearningPathInfoService
{
/**
* 查询学习路径信息
*
* @param id 学习路径信息主键
* @return 学习路径信息
*/
public LearningPathInfo selectLearningPathInfoById(String id);
/**
* 查询学习路径信息列表
*
* @param learningPathInfo 学习路径信息
* @return 学习路径信息集合
*/
public List<LearningPathInfo> selectLearningPathInfoList(LearningPathInfo learningPathInfo);
/**
* 新增学习路径信息
*
* @param learningPathInfo 学习路径信息
* @return 结果
*/
public int insertLearningPathInfo(LearningPathInfo learningPathInfo);
/**
* 修改学习路径信息
*
* @param learningPathInfo 学习路径信息
* @return 结果
*/
public int updateLearningPathInfo(LearningPathInfo learningPathInfo);
/**
* 批量删除学习路径信息
*
* @param ids 需要删除的学习路径信息主键集合
* @return 结果
*/
public int deleteLearningPathInfoByIds(String[] ids);
/**
* 删除学习路径信息信息
*
* @param id 学习路径信息主键
* @return 结果
*/
public int deleteLearningPathInfoById(String id);
}

View File

@ -0,0 +1,61 @@
package com.inspur.develop.service.impl;
import com.inspur.develop.domain.LearningPathCourse;
import com.inspur.develop.mapper.LearningPathCourseMapper;
import com.inspur.develop.service.ILearningPathCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* 学习路径与课程关联表
*
* @Author xusd
* @Date 2024/4/30 14:55
**/
@Service
public class LearningPathCourseServiceImpl implements ILearningPathCourseService {
@Autowired
private LearningPathCourseMapper learningPathCourseMapper;
/**
* 新增学习路径课程关联
*
* @param learningPathCourse 学习路径课程关联
* @return 结果
*/
@Override
public int insertLearningPathCourse(LearningPathCourse learningPathCourse)
{
return learningPathCourseMapper.insertLearningPathCourse(learningPathCourse);
}
/**
* 根据学习路径id删除学习路径与课程关联信息
*
* @Author xusd
* @Date 15:10 2024/4/30
* @param pathId 学习路径id
* @return int
*/
@Override
public int deleteLearningPathCourseByPathId(String pathId) {
return learningPathCourseMapper.deleteLearningPathCourseByPathId(pathId);
}
/**
* 根据学习路径id查询学习路径与课程关联信息
*
* @Author xusd
* @Date 15:10 2024/4/30
* @param pathId 学习路径id
* @return int
*/
@Override
public List<LearningPathCourse> selectLearningPathCourseByPathId(String pathId) {
return learningPathCourseMapper.selectLearningPathCourseByPathId(pathId);
}
}

View File

@ -0,0 +1,148 @@
package com.inspur.service.impl;
import java.util.Base64;
import java.util.List;
import java.util.Objects;
import cn.hutool.core.util.StrUtil;
import com.inspur.common.sftp.ISFTPServices;
import com.inspur.common.utils.DateUtils;
import com.inspur.common.utils.SecurityUtils;
import com.inspur.common.utils.StringUtils;
import com.inspur.common.utils.file.FileTypeUtils;
import com.inspur.common.utils.uuid.IdUtils;
import com.inspur.develop.domain.LearningPathCourse;
import com.inspur.develop.service.ILearningPathCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.inspur.develop.mapper.LearningPathInfoMapper;
import com.inspur.develop.domain.LearningPathInfo;
import com.inspur.service.ILearningPathInfoService;
import org.springframework.transaction.annotation.Transactional;
/**
* 学习路径信息Service业务层处理
*
* @author inspur
* @date 2024-04-29
*/
@Service
public class LearningPathInfoServiceImpl implements ILearningPathInfoService
{
@Autowired
private LearningPathInfoMapper learningPathInfoMapper;
@Autowired
private ILearningPathCourseService learningPathCourseService;
@Autowired
private ISFTPServices sftpServices;
/**
* 查询学习路径信息
*
* @param id 学习路径信息主键
* @return 学习路径信息
*/
@Override
public LearningPathInfo selectLearningPathInfoById(String id)
{
LearningPathInfo learningPathInfo = learningPathInfoMapper.selectLearningPathInfoById(id);
if (Objects.nonNull(learningPathInfo)){
learningPathInfo.setLearningPathCourseList(learningPathCourseService.selectLearningPathCourseByPathId(id));
if (StringUtils.isNotEmpty(learningPathInfo.getFileName())){
byte[] bytes = sftpServices.downLoadFile(learningPathInfo.getFileName());
learningPathInfo.setPhotoBase("data:image/png;base64,"+Base64.getEncoder().encodeToString(bytes));
}
}
return learningPathInfo;
}
/**
* 查询学习路径信息列表
*
* @param learningPathInfo 学习路径信息
* @return 学习路径信息
*/
@Override
public List<LearningPathInfo> selectLearningPathInfoList(LearningPathInfo learningPathInfo)
{
return learningPathInfoMapper.selectLearningPathInfoList(learningPathInfo);
}
/**
* 新增学习路径信息
*
* @param learningPathInfo 学习路径信息
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertLearningPathInfo(LearningPathInfo learningPathInfo)
{
learningPathInfo.setId(IdUtils.fastSimpleUUID());
learningPathInfo.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
learningPathInfo.setCreateTime(DateUtils.getNowDate());
int i = learningPathInfoMapper.insertLearningPathInfo(learningPathInfo);
if (i > 0){
if (StringUtils.isNotEmpty(learningPathInfo.getLearningPathCourseList())){
List<LearningPathCourse> learningPathCourseList = learningPathInfo.getLearningPathCourseList();
learningPathCourseList.forEach(item->{
item.setLearningPathId(learningPathInfo.getId());
learningPathCourseService.insertLearningPathCourse(item);
});
}
}
return i;
}
/**
* 修改学习路径信息
*
* @param learningPathInfo 学习路径信息
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int updateLearningPathInfo(LearningPathInfo learningPathInfo)
{
learningPathInfo.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
learningPathInfo.setUpdateTime(DateUtils.getNowDate());
int i = learningPathInfoMapper.updateLearningPathInfo(learningPathInfo);
if (i > 0){
if (StringUtils.isNotEmpty(learningPathInfo.getLearningPathCourseList())){
List<LearningPathCourse> learningPathCourseList = learningPathInfo.getLearningPathCourseList();
learningPathCourseService.deleteLearningPathCourseByPathId(learningPathInfo.getId());
learningPathCourseList.forEach(item->{
item.setLearningPathId(learningPathInfo.getId());
learningPathCourseService.insertLearningPathCourse(item);
});
}
}
return i;
}
/**
* 批量删除学习路径信息
*
* @param ids 需要删除的学习路径信息主键
* @return 结果
*/
@Override
public int deleteLearningPathInfoByIds(String[] ids)
{
return learningPathInfoMapper.deleteLearningPathInfoByIds(ids);
}
/**
* 删除学习路径信息信息
*
* @param id 学习路径信息主键
* @return 结果
*/
@Override
public int deleteLearningPathInfoById(String id)
{
return learningPathInfoMapper.deleteLearningPathInfoById(id);
}
}

View File

@ -0,0 +1,64 @@
<?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="com.inspur.develop.mapper.LearningPathCourseMapper">
<insert id="insertLearningPathCourse" parameterType="com.inspur.develop.domain.LearningPathCourse">
insert into learning_path_course
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="learningPathId != null">learning_path_id,</if>
<if test="courseId != null">course_id,</if>
<if test="type != null">type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="learningPathId != null">#{learningPathId},</if>
<if test="courseId != null">#{courseId},</if>
<if test="type != null">#{type},</if>
</trim>
</insert>
<delete id="deleteLearningPathCourseByPathId">
delete from learning_path_course where learning_path_id = #{pathId}
</delete>
<select id="selectLearningPathCourseByPathId" resultType="com.inspur.develop.domain.LearningPathCourse">
SELECT
lpc.learning_path_id AS learningPathId,
lpc.course_id AS courseId,
'0' AS type,
'在线课程' AS typeName,
coi.class_name AS courseName
FROM
learning_path_course AS lpc
JOIN course_online_info AS coi ON lpc.course_id = coi.class_id
AND lpc.type = '0'
WHERE
lpc.learning_path_id = #{pathId} UNION ALL
SELECT
lpc.learning_path_id AS learningPathId,
lpc.course_id AS courseId,
'1' AS type,
'视频课程' AS typeName,
cvi.course_name AS courseName
FROM
learning_path_course AS lpc
JOIN course_video_info AS cvi ON lpc.course_id = cvi.course_id
AND lpc.type = '1'
WHERE
lpc.learning_path_id = #{pathId} UNION ALL
SELECT
lpc.learning_path_id AS learningPathId,
lpc.course_id AS courseId,
'2' AS type,
'培训资料' AS typeName,
cdi.doc_name AS courseName
FROM
learning_path_course AS lpc
JOIN course_document_info AS cdi ON lpc.course_id = cdi.doc_id
AND lpc.type = '2'
WHERE
lpc.learning_path_id = #{pathId}
</select>
</mapper>

View File

@ -0,0 +1,96 @@
<?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="com.inspur.develop.mapper.LearningPathInfoMapper">
<resultMap type="com.inspur.develop.domain.LearningPathInfo" id="LearningPathInfoResult">
<result property="id" column="id" />
<result property="applicableField" column="applicable_field" />
<result property="applicablePersonnel" column="applicable_personnel" />
<result property="learningPathName" column="learning_path_name" />
<result property="description" column="description" />
<result property="fileName" column="file_name" />
<result property="sftpFileName" column="sftp_file_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectLearningPathInfoVo">
select id, applicable_field, applicable_personnel, learning_path_name, description, file_name, sftp_file_name, create_by, create_time, update_by, update_time from learning_path_info
</sql>
<select id="selectLearningPathInfoList" parameterType="com.inspur.develop.domain.LearningPathInfo" resultMap="LearningPathInfoResult">
<include refid="selectLearningPathInfoVo"/>
<where>
<if test="applicableField != null and applicableField != ''"> and applicable_field like concat('%', #{applicableField}, '%')</if>
<if test="applicablePersonnel != null and applicablePersonnel != ''"> and applicable_personnel like concat('%', #{applicablePersonnel}, '%')</if>
<if test="learningPathName != null and learningPathName != ''"> and learning_path_name like concat('%', #{learningPathName}, '%')</if>
</where>
</select>
<select id="selectLearningPathInfoById" parameterType="String" resultMap="LearningPathInfoResult">
<include refid="selectLearningPathInfoVo"/>
where id = #{id}
</select>
<insert id="insertLearningPathInfo" parameterType="com.inspur.develop.domain.LearningPathInfo">
insert into learning_path_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="applicableField != null">applicable_field,</if>
<if test="applicablePersonnel != null">applicable_personnel,</if>
<if test="learningPathName != null">learning_path_name,</if>
<if test="description != null">description,</if>
<if test="fileName != null">file_name,</if>
<if test="sftpFileName != null">sftp_file_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="applicableField != null">#{applicableField},</if>
<if test="applicablePersonnel != null">#{applicablePersonnel},</if>
<if test="learningPathName != null">#{learningPathName},</if>
<if test="description != null">#{description},</if>
<if test="fileName != null">#{fileName},</if>
<if test="sftpFileName != null">#{sftpFileName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateLearningPathInfo" parameterType="com.inspur.develop.domain.LearningPathInfo">
update learning_path_info
<trim prefix="SET" suffixOverrides=",">
<if test="applicableField != null">applicable_field = #{applicableField},</if>
<if test="applicablePersonnel != null">applicable_personnel = #{applicablePersonnel},</if>
<if test="learningPathName != null">learning_path_name = #{learningPathName},</if>
<if test="description != null">description = #{description},</if>
<if test="fileName != null">file_name = #{fileName},</if>
<if test="sftpFileName != null">sftp_file_name = #{sftpFileName},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteLearningPathInfoById" parameterType="String">
delete from learning_path_info where id = #{id}
</delete>
<delete id="deleteLearningPathInfoByIds" parameterType="String">
delete from learning_path_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="docName != null and docName != ''"> and doc_name like concat('%', #{docName}, '%')</if>
<if test="docType != null and docType != ''"> and doc_type = #{docType}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="docId != null and docId != ''"> and doc_id = #{docId}</if>
</where>
order by create_time desc
</select>

View File

@ -27,7 +27,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCourseOnlineInfoList" parameterType="com.inspur.operations.domain.CourseOnlineInfo" resultMap="CourseOnlineInfoResult">
<include refid="selectCourseOnlineInfoVo"/>
<where>
<where>
<if test="classId != null and classId != ''">and class_id = #{classId}</if>
<if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
<if test="classType != null and classType != ''"> and class_type = #{classType}</if>
<if test="status != null and status != ''"> and status = #{status}</if>

View File

@ -31,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="courseName != null and courseName != ''"> and course_name like concat('%', #{courseName}, '%')</if>
<if test="courseType != null and courseType != ''"> and course_type = #{courseType}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="courseId != null and courseId != ''"> and course_id = #{courseId}</if>
</where>
order by create_time desc
</select>

View File

@ -174,6 +174,17 @@
<artifactId>inspur-order</artifactId>
<version>${inspur.version}</version>
</dependency>
<!--论坛社区模块-->
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-community</artifactId>
<version>${inspur.version}</version>
</dependency>
<dependency>
<groupId>com.inspur</groupId>
<artifactId>inspur-knowledgeBase</artifactId>
<version>${inspur.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -186,8 +197,10 @@
<module>inspur-common</module>
<module>inspur-om</module>
<module>inspur-order</module>
<module>inspur-community</module>
<module>inspur-knowledgeBase</module>
<module>inspur-operations</module>
<module>inspur-develop</module>
</modules>
<packaging>pom</packaging>

View File

@ -0,0 +1,52 @@
import request from "@/utils/request";
// 查询社区帖子信息列表
export function listCommunityInfo(query) {
return request({
url: "/community/info/list",
method: "get",
params: query,
});
}
// 查询社区帖子信息详细
export function getCommunityInfo(postId) {
return request({
url: "/community/info/" + postId,
method: "get",
});
}
// 新增社区帖子信息
export function addCommunityInfo(data) {
return request({
url: "/community/info",
method: "post",
data: data,
});
}
// 修改社区帖子信息
export function updateCommunityInfo(data) {
return request({
url: "/community/info",
method: "put",
data: data,
});
}
//浏览量加一
export function addViews(postId) {
return request({
url: "/community/info/addViews/" + postId,
method: "put",
});
}
// 删除社区帖子信息
export function delCommunityInfo(postId) {
return request({
url: "/community/info/" + postId,
method: "delete",
});
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询学习路径信息列表
export function listLearningPath(query) {
return request({
url: '/develop/learningPath/list',
method: 'get',
params: query
})
}
// 查询学习路径信息详细
export function getLearningPath(id) {
return request({
url: '/develop/learningPath/' + id,
method: 'get'
})
}
// 新增学习路径信息
export function addLearningPath(data) {
return request({
url: '/develop/learningPath',
method: 'post',
data: data
})
}
// 修改学习路径信息
export function updateLearningPath(data) {
return request({
url: '/develop/learningPath',
method: 'put',
data: data
})
}
// 删除学习路径信息
export function delLearningPath(id) {
return request({
url: '/develop/learningPath/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,3 @@
{
"data": ["😀","😁","😂","😃","😄","😅","😆","😉","😊","😋","😎","😍","😘","😗","😙","😚","😇","😐","😑","😶","😏","😣","😥","😮","😯","😪","😫","😴","😌","😛","😜","😝","😒","😓","😔","😕","😲","😷","😖","😞","😟","😤","😢","😭","😦","😧","😨","😬","😰","😱","😳","😵","😡","😠","💘","❤","💓","💔","💕","💖","💗","💙","💚","💛","💜","💝","💞","💟","❣","💪","👈","👉","☝","👆","👇","✌","✋","👌","👍","👎","✊","👊","👋","👏","👐","✍","🍇","🍈","🍉","🍊","🍋","🍌","🍍","🍎","🍏","🍐","🍑","🍒","🍓","🍅","🍆","🌽","🍄","🌰","🍞","🍖","🍗","🍔","🍟","🍕","🍳","🍲","🍱","🍘","🍙","🍚","🍛","🍜","🍝","🍠","🍢","🍣","🍤","🍥","🍡","🍦","🍧","🍨","🍩","🍪","🎂","🍰","🍫","🍬","🍭","🍮","🍯","🍼","☕","🍵","🍶","🍷","🍸","🍹","🍺","🍻","🍴","🌹","🍀","🍎","💰","📱","🌙","🍁","🍂","🍃","🌷","💎","🔪","🔫","🏀","⚽","⚡","👄","👍","🔥","🙈","🙉","🙊","🐵","🐒","🐶","🐕","🐩","🐺","🐱","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🐈","🐯","🐅","🐆","🐴","🐎","🐮","🐂","🐃","🐄","🐷","🐖","🐗","🐽","🐏","🐑","🐐","🐪","🐫","🐘","🐭","🐁","🐀","🐹","🐰","🐇","🐻","🐨","🐼","🐾","🐔","🐓","🐣","🐤","🐥","🐦","🐧","🐸","🐊","🐢","🐍","🐲","🐉","🐳","🐋","🐬","🐟","🐠","🐡","🐙","🐚","🐌","🐛","🐜","🐝","🐞","🦋","😈","👿","👹","👺","💀","☠","👻","👽","👾","💣"]
}

View File

@ -0,0 +1,68 @@
<template>
<el-popover placement="bottom" trigger="click" ref="popover"
v-model="popoverVisible">
<div class="emjioBox">
<ul class="emjio">
<li class="emjioLi" v-for="(item,i) in this.emojiList" :key="i" @click="selectEmit(item)">
{{item}}
</li>
</ul>
</div>
<el-link :underline="false" title="添加表情"
slot="reference">
😀
</el-link>
</el-popover>
</template>
<script>
import emojiList from './emoji.json';
export default {
name: 'emoji',
props: {},
data() {
return {
emojiList: [],
popoverVisible: false,
}
},
watch: {},
created() {
this.init();
},
methods: {
init() {
this.emojiList = emojiList.data
},
//
selectEmit(item) {
this.$emit('output', item)
this.popoverVisible = false
}
},
beforeDestroy() {
}
}
</script>
<style lang="scss" scoped>
.emjioBox {
background: #fff;
height: 150px;
width: 300px;
overflow: auto;
text-align: left;
}
.emjioBox .emjio {
padding: 0;
}
.emjioBox li {
display: inline-block;
width: 28px;
height: 28px;
line-height: 28px;
text-align: center;
cursor: pointer;
}
</style>

View File

@ -0,0 +1,204 @@
<template>
<transition name="fade">
<div
class="input-wrapper"
v-if="show"
>
<el-input
class="gray-bg-input"
maxlength="100"
show-word-limit
v-model="inputComment"
type="textarea"
:rows="3"
@focus="inputFocus"
@blur="blur"
:placeholder="name"
>
</el-input>
<!--enter-active-class="animated fadeInDown" leave-active-class="animated fadeOutUp"-->
<transition name="fade2">
<div
class="btn-control"
v-show="controlShow"
>
<el-row>
<el-col
:span="12"
style="text-align: left"
>
<Emoji @output="output"></Emoji>
</el-col>
<el-col
:span="12"
style="text-align: right"
>
<span
class="cancel"
@click="cancel"
>取消</span>
<el-button
class="btn"
type="success"
round
@click="commitComment"
>确定</el-button>
</el-col>
</el-row>
</div>
</transition>
</div>
</transition>
</template>
<script>
import Emoji from "@/components/Emoji";
export default {
props: {
//
show: {
type: Boolean,
required: true,
},
//input
value: {
type: String,
},
//input
toComment: {
type: String,
},
//input
toId: {
type: Number,
},
//end(), comment(),
type: {
type: String,
// default: 'comment'
},
},
components: { Emoji },
data() {
return {
inputComment: "",
name: "",
id: "",
//
controlShow: false,
cursorIndexStart: null, //
cursorIndexEnd: null, //
};
},
computed: {},
methods: {
/**
* 点击取消按钮
*/
cancel() {
if (this.type === "end") {
this.controlShow = false;
}
this.$emit("cancel");
},
/**
* 提交评论
*/
commitComment() {
this.$emit("confirm", { inputComment: this.inputComment, id: this.id });
this.inputComment = "";
},
//input
inputFocus() {
// console.log("focus");
if (this.type === "end") {
this.controlShow = true;
}
},
blur(e) {
this.cursorIndexStart = e.srcElement.selectionStart; // input
this.cursorIndexEnd = e.srcElement.selectionEnd; // input
},
output(val) {
if (this.cursorIndexStart !== null && this.inputComment) {
// ,
this.inputComment =
this.inputComment.substring(0, this.cursorIndexStart) +
val +
this.inputComment.substring(this.cursorIndexEnd);
} else {
// ,
this.inputComment = this.inputComment ? this.inputComment : "" + val;
}
},
},
watch: {
//toCommentname
toComment: function (newValue, oldValue) {
this.name = newValue;
this.inputComment = "";
},
toId: function (newValue, oldValue) {
this.id = newValue;
this.inputComment = "";
},
},
mounted() {
if (this.type === "end") {
this.controlShow = false;
} else {
this.controlShow = true;
}
// console.log(this.controlShow)
},
};
</script>
<style scoped rel="stylesheet/scss" lang="scss">
.fade-enter-active,
fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter,
.fade-leave-to {
opacity: 0;
}
.input-wrapper {
padding: 10px;
.fade2-enter-active,
fade2-leave-active {
transition: opacity 0.5s;
}
.fade2-enter,
.fade2-leave-to {
opacity: 0;
}
.gray-bg-input,
.el-input__inner {
/*background-color: #67C23A;*/
}
.btn-control {
justify-content: flex-end;
align-items: center;
padding-top: 10px;
.cancel {
font-size: 16px;
color: #606266;
margin-right: 20px;
cursor: pointer;
&:hover {
color: #333;
}
}
.confirm {
font-size: 16px;
}
}
}
</style>

View File

@ -0,0 +1,339 @@
<template>
<el-container style="opacity: 0.9">
<div class="author">
<el-avatar
v-if="token==null"
icon="el-icon-user-solid"
size="large"
>
<!-- style="background-color: #666" -->
</el-avatar>
<el-avatar
v-else
:src="avatar"
size="large"
></el-avatar>
<div>
<div class="nkname">
<span
class="name"
v-if="token==null"
>匿名用户</span>
<span
class="name"
v-else
>{{name}} </span>
</div>
</div>
</div>
<el-form
:model="messageForm"
:rules="messageFormRules"
ref="messageFormRef"
>
<el-form-item prop="content">
<el-input
@blur="blur"
:rows="5"
v-model="messageForm.content"
type="textarea"
maxlength="100"
show-word-limit
placeholder="请输入你的评论"
></el-input>
</el-form-item>
<el-form-item style="text-align: right">
<el-row>
<el-col
:span="12"
style="text-align: left"
>
<Emoji @output="output"></Emoji>
</el-col>
<el-col
:span="12"
style="text-align: right"
>
<el-button
type="primary"
@click="publish"
>点击发表</el-button>
</el-col>
</el-row>
</el-form-item>
</el-form>
<el-divider v-if="messageList.length>0"><span style="color: #999;font-size: small;">最新评论</span></el-divider>
<comment
:comments="messageList"
@replyConfirm="commitComment"
></comment>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getMessageList"
/>
</el-container>
</template>
<script>
import { mapGetters } from "vuex";
import { getToken } from "@/utils/auth";
// import {
// cmsListComment,
// cmsAddComment,
// } from "@/api/cms/comment"
import comment from "./comments.vue";
import Emoji from "@/components/Emoji";
export default {
name: "Ipcomment",
data() {
return {
picList: [],
editing: false,
messageList: [],
// userInfo: null,
message: {
userId: -1,
content: "",
},
messageForm: {},
//
total: 0,
//
queryParams: {
pageNum: 1,
pageSize: 10,
parentId: null,
mainId: null,
likeNum: null,
content: null,
type: null,
blogId: this.$route.query.id,
userId: null,
delFlag: null,
createBy: null,
},
messageFormRules: {
content: [
{
min: 0,
max: 100,
message: "评论内容不超过100字",
},
],
},
cursorIndexStart: null, //
cursorIndexEnd: null, //
};
},
created() {
this.getMessageList();
this.reset();
},
updated: function () {
this.$nextTick(function () {
//
this.to();
});
},
computed: {
...mapGetters(["token", "avatar", "name"]),
},
components: {
comment,
Emoji,
},
methods: {
//
reset() {
this.messageForm = {
id: null,
parentId: null,
mainId: null,
likeNum: null,
content: null,
type: null,
blogId: this.$route.query.id,
userId: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.resetForm("messageForm");
},
//
publish() {
let token = getToken();
this.$refs.messageFormRef.validate(async (valid) => {
if (!valid) return;
if (
this.messageForm.content == null ||
this.messageForm.content == ""
) {
this.$modal.msgError("评论内容不能为空!");
return;
}
if (token == null || token == "") {
this.messageForm.createBy = "匿名用户";
this.messageForm.type = "0";
} else {
this.messageForm.createBy = this.$store.getters.name;
this.messageForm.type = "0";
}
cmsAddComment(this.messageForm).then((response) => {
this.$modal.msgSuccess("评论发表成功");
this.reset();
this.getMessageList();
});
});
},
/**
* 提交评论
*/
commitComment(value) {
this.reset();
this.messageForm.content = value.inputComment;
this.messageForm.parentId = value.id;
let token = getToken();
this.$refs.messageFormRef.validate(async (valid) => {
if (!valid) return;
if (
this.messageForm.content == null ||
this.messageForm.content == ""
) {
this.$modal.msgError("评论内容不能为空!");
return;
}
if (token == null || token == "") {
this.messageForm.createBy = "匿名用户";
this.messageForm.type = "1";
} else {
this.messageForm.createBy = this.$store.getters.name;
this.messageForm.type = "1";
}
cmsAddComment(this.messageForm).then((response) => {
this.$modal.msgSuccess("评论发表成功");
this.reset();
this.getMessageList();
});
});
},
//
async getMessageList() {
let token = getToken();
if (token != null && token != "") {
this.queryParams.createBy = this.$store.getters.name;
}
// cmsListComment(this.queryParams).then((response) => {
// for (let i = 0; i < response.rows.length; i++) {
// let mesInfo = response.rows[i];
// if (mesInfo.avatar != null && mesInfo.avatar != "") {
// response.rows[i].avatar =
// process.env.VUE_APP_BASE_API + mesInfo.avatar;
// }
// if (mesInfo.children != null && mesInfo.children != "") {
// for (let j = 0; j < response.rows[i].children.length; j++) {
// let children = response.rows[i].children;
// if (children.avatar != null && children.avatar != "") {
// response.rows[i].children[j].avatar =
// process.env.VUE_APP_BASE_API + children.avatar;
// }
// }
// }
// }
// this.messageList = response.rows;
// this.total = response.total;
// });
},
blur(e) {
this.cursorIndexStart = e.srcElement.selectionStart; // input
this.cursorIndexEnd = e.srcElement.selectionEnd; // input
},
output(val) {
if (this.cursorIndexStart !== null && this.messageForm.content) {
// ,
this.messageForm.content =
this.messageForm.content.substring(0, this.cursorIndexStart) +
val +
this.messageForm.content.substring(this.cursorIndexEnd);
} else {
// ,
this.messageForm.content = this.messageForm.content
? this.messageForm.content
: "" + val;
}
},
//
to() {
if (this.$route.query.commentId != null) {
var toEl = document.getElementById(this.$route.query.commentId);
if (toEl != null) {
if (toEl != null && toEl != "") {
// toEl DOM
let bridgeCms = toEl;
let bodyTop = document.body;
let heightCms = 0;
// DOM bodyTop
do {
heightCms += bridgeCms.offsetTop;
bridgeCms = bridgeCms.offsetParent;
} while (bridgeCms !== bodyTop);
//
window.scrollTo({
top: heightCms,
behavior: "smooth",
});
}
}
}
},
},
};
</script>
<style scoped>
.el-container {
display: block;
}
.author {
display: flex;
justify-content: flex-start;
align-items: center;
width: 100%;
margin-bottom: 20px;
}
.comment {
border-bottom: 1px dashed #ccc;
margin: 30px 0;
display: flex;
}
.content {
text-align: left;
font-size: 14px;
flex-grow: 1;
}
.nkname {
margin: 10px;
max-width: 530px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.date {
color: #999;
margin-left: 10px;
}
.reply {
margin-left: 10px;
}
</style>

View File

@ -0,0 +1,369 @@
<!--评论模块-->
<template>
<div class="container">
<div class="comment" v-for="item in comments">
<div class="info" :id="item.id">
<el-avatar v-if="item.avatar!==''&&item.avatar!=null" :src="item.avatar"></el-avatar>
<el-avatar v-else icon="el-icon-user-solid"></el-avatar>
<div class="right">
<div class="name">{{item.createBy}}</div>
<div class="date">{{item.createTime}}</div>
</div>
</div>
<div class="content">{{item.content}}</div>
<div class="control">
<span class="like" :class="{active: item.isLike}" @click="likeClick(item)">
<svg-icon icon-class="like" />
<span class="like-num" style="margin-left: 5px;">{{item.likeNum > 0 ? item.likeNum + '人赞' : '赞'}}</span>
</span>
<span class="comment-reply" @click="showCommentInput(item)">
<svg-icon icon-class="comment" />
<span style="margin-left: 5px;">回复</span>
</span>
</div>
<div class="reply">
<div class="item" v-for="reply in item.children" :id="reply.id">
<div class="reply-content">
<span class="from-name">{{reply.createBy}}</span><span>: </span>
<span class="to-name" v-show="reply.parentId!=reply.mainId">@{{reply.pcreateBy}}</span>
<span v-show="reply.delFlag=='0'">{{reply.content}}</span>
<span v-show="reply.delFlag=='1'" style="color: #909399;">该评论已被删除</span>
</div>
<div class="reply-bottom">
<span>{{reply.createTime}}</span>
<span class="reply-text" @click="showCommentInput(item, reply)">
<svg-icon icon-class="comment" />
<span style="margin-left: 5px;">回复</span>
</span>
</div>
</div>
<div class="write-reply" v-if="item.children!=null" @click="showCommentInput(item)">
<i class="el-icon-edit"></i>
<span class="add-comment">添加新评论</span>
</div>
<input-component :show="showItemId === item.id"
:value="inputComment"
:toComment="name"
:toId="id"
@cancel="cancelInput"
@confirm="commitComment">
</input-component>
<!--<transition name="fade">-->
<!--<div class="input-wrapper" v-if="showItemId === item.id">-->
<!--<el-input class="gray-bg-input"-->
<!--v-model="inputComment"-->
<!--type="textarea"-->
<!--:rows="3"-->
<!--autofocus-->
<!--placeholder="写下你的评论">-->
<!--</el-input>-->
<!--<div class="btn-control">-->
<!--<span class="cancel" @click="cancel">取消</span>-->
<!--<el-button class="btn" type="success" round @click="commitComment">确定</el-button>-->
<!--</div>-->
<!--</div>-->
<!--</transition>-->
</div>
</div>
</div>
</template>
<script>
import Vue from 'vue'
import InputComponent from './InputComponent'
import {
getToken
} from '@/utils/auth'
// import {
// addCmsCommentLike,
// delCmsCommentLike,
// } from "@/api/cms/comment"
export default {
props: {
comments: {
type: Array,
required: true
}
},
components: {
"input-component": InputComponent
},
data() {
return {
inputComment: '',
name: '',
id: null,
showItemId: '',
commentLikeForm: {},
}
},
computed: {},
methods: {
//
reset() {
this.commentLikeForm = {
commentId: null,
userId: null,
likeNum: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("commentLikeForm");
},
/**
* 新增点赞
*/
addCommentLike(item){
let token = getToken();
this.reset();
if (token==null || token == '') {
this.commentLikeForm.createBy = "匿名用户"
this.commentLikeForm.commentId = item.id
this.commentLikeForm.likeNum = item.likeNum
} else {
this.commentLikeForm.createBy = this.$store.getters.name
this.commentLikeForm.commentId = item.id
this.commentLikeForm.likeNum = item.likeNum
}
addCmsCommentLike(this.commentLikeForm).then(response => {
this.reset();
});
},
/**
* 删除点赞
*/
delCommentLike(item){
let token = getToken();
this.reset();
if (token==null || token == '') {
this.commentLikeForm.createBy = "匿名用户"
this.commentLikeForm.commentId = item.id
this.commentLikeForm.likeNum = item.likeNum
} else {
this.commentLikeForm.createBy = this.$store.getters.name
this.commentLikeForm.commentId = item.id
this.commentLikeForm.likeNum = item.likeNum
}
delCmsCommentLike(this.commentLikeForm).then(response => {
this.reset();
});
},
/**
* 点赞
*/
likeClick(item) {
if (item.isLike === null) {
Vue.$set(item, "isLike", true);
item.likeNum++
this.addCommentLike(item)
} else {
if (item.isLike) {
item.likeNum--
this.delCommentLike(item)
} else {
item.likeNum++
this.addCommentLike(item)
}
item.isLike = !item.isLike;
}
},
/**
* 点击取消按钮
*/
cancelInput() {
this.showItemId = ''
},
/**
* 提交评论
*/
commitComment(value) {
this.$emit("replyConfirm", value)
// console.log(value);
},
/**
* 点击评论按钮显示输入框
* item: 当前大评论
* reply: 当前回复的评论
*/
showCommentInput(item, reply) {
if (reply) {
this.inputComment = ""
this.name = "回复@" + reply.createBy + ":"
this.id = reply.id
} else {
this.inputComment = ''
this.name = '写下你的评论'
this.id = item.id
}
this.showItemId = item.id
}
},
created() {
// console.log(this.comments)
}
}
</script>
<style scoped rel="stylesheet/scss" lang="scss">
.container {
padding: 0 10px;
box-sizing: border-box;
.comment {
display: flex;
flex-direction: column;
padding: 10px;
border-bottom: 1px solid #F2F6FC;
.info {
display: flex;
align-items: center;
.right {
display: flex;
flex-direction: column;
margin-left: 10px;
.name {
font-size: 16px;
color: #303133;
margin-bottom: 5px;
font-weight: 500;
}
.date {
font-size: 12px;
color: #909399;
}
}
}
.content {
font-size: 16px;
color: #303133;
line-height: 20px;
padding: 10px 0;
}
.control {
display: flex;
align-items: center;
font-size: 14px;
color: #909399;
.like {
display: flex;
align-items: center;
margin-right: 20px;
cursor: pointer;
&.active, &:hover {
color: #409EFF;
}
.iconfont {
font-size: 14px;
margin-right: 5px;
}
}
.comment-reply {
display: flex;
align-items: center;
cursor: pointer;
&:hover {
color: #333;
}
.iconfont {
font-size: 16px;
margin-right: 5px;
}
}
}
.reply {
margin: 10px 0;
border-left: 2px solid #DCDFE6;
.item {
margin: 0 10px;
padding: 10px 0;
border-bottom: 1px dashed #EBEEF5;
.reply-content {
display: flex;
align-items: center;
font-size: 14px;
color: #303133;
.from-name {
color: #409EFF;
}
.to-name {
color: #409EFF;
margin-left: 5px;
margin-right: 5px;
}
}
.reply-bottom {
display: flex;
align-items: center;
margin-top: 6px;
font-size: 12px;
color: #909399;
.reply-text {
display: flex;
align-items: center;
margin-left: 10px;
cursor: pointer;
&:hover {
color: #333;
}
.icon-comment {
margin-right: 5px;
}
}
}
}
.write-reply {
display: flex;
align-items: center;
font-size: 14px;
color: #909399;
padding: 10px;
cursor: pointer;
&:hover {
color: #303133;
}
.el-icon-edit {
margin-right: 5px;
}
}
.fade-enter-active, fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter, .fade-leave-to {
opacity: 0;
}
.input-wrapper {
padding: 10px;
.gray-bg-input, .el-input__inner {
/*background-color: #67C23A;*/
}
.btn-control {
display: flex;
justify-content: flex-end;
align-items: center;
padding-top: 10px;
.cancel {
font-size: 16px;
color: #606266;
margin-right: 20px;
cursor: pointer;
&:hover {
color: #333;
}
}
.confirm {
font-size: 16px;
}
}
}
}
}
}
</style>

View File

@ -0,0 +1,437 @@
<template>
<el-row :gutter="20">
<el-col
:sm="3"
class="hidden-xs-only"
style="opacity:0;"
>左侧占位</el-col>
<el-col
:xs="24"
:sm="18"
>
<el-card
style="background-color: rgba(255, 255, 255,1)"
class="first-card"
>
<div
slot="header"
class="total blog-info"
>
<div class="user-info">
<i class="el-icon-user"></i>
<span class="header"> {{blog.userName}}</span>
</div>
<div class="blog-date">
<i class="el-icon-date"></i>
<span> {{blog.postTime}}</span>
</div>
<div class="blog-views">
<i class="el-icon-view"></i>
<span> {{blog.views}}</span>
</div>
</div>
<h2 class="blog-title header">{{blog.postTitle}}
<!-- <el-tag
size="mini"
v-for="tag in blog.types"
:key="tag.typeId"
type="info"
>{{tag.typeName}}</el-tag> -->
</h2>
<div style="display:flex">
<div class="tag-type"><template>
<dict-tag
:options="dict.type.post_type"
:value="blog.postType"
/>
</template></div>
<div class="tag-type"><template>
<dict-tag
:options="dict.type.community_field"
:value="blog.omField"
/>
</template></div>
<div class="tag-type"><template>
<dict-tag
:options="dict.type.community_industry"
:value="blog.omIndustry"
/>
</template></div>
</div>
<div
class="typo m-padded-lr-responsive m-padded-tb-large ql-editor"
v-html="blog.postContent"
></div>
<!-- <div class="tags">
<div
class="tag-item"
v-for="tag in blog.tags"
:key="tag.tagId"
>
<div class="sjx-outer">
<div class="sjx-inner"></div>
</div>
<div class="tag">
{{tag.tagName}}
</div>
</div>
</div> -->
<!-- <div class="appreciate">
<el-popover
placement="bottom"
title=""
width="300"
trigger="hover"
content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<el-button class="zanshang" slot="reference" type="danger" round plain>赞赏</el-button>
</el-popover>
</div> -->
<!-- <el-table
:data="blog.blogFilesNew"
:border="true"
style="width: 99.99%;"
>
<el-table-column
align="center"
min-width="30%"
prop="remark"
label="附件"
>
<template slot-scope="scope">
<el-row>
<el-col :span="6">
<div class="blogFilesInfoName">名称</div>
</el-col>
<el-col :span="18"><el-input
v-model="scope.row.fileOriginName"
disabled
/></el-col>
</el-row>
<el-row style="margin-top: 4px;">
<el-col :span="6">
<div class="blogFilesInfoName">大小</div>
</el-col>
<el-col :span="18"><el-input
v-model="scope.row.fileSize"
disabled
/></el-col>
</el-row>
<el-row style="margin-top: 4px;">
<el-col :span="6">
<div class="blogFilesInfoName">类型</div>
</el-col>
<el-col :span="18"><el-input
v-model="scope.row.fileSuffix"
disabled
/></el-col>
</el-row>
</template>
</el-table-column>
<el-table-column
align="center"
min-width="50%"
prop="remark"
label="备注"
>
<template slot-scope="scope">
<el-input
v-model="scope.row.remark"
type="textarea"
:rows="6"
size="small"
disabled
/>
</template>
</el-table-column>
<el-table-column
align="center"
min-width="20%"
label="操作"
>
<template slot-scope="scope">
<el-button
size="mini"
plain
@click="handleDownload(scope.row)"
>下载</el-button>
</template>
</el-table-column>
</el-table> -->
<div class="author">
<ul>
<li>作者 {{blog.userName}}</li>
<li>发表时间 {{blog.postTime}}</li>
</ul>
</div>
<el-card
shadow="never"
class="comments"
>
<div
class="header"
style="padding-bottom: 10px;"
>
评论
</div>
<comment></comment>
</el-card>
</el-card>
</el-col>
<el-col
:xs="24"
:sm="0"
></el-col>
<el-col
:sm="3"
class="hidden-xs-only"
style="opacity:0;"
>右侧占位</el-col>
<!-- 设置底部距离的 -->
<el-backtop :bottom="60">
<div style="{
height: 50px;
width: 50px;
background-color: rgba(240,239,241,1);
box-shadow: 0 0 6px rgba(0,0,0, .12);
text-align: center;
line-height: 40px;
border-radius:2px;
color: #1989fa;
}">
<svg-icon icon-class="top" />
</div>
</el-backtop>
</el-row>
</template>
<script>
import comment from "../comment/Ipcomment";
import { mapState } from "vuex";
import {
listCommunityInfo,
getCommunityInfo,
addCommunityInfo,
updateCommunityInfo,
CommunityInfo,
addViews,
} from "@/api/community/info";
export default {
dicts: ["post_type", "community_field", "community_industry"],
components: {
comment,
},
data() {
return {
blog: {},
commentForm: {
content: "",
},
};
},
watch: {
$route(to, from) {
this.$router.go(0);
},
},
created() {
this.getBlogInfomation();
},
computed: {
...mapState(["userInfo", "administrator"]),
},
methods: {
//
async getBlogInfomation() {
//
addViews(this.$route.query.id);
getCommunityInfo(this.$route.query.id).then((response) => {
this.blog = response.data;
});
},
//
// handleDownload(row) {
// var name = row.fileOriginName;
// var url = row.filePath;
// var suffix = url.substring(url.lastIndexOf("."), url.length);
// const a = document.createElement("a");
// a.setAttribute("download", name);
// a.setAttribute("target", "_blank");
// a.setAttribute("href", process.env.VUE_APP_BASE_API + url);
// a.click();
// },
},
};
</script>
<style scoped>
.tag-type {
display: flex;
margin: 0 5px 0 5px;
}
.el-card {
width: 100%;
}
.el-popper /deep/ {
box-shadow: 0 2px 4px 0 rgb(34 36 38 / 12%);
}
.first-card {
border-radius: 10px 10px 10px 10px;
position: relative;
padding-bottom: 10px;
/*text-align: center;*/
font: 300 1em/1.8 PingFang SC, Lantinghei SC, Microsoft Yahei,
Hiragino Sans GB, Microsoft Sans Serif, WenQuanYi Micro Hei, sans-serif;
}
hr.style-one {
width: 100%;
background-image: linear-gradient(
to right,
rgba(64, 158, 255, 0),
rgba(64, 158, 255, 0.75),
rgba(64, 158, 255, 0)
);
}
.forum-type-span {
font-size: medium;
color: #d56611;
}
.appreciate {
text-align: center;
}
.tags {
display: flex;
align-items: center;
margin-left: 50px;
margin-top: 20px;
}
.tag-item {
display: flex;
justify-content: space-around;
align-items: center;
margin-left: 10px;
margin-bottom: 20px;
}
.tag {
padding-left: 10px;
padding-right: 10px;
border-radius: 5px;
background-color: #ecf5ff;
border: 1px solid #409eff;
color: #409eff;
display: flex;
}
.sjx-outer {
width: 0;
height: 0;
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-right: 7px solid #409eff;
position: relative;
}
.sjx-inner {
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-right: 7px solid #ecf5ff;
top: -7px;
left: 1px;
position: absolute;
}
.author {
text-align: left;
background-color: #fcfff5;
box-shadow: 0 0 0 1px #a3c293 inset;
color: #2c662d;
width: 100%;
position: absolute;
left: 0;
margin: 20px 0;
padding: 20px 0;
font-size: small;
font-family: PingFang SC, Lantinghei SC, Microsoft Yahei, Hiragino Sans GB,
Microsoft Sans Serif, WenQuanYi Micro Hei, sans-serif;
}
.comments {
margin-top: 150px;
box-shadow: 0 1px 2px 0 rgb(34 36 38 / 15%);
border: 1px solid rgba(34, 36, 38, 0.15);
border-top: 2px solid #409eff;
text-align: left;
}
.blog-title {
text-align: center;
}
.blog-info {
display: flex;
align-items: center;
color: rgba(0, 0, 0, 0.4);
font-size: 13px;
}
.blog-date {
margin-right: 5px;
float: right;
}
.blog-views {
margin-right: 5px;
float: right;
}
.user-info {
justify-content: space-around;
align-items: center;
margin-right: 15px;
float: left;
}
.header {
text-decoration: none;
color: #3a8ee6;
font-weight: bold;
}
@media screen and (max-width: 768px) {
.tags {
margin-left: 0;
margin-top: 20px;
}
hr {
display: none;
}
.comment-content {
font-size: 12px !important;
}
}
@media only screen and (max-width: 480px) {
h2 {
font-weight: normal;
}
code,
pre {
font-size: 13px !important;
}
}
.blogFilesInfoName {
text-align: center;
padding-top: 5px;
}
</style>

View File

@ -0,0 +1,306 @@
<template>
<div class="app-container">
<div>
<div style="text-align:center;margin-bottom:5px">
<i
class="el-icon-chat-line-round"
style="color:blue"
></i>
<span style="font-weight:bold">发表新贴</span>
</div>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="80px"
>
<el-form-item
label="标题"
prop="postTitle"
>
<el-row>
<el-col :span="24">
<el-input
v-model="form.postTitle"
placeholder="请输入标题"
/>
</el-col>
</el-row>
</el-form-item>
<!-- <el-row>
<el-col :span="8">
<el-form-item label="首图">
<el-radio-group v-model="form.blogPicType">
<el-radio-button label="0">地址</el-radio-button>
<el-radio-button label="1">上传</el-radio-button>
</el-radio-group>
<div
v-show="form.blogPicType == '0'"
class="tabBlock"
>
<el-input
v-model="form.blogPicLink"
placeholder="请输入图片地址 https://"
style="margin-bottom: 10px;"
/>
<el-image
:src="form.blogPicLink"
:preview-src-list="[form.blogPicLink]"
fit="cover"
class="blogPic"
>
<div
slot="error"
class="image-slot"
>
<el-image
src="/errorImg.jpg"
fit="cover"
class="blogPic"
></el-image>
</div>
</el-image>
</div>
<div
v-show="form.blogPicType == '1'"
class="tabBlock"
>
<imageUpload
v-model="form.blogPic"
:limit="1"
/>
</div>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="简介">
<el-input
type="textarea"
v-model="form.blogDesc"
:autosize="{ minRows: 7, maxRows: 7}"
maxlength="50"
show-word-limit
placeholder="请输入简介"
/>
</el-form-item>
</el-col>
</el-row> -->
<el-row>
<el-col :span="24">
<el-form-item
prop="postContent"
label="内容"
>
<Editor
v-model="form.postContent"
type="base64"
:min-height="192"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item
prop="postType"
label="帖子类型"
>
<el-select
v-model="form.postType"
placeholder="请选择"
filterable
clearable
>
<el-option
v-for="item in dict.type.post_type"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
prop="omField"
label="运维领域"
>
<el-select
v-model="form.omField"
placeholder="请选择"
clearable
>
<el-option
v-for="item in dict.type.community_field"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
prop="omIndustry"
label="运维行业"
>
<el-select
v-model="form.omIndustry"
placeholder="请选择"
clearable
>
<el-option
v-for="item in dict.type.community_industry"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div style="text-align:right">
<el-button
type="primary"
@click="releaseForm"
> </el-button>
</div>
</div>
</template>
<script>
import {
listCommunityInfo,
getCommunityInfo,
addCommunityInfo,
updateCommunityInfo,
CommunityInfo,
} from "@/api/community/info";
export default {
name: "forum",
dicts: ["post_type", "community_field", "community_industry"],
data() {
return {
//
loading: true,
//
total: 0,
//
blogList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
postType: null,
omField: null,
omIndustry: null,
postTitle: null,
postContent: null,
},
//
form: {},
//
rules: {
postTitle: [
{
required: true,
message: "标题不能为空",
trigger: "blur",
},
],
postContent: [
{
required: true,
message: "内容不能为空",
trigger: "blur",
},
],
postType: [
{
required: true,
message: "帖子类型不能为空",
trigger: "change",
},
],
omField: [
{
required: true,
message: "运维行业不能为空",
trigger: "change",
},
],
omIndustry: [
{
required: true,
message: "运维领域不能为空",
trigger: "change",
},
],
},
//
typeOptions: [],
//
tagOptions: [],
};
},
created() {},
methods: {
validate(callback) {
//form el-form ref="contentForm"
this.$refs.form.validate((valid) => {
callback(valid);
});
},
/** 查询文章管理列表 */
getList() {},
/**发布帖子 */
releaseForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
addCommunityInfo(this.form).then((response) => {
this.$emit("addSucess", response.data);
this.reset();
});
}
});
},
//
cancel() {},
//
reset() {
this.form = {};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
},
};
</script>
<style lang="scss" scoped>
.app-container {
background-color: #f6f6f6;
}
</style>

View File

@ -0,0 +1,927 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col
:sm="2"
class="hidden-xs-only"
style="opacity:0;"
>左侧占位</el-col>
<el-col
:xs="24"
:sm="15"
>
<el-card
style="background-color: rgba(255,255,255,0.9)"
class="left-item"
>
<div
slot="header"
class="total"
>
<div class="titleIndex">
<i
v-if="selected"
class="el-icon-back"
@click="updateForumList"
></i>
<span>{{selectMethod}}</span>
</div>
<!-- <span> <span style="color: #3a8ee6; font-size: 20px">{{totalcount}}</span> </span> -->
</div>
<el-row
type="flex"
align="middle"
style="flex-wrap: wrap"
:gutter="20"
v-for="forum in forumList"
:key="forum.postId"
shadow="never"
class="forum-content"
>
<div @click="getForumInfo(forum.postId)">
<!-- <el-col
class="img"
:xs="24"
:sm="6"
>
<el-image
v-if="forum.blogPicType == '0'"
lazy
:src="forum.blogPicLink"
>
<div
slot="error"
class="image-slot"
>
<el-image
src="/errorImg.jpg"
fit="cover"
class="blogPic"
>></el-image>
</div>
</el-image>
<el-image
v-if="forum.blogPicType == '1'"
lazy
:src="forum.blogPic"
></el-image>
</el-col> -->
<el-col
:xs="24"
:sm="18"
style="padding-left: 10px;padding-right: 10px;margin-bottom: 5px;margin-top: -5px;"
>
<div>
<h3><svg-icon
icon-class="Topping"
v-show="forum.top==1"
/> {{forum.postTitle}}</h3>
<!-- <div style="margin-bottom: 10px;">
<span style="color: rgba(0, 0, 0, .4);"> {{forum.blogDesc}}</span>
</div> -->
<!-- <div style="margin-bottom: 10px;">
<el-tag
effect="plain"
size="mini"
v-for="tag in forum.tags"
:key="tag.tagId"
type="success"
>
{{tag.tagName}}
</el-tag>
</div> -->
<div class="forum-info">
<div class="user-info">
<i class="el-icon-user"></i>
<span class="header">{{ forum.userName}}</span>
</div>
<div class="forum-date">
<i class="el-icon-date"></i>
<span> {{forum.postTime}}</span>
</div>
<div class="forum-views">
<i class="el-icon-view"></i>
<span> {{forum.views}}</span>
</div>
<!-- <div class="forum-type">
<el-tag
size="mini"
v-for="tag in forum.types"
:key="tag.typeId"
type="info"
>
{{tag.typeName}}
</el-tag>
</div> -->
</div>
</div>
</el-col>
</div>
</el-row>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
background
layout="total, sizes, prev, pager, next, jumper"
@pagination="getForumList"
style="margin-bottom: 30px;float: right;margin-right: 10px;"
/>
</el-card>
<forumForm
ref="form"
@addSucess="releaseSuc"
></forumForm>
</el-col>
<el-col
:xs="24"
:sm="5"
>
<el-card
style="background-color: rgba(255,255,255,0.9)"
class=" right-item"
>
<div
slot="header"
class="attributes"
>
<b>帖子热度榜</b>
</div>
<ul
class=" forum-type-ul"
style="margin-top: 5px;"
>
<li
class=" forum-type-li"
v-for="cmsType in typeList"
:key="cmsType.typeId"
@click="selectType(cmsType)"
:class="cmsType.typeId === typeId? 'activeType':''"
>
<div style="display: flex;align-items: center">
<el-image
style="width: 28px;height: 28px; border-radius: 50%; margin-right: 10px"
lazy
:src="cmsType.typePicLink"
v-show="cmsType.typePicType == '0'"
>
<div
slot="error"
style="width: 28px;height: 28px; border-radius: 50%;"
>
<i
class="el-icon-collection"
style="margin-left:6px;"
></i>
</div>
</el-image>
<el-image
style="width: 28px;height: 28px; border-radius: 50%; margin-right: 10px"
lazy
:src="cmsType.typePic"
v-show="cmsType.typePicType == '1'"
>
<div
slot="error"
style="width: 28px;height: 28px; border-radius: 50%;"
>
<i
class="el-icon-collection"
style="margin-left:6px;"
></i>
</div>
</el-image>
{{cmsType.typeName}}
</div>
<div>{{cmsType.blogNum}}</div>
</li>
</ul>
<div
class="more"
@click="dealType"
>
<i
v-if="moreType"
class="el-icon-arrow-down"
></i>
<i
v-else
class="el-icon-arrow-up"
></i>
</div>
</el-card>
<el-card
style="background-color: rgba(255,255,255,0.9)"
class=" right-item"
>
<div
slot="header"
class="attributes"
>
<b>标签</b>
</div>
<div class="tags">
<div
class=" tag-item"
v-for="tag in tagList"
:key="tag.tagId"
@click="selectTag(tag)"
:class="tag.tagId === tagId? 'activeTag':''"
>
<div class="sjx-outer">
<div class="sjx-inner"></div>
</div>
<div class="tag">
{{tag.tagName}}
{{tag.blogNum}}
</div>
</div>
</div>
<div
class="more"
@click="dealTag"
>
<i
v-if="moreTag"
class="el-icon-arrow-down"
></i>
<i
v-else
class="el-icon-arrow-up"
></i>
</div>
</el-card>
<el-card
style="background-color: rgba(255,255,255,0.9)"
class=" right-item"
>
<div
slot="header"
class="attributes"
>
<b>最新推荐</b>
</div>
<div
class=" recommend-forum l-text"
v-for="forum in recommendList"
:key="forum.id"
@click="getForumInfo(forum.postId)"
>
<a class="recommend-a">{{forum.title}}</a>
</div>
</el-card>
</el-col>
<el-col
:sm="2"
class="hidden-xs-only"
style="opacity:0;"
>右侧占位</el-col>
</el-row>
</div>
</template>
<script>
import "element-ui/lib/theme-chalk/display.css";
import forumForm from "./forumForm.vue";
import { Loading } from "element-ui";
import {
listCommunityInfo,
getCommunityInfo,
addCommunityInfo,
updateCommunityInfo,
CommunityInfo,
addViews,
} from "@/api/community/info";
export default {
name: "forum",
components: {
forumForm,
},
data() {
return {
totalcount: 100,
queryInfo: {
query: "",
pagenum: 1,
pagesize: 8,
},
intro: "",
forumList: [],
typeList: [],
tagList: [],
fullTypeList: [],
fullTagList: [],
recommendList: [],
selectMethod: "全部帖子",
typeId: -1,
tagId: -1,
selected: false,
moreType: true,
moreTag: true,
value: new Date(),
timer: null,
start: false,
screenWidth: document.documentElement.clientWidth, //
//
queryParams: {
pageNum: 1,
pageSize: 10,
},
//
total: 0,
};
},
computed: {
pagSmall() {
return this.screenWidth <= 768;
},
//
pagLayout() {
if (this.screenWidth < 768) {
return "prev, pager, next";
} else {
return "total, prev, pager, next, jumper";
}
},
},
created() {
window.addEventListener("resize", this.screenAdapter);
},
mounted() {
this.getForumList();
// this.$nextTick(function () {
// //
// this.getTypeList()
// this.getForumList();
// this.getTagList()
// this.getRecommendList()
// let str = '...';
// let idx = 0;
// let that = this
// let timer = setTimeout(function fn() {
// // console.log(this.intro)
// that.intro = that.intro + str.substring(idx, idx + 1)
// idx++
// if (idx > str.length) {
// that.intro = ''
// idx = 0
// }
// setTimeout(fn, 200)
// }, 2000)
// this.screenWidth = document.documentElement.clientWidth
// })
},
methods: {
releaseSuc() {
this.$modal.msgSuccess("发表成功");
// this.getForumList();\
window.location.reload();
},
/** 获取博客列表 */
getForumList() {
let loadingInstance = Loading.service({
target: ".left-item",
});
listCommunityInfo(this.queryParams)
.then((response) => {
this.forumList = response.rows;
this.total = response.total;
})
.finally(() => {
loadingInstance.close();
});
},
//
startRead() {
this.$nextTick(() => {
document.getElementById("index").scrollIntoView({
behavior: "smooth",
block: "start",
// inline: 'nearest'
});
});
},
compare(property) {
return function (a, b) {
let value1 = a[property].length;
let value2 = b[property].length;
return value2 - value1;
};
},
//
async getRecommendList() {
cmsListRecommend(this.queryParams).then((response) => {
const { data: res } = response;
this.recommendList = response.rows.slice(0, 4);
this.total = response.total;
});
},
//
async getTypeList() {
getForumDetail(this.$route.query.id).then((response) => {
for (let i = 0; i < response.types.length; i++) {
let typeInfo = response.types[i];
if (typeInfo.typePic.length > 0) {
response.types[i].typePic =
process.env.VUE_APP_BASE_API + typeInfo.typePic;
}
}
const { data: res } = response;
this.fullTypeList = response.types;
this.typeList = response.types.slice(0, 4);
});
},
//
async getTagList() {
getForumDetail(this.$route.query.id).then((response) => {
const { data: res } = response;
this.fullTagList = response.tags;
this.tagList = response.tags.slice(0, 6);
});
},
//
getForumInfo(postId) {
let routeUrl = this.$router.push({
path: "/community/forumDetails",
query: {
id: postId,
},
});
},
//
handleCurrentChange(newSize) {
this.queryInfo.pagenum = newSize;
this.getForumList();
},
//
handleSizeChange(newSize) {
this.queryInfo.pagesize = newSize;
},
//
async selectType(cmsType) {
let loadingInstance = Loading.service({
target: ".left-item",
});
this.typeId = cmsType.typeId;
cmsListByTypeId(this.typeId)
.then((response) => {
this.blogList = this.picSrc(response.rows);
this.total = response.total;
// this.totalcount = res.data.totalElements
this.selectMethod = "分类: " + cmsType.typeName;
this.selected = true;
})
.finally(() => {
loadingInstance.close();
});
},
//
async selectTag(tag) {
let loadingInstance = Loading.service({
target: ".left-item",
});
this.tagId = tag.tagId;
cmsListByTagId(this.tagId)
.then((response) => {
this.blogList = this.picSrc(response.rows);
this.total = response.total;
// this.totalcount = res.data.totalElements
this.selectMethod = "标签: " + tag.tagName;
this.selected = true;
})
.finally(() => {
loadingInstance.close();
});
},
//
updateForumList() {
this.selected = false;
this.typeId = -1;
this.tagId = -1;
this.selectMethod = "全部博客";
this.getForumList();
},
//
async getFullTagList() {
this.tagList = this.fullTagList;
},
async dealType() {
if (this.moreType) {
this.typeList = this.fullTypeList;
} else {
this.typeList = this.fullTypeList.slice(0, 4);
}
this.moreType = !this.moreType;
},
async dealTag() {
if (this.moreTag) {
await this.getFullTagList();
} else {
this.tagList = this.fullTagList.slice(0, 6);
}
this.moreTag = !this.moreTag;
},
//
screenAdapter() {
this.screenWidth = document.documentElement.clientWidth;
},
},
};
</script>
<style scoped>
/* .app-container {
background-image: url("../../../assets/images/login-background.jpg");
background-repeat: no-repeat;
background-size: cover;
background-position: center;
margin: 0px;
padding: 0px;
width: 100%;
height: 120vh;
position: fixed;
} */
.welcome {
background-color: rgba(0, 0, 0, 0.1);
border: none;
height: 90%;
position: relative;
}
.border {
width: 812px;
height: 112px;
position: absolute;
top: -6px;
left: -6px;
border: 3px solid white;
box-sizing: border-box;
animation: clipMe 5s linear infinite;
}
.tit {
box-sizing: border-box;
position: relative;
width: 800px;
height: 100px;
line-height: 100px;
box-shadow: inset 0 0 0 1px white;
margin: 40px auto;
margin-top: 80px;
color: white;
text-align: center;
font-size: 50px;
font-weight: normal;
letter-spacing: 10px;
}
.intro {
letter-spacing: 5px;
line-height: 50px;
width: 80%;
margin: 0 auto;
text-align: center;
font-weight: normal;
color: white;
}
.down {
animation: bounce 2s infinite;
animation-duration: 3s;
font-size: 25px;
position: absolute;
bottom: 5px;
left: 50%;
transform: translateX(-50%);
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
border-radius: 50%;
border: 2px solid #fff;
}
.down:hover {
animation: none;
cursor: pointer;
box-shadow: 0 0 20px 0 white;
transition: all 0.2s;
}
.left-item .pagination-container {
background: rgb(255, 255, 255, 0);
}
@keyframes clipMe {
0%,
100% {
clip: rect(0px, 806px, 6px, 0px);
}
25% {
clip: rect(0px, 6px, 112px, 0px);
}
50% {
clip: rect(112px, 812px, 112px, 0px);
}
75% {
clip: rect(0px, 812px, 112px, 806px);
}
}
@keyframes bounce {
0%,
20%,
50%,
80%,
100% {
transform: translate(-50%, 0);
}
40% {
transform: translate(-50%, -30px);
}
60% {
transform: translate(-50%, -15px);
}
}
.forum-type-ul {
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0;
border-radius: 5px;
}
.el-pagination {
padding-bottom: 20px;
}
.el-card /deep/ .el-card__body {
padding: 0;
}
.right-item {
margin-bottom: 20px;
}
.forum-type-li:first-child {
border-top: 1px solid rgba(179, 216, 255, 0.5);
}
.forum-type-li {
border-bottom: 1px solid rgba(179, 216, 255, 0.5);
}
.more {
text-align: center;
color: #3a8ee6;
padding: 8px;
}
.more:hover {
cursor: pointer;
color: #3a8ee6;
}
.forum-type-li:hover {
background-color: rgba(213, 255, 255, 0.3);
cursor: pointer;
}
.activeType {
background-color: rgba(58, 142, 230, 0.3);
cursor: pointer;
}
.tags {
display: flex;
flex-wrap: wrap;
align-items: center;
margin: 15px 13px 0;
border-bottom: 1px solid rgba(179, 216, 255, 0.5);
}
.tag-item {
display: flex;
justify-content: space-around;
align-items: center;
margin-left: 5px;
margin-right: 5px;
margin-bottom: 10px;
box-sizing: border-box;
}
.tag {
background-color: #ecf5ff;
box-sizing: border-box;
display: inline-block;
height: 22px;
padding: 0 10px;
line-height: 22px;
font-size: 10px;
color: #409eff;
border-radius: 4px;
white-space: nowrap;
border: 1px solid #409eff;
transition: 0.2s;
}
.sjx-outer {
width: 0;
height: 0;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-right: 6px solid #409eff;
position: relative;
transition: 0.2s;
}
.sjx-inner {
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-right: 6px solid #ecf5ff;
top: -6px;
left: 1px;
position: absolute;
transition: 0.2s;
}
.tag-item:hover,
.activeTag {
box-sizing: border-box;
}
.tag {
color: white;
background-color: #409eff;
cursor: pointer;
}
.sjx-inner {
border-right: 6px solid #409eff;
}
.forum-type-li {
display: flex;
justify-content: space-between;
align-items: center;
line-height: 40px;
}
.recommend-forum {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0;
border-radius: 5px;
}
.recommend-a {
border-bottom: 1px solid rgba(34, 36, 38, 0.15);
line-height: 40px;
display: block;
text-decoration: none;
color: black;
}
.recommend-a:hover {
color: #3a8ee6;
}
.total {
display: flex;
justify-content: space-between;
align-items: center;
font-size: larger;
font-weight: bold;
}
.titleIndex {
display: flex;
align-items: center;
}
.el-icon-back {
font-weight: bolder;
color: #3a8ee6;
margin-right: 10px;
}
.el-icon-back:hover {
cursor: pointer;
}
.forum-content:hover {
border-left: 5px solid #3a8ee6;
border-right: 5px solid #3a8ee6;
background-color: rgba(58, 142, 230, 0.3);
cursor: pointer;
}
.forum-content {
padding: 10px;
height: auto;
border-bottom: 1px solid rgb(199, 163, 92);
/*border-bottom: 1px solid rgba(34, 36, 38, .15);*/
transition: 0.3s;
}
.el-image {
border-radius: 5px;
box-sizing: border-box;
flex-shrink: 0;
}
.forum-info {
display: flex;
justify-content: space-around;
align-items: center;
color: rgba(0, 0, 0, 0.4);
font-size: 12px;
}
.user-info {
display: flex;
align-items: center;
margin-right: 15px;
float: left;
}
.header {
display: flex;
align-items: center;
text-decoration: none;
color: #3a8ee6;
font-weight: bold;
word-break: keep-all;
}
.forum-date {
display: flex;
align-items: center;
float: right;
margin-left: 5px;
width: 200px;
}
.forum-views {
display: flex;
align-items: center;
float: right;
margin-left: 5px;
width: 180px;
}
.forum-type {
float: right;
margin-left: auto;
}
.forum-tag {
float: right;
margin-left: auto;
}
@media screen and (max-width: 768px) {
/* .forum-date {
display: none;
} */
.welcome {
width: 100%;
}
.border {
display: none;
}
.tit {
font-size: 2rem;
width: 100%;
line-height: 50px;
letter-spacing: 2px;
height: auto;
}
.intro {
font-size: 1rem;
line-height: 30px;
}
.el-pagination {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,840 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="学习路径名称" prop="learningPathName">
<el-input
v-model="queryParams.learningPathName"
placeholder="请输入学习路径名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="适用领域" prop="applicableField">
<el-input
v-model="queryParams.applicableField"
placeholder="请输入适用领域"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="适用人员" prop="applicablePersonnel">
<el-input
v-model="queryParams.applicablePersonnel"
placeholder="请输入适用人员"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['develop:learningPath:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['develop:learningPath:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['develop:learningPath:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['develop:learningPath:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="learningPathList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="学习路径名称" align="center" prop="learningPathName" />
<el-table-column label="适用领域" align="center" prop="applicableField" />
<el-table-column label="适用人员" align="center" prop="applicablePersonnel" />
<el-table-column label="描述" align="center" prop="description" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['develop:learningPath:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['develop:learningPath:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-thumb"
@click="handleGetLearningPath(scope.row)"
v-hasPermi="['develop:learningPath:query']"
>获取学习路径</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改学习路径信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-card >
<div slot="header"><span>基本信息</span></div>
<el-form-item label="学习路径名称" prop="learningPathName">
<el-input v-model="form.learningPathName" placeholder="请输入学习路径名称" />
</el-form-item>
<el-form-item label="适用领域" prop="applicableField">
<el-input v-model="form.applicableField" placeholder="请输入适用领域" />
</el-form-item>
<el-form-item label="适用人员" prop="applicablePersonnel">
<el-input v-model="form.applicablePersonnel" placeholder="请输入适用人员" />
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-card>
<el-card>
<div slot="header"><span>学习路径</span></div>
<el-form-item label="学习路径图片" prop="fileName">
<el-upload
ref="uploadFile"
accept=".jpg,.jpeg,.png"
class="upload-demo"
:action="uploadFile.url"
:headers="uploadFile.headers"
:data="uploadFile.data"
:file-list="fileList"
:show-file-list="true"
:on-success="handleFileSuccess"
:on-exceed="handleFileExceed"
:limit="1"
>
<el-button
size="medium"
type="primary"
fixed="left"
>点击上传</el-button>
<div
class="el-upload__tip"
slot="tip"
>请上传png/jpg/jpeg格式图片</div>
</el-upload>
</el-form-item>
<div slot="header"><span>关联课程</span></div>
<el-button
size="medium"
type="primary"
fixed="left"
@click="handleSelectCourse"
>选择课程</el-button>
<el-table :data="allDiaLogSelectList">
<el-table-column label="课程名称" align="center" prop="courseName" />
<el-table-column label="课程类型" align="center" prop="typeName" />
</el-table>
</el-card>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="选择关联课程" :visible.sync="selectCourse" width="1200px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleClick">
<!-- 在线课程 -->
<el-tab-pane label="在线课程" name="first">
<el-form :model="onLineQueryParams" ref="onLineQueryForm" size="small" :inline="true" v-show="onLineShowSearch" label-width="68px">
<el-form-item label="课程名称" prop="className">
<el-input
v-model="onLineQueryParams.className"
placeholder="请输入课程名称"
clearable
@keyup.enter.native="onLineHandleQuery"
/>
</el-form-item>
<el-form-item label="课程类型" prop="classType">
<el-select v-model="onLineQueryParams.classType" placeholder="请选择课程类型" clearable>
<el-option
v-for="dict in dict.type.class_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="课程讲师" prop="classLecturer">
<el-input
v-model="onLineQueryParams.classLecturer"
placeholder="请输入课程讲师"
clearable
@keyup.enter.native="onLineHandleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="onLineHandleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="onLineResetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="onLineLoading" :data="courseOnlineList" @selection-change="onLineHandleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="课程名称" align="center" prop="className" />
<el-table-column label="课程类型" align="center" prop="classType">
<template slot-scope="scope">
<dict-tag :options="dict.type.class_type" :value="scope.row.classType"/>
</template>
</el-table-column>
<el-table-column label="课程讲师" align="center" prop="classLecturer" />
<el-table-column label="课程参与者" align="center" prop="classParticipant" />
<el-table-column label="课程描述" align="center" prop="classDescription" />
<el-table-column label="课程开始时间" align="center" prop="classStartTime" width="180"/>
<el-table-column label="课程结束时间" align="center" prop="classEndTime" width="180"/>
<el-table-column label="参加方式" align="center" prop="classJoinMethod" />
</el-table>
<pagination
v-show="onLineTotal>0"
:total="onLineTotal"
:page.sync="onLineQueryParams.pageNum"
:limit.sync="onLineQueryParams.pageSize"
@pagination="onLineGetList"
/>
</el-tab-pane>
<el-tab-pane label="视频课程" name="second">
<el-form :model="videoQueryParams" ref="queryForm" size="small" :inline="true" v-show="videoShowSearch" label-width="68px">
<el-form-item label="课程名称" prop="courseName">
<el-input v-model="videoQueryParams.courseName" placeholder="请输入课程名称"/>
</el-form-item>
<el-form-item label="课程类型" prop="courseType">
<el-select v-model="videoQueryParams.courseType" placeholder="请选择课程类型" clearable>
<el-option
v-for="dict in dict.type.class_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="videoHandleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="videoResetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="videoLoading" :data="courseVideoList" @selection-change="videoHandleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="课程名称" align="center" prop="courseName" />
<el-table-column label="课程类型" align="center" prop="courseType">
<template slot-scope="scope">
<dict-tag :options="dict.type.class_type" :value="scope.row.courseType"/>
</template>
</el-table-column>
<el-table-column label="课程描述" align="center" prop="courseDescription" />
<el-table-column label="课程文件名称" align="center" prop="courseFileName" />
<el-table-column label="课程预览" align="center" prop="courseCoverPath" >
<template slot-scope="scope">
<img :src="scope.row.courseCoverPath" style="width: 80px;height: 80px" :alt="scope.row.courseFileName">
</template>
</el-table-column>
</el-table>
<pagination
v-show="videoTotal>0"
:total="videoTotal"
:page.sync="videoQueryParams.pageNum"
:limit.sync="videoQueryParams.pageSize"
@pagination="videoGetList"
/>
</el-tab-pane>
<el-tab-pane label="培训资料" name="third">
<el-form :model="docQueryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="培训资料名称" prop="docName">
<el-input v-model="docQueryParams.docName" placeholder="请输入培训资料名称"></el-input>
</el-form-item>
<el-form-item label="培训资料类型" prop="docType">
<el-select v-model="docQueryParams.docType" placeholder="请选择培训资料类型" clearable>
<el-option
v-for="dict in dict.type.train_doc_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="docHandleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="docResetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="docLoading" :data="documentList" @selection-change="docHandleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="培训资料名称" align="center" prop="docName" />
<el-table-column label="培训资料类型" align="center" prop="docType">
<template slot-scope="scope">
<dict-tag :options="dict.type.train_doc_type" :value="scope.row.docType"/>
</template>
</el-table-column>
<el-table-column label="培训资料描述" align="center" prop="docDescription" />
<el-table-column label="文件名称" align="center" prop="fileName" />
<el-table-column label="文件格式" align="center" prop="fileFormat" />
<el-table-column label="文件大小" align="center" prop="fileSize" >
<template slot-scope="scope">
<span v-if="scope.row.fileSize / 1024 / 1024 < 1">{{(scope.row.fileSize / 1024).toFixed(2) + 'KB'}}</span>
<span v-else>{{(scope.row.fileSize / 1024 / 1024).toFixed(2) + 'MB'}}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="docTotal>0"
:total="docTotal"
:page.sync="docQueryParams.pageNum"
:limit.sync="docQueryParams.pageSize"
@pagination="getList"
/>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitSelectCourseForm"> </el-button>
<el-button @click="cancelSelectCourseForm"> </el-button>
</div>
</el-dialog>
<!--查看学习路径-->
<el-dialog title="查看学习路径" :visible.sync="loadingLearningPath" width="700px" append-to-body>
<el-form ref="form" :model="learningPathForm" :rules="rules" label-width="120px">
<el-card class="box-card">
<div slot="header" class="clearfix"><span>基本信息</span></div>
<el-form-item label="学习路径名称" prop="learningPathName">
<span class="pop-span">{{learningPathForm.learningPathName}}</span>
</el-form-item>
<el-form-item label="适用领域" prop="applicableField">
<span class="pop-span">{{learningPathForm.applicableField}}</span>
</el-form-item>
<el-form-item label="适用人员" prop="applicablePersonnel">
<span class="pop-span">{{learningPathForm.applicablePersonnel}}</span>
</el-form-item>
<el-form-item label="描述" prop="description">
<span class="pop-span">{{learningPathForm.description}}</span>
</el-form-item>
</el-card>
<el-card>
<div slot="header" class="clearfix"><span>学习路径</span></div>
<img :src="learningPathForm.photoBase" alt="learningPathForm.fileName" width="700px" height="400px">
<el-table :data="allDiaLogSelectList">
<el-table-column label="课程名称" align="center" prop="courseName" />
<el-table-column label="课程类型" align="center" prop="typeName" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-s-promotion"
@click="handleGoToStudy(scope.row)"
v-hasPermi="['develop:learningPath:edit']"
>前往学习</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="downloadPhoto">下载学习路径图</el-button>
<el-button @click="cancelShowLearningPath"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
addLearningPath,
delLearningPath,
getLearningPath,
listLearningPath,
updateLearningPath
} from '@/api/develop/learningPath'
import { getToken } from '@/utils/auth'
import { listCourseOnline } from '@/api/operations/courseOnline'
import { listCourseVideo } from '@/api/operations/courseVideo'
import { listDocument } from '@/api/operations/document'
import { downFileThree } from "@/api/sftp/sftp";
export default {
name: "LearningPath",
dicts: ['class_type','sys_normal_disable','train_doc_type'],
data() {
return {
learningPathForm: {},
loadingLearningPath: false,
onLineDiaLogSelectList: [],
videoDiaLogSelectList: [],
docDiaLogSelectList: [],
allDiaLogSelectList: [],
selectCourse: false,
fileList: [],
//
uploadFile: {
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/sftp/upload/file",
},
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
learningPathList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
applicableField: null,
applicablePersonnel: null,
learningPathName: null,
},
//
form: {},
//
rules: {
learningPathName: [
{ required: true, message: "学习路径名称不能为空", trigger: "blur" }
],
fileName: [
{ required: true, message: "文件名称不能为空", trigger: "blur" }
],
},
activeName: 'first',
//
onLineLoading: true,
//
onLineIds: [],
//
onLineSingle: true,
//
onLineMultiple: true,
//
onLineShowSearch: true,
//
onLineTotal: 0,
// 线
courseOnlineList: [],
//
onLineTitle: "",
//
onLineOpen: false,
//
onLineQueryParams: {
pageNum: 1,
pageSize: 10,
className: null,
classType: null,
classLecturer: null,
},
videoPlayOpen: false,
videoPath: null,
//
videoLoading: true,
//
videoIds: [],
//
videoSingle: true,
//
videoMultiple: true,
//
videoShowSearch: true,
//
videoTotal: 0,
//
courseVideoList: [],
//
videoTitle: "",
//
videoOpen: false,
//
videoQueryParams: {
pageNum: 1,
pageSize: 10,
courseName: null,
courseType: null,
},
docLoading:false,
uploadFileLoading: false,
uploadForm:{},
//
fileInfoList: [],
fileList2: [],
openUpload: false,
//
docTotal: 0,
//
documentList: [],
//
docQueryParams: {
pageNum: 1,
pageSize: 10,
docName: null,
docType: null,
},
};
},
created() {
this.getList();
},
methods: {
//
handleGoToStudy(row) {
this.loadingLearningPath = false
const type = row.type
if ('0' === type) {
this.$router.push({
path: '/operations/courseOnline',
query: {
id: row.courseId
}
})
} else if ('1' === type) {
this.$router.push({
path: '/operations/courseVideo',
query: {
id: row.courseId
}
})
} else if ('2' === type) {
this.$router.push({
path: '/operations/document',
query: {
id: row.courseId
}
})
}
},
//
downloadPhoto(row){
const name = this.learningPathForm.fileName;
this.$confirm("是否确定下载文件:" + name + "?").then(() => {
downFileThree(name,this.learningPathForm.sftpFileName);
});
},
//
cancelShowLearningPath(){
this.loadingLearningPath = false;
this.learningPathForm = {};
},
//
submitSelectCourseForm(){
this.allDiaLogSelectList = [];
this.onLineDiaLogSelectList.forEach(item =>{
this.allDiaLogSelectList.push(item);
});
this.videoDiaLogSelectList.forEach(item =>{
this.allDiaLogSelectList.push(item);
});
this.docDiaLogSelectList.forEach(item =>{
this.allDiaLogSelectList.push(item);
});
console.log("push")
console.log(this.allDiaLogSelectList)
this.cancelSelectCourseForm();
},
//
cancelSelectCourseForm(){
this.selectCourse = false;
this.onLineDiaLogSelectList = []
this.videoDiaLogSelectList = []
this.docDiaLogSelectList = []
},
//
handleSelectCourse(){
this.selectCourse = true;
this.onLineGetList();
this.videoGetList();
this.getDocList();
},
handleClick(tab, event) {
console.log(tab.name);
},
/** 查询在线课程信息列表 */
onLineGetList() {
this.onLineLoading = true;
this.onLineQueryParams.status = '0'
listCourseOnline(this.onLineQueryParams).then(response => {
this.courseOnlineList = response.rows;
this.onLineTotal = response.total;
this.onLineLoading = false;
});
},
/** 查询视频课程信息列表 */
videoGetList() {
this.videoLoading = true;
this.videoQueryParams.status = '0'
listCourseVideo(this.videoQueryParams).then(response => {
this.courseVideoList = response.rows;
this.videoTotal = response.total;
this.videoLoading = false;
});
},
/** 查询课程培训资料列表 */
getDocList() {
this.docLoading = true;
this.docQueryParams.status = '0'
listDocument(this.docQueryParams).then(response => {
this.documentList = response.rows;
this.total = response.total;
this.docLoading = false;
});
},
/** 搜索按钮操作 */
onLineHandleQuery() {
this.onLineQueryParams.pageNum = 1;
this.onLineGetList();
},
/** 重置按钮操作 */
onLineResetQuery() {
this.resetForm("onLineQueryForm");
this.onLineHandleQuery();
},
//
onLineHandleSelectionChange(selection) {
this.onLineDiaLogSelectList = selection.map(item => {
return {
courseId: item.classId,
courseName: item.className,
type: "0",
typeName: "在线课程"
};
});
},
/** 搜索按钮操作 */
videoHandleQuery() {
this.videoQueryParams.pageNum = 1;
this.videoGetList();
},
/** 重置按钮操作 */
videoResetQuery() {
this.resetForm("queryForm");
this.videoHandleQuery();
},
//
videoHandleSelectionChange(selection) {
this.videoDiaLogSelectList = selection.map(item => {
return {
courseId: item.courseId,
courseName: item.courseName,
type: "1",
typeName: "视频课程"
};
});
},
/** 搜索按钮操作 */
docHandleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
docResetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
docHandleSelectionChange(selection) {
this.docDiaLogSelectList = selection.map(item => {
return {
courseId: item.docId,
courseName: item.docName,
type: "2",
typeName: "培训资料"
};
});
},
//
handleFileExceed(){
this.$message.warning(`仅能上传单张图片,请删除已上传图片后重试`);
},
/** 文件上传成功 */
handleFileSuccess(res, file, fileList) {
this.$modal.msgSuccess("图片上传成功");
this.fileList = fileList;
this.form.fileName = fileList[0].name;
this.form.sftpFileName = res;
},
/** 查询学习路径信息列表 */
getList() {
this.loading = true;
listLearningPath(this.queryParams).then(response => {
this.learningPathList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.fileList = [];
this.allDiaLogSelectList = [];
this.form = {};
this.learningPathForm = {};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加学习路径信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getLearningPath(id).then(response => {
this.form = response.data;
if (this.form.fileName !== null){
const file = {
name: this.form.fileName
}
this.fileList.push(file);
}
this.allDiaLogSelectList = this.form.learningPathCourseList;
this.open = true;
this.title = "修改学习路径信息";
});
},
handleGetLearningPath(row){
this.reset();
const id = row.id || this.ids
getLearningPath(id).then(response => {
this.learningPathForm = response.data;
if (this.learningPathForm.fileName !== null){
const file = {
name: this.learningPathForm.fileName
}
this.fileList.push(file);
}
this.allDiaLogSelectList = this.learningPathForm.learningPathCourseList;
this.loadingLearningPath = true;
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.form.learningPathCourseList = this.allDiaLogSelectList;
if (valid) {
if (this.form.id != null) {
updateLearningPath(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addLearningPath(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除学习路径信息编号为"' + ids + '"的数据项?').then(function() {
return delLearningPath(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('develop/learningPath/export', {
...this.queryParams
}, `learningPath_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<style lang="scss" scoped>
.pop-span {
color: darkorange;
}
</style>

View File

@ -206,10 +206,10 @@
<el-input v-model="form.authors" placeholder="请输入作者" />
</el-form-item>
<el-form-item label="文件上传" prop="fileName">
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName == ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName != ''"@click="uploadClick">重新上传</el-button>
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName === ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName !== ''"@click="uploadClick">重新上传</el-button>
</el-form-item>
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName != ''">
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName !== ''">
<span>{{ form.fileName }}</span>
</el-form-item>
</el-form>

View File

@ -181,10 +181,10 @@
<el-input v-model="form.authors" placeholder="请输入作者" />
</el-form-item>
<el-form-item label="文件上传" prop="fileName">
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName == ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName != ''"@click="uploadClick">重新上传</el-button>
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName === ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName !== ''"@click="uploadClick">重新上传</el-button>
</el-form-item>
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName != ''">
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName !== ''">
<span>{{ form.fileName }}</span>
</el-form-item>
</el-form>

View File

@ -181,10 +181,10 @@
<el-input v-model="form.authors" placeholder="请输入作者" />
</el-form-item>
<el-form-item label="文件上传" prop="fileName">
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName == ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName != ''"@click="uploadClick">重新上传</el-button>
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName === ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName !== ''"@click="uploadClick">重新上传</el-button>
</el-form-item>
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName != ''">
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName !== ''">
<span>{{ form.fileName }}</span>
</el-form-item>
</el-form>

View File

@ -181,10 +181,10 @@
<el-input v-model="form.authors" placeholder="请输入作者" />
</el-form-item>
<el-form-item label="文件上传" prop="fileName">
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName == ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName != ''"@click="uploadClick">重新上传</el-button>
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName === ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName !== ''"@click="uploadClick">重新上传</el-button>
</el-form-item>
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName != ''">
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName !== ''">
<span>{{ form.fileName }}</span>
</el-form-item>
</el-form>

View File

@ -336,6 +336,10 @@ export default {
getList() {
this.loading = true;
this.queryParams.status = '0';
const classId = this.$route.query.id;
if (classId !== null){
this.queryParams.classId = classId;
}
listCourseOnline(this.queryParams).then(response => {
this.courseOnlineList = response.rows;
this.total = response.total;

View File

@ -337,6 +337,10 @@ export default {
getList() {
this.loading = true;
this.queryParams.status = '0';
const courseId = this.$route.query.id;
if (courseId !== null){
this.queryParams.courseId = courseId;
}
listCourseVideo(this.queryParams).then(response => {
this.courseVideoList = response.rows;
this.total = response.total;

View File

@ -182,10 +182,10 @@
<el-input v-model="form.docDescription" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="文件上传" prop="fileName">
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName == ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName != ''"@click="uploadClick">重新上传</el-button>
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName === ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName !== ''"@click="uploadClick">重新上传</el-button>
</el-form-item>
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName != ''">
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName !== ''">
<span>{{ form.fileName }}</span>
</el-form-item>
</el-form>
@ -503,6 +503,10 @@ export default {
getList() {
this.loading = true;
this.queryParams.status = '0';
const docId = this.$route.query.id;
if (docId !== null){
this.queryParams.docId = docId;
}
listDocument(this.queryParams).then(response => {
this.documentList = response.rows;
this.total = response.total;

View File

@ -568,10 +568,10 @@
<el-input v-model="form.docDescription" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="文件上传" prop="fileName">
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName == ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName != ''"@click="uploadClick">重新上传</el-button>
<el-button type="primary" v-if="this.form.fileName == null || this.form.fileName === ''" @click="uploadClick">上传文件</el-button>
<el-button type="primary" v-if="this.form.fileName != null && this.form.fileName !== ''"@click="uploadClick">重新上传</el-button>
</el-form-item>
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName != ''">
<el-form-item label="文件名称" v-if="this.form.fileName != null && this.form.fileName !== ''">
<span>{{ form.fileName }}</span>
</el-form-item>
</el-form>