Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 236 KiB |
@ -0,0 +1,62 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-upload action="#" list-type="picture-card" :auto-upload="false">
|
||||||
|
<i slot="default" class="el-icon-plus"></i>
|
||||||
|
<div slot="file" slot-scope="{file}">
|
||||||
|
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
|
||||||
|
<span class="el-upload-list__item-actions">
|
||||||
|
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
|
||||||
|
<i class="el-icon-zoom-in"></i>
|
||||||
|
</span>
|
||||||
|
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleDownload(file)">
|
||||||
|
<i class="el-icon-download"></i>
|
||||||
|
</span>
|
||||||
|
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
|
||||||
|
<i class="el-icon-delete"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<el-dialog :visible.sync="dialogVisible">
|
||||||
|
<img width="100%" :src="dialogImageUrl" alt="">
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: '',
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogImageUrl: '',
|
||||||
|
dialogVisible: false,
|
||||||
|
disabled: false,
|
||||||
|
fileList:[]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() { },
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleRemove(file) {
|
||||||
|
console.log(file);
|
||||||
|
console.log(this.dialogImageUrl);
|
||||||
|
|
||||||
|
},
|
||||||
|
handlePictureCardPreview(file) {
|
||||||
|
this.dialogImageUrl = file.url;
|
||||||
|
console.log(file);
|
||||||
|
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
handleDownload(file) {
|
||||||
|
console.log(file);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped lang='scss'></style>
|
@ -0,0 +1,106 @@
|
|||||||
|
<template>
|
||||||
|
<div class="dlodbox">
|
||||||
|
<el-upload action="#" list-type="picture-card" :auto-upload="false" :limit="0"
|
||||||
|
:on-success="handleUploadSuccess" disabled>
|
||||||
|
<i slot="default" class="el-icon-plus"></i>
|
||||||
|
<div slot="file" slot-scope="{file}">
|
||||||
|
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" >
|
||||||
|
<span class="el-upload-list__item-actions">
|
||||||
|
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
|
||||||
|
<i class="el-icon-zoom-in"></i>
|
||||||
|
</span>
|
||||||
|
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleDownload(file)">
|
||||||
|
<i class="el-icon-download"></i>
|
||||||
|
</span>
|
||||||
|
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
|
||||||
|
<i class="el-icon-delete"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="shangchuanzhaopian">请上传国徽侧照片</div>
|
||||||
|
</el-upload>
|
||||||
|
<el-dialog :visible.sync="dialogVisible">
|
||||||
|
<img width="100%" :src="dialogImageUrl" alt="">
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: '',
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogImageUrl: '',
|
||||||
|
dialogVisible: false,
|
||||||
|
disabled: false,
|
||||||
|
fileList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() { },
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleRemove(file) {
|
||||||
|
console.log(file);
|
||||||
|
console.log(this.dialogImageUrl);
|
||||||
|
console.log(this.fileList);
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
handlePictureCardPreview(file) {
|
||||||
|
this.dialogImageUrl = file.url;
|
||||||
|
console.log(file);
|
||||||
|
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
handleDownload(file) {
|
||||||
|
console.log(file);
|
||||||
|
},
|
||||||
|
handleUploadSuccess(response, file) {
|
||||||
|
// 假设每个文件都有一个url属性
|
||||||
|
console.log(file);
|
||||||
|
|
||||||
|
// this.uploadedFiles.push({ url: URL.createObjectURL(file.raw) });
|
||||||
|
// 隐藏上传界面
|
||||||
|
},
|
||||||
|
huidiao(type){
|
||||||
|
console.log(type);
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped lang='scss'>
|
||||||
|
.dlodbox {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon-plus {
|
||||||
|
font-size: 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shangchuanzhaopian {
|
||||||
|
position: relative;
|
||||||
|
bottom: 50px;
|
||||||
|
z-index: 5;
|
||||||
|
font-family: "Source Han Sans CN-Regular";
|
||||||
|
font-size: 20px;
|
||||||
|
color: #8c939d;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-upload--picture-card,
|
||||||
|
.el-upload-list__item {
|
||||||
|
width: 350px;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-upload-list--picture-card .el-upload-list__item {
|
||||||
|
width: 350px;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
</style>
|