mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 12:05:05 +08:00
update 图片上传
This commit is contained in:
@@ -17,20 +17,7 @@
|
||||
|
||||
<div id="container"></div>
|
||||
</div>
|
||||
<div>上传图片</div>
|
||||
<el-upload
|
||||
action="http://localhost:8080/common/uploadOSS"
|
||||
:headers="headers"
|
||||
list-type="picture-card"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:on-remove="handleRemove"
|
||||
:on-success="handleSuccess"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible">
|
||||
<img width="100%" :src="dialogImageUrl" alt="">
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- <div class="img">-->
|
||||
<!-- <el-input-->
|
||||
@@ -77,26 +64,11 @@ export default {
|
||||
placeSearch: "",
|
||||
stationId: this.$route.params.id,
|
||||
avatar: "",
|
||||
headers: {
|
||||
Authorization: "Bearer " + getToken()
|
||||
},
|
||||
imageUrl: null
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleSuccess(res, file) {
|
||||
this.imageUrl = URL.createObjectURL(file.raw);
|
||||
console.log("图片上传成功 url:", this.imageUrl);
|
||||
console.log("图片上传成功 res:", res);
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url;
|
||||
console.log(this.dialogImageUrl)
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
|
||||
// 点击搜索按钮
|
||||
send() {
|
||||
this.searchPlaceInput = this.inputObject.userInput;
|
||||
|
||||
Reference in New Issue
Block a user