|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import { AbstractMesh, Vector3 } from "@babylonjs/core"; |
|
|
|
|
import { PointerEventTypes, PointerInfo } from "@babylonjs/core/Events/pointerEvents"; |
|
|
|
|
import { EventState, Observer } from "@babylonjs/core/Misc/observable"; |
|
|
|
|
import { classToClass } from "class-transformer"; |
|
|
|
|
import { classToClass, plainToClass } from "class-transformer"; |
|
|
|
|
import { PlanComponent } from "src/app/pages/plan/plan.component"; |
|
|
|
|
import { DataManager } from "../../controller/data-manager"; |
|
|
|
|
import { EventManager } from "../../controller/event-manager/event-manager"; |
|
|
|
@ -1597,24 +1597,26 @@ export class MarkWindow extends UIBase {
|
|
|
|
|
getAllSandBoxTemplate() { |
|
|
|
|
let instance = this; |
|
|
|
|
this.allSandBoxTemplate = []; |
|
|
|
|
ServeManager.instance.getAllMarkTemplate((data: string) => { |
|
|
|
|
ServeManager.instance.getAllMarkTemplate((data: any) => { |
|
|
|
|
if (data == null) { |
|
|
|
|
instance.allSandBoxTemplate = []; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
|
|
|
|
|
console.log("getAllSandBoxTemplate", data); |
|
|
|
|
instance.allSandBoxTemplate = data; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取一个模板的详细内容 |
|
|
|
|
* 根据模板创建一个应急预案 |
|
|
|
|
* @param id
|
|
|
|
|
*/ |
|
|
|
|
getOneSandBoxTemplate(id: number) { |
|
|
|
|
addMarkPlanByTemplate(id: number) { |
|
|
|
|
let instance = this; |
|
|
|
|
ServeManager.instance.getOneMarkTemplate(id, (data: string) => { |
|
|
|
|
|
|
|
|
|
ServeManager.instance.getOneMarkTemplate(id, (data: any) => { |
|
|
|
|
let value = plainToClass(MarkPlanData, data); |
|
|
|
|
instance.allMarkPlanData.createPlanDataByTemplate(value); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -1627,7 +1629,7 @@ export class MarkWindow extends UIBase {
|
|
|
|
|
*/ |
|
|
|
|
saveToSandBoxTemplate(data: MarkPlanData) { |
|
|
|
|
let name: string = data.name; |
|
|
|
|
let id: number = new Date().getTime(); |
|
|
|
|
let id: number = Math.ceil(new Date().getTime() * 0.001); |
|
|
|
|
let instance = this; |
|
|
|
|
ServeManager.instance.saveOneMarkTemplate(id, name, data, (data: string) => { |
|
|
|
|
|
|
|
|
|