Browse Source

[修改]修改logo 以及修正因为输入框限制的出现的不能保存基本信息的问题

develop
邵佳豪 5 years ago
parent
commit
007cf2292e
  1. 2
      src/app/navigation/navigation.component.html
  2. 4
      src/app/ui/basicinfo/basicinfo.component.html
  3. 10
      src/app/ui/basicinfo/basicinfo.component.scss
  4. 265
      src/app/ui/basicinfo/basicinfo.component.ts
  5. 7
      src/app/ui/basicinfo/lookmaster.component.html
  6. 4
      src/app/ui/basicinfo/lookmaster.component.ts
  7. BIN
      src/assets/images/logo2.png

2
src/app/navigation/navigation.component.html

@ -2,7 +2,7 @@
<mat-sidenav-container class="example-container" autosize [class.myapp-dark-theme]="darktheme">
<mat-sidenav #drawer class="example-sidenav" mode="side" opened="true" color="primary" style="overflow-x: hidden;">
<div class="biglogobox">
<img src="../../assets/images/logo.png" alt="">
<img src="../../assets/images/logo2.png" alt="">
</div>
<div class="navbox">
<ul>

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

@ -220,7 +220,7 @@
<div class="deviceinfo">
<div style="width: 200px;">
<mat-checkbox (change)="checkboxchange(item.buildingBasicGroups[1].submitted)" name="item.buildingBasicGroups[1].name" *ngIf="item.buildingBasicGroups[1].isOptional" [(ngModel)]="item.buildingBasicGroups[1].submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
<mat-checkbox (change)="checkboxchange(item.buildingBasicGroups[1].submitted,$event)" name="item.buildingBasicGroups[1].name" *ngIf="item.buildingBasicGroups[1].isOptional" [(ngModel)]="item.buildingBasicGroups[1].submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">{{item.buildingBasicGroups[1].name}}</h1>
</div>
@ -258,7 +258,7 @@
</div>
<div style="width: 200px;">
<mat-checkbox (change)="checkboxchange(item)" *ngIf="item.buildingBasicGroups[2].isOptional" name="item.buildingBasicGroups[2].name" [(ngModel)]="item.buildingBasicGroups[2].submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
<mat-checkbox (change)="checkboxchange(item,$event)" *ngIf="item.buildingBasicGroups[2].isOptional" name="item.buildingBasicGroups[2].name" [(ngModel)]="item.buildingBasicGroups[2].submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">储罐信息</h1>
</div>

10
src/app/ui/basicinfo/basicinfo.component.scss

