Browse Source

[完善] 查看/编辑模式切换

zhuzhou
陈鹏飞 4 years ago
parent
commit
0893958222
  1. 2
      src/app/ui/collection-tools-building/collection-tools.component.html
  2. 26
      src/app/ui/collection-tools-building/collection-tools.component.ts
  3. 2
      src/app/ui/collection-tools-plan/collection-tools.component.html
  4. 23
      src/app/ui/collection-tools-plan/collection-tools.component.ts
  5. 2
      src/app/ui/collection-tools/collection-tools.component.html
  6. 27
      src/app/ui/collection-tools/collection-tools.component.ts

2
src/app/ui/collection-tools-building/collection-tools.component.html

@ -24,7 +24,7 @@
<span class="rightSave"> <span class="rightSave">
<!-- <mat-icon title="查看/编辑模式" (click)="lookpat()" *ngIf="isEditPattern">tv</mat-icon> <!-- <mat-icon title="查看/编辑模式" (click)="lookpat()" *ngIf="isEditPattern">tv</mat-icon>
<mat-icon title="查看/编辑模式" (click)="editpat()" *ngIf="!isEditPattern && isediticon">create</mat-icon> --> <mat-icon title="查看/编辑模式" (click)="editpat()" *ngIf="!isEditPattern && isediticon">create</mat-icon> -->
<label title="保存" (click)="saveSite()"><mat-icon>description</mat-icon>保存</label> <label title="保存" (click)="saveSite()" *ngIf="isEditPattern"><mat-icon>description</mat-icon>保存</label>
</span> </span>
</div> </div>

26
src/app/ui/collection-tools-building/collection-tools.component.ts

