|
@@ -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
|
|
|
}
|
|
|
})
|