|
|
|
@ -40,8 +40,8 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); |
|
|
|
|
myControl = new FormControl(); |
|
|
|
|
hasChild = (_: number, node: any) => node.expandable; |
|
|
|
|
IsNewData=true //维护更新活新增
|
|
|
|
|
displayedColumns: string[] = ['state','planname', 'addpeople', 'addtime','planCategory', 'plantype', 'auditstate', 'weihustate','isopen', 'preparethelevel', 'operation']; |
|
|
|
|
IsNewData = true //维护更新活新增
|
|
|
|
|
displayedColumns: string[] = ['state', 'planname', 'addpeople', 'addtime', 'planCategory', 'plantype', 'auditstate', 'weihustate', 'isopen', 'preparethelevel', 'operation']; |
|
|
|
|
tabledataSource: any |
|
|
|
|
//分页
|
|
|
|
|
@ViewChild(MatPaginator, { static: true }) |
|
|
|
@ -109,45 +109,43 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
//查看预案
|
|
|
|
|
lookPlan(e) { |
|
|
|
|
if (e.planType == 16 || e.planType == 4 || e.planType == 8) { |
|
|
|
|
if (e.planType == 16&&e.attachmentUrls == null){ |
|
|
|
|
if (e.planType == 16 && e.attachmentUrls == null) { |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false`) |
|
|
|
|
}else{ |
|
|
|
|
var index = e.attachmentUrls[0].indexOf("\/") |
|
|
|
|
if (e.attachmentUrls[0].substr(0, index) == 'psw') { |
|
|
|
|
const dialogRef = this.dialog.open(PsViewer, { |
|
|
|
|
width: '1500px', |
|
|
|
|
height: '800px', |
|
|
|
|
data: e.attachmentUrls[0] |
|
|
|
|
}); |
|
|
|
|
} else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'JPG' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'png' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpeg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') { |
|
|
|
|
let data = e |
|
|
|
|
const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
data: data.attachmentUrls, |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
let fetchUrl = e.attachmentUrls[0] |
|
|
|
|
if (fetchUrl) { |
|
|
|
|
let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() |
|
|
|
|
if (suffix == 'docx' || suffix == 'doc') { |
|
|
|
|
let arr = fetchUrl.split('.') |
|
|
|
|
arr[arr.length - 1] = 'pdf' |
|
|
|
|
window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) |
|
|
|
|
} else if (suffix == 'pdf') { |
|
|
|
|
window.open(`/api/Objects/PlanPlatform/` + fetchUrl) |
|
|
|
|
} else { |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); |
|
|
|
|
var index = e.attachmentUrls[0].indexOf("\/") |
|
|
|
|
if (e.attachmentUrls[0].substr(0, index) == 'psw') { |
|
|
|
|
const dialogRef = this.dialog.open(PsViewer, { |
|
|
|
|
width: '1500px', |
|
|
|
|
height: '800px', |
|
|
|
|
data: e.attachmentUrls[0] |
|
|
|
|
}); |
|
|
|
|
} else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'JPG' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'png' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpeg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') { |
|
|
|
|
let data = e |
|
|
|
|
const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
data: data.attachmentUrls, |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(); |
|
|
|
|
} else { |
|
|
|
|
let fetchUrl = e.attachmentUrls[0] |
|
|
|
|
if (fetchUrl) { |
|
|
|
|
let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() |
|
|
|
|
if (suffix == 'docx' || suffix == 'doc') { |
|
|
|
|
let arr = fetchUrl.split('.') |
|
|
|
|
arr[arr.length - 1] = 'pdf' |
|
|
|
|
window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) |
|
|
|
|
} else if (suffix == 'pdf') { |
|
|
|
|
window.open(`/api/Objects/PlanPlatform/` + fetchUrl) |
|
|
|
|
} else { |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (e.planType == 1) { //如果是在线编辑
|
|
|
|
|
if (e.planType == 1 && e.planMode == 2) { //如果是在线编辑
|
|
|
|
|
let id = e.id |
|
|
|
|
sessionStorage.setItem("planId", id) |
|
|
|
|
sessionStorage.setItem("companyId", this.companyId) |
|
|
|
@ -157,7 +155,7 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
let companyId = sessionStorage.getItem("companyId") |
|
|
|
|
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); |
|
|
|
|
} |
|
|
|
|
if (e.planType == 2) { //如果是跳转网页
|
|
|
|
|
if (e.planType == 2 && e.planMode == 3) { //如果是跳转网页
|
|
|
|
|
if (e.url.indexOf('app') == 0) { |
|
|
|
|
window.location.href = e.url |
|
|
|
|
} else { |
|
|
|
@ -175,42 +173,12 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
if(e.openRange!='未公开'||e.auditStatus!=8){ |
|
|
|
|
if (e.openRange != '未公开' || e.auditStatus != 8) { |
|
|
|
|
let isTrue = confirm('您确定编辑吗,若是公开预案会变成未公开状态,审核状态也会改变') |
|
|
|
|
if(isTrue){ |
|
|
|
|
if (e.auditStatus == 8) { |
|
|
|
|
if (e.planType == 1) { //如果是在线编辑
|
|
|
|
|
let id = e.id |
|
|
|
|
let body = {}; |
|
|
|
|
let resetAudit = true |
|
|
|
|
let headers = new HttpHeaders({ |
|
|
|
|
'Content-Type': 'text/json' |
|
|
|
|
}); |
|
|
|
|
let options = { |
|
|
|
|
headers |
|
|
|
|
}; |
|
|
|
|
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
// this.lookPlan(e)
|
|
|
|
|
}) |
|
|
|
|
sessionStorage.setItem("planId", id) |
|
|
|
|
sessionStorage.setItem("companyId", this.companyId) |
|
|
|
|
sessionStorage.setItem("buildingTypeId", this.unittypeId) |
|
|
|
|
sessionStorage.setItem("editable", "1") |
|
|
|
|
sessionStorage.setItem("planName", e.name) |
|
|
|
|
let companyId = sessionStorage.getItem("companyId") |
|
|
|
|
window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); |
|
|
|
|
} |
|
|
|
|
else if (e.planType == 16) { |
|
|
|
|
if (e.attachmentUrls == null) { |
|
|
|
|
if(e.planMode==4){ |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) |
|
|
|
|
}else{ |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
if (isTrue) { |
|
|
|
|
if (e.auditStatus == 8) { |
|
|
|
|
if (e.planType == 1) { //如果是在线编辑
|
|
|
|
|
let id = e.id |
|
|
|
|
let body = {}; |
|
|
|
|
let resetAudit = true |
|
|
|
|
let headers = new HttpHeaders({ |
|
|
|
@ -220,61 +188,9 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
headers |
|
|
|
|
}; |
|
|
|
|
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { |
|
|
|
|
/* this.getAllPlanComponents() |
|
|
|
|
this.lookPlan(e) */ |
|
|
|
|
const dialogRef = this.dialog.open(editUpload, { |
|
|
|
|
width: "300px", |
|
|
|
|
height: "150px", |
|
|
|
|
data: { id:e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, |
|
|
|
|
disableClose: true |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(data => { |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
}) |
|
|
|
|
}/* ,err => { |
|
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|
|
} */) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if (e.planType == 2) { //三维预案
|
|
|
|
|
const dialogRef = this.dialog.open(ChangeUrl, { |
|
|
|
|
//改网址
|
|
|
|
|
data: { element: e } |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
|
data => { |
|
|
|
|
if (data) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('修改成功!', '确定', config); |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
//let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗')
|
|
|
|
|
if (e.planType == 1) { //如果是在线编辑
|
|
|
|
|
let id = e.id |
|
|
|
|
let body = {}; |
|
|
|
|
let resetAudit = true |
|
|
|
|
let headers = new HttpHeaders({ |
|
|
|
|
'Content-Type': 'text/json' |
|
|
|
|
}); |
|
|
|
|
let options = { |
|
|
|
|
headers |
|
|
|
|
}; |
|
|
|
|
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
// this.lookPlan(e)
|
|
|
|
|
}/* ,err => { |
|
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|
|
} */) |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
// this.lookPlan(e)
|
|
|
|
|
}) |
|
|
|
|
sessionStorage.setItem("planId", id) |
|
|
|
|
sessionStorage.setItem("companyId", this.companyId) |
|
|
|
|
sessionStorage.setItem("buildingTypeId", this.unittypeId) |
|
|
|
@ -285,8 +201,12 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
else if (e.planType == 16) { |
|
|
|
|
if (e.attachmentUrls == null) { |
|
|
|
|
console.log(this.compantData) |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&planMode=${e.planMode}`) |
|
|
|
|
if (e.planMode == 4) { |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) |
|
|
|
|
} else { |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
let body = {}; |
|
|
|
@ -298,10 +218,12 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
headers |
|
|
|
|
}; |
|
|
|
|
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { |
|
|
|
|
/* this.getAllPlanComponents() |
|
|
|
|
this.lookPlan(e) */ |
|
|
|
|
const dialogRef = this.dialog.open(editUpload, { |
|
|
|
|
width: "300px", |
|
|
|
|
height: "150px", |
|
|
|
|
data: { id:e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, |
|
|
|
|
data: { id: e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, |
|
|
|
|
disableClose: true |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(data => { |
|
|
|
@ -314,8 +236,8 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if (e.planType == 2) { //三维预案
|
|
|
|
|
|
|
|
|
|
const dialogRef = this.dialog.open(ChangeUrl, { |
|
|
|
|
//改网址
|
|
|
|
|
data: { element: e } |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
@ -326,20 +248,31 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('修改成功!', '确定', config); |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
//let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗')
|
|
|
|
|
if (e.planType == 1) { //如果是在线编辑
|
|
|
|
|
let id = e.id |
|
|
|
|
let body = {}; |
|
|
|
|
let resetAudit = true |
|
|
|
|
let headers = new HttpHeaders({ |
|
|
|
|
'Content-Type': 'text/json' |
|
|
|
|
}); |
|
|
|
|
let options = { |
|
|
|
|
headers |
|
|
|
|
}; |
|
|
|
|
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
// this.lookPlan(e)
|
|
|
|
|
}/* ,err => { |
|
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|
|
} */) |
|
|
|
|
sessionStorage.setItem("planId", id) |
|
|
|
|
sessionStorage.setItem("companyId", this.companyId) |
|
|
|
|
sessionStorage.setItem("buildingTypeId", this.unittypeId) |
|
|
|
@ -350,12 +283,8 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
else if (e.planType == 16) { |
|
|
|
|
if (e.attachmentUrls == null) { |
|
|
|
|
if(e.planMode==4){ |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) |
|
|
|
|
}else{ |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log(this.compantData) |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&planMode=${e.planMode}`) |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
let body = {}; |
|
|
|
@ -367,26 +296,24 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
headers |
|
|
|
|
}; |
|
|
|
|
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { |
|
|
|
|
|
|
|
|
|
const dialogRef = this.dialog.open(editUpload, { |
|
|
|
|
width: "300px", |
|
|
|
|
height: "150px", |
|
|
|
|
data: { id:e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, |
|
|
|
|
data: { id: e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, |
|
|
|
|
disableClose: true |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(data => { |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
}) |
|
|
|
|
//this.lookPlan(e)
|
|
|
|
|
}/* ,err => { |
|
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|
|
} */) |
|
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|
|
} */) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if (e.planType == 2) { //三维预案
|
|
|
|
|
|
|
|
|
|
const dialogRef = this.dialog.open(ChangeUrl, { |
|
|
|
|
//改网址
|
|
|
|
|
data: { element: e } |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
@ -397,76 +324,147 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('修改成功!', '确定', config); |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
/* if (e.url.indexOf('app') == 0) { |
|
|
|
|
window.location.href = e.url |
|
|
|
|
} else { |
|
|
|
|
sessionStorage.setItem("url", e.url) |
|
|
|
|
if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案
|
|
|
|
|
window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`) |
|
|
|
|
} else { |
|
|
|
|
window.open(`/planManagement/webLook`) |
|
|
|
|
} |
|
|
|
|
} */ |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); |
|
|
|
|
} |
|
|
|
|
/* else { |
|
|
|
|
if (e.planType == 1) { //如果是在线编辑
|
|
|
|
|
let id = e.id |
|
|
|
|
sessionStorage.setItem("planId", id) |
|
|
|
|
sessionStorage.setItem("companyId", this.companyId) |
|
|
|
|
sessionStorage.setItem("buildingTypeId", this.unittypeId) |
|
|
|
|
sessionStorage.setItem("editable", "1") |
|
|
|
|
sessionStorage.setItem("planName", e.name) |
|
|
|
|
let companyId = sessionStorage.getItem("companyId") |
|
|
|
|
window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); |
|
|
|
|
} |
|
|
|
|
else if (e.planType == 16) { |
|
|
|
|
if (e.attachmentUrls == null) { |
|
|
|
|
console.log(this.compantData) |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
let body = {}; |
|
|
|
|
let resetAudit = true |
|
|
|
|
let headers = new HttpHeaders({ |
|
|
|
|
'Content-Type': 'text/json' |
|
|
|
|
}); |
|
|
|
|
let options = { |
|
|
|
|
headers |
|
|
|
|
}; |
|
|
|
|
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
this.lookPlan(e) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if (e.planType == 2) { //三维预案
|
|
|
|
|
const dialogRef = this.dialog.open(ChangeUrl, { |
|
|
|
|
data: { element: e } |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
|
data => { |
|
|
|
|
if (data) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('修改成功!', '确定', config); |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (e.planType == 1) { //如果是在线编辑
|
|
|
|
|
let id = e.id |
|
|
|
|
sessionStorage.setItem("planId", id) |
|
|
|
|
sessionStorage.setItem("companyId", this.companyId) |
|
|
|
|
sessionStorage.setItem("buildingTypeId", this.unittypeId) |
|
|
|
|
sessionStorage.setItem("editable", "1") |
|
|
|
|
sessionStorage.setItem("planName", e.name) |
|
|
|
|
let companyId = sessionStorage.getItem("companyId") |
|
|
|
|
window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); |
|
|
|
|
} |
|
|
|
|
else if (e.planType == 16) { |
|
|
|
|
if (e.attachmentUrls == null) { |
|
|
|
|
if (e.planMode == 4) { |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) |
|
|
|
|
} else { |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&planMode=${e.planMode}`) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
let body = {}; |
|
|
|
|
let resetAudit = true |
|
|
|
|
let headers = new HttpHeaders({ |
|
|
|
|
'Content-Type': 'text/json' |
|
|
|
|
}); |
|
|
|
|
let options = { |
|
|
|
|
headers |
|
|
|
|
}; |
|
|
|
|
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { |
|
|
|
|
|
|
|
|
|
const dialogRef = this.dialog.open(editUpload, { |
|
|
|
|
width: "300px", |
|
|
|
|
height: "150px", |
|
|
|
|
data: { id: e.id, companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname }, |
|
|
|
|
disableClose: true |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(data => { |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
}) |
|
|
|
|
//this.lookPlan(e)
|
|
|
|
|
}/* ,err => { |
|
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|
|
} */) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if (e.planType == 2) { //三维预案
|
|
|
|
|
const dialogRef = this.dialog.open(ChangeUrl, { |
|
|
|
|
//改网址
|
|
|
|
|
data: { element: e } |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
|
data => { |
|
|
|
|
if (data) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('修改成功!', '确定', config); |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
/* if (e.url.indexOf('app') == 0) { |
|
|
|
|
window.location.href = e.url |
|
|
|
|
} else { |
|
|
|
|
sessionStorage.setItem("url", e.url) |
|
|
|
|
if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案
|
|
|
|
|
window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`) |
|
|
|
|
} else { |
|
|
|
|
window.open(`/planManagement/webLook`) |
|
|
|
|
} |
|
|
|
|
} */ |
|
|
|
|
} else { |
|
|
|
|
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); |
|
|
|
|
} |
|
|
|
|
/* else { |
|
|
|
|
if (e.planType == 1) { //如果是在线编辑
|
|
|
|
|
let id = e.id |
|
|
|
|
sessionStorage.setItem("planId", id) |
|
|
|
|
sessionStorage.setItem("companyId", this.companyId) |
|
|
|
|
sessionStorage.setItem("buildingTypeId", this.unittypeId) |
|
|
|
|
sessionStorage.setItem("editable", "1") |
|
|
|
|
sessionStorage.setItem("planName", e.name) |
|
|
|
|
let companyId = sessionStorage.getItem("companyId") |
|
|
|
|
window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); |
|
|
|
|
} |
|
|
|
|
else if (e.planType == 16) { |
|
|
|
|
if (e.attachmentUrls == null) { |
|
|
|
|
console.log(this.compantData) |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
let body = {}; |
|
|
|
|
let resetAudit = true |
|
|
|
|
let headers = new HttpHeaders({ |
|
|
|
|
'Content-Type': 'text/json' |
|
|
|
|
}); |
|
|
|
|
let options = { |
|
|
|
|
headers |
|
|
|
|
}; |
|
|
|
|
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
this.lookPlan(e) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if (e.planType == 2) { //三维预案
|
|
|
|
|
const dialogRef = this.dialog.open(ChangeUrl, { |
|
|
|
|
data: { element: e } |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
|
data => { |
|
|
|
|
if (data) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('修改成功!', '确定', config); |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -495,7 +493,7 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
//获得所有预案组件
|
|
|
|
|
audit:boolean |
|
|
|
|
audit: boolean |
|
|
|
|
getAllPlanComponents() { |
|
|
|
|
let pagetype = this.route.snapshot.queryParams.pagetype |
|
|
|
|
let unitId = this.route.snapshot.queryParams.unitId |
|
|
|
@ -531,6 +529,7 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
this.length = data.totalCount |
|
|
|
|
this.allPlanComponents = data |
|
|
|
|
this.tabledataSource = data.items |
|
|
|
|
console.log('预案列表', data.items) |
|
|
|
|
/* if(this.tabledataSource.isNewData){ |
|
|
|
|
this.tabledataSource.auditStatus==8?this.audit=true:false |
|
|
|
|
}else{ |
|
|
|
@ -550,7 +549,7 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
this.http.delete(`/api/PlanComponents2D/${plandata.id}`).subscribe(data => { |
|
|
|
|
this.snackBar.open('删除成功!', '确定', config); |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
},err=>{ |
|
|
|
|
}, err => { |
|
|
|
|
this.snackBar.open(err, '确定', config); |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
@ -560,7 +559,7 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('删除成功!', '确定', config); |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
},err=>{ |
|
|
|
|
}, err => { |
|
|
|
|
this.snackBar.open(err, '确定', config); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -641,15 +640,15 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
readFile(element) { |
|
|
|
|
this.uploadFileLonging = element |
|
|
|
|
console.log(element) |
|
|
|
|
if(element.planType==16&&(element.planMode==4||element.planMode==2)){ |
|
|
|
|
if (element.planType == 16 && (element.planMode == 4 || element.planMode == 2)) { |
|
|
|
|
const dialogRef = this.dialog.open(wenbenUpload, { |
|
|
|
|
width: "180px", |
|
|
|
|
height:"200px", |
|
|
|
|
height: "200px", |
|
|
|
|
disableClose: true, |
|
|
|
|
data: {src:`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${element.name}&unitName=${this.unitdata.unitname}&planCategory=${element.planCategory}&planId=${element.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false&xiazai=true`} |
|
|
|
|
data: { src: `/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${element.name}&unitName=${this.unitdata.unitname}&planCategory=${element.planCategory}&planId=${element.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false&xiazai=true` } |
|
|
|
|
}); |
|
|
|
|
//window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${element.name}&unitName=${this.unitdata.unitname}&planCategory=${element.planCategory}&planId=${element.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false&xiazai=true`)
|
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
const dialogRef = this.dialog.open(DownloadFile, { |
|
|
|
|
width: "435px", |
|
|
|
|
// height:"410px",
|
|
|
|
@ -777,60 +776,60 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
//上传word转在线编制
|
|
|
|
|
spinner=false//圈圈是否存在
|
|
|
|
|
async upzhuanMb(element){ |
|
|
|
|
this.spinner=true |
|
|
|
|
spinner = false//圈圈是否存在
|
|
|
|
|
async upzhuanMb(element) { |
|
|
|
|
this.spinner = true |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
let objectName//预案文件名称
|
|
|
|
|
let formData = new FormData() |
|
|
|
|
//模板导入接口传参
|
|
|
|
|
let type=this.unitdata.unittype=='高层建筑'?1:this.unitdata.unittype=='居民小区'?2:this.unitdata.unittype=='厂房'?3 |
|
|
|
|
:(this.unitdata.unittype=='商市场'||this.unitdata.unittype=='医院'||this.unitdata.unittype=='学校' |
|
|
|
|
||this.unitdata.unittype=='宾馆'||this.unitdata.unittype=='娱乐场所'||this.unitdata.unittype=='餐饮业' |
|
|
|
|
||this.unitdata.unittype=='影剧院'||this.unitdata.unittype=='展览建筑'||this.unitdata.unittype=='养老院' |
|
|
|
|
||this.unitdata.unittype=='会议中心')?4:this.unitdata.unittype=='储罐类'?'StorageTankFivePlan' |
|
|
|
|
:this.unitdata.unittype=='化工生产'?'ChemicalProductionFivePlan':this.unitdata.unittype=='农村'?'CountrysideFivePlan':'' |
|
|
|
|
let blob=[] |
|
|
|
|
let type = this.unitdata.unittype == '高层建筑' ? 1 : this.unitdata.unittype == '居民小区' ? 2 : this.unitdata.unittype == '厂房' ? 3 |
|
|
|
|
: (this.unitdata.unittype == '商市场' || this.unitdata.unittype == '医院' || this.unitdata.unittype == '学校' |
|
|
|
|
|| this.unitdata.unittype == '宾馆' || this.unitdata.unittype == '娱乐场所' || this.unitdata.unittype == '餐饮业' |
|
|
|
|
|| this.unitdata.unittype == '影剧院' || this.unitdata.unittype == '展览建筑' || this.unitdata.unittype == '养老院' |
|
|
|
|
|| this.unitdata.unittype == '会议中心') ? 4 : this.unitdata.unittype == '储罐类' ? 'StorageTankFivePlan' |
|
|
|
|
: this.unitdata.unittype == '化工生产' ? 'ChemicalProductionFivePlan' : this.unitdata.unittype == '农村' ? 'CountrysideFivePlan' : '' |
|
|
|
|
let blob = [] |
|
|
|
|
/* |
|
|
|
|
调用下载接口获取文件流,并赋值给blob |
|
|
|
|
*/ |
|
|
|
|
let fileRuquest=await new Promise((resolve,reject)=>{ |
|
|
|
|
this.http.get(`/api/ObjectMetadata/PlanPlatform/`+element.attachmentUrls[0]).subscribe((obdata: any) => { |
|
|
|
|
objectName=obdata.objectName |
|
|
|
|
let fileRuquest = await new Promise((resolve, reject) => { |
|
|
|
|
this.http.get(`/api/ObjectMetadata/PlanPlatform/` + element.attachmentUrls[0]).subscribe((obdata: any) => { |
|
|
|
|
objectName = obdata.objectName |
|
|
|
|
this.http.get(`/api/Objects/PlanPlatform/${objectName}`, { responseType: 'blob' },).subscribe(blobdata => { |
|
|
|
|
resolve(blobdata) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
blob.push(fileRuquest)//接收返回的blob类型数据
|
|
|
|
|
let file=new File(blob,objectName)//转化为file类型
|
|
|
|
|
formData.append('file',file) |
|
|
|
|
let file = new File(blob, objectName)//转化为file类型
|
|
|
|
|
formData.append('file', file) |
|
|
|
|
let pData//接受返回的模板信息数据
|
|
|
|
|
/* |
|
|
|
|
调用模板导入接口,获取在线编制的json,并赋值给pData |
|
|
|
|
*/ |
|
|
|
|
let pRequest=await new Promise((resolve,rejest)=>{ |
|
|
|
|
this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{ |
|
|
|
|
let pRequest = await new Promise((resolve, rejest) => { |
|
|
|
|
this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`, formData).subscribe((data: any) => { |
|
|
|
|
resolve(data) |
|
|
|
|
},err=>{ |
|
|
|
|
this.spinner=false |
|
|
|
|
}, err => { |
|
|
|
|
this.spinner = false |
|
|
|
|
this.snackBar.open('解析失败,请确定好格式再重新上传!', '确定', config); |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
pData=pRequest |
|
|
|
|
pData = pRequest |
|
|
|
|
/* 调用新建预案接口,新建一条新的预案,并跳转新建在线编制页面 */ |
|
|
|
|
let body={ |
|
|
|
|
name:(element.planCategory==3?'Ⅲ级':element.planCategory==4?'Ⅳ级':element.planCategory==5?'Ⅴ级':'')+ element.name+'转在线编制', |
|
|
|
|
let body = { |
|
|
|
|
name: (element.planCategory == 3 ? 'Ⅲ级' : element.planCategory == 4 ? 'Ⅳ级' : element.planCategory == 5 ? 'Ⅴ级' : '') + element.name + '转在线编制', |
|
|
|
|
planType: element.planType, |
|
|
|
|
planMode: 2, |
|
|
|
|
planLevel: element.planLevel, |
|
|
|
|
planCategory:element.planCategory, |
|
|
|
|
webTextData:JSON.stringify(pData) |
|
|
|
|
planCategory: element.planCategory, |
|
|
|
|
webTextData: JSON.stringify(pData) |
|
|
|
|
} |
|
|
|
|
let planData |
|
|
|
|
let newyuan=await new Promise((resolve,reject)=>{ |
|
|
|
|
let newyuan = await new Promise((resolve, reject) => { |
|
|
|
|
this.http.post('/api/PlanComponents', body, { |
|
|
|
|
params: { |
|
|
|
|
companyId: this.route.snapshot.queryParams.unitId |
|
|
|
@ -839,10 +838,10 @@ export class EntryPlanLookComponent implements OnInit {
|
|
|
|
|
resolve(plandata) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
planData=newyuan |
|
|
|
|
planData = newyuan |
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.route.snapshot.queryParams.unitId}&planName=${planData.name}&unitName=${this.unitdata.unitname}&planCategory=${planData.planCategory}&planId=${planData.id}&&wordChange=true`) |
|
|
|
|
this.getAllPlanComponents() |
|
|
|
|
this.spinner=false |
|
|
|
|
this.spinner = false |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1132,7 +1131,7 @@ export class AddPlanone {
|
|
|
|
|
inputword: boolean = false //导入文档
|
|
|
|
|
onlineedit: boolean = false //在线编辑
|
|
|
|
|
website: boolean = false //网页地址
|
|
|
|
|
inputNew :boolean=false //自定义编辑
|
|
|
|
|
inputNew: boolean = false //自定义编辑
|
|
|
|
|
next(formdata) { |
|
|
|
|
//console.log(formdata.value.firstCtrlthree)
|
|
|
|
|
//console.log(this.file)
|
|
|
|
@ -1146,17 +1145,17 @@ export class AddPlanone {
|
|
|
|
|
this.onlineedit = false |
|
|
|
|
this.website = false |
|
|
|
|
} |
|
|
|
|
if (formdata.value.firstCtrltwo == '16' ) {//&& formdata.value.firstCtrlthree != '4'
|
|
|
|
|
if (formdata.value.firstCtrltwo == '16') {//&& formdata.value.firstCtrlthree != '4'
|
|
|
|
|
this.localup = true |
|
|
|
|
this.inputword = true |
|
|
|
|
this.onlineedit = false |
|
|
|
|
this.website = false |
|
|
|
|
this.inputNew=true |
|
|
|
|
this.inputNew = true |
|
|
|
|
} |
|
|
|
|
if (formdata.value.firstCtrltwo == '16' && formdata.value.firstCtrlthree != '4') {//&& formdata.value.firstCtrlthree != '4'
|
|
|
|
|
this.localup = true |
|
|
|
|
this.inputword = true |
|
|
|
|
this.inputNew=true |
|
|
|
|
this.inputNew = true |
|
|
|
|
this.onlineedit = false |
|
|
|
|
this.website = false |
|
|
|
|
} |
|
|
|
@ -1165,12 +1164,12 @@ export class AddPlanone {
|
|
|
|
|
this.inputword = false |
|
|
|
|
this.onlineedit = true |
|
|
|
|
this.website = true |
|
|
|
|
this.inputNew=false |
|
|
|
|
this.inputNew = false |
|
|
|
|
} |
|
|
|
|
if (formdata.value.firstCtrltwo == '2' || formdata.value.firstCtrltwo == '4') { |
|
|
|
|
this.localup = true |
|
|
|
|
this.inputword = false |
|
|
|
|
this.inputNew=false |
|
|
|
|
this.inputNew = false |
|
|
|
|
this.onlineedit = false |
|
|
|
|
this.website = true |
|
|
|
|
this.pswShow = true |
|
|
|
@ -1234,7 +1233,7 @@ export class AddPlanone {
|
|
|
|
|
let open = this.newleftTabledata.filter((value, index, array) => { |
|
|
|
|
return value.unitname == this.data.unitType && value.planCategory == this.selectedPLanLevel |
|
|
|
|
}) |
|
|
|
|
if(haveNew==true){ |
|
|
|
|
if (haveNew == true) { |
|
|
|
|
this.http.post('/api/PlanComponents', { |
|
|
|
|
id: "", |
|
|
|
|
name: this.selectedPLanName, |
|
|
|
@ -1254,7 +1253,7 @@ export class AddPlanone {
|
|
|
|
|
//console.log(plandata)
|
|
|
|
|
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}&haveNew=${haveNew}&planMode=${this.defaultisshow}`) |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
if (open.length > 0) { |
|
|
|
|
this.http.post('/api/PlanComponents', { |
|
|
|
|
id: "", |
|
|
|
@ -1338,7 +1337,7 @@ export class AddPlanone {
|
|
|
|
|
//this.snackBar.open('暂不支持导入','确定',config);
|
|
|
|
|
this.createWord(false) |
|
|
|
|
} |
|
|
|
|
if(this.defaultisshow == '4'){ |
|
|
|
|
if (this.defaultisshow == '4') { |
|
|
|
|
this.createWord(true) |
|
|
|
|
} |
|
|
|
|
if (this.defaultisshow == '3' && (this.webaddress == "" || this.webaddress == null)) { //如果是填写网址
|
|
|
|
@ -1647,7 +1646,7 @@ export class ImgDetails {
|
|
|
|
|
templateUrl: './changeurl.html', |
|
|
|
|
styleUrls: ['./entry-plan-look.component.scss'] |
|
|
|
|
}) |
|
|
|
|
export class ChangeUrl{ |
|
|
|
|
export class ChangeUrl { |
|
|
|
|
constructor(private http: HttpClient, public dialogRef: MatDialogRef<ChangeUrl>, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } |
|
|
|
|
planUrl: any//预案路径
|
|
|
|
|
updata//修改后的data
|
|
|
|
@ -1667,19 +1666,19 @@ export class ChangeUrl{
|
|
|
|
|
}; |
|
|
|
|
let body = { |
|
|
|
|
url: value.name, |
|
|
|
|
auditStatus:8 |
|
|
|
|
auditStatus: 8 |
|
|
|
|
} |
|
|
|
|
this.http.put(`/api/PlanComponents/${this.data.element.id}`, body, options).subscribe(data => { |
|
|
|
|
console.log(data) |
|
|
|
|
this.updata=data |
|
|
|
|
this.dialogRef.close("success"); |
|
|
|
|
sessionStorage.setItem("url", this.updata.url) |
|
|
|
|
if ((this.updata.url as string).includes('gis/threeDimensionalHome')) { //三维预案
|
|
|
|
|
window.open(`${this.updata.url}?unitId=${this.updata.companyId}&unitName=${this.updata.name}&editMode=true`) |
|
|
|
|
} else { |
|
|
|
|
window.open(`/planManagement/webLook`) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.http.put(`/api/PlanComponents/${this.data.element.id}`, body, options).subscribe(data => { |
|
|
|
|
console.log(data) |
|
|
|
|
this.updata = data |
|
|
|
|
this.dialogRef.close("success"); |
|
|
|
|
sessionStorage.setItem("url", this.updata.url) |
|
|
|
|
if ((this.updata.url as string).includes('gis/threeDimensionalHome')) { //三维预案
|
|
|
|
|
window.open(`${this.updata.url}?unitId=${this.updata.companyId}&unitName=${this.updata.name}&editMode=true`) |
|
|
|
|
} else { |
|
|
|
|
window.open(`/planManagement/webLook`) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1690,7 +1689,7 @@ export class ChangeUrl{
|
|
|
|
|
templateUrl: './upLoad.html', |
|
|
|
|
styleUrls: ['./entry-plan-look.component.scss'] |
|
|
|
|
}) |
|
|
|
|
export class editUpload{ |
|
|
|
|
export class editUpload { |
|
|
|
|
constructor(private http: HttpClient, public dialogRef: MatDialogRef<editUpload>, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } |
|
|
|
|
planName: any//预案名称
|
|
|
|
|
ngOnInit(): void { |
|
|
|
@ -1711,10 +1710,10 @@ export class editUpload{
|
|
|
|
|
upload() { |
|
|
|
|
document.getElementById('up').click() |
|
|
|
|
} |
|
|
|
|
//上传文件input
|
|
|
|
|
filechange(e) { |
|
|
|
|
this.file = e.target.files[0] || null //上传的文件
|
|
|
|
|
} |
|
|
|
|
//上传文件input
|
|
|
|
|
filechange(e) { |
|
|
|
|
this.file = e.target.files[0] || null //上传的文件
|
|
|
|
|
} |
|
|
|
|
//上传文件
|
|
|
|
|
startUploading() { |
|
|
|
|
console.log(this.file) |
|
|
|
@ -1722,7 +1721,7 @@ filechange(e) {
|
|
|
|
|
let fileSize = file.size || null //上传文件的总大小
|
|
|
|
|
let shardSize = 5 * 1024 * 1024 //5MB一个分片
|
|
|
|
|
// console.log(this.psw)
|
|
|
|
|
if(this.file!=undefined){ |
|
|
|
|
if (this.file != undefined) { |
|
|
|
|
if (file && fileSize <= shardSize) { //上传文件<=5MB时
|
|
|
|
|
let formData = new FormData() |
|
|
|
|
formData.append("file", file) |
|
|
|
@ -1753,25 +1752,25 @@ filechange(e) {
|
|
|
|
|
PlanLevel = 8 |
|
|
|
|
} |
|
|
|
|
let uploadUrl = "/api/PlanComponents" |
|
|
|
|
this.http.get(`/api/PlanComponents/${this.data.id}`).subscribe(yuandata => { |
|
|
|
|
console.log(yuandata) |
|
|
|
|
this.lastyuanData=yuandata |
|
|
|
|
this.lastyuanData.attachmentUrls[0]=this.objectName |
|
|
|
|
this.http.put(`/api/PlanComponents/${this.data.id}`, this.lastyuanData,options).subscribe(data => { |
|
|
|
|
this.dialogRef.close(data); |
|
|
|
|
}) |
|
|
|
|
this.http.get(`/api/PlanComponents/${this.data.id}`).subscribe(yuandata => { |
|
|
|
|
console.log(yuandata) |
|
|
|
|
this.lastyuanData = yuandata |
|
|
|
|
this.lastyuanData.attachmentUrls[0] = this.objectName |
|
|
|
|
this.http.put(`/api/PlanComponents/${this.data.id}`, this.lastyuanData, options).subscribe(data => { |
|
|
|
|
this.dialogRef.close(data); |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传
|
|
|
|
|
let data = { filename: file.name } |
|
|
|
|
//this.uploadisLoading = tru
|
|
|
|
|
this.subsectionUploading() |
|
|
|
|
this.subsectionUploading() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
else { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
@ -1855,9 +1854,9 @@ filechange(e) {
|
|
|
|
|
if (this.uploadover) {//如果上次成功了才创建
|
|
|
|
|
this.http.get(`/api/PlanComponents/${this.data.id}`).subscribe(yuandata => { |
|
|
|
|
console.log(yuandata) |
|
|
|
|
this.lastyuanData=yuandata |
|
|
|
|
this.lastyuanData.attachmentUrls[0]=this.objectName |
|
|
|
|
this.http.put(`/api/PlanComponents/${this.data.id}`, this.lastyuanData,options).subscribe(data => { |
|
|
|
|
this.lastyuanData = yuandata |
|
|
|
|
this.lastyuanData.attachmentUrls[0] = this.objectName |
|
|
|
|
this.http.put(`/api/PlanComponents/${this.data.id}`, this.lastyuanData, options).subscribe(data => { |
|
|
|
|
this.dialogRef.close(data); |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
@ -1874,13 +1873,13 @@ filechange(e) {
|
|
|
|
|
templateUrl: './upNew.html', |
|
|
|
|
styleUrls: ['./entry-plan-look.component.scss'] |
|
|
|
|
}) |
|
|
|
|
export class wenbenUpload{ |
|
|
|
|
export class wenbenUpload { |
|
|
|
|
constructor(private http: HttpClient, public dialogRef: MatDialogRef<wenbenUpload>, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar, private sanitizer: DomSanitizer) { } |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
console.log(this.data) |
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
},45000) |
|
|
|
|
}, 45000) |
|
|
|
|
} |
|
|
|
|
src=this.sanitizer.bypassSecurityTrustResourceUrl(this.data.src); |
|
|
|
|
src = this.sanitizer.bypassSecurityTrustResourceUrl(this.data.src); |
|
|
|
|
} |
|
|
|
|