Pārlūkot izejas kodu

音频管理 歌曲

DESKTOP-O04BTUJ\muzen 2 gadi atpakaļ
vecāks
revīzija
c81595d5f1
2 mainītis faili ar 13 papildinājumiem un 21 dzēšanām
  1. 11 19
      src/views/music/list/detail.vue
  2. 2 2
      src/views/music/list/index.vue

+ 11 - 19
src/views/music/list/detail.vue

@@ -41,7 +41,7 @@
 
 <script>
 import Upload from "@/components/Upload/index";
-import { create, edit, detail } from '@/api/music/list'
+import { submit, detail } from '@/api/music/list'
 import { selectSinger } from '@/api/music/singer'
 import { platformMixin, languageMixin } from '@/mixin/index'
 export default {
@@ -53,8 +53,6 @@ export default {
     return {
       // 歌手
       singerOptions: [],
-      // 音频类型
-      audioType: 11,
       // 表单
       form: {
         status: 1
@@ -85,6 +83,8 @@ export default {
     };
   },
   mounted() {
+    // 获取资源平台
+    this.getPlatform(11)
     if (this.$route.query.id) {
       this.form.id = this.$route.query.id
       this.disabled = Boolean(this.$route.query.disabled)
@@ -142,22 +142,14 @@ export default {
       this.$refs.form.validate((valid) => {
         if (valid) {
           this.form.singerId = this.form.singerId.join(',')
-          if (this.form.id) {
-            edit(this.form).then(res => {
-              if (res.code === 0) {
-                this.$message.success('编辑成功!')
-                this.cancel()
-              }
-            })
-          } else {
-            create(this.form).then(res => {
-              if (res.code === 0) {
-                this.$message.success('新增成功!')
-                this.cancel()
-              }
-            })
-          }
-        }else{
+          let title = this.form.id ? '编辑成功!' : '新增成功!'
+          submit(this.form).then(res => {
+            if (res.code === 0) {
+              this.$message.success(`${title}`)
+              this.cancel()
+            }
+          })
+        } else {
           return false
         }
       })

+ 2 - 2
src/views/music/list/index.vue

@@ -84,8 +84,6 @@ export default {
         pageNum: 1,
         pageSize: 10
       },
-      // 音频类型
-      audioType: 11,
       // 总数据
       total: 0,
       // 列表
@@ -95,6 +93,8 @@ export default {
     };
   },
   mounted() {
+    // 获取资源平台
+    this.getPlatform(11)
     this.getList()
   },
   methods: {