Browse Source

[完善]基本信息页面删除建筑时index优化

develop
邵佳豪 5 years ago
parent
commit
df790f67fb
  1. 2
      src/app/ui/basicinfo/basicinfo.component.html
  2. 12
      src/app/ui/basicinfo/basicinfo.component.ts

2
src/app/ui/basicinfo/basicinfo.component.html

@ -117,7 +117,7 @@
</div>
<div class="image" (click)="closeorganizationbox()">
<input id="selectedfile" type="file" ng2FileSelect [uploader]="uploader" (change)="filechange($event)" name="imgFile" accept=".jpg,.png,.jpeg">
<input id="selectedfile" type="file" ng2FileSelect [uploader]="uploader" (change)="filechange($event)" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
</div>
<div class="addbtn">

12
src/app/ui/basicinfo/basicinfo.component.ts

@ -875,11 +875,12 @@ export class BasicinfoComponent implements OnInit {
if(isdeleted){
//请求删除接口
this.http.delete(`/api/CompanyAccount/Buildings/${item.buildingId}`).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('删除成功','确定',config);
this.houses.splice(item.index,1)
this.houses.splice(this.houses.findIndex(items=>items==item),1)
})
}
}
@ -961,7 +962,7 @@ export class BasicinfoComponent implements OnInit {
isshowrule:boolean = false
rulevalue:any
inputchange(e,name,value,item){
console.log(e.target.value,name,value,item)
// console.log(e.target.value,name,value,item)
// console.log(item)
if(name == "≥"){
if(Number(e.target.value)< Number(value)){
@ -981,7 +982,7 @@ export class BasicinfoComponent implements OnInit {
}
if(name == "Range"){
let rangenum = value.split(",")
console.log(rangenum)
// console.log(rangenum)
if(Number(e.target.value) < Number(rangenum[0]) || Number(e.target.value) >= Number(rangenum[1])){
item.isshowrule = true
item.rulevalue = `请输入位于${Number(rangenum[0])}${Number(rangenum[1])-1}之间的值`
@ -1941,6 +1942,11 @@ export class BasicinfoComponent implements OnInit {
delete item.rulevalue
item.propertyValue = String(item.propertyValue)
});
newObj.buildingBasicGroups[1].propertyInfos.forEach(item => {
delete item.isshowrule
delete item.rulevalue
item.propertyValue = String(item.propertyValue)
});
newObj.buildingBasicGroups[0].buildingId = newObj.buildingId
newObj.buildingBasicGroups[0].companyId = this.unitinfo.id
newObj.buildingBasicGroups[1].buildingId = newObj.buildingId

Loading…
Cancel
Save