Browse Source

新增编辑预案名称

dev
陈鹏飞 3 years ago
parent
commit
84d3c4e9a7
  1. 17
      src/app/pages/left-domain/left-domain.component.html
  2. 2
      src/app/pages/left-domain/left-domain.component.scss
  3. 16
      src/app/pages/left-domain/left-domain.component.ts

17
src/app/pages/left-domain/left-domain.component.html

@ -140,7 +140,12 @@
<div class="publicBox disposalPlan" *ngIf="beforeFence === 7 && allMarkPlanData">
<div class="interval" *ngFor="let item of allMarkPlanData.datas;let key = index;">
<div class="publicDisposal disposalHeader">
{{item.name}}<label *ngIf="editMode"><i nz-icon nzType="plus-circle" nzTheme="outline" (click)="addNodePop = item.id;"></i><i nz-icon nzType="delete" nzTheme="outline" (click)="deleteDisposal(item)"></i></label>
{{item.name}}
<label *ngIf="editMode">
<i nz-icon nzType="plus-circle" nzTheme="outline" (click)="addNodePop = item.id;"></i>
<i nz-icon nzType="edit" nzTheme="outline" (click)="openEditDisposal(item)"></i>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteDisposal(item)"></i>
</label>
</div>
<ul>
<li class="publicDisposal disposalContent" *ngFor="let items of item.nodes;let keys = index;">
@ -162,6 +167,16 @@
</nz-form-item>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="editSelectDisposal" nzTitle="编辑预案名称" (nzOnCancel)="editSelectDisposal = null;" (nzOnOk)="editDisposal(editForm.value)" [nzOkDisabled]='name.invalid'>
<form nz-form #editForm='ngForm'>
<nz-form-item>
<nz-form-label [nzSpan]="6">预案名称</nz-form-label>
<nz-form-control [nzSpan]="18" nzErrorTip="请输入必填项">
<input nz-input #name='ngModel' [(ngModel)]="editDisposalName" name="name" required/>
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="saveDisposalDialog" nzTitle="处置节点保存" (nzOnCancel)="saveDisposalDialog = false;" [nzFooter]="null">
<div class="submitBottom">
<button (click)='saveNode(true)'>新建节点并保存</button><button (click)='saveNode(false)'>保存到已有节点</button>

2
src/app/pages/left-domain/left-domain.component.scss

@ -90,7 +90,7 @@
line-height: 35px;
color: #23D9FF;
padding-left: 20px;
label{ float: right; .anticon{ margin-right: 15px; font-size: 18px; cursor: pointer; } }
label{ float: right; .anticon{ margin-right: 10px; font-size: 18px; cursor: pointer; } }
span{ cursor: pointer; }
}
.disposalContent { color: #fff; .anticon{ color: #23D9FF; } }

16
src/app/pages/left-domain/left-domain.component.ts

@ -178,6 +178,21 @@ export class LeftDomainComponent implements OnInit {
}
}
editSelectDisposal: MarkPlanData = null; //编辑预案名称 选中预案
editDisposalName: string = null; //显示/隐藏 编辑预案名称 弹窗
//打开 编辑预案名称弹窗
openEditDisposal(item: MarkPlanData) {
this.editSelectDisposal = item;
this.editDisposalName = JSON.parse(JSON.stringify(item.name))
}
//编辑预案名称
editDisposal(e) {
this.editSelectDisposal.name = e.name
this.editSelectDisposal = null
}
//删除预案/节点
deleteDisposal(item: MarkPlanData, e?: MarkNodeData) {
let isTrue = confirm('您确定要删除吗')
@ -202,7 +217,6 @@ export class LeftDomainComponent implements OnInit {
if (ModeManager.currentMode == ModeType.Edit) {
isTrue = confirm('切换节点后,没保存的信息将会丢失!')
}
if (isTrue) {
this.selectPlanId = item.id
this.selectNodeId = e.id

Loading…
Cancel
Save