Browse Source

预案模板功能

dev
刘向辉 3 years ago
parent
commit
569a1d0991
  1. 57
      src/app/babylon/controller/serve-manager.ts
  2. 9
      src/app/babylon/model/data/mark/mark-template-data.ts
  3. 54
      src/app/babylon/view/mark-window/mark-window.ts
  4. 43
      src/app/service/babylon/building-basic-infos.service.ts

57
src/app/babylon/controller/serve-manager.ts

@ -5,7 +5,7 @@ import { BuildingBasicInfosService } from "src/app/service/babylon/building-basi
import { ObjectsService } from "src/app/service/objects.service"; import { ObjectsService } from "src/app/service/objects.service";
import { ExportData } from "../model/data/institution/building/export-data"; import { ExportData } from "../model/data/institution/building/export-data";
import { InsitutionDataSimple } from "../model/data/institution/institution-data-simple"; import { InsitutionDataSimple } from "../model/data/institution/institution-data-simple";
import { AllMarkPlanData } from "../model/data/mark/mark-plan-data"; import { AllMarkPlanData, MarkPlanData } from "../model/data/mark/mark-plan-data";
import { DataManager } from "./data-manager"; import { DataManager } from "./data-manager";
import { ModeManager, ModeType } from "./mode-manager"; import { ModeManager, ModeType } from "./mode-manager";
@ -159,6 +159,61 @@ export class ServeManager {
//#endregion //#endregion
//#region 态势标会模板
/**
*
* @param onSuccess
*/
getAllMarkTemplate(onSuccess?: (data: string) => void) {
this.buildingBISrv.getAllSandBoxTemplate()
.subscribe(data => {
console.log("得到所有模板", data);
if (onSuccess) {
// onSuccess( JSON.parse((data as any).result));
}
}, error => {
console.error("From serve:AllMarkTemplate", error);
})
}
/**
*
*/
getOneMarkTemplate(id: number, onSuccess?: (data: string) => void) {
this.buildingBISrv.getSandBoxTemplate(id).
subscribe(data => {
console.log("得到单个模板" + id, data);
if (onSuccess) {
// onSuccess( JSON.parse((data as any).result));
}
}, error => {
console.error("From serve:OneMarkTemplate", error);
})
}
/**
*
* @param id
* @param name
* @param data
* @param onSuccess
*/
saveOneMarkTemplate(id: number, name: string, data: MarkPlanData, onSuccess?: (data: string) => void) {
this.buildingBISrv.postSandBoxTemplate(name, id, data).
subscribe(data => {
console.log("保存单个模板" + id, data);
if (onSuccess) {
// onSuccess( JSON.parse((data as any).result));
}
}, error => {
console.error("From serve:OneMarkTemplate", error);
})
}
//#endregion
//#region 导出excel的信息 //#region 导出excel的信息

9
src/app/babylon/model/data/mark/mark-template-data.ts

@ -0,0 +1,9 @@
import { MarkPlanData } from "./mark-plan-data";
/**
*
*/
export class MarkTemplate {
id: number;
name: string;
}

54
src/app/babylon/view/mark-window/mark-window.ts

@ -11,6 +11,7 @@ import { Event_MarkInfoChange, MarkInfoChangeType } from "../../controller/event
import { InputController } from "../../controller/inputController"; import { InputController } from "../../controller/inputController";
import { ModeManager, ModeType } from "../../controller/mode-manager"; import { ModeManager, ModeType } from "../../controller/mode-manager";
import { SceneManager } from "../../controller/scene-manager"; import { SceneManager } from "../../controller/scene-manager";
import { ServeManager } from "../../controller/serve-manager";
import { BuildingStatus } from "../../controller/status/building-status"; import { BuildingStatus } from "../../controller/status/building-status";
import { IndoorStatus } from "../../controller/status/indoor-status"; import { IndoorStatus } from "../../controller/status/indoor-status";
import { StatusManager } from "../../controller/status/status-manager"; import { StatusManager } from "../../controller/status/status-manager";
@ -18,6 +19,7 @@ import { UIManager } from "../../controller/ui-manager";
import { ArcRotateCameraData } from "../../model/data/camera-data"; import { ArcRotateCameraData } from "../../model/data/camera-data";
import { MarkData, MarkKindType, MarkTagPos, MarkType } from "../../model/data/mark/mark-data"; import { MarkData, MarkKindType, MarkTagPos, MarkType } from "../../model/data/mark/mark-data";
import { AllMarkPlanData, MarkNodeData, MarkPlanData, WeatherType, WindDirectionType, EnvironmentData, NatureData } from "../../model/data/mark/mark-plan-data"; import { AllMarkPlanData, MarkNodeData, MarkPlanData, WeatherType, WindDirectionType, EnvironmentData, NatureData } from "../../model/data/mark/mark-plan-data";
import { MarkTemplate } from "../../model/data/mark/mark-template-data";
import { ModelType } from "../../model/data/model-data/model-data"; import { ModelType } from "../../model/data/model-data/model-data";
import { FacilityType } from "../../model/data/model-data/model-data-facility"; import { FacilityType } from "../../model/data/model-data/model-data-facility";
import { BuildingInfo } from "../../model/info/building/building-info"; import { BuildingInfo } from "../../model/info/building/building-info";
@ -1329,11 +1331,11 @@ export class MarkWindow extends UIBase {
let markData = environmentData.markDatas[i]; let markData = environmentData.markDatas[i];
if (markData.belongtoBuildingId == key) { //if (markData.belongtoBuildingId == key) {
this.createMark(0, markData, false, null, buildingInfo, true, null, (modelInfo: ModelInfo_mark) => { this.createMark(0, markData, false, null, buildingInfo, true, null, (modelInfo: ModelInfo_mark) => {
modelInfo.showFollowUI(instance.isShowProperty3d); modelInfo.showFollowUI(instance.isShowProperty3d);
}); });
} //}
} }
this.shouWaterSource(this.isShowWaterSource); this.shouWaterSource(this.isShowWaterSource);
@ -1581,5 +1583,53 @@ export class MarkWindow extends UIBase {
//#endregion //#endregion
//#region 应急模板
/**
*
*/
allSandBoxTemplate: MarkTemplate[];
/**
*
*/
getAllSandBoxTemplate() {
let instance = this;
this.allSandBoxTemplate = [];
ServeManager.instance.getAllMarkTemplate((data: string) => {
});
}
/**
*
* @param id
*/
getOneSandBoxTemplate(id: number) {
let instance = this;
ServeManager.instance.getOneMarkTemplate(id, (data: string) => {
})
}
/**
*
* @param id
* @param name
* @param data
*/
saveToSandBoxTemplate(id: number, name: string, data: MarkPlanData) {
let instance = this;
ServeManager.instance.saveOneMarkTemplate(id, name, data, (data: string) => {
});
}
//#endregion
} }

