20200529-zlp-2

1新增视频学习列表页
This commit is contained in:
paidaxing444 2020-05-29 11:39:03 +08:00
parent 91b5936d90
commit 81d2fe5b72
2 changed files with 135 additions and 24 deletions

View File

@ -1,33 +1,154 @@
<template>
<div class="app-container">
<el-row>
<el-col :span="8" v-for="(o, index) in 2" :key="o" :offset="index > 0 ? 2 : 0">
<el-card :body-style="{ padding: '0px' }">
<img
src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"
class="image"
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="视频类别" prop="type">
<el-cascader
placeholder="请选择视频类别"
v-model="queryParams.type"
:options="optionTypes"
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
clearable
></el-cascader>
</el-form-item>
<el-form-item label="讲师姓名" prop="lecturer">
<el-select v-model="queryParams.lecturer" filterable placeholder="请选择讲师">
<el-option
v-for="item in lecturerOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="视频标题" prop="title">
<el-input
v-model="queryParams.title"
clearable
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>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row v-loading="loading">
<el-col :span="6" v-for="(o, index) in videoList" :key="index" style="padding: 10px;">
<el-card :body-style="{ padding: '2px' }">
<video
controls="controls"
controlslist="nodownload"
oncontextmenu="return false"
:src="[qiniuUrl + '/' + o.videourl]"
class="avatar"
></video>
<div style="padding: 14px;">
<span>好吃的汉堡</span>
<span class="word-space-ellipsis" :title="o.title">{{o.title+" (讲师:"+o.lecturer+")"}}</span>
<div class="bottom clearfix">
<time class="time">{{ currentDate }}</time>
<el-button type="text" class="button">操作按钮</el-button>
<time class="time">{{ parseTime(o.createtime) }}</time>
</div>
</div>
</el-card>
</el-col>
</el-row>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:page-sizes="[8, 16, 32, 64]"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listVideo, getVideo } from "@/api/benyi_train/video";
import { listAllLecturer } from "@/api/benyi_train/lecturer";
import { listMoedata } from "@/api/system/moedata";
export default {
name: "VideoStudy",
data() {
return {
currentDate: new Date()
qiniuUrl: "https://files.benyiedu.com", // 访
//
loading: true,
//
total: 0,
//
videoList: [],
//
lecturerOptions: [],
//
optionTypes: [],
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 8,
title: undefined,
lecturer: undefined,
type: undefined
}
};
},
created() {
this.getList();
listAllLecturer().then(response => {
//console.log(response.lecturer);
this.lecturerOptions = response.lecturer;
});
listMoedata(this.queryParams).then(response => {
//
this.optionTypes = this.handleTree(response.data, "id", "pid");
//children0children0 undefined
this.optionTypes = this.getTreeData(this.optionTypes);
});
},
methods: {
// childrenundefined
getTreeData(data) {
for (var i = 0; i < data.length; i++) {
if (data[i].children.length < 1) {
// childrenchildrenundefined
data[i].children = undefined;
} else {
// children
this.getTreeData(data[i].children);
}
}
//console.log(data);
return data;
},
/** 查询培训列表 */
getList() {
this.loading = true;
listVideo(this.queryParams).then(response => {
this.videoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
if (this.queryParams.type == null) {
this.queryParams.type = "";
} else {
this.queryParams.type = this.queryParams.type.toString();
}
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
}
}
};
</script>
@ -38,17 +159,7 @@ export default {
color: #999;
}
.bottom {
margin-top: 13px;
line-height: 12px;
}
.button {
padding: 0;
float: right;
}
.image {
.avatar {
width: 100%;
display: block;
}

View File

@ -36,7 +36,7 @@ public class SysDictMoedataController extends BaseController {
/**
* 查询多级字典管理列表
*/
@PreAuthorize("@ss.hasPermi('system:moedata:list')")
@PreAuthorize("@ss.hasPermi('system:moedata:list')"+ "||@ss.hasPermi('benyi:video:list')")
@GetMapping("/list")
public AjaxResult list(SysDictMoedata sysDictMoedata) {