mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-03 11:48:17 +00:00
feat: 客户端快捷键关闭侧滑窗
This commit is contained in:
parent
544496a09b
commit
20a6da4944
@ -53,7 +53,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['taskId']),
|
...mapState(['taskId', 'cacheDrawerOverlay']),
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
@ -181,6 +181,10 @@ export default {
|
|||||||
if (this.$Modal.removeLast()) {
|
if (this.$Modal.removeLast()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.cacheDrawerOverlay.length > 0) {
|
||||||
|
this.cacheDrawerOverlay[this.cacheDrawerOverlay.length - 1].close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
ipcRenderer.send('windowHidden');
|
ipcRenderer.send('windowHidden');
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import state from "../store/state";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DrawerOverlay',
|
name: 'DrawerOverlay',
|
||||||
props: {
|
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: {
|
methods: {
|
||||||
mask () {
|
mask () {
|
||||||
if (this.maskClosable) {
|
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.cacheLoading = {};
|
||||||
|
state.cacheDrawerOverlay = [];
|
||||||
// User
|
// User
|
||||||
state.cacheUserActive = {};
|
state.cacheUserActive = {};
|
||||||
state.cacheUserWait = [];
|
state.cacheUserWait = [];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user