Browse Source

[修改]修改查看预案代码:完善icon

tangshan
邵佳豪 3 years ago
parent
commit
428490d145
  1. 37
      src/app/plan-management/entry-plan-look/entry-plan-look.component.html
  2. 3
      src/app/plan-management/entry-plan-look/entry-plan-look.component.scss
  3. 25
      src/app/plan-management/entry-plan-look/entry-plan-look.component.spec.ts
  4. 609
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  5. 4
      src/app/plan-management/entry-plan/entry-plan.component.html
  6. 13
      src/app/plan-management/entry-plan/entry-plan.component.ts
  7. 19
      src/app/plan-management/open-plan/open-plan.component.html
  8. 78
      src/app/plan-management/open-plan/open-plan.component.ts
  9. 19
      src/app/plan-management/pass-plan/pass-plan.component.html
  10. 74
      src/app/plan-management/pass-plan/pass-plan.component.ts
  11. 14
      src/app/statistic-analysis/combined-query/combined-query.component.html
  12. 7
      src/app/statistic-analysis/combined-query/combined-query.component.ts
  13. BIN
      src/assets/images/back.png
  14. BIN
      src/assets/images/custom.png
  15. BIN
      src/assets/images/template.png

37
src/app/plan-management/entry-plan-look/entry-plan-look.component.html

@ -46,8 +46,8 @@
<ng-container matColumnDef="state">
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案状态</th>
<td mat-cell *matCellDef="let element">
<span class="add" *ngIf="element.isNewData">新增</span>
<span class="weihu" *ngIf="!element.isNewData">维护更新</span>
<span class="add" *ngIf="element.isNewData">新增</span>
<span class="weihu" *ngIf="!element.isNewData">维护更新</span>
</td>
</ng-container>
<ng-container matColumnDef="planname">
@ -66,13 +66,24 @@
</ng-container>
<ng-container matColumnDef="planCategory">
<th mat-header-cell *matHeaderCellDef>预案级别</th>
<td mat-cell *matCellDef="let element">{{element.planCategory=='3'?'Ⅲ级预案':element.planCategory=='4'?'Ⅳ级预案':'Ⅴ级预案'}}</td>
<td mat-cell *matCellDef="let element">
{{element.planCategory=='3'?'Ⅲ级预案':element.planCategory=='4'?'Ⅳ级预案':'Ⅴ级预案'}}</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">{{element.planType | plantype}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 150px;">预案类型</th>
<td mat-cell *matCellDef="let element" style="text-align: left;">
<span
style="margin:0px;margin-left: 31%; color: black;cursor: default;vertical-align: middle;">{{element.planType
|
plantype}}</span>
<img *ngIf="element.planType == 16 && element.attachmentUrls == null && element.planMode == 2"
style="vertical-align: middle;
margin: 2px 0 0 3px;" src="../../../assets/images/template.png" alt="">
<img *ngIf="element.planType == 16 && element.attachmentUrls == null && element.planMode == 4"
style="vertical-align: middle;
margin: 2px 0 0 3px;" src="../../../assets/images/custom.png" alt="">
</td>
</ng-container>
<ng-container matColumnDef="auditstate">
<th mat-header-cell *matHeaderCellDef>新增审核</th>
<td mat-cell *matCellDef="let element">
@ -97,18 +108,20 @@
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span (click)="changeName(element)" *ngIf="element.auditStatus==8">改名</span>
<span (click)="upzhuanMb(element)" *ngIf="element.planMode==1&&element.planType==16&&element.planCategory==5">转在线导入</span>
<span (click)="upzhuanMb(element)"
*ngIf="element.planMode==1&&element.planType==16&&element.planCategory==5">转在线导入</span>
<span (click)="editPlan(element)"
[ngClass]="{'grey': !(element.auditStatus!='16' && element.auditStatus != '1' )}">编辑</span>
<span (click)="lookPlan(element)" *ngIf="element.planType == 2 || element.planType == 16 ||element.planType==1">查看</span>
<span (click)="readFile(element)"
[ngClass]="{'grey':element.planMode == '3'}">下载</span>
<span (click)="lookPlan(element)"
*ngIf="element.planType == 2 || element.planType == 16 ||element.planType==1">查看</span>
<span (click)="readFile(element)" [ngClass]="{'grey':element.planMode == '3'}">下载</span>
<span (click)="deletePlan(element)" *ngIf="element.auditStatus==8">删除</span>
<span (click)="auditResult(element)">审批结果</span>
<span (click)="submitAudit(element)"
*ngIf="(element.isNewData && element.newVerifyState=='未提交审核')||(!element.isNewData&&(element.maintenanceVerifyState=='审核通过'||element.maintenanceVerifyState=='未提交审核'))">
提交审核</span>
<span (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1||element.auditStatus == 16">撤销审核</span>
<span (click)="cancelAudit(element)"
*ngIf="element.auditStatus == 1||element.auditStatus == 16">撤销审核</span>
</td>
</ng-container>
<ng-container *ngIf="isoperation == 'false'" matColumnDef="operation">
@ -127,4 +140,4 @@
</mat-paginator>
</div>
</div>
</div>
</div>

3
src/app/plan-management/entry-plan-look/entry-plan-look.component.scss

@ -86,9 +86,6 @@
margin: 0 3px;
cursor: pointer;
}
span:hover{
text-decoration:underline
}
.grey{
color: grey;
pointer-events: none;

25
src/app/plan-management/entry-plan-look/entry-plan-look.component.spec.ts

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EntryPlanLookComponent } from './entry-plan-look.component';
describe('EntryPlanLookComponent', () => {
let component: EntryPlanLookComponent;
let fixture: ComponentFixture<EntryPlanLookComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EntryPlanLookComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EntryPlanLookComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

609
src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

@ -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 => {
@ -311,11 +233,11 @@ export class EntryPlanLookComponent implements OnInit {
this.snackBar.open(err,'确定',config);
} */)
}
}
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 {
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,79 +324,150 @@ 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 {
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) {
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 = {};
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);
}
} */
}
}
allPlanComponents: any //所有预案组件
@ -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",
@ -665,7 +664,7 @@ export class EntryPlanLookComponent implements OnInit {
}
);
}
}
//初始化下载
@ -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: "",
@ -1279,7 +1278,7 @@ export class AddPlanone {
this.snackBar.open('请先创建模板!', '确定', config);
}
}
})
@ -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,20 +1666,20 @@ 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)
@ -1734,8 +1733,8 @@ filechange(e) {
let options = {
headers
};
this.uploadover = true
let level = sessionStorage.getItem("level")
// console.log(level)
@ -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
@ -1851,13 +1850,13 @@ filechange(e) {
PlanLevel = 8
}
let uploadUrl = "/api/PlanComponents"
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);
}

