|
|
@@ -3,19 +3,12 @@
|
|
|
点我修改轮播图
|
|
|
</el-card>
|
|
|
<el-dialog v-model="seeDialog">
|
|
|
- <div>请慎重上传!上传到服务器后会直接覆盖原有图片!</div>
|
|
|
- <el-upload
|
|
|
- class="upload-demo"
|
|
|
- action=""
|
|
|
- :auto-upload="false"
|
|
|
- :limit="3"
|
|
|
- :on-exceed="handleExceed"
|
|
|
- :file-list="fileList"
|
|
|
- list-type="picture"
|
|
|
- :on-remove="handleChange"
|
|
|
- :on-change="handleChange">
|
|
|
- <el-button size="small" type="primary" style="margin: 10px">点击上传</el-button>
|
|
|
- </el-upload>
|
|
|
+ <div>请慎重上传!上传到服务器后会直接覆盖原有信息!</div>
|
|
|
+ <div>
|
|
|
+ <el-input v-model="input[0]" placeholder="请输入课程名" style="margin: 10px;left: -10px;"></el-input>
|
|
|
+ <el-input v-model="input[1]" placeholder="请输入课程名" style="margin: 10px;left: -10px;"></el-input>
|
|
|
+ <el-input v-model="input[2]" placeholder="请输入课程名" style="margin: 10px;left: -10px;"></el-input>
|
|
|
+ </div>
|
|
|
<el-button style="margin: 10px;" size="small" type="success" @click="updatePictures" >上传到服务器</el-button>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
@@ -29,6 +22,7 @@ export default {
|
|
|
return {
|
|
|
fileList: [],
|
|
|
seeDialog: false,
|
|
|
+ input: ["","",""],
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
@@ -41,13 +35,16 @@ export default {
|
|
|
ElMessage.error("最多展示3个文件!");
|
|
|
},
|
|
|
async updatePictures() {
|
|
|
- const message=await this.$apis.uploadCarouselChart(this.fileList);
|
|
|
- if (message.data.data==="成功"){
|
|
|
+ const message=await this.$apis.uploadCarouselChart(this.input);
|
|
|
+ if (message.data.code===-1){
|
|
|
+ ElMessage.error("课程不存在!");
|
|
|
+ }else if (message.data.data===true){
|
|
|
ElMessage.success("上传成功!");
|
|
|
}else {
|
|
|
- ElMessage.error("上传失败!");
|
|
|
+ ElMessage.error("上传失败!后端报错");
|
|
|
}
|
|
|
this.seeDialog=false;
|
|
|
+ this.input=["","",""];
|
|
|
},
|
|
|
handleChange(file, fileList) {
|
|
|
this.fileList = fileList;
|