Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed67847

Browse files
committed
feat:图片模式添加下载按钮
fix:下载完成后,反选
1 parent 5279c19 commit ed67847

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

app/src/renderer/components/Main/ResourceGrid.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
</div>
6969
<span v-else class="image">其他类型</span>
7070
<div class="btn">
71+
<Button type="ghost" shape="circle" size="small" icon="ios-download"
72+
@click="handleDownload(index,$event)" style="background: #FFFFFF"></Button>
7173
<Button type="ghost" shape="circle" size="small" icon="clipboard"
7274
@click="copy(index,$event)" style="background: #FFFFFF"></Button>
7375
<Button type="error" shape="circle" size="small" icon="trash-b"
@@ -105,6 +107,16 @@
105107
return {
106108
self: this,
107109
}
110+
},
111+
methods: {
112+
handleDownload(index) {
113+
let item = this.bucket.files[index];
114+
115+
this.bucket.selection = [item];
116+
this.downloadFiles();
117+
118+
event.stopPropagation();
119+
}
108120
}
109121
};
110122
</script>

app/src/renderer/components/Main/ResourceTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</style>
88
<template>
99
<div class="layout-content">
10-
<Table border :columns="columns" :context="self"
10+
<Table ref="table" border :columns="columns" :context="self"
1111
:height="tableHeight" :data="bucket.files" no-data-text="暂无数据"
1212
@on-selection-change="onSelectionChange"></Table>
1313
<Modal

app/src/renderer/mixins/mixin-resource.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export default {
6060
this.$electron.ipcRenderer.send('downloadFile', util.getQiniuUrl(this.bucket.domains[0], this.bucket.selection[0].key), option);
6161
this.bucket.selection.shift();
6262
} else {
63+
this.$refs['table'] && this.$refs['table'].selectAll(false);
64+
6365
this.$Message.info('文件下载完成');
6466
}
6567
},

0 commit comments

Comments
 (0)