提交代码

dev_xd
姜玉琦 2024-10-08 00:23:01 +08:00
parent c7dd2063a6
commit f618dee734
5 changed files with 169 additions and 14 deletions

View File

@ -19,7 +19,7 @@ public class BusTrainingVideoUser extends BaseEntity
private Long id; private Long id;
/** 公司主键 */ /** 公司主键 */
private Long deptId; private Long comId;
/** 公司名称 */ /** 公司名称 */
@Excel(name = "公司名称") @Excel(name = "公司名称")
@ -60,6 +60,26 @@ public class BusTrainingVideoUser extends BaseEntity
@Excel(name = "删除标识") @Excel(name = "删除标识")
private Long isDel; private Long isDel;
/** 培训名称 */
@Excel(name = "培训名称")
private String trainTitle;
/** 培训类型 */
@Excel(name = "培训类型")
private String trainType;
/** 培训级别 */
@Excel(name = "培训级别")
private String trainLevel;
/** 培训文件地址 */
@Excel(name = "培训文件地址")
private String trainFilePath;
/** 培训文件主图 */
@Excel(name = "培训文件主图")
private String trainFileImage;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -69,15 +89,15 @@ public class BusTrainingVideoUser extends BaseEntity
{ {
return id; return id;
} }
public void setDeptId(Long deptId)
{ public Long getComId() {
this.deptId = deptId; return comId;
} }
public Long getDeptId() public void setComId(Long comId) {
{ this.comId = comId;
return deptId;
} }
public void setProjectId(Long projectId) public void setProjectId(Long projectId)
{ {
this.projectId = projectId; this.projectId = projectId;
@ -165,11 +185,51 @@ public class BusTrainingVideoUser extends BaseEntity
this.userName = userName; this.userName = userName;
} }
public String getTrainTitle() {
return trainTitle;
}
public void setTrainTitle(String trainTitle) {
this.trainTitle = trainTitle;
}
public String getTrainType() {
return trainType;
}
public void setTrainType(String trainType) {
this.trainType = trainType;
}
public String getTrainLevel() {
return trainLevel;
}
public void setTrainLevel(String trainLevel) {
this.trainLevel = trainLevel;
}
public String getTrainFilePath() {
return trainFilePath;
}
public void setTrainFilePath(String trainFilePath) {
this.trainFilePath = trainFilePath;
}
public String getTrainFileImage() {
return trainFileImage;
}
public void setTrainFileImage(String trainFileImage) {
this.trainFileImage = trainFileImage;
}
@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("deptId", getDeptId()) .append("comId", getComId())
.append("projectId", getProjectId()) .append("projectId", getProjectId())
.append("userId", getUserId()) .append("userId", getUserId())
.append("videoId", getVideoId()) .append("videoId", getVideoId())

View File

@ -14,6 +14,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userNick" column="user_nick" /> <result property="userNick" column="user_nick" />
<result property="userName" column="user_name" /> <result property="userName" column="user_name" />
<result property="videoId" column="video_id" /> <result property="videoId" column="video_id" />
<result property="trainTitle" column="train_title" />
<result property="trainType" column="train_type" />
<result property="trainLevel" column="train_level" />
<result property="trainFilePath" column="train_file_path" />
<result property="trainFileImage" column="train_file_image" />
<result property="playStatus" column="play_status" /> <result property="playStatus" column="play_status" />
<result property="sortBy" column="sort_by" /> <result property="sortBy" column="sort_by" />
<result property="isDel" column="is_del" /> <result property="isDel" column="is_del" />
@ -25,7 +30,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectBusTrainingVideoUserVo"> <sql id="selectBusTrainingVideoUserVo">
select btvu.id, btvu.com_id, sd.dept_name as com_name, btvu.project_id, pi.project_name, btvu.user_id, su.nick_name as user_nick, su.user_name, btvu.video_id, btvu.play_status, btvu.sort_by, btvu.is_del, btvu.create_by, btvu.create_time, btvu.update_by, btvu.update_time, btvu.remark from bus_training_video_user btvu select btvu.id, btvu.com_id, sd.dept_name as com_name, btvu.project_id, pi.project_name, btvu.user_id, su.nick_name as user_nick, su.user_name, btvu.video_id, btv.train_title,
btv.train_type, btv.train_level, btv.train_file_path, btv.train_file_image,
btvu.play_status, btvu.sort_by, btvu.is_del, btvu.create_by, btvu.create_time, btvu.update_by, btvu.update_time, btvu.remark from bus_training_video_user btvu
left join bus_training_video btv on btv.id = btvu.video_id
left join pro_project_info pi on pi.id = btvu.project_id left join pro_project_info pi on pi.id = btvu.project_id
left join sys_dept sd on sd.com_id = btvu.com_id left join sys_dept sd on sd.com_id = btvu.com_id
left join sys_user su on su.user_id = btvu.user_id left join sys_user su on su.user_id = btvu.user_id

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -118,6 +118,11 @@
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="播放" align="center" width="80">
<template #default="scope">
<el-button type="primary" link icon="VideoPlay" @click="handlePlayVideo(scope.row)"></el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="150" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" fixed="right" width="150" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button v-if="!scope.row.disabledState" link type="primary" icon="Edit" @click="handleUpdate(scope.row)" <el-button v-if="!scope.row.disabledState" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
@ -185,10 +190,23 @@
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
<!--培训视频播放对话框 -->
<el-dialog :title="videoTitle" v-model="videoOpen" width="680px" append-to-body modal-class="video-play-dlg">
<video
ref="videoRef"
:src="videoSrc"
controls="controls"
autoplay="autoplay"
:poster="videoPoster?videoPoster:poster"
style="width: 100%;max-height: 550px"
/>
</el-dialog>
</div> </div>
</template> </template>
<script setup name="BusTrainingVideo"> <script setup name="BusTrainingVideo">
import poster from '@/assets/images/poster.gif'
import { listBusTrainingVideo, findBusTrainingVideo, getBusTrainingVideo, delBusTrainingVideo, addBusTrainingVideo, updateBusTrainingVideo } from "@/api/manage/busTrainingVideo"; import { listBusTrainingVideo, findBusTrainingVideo, getBusTrainingVideo, delBusTrainingVideo, addBusTrainingVideo, updateBusTrainingVideo } from "@/api/manage/busTrainingVideo";
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
@ -207,6 +225,11 @@ const tabs = ref({'gsj':0,'xmj':0,'bzj':0});
const activeName = ref("gsj"); const activeName = ref("gsj");
const craftPostOptions = ref([]); const craftPostOptions = ref([]);
const videoSrc = ref("");
const videoPoster = ref("");
const videoOpen = ref(false);
const videoTitle = ref("");
const data = reactive({ const data = reactive({
form: {}, form: {},
queryParams: { queryParams: {
@ -441,6 +464,14 @@ function handleExport() {
}, `busTrainingVideo_${new Date().getTime()}.xlsx`) }, `busTrainingVideo_${new Date().getTime()}.xlsx`)
} }
/** 播放视频操作 */
function handlePlayVideo(row) {
videoSrc.value = row.trainFilePath;
videoPoster.value = row.trainFileImage;
videoOpen.value = true;
videoTitle.value = "视频播放 #"+row.trainTitle;
}
/** 初始化行标识 */ /** 初始化行标识 */
function initRowDisabled(row) { function initRowDisabled(row) {
let roles = userStore.roles; let roles = userStore.roles;
@ -513,4 +544,9 @@ getList();
} }
} }
} }
.video-play-dlg{
.el-dialog__body{
padding: 10px;
}
}
</style> </style>

View File

