Browse Source

[完善]申诉视频,预警级别,驳回理由

beijing
邵佳豪 2 years ago
parent
commit
066f0deb82
  1. 2
      package.json
  2. 2
      src/app/app.module.ts
  3. 32
      src/app/component/video-play/video-play.component.html
  4. 133
      src/app/component/video-play/video-play.component.scss
  5. 19
      src/app/component/video-play/video-play.component.ts
  6. 2
      src/app/pages/audit/annual-inspection/edit-annual-inspection/edit-annual-inspection.component.ts
  7. 2
      src/app/pages/audit/audit-inform-time/edit-inform-time/edit-inform-time.component.ts
  8. 119
      src/app/pages/audit/audit-ing/appeal-details/appeal-details.component.ts
  9. 173
      src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.ts
  10. 275
      src/app/pages/audit/audit-ing/audit-ing.component.ts
  11. 10
      src/app/pages/equipment-info/equipment-info.component.ts
  12. 2
      src/app/pages/home-page-nologin/home-page-nologin.component.html
  13. 10
      src/app/pages/home-page-nologin/home-page-nologin.component.ts
  14. 2
      src/app/pages/home-page/home-page.component.html
  15. 10
      src/app/pages/home-page/home-page.component.ts
  16. 22
      src/app/pages/home/home.component.ts
  17. 8
      src/app/pages/left-domain/left-domain.component.ts
  18. 157
      src/app/pages/license/file-category/details-file-category/details-file-category.component.ts
  19. 198
      src/app/pages/license/file-category/edit-file-category/edit-file-category.component.ts
  20. 283
      src/app/pages/license/file-category/file-category.component.ts
  21. 177
      src/app/pages/license/update-category/details-update-category/details-update-category.component.ts
  22. 272
      src/app/pages/license/update-category/edit-update-category/edit-update-category.component.ts
  23. 330
      src/app/pages/license/update-category/update-category.component.ts
  24. 6
      src/app/pages/login/forget/forget.component.ts
  25. 18
      src/app/pages/oil-station-info/oil-station-info.component.ts
  26. 4
      src/app/pages/plan/plan.component.ts
  27. 14
      src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts
  28. 14
      src/app/pages/records/criminal-records/criminal-records.component.ts
  29. 10
      src/app/pages/records/warning-statistics-list/warning-statistics-list.component.ts
  30. 14
      src/app/pages/today-warning-admin/today-warning-admin.component.ts
  31. 1
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
  32. 45
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts
  33. 451
      src/app/pages/today-warning/today-warning.component.ts
  34. 33
      src/app/service/publicMethods.service.ts
  35. 20
      src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts
  36. 10
      src/app/system-management/file-of-license/file-of-license.component.ts
  37. 10
      src/app/system-management/menu/menu.component.ts
  38. 12
      src/app/system-management/organization/organization.component.ts
  39. 10
      src/app/system-management/push/push.component.ts
  40. 20
      src/app/system-management/role/role.component.ts
  41. 10
      src/app/system-management/update-of-license/update-of-license.component.ts
  42. 4
      src/app/system-management/user/edituser/edituser.component.ts
  43. 2
      src/app/ui/changepassword/changepassword.component.html
  44. 1
      src/theme.less

2
package.json

@ -3,7 +3,7 @@
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve --proxy-config proxy.config.json --open --port 4200 ", "start": "ng serve --proxy-config proxy.config.json --open --port 1119",
"build": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration production", "build": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration production",
"test": "ng test", "test": "ng test",
"lint": "ng lint", "lint": "ng lint",

2
src/app/app.module.ts

@ -11,9 +11,11 @@ import { CacheTokenService } from './service/cache-token.service'
import { TreeService } from './service/tree.service' import { TreeService } from './service/tree.service'
import { NzNotificationModule } from 'ng-zorro-antd/notification'; import { NzNotificationModule } from 'ng-zorro-antd/notification';
import { NzMessageModule } from 'ng-zorro-antd/message'; import { NzMessageModule } from 'ng-zorro-antd/message';
import { VideoPlayComponent } from './component/video-play/video-play.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, AppComponent,
VideoPlayComponent,
], ],
imports: [ imports: [
AppRoutingModule, AppRoutingModule,

32
src/app/component/video-play/video-play.component.html

@ -0,0 +1,32 @@
<div class="box" cdkDrag id="videoplay">
<div class="titlebox">
<div class="title" cdkDragHandle>
<div class="selected">
视频
<div class="border"></div>
</div>
</div>
<div class="close" (click)="closeModel()">
<i nz-icon>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" p-id="2753" width="16" height="16">
<path
d="M548.992 503.744L885.44 167.328a31.968 31.968 0 1 0-45.248-45.248L503.744 458.496 167.328 122.08a31.968 31.968 0 1 0-45.248 45.248l336.416 336.416L122.08 840.16a31.968 31.968 0 1 0 45.248 45.248l336.416-336.416L840.16 885.44a31.968 31.968 0 1 0 45.248-45.248L548.992 503.744z"
p-id="2754" fill="#ffffff"></path>
</svg>
</i>
</div>
</div>
<div class="content">
<div class="vediobox">
<ng-container *ngIf="vedioUrl; else elseTemplate">
<video crossorign="anonymous" controls style="width: 100%;height: 100%;" [src]="vedioUrl"></video>
</ng-container>
<ng-template #elseTemplate>
暂无视频
</ng-template>
</div>
</div>
</div>

133
src/app/component/video-play/video-play.component.scss

@ -0,0 +1,133 @@
.box {
width: 100%;
height: 715px;
color: #fff;
display: flex;
flex-direction: column;
background-image: linear-gradient(#003B6E, #000D21);
position: relative;
border: 1px solid #6d9cc7;
box-shadow: 0 0 8px 0 #fff
}
.titlebox {
width: 100%;
height: 48px;
background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, rgba(35, 153, 255, 0.57) 50%, rgba(35, 153, 255, 0) 100%);
display: flex;
align-items: center;
position: relative;
.title {
width: 100%;
height: 32px;
background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, rgba(35, 153, 255, 0.57) 50%, rgba(35, 153, 255, 0) 100%);
display: flex;
justify-content: center;
div {
width: 120px;
height: 32px;
text-align: center;
line-height: 32px;
font-family: sybold;
font-size: 16px;
position: relative;
cursor: pointer;
margin: 0 18px;
.border {
position: absolute;
bottom: -7px;
left: -18px;
width: 120px;
height: 4px;
}
}
.selected {
background: linear-gradient(90deg, rgba(35, 153, 255, 0.57) 0%, #25b7d4 50%, rgba(35, 153, 255, 0.57) 100%);
.border {
background: linear-gradient(90deg, rgba(35, 217, 255, 0) 0%, #25b7d4 50%, rgba(35, 217, 255, 0) 100%);
}
}
}
.close {
position: absolute;
right: 20px;
top: 18px;
cursor: pointer;
}
}
.content {
flex: 1;
overflow: hidden;
.vediobox {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
video {
max-width: 100%;
max-height: 100%;
}
}
}
// 适配125%
@media screen and (max-height: 750px) {
.box {
width: 100%;
height: 650px;
color: #fff;
display: flex;
flex-direction: column;
background-image: linear-gradient(#003B6E, #000D21);
position: relative;
}
}
// 适配150%
@media screen and (max-height: 600px) {
.box {
width: 100%;
height: 480px;
color: #fff;
display: flex;
flex-direction: column;
background-image: linear-gradient(#003B6E, #000D21);
position: relative;
}
}
::-webkit-input-placeholder {
color: #345d85;
}
//滚动条样式
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-thumb {
background-image: linear-gradient(#2495f8, #1c73c2, #0a3d6a, #061d3c);
}
::-webkit-scrollbar-track {
background-color: #061d3c;
}

19
src/app/component/video-play/video-play.component.ts

@ -0,0 +1,19 @@
import { Component, OnInit, Input } from "@angular/core";
import { NzModalRef } from "ng-zorro-antd/modal";
@Component({
selector: "app-video-play",
templateUrl: "./video-play.component.html",
styleUrls: ["./video-play.component.scss"],
})
export class VideoPlayComponent implements OnInit {
@Input() vedioUrl: any;
constructor(private openmodal: NzModalRef) {}
ngOnInit(): void {}
closeModel() {
this.openmodal.close();
}
}

2
src/app/pages/audit/annual-inspection/edit-annual-inspection/edit-annual-inspection.component.ts

@ -54,7 +54,7 @@ export class EditAnnualInspectionComponent implements OnInit {
this.isLoading = false this.isLoading = false
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
} }

2
src/app/pages/audit/audit-inform-time/edit-inform-time/edit-inform-time.component.ts

@ -61,7 +61,7 @@ export class EditInformTimeComponent implements OnInit {
this.isLoading = false this.isLoading = false
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
} }

119
src/app/pages/audit/audit-ing/appeal-details/appeal-details.component.ts

@ -1,72 +1,69 @@
import { HttpClient } from '@angular/common/http'; import { HttpClient } from "@angular/common/http";
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit, ViewContainerRef } from "@angular/core";
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from "ng-zorro-antd/message";
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef, NzModalService } from "ng-zorro-antd/modal";
import Viewer from 'viewerjs'; import { VideoPlayComponent } from "src/app/component/video-play/video-play.component";
import { PublicMethodsService } from "src/app/service/publicMethods.service";
import Viewer from "viewerjs";
@Component({ @Component({
selector: 'app-appeal-details', selector: "app-appeal-details",
templateUrl: './appeal-details.component.html', templateUrl: "./appeal-details.component.html",
styleUrls: ['./appeal-details.component.scss'] styleUrls: ["./appeal-details.component.scss"],
}) })
export class AppealDetailsComponent implements OnInit { export class AppealDetailsComponent implements OnInit {
@Input() data?: any; @Input() data?: any;
constructor(private modal: NzModalRef, private http: HttpClient, private message: NzMessageService) { } constructor(
private modal: NzModalRef,
private http: HttpClient,
private message: NzMessageService,
private pubilcMethods: PublicMethodsService,
private modalChild: NzModalService,
private viewContainerRef: ViewContainerRef
) {}
/** /**
* *
*/ */
appealData: any = { appealData: any = {
appealAttachments: [], appealAttachments: [],
handleUserName: '', handleUserName: "",
lastModificationTime: '' lastModificationTime: "",
} };
organizationName organizationName;
ngOnInit(): void { ngOnInit(): void {
console.log('申诉详情', this.data) console.log("申诉详情", this.data);
if (this.data.auditType == 5) { if (this.data.auditType == 5) {
this.http
this.http.get('/api/services/app/ViolateRecord/Get', { .get("/api/services/app/ViolateRecord/Get", {
params: { params: {
id: this.data.itemId id: this.data.itemId,
} },
}).subscribe((data: any) => {
this.appealData = data.result
console.log('申诉预警详情', this.appealData)
}) })
.subscribe((data: any) => {
this.appealData = data.result;
console.log("申诉预警详情", this.appealData);
});
} }
} }
destroyModal() { destroyModal() {
this.modal.destroy({ data: 'this the result data' }); this.modal.destroy({ data: "this the result data" });
}
//获取文件格式
getFileType(name: string): string {
let suffix
if (name.substring(name.length - 4).includes('png') || name.substring(name.length - 4).includes('jpg') || name.substring(name.length - 4).includes('jpeg') || name.substring(name.length - 4).includes('webp')) {
suffix = 'img'
} else if (name.substring(name.length - 4).includes('doc') || name.substring(name.length - 4).includes('docx')) {
suffix = 'word'
} else if (name.substring(name.length - 4).includes('pdf')) {
suffix = 'pdf'
}
return suffix
} }
//查看图片 //查看图片
viewImg(url) { viewImg(url) {
let dom = document.getElementById(`viewerjs`) let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes; let pObjs = dom.childNodes;
let node = document.createElement("img") let node = document.createElement("img");
node.style.display = "none"; node.style.display = "none";
node.src = url; node.src = url;
node.id = 'img' node.id = "img";
dom.appendChild(node) dom.appendChild(node);
setTimeout(() => { setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), { let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => { hidden: () => {
dom.removeChild(pObjs[0]); dom.removeChild(pObjs[0]);
viewer.destroy(); viewer.destroy();
} },
}); });
node.click(); node.click();
}, 0); }, 0);
@ -75,18 +72,40 @@ export class AppealDetailsComponent implements OnInit {
//查看文件 //查看文件
lookFile(item) { lookFile(item) {
if (!item) { if (!item) {
return return;
} }
if (this.getFileType(item) == 'word') { if (this.pubilcMethods.getFileType(item) == "word") {
let arr = item.split('.') let arr = item.split(".");
arr[arr.length - 1] = 'pdf' arr[arr.length - 1] = "pdf";
window.open(arr.join('.')) window.open(arr.join("."));
} else if (this.getFileType(item) == 'pdf') { } else if (this.pubilcMethods.getFileType(item) == "pdf") {
window.open(item) window.open(item);
} else if (this.getFileType(item) == 'img') { } else if (this.pubilcMethods.getFileType(item) == "img") {
this.viewImg(item) this.viewImg(item);
} else if (this.pubilcMethods.getFileType(item) == "video") {
this.modalChild.create({
nzContent: VideoPlayComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth:
document.documentElement.clientHeight < 650 ||
document.documentElement.clientWidth < 1400
? 1000
: 1200,
nzClosable: false,
nzClassName: "modelnobg",
nzBodyStyle: {
"border-radius": "0px",
padding: "0px",
},
nzComponentParams: {
vedioUrl: item,
},
nzFooter: null,
});
} else { } else {
this.message.create('warning', '暂不支持查看!'); this.message.create("warning", "暂不支持查看!");
window.open(window.location.origin + item);
} }
} }
} }

173
src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.ts

@ -1,55 +1,65 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input, ViewContainerRef } from "@angular/core";
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef, NzModalService } from "ng-zorro-antd/modal";
import Viewer from 'viewerjs'; import Viewer from "viewerjs";
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from "ng-zorro-antd/message";
import { handleType, handleTypeList } from 'src/app/pages/license/update-category/edit-update-category/edit-update-category.component'; import {
import { HttpClient } from '@angular/common/http'; handleType,
handleTypeList,
} from "src/app/pages/license/update-category/edit-update-category/edit-update-category.component";
import { HttpClient } from "@angular/common/http";
import { PublicMethodsService } from "src/app/service/publicMethods.service";
import { VideoPlayComponent } from "src/app/component/video-play/video-play.component";
@Component({ @Component({
selector: 'app-audit-dispose', selector: "app-audit-dispose",
templateUrl: './audit-dispose.component.html', templateUrl: "./audit-dispose.component.html",
styleUrls: ['./audit-dispose.component.scss'] styleUrls: ["./audit-dispose.component.scss"],
}) })
export class AuditDisposeComponent implements OnInit { export class AuditDisposeComponent implements OnInit {
@Input() data?: any; @Input() data?: any;
constructor(private modal: NzModalRef, private message: NzMessageService, private http: HttpClient) { } constructor(
private modal: NzModalRef,
private message: NzMessageService,
private http: HttpClient,
private pubilcMethods: PublicMethodsService,
private viewContainerRef: ViewContainerRef,
private modalChild: NzModalService
) {}
textarea: string = ""; //审批意见 textarea: string = ""; //审批意见
role1 = [] role1 = [];
role2 = [] role2 = [];
/** /**
* *
*/ */
appealData: any = { appealData: any = {
appealAttachments: [] appealAttachments: [],
} };
ngOnInit(): void { ngOnInit(): void {
console.log('审批信息', this.data) console.log("审批信息", this.data);
if (this.data.auditType == 4) { if (this.data.auditType == 4) {
this.data.getData.roleDisplayNames.forEach(element => { this.data.getData.roleDisplayNames.forEach((element) => {
if (element.indexOf('接收人') != -1) { if (element.indexOf("接收人") != -1) {
this.role2.push(element) this.role2.push(element);
} else { } else {
this.role1.push(element) this.role1.push(element);
} }
}); });
} }
if (this.data.auditType == 5) { if (this.data.auditType == 5) {
this.http
this.http.get('/api/services/app/ViolateRecord/Get', { .get("/api/services/app/ViolateRecord/Get", {
params: { params: {
id: this.data.itemId id: this.data.itemId,
} },
}).subscribe((data: any) => {
this.appealData = data.result
}) })
.subscribe((data: any) => {
this.appealData = data.result;
});
} }
} }
destroyModal() { destroyModal() {
this.modal.destroy(); this.modal.destroy();
} }
@ -57,53 +67,63 @@ export class AuditDisposeComponent implements OnInit {
isPass: boolean; isPass: boolean;
ok(isPass: boolean) { ok(isPass: boolean) {
this.isPass = isPass; this.isPass = isPass;
this.modal.triggerOk() this.modal.triggerOk();
} }
//获取办理类型 //获取办理类型
getHandleTypes(handleTypes: any[]): string { getHandleTypes(handleTypes: any[]): string {
if (!handleTypes || !handleTypes.length) { if (!handleTypes || !handleTypes.length) {
return return;
} }
let names: string[] = [] let names: string[] = [];
let handleTypeList = JSON.parse(JSON.stringify(handleTypes)); let handleTypeList = JSON.parse(JSON.stringify(handleTypes));
let list: handleTypeList[] = new handleType().list; let list: handleTypeList[] = new handleType().list;
handleTypeList.forEach(item => { handleTypeList.forEach((item) => {
list.find(element => { list.find((element) => {
item == element.value ? names.push(element.name) : null item == element.value ? names.push(element.name) : null;
}) });
}) });
return names.join(',') return names.join(",");
} }
//获取文件格式 //获取文件格式
getFileType(name: string): string { getFileType(name: string): string {
let suffix let type;
if (name.substring(name.length - 4).includes('png') || name.substring(name.length - 4).includes('jpg') || name.substring(name.length - 4).includes('jpeg') || name.substring(name.length - 4).includes('webp')) { let suffix = name.substring(name.length - 4);
suffix = 'img' if (
} else if (name.substring(name.length - 4).includes('doc') || name.substring(name.length - 4).includes('docx')) { suffix.includes("png") ||
suffix = 'word' suffix.includes("jpg") ||
} else if (name.substring(name.length - 4).includes('pdf')) { suffix.includes("jpeg") ||
suffix = 'pdf' suffix.includes("webp")
} ) {
return suffix type = "img";
} else if (suffix.includes("doc") || suffix.includes("docx")) {
type = "word";
} else if (suffix.includes("pdf")) {
type = "pdf";
} else if (
suffix.includes("mp4") ||
suffix.includes("webm") ||
suffix.includes("ogg")
) {
type = "video";
}
return type;
} }
//查看图片 //查看图片
viewImg(url) { viewImg(url) {
let dom = document.getElementById(`viewerjs`) let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes; let pObjs = dom.childNodes;
let node = document.createElement("img") let node = document.createElement("img");
node.style.display = "none"; node.style.display = "none";
node.src = url; node.src = url;
node.id = 'img' node.id = "img";
dom.appendChild(node) dom.appendChild(node);
setTimeout(() => { setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), { let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => { hidden: () => {
dom.removeChild(pObjs[0]); dom.removeChild(pObjs[0]);
viewer.destroy(); viewer.destroy();
} },
}); });
node.click(); node.click();
}, 0); }, 0);
@ -112,21 +132,40 @@ export class AuditDisposeComponent implements OnInit {
//查看文件 //查看文件
lookFile(item) { lookFile(item) {
if (!item) { if (!item) {
return return;
} }
if (this.getFileType(item) == 'word') { if (this.pubilcMethods.getFileType(item) == "word") {
let arr = item.split('.') let arr = item.split(".");
arr[arr.length - 1] = 'pdf' arr[arr.length - 1] = "pdf";
window.open(arr.join('.')) window.open(arr.join("."));
} else if (this.getFileType(item) == 'pdf') { } else if (this.pubilcMethods.getFileType(item) == "pdf") {
window.open(item) window.open(item);
} else if (this.getFileType(item) == 'img') { } else if (this.pubilcMethods.getFileType(item) == "img") {
this.viewImg(item) this.viewImg(item);
} else if (this.pubilcMethods.getFileType(item) == "video") {
this.modalChild.create({
nzContent: VideoPlayComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth:
document.documentElement.clientHeight < 650 ||
document.documentElement.clientWidth < 1400
? 1000
: 1200,
nzClosable: false,
nzClassName: "modelnobg",
nzBodyStyle: {
"border-radius": "0px",
padding: "0px",
},
nzComponentParams: {
vedioUrl: item,
},
nzFooter: null,
});
} else { } else {
this.message.create('warning', '暂不支持查看!'); this.message.create("warning", "暂不支持查看!");
window.open(window.location.origin + item);
} }
} }
} }

