|
@@ -195,7 +195,7 @@
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
</el-upload>
|
|
</el-upload>
|
|
<p v-if="form.audio" style="color: #999">
|
|
<p v-if="form.audio" style="color: #999">
|
|
- <a target="_blank" :href="'/data/' + form.audio">{{ form.audio }}</a>
|
|
|
|
|
|
+ <a target="_blank" :href="'/data/' + form.audio">{{ form.fileName }}</a>
|
|
</p>
|
|
</p>
|
|
<div>
|
|
<div>
|
|
<p style="color: #999">格式要求:</p>
|
|
<p style="color: #999">格式要求:</p>
|
|
@@ -273,6 +273,7 @@ export default {
|
|
type: 2,
|
|
type: 2,
|
|
icon: "",
|
|
icon: "",
|
|
audio: "",
|
|
audio: "",
|
|
|
|
+ fileName:""
|
|
},
|
|
},
|
|
changeType: true,
|
|
changeType: true,
|
|
dialogFormVisible: false,
|
|
dialogFormVisible: false,
|
|
@@ -330,12 +331,13 @@ export default {
|
|
handleAudioFilesRemove() {
|
|
handleAudioFilesRemove() {
|
|
this.audioFileList = [];
|
|
this.audioFileList = [];
|
|
this.form.audio = "";
|
|
this.form.audio = "";
|
|
|
|
+ this.form.fileName = "";
|
|
},
|
|
},
|
|
handleAudioFilesChange(file) {
|
|
handleAudioFilesChange(file) {
|
|
this.audioFileList = [];
|
|
this.audioFileList = [];
|
|
this.audioFileList.push(file);
|
|
this.audioFileList.push(file);
|
|
- this.form.audio =
|
|
|
|
- file.response && file.response.data && file.response.data.path;
|
|
|
|
|
|
+ this.form.audio = file.response && file.response.data && file.response.data.path;
|
|
|
|
+ this.form.fileName = file.response && file.response.data && file.response.data.fileName;
|
|
},
|
|
},
|
|
changeState(item) {
|
|
changeState(item) {
|
|
changeState(item, "fodder", () => {
|
|
changeState(item, "fodder", () => {
|
|
@@ -402,15 +404,14 @@ export default {
|
|
console.log("item", item);
|
|
console.log("item", item);
|
|
this.dialogFormVisible = true;
|
|
this.dialogFormVisible = true;
|
|
this.showType = type;
|
|
this.showType = type;
|
|
- this.form = { id: "", name: "", icon: "", audio: "" };
|
|
|
|
|
|
+ this.form = { id: "", name: "", icon: "", audio: "",fileName:'' };
|
|
if (type === "add") {
|
|
if (type === "add") {
|
|
- let test= '132;';
|
|
|
|
console.log("add");
|
|
console.log("add");
|
|
this.audioFileList = [];
|
|
this.audioFileList = [];
|
|
}
|
|
}
|
|
if (type === "edit") {
|
|
if (type === "edit") {
|
|
this.form = { ...item };
|
|
this.form = { ...item };
|
|
- let file = { name: "音频文件", url: `/${this.form.audio}` };
|
|
|
|
|
|
+ let file = { name: item.fileName, url: `/${this.form.audio}` };
|
|
this.audioFileList = [file];
|
|
this.audioFileList = [file];
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -454,15 +455,15 @@ export default {
|
|
},
|
|
},
|
|
async save() {
|
|
async save() {
|
|
this.$refs["fodderform"].validate(async (valid) => {
|
|
this.$refs["fodderform"].validate(async (valid) => {
|
|
- console.log("valid", valid);
|
|
|
|
if (valid) {
|
|
if (valid) {
|
|
- let { id, name, type, icon, audio } = this.form;
|
|
|
|
|
|
+ let { id, name, type, icon, audio,fileName } = this.form;
|
|
let data = {
|
|
let data = {
|
|
id,
|
|
id,
|
|
name,
|
|
name,
|
|
type,
|
|
type,
|
|
icon,
|
|
icon,
|
|
audio,
|
|
audio,
|
|
|
|
+ fileName
|
|
};
|
|
};
|
|
if (!data.icon) {
|
|
if (!data.icon) {
|
|
this.tipError("音频图标不能为空");
|
|
this.tipError("音频图标不能为空");
|
|
@@ -477,7 +478,6 @@ export default {
|
|
data,
|
|
data,
|
|
url: `/manage/sceneAudio/save`,
|
|
url: `/manage/sceneAudio/save`,
|
|
});
|
|
});
|
|
- console.log("result", result);
|
|
|
|
if (result.code === 0) {
|
|
if (result.code === 0) {
|
|
this.$alert("保存成功", "提示", {
|
|
this.$alert("保存成功", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|