diff --git a/src/app/key-unit/basicinfo/basicinfo.component.html b/src/app/key-unit/basicinfo/basicinfo.component.html
index 57c48e2..13d7609 100644
--- a/src/app/key-unit/basicinfo/basicinfo.component.html
+++ b/src/app/key-unit/basicinfo/basicinfo.component.html
@@ -108,7 +108,8 @@
' +
'

' +
@@ -179,13 +159,9 @@ export class BasicinfoComponent implements OnInit {
this.map.setCity('上海市');
}
}
-
-
markerPosition2
//点击位置按钮
setPosition(){
-
-
this.isGisTopBox = false
this.isGisTopBoxTwo = true
if(this.isMapLabel){//如果已经标注单位坐标
@@ -304,12 +280,14 @@ export class BasicinfoComponent implements OnInit {
}
//获得所有单位类型
+ allunittype: any //所有单位类型
getallunittype() {
this.http.get("/api/BuildingTypes/Simple").subscribe(data => {
this.allunittype = data
})
}
//获得所有组织机构
+ allorganizing:any = [] //所有组织机构
getorganization() {
this.http.get('/api/Organizations').subscribe(
(data: any) => {
@@ -323,15 +301,12 @@ export class BasicinfoComponent implements OnInit {
}else{//未标注
_this.isMapLabel = false
}
-
this.labelGis()
-
})
}
)
}
//获得当前单位的基本信息
- CompanyId
async getunitinfo(){
let result = await new Promise((resolve, reject) => {
this.http.get(`/api/Companies/${this.unitId}`).subscribe((data:any)=>{
@@ -367,8 +342,7 @@ export class BasicinfoComponent implements OnInit {
})
this.selectedorganization = str.substr(1)
}
- }
-
+ }
this.unitinfo = data
resolve(this.unitinfo)
this.selectedorganizationid = data.organizationId
@@ -383,6 +357,7 @@ export class BasicinfoComponent implements OnInit {
})
}
+
//石油化工 装置信息 勾选框
checkboxchange(item,e){
if(item.buildingBasicGroups){
@@ -395,13 +370,13 @@ export class BasicinfoComponent implements OnInit {
}
unitallbuilding:any = []//用于存储当前单位所有的建筑
- buildinginfoId:any = []//用于存储当前单位所有具体建筑的id
- presentbuildinfoId:any // 用于存储当前单位第一个建筑的id
+
+
bigfor:any//循环(储罐信息+罐区信息)大组
npdata:any = []
newnpdata:any //用于存储石油化工 储罐信息/罐区情况的 datasource
- basicCategoryId:any //当前单位所有建筑中位于第一个的建筑id
+
deviceinfodata:any=[];//用于存储石油化工装置信息的数组
zhuangzhiinfodatasource:any = [] //用于存储石油化工装置信息表格的数据来源
newzhuangzhiinfodatasource:any= []//存储石油化工装置信息表格的 datasource形式
@@ -575,7 +550,11 @@ export class BasicinfoComponent implements OnInit {
item.buildingCustomData.customProperties.pop()
}
//得到建筑信息数据并进行处理
- allBuildings:any
+ allBuildings:any //当前单位所有的建筑
+ houses: any = [] //存储当前单位的建筑信息
+ basicCategoryId:any //当前单位所有建筑中位于第一个的建筑类型id
+ presentbuildinfoId:any //用于存储当前单位第一个建筑的具体id
+ buildinginfoId:any = []//用于存储当前单位所有具体建筑的id
getunitallbuilding(){
this.houses = []
this.unitId = this.route.snapshot.queryParams.id
@@ -584,9 +563,9 @@ export class BasicinfoComponent implements OnInit {
companyId:this.unitId
}
}).subscribe(async (data:any)=>{ // 获得当前单位所有的建筑
+ console.log('所有建筑',data)
this.allBuildings = data
- // console.log(data)
- if(data.length != 0){
+ if(data.length != 0){//如果存在建筑
this.basicCategoryId = data[0].buildingTypes[0].id
this.presentbuildinfoId = data[0].id // 用于存储当前单位第一个建筑的id
for (let i = 0, length = data.length; i < length; i++) {//循环所有建筑
@@ -601,17 +580,19 @@ export class BasicinfoComponent implements OnInit {
buildingType:n.buildingTypes[0].id
}
}).subscribe((data)=>{
- //获得当前建筑自定义信息并且添加到item自定义属性上
+ //获得当前建筑自定义信息并且添加到建筑属性对象中
let _data = data
+ console.log('当前建筑信息'+index,data)
this.http.get("/api/BuildingCustomData",{params:{
buildingId:n.id
}}).subscribe((data:any)=>{
+ console.log('当前建筑自定义信息'+index,data)
_data[0].buildingCustomData = data
if(data && data.customProperties.length != 0){
_data[0].isCustomData = true
}else{
_data[0].isCustomData = false
- _data[0].buildingCustomData ={
+ _data[0].buildingCustomData = {
id: "",
customProperties: [
{
@@ -623,7 +604,7 @@ export class BasicinfoComponent implements OnInit {
}
}
})
- //为每个建筑添加自定义属性
+ //为每个建筑添加建筑名称等自定义属性 用于显示使用
data[0].buildingtypeId = n.buildingTypes[0].id
data[0].name = n.name
data[0].username = n.name
@@ -714,7 +695,6 @@ export class BasicinfoComponent implements OnInit {
this.houses.push(result) // 并且把他添加到 tab 总体数组中
}
}
- // console.log(666,this.houses)
})
}
@@ -1052,7 +1032,8 @@ export class BasicinfoComponent implements OnInit {
hasChild = (_: number, node: any) => node.expandable;
- imgsrc = "../../../assets/images/upload.jpg" //没有上传图片时显示的图片,当上传后就会被替换,即保存时需要传的图片地址参数
+ imgsrc = "" //没有上传图片时显示的图片,当上传后就会被替换,即保存时需要传的图片地址参数
+ noImgSrc = '../../../assets/images/upload.jpg'
// imgsrc = ""
imgUrl = ""//返回来的图片地址后缀
file: any; //上传的文件
@@ -1102,7 +1083,6 @@ export class BasicinfoComponent implements OnInit {
let shardSize = 5 * 1024 * 1024 //5MB一个分片
if (file && fileSize <= shardSize) { //上传文件<=5MB时
- // this.upload()
let formData = new FormData()
formData.append("file",file)
this.http.post(`/api/Objects/PlanPlatform/${sessionStorage.getItem('companyId')}`,formData).subscribe((data:any)=>{
@@ -1124,38 +1104,6 @@ export class BasicinfoComponent implements OnInit {
})
}
}
-
-
-
-
- //小于5MB不需要分块上传
- upload(){
- this.uploader.queue[0].upload();//开始上传
- this.uploader.queue[0].onSuccess = (response, status, headers) => {
- // 上传文件成功
- if (status == 201) {
- // 上传文件后获取服务器返回的数据
- const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.snackBar.open('上传成功','确定',config);
- this.isspinner = false
- let tempRes = JSON.parse(response);
- this.imgUrl = tempRes.objectName
- this.imgsrc = `/api/Objects/PlanPlatform/${this.imgUrl}?x-oss-process=image/resize,m_fill,h_170,w_299`
- }else {
- // 上传文件后获取服务器返回的数据错误
- }
- };
- this.uploader.queue[0].onError = (response, status, headers) => {
- if (status == 401) {
- const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.snackBar.open('上传失败','确定',config);
- }
- };
- }
//开始分块上传
async subsectionUploading () {
@@ -1194,7 +1142,6 @@ export class BasicinfoComponent implements OnInit {
this.imgsrc = `/api/Objects/PlanPlatform/${this.objectName}?x-oss-process=image/resize,m_fill,h_170,w_299`
this.isspinner = false
this.PartNumberETag = []
- this.uploader.clearQueue(); //清空input控件文件
})
}
//删除具体建筑