275
src/app/pages/audit/audit-ing/audit-ing.component.ts

@ -1,220 +1,265 @@
import { HttpClient } from '@angular/common/http'; import { HttpClient } from "@angular/common/http";
import { Component, ElementRef, OnInit, ViewContainerRef } from '@angular/core'; import { Component, ElementRef, OnInit, ViewContainerRef } from "@angular/core";
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from "ng-zorro-antd/message";
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from "ng-zorro-antd/modal";
import { Observable, fromEvent } from 'rxjs'; import { Observable, fromEvent } from "rxjs";
import { debounceTime } from 'rxjs/operators'; import { debounceTime } from "rxjs/operators";
import { DetailsFileCategoryComponent } from '../../license/file-category/details-file-category/details-file-category.component'; import { DetailsFileCategoryComponent } from "../../license/file-category/details-file-category/details-file-category.component";
import { DetailsUpdateCategoryComponent } from '../../license/update-category/details-update-category/details-update-category.component'; import { DetailsUpdateCategoryComponent } from "../../license/update-category/details-update-category/details-update-category.component";
import { AuditDetailsInformTimeComponent } from '../audit-inform-time/audit-details-inform-time/audit-details-inform-time.component'; import { AuditDetailsInformTimeComponent } from "../audit-inform-time/audit-details-inform-time/audit-details-inform-time.component";
import { GasBaseInfoComponent } from '../gas-base-info/gas-base-info.component'; import { GasBaseInfoComponent } from "../gas-base-info/gas-base-info.component";
import { AppealDetailsComponent } from './appeal-details/appeal-details.component'; import { AppealDetailsComponent } from "./appeal-details/appeal-details.component";
import { AuditDisposeComponent } from './audit-dispose/audit-dispose.component'; import { AuditDisposeComponent } from "./audit-dispose/audit-dispose.component";
import { UserDetailsComponent } from './user-details/user-details.component'; import { UserDetailsComponent } from "./user-details/user-details.component";
@Component({ @Component({
selector: 'app-audit-ing', selector: "app-audit-ing",
templateUrl: './audit-ing.component.html', templateUrl: "./audit-ing.component.html",
styleUrls: ['./audit-ing.component.scss'] styleUrls: ["./audit-ing.component.scss"],
}) })
export class AuditIngComponent implements OnInit { export class AuditIngComponent implements OnInit {
constructor(
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private http: HttpClient,
private message: NzMessageService,
private element: ElementRef
) {}
tableSpin = false;
constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef, private http: HttpClient, private message: NzMessageService, private element: ElementRef) { } tableScrollHeight;
tableSpin = false resizeListener;
tableScrollHeight level;
resizeListener
level
ngOnInit(): void { ngOnInit(): void {
this.tableScrollHeight = '100px' this.tableScrollHeight = "100px";
// 页面监听 // 页面监听
this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => { this.resizeListener = fromEvent(window, "resize")
let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight .pipe(debounceTime(100))
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px' .subscribe((event) => {
let tableHeader =
this.element.nativeElement.querySelector(
`.ant-table-header`
).clientHeight;
this.tableScrollHeight =
document.getElementById("tablebox").clientHeight -
tableHeader -
10 +
"px";
}); });
this.getStationList() this.getStationList();
this.level = JSON.parse(sessionStorage.getItem('userdata')).organization.level this.level = JSON.parse(
sessionStorage.getItem("userdata")
).organization.level;
} }
ngOnDestroy(): void { ngOnDestroy(): void {
this.resizeListener.unsubscribe() this.resizeListener.unsubscribe();
} }
ngAfterViewInit(): void { ngAfterViewInit(): void {
fromEvent(this.element.nativeElement.querySelector(`.ant-table-body`) as HTMLCanvasElement, 'scroll').pipe(debounceTime(100)).subscribe((event: any) => { //监听 DOM 滚动事件 fromEvent(
if (event.target.scrollHeight - (event.target.scrollTop + event.target.clientHeight) <= 10) { this.element.nativeElement.querySelector(
`.ant-table-body`
) as HTMLCanvasElement,
"scroll"
)
.pipe(debounceTime(100))
.subscribe((event: any) => {
//监听 DOM 滚动事件
if (
event.target.scrollHeight -
(event.target.scrollTop + event.target.clientHeight) <=
10
) {
if (this.totalCount > this.list.length) { if (this.totalCount > this.list.length) {
this.SkipCount = String(Number(this.SkipCount) + 50) this.SkipCount = String(Number(this.SkipCount) + 50);
this.getStationList() this.getStationList();
} }
} }
}); });
} }
list = [] list = [];
totalCount; //列表总数 totalCount; //列表总数
SkipCount: string = '0'; SkipCount: string = "0";
MaxResultCount: string = '50'; MaxResultCount: string = "50";
//获取当前油站档案类证照 //获取当前油站档案类证照
getStationList() { getStationList() {
this.tableSpin = true this.tableSpin = true;
let data = JSON.parse(sessionStorage.getItem('userdata')); let data = JSON.parse(sessionStorage.getItem("userdata"));
let params = { let params = {
OrganizationUnitId: data.organization.id || "", OrganizationUnitId: data.organization.id || "",
IsContainsChildren: "true", IsContainsChildren: "true",
AuditStatuses: "1", AuditStatuses: "1",
SkipCount: this.SkipCount, SkipCount: this.SkipCount,
MaxResultCount: this.MaxResultCount, MaxResultCount: this.MaxResultCount,
} };
this.http.get(`/api/services/app/ContentAuditLog/GetAuditting`, { params }).subscribe((info: any) => { this.http
info.result.items.forEach(element => { .get(`/api/services/app/ContentAuditLog/GetAuditting`, { params })
element.itemData = JSON.parse(element.itemData) .subscribe((info: any) => {
info.result.items.forEach((element) => {
element.itemData = JSON.parse(element.itemData);
}); });
this.list = this.list.concat(info.result.items); this.list = this.list.concat(info.result.items);
this.list = [...this.list] this.list = [...this.list];
this.totalCount = info.result.totalCount this.totalCount = info.result.totalCount;
this.tableSpin = false this.tableSpin = false;
setTimeout(() => { setTimeout(() => {
let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight let tableHeader =
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px' this.element.nativeElement.querySelector(
`.ant-table-header`
).clientHeight;
this.tableScrollHeight =
document.getElementById("tablebox").clientHeight -
tableHeader -
10 +
"px";
}, 0); }, 0);
console.log(this.list) console.log(this.list);
}) });
} }
dispose(item) { dispose(item) {
this.getData(item).then(res => { this.getData(item).then((res) => {
item.getData = res item.getData = res;
const modal = this.modal.create({ const modal = this.modal.create({
nzContent: AuditDisposeComponent, nzContent: AuditDisposeComponent,
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzWidth: item.auditType == 0 ? 700 : 600, nzWidth: item.auditType == 0 ? 700 : 600,
nzBodyStyle: { nzBodyStyle: {
'border': '1px solid #91CCFF', border: "1px solid #91CCFF",
'border-radius': '0px', "border-radius": "0px",
'padding': '7px', padding: "7px",
'box-shadow': '0 0 8px 0 #fff', "box-shadow": "0 0 8px 0 #fff",
'background-image': 'linear-gradient(#003665, #000f25)' "background-image": "linear-gradient(#003665, #000f25)",
}, },
nzStyle: { nzStyle: {
'top': '50px', top: "50px",
}, },
nzComponentParams: { nzComponentParams: {
data: item data: item,
}, },
nzFooter: null, nzFooter: null,
nzKeyboard: false, nzKeyboard: false,
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {
await new Promise(resolve => { await new Promise((resolve, reject) => {
let url = '/api/services/app/ContentAuditLog/Audit' if (!instance.isPass && !instance.textarea) {
this.message.warning("请输入审批意见");
reject();
return;
}
let url = "/api/services/app/ContentAuditLog/Audit";
let params = { let params = {
id: item.id, id: item.id,
rejectReason: instance.textarea rejectReason: instance.textarea,
} };
let body = instance.isPass ? 2 : 3; let body = instance.isPass ? 2 : 3;
this.http.post(url, body, { params }).subscribe(data => { this.http.post(url, body, { params }).subscribe((data) => {
resolve(data); resolve(data);
this.list = [] this.list = [];
this.SkipCount = '0' this.SkipCount = "0";
this.getStationList(); this.getStationList();
this.message.create('success', '审核完成!'); this.message.create("success", "审核完成!");
return true return true;
}) });
}) });
} },
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => { }); modal.afterClose.subscribe((result) => {});
}) });
} }
details(item) { details(item) {
console.log('点击的item', item) console.log("点击的item", item);
let component let component;
if (item.auditType == 0) { if (item.auditType == 0) {
component = GasBaseInfoComponent component = GasBaseInfoComponent;
} else if (item.auditType == 1) { } else if (item.auditType == 1) {
component = AuditDetailsInformTimeComponent component = AuditDetailsInformTimeComponent;
} else if (item.auditType == 2) { } else if (item.auditType == 2) {
component = DetailsUpdateCategoryComponent component = DetailsUpdateCategoryComponent;
} else if (item.auditType == 4) { } else if (item.auditType == 4) {
component = UserDetailsComponent component = UserDetailsComponent;
} else if (item.auditType == 5) { } else if (item.auditType == 5) {
component = AppealDetailsComponent component = AppealDetailsComponent;
} else if (item.auditType) { } else if (item.auditType) {
component = DetailsFileCategoryComponent component = DetailsFileCategoryComponent;
} }
this.getData(item).then((res: any) => { this.getData(item).then((res: any) => {
item.getData = res item.getData = res;
if (item.auditType == 1) { if (item.auditType == 1) {
item.getData.isYearlyCheckDefault = res.licenseType.isYearlyCheck item.getData.isYearlyCheckDefault = res.licenseType.isYearlyCheck;
} }
const modal = this.modal.create({ const modal = this.modal.create({
nzContent: component, nzContent: component,
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzWidth: item.auditType == 0 ? 700 : 450, nzWidth: item.auditType == 0 ? 700 : 450,
nzBodyStyle: { nzBodyStyle: {
'border': '1px solid #91CCFF', border: "1px solid #91CCFF",
'border-radius': '0px', "border-radius": "0px",
'padding': '7px', padding: "7px",
'box-shadow': '0 0 8px 0 #fff', "box-shadow": "0 0 8px 0 #fff",
'background-image': 'linear-gradient(#003665, #000f25)' "background-image": "linear-gradient(#003665, #000f25)",
}, },
nzStyle: { nzStyle: {
'top': '50px', top: "50px",
}, },
nzComponentParams: { nzComponentParams: {
data: item.getData data: item.getData,
}, },
nzKeyboard: false, nzKeyboard: false,
nzFooter: null, nzFooter: null,
nzClosable: false, nzClosable: false,
}); });
}) });
} }
//获取证照类data //获取证照类data
getData(item) { getData(item) {
let url let url;
if (item.auditType == 0) { //油站基本信息 if (item.auditType == 0) {
//油站基本信息
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let organization = { organizationId: item.organizationId } let organization = { organizationId: item.organizationId };
resolve(organization) resolve(organization);
}) });
} else if (item.auditType == 1) { } else if (item.auditType == 1) {
url = '/api/services/app/OrganizationValidityLicenseRule/Get' url = "/api/services/app/OrganizationValidityLicenseRule/Get";
} else if (item.auditType == 2) { } else if (item.auditType == 2) {
url = '/api/services/app/StationValidityLicense/Get' url = "/api/services/app/StationValidityLicense/Get";
} else if (item.auditType == 4) { } else if (item.auditType == 4) {
url = '/api/services/app/EdittingUser/Get' url = "/api/services/app/EdittingUser/Get";
} else if (item.auditType == 5) { } else if (item.auditType == 5) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve(item) resolve(item);
}) });
} else if (item.auditType) { } else if (item.auditType) {
url = '/api/services/app/StationFileLicense/Get' url = "/api/services/app/StationFileLicense/Get";
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let params = { id: item.itemId } let params = { id: item.itemId };
this.http.get(url, { params }).subscribe((data: any) => { this.http.get(url, { params }).subscribe((data: any) => {
let auditLog = { rejectReason: item.rejectReason } let auditLog = { rejectReason: item.rejectReason };
let organization = { displayName: item.organization ? item.organization.displayName : "" } let organization = {
displayName: item.organization ? item.organization.displayName : "",
};
if (item.auditType == 1) { if (item.auditType == 1) {
data.result.auditLog = auditLog data.result.auditLog = auditLog;
data.result.organization = organization data.result.organization = organization;
data.result.handleRemindDaysDefault = data.result.licenseType.handleRemindDays data.result.handleRemindDaysDefault =
data.result.closingRemindDaysDefault = data.result.licenseType.closingRemindDays data.result.licenseType.handleRemindDays;
data.result.closingRemindDaysDefault =
data.result.licenseType.closingRemindDays;
} }
if (item.auditType == 2 || item.auditType == 3) { if (item.auditType == 2 || item.auditType == 3) {
data.result.auditLogId = item.id data.result.auditLogId = item.id;
} }
resolve(data.result) resolve(data.result);
}) });
}) });
} }
} }

10
src/app/pages/equipment-info/equipment-info.component.ts

@ -102,12 +102,12 @@ export class EquipmentInfoComponent implements OnInit {
.post("/api/services/app/FireEquipment/Create", body) .post("/api/services/app/FireEquipment/Create", body)
.subscribe((data) => { .subscribe((data) => {
resolve(data); resolve(data);
this.message.create("success", "创建成功"); this.message.create("success", "创建成功!");
return true; return true;
}); });
}); });
} else { } else {
this.message.create("warning", "请填写完整"); this.message.create("warning", "请填写完整!");
return false; return false;
} }
}, },
@ -156,12 +156,12 @@ export class EquipmentInfoComponent implements OnInit {
.put("/api/services/app/FireEquipment/Update", body) .put("/api/services/app/FireEquipment/Update", body)
.subscribe((data) => { .subscribe((data) => {
resolve(data); resolve(data);
this.message.create("success", "修改成功"); this.message.create("success", "修改成功!");
return true; return true;
}); });
}); });
} else { } else {
this.message.create("warning", "请填写完整"); this.message.create("warning", "请填写完整!");
return false; return false;
} }
}, },
@ -182,7 +182,7 @@ export class EquipmentInfoComponent implements OnInit {
}, },
}) })
.subscribe((data) => { .subscribe((data) => {
this.message.create("success", "删除成功"); this.message.create("success", "删除成功!");
this.getEquipment(); this.getEquipment();
}); });
}, },

2
src/app/pages/home-page-nologin/home-page-nologin.component.html

@ -17,7 +17,7 @@
<li class="info" *ngFor="let item of unreadMessageList;let key = index"> <li class="info" *ngFor="let item of unreadMessageList;let key = index">
<div class="infoitem"> <div class="infoitem">
<img src="../../../assets/images/warning1.png" alt=""> <img src="../../../assets/images/warning1.png" alt="">
您有一条新的预警信息{{item.notification.data.violationName}} 您有一条新的预警信息!{{item.notification.data.violationName}}
</div> </div>
<div class="btn"> <div class="btn">
<span (click)="look(item)">查看</span> <span (click)="look(item)">查看</span>

10
src/app/pages/home-page-nologin/home-page-nologin.component.ts

@ -822,11 +822,11 @@ export class HomePageNologinComponent implements OnInit {
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = { let body = {
id: item.notification.entityId, id: item.notification.entityId,
handleRecord: '报废成功' handleRecord: '报废成功!'
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '报废成功'); this.message.create('success', '报废成功!');
copydata.handleTime = new Date() copydata.handleTime = new Date()
return true return true
}) })
@ -848,18 +848,18 @@ export class HomePageNologinComponent implements OnInit {
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = { let body = {
id: item.notification.entityId, id: item.notification.entityId,
handleRecord: '维保成功' handleRecord: '维保成功!'
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '维保成功'); this.message.create('success', '维保成功!');
copydata.handleTime = new Date() copydata.handleTime = new Date()
return true return true
}) })
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }

2
src/app/pages/home-page/home-page.component.html

@ -18,7 +18,7 @@
<li class="info" *ngFor="let item of unreadMessageList;let key = index"> <li class="info" *ngFor="let item of unreadMessageList;let key = index">
<div class="infoitem"> <div class="infoitem">
<img src="../../../assets/images/warning1.png" alt=""> <img src="../../../assets/images/warning1.png" alt="">
您有一条新的预警信息{{item.notification.data.violationName}} 您有一条新的预警信息!{{item.notification.data.violationName}}
</div> </div>
<div class="btn"> <div class="btn">
<span (click)="look(item)">查看</span> <span (click)="look(item)">查看</span>

10
src/app/pages/home-page/home-page.component.ts

@ -1013,7 +1013,7 @@ export class HomePageComponent implements OnInit {
.subscribe((data: any) => { .subscribe((data: any) => {
let body = { let body = {
id: item.notification.entityId, id: item.notification.entityId,
handleRecord: "报废成功", handleRecord: "报废成功!",
}; };
this.http this.http
.post( .post(
@ -1022,7 +1022,7 @@ export class HomePageComponent implements OnInit {
) )
.subscribe((data) => { .subscribe((data) => {
resolve(data); resolve(data);
this.message.create("success", "报废成功"); this.message.create("success", "报废成功!");
copydata.handleTime = new Date(); copydata.handleTime = new Date();
return true; return true;
}); });
@ -1052,7 +1052,7 @@ export class HomePageComponent implements OnInit {
.subscribe((data: any) => { .subscribe((data: any) => {
let body = { let body = {
id: item.notification.entityId, id: item.notification.entityId,
handleRecord: "维保成功", handleRecord: "维保成功!",
}; };
this.http this.http
.post( .post(
@ -1061,14 +1061,14 @@ export class HomePageComponent implements OnInit {
) )
.subscribe((data) => { .subscribe((data) => {
resolve(data); resolve(data);
this.message.create("success", "维保成功"); this.message.create("success", "维保成功!");
copydata.handleTime = new Date(); copydata.handleTime = new Date();
return true; return true;
}); });
}); });
}); });
} else { } else {
this.message.create("warning", "请填写完整"); this.message.create("warning", "请填写完整!");
return false; return false;
} }
} }

