|
|
|
@ -186,19 +186,25 @@ export default class Viewport { |
|
|
|
itemType.clazz.afterAddViewport(this) |
|
|
|
}) |
|
|
|
|
|
|
|
try { |
|
|
|
const vdata = await this.worldModel.getCatalogData(this.scene.catalogCode) |
|
|
|
if (!vdata) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (!vdata.catalog) { |
|
|
|
vdata.catalog = toRaw(this.worldModel.state.catalog) |
|
|
|
} |
|
|
|
await this.stateManager.load(vdata) |
|
|
|
EventBus.dispatch('dataLoadComplete', {}) |
|
|
|
// 尝试从草稿中恢复
|
|
|
|
const tryGetFromLocal = false // await this.stateManager.tryLoadFromLocalstore()
|
|
|
|
|
|
|
|
if (!tryGetFromLocal) { |
|
|
|
// 没有草稿,就找服务器捞数据
|
|
|
|
try { |
|
|
|
const vdata = await this.worldModel.getCatalogData(this.scene.catalogCode) |
|
|
|
if (!vdata) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (!vdata.catalog) { |
|
|
|
vdata.catalog = toRaw(this.worldModel.state.catalog) |
|
|
|
} |
|
|
|
await this.stateManager.load(vdata) |
|
|
|
EventBus.dispatch('dataLoadComplete', {}) |
|
|
|
|
|
|
|
} finally { |
|
|
|
this.state.isReady = true |
|
|
|
} finally { |
|
|
|
this.state.isReady = true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|