43
src/app/service/babylon/building-basic-infos.service.ts

@ -29,6 +29,17 @@ export class BuildingBasicInfosService {
*/ */
readonly api_excelData = "api/Services/3D/GasStationExcelData"; readonly api_excelData = "api/Services/3D/GasStationExcelData";
/**
*
*/
readonly api_sandBoxTemplate = "api/Services/3D/SandboxTemplate";
/**
*
*/
readonly api_sandBoxTemplateGetAll = "api/Services/3D/SandboxTemplate/GetAll";
/** /**
* *
@ -74,6 +85,38 @@ export class BuildingBasicInfosService {
} }
/**
*
* @param id
*/
getSandBoxTemplate(id: number) {
return this.getInfos(this.api_sandBoxTemplate, { "Id": id });
}
/**
*
* get封装
* @param id
*/
getAllSandBoxTemplate() {
return this.http.get<string>(this.api_sandBoxTemplateGetAll).pipe(
catchError((err) => this.handleError(err))
);
}
/**
*
* @param name
* @param id
* @param data
*/
postSandBoxTemplate(name: string, id: number, data: object) {
return this.postInfos(this.api_sandBoxTemplate, data, { name: name, "Id": id });
}
//#region 通用封装,新增api时调用即可,不需关心具体组装规则。若修改规则,只需修改此通用封装 //#region 通用封装,新增api时调用即可,不需关心具体组装规则。若修改规则,只需修改此通用封装
/** /**
* get类api所需的固定内容 * get类api所需的固定内容

Loading…
Cancel
Save