20200529-zlp-2

1新增视频学习列表页(标题兼容性)
2删除讲师为软删除
This commit is contained in:
paidaxing444 2020-05-29 15:42:00 +08:00
parent 72158a2ee5
commit 1ac9d63503
5 changed files with 67 additions and 37 deletions

View File

@ -1,14 +1,14 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="视频标题" prop="title"> <el-form-item label="所属类别" prop="type">
<el-input <el-cascader
v-model="queryParams.title" placeholder="请选择所属类别"
v-model="queryParams.type"
:options="optionTypes"
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
clearable clearable
size="small" ></el-cascader>
@keyup.enter.native="handleQuery"
placeholder="请输入培训视频标题"
/>
</el-form-item> </el-form-item>
<el-form-item label="讲师姓名" prop="lecturer"> <el-form-item label="讲师姓名" prop="lecturer">
<el-select v-model="queryParams.lecturer" filterable placeholder="请选择讲师"> <el-select v-model="queryParams.lecturer" filterable placeholder="请选择讲师">
@ -20,14 +20,14 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属类别" prop="type"> <el-form-item label="视频标题" prop="title">
<el-cascader <el-input
placeholder="请选择所属类别" v-model="queryParams.title"
v-model="queryParams.type"
:options="optionTypes"
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
clearable clearable
></el-cascader> size="small"
@keyup.enter.native="handleQuery"
placeholder="请输入培训视频标题"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>

View File

@ -42,12 +42,15 @@
controlslist="nodownload" controlslist="nodownload"
oncontextmenu="return false" oncontextmenu="return false"
:src="[qiniuUrl + '/' + o.videourl]" :src="[qiniuUrl + '/' + o.videourl]"
class="avatar" class="videoavatar"
></video> ></video>
<div style="padding: 14px;"> <div style="padding: 14px;">
<span class="word-space-ellipsis" :title="o.title">{{o.title+" (讲师:"+o.lecturer+")"}}</span> <el-tooltip effect="dark" :content="o.title" placement="bottom">
<el-button class="info-title">{{o.title+" (讲师:"+o.lecturername+")"}}</el-button>
</el-tooltip>
<div class="bottom clearfix"> <div class="bottom clearfix">
<time class="time">{{ parseTime(o.createtime) }}</time> <time class="time">{{ parseTime(o.createtime) }}</time>
<el-button type="text" class="button">进入详情页</el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
@ -159,7 +162,24 @@ export default {
color: #999; color: #999;
} }
.avatar { .bottom {
margin-top: 13px;
line-height: 12px;
}
.button {
padding: 0;
float: right;
}
.info-title{
width: 100%; /*根据自己项目进行定义宽度*/
overflow: hidden; /*设置超出的部分进行影藏*/
text-overflow: ellipsis; /*设置超出部分使用省略号*/
white-space:nowrap ; /*设置为单行*/
}
.videoavatar {
width: 100%; width: 100%;
display: block; display: block;
} }

View File

@ -25,14 +25,13 @@ import com.ruoyi.framework.web.page.TableDataInfo;
/** /**
* 讲师Controller * 讲师Controller
* *
* @author tsbz * @author tsbz
* @date 2020-05-25 * @date 2020-05-25
*/ */
@RestController @RestController
@RequestMapping("/benyi/lecturer") @RequestMapping("/benyi/lecturer")
public class ByLecturerController extends BaseController public class ByLecturerController extends BaseController {
{
@Autowired @Autowired
private IByLecturerService byLecturerService; private IByLecturerService byLecturerService;
@ -41,8 +40,7 @@ public class ByLecturerController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('benyi:lecturer:list')") @PreAuthorize("@ss.hasPermi('benyi:lecturer:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(ByLecturer byLecturer) public TableDataInfo list(ByLecturer byLecturer) {
{
startPage(); startPage();
List<ByLecturer> list = byLecturerService.selectByLecturerList(byLecturer); List<ByLecturer> list = byLecturerService.selectByLecturerList(byLecturer);
return getDataTable(list); return getDataTable(list);
@ -66,8 +64,7 @@ public class ByLecturerController extends BaseController
@PreAuthorize("@ss.hasPermi('benyi:lecturer:export')") @PreAuthorize("@ss.hasPermi('benyi:lecturer:export')")
@Log(title = "讲师", businessType = BusinessType.EXPORT) @Log(title = "讲师", businessType = BusinessType.EXPORT)
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(ByLecturer byLecturer) public AjaxResult export(ByLecturer byLecturer) {
{
List<ByLecturer> list = byLecturerService.selectByLecturerList(byLecturer); List<ByLecturer> list = byLecturerService.selectByLecturerList(byLecturer);
ExcelUtil<ByLecturer> util = new ExcelUtil<ByLecturer>(ByLecturer.class); ExcelUtil<ByLecturer> util = new ExcelUtil<ByLecturer>(ByLecturer.class);
return util.exportExcel(list, "lecturer"); return util.exportExcel(list, "lecturer");
@ -78,8 +75,7 @@ public class ByLecturerController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('benyi:lecturer:query')") @PreAuthorize("@ss.hasPermi('benyi:lecturer:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return AjaxResult.success(byLecturerService.selectByLecturerById(id)); return AjaxResult.success(byLecturerService.selectByLecturerById(id));
} }
@ -89,10 +85,10 @@ public class ByLecturerController extends BaseController
@PreAuthorize("@ss.hasPermi('benyi:lecturer:add')") @PreAuthorize("@ss.hasPermi('benyi:lecturer:add')")
@Log(title = "讲师", businessType = BusinessType.INSERT) @Log(title = "讲师", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ByLecturer byLecturer) public AjaxResult add(@RequestBody ByLecturer byLecturer) {
{
byLecturer.setCreatetime(new Date()); byLecturer.setCreatetime(new Date());
byLecturer.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId()); byLecturer.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byLecturer.setIsdel("0");
return toAjax(byLecturerService.insertByLecturer(byLecturer)); return toAjax(byLecturerService.insertByLecturer(byLecturer));
} }
@ -102,8 +98,7 @@ public class ByLecturerController extends BaseController
@PreAuthorize("@ss.hasPermi('benyi:lecturer:edit')") @PreAuthorize("@ss.hasPermi('benyi:lecturer:edit')")
@Log(title = "讲师", businessType = BusinessType.UPDATE) @Log(title = "讲师", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody ByLecturer byLecturer) public AjaxResult edit(@RequestBody ByLecturer byLecturer) {
{
return toAjax(byLecturerService.updateByLecturer(byLecturer)); return toAjax(byLecturerService.updateByLecturer(byLecturer));
} }
@ -112,9 +107,8 @@ public class ByLecturerController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('benyi:lecturer:remove')") @PreAuthorize("@ss.hasPermi('benyi:lecturer:remove')")
@Log(title = "讲师", businessType = BusinessType.DELETE) @Log(title = "讲师", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(byLecturerService.deleteByLecturerByIds(ids)); return toAjax(byLecturerService.deleteByLecturerByIds(ids));
} }
} }

View File

@ -43,6 +43,10 @@ public class ByLecturer extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createtime; private Date createtime;
/** 是否删除 */
@Excel(name = "是否删除")
private String isdel;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -96,6 +100,15 @@ public class ByLecturer extends BaseEntity
public Date getCreatetime() { public Date getCreatetime() {
return createtime; return createtime;
} }
public void setIsdel(String isdel)
{
this.isdel = isdel;
}
public String getIsdel()
{
return isdel;
}
@Override @Override
public String toString() { public String toString() {
@ -106,6 +119,7 @@ public class ByLecturer extends BaseEntity
.append("imgurl", getImgurl()) .append("imgurl", getImgurl())
.append("createuserid", getCreateuserid()) .append("createuserid", getCreateuserid())
.append("createtime", getCreatetime()) .append("createtime", getCreatetime())
.append("isdel", getIsdel())
.toString(); .toString();
} }
} }

