|
@@ -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: "删除成功",
|