Просмотр исходного кода

Merge branch 'bencao' of ssh://gogs.hanyiyun.com:2222/xmnk/party into bencao

xvying 1 год назад
Родитель
Сommit
db06b780f3

+ 23 - 1
src/router/index.js

@@ -334,11 +334,33 @@ export const asyncRoutes = [
         name: "videoIndex",
         component: () => import("@/views/video/index"),
         meta: {
-          title: "视频列表",
+          title: "课程列表",
           icon: "admin",
           roles: ["Super admin", "Admin"],
         },
       },
+      {
+        path: "video",
+        name: "video",
+        component: () => import("@/views/video/video"),
+        meta: {
+          title: "视频列表",
+          icon: "message",
+          hidden: false,
+          roles: ["Super admin", "Admin", "Student"],
+        },
+      },
+      {
+        path: "chapter",
+        name: "chapter",
+        component: () => import("@/views/video/chapter"),
+        meta: {
+          title: "章节管理",
+          icon: "message",
+          hidden: false,
+          roles: ["Super admin", "Admin", "Student"],
+        },
+      },
     ],
     // Super admin
   },

+ 40 - 0
src/views/video/api/chapter.js

@@ -0,0 +1,40 @@
+/*
+ * @Description:
+ * @version:
+ * @Author: King
+ * @Date: 2022-02-14 14:46:14
+ * @LastEditors: king
+ * @LastEditTime: 2023-03-24 17:01:56
+ */
+import request from '@/utils/request'
+//章节模块接口--------------------------------------------------------------
+export function chapterList(params) {
+  return request({
+    url: '/course/chapters',
+    method: 'get',
+    params,
+  })
+}
+// 章节添加 ?????????
+export function chapterAdd(data) {
+  return request({
+    url: '/course/' + data.course_id + '/chapter',
+    method: 'post',
+    data,
+  })
+}
+//章节修改 -->此处data需要穿一个id
+export function chapterEdit(data) {
+  return request({
+    url: '/course/chapter/' + data.id,
+    method: 'put',
+    data,
+  })
+}
+// 章节删除 --》此处data需要穿一个id
+export function chapterDelete(data) {
+  return request({
+    url: '/course/chapter/' + data.id,
+    method: 'delete',
+  })
+}

+ 3 - 11
src/views/video/api/index.js

@@ -3,14 +3,14 @@
  * @version:
  * @Author: King
  * @Date: 2022-02-14 10:45:11
- * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-02-16 14:17:07
+ * @LastEditors: king
+ * @LastEditTime: 2023-03-24 17:02:42
  */
 import request from '@/utils/request'
 // 课程列表
 export function courseList(params) {
   return request({
-    url: '/course/info',
+    url: '/courses',
     method: 'get',
     params,
   })
@@ -46,11 +46,3 @@ export function doDelete(data) {
   })
 }
 // 分类模块接口----------------------------------------------------------
-// 课程分类tree列表
-export function doTree(params) {
-  return request({
-    url: '/course/category-tree',
-    method: 'get',
-    params,
-  })
-}

+ 46 - 0
src/views/video/api/video.js

@@ -0,0 +1,46 @@
+/*
+ * @Description:
+ * @version:
+ * @Author: King
+ * @Date: 2022-02-14 14:46:14
+ * @LastEditors: king
+ * @LastEditTime: 2023-03-24 15:35:20
+ */
+import request from '@/utils/request'
+//视频模块接口--------------------------------------------------------------
+export function videoList(params) {
+  return request({
+    url: '/course/videos',
+    method: 'get',
+    params,
+  })
+}
+// 视频添加 ?????????
+export function videoAdd(data) {
+  return request({
+    url: '/course/1/video',
+    method: 'post',
+    data,
+  })
+}
+//视频修改 -->此处data需要穿一个id
+export function videoEdit(data) {
+  return request({
+    url: '/course/video/' + data,
+    method: 'put',
+  })
+}
+//视频详情 -->此处params需要穿一个id
+export function videoDetail(params) {
+  return request({
+    url: '/course/' + params.courseId + '/video/' + params.videoId,
+    method: 'get',
+  })
+}
+// 课程删除 --》此处data需要穿一个id
+export function videoDelete(data) {
+  return request({
+    url: '/course/video/' + data.id,
+    method: 'delete',
+  })
+}

