From 1ac9d63503445bfa1ab02500eb866db426af34b1 Mon Sep 17 00:00:00 2001 From: paidaxing444 <12qwaszx> Date: Fri, 29 May 2020 15:42:00 +0800 Subject: [PATCH] =?UTF-8?q?20200529-zlp-2=201=E6=96=B0=E5=A2=9E=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=AD=A6=E4=B9=A0=E5=88=97=E8=A1=A8=E9=A1=B5(?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=85=BC=E5=AE=B9=E6=80=A7)=202=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=AE=B2=E5=B8=88=E4=B8=BA=E8=BD=AF=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/benyi_train/video/index.vue | 28 +++++++++---------- .../views/benyi_train/video_study/index.vue | 26 +++++++++++++++-- .../controller/ByLecturerController.java | 26 +++++++---------- .../project/benyi/domain/ByLecturer.java | 14 ++++++++++ .../mybatis/benyi/ByLecturerMapper.xml | 10 ++++--- 5 files changed, 67 insertions(+), 37 deletions(-) diff --git a/ruoyi-ui/src/views/benyi_train/video/index.vue b/ruoyi-ui/src/views/benyi_train/video/index.vue index edfc3ff38..e2ce865a6 100644 --- a/ruoyi-ui/src/views/benyi_train/video/index.vue +++ b/ruoyi-ui/src/views/benyi_train/video/index.vue @@ -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> diff --git a/ruoyi-ui/src/views/benyi_train/video_study/index.vue b/ruoyi-ui/src/views/benyi_train/video_study/index.vue index 96030e5ff..1d93afeee 100644 --- a/ruoyi-ui/src/views/benyi_train/video_study/index.vue +++ b/ruoyi-ui/src/views/benyi_train/video_study/index.vue @@ -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; } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByLecturerController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByLecturerController.java index 0070733f9..e9fade587 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByLecturerController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByLecturerController.java @@ -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)); } } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByLecturer.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByLecturer.java index adc0e7183..75b6fa4cd 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByLecturer.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByLecturer.java @@ -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(); } } diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByLecturerMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByLecturerMapper.xml index 62177b713..901680d40 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/ByLecturerMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/ByLecturerMapper.xml @@ -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>