22
src/app/pages/home/home.component.ts

@ -314,12 +314,12 @@ export class HomeComponent implements OnInit {
this.passwordValidateForm.value.newpassword != this.passwordValidateForm.value.newpassword !=
this.passwordValidateForm.value.affirmpassword this.passwordValidateForm.value.affirmpassword
) { ) {
this.message.create("warning", "两次密码输入不一致"); this.message.create("warning", "两次密码输入不一致!");
} else if ( } else if (
this.passwordValidateForm.value.newpassword == this.passwordValidateForm.value.newpassword ==
this.passwordValidateForm.value.oldpassword this.passwordValidateForm.value.oldpassword
) { ) {
this.message.create("warning", "旧密码和新密码不能相同"); this.message.create("warning", "旧密码和新密码不能相同!");
} else { } else {
this.isConfirmLoading = true; this.isConfirmLoading = true;
let body = { let body = {
@ -328,7 +328,7 @@ export class HomeComponent implements OnInit {
}; };
this.http.post("/api/services/app/User/ChangePassword", body).subscribe( this.http.post("/api/services/app/User/ChangePassword", body).subscribe(
(data) => { (data) => {
this.message.create("success", "修改成功"); this.message.create("success", "修改成功!");
this.isConfirmLoading = false; this.isConfirmLoading = false;
this.isVisible = false; this.isVisible = false;
//清除sessionStorage //清除sessionStorage
@ -453,7 +453,7 @@ export class HomeComponent implements OnInit {
.subscribe((data: any) => { .subscribe((data: any) => {
let body = { let body = {
id: copydata.id, id: copydata.id,
handleRecord: "报废成功", handleRecord: "报废成功!",
}; };
this.http this.http
.post( .post(
@ -462,7 +462,7 @@ export class HomeComponent implements OnInit {
) )
.subscribe((data) => { .subscribe((data) => {
resolve(data); resolve(data);
this.message.create("success", "报废成功"); this.message.create("success", "报废成功!");
copydata.handleTime = new Date(); copydata.handleTime = new Date();
if (this.router.url.indexOf("todaywarning") != -1) { if (this.router.url.indexOf("todaywarning") != -1) {
let obj = { let obj = {
@ -500,7 +500,7 @@ export class HomeComponent implements OnInit {
.subscribe((data: any) => { .subscribe((data: any) => {
let body = { let body = {
id: copydata.id, id: copydata.id,
handleRecord: "维保成功", handleRecord: "维保成功!",
}; };
this.http this.http
.post( .post(
@ -509,7 +509,7 @@ export class HomeComponent implements OnInit {
) )
.subscribe((data) => { .subscribe((data) => {
resolve(data); resolve(data);
this.message.create("success", "维保成功"); this.message.create("success", "维保成功!");
copydata.handleTime = new Date(); copydata.handleTime = new Date();
if ( if (
this.router.url.indexOf("todaywarning") != -1 this.router.url.indexOf("todaywarning") != -1
@ -525,7 +525,7 @@ export class HomeComponent implements OnInit {
}); });
}); });
} else { } else {
this.message.create("warning", "请填写完整"); this.message.create("warning", "请填写完整!");
return false; return false;
} }
} }
@ -748,7 +748,7 @@ export class HomeComponent implements OnInit {
instance.validateForm.value.newpassword != instance.validateForm.value.newpassword !=
instance.validateForm.value.affirmpassword instance.validateForm.value.affirmpassword
) { ) {
this.message.create("warning", "两次密码输入不一致"); this.message.create("warning", "两次密码输入不一致!");
return false; return false;
} }
if (word.indexOf("sino") != -1 || word.indexOf("zhonghua") != -1) { if (word.indexOf("sino") != -1 || word.indexOf("zhonghua") != -1) {
@ -768,7 +768,7 @@ export class HomeComponent implements OnInit {
.subscribe( .subscribe(
(data) => { (data) => {
resolve(data); resolve(data);
this.message.create("success", "修改成功"); this.message.create("success", "修改成功!");
return true; return true;
}, },
(err) => { (err) => {
@ -780,7 +780,7 @@ export class HomeComponent implements OnInit {
}); });
} }
} else { } else {
this.message.create("warning", "请填写完整"); this.message.create("warning", "请填写完整!");
return false; return false;
} }
}, },

8
src/app/pages/left-domain/left-domain.component.ts

@ -411,7 +411,7 @@ export class LeftDomainComponent implements OnInit {
if (!this.validateForm3.valid) { if (!this.validateForm3.valid) {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return return
} }
@ -513,7 +513,7 @@ export class LeftDomainComponent implements OnInit {
saveDisposalNode() { saveDisposalNode() {
if (!this.validateForm2.valid) { if (!this.validateForm2.valid) {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return return
} }
let e = this.validateForm2.value let e = this.validateForm2.value
@ -565,9 +565,9 @@ export class LeftDomainComponent implements OnInit {
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
this.message.create('success', '导出成功'); this.message.create('success', '导出成功!');
}, err => { }, err => {
this.message.create('error', '导出失败'); this.message.create('error', '导出失败!');
}) })
} }

157
src/app/pages/license/file-category/details-file-category/details-file-category.component.ts

@ -1,92 +1,112 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input, ViewContainerRef } from "@angular/core";
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef, NzModalService } from "ng-zorro-antd/modal";
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { HttpClient } from '@angular/common/http'; import { HttpClient } from "@angular/common/http";
import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service'; import { ObjectsSimpleService } from "src/app/service/objectsSimple.service";
import Viewer from 'viewerjs'; import Viewer from "viewerjs";
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from "ng-zorro-antd/message";
import { PublicMethodsService } from "src/app/service/publicMethods.service";
import { VideoPlayComponent } from "src/app/component/video-play/video-play.component";
@Component({ @Component({
selector: 'app-details-file-category', selector: "app-details-file-category",
templateUrl: './details-file-category.component.html', templateUrl: "./details-file-category.component.html",
styleUrls: ['./details-file-category.component.scss'] styleUrls: ["./details-file-category.component.scss"],
}) })
export class DetailsFileCategoryComponent implements OnInit { export class DetailsFileCategoryComponent implements OnInit {
@Input() data?: any; @Input() data?: any;
constructor(private modal: NzModalRef, private http: HttpClient,private message: NzMessageService) { } constructor(
private modal: NzModalRef,
private http: HttpClient,
private message: NzMessageService,
private pubilcMethods: PublicMethodsService,
private viewContainerRef: ViewContainerRef,
private modalChild: NzModalService
) {}
ngOnInit(): void { ngOnInit(): void {
this.getAuditLogging() this.getAuditLogging();
} }
auditList: any[] = []; auditList: any[] = [];
//获取审核记录 //获取审核记录
getAuditLogging() { getAuditLogging() {
if (!this.data.auditLogId) { if (!this.data.auditLogId) {
return return;
} }
let params = { id: this.data.auditLogId } let params = { id: this.data.auditLogId };
this.http.get(`/api/services/app/ContentAuditLog/Get`,{params}).subscribe((data: any)=>{ this.http
this.auditList = data.result.actionList || [] .get(`/api/services/app/ContentAuditLog/Get`, { params })
console.log(this.auditList) .subscribe((data: any) => {
}) this.auditList = data.result.actionList || [];
console.log(this.auditList);
});
} }
//获取审核次数 //获取审核次数
getVerifyNum(): number { getVerifyNum(): number {
let num = 0 let num = 0;
this.auditList.forEach(item=>{ this.auditList.forEach((item) => {
if (item.auditStatus == 2 || item.auditStatus == 3) { if (item.auditStatus == 2 || item.auditStatus == 3) {
num = num + 1 num = num + 1;
} }
}) });
return num return num;
} }
//获取驳回次数 //获取驳回次数
getRejectNum(): number { getRejectNum(): number {
let num = 0 let num = 0;
this.auditList.forEach(item=>{ this.auditList.forEach((item) => {
if (item.auditStatus == 3) { if (item.auditStatus == 3) {
num = num + 1 num = num + 1;
} }
}) });
return num return num;
} }
destroyModal() { destroyModal() {
this.modal.destroy({ data: 'this the result data' }); this.modal.destroy({ data: "this the result data" });
} }
//获取文件格式 //获取文件格式
getFileType(name: string): string { getFileType(name: string): string {
let suffix let type;
if (name.substring(name.length-4).includes('png') || name.substring(name.length-4).includes('jpg') || name.substring(name.length-4).includes('jpeg') || name.substring(name.length-4).includes('webp')) { let suffix = name.substring(name.length - 4);
suffix = 'img' if (
} else if (name.substring(name.length-4).includes('doc') || name.substring(name.length-4).includes('docx')) { suffix.includes("png") ||
suffix = 'word' suffix.includes("jpg") ||
} else if (name.substring(name.length-4).includes('pdf')) { suffix.includes("jpeg") ||
suffix = 'pdf' suffix.includes("webp")
} ) {
return suffix type = "img";
} else if (suffix.includes("doc") || suffix.includes("docx")) {
type = "word";
} else if (suffix.includes("pdf")) {
type = "pdf";
} else if (
suffix.includes("mp4") ||
suffix.includes("webm") ||
suffix.includes("ogg")
) {
type = "video";
}
return type;
} }
//查看图片 //查看图片
viewImg(url) { viewImg(url) {
let dom = document.getElementById(`viewerjs`) let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes; let pObjs = dom.childNodes;
let node = document.createElement("img") let node = document.createElement("img");
node.style.display = "none"; node.style.display = "none";
node.src = url; node.src = url;
node.id = 'img' node.id = "img";
dom.appendChild(node) dom.appendChild(node);
setTimeout(() => { setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), { let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => { hidden: () => {
dom.removeChild(pObjs[0]); dom.removeChild(pObjs[0]);
viewer.destroy(); viewer.destroy();
} },
}); });
node.click(); node.click();
}, 0); }, 0);
@ -95,17 +115,40 @@ export class DetailsFileCategoryComponent implements OnInit {
//查看文件 //查看文件
lookFile(item) { lookFile(item) {
if (!item.imageUrl) { if (!item.imageUrl) {
return return;
} }
if (this.getFileType(item.imageUrl) == 'word') { if (this.pubilcMethods.getFileType(item.imageUrl) == "word") {
let arr = item.imageUrl.split('.') let arr = item.imageUrl.split(".");
arr[arr.length - 1] = 'pdf' arr[arr.length - 1] = "pdf";
window.open(arr.join('.')) window.open(arr.join("."));
} else if (this.getFileType(item.imageUrl) == 'pdf') { } else if (this.pubilcMethods.getFileType(item.imageUrl) == "pdf") {
window.open(item.imageUrl) window.open(item.imageUrl);
} else if (this.pubilcMethods.getFileType(item.imageUrl) == "img") {
this.viewImg(item.imageUrl);
} else if (this.pubilcMethods.getFileType(item.imageUrl) == "video") {
this.modalChild.create({
nzContent: VideoPlayComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth:
document.documentElement.clientHeight < 650 ||
document.documentElement.clientWidth < 1400
? 1000
: 1200,
nzClosable: false,
nzClassName: "modelnobg",
nzBodyStyle: {
"border-radius": "0px",
padding: "0px",
},
nzComponentParams: {
vedioUrl: item.imageUrl,
},
nzFooter: null,
});
} else { } else {
this.message.create('warning', '暂不支持查看!'); this.message.create("warning", "暂不支持查看!");
window.open(window.location.origin + item.imageUrl);
} }
} }
} }

198
src/app/pages/license/file-category/edit-file-category/edit-file-category.component.ts

@ -1,43 +1,50 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input, ViewContainerRef } from "@angular/core";
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef, NzModalService } from "ng-zorro-antd/modal";
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { HttpClient } from '@angular/common/http'; import { ObjectsSimpleService } from "src/app/service/objectsSimple.service";
import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service'; import Viewer from "viewerjs";
import Viewer from 'viewerjs'; import { NzMessageService } from "ng-zorro-antd/message";
import { NzMessageService } from 'ng-zorro-antd/message'; import { PublicMethodsService } from "src/app/service/publicMethods.service";
import { VideoPlayComponent } from "src/app/component/video-play/video-play.component";
@Component({ @Component({
selector: 'app-edit-file-category', selector: "app-edit-file-category",
templateUrl: './edit-file-category.component.html', templateUrl: "./edit-file-category.component.html",
styleUrls: ['./edit-file-category.component.scss'] styleUrls: ["./edit-file-category.component.scss"],
}) })
export class EditFileCategoryComponent implements OnInit { export class EditFileCategoryComponent implements OnInit {
@Input() data?: any; @Input() data?: any;
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private objectsSrv: ObjectsSimpleService,private message: NzMessageService) { } constructor(
private modal: NzModalRef,
private fb: FormBuilder,
data2 private objectsSrv: ObjectsSimpleService,
private message: NzMessageService,
private pubilcMethods: PublicMethodsService,
private viewContainerRef: ViewContainerRef,
private modalChild: NzModalService
) {}
data2;
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
type: [null, [Validators.required]], type: [null, [Validators.required]],
remark: [null] remark: [null],
}); });
this.data2 = JSON.parse(JSON.stringify(this.data)) this.data2 = JSON.parse(JSON.stringify(this.data));
this.validatyType = (this.data2.validatyType).toString() this.validatyType = this.data2.validatyType.toString();
console.log(this.data2) console.log(this.data2);
} }
validatyType: string validatyType: string;
isLongTerm = false isLongTerm = false;
imageUrl = '/api/Objects/sinochemweb/stationPhotos/175/timg.jpg' imageUrl = "/api/Objects/sinochemweb/stationPhotos/175/timg.jpg";
validityChange($event) { validityChange($event) {
this.isLongTerm = $event this.isLongTerm = $event;
} }
destroyModal() { destroyModal() {
this.modal.destroy({ data: 'this the result data' }); this.modal.destroy({ data: "this the result data" });
} }
isSubmit: boolean = false; isSubmit: boolean = false;
@ -52,43 +59,43 @@ export class EditFileCategoryComponent implements OnInit {
this.modal.triggerOk(); this.modal.triggerOk();
} }
isLoadingSave: boolean = false;
uploadIndex: string;
isLoadingSave: boolean = false
uploadIndex: string
filechange(e) { filechange(e) {
this.isLoadingSave = true this.isLoadingSave = true;
let oilStationId = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id let oilStationId = JSON.parse(
let file = e.target.files[0] || null //获取上传的文件 sessionStorage.getItem("userdataOfgasstation")
this.openFileSelect(file, `stationPhotos/${oilStationId}/`) ).organization.id;
let file = e.target.files[0] || null; //获取上传的文件
this.openFileSelect(file, `stationPhotos/${oilStationId}/`);
} }
//设置文件路径并上传 //设置文件路径并上传
postFilePath postFilePath;
async openFileSelect(file: File, extensionPath: string) { async openFileSelect(file: File, extensionPath: string) {
this.postFilePath = extensionPath; this.postFilePath = extensionPath;
let fileSize = file.size || null //上传文件的总大小 let fileSize = file.size || null; //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB 超过5MB要分块上传 let shardSize = 5 * 1024 * 1024; //5MB 超过5MB要分块上传
if (fileSize >= shardSize) // 超过5MB要分块上传 if (fileSize >= shardSize) {
{ // 超过5MB要分块上传
await this.postFileByMul(file); await this.postFileByMul(file);
} } //普通上传
else //普通上传 else {
{
await this.postFile(file); await this.postFile(file);
} }
} }
//上传文件 //上传文件
async postFile(file: File) { async postFile(file: File) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
this.objectsSrv.postFile(this.postFilePath, file).subscribe(data => { this.objectsSrv.postFile(this.postFilePath, file).subscribe((data) => {
let dataObj = data as any; let dataObj = data as any;
let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName; let filePath: string =
this.imageUrl = filePath ObjectsSimpleService.baseUrl + dataObj.objectName;
this.data2.imageUrl = filePath this.imageUrl = filePath;
this.isLoadingSave = false this.data2.imageUrl = filePath;
resolve('success') this.isLoadingSave = false;
resolve("success");
});
}); });
})
} }
/** /**
@ -96,44 +103,56 @@ export class EditFileCategoryComponent implements OnInit {
* @param file * @param file
*/ */
postFileByMul(file: File) { postFileByMul(file: File) {
this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => { this.objectsSrv
.postFile_MultipartUpload(this.postFilePath, file)
.then((value) => {
let dataObj = value as any; let dataObj = value as any;
let filePath = dataObj.filePath let filePath = dataObj.filePath;
this.imageUrl = filePath this.imageUrl = filePath;
this.data2.imageUrl = filePath this.data2.imageUrl = filePath;
this.isLoadingSave = false this.isLoadingSave = false;
}); });
} }
//获取文件格式 //获取文件格式
getFileType(name: string): string { getFileType(name: string): string {
let suffix let type;
if (name.substring(name.length-4).includes('png') || name.substring(name.length-4).includes('jpg') || name.substring(name.length-4).includes('jpeg') || name.substring(name.length-4).includes('webp')) { let suffix = name.substring(name.length - 4);
suffix = 'img' if (
} else if (name.substring(name.length-4).includes('doc') || name.substring(name.length-4).includes('docx')) { suffix.includes("png") ||
suffix = 'word' suffix.includes("jpg") ||
} else if (name.substring(name.length-4).includes('pdf')) { suffix.includes("jpeg") ||
suffix = 'pdf' suffix.includes("webp")
} ) {
return suffix type = "img";
} else if (suffix.includes("doc") || suffix.includes("docx")) {
type = "word";
} else if (suffix.includes("pdf")) {
type = "pdf";
} else if (
suffix.includes("mp4") ||
suffix.includes("webm") ||
suffix.includes("ogg")
) {
type = "video";
}
return type;
} }
//查看图片 //查看图片
viewImg(url) { viewImg(url) {
let dom = document.getElementById(`viewerjs`) let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes; let pObjs = dom.childNodes;
let node = document.createElement("img") let node = document.createElement("img");
node.style.display = "none"; node.style.display = "none";
node.src = url; node.src = url;
node.id = 'img' node.id = "img";
dom.appendChild(node) dom.appendChild(node);
setTimeout(() => { setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), { let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => { hidden: () => {
dom.removeChild(pObjs[0]); dom.removeChild(pObjs[0]);
viewer.destroy(); viewer.destroy();
} },
}); });
node.click(); node.click();
}, 0); }, 0);
@ -142,17 +161,40 @@ export class EditFileCategoryComponent implements OnInit {
//查看文件 //查看文件
lookFile(item) { lookFile(item) {
if (!item.imageUrl) { if (!item.imageUrl) {
return return;
} }
if (this.getFileType(item.imageUrl) == 'word') { if (this.pubilcMethods.getFileType(item.imageUrl) == "word") {
let arr = item.imageUrl.split('.') let arr = item.imageUrl.split(".");
arr[arr.length - 1] = 'pdf' arr[arr.length - 1] = "pdf";
window.open(arr.join('.')) window.open(arr.join("."));
} else if (this.getFileType(item.imageUrl) == 'pdf') { } else if (this.pubilcMethods.getFileType(item.imageUrl) == "pdf") {
window.open(item.imageUrl) window.open(item.imageUrl);
} else if (this.pubilcMethods.getFileType(item.imageUrl) == "img") {
this.viewImg(item.imageUrl);
} else if (this.pubilcMethods.getFileType(item.imageUrl) == "video") {
this.modalChild.create({
nzContent: VideoPlayComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth:
document.documentElement.clientHeight < 650 ||
document.documentElement.clientWidth < 1400
? 1000
: 1200,
nzClosable: false,
nzClassName: "modelnobg",
nzBodyStyle: {
"border-radius": "0px",
padding: "0px",
},
nzComponentParams: {
vedioUrl: item.imageUrl,
},
nzFooter: null,
});
} else { } else {
this.message.create('warning', '暂不支持查看!'); this.message.create("warning", "暂不支持查看!");
window.open(window.location.origin + item.imageUrl);
} }
} }
} }