4
src/app/plan-management/entry-plan/entry-plan.component.html

@ -153,10 +153,10 @@
</mat-form-field>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<mat-checkbox [(ngModel)]="templatePlan" name="templatePlan">模板录入预案</mat-checkbox>
<mat-checkbox (ngModelChange)="templatePlanChange($event,1)" [(ngModel)]="templatePlan" name="templatePlan">模板录入预案</mat-checkbox>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<mat-checkbox [(ngModel)]="customPlan" name="customPlan">自定义预案</mat-checkbox>
<mat-checkbox (ngModelChange)="templatePlanChange($event,2)" [(ngModel)]="customPlan" name="customPlan">自定义预案</mat-checkbox>
</div>
</div>
</form>

13
src/app/plan-management/entry-plan/entry-plan.component.ts

@ -366,7 +366,18 @@ export class EntryPlanComponent implements OnInit {
this.pageEvent.pageIndex = 0
this.getAllPlanInfo()
}
templatePlanChange($event, type) {
if (type == 1) {
this.templatePlan = $event
} else if (type == 2) {
this.customPlan = $event
}
if (this.templatePlan || this.customPlan) {
this.reservePlanType = ['16']
} else {
this.reservePlanType = []
}
}
companyName: any //单位名称
js: any //所选组织机构
jsId: any //所选组织机构的id

19
src/app/plan-management/open-plan/open-plan.component.html

@ -67,10 +67,12 @@
</mat-form-field>
</div>
<div class="queryField" *ngIf="!padMore">
<mat-checkbox [(ngModel)]="templatePlan" name="templatePlan">模板录入预案</mat-checkbox>
<mat-checkbox (ngModelChange)="templatePlanChange($event,1)" [(ngModel)]="templatePlan" name="templatePlan">
模板录入预案</mat-checkbox>
</div>
<div class="queryField" *ngIf="!padMore">
<mat-checkbox [(ngModel)]="customPlan" name="customPlan">自定义预案</mat-checkbox>
<mat-checkbox (ngModelChange)="templatePlanChange($event,2)" [(ngModel)]="customPlan" name="customPlan">自定义预案
</mat-checkbox>
</div>
<div class="queryField" *ngIf="pcfind">
<button mat-raised-button color="primary">查询</button>
@ -108,8 +110,17 @@
<td mat-cell *matCellDef="let element">{{element.creationTime | date:'yyyy-MM-dd'}}</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">{{element.planType | plantype}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 120px;">预案类型</th>
<td mat-cell *matCellDef="let element" style="text-align: left;">
<span
style="margin:0px;margin-left: 26%; color: black;cursor: default;vertical-align: middle;">{{element.planType
|
plantype}}</span>
<img *ngIf="element.planType == 16 && element.attachmentUrls == null && element.planMode == 2" style="vertical-align: middle;
margin: 3px 0 0 3px;" src="../../../assets/images/template.png" alt="">
<img *ngIf="element.planType == 16 && element.attachmentUrls == null && element.planMode == 4" style="vertical-align: middle;
margin: 3px 0 0 3px;" src="../../../assets/images/custom.png" alt="">
</td>
</ng-container>
<ng-container matColumnDef="auditStatus">
<th mat-header-cell *matHeaderCellDef>新增审核</th>

