lushixing 1 주 전
부모
커밋
14f9829cee
3개의 변경된 파일35개의 추가작업 그리고 30개의 파일을 삭제
  1. 10 2
      src/api/musicLibraryManager.js
  2. 3 3
      src/views/music-library-manager/index.vue
  3. 22 25
      src/views/music-library-manager/musicLibraryUpdater.vue

+ 10 - 2
src/api/musicLibraryManager.js

@@ -9,9 +9,9 @@ export function fetchMusicConfigList(params) {
   })
 }
 // 删除
-export function deteleMusicConfig(data) {
+export function deleteMusicCategoryInfo(data) {
   return request({
-    url: '/musicConfig/delete',
+    url: '/musicConfig/deleteMusicCategoryInfo',
     method: 'post',
     data
   })
@@ -48,3 +48,11 @@ export function editMusicConfigInfo(data) {
     data
   })
 }
+// 删除音乐库
+export function deteleMusicConfig(data) {
+  return request({
+    url: '/musicConfig/delete',
+    method: 'post',
+    data
+  })
+}

+ 3 - 3
src/views/music-library-manager/index.vue

@@ -48,7 +48,7 @@ import waves from "@/directive/waves";
 import swPage from "@/views/common/swPage";
 import { auditStatus } from "@/constants/index";
 import { getValueByKey } from "@/utils/index";
-import { fetchMusicConfigList, deteleMusicConfig } from "@/api/musicLibraryManager";
+import { fetchMusicConfigList, deleteMusicCategoryInfo } from "@/api/musicLibraryManager";
 import permission from "@/directive/permission";
 import MusicLibraryFormModal from "./components/MusicLibraryFormModal";
 
@@ -116,13 +116,13 @@ export default {
     },
     handleDelete(row) {
       //删除
-      this.$confirm("确定要删除吗?", "提示", {
+      this.$confirm("删除类目该类目下所有音乐都会删除,确定要删除吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
         const { id } = row;
-        deteleMusicConfig([id]).then(() => {
+        deleteMusicCategoryInfo([id]).then(() => {
           this.$notify({
             title: "成功",
             message: "删除成功",

+ 22 - 25
src/views/music-library-manager/musicLibraryUpdater.vue

@@ -48,8 +48,8 @@
                   <div class="video-black__warp">
                     <div class="music--black" v-if="form.musicUrl && !videoFlag">
                       <span class="music--icon"><img src="../../assets/image/file-icon.svg" alt=""></span>
-                      <span class="music--title">{{ musicFile.title }}</span>
-                      <span class="music--size">{{ musicFile.size }}</span>
+                      <span class="music--title">{{ form.fileName }}</span>
+                      <span class="music--size">{{ form.size }}</span>
                       <el-tooltip
                         class="item"
                         effect="dark"
@@ -77,7 +77,7 @@
           </div>
         </div>
         <div class="music-library-btns">
-          <el-button type="primary" class="music-library__a" :loading="comfirmLoading" @click="handleConfirm">更新音乐库</el-button>
+          <el-button type="primary" :disabled="videoFlag" class="music-library__a" :loading="comfirmLoading" @click="handleConfirm">更新音乐库</el-button>
         </div>
       </el-form>
     </div>
@@ -87,6 +87,7 @@
 <script>
 import { api } from "@/api/api";
 import { getToken } from '@/utils/auth'
+import { addMusicConfigInfo, editMusicConfigInfo } from "@/api/musicLibraryManager";
 export default {
   name: "MusicLibraryUpdater",
   components: {
@@ -110,7 +111,9 @@ export default {
       form: {
         musicName: '',
         musicUrl: '',
-        parentId: ''
+        parentId: '',
+        fileName: '',
+        size: ''
       },
       modelType: 'add',
       dialogVisible: false,
@@ -119,10 +122,6 @@ export default {
       videoFlag: false,
       videoUploadPercent: 0,
       musicTypes: [],
-      musicFile: {
-        title: '官方剪辑.MP4',
-        size: '4.8 MB'
-      },
       rules: {
         musicName: [
           { required: true, message: "请输入音乐库名称", trigger: "blur" }
@@ -143,15 +142,13 @@ export default {
         this.form = {
           musicName: '',
           musicUrl: '',
-          parentId: ''
+          parentId: '',
+          fileName: '',
+          size: ''
         }
         this.modelType =  'add';
         this.comfirmLoading = false;
         this.editId = '';
-        this.musicFile = {
-          title: '',
-          size: ''
-        }
       }
     }
   },
@@ -168,11 +165,15 @@ export default {
         this.form = type == 'edit' ? {
           musicName: rows.musicName,
           musicUrl: rows.musicUrl,
-          parentId: rows.parentId
+          parentId: rows.parentId,
+          fileName: rows.fileName,
+          size: rows.size
         } : {
           musicName: '',
           musicUrl: '',
-          parentId: ''
+          parentId: '',
+          fileName: '',
+          size: ''
         }
         this.$refs.MusicLibraryForm.resetFields()
       })
@@ -183,7 +184,7 @@ export default {
           this.comfirmLoading = true;
           const params = this.form;
           if (this.modelType == 'add') {
-            addMusicConfig(params).then(res =>{
+            addMusicConfigInfo(params).then(res =>{
               this.dialogVisible = false;
               if(res.code == 200){
                 this.$message.success(res.msg || "操作成功");
@@ -194,7 +195,7 @@ export default {
             })
           } else {
             params.id = this.editId;
-            editMusicConfig(params).then(res =>{
+            editMusicConfigInfo(params).then(res =>{
               this.dialogVisible = false;
               if(res.code == 200){
                 this.$message.success(res.msg || "操作成功");
@@ -242,10 +243,8 @@ export default {
       this.videoUploadPercent = 0;
       this.$refs.MusicLibraryForm.clearValidate(['musicUrl']);
       if (res.code == 200) {
-        this.musicFile = {
-          title: res.data.fileName,
-          size: res.data.size
-        }
+        this.form.fileName = res.data.fileName;
+        this.form.size = res.data.size;
         this.form.musicUrl = res.data.url;
       } else {
         this.$message.error('上传失败,请重新上传!');
@@ -259,10 +258,8 @@ export default {
         type: "warning"
       }).then(() => {
         this.form.musicUrl = '';
-        this.musicFile = {
-          title: '',
-          size: ''
-        }
+        this.form.fileName = '';
+        this.form.size = '';
         this.$notify({
           title: "成功",
           message: "删除成功",