فهرست منبع

音乐管理 主播

DESKTOP-O04BTUJ\muzen 2 سال پیش
والد
کامیت
493f1d6c1b
2فایلهای تغییر یافته به همراه14 افزوده شده و 23 حذف شده
  1. 11 20
      src/views/music/anchor/detail.vue
  2. 3 3
      src/views/music/anchor/index.vue

+ 11 - 20
src/views/music/anchor/detail.vue

@@ -26,7 +26,7 @@
 </template>
 
 <script>
-import { create, edit, detail } from '@/api/music/anchor'
+import { submit, detail } from '@/api/music/anchor'
 import Upload from '@/components/Upload/index.vue'
 import { platformMixin } from '@/mixin/index'
 export default {
@@ -36,8 +36,6 @@ export default {
   },
   data() {
     return {
-      // 音频类型
-      audioType: 12,
       // 表单
       form: {
         status: 1
@@ -62,6 +60,8 @@ export default {
     }
   },
   mounted() {
+    // 获取资源平台
+    this.getPlatform(12)
     if (this.$route.query.id) {
       this.form.id = this.$route.query.id
       this.disabled = Boolean(this.$route.query.disabled)
@@ -71,8 +71,7 @@ export default {
   methods: {
     getList() {
       detail(this.form.id).then(res => {
-        console.log(res);
-        if(res.code === 0) {
+        if (res.code === 0) {
           this.form = res.data
         }
       })
@@ -87,21 +86,13 @@ export default {
     getSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
-          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()
-              }
-            })
-          }
+          let title = this.form.id ? '编辑成功!' : '新增成功!'
+          submit(this.form).then(res => {
+            if (res.code === 0) {
+              this.$message.success(`${title}`)
+              this.cancel()
+            }
+          })
         } else {
           return false
         }

+ 3 - 3
src/views/music/anchor/index.vue

@@ -52,7 +52,7 @@
 </template>
 
 <script>
-import { list, change } from '@/api/music/anchor'
+import { list, change, remove } from '@/api/music/anchor'
 import { platformMixin, onOrOffMixin } from '@/mixin/index'
 export default {
   mixins: [platformMixin, onOrOffMixin],
@@ -60,8 +60,6 @@ export default {
     return {
       // 遮罩层
       loading: false,
-      // 音频类型
-      audioType: 12,
       // 表单
       form: {
         pageNum: 1,
@@ -74,6 +72,8 @@ export default {
     }
   },
   mounted() {
+    // 获取资源平台
+    this.getPlatform(12)
     this.getList()
   },
   methods: {