283
src/app/pages/license/file-category/file-category.component.ts

@ -1,84 +1,82 @@
import { Component, OnInit, ViewContainerRef } from '@angular/core'; import { Component, OnInit, ViewContainerRef } from "@angular/core";
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from "ng-zorro-antd/modal";
import { Observable, fromEvent } from 'rxjs'; import { fromEvent } from "rxjs";
import { debounceTime } from 'rxjs/operators'; import { debounceTime } from "rxjs/operators";
import Viewer from 'viewerjs'; import Viewer from "viewerjs";
import * as moment from 'moment'; import { NzMessageService } from "ng-zorro-antd/message";
import { NzMessageService } from 'ng-zorro-antd/message'; import { HttpClient } from "@angular/common/http";
import { HttpClient } from '@angular/common/http'; import { EditFileCategoryComponent } from "./edit-file-category/edit-file-category.component";
import { EditFileCategoryComponent } from './edit-file-category/edit-file-category.component'; import { DetailsFileCategoryComponent } from "./details-file-category/details-file-category.component";
import { DetailsFileCategoryComponent } from './details-file-category/details-file-category.component'; import { PublicMethodsService } from "src/app/service/publicMethods.service";
import { VideoPlayComponent } from "src/app/component/video-play/video-play.component";
@Component({ @Component({
selector: 'app-file-category', selector: "app-file-category",
templateUrl: './file-category.component.html', templateUrl: "./file-category.component.html",
styleUrls: ['./file-category.component.scss'] styleUrls: ["./file-category.component.scss"],
}) })
export class FileCategoryComponent implements OnInit { export class FileCategoryComponent implements OnInit {
constructor(
constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient) { } private modal: NzModalService,
tableSpin = false private viewContainerRef: ViewContainerRef,
private message: NzMessageService,
private http: HttpClient,
private pubilcMethods: PublicMethodsService,
private modalChild: NzModalService
) {}
tableSpin = false;
list = []; //tabelData list = []; //tabelData
tableScrollHeight tableScrollHeight;
resizeListener resizeListener;
ngOnInit(): void { ngOnInit(): void {
setTimeout(() => { setTimeout(() => {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px' this.tableScrollHeight =
document.getElementById("tablebox").clientHeight - 42 + "px";
}, 0); }, 0);
// 页面监听 // 页面监听
this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => { this.resizeListener = fromEvent(window, "resize")
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px' .pipe(debounceTime(100))
.subscribe((event) => {
this.tableScrollHeight =
document.getElementById("tablebox").clientHeight - 42 + "px";
}); });
this.getStationList() this.getStationList();
} }
ngOnDestroy(): void { ngOnDestroy(): void {
this.resizeListener.unsubscribe() this.resizeListener.unsubscribe();
} }
//获取当前油站档案类证照 //获取当前油站档案类证照
getStationList() { getStationList() {
this.tableSpin = true this.tableSpin = true;
let data = JSON.parse(sessionStorage.getItem('userdataOfgasstation')); let data = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
let params = { orgId: data.organization.id || "" } let params = { orgId: data.organization.id || "" };
this.http.get(`/api/services/app/StationFileLicense/GetStationList`, { params }).subscribe((info: any) => { this.http
this.list = info.result .get(`/api/services/app/StationFileLicense/GetStationList`, { params })
this.tableSpin = false .subscribe((info: any) => {
console.log(info.result) this.list = info.result;
}) this.tableSpin = false;
} console.log(info.result);
});
//获取文件格式
getFileType(name: string): string {
let suffix
if (name.substring(name.length - 4).includes('png') || name.substring(name.length - 4).includes('jpg') || name.substring(name.length - 4).includes('jpeg') || name.substring(name.length - 4).includes('webp')) {
suffix = 'img'
} else if (name.substring(name.length - 4).includes('doc') || name.substring(name.length - 4).includes('docx')) {
suffix = 'word'
} else if (name.substring(name.length - 4).includes('pdf')) {
suffix = 'pdf'
}
return suffix
} }
//查看图片 //查看图片
viewImg(url) { viewImg(url) {
let dom = document.getElementById(`viewerjs`) let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes; let pObjs = dom.childNodes;
let node = document.createElement("img") let node = document.createElement("img");
node.style.display = "none"; node.style.display = "none";
node.src = url; node.src = url;
node.id = 'img' node.id = "img";
dom.appendChild(node) dom.appendChild(node);
setTimeout(() => { setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), { let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => { hidden: () => {
dom.removeChild(pObjs[0]); dom.removeChild(pObjs[0]);
viewer.destroy(); viewer.destroy();
} },
}); });
node.click(); node.click();
}, 0); }, 0);
@ -87,79 +85,115 @@ export class FileCategoryComponent implements OnInit {
//查看文件 //查看文件
lookFile(item) { lookFile(item) {
if (!item.imageUrl) { if (!item.imageUrl) {
return return;
} }
if (this.getFileType(item.imageUrl) == 'word') { if (this.pubilcMethods.getFileType(item.imageUrl) == "word") {
let arr = item.imageUrl.split('.') let arr = item.imageUrl.split(".");
arr[arr.length - 1] = 'pdf' arr[arr.length - 1] = "pdf";
window.open(arr.join('.')) window.open(arr.join("."));
} else if (this.getFileType(item.imageUrl) == 'pdf') { } else if (this.pubilcMethods.getFileType(item.imageUrl) == "pdf") {
window.open(item.imageUrl) window.open(item.imageUrl);
} else if (this.pubilcMethods.getFileType(item.imageUrl) == "img") {
this.viewImg(item.imageUrl);
} else if (this.pubilcMethods.getFileType(item.imageUrl) == "video") {
this.modalChild.create({
nzContent: VideoPlayComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth:
document.documentElement.clientHeight < 650 ||
document.documentElement.clientWidth < 1400
? 1000
: 1200,
nzClosable: false,
nzClassName: "modelnobg",
nzBodyStyle: {
"border-radius": "0px",
padding: "0px",
},
nzComponentParams: {
vedioUrl: item.imageUrl,
},
nzFooter: null,
});
} else { } else {
this.message.create('warning', '暂不支持查看!'); this.message.create("warning", "暂不支持查看!");
window.open(window.location.origin + item.imageUrl);
} }
} }
dispose() { dispose() {}
}
edit(item) { edit(item) {
if (item.auditStatus === 1) { if (item.auditStatus === 1) {
this.message.create('warning', '审核中不允许编辑!'); this.message.create("warning", "审核中不允许编辑!");
return return;
} }
const modal = this.modal.create({ const modal = this.modal.create({
nzContent: EditFileCategoryComponent, nzContent: EditFileCategoryComponent,
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzWidth: 750, nzWidth: 750,
nzBodyStyle: { nzBodyStyle: {
'border': '1px solid #91CCFF', border: "1px solid #91CCFF",
'border-radius': '0px', "border-radius": "0px",
'padding': '7px', padding: "7px",
'box-shadow': '0 0 8px 0 #fff', "box-shadow": "0 0 8px 0 #fff",
'background-image': 'linear-gradient(#003665, #000f25)' "background-image": "linear-gradient(#003665, #000f25)",
}, },
nzComponentParams: { nzComponentParams: {
data: item data: item,
}, },
nzFooter: null, nzFooter: null,
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {
if (instance.validatyType == '2' && !instance.data2.imageUrl) { if (instance.validatyType == "2" && !instance.data2.imageUrl) {
this.message.create('warning', '请上传附件!'); this.message.create("warning", "请上传附件!");
return false; return false;
} }
if (instance.validatyType != '2' && !instance.data2.remark) { if (instance.validatyType != "2" && !instance.data2.remark) {
this.message.create('warning', '请填写说明!'); this.message.create("warning", "请填写说明!");
return false; return false;
} }
instance.data2.validatyType = Number(instance.validatyType) instance.data2.validatyType = Number(instance.validatyType);
if (instance.data2.imageUrl && instance.data2.imageUrl.indexOf('http') == -1) { if (
let newUrl = window.location.protocol + '//' + window.location.host + instance.data2.imageUrl instance.data2.imageUrl &&
instance.data2.imageUrl = newUrl instance.data2.imageUrl.indexOf("http") == -1
) {
let newUrl =
window.location.protocol +
"//" +
window.location.host +
instance.data2.imageUrl;
instance.data2.imageUrl = newUrl;
} }
if (!instance.isSubmit) { if (!instance.isSubmit) {
this.http.post('/api/services/app/StationFileLicense/Create', instance.data2).subscribe((data: any) => { this.http
.post("/api/services/app/StationFileLicense/Create", instance.data2)
.subscribe((data: any) => {
this.getStationList(); this.getStationList();
this.message.create('success', '修改成功!'); this.message.create("success", "修改成功!");
}) });
return true; return true;
} else { } else {
await new Promise(resolve => { await new Promise((resolve) => {
this.http.post('/api/services/app/StationFileLicense/Create', instance.data2).subscribe((data: any) => { this.http
this.submitReview(data.result).then(res => { .post(
"/api/services/app/StationFileLicense/Create",
instance.data2
)
.subscribe((data: any) => {
this.submitReview(data.result).then((res) => {
resolve(data); resolve(data);
return true; return true;
}); });
}) });
}) });
}
} }
},
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => { }); modal.afterClose.subscribe((result) => {});
} }
details(item) { details(item) {
const modal = this.modal.create({ const modal = this.modal.create({
@ -167,48 +201,73 @@ export class FileCategoryComponent implements OnInit {
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzWidth: 450, nzWidth: 450,
nzBodyStyle: { nzBodyStyle: {
'border': '1px solid #91CCFF', border: "1px solid #91CCFF",
'border-radius': '0px', "border-radius": "0px",
'padding': '7px', padding: "7px",
'box-shadow': '0 0 8px 0 #fff', "box-shadow": "0 0 8px 0 #fff",
'background-image': 'linear-gradient(#003665, #000f25)' "background-image": "linear-gradient(#003665, #000f25)",
}, },
nzComponentParams: { nzComponentParams: {
data: item data: item,
}, },
nzFooter: null, nzFooter: null,
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {},
}
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => { }); modal.afterClose.subscribe((result) => {});
} }
//提交审核 //提交审核
submitReview(item) { submitReview(item) {
if (!item.id) { if (!item.id) {
this.message.create('warning', '该证照请编辑保存后再提交审核!'); this.message.create("warning", "该证照请编辑保存后再提交审核!");
return return;
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let params = { id: item.id } let params = { id: item.id };
this.http.post('/api/services/app/StationFileLicense/Commit', {}, { params }).subscribe(data => { this.http
this.message.create('success', '提交审核成功!'); .post("/api/services/app/StationFileLicense/Commit", {}, { params })
.subscribe((data) => {
this.message.create("success", "提交审核成功!");
this.getStationList(); this.getStationList();
resolve('success'); resolve("success");
}) });
}) });
} }
//撤销审核 //撤销审核
cancelReview(item) { cancelReview(item) {
let params = { id: item.id } let params = { id: item.id };
this.http.post('/api/services/app/StationFileLicense/Uncommit', {}, { params }).subscribe(data => { this.http
this.message.create('success', '撤销审核成功!'); .post("/api/services/app/StationFileLicense/Uncommit", {}, { params })
.subscribe((data) => {
this.message.create("success", "撤销审核成功!");
this.getStationList(); this.getStationList();
}) });
}
//获取文件格式
getFileType(name: string): string {
let type;
let suffix = name.substring(name.length - 4);
if (
suffix.includes("png") ||
suffix.includes("jpg") ||
suffix.includes("jpeg") ||
suffix.includes("webp")
) {
type = "img";
} else if (suffix.includes("doc") || suffix.includes("docx")) {
type = "word";
} else if (suffix.includes("pdf")) {
type = "pdf";
} else if (
suffix.includes("mp4") ||
suffix.includes("webm") ||
suffix.includes("ogg")
) {
type = "video";
}
return type;
} }
} }

177
src/app/pages/license/update-category/details-update-category/details-update-category.component.ts

@ -1,128 +1,175 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input, ViewContainerRef } from "@angular/core";
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef, NzModalService } from "ng-zorro-antd/modal";
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { HttpClient } from '@angular/common/http'; import { HttpClient } from "@angular/common/http";
import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service'; import { ObjectsSimpleService } from "src/app/service/objectsSimple.service";
import Viewer from 'viewerjs'; import Viewer from "viewerjs";
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from "ng-zorro-antd/message";
import { handleType, handleTypeList } from '../edit-update-category/edit-update-category.component'; import {
handleType,
handleTypeList,
} from "../edit-update-category/edit-update-category.component";
import { PublicMethodsService } from "src/app/service/publicMethods.service";
import { VideoPlayComponent } from "src/app/component/video-play/video-play.component";
@Component({ @Component({
selector: 'app-details-update-category', selector: "app-details-update-category",
templateUrl: './details-update-category.component.html', templateUrl: "./details-update-category.component.html",
styleUrls: ['./details-update-category.component.scss'] styleUrls: ["./details-update-category.component.scss"],
}) })
export class DetailsUpdateCategoryComponent implements OnInit { export class DetailsUpdateCategoryComponent implements OnInit {
@Input() data?: any; @Input() data?: any;
constructor(private modal: NzModalRef,private message: NzMessageService,private http: HttpClient) { } constructor(
private modal: NzModalRef,
private message: NzMessageService,
private http: HttpClient,
private pubilcMethods: PublicMethodsService,
private viewContainerRef: ViewContainerRef,
private modalChild: NzModalService
) {}
ngOnInit(): void { ngOnInit(): void {
this.getAuditLogging() this.getAuditLogging();
} }
auditList: any[] = []; auditList: any[] = [];
//获取审核记录 //获取审核记录
getAuditLogging() { getAuditLogging() {
if (!this.data.auditLogId) { if (!this.data.auditLogId) {
return return;
} }
let params = { id: this.data.auditLogId } let params = { id: this.data.auditLogId };
this.http.get(`/api/services/app/ContentAuditLog/Get`,{params}).subscribe((data: any)=>{ this.http
this.auditList = data.result.actionList || [] .get(`/api/services/app/ContentAuditLog/Get`, { params })
console.log(this.auditList) .subscribe((data: any) => {
}) this.auditList = data.result.actionList || [];
console.log(this.auditList);
});
} }
//获取审核次数 //获取审核次数
getVerifyNum(): number { getVerifyNum(): number {
let num = 0 let num = 0;
this.auditList.forEach(item=>{ this.auditList.forEach((item) => {
if (item.auditStatus == 2 || item.auditStatus == 3) { if (item.auditStatus == 2 || item.auditStatus == 3) {
num = num + 1 num = num + 1;
} }
}) });
return num return num;
} }
//获取驳回次数 //获取驳回次数
getRejectNum(): number { getRejectNum(): number {
let num = 0 let num = 0;
this.auditList.forEach(item=>{ this.auditList.forEach((item) => {
if (item.auditStatus == 3) { if (item.auditStatus == 3) {
num = num + 1 num = num + 1;
} }
}) });
return num return num;
} }
destroyModal() { destroyModal() {
this.modal.destroy({ data: 'this the result data' }); this.modal.destroy({ data: "this the result data" });
} }
//获取办理类型 //获取办理类型
getHandleTypes(handleTypes: any[]): string { getHandleTypes(handleTypes: any[]): string {
if (!handleTypes || !handleTypes.length) { if (!handleTypes || !handleTypes.length) {
return return;
} }
let names: string[] = [] let names: string[] = [];
let handleTypeList = JSON.parse(JSON.stringify(handleTypes)); let handleTypeList = JSON.parse(JSON.stringify(handleTypes));
let list: handleTypeList[] = new handleType().list; let list: handleTypeList[] = new handleType().list;
handleTypeList.forEach(item=>{ handleTypeList.forEach((item) => {
list.find(element=>{ list.find((element) => {
item == element.value? names.push(element.name) : null item == element.value ? names.push(element.name) : null;
}) });
}) });
return names.join(',') return names.join(",");
} }
//获取文件格式 //获取文件格式
getFileType(name: string): string { getFileType(name: string): string {
let suffix let type;
if (name.substring(name.length-4).includes('png') || name.substring(name.length-4).includes('jpg') || name.substring(name.length-4).includes('jpeg') || name.substring(name.length-4).includes('webp')) { let suffix = name.substring(name.length - 4);
suffix = 'img' if (
} else if (name.substring(name.length-4).includes('doc') || name.substring(name.length-4).includes('docx')) { suffix.includes("png") ||
suffix = 'word' suffix.includes("jpg") ||
} else if (name.substring(name.length-4).includes('pdf')) { suffix.includes("jpeg") ||
suffix = 'pdf' suffix.includes("webp")
} ) {
return suffix type = "img";
} else if (suffix.includes("doc") || suffix.includes("docx")) {
type = "word";
} else if (suffix.includes("pdf")) {
type = "pdf";
} else if (
suffix.includes("mp4") ||
suffix.includes("webm") ||
suffix.includes("ogg")
) {
type = "video";
}
return type;
} }
//查看文件 //查看文件
lookFile(item) { lookFile(item) {
if (!item) { if (!item) {
return return;
} }
if (this.getFileType(item) == 'word') { if (this.pubilcMethods.getFileType(item) == "word") {
let arr = item.split('.') let arr = item.split(".");
arr[arr.length - 1] = 'pdf' arr[arr.length - 1] = "pdf";
window.open(arr.join('.')) window.open(arr.join("."));
} else if (this.getFileType(item) == 'pdf') { } else if (this.pubilcMethods.getFileType(item) == "pdf") {
window.open(item) window.open(item);
} else if (this.pubilcMethods.getFileType(item) == "img") {
this.viewImg(item);
} else if (this.pubilcMethods.getFileType(item) == "video") {
this.modalChild.create({
nzContent: VideoPlayComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth:
document.documentElement.clientHeight < 650 ||
document.documentElement.clientWidth < 1400
? 1000
: 1200,
nzClosable: false,
nzClassName: "modelnobg",
nzBodyStyle: {
"border-radius": "0px",
padding: "0px",
},
nzComponentParams: {
vedioUrl: item,
},
nzFooter: null,
});
} else { } else {
this.message.create('warning', '暂不支持查看!'); this.message.create("warning", "暂不支持查看!");
window.open(window.location.origin + item);
} }
} }
//查看图片 //查看图片
viewImg(url) { viewImg(url) {
let dom = document.getElementById(`viewerjs`) let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes; let pObjs = dom.childNodes;
let node = document.createElement("img") let node = document.createElement("img");
node.style.display = "none"; node.style.display = "none";
node.src = url; node.src = url;
node.id = 'img' node.id = "img";
dom.appendChild(node) dom.appendChild(node);
setTimeout(() => { setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), { let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => { hidden: () => {
dom.removeChild(pObjs[0]); dom.removeChild(pObjs[0]);
viewer.destroy(); viewer.destroy();
} },
}); });
node.click(); node.click();
}, 0); }, 0);
} }
} }