@ -607,23 +607,17 @@ export class CollectionToolsBuildingComponent implements OnInit {
this.canvasData.isChange = true this.canvasData.isChange = true
} }
isSixShow = true
isSixbtn = true //控制想定作业编辑按钮
isediticon = true //控制查看编辑模式的编辑模式小笔按钮 isediticon = true //控制查看编辑模式的编辑模式小笔按钮
ngOnInit(): void { ngOnInit(): void {
if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1 || this.router.url.indexOf("keyUnit/editplaninfo")!= -1){ if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1){ //查看模式
this.isSixbtn = false
}
if(!this.isSixbtn && sessionStorage.getItem("six") == "edit"){
this.isSixShow = true
}
if(!this.isSixbtn && sessionStorage.getItem("six") == "look"){
this.isEditPattern = false this.isEditPattern = false
this.isediticon = false this.isediticon = false
this.canvasData.gameMode = GameMode.Assignment
} else if (this.router.url.indexOf("keyUnit/editplaninfo")!= -1) { //编辑模式
this.canvasData.gameMode = GameMode.BasicInformation
} }
//gis模块平面图 //gis模块平面图
if(this.router.url.indexOf("gis") != -1 && sessionStorage.getItem("gisplan") == "look"){ if(this.router.url.indexOf("gis") != -1 && sessionStorage.getItem("gisplan") == "look"){
this.isEditPattern = false this.isEditPattern = false
@ -641,7 +635,7 @@ export class CollectionToolsBuildingComponent implements OnInit {
event.preventDefault(); event.preventDefault();
}; };
}) })
this.canvasData.getMessage().subscribe((message: any)=>{ this.canvasData.getMessage().subscribe((message: any)=>{
if(message == "send a message"){ if(message == "send a message"){
this.refurbishTreeData() this.refurbishTreeData()
@ -652,10 +646,10 @@ export class CollectionToolsBuildingComponent implements OnInit {
ngAfterViewInit(): void { ngAfterViewInit(): void {
//gis模块平面图 //不是gis模块平面图
if(this.router.url.indexOf("gis") == -1) { if(this.router.url.indexOf("gis") == -1) {
this.getAllBuildings(true) //获取所有建筑 this.getAllBuildings(true) //获取所有建筑
} }
// 监听canvas组件选中素材事件 // 监听canvas组件选中素材事件
this.canvas.on("select",obj=>{ this.canvas.on("select",obj=>{
//选中素材属性注入函数 //选中素材属性注入函数

2
src/app/ui/collection-tools-plan/collection-tools.component.html

@ -24,7 +24,7 @@
<span class="rightSave"> <span class="rightSave">
<!-- <mat-icon title="查看/编辑模式" (click)="lookpat()" *ngIf="isEditPattern">tv</mat-icon> <!-- <mat-icon title="查看/编辑模式" (click)="lookpat()" *ngIf="isEditPattern">tv</mat-icon>
<mat-icon title="查看/编辑模式" (click)="editpat()" *ngIf="!isEditPattern && isediticon">create</mat-icon> --> <mat-icon title="查看/编辑模式" (click)="editpat()" *ngIf="!isEditPattern && isediticon">create</mat-icon> -->
<label title="保存" (click)="saveSite()"><mat-icon>description</mat-icon>保存</label> <label title="保存" (click)="saveSite()" *ngIf="isEditPattern"><mat-icon>description</mat-icon>保存</label>
</span> </span>
</div> </div>

23
src/app/ui/collection-tools-plan/collection-tools.component.ts

@ -607,22 +607,17 @@ export class CollectionToolsPlanComponent implements OnInit {
this.canvasData.isChange = true this.canvasData.isChange = true
} }
isSixShow = true
isSixbtn = true //控制想定作业编辑按钮
isediticon = true //控制查看编辑模式的编辑模式小笔按钮 isediticon = true //控制查看编辑模式的编辑模式小笔按钮
ngOnInit(): void { ngOnInit(): void {
if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1 || this.router.url.indexOf("keyUnit/editplaninfo")!= -1){ if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1){ //查看模式
this.isSixbtn = false
}
if(!this.isSixbtn && sessionStorage.getItem("six") == "edit"){
this.isSixShow = true
}
if(!this.isSixbtn && sessionStorage.getItem("six") == "look"){
this.isEditPattern = false this.isEditPattern = false
this.isediticon = false this.isediticon = false
this.canvasData.gameMode = GameMode.Assignment
} else if (this.router.url.indexOf("keyUnit/editplaninfo")!= -1) { //编辑模式
this.canvasData.gameMode = GameMode.BasicInformation
} }
//gis模块平面图 //gis模块平面图
if(this.router.url.indexOf("gis") != -1 && sessionStorage.getItem("gisplan") == "look"){ if(this.router.url.indexOf("gis") != -1 && sessionStorage.getItem("gisplan") == "look"){
this.isEditPattern = false this.isEditPattern = false
@ -651,10 +646,10 @@ export class CollectionToolsPlanComponent implements OnInit {
ngAfterViewInit(): void { ngAfterViewInit(): void {
//gis模块平面图 //不是gis模块平面图
if(this.router.url.indexOf("gis") == -1) { if(this.router.url.indexOf("gis") == -1) {
this.getSitePlan() this.getSitePlan()
} }
// 监听canvas组件选中素材事件 // 监听canvas组件选中素材事件
this.canvas.on("select",obj=>{ this.canvas.on("select",obj=>{
//选中素材属性注入函数 //选中素材属性注入函数

2
src/app/ui/collection-tools/collection-tools.component.html

@ -58,7 +58,7 @@
<option value ="6">东北</option> <option value ="6">东北</option>
<option value ="7">西北</option> <option value ="7">西北</option>
</select> </select>
<label title="保存" (click)="saveSite()" class="rightSave"><mat-icon>description</mat-icon>保存</label> <label title="保存" (click)="saveSite()" class="rightSave" *ngIf="isEditPattern"><mat-icon>description</mat-icon>保存</label>
</div> </div>
</div> </div>

27
src/app/ui/collection-tools/collection-tools.component.ts

@ -619,28 +619,13 @@ export class CollectionToolsComponent implements OnInit {
this.canvasData.isChange = true this.canvasData.isChange = true
} }
isSixShow = true
isSixbtn = true //控制想定作业编辑按钮
isxxx = true //控制查看编辑模式的编辑模式按钮
ngOnInit(): void { ngOnInit(): void {
this.canvasData.gameMode = GameMode.Assignment
if(this.router.url.indexOf("keyUnit/viewunitinfoplan") == -1 && this.router.url.indexOf("keyUnit/viewunitinfo") != -1 || this.router.url.indexOf("keyUnit/editplaninfo")!= -1){
this.isSixbtn = false
}
if(!this.isSixbtn && sessionStorage.getItem("six") == "edit"){ this.canvasData.gameMode = GameMode.Assignment
this.isSixShow = true if (sessionStorage.getItem('editable') == "0") { //查看模式
}
if(!this.isSixbtn && sessionStorage.getItem("six") == "look"){
this.isEditPattern = false this.isEditPattern = false
this.isxxx = false } else {
}
if (sessionStorage.getItem('editable') == "0") {
this.isEditPattern = false
this.isxxx = false
} }
this.getAllLibrary('plan') //获取素材库 this.getAllLibrary('plan') //获取素材库
@ -655,18 +640,18 @@ export class CollectionToolsComponent implements OnInit {
event.preventDefault(); event.preventDefault();
}; };
}) })
this.canvasData.getMessage().subscribe((message: any)=>{ this.canvasData.getMessage().subscribe((message: any)=>{
if(message == "send a message"){ if(message == "send a message"){
this.refurbishTreeData() this.refurbishTreeData()
} }
}) })
} }
ngAfterViewInit(): void { ngAfterViewInit(): void {
this.getSitePlan() this.getSitePlan()
// 监听canvas组件选中素材事件 // 监听canvas组件选中素材事件
this.canvas.on("select",obj=>{ this.canvas.on("select",obj=>{
@ -2280,7 +2265,7 @@ export class CollectionToolsComponent implements OnInit {
if(selectPanelPoint.Data){ if(selectPanelPoint.Data){
for(let key in selectPanelPoint.Data.Stock){ //筛选数据 没有匹配全部放入到 其他 数组 for(let key in selectPanelPoint.Data.Stock){ //筛选数据 没有匹配全部放入到 其他 数组
let noMatch = this.allFireElements.find( every=> every.id===selectPanelPoint.Data.Stock[key].FireElementId ) let noMatch = this.allFireElements.find( every=> every.id===selectPanelPoint.Data.Stock[key].FireElementId )
if (!noMatch) { if (!noMatch && selectPanelPoint.Data.Stock[key].Id != "图例") {
this.allFireElements[this.allFireElements.length-1].children.push(selectPanelPoint.Data.Stock[key]) this.allFireElements[this.allFireElements.length-1].children.push(selectPanelPoint.Data.Stock[key])
} }
} }

Loading…
Cancel
Save