|
@@ -1,74 +1,13 @@
|
|
|
-<template >
|
|
|
+<template>
|
|
|
<div class="video_contianer">
|
|
|
<el-card>
|
|
|
- <div slot="header" >
|
|
|
- <mx-search-group justify="space-between" :span="6" v-model="form.sectionName" placeholder="请输入搜索内容" @search="searchVideo">
|
|
|
- <div class="spans">
|
|
|
- <span
|
|
|
- v-for="item in videoType"
|
|
|
- :key="item.code"
|
|
|
- class="pointer"
|
|
|
- :class="typeActive == item.code ? 'active_text' : ''"
|
|
|
- @click="toggleType(item.code)"
|
|
|
- >{{ item.label }}</span
|
|
|
- >
|
|
|
- </div>
|
|
|
+ <mx-condition ref="condition" :query-params="queryParams" :require-fields="requireFields" @query="handleQuery"
|
|
|
+ @invalid="handleInvalidQuery"
|
|
|
+ ></mx-condition>
|
|
|
+ <div slot="header">
|
|
|
+ <mx-search-group justify="end" :span="6" v-model="sectionName" placeholder="请输入搜索内容" @search="searchVideo">
|
|
|
</mx-search-group>
|
|
|
</div>
|
|
|
- <div class="radio_contianer">
|
|
|
- <div style="margin-bottom: 16px">
|
|
|
- <span>科目</span>
|
|
|
- <el-radio-group v-model="form.course" @change="getGrade" size="mini">
|
|
|
- <el-radio-button
|
|
|
- :label="item.code"
|
|
|
- v-for="item in subjects"
|
|
|
- :key="item.code"
|
|
|
- >{{ item.label }}</el-radio-button
|
|
|
- >
|
|
|
- </el-radio-group>
|
|
|
- </div>
|
|
|
- <div style="margin-bottom: 16px">
|
|
|
- <span>年级</span>
|
|
|
- <el-radio-group v-model="form.grade" @change="getVersion" size="mini">
|
|
|
- <el-radio-button
|
|
|
- :label="item.code"
|
|
|
- v-for="item in grade"
|
|
|
- :key="item.code"
|
|
|
- >{{ item.label }}</el-radio-button
|
|
|
- >
|
|
|
- </el-radio-group>
|
|
|
- </div>
|
|
|
- <div style="margin-bottom: 16px" v-if="version.length > 0">
|
|
|
- <span>版本</span>
|
|
|
- <el-radio-group
|
|
|
- v-model="form.version"
|
|
|
- size="mini"
|
|
|
- @change="toggleCondition"
|
|
|
- >
|
|
|
- <el-radio-button
|
|
|
- :label="item.code"
|
|
|
- v-for="item in version"
|
|
|
- :key="item.code"
|
|
|
- >{{ item.label }}</el-radio-button
|
|
|
- >
|
|
|
- </el-radio-group>
|
|
|
- </div>
|
|
|
- <div style="margin-bottom: 16px" v-if="packList.length > 0">
|
|
|
- <span>分类</span>
|
|
|
- <el-radio-group
|
|
|
- v-model="form.pack"
|
|
|
- size="mini"
|
|
|
- @change="togglePack($event)"
|
|
|
- >
|
|
|
- <el-radio-button
|
|
|
- :label="item.value"
|
|
|
- v-for="item in packList"
|
|
|
- :key="item.code"
|
|
|
- >{{ item.label }}</el-radio-button
|
|
|
- >
|
|
|
- </el-radio-group>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
</el-card>
|
|
|
<!-- 视频主体 -->
|
|
|
<el-card class="video_content" v-if="videoList.length > 0">
|
|
@@ -100,162 +39,85 @@
|
|
|
<pagination
|
|
|
v-show="total > 0"
|
|
|
:total="total"
|
|
|
- :page.sync="form.pageNum"
|
|
|
- :limit.sync="form.pageSize"
|
|
|
+ :page.sync="pageForm.pageNum"
|
|
|
+ :limit.sync="pageForm.pageSize"
|
|
|
:pageSizes="[16,32]"
|
|
|
@pagination="getVideoList"
|
|
|
/>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
- <evaluation-empty v-if="videoList.length == 0" />
|
|
|
+ <evaluation-empty v-if="videoList.length == 0"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import {
|
|
|
- videoSubjects,
|
|
|
- videoType,
|
|
|
- videoGrades,
|
|
|
- videoVersions,
|
|
|
- packList,
|
|
|
- videoList,
|
|
|
- videoInfo,
|
|
|
-} from "@/api/webApi/webVideo";
|
|
|
+import { videoList } from '@/api/webApi/webVideo'
|
|
|
import MxSearchGroup from '@/components/MxSearch/mx-search-group'
|
|
|
-import FormSearch from "@/components/formSearch";
|
|
|
+import MxCondition from '@/components/MxCondition/mx-condition'
|
|
|
+
|
|
|
export default {
|
|
|
- components: {MxSearchGroup },
|
|
|
+ components: { MxSearchGroup, MxCondition },
|
|
|
data() {
|
|
|
return {
|
|
|
- input: "",
|
|
|
- typeActive: 0,
|
|
|
- videoType: [],
|
|
|
- form: {
|
|
|
- course: "", // 科目
|
|
|
- subject: "", // 大类
|
|
|
- grade: "", // 年级
|
|
|
- version: "", // 版本
|
|
|
+ pageForm: {
|
|
|
pageNum: 1,
|
|
|
- pageSize: 16,
|
|
|
- pack: 0,
|
|
|
- sectionName: "",
|
|
|
+ pageSize: 16
|
|
|
+ },
|
|
|
+ sectionName: '',
|
|
|
+ queryParams: {
|
|
|
+ videoType: '',
|
|
|
+ videoCourse: '',
|
|
|
+ videoGrade: '',
|
|
|
+ videoVersion: '',
|
|
|
+ videoPack: ''
|
|
|
},
|
|
|
- subjects: [], // 课程
|
|
|
- grade: [], // 年级
|
|
|
- version: [], // 版本
|
|
|
- packList: [], // 分类
|
|
|
+ requireFields: ['videoType', 'videoCourse',
|
|
|
+ 'videoGrade',
|
|
|
+ 'videoVersion',
|
|
|
+ 'videoPack'
|
|
|
+ ],
|
|
|
total: 0,
|
|
|
packNewList: [],
|
|
|
- videoList: [], // 视频列表
|
|
|
- };
|
|
|
+ videoList: [] // 视频列表
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- tohandle(code) {
|
|
|
- console.log(code);
|
|
|
+ handleInvalidQuery() {
|
|
|
+
|
|
|
},
|
|
|
toVideoDetail(id, chapter_id, childrenId, section_aliId, aliIdType) {
|
|
|
this.$router.push({
|
|
|
- path: "/video_course/detail",
|
|
|
- query: {
|
|
|
+ path: '/video_course/detail', query: {
|
|
|
packId: id,
|
|
|
chapter_id: chapter_id,
|
|
|
childrenId: childrenId,
|
|
|
section_aliId,
|
|
|
aliIdType: aliIdType
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
- searchVideo() {
|
|
|
- this.getVideoList();
|
|
|
- },
|
|
|
- // 获取视频课程大类
|
|
|
- getVideoType() {
|
|
|
- videoType().then((res) => {
|
|
|
- this.videoType = res.rows;
|
|
|
- if (res.rows.length > 0) {
|
|
|
- this.toggleType(res.rows[0].code);
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
- // 切换大类获取科目
|
|
|
- toggleType(params) {
|
|
|
- this.typeActive = params;
|
|
|
- this.form.subject = params;
|
|
|
- let { subject } = this.form;
|
|
|
- // 获取科目
|
|
|
- videoSubjects({ subject }).then((res) => {
|
|
|
- this.subjects = res.rows;
|
|
|
- if (res.rows.length > 0) {
|
|
|
- this.form.course = res.rows[0].code;
|
|
|
- }
|
|
|
- // 获取年级
|
|
|
- this.getGrade();
|
|
|
- });
|
|
|
+ handleQuery() {
|
|
|
+ this.getVideoList()
|
|
|
},
|
|
|
- // 获取年级
|
|
|
- getGrade() {
|
|
|
- let { subject, course } = this.form;
|
|
|
- videoGrades({ subject, course }).then((res) => {
|
|
|
- console.log(JSON.stringify(res.rows));
|
|
|
- this.grade = res.rows;
|
|
|
- if (res.rows.length > 0) {
|
|
|
- this.form.grade = res.rows[0].code;
|
|
|
- }
|
|
|
- this.getVersion();
|
|
|
- });
|
|
|
- },
|
|
|
- // 获取版本
|
|
|
- getVersion() {
|
|
|
- let { subject, course, grade } = this.form;
|
|
|
- videoVersions({ subject, course, grade }).then((res) => {
|
|
|
- let resArr = res.rows.filter((item) => {
|
|
|
- return item != null;
|
|
|
- });
|
|
|
- if (resArr.length > 0) {
|
|
|
- this.version = resArr;
|
|
|
- this.form.version = this.version[0].code;
|
|
|
- this.getPack();
|
|
|
- } else {
|
|
|
- this.version = []
|
|
|
- this.form.version = ''
|
|
|
- this.videoList = []
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 获取包分类
|
|
|
- getPack() {
|
|
|
- packList(this.form).then((res) => {
|
|
|
- if (res.rows.length > 0) {
|
|
|
- this.form.pack = res.rows[0].value;
|
|
|
- this.packList = res.rows;
|
|
|
- this.getVideoList();
|
|
|
- } else {
|
|
|
- this.packList = []
|
|
|
- this.form.pack = ''
|
|
|
- this.videoList = []
|
|
|
- }
|
|
|
- });
|
|
|
+ searchVideo() {
|
|
|
+ this.getVideoList()
|
|
|
},
|
|
|
// 获取视频列表
|
|
|
getVideoList() {
|
|
|
- videoList(this.form).then((res) => {
|
|
|
- console.log(res);
|
|
|
- this.total = res.total;
|
|
|
- this.videoList = res.rows;
|
|
|
- });
|
|
|
- },
|
|
|
- togglePack(pack) {
|
|
|
- this.form.pack = pack;
|
|
|
- this.getVideoList();
|
|
|
- },
|
|
|
- toggleCondition(code) {
|
|
|
- this.form.version = code;
|
|
|
- this.getPack();
|
|
|
+ videoList({
|
|
|
+ course: this.queryParams.videoCourse, // 科目
|
|
|
+ subject: this.queryParams.videoType, // 大类
|
|
|
+ grade: this.queryParams.videoGrade, // 年级
|
|
|
+ version: this.queryParams.videoVersion, // 版本
|
|
|
+ pack: this.queryParams.videoPack,
|
|
|
+ ...this.pageForm,
|
|
|
+ sectionName: this.sectionName
|
|
|
+ }).then((res) => {
|
|
|
+ this.total = res.total
|
|
|
+ this.videoList = res.rows
|
|
|
+ })
|
|
|
}
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getVideoType();
|
|
|
- },
|
|
|
-};
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
.el-card {
|
|
@@ -265,9 +127,11 @@ export default {
|
|
|
.video_contianer {
|
|
|
padding: 20px;
|
|
|
}
|
|
|
+
|
|
|
.spans {
|
|
|
margin-left: 10px;
|
|
|
}
|
|
|
+
|
|
|
.spans > span {
|
|
|
height: 100%;
|
|
|
display: inline-block;
|
|
@@ -279,28 +143,35 @@ export default {
|
|
|
margin-right: 8px;
|
|
|
border: 1px solid #eee;
|
|
|
}
|
|
|
+
|
|
|
.active_text {
|
|
|
background: #47c6a2;
|
|
|
color: white;
|
|
|
}
|
|
|
+
|
|
|
.search_btn {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
align-items: center;
|
|
|
}
|
|
|
+
|
|
|
.search_btn input {
|
|
|
border: 0;
|
|
|
height: 100%;
|
|
|
}
|
|
|
+
|
|
|
.search_btn input:focus {
|
|
|
outline: 0;
|
|
|
}
|
|
|
+
|
|
|
.search_btn img {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+
|
|
|
.radio_contianer {
|
|
|
margin-top: 24px;
|
|
|
}
|
|
|
+
|
|
|
.radio_contianer span {
|
|
|
font-size: 14px;
|
|
|
font-family: PingFangSC-Regular, PingFang SC;
|
|
@@ -310,9 +181,11 @@ export default {
|
|
|
height: 20px;
|
|
|
margin-right: 16px;
|
|
|
}
|
|
|
+
|
|
|
.radio_contianer .el-radio-button {
|
|
|
margin-right: 8px;
|
|
|
}
|
|
|
+
|
|
|
.video_content p {
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
@@ -325,27 +198,33 @@ export default {
|
|
|
line-height: 20px;
|
|
|
margin-top: 11px;
|
|
|
}
|
|
|
+
|
|
|
.video_item > img {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+
|
|
|
.video_content .el-col {
|
|
|
margin-bottom: 42px;
|
|
|
}
|
|
|
+
|
|
|
.video_item > img {
|
|
|
width: 100%;
|
|
|
padding-right: 22px;
|
|
|
}
|
|
|
</style>
|
|
|
-<style >
|
|
|
+<style>
|
|
|
.radio_contianer .el-radio-button__inner {
|
|
|
border-left: 1px solid #dcdfe6;
|
|
|
}
|
|
|
+
|
|
|
.radio_contianer .el-radio-button:first-child:last-child .el-radio-button__inner {
|
|
|
border-radius: 16px;
|
|
|
}
|
|
|
+
|
|
|
.radio_contianer .el-radio-button .el-radio-button__inner {
|
|
|
border-radius: 16px;
|
|
|
}
|
|
|
+
|
|
|
.split_page .el-pager > li {
|
|
|
border-radius: 50%;
|
|
|
}
|