+ 292 - 0
src/views/video/chapter.vue

@@ -0,0 +1,292 @@
+<template>
+  <div class="department-management-container">
+    <vab-query-form style="display: flex;justify-content: space-between;">
+      <vab-query-form-left-panel :span="12">
+        <el-button icon="el-icon-plus" type="primary" @click="handleEdit">
+          添加
+        </el-button>
+      </vab-query-form-left-panel>
+      <vab-query-form-right-panel :span="12">
+        <el-form :inline="true" :model="queryForm" @submit.native.prevent>
+          <el-form-item>
+            <el-input
+              v-model.trim="queryForm.title"
+              clearable
+              placeholder="请输入章节名称"
+            />
+          </el-form-item>
+          <el-form-item>
+            <el-button icon="el-icon-search" type="primary" @click="queryData">
+              查询
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </vab-query-form-right-panel>
+    </vab-query-form>
+
+    <el-table
+      v-loading="listLoading"
+      border
+      :data="list"
+      default-expand-all
+      row-key="id"
+      :tree-props="{ children: 'children' }"
+    >
+      <el-table-column
+        align="center"
+        label="序号"
+        show-overflow-tooltip
+        type="index"
+        width="60"
+      />
+      <el-table-column
+        align="center"
+        label="章节名称"
+        min-width="120"
+        prop="title"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        align="center"
+        label="课程名称"
+        min-width="120"
+        prop="course.title"
+        show-overflow-tooltip
+      />
+      <!-- 章节排序 -->
+      <el-table-column
+        align="center"
+        label="排序"
+        prop="sort"
+        show-overflow-tooltip
+      >
+        <template #default="{ row }">
+          <div class="edit">
+            <i
+              v-if="editForm.id == row.id && editStatus == 1"
+              class="el-icon-circle-close"
+              @click.stop="cancelSort(row)"
+            ></i>
+            <span
+              v-if="editForm.id !== row.id || editStatus == 0"
+              class="sort-num"
+            >
+              {{ row.sort }}
+            </span>
+
+            <el-input
+              v-if="editForm.id == row.id && editStatus == 1"
+              ref="getFocus"
+              v-model="row.sort"
+              class="input-sort"
+              @input="inputSort"
+            />
+
+            <i
+              v-if="editForm.id !== row.id || editStatus == 0"
+              class="el-icon-edit"
+              @click="changeSort(row)"
+            ></i>
+            <i
+              v-if="editForm.id == row.id && editStatus == 1"
+              class="el-icon-circle-check"
+              @click.stop="sureChange"
+            ></i>
+          </div>
+        </template>
+      </el-table-column>
+      <!-- 命名需要再改 -->
+      <el-table-column
+        align="center"
+        fixed="right"
+        label="创建时间"
+        min-width="120"
+        prop="humans"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        align="center"
+        fixed="right"
+        label="操作"
+        min-width="120"
+      >
+        <template #default="{ row }">
+          <el-button type="text" @click="handleEdit(row)">
+           编辑
+          </el-button>
+          <el-button type="text" @click="handleDelete(row)">
+            删除
+          </el-button>
+        </template>
+      </el-table-column>
+      <template #empty>
+        <!-- <el-image
+          class="vab-data-empty"
+          :src="require('@/assets/empty_images/data_empty.png')"
+        /> -->
+      </template>
+    </el-table>
+    <edit ref="edit" @fetch-data="getChapterList" />
+  </div>
+</template>
+
+<script>
+  import { chapterList, chapterDelete, chapterEdit } from './api/chapter'
+  import Edit from './components/ChapterManage'
+
+  export default {
+    name: 'ChapterManage',
+    components: { Edit },
+    data() {
+      return {
+        //修改排序
+        editForm: {},
+        oldSort: 0,
+        editStatus: 0, //排序编辑状态 0为正常 1显示输入框
+        flag: false, //是否自动聚焦
+        list: [],
+        listLoading: true,
+        total: 0,
+        queryForm: {
+          title: '',
+          // courseId: '', //课程id
+        },
+        videoId: '', //视频id
+      }
+    },
+    created() {
+      let route = this.$route
+      console.log(route.query, 'route.query11111')
+      // 章节列表里边接收上个页面的参数没有什么用目前!!!!!!!!!
+      // // 课程id
+      // this.courseId = route.query.courseId
+      // // 视频id
+      // this.queryForm.videoId = route.query.videoId
+      this.queryForm.courseId = route.query.courseId
+      this.videoId = route.query.videoId
+      this.getChapterList()
+    },
+    methods: {
+      // 排序这块
+      cancelSort(row) {
+        this.editStatus = 0
+        row.sort = this.oldSort
+      },
+      //修改排序事件
+      async changeSort(row) {
+        console.log(row, '1111111111')
+        this.editStatus = 1
+        this.editForm = row
+        // 附件修改接口修改时这俩参数要求必填的
+        // this.editForm.course_id = this.queryForm.courseId
+        this.editForm.course_id = row.course.id
+        // this.editForm.path = row.path_resource.id
+        this.oldSort = row.sort
+        this.$nextTick(() => {
+          this.$refs['getFocus'].focus()
+        })
+        //await doEdit(this.editForm)
+      },
+      //修改排序
+      inputSort(e) {
+        console.log(e, '000000000')
+        this.editForm.sort = e
+      },
+      async sureChange() {
+        this.editStatus = 0
+        if (this.oldSort !== this.editForm.sort) {
+          console.log(this.editForm, '附件排序的内容')
+          const { message } = await chapterEdit(this.editForm)
+          console.log(message, 'message')
+          // location.reload()
+          this.$baseMessage(
+            message,
+            'success',
+            false,
+            'vab-hey-message-success'
+          )
+          this.getChapterList()
+        } else {
+          return
+        }
+      },
+      //跳转课程详情
+      courseVideo(row) {
+        this.$router.push({
+          path: '/course/video',
+          query: {
+            id: row.id,
+          },
+        })
+      },
+      courseDetail(row) {
+        this.$router.push({
+          path: '/course/detail',
+          query: {
+            id: row.id,
+          },
+        })
+      },
+      handleEdit(row) {
+        if (row.id) {
+          this.$refs['edit'].showEdit(row)
+        } else {
+          this.$refs['edit'].showEdit()
+        }
+      },
+      handleDelete(row) {
+        if (row.id) {
+          this.$baseConfirm('你确定要删除当前项吗', null, async () => {
+            const { message } = await chapterDelete({ id: row.id })
+            this.$baseMessage(
+              message,
+              'success',
+              false,
+              'vab-hey-message-success'
+            )
+            await this.getChapterList()
+          })
+        }
+      },
+      // handleSizeChange(val) {
+      //   this.queryForm.pageSize = val
+      //   this.getChapterList()
+      // },
+      // handleCurrentChange(val) {
+      //   this.queryForm.pageNo = val
+      //   this.getChapterList()
+      // },
+      queryData() {
+        this.getChapterList()
+      },
+      async getChapterList() {
+        this.listLoading = true
+        const { data } = await chapterList(this.queryForm)
+        console.log(data, '章节列表')
+        this.list = data.data
+        console.log(this.list, '++++++++++')
+        this.listLoading = false
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+  /* 修改排序样式 */
+  .edit {
+    display: inline-block;
+    width: 110px;
+  }
+  .input-sort {
+    display: inline-block;
+    width: 100px;
+    margin-left: 10px;
+    border: none;
+  }
+  .sort-num {
+    display: inline-block;
+    margin-left: 10px;
+  }
+  .el-icon-edit {
+    color: #1890ff;
+  }
+</style>

+ 143 - 0
src/views/video/components/ChapterManage.vue

@@ -0,0 +1,143 @@
+<template>
+  <el-dialog
+    :title="title"
+    :visible.sync="dialogFormVisible"
+    width="500px"
+    @close="close"
+  >
+    <el-form ref="form" label-width="120px" :model="form" :rules="rules">
+      <el-form-item label="章节名称" prop="title">
+        <el-input
+          v-model="form.title"
+          placeholder="请输入章节名称"
+        />
+      </el-form-item>
+      <el-form-item label="章节排序" prop="sort">
+        <el-input
+          v-model="form.sort"
+          placeholder="请输入章节排序"
+          type="number"
+        />
+      </el-form-item>
+      <!-- <el-form-item label="章节状态" prop="status">
+        <el-radio-group v-model="form.status">
+          <el-radio :label="1">正常</el-radio>
+          <el-radio :label="0">禁用</el-radio>
+        </el-radio-group>
+      </el-form-item> -->
+    </el-form>
+    <template #footer>
+      <el-button @click="close">取消</el-button>
+      <el-button v-if="title == '编辑'" type="primary" @click="save">
+        确定
+      </el-button>
+      <el-button v-if="title == '添加'" type="primary" @click="add">
+        添加暂时不要求
+      </el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+  import { chapterAdd, chapterEdit } from '../api/chapter'
+
+  export default {
+    name: 'DepartmentManagementEdit',
+    data() {
+      return {
+        form: {
+          title: '',
+          // status: 1,
+          course_id: '',
+          sort: 0,
+        },
+        rules: {
+          title: [
+            {
+              required: true,
+              trigger: 'blur',
+              message: '请输入章节名称',
+            },
+          ],
+          sort: [
+            {
+              required: true,
+              trigger: 'blur',
+              message: '请输入章节排序',
+            },
+          ],
+          // status: [
+          //   {
+          //     required: true,
+          //     trigger: 'change',
+          //     message: '请选择章节状态',
+          //   },
+          // ],
+        },
+        title: '',
+        dialogFormVisible: false,
+      }
+    },
+    created() {},
+    methods: {
+      // handleNodeClick(node) {
+      //   this.form.parent_name = node.name
+      //   this.form.parent_id = node.id
+      // },
+      showEdit(row) {
+        console.log(row, '章节列表的传过来的')
+        if (!row) {
+          this.title = '添加'
+          let route = this.$route
+          console.log(route.query, 'route.que12121ry')
+          this.form.course_id = route.query.courseId
+          console.log(this.form.course_id, 'route.que12121ry')
+        } else {
+          this.title = '编辑'
+          this.form = Object.assign({}, row)
+          this.form.course_id = row.course.id
+        }
+
+        this.dialogFormVisible = true
+      },
+      close() {
+        this.$refs['form'].resetFields()
+        // this.form = this.$options.data().form
+        this.dialogFormVisible = false
+      },
+      //编辑保存
+      save() {
+        console.log(this.form, '999999999999')
+        this.$refs['form'].validate(async (valid) => {
+          if (valid) {
+            const { message } = await chapterEdit(this.form)
+            this.$baseMessage(
+              message,
+              'success',
+              false,
+              'vab-hey-message-success'
+            )
+            this.$emit('fetch-data')
+            this.close()
+          }
+        })
+      },
+      //添加
+      add() {
+        this.$refs['form'].validate(async (valid) => {
+          if (valid) {
+            const { message } = await chapterAdd(this.form)
+            this.$baseMessage(
+              message,
+              'success',
+              false,
+              'vab-hey-message-success'
+            )
+            this.$emit('fetch-data')
+            this.close()
+          }
+        })
+      },
+    },
+  }
+</script>

+ 10 - 20
src/views/video/components/CourseManage.vue

@@ -15,7 +15,7 @@
       style="width: 80%; margin: 0 auto"
     >
       <el-form-item label="课程分类" prop="category">
-        <el-select
+        <!-- <el-select
           v-model="form.category.id"
           placeholder="请选择课程分类"
           style="width: 90%"
@@ -27,7 +27,7 @@
             style="height: auto; padding: 0 10px"
             :value="item.id"
           />
-        </el-select>
+        </el-select> -->
         <el-button style="margin-left: 10px" type="text" @click="courseSort">
           分类管理
         </el-button>
@@ -87,11 +87,12 @@
         </div>
       </el-form-item>
       <el-form-item label="课程描述" prop="description">
-        <tiny-mce
+        <!-- <tiny-mce
           :content="form.intro"
           :tiny-height="300"
           @childByValue="getTnyMac"
-        />
+        /> -->
+        <el-input type="textarea" v-model="form.description"></el-input>
       </el-form-item>
       <el-form-item label="发布时间" prop="published_at">
         <!-- <el-input v-model="form.published_at" /> -->
@@ -104,18 +105,18 @@
           value-format="yyyy-MM-dd HH:mm:ss"
         />
       </el-form-item>
-      <el-form-item label="是否推荐" prop="is_rec">
+      <!-- <el-form-item label="是否推荐" prop="is_rec">
         <el-radio-group v-model="form.is_rec">
           <el-radio :label="1">是</el-radio>
           <el-radio :label="0">否</el-radio>
         </el-radio-group>
-      </el-form-item>
-      <el-form-item label="评论" prop="comment_status">
+      </el-form-item> -->
+      <!-- <el-form-item label="评论" prop="comment_status">
         <el-radio-group v-model="form.comment_status">
           <el-radio :label="1">开启评论</el-radio>
           <el-radio :label="0">关闭评论</el-radio>
         </el-radio-group>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="课程排序" prop="sort">
         <el-input v-model="form.sort" type="number" />
       </el-form-item>
@@ -139,7 +140,7 @@
 </template>
 
 <script>
-  import { doEdit, doTree, doAdd } from '../api/index'
+  import { doEdit, doAdd } from '../api/index'
   // import { baseURL } from '@/config'
 
   export default {
@@ -217,11 +218,7 @@
         dialogFormVisible: false,
       }
     },
-    watch: {
-      $route: 'getTree',
-    },
     created() {
-      this.getTree()
       // this.action = baseURL + '/common/upload'
       this.fileList = []
     },
@@ -244,13 +241,6 @@
         console.log('上传之前')
         this.imageUrl = ''
       },
-      // 分类列表数据
-      async getTree() {
-        const { data } = await doTree()
-        console.log(data, '课程分类列表数据0000')
-        // this.treeData = this.treeData.concat(data)
-        this.treeData = data
-      },
       // handleNodeClick(node) {
       //   this.form.category_name = node.name
       //   this.form.category_id = node.id

+ 22 - 9
src/views/video/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="department-management-container">
-    <vab-query-form>
+    <vab-query-form style="display: flex;justify-content: space-between;">
       <vab-query-form-left-panel :span="12">
         <!-- 添加暂时不要求 -->
         <el-button icon="el-icon-plus" type="primary" @click="handleEdit">
@@ -83,7 +83,7 @@
         prop="video_nums"
         show-overflow-tooltip
       />
-      <el-table-column
+      <!-- <el-table-column
         align="center"
         label="是否推荐"
         min-width="80"
@@ -98,7 +98,7 @@
             普通
           </el-tag>
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <!-- 可修改排序 -->
       <!-- <el-table-column
         align="center"
@@ -174,9 +174,12 @@
           <el-button type="text" @click="courseVideo(row)">
             视频管理
           </el-button>
-          <!-- <el-button type="text" @click="handleEdit(row)">
+          <el-button type="text" @click="courseZhang(row)">
+            章节管理
+          </el-button>
+          <el-button type="text" @click="handleEdit(row)">
             编辑
-          </el-button> -->
+          </el-button>
           <el-button type="text" @click="courseDetail(row)">
             详情
           </el-button>
@@ -276,20 +279,29 @@
         }
       },
       //跳转视频列表页面
