mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-02-13 07:25:01 +08:00
fix:改动快捷键设置时未及时生效
This commit is contained in:
@@ -354,7 +354,8 @@ export default {
|
||||
},
|
||||
startPosition: { min: '00', sec: '00' }, // 对应调略输入框
|
||||
endPosition: { min: '00', sec: '00' },
|
||||
skipendStatus: false // 是否跳过了片尾
|
||||
skipendStatus: false, // 是否跳过了片尾
|
||||
currentShortcutList: []
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
@@ -411,8 +412,13 @@ export default {
|
||||
this.SET_APPSTATE(val)
|
||||
}
|
||||
},
|
||||
setting () {
|
||||
return this.$store.getters.getSetting
|
||||
setting: {
|
||||
get () {
|
||||
return this.$store.getters.getSetting
|
||||
},
|
||||
set (val) {
|
||||
this.SET_SETTING(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -1044,6 +1050,7 @@ export default {
|
||||
this.video = { key: e.key, info: { id: e.id, name: e.name, site: e.site, index: this.video.info.index, time: this.right.currentTime } }
|
||||
},
|
||||
mtEvent () {
|
||||
if (this.setting.shortcutModified) this.currentShortcutList.forEach(e => mt.unbind(e.key))
|
||||
setting.find().then(res => {
|
||||
if (res.shortcut) {
|
||||
shortcut.all().then(res => {
|
||||
@@ -1054,14 +1061,22 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
this.currentShortcutList = res
|
||||
})
|
||||
} else {
|
||||
shortcut.all().then(res => {
|
||||
for (const i of res) {
|
||||
mt.unbind(i.key)
|
||||
}
|
||||
this.currentShortcutList = []
|
||||
})
|
||||
}
|
||||
}).finally(() => {
|
||||
this.setting.shortcutModified = false
|
||||
setting.find().then(res => {
|
||||
res.shortcutModified = this.setting.shortcutModified
|
||||
setting.update(res)
|
||||
})
|
||||
})
|
||||
},
|
||||
async shortcutEvent (e) {
|
||||
|
||||
@@ -427,7 +427,9 @@ export default {
|
||||
this.$message.info('已清空原数据')
|
||||
shortcut.add(json).then(e => {
|
||||
this.$message.success('已添加成功')
|
||||
this.getSites()
|
||||
this.getShortcut()
|
||||
this.d.shortcutModified = true
|
||||
this.updateSettingEvent()
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -435,6 +437,8 @@ export default {
|
||||
shortcut.clear().then(shortcut.add(defaultShortcuts)).then(res => {
|
||||
this.getShortcut()
|
||||
this.$message.success('快捷键已重置')
|
||||
this.d.shortcutModified = true
|
||||
this.updateSettingEvent()
|
||||
})
|
||||
},
|
||||
async changeProxyType (e) {
|
||||
|
||||
Reference in New Issue
Block a user