ソースを参照

新增批量上架,批量下架功能

wyling007 3 年 前
コミット
96f6b9e4f5

+ 26 - 10
src/api/stortVideo/index.js

@@ -8,8 +8,8 @@ class ShortVideoApi {
       method: 'get',
       params: {
         status: 0,
-        ...query
-      }
+        ...query,
+      },
     })
   }
 
@@ -17,7 +17,7 @@ class ShortVideoApi {
   getVideoInfo(Id) {
     return request({
       url: 'pc/teachingDsp/dsp/' + Id,
-      method: 'get'
+      method: 'get',
     })
   }
 
@@ -26,7 +26,7 @@ class ShortVideoApi {
     return request({
       url: 'pc/teachingDsp/dsp',
       method: 'post',
-      data: data
+      data: data,
     })
   }
 
@@ -35,7 +35,7 @@ class ShortVideoApi {
     return request({
       url: 'pc/teachingDsp/dsp',
       method: 'put',
-      data: data
+      data: data,
     })
   }
 
@@ -43,7 +43,7 @@ class ShortVideoApi {
   delVideo(ids) {
     return request({
       url: 'pc/teachingDsp/dsp/' + ids,
-      method: 'put'
+      method: 'put',
     })
   }
 
@@ -53,11 +53,11 @@ class ShortVideoApi {
       url: 'pc/teachingDsp/dsp/coverUp',
       method: 'put',
       headers: {
-        'content-type': 'multipart/form-data'
+        'content-type': 'multipart/form-data',
       },
       data,
       onUploadProgress: fn,
-      timeout: 0
+      timeout: 0,
     })
   }
 
@@ -66,15 +66,31 @@ class ShortVideoApi {
     if (shelfStatus != 0) {
       return request({
         url: 'pc/teachingDsp/dsp/offShelf/' + id,
-        method: 'put'
+        method: 'put',
       })
     } else {
       return request({
         url: 'pc/teachingDsp/dsp/putShelf/' + id,
-        method: 'put'
+        method: 'put',
       })
     }
   }
+
+  /**下架短视频 */
+  offShelf(ids) {
+    return request({
+      url: 'pc/teachingDsp/dsp/offShelf/' + ids,
+      method: 'put',
+    })
+  }
+
+  /**上架短视频 */
+  putShelf(ids) {
+    return request({
+      url: 'pc/teachingDsp/dsp/putShelf/' + ids,
+      method: 'put',
+    })
+  }
 }
 
 export default new ShortVideoApi()

+ 26 - 10
src/api/teachingVideo/index.js

@@ -8,8 +8,8 @@ export function listUser(query) {
     method: 'get',
     params: {
       status: 0,
-      ...query
-    }
+      ...query,
+    },
   })
 }
 
@@ -17,7 +17,7 @@ export function listUser(query) {
 export function getUser(userId) {
   return request({
     url: 'pc/teachingVideo/info/' + userId,
-    method: 'get'
+    method: 'get',
   })
 }
 
@@ -26,7 +26,7 @@ export function addUser(data) {
   return request({
     url: 'pc/teachingVideo/info',
     method: 'post',
-    data: data
+    data: data,
   })
 }
 
@@ -35,7 +35,7 @@ export function updateUser(data) {
   return request({
     url: 'pc/teachingVideo/info',
     method: 'put',
-    data: data
+    data: data,
   })
 }
 
@@ -43,7 +43,7 @@ export function updateUser(data) {
 export function delVideo(userId) {
   return request({
     url: 'pc/teachingVideo/info/' + userId,
-    method: 'put'
+    method: 'put',
   })
 }
 
@@ -53,11 +53,11 @@ export function uploadCover(data, fn) {
     url: 'pc/teachingVideo/info/coverUp',
     method: 'put',
     headers: {
-      'content-type': 'multipart/form-data'
+      'content-type': 'multipart/form-data',
     },
     data,
     onUploadProgress: fn,
-    timeout: 0
+    timeout: 0,
   })
 }
 
