发展规划-学习路径模块

This commit is contained in:
xusd 2024-04-30 17:33:12 +08:00
parent 38e9a410b0
commit 1b7ea03dbf
29 changed files with 1733 additions and 22 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>

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,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,65 @@
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;
}

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,139 @@
package com.inspur.service.impl;
import java.util.List;
import java.util.Objects;
import cn.hutool.core.util.StrUtil;
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;
/**
* 查询学习路径信息
*
* @param id 学习路径信息主键
* @return 学习路径信息
*/
@Override
public LearningPathInfo selectLearningPathInfoById(String id)
{
LearningPathInfo learningPathInfo = learningPathInfoMapper.selectLearningPathInfoById(id);
if (Objects.nonNull(learningPathInfo)){
learningPathInfo.setLearningPathCourseList(learningPathCourseService.selectLearningPathCourseByPathId(id));
}
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

@ -200,6 +200,7 @@
<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,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,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="https://img2.baidu.com/it/u=1998428691,4088712844&fm=253&fmt=auto&app=120&f=BMP?w=753&h=500" 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>