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) {
return request({

View File

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

View File

@ -85,6 +85,16 @@
:formatter="typeFormat"
: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">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createtime) }}</span>
@ -182,12 +192,29 @@
<el-button @click="cancel"> </el-button>
</div>
</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>
</template>
<script>
import {
listVideo,
listScoreAndFree,
getVideo,
delVideo,
addVideo,
@ -223,14 +250,20 @@ export default {
multiple: true,
//
total: 0,
//
detailtotal: 0,
//
videoList: [],
//
scoreandfreeList: [],
//
title: "",
//
lecturerOptions: [],
//
open: false,
//
opendetail: false,
//
queryParams: {
pageNum: 1,
@ -378,10 +411,20 @@ export default {
this.loading = true;
listVideo(this.queryParams).then(response => {
this.videoList = response.rows;
//console.log(response.rows);
this.total = response.total;
this.loading = false;
});
},
/** 查询分数和评价列表 */
getScoreAndFreeList(id) {
//this.loading = true;
listScoreAndFree(id).then(response => {
this.scoreandfreeList = response.rows;
this.detailtotal = response.total;
//this.loading = false;
});
},
//
cancel() {
this.open = false;
@ -423,6 +466,12 @@ export default {
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/**查看平均分详情和评价 */
lookDetails(row) {
const id = row.id;
this.opendetail = true;
this.getScoreAndFreeList(id);
},
/** 新增按钮操作 */
handleAdd() {
this.imageUrl = "";

View File

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

View File

@ -4,6 +4,8 @@ import java.util.Date;
import java.util.List;
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.SchoolCommon;
import org.springframework.security.access.prepost.PreAuthorize;
@ -40,6 +42,8 @@ public class ByTrainVideoController extends BaseController {
private CommonController commonController;
@Autowired
private SchoolCommon schoolCommon;
@Autowired
private IByTrainVideoScoreService byTrainVideoScoreService;
/**
@ -64,6 +68,19 @@ public class ByTrainVideoController extends BaseController {
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")
private Date createtime;
/**
* 培训视频平均分
*/
@Excel(name = "培训视频平均分")
private Float avgscore;
public void setId(Long id) {
this.id = id;
}
@ -170,6 +176,14 @@ public class ByTrainVideo extends BaseEntity {
return createtime;
}
public void setAvgscore(Float avgscore) {
this.avgscore = avgscore;
}
public Float getAvgscore() {
return avgscore;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -184,6 +198,7 @@ public class ByTrainVideo extends BaseEntity {
.append("classtype", getClasstype())
.append("createuserid", getCreateuserid())
.append("createtime", getCreatetime())
.append("avgscore",getAvgscore())
.toString();
}
}

View File

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