@@ -65,12 +65,28 @@ export function changeUserStatus(id, shelfStatus) {
   if (shelfStatus != 0) {
     return request({
       url: 'pc/teachingVideo/info/offShelf/' + id,
-      method: 'put'
+      method: 'put',
     })
   } else {
     return request({
       url: 'pc/teachingVideo/info/putShelf/' + id,
-      method: 'put'
+      method: 'put',
     })
   }
 }
+
+/**下架短视频 */
+export function offShelf(ids) {
+  return request({
+    url: 'pc/teachingVideo/info/offShelf/' + ids,
+    method: 'put',
+  })
+}
+
+/**上架短视频 */
+export function putShelf(ids) {
+  return request({
+    url: 'pc/teachingVideo/info/putShelf/' + ids,
+    method: 'put',
+  })
+}

+ 52 - 20
src/views/shortVideo/index.vue

@@ -44,6 +44,12 @@
               >删除</el-button
             >
           </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" size="mini" :disabled="multiple" @click="putShelf" v-hasPermi="['system:role:remove']">批量上架</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" size="mini" :disabled="multiple" @click="offShelf" v-hasPermi="['system:role:remove']">批量下架</el-button>
+          </el-col>
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
@@ -218,25 +224,25 @@ export default {
       form: {},
       defaultProps: {
         children: 'children',
-        label: 'typeName'
+        label: 'typeName',
       },
       // 查询参数
       queryParams: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 表单校验
       rules: {
-        userName: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }]
-      }
+        userName: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }],
+      },
     }
   },
   async created() {
     this.tcVod = new TcVod({
-      getSignature: vodSignature
+      getSignature: vodSignature,
     })
     this.getList()
-    this.getDicts('sys_normal_disable').then(response => {
+    this.getDicts('sys_normal_disable').then((response) => {
       this.statusOptions = response.data
     })
   },
@@ -262,12 +268,12 @@ export default {
       }
       this.videoPercentage = 0
       const uploader = this.tcVod.upload({
-        mediaFile: this.mediaFile // 媒体文件(视频或音频或图片),类型为 File
+        mediaFile: this.mediaFile, // 媒体文件(视频或音频或图片),类型为 File
       })
-      uploader.on('media_progress', info => {
+      uploader.on('media_progress', (info) => {
         this.videoPercentage = Math.floor(info.percent * 100 * 100) / 100
       })
-      uploader.done().then(doneResult => {
+      uploader.done().then((doneResult) => {
         this.$set(this.form, 'vodVideoFileId', doneResult.fileId)
       })
     },
@@ -282,7 +288,7 @@ export default {
       let formData = new FormData()
       formData.append('coverFile', this.coverFile)
       formData.append('fileId', this.form.vodVideoFileId)
-      const { data } = await shortVideoApi.uploadCover(formData, e => {
+      const { data } = await shortVideoApi.uploadCover(formData, (e) => {
         this.imagePercentage = Math.floor((e.loaded / e.total) * 100 * 100) / 100
       })
       this.$set(this.form, 'coverFileId', data.fileId)
@@ -294,7 +300,7 @@ export default {
         await this.$confirm(`确认要 ${text} ${row.title}吗?`, '警告', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
-          type: 'warning'
+          type: 'warning',
         })
         await shortVideoApi.changeUserStatus(row.id, row.shelfStatus)
       } catch (error) {
@@ -327,7 +333,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
+      this.ids = selection.map((item) => item.id)
       this.single = selection.length != 1
       this.multiple = !selection.length
     },
@@ -347,7 +353,7 @@ export default {
     },
     /** 提交按钮 */
     async submitForm() {
-      this.$refs['form'].validate(valid => {
+      this.$refs['form'].validate((valid) => {
         if (valid) {
           if (this.form.id != undefined) {
             const data = {
@@ -356,9 +362,9 @@ export default {
               sort: this.form.sort,
               videoDescribe: this.form.videoDescribe,
               videoFileId: this.form.vodVideoFileId,
-              coverFileId: this.form.coverFileId
+              coverFileId: this.form.coverFileId,
             }
-            shortVideoApi.updateVideo(data).then(response => {
+            shortVideoApi.updateVideo(data).then((response) => {
               this.msgSuccess('修改成功')
               this.open = false
               this.getList()
@@ -370,9 +376,9 @@ export default {
               title: this.form.title,
               videoDescribe: this.form.videoDescribe,
               videoFileId: this.form.vodVideoFileId,
-              coverFileId: this.form.coverFileId
+              coverFileId: this.form.coverFileId,
             }
-            shortVideoApi.addVideo(data).then(response => {
+            shortVideoApi.addVideo(data).then((response) => {
               this.msgSuccess('新增成功')
               this.open = false
               this.getList()
@@ -388,13 +394,39 @@ export default {
         await this.$confirm(`是否删除ID为${ids}的短视频`, '警告', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
-          type: 'warning'
+          type: 'warning',
         })
         await shortVideoApi.delVideo(ids)
         this.getList()
       } catch (error) {}
-    }
-  }
+    },
+    /**批量下架 */
+    async offShelf() {
+      try {
+        const ids = this.ids
+        await this.$confirm(`是否下架ID为${ids}的短视频`, '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+        await shortVideoApi.offShelf(ids)
+        this.getList()
+      } catch (error) {}
+    },
+    /**批量上架 */
+    async putShelf() {
+      try {
+        const ids = this.ids
+        await this.$confirm(`是否上架ID为${ids}的短视频`, '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+        await shortVideoApi.putShelf(ids)
+        this.getList()
+      } catch (error) {}
+    },
+  },
 }
 </script>
 

+ 63 - 35
src/views/teachingVideo/info/index.vue

@@ -58,18 +58,20 @@
               >新增</el-button
             >
           </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" size="mini" :disabled="multiple" @click="putShelf" v-hasPermi="['system:role:remove']">批量上架</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" size="mini" :disabled="multiple" @click="offShelf" v-hasPermi="['system:role:remove']">批量下架</el-button>
+          </el-col>
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
         <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
+          <el-table-column type="selection" width="55" align="center" />
           <el-table-column label="视频id" align="center" prop="id" />
           <el-table-column label="视频标题" align="center" prop="title" />
           <el-table-column label="视频描述" align="center" prop="videoDescribe" />
-          <!-- <el-table-column label="视频预览" align="center" width="300px">
-            <template slot-scope="scope">
-              <video :src="scope.row.fileUrl" class="videoPreview" :poster="scope.row.coverFileUrl" controls preload="meta"></video>
-            </template>
-          </el-table-column> -->
           <el-table-column label="视频封面" align="center" width="200px">
             <template slot-scope="scope">
               <div>
@@ -187,7 +189,7 @@
 </template>
 
 <script>
-import { listUser, getUser, delVideo, addUser, updateUser, changeUserStatus, uploadCover } from '@/api/teachingVideo/index'
+import { listUser, getUser, delVideo, addUser, updateUser, changeUserStatus, uploadCover, offShelf, putShelf } from '@/api/teachingVideo/index'
 import { treeselect } from '@/api/videoType'
 import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@@ -237,39 +239,38 @@ export default {
       form: {},
       defaultProps: {
         children: 'children',
-        label: 'typeName'
+        label: 'typeName',
       },
       // 查询参数
       queryParams: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       // 表单校验
       rules: {
-        userName: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }]
-      }
+        userName: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }],
+      },
     }
   },
   watch: {
     // 根据名称筛选部门树
     deptName(val) {
       this.$refs.tree.filter(val)
-    }
+    },
   },
   async created() {
     this.tcVod = new TcVod({
-      getSignature: vodSignature
+      getSignature: vodSignature,
     })
     this.getList()
     this.getTreeselect()
-    this.getDicts('sys_normal_disable').then(response => {
+    this.getDicts('sys_normal_disable').then((response) => {
       this.statusOptions = response.data
     })
   },
   methods: {
-    videoPreview(videoSrc) {
-      VideoPreview(videoSrc)
-    },
+    /**视频预览 */
+    videoPreview: VideoPreview,
     //上传视频
     fileUpload(e) {
       this.mediaFile = e.target.files[0]
@@ -279,12 +280,12 @@ export default {
       }
       this.videoPercentage = 0
       const uploader = this.tcVod.upload({
-        mediaFile: this.mediaFile // 媒体文件(视频或音频或图片),类型为 File
+        mediaFile: this.mediaFile, // 媒体文件(视频或音频或图片),类型为 File
       })
-      uploader.on('media_progress', info => {
+      uploader.on('media_progress', (info) => {
         this.videoPercentage = Math.floor(info.percent * 100 * 100) / 100
       })
-      uploader.done().then(doneResult => {
+      uploader.done().then((doneResult) => {
         this.$set(this.form, 'vodVideoFileId', doneResult.fileId)
       })
     },
@@ -299,7 +300,7 @@ export default {
       let formData = new FormData()
       formData.append('coverFile', this.coverFile)
       formData.append('fileId', this.form.vodVideoFileId)
-      let { data } = await uploadCover(formData, e => {
+      let { data } = await uploadCover(formData, (e) => {
         this.imagePercentage = Math.floor((e.loaded / e.total) * 100 * 100) / 100
       })
       this.$set(this.form, 'coverFileId', data.fileId)
@@ -307,7 +308,7 @@ export default {
     /** 查询用户列表 */
     getList() {
       this.loading = true
-      listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+      listUser(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
         this.userList = response.rows
         this.total = response.total
         this.loading = false
@@ -315,7 +316,7 @@ export default {
     },
     /** 查询部门下拉树结构 */
     getTreeselect() {
-      treeselect().then(response => {
+      treeselect().then((response) => {
         this.deptOptions = response.data
       })
     },
@@ -337,7 +338,7 @@ export default {
       this.$confirm('确认要"' + text + '""' + row.title + '"视频吗?', '警告', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
-        type: 'warning'
+        type: 'warning',
       })
         .then(() => {
           return changeUserStatus(row.id, row.shelfStatus)
@@ -376,7 +377,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.userId)
+      this.ids = selection.map((item) => item.id)
       this.single = selection.length != 1
       this.multiple = !selection.length
     },
@@ -392,14 +393,14 @@ export default {
       this.reset()
       this.getTreeselect()
       const userId = row.id || this.ids
-      getUser(userId).then(response => {
+      getUser(userId).then((response) => {
         this.form = response.data
         this.open = true
         this.title = '修改视频信息'
       })
     },
     /**校验form */
-    validate: function(form) {
+    validate: function (form) {
       console.log(form)
       if (!form.title) {
         this.msgError('标题必填')
@@ -416,7 +417,7 @@ export default {
       return true
     },
     /** 提交按钮 */
-    submitForm: function() {
+    submitForm: function () {
       if (this.form.id != undefined) {
         let data = {
           teachingVideoTypeId: this.form.teachingVideoTypeId,
@@ -425,9 +426,9 @@ export default {
           sort: this.form.sort,
           videoDescribe: this.form.videoDescribe,
           videoFileId: this.form.vodVideoFileId,
-          coverFileId: this.form.coverFileId
+          coverFileId: this.form.coverFileId,
         }
-        updateUser(data).then(response => {
+        updateUser(data).then((response) => {
           this.msgSuccess('修改成功')
           this.open = false
           this.getList()
@@ -440,9 +441,9 @@ export default {
           sort: this.form.sort,
           videoDescribe: this.form.videoDescribe,
           videoFileId: this.form.vodVideoFileId,
-          coverFileId: this.form.coverFileId
+          coverFileId: this.form.coverFileId,
         }
-        addUser(data).then(response => {
+        addUser(data).then((response) => {
           this.msgSuccess('新增成功')
           this.open = false
           this.getList()
@@ -456,9 +457,9 @@ export default {
       this.$confirm('是否确认删除id为"' + userIds + '"的数据项?', '警告', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
-        type: 'warning'
+        type: 'warning',
       })
-        .then(function() {
+        .then(function () {
           console.log('确定')
           return delVideo(userIds)
         })
@@ -466,8 +467,35 @@ export default {
           this.getList()
           this.msgSuccess('删除成功')
         })
-    }
-  }
+    },
+    /**批量下架 */
+    async offShelf() {
+      try {
+        const ids = this.ids
+        await this.$confirm(`是否下架ID为${ids}的短视频`, '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+        await offShelf(ids)
+        this.getList()
+      } catch (error) {}
+    },
+    /**批量上架 */
+    async putShelf() {
+      try {
+        const ids = this.ids
+        console.log(ids)
+        await this.$confirm(`是否上架ID为${ids}的短视频`, '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        })
+        await putShelf(ids)
+        this.getList()
+      } catch (error) {}
+    },
+  },
 }
 </script>
 

+ 0 - 92
src/views/teachingVideo/profile/index.vue

@@ -1,92 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-row :gutter="20">
-      <el-col :span="6" :xs="24">
-        <el-card class="box-card">
-          <div slot="header" class="clearfix">
-            <span>个人信息</span>
-          </div>
-          <div>
-            <div class="text-center">
-              <userAvatar :user="user" />
-            </div>
-            <ul class="list-group list-group-striped">
-              <li class="list-group-item">
-                <svg-icon icon-class="user" />用户名称
-                <div class="pull-right">{{ user.userName }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="phone" />手机号码
-                <div class="pull-right">{{ user.phonenumber }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="email" />用户邮箱
-                <div class="pull-right">{{ user.email }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="tree" />所属部门
-                <div class="pull-right" v-if="user.dept">{{ user.dept.deptName }} / {{ postGroup }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="peoples" />所属角色
-                <div class="pull-right">{{ roleGroup }}</div>
-              </li>
-              <li class="list-group-item">
-                <svg-icon icon-class="date" />创建日期
-                <div class="pull-right">{{ user.createTime }}</div>
-              </li>
-            </ul>
-          </div>
-        </el-card>
-      </el-col>
-      <el-col :span="18" :xs="24">
-        <el-card>
-          <div slot="header" class="clearfix">
-            <span>基本资料</span>
-          </div>
-          <el-tabs v-model="activeTab">
-            <el-tab-pane label="基本资料" name="userinfo">
-              <userInfo :user="user" />
-            </el-tab-pane>
-            <el-tab-pane label="修改密码" name="resetPwd">
-              <resetPwd :user="user" />
-            </el-tab-pane>
-          </el-tabs>
-        </el-card>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import userAvatar from "./userAvatar";
-import userInfo from "./userInfo";
-import resetPwd from "./resetPwd";
-import { getUserProfile } from "@/api/system/user";
-
-export default {
-  name: "Profile",
-  components: { userAvatar, userInfo, resetPwd },
-  data() {
-    return {
-      user: {},
-      roleGroup: {},
-      postGroup: {},
-      activeTab: "userinfo"
-    };
-  },
-  created() {
-    this.getUser();
-  },
-  methods: {
-    getUser() {
-      getUserProfile().then(response => {
-        var data = response.data;
-        this.user = data.user;
-        this.roleGroup = data.roleGroup;
-        this.postGroup = data.postGroup;
-      });
-    }
-  }
-};
-</script>

+ 0 - 72
src/views/teachingVideo/profile/resetPwd.vue

@@ -1,72 +0,0 @@
-<template>
-  <el-form ref="form" :model="user" :rules="rules" label-width="80px">
-    <el-form-item label="旧密码" prop="oldPassword">
-      <el-input v-model="user.oldPassword" placeholder="请输入旧密码" type="password" />
-    </el-form-item>
-    <el-form-item label="新密码" prop="newPassword">
-      <el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" />
-    </el-form-item>
-    <el-form-item label="确认密码" prop="confirmPassword">
-      <el-input v-model="user.confirmPassword" placeholder="请确认密码" type="password" />
-    </el-form-item>
-    <el-form-item>
-      <el-button type="primary" size="mini" @click="submit">保存</el-button>
-      <el-button type="danger" size="mini" @click="close">关闭</el-button>
-    </el-form-item>
-  </el-form>
-</template>
-
-<script>
-import { updateUserPwd } from "@/api/system/user";
-
-export default {
-  data() {
-    const equalToPassword = (rule, value, callback) => {
-      if (this.user.newPassword !== value) {
-        callback(new Error("两次输入的密码不一致"));
-      } else {
-        callback();
-      }
-    };
-    return {
-      test: "1test",
-      user: {
-        oldPassword: undefined,
-        newPassword: undefined,
-        confirmPassword: undefined
-      },
-      // 表单校验
-      rules: {
-        oldPassword: [
-          { required: true, message: "旧密码不能为空", trigger: "blur" }
-        ],
-        newPassword: [
-          { required: true, message: "新密码不能为空", trigger: "blur" },
-          { min: 6, max: 20, message: "长度在 6 到 20 个字符", trigger: "blur" }
-        ],
-        confirmPassword: [
-          { required: true, message: "确认密码不能为空", trigger: "blur" },
-          { required: true, validator: equalToPassword, trigger: "blur" }
-        ]
-      }
-    };
-  },
-  methods: {
-    submit() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          updateUserPwd(this.user.oldPassword, this.user.newPassword).then(
-            response => {
-              this.msgSuccess("修改成功");
-            }
-          );
-        }
-      });
-    },
-    close() {
-      this.$store.dispatch("tagsView/delView", this.$route);
-      this.$router.push({ path: "/index" });
-    }
-  }
-};
-</script>

+ 0 - 142
src/views/teachingVideo/profile/userAvatar.vue

@@ -1,142 +0,0 @@
-<template>
-  <div>
-    <img v-bind:src="options.img" @click="editCropper()" title="点击上传头像" class="img-circle img-lg" />
-    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened">
-      <el-row>
-        <el-col :xs="24" :md="12" :style="{height: '350px'}">
-          <vue-cropper
-            ref="cropper"
-            :img="options.img"
-            :info="true"
-            :autoCrop="options.autoCrop"
-            :autoCropWidth="options.autoCropWidth"
-            :autoCropHeight="options.autoCropHeight"
-            :fixedBox="options.fixedBox"
-            @realTime="realTime"
-            v-if="visible"
-          />
-        </el-col>
-        <el-col :xs="24" :md="12" :style="{height: '350px'}">
-          <div class="avatar-upload-preview">
-            <img :src="previews.url" :style="previews.img" />
-          </div>
-        </el-col>
-      </el-row>
-      <br />
-      <el-row>
-        <el-col :lg="2" :md="2">
-          <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
-            <el-button size="small">
-              上传
-              <i class="el-icon-upload el-icon--right"></i>
-            </el-button>
-          </el-upload>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 2}" :md="2">
-          <el-button icon="el-icon-plus" size="small" @click="changeScale(1)"></el-button>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 1}" :md="2">
-          <el-button icon="el-icon-minus" size="small" @click="changeScale(-1)"></el-button>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 1}" :md="2">
-          <el-button icon="el-icon-refresh-left" size="small" @click="rotateLeft()"></el-button>
-        </el-col>
-        <el-col :lg="{span: 1, offset: 1}" :md="2">
-          <el-button icon="el-icon-refresh-right" size="small" @click="rotateRight()"></el-button>
-        </el-col>
-        <el-col :lg="{span: 2, offset: 6}" :md="2">
-          <el-button type="primary" size="small" @click="uploadImg()">提 交</el-button>
-        </el-col>
-      </el-row>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import store from "@/store";
-import { VueCropper } from "vue-cropper";
-import { uploadAvatar } from "@/api/system/user";
-
-export default {
-  components: { VueCropper },
-  props: {
-    user: {
-      type: Object
-    }
-  },
-  data() {
-    return {
-      // 是否显示弹出层
-      open: false,
-      // 是否显示cropper
-      visible: false,
-      // 弹出层标题
-      title: "修改头像",
-      options: {
-        img: store.getters.avatar, //裁剪图片的地址
-        autoCrop: true, // 是否默认生成截图框
-        autoCropWidth: 200, // 默认生成截图框宽度
-        autoCropHeight: 200, // 默认生成截图框高度
-        fixedBox: true // 固定截图框大小 不允许改变
-      },
-      previews: {}
-    };
-  },
-  methods: {
-    // 编辑头像
-    editCropper() {
-      this.open = true;
-    },
-    // 打开弹出层结束时的回调
-    modalOpened() {
-      this.visible = true;
-    },
-    // 覆盖默认的上传行为
-    requestUpload() {
-    },
-    // 向左旋转
-    rotateLeft() {
-      this.$refs.cropper.rotateLeft();
-    },
-    // 向右旋转
-    rotateRight() {
-      this.$refs.cropper.rotateRight();
-    },
-    // 图片缩放
-    changeScale(num) {
-      num = num || 1;
-      this.$refs.cropper.changeScale(num);
-    },
-    // 上传预处理
-    beforeUpload(file) {
-      if (file.type.indexOf("image/") == -1) {
-        this.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
-      } else {
-        const reader = new FileReader();
-        reader.readAsDataURL(file);
-        reader.onload = () => {
-          this.options.img = reader.result;
-        };
-      }
-    },
-    // 上传图片
-    uploadImg() {
-      this.$refs.cropper.getCropBlob(data => {
-        let formData = new FormData();
-        formData.append("avatarfile", data);
-        uploadAvatar(formData).then(response => {
-          this.open = false;
-          this.options.img = process.env.VUE_APP_BASE_API + response.data;
-          store.commit('SET_AVATAR', this.options.img);
-          this.msgSuccess("修改成功");
-          this.visible = false;
-        });
-      });
-    },
-    // 实时预览
-    realTime(data) {
-      this.previews = data;
-    }
-  }
-};
-</script>

+ 0 - 76
src/views/teachingVideo/profile/userInfo.vue

@@ -1,76 +0,0 @@
-<template>
-  <el-form ref="form" :model="user" :rules="rules" label-width="80px">
-    <el-form-item label="用户昵称" prop="nickName">
-      <el-input v-model="user.nickName" />
-    </el-form-item> 
-    <el-form-item label="手机号码" prop="phonenumber">
-      <el-input v-model="user.phonenumber" maxlength="11" />
-    </el-form-item>
-    <el-form-item label="邮箱" prop="email">
-      <el-input v-model="user.email" maxlength="50" />
-    </el-form-item>
-    <el-form-item label="性别">
-      <el-radio-group v-model="user.sex">
-        <el-radio label="0">男</el-radio>
-        <el-radio label="1">女</el-radio>
-      </el-radio-group>
-    </el-form-item>
-    <el-form-item>
-      <el-button type="primary" size="mini" @click="submit">保存</el-button>
-      <el-button type="danger" size="mini" @click="close">关闭</el-button>
-    </el-form-item>
-  </el-form>
-</template>
-
-<script>
-import { updateUserProfile } from "@/api/system/user";
-
-export default {
-  props: {
-    user: {
-      type: Object
-    }
-  },
-  data() {
-    return {
-      // 表单校验
-      rules: {
-        nickName: [
-          { required: true, message: "用户昵称不能为空", trigger: "blur" }
-        ],
-        email: [
-          { required: true, message: "邮箱地址不能为空", trigger: "blur" },
-          {
-            type: "email",
-            message: "'请输入正确的邮箱地址",
-            trigger: ["blur", "change"]
-          }
-        ],
-        phonenumber: [
-          { required: true, message: "手机号码不能为空", trigger: "blur" },
-          {
-            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
-            message: "请输入正确的手机号码",
-            trigger: "blur"
-          }
-        ]
-      }
-    };
-  },
-  methods: {
-    submit() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          updateUserProfile(this.user).then(response => {
-            this.msgSuccess("修改成功");
-          });
-        }
-      });
-    },
-    close() {
-      this.$store.dispatch("tagsView/delView", this.$route);
-      this.$router.push({ path: "/index" });
-    }
-  }
-};
-</script>

+ 50 - 55
vue.config.js

@@ -17,7 +17,7 @@ module.exports = {
   // 部署生产环境和开发环境下的URL。
   // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
   // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
-  publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
+  publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
   // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
   outputDir: 'dist',
   // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
@@ -34,32 +34,29 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://192.168.8.213:8080/zzjs-admin/`,
+        target: `http://218.85.55.253:65535/zzjs-admin/`,
         changeOrigin: true,
         pathRewrite: {
-          ['^' + process.env.VUE_APP_BASE_API]: ''
-        }
-      }
+          ['^' + process.env.VUE_APP_BASE_API]: '',
+        },
+      },
     },
-    disableHostCheck: true
+    disableHostCheck: true,
   },
   configureWebpack: {
     name: name,
     resolve: {
       alias: {
-        '@': resolve('src')
-      }
-    }
+        '@': resolve('src'),
+      },
+    },
   },
   chainWebpack(config) {
     config.plugins.delete('preload') // TODO: need test
     config.plugins.delete('prefetch') // TODO: need test
 
     // set svg-sprite-loader
-    config.module
-      .rule('svg')
-      .exclude.add(resolve('src/assets/icons'))
-      .end()
+    config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end()
     config.module
       .rule('icons')
       .test(/\.svg$/)
@@ -68,51 +65,49 @@ module.exports = {
       .use('svg-sprite-loader')
       .loader('svg-sprite-loader')
       .options({
-        symbolId: 'icon-[name]'
+        symbolId: 'icon-[name]',
       })
       .end()
 
-    config
-      .when(process.env.NODE_ENV !== 'development',
-        config => {
-          config
-            .plugin('ScriptExtHtmlWebpackPlugin')
-            .after('html')
-            .use('script-ext-html-webpack-plugin', [{
-            // `runtime` must same as runtimeChunk name. default is `runtime`
-              inline: /runtime\..*\.js$/
-            }])
-            .end()
-          config
-            .optimization.splitChunks({
-              chunks: 'all',
-              cacheGroups: {
-                libs: {
-                  name: 'chunk-libs',
-                  test: /[\\/]node_modules[\\/]/,
-                  priority: 10,
-                  chunks: 'initial' // only package third parties that are initially dependent
-                },
-                elementUI: {
-                  name: 'chunk-elementUI', // split elementUI into a single package
-                  priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
-                  test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
-                },
-                commons: {
-                  name: 'chunk-commons',
-                  test: resolve('src/components'), // can customize your rules
-                  minChunks: 3, //  minimum common number
-                  priority: 5,
-                  reuseExistingChunk: true
-                }
-              }
-            })
-          config.optimization.runtimeChunk('single'),
+    config.when(process.env.NODE_ENV !== 'development', (config) => {
+      config
+        .plugin('ScriptExtHtmlWebpackPlugin')
+        .after('html')
+        .use('script-ext-html-webpack-plugin', [
           {
-             from: path.resolve(__dirname, './public/robots.txt'),//防爬虫文件
-             to:'./',//到根目录下
-          }
+            // `runtime` must same as runtimeChunk name. default is `runtime`
+            inline: /runtime\..*\.js$/,
+          },
+        ])
+        .end()
+      config.optimization.splitChunks({
+        chunks: 'all',
+        cacheGroups: {
+          libs: {
+            name: 'chunk-libs',
+            test: /[\\/]node_modules[\\/]/,
+            priority: 10,
+            chunks: 'initial', // only package third parties that are initially dependent
+          },
+          elementUI: {
+            name: 'chunk-elementUI', // split elementUI into a single package
+            priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
+            test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
+          },
+          commons: {
+            name: 'chunk-commons',
+            test: resolve('src/components'), // can customize your rules
+            minChunks: 3, //  minimum common number
+            priority: 5,
+            reuseExistingChunk: true,
+          },
+        },
+      })
+      config.optimization.runtimeChunk('single'),
+        {
+          from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
+          to: './', //到根目录下
         }
-      )
-  }
+    })
+  },
 }