|
|
|
@ -118,34 +118,35 @@ export default { |
|
|
|
ModelMainInit() |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
ModelMainMounted() |
|
|
|
ModelMainMounted().then(() => { |
|
|
|
|
|
|
|
// 注册 widget 快捷键 |
|
|
|
const allWidget = getAllWidget() |
|
|
|
// 注册 widget 快捷键 |
|
|
|
const allWidget = getAllWidget() |
|
|
|
|
|
|
|
allWidget.forEach((widget) => { |
|
|
|
if (widget?.shortcut && widget?.name && widget?.side) { |
|
|
|
const shortKey = normalizeShortKey(widget.shortcut) |
|
|
|
widget.shortcut = shortKey |
|
|
|
if (shortKey) { |
|
|
|
system.hotkeys(shortKey, (event) => { |
|
|
|
if (widget.side === 'left') { |
|
|
|
this.sectionLeftName = widget.name |
|
|
|
this.hideLeft = false |
|
|
|
allWidget.forEach((widget) => { |
|
|
|
if (widget?.shortcut && widget?.name && widget?.side) { |
|
|
|
const shortKey = normalizeShortKey(widget.shortcut) |
|
|
|
widget.shortcut = shortKey |
|
|
|
if (shortKey) { |
|
|
|
system.hotkeys(shortKey, (event) => { |
|
|
|
if (widget.side === 'left') { |
|
|
|
this.sectionLeftName = widget.name |
|
|
|
this.hideLeft = false |
|
|
|
|
|
|
|
} else if (widget.side === 'right') { |
|
|
|
this.sectionRightName = widget.name |
|
|
|
this.hideRight = false |
|
|
|
} else if (widget.side === 'right') { |
|
|
|
this.sectionRightName = widget.name |
|
|
|
this.hideRight = false |
|
|
|
|
|
|
|
} else if (widget.side === 'bottom') { |
|
|
|
this.sectionBottomName = widget.name |
|
|
|
this.hideBottom = false |
|
|
|
} |
|
|
|
} else if (widget.side === 'bottom') { |
|
|
|
this.sectionBottomName = widget.name |
|
|
|
this.hideBottom = false |
|
|
|
} |
|
|
|
|
|
|
|
event.preventDefault() |
|
|
|
}) |
|
|
|
event.preventDefault() |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
unmounted() { |
|
|
|
|