-      courseVideo(row) {
+      courseZhang(row) {
         console.log(row.id, '课程列表页跳转到视频列表页row.id就是课程id')
         this.$router.push({
-          path: '/course/video',
+          path: '/video/chapter',
           query: {
             id: row.id,
           },
         })
       },
       // 跳转到课程详情页面
+      courseVideo(row) {
+        console.log(row.id, '课程列表页跳转到课程详情页row.id就是课程id')
+        this.$router.push({
+          path: '/video/video',
+          query: {
+            id: row.id,
+          },
+        })
+      },
       courseDetail(row) {
         console.log(row.id, '课程列表页跳转到课程详情页row.id就是课程id')
         this.$router.push({
-          path: '/course/detail',
+          path: '/video/video',
           query: {
             id: row.id,
           },
@@ -337,7 +349,8 @@
         const { data } = await courseList(this.queryForm)
         console.log(data, '课程列表信息')
         const { list, meta } = data
-        this.list = list
+        console.log(list)
+        this.list = data.data
         this.total = meta.pagination.total
         this.listLoading = false
       },

+ 330 - 0
src/views/video/video.vue

@@ -0,0 +1,330 @@
+<template>
+  <div class="department-management-container">
+    <!-- <el-page-header content="视频列表" @back="goBack" /> -->
+    <vab-query-form style="display: flex;justify-content: space-between;">
+      <vab-query-form-left-panel :span="12">
+        <!-- 暂时不要求添加 -->
+        <el-button icon="el-icon-plus" type="primary" @click="handleEdit">
+          添加
+        </el-button>
+      </vab-query-form-left-panel>
+      <vab-query-form-right-panel :span="12">
+        <el-form :inline="true" :model="queryForm" @submit.native.prevent>
+          <el-form-item>
+            <el-input
+              v-model.trim="queryForm.title"
+              clearable
+              placeholder="请输入视频名称"
+              @keyup.enter.native="queryData"
+            />
+          </el-form-item>
+          <el-form-item>
+            <el-button icon="el-icon-search" type="primary" @click="queryData">
+              查询
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </vab-query-form-right-panel>
+    </vab-query-form>
+
+    <el-table
+      v-loading="listLoading"
+      border
+      :data="list"
+      default-expand-all
+      row-key="id"
+      :tree-props="{ children: 'children' }"
+    >
+      <el-table-column
+        align="center"
+        label="序号"
+        show-overflow-tooltip
+        type="index"
+        width="60"
+      />
+      <el-table-column
+        align="center"
+        label="视频名称"
+        min-width="120"
+        prop="title"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        align="center"
+        label="所属章节"
+        min-width="100"
+        prop="course_chapter.title"
+        show-overflow-tooltip
+      />
+
+      <el-table-column
+        align="center"
+        label="观看次数"
+        min-width="80"
+        prop="view_num"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        align="center"
+        label="上线时间"
+        min-width="120"
+        prop="published_at"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        align="center"
+        label="状态"
+        min-width="100"
+        prop="status"
+        show-overflow-tooltip
+      >
+        <template #default="{ row }">
+          <el-tag v-if="row.status == 1">
+            正常
+          </el-tag>
+          <el-tag v-if="row.status == 0" type="danger">
+            禁用
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column
+        align="center"
+        label="更新时间"
+        min-width="120"
+        prop="updated_at"
+        show-overflow-tooltip
+      />
+      <el-table-column
+        align="center"
+        fixed="right"
+        label="操作"
+        min-width="120"
+      >
+        <template #default="{ row }">
+          <!-- 暂时不要求编辑 -->
+          <el-button type="text" @click="handleEditVideo(row)">
+            编辑
+          </el-button>
+          <el-button type="text" @click="videoDetail(row)">
+            详情
+          </el-button>
+          <el-button type="text" @click="handleDelete(row)">
+            删除
+          </el-button>
+        </template>
+      </el-table-column>
+      <template #empty>
+        <!-- <el-image
+          class="vab-data-empty"
+          :src="require('@/assets/empty_images/data_empty.png')"
+        /> -->
+      </template>
+    </el-table>
+    <el-pagination
+      background
+      :current-page="queryForm.page"
+      :layout="layout"
+      :page-size="queryForm.per_page"
+      :page-sizes="[15, 20, 30, 40, 50, 100]"
+      :total="total"
+      @current-change="handleCurrentChange"
+      @size-change="handleSizeChange"
+    />
+  </div>
+</template>
+
+<script>
+  //  , videoEdit
+  import { videoList, videoDelete } from './api/video'
+  // import { mapActions } from 'vuex'
+  // import { handleActivePath } from '@/utils/routes'
+
+  export default {
+    name: 'CourseManage',
+    data() {
+      return {
+        //修改排序
+        editForm: '',
+        oldSort: 0,
+        editStatus: 0, //排序编辑状态 0为正常 1显示输入框
+        //
+        list: [],
+        listLoading: true,
+        layout: 'total, sizes, prev, pager, next, jumper',
+        total: 0,
+        queryForm: {
+          page: 1,
+          per_page: 15,
+          title: '',
+        },
+      }
+    },
+    watch: {
+      $route: 'getVideoList',
+    },
+    created() {
+      const route = this.$route
+      console.log(route, route.query, route.query.id, 'idididii')
+      // 接收课程页面传过来的参数--》此id是课程id
+      this.queryForm.id = route.query.id
+      this.getVideoList()
+    },
+    methods: {
+      // ...mapActions({
+      //   delVisitedRoute: 'tabs/delVisitedRoute',
+      // }),
+      //返回上一页
+      goBack() {
+        // this.delVisitedRoute(handleActivePath(this.$route, true))
+        // this.$router.push('/course/courseList')
+      },
+      //章节管理
+      chapterManage(row) {
+        console.log(row.id, this.queryForm.id, '视频跳转到章节传递的参数')
+        this.$router.push({
+          path: '/course/chapter',
+          query: {
+            // 视频id
+            videoId: row.id,
+            // 课程id
+            courseId: this.queryForm.id,
+          },
+        })
+      },
+      //附件管理
+      handleEnclosure(row) {
+        console.log(row.id, this.queryForm.id, '视频跳转到附件传递的参数')
+        this.$router.push({
+          path: '/course/enclosure',
+          query: {
+            // 视频id
+            videoId: row.id,
+            // 课程id
+            courseId: this.queryForm.id,
+          },
+        })
+      },
+      // 跳转到视频详情页面
+      videoDetail(row) {
+        console.log(row.id, '课程列表页跳转到课程详情页row.id就是课程id')
+        this.$router.push({
+          path: '/course/videoDetail',
+          query: {
+            // 视频id
+            videoId: row.id,
+            // 课程id
+            courseId: this.queryForm.id,
+          },
+        })
+      },
+      handleDelete(row) {
+        if (row.id) {
+          this.$baseConfirm('你确定要删除当前项吗', null, async () => {
+            const { message } = await videoDelete({ id: row.id })
+            this.$baseMessage(
+              message,
+              'success',
+              false,
+              'vab-hey-message-success'
+            )
+            await this.getVideoList()
+          })
+        }
+      },
+      handleSizeChange(val) {
+        this.queryForm.per_page = val
+        this.getVideoList()
+      },
+      handleCurrentChange(val) {
+        this.queryForm.page = val
+        this.getVideoList()
+      },
+      queryData() {
+        this.queryForm.page = 1
+        this.getVideoList()
+      },
+      async getVideoList() {
+        this.listLoading = true
+        const { data } = await videoList(this.queryForm)
+        console.log(data, '视频列表')
+        this.list = data.data
+        this.total = data.meta.pagination.total
+        this.listLoading = false
+      },
+      //修改排序事件
+      async changeSort(row) {
+        console.log('1111111111')
+        this.editStatus = 1
+        this.editForm = row
+        this.oldSort = row.sort
+
+        //await doEdit(this.editForm)
+      },
+      //修改排序
+      inputSort(e) {
+        console.log(e, '000000000')
+        this.editForm.sort = e
+      },
+      // async sureChange() {
+      //   this.editStatus = 0
+      //   if (this.oldSort !== this.editForm.sort) {
+      //     const { message } = await videoEdit(this.editForm)
+      //     console.log(message, 'message')
+      //     // location.reload()
+      //     this.$baseMessage(
+      //       message,
+      //       'success',
+      //       false,
+      //       'vab-hey-message-success'
+      //     )
+      //     this.getVideoList()
+      //   } else {
+      //     return
+      //   }
+      // },
+      //暂时不要求添加视频
+      handleEdit() {
+        this.$router.push({
+          path: '/course/editvideo',
+          query: {
+            courseId: this.queryForm.id,
+          },
+        })
+      },
+      //暂时不要求编辑视频
+      // handleEditVideo(row) {
+      //   console.log(row, row.id, '点击视频列表中的编辑按钮')
+      //   if (row.id != undefined) {
+      //     this.$router.push({
+      //       path: '/course/editvideo',
+      //       query: {
+      //         // course_chapter_id: row.id,
+      //         videoId: row.id,
+      //         courseId: this.queryForm.id,
+      //       },
+      //     })
+      //   }
+      // },
+    },
+  }
+</script>
+<style scoped lang="scss">
+  /* 修改排序样式 */
+  .edit {
+    display: inline-block;
+    width: 110px;
+  }
+  .input-sort {
+    display: inline-block;
+    width: 100px;
+    margin-left: 10px;
+    border: none;
+  }
+  .sort-num {
+    display: inline-block;
+    margin-left: 10px;
+  }
+  .el-icon-edit {
+    color: #1890ff;
+  }
+</style>