272
src/app/pages/license/update-category/edit-update-category/edit-update-category.component.ts

@ -1,22 +1,30 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input, ViewContainerRef } from "@angular/core";
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef, NzModalService } from "ng-zorro-antd/modal";
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { HttpClient } from '@angular/common/http'; import { ObjectsSimpleService } from "src/app/service/objectsSimple.service";
import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service'; import Viewer from "viewerjs";
import Viewer from 'viewerjs'; import { NzMessageService } from "ng-zorro-antd/message";
import { NzMessageService } from 'ng-zorro-antd/message'; import { PublicMethodsService } from "src/app/service/publicMethods.service";
import { VideoPlayComponent } from "src/app/component/video-play/video-play.component";
@Component({ @Component({
selector: 'app-edit-update-category', selector: "app-edit-update-category",
templateUrl: './edit-update-category.component.html', templateUrl: "./edit-update-category.component.html",
styleUrls: ['./edit-update-category.component.scss'] styleUrls: ["./edit-update-category.component.scss"],
}) })
export class EditUpdateCategoryComponent implements OnInit { export class EditUpdateCategoryComponent implements OnInit {
@Input() data?: any; @Input() data?: any;
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private objectsSrv: ObjectsSimpleService, private message: NzMessageService,) { } constructor(
private modal: NzModalRef,
private fb: FormBuilder,
private objectsSrv: ObjectsSimpleService,
private message: NzMessageService,
private pubilcMethods: PublicMethodsService,
private viewContainerRef: ViewContainerRef,
private modalChild: NzModalService
) {}
handleTypeList: handleTypeList[] = new handleType().list; handleTypeList: handleTypeList[] = new handleType().list;
data2: any; //深拷贝data data2: any; //深拷贝data
@ -30,39 +38,45 @@ export class EditUpdateCategoryComponent implements OnInit {
isLongTermTime: [null], isLongTermTime: [null],
isNoLongTermTime: [null], isNoLongTermTime: [null],
radioTypeForm: [null], radioTypeForm: [null],
explain: [null] explain: [null],
}); });
// 日期 // 日期
this.data2 = JSON.parse(JSON.stringify(this.data)) this.data2 = JSON.parse(JSON.stringify(this.data));
if (this.data2.isLongTerm) { if (this.data2.isLongTerm) {
this.isLongTermTime = new Date(this.data2.validityStartTime) this.isLongTermTime = new Date(this.data2.validityStartTime);
if (this.isLongTermTime.getFullYear && this.isLongTermTime.getFullYear() < 1000) { if (
this.isLongTermTime = new Date() this.isLongTermTime.getFullYear &&
this.isLongTermTime.getFullYear() < 1000
) {
this.isLongTermTime = new Date();
} }
} else { } else {
this.isNoLongTermTime = [] this.isNoLongTermTime = [];
this.isNoLongTermTime.push(new Date(this.data2.validityStartTime)) this.isNoLongTermTime.push(new Date(this.data2.validityStartTime));
this.isNoLongTermTime.push(new Date(this.data2.validityEndTime)) this.isNoLongTermTime.push(new Date(this.data2.validityEndTime));
if (this.isNoLongTermTime.length && this.isNoLongTermTime.find(item => { return item.getFullYear() < 1000 })) { if (
this.isNoLongTermTime[0] = new Date() this.isNoLongTermTime.length &&
this.isNoLongTermTime[1] = new Date() this.isNoLongTermTime.find((item) => {
return item.getFullYear() < 1000;
})
) {
this.isNoLongTermTime[0] = new Date();
this.isNoLongTermTime[1] = new Date();
} }
} }
console.log(this.data2) console.log(this.data2);
console.log(typeof(this.data2.lastLicenseAuditType)) console.log(typeof this.data2.lastLicenseAuditType);
} }
radioChange($event) { radioChange($event) {
this.data2.LastLicenseAuditType = $event this.data2.LastLicenseAuditType = $event;
} }
imageUrl = "/api/Objects/sinochemweb/stationPhotos/175/timg.jpg";
imageUrl = '/api/Objects/sinochemweb/stationPhotos/175/timg.jpg'
destroyModal() { destroyModal() {
this.modal.destroy({ data: 'this the result data' }); this.modal.destroy({ data: "this the result data" });
} }
isSubmit: boolean = false; isSubmit: boolean = false;
@ -79,14 +93,16 @@ export class EditUpdateCategoryComponent implements OnInit {
//check change //check change
validityChange($event) { validityChange($event) {
if ($event) { //长期 if ($event) {
this.data2.validityDays = 999 //长期
} else { //限期 this.data2.validityDays = 999;
let start = (new Date(this.isNoLongTermTime[0])).getTime(); } else {
let end = (new Date(this.isNoLongTermTime[1])).getTime(); //限期
let time = end - start let start = new Date(this.isNoLongTermTime[0]).getTime();
let end = new Date(this.isNoLongTermTime[1]).getTime();
let time = end - start;
if (time <= 0) { if (time <= 0) {
this.data2.validityDays = 0 this.data2.validityDays = 0;
} else { } else {
this.data2.validityDays = Math.floor(time / (1000 * 3600 * 24)); this.data2.validityDays = Math.floor(time / (1000 * 3600 * 24));
} }
@ -96,110 +112,146 @@ export class EditUpdateCategoryComponent implements OnInit {
//date change //date change
onChange(e) { onChange(e) {
if (!e) { if (!e) {
return return;
} }
if (e instanceof Array) { if (e instanceof Array) {
let start = (new Date(e[0])).getTime(); let start = new Date(e[0]).getTime();
let end = (new Date(e[1])).getTime(); let end = new Date(e[1]).getTime();
let time = end - start let time = end - start;
if (time <= 0) { if (time <= 0) {
this.data2.validityDays = 0 this.data2.validityDays = 0;
} else { } else {
this.data2.validityDays = Math.floor(time / (1000 * 3600 * 24)); this.data2.validityDays = Math.floor(time / (1000 * 3600 * 24));
} }
} else { } else {
this.data2.validityDays = 999 this.data2.validityDays = 999;
} }
} }
//获取办理类型 //获取办理类型
getHandleTypes(handleTypes: any[]): string { getHandleTypes(handleTypes: any[]): string {
if (!handleTypes || !handleTypes.length) { if (!handleTypes || !handleTypes.length) {
return return;
} }
let names: string[] = [] let names: string[] = [];
let handleTypeList = JSON.parse(JSON.stringify(handleTypes)); let handleTypeList = JSON.parse(JSON.stringify(handleTypes));
let list: handleTypeList[] = new handleType().list; let list: handleTypeList[] = new handleType().list;
handleTypeList.forEach(item => { handleTypeList.forEach((item) => {
list.find(element => { list.find((element) => {
item == element.value ? names.push(element.name) : null item == element.value ? names.push(element.name) : null;
}) });
}) });
return names.join(',') return names.join(",");
} }
//获取文件格式 //获取文件格式
getFileType(name: string): string { getFileType(name: string): string {
let suffix let type;
if (name.substring(name.length - 4).includes('png') || name.substring(name.length - 4).includes('jpg') || name.substring(name.length - 4).includes('jpeg') || name.substring(name.length - 4).includes('webp')) { let suffix = name.substring(name.length - 4);
suffix = 'img' if (
} else if (name.substring(name.length - 4).includes('doc') || name.substring(name.length - 4).includes('docx')) { suffix.includes("png") ||
suffix = 'word' suffix.includes("jpg") ||
} else if (name.substring(name.length - 4).includes('pdf')) { suffix.includes("jpeg") ||
suffix = 'pdf' suffix.includes("webp")
} ) {
return suffix type = "img";
} else if (suffix.includes("doc") || suffix.includes("docx")) {
type = "word";
} else if (suffix.includes("pdf")) {
type = "pdf";
} else if (
suffix.includes("mp4") ||
suffix.includes("webm") ||
suffix.includes("ogg")
) {
type = "video";
}
return type;
} }
//查看文件 //查看文件
lookFile(item) { lookFile(item) {
if (!item) { if (!item) {
return return;
} }
if (this.getFileType(item) == 'word') { if (this.pubilcMethods.getFileType(item) == "word") {
let arr = item.split('.') let arr = item.split(".");
arr[arr.length - 1] = 'pdf' arr[arr.length - 1] = "pdf";
window.open(arr.join('.')) window.open(arr.join("."));
} else if (this.getFileType(item) == 'pdf') { } else if (this.pubilcMethods.getFileType(item) == "pdf") {
window.open(item) window.open(item);
} else if (this.pubilcMethods.getFileType(item) == "img") {
this.viewImg(item);
} else if (this.pubilcMethods.getFileType(item) == "video") {
this.modalChild.create({
nzContent: VideoPlayComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth:
document.documentElement.clientHeight < 650 ||
document.documentElement.clientWidth < 1400
? 1000
: 1200,
nzClosable: false,
nzClassName: "modelnobg",
nzBodyStyle: {
"border-radius": "0px",
padding: "0px",
},
nzComponentParams: {
vedioUrl: item,
},
nzFooter: null,
});
} else { } else {
this.message.create('warning', '暂不支持查看!'); this.message.create("warning", "暂不支持查看!");
window.open(window.location.origin + item);
} }
} }
uploadType: number; //是否是上传副本 uploadType: number; //是否是上传副本
isLoadingSave: boolean = false isLoadingSave: boolean = false;
uploadIndex: string uploadIndex: string;
filechange(e, type: number) { filechange(e, type: number) {
this.uploadType = type this.uploadType = type;
this.isLoadingSave = true this.isLoadingSave = true;
let oilStationId = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id let oilStationId = JSON.parse(
let file = e.target.files[0] || null //获取上传的文件 sessionStorage.getItem("userdataOfgasstation")
this.openFileSelect(file, `stationPhotos/${oilStationId}/`) ).organization.id;
let file = e.target.files[0] || null; //获取上传的文件
this.openFileSelect(file, `stationPhotos/${oilStationId}/`);
} }
//设置文件路径并上传 //设置文件路径并上传
postFilePath postFilePath;
async openFileSelect(file: File, extensionPath: string) { async openFileSelect(file: File, extensionPath: string) {
this.postFilePath = extensionPath; this.postFilePath = extensionPath;
let fileSize = file.size || null //上传文件的总大小 let fileSize = file.size || null; //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB 超过5MB要分块上传 let shardSize = 5 * 1024 * 1024; //5MB 超过5MB要分块上传
if (fileSize >= shardSize) // 超过5MB要分块上传 if (fileSize >= shardSize) {
{ // 超过5MB要分块上传
await this.postFileByMul(file); await this.postFileByMul(file);
} } //普通上传
else //普通上传 else {
{
await this.postFile(file); await this.postFile(file);
} }
} }
//上传文件 //上传文件
async postFile(file: File) { async postFile(file: File) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
this.objectsSrv.postFile(this.postFilePath, file).subscribe(data => { this.objectsSrv.postFile(this.postFilePath, file).subscribe((data) => {
let dataObj = data as any; let dataObj = data as any;
let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName; let filePath: string =
ObjectsSimpleService.baseUrl + dataObj.objectName;
if (this.uploadType === 0) { if (this.uploadType === 0) {
this.data2.imageUrl = filePath this.data2.imageUrl = filePath;
} else if (this.uploadType === 1) { } else if (this.uploadType === 1) {
this.data2.attachment = filePath this.data2.attachment = filePath;
} else if (this.uploadType === 2) { } else if (this.uploadType === 2) {
this.data2.yearlyCheckAttachment = filePath this.data2.yearlyCheckAttachment = filePath;
} }
this.isLoadingSave = false this.isLoadingSave = false;
resolve('success') resolve("success");
});
}); });
})
} }
/** /**
@ -207,41 +259,41 @@ export class EditUpdateCategoryComponent implements OnInit {
* @param file * @param file
*/ */
postFileByMul(file: File) { postFileByMul(file: File) {
this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => { this.objectsSrv
.postFile_MultipartUpload(this.postFilePath, file)
.then((value) => {
let dataObj = value as any; let dataObj = value as any;
let filePath = dataObj.filePath let filePath = dataObj.filePath;
if (this.uploadType === 0) { if (this.uploadType === 0) {
this.data2.imageUrl = filePath this.data2.imageUrl = filePath;
} else if (this.uploadType === 1) { } else if (this.uploadType === 1) {
this.data2.attachment = filePath this.data2.attachment = filePath;
} else if (this.uploadType === 2) { } else if (this.uploadType === 2) {
this.data2.yearlyCheckAttachment = filePath this.data2.yearlyCheckAttachment = filePath;
} }
this.isLoadingSave = false this.isLoadingSave = false;
}); });
} }
//查看图片 //查看图片
viewImg(url) { viewImg(url) {
let dom = document.getElementById(`viewerjs`) let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes; let pObjs = dom.childNodes;
let node = document.createElement("img") let node = document.createElement("img");
node.style.display = "none"; node.style.display = "none";
node.src = url; node.src = url;
node.id = 'img' node.id = "img";
dom.appendChild(node) dom.appendChild(node);
setTimeout(() => { setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), { let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => { hidden: () => {
dom.removeChild(pObjs[0]); dom.removeChild(pObjs[0]);
viewer.destroy(); viewer.destroy();
} },
}); });
node.click(); node.click();
}, 0); }, 0);
} }
} }
//办理类型 //办理类型
@ -257,9 +309,9 @@ export class handleType {
{ value: 7, name: "年度检测" }, { value: 7, name: "年度检测" },
{ value: 8, name: "到期备案" }, { value: 8, name: "到期备案" },
{ value: 9, name: "到期评价" }, { value: 9, name: "到期评价" },
] ];
} }
export class handleTypeList { export class handleTypeList {
value: number value: number;
name: string name: string;
} }

330
src/app/pages/license/update-category/update-category.component.ts