View File

@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="name" column="name" /> <result property="name" column="name" />
<result property="information" column="information" /> <result property="information" column="information" />
<result property="imgurl" column="imgurl" /> <result property="imgurl" column="imgurl" />
<result property="isdel" column="isdel" />
<result property="createuserid" column="createuserid" /> <result property="createuserid" column="createuserid" />
<result property="createtime" column="createtime" /> <result property="createtime" column="createtime" />
</resultMap> </resultMap>
@ -19,13 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectByLecturerList" parameterType="ByLecturer" resultMap="ByLecturerResult"> <select id="selectByLecturerList" parameterType="ByLecturer" resultMap="ByLecturerResult">
<include refid="selectByLecturerVo"/> <include refid="selectByLecturerVo"/>
<where> where isdel='0'
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="information != null and information != ''"> and information = #{information}</if> <if test="information != null and information != ''"> and information = #{information}</if>
<if test="imgurl != null and imgurl != ''"> and imgurl = #{imgurl}</if> <if test="imgurl != null and imgurl != ''"> and imgurl = #{imgurl}</if>
<if test="createuserid != null "> and createuserid = #{createuserid}</if> <if test="createuserid != null "> and createuserid = #{createuserid}</if>
<if test="createtime != null "> and createtime = #{createtime}</if> <if test="createtime != null "> and createtime = #{createtime}</if>
</where>
</select> </select>
<select id="selectByLecturerById" parameterType="Long" resultMap="ByLecturerResult"> <select id="selectByLecturerById" parameterType="Long" resultMap="ByLecturerResult">
@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="imgurl != null and imgurl != ''">imgurl,</if> <if test="imgurl != null and imgurl != ''">imgurl,</if>
<if test="createuserid != null ">createuserid,</if> <if test="createuserid != null ">createuserid,</if>
<if test="createtime != null ">createtime,</if> <if test="createtime != null ">createtime,</if>
<if test="isdel != null and isdel != ''">isdel,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null ">#{id},</if> <if test="id != null ">#{id},</if>
@ -50,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="imgurl != null and imgurl != ''">#{imgurl},</if> <if test="imgurl != null and imgurl != ''">#{imgurl},</if>
<if test="createuserid != null ">#{createuserid},</if> <if test="createuserid != null ">#{createuserid},</if>
<if test="createtime != null ">#{createtime},</if> <if test="createtime != null ">#{createtime},</if>
<if test="isdel != null and isdel != ''">#{isdel},</if>
</trim> </trim>
</insert> </insert>
@ -66,11 +68,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteByLecturerById" parameterType="Long"> <delete id="deleteByLecturerById" parameterType="Long">
delete from by_lecturer where id = #{id} update by_lecturer set isdel='1' where id = #{id}
</delete> </delete>
<delete id="deleteByLecturerByIds" parameterType="String"> <delete id="deleteByLecturerByIds" parameterType="String">
delete from by_lecturer where id in update by_lecturer set isdel='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>