@ -225,23 +225,23 @@ textarea {
}
.img2{
transform:rotate(180deg);
height: 100%;
// height: 100%;
}
.img3{
transform:rotate(270deg) scale(0.55);
height: 100%;
// height: 100%;
}
.img4{
transform:rotate(90deg) scale(1.3);
height: 100%;
// height: 100%;
}
.img5{
transform:rotate(180deg);
height: 100%;
// height: 100%;
}
.img6{
transform:rotate(270deg) scale(1.3);
height: 100%;
// height: 100%;
}
.imgbox{
text-align: center;

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

@ -112,9 +112,12 @@ export class BasicinfoComponent implements OnInit {
}
//石油化工装置信息勾选框
checkboxchange(e){
// console.log(e)
// console.log(this.houses[0])
checkboxchange(item,e){
item.buildingBasicGroups.forEach(item=>{
if(item.name != "基本信息" && item.name != "装置信息"){
item.submitted = e.checked
}
})
}
//获得所有单位类型
getallunittype() {
@ -317,14 +320,15 @@ export class BasicinfoComponent implements OnInit {
}
//删除自定义信息行数
deleteCustomData(item){
if(item.buildingCustomData.customProperties.length>1){
item.buildingCustomData.customProperties.pop()
}else{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('已达最小值,无法删除','确定',config);
}
// if(item.buildingCustomData.customProperties.length>1){
// item.buildingCustomData.customProperties.pop()
// }else{
// const config = new MatSnackBarConfig();
// config.verticalPosition = 'top';
// config.duration = 3000
// this.snackBar.open('已达最小值,无法删除','确定',config);
// }
item.buildingCustomData.customProperties.pop()
}
//得到建筑信息数据并进行处理
getunitallbuilding(){
@ -349,9 +353,9 @@ export class BasicinfoComponent implements OnInit {
let _data = data
this.http.get("/api/CompanyAccount/BuildingCustomData",{params:{
buildingId:n.id
}}).subscribe(data=>{
}}).subscribe((data:any)=>{
_data[0].buildingCustomData = data
if(data){
if(data && data.customProperties.length != 0){
_data[0].isCustomData = true
}else{
_data[0].isCustomData = false
@ -1050,11 +1054,11 @@ export class BasicinfoComponent implements OnInit {
err=>{
alert("名称和类型保存失败")
})
if(value.checkbuilding){//如果勾选了自定义信息的checkbox
let CustomDataval = []
var CustomDataval = []
for (const key in value) {
if (key.indexOf("CustomData") != -1) {
// CustomData[key] = value[key]
CustomDataval.push(value[key])
}
}
@ -1075,6 +1079,20 @@ export class BasicinfoComponent implements OnInit {
buildingId:item.buildingId
}}).subscribe(data=>{
},
err=>{
alert("自定义信息保存失败")
})
}else{
let CustomDatabody = {
id: "",
customProperties: [],
buildingId: item.buildingId
}
this.http.post("/api/CompanyAccount/BuildingCustomData",CustomDatabody,{params:{
buildingId:item.buildingId
}}).subscribe(data=>{
},
err=>{
alert("自定义信息保存失败")
@ -1270,7 +1288,7 @@ export class BasicinfoComponent implements OnInit {
if(bodyObj.buildingBasicGroups[2].submitted){//如果没有勾选储罐信息 则直接提交当前bodyObj
if(bodyObj.buildingBasicGroups[2].submitted){ //如果没有勾选储罐信息 则直接提交当前bodyObj
var map = {}; //用于存储石油化工要提交的储罐信息表单
for (let key in value) {
if (key.indexOf('tanker') != -1) {
@ -1638,7 +1656,7 @@ export class BasicinfoComponent implements OnInit {
bodyObj.buildingBasicGroups.push(basictankchildinfobody)
});
}else{
// console.log(666,bodyObj)
console.log(66666,bodyObj)
bodyObj.buildingBasicGroups[2].buildingId = item.buildingId
bodyObj.buildingBasicGroups[2].companyId = this.unitinfo.id
bodyObj.buildingBasicGroups[2].propertyInfos.forEach(item=>{
@ -1646,8 +1664,217 @@ export class BasicinfoComponent implements OnInit {
})
bodyObj.buildingBasicGroups[3].buildingId = item.buildingId
bodyObj.buildingBasicGroups[3].companyId = this.unitinfo.id
}
bodyObj.buildingBasicGroups[3].propertyInfos = [
{
propertyName: "罐区",
propertyValue: "",
propertyType: 0,
required: false,
ruleName: "",
ruleValue: "",
physicalUnit: "",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "储罐编号",
propertyValue: "",
propertyType: 0,
required: true,
ruleName: "",
ruleValue: "",
physicalUnit: "",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "储存介质",
propertyValue: "",
propertyType: 0,
required: true,
ruleName: "",
ruleValue: "",
physicalUnit: "",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "储罐类型",
propertyValue:"",
propertyType: 0,
required: true,
ruleName: "",
ruleValue: "",
physicalUnit: "",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "容量",
propertyValue: "",
propertyType: 2,
required: true,
ruleName: "",
ruleValue: "",
physicalUnit: "㎡",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "直径",
propertyValue:"",
propertyType: 2,
required: true,
ruleName: "",
ruleValue: "",
physicalUnit: "m",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "高度",
propertyValue: "",
propertyType: 2,
required: true,
ruleName: "",
ruleValue: "",
physicalUnit: "m",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "顶盖形式",
propertyValue: "",
propertyType: 0,
required: false,
ruleName: "",
ruleValue: "",
physicalUnit: "",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "浮盘材质",
propertyValue:"",
propertyType: 0,
required: false,
ruleName: "",
ruleValue: "",
physicalUnit: "",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "浮盘类型",
propertyValue: "",
propertyType: 0,
required: false,
ruleName: "",
ruleValue: "",
physicalUnit: "",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "泡沫产生器型号",
propertyValue:"",
propertyType: 0,
required: false,
ruleName: "",
ruleValue: "",
physicalUnit: "",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "泡沫产生器形式",
propertyValue: "",
propertyType: 0,
required: false,
ruleName: "",
ruleValue: "",
physicalUnit: "",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "是否设置氮封惰化保护装置",
propertyValue:"",
propertyType: 0,
required: false,
ruleName: "",
ruleValue: "",
physicalUnit: "",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "防护堤高度",
propertyValue:"",
propertyType: 2,
required: true,
ruleName: "",
ruleValue: "",
physicalUnit: "m",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "半固定泡沫灭火接口数量",
propertyValue: "",
propertyType: 2,
required: false,
ruleName: "",
ruleValue: "",
physicalUnit: "个",
order: 0,
enabled: true,
visible: true,
tag:"1"
},
{
propertyName: "其他设施",
propertyValue: "",
propertyType: 0,
required: false,
ruleName: "",
ruleValue: "",
physicalUnit: "",
order: 0,
enabled: true,
visible: true,
tag:"1"
}
]
}

7
src/app/ui/basicinfo/lookmaster.component.html

@ -2,7 +2,8 @@
<div >
<div>
<div class="imgbox">
<img class="imgitemdefault" [src]="ImgUrl" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" >
<img class="imgitemdefault" [src]="ImgUrl">
<!-- <img class="imgitemdefault" [src]="ImgUrl" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" > -->
</div>
</div>
@ -11,6 +12,6 @@
<div class="swiper-button-next"></div> -->
</div>
<div class="previewImgBottom">
<!-- <div class="previewImgBottom">
<button type="button" mat-icon-button (click)='rotate()'><mat-icon>refresh</mat-icon></button>
</div>
</div> -->

4
src/app/ui/basicinfo/lookmaster.component.ts

@ -53,5 +53,9 @@ import { MatSnackBar } from '@angular/material/snack-bar';
}
console.log(this.rotateA)
}
}

BIN
src/assets/images/logo2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Loading…
Cancel
Save