@ -1,97 +1,126 @@
import { Component, OnInit, ViewContainerRef } from '@angular/core'; import { Component, OnInit, ViewContainerRef } from "@angular/core";
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from "ng-zorro-antd/modal";
import { Observable, fromEvent } from 'rxjs'; import { fromEvent } from "rxjs";
import { debounceTime } from 'rxjs/operators'; import { debounceTime } from "rxjs/operators";
import Viewer from 'viewerjs'; import Viewer from "viewerjs";
import { EditUpdateCategoryComponent, handleType, handleTypeList } from './edit-update-category/edit-update-category.component'; import {
import * as moment from 'moment'; EditUpdateCategoryComponent,
import { NzMessageService } from 'ng-zorro-antd/message'; handleType,
import { HttpClient } from '@angular/common/http'; handleTypeList,
import { DetailsUpdateCategoryComponent } from './details-update-category/details-update-category.component'; } from "./edit-update-category/edit-update-category.component";
import { PdfWordLookComponent } from '../pdf-word-look/pdf-word-look.component'; import { NzMessageService } from "ng-zorro-antd/message";
import { HttpClient } from "@angular/common/http";
import { DetailsUpdateCategoryComponent } from "./details-update-category/details-update-category.component";
import { PublicMethodsService } from "src/app/service/publicMethods.service";
import { VideoPlayComponent } from "src/app/component/video-play/video-play.component";
@Component({ @Component({
selector: 'app-update-category', selector: "app-update-category",
templateUrl: './update-category.component.html', templateUrl: "./update-category.component.html",
styleUrls: ['./update-category.component.scss'] styleUrls: ["./update-category.component.scss"],
}) })
export class UpdateCategoryComponent implements OnInit { export class UpdateCategoryComponent implements OnInit {
constructor(
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private message: NzMessageService,
private http: HttpClient,
private pubilcMethods: PublicMethodsService
) {}
tableSpin = false;
list = [];
constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient) { } tableScrollHeight;
tableSpin = false resizeListener;
list = []
tableScrollHeight
resizeListener
ngOnInit(): void { ngOnInit(): void {
setTimeout(() => { setTimeout(() => {
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px' this.tableScrollHeight =
document.getElementById("tablebox").clientHeight - 42 + "px";
}, 0); }, 0);
// 页面监听 // 页面监听
this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => { this.resizeListener = fromEvent(window, "resize")
this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px' .pipe(debounceTime(100))
.subscribe((event) => {
this.tableScrollHeight =
document.getElementById("tablebox").clientHeight - 42 + "px";
}); });
this.getStationList() this.getStationList();
} }
ngOnDestroy(): void { ngOnDestroy(): void {
this.resizeListener.unsubscribe() this.resizeListener.unsubscribe();
} }
//获取当前油站档案类证照 //获取当前油站档案类证照
getStationList() { getStationList() {
this.tableSpin = true this.tableSpin = true;
let data = JSON.parse(sessionStorage.getItem('userdataOfgasstation')); let data = JSON.parse(sessionStorage.getItem("userdataOfgasstation"));
let params = { orgId: data.organization.id || "" } let params = { orgId: data.organization.id || "" };
this.http.get(`/api/services/app/StationValidityLicense/GetCurStationLicense`, { params }).subscribe((info: any) => { this.http
this.list = info.result .get(`/api/services/app/StationValidityLicense/GetCurStationLicense`, {
this.tableSpin = false params,
console.log(info.result)
}) })
.subscribe((info: any) => {
this.list = info.result;
this.tableSpin = false;
console.log(info.result);
});
} }
//获取办理类型 //获取办理类型
getHandleTypes(handleTypes: any[]): string { getHandleTypes(handleTypes: any[]): string {
if (!handleTypes || !handleTypes.length) { if (!handleTypes || !handleTypes.length) {
return return;
} }
let names: string[] = [] let names: string[] = [];
let handleTypeList = JSON.parse(JSON.stringify(handleTypes)); let handleTypeList = JSON.parse(JSON.stringify(handleTypes));
let list: handleTypeList[] = new handleType().list; let list: handleTypeList[] = new handleType().list;
handleTypeList.forEach(item => { handleTypeList.forEach((item) => {
list.find(element => { list.find((element) => {
item == element.value ? names.push(element.name) : null item == element.value ? names.push(element.name) : null;
}) });
}) });
return names.join(',') return names.join(",");
} }
//获取文件格式 //获取文件格式
getFileType(name: string): string { getFileType(name: string): string {
let suffix let type;
if (name.substring(name.length - 4).includes('png') || name.substring(name.length - 4).includes('jpg') || name.substring(name.length - 4).includes('jpeg') || name.substring(name.length - 4).includes('webp')) { let suffix = name.substring(name.length - 4);
suffix = 'img' if (
} else if (name.substring(name.length - 4).includes('doc') || name.substring(name.length - 4).includes('docx')) { suffix.includes("png") ||
suffix = 'word' suffix.includes("jpg") ||
} else if (name.substring(name.length - 4).includes('pdf')) { suffix.includes("jpeg") ||
suffix = 'pdf' suffix.includes("webp")
} ) {
return suffix type = "img";
} else if (suffix.includes("doc") || suffix.includes("docx")) {
type = "word";
} else if (suffix.includes("pdf")) {
type = "pdf";
} else if (
suffix.includes("mp4") ||
suffix.includes("webm") ||
suffix.includes("ogg")
) {
type = "video";
}
return type;
} }
//查看图片 //查看图片
viewImg(url) { viewImg(url) {
let dom = document.getElementById(`viewerjs`) let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes; let pObjs = dom.childNodes;
let node = document.createElement("img") let node = document.createElement("img");
node.style.display = "none"; node.style.display = "none";
node.src = url; node.src = url;
node.id = 'img' node.id = "img";
dom.appendChild(node) dom.appendChild(node);
setTimeout(() => { setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), { let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => { hidden: () => {
dom.removeChild(pObjs[0]); dom.removeChild(pObjs[0]);
viewer.destroy(); viewer.destroy();
} },
}); });
node.click(); node.click();
}, 0); }, 0);
@ -100,108 +129,150 @@ export class UpdateCategoryComponent implements OnInit {
//查看文件 //查看文件
lookFile(item) { lookFile(item) {
if (!item) { if (!item) {
return return;
} }
if (this.getFileType(item) == 'word') { if (this.pubilcMethods.getFileType(item) == "word") {
let arr = item.split('.') let arr = item.split(".");
arr[arr.length - 1] = 'pdf' arr[arr.length - 1] = "pdf";
window.open(arr.join('.')) window.open(arr.join("."));
} else if (this.getFileType(item) == 'pdf') { } else if (this.pubilcMethods.getFileType(item) == "pdf") {
window.open(item) window.open(item);
} else if (this.pubilcMethods.getFileType(item) == "img") {
this.viewImg(item);
} else if (this.pubilcMethods.getFileType(item) == "video") {
this.modal.create({
nzContent: VideoPlayComponent,
nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef,
nzWidth:
document.documentElement.clientHeight < 650 ||
document.documentElement.clientWidth < 1400
? 1000
: 1200,
nzClosable: false,
nzClassName: "modelnobg",
nzBodyStyle: {
"border-radius": "0px",
padding: "0px",
},
nzComponentParams: {
vedioUrl: item,
},
nzFooter: null,
});
} else { } else {
this.message.create('warning', '暂不支持查看!'); this.message.create("warning", "暂不支持查看!");
window.open(window.location.origin + item);
} }
} }
dispose() { dispose() {}
}
edit(item) { edit(item) {
console.log(item) console.log(item);
if (item.auditStatus === 1) { if (item.auditStatus === 1) {
this.message.create('warning', '审核中不允许编辑!'); this.message.create("warning", "审核中不允许编辑!");
return return;
} }
const modal = this.modal.create({ const modal = this.modal.create({
nzContent: EditUpdateCategoryComponent, nzContent: EditUpdateCategoryComponent,
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzWidth: 750, nzWidth: 750,
nzBodyStyle: { nzBodyStyle: {
'border': '1px solid #91CCFF', border: "1px solid #91CCFF",
'border-radius': '0px', "border-radius": "0px",
'padding': '7px', padding: "7px",
'box-shadow': '0 0 8px 0 #fff', "box-shadow": "0 0 8px 0 #fff",
'background-image': 'linear-gradient(#003665, #000f25)' "background-image": "linear-gradient(#003665, #000f25)",
}, },
nzComponentParams: { nzComponentParams: {
data: item data: item,
}, },
nzFooter: null, nzFooter: null,
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {
if (!instance.data2.imageUrl) { if (!instance.data2.imageUrl) {
this.message.create('warning', '请上传附件!'); this.message.create("warning", "请上传附件!");
return false; return false;
} }
if (instance.data2.hasAttachmentDefault && !instance.data2.attachment) { if (instance.data2.hasAttachmentDefault && !instance.data2.attachment) {
this.message.create('warning', '请上传附件副本!'); this.message.create("warning", "请上传附件副本!");
return false; return false;
} }
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
let body = instance.data2 let body = instance.data2;
if (body.isLongTerm) { if (body.isLongTerm) {
body.validityStartTime = instance.isLongTermTime || new Date() body.validityStartTime = instance.isLongTermTime || new Date();
body.validityEndTime = '9999-01-01' body.validityEndTime = "9999-01-01";
} else { } else {
body.validityStartTime = instance.isNoLongTermTime[0] || new Date() body.validityStartTime = instance.isNoLongTermTime[0] || new Date();
body.validityEndTime = instance.isNoLongTermTime[1] || new Date() body.validityEndTime = instance.isNoLongTermTime[1] || new Date();
} }
if (body.imageUrl.indexOf('http') == -1) { if (body.imageUrl.indexOf("http") == -1) {
let newUrl = window.location.protocol + '//' + window.location.host + body.imageUrl let newUrl =
body.imageUrl = newUrl window.location.protocol +
} "//" +
if (body.hasAttachmentDefault && body.attachment && body.attachment.indexOf('http') == -1) { window.location.host +
let newUrl = window.location.protocol + '//' + window.location.host + body.attachment body.imageUrl;
body.attachment = newUrl body.imageUrl = newUrl;
}
if (
body.hasAttachmentDefault &&
body.attachment &&
body.attachment.indexOf("http") == -1
) {
let newUrl =
window.location.protocol +
"//" +
window.location.host +
body.attachment;
body.attachment = newUrl;
} }
if (body.isYearlyCheck && !body.yearlyCheckDescription && body.lastLicenseAuditType == 1) { if (
this.message.create('warning', '请填写年检更新说明!'); body.isYearlyCheck &&
return false !body.yearlyCheckDescription &&
body.lastLicenseAuditType == 1
) {
this.message.create("warning", "请填写年检更新说明!");
return false;
} }
if (body.lastLicenseAuditType == 0) { if (body.lastLicenseAuditType == 0) {
body.yearlyCheckAttachment = null body.yearlyCheckAttachment = null;
body.yearlyCheckDescription = null body.yearlyCheckDescription = null;
} }
if (!instance.isSubmit) { if (!instance.isSubmit) {
this.http.post('/api/services/app/StationValidityLicense/Create', body).subscribe((data: any) => { this.http
.post("/api/services/app/StationValidityLicense/Create", body)
.subscribe((data: any) => {
this.getStationList(); this.getStationList();
this.message.create('success', '修改成功!'); this.message.create("success", "修改成功!");
}) });
return false; return false;
} else { } else {
await new Promise(resolve => { await new Promise((resolve) => {
this.http.post('/api/services/app/StationValidityLicense/Create', body).subscribe((data: any) => { this.http
this.submitReview(data.result).then(res => { .post("/api/services/app/StationValidityLicense/Create", body)
.subscribe((data: any) => {
this.submitReview(data.result).then((res) => {
resolve(data); resolve(data);
return true; return true;
}); });
}) });
}) });
} }
// return false; // return false;
} else { } else {
this.message.create('warning', '请填写完整!'); this.message.create("warning", "请填写完整!");
return false; return false;
} }
} },
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => { }); modal.afterClose.subscribe((result) => {});
} }
details(item) { details(item) {
@ -210,51 +281,52 @@ export class UpdateCategoryComponent implements OnInit {
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzWidth: 450, nzWidth: 450,
nzBodyStyle: { nzBodyStyle: {
'border': '1px solid #91CCFF', border: "1px solid #91CCFF",
'border-radius': '0px', "border-radius": "0px",
'padding': '7px', padding: "7px",
'box-shadow': '0 0 8px 0 #fff', "box-shadow": "0 0 8px 0 #fff",
'background-image': 'linear-gradient(#003665, #000f25)' "background-image": "linear-gradient(#003665, #000f25)",
}, },
nzComponentParams: { nzComponentParams: {
data: item data: item,
}, },
nzFooter: null, nzFooter: null,
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {},
}
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => { }); modal.afterClose.subscribe((result) => {});
} }
//提交审核 //提交审核
submitReview(item) { submitReview(item) {
if (!item.id) { if (!item.id) {
this.message.create('warning', '该证照请编辑保存后再提交审核!'); this.message.create("warning", "该证照请编辑保存后再提交审核!");
return return;
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let params: any = { let params: any = {
id: item.id, id: item.id,
type: item.lastLicenseAuditType type: item.lastLicenseAuditType,
} };
this.http.post('/api/services/app/StationValidityLicense/Commit', {}, { params }).subscribe(data => { this.http
this.message.create('success', '提交审核成功!'); .post("/api/services/app/StationValidityLicense/Commit", {}, { params })
.subscribe((data) => {
this.message.create("success", "提交审核成功!");
this.getStationList(); this.getStationList();
resolve('success'); resolve("success");
}) });
}) });
} }
//撤销审核 //撤销审核
cancelReview(item) { cancelReview(item) {
let params = { id: item.id } let params = { id: item.id };
this.http.post('/api/services/app/StationValidityLicense/Uncommit', {}, { params }).subscribe(data => { this.http
this.message.create('success', '撤销审核成功!'); .post("/api/services/app/StationValidityLicense/Uncommit", {}, { params })
.subscribe((data) => {
this.message.create("success", "撤销审核成功!");
this.getStationList(); this.getStationList();
}) });
} }
} }

6
src/app/pages/login/forget/forget.component.ts

@ -92,7 +92,7 @@ export class ForgetComponent implements OnInit {
if (this.validateForm3.valid) { if (this.validateForm3.valid) {
let word = JSON.parse(JSON.stringify(this.validateForm3.value.newpassword)).toLowerCase() let word = JSON.parse(JSON.stringify(this.validateForm3.value.newpassword)).toLowerCase()
if (this.validateForm3.value.newpassword != this.validateForm3.value.affirmpassword) { if (this.validateForm3.value.newpassword != this.validateForm3.value.affirmpassword) {
this.message.create('warning', '两次密码输入不一致'); this.message.create('warning', '两次密码输入不一致!');
return false return false
} if (word.indexOf('sino') != -1 || word.indexOf('zhonghua') != -1) { } if (word.indexOf('sino') != -1 || word.indexOf('zhonghua') != -1) {
this.message.create('warning', '口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符'); this.message.create('warning', '口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符');
@ -105,7 +105,7 @@ export class ForgetComponent implements OnInit {
newPassword: this.validateForm3.value.newpassword, newPassword: this.validateForm3.value.newpassword,
} }
this.http.post('/api/services/app/User/ChangePasswordBySms', body).subscribe(data => { this.http.post('/api/services/app/User/ChangePasswordBySms', body).subscribe(data => {
this.message.create('success', '修改成功'); this.message.create('success', '修改成功!');
this.modal.close() this.modal.close()
return true return true
}, err => { }, err => {
@ -115,7 +115,7 @@ export class ForgetComponent implements OnInit {
} }
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }

18
src/app/pages/oil-station-info/oil-station-info.component.ts

@ -116,9 +116,9 @@ export class OilStationInfoComponent implements OnInit {
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
this.message.create('success', '导出成功'); this.message.create('success', '导出成功!');
}, err => { }, err => {
this.message.create('error', '导出失败'); this.message.create('error', '导出失败!');
}) })
} }
@ -311,15 +311,15 @@ export class OilStationInfoComponent implements OnInit {
this.http.put('/api/services/app/GasStation/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/GasStation/Update', body).subscribe((data: any) => {
resolve(data) resolve(data)
this.isLoadingSave = false this.isLoadingSave = false
this.message.create('success', '保存成功'); this.message.create('success', '保存成功!');
}, err => { }, err => {
reject(err) reject(err)
this.isLoadingSave = false this.isLoadingSave = false
this.message.create('error', '保存失败'); this.message.create('error', '保存失败!');
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -337,10 +337,10 @@ export class OilStationInfoComponent implements OnInit {
this.http.post('/api/services/app/GasStation/Commit', null, { params: params }).subscribe((data: any) => { this.http.post('/api/services/app/GasStation/Commit', null, { params: params }).subscribe((data: any) => {
this.isSubmitAuditLoading = false this.isSubmitAuditLoading = false
this.getInfo() this.getInfo()
this.message.create('success', '提交审核成功'); this.message.create('success', '提交审核成功!');
}, err => { }, err => {
this.isSubmitAuditLoading = false this.isSubmitAuditLoading = false
this.message.create('error', '提交审核失败'); this.message.create('error', '提交审核失败!');
}) })
} }
@ -354,10 +354,10 @@ export class OilStationInfoComponent implements OnInit {
this.http.post('/api/services/app/GasStation/Uncommit', null, { params: params }).subscribe((data: any) => { this.http.post('/api/services/app/GasStation/Uncommit', null, { params: params }).subscribe((data: any) => {
this.isRevocationAuditLoading = false this.isRevocationAuditLoading = false
this.getInfo() this.getInfo()
this.message.create('success', '撤销审核成功'); this.message.create('success', '撤销审核成功!');
}, err => { }, err => {
this.isRevocationAuditLoading = false this.isRevocationAuditLoading = false
this.message.create('error', '撤销审核失败'); this.message.create('error', '撤销审核失败!');
}) })
} }
} }

4
src/app/pages/plan/plan.component.ts

@ -350,7 +350,7 @@ export class PlanComponent implements OnInit {
//创建/编辑建筑 //创建/编辑建筑
addModelBuilding() { addModelBuilding() {
if (!this.validateForm.valid) { if (!this.validateForm.valid) {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return return
} }
let e: modelBuilding = this.validateForm.value let e: modelBuilding = this.validateForm.value
@ -814,7 +814,7 @@ export class PlanComponent implements OnInit {
submitTaskForm() { submitTaskForm() {
if (!this.validateForm2.valid) { if (!this.validateForm2.valid) {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return return
} }
let e = this.validateForm2.value let e = this.validateForm2.value

14
src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts

@ -742,11 +742,11 @@ export class CriminalRecordsAdminComponent implements OnInit {
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = { let body = {
id: item.id, id: item.id,
handleRecord: '报废成功' handleRecord: '报废成功!'
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '报废成功'); this.message.create('success', '报废成功!');
item.handleTime = new Date() item.handleTime = new Date()
return true return true
}) })
@ -769,18 +769,18 @@ export class CriminalRecordsAdminComponent implements OnInit {
// item.violatedItemSnapshotObj = data.result // item.violatedItemSnapshotObj = data.result
let body = { let body = {
id: item.id, id: item.id,
handleRecord: '维保成功' handleRecord: '维保成功!'
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '维保成功'); this.message.create('success', '维保成功!');
item.handleTime = new Date() item.handleTime = new Date()
return true return true
}) })
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -884,13 +884,13 @@ export class CriminalRecordsAdminComponent implements OnInit {
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '处置成功'); this.message.create('success', '处置成功!');
item.handleTime = new Date() item.handleTime = new Date()
return true return true
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
}, },

14
src/app/pages/records/criminal-records/criminal-records.component.ts

@ -708,11 +708,11 @@ export class CriminalRecordsComponent implements OnInit {
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = { let body = {
id: item.id, id: item.id,
handleRecord: '报废成功' handleRecord: '报废成功!'
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '报废成功'); this.message.create('success', '报废成功!');
item.handleTime = new Date() item.handleTime = new Date()
return true return true
}) })
@ -734,18 +734,18 @@ export class CriminalRecordsComponent implements OnInit {
// item.violatedItemSnapshotObj = data.result // item.violatedItemSnapshotObj = data.result
let body = { let body = {
id: item.id, id: item.id,
handleRecord: '维保成功' handleRecord: '维保成功!'
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '维保成功'); this.message.create('success', '维保成功!');
item.handleTime = new Date() item.handleTime = new Date()
return true return true
}) })
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -820,13 +820,13 @@ export class CriminalRecordsComponent implements OnInit {
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '处置成功'); this.message.create('success', '处置成功!');
item.handleTime = new Date() item.handleTime = new Date()
return true return true
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
}, },

10
src/app/pages/records/warning-statistics-list/warning-statistics-list.component.ts

@ -682,11 +682,11 @@ export class WarningStatisticsListComponent implements OnInit {
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = { let body = {
id: item.id, id: item.id,
handleRecord: '报废成功' handleRecord: '报废成功!'
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '报废成功'); this.message.create('success', '报废成功!');
item.handleTime = new Date() item.handleTime = new Date()
return true return true
}) })
@ -708,18 +708,18 @@ export class WarningStatisticsListComponent implements OnInit {
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = { let body = {
id: item.id, id: item.id,
handleRecord: '维保成功' handleRecord: '维保成功!'
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '维保成功'); this.message.create('success', '维保成功!');
item.handleTime = new Date() item.handleTime = new Date()
return true return true
}) })
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }

14
src/app/pages/today-warning-admin/today-warning-admin.component.ts

@ -296,11 +296,11 @@ export class TodayWarningAdminComponent implements OnInit {
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => {
let body = { let body = {
id: item.id, id: item.id,
handleRecord: '报废成功' handleRecord: '报废成功!'
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '报废成功'); this.message.create('success', '报废成功!');
item.handleTime = new Date() item.handleTime = new Date()
return true return true
}) })
@ -323,18 +323,18 @@ export class TodayWarningAdminComponent implements OnInit {
// item.violatedItemSnapshotObj = data.result // item.violatedItemSnapshotObj = data.result
let body = { let body = {
id: item.id, id: item.id,
handleRecord: '维保成功' handleRecord: '维保成功!'
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '维保成功'); this.message.create('success', '维保成功!');
item.handleTime = new Date() item.handleTime = new Date()
return true return true
}) })
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -401,13 +401,13 @@ export class TodayWarningAdminComponent implements OnInit {
} }
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '处置成功'); this.message.create('success', '处置成功!');
item.handleTime = new Date() item.handleTime = new Date()
return true return true
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
}, },

1
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss

@ -61,6 +61,7 @@
right: 18px; right: 18px;
top: 18px; top: 18px;
cursor: pointer; cursor: pointer;
i { i {
font-size: 18px; font-size: 18px;
} }

45
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

@ -6,6 +6,7 @@ import { NzMessageService } from "ng-zorro-antd/message";
import { NzModalRef, NzModalService } from "ng-zorro-antd/modal"; import { NzModalRef, NzModalService } from "ng-zorro-antd/modal";
import { NzTreeModule } from "ng-zorro-antd/tree"; import { NzTreeModule } from "ng-zorro-antd/tree";
import { ObjectsSimpleService } from "src/app/service/objectsSimple.service"; import { ObjectsSimpleService } from "src/app/service/objectsSimple.service";
import { PublicMethodsService } from "src/app/service/publicMethods.service";
import Viewer from "viewerjs"; import Viewer from "viewerjs";
@Component({ @Component({
@ -24,7 +25,8 @@ export class GetOutOfLineDetailsComponent implements OnInit {
private modal: NzModalService, private modal: NzModalService,
private initialModal: NzModalRef, private initialModal: NzModalRef,
private sanitizer: DomSanitizer, private sanitizer: DomSanitizer,
private openmodal: NzModalRef private openmodal: NzModalRef,
private pubilcMethods: PublicMethodsService
) {} ) {}
imgUrl: string; imgUrl: string;
@ -55,17 +57,17 @@ export class GetOutOfLineDetailsComponent implements OnInit {
this.imgUrl = this.data.violateImage; this.imgUrl = this.data.violateImage;
if (this.imgUrl) { if (this.imgUrl) {
if (this.getFileType(this.imgUrl) == "img") { if (this.pubilcMethods.getFileType(this.imgUrl) == "img") {
this.isImage = true; this.isImage = true;
} else { } else {
this.isImage = false; this.isImage = false;
if (this.getFileType(this.imgUrl) == "word") { if (this.pubilcMethods.getFileType(this.imgUrl) == "word") {
let arr = this.imgUrl.split("."); let arr = this.imgUrl.split(".");
arr[arr.length - 1] = "pdf"; arr[arr.length - 1] = "pdf";
this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl( this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(
arr.join(".") arr.join(".")
); );
} else if (this.getFileType(this.imgUrl) == "pdf") { } else if (this.pubilcMethods.getFileType(this.imgUrl) == "pdf") {
this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl( this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(
this.imgUrl this.imgUrl
); );
@ -163,11 +165,11 @@ export class GetOutOfLineDetailsComponent implements OnInit {
if (!item) { if (!item) {
return; return;
} }
if (this.getFileType(item) == "word") { if (this.pubilcMethods.getFileType(item) == "word") {
let arr = item.split("."); let arr = item.split(".");
arr[arr.length - 1] = "pdf"; arr[arr.length - 1] = "pdf";
window.open(arr.join(".")); window.open(arr.join("."));
} else if (this.getFileType(item) == "pdf") { } else if (this.pubilcMethods.getFileType(item) == "pdf") {
window.open(item); window.open(item);
} else { } else {
this.viewImg(item); this.viewImg(item);
@ -206,27 +208,6 @@ export class GetOutOfLineDetailsComponent implements OnInit {
}, 0); }, 0);
} }
//获取文件格式
getFileType(name: string): string {
let suffix;
if (
name.substring(name.length - 4).includes("png") ||
name.substring(name.length - 4).includes("jpg") ||
name.substring(name.length - 4).includes("jpeg") ||
name.substring(name.length - 4).includes("webp")
) {
suffix = "img";
} else if (
name.substring(name.length - 4).includes("doc") ||
name.substring(name.length - 4).includes("docx")
) {
suffix = "word";
} else if (name.substring(name.length - 4).includes("pdf")) {
suffix = "pdf";
}
return suffix;
}
selectedType: string = "img"; selectedType: string = "img";
contentType(type) { contentType(type) {
this.selectedType = type; this.selectedType = type;
@ -239,7 +220,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
this.http this.http
.post("/api/services/app/ViolateRecord/HandleViolateRecord", body) .post("/api/services/app/ViolateRecord/HandleViolateRecord", body)
.subscribe((data) => { .subscribe((data) => {
this.message.create("success", "处置成功"); this.message.create("success", "处置成功!");
this.data.handleTime = new Date(); this.data.handleTime = new Date();
this.data.handleStateStr = "已处置"; this.data.handleStateStr = "已处置";
this.data.handleRecord = this.content; this.data.handleRecord = this.content;
@ -261,12 +242,12 @@ export class GetOutOfLineDetailsComponent implements OnInit {
.post("/api/services/app/ViolateRecord/CensorViolateRecord", body) .post("/api/services/app/ViolateRecord/CensorViolateRecord", body)
.subscribe( .subscribe(
(data) => { (data) => {
this.message.create("success", "处置成功"); this.message.create("success", "处置成功!");
// this.data.handleTime = new Date() // this.data.handleTime = new Date()
this.initialModal.triggerOk(); this.initialModal.triggerOk();
}, },
(err) => { (err) => {
this.message.create("warning", "处置失败,请联系管理员"); this.message.create("warning", "处置失败,请联系管理员!");
} }
); );
}, },
@ -300,7 +281,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
this.data.appealLog = data.result.appealLog; this.data.appealLog = data.result.appealLog;
}, },
(err) => { (err) => {
this.message.create("warning", "申诉提交失败,请联系管理员"); this.message.create("warning", "申诉提交失败,请联系管理员!");
} }
); );
} }
@ -322,7 +303,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
this.data.appealStatus = 4; this.data.appealStatus = 4;
}, },
(err) => { (err) => {
this.message.create("warning", "申诉撤销失败,请联系管理员"); this.message.create("warning", "申诉撤销失败,请联系管理员!");
} }
); );
} }

451
src/app/pages/today-warning/today-warning.component.ts

@ -1,26 +1,35 @@
import { Component, OnInit, ViewContainerRef } from '@angular/core'; import { Component, OnInit, ViewContainerRef } from "@angular/core";
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { HttpClient } from '@angular/common/http'; import { HttpClient } from "@angular/common/http";
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from "ng-zorro-antd/modal";
import { GetOutOfLineDetailsComponent } from './get-out-of-line-details/get-out-of-line-details.component'; import { GetOutOfLineDetailsComponent } from "./get-out-of-line-details/get-out-of-line-details.component";
// import { TreeService } from 'src/app/service/tree.service'; // import { TreeService } from 'src/app/service/tree.service';
// import { NavChangeService } from 'src/app/service/navChange.service'; // import { NavChangeService } from 'src/app/service/navChange.service';
import { TreeService } from '../../service/tree.service'; import { TreeService } from "../../service/tree.service";
import { NavChangeService } from '../../service/navChange.service'; import { NavChangeService } from "../../service/navChange.service";
import * as moment from 'moment'; import * as moment from "moment";
import { DispositionComponent } from '../disposition/disposition.component'; import { DispositionComponent } from "../disposition/disposition.component";
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from "ng-zorro-antd/message";
import { listRefreshService } from '../../service/listRefresh.service'; import { listRefreshService } from "../../service/listRefresh.service";
import { DisposeequipmentComponent } from '../records/warning-statistics-list/disposeequipment/disposeequipment.component'; import { DisposeequipmentComponent } from "../records/warning-statistics-list/disposeequipment/disposeequipment.component";
@Component({ @Component({
selector: 'app-today-warning', selector: "app-today-warning",
templateUrl: './today-warning.component.html', templateUrl: "./today-warning.component.html",
styleUrls: ['./today-warning.component.scss'] styleUrls: ["./today-warning.component.scss"],
}) })
export class TodayWarningComponent implements OnInit { export class TodayWarningComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private listRefreshService: listRefreshService, private http: HttpClient, private fb: FormBuilder, private toTree: TreeService, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private navChangeService: NavChangeService, private message: NzMessageService) { } constructor(
isMisinformation: boolean = false//误报按钮的显隐 private listRefreshService: listRefreshService,
private http: HttpClient,
private fb: FormBuilder,
private toTree: TreeService,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private navChangeService: NavChangeService,
private message: NzMessageService
) {}
isMisinformation: boolean = false; //误报按钮的显隐
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
level: [null], level: [null],
@ -29,60 +38,78 @@ export class TodayWarningComponent implements OnInit {
area: [null], area: [null],
disposalState: [null], disposalState: [null],
appealState: [null], appealState: [null],
datePickerStart: [new Date(`${moment(new Date()).format('YYYY-MM-DD')} 00:00`)], datePickerStart: [
datePickerEnd: [new Date(`${moment(new Date()).format('YYYY-MM-DD')} 23:59`)] new Date(`${moment(new Date()).format("YYYY-MM-DD")} 00:00`),
],
datePickerEnd: [
new Date(`${moment(new Date()).format("YYYY-MM-DD")} 23:59`),
],
}); });
this.warningType() this.warningType();
this.getEarlyWarningList() this.getEarlyWarningList();
this.listRefreshService.getMessage().subscribe((message: any) => { this.listRefreshService.getMessage().subscribe((message: any) => {
//列表刷新 //列表刷新
if (message.type == 'add') { if (message.type == "add") {
this.getEarlyWarningList() this.getEarlyWarningList();
} }
//更新处置状态 //更新处置状态
if (message.type == 'updatehandleTime') { if (message.type == "updatehandleTime") {
// console.log('更新处置状态', message) // console.log('更新处置状态', message)
// console.log(this.list) // console.log(this.list)
this.list.forEach(element => { this.list.forEach((element) => {
if (element.id == message.data) { if (element.id == message.data) {
element.handleTime = new Date() element.handleTime = new Date();
} }
}); });
} }
}); });
let loginUserInfo let loginUserInfo;
if (sessionStorage.getItem('isGasStation') == 'true') { if (sessionStorage.getItem("isGasStation") == "true") {
loginUserInfo = JSON.parse(sessionStorage.getItem('userdataOfgasstation')) loginUserInfo = JSON.parse(
sessionStorage.getItem("userdataOfgasstation")
);
} else { } else {
loginUserInfo = JSON.parse(sessionStorage.getItem('userdata')) loginUserInfo = JSON.parse(sessionStorage.getItem("userdata"));
} }
if (loginUserInfo.permissions.find((item) => { if (
return item.name == 'Data.Violation.Positive.Censor' loginUserInfo.permissions.find((item) => {
})) { return item.name == "Data.Violation.Positive.Censor";
this.isMisinformation = true })
) {
this.isMisinformation = true;
} else { } else {
this.isMisinformation = false this.isMisinformation = false;
} }
} }
//预警类型接口 //预警类型接口
warningTypesDetails: any warningTypesDetails: any;
warningTypesDetailsCopy: any warningTypesDetailsCopy: any;
warningTypes: any //预警接口数据 warningTypes: any; //预警接口数据
warningTypesCopy: any warningTypesCopy: any;
warningLevels: any warningLevels: any;
warningLevelsCopy: any warningLevelsCopy: any;
warningType() { warningType() {
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => { this.http
this.warningTypesDetails = JSON.parse(JSON.stringify(data.result)) .get("/api/services/app/Violation/GetAllList")
this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)) //原始数据备份 .subscribe((data: any) => {
this.warningTypes = (data.result as any).groupBy((t) => { return t.violationType }); this.warningTypesDetails = JSON.parse(JSON.stringify(data.result));
this.warningTypesCopy = (data.result as any).groupBy((t) => { return t.violationType }) this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)); //原始数据备份
this.warningLevels = (data.result as any).groupBy((t) => { return t.level }); this.warningTypes = (data.result as any).groupBy((t) => {
this.warningLevelsCopy = (data.result as any).groupBy((t) => { return t.level }) return t.violationType;
});
this.warningTypesCopy = (data.result as any).groupBy((t) => {
return t.violationType;
});
this.warningLevels = (data.result as any).groupBy((t) => {
return t.level;
});
this.warningLevelsCopy = (data.result as any).groupBy((t) => {
return t.level;
});
this.warningLevels.sort(function (a, b) { this.warningLevels.sort(function (a, b) {
if (a.key < b.key) { if (a.key < b.key) {
return -1; return -1;
@ -104,18 +131,20 @@ export class TodayWarningComponent implements OnInit {
// console.log(111, this.warningTypesDetails) // console.log(111, this.warningTypesDetails)
// console.log(222, this.warningTypesCopy) // console.log(222, this.warningTypesCopy)
// console.log(333, this.warningLevels) // console.log(333, this.warningLevels)
}) });
} }
typeChange(e) { typeChange(e) {
if (!e) { if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy this.warningTypesDetails = this.warningTypesDetailsCopy;
this.warningLevels = this.warningLevelsCopy this.warningLevels = this.warningLevelsCopy;
return return;
} }
this.warningTypes.forEach(element => { this.warningTypes.forEach((element) => {
if (element.key == e) { if (element.key == e) {
this.warningTypesDetails = element this.warningTypesDetails = element;
this.warningLevels = (element as any).groupBy((t) => { return t.level }); this.warningLevels = (element as any).groupBy((t) => {
return t.level;
});
} }
}); });
this.validateForm.patchValue({ this.validateForm.patchValue({
@ -124,17 +153,19 @@ export class TodayWarningComponent implements OnInit {
} }
levelChange(e) { levelChange(e) {
if (!e) { if (!e) {
this.warningTypesDetails = this.warningTypesDetailsCopy this.warningTypesDetails = this.warningTypesDetailsCopy;
this.warningTypes = this.warningTypesCopy this.warningTypes = this.warningTypesCopy;
this.validateForm.patchValue({ this.validateForm.patchValue({
type: null, type: null,
}); });
return return;
} }
this.warningLevels.forEach(element => { this.warningLevels.forEach((element) => {
if (element.key == e) { if (element.key == e) {
this.warningTypesDetails = element this.warningTypesDetails = element;
this.warningTypes = (element as any).groupBy((t) => { return t.violationType }); this.warningTypes = (element as any).groupBy((t) => {
return t.violationType;
});
} }
}); });
this.validateForm.patchValue({ this.validateForm.patchValue({
@ -143,62 +174,75 @@ export class TodayWarningComponent implements OnInit {
} }
//获得预警列表 //获得预警列表
list: any = [ list: any = [];
] totalCount: string; //预警总数
totalCount: string //预警总数 isSpin: boolean = false;
isSpin: boolean = false isLoading = false;
isLoading = false
getEarlyWarningList() { getEarlyWarningList() {
this.isLoading = true this.isLoading = true;
let ViolationIds = [] let ViolationIds = [];
if (this.validateForm.value.event) { if (this.validateForm.value.event) {
ViolationIds = this.validateForm.value.event ViolationIds = this.validateForm.value.event;
} }
if (this.validateForm.value.type && !this.validateForm.value.event) { if (this.validateForm.value.type && !this.validateForm.value.event) {
this.warningTypesDetails.forEach(item => { this.warningTypesDetails.forEach((item) => {
item.id ? ViolationIds.push(item.id) : null item.id ? ViolationIds.push(item.id) : null;
}); });
} }
let disposalState let disposalState;
if (this.validateForm.value.disposalState == '0') { if (this.validateForm.value.disposalState == "0") {
disposalState = true disposalState = true;
} else if (this.validateForm.value.disposalState == '1') { } else if (this.validateForm.value.disposalState == "1") {
disposalState = false disposalState = false;
} else { } else {
disposalState = null disposalState = null;
} }
let params = { let params = {
Level: this.validateForm.value.level, Level: this.validateForm.value.level,
ViolationIds: ViolationIds, ViolationIds: ViolationIds,
ViolateAreas: this.validateForm.value.area, ViolateAreas: this.validateForm.value.area,
organizationUnitId: JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id, organizationUnitId: JSON.parse(
ViolateTime: (this.validateForm.value.datePickerEnd && this.validateForm.value.datePickerStart) ? [moment(this.validateForm.value.datePickerStart).format('yyyy-MM-DD HH:mm:ss'), moment(this.validateForm.value.datePickerEnd).format('yyyy-MM-DD HH:mm:ss')] : null, sessionStorage.getItem("userdataOfgasstation")
).organization.id,
ViolateTime:
this.validateForm.value.datePickerEnd &&
this.validateForm.value.datePickerStart
? [
moment(this.validateForm.value.datePickerStart).format(
"yyyy-MM-DD HH:mm:ss"
),
moment(this.validateForm.value.datePickerEnd).format(
"yyyy-MM-DD HH:mm:ss"
),
]
: null,
IsHandled: disposalState, IsHandled: disposalState,
AppealStatus: this.validateForm.value.appealState, AppealStatus: this.validateForm.value.appealState,
// ViolateTime: ['2021-10-27', '2021-11-26'], // ViolateTime: ['2021-10-27', '2021-11-26'],
IsContainsChildren: 'true', IsContainsChildren: "true",
SkipCount: '0', SkipCount: "0",
MaxResultCount: '9999', MaxResultCount: "9999",
Positive: 'true' Positive: "true",
} };
this.isSpin = true this.isSpin = true;
this.http.get('/api/services/app/ViolateRecord/GetAll', { this.http
params: params .get("/api/services/app/ViolateRecord/GetAll", {
}).subscribe((data: any) => { params: params,
this.list = data.result.items })
this.totalCount = data.result.totalCount .subscribe((data: any) => {
console.log('预警列表', this.list) this.list = data.result.items;
this.isSpin = false this.totalCount = data.result.totalCount;
this.isLoading = false console.log("预警列表", this.list);
this.isSpin = false;
this.isLoading = false;
let obj = { let obj = {
name: '改变数量', name: "改变数量",
num: this.totalCount num: this.totalCount,
} };
setTimeout(() => { setTimeout(() => {
this.navChangeService.sendMessage(obj); //发布一条消息 this.navChangeService.sendMessage(obj); //发布一条消息
}, 0); }, 0);
});
})
} }
submitForm(): void { submitForm(): void {
@ -206,7 +250,7 @@ export class TodayWarningComponent implements OnInit {
this.validateForm.controls[i].markAsDirty(); this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity(); this.validateForm.controls[i].updateValueAndValidity();
} }
this.getEarlyWarningList() this.getEarlyWarningList();
} }
resetForm(e: MouseEvent): void { resetForm(e: MouseEvent): void {
e.preventDefault(); e.preventDefault();
@ -216,134 +260,161 @@ export class TodayWarningComponent implements OnInit {
this.validateForm.controls[key].updateValueAndValidity(); this.validateForm.controls[key].updateValueAndValidity();
} }
this.validateForm.patchValue({ this.validateForm.patchValue({
datePickerStart: new Date(`${moment(new Date()).format('YYYY-MM-DD')} 00:00`), datePickerStart: new Date(
datePickerEnd: new Date(`${moment(new Date()).format('YYYY-MM-DD')} 23:59`) `${moment(new Date()).format("YYYY-MM-DD")} 00:00`
),
datePickerEnd: new Date(
`${moment(new Date()).format("YYYY-MM-DD")} 23:59`
),
}); });
this.getEarlyWarningList() this.getEarlyWarningList();
} }
look(item) { look(item) {
if (item.violation.violationType == '设备监测') { if (item.violation.violationType == "设备监测") {
item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot) item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot);
const modal = this.modal.create({ const modal = this.modal.create({
nzContent: DisposeequipmentComponent, nzContent: DisposeequipmentComponent,
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzWidth: 380, nzWidth: 380,
nzBodyStyle: { nzBodyStyle: {
'border': '1px solid #91CCFF', border: "1px solid #91CCFF",
'border-radius': '0px', "border-radius": "0px",
'padding': '7px', padding: "7px",
'box-shadow': '0 0 8px 0 #fff', "box-shadow": "0 0 8px 0 #fff",
'background-image': 'linear-gradient(#003665, #000f25)' "background-image": "linear-gradient(#003665, #000f25)",
}, },
nzComponentParams: { nzComponentParams: {
data: item data: item,
}, },
nzFooter: null, nzFooter: null,
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {
if (instance.isScrap) { if (instance.isScrap) {
await new Promise(resolve => { await new Promise((resolve) => {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.copydata2.violatedItemSnapshotObj.name, name: instance.copydata2.violatedItemSnapshotObj.name,
storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation, storageLocation:
productionDate: moment(instance.copydata2.violatedItemSnapshotObj.productionDate).format('yyyy-MM-DD'), instance.copydata2.violatedItemSnapshotObj.storageLocation,
maintenanceDate: moment(instance.copydata2.violatedItemSnapshotObj.maintenanceDate).format('yyyy-MM-DD'), productionDate: moment(
validityEndTime: moment(instance.copydata2.violatedItemSnapshotObj.validityEndTime).format('yyyy-MM-DD'), instance.copydata2.violatedItemSnapshotObj.productionDate
).format("yyyy-MM-DD"),
maintenanceDate: moment(
instance.copydata2.violatedItemSnapshotObj.maintenanceDate
).format("yyyy-MM-DD"),
validityEndTime: moment(
instance.copydata2.violatedItemSnapshotObj.validityEndTime
).format("yyyy-MM-DD"),
isScrapped: true, isScrapped: true,
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId organizationUnitId:
} item.violatedItemSnapshotObj.organizationUnitId,
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { };
this.http
.put("/api/services/app/FireEquipment/Update", body)
.subscribe((data: any) => {
let body = { let body = {
id: item.id, id: item.id,
handleRecord: '报废成功!' handleRecord: "报废成功!",
} };
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http
resolve(data) .post(
this.message.create('success', '报废成功!'); "/api/services/app/ViolateRecord/HandleViolateRecord",
item.handleTime = new Date() body
return true )
}) .subscribe((data) => {
}) resolve(data);
}) this.message.create("success", "报废成功!");
item.handleTime = new Date();
return true;
});
});
});
} else { } else {
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise(resolve => { await new Promise((resolve) => {
let body = { let body = {
id: item.violatedItemSnapshotObj.id, id: item.violatedItemSnapshotObj.id,
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
storageLocation: instance.validateForm.value.storageLocation, storageLocation: instance.validateForm.value.storageLocation,
productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'), productionDate: moment(
maintenanceDate: moment(instance.validateForm.value.maintenanceDate).format('yyyy-MM-DD'), instance.validateForm.value.productionDate
validityEndTime: moment(instance.validateForm.value.validityEndTime).format('yyyy-MM-DD'), ).format("yyyy-MM-DD"),
organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId maintenanceDate: moment(
} instance.validateForm.value.maintenanceDate
this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { ).format("yyyy-MM-DD"),
validityEndTime: moment(
instance.validateForm.value.validityEndTime
).format("yyyy-MM-DD"),
organizationUnitId:
item.violatedItemSnapshotObj.organizationUnitId,
};
this.http
.put("/api/services/app/FireEquipment/Update", body)
.subscribe((data: any) => {
// item.violatedItemSnapshotObj = data.result // item.violatedItemSnapshotObj = data.result
let body = { let body = {
id: item.id, id: item.id,
handleRecord: '维保成功!' handleRecord: "维保成功!",
} };
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http
resolve(data) .post(
this.message.create('success', '维保成功!'); "/api/services/app/ViolateRecord/HandleViolateRecord",
item.handleTime = new Date() body
return true )
}) .subscribe((data) => {
}) resolve(data);
}) this.message.create("success", "维保成功!");
item.handleTime = new Date();
return true;
});
});
});
} else { } else {
this.message.create('warning', '请填写完整!'); this.message.create("warning", "请填写完整!");
return false return false;
}
} }
} }
},
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
} else { } else {
console.log(777777777777) this.modal.create({
const modal = this.modal.create({
nzContent: GetOutOfLineDetailsComponent, nzContent: GetOutOfLineDetailsComponent,
nzWrapClassName: "vertical-center-modal", nzWrapClassName: "vertical-center-modal",
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzWidth: (document.documentElement.clientHeight < 650 || document.documentElement.clientWidth < 1400) ? 1000 : 1200, nzWidth:
document.documentElement.clientHeight < 650 ||
document.documentElement.clientWidth < 1400
? 1000
: 1200,
nzClosable: false, nzClosable: false,
nzClassName: 'modelnobg', nzClassName: "modelnobg",
nzBodyStyle: { nzBodyStyle: {
'border-radius': '0px', "border-radius": "0px",
'padding': '0px', padding: "0px",
}, },
nzComponentParams: { nzComponentParams: {
data: item data: item,
}, },
nzFooter: null, nzFooter: null,
nzOnOk: async () => { nzOnOk: async () => {
console.log('误报处理') console.log("误报处理");
for (let index = 0; index < this.list.length; index++) { for (let index = 0; index < this.list.length; index++) {
const element = this.list[index]; const element = this.list[index];
if (element.id == item.id) { if (element.id == item.id) {
this.list.splice(index, 1) this.list.splice(index, 1);
this.totalCount = String(Number(this.totalCount) - 1) this.totalCount = String(Number(this.totalCount) - 1);
// this.SkipCount = String(Number(this.SkipCount) - 1) // this.SkipCount = String(Number(this.SkipCount) - 1)
} }
} }
} },
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => {
console.log(9999999999999999)
}); });
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
} }
} }
dispose(item) { dispose(item) {
console.log(item) console.log(item);
if (item.isEnableHandle) { if (item.isEnableHandle) {
const modal = this.modal.create({ const modal = this.modal.create({
nzContent: DispositionComponent, nzContent: DispositionComponent,
@ -351,39 +422,43 @@ export class TodayWarningComponent implements OnInit {
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzWidth: 380, nzWidth: 380,
nzBodyStyle: { nzBodyStyle: {
'border': '1px solid #91CCFF', border: "1px solid #91CCFF",
'border-radius': '0px', "border-radius": "0px",
'padding': '7px', padding: "7px",
'box-shadow': '0 0 8px 0 #fff', "box-shadow": "0 0 8px 0 #fff",
'background-image': 'linear-gradient(#003665, #000f25)' "background-image": "linear-gradient(#003665, #000f25)",
}, },
nzComponentParams: {}, nzComponentParams: {},
nzFooter: null, nzFooter: null,
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise(resolve => { await new Promise((resolve) => {
let body = { let body = {
id: item.id, id: item.id,
handleRecord: instance.validateForm.value.content handleRecord: instance.validateForm.value.content,
} };
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { this.http
resolve(data) .post(
this.message.create('success', '处置成功!'); "/api/services/app/ViolateRecord/HandleViolateRecord",
item.handleTime = new Date() body
return true )
}) .subscribe((data) => {
}) resolve(data);
this.message.create("success", "处置成功!");
item.handleTime = new Date();
return true;
});
});
} else { } else {
this.message.create('warning', '请填写完整!'); this.message.create("warning", "请填写完整!");
return false return false;
} }
}, },
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
} else { } else {
this.message.create('warning', '无处置权限!'); this.message.create("warning", "无处置权限!");
} }
} }
} }

33
src/app/service/publicMethods.service.ts

@ -0,0 +1,33 @@
import { Injectable } from "@angular/core";
@Injectable({
providedIn: "root",
})
export class PublicMethodsService {
constructor() {}
//获取文件格式
getFileType(name: string): string {
let type;
let suffix = name.substring(name.length - 4);
if (
suffix.includes("png") ||
suffix.includes("jpg") ||
suffix.includes("jpeg") ||
suffix.includes("webp")
) {
type = "img";
} else if (suffix.includes("doc") || suffix.includes("docx")) {
type = "word";
} else if (suffix.includes("pdf")) {
type = "pdf";
} else if (
suffix.includes("mp4") ||
suffix.includes("webm") ||
suffix.includes("ogg")
) {
type = "video";
}
return type;
}
}

20
src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts

@ -126,13 +126,13 @@ export class AnalysisOfTheHostComponent implements OnInit {
} }
this.http.post('/api/services/app/EdgeDevice/Create', body).subscribe(data => { this.http.post('/api/services/app/EdgeDevice/Create', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '创建成功'); this.message.create('success', '创建成功!');
this.getHost() this.getHost()
return true return true
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -156,13 +156,13 @@ export class AnalysisOfTheHostComponent implements OnInit {
data.hostIPAddress = instance.validateForm.value.ip, data.hostIPAddress = instance.validateForm.value.ip,
this.http.put('/api/services/app/EdgeDevice/Update', data).subscribe(data => { this.http.put('/api/services/app/EdgeDevice/Update', data).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '修改成功'); this.message.create('success', '修改成功!');
this.getHost() this.getHost()
return true return true
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -181,7 +181,7 @@ export class AnalysisOfTheHostComponent implements OnInit {
Id: item.id Id: item.id
} }
}).subscribe(data => { }).subscribe(data => {
this.message.create('success', '删除成功'); this.message.create('success', '删除成功!');
this.getHost() this.getHost()
}) })
}, },
@ -212,7 +212,7 @@ export class AnalysisOfTheHostComponent implements OnInit {
} }
this.http.post('/api/services/app/Camera/Create', body).subscribe(data => { this.http.post('/api/services/app/Camera/Create', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '创建成功'); this.message.create('success', '创建成功!');
this.getCamera() this.getCamera()
return true return true
}, err => { }, err => {
@ -220,7 +220,7 @@ export class AnalysisOfTheHostComponent implements OnInit {
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -247,7 +247,7 @@ export class AnalysisOfTheHostComponent implements OnInit {
data.ipAdress = instance.validateForm.value.ip data.ipAdress = instance.validateForm.value.ip
this.http.put('/api/services/app/Camera/Update', data).subscribe(data => { this.http.put('/api/services/app/Camera/Update', data).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '编辑成功'); this.message.create('success', '编辑成功!');
this.getCamera() this.getCamera()
return true return true
}, err => { }, err => {
@ -255,7 +255,7 @@ export class AnalysisOfTheHostComponent implements OnInit {
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -274,7 +274,7 @@ export class AnalysisOfTheHostComponent implements OnInit {
Id: item.id Id: item.id
} }
}).subscribe(data => { }).subscribe(data => {
this.message.create('success', '删除成功'); this.message.create('success', '删除成功!');
this.getCamera() this.getCamera()
}) })
}, },

10
src/app/system-management/file-of-license/file-of-license.component.ts

@ -54,13 +54,13 @@ export class FileOfLicenseComponent implements OnInit {
} }
this.http.post('/api/services/app/FileLicenseType/Create', body).subscribe(data => { this.http.post('/api/services/app/FileLicenseType/Create', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '创建成功'); this.message.create('success', '创建成功!');
this.getLicense() this.getLicense()
return true return true
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -91,13 +91,13 @@ export class FileOfLicenseComponent implements OnInit {
} }
this.http.put('/api/services/app/FileLicenseType/Update', body).subscribe(data => { this.http.put('/api/services/app/FileLicenseType/Update', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '修改成功'); this.message.create('success', '修改成功!');
this.getLicense() this.getLicense()
return true return true
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -120,7 +120,7 @@ export class FileOfLicenseComponent implements OnInit {
Id: item.id Id: item.id
} }
}).subscribe(data => { }).subscribe(data => {
this.message.create('success', '删除成功'); this.message.create('success', '删除成功!');
this.getLicense() this.getLicense()
}) })
}, },

10
src/app/system-management/menu/menu.component.ts

@ -90,7 +90,7 @@ export class MenuComponent implements OnInit {
} }
this.http.post('/api/services/app/Menu/Create', body).subscribe(data => { this.http.post('/api/services/app/Menu/Create', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '创建成功'); this.message.create('success', '创建成功!');
this.nzTreeComponent.getExpandedNodeList().forEach((item) => { this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
this.defaultExpandedKeys.push(item.key) this.defaultExpandedKeys.push(item.key)
}) })
@ -103,7 +103,7 @@ export class MenuComponent implements OnInit {
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -134,7 +134,7 @@ export class MenuComponent implements OnInit {
} }
this.http.put('/api/services/app/Menu/Update', body).subscribe(data => { this.http.put('/api/services/app/Menu/Update', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '编辑成功'); this.message.create('success', '编辑成功!');
this.nzTreeComponent.getExpandedNodeList().forEach((item) => { this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
this.defaultExpandedKeys.push(item.key) this.defaultExpandedKeys.push(item.key)
}) })
@ -147,7 +147,7 @@ export class MenuComponent implements OnInit {
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -173,7 +173,7 @@ export class MenuComponent implements OnInit {
this.defaultExpandedKeys.push(item.key) this.defaultExpandedKeys.push(item.key)
}) })
this.getAllOrganization() this.getAllOrganization()
this.message.create('success', '删除成功'); this.message.create('success', '删除成功!');
}) })
}, },
nzCancelText: '取消', nzCancelText: '取消',

12
src/app/system-management/organization/organization.component.ts

@ -160,7 +160,7 @@ export class OrganizationComponent implements OnInit {
.subscribe( .subscribe(
(data) => { (data) => {
resolve(data); resolve(data);
this.message.create("success", "创建成功"); this.message.create("success", "创建成功!");
this.nzTreeComponent.getExpandedNodeList().forEach((item) => { this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
this.defaultExpandedKeys.push(item.key); this.defaultExpandedKeys.push(item.key);
}); });
@ -175,7 +175,7 @@ export class OrganizationComponent implements OnInit {
); );
}); });
} else { } else {
this.message.create("warning", "请填写完整"); this.message.create("warning", "请填写完整!");
return false; return false;
} }
}, },
@ -212,7 +212,7 @@ export class OrganizationComponent implements OnInit {
.subscribe( .subscribe(
(data) => { (data) => {
resolve(data); resolve(data);
this.message.create("success", "编辑成功"); this.message.create("success", "编辑成功!");
this.nzTreeComponent.getExpandedNodeList().forEach((item) => { this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
this.defaultExpandedKeys.push(item.key); this.defaultExpandedKeys.push(item.key);
}); });
@ -227,7 +227,7 @@ export class OrganizationComponent implements OnInit {
); );
}); });
} else { } else {
this.message.create("warning", "请填写完整"); this.message.create("warning", "请填写完整!");
return false; return false;
} }
}, },
@ -273,7 +273,7 @@ export class OrganizationComponent implements OnInit {
this.defaultExpandedKeys.push(item.key); this.defaultExpandedKeys.push(item.key);
}); });
this.getAllOrganization(); this.getAllOrganization();
this.message.create("success", "删除成功"); this.message.create("success", "删除成功!");
}); });
}, },
nzCancelText: "取消", nzCancelText: "取消",
@ -313,7 +313,7 @@ export class OrganizationComponent implements OnInit {
}) })
.subscribe( .subscribe(
(data) => { (data) => {
this.message.create("success", "拖拽成功"); this.message.create("success", "拖拽成功!");
this.nzTreeComponent.getExpandedNodeList().forEach((item) => { this.nzTreeComponent.getExpandedNodeList().forEach((item) => {
this.defaultExpandedKeys.push(item.key); this.defaultExpandedKeys.push(item.key);
}); });

10
src/app/system-management/push/push.component.ts

@ -62,9 +62,9 @@ export class PushComponent implements OnInit {
.subscribe((data: any) => { .subscribe((data: any) => {
// console.log('设置短信推送状态成功', data) // console.log('设置短信推送状态成功', data)
if (e) { if (e) {
this.message.create("success", "开启成功"); this.message.create("success", "开启成功!");
} else { } else {
this.message.create("success", "关闭成功"); this.message.create("success", "关闭成功!");
} }
}); });
} }
@ -172,18 +172,18 @@ export class PushComponent implements OnInit {
.subscribe({ .subscribe({
next: (data) => { next: (data) => {
resolve(data); resolve(data);
this.message.create("success", "修改成功"); this.message.create("success", "修改成功!");
this.getViolation(); this.getViolation();
return true; return true;
}, },
error: (err) => { error: (err) => {
this.message.create("success", "修改失败"); this.message.create("success", "修改失败!");
reject(err); reject(err);
}, },
}); });
}); });
} else { } else {
this.message.create("warning", "请填写完整"); this.message.create("warning", "请填写完整!");
return false; return false;
} }
}, },

20
src/app/system-management/role/role.component.ts

@ -115,23 +115,23 @@ export class RoleComponent implements OnInit {
.subscribe( .subscribe(
(data) => { (data) => {
resolve(data); resolve(data);
this.message.create("success", "创建成功"); this.message.create("success", "创建成功!");
this.getAllRoles(); this.getAllRoles();
}, },
(err) => { (err) => {
this.message.create("warning", "分配菜单错误"); this.message.create("warning", "分配菜单错误!");
reject(err); reject(err);
} }
); );
}, },
(err) => { (err) => {
this.message.create("warning", "创建角色错误"); this.message.create("warning", "创建角色错误!");
reject(err); reject(err);
} }
); );
}); });
} else { } else {
this.message.create("warning", "请填写完整"); this.message.create("warning", "请填写完整!");
return false; return false;
} }
}, },
@ -178,24 +178,24 @@ export class RoleComponent implements OnInit {
}) })
.subscribe( .subscribe(
(data) => { (data) => {
this.message.create("success", "修改成功"); this.message.create("success", "修改成功!");
this.getAllRoles(); this.getAllRoles();
resolve(data); resolve(data);
}, },
(err) => { (err) => {
this.message.create("warning", "分配菜单错误"); this.message.create("warning", "分配菜单错误!");
reject(err); reject(err);
} }
); );
}, },
(err) => { (err) => {
this.message.create("warning", "修改角色错误"); this.message.create("warning", "修改角色错误!");
reject(err); reject(err);
} }
); );
}); });
} else { } else {
this.message.create("warning", "请填写完整"); this.message.create("warning", "请填写完整!");
return false; return false;
} }
}, },
@ -247,7 +247,7 @@ export class RoleComponent implements OnInit {
}) })
.subscribe((data) => { .subscribe((data) => {
resolve(data); resolve(data);
this.message.create("success", "分配成功"); this.message.create("success", "分配成功!");
this.getAllRoles(); this.getAllRoles();
return true; return true;
}); });
@ -285,7 +285,7 @@ export class RoleComponent implements OnInit {
}, },
}) })
.subscribe((data) => { .subscribe((data) => {
this.message.create("success", "删除成功"); this.message.create("success", "删除成功!");
this.getAllRoles(); this.getAllRoles();
}); });
}, },

10
src/app/system-management/update-of-license/update-of-license.component.ts

@ -63,13 +63,13 @@ export class UpdateOfLicenseComponent implements OnInit {
} }
this.http.post('/api/services/app/ValidityLicenseType/Create', body).subscribe(data => { this.http.post('/api/services/app/ValidityLicenseType/Create', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '创建成功'); this.message.create('success', '创建成功!');
this.getLicense() this.getLicense()
return true return true
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -106,13 +106,13 @@ export class UpdateOfLicenseComponent implements OnInit {
} }
this.http.put('/api/services/app/ValidityLicenseType/Update', body).subscribe(data => { this.http.put('/api/services/app/ValidityLicenseType/Update', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '修改成功'); this.message.create('success', '修改成功!');
this.getLicense() this.getLicense()
return true return true
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
return false return false
} }
} }
@ -135,7 +135,7 @@ export class UpdateOfLicenseComponent implements OnInit {
Id: item.id Id: item.id
} }
}).subscribe(data => { }).subscribe(data => {
this.message.create('success', '删除成功'); this.message.create('success', '删除成功!');
this.getLicense() this.getLicense()
}) })
}, },

4
src/app/system-management/user/edituser/edituser.component.ts

@ -139,7 +139,7 @@ export class EdituserComponent implements OnInit {
resolve(data) resolve(data)
this.data.auditStatus = data.result.auditStatus this.data.auditStatus = data.result.auditStatus
this.isLoading = false this.isLoading = false
this.message.create('success', '保存成功'); this.message.create('success', '保存成功!');
}, err => { }, err => {
resolve(err) resolve(err)
this.isLoading = false this.isLoading = false
@ -147,7 +147,7 @@ export class EdituserComponent implements OnInit {
}) })
}) })
} else { } else {
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整!');
} }
} }
//取消 //取消

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

@ -30,7 +30,7 @@
[appConfirmpsw] = "newPassword.value"> [appConfirmpsw] = "newPassword.value">
</mat-form-field> </mat-form-field>
<div *ngIf="newsPassword.touched&&newsPassword.invalid"> <div *ngIf="newsPassword.touched&&newsPassword.invalid">
<div class="group-error-content">密码输入不一致</div> <div class="group-error-content">密码输入不一致!</div>
</div> </div>
<div *ngIf="errmsg" class="group-error-content"> <div *ngIf="errmsg" class="group-error-content">
{{errmsg}} {{errmsg}}

1
src/theme.less

@ -641,6 +641,7 @@
} }
} }
.ant-modal-close-x { .ant-modal-close-x {
color: #fff; color: #fff;
} }

Loading…
Cancel
Save