20200529-zlp-2
1新增视频学习列表页(标题兼容性) 2删除讲师为软删除
This commit is contained in:
parent
72158a2ee5
commit
1ac9d63503
@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||
<el-form-item label="视频标题" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
<el-form-item label="所属类别" prop="type">
|
||||
<el-cascader
|
||||
placeholder="请选择所属类别"
|
||||
v-model="queryParams.type"
|
||||
:options="optionTypes"
|
||||
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
placeholder="请输入培训视频标题"
|
||||
/>
|
||||
></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="讲师姓名" prop="lecturer">
|
||||
<el-select v-model="queryParams.lecturer" filterable placeholder="请选择讲师">
|
||||
@ -20,14 +20,14 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属类别" prop="type">
|
||||
<el-cascader
|
||||
placeholder="请选择所属类别"
|
||||
v-model="queryParams.type"
|
||||
:options="optionTypes"
|
||||
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
|
||||
<el-form-item label="视频标题" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
clearable
|
||||
></el-cascader>
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
placeholder="请输入培训视频标题"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
@ -42,12 +42,15 @@
|
||||
controlslist="nodownload"
|
||||
oncontextmenu="return false"
|
||||
:src="[qiniuUrl + '/' + o.videourl]"
|
||||
class="avatar"
|
||||
class="videoavatar"
|
||||
></video>
|
||||
<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">
|
||||
<time class="time">{{ parseTime(o.createtime) }}</time>
|
||||
<el-button type="text" class="button">进入详情页</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -159,7 +162,24 @@ export default {
|
||||
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%;
|
||||
display: block;
|
||||
}
|
||||
|
@ -25,14 +25,13 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 讲师Controller
|
||||
*
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-05-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/benyi/lecturer")
|
||||
public class ByLecturerController extends BaseController
|
||||
{
|
||||
public class ByLecturerController extends BaseController {
|
||||
@Autowired
|
||||
private IByLecturerService byLecturerService;
|
||||
|
||||
@ -41,8 +40,7 @@ public class ByLecturerController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ByLecturer byLecturer)
|
||||
{
|
||||
public TableDataInfo list(ByLecturer byLecturer) {
|
||||
startPage();
|
||||
List<ByLecturer> list = byLecturerService.selectByLecturerList(byLecturer);
|
||||
return getDataTable(list);
|
||||
@ -66,8 +64,7 @@ public class ByLecturerController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:export')")
|
||||
@Log(title = "讲师", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(ByLecturer byLecturer)
|
||||
{
|
||||
public AjaxResult export(ByLecturer byLecturer) {
|
||||
List<ByLecturer> list = byLecturerService.selectByLecturerList(byLecturer);
|
||||
ExcelUtil<ByLecturer> util = new ExcelUtil<ByLecturer>(ByLecturer.class);
|
||||
return util.exportExcel(list, "lecturer");
|
||||
@ -78,8 +75,7 @@ public class ByLecturerController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(byLecturerService.selectByLecturerById(id));
|
||||
}
|
||||
|
||||
@ -89,10 +85,10 @@ public class ByLecturerController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:add')")
|
||||
@Log(title = "讲师", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ByLecturer byLecturer)
|
||||
{
|
||||
public AjaxResult add(@RequestBody ByLecturer byLecturer) {
|
||||
byLecturer.setCreatetime(new Date());
|
||||
byLecturer.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||
byLecturer.setIsdel("0");
|
||||
return toAjax(byLecturerService.insertByLecturer(byLecturer));
|
||||
}
|
||||
|
||||
@ -102,8 +98,7 @@ public class ByLecturerController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:edit')")
|
||||
@Log(title = "讲师", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ByLecturer byLecturer)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody ByLecturer byLecturer) {
|
||||
return toAjax(byLecturerService.updateByLecturer(byLecturer));
|
||||
}
|
||||
|
||||
@ -112,9 +107,8 @@ public class ByLecturerController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('benyi:lecturer:remove')")
|
||||
@Log(title = "讲师", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(byLecturerService.deleteByLecturerByIds(ids));
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,10 @@ public class ByLecturer extends BaseEntity
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createtime;
|
||||
|
||||
/** 是否删除 */
|
||||
@Excel(name = "是否删除")
|
||||
private String isdel;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
@ -96,6 +100,15 @@ public class ByLecturer extends BaseEntity
|
||||
public Date getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
public void setIsdel(String isdel)
|
||||
{
|
||||
this.isdel = isdel;
|
||||
}
|
||||
|
||||
public String getIsdel()
|
||||
{
|
||||
return isdel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -106,6 +119,7 @@ public class ByLecturer extends BaseEntity
|
||||
.append("imgurl", getImgurl())
|
||||
.append("createuserid", getCreateuserid())
|
||||
.append("createtime", getCreatetime())
|
||||
.append("isdel", getIsdel())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="name" column="name" />
|
||||
<result property="information" column="information" />
|
||||
<result property="imgurl" column="imgurl" />
|
||||
<result property="isdel" column="isdel" />
|
||||
<result property="createuserid" column="createuserid" />
|
||||
<result property="createtime" column="createtime" />
|
||||
</resultMap>
|
||||
@ -19,13 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectByLecturerList" parameterType="ByLecturer" resultMap="ByLecturerResult">
|
||||
<include refid="selectByLecturerVo"/>
|
||||
<where>
|
||||
where isdel='0'
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="information != null and information != ''"> and information = #{information}</if>
|
||||
<if test="imgurl != null and imgurl != ''"> and imgurl = #{imgurl}</if>
|
||||
<if test="createuserid != null "> and createuserid = #{createuserid}</if>
|
||||
<if test="createtime != null "> and createtime = #{createtime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<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="createuserid != null ">createuserid,</if>
|
||||
<if test="createtime != null ">createtime,</if>
|
||||
<if test="isdel != null and isdel != ''">isdel,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<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="createuserid != null ">#{createuserid},</if>
|
||||
<if test="createtime != null ">#{createtime},</if>
|
||||
<if test="isdel != null and isdel != ''">#{isdel},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -66,11 +68,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteByLecturerById" parameterType="Long">
|
||||
delete from by_lecturer where id = #{id}
|
||||
update by_lecturer set isdel='1' where id = #{id}
|
||||
</delete>
|
||||
|
||||
<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=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
Loading…
x
Reference in New Issue
Block a user