78
src/app/plan-management/open-plan/open-plan.component.ts

@ -10,6 +10,7 @@ import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dial
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
import { Viewer } from 'photo-sphere-viewer';
import { ImgDetails, PsViewer } from '../entry-plan-look/entry-plan-look.component';
declare var CryptoJS
@Component({
selector: 'app-open-plan',
@ -201,39 +202,46 @@ export class OpenPlanComponent implements OnInit {
}
//跳转查看预案页面 公开预案
routerTo(e) {
/* sessionStorage.setItem("companyName",element.companyName)
window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=2`); */
// console.log(e)
if (e.planMode == 0 || e.planMode == 1) {
//console.log(e.attachmentUrls)
var index = e.attachmentUrls[0].indexOf("\/")
if (e.attachmentUrls[0].substr(0, index) == 'psw') {
const dialogRef = this.dialog.open(GkhtmlPsViewer, {
width: '1500px',
height: '800px',
data: e.attachmentUrls[0]
});
}
else {
let fetchUrl = e.attachmentUrls[0]
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)
console.log(e)
if (e.planType == 16 || e.planType == 4 || e.planType == 8) {
if (e.planType == 16 && e.attachmentUrls == null) {
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${e.companyId}&planName=${e.name}&unitName=${e.company.name}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${e.company.buildingTypes[0].id}&orName=${e.company.organizationName}&orId=${e.company.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 config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
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.planMode == 2) { //如果是在线编辑
if (e.planMode == 2 && e.planType == 1) { //如果是在线编辑
let id = e.id
sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId", e.companyId)
@ -248,6 +256,20 @@ export class OpenPlanComponent implements OnInit {
window.open(`/planManagement/webLook`)
}
}
templatePlanChange($event, type) {
if (type == 1) {
this.templatePlan = $event
} else if (type == 2) {
this.customPlan = $event
}
if (this.templatePlan || this.customPlan) {
this.reservePlanType = ['16']
} else {
this.reservePlanType = []
}
}
//分页事件
chagePage(e) {
this.PageNumber = e.pageIndex + 1

19
src/app/plan-management/pass-plan/pass-plan.component.html

@ -132,10 +132,12 @@
</mat-form-field>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<mat-checkbox [(ngModel)]="templatePlan" name="templatePlan">模板录入预案</mat-checkbox>
<mat-checkbox (ngModelChange)="templatePlanChange($event,1)" [(ngModel)]="templatePlan" name="templatePlan">
模板录入预案</mat-checkbox>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<mat-checkbox [(ngModel)]="customPlan" name="customPlan">自定义预案</mat-checkbox>
<mat-checkbox (ngModelChange)="templatePlanChange($event,2)" [(ngModel)]="customPlan" name="customPlan">自定义预案
</mat-checkbox>
</div>
</div>
@ -173,8 +175,17 @@
<td mat-cell *matCellDef="let element">{{element.creationTime | date:'yyyy-MM-dd'}}</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">{{element.planType | plantype}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 120px;">预案类型</th>
<td mat-cell *matCellDef="let element" style="text-align: left;">
<span
style="margin:0px;margin-left: 26%; color: black;cursor: default;vertical-align: middle;">{{element.planType
|
plantype}}</span>
<img *ngIf="element.planType == 16 && element.attachmentUrls == null && element.planMode == 2" style="vertical-align: middle;
margin: 3px 0 0 3px;" src="../../../assets/images/template.png" alt="">
<img *ngIf="element.planType == 16 && element.attachmentUrls == null && element.planMode == 4" style="vertical-align: middle;
margin: 3px 0 0 3px;" src="../../../assets/images/custom.png" alt="">
</td>
</ng-container>
<ng-container matColumnDef="auditStatus">
<th mat-header-cell *matHeaderCellDef>新增审核</th>

74
src/app/plan-management/pass-plan/pass-plan.component.ts

@ -10,6 +10,7 @@ import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dial
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
import { Viewer } from 'photo-sphere-viewer';
import { ImgDetails, PsViewer } from '../entry-plan-look/entry-plan-look.component';
declare var CryptoJS
@Component({
selector: 'app-pass-plan',
@ -351,36 +352,46 @@ export class PassPlanComponent implements OnInit {
//跳转查看预案页面 审核通过预案
routerTo(e) {
// console.log(e)
if (e.planMode == 0 || e.planMode == 1) {
//console.log(e.attachmentUrls)
var index = e.attachmentUrls[0].indexOf("\/")
if (e.attachmentUrls[0].substr(0, index) == 'psw') {
const dialogRef = this.dialog.open(GkPsViewer, {
width: '1500px',
height: '800px',
data: e.attachmentUrls[0]
});
}
else {
let fetchUrl = e.attachmentUrls[0]
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)
console.log(e)
if (e.planType == 16 || e.planType == 4 || e.planType == 8) {
if (e.planType == 16 && e.attachmentUrls == null) {
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${e.companyId}&planName=${e.name}&unitName=${e.company.name}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${e.company.buildingTypes[0].id}&orName=${e.company.organizationName}&orId=${e.company.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 config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
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.planMode == 2) { //如果是在线编辑
if (e.planMode == 2 && e.planType == 1) { //如果是在线编辑
let id = e.id
sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId", e.companyId)
@ -395,7 +406,18 @@ export class PassPlanComponent implements OnInit {
window.open(`/planManagement/webLook`)
}
}
templatePlanChange($event, type) {
if (type == 1) {
this.templatePlan = $event
} else if (type == 2) {
this.customPlan = $event
}
if (this.templatePlan || this.customPlan) {
this.reservePlanType = ['16']
} else {
this.reservePlanType = []
}
}
//预案公开
openReserve(e) {
this.http.put(`/api/PlanAudits/${e.id}/Public`, []).subscribe(data => {

14
src/app/statistic-analysis/combined-query/combined-query.component.html

@ -134,10 +134,9 @@
<div class="tablebox" id="table">
<table cellpadding="0" cellspacing="0" *ngIf="preparelevels==0&&!tableDataNull">
<thead>
<th *ngFor="let item of displayedColumns;let i=index">{{item}}<mat-icon
*ngIf="i == 0 && orRecord.length != 0" style="cursor: pointer;vertical-align: text-top;"
(click)="goBack()">undo
</mat-icon>
<th *ngFor="let item of displayedColumns;let i=index">{{item}}<img *ngIf="i==0 && orRecord.length !=0"
style="cursor: pointer;vertical-align: middle;margin-bottom: 2px;" (click)="goBack()"
src="../../../assets/images/back.png" alt="">
</th>
</thead>
<tbody>
@ -150,10 +149,9 @@
<table cellpadding="0" cellspacing="0" *ngIf="preparelevels==1&&!tableDataNull">
<thead>
<th *ngFor="let item of yuanColumns;let i=index">{{item}}<mat-icon
*ngIf="i == 0 && orRecord.length != 0" style="cursor: pointer;vertical-align: text-top;"
(click)="goBack()">undo
</mat-icon>
<th *ngFor="let item of yuanColumns;let i=index">{{item}}<img *ngIf="i==0 && orRecord.length !=0"
style="cursor: pointer;vertical-align: middle;margin-bottom: 2px;" (click)="goBack()"
src="../../../assets/images/back.png" alt="">
</th>
</thead>
<tbody>

7
src/app/statistic-analysis/combined-query/combined-query.component.ts

@ -277,9 +277,6 @@ export class CombinedQueryComponent implements OnInit {
} else {
this.tabledataSource[i].name.push(bvalue[bi].count)
}
/* this.tabledataSource.forEach((td,ti,tval)=>{
tval[ti].name.push(item.count)
}) */
});
}
@ -369,8 +366,6 @@ export class CombinedQueryComponent implements OnInit {
})
}
}
// console.log(this.yuanColumns)
// console.log(this.yuanTable)
this.isMasklayer = false
resolve(this.excelData)
}
@ -465,7 +460,7 @@ export class CombinedQueryComponent implements OnInit {
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if (key == 0) {
if (key == 0 && element != '合计') {
let clickOr
this.allorganizations.forEach(item => {
if (element === item.name) {

BIN
src/assets/images/back.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

BIN
src/assets/images/custom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

BIN
src/assets/images/template.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Loading…
Cancel
Save