Commit 01e78834 authored by zL's avatar zL

fix:阻止事件冒泡

parent 83561fae
...@@ -80,12 +80,25 @@ export default { ...@@ -80,12 +80,25 @@ export default {
this.showAudio = true; this.showAudio = true;
}, },
deleteAudios(index) { deleteAudios(index) {
this.localHash.splice(index, 1); this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
this.localObjects.splice(index, 1); confirmButtonText: "确定",
this.$message({ cancelButtonText: "取消",
type: "success", type: "warning",
message: "删除成功!", })
}); .then(() => {
this.localHash.splice(index, 1);
this.localObjects.splice(index, 1);
this.$message({
type: "success",
message: "删除成功!",
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
}, },
// 上传文件 // 上传文件
upFile() { upFile() {
...@@ -180,7 +193,7 @@ export default { ...@@ -180,7 +193,7 @@ export default {
line-height: 36px; line-height: 36px;
color: rgba(121, 125, 132, 1); color: rgba(121, 125, 132, 1);
background: #f6f6f7; background: #f6f6f7;
border: 1px solid #DCDFE6; border: 1px solid #dcdfe6;
.iconyinpin2 { .iconyinpin2 {
font-size: 24px; font-size: 24px;
vertical-align: sub; vertical-align: sub;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<img class="list-item-img" :src="item.url || item.dataUrl" /> <img class="list-item-img" :src="item.url || item.dataUrl" />
<i <i
class="iconfont iconshanchu3" class="iconfont iconshanchu3"
@click="deleteimg(item, index)" @click.stop="deleteimg(item, index)"
></i> ></i>
</div> </div>
<div class="add_wrapper"> <div class="add_wrapper">
...@@ -122,7 +122,24 @@ export default class ImageForm extends Vue { ...@@ -122,7 +122,24 @@ export default class ImageForm extends Vue {
} }
// 删除图片 // 删除图片
deleteimg(item: any, index: number) { deleteimg(item: any, index: number) {
this.imageInfo.imgList.splice(index, 1); this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.imageInfo.imgList.splice(index, 1);
this.$message({
type: "success",
message: "删除成功!",
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
} }
public fileChange(e: any) { public fileChange(e: any) {
const file: File = e.target.files[0]; const file: File = e.target.files[0];
......
...@@ -32,11 +32,7 @@ ...@@ -32,11 +32,7 @@
@change="fileChange" @change="fileChange"
/> />
<!-- 视频预览 --> <!-- 视频预览 -->
<common-dialog <common-dialog v-if="showVideo" @closePopup="showVideo = false" showMask>
v-if="showVideo"
@closePopup="showVideo = false"
showMask
>
<div> <div>
<video controls="controls" style="outline: none" :src="Vurl"></video> <video controls="controls" style="outline: none" :src="Vurl"></video>
</div> </div>
...@@ -121,11 +117,28 @@ export default { ...@@ -121,11 +117,28 @@ export default {
}, },
// 删除当前视频||终止上传 // 删除当前视频||终止上传
termination(index) { termination(index) {
if (xhr) { this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
xhr.abort(); confirmButtonText: "确定",
} cancelButtonText: "取消",
this.hashList.splice(index, 1); type: "warning",
this.locaVideos.splice(index, 1); })
.then(() => {
if (xhr) {
xhr.abort();
}
this.hashList.splice(index, 1);
this.locaVideos.splice(index, 1);
this.$message({
type: "success",
message: "删除成功!",
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
}, },
// //
upFile() { upFile() {
...@@ -242,7 +255,7 @@ export default { ...@@ -242,7 +255,7 @@ export default {
width: 151px; width: 151px;
background: #f6f6f7; background: #f6f6f7;
border-radius: 4px; border-radius: 4px;
border: 1px solid #DCDFE6; border: 1px solid #dcdfe6;
color: #353535; color: #353535;
line-height: 36px; line-height: 36px;
text-align: center; text-align: center;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment