陈鹏飞 3 years ago
parent
commit
ec7c9dff08
  1. 6
      src/app/pages/left-domain/left-domain.component.html
  2. 8
      src/app/pages/left-domain/left-domain.component.ts

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

@ -220,11 +220,11 @@
<nz-form-item *ngIf="addDisposalPop">
<nz-form-label [nzSpan]="6">选取模板</nz-form-label>
<nz-form-control>
<nz-select ngModel name="selectMould">
<nz-select [(ngModel)]="selectMould" name="selectMould">
<nz-option nzValue="" nzLabel="无"></nz-option>
<nz-option [nzValue]="item.id" [nzLabel]="item.name" *ngFor="let item of allSandBoxTemplate"></nz-option>
</nz-select>
<button nz-button style="margin-top: 5px;" (click)="deleteMould(form.value)">删除模板</button>
<button nz-button style="margin-top: 5px;" (click)="deleteMould(form.value)" *ngIf="userMode">删除模板</button>
</nz-form-control>
</nz-form-item>
</form>
@ -239,7 +239,7 @@
</nz-form-item>
</form>
<div *nzModalFooter>
<button nz-button nzType="primary" (click)="saveMould()">保存为模板</button>
<button nz-button nzType="primary" (click)="saveMould()" *ngIf="userMode">保存为模板</button>
<button nz-button nzType="default" (click)="editSelectDisposal = null;">取消</button>
<button nz-button nzType="primary" (click)="editDisposal(editForm.value)">确定</button>
</div>

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

@ -33,6 +33,7 @@ export class LeftDomainComponent implements OnInit {
}
editMode: boolean = true; //编辑/查看模式
userMode: boolean = ModeManager.s_isMakeMode; //是否为 内部权限
beforeFence: number; //当前选中功能栏
FacilityList: FacilityInfoUIItem[] = []; //统计设备 list
selectFacilityId: string = null; //选中设备 ID
@ -279,15 +280,18 @@ export class LeftDomainComponent implements OnInit {
this.addNodePop = id
}
selectMould: number = 0; //当前选择模板
//删除模板
deleteMould(e) {
if (e.selectMould) {
let isTrue = confirm('您确定要删除当前选中模板吗')
if (isTrue) {
// MarkWindow.instance.
MarkWindow.instance.deleteSandBoxTemplate(e.selectMould)
this.allSandBoxTemplate.splice(this.allSandBoxTemplate.findIndex(item => item.id === e.selectMould), 1)
this.selectMould = 0
}
}
console.log(e)
}
//保存为模板

Loading…
Cancel
Save