From 16e44d71bdc4777e77edc915d9aef8d94949bd11 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Thu, 17 Dec 2020 16:22:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E6=8A=A5=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E4=B8=8D=E6=8F=90=E9=86=92=E6=94=AF=E6=8C=81shift?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/History.vue | 29 ++++++++++++++++++----------- src/components/Star.vue | 29 ++++++++++++++++++----------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/components/History.vue b/src/components/History.vue index 069f6fe..7bc3b3b 100644 --- a/src/components/History.vue +++ b/src/components/History.vue @@ -177,15 +177,7 @@ export default { if (this.view === 'History') { this.getAllhistory() this.getAllsites() - if (this.setting.shiftTooltipLimitTimes === undefined) this.setting.shiftTooltipLimitTimes = 5 - if (this.setting.shiftTooltipLimitTimes) { - this.$message.info('多选时支持shift快捷键') - this.setting.shiftTooltipLimitTimes-- - setting.find().then(res => { - res.shiftTooltipLimitTimes = this.setting.shiftTooltipLimitTimes - setting.update(res) - }) - } + if (this.setting.historyViewMode === 'table') this.showShiftPrompt() } } }, @@ -361,12 +353,27 @@ export default { }) }, updateViewMode () { - if (this.setting.historyViewMode === 'table') setTimeout(() => { this.rowDrop() }, 100) - setTimeout(() => { if (this.$refs.historyWaterfall) this.$refs.historyWaterfall.refresh() }, 700) + if (this.setting.historyViewMode === 'table') { + setTimeout(() => { this.rowDrop() }, 100) + this.showShiftPrompt() + } else { + setTimeout(() => { if (this.$refs.historyWaterfall) this.$refs.historyWaterfall.refresh() }, 700) + } setting.find().then(res => { res.historyViewMode = this.setting.historyViewMode setting.update(res) }) + }, + showShiftPrompt () { + if (this.setting.shiftTooltipLimitTimes === undefined) this.setting.shiftTooltipLimitTimes = 5 + if (this.setting.shiftTooltipLimitTimes) { + this.$message.info('多选时支持shift快捷键') + this.setting.shiftTooltipLimitTimes-- + setting.find().then(res => { + res.shiftTooltipLimitTimes = this.setting.shiftTooltipLimitTimes + setting.update(res) + }) + } } }, mounted () { diff --git a/src/components/Star.vue b/src/components/Star.vue index 28480db..ab4a4d3 100644 --- a/src/components/Star.vue +++ b/src/components/Star.vue @@ -208,15 +208,7 @@ export default { if (this.view === 'Star') { this.getAllsites() this.getFavorites() - if (this.setting.shiftTooltipLimitTimes === undefined) this.setting.shiftTooltipLimitTimes = 5 - if (this.setting.shiftTooltipLimitTimes) { - this.$message.info('多选时支持shift快捷键') - this.setting.shiftTooltipLimitTimes-- - setting.find().then(res => { - res.shiftTooltipLimitTimes = this.setting.shiftTooltipLimitTimes - setting.update(res) - }) - } + if (this.setting.starViewMode === 'table') this.showShiftPrompt() } }, numNoUpdate () { @@ -500,12 +492,27 @@ export default { }) }, updateViewMode () { - if (this.setting.starViewMode === 'table') setTimeout(() => { this.rowDrop() }, 100) - setTimeout(() => { if (this.$refs.starWaterfall) this.$refs.starWaterfall.refresh() }, 700) + if (this.setting.starViewMode === 'table') { + setTimeout(() => { this.rowDrop() }, 100) + this.showShiftPrompt() + } else { + setTimeout(() => { if (this.$refs.starWaterfall) this.$refs.starWaterfall.refresh() }, 700) + } setting.find().then(res => { res.starViewMode = this.setting.starViewMode setting.update(res) }) + }, + showShiftPrompt () { + if (this.setting.shiftTooltipLimitTimes === undefined) this.setting.shiftTooltipLimitTimes = 5 + if (this.setting.shiftTooltipLimitTimes) { + this.$message.info('多选时支持shift快捷键') + this.setting.shiftTooltipLimitTimes-- + setting.find().then(res => { + res.shiftTooltipLimitTimes = this.setting.shiftTooltipLimitTimes + setting.update(res) + }) + } } }, created () {