|
@@ -30,16 +30,28 @@
|
|
|
<!-- 文件列表 -->
|
|
|
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
|
|
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
|
|
- <el-link :href="file.url" :underline="false" target="_blank">
|
|
|
+<!-- <el-link :href="file.url" :underline="false" target="_blank">-->
|
|
|
<span class="el-icon-document"> {{ file.name }} </span>
|
|
|
- </el-link>
|
|
|
+<!-- </el-link>-->
|
|
|
<div class="ele-upload-list__item-content-action">
|
|
|
- <el-link :underline="false" @click="handleDelete(index)" type="danger">预览</el-link>
|
|
|
-<!-- <el-link :underline="false" @click="handleDelete(index)" type="danger">下载</el-link>-->
|
|
|
+ <el-link :underline="false" @click="handlePictureCardPreview(file)" type="primary">预览</el-link>
|
|
|
+ <el-link :href="file.url" :underline="false" target="_blank" type="primary">下载</el-link>
|
|
|
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
|
|
|
</div>
|
|
|
</li>
|
|
|
</transition-group>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ title="预览"
|
|
|
+ width="800"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ :src="dialogImageUrl"
|
|
|
+ style="display: block; max-width: 100%; margin: 0 auto"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -79,6 +91,8 @@ export default {
|
|
|
return {
|
|
|
number: 0,
|
|
|
uploadList: [],
|
|
|
+ dialogVisible: false,
|
|
|
+ dialogImageUrl: "",
|
|
|
uploadFileUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传的图片服务器地址
|
|
|
headers: {
|
|
|
Authorization: "Bearer " + getToken(),
|
|
@@ -203,11 +217,15 @@ export default {
|
|
|
this.uploadList = [];
|
|
|
this.number = 0;
|
|
|
this.$emit("input", this.listToString(this.fileList));
|
|
|
- console.log("ppo", this.fileList)
|
|
|
this.$modal.closeLoading();
|
|
|
}
|
|
|
this.setFileName(res.data.webName)
|
|
|
},
|
|
|
+ // 预览
|
|
|
+ handlePictureCardPreview(file) {
|
|
|
+ this.dialogImageUrl = file.url;
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
// 删除文件
|
|
|
handleDelete(index) {
|
|
|
this.fileList.splice(index, 1);
|