@ -69,14 +69,29 @@
<el-table-column label="所属公司" align="center" prop="comName" /> <el-table-column label="所属公司" align="center" prop="comName" />
<el-table-column label="项目名称" align="center" prop="projectName" /> <el-table-column label="项目名称" align="center" prop="projectName" />
<el-table-column label="用户账号" align="center" prop="userName" /> <el-table-column label="用户账号" align="center" prop="userName" />
<el-table-column label="培训名称" align="center" prop="trainTitle"/>
<el-table-column label="培训类型" align="center" prop="trainType" width="120">
<template #default="scope">
<dict-tag :options="edu_train_type" :value="scope.row.trainType" />
</template>
</el-table-column>
<el-table-column label="培训级别" align="center" prop="trainLevel" width="100">
<template #default="scope">
<dict-tag :options="edu_train_level" :value="scope.row.trainLevel" />
</template>
</el-table-column>
<el-table-column label="培训状态" align="center" prop="playStatus" /> <el-table-column label="培训状态" align="center" prop="playStatus" />
<el-table-column label="培训排序" align="center" prop="sortBy" /> <el-table-column label="培训顺序" align="center" prop="sortBy" />
<el-table-column label="培训时间" align="center" prop="createTime" width="120"> <el-table-column label="培训时间" align="center" prop="createTime" width="120">
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="播放" align="center" width="80">
<template #default="scope">
<el-button type="primary" link icon="VideoPlay" @click="handlePlayVideo(scope.row)"></el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button v-if="false" link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busTrainingVideoUser:edit']"></el-button> <el-button v-if="false" link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busTrainingVideoUser:edit']"></el-button>
@ -126,13 +141,28 @@
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
<!--培训视频播放对话框 -->
<el-dialog :title="videoTitle" v-model="videoOpen" width="680px" append-to-body modal-class="video-play-user-dlg">
<video
ref="videoRef"
:src="videoSrc"
controls="controls"
autoplay="autoplay"
:poster="videoPoster?videoPoster:poster"
style="width: 100%;max-height: 550px"
/>
</el-dialog>
</div> </div>
</template> </template>
<script setup name="BusTrainingVideoUser"> <script setup name="BusTrainingVideoUser">
import poster from '@/assets/images/poster.gif'
import { listBusTrainingVideoUser, getBusTrainingVideoUser, delBusTrainingVideoUser, addBusTrainingVideoUser, updateBusTrainingVideoUser } from "@/api/manage/busTrainingVideoUser"; import { listBusTrainingVideoUser, getBusTrainingVideoUser, delBusTrainingVideoUser, addBusTrainingVideoUser, updateBusTrainingVideoUser } from "@/api/manage/busTrainingVideoUser";
import useUserStore from '@/store/modules/user'
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { edu_train_level, edu_train_type} = proxy.useDict('edu_train_level', 'edu_train_type');
const busTrainingVideoUserList = ref([]); const busTrainingVideoUserList = ref([]);
const open = ref(false); const open = ref(false);
@ -144,6 +174,11 @@ const multiple = ref(true);
const total = ref(0); const total = ref(0);
const title = ref(""); const title = ref("");
const videoSrc = ref("");
const videoPoster = ref("");
const videoOpen = ref(false);
const videoTitle = ref("");
const data = reactive({ const data = reactive({
form: {}, form: {},
queryParams: { queryParams: {
@ -162,6 +197,7 @@ const data = reactive({
}); });
const { queryParams, form, rules } = toRefs(data); const { queryParams, form, rules } = toRefs(data);
const userStore = useUserStore()
/** 查询用户培训视频列表 */ /** 查询用户培训视频列表 */
function getList() { function getList() {
@ -275,5 +311,20 @@ function handleExport() {
}, `busTrainingVideoUser_${new Date().getTime()}.xlsx`) }, `busTrainingVideoUser_${new Date().getTime()}.xlsx`)
} }
/** 播放视频操作 */
function handlePlayVideo(row) {
videoSrc.value = row.trainFilePath;
videoPoster.value = row.trainFileImage;
videoOpen.value = true;
videoTitle.value = "视频播放 #"+row.trainTitle;
}
getList(); getList();
</script> </script>
<style lang="scss">
.video-play-user-dlg{
.el-dialog__body{
padding: 10px;
}
}
</style>