Browse Source

WorldModel open

master
修宁 7 months ago
parent
commit
05a3c3d672
  1. 45
      src/views/ModelMain.vue
  2. 9
      src/views/ModelMainInit.ts

45
src/views/ModelMain.vue

@ -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() {

9
src/views/ModelMainInit.ts

@ -37,13 +37,10 @@ export function ModelMainInit() {
const worldModel = new WorldModel()
window['worldModel'] = worldModel
worldModel.init().then(() => {
worldModel.open()
})
}
export function ModelMainMounted() {
forEachMenu((menu) => {
if (typeof menu.click === 'function') {
@ -58,6 +55,10 @@ export function ModelMainMounted() {
}
}
})
return worldModel.init().then(() => {
worldModel.open()
})
}
export function ModelMainUnmounted() {

Loading…
Cancel
Save