|
|
|
@ -31,12 +31,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
this.getTemplateData() |
|
|
|
|
this.getUnitData() |
|
|
|
|
this.tree = { |
|
|
|
|
json:this.treedate, |
|
|
|
|
json: this.treedate, |
|
|
|
|
config: this.treeConfig |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
//树形结构数据
|
|
|
|
|
treedate=[ |
|
|
|
|
//树形结构数据
|
|
|
|
|
treedate = [ |
|
|
|
|
{ |
|
|
|
|
"guid": "bc4c7a02-5379-4046-92be-12c67af4295a", |
|
|
|
|
"displayName": "Elentrix", |
|
|
|
@ -46,12 +46,12 @@ treedate=[
|
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
tree |
|
|
|
|
treeConfig = { |
|
|
|
|
] |
|
|
|
|
tree |
|
|
|
|
treeConfig = { |
|
|
|
|
nodeWidth: 90, |
|
|
|
|
nodeHeight: 60 |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
//获得单位信息
|
|
|
|
|
unitData: any |
|
|
|
@ -71,7 +71,7 @@ treeConfig = {
|
|
|
|
|
|
|
|
|
|
selectedItem: string = '封面' |
|
|
|
|
clickTitleItem(item) { |
|
|
|
|
this.addNumber=-1 |
|
|
|
|
this.addNumber = -1 |
|
|
|
|
item == '封面' ? this.selectedItem = '封面' : this.selectedItem = item.groupName |
|
|
|
|
if (this.selectedItem == '重点图示') { |
|
|
|
|
this.getAllBuildings() |
|
|
|
@ -90,7 +90,7 @@ treeConfig = {
|
|
|
|
|
} |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
this.allRealPicture = data |
|
|
|
|
this.getAllRealPicture().then(()=>{ |
|
|
|
|
this.getAllRealPicture().then(() => { |
|
|
|
|
console.log('实景图', this.allRealPicture) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
@ -143,7 +143,7 @@ treeConfig = {
|
|
|
|
|
item.attribute.push({ name: '', imgArr: [] }) |
|
|
|
|
} |
|
|
|
|
//通过左侧实景图增加分组
|
|
|
|
|
addkeyImgItemLeft(i){ |
|
|
|
|
addkeyImgItemLeft(i) { |
|
|
|
|
console.log(i) |
|
|
|
|
} |
|
|
|
|
//重点图示删除指定分组
|
|
|
|
@ -234,41 +234,41 @@ treeConfig = {
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//input key值,一个字符焦点消失问题
|
|
|
|
|
trackByFn(index){ |
|
|
|
|
trackByFn(index) { |
|
|
|
|
return index |
|
|
|
|
} |
|
|
|
|
//表格增加一行
|
|
|
|
|
addNumber=-1 |
|
|
|
|
addTd(key,i){ |
|
|
|
|
addNumber = -1 |
|
|
|
|
addTd(key, i) { |
|
|
|
|
this.addNumber++ |
|
|
|
|
//this.planTemplateData[key].attribute[i].push({tabletr:[]})
|
|
|
|
|
if(this.planTemplateData[key].attribute[i].tabletr==undefined){ |
|
|
|
|
this.planTemplateData[key].attribute[i].tabletr=[] |
|
|
|
|
if (this.planTemplateData[key].attribute[i].tabletr == undefined) { |
|
|
|
|
this.planTemplateData[key].attribute[i].tabletr = [] |
|
|
|
|
} |
|
|
|
|
this.planTemplateData[key].attribute[i].tabletr.push({tabletd:[]}) |
|
|
|
|
for(var j=0;j<this.planTemplateData[key].attribute[i].tableth.length;j++){ |
|
|
|
|
if(this.planTemplateData[key].attribute[i].tabletr!=undefined){ |
|
|
|
|
this.planTemplateData[key].attribute[i].tabletr[this.planTemplateData[key].attribute[i].tabletr.length-1].tabletd.push('') |
|
|
|
|
this.planTemplateData[key].attribute[i].tabletr.push({ tabletd: [] }) |
|
|
|
|
for (var j = 0; j < this.planTemplateData[key].attribute[i].tableth.length; j++) { |
|
|
|
|
if (this.planTemplateData[key].attribute[i].tabletr != undefined) { |
|
|
|
|
this.planTemplateData[key].attribute[i].tabletr[this.planTemplateData[key].attribute[i].tabletr.length - 1].tabletd.push('') |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
else { |
|
|
|
|
this.planTemplateData[key].attribute[i].tabletr[this.addNumber].tabletd.push('') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
} |
|
|
|
|
//表格删除一行
|
|
|
|
|
delTd(key,i){ |
|
|
|
|
delTd(key, i) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
if(this.planTemplateData[key].attribute[i].tabletr!=undefined){ |
|
|
|
|
this.planTemplateData[key].attribute[i].tabletr.splice(this.planTemplateData[key].attribute[i].tabletr.length-1,1) |
|
|
|
|
if (this.planTemplateData[key].attribute[i].tabletr != undefined) { |
|
|
|
|
this.planTemplateData[key].attribute[i].tabletr.splice(this.planTemplateData[key].attribute[i].tabletr.length - 1, 1) |
|
|
|
|
this.addNumber-- |
|
|
|
|
if(this.planTemplateData[key].attribute[i].tabletr.length==0){ |
|
|
|
|
this.addNumber=-1 |
|
|
|
|
if (this.planTemplateData[key].attribute[i].tabletr.length == 0) { |
|
|
|
|
this.addNumber = -1 |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
this.snackBar.open('请先增加一行!','确定',config); |
|
|
|
|
} else { |
|
|
|
|
this.snackBar.open('请先增加一行!', '确定', config); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|