mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-27 13:08:13 +00:00
feat: 客户端快捷键关闭侧滑窗
This commit is contained in:
parent
544496a09b
commit
20a6da4944
@ -53,7 +53,7 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['taskId']),
|
||||
...mapState(['taskId', 'cacheDrawerOverlay']),
|
||||
},
|
||||
|
||||
watch: {
|
||||
@ -181,6 +181,10 @@ export default {
|
||||
if (this.$Modal.removeLast()) {
|
||||
return;
|
||||
}
|
||||
if (this.cacheDrawerOverlay.length > 0) {
|
||||
this.cacheDrawerOverlay[this.cacheDrawerOverlay.length - 1].close();
|
||||
return;
|
||||
}
|
||||
ipcRenderer.send('windowHidden');
|
||||
})
|
||||
}
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import state from "../store/state";
|
||||
|
||||
export default {
|
||||
name: 'DrawerOverlay',
|
||||
props: {
|
||||
@ -74,6 +76,23 @@
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
value(val) {
|
||||
if (this._uid) {
|
||||
const index = this.$store.state.cacheDrawerOverlay.findIndex(({_uid}) => _uid === this._uid);
|
||||
if (val && index === -1) {
|
||||
this.$store.state.cacheDrawerOverlay.push({
|
||||
_uid: this._uid,
|
||||
close: this.close
|
||||
});
|
||||
}
|
||||
if (!val && index > -1) {
|
||||
this.$store.state.cacheDrawerOverlay.splice(index, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
mask () {
|
||||
if (this.maskClosable) {
|
||||
|
||||
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -255,6 +255,7 @@ state.windowMax768 = window.innerWidth <= 768;
|
||||
|
||||
// 数据缓存
|
||||
state.cacheLoading = {};
|
||||
state.cacheDrawerOverlay = [];
|
||||
// User
|
||||
state.cacheUserActive = {};
|
||||
state.cacheUserWait = [];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user