diff --git a/src/app/pages/left-domain/left-domain.component.ts b/src/app/pages/left-domain/left-domain.component.ts
index e9a9f83..89f580a 100644
--- a/src/app/pages/left-domain/left-domain.component.ts
+++ b/src/app/pages/left-domain/left-domain.component.ts
@@ -7,7 +7,9 @@ import { ConfigManager } from 'src/app/babylon/controller/config-manager';
import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-facility';
import { EventManager } from 'src/app/babylon/controller/event-manager/event-manager';
import { Event_GetAllMarkPlanData } from 'src/app/babylon/controller/event-manager/events/event-get-markplandata-success';
-import { AllMarkPlanData } from 'src/app/babylon/model/data/mark/mark-plan-data';
+import { AllMarkPlanData, MarkNodeData, MarkPlanData } from 'src/app/babylon/model/data/mark/mark-plan-data';
+import { MarkWindow } from 'src/app/babylon/view/mark-window/mark-window';
+import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'app-left-domain',
@@ -16,7 +18,7 @@ import { AllMarkPlanData } from 'src/app/babylon/model/data/mark/mark-plan-data'
})
export class LeftDomainComponent implements OnInit {
- constructor() { }
+ constructor(private message: NzMessageService) { }
ngOnInit(): void {
this.initComponent()
@@ -151,6 +153,51 @@ export class LeftDomainComponent implements OnInit {
allMarkPlanData: AllMarkPlanData; //处置预案节点数据
selectPlanId: number;
selectNodeId: number;
+ addDisposalPop: boolean = false; //显示/隐藏 创建预案弹窗
+ addNodePop: number = null; //显示/隐藏 创建节点 父节点ID
+
+ //创建预案/节点
+ addDisposal(e) {
+ if (this.addDisposalPop) { //创建预案
+ MarkWindow.instance.createMarkPlaneData(e.name)
+ this.addDisposalPop = false
+ } else { //创建节点
+ MarkWindow.instance.createMarkNodeData(this.addNodePop,e.name)
+ this.addNodePop = null
+ }
+ }
+
+ //删除预案/节点
+ deleteDisposal(item: MarkPlanData, e?: MarkNodeData) {
+ let isTrue = confirm('您确定要删除吗')
+ if (isTrue) {
+ if (!e) {
+ MarkWindow.instance.deleteMarkPlaneData(item.id)
+ } else {
+ MarkWindow.instance.deleteMarkNodeData(item.id, e.id)
+ }
+ }
+ }
+
+ //保存预案/节点
+ saveDisposal(markPlanId: number = null, nodeId: number = null) {
+ if (!MarkWindow.instance.currentMarkNodeInfo) { //未选中节点
+ this.message.info('还没有进行标绘,无法保存');
+ return
+ }
+ if (markPlanId === null && nodeId === null) { // 整体弹窗保存
+ this.saveDisposalDialog = true
+ } else {
+ if (this.selectPlanId === markPlanId && this.selectNodeId === nodeId) {
+ MarkWindow.instance.saveToOldNode(markPlanId,nodeId)
+ } else {
+ let isTrue = confirm('是否覆盖要保存的节点?')
+ isTrue? MarkWindow.instance.saveToOldNode(markPlanId,nodeId) : null
+ }
+ }
+ }
+
+ saveDisposalDialog: boolean = false; //整体保存预案 弹窗
//编辑信息
editInfo() {
diff --git a/src/app/pages/plan/plan.component.html b/src/app/pages/plan/plan.component.html
index 6f86f28..9fd0863 100644
--- a/src/app/pages/plan/plan.component.html
+++ b/src/app/pages/plan/plan.component.html
@@ -19,7 +19,7 @@
diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts
index 932f825..21b3608 100644
--- a/src/app/pages/plan/plan.component.ts
+++ b/src/app/pages/plan/plan.component.ts
@@ -59,17 +59,14 @@ export class PlanComponent implements OnInit {
loginStatus.getInstitutionListFromServe((result: InsitutionDataSimple[], data: any) => {
if (ModeManager.institutionDemoKey == ModeManager.c_demoKey_null) { //无指定测试单位,则为正式启动,根据当前单位key寻找
let key = 'ceshi';
- // console.log("获取数据", data);
let find = data.find(item => { return item.key === key })
if (find) { //如果在data中找到了对应的单位key,则表示已经有三维数据,直接进入
- // console.log("找到已有单位" + key);
this.beforeOneSatus = StatusManager.getStatus
(LoginSatus);
this.beforeOneSatus.onSelectInsSuccess(find)
} else { //如果没有找到对应的单位key,则调用新建单位
let isAdd = confirm('没有单位name,是否进行初始化?')
if (isAdd) {
let name = 'ceshi';
- console.log("没找到单位,新建" + key);
loginStatus.createInsitution(key, name);
}
}
@@ -141,6 +138,17 @@ export class PlanComponent implements OnInit {
return fenceType
}
+ //子组件 创建预案/保存
+ noticeChildComponent(type: boolean) {
+ if (this.isShowChildComponent && this.leftDomain) {
+ if (type) { //创建预案
+ this.leftDomain.addDisposalPop = true
+ } else { //整体保存
+ this.leftDomain.saveDisposal()
+ }
+ }
+ }
+
//切换 头部罩棚
toggleHeaderAwning(isOpen: boolean) {
this.isOpenAwning = isOpen;