20200622-zlp-1

首页-一日流程学习
This commit is contained in:
paidaxing444
2020-06-22 11:29:25 +08:00
parent ef9856f4e5
commit 067fced942
9 changed files with 219 additions and 100 deletions

View File

@ -9,6 +9,15 @@ export function listVideo(query) {
}) })
} }
// 查询培训列表
export function listScoreAndFree(id) {
return request({
url: '/benyi/video/listscoreandfree/'+id,
method: 'get'
})
}
// 查询培训详细 // 查询培训详细
export function getVideo(id) { export function getVideo(id) {
return request({ return request({

View File

@ -24,20 +24,36 @@
/> />
</div> </div>
</el-col> </el-col>
<div> <el-col :span="20" :xs="24">
<span>流程中所含任务</span> <el-card class="box-card">
</div> <div slot="header" class="clearfix">
<el-col :span="20" :xs="24" v-for="(item, index) in dayflowtaskList" :key="index" > <span>{{title}}</span>
<el-card :body-style="{ padding: '2px' }"> </div>
<div class="to-detail"> <div class="text item">
<el-tooltip effect="dark" :content="item.taskLable" placement="right"> 导言
<div> <br />
<p class="info-title">{{item.taskLable}}</p> <label v-html="content"></label>
</div> </div>
</el-tooltip> <div class="text item">
<p class="info-title info-title-name">该任务所含标准个数:{{ item.standardCount }}</p> 目的
<div class="bottom"> <br />
<time class="time">{{ parseTime(item.createtime) }}</time> <label v-html="note"></label>
</div>
<div v-for="(item, index) in dayflowtaskList" :key="index" class="text item">
{{item.taskLable}}
<div
v-for="(item_standard, index_standard) in (dayflowstandardList.filter(p=>p.taskCode==item.code))"
:key="index_standard"
class="text item"
>{{item_standard.standardTitle}}
<br/>解读
<div
v-for="(item_unscramble, index_unscramble) in (dayflowunscrambleList.filter(p=>p.standardId==item_standard.id))"
:key="index_unscramble"
class="text item"
>{{item_unscramble.sort}}-{{item_unscramble.content}}
</div>
</div> </div>
</div> </div>
</el-card> </el-card>
@ -47,29 +63,31 @@
</template> </template>
<script> <script>
import { listDetail, getDetail } from "@/api/benyi/dayflow/dayflowmanger";
import { listDayflowtask } from "@/api/benyi/dayflow/dayflowtask"; import { listDayflowtask } from "@/api/benyi/dayflow/dayflowtask";
import { listStandard } from "@/api/benyi/dayflow/biaozhun/standard" import { listStandard } from "@/api/benyi/dayflow/biaozhun/standard";
import { treeselect } from "@/api/benyi/dayflow/dayflowmanger"; import { listUnscramble } from "@/api/benyi/dayflow/unscramble";
import Treeselect from "@riophae/vue-treeselect"; import { treeselect, getDetail } from "@/api/benyi/dayflow/dayflowmanger";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
name: "Detail", name: "Detail",
data() { data() {
return { return {
// 遮罩层
loading: true,
// 一日流程名称 // 一日流程名称
name: undefined, name: undefined,
// 一日流程id // 一日流程id
id: undefined, id: undefined,
//标题
title: "一日流程",
//导言
content: undefined,
//目的
note: undefined,
// 根据一日流程id查到的名下任务列表 // 根据一日流程id查到的名下任务列表
dayflowtaskList: [], dayflowtaskList: [],
// 根据任务查询到名下标准 // 根据任务查询到名下标准
dayflowstandardList: [], dayflowstandardList: [],
//一日流程解读
dayflowunscrambleList: [],
// 树状显示类型 // 树状显示类型
treeOptions: [], treeOptions: [],
// 树结构 // 树结构
@ -79,8 +97,10 @@ export default {
}, },
// 查询参数 // 查询参数
queryParams: { queryParams: {
detailId: undefined, detailId: undefined
taskCode: undefined, },
queryStandardParams: {
taskCode: undefined
} }
}; };
}, },
@ -108,60 +128,45 @@ export default {
// 节点单击事件 // 节点单击事件
handleNodeClick(data) { handleNodeClick(data) {
this.queryParams.detailId = data.id; this.queryParams.detailId = data.id;
this.title = data.label;
this.getTaskList(); this.getTaskList();
// console.log(this.dayflowtaskList[date.id]) // console.log(this.dayflowtaskList[date.id])
// this.getStandardList(); // this.getStandardList();
}, },
/** 查询一日流程任务列表 */ /** 查询一日流程任务列表 */
getTaskList() { getTaskList() {
this.loading = true;
listDayflowtask(this.queryParams).then(response => { listDayflowtask(this.queryParams).then(response => {
this.dayflowtaskList = response.rows; this.dayflowtaskList = response.rows;
// console.log(this.dayflowtaskList);
this.loading = false;
}); });
}, getDetail(this.queryParams.detailId).then(response => {
/** 查询任务标准列表 */ this.content = response.data.content;
// getStandardList() { this.note = response.data.note;
// this.loading = true; });
// const taskCode = this.dayflowtaskList[this.id-1].code; listStandard(null).then(response => {
// listStandard(taskCode).then(response => { this.dayflowstandardList = response.rows;
// this.dayflowstandardList = response.rows; });
// console.log(this.dayflowstandardList); listUnscramble(null).then(response => {
// this.loading = false; this.dayflowunscrambleList = response.rows;
// }); });
// }, }
} }
}; };
</script> </script>
<style> <style>
.time { .text {
line-height: 12px; font-size: 14px;
font-size: 12px;
color: #999;
} }
.bottom { .item {
margin-top: 13px; margin-bottom: 18px;
display: flex;
justify-content: space-between;
align-items: center;
} }
.to-detail { .clearfix:before,
/*cursor: pointer;*/ .clearfix:after {
padding: 14px; display: table;
content: "";
} }
.clearfix:after {
.info-title { clear: both;
width: 100%; /*根据自己项目进行定义宽度*/
overflow: hidden; /*设置超出的部分进行影藏*/
text-overflow: ellipsis; /*设置超出部分使用省略号*/
white-space: nowrap; /*设置为单行*/
}
.info-title-name {
font-size: 12px;
} }
</style> </style>

View File

@ -85,6 +85,16 @@
:formatter="typeFormat" :formatter="typeFormat"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column label="所得平均分" align="center">
<template slot-scope="scope">
<el-button
title="点击我查看分数和评价"
size="mini"
type="text"
@click="lookDetails(scope.row)"
>{{ scope.row.avgscore }}</el-button>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createtime" width="180"> <el-table-column label="创建时间" align="center" prop="createtime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createtime) }}</span> <span>{{ parseTime(scope.row.createtime) }}</span>
@ -182,12 +192,29 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 添加或修改培训对话框 -->
<el-dialog title="查看分数和评价详情页" :visible.sync="opendetail" width="800px">
<el-table v-loading="loading" :data="scoreandfreeList">
<el-table-column label="分数" align="center" prop="score" />
<el-table-column label="评价" align="center" prop="content" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="detailtotal>0"
:total="detailtotal"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getScoreAndFreeList"
/>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
listVideo, listVideo,
listScoreAndFree,
getVideo, getVideo,
delVideo, delVideo,
addVideo, addVideo,
@ -223,14 +250,20 @@ export default {
multiple: true, multiple: true,
// 总条数 // 总条数
total: 0, total: 0,
//详情总条数
detailtotal: 0,
// 培训表格数据 // 培训表格数据
videoList: [], videoList: [],
// 培训表格数据
scoreandfreeList: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
//讲师列表 //讲师列表
lecturerOptions: [], lecturerOptions: [],
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
//详情页弹出层
opendetail: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -378,10 +411,20 @@ export default {
this.loading = true; this.loading = true;
listVideo(this.queryParams).then(response => { listVideo(this.queryParams).then(response => {
this.videoList = response.rows; this.videoList = response.rows;
//console.log(response.rows);
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, },
/** 查询分数和评价列表 */
getScoreAndFreeList(id) {
//this.loading = true;
listScoreAndFree(id).then(response => {
this.scoreandfreeList = response.rows;
this.detailtotal = response.total;
//this.loading = false;
});
},
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; this.open = false;
@ -423,6 +466,12 @@ export default {
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
/**查看平均分详情和评价 */
lookDetails(row) {
const id = row.id;
this.opendetail = true;
this.getScoreAndFreeList(id);
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.imageUrl = ""; this.imageUrl = "";

View File

@ -148,6 +148,7 @@ export default {
if (this.form.score == 0) { if (this.form.score == 0) {
this.form.score = null; this.form.score = null;
} }
this.form.content=this.form.content.trim();
this.form.lecturerid = this.lecturerid; this.form.lecturerid = this.lecturerid;
this.form.videoid = id; this.form.videoid = id;
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {

View File

@ -4,6 +4,8 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.project.benyi.domain.ByTrainVideoScore;
import com.ruoyi.project.benyi.service.IByTrainVideoScoreService;
import com.ruoyi.project.common.CommonController; import com.ruoyi.project.common.CommonController;
import com.ruoyi.project.common.SchoolCommon; import com.ruoyi.project.common.SchoolCommon;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -40,6 +42,8 @@ public class ByTrainVideoController extends BaseController {
private CommonController commonController; private CommonController commonController;
@Autowired @Autowired
private SchoolCommon schoolCommon; private SchoolCommon schoolCommon;
@Autowired
private IByTrainVideoScoreService byTrainVideoScoreService;
/** /**
@ -64,6 +68,19 @@ public class ByTrainVideoController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询培训评分和评价列表
*/
@PreAuthorize("@ss.hasPermi('benyi:video:list')")
@GetMapping("/listscoreandfree/{id}")
public TableDataInfo listscoreandfree(@PathVariable("id") Long id) {
startPage();
ByTrainVideoScore byTrainVideoScore=new ByTrainVideoScore();
byTrainVideoScore.setVideoid(id);
List<ByTrainVideoScore> list = byTrainVideoScoreService.selectByTrainVideoScoreList(byTrainVideoScore);
return getDataTable(list);
}
/** /**
* 导出培训列表 * 导出培训列表
*/ */

View File

@ -82,6 +82,12 @@ public class ByTrainVideo 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 Float avgscore;
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
@ -170,6 +176,14 @@ public class ByTrainVideo extends BaseEntity {
return createtime; return createtime;
} }
public void setAvgscore(Float avgscore) {
this.avgscore = avgscore;
}
public Float getAvgscore() {
return avgscore;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -184,6 +198,7 @@ public class ByTrainVideo extends BaseEntity {
.append("classtype", getClasstype()) .append("classtype", getClasstype())
.append("createuserid", getCreateuserid()) .append("createuserid", getCreateuserid())
.append("createtime", getCreatetime()) .append("createtime", getCreatetime())
.append("avgscore",getAvgscore())
.toString(); .toString();
} }
} }

View File

@ -10,30 +10,45 @@ import java.util.Date;
/** /**
* 培训视频评分对象 by_train_video_score * 培训视频评分对象 by_train_video_score
* *
* @author tsbz * @author tsbz
* @date 2020-06-01 * @date 2020-06-01
*/ */
public class ByTrainVideoScore extends BaseEntity public class ByTrainVideoScore extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 编号 */ /**
* 编号
*/
private Long id; private Long id;
/** 视频编号 */ /**
* 视频编号
*/
@Excel(name = "视频编号") @Excel(name = "视频编号")
private Long videoid; private Long videoid;
/** 讲师id */ /**
* 讲师id
*/
@Excel(name = "讲师id") @Excel(name = "讲师id")
private Long lecturerid; private Long lecturerid;
/** 评分 */ /**
* 评分
*/
@Excel(name = "评分") @Excel(name = "评分")
private Long score; private Long score;
/** 创建人 */ /**
* 反馈意见建议
*/
@Excel(name = "反馈意见建议")
private String content;
/**
* 创建人
*/
@Excel(name = "创建人") @Excel(name = "创建人")
private Long createuserid; private Long createuserid;
@ -43,51 +58,54 @@ public class ByTrainVideoScore extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createtime; private Date createtime;
public void setId(Long id) public void setId(Long id) {
{
this.id = id; this.id = id;
} }
public Long getId() public Long getId() {
{
return id; return id;
} }
public void setVideoid(Long videoid)
{ public void setVideoid(Long videoid) {
this.videoid = videoid; this.videoid = videoid;
} }
public Long getVideoid() public Long getVideoid() {
{
return videoid; return videoid;
} }
public void setLecturerid(Long lecturerid)
{ public void setLecturerid(Long lecturerid) {
this.lecturerid = lecturerid; this.lecturerid = lecturerid;
} }
public Long getLecturerid() public Long getLecturerid() {
{
return lecturerid; return lecturerid;
} }
public void setScore(Long score)
{ public void setScore(Long score) {
this.score = score; this.score = score;
} }
public Long getScore() public Long getScore() {
{
return score; return score;
} }
public void setCreateuserid(Long createuserid)
{ public void setContent(String content) {
this.content = content;
}
public String getContent() {
return content;
}
public void setCreateuserid(Long createuserid) {
this.createuserid = createuserid; this.createuserid = createuserid;
} }
public Long getCreateuserid() public Long getCreateuserid() {
{
return createuserid; return createuserid;
} }
public void setCreatetime(Date createtime) { public void setCreatetime(Date createtime) {
this.createtime = createtime; this.createtime = createtime;
} }
@ -98,13 +116,14 @@ public class ByTrainVideoScore extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("videoid", getVideoid()) .append("videoid", getVideoid())
.append("lecturerid", getLecturerid()) .append("lecturerid", getLecturerid())
.append("score", getScore()) .append("score", getScore())
.append("createuserid", getCreateuserid()) .append("content", getContent())
.append("createtime", getCreatetime()) .append("createuserid", getCreateuserid())
.toString(); .append("createtime", getCreatetime())
.toString();
} }
} }

View File

@ -16,10 +16,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="classtype" column="classtype" /> <result property="classtype" column="classtype" />
<result property="createuserid" column="createuserid" /> <result property="createuserid" column="createuserid" />
<result property="createtime" column="createtime" /> <result property="createtime" column="createtime" />
<result property="avgscore" column="avgscore" />
</resultMap> </resultMap>
<sql id="selectByTrainVideoVo"> <sql id="selectByTrainVideoVo">
select id, title, information, lecturer,(select name from by_lecturer where lecturer=by_lecturer.id) as lecturername, videourl,filetype, type, classtype, createuserid, createtime from by_train_video select id, title, information, lecturer,(select name from by_lecturer where lecturer=by_lecturer.id) as lecturername, videourl,filetype, type, classtype, createuserid, createtime,
(select avg(score) from by_train_video_score where by_train_video_score.videoid=by_train_video.id) avgscore
from by_train_video
</sql> </sql>
<select id="selectByTrainVideoList" parameterType="ByTrainVideo" resultMap="ByTrainVideoResult"> <select id="selectByTrainVideoList" parameterType="ByTrainVideo" resultMap="ByTrainVideoResult">

View File

@ -9,12 +9,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="videoid" column="videoid" /> <result property="videoid" column="videoid" />
<result property="lecturerid" column="lecturerid" /> <result property="lecturerid" column="lecturerid" />
<result property="score" column="score" /> <result property="score" column="score" />
<result property="content" column="content" />
<result property="createuserid" column="createuserid" /> <result property="createuserid" column="createuserid" />
<result property="createtime" column="createtime" /> <result property="createtime" column="createtime" />
</resultMap> </resultMap>
<sql id="selectByTrainVideoScoreVo"> <sql id="selectByTrainVideoScoreVo">
select id, videoid, lecturerid, score, createuserid, createtime from by_train_video_score select id, videoid, lecturerid, score,(select content from by_train_video_feedback where by_train_video_feedback.id=by_train_video_score.id) content, createuserid, createtime from by_train_video_score
</sql> </sql>
<select id="selectByTrainVideoScoreList" parameterType="ByTrainVideoScore" resultMap="ByTrainVideoScoreResult"> <select id="selectByTrainVideoScoreList" parameterType="ByTrainVideoScore" resultMap="ByTrainVideoScoreResult">