保存一下
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import ProcessManageImpl from './process/impl/ProcessManageImpl.ts'
|
||||
import ProcessImpl from './process/impl/ProcessImpl.ts'
|
||||
import type { ProcessInfoImpl } from '@/core/process/impl/ProcessInfoImpl.ts'
|
||||
import { isUndefined } from 'lodash'
|
||||
import { BasicSystemProcess } from '@/core/system/BasicSystemProcess.ts'
|
||||
import { DesktopProcess } from '@/core/desktop/DesktopProcess.ts'
|
||||
@@ -10,12 +9,22 @@ import { EventBuilderImpl } from '@/core/events/impl/EventBuilderImpl.ts'
|
||||
import type { IProcessManage } from '@/core/process/IProcessManage.ts'
|
||||
import type { IProcess } from '@/core/process/IProcess.ts'
|
||||
import type { IProcessInfo } from '@/core/process/IProcessInfo.ts'
|
||||
import { ObservableWeakRefImpl } from '@/core/state/impl/ObservableWeakRefImpl.ts'
|
||||
import type { IObservable } from '@/core/state/IObservable.ts'
|
||||
|
||||
interface IGlobalState {
|
||||
isLogin: boolean
|
||||
}
|
||||
|
||||
export default class XSystem {
|
||||
private static _instance: XSystem = new XSystem()
|
||||
|
||||
private _processManage: IProcessManage = new ProcessManageImpl()
|
||||
private _eventManage: IEventBuilder<IAllEvent> = new EventBuilderImpl()
|
||||
private _globalState: IObservable<IGlobalState> = new ObservableWeakRefImpl<IGlobalState>({
|
||||
isLogin: false
|
||||
})
|
||||
private _desktopRootDom: HTMLElement;
|
||||
|
||||
constructor() {
|
||||
console.log('XSystem')
|
||||
@@ -30,11 +39,19 @@ export default class XSystem {
|
||||
public get eventManage() {
|
||||
return this._eventManage
|
||||
}
|
||||
public get globalState() {
|
||||
return this._globalState
|
||||
}
|
||||
public get desktopRootDom() {
|
||||
return this._desktopRootDom
|
||||
}
|
||||
|
||||
public initialization(dom: HTMLDivElement) {
|
||||
this._desktopRootDom = dom
|
||||
this.run('basic-system', BasicSystemProcess).then(() => {
|
||||
this.run('desktop', DesktopProcess).then((proc) => {
|
||||
proc.mount(dom)
|
||||
// console.log(dom.querySelector('.desktop-root'))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user