diff --git a/package.json b/package.json index 70df921..d10cd3e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "scripts": { "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", "test": "ng test", "lint": "ng lint", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 46ec9f6..23249de 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -11,9 +11,11 @@ import { CacheTokenService } from './service/cache-token.service' import { TreeService } from './service/tree.service' import { NzNotificationModule } from 'ng-zorro-antd/notification'; import { NzMessageModule } from 'ng-zorro-antd/message'; +import { VideoPlayComponent } from './component/video-play/video-play.component'; @NgModule({ declarations: [ AppComponent, + VideoPlayComponent, ], imports: [ AppRoutingModule, diff --git a/src/app/component/video-play/video-play.component.html b/src/app/component/video-play/video-play.component.html new file mode 100644 index 0000000..1b9c386 --- /dev/null +++ b/src/app/component/video-play/video-play.component.html @@ -0,0 +1,32 @@ +
+
+
+
+ 视频 +
+
+
+
+ + + + + +
+
+ +
+ +
+ + + + + 暂无视频 + +
+
+ +
\ No newline at end of file diff --git a/src/app/component/video-play/video-play.component.scss b/src/app/component/video-play/video-play.component.scss new file mode 100644 index 0000000..ff9c456 --- /dev/null +++ b/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; +} diff --git a/src/app/component/video-play/video-play.component.ts b/src/app/component/video-play/video-play.component.ts new file mode 100644 index 0000000..8e3cd04 --- /dev/null +++ b/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(); + } +} diff --git a/src/app/pages/audit/annual-inspection/edit-annual-inspection/edit-annual-inspection.component.ts b/src/app/pages/audit/annual-inspection/edit-annual-inspection/edit-annual-inspection.component.ts index 4c55922..32b9f2a 100644 --- a/src/app/pages/audit/annual-inspection/edit-annual-inspection/edit-annual-inspection.component.ts +++ b/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 }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); } diff --git a/src/app/pages/audit/audit-inform-time/edit-inform-time/edit-inform-time.component.ts b/src/app/pages/audit/audit-inform-time/edit-inform-time/edit-inform-time.component.ts index fe1c5f5..90fa31f 100644 --- a/src/app/pages/audit/audit-inform-time/edit-inform-time/edit-inform-time.component.ts +++ b/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 }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); } diff --git a/src/app/pages/audit/audit-ing/appeal-details/appeal-details.component.ts b/src/app/pages/audit/audit-ing/appeal-details/appeal-details.component.ts index 48ed352..e8b92d3 100644 --- a/src/app/pages/audit/audit-ing/appeal-details/appeal-details.component.ts +++ b/src/app/pages/audit/audit-ing/appeal-details/appeal-details.component.ts @@ -1,72 +1,69 @@ -import { HttpClient } from '@angular/common/http'; -import { Component, Input, OnInit } from '@angular/core'; -import { NzMessageService } from 'ng-zorro-antd/message'; -import { NzModalRef } from 'ng-zorro-antd/modal'; -import Viewer from 'viewerjs'; +import { HttpClient } from "@angular/common/http"; +import { Component, Input, OnInit, ViewContainerRef } from "@angular/core"; +import { NzMessageService } from "ng-zorro-antd/message"; +import { NzModalRef, NzModalService } from "ng-zorro-antd/modal"; +import { VideoPlayComponent } from "src/app/component/video-play/video-play.component"; +import { PublicMethodsService } from "src/app/service/publicMethods.service"; +import Viewer from "viewerjs"; @Component({ - selector: 'app-appeal-details', - templateUrl: './appeal-details.component.html', - styleUrls: ['./appeal-details.component.scss'] + selector: "app-appeal-details", + templateUrl: "./appeal-details.component.html", + styleUrls: ["./appeal-details.component.scss"], }) export class AppealDetailsComponent implements OnInit { - @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 = { appealAttachments: [], - handleUserName: '', - lastModificationTime: '' - } - organizationName + handleUserName: "", + lastModificationTime: "", + }; + organizationName; ngOnInit(): void { - console.log('申诉详情', this.data) + console.log("申诉详情", this.data); if (this.data.auditType == 5) { - - this.http.get('/api/services/app/ViolateRecord/Get', { - params: { - id: this.data.itemId - } - }).subscribe((data: any) => { - this.appealData = data.result - console.log('申诉预警详情', this.appealData) - }) + this.http + .get("/api/services/app/ViolateRecord/Get", { + params: { + id: this.data.itemId, + }, + }) + .subscribe((data: any) => { + this.appealData = data.result; + console.log("申诉预警详情", this.appealData); + }); } } destroyModal() { - 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 + this.modal.destroy({ data: "this the result data" }); } //查看图片 viewImg(url) { - let dom = document.getElementById(`viewerjs`) + let dom = document.getElementById(`viewerjs`); let pObjs = dom.childNodes; - let node = document.createElement("img") + let node = document.createElement("img"); node.style.display = "none"; node.src = url; - node.id = 'img' - dom.appendChild(node) + node.id = "img"; + dom.appendChild(node); setTimeout(() => { let viewer = new Viewer(document.getElementById(`viewerjs`), { hidden: () => { dom.removeChild(pObjs[0]); viewer.destroy(); - } + }, }); node.click(); }, 0); @@ -75,18 +72,40 @@ export class AppealDetailsComponent implements OnInit { //查看文件 lookFile(item) { if (!item) { - return + return; } - if (this.getFileType(item) == 'word') { - let arr = item.split('.') - arr[arr.length - 1] = 'pdf' - window.open(arr.join('.')) - } else if (this.getFileType(item) == 'pdf') { - window.open(item) - } else if (this.getFileType(item) == 'img') { - this.viewImg(item) + if (this.pubilcMethods.getFileType(item) == "word") { + let arr = item.split("."); + arr[arr.length - 1] = "pdf"; + window.open(arr.join(".")); + } else if (this.pubilcMethods.getFileType(item) == "pdf") { + 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 { - this.message.create('warning', '暂不支持查看!'); + this.message.create("warning", "暂不支持查看!"); + window.open(window.location.origin + item); } } } diff --git a/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.ts b/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.ts index bc38491..2edd28f 100644 --- a/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.ts +++ b/src/app/pages/audit/audit-ing/audit-dispose/audit-dispose.component.ts @@ -1,55 +1,65 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { NzModalRef } from 'ng-zorro-antd/modal'; -import Viewer from 'viewerjs'; -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 { HttpClient } from '@angular/common/http'; - +import { Component, OnInit, Input, ViewContainerRef } from "@angular/core"; +import { NzModalRef, NzModalService } from "ng-zorro-antd/modal"; +import Viewer from "viewerjs"; +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 { 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({ - selector: 'app-audit-dispose', - templateUrl: './audit-dispose.component.html', - styleUrls: ['./audit-dispose.component.scss'] + selector: "app-audit-dispose", + templateUrl: "./audit-dispose.component.html", + styleUrls: ["./audit-dispose.component.scss"], }) export class AuditDisposeComponent implements OnInit { - @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 = ""; //审批意见 - role1 = [] - role2 = [] + role1 = []; + role2 = []; /** * 申诉数据 */ appealData: any = { - appealAttachments: [] - } + appealAttachments: [], + }; ngOnInit(): void { - console.log('审批信息', this.data) + console.log("审批信息", this.data); if (this.data.auditType == 4) { - this.data.getData.roleDisplayNames.forEach(element => { - if (element.indexOf('接收人') != -1) { - this.role2.push(element) + this.data.getData.roleDisplayNames.forEach((element) => { + if (element.indexOf("接收人") != -1) { + this.role2.push(element); } else { - this.role1.push(element) + this.role1.push(element); } }); } if (this.data.auditType == 5) { - - this.http.get('/api/services/app/ViolateRecord/Get', { - params: { - id: this.data.itemId - } - }).subscribe((data: any) => { - this.appealData = data.result - }) + this.http + .get("/api/services/app/ViolateRecord/Get", { + params: { + id: this.data.itemId, + }, + }) + .subscribe((data: any) => { + this.appealData = data.result; + }); } } - destroyModal() { this.modal.destroy(); } @@ -57,53 +67,63 @@ export class AuditDisposeComponent implements OnInit { isPass: boolean; ok(isPass: boolean) { this.isPass = isPass; - this.modal.triggerOk() + this.modal.triggerOk(); } //获取办理类型 getHandleTypes(handleTypes: any[]): string { if (!handleTypes || !handleTypes.length) { - return + return; } - let names: string[] = [] + let names: string[] = []; let handleTypeList = JSON.parse(JSON.stringify(handleTypes)); let list: handleTypeList[] = new handleType().list; - handleTypeList.forEach(item => { - list.find(element => { - item == element.value ? names.push(element.name) : null - }) - }) - return names.join(',') + handleTypeList.forEach((item) => { + list.find((element) => { + item == element.value ? names.push(element.name) : null; + }); + }); + return names.join(","); } - //获取文件格式 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' + 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 suffix + return type; } - //查看图片 viewImg(url) { - let dom = document.getElementById(`viewerjs`) + let dom = document.getElementById(`viewerjs`); let pObjs = dom.childNodes; - let node = document.createElement("img") + let node = document.createElement("img"); node.style.display = "none"; node.src = url; - node.id = 'img' - dom.appendChild(node) + node.id = "img"; + dom.appendChild(node); setTimeout(() => { let viewer = new Viewer(document.getElementById(`viewerjs`), { hidden: () => { dom.removeChild(pObjs[0]); viewer.destroy(); - } + }, }); node.click(); }, 0); @@ -112,21 +132,40 @@ export class AuditDisposeComponent implements OnInit { //查看文件 lookFile(item) { if (!item) { - return + return; } - if (this.getFileType(item) == 'word') { - let arr = item.split('.') - arr[arr.length - 1] = 'pdf' - window.open(arr.join('.')) - } else if (this.getFileType(item) == 'pdf') { - window.open(item) - } else if (this.getFileType(item) == 'img') { - this.viewImg(item) + if (this.pubilcMethods.getFileType(item) == "word") { + let arr = item.split("."); + arr[arr.length - 1] = "pdf"; + window.open(arr.join(".")); + } else if (this.pubilcMethods.getFileType(item) == "pdf") { + 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 { - this.message.create('warning', '暂不支持查看!'); + this.message.create("warning", "暂不支持查看!"); + window.open(window.location.origin + item); } } - - - } diff --git a/src/app/pages/audit/audit-ing/audit-ing.component.ts b/src/app/pages/audit/audit-ing/audit-ing.component.ts index 0dd441a..7e19669 100644 --- a/src/app/pages/audit/audit-ing/audit-ing.component.ts +++ b/src/app/pages/audit/audit-ing/audit-ing.component.ts @@ -1,220 +1,265 @@ -import { HttpClient } from '@angular/common/http'; -import { Component, ElementRef, OnInit, ViewContainerRef } from '@angular/core'; -import { NzMessageService } from 'ng-zorro-antd/message'; -import { NzModalService } from 'ng-zorro-antd/modal'; -import { Observable, fromEvent } from 'rxjs'; -import { debounceTime } from 'rxjs/operators'; -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 { 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 { AppealDetailsComponent } from './appeal-details/appeal-details.component'; -import { AuditDisposeComponent } from './audit-dispose/audit-dispose.component'; -import { UserDetailsComponent } from './user-details/user-details.component'; +import { HttpClient } from "@angular/common/http"; +import { Component, ElementRef, OnInit, ViewContainerRef } from "@angular/core"; +import { NzMessageService } from "ng-zorro-antd/message"; +import { NzModalService } from "ng-zorro-antd/modal"; +import { Observable, fromEvent } from "rxjs"; +import { debounceTime } from "rxjs/operators"; +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 { 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 { AppealDetailsComponent } from "./appeal-details/appeal-details.component"; +import { AuditDisposeComponent } from "./audit-dispose/audit-dispose.component"; +import { UserDetailsComponent } from "./user-details/user-details.component"; @Component({ - selector: 'app-audit-ing', - templateUrl: './audit-ing.component.html', - styleUrls: ['./audit-ing.component.scss'] + selector: "app-audit-ing", + templateUrl: "./audit-ing.component.html", + styleUrls: ["./audit-ing.component.scss"], }) 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) { } - tableSpin = false + tableScrollHeight; + resizeListener; - tableScrollHeight - resizeListener - - level + level; ngOnInit(): void { - this.tableScrollHeight = '100px' + this.tableScrollHeight = "100px"; // 页面监听 - this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => { - let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight - this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px' - }); - this.getStationList() + this.resizeListener = fromEvent(window, "resize") + .pipe(debounceTime(100)) + .subscribe((event) => { + let tableHeader = + this.element.nativeElement.querySelector( + `.ant-table-header` + ).clientHeight; + this.tableScrollHeight = + document.getElementById("tablebox").clientHeight - + tableHeader - + 10 + + "px"; + }); + this.getStationList(); - this.level = JSON.parse(sessionStorage.getItem('userdata')).organization.level + this.level = JSON.parse( + sessionStorage.getItem("userdata") + ).organization.level; } ngOnDestroy(): void { - this.resizeListener.unsubscribe() + this.resizeListener.unsubscribe(); } ngAfterViewInit(): void { - fromEvent(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) { - this.SkipCount = String(Number(this.SkipCount) + 50) - this.getStationList() + fromEvent( + 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) { + this.SkipCount = String(Number(this.SkipCount) + 50); + this.getStationList(); + } } - } - }); + }); } - list = [] - totalCount;//列表总数 - SkipCount: string = '0'; - MaxResultCount: string = '50'; + list = []; + totalCount; //列表总数 + SkipCount: string = "0"; + MaxResultCount: string = "50"; //获取当前油站档案类证照 getStationList() { - this.tableSpin = true - let data = JSON.parse(sessionStorage.getItem('userdata')); + this.tableSpin = true; + let data = JSON.parse(sessionStorage.getItem("userdata")); let params = { OrganizationUnitId: data.organization.id || "", IsContainsChildren: "true", AuditStatuses: "1", SkipCount: this.SkipCount, MaxResultCount: this.MaxResultCount, - } - this.http.get(`/api/services/app/ContentAuditLog/GetAuditting`, { params }).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] - this.totalCount = info.result.totalCount - this.tableSpin = false - setTimeout(() => { - let tableHeader = this.element.nativeElement.querySelector(`.ant-table-header`).clientHeight - this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - tableHeader - 10) + 'px' - }, 0); + }; + this.http + .get(`/api/services/app/ContentAuditLog/GetAuditting`, { params }) + .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]; + this.totalCount = info.result.totalCount; + this.tableSpin = false; + setTimeout(() => { + let tableHeader = + this.element.nativeElement.querySelector( + `.ant-table-header` + ).clientHeight; + this.tableScrollHeight = + document.getElementById("tablebox").clientHeight - + tableHeader - + 10 + + "px"; + }, 0); - console.log(this.list) - }) + console.log(this.list); + }); } - - dispose(item) { - this.getData(item).then(res => { - item.getData = res + this.getData(item).then((res) => { + item.getData = res; const modal = this.modal.create({ nzContent: AuditDisposeComponent, nzViewContainerRef: this.viewContainerRef, nzWidth: item.auditType == 0 ? 700 : 600, nzBodyStyle: { - 'border': '1px solid #91CCFF', - 'border-radius': '0px', - 'padding': '7px', - 'box-shadow': '0 0 8px 0 #fff', - 'background-image': 'linear-gradient(#003665, #000f25)' + border: "1px solid #91CCFF", + "border-radius": "0px", + padding: "7px", + "box-shadow": "0 0 8px 0 #fff", + "background-image": "linear-gradient(#003665, #000f25)", }, nzStyle: { - 'top': '50px', + top: "50px", }, nzComponentParams: { - data: item + data: item, }, nzFooter: null, - nzKeyboard:false, + nzKeyboard: false, nzClosable: false, nzOnOk: async () => { - await new Promise(resolve => { - let url = '/api/services/app/ContentAuditLog/Audit' + await new Promise((resolve, reject) => { + if (!instance.isPass && !instance.textarea) { + this.message.warning("请输入审批意见"); + reject(); + return; + } + + let url = "/api/services/app/ContentAuditLog/Audit"; let params = { id: item.id, - rejectReason: instance.textarea - } + rejectReason: instance.textarea, + }; let body = instance.isPass ? 2 : 3; - this.http.post(url, body, { params }).subscribe(data => { + this.http.post(url, body, { params }).subscribe((data) => { resolve(data); - this.list = [] - this.SkipCount = '0' + this.list = []; + this.SkipCount = "0"; this.getStationList(); - this.message.create('success', '审核完成!'); - return true - }) - }) - } + this.message.create("success", "审核完成!"); + return true; + }); + }); + }, }); const instance = modal.getContentComponent(); - modal.afterClose.subscribe(result => { }); - }) + modal.afterClose.subscribe((result) => {}); + }); } details(item) { - console.log('点击的item', item) - let component + console.log("点击的item", item); + let component; if (item.auditType == 0) { - component = GasBaseInfoComponent + component = GasBaseInfoComponent; } else if (item.auditType == 1) { - component = AuditDetailsInformTimeComponent + component = AuditDetailsInformTimeComponent; } else if (item.auditType == 2) { - component = DetailsUpdateCategoryComponent + component = DetailsUpdateCategoryComponent; } else if (item.auditType == 4) { - component = UserDetailsComponent + component = UserDetailsComponent; } else if (item.auditType == 5) { - component = AppealDetailsComponent + component = AppealDetailsComponent; } else if (item.auditType) { - component = DetailsFileCategoryComponent + component = DetailsFileCategoryComponent; } this.getData(item).then((res: any) => { - item.getData = res + item.getData = res; if (item.auditType == 1) { - item.getData.isYearlyCheckDefault = res.licenseType.isYearlyCheck + item.getData.isYearlyCheckDefault = res.licenseType.isYearlyCheck; } const modal = this.modal.create({ nzContent: component, nzViewContainerRef: this.viewContainerRef, nzWidth: item.auditType == 0 ? 700 : 450, nzBodyStyle: { - 'border': '1px solid #91CCFF', - 'border-radius': '0px', - 'padding': '7px', - 'box-shadow': '0 0 8px 0 #fff', - 'background-image': 'linear-gradient(#003665, #000f25)' + border: "1px solid #91CCFF", + "border-radius": "0px", + padding: "7px", + "box-shadow": "0 0 8px 0 #fff", + "background-image": "linear-gradient(#003665, #000f25)", }, nzStyle: { - 'top': '50px', + top: "50px", }, nzComponentParams: { - data: item.getData + data: item.getData, }, - nzKeyboard:false, + nzKeyboard: false, nzFooter: null, nzClosable: false, }); - }) + }); } //获取证照类data getData(item) { - let url - if (item.auditType == 0) { //油站基本信息 + let url; + if (item.auditType == 0) { + //油站基本信息 return new Promise((resolve, reject) => { - let organization = { organizationId: item.organizationId } - resolve(organization) - }) + let organization = { organizationId: item.organizationId }; + resolve(organization); + }); } else if (item.auditType == 1) { - url = '/api/services/app/OrganizationValidityLicenseRule/Get' + url = "/api/services/app/OrganizationValidityLicenseRule/Get"; } else if (item.auditType == 2) { - url = '/api/services/app/StationValidityLicense/Get' + url = "/api/services/app/StationValidityLicense/Get"; } else if (item.auditType == 4) { - url = '/api/services/app/EdittingUser/Get' + url = "/api/services/app/EdittingUser/Get"; } else if (item.auditType == 5) { return new Promise((resolve, reject) => { - resolve(item) - }) + resolve(item); + }); } else if (item.auditType) { - url = '/api/services/app/StationFileLicense/Get' + url = "/api/services/app/StationFileLicense/Get"; } return new Promise((resolve, reject) => { - let params = { id: item.itemId } + let params = { id: item.itemId }; this.http.get(url, { params }).subscribe((data: any) => { - let auditLog = { rejectReason: item.rejectReason } - let organization = { displayName: item.organization ? item.organization.displayName : "" } + let auditLog = { rejectReason: item.rejectReason }; + let organization = { + displayName: item.organization ? item.organization.displayName : "", + }; if (item.auditType == 1) { - data.result.auditLog = auditLog - data.result.organization = organization - data.result.handleRemindDaysDefault = data.result.licenseType.handleRemindDays - data.result.closingRemindDaysDefault = data.result.licenseType.closingRemindDays + data.result.auditLog = auditLog; + data.result.organization = organization; + data.result.handleRemindDaysDefault = + data.result.licenseType.handleRemindDays; + data.result.closingRemindDaysDefault = + data.result.licenseType.closingRemindDays; } if (item.auditType == 2 || item.auditType == 3) { - data.result.auditLogId = item.id + data.result.auditLogId = item.id; } - resolve(data.result) - }) - }) + resolve(data.result); + }); + }); } - } diff --git a/src/app/pages/equipment-info/equipment-info.component.ts b/src/app/pages/equipment-info/equipment-info.component.ts index 12ebec7..d5e2407 100644 --- a/src/app/pages/equipment-info/equipment-info.component.ts +++ b/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) .subscribe((data) => { resolve(data); - this.message.create("success", "创建成功!"); + this.message.create("success", "创建成功!"); return true; }); }); } else { - this.message.create("warning", "请填写完整!"); + this.message.create("warning", "请填写完整!"); return false; } }, @@ -156,12 +156,12 @@ export class EquipmentInfoComponent implements OnInit { .put("/api/services/app/FireEquipment/Update", body) .subscribe((data) => { resolve(data); - this.message.create("success", "修改成功!"); + this.message.create("success", "修改成功!"); return true; }); }); } else { - this.message.create("warning", "请填写完整!"); + this.message.create("warning", "请填写完整!"); return false; } }, @@ -182,7 +182,7 @@ export class EquipmentInfoComponent implements OnInit { }, }) .subscribe((data) => { - this.message.create("success", "删除成功!"); + this.message.create("success", "删除成功!"); this.getEquipment(); }); }, diff --git a/src/app/pages/home-page-nologin/home-page-nologin.component.html b/src/app/pages/home-page-nologin/home-page-nologin.component.html index 2178e10..9d87bfd 100644 --- a/src/app/pages/home-page-nologin/home-page-nologin.component.html +++ b/src/app/pages/home-page-nologin/home-page-nologin.component.html @@ -17,7 +17,7 @@
  • - 您有一条新的预警信息!{{item.notification.data.violationName}} + 您有一条新的预警信息!{{item.notification.data.violationName}}
    查看 diff --git a/src/app/pages/home-page-nologin/home-page-nologin.component.ts b/src/app/pages/home-page-nologin/home-page-nologin.component.ts index ae553b2..3fd4c4a 100644 --- a/src/app/pages/home-page-nologin/home-page-nologin.component.ts +++ b/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) => { let body = { id: item.notification.entityId, - handleRecord: '报废成功!' + handleRecord: '报废成功!' } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '报废成功!'); + this.message.create('success', '报废成功!'); copydata.handleTime = new Date() return true }) @@ -848,18 +848,18 @@ export class HomePageNologinComponent implements OnInit { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { let body = { id: item.notification.entityId, - handleRecord: '维保成功!' + handleRecord: '维保成功!' } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '维保成功!'); + this.message.create('success', '维保成功!'); copydata.handleTime = new Date() return true }) }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } diff --git a/src/app/pages/home-page/home-page.component.html b/src/app/pages/home-page/home-page.component.html index ce0072e..af3177a 100644 --- a/src/app/pages/home-page/home-page.component.html +++ b/src/app/pages/home-page/home-page.component.html @@ -18,7 +18,7 @@
  • - 您有一条新的预警信息!{{item.notification.data.violationName}} + 您有一条新的预警信息!{{item.notification.data.violationName}}
    查看 diff --git a/src/app/pages/home-page/home-page.component.ts b/src/app/pages/home-page/home-page.component.ts index d8456a0..b46944b 100644 --- a/src/app/pages/home-page/home-page.component.ts +++ b/src/app/pages/home-page/home-page.component.ts @@ -1013,7 +1013,7 @@ export class HomePageComponent implements OnInit { .subscribe((data: any) => { let body = { id: item.notification.entityId, - handleRecord: "报废成功!", + handleRecord: "报废成功!", }; this.http .post( @@ -1022,7 +1022,7 @@ export class HomePageComponent implements OnInit { ) .subscribe((data) => { resolve(data); - this.message.create("success", "报废成功!"); + this.message.create("success", "报废成功!"); copydata.handleTime = new Date(); return true; }); @@ -1052,7 +1052,7 @@ export class HomePageComponent implements OnInit { .subscribe((data: any) => { let body = { id: item.notification.entityId, - handleRecord: "维保成功!", + handleRecord: "维保成功!", }; this.http .post( @@ -1061,14 +1061,14 @@ export class HomePageComponent implements OnInit { ) .subscribe((data) => { resolve(data); - this.message.create("success", "维保成功!"); + this.message.create("success", "维保成功!"); copydata.handleTime = new Date(); return true; }); }); }); } else { - this.message.create("warning", "请填写完整!"); + this.message.create("warning", "请填写完整!"); return false; } } diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts index b0d9102..30253ca 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/pages/home/home.component.ts @@ -314,12 +314,12 @@ export class HomeComponent implements OnInit { this.passwordValidateForm.value.newpassword != this.passwordValidateForm.value.affirmpassword ) { - this.message.create("warning", "两次密码输入不一致!"); + this.message.create("warning", "两次密码输入不一致!"); } else if ( this.passwordValidateForm.value.newpassword == this.passwordValidateForm.value.oldpassword ) { - this.message.create("warning", "旧密码和新密码不能相同!"); + this.message.create("warning", "旧密码和新密码不能相同!"); } else { this.isConfirmLoading = true; let body = { @@ -328,7 +328,7 @@ export class HomeComponent implements OnInit { }; this.http.post("/api/services/app/User/ChangePassword", body).subscribe( (data) => { - this.message.create("success", "修改成功!"); + this.message.create("success", "修改成功!"); this.isConfirmLoading = false; this.isVisible = false; //清除sessionStorage @@ -453,7 +453,7 @@ export class HomeComponent implements OnInit { .subscribe((data: any) => { let body = { id: copydata.id, - handleRecord: "报废成功!", + handleRecord: "报废成功!", }; this.http .post( @@ -462,7 +462,7 @@ export class HomeComponent implements OnInit { ) .subscribe((data) => { resolve(data); - this.message.create("success", "报废成功!"); + this.message.create("success", "报废成功!"); copydata.handleTime = new Date(); if (this.router.url.indexOf("todaywarning") != -1) { let obj = { @@ -500,7 +500,7 @@ export class HomeComponent implements OnInit { .subscribe((data: any) => { let body = { id: copydata.id, - handleRecord: "维保成功!", + handleRecord: "维保成功!", }; this.http .post( @@ -509,7 +509,7 @@ export class HomeComponent implements OnInit { ) .subscribe((data) => { resolve(data); - this.message.create("success", "维保成功!"); + this.message.create("success", "维保成功!"); copydata.handleTime = new Date(); if ( this.router.url.indexOf("todaywarning") != -1 @@ -525,7 +525,7 @@ export class HomeComponent implements OnInit { }); }); } else { - this.message.create("warning", "请填写完整!"); + this.message.create("warning", "请填写完整!"); return false; } } @@ -748,7 +748,7 @@ export class HomeComponent implements OnInit { instance.validateForm.value.newpassword != instance.validateForm.value.affirmpassword ) { - this.message.create("warning", "两次密码输入不一致!"); + this.message.create("warning", "两次密码输入不一致!"); return false; } if (word.indexOf("sino") != -1 || word.indexOf("zhonghua") != -1) { @@ -768,7 +768,7 @@ export class HomeComponent implements OnInit { .subscribe( (data) => { resolve(data); - this.message.create("success", "修改成功!"); + this.message.create("success", "修改成功!"); return true; }, (err) => { @@ -780,7 +780,7 @@ export class HomeComponent implements OnInit { }); } } else { - this.message.create("warning", "请填写完整!"); + this.message.create("warning", "请填写完整!"); return false; } }, diff --git a/src/app/pages/left-domain/left-domain.component.ts b/src/app/pages/left-domain/left-domain.component.ts index 34d524f..253ca90 100644 --- a/src/app/pages/left-domain/left-domain.component.ts +++ b/src/app/pages/left-domain/left-domain.component.ts @@ -411,7 +411,7 @@ export class LeftDomainComponent implements OnInit { if (!this.validateForm3.valid) { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return } @@ -513,7 +513,7 @@ export class LeftDomainComponent implements OnInit { saveDisposalNode() { if (!this.validateForm2.valid) { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return } let e = this.validateForm2.value @@ -565,9 +565,9 @@ export class LeftDomainComponent implements OnInit { document.body.appendChild(link); link.click(); document.body.removeChild(link); - this.message.create('success', '导出成功!'); + this.message.create('success', '导出成功!'); }, err => { - this.message.create('error', '导出失败!'); + this.message.create('error', '导出失败!'); }) } diff --git a/src/app/pages/license/file-category/details-file-category/details-file-category.component.ts b/src/app/pages/license/file-category/details-file-category/details-file-category.component.ts index 2161bd7..5be5d05 100644 --- a/src/app/pages/license/file-category/details-file-category/details-file-category.component.ts +++ b/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 { NzModalRef } from 'ng-zorro-antd/modal'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { HttpClient } from '@angular/common/http'; -import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service'; -import Viewer from 'viewerjs'; -import { NzMessageService } from 'ng-zorro-antd/message'; +import { Component, OnInit, Input, ViewContainerRef } from "@angular/core"; +import { NzModalRef, NzModalService } from "ng-zorro-antd/modal"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { HttpClient } from "@angular/common/http"; +import { ObjectsSimpleService } from "src/app/service/objectsSimple.service"; +import Viewer from "viewerjs"; +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({ - selector: 'app-details-file-category', - templateUrl: './details-file-category.component.html', - styleUrls: ['./details-file-category.component.scss'] + selector: "app-details-file-category", + templateUrl: "./details-file-category.component.html", + styleUrls: ["./details-file-category.component.scss"], }) export class DetailsFileCategoryComponent implements OnInit { - @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 { - this.getAuditLogging() + this.getAuditLogging(); } auditList: any[] = []; //获取审核记录 getAuditLogging() { if (!this.data.auditLogId) { - return + return; } - let params = { id: this.data.auditLogId } - this.http.get(`/api/services/app/ContentAuditLog/Get`,{params}).subscribe((data: any)=>{ - this.auditList = data.result.actionList || [] - console.log(this.auditList) - }) + let params = { id: this.data.auditLogId }; + this.http + .get(`/api/services/app/ContentAuditLog/Get`, { params }) + .subscribe((data: any) => { + this.auditList = data.result.actionList || []; + console.log(this.auditList); + }); } //获取审核次数 getVerifyNum(): number { - let num = 0 - this.auditList.forEach(item=>{ + let num = 0; + this.auditList.forEach((item) => { if (item.auditStatus == 2 || item.auditStatus == 3) { - num = num + 1 + num = num + 1; } - }) - return num + }); + return num; } //获取驳回次数 getRejectNum(): number { - let num = 0 - this.auditList.forEach(item=>{ + let num = 0; + this.auditList.forEach((item) => { if (item.auditStatus == 3) { - num = num + 1 + num = num + 1; } - }) - return num + }); + return num; } 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' + 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 suffix + return type; } - //查看图片 viewImg(url) { - let dom = document.getElementById(`viewerjs`) + let dom = document.getElementById(`viewerjs`); let pObjs = dom.childNodes; - let node = document.createElement("img") + let node = document.createElement("img"); node.style.display = "none"; node.src = url; - node.id = 'img' - dom.appendChild(node) + node.id = "img"; + dom.appendChild(node); setTimeout(() => { let viewer = new Viewer(document.getElementById(`viewerjs`), { hidden: () => { dom.removeChild(pObjs[0]); viewer.destroy(); - } + }, }); node.click(); }, 0); @@ -95,17 +115,40 @@ export class DetailsFileCategoryComponent implements OnInit { //查看文件 lookFile(item) { if (!item.imageUrl) { - return + return; } - if (this.getFileType(item.imageUrl) == 'word') { - let arr = item.imageUrl.split('.') - arr[arr.length - 1] = 'pdf' - window.open(arr.join('.')) - } else if (this.getFileType(item.imageUrl) == 'pdf') { - window.open(item.imageUrl) + if (this.pubilcMethods.getFileType(item.imageUrl) == "word") { + let arr = item.imageUrl.split("."); + arr[arr.length - 1] = "pdf"; + window.open(arr.join(".")); + } else if (this.pubilcMethods.getFileType(item.imageUrl) == "pdf") { + 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 { - this.message.create('warning', '暂不支持查看!'); + this.message.create("warning", "暂不支持查看!"); + window.open(window.location.origin + item.imageUrl); } } - } diff --git a/src/app/pages/license/file-category/edit-file-category/edit-file-category.component.ts b/src/app/pages/license/file-category/edit-file-category/edit-file-category.component.ts index 1d6cde1..58bc3de 100644 --- a/src/app/pages/license/file-category/edit-file-category/edit-file-category.component.ts +++ b/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 { NzModalRef } from 'ng-zorro-antd/modal'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { HttpClient } from '@angular/common/http'; -import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service'; -import Viewer from 'viewerjs'; -import { NzMessageService } from 'ng-zorro-antd/message'; +import { Component, OnInit, Input, ViewContainerRef } from "@angular/core"; +import { NzModalRef, NzModalService } from "ng-zorro-antd/modal"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { ObjectsSimpleService } from "src/app/service/objectsSimple.service"; +import Viewer from "viewerjs"; +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({ - selector: 'app-edit-file-category', - templateUrl: './edit-file-category.component.html', - styleUrls: ['./edit-file-category.component.scss'] + selector: "app-edit-file-category", + templateUrl: "./edit-file-category.component.html", + styleUrls: ["./edit-file-category.component.scss"], }) export class EditFileCategoryComponent implements OnInit { - @Input() data?: any; validateForm!: FormGroup; - constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private objectsSrv: ObjectsSimpleService,private message: NzMessageService) { } - - - data2 + constructor( + private modal: NzModalRef, + private fb: FormBuilder, + private objectsSrv: ObjectsSimpleService, + private message: NzMessageService, + private pubilcMethods: PublicMethodsService, + private viewContainerRef: ViewContainerRef, + private modalChild: NzModalService + ) {} + + data2; ngOnInit(): void { this.validateForm = this.fb.group({ type: [null, [Validators.required]], - remark: [null] + remark: [null], }); - this.data2 = JSON.parse(JSON.stringify(this.data)) - this.validatyType = (this.data2.validatyType).toString() - console.log(this.data2) + this.data2 = JSON.parse(JSON.stringify(this.data)); + this.validatyType = this.data2.validatyType.toString(); + console.log(this.data2); } - validatyType: string - isLongTerm = false - imageUrl = '/api/Objects/sinochemweb/stationPhotos/175/timg.jpg' + validatyType: string; + isLongTerm = false; + imageUrl = "/api/Objects/sinochemweb/stationPhotos/175/timg.jpg"; validityChange($event) { - this.isLongTerm = $event + this.isLongTerm = $event; } destroyModal() { - this.modal.destroy({ data: 'this the result data' }); + this.modal.destroy({ data: "this the result data" }); } isSubmit: boolean = false; @@ -47,93 +54,105 @@ export class EditFileCategoryComponent implements OnInit { } //提交审核 - submitReview(){ + submitReview() { this.isSubmit = true; this.modal.triggerOk(); } - - - isLoadingSave: boolean = false - uploadIndex: string + isLoadingSave: boolean = false; + uploadIndex: string; filechange(e) { - this.isLoadingSave = true - let oilStationId = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id - let file = e.target.files[0] || null //获取上传的文件 - this.openFileSelect(file, `stationPhotos/${oilStationId}/`) + this.isLoadingSave = true; + let oilStationId = JSON.parse( + sessionStorage.getItem("userdataOfgasstation") + ).organization.id; + let file = e.target.files[0] || null; //获取上传的文件 + this.openFileSelect(file, `stationPhotos/${oilStationId}/`); } //设置文件路径并上传 - postFilePath + postFilePath; async openFileSelect(file: File, extensionPath: string) { this.postFilePath = extensionPath; - let fileSize = file.size || null //上传文件的总大小 - let shardSize = 5 * 1024 * 1024 //5MB 超过5MB要分块上传 - if (fileSize >= shardSize) // 超过5MB要分块上传 - { + let fileSize = file.size || null; //上传文件的总大小 + let shardSize = 5 * 1024 * 1024; //5MB 超过5MB要分块上传 + if (fileSize >= shardSize) { + // 超过5MB要分块上传 await this.postFileByMul(file); - } - else //普通上传 - { + } //普通上传 + else { await this.postFile(file); } } //上传文件 async postFile(file: File) { 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 filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName; - this.imageUrl = filePath - this.data2.imageUrl = filePath - this.isLoadingSave = false - resolve('success') + let filePath: string = + ObjectsSimpleService.baseUrl + dataObj.objectName; + this.imageUrl = filePath; + this.data2.imageUrl = filePath; + this.isLoadingSave = false; + resolve("success"); }); - }) + }); } /** * 分块上传 - * @param file + * @param file */ postFileByMul(file: File) { - this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => { - let dataObj = value as any; - let filePath = dataObj.filePath - this.imageUrl = filePath - this.data2.imageUrl = filePath - this.isLoadingSave = false - }); - + this.objectsSrv + .postFile_MultipartUpload(this.postFilePath, file) + .then((value) => { + let dataObj = value as any; + let filePath = dataObj.filePath; + this.imageUrl = filePath; + this.data2.imageUrl = filePath; + this.isLoadingSave = false; + }); } - //获取文件格式 - 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' + 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 suffix + return type; } //查看图片 viewImg(url) { - let dom = document.getElementById(`viewerjs`) + let dom = document.getElementById(`viewerjs`); let pObjs = dom.childNodes; - let node = document.createElement("img") + let node = document.createElement("img"); node.style.display = "none"; node.src = url; - node.id = 'img' - dom.appendChild(node) + node.id = "img"; + dom.appendChild(node); setTimeout(() => { let viewer = new Viewer(document.getElementById(`viewerjs`), { hidden: () => { dom.removeChild(pObjs[0]); viewer.destroy(); - } + }, }); node.click(); }, 0); @@ -142,17 +161,40 @@ export class EditFileCategoryComponent implements OnInit { //查看文件 lookFile(item) { if (!item.imageUrl) { - return + return; } - if (this.getFileType(item.imageUrl) == 'word') { - let arr = item.imageUrl.split('.') - arr[arr.length - 1] = 'pdf' - window.open(arr.join('.')) - } else if (this.getFileType(item.imageUrl) == 'pdf') { - window.open(item.imageUrl) + if (this.pubilcMethods.getFileType(item.imageUrl) == "word") { + let arr = item.imageUrl.split("."); + arr[arr.length - 1] = "pdf"; + window.open(arr.join(".")); + } else if (this.pubilcMethods.getFileType(item.imageUrl) == "pdf") { + 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 { - this.message.create('warning', '暂不支持查看!'); + this.message.create("warning", "暂不支持查看!"); + window.open(window.location.origin + item.imageUrl); } } - } diff --git a/src/app/pages/license/file-category/file-category.component.ts b/src/app/pages/license/file-category/file-category.component.ts index 4ec6351..8b23525 100644 --- a/src/app/pages/license/file-category/file-category.component.ts +++ b/src/app/pages/license/file-category/file-category.component.ts @@ -1,84 +1,82 @@ -import { Component, OnInit, ViewContainerRef } from '@angular/core'; -import { NzModalService } from 'ng-zorro-antd/modal'; -import { Observable, fromEvent } from 'rxjs'; -import { debounceTime } from 'rxjs/operators'; -import Viewer from 'viewerjs'; -import * as moment from 'moment'; -import { NzMessageService } from 'ng-zorro-antd/message'; -import { HttpClient } from '@angular/common/http'; -import { EditFileCategoryComponent } from './edit-file-category/edit-file-category.component'; -import { DetailsFileCategoryComponent } from './details-file-category/details-file-category.component'; +import { Component, OnInit, ViewContainerRef } from "@angular/core"; +import { NzModalService } from "ng-zorro-antd/modal"; +import { fromEvent } from "rxjs"; +import { debounceTime } from "rxjs/operators"; +import Viewer from "viewerjs"; +import { NzMessageService } from "ng-zorro-antd/message"; +import { HttpClient } from "@angular/common/http"; +import { EditFileCategoryComponent } from "./edit-file-category/edit-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({ - selector: 'app-file-category', - templateUrl: './file-category.component.html', - styleUrls: ['./file-category.component.scss'] + selector: "app-file-category", + templateUrl: "./file-category.component.html", + styleUrls: ["./file-category.component.scss"], }) export class FileCategoryComponent implements OnInit { - - constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient) { } - tableSpin = false + constructor( + private modal: NzModalService, + private viewContainerRef: ViewContainerRef, + private message: NzMessageService, + private http: HttpClient, + private pubilcMethods: PublicMethodsService, + private modalChild: NzModalService + ) {} + tableSpin = false; list = []; //tabelData - tableScrollHeight - resizeListener + tableScrollHeight; + resizeListener; ngOnInit(): void { setTimeout(() => { - this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px' + this.tableScrollHeight = + document.getElementById("tablebox").clientHeight - 42 + "px"; }, 0); // 页面监听 - this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => { - this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px' - }); - this.getStationList() + this.resizeListener = fromEvent(window, "resize") + .pipe(debounceTime(100)) + .subscribe((event) => { + this.tableScrollHeight = + document.getElementById("tablebox").clientHeight - 42 + "px"; + }); + this.getStationList(); } ngOnDestroy(): void { - this.resizeListener.unsubscribe() + this.resizeListener.unsubscribe(); } - - //获取当前油站档案类证照 getStationList() { - this.tableSpin = true - let data = JSON.parse(sessionStorage.getItem('userdataOfgasstation')); - let params = { orgId: data.organization.id || "" } - this.http.get(`/api/services/app/StationFileLicense/GetStationList`, { params }).subscribe((info: any) => { - 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 + this.tableSpin = true; + let data = JSON.parse(sessionStorage.getItem("userdataOfgasstation")); + let params = { orgId: data.organization.id || "" }; + this.http + .get(`/api/services/app/StationFileLicense/GetStationList`, { params }) + .subscribe((info: any) => { + this.list = info.result; + this.tableSpin = false; + console.log(info.result); + }); } //查看图片 viewImg(url) { - let dom = document.getElementById(`viewerjs`) + let dom = document.getElementById(`viewerjs`); let pObjs = dom.childNodes; - let node = document.createElement("img") + let node = document.createElement("img"); node.style.display = "none"; node.src = url; - node.id = 'img' - dom.appendChild(node) + node.id = "img"; + dom.appendChild(node); setTimeout(() => { let viewer = new Viewer(document.getElementById(`viewerjs`), { hidden: () => { dom.removeChild(pObjs[0]); viewer.destroy(); - } + }, }); node.click(); }, 0); @@ -87,79 +85,115 @@ export class FileCategoryComponent implements OnInit { //查看文件 lookFile(item) { if (!item.imageUrl) { - return + return; } - if (this.getFileType(item.imageUrl) == 'word') { - let arr = item.imageUrl.split('.') - arr[arr.length - 1] = 'pdf' - window.open(arr.join('.')) - } else if (this.getFileType(item.imageUrl) == 'pdf') { - window.open(item.imageUrl) + if (this.pubilcMethods.getFileType(item.imageUrl) == "word") { + let arr = item.imageUrl.split("."); + arr[arr.length - 1] = "pdf"; + window.open(arr.join(".")); + } else if (this.pubilcMethods.getFileType(item.imageUrl) == "pdf") { + 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 { - this.message.create('warning', '暂不支持查看!'); + this.message.create("warning", "暂不支持查看!"); + window.open(window.location.origin + item.imageUrl); } } - dispose() { - - } + dispose() {} edit(item) { if (item.auditStatus === 1) { - this.message.create('warning', '审核中不允许编辑!'); - return + this.message.create("warning", "审核中不允许编辑!"); + return; } const modal = this.modal.create({ nzContent: EditFileCategoryComponent, nzViewContainerRef: this.viewContainerRef, nzWidth: 750, nzBodyStyle: { - 'border': '1px solid #91CCFF', - 'border-radius': '0px', - 'padding': '7px', - 'box-shadow': '0 0 8px 0 #fff', - 'background-image': 'linear-gradient(#003665, #000f25)' + border: "1px solid #91CCFF", + "border-radius": "0px", + padding: "7px", + "box-shadow": "0 0 8px 0 #fff", + "background-image": "linear-gradient(#003665, #000f25)", }, nzComponentParams: { - data: item + data: item, }, nzFooter: null, nzClosable: false, nzOnOk: async () => { - if (instance.validatyType == '2' && !instance.data2.imageUrl) { - this.message.create('warning', '请上传附件!'); + if (instance.validatyType == "2" && !instance.data2.imageUrl) { + this.message.create("warning", "请上传附件!"); return false; } - if (instance.validatyType != '2' && !instance.data2.remark) { - this.message.create('warning', '请填写说明!'); + if (instance.validatyType != "2" && !instance.data2.remark) { + this.message.create("warning", "请填写说明!"); return false; } - instance.data2.validatyType = Number(instance.validatyType) - if (instance.data2.imageUrl && instance.data2.imageUrl.indexOf('http') == -1) { - let newUrl = window.location.protocol + '//' + window.location.host + instance.data2.imageUrl - instance.data2.imageUrl = newUrl + instance.data2.validatyType = Number(instance.validatyType); + if ( + instance.data2.imageUrl && + instance.data2.imageUrl.indexOf("http") == -1 + ) { + let newUrl = + window.location.protocol + + "//" + + window.location.host + + instance.data2.imageUrl; + instance.data2.imageUrl = newUrl; } if (!instance.isSubmit) { - this.http.post('/api/services/app/StationFileLicense/Create', instance.data2).subscribe((data: any) => { - this.getStationList(); - this.message.create('success', '修改成功!'); - }) + this.http + .post("/api/services/app/StationFileLicense/Create", instance.data2) + .subscribe((data: any) => { + this.getStationList(); + this.message.create("success", "修改成功!"); + }); return true; } else { - await new Promise(resolve => { - this.http.post('/api/services/app/StationFileLicense/Create', instance.data2).subscribe((data: any) => { - this.submitReview(data.result).then(res => { - resolve(data); - return true; + await new Promise((resolve) => { + this.http + .post( + "/api/services/app/StationFileLicense/Create", + instance.data2 + ) + .subscribe((data: any) => { + this.submitReview(data.result).then((res) => { + resolve(data); + return true; + }); }); - }) - }) + }); } - } + }, }); const instance = modal.getContentComponent(); - modal.afterClose.subscribe(result => { }); + modal.afterClose.subscribe((result) => {}); } details(item) { const modal = this.modal.create({ @@ -167,48 +201,73 @@ export class FileCategoryComponent implements OnInit { nzViewContainerRef: this.viewContainerRef, nzWidth: 450, nzBodyStyle: { - 'border': '1px solid #91CCFF', - 'border-radius': '0px', - 'padding': '7px', - 'box-shadow': '0 0 8px 0 #fff', - 'background-image': 'linear-gradient(#003665, #000f25)' + border: "1px solid #91CCFF", + "border-radius": "0px", + padding: "7px", + "box-shadow": "0 0 8px 0 #fff", + "background-image": "linear-gradient(#003665, #000f25)", }, nzComponentParams: { - data: item + data: item, }, nzFooter: null, nzClosable: false, - nzOnOk: async () => { - - } + nzOnOk: async () => {}, }); const instance = modal.getContentComponent(); - modal.afterClose.subscribe(result => { }); + modal.afterClose.subscribe((result) => {}); } //提交审核 submitReview(item) { if (!item.id) { - this.message.create('warning', '该证照请编辑保存后再提交审核!'); - return + this.message.create("warning", "该证照请编辑保存后再提交审核!"); + return; } return new Promise((resolve, reject) => { - let params = { id: item.id } - this.http.post('/api/services/app/StationFileLicense/Commit', {}, { params }).subscribe(data => { - this.message.create('success', '提交审核成功!'); - this.getStationList(); - resolve('success'); - }) - }) + let params = { id: item.id }; + this.http + .post("/api/services/app/StationFileLicense/Commit", {}, { params }) + .subscribe((data) => { + this.message.create("success", "提交审核成功!"); + this.getStationList(); + resolve("success"); + }); + }); } //撤销审核 cancelReview(item) { - let params = { id: item.id } - this.http.post('/api/services/app/StationFileLicense/Uncommit', {}, { params }).subscribe(data => { - this.message.create('success', '撤销审核成功!'); - this.getStationList(); - }) + let params = { id: item.id }; + this.http + .post("/api/services/app/StationFileLicense/Uncommit", {}, { params }) + .subscribe((data) => { + this.message.create("success", "撤销审核成功!"); + 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; } - } diff --git a/src/app/pages/license/update-category/details-update-category/details-update-category.component.ts b/src/app/pages/license/update-category/details-update-category/details-update-category.component.ts index 76ccfbb..b16fc65 100644 --- a/src/app/pages/license/update-category/details-update-category/details-update-category.component.ts +++ b/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 { NzModalRef } from 'ng-zorro-antd/modal'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { HttpClient } from '@angular/common/http'; -import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service'; -import Viewer from 'viewerjs'; -import { NzMessageService } from 'ng-zorro-antd/message'; -import { handleType, handleTypeList } from '../edit-update-category/edit-update-category.component'; +import { Component, OnInit, Input, ViewContainerRef } from "@angular/core"; +import { NzModalRef, NzModalService } from "ng-zorro-antd/modal"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { HttpClient } from "@angular/common/http"; +import { ObjectsSimpleService } from "src/app/service/objectsSimple.service"; +import Viewer from "viewerjs"; +import { NzMessageService } from "ng-zorro-antd/message"; +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({ - selector: 'app-details-update-category', - templateUrl: './details-update-category.component.html', - styleUrls: ['./details-update-category.component.scss'] + selector: "app-details-update-category", + templateUrl: "./details-update-category.component.html", + styleUrls: ["./details-update-category.component.scss"], }) export class DetailsUpdateCategoryComponent implements OnInit { @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 { - this.getAuditLogging() + this.getAuditLogging(); } auditList: any[] = []; //获取审核记录 getAuditLogging() { if (!this.data.auditLogId) { - return + return; } - let params = { id: this.data.auditLogId } - this.http.get(`/api/services/app/ContentAuditLog/Get`,{params}).subscribe((data: any)=>{ - this.auditList = data.result.actionList || [] - console.log(this.auditList) - }) + let params = { id: this.data.auditLogId }; + this.http + .get(`/api/services/app/ContentAuditLog/Get`, { params }) + .subscribe((data: any) => { + this.auditList = data.result.actionList || []; + console.log(this.auditList); + }); } //获取审核次数 getVerifyNum(): number { - let num = 0 - this.auditList.forEach(item=>{ + let num = 0; + this.auditList.forEach((item) => { if (item.auditStatus == 2 || item.auditStatus == 3) { - num = num + 1 + num = num + 1; } - }) - return num + }); + return num; } //获取驳回次数 getRejectNum(): number { - let num = 0 - this.auditList.forEach(item=>{ + let num = 0; + this.auditList.forEach((item) => { if (item.auditStatus == 3) { - num = num + 1 + num = num + 1; } - }) - return num + }); + return num; } 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) { - return + return; } - let names: string[] = [] + let names: string[] = []; let handleTypeList = JSON.parse(JSON.stringify(handleTypes)); let list: handleTypeList[] = new handleType().list; - handleTypeList.forEach(item=>{ - list.find(element=>{ - item == element.value? names.push(element.name) : null - }) - }) - return names.join(',') + handleTypeList.forEach((item) => { + list.find((element) => { + item == element.value ? names.push(element.name) : null; + }); + }); + return names.join(","); } //获取文件格式 - 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' + 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 suffix + return type; } - - //查看文件 - lookFile(item) { + //查看文件 + lookFile(item) { if (!item) { - return + return; } - if (this.getFileType(item) == 'word') { - let arr = item.split('.') - arr[arr.length - 1] = 'pdf' - window.open(arr.join('.')) - } else if (this.getFileType(item) == 'pdf') { - window.open(item) + if (this.pubilcMethods.getFileType(item) == "word") { + let arr = item.split("."); + arr[arr.length - 1] = "pdf"; + window.open(arr.join(".")); + } else if (this.pubilcMethods.getFileType(item) == "pdf") { + 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 { - this.message.create('warning', '暂不支持查看!'); + this.message.create("warning", "暂不支持查看!"); + window.open(window.location.origin + item); } } //查看图片 viewImg(url) { - let dom = document.getElementById(`viewerjs`) + let dom = document.getElementById(`viewerjs`); let pObjs = dom.childNodes; - let node = document.createElement("img") + let node = document.createElement("img"); node.style.display = "none"; node.src = url; - node.id = 'img' - dom.appendChild(node) + node.id = "img"; + dom.appendChild(node); setTimeout(() => { let viewer = new Viewer(document.getElementById(`viewerjs`), { hidden: () => { dom.removeChild(pObjs[0]); viewer.destroy(); - } + }, }); node.click(); }, 0); } - } diff --git a/src/app/pages/license/update-category/edit-update-category/edit-update-category.component.ts b/src/app/pages/license/update-category/edit-update-category/edit-update-category.component.ts index 0a947d9..d85ac65 100644 --- a/src/app/pages/license/update-category/edit-update-category/edit-update-category.component.ts +++ b/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 { NzModalRef } from 'ng-zorro-antd/modal'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { HttpClient } from '@angular/common/http'; -import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service'; -import Viewer from 'viewerjs'; -import { NzMessageService } from 'ng-zorro-antd/message'; +import { Component, OnInit, Input, ViewContainerRef } from "@angular/core"; +import { NzModalRef, NzModalService } from "ng-zorro-antd/modal"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { ObjectsSimpleService } from "src/app/service/objectsSimple.service"; +import Viewer from "viewerjs"; +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({ - selector: 'app-edit-update-category', - templateUrl: './edit-update-category.component.html', - styleUrls: ['./edit-update-category.component.scss'] + selector: "app-edit-update-category", + templateUrl: "./edit-update-category.component.html", + styleUrls: ["./edit-update-category.component.scss"], }) export class EditUpdateCategoryComponent implements OnInit { - @Input() data?: any; 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; data2: any; //深拷贝data @@ -30,39 +38,45 @@ export class EditUpdateCategoryComponent implements OnInit { isLongTermTime: [null], isNoLongTermTime: [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) { - this.isLongTermTime = new Date(this.data2.validityStartTime) - if (this.isLongTermTime.getFullYear && this.isLongTermTime.getFullYear() < 1000) { - this.isLongTermTime = new Date() + this.isLongTermTime = new Date(this.data2.validityStartTime); + if ( + this.isLongTermTime.getFullYear && + this.isLongTermTime.getFullYear() < 1000 + ) { + this.isLongTermTime = new Date(); } } else { - this.isNoLongTermTime = [] - this.isNoLongTermTime.push(new Date(this.data2.validityStartTime)) - this.isNoLongTermTime.push(new Date(this.data2.validityEndTime)) - if (this.isNoLongTermTime.length && this.isNoLongTermTime.find(item => { return item.getFullYear() < 1000 })) { - this.isNoLongTermTime[0] = new Date() - this.isNoLongTermTime[1] = new Date() + this.isNoLongTermTime = []; + this.isNoLongTermTime.push(new Date(this.data2.validityStartTime)); + this.isNoLongTermTime.push(new Date(this.data2.validityEndTime)); + if ( + this.isNoLongTermTime.length && + this.isNoLongTermTime.find((item) => { + return item.getFullYear() < 1000; + }) + ) { + this.isNoLongTermTime[0] = new Date(); + this.isNoLongTermTime[1] = new Date(); } } - console.log(this.data2) - console.log(typeof(this.data2.lastLicenseAuditType)) + console.log(this.data2); + console.log(typeof this.data2.lastLicenseAuditType); } 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() { - this.modal.destroy({ data: 'this the result data' }); + this.modal.destroy({ data: "this the result data" }); } isSubmit: boolean = false; @@ -79,14 +93,16 @@ export class EditUpdateCategoryComponent implements OnInit { //check change validityChange($event) { - if ($event) { //长期 - this.data2.validityDays = 999 - } else { //限期 - let start = (new Date(this.isNoLongTermTime[0])).getTime(); - let end = (new Date(this.isNoLongTermTime[1])).getTime(); - let time = end - start + if ($event) { + //长期 + this.data2.validityDays = 999; + } else { + //限期 + let start = new Date(this.isNoLongTermTime[0]).getTime(); + let end = new Date(this.isNoLongTermTime[1]).getTime(); + let time = end - start; if (time <= 0) { - this.data2.validityDays = 0 + this.data2.validityDays = 0; } else { this.data2.validityDays = Math.floor(time / (1000 * 3600 * 24)); } @@ -96,152 +112,188 @@ export class EditUpdateCategoryComponent implements OnInit { //date change onChange(e) { if (!e) { - return + return; } if (e instanceof Array) { - let start = (new Date(e[0])).getTime(); - let end = (new Date(e[1])).getTime(); - let time = end - start + let start = new Date(e[0]).getTime(); + let end = new Date(e[1]).getTime(); + let time = end - start; if (time <= 0) { - this.data2.validityDays = 0 + this.data2.validityDays = 0; } else { this.data2.validityDays = Math.floor(time / (1000 * 3600 * 24)); } } else { - this.data2.validityDays = 999 + this.data2.validityDays = 999; } } //获取办理类型 getHandleTypes(handleTypes: any[]): string { if (!handleTypes || !handleTypes.length) { - return + return; } - let names: string[] = [] + let names: string[] = []; let handleTypeList = JSON.parse(JSON.stringify(handleTypes)); let list: handleTypeList[] = new handleType().list; - handleTypeList.forEach(item => { - list.find(element => { - item == element.value ? names.push(element.name) : null - }) - }) - return names.join(',') + handleTypeList.forEach((item) => { + list.find((element) => { + item == element.value ? names.push(element.name) : null; + }); + }); + return names.join(","); } - //获取文件格式 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' + 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 suffix + return type; } //查看文件 lookFile(item) { if (!item) { - return + return; } - if (this.getFileType(item) == 'word') { - let arr = item.split('.') - arr[arr.length - 1] = 'pdf' - window.open(arr.join('.')) - } else if (this.getFileType(item) == 'pdf') { - window.open(item) + if (this.pubilcMethods.getFileType(item) == "word") { + let arr = item.split("."); + arr[arr.length - 1] = "pdf"; + window.open(arr.join(".")); + } else if (this.pubilcMethods.getFileType(item) == "pdf") { + 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 { - this.message.create('warning', '暂不支持查看!'); + this.message.create("warning", "暂不支持查看!"); + window.open(window.location.origin + item); } } - uploadType: number; //是否是上传副本 - isLoadingSave: boolean = false - uploadIndex: string + isLoadingSave: boolean = false; + uploadIndex: string; filechange(e, type: number) { - this.uploadType = type - this.isLoadingSave = true - let oilStationId = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id - let file = e.target.files[0] || null //获取上传的文件 - this.openFileSelect(file, `stationPhotos/${oilStationId}/`) + this.uploadType = type; + this.isLoadingSave = true; + let oilStationId = JSON.parse( + sessionStorage.getItem("userdataOfgasstation") + ).organization.id; + let file = e.target.files[0] || null; //获取上传的文件 + this.openFileSelect(file, `stationPhotos/${oilStationId}/`); } //设置文件路径并上传 - postFilePath + postFilePath; async openFileSelect(file: File, extensionPath: string) { this.postFilePath = extensionPath; - let fileSize = file.size || null //上传文件的总大小 - let shardSize = 5 * 1024 * 1024 //5MB 超过5MB要分块上传 - if (fileSize >= shardSize) // 超过5MB要分块上传 - { + let fileSize = file.size || null; //上传文件的总大小 + let shardSize = 5 * 1024 * 1024; //5MB 超过5MB要分块上传 + if (fileSize >= shardSize) { + // 超过5MB要分块上传 await this.postFileByMul(file); - } - else //普通上传 - { + } //普通上传 + else { await this.postFile(file); } } //上传文件 async postFile(file: File) { 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 filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName; + let filePath: string = + ObjectsSimpleService.baseUrl + dataObj.objectName; if (this.uploadType === 0) { - this.data2.imageUrl = filePath + this.data2.imageUrl = filePath; } else if (this.uploadType === 1) { - this.data2.attachment = filePath + this.data2.attachment = filePath; } else if (this.uploadType === 2) { - this.data2.yearlyCheckAttachment = filePath + this.data2.yearlyCheckAttachment = filePath; } - this.isLoadingSave = false - resolve('success') + this.isLoadingSave = false; + resolve("success"); }); - }) + }); } /** * 分块上传 - * @param file + * @param file */ postFileByMul(file: File) { - this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => { - let dataObj = value as any; - let filePath = dataObj.filePath - if (this.uploadType === 0) { - this.data2.imageUrl = filePath - } else if (this.uploadType === 1) { - this.data2.attachment = filePath - } else if (this.uploadType === 2) { - this.data2.yearlyCheckAttachment = filePath - } - this.isLoadingSave = false - }); - + this.objectsSrv + .postFile_MultipartUpload(this.postFilePath, file) + .then((value) => { + let dataObj = value as any; + let filePath = dataObj.filePath; + if (this.uploadType === 0) { + this.data2.imageUrl = filePath; + } else if (this.uploadType === 1) { + this.data2.attachment = filePath; + } else if (this.uploadType === 2) { + this.data2.yearlyCheckAttachment = filePath; + } + this.isLoadingSave = false; + }); } //查看图片 viewImg(url) { - let dom = document.getElementById(`viewerjs`) + let dom = document.getElementById(`viewerjs`); let pObjs = dom.childNodes; - let node = document.createElement("img") + let node = document.createElement("img"); node.style.display = "none"; node.src = url; - node.id = 'img' - dom.appendChild(node) + node.id = "img"; + dom.appendChild(node); setTimeout(() => { let viewer = new Viewer(document.getElementById(`viewerjs`), { hidden: () => { dom.removeChild(pObjs[0]); viewer.destroy(); - } + }, }); node.click(); }, 0); } - } //办理类型 @@ -257,9 +309,9 @@ export class handleType { { value: 7, name: "年度检测" }, { value: 8, name: "到期备案" }, { value: 9, name: "到期评价" }, - ] + ]; } export class handleTypeList { - value: number - name: string -} \ No newline at end of file + value: number; + name: string; +} diff --git a/src/app/pages/license/update-category/update-category.component.ts b/src/app/pages/license/update-category/update-category.component.ts index 3e2f055..193fcc0 100644 --- a/src/app/pages/license/update-category/update-category.component.ts +++ b/src/app/pages/license/update-category/update-category.component.ts @@ -1,97 +1,126 @@ -import { Component, OnInit, ViewContainerRef } from '@angular/core'; -import { NzModalService } from 'ng-zorro-antd/modal'; -import { Observable, fromEvent } from 'rxjs'; -import { debounceTime } from 'rxjs/operators'; -import Viewer from 'viewerjs'; -import { EditUpdateCategoryComponent, handleType, handleTypeList } from './edit-update-category/edit-update-category.component'; -import * as moment from 'moment'; -import { NzMessageService } from 'ng-zorro-antd/message'; -import { HttpClient } from '@angular/common/http'; -import { DetailsUpdateCategoryComponent } from './details-update-category/details-update-category.component'; -import { PdfWordLookComponent } from '../pdf-word-look/pdf-word-look.component'; +import { Component, OnInit, ViewContainerRef } from "@angular/core"; +import { NzModalService } from "ng-zorro-antd/modal"; +import { fromEvent } from "rxjs"; +import { debounceTime } from "rxjs/operators"; +import Viewer from "viewerjs"; +import { + EditUpdateCategoryComponent, + handleType, + handleTypeList, +} from "./edit-update-category/edit-update-category.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({ - selector: 'app-update-category', - templateUrl: './update-category.component.html', - styleUrls: ['./update-category.component.scss'] + selector: "app-update-category", + templateUrl: "./update-category.component.html", + styleUrls: ["./update-category.component.scss"], }) 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) { } - tableSpin = false - list = [] - - tableScrollHeight - resizeListener + tableScrollHeight; + resizeListener; ngOnInit(): void { setTimeout(() => { - this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px' + this.tableScrollHeight = + document.getElementById("tablebox").clientHeight - 42 + "px"; }, 0); - + // 页面监听 - this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => { - this.tableScrollHeight = (document.getElementById('tablebox').clientHeight - 42) + 'px' - }); - this.getStationList() + this.resizeListener = fromEvent(window, "resize") + .pipe(debounceTime(100)) + .subscribe((event) => { + this.tableScrollHeight = + document.getElementById("tablebox").clientHeight - 42 + "px"; + }); + this.getStationList(); } ngOnDestroy(): void { - this.resizeListener.unsubscribe() + this.resizeListener.unsubscribe(); } //获取当前油站档案类证照 getStationList() { - this.tableSpin = true - let data = JSON.parse(sessionStorage.getItem('userdataOfgasstation')); - let params = { orgId: data.organization.id || "" } - this.http.get(`/api/services/app/StationValidityLicense/GetCurStationLicense`, { params }).subscribe((info: any) => { - this.list = info.result - this.tableSpin = false - console.log(info.result) - }) + this.tableSpin = true; + let data = JSON.parse(sessionStorage.getItem("userdataOfgasstation")); + let params = { orgId: data.organization.id || "" }; + this.http + .get(`/api/services/app/StationValidityLicense/GetCurStationLicense`, { + params, + }) + .subscribe((info: any) => { + this.list = info.result; + this.tableSpin = false; + console.log(info.result); + }); } //获取办理类型 getHandleTypes(handleTypes: any[]): string { if (!handleTypes || !handleTypes.length) { - return + return; } - let names: string[] = [] + let names: string[] = []; let handleTypeList = JSON.parse(JSON.stringify(handleTypes)); let list: handleTypeList[] = new handleType().list; - handleTypeList.forEach(item => { - list.find(element => { - item == element.value ? names.push(element.name) : null - }) - }) - return names.join(',') + handleTypeList.forEach((item) => { + list.find((element) => { + item == element.value ? names.push(element.name) : null; + }); + }); + return names.join(","); } //获取文件格式 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' + 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 suffix + return type; } //查看图片 viewImg(url) { - let dom = document.getElementById(`viewerjs`) + let dom = document.getElementById(`viewerjs`); let pObjs = dom.childNodes; - let node = document.createElement("img") + let node = document.createElement("img"); node.style.display = "none"; node.src = url; - node.id = 'img' - dom.appendChild(node) + node.id = "img"; + dom.appendChild(node); setTimeout(() => { let viewer = new Viewer(document.getElementById(`viewerjs`), { hidden: () => { dom.removeChild(pObjs[0]); viewer.destroy(); - } + }, }); node.click(); }, 0); @@ -100,108 +129,150 @@ export class UpdateCategoryComponent implements OnInit { //查看文件 lookFile(item) { if (!item) { - return + return; } - if (this.getFileType(item) == 'word') { - let arr = item.split('.') - arr[arr.length - 1] = 'pdf' - window.open(arr.join('.')) - } else if (this.getFileType(item) == 'pdf') { - window.open(item) + if (this.pubilcMethods.getFileType(item) == "word") { + let arr = item.split("."); + arr[arr.length - 1] = "pdf"; + window.open(arr.join(".")); + } else if (this.pubilcMethods.getFileType(item) == "pdf") { + 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 { - this.message.create('warning', '暂不支持查看!'); + this.message.create("warning", "暂不支持查看!"); + window.open(window.location.origin + item); } } - dispose() { - - } + dispose() {} edit(item) { - console.log(item) + console.log(item); if (item.auditStatus === 1) { - this.message.create('warning', '审核中不允许编辑!'); - return + this.message.create("warning", "审核中不允许编辑!"); + return; } const modal = this.modal.create({ nzContent: EditUpdateCategoryComponent, nzViewContainerRef: this.viewContainerRef, nzWidth: 750, nzBodyStyle: { - 'border': '1px solid #91CCFF', - 'border-radius': '0px', - 'padding': '7px', - 'box-shadow': '0 0 8px 0 #fff', - 'background-image': 'linear-gradient(#003665, #000f25)' + border: "1px solid #91CCFF", + "border-radius": "0px", + padding: "7px", + "box-shadow": "0 0 8px 0 #fff", + "background-image": "linear-gradient(#003665, #000f25)", }, nzComponentParams: { - data: item + data: item, }, nzFooter: null, nzClosable: false, nzOnOk: async () => { if (!instance.data2.imageUrl) { - this.message.create('warning', '请上传附件!'); + this.message.create("warning", "请上传附件!"); return false; } if (instance.data2.hasAttachmentDefault && !instance.data2.attachment) { - this.message.create('warning', '请上传附件副本!'); + this.message.create("warning", "请上传附件副本!"); return false; } if (instance.validateForm.valid) { - let body = instance.data2 + let body = instance.data2; if (body.isLongTerm) { - body.validityStartTime = instance.isLongTermTime || new Date() - body.validityEndTime = '9999-01-01' + body.validityStartTime = instance.isLongTermTime || new Date(); + body.validityEndTime = "9999-01-01"; } else { - body.validityStartTime = instance.isNoLongTermTime[0] || new Date() - body.validityEndTime = instance.isNoLongTermTime[1] || new Date() + body.validityStartTime = instance.isNoLongTermTime[0] || new Date(); + body.validityEndTime = instance.isNoLongTermTime[1] || new Date(); } - if (body.imageUrl.indexOf('http') == -1) { - let newUrl = window.location.protocol + '//' + window.location.host + body.imageUrl - body.imageUrl = newUrl + if (body.imageUrl.indexOf("http") == -1) { + let newUrl = + window.location.protocol + + "//" + + window.location.host + + body.imageUrl; + 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.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) { - this.message.create('warning', '请填写年检更新说明!'); - return false + if ( + body.isYearlyCheck && + !body.yearlyCheckDescription && + body.lastLicenseAuditType == 1 + ) { + this.message.create("warning", "请填写年检更新说明!"); + return false; } if (body.lastLicenseAuditType == 0) { - body.yearlyCheckAttachment = null - body.yearlyCheckDescription = null + body.yearlyCheckAttachment = null; + body.yearlyCheckDescription = null; } if (!instance.isSubmit) { - this.http.post('/api/services/app/StationValidityLicense/Create', body).subscribe((data: any) => { - this.getStationList(); - this.message.create('success', '修改成功!'); - }) + this.http + .post("/api/services/app/StationValidityLicense/Create", body) + .subscribe((data: any) => { + this.getStationList(); + this.message.create("success", "修改成功!"); + }); return false; } else { - await new Promise(resolve => { - this.http.post('/api/services/app/StationValidityLicense/Create', body).subscribe((data: any) => { - this.submitReview(data.result).then(res => { - resolve(data); - return true; + await new Promise((resolve) => { + this.http + .post("/api/services/app/StationValidityLicense/Create", body) + .subscribe((data: any) => { + this.submitReview(data.result).then((res) => { + resolve(data); + return true; + }); }); - }) - }) + }); } // return false; } else { - this.message.create('warning', '请填写完整!'); + this.message.create("warning", "请填写完整!"); return false; } - } + }, }); const instance = modal.getContentComponent(); - modal.afterClose.subscribe(result => { }); + modal.afterClose.subscribe((result) => {}); } details(item) { @@ -210,51 +281,52 @@ export class UpdateCategoryComponent implements OnInit { nzViewContainerRef: this.viewContainerRef, nzWidth: 450, nzBodyStyle: { - 'border': '1px solid #91CCFF', - 'border-radius': '0px', - 'padding': '7px', - 'box-shadow': '0 0 8px 0 #fff', - 'background-image': 'linear-gradient(#003665, #000f25)' + border: "1px solid #91CCFF", + "border-radius": "0px", + padding: "7px", + "box-shadow": "0 0 8px 0 #fff", + "background-image": "linear-gradient(#003665, #000f25)", }, nzComponentParams: { - data: item + data: item, }, nzFooter: null, nzClosable: false, - nzOnOk: async () => { - - } + nzOnOk: async () => {}, }); const instance = modal.getContentComponent(); - modal.afterClose.subscribe(result => { }); + modal.afterClose.subscribe((result) => {}); } //提交审核 submitReview(item) { if (!item.id) { - this.message.create('warning', '该证照请编辑保存后再提交审核!'); - return + this.message.create("warning", "该证照请编辑保存后再提交审核!"); + return; } return new Promise((resolve, reject) => { let params: any = { id: item.id, - type: item.lastLicenseAuditType - } - this.http.post('/api/services/app/StationValidityLicense/Commit', {}, { params }).subscribe(data => { - this.message.create('success', '提交审核成功!'); - this.getStationList(); - resolve('success'); - }) - }) + type: item.lastLicenseAuditType, + }; + this.http + .post("/api/services/app/StationValidityLicense/Commit", {}, { params }) + .subscribe((data) => { + this.message.create("success", "提交审核成功!"); + this.getStationList(); + resolve("success"); + }); + }); } //撤销审核 cancelReview(item) { - let params = { id: item.id } - this.http.post('/api/services/app/StationValidityLicense/Uncommit', {}, { params }).subscribe(data => { - this.message.create('success', '撤销审核成功!'); - this.getStationList(); - }) + let params = { id: item.id }; + this.http + .post("/api/services/app/StationValidityLicense/Uncommit", {}, { params }) + .subscribe((data) => { + this.message.create("success", "撤销审核成功!"); + this.getStationList(); + }); } - } diff --git a/src/app/pages/login/forget/forget.component.ts b/src/app/pages/login/forget/forget.component.ts index 8a7f047..4d3f834 100644 --- a/src/app/pages/login/forget/forget.component.ts +++ b/src/app/pages/login/forget/forget.component.ts @@ -92,7 +92,7 @@ export class ForgetComponent implements OnInit { if (this.validateForm3.valid) { let word = JSON.parse(JSON.stringify(this.validateForm3.value.newpassword)).toLowerCase() if (this.validateForm3.value.newpassword != this.validateForm3.value.affirmpassword) { - this.message.create('warning', '两次密码输入不一致!'); + this.message.create('warning', '两次密码输入不一致!'); return false } if (word.indexOf('sino') != -1 || word.indexOf('zhonghua') != -1) { this.message.create('warning', '口令禁止包含 sinochem、sino、zhonghua (含大小写变体) 等中国中化相关字符'); @@ -105,7 +105,7 @@ export class ForgetComponent implements OnInit { newPassword: this.validateForm3.value.newpassword, } this.http.post('/api/services/app/User/ChangePasswordBySms', body).subscribe(data => { - this.message.create('success', '修改成功!'); + this.message.create('success', '修改成功!'); this.modal.close() return true }, err => { @@ -115,7 +115,7 @@ export class ForgetComponent implements OnInit { } } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } diff --git a/src/app/pages/oil-station-info/oil-station-info.component.ts b/src/app/pages/oil-station-info/oil-station-info.component.ts index 3f38c50..5d64bc3 100644 --- a/src/app/pages/oil-station-info/oil-station-info.component.ts +++ b/src/app/pages/oil-station-info/oil-station-info.component.ts @@ -116,9 +116,9 @@ export class OilStationInfoComponent implements OnInit { document.body.appendChild(link); link.click(); document.body.removeChild(link); - this.message.create('success', '导出成功!'); + this.message.create('success', '导出成功!'); }, 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) => { resolve(data) this.isLoadingSave = false - this.message.create('success', '保存成功!'); + this.message.create('success', '保存成功!'); }, err => { reject(err) this.isLoadingSave = false - this.message.create('error', '保存失败!'); + this.message.create('error', '保存失败!'); }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); 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.isSubmitAuditLoading = false this.getInfo() - this.message.create('success', '提交审核成功!'); + this.message.create('success', '提交审核成功!'); }, err => { 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.isRevocationAuditLoading = false this.getInfo() - this.message.create('success', '撤销审核成功!'); + this.message.create('success', '撤销审核成功!'); }, err => { this.isRevocationAuditLoading = false - this.message.create('error', '撤销审核失败!'); + this.message.create('error', '撤销审核失败!'); }) } } diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts index 501466d..ddc2259 100644 --- a/src/app/pages/plan/plan.component.ts +++ b/src/app/pages/plan/plan.component.ts @@ -350,7 +350,7 @@ export class PlanComponent implements OnInit { //创建/编辑建筑 addModelBuilding() { if (!this.validateForm.valid) { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return } let e: modelBuilding = this.validateForm.value @@ -814,7 +814,7 @@ export class PlanComponent implements OnInit { submitTaskForm() { if (!this.validateForm2.valid) { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return } let e = this.validateForm2.value diff --git a/src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts b/src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts index cb2e57d..427b1bd 100644 --- a/src/app/pages/records/criminal-records-admin/criminal-records-admin.component.ts +++ b/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) => { let body = { id: item.id, - handleRecord: '报废成功!' + handleRecord: '报废成功!' } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '报废成功!'); + this.message.create('success', '报废成功!'); item.handleTime = new Date() return true }) @@ -769,18 +769,18 @@ export class CriminalRecordsAdminComponent implements OnInit { // item.violatedItemSnapshotObj = data.result let body = { id: item.id, - handleRecord: '维保成功!' + handleRecord: '维保成功!' } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '维保成功!'); + this.message.create('success', '维保成功!'); item.handleTime = new Date() return true }) }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -884,13 +884,13 @@ export class CriminalRecordsAdminComponent implements OnInit { } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '处置成功!'); + this.message.create('success', '处置成功!'); item.handleTime = new Date() return true }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } }, diff --git a/src/app/pages/records/criminal-records/criminal-records.component.ts b/src/app/pages/records/criminal-records/criminal-records.component.ts index d453455..ae1003a 100644 --- a/src/app/pages/records/criminal-records/criminal-records.component.ts +++ b/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) => { let body = { id: item.id, - handleRecord: '报废成功!' + handleRecord: '报废成功!' } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '报废成功!'); + this.message.create('success', '报废成功!'); item.handleTime = new Date() return true }) @@ -734,18 +734,18 @@ export class CriminalRecordsComponent implements OnInit { // item.violatedItemSnapshotObj = data.result let body = { id: item.id, - handleRecord: '维保成功!' + handleRecord: '维保成功!' } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '维保成功!'); + this.message.create('success', '维保成功!'); item.handleTime = new Date() return true }) }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -820,13 +820,13 @@ export class CriminalRecordsComponent implements OnInit { } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '处置成功!'); + this.message.create('success', '处置成功!'); item.handleTime = new Date() return true }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } }, diff --git a/src/app/pages/records/warning-statistics-list/warning-statistics-list.component.ts b/src/app/pages/records/warning-statistics-list/warning-statistics-list.component.ts index 6add8e3..0c9c63c 100644 --- a/src/app/pages/records/warning-statistics-list/warning-statistics-list.component.ts +++ b/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) => { let body = { id: item.id, - handleRecord: '报废成功!' + handleRecord: '报废成功!' } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '报废成功!'); + this.message.create('success', '报废成功!'); item.handleTime = new Date() return true }) @@ -708,18 +708,18 @@ export class WarningStatisticsListComponent implements OnInit { this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { let body = { id: item.id, - handleRecord: '维保成功!' + handleRecord: '维保成功!' } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '维保成功!'); + this.message.create('success', '维保成功!'); item.handleTime = new Date() return true }) }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } diff --git a/src/app/pages/today-warning-admin/today-warning-admin.component.ts b/src/app/pages/today-warning-admin/today-warning-admin.component.ts index 8eeaac4..220660d 100644 --- a/src/app/pages/today-warning-admin/today-warning-admin.component.ts +++ b/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) => { let body = { id: item.id, - handleRecord: '报废成功!' + handleRecord: '报废成功!' } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '报废成功!'); + this.message.create('success', '报废成功!'); item.handleTime = new Date() return true }) @@ -323,18 +323,18 @@ export class TodayWarningAdminComponent implements OnInit { // item.violatedItemSnapshotObj = data.result let body = { id: item.id, - handleRecord: '维保成功!' + handleRecord: '维保成功!' } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '维保成功!'); + this.message.create('success', '维保成功!'); item.handleTime = new Date() return true }) }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -401,13 +401,13 @@ export class TodayWarningAdminComponent implements OnInit { } this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { resolve(data) - this.message.create('success', '处置成功!'); + this.message.create('success', '处置成功!'); item.handleTime = new Date() return true }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } }, diff --git a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss b/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss index d4651c1..ee16da5 100644 --- a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss +++ b/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss @@ -61,6 +61,7 @@ right: 18px; top: 18px; cursor: pointer; + i { font-size: 18px; } diff --git a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts b/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts index d0a4d98..b282461 100644 --- a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts +++ b/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 { NzTreeModule } from "ng-zorro-antd/tree"; import { ObjectsSimpleService } from "src/app/service/objectsSimple.service"; +import { PublicMethodsService } from "src/app/service/publicMethods.service"; import Viewer from "viewerjs"; @Component({ @@ -24,7 +25,8 @@ export class GetOutOfLineDetailsComponent implements OnInit { private modal: NzModalService, private initialModal: NzModalRef, private sanitizer: DomSanitizer, - private openmodal: NzModalRef + private openmodal: NzModalRef, + private pubilcMethods: PublicMethodsService ) {} imgUrl: string; @@ -55,17 +57,17 @@ export class GetOutOfLineDetailsComponent implements OnInit { this.imgUrl = this.data.violateImage; if (this.imgUrl) { - if (this.getFileType(this.imgUrl) == "img") { + if (this.pubilcMethods.getFileType(this.imgUrl) == "img") { this.isImage = true; } else { this.isImage = false; - if (this.getFileType(this.imgUrl) == "word") { + if (this.pubilcMethods.getFileType(this.imgUrl) == "word") { let arr = this.imgUrl.split("."); arr[arr.length - 1] = "pdf"; this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl( arr.join(".") ); - } else if (this.getFileType(this.imgUrl) == "pdf") { + } else if (this.pubilcMethods.getFileType(this.imgUrl) == "pdf") { this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl( this.imgUrl ); @@ -163,11 +165,11 @@ export class GetOutOfLineDetailsComponent implements OnInit { if (!item) { return; } - if (this.getFileType(item) == "word") { + if (this.pubilcMethods.getFileType(item) == "word") { let arr = item.split("."); arr[arr.length - 1] = "pdf"; window.open(arr.join(".")); - } else if (this.getFileType(item) == "pdf") { + } else if (this.pubilcMethods.getFileType(item) == "pdf") { window.open(item); } else { this.viewImg(item); @@ -206,27 +208,6 @@ export class GetOutOfLineDetailsComponent implements OnInit { }, 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"; contentType(type) { this.selectedType = type; @@ -239,7 +220,7 @@ export class GetOutOfLineDetailsComponent implements OnInit { this.http .post("/api/services/app/ViolateRecord/HandleViolateRecord", body) .subscribe((data) => { - this.message.create("success", "处置成功!"); + this.message.create("success", "处置成功!"); this.data.handleTime = new Date(); this.data.handleStateStr = "已处置"; this.data.handleRecord = this.content; @@ -261,12 +242,12 @@ export class GetOutOfLineDetailsComponent implements OnInit { .post("/api/services/app/ViolateRecord/CensorViolateRecord", body) .subscribe( (data) => { - this.message.create("success", "处置成功!"); + this.message.create("success", "处置成功!"); // this.data.handleTime = new Date() this.initialModal.triggerOk(); }, (err) => { - this.message.create("warning", "处置失败,请联系管理员!"); + this.message.create("warning", "处置失败,请联系管理员!"); } ); }, @@ -300,7 +281,7 @@ export class GetOutOfLineDetailsComponent implements OnInit { this.data.appealLog = data.result.appealLog; }, (err) => { - this.message.create("warning", "申诉提交失败,请联系管理员!"); + this.message.create("warning", "申诉提交失败,请联系管理员!"); } ); } @@ -322,7 +303,7 @@ export class GetOutOfLineDetailsComponent implements OnInit { this.data.appealStatus = 4; }, (err) => { - this.message.create("warning", "申诉撤销失败,请联系管理员!"); + this.message.create("warning", "申诉撤销失败,请联系管理员!"); } ); } diff --git a/src/app/pages/today-warning/today-warning.component.ts b/src/app/pages/today-warning/today-warning.component.ts index 08fe295..3d725a2 100644 --- a/src/app/pages/today-warning/today-warning.component.ts +++ b/src/app/pages/today-warning/today-warning.component.ts @@ -1,26 +1,35 @@ -import { Component, OnInit, ViewContainerRef } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { HttpClient } from '@angular/common/http'; -import { NzModalService } from 'ng-zorro-antd/modal'; -import { GetOutOfLineDetailsComponent } from './get-out-of-line-details/get-out-of-line-details.component'; +import { Component, OnInit, ViewContainerRef } from "@angular/core"; +import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { HttpClient } from "@angular/common/http"; +import { NzModalService } from "ng-zorro-antd/modal"; +import { GetOutOfLineDetailsComponent } from "./get-out-of-line-details/get-out-of-line-details.component"; // import { TreeService } from 'src/app/service/tree.service'; // import { NavChangeService } from 'src/app/service/navChange.service'; -import { TreeService } from '../../service/tree.service'; -import { NavChangeService } from '../../service/navChange.service'; -import * as moment from 'moment'; -import { DispositionComponent } from '../disposition/disposition.component'; -import { NzMessageService } from 'ng-zorro-antd/message'; -import { listRefreshService } from '../../service/listRefresh.service'; -import { DisposeequipmentComponent } from '../records/warning-statistics-list/disposeequipment/disposeequipment.component'; +import { TreeService } from "../../service/tree.service"; +import { NavChangeService } from "../../service/navChange.service"; +import * as moment from "moment"; +import { DispositionComponent } from "../disposition/disposition.component"; +import { NzMessageService } from "ng-zorro-antd/message"; +import { listRefreshService } from "../../service/listRefresh.service"; +import { DisposeequipmentComponent } from "../records/warning-statistics-list/disposeequipment/disposeequipment.component"; @Component({ - selector: 'app-today-warning', - templateUrl: './today-warning.component.html', - styleUrls: ['./today-warning.component.scss'] + selector: "app-today-warning", + templateUrl: "./today-warning.component.html", + styleUrls: ["./today-warning.component.scss"], }) export class TodayWarningComponent implements OnInit { 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) { } - isMisinformation: boolean = false//误报按钮的显隐 + 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 + ) {} + isMisinformation: boolean = false; //误报按钮的显隐 ngOnInit(): void { this.validateForm = this.fb.group({ level: [null], @@ -29,93 +38,113 @@ export class TodayWarningComponent implements OnInit { area: [null], disposalState: [null], appealState: [null], - datePickerStart: [new Date(`${moment(new Date()).format('YYYY-MM-DD')} 00:00`)], - datePickerEnd: [new Date(`${moment(new Date()).format('YYYY-MM-DD')} 23:59`)] + datePickerStart: [ + 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.getEarlyWarningList() + this.warningType(); + this.getEarlyWarningList(); this.listRefreshService.getMessage().subscribe((message: any) => { //列表刷新 - if (message.type == 'add') { - this.getEarlyWarningList() + if (message.type == "add") { + this.getEarlyWarningList(); } //更新处置状态 - if (message.type == 'updatehandleTime') { + if (message.type == "updatehandleTime") { // console.log('更新处置状态', message) // console.log(this.list) - this.list.forEach(element => { + this.list.forEach((element) => { if (element.id == message.data) { - element.handleTime = new Date() + element.handleTime = new Date(); } }); } }); - let loginUserInfo - if (sessionStorage.getItem('isGasStation') == 'true') { - loginUserInfo = JSON.parse(sessionStorage.getItem('userdataOfgasstation')) + let loginUserInfo; + if (sessionStorage.getItem("isGasStation") == "true") { + loginUserInfo = JSON.parse( + sessionStorage.getItem("userdataOfgasstation") + ); } else { - loginUserInfo = JSON.parse(sessionStorage.getItem('userdata')) + loginUserInfo = JSON.parse(sessionStorage.getItem("userdata")); } - if (loginUserInfo.permissions.find((item) => { - return item.name == 'Data.Violation.Positive.Censor' - })) { - this.isMisinformation = true + if ( + loginUserInfo.permissions.find((item) => { + return item.name == "Data.Violation.Positive.Censor"; + }) + ) { + this.isMisinformation = true; } else { - this.isMisinformation = false + this.isMisinformation = false; } } //预警类型接口 - warningTypesDetails: any - warningTypesDetailsCopy: any + warningTypesDetails: any; + warningTypesDetailsCopy: any; - warningTypes: any //预警接口数据 - warningTypesCopy: any - warningLevels: any - warningLevelsCopy: any + warningTypes: any; //预警接口数据 + warningTypesCopy: any; + warningLevels: any; + warningLevelsCopy: any; warningType() { - this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => { - this.warningTypesDetails = JSON.parse(JSON.stringify(data.result)) - this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)) //原始数据备份 - this.warningTypes = (data.result as any).groupBy((t) => { 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) { - if (a.key < b.key) { - return -1; - } else if (a.key == b.key) { - return 0; - } else { - return 1; - } - }); - this.warningLevelsCopy.sort(function (a, b) { - if (a.key < b.key) { - return -1; - } else if (a.key == b.key) { - return 0; - } else { - return 1; - } + this.http + .get("/api/services/app/Violation/GetAllList") + .subscribe((data: any) => { + this.warningTypesDetails = JSON.parse(JSON.stringify(data.result)); + this.warningTypesDetailsCopy = JSON.parse(JSON.stringify(data.result)); //原始数据备份 + this.warningTypes = (data.result as any).groupBy((t) => { + 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) { + if (a.key < b.key) { + return -1; + } else if (a.key == b.key) { + return 0; + } else { + return 1; + } + }); + this.warningLevelsCopy.sort(function (a, b) { + if (a.key < b.key) { + return -1; + } else if (a.key == b.key) { + return 0; + } else { + return 1; + } + }); + // console.log(111, this.warningTypesDetails) + // console.log(222, this.warningTypesCopy) + // console.log(333, this.warningLevels) }); - // console.log(111, this.warningTypesDetails) - // console.log(222, this.warningTypesCopy) - // console.log(333, this.warningLevels) - }) } typeChange(e) { if (!e) { - this.warningTypesDetails = this.warningTypesDetailsCopy - this.warningLevels = this.warningLevelsCopy - return + this.warningTypesDetails = this.warningTypesDetailsCopy; + this.warningLevels = this.warningLevelsCopy; + return; } - this.warningTypes.forEach(element => { + this.warningTypes.forEach((element) => { if (element.key == e) { - this.warningTypesDetails = element - this.warningLevels = (element as any).groupBy((t) => { return t.level }); + this.warningTypesDetails = element; + this.warningLevels = (element as any).groupBy((t) => { + return t.level; + }); } }); this.validateForm.patchValue({ @@ -124,17 +153,19 @@ export class TodayWarningComponent implements OnInit { } levelChange(e) { if (!e) { - this.warningTypesDetails = this.warningTypesDetailsCopy - this.warningTypes = this.warningTypesCopy + this.warningTypesDetails = this.warningTypesDetailsCopy; + this.warningTypes = this.warningTypesCopy; this.validateForm.patchValue({ type: null, }); - return + return; } - this.warningLevels.forEach(element => { + this.warningLevels.forEach((element) => { if (element.key == e) { - this.warningTypesDetails = element - this.warningTypes = (element as any).groupBy((t) => { return t.violationType }); + this.warningTypesDetails = element; + this.warningTypes = (element as any).groupBy((t) => { + return t.violationType; + }); } }); this.validateForm.patchValue({ @@ -142,63 +173,76 @@ export class TodayWarningComponent implements OnInit { }); } - //获得预警列表 - list: any = [ - ] - totalCount: string //预警总数 - isSpin: boolean = false - isLoading = false + //获得预警列表 + list: any = []; + totalCount: string; //预警总数 + isSpin: boolean = false; + isLoading = false; getEarlyWarningList() { - this.isLoading = true - let ViolationIds = [] + this.isLoading = true; + let ViolationIds = []; if (this.validateForm.value.event) { - ViolationIds = this.validateForm.value.event + ViolationIds = this.validateForm.value.event; } if (this.validateForm.value.type && !this.validateForm.value.event) { - this.warningTypesDetails.forEach(item => { - item.id ? ViolationIds.push(item.id) : null + this.warningTypesDetails.forEach((item) => { + item.id ? ViolationIds.push(item.id) : null; }); } - let disposalState - if (this.validateForm.value.disposalState == '0') { - disposalState = true - } else if (this.validateForm.value.disposalState == '1') { - disposalState = false + let disposalState; + if (this.validateForm.value.disposalState == "0") { + disposalState = true; + } else if (this.validateForm.value.disposalState == "1") { + disposalState = false; } else { - disposalState = null + disposalState = null; } let params = { Level: this.validateForm.value.level, ViolationIds: ViolationIds, ViolateAreas: this.validateForm.value.area, - organizationUnitId: JSON.parse(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, + organizationUnitId: JSON.parse( + 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, AppealStatus: this.validateForm.value.appealState, // ViolateTime: ['2021-10-27', '2021-11-26'], - IsContainsChildren: 'true', - SkipCount: '0', - MaxResultCount: '9999', - Positive: 'true' - } - this.isSpin = true - this.http.get('/api/services/app/ViolateRecord/GetAll', { - params: params - }).subscribe((data: any) => { - this.list = data.result.items - this.totalCount = data.result.totalCount - console.log('预警列表', this.list) - this.isSpin = false - this.isLoading = false - let obj = { - name: '改变数量', - num: this.totalCount - } - setTimeout(() => { - this.navChangeService.sendMessage(obj);//发布一条消息 - }, 0); - - }) + IsContainsChildren: "true", + SkipCount: "0", + MaxResultCount: "9999", + Positive: "true", + }; + this.isSpin = true; + this.http + .get("/api/services/app/ViolateRecord/GetAll", { + params: params, + }) + .subscribe((data: any) => { + this.list = data.result.items; + this.totalCount = data.result.totalCount; + console.log("预警列表", this.list); + this.isSpin = false; + this.isLoading = false; + let obj = { + name: "改变数量", + num: this.totalCount, + }; + setTimeout(() => { + this.navChangeService.sendMessage(obj); //发布一条消息 + }, 0); + }); } submitForm(): void { @@ -206,7 +250,7 @@ export class TodayWarningComponent implements OnInit { this.validateForm.controls[i].markAsDirty(); this.validateForm.controls[i].updateValueAndValidity(); } - this.getEarlyWarningList() + this.getEarlyWarningList(); } resetForm(e: MouseEvent): void { e.preventDefault(); @@ -216,134 +260,161 @@ export class TodayWarningComponent implements OnInit { this.validateForm.controls[key].updateValueAndValidity(); } this.validateForm.patchValue({ - datePickerStart: new Date(`${moment(new Date()).format('YYYY-MM-DD')} 00:00`), - datePickerEnd: new Date(`${moment(new Date()).format('YYYY-MM-DD')} 23:59`) + datePickerStart: new Date( + `${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) { - if (item.violation.violationType == '设备监测') { - item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot) + if (item.violation.violationType == "设备监测") { + item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot); const modal = this.modal.create({ nzContent: DisposeequipmentComponent, nzViewContainerRef: this.viewContainerRef, nzWidth: 380, nzBodyStyle: { - 'border': '1px solid #91CCFF', - 'border-radius': '0px', - 'padding': '7px', - 'box-shadow': '0 0 8px 0 #fff', - 'background-image': 'linear-gradient(#003665, #000f25)' + border: "1px solid #91CCFF", + "border-radius": "0px", + padding: "7px", + "box-shadow": "0 0 8px 0 #fff", + "background-image": "linear-gradient(#003665, #000f25)", }, nzComponentParams: { - data: item + data: item, }, nzFooter: null, nzClosable: false, nzOnOk: async () => { if (instance.isScrap) { - await new Promise(resolve => { + await new Promise((resolve) => { let body = { id: item.violatedItemSnapshotObj.id, name: instance.copydata2.violatedItemSnapshotObj.name, - storageLocation: instance.copydata2.violatedItemSnapshotObj.storageLocation, - productionDate: moment(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'), + storageLocation: + instance.copydata2.violatedItemSnapshotObj.storageLocation, + productionDate: moment( + 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, - organizationUnitId: item.violatedItemSnapshotObj.organizationUnitId - } - this.http.put('/api/services/app/FireEquipment/Update', body).subscribe((data: any) => { - let body = { - id: item.id, - handleRecord: '报废成功!' - } - this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { - resolve(data) - this.message.create('success', '报废成功!'); - item.handleTime = new Date() - return true - }) - }) - }) - + organizationUnitId: + item.violatedItemSnapshotObj.organizationUnitId, + }; + this.http + .put("/api/services/app/FireEquipment/Update", body) + .subscribe((data: any) => { + let body = { + id: item.id, + handleRecord: "报废成功!", + }; + this.http + .post( + "/api/services/app/ViolateRecord/HandleViolateRecord", + body + ) + .subscribe((data) => { + resolve(data); + this.message.create("success", "报废成功!"); + item.handleTime = new Date(); + return true; + }); + }); + }); } else { if (instance.validateForm.valid) { - await new Promise(resolve => { + await new Promise((resolve) => { let body = { id: item.violatedItemSnapshotObj.id, name: instance.validateForm.value.name, storageLocation: instance.validateForm.value.storageLocation, - productionDate: moment(instance.validateForm.value.productionDate).format('yyyy-MM-DD'), - maintenanceDate: moment(instance.validateForm.value.maintenanceDate).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 - let body = { - id: item.id, - handleRecord: '维保成功!' - } - this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { - resolve(data) - this.message.create('success', '维保成功!'); - item.handleTime = new Date() - return true - }) - }) - }) + productionDate: moment( + instance.validateForm.value.productionDate + ).format("yyyy-MM-DD"), + maintenanceDate: moment( + instance.validateForm.value.maintenanceDate + ).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 + let body = { + id: item.id, + handleRecord: "维保成功!", + }; + this.http + .post( + "/api/services/app/ViolateRecord/HandleViolateRecord", + body + ) + .subscribe((data) => { + resolve(data); + this.message.create("success", "维保成功!"); + item.handleTime = new Date(); + return true; + }); + }); + }); } else { - this.message.create('warning', '请填写完整!'); - return false + this.message.create("warning", "请填写完整!"); + return false; } } - } + }, }); const instance = modal.getContentComponent(); } else { - console.log(777777777777) - const modal = this.modal.create({ + this.modal.create({ nzContent: GetOutOfLineDetailsComponent, nzWrapClassName: "vertical-center-modal", 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, - nzClassName: 'modelnobg', + nzClassName: "modelnobg", nzBodyStyle: { - 'border-radius': '0px', - 'padding': '0px', + "border-radius": "0px", + padding: "0px", }, nzComponentParams: { - data: item + data: item, }, nzFooter: null, nzOnOk: async () => { - console.log('误报处理') + console.log("误报处理"); for (let index = 0; index < this.list.length; index++) { const element = this.list[index]; if (element.id == item.id) { - this.list.splice(index, 1) - this.totalCount = String(Number(this.totalCount) - 1) + this.list.splice(index, 1); + this.totalCount = String(Number(this.totalCount) - 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) { - console.log(item) + console.log(item); if (item.isEnableHandle) { const modal = this.modal.create({ nzContent: DispositionComponent, @@ -351,39 +422,43 @@ export class TodayWarningComponent implements OnInit { nzViewContainerRef: this.viewContainerRef, nzWidth: 380, nzBodyStyle: { - 'border': '1px solid #91CCFF', - 'border-radius': '0px', - 'padding': '7px', - 'box-shadow': '0 0 8px 0 #fff', - 'background-image': 'linear-gradient(#003665, #000f25)' + border: "1px solid #91CCFF", + "border-radius": "0px", + padding: "7px", + "box-shadow": "0 0 8px 0 #fff", + "background-image": "linear-gradient(#003665, #000f25)", }, nzComponentParams: {}, nzFooter: null, nzClosable: false, nzOnOk: async () => { if (instance.validateForm.valid) { - await new Promise(resolve => { + await new Promise((resolve) => { let body = { id: item.id, - handleRecord: instance.validateForm.value.content - } - this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => { - resolve(data) - this.message.create('success', '处置成功!'); - item.handleTime = new Date() - return true - }) - }) + handleRecord: instance.validateForm.value.content, + }; + this.http + .post( + "/api/services/app/ViolateRecord/HandleViolateRecord", + body + ) + .subscribe((data) => { + resolve(data); + this.message.create("success", "处置成功!"); + item.handleTime = new Date(); + return true; + }); + }); } else { - this.message.create('warning', '请填写完整!'); - return false + this.message.create("warning", "请填写完整!"); + return false; } }, }); const instance = modal.getContentComponent(); } else { - this.message.create('warning', '无处置权限!'); + this.message.create("warning", "无处置权限!"); } - } } diff --git a/src/app/service/publicMethods.service.ts b/src/app/service/publicMethods.service.ts new file mode 100644 index 0000000..6e8d51a --- /dev/null +++ b/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; + } +} diff --git a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts b/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts index a62fcda..1930227 100644 --- a/src/app/system-management/analysis-of-the-host/analysis-of-the-host.component.ts +++ b/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 => { resolve(data) - this.message.create('success', '创建成功!'); + this.message.create('success', '创建成功!'); this.getHost() return true }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -156,13 +156,13 @@ export class AnalysisOfTheHostComponent implements OnInit { data.hostIPAddress = instance.validateForm.value.ip, this.http.put('/api/services/app/EdgeDevice/Update', data).subscribe(data => { resolve(data) - this.message.create('success', '修改成功!'); + this.message.create('success', '修改成功!'); this.getHost() return true }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -181,7 +181,7 @@ export class AnalysisOfTheHostComponent implements OnInit { Id: item.id } }).subscribe(data => { - this.message.create('success', '删除成功!'); + this.message.create('success', '删除成功!'); this.getHost() }) }, @@ -212,7 +212,7 @@ export class AnalysisOfTheHostComponent implements OnInit { } this.http.post('/api/services/app/Camera/Create', body).subscribe(data => { resolve(data) - this.message.create('success', '创建成功!'); + this.message.create('success', '创建成功!'); this.getCamera() return true }, err => { @@ -220,7 +220,7 @@ export class AnalysisOfTheHostComponent implements OnInit { }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -247,7 +247,7 @@ export class AnalysisOfTheHostComponent implements OnInit { data.ipAdress = instance.validateForm.value.ip this.http.put('/api/services/app/Camera/Update', data).subscribe(data => { resolve(data) - this.message.create('success', '编辑成功!'); + this.message.create('success', '编辑成功!'); this.getCamera() return true }, err => { @@ -255,7 +255,7 @@ export class AnalysisOfTheHostComponent implements OnInit { }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -274,7 +274,7 @@ export class AnalysisOfTheHostComponent implements OnInit { Id: item.id } }).subscribe(data => { - this.message.create('success', '删除成功!'); + this.message.create('success', '删除成功!'); this.getCamera() }) }, diff --git a/src/app/system-management/file-of-license/file-of-license.component.ts b/src/app/system-management/file-of-license/file-of-license.component.ts index c273f10..379b4d6 100644 --- a/src/app/system-management/file-of-license/file-of-license.component.ts +++ b/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 => { resolve(data) - this.message.create('success', '创建成功!'); + this.message.create('success', '创建成功!'); this.getLicense() return true }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -91,13 +91,13 @@ export class FileOfLicenseComponent implements OnInit { } this.http.put('/api/services/app/FileLicenseType/Update', body).subscribe(data => { resolve(data) - this.message.create('success', '修改成功!'); + this.message.create('success', '修改成功!'); this.getLicense() return true }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -120,7 +120,7 @@ export class FileOfLicenseComponent implements OnInit { Id: item.id } }).subscribe(data => { - this.message.create('success', '删除成功!'); + this.message.create('success', '删除成功!'); this.getLicense() }) }, diff --git a/src/app/system-management/menu/menu.component.ts b/src/app/system-management/menu/menu.component.ts index c15c7e0..9c1d729 100644 --- a/src/app/system-management/menu/menu.component.ts +++ b/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 => { resolve(data) - this.message.create('success', '创建成功!'); + this.message.create('success', '创建成功!'); this.nzTreeComponent.getExpandedNodeList().forEach((item) => { this.defaultExpandedKeys.push(item.key) }) @@ -103,7 +103,7 @@ export class MenuComponent implements OnInit { }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -134,7 +134,7 @@ export class MenuComponent implements OnInit { } this.http.put('/api/services/app/Menu/Update', body).subscribe(data => { resolve(data) - this.message.create('success', '编辑成功!'); + this.message.create('success', '编辑成功!'); this.nzTreeComponent.getExpandedNodeList().forEach((item) => { this.defaultExpandedKeys.push(item.key) }) @@ -147,7 +147,7 @@ export class MenuComponent implements OnInit { }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -173,7 +173,7 @@ export class MenuComponent implements OnInit { this.defaultExpandedKeys.push(item.key) }) this.getAllOrganization() - this.message.create('success', '删除成功!'); + this.message.create('success', '删除成功!'); }) }, nzCancelText: '取消', diff --git a/src/app/system-management/organization/organization.component.ts b/src/app/system-management/organization/organization.component.ts index b11f64b..2a0891b 100644 --- a/src/app/system-management/organization/organization.component.ts +++ b/src/app/system-management/organization/organization.component.ts @@ -160,7 +160,7 @@ export class OrganizationComponent implements OnInit { .subscribe( (data) => { resolve(data); - this.message.create("success", "创建成功!"); + this.message.create("success", "创建成功!"); this.nzTreeComponent.getExpandedNodeList().forEach((item) => { this.defaultExpandedKeys.push(item.key); }); @@ -175,7 +175,7 @@ export class OrganizationComponent implements OnInit { ); }); } else { - this.message.create("warning", "请填写完整!"); + this.message.create("warning", "请填写完整!"); return false; } }, @@ -212,7 +212,7 @@ export class OrganizationComponent implements OnInit { .subscribe( (data) => { resolve(data); - this.message.create("success", "编辑成功!"); + this.message.create("success", "编辑成功!"); this.nzTreeComponent.getExpandedNodeList().forEach((item) => { this.defaultExpandedKeys.push(item.key); }); @@ -227,7 +227,7 @@ export class OrganizationComponent implements OnInit { ); }); } else { - this.message.create("warning", "请填写完整!"); + this.message.create("warning", "请填写完整!"); return false; } }, @@ -273,7 +273,7 @@ export class OrganizationComponent implements OnInit { this.defaultExpandedKeys.push(item.key); }); this.getAllOrganization(); - this.message.create("success", "删除成功!"); + this.message.create("success", "删除成功!"); }); }, nzCancelText: "取消", @@ -313,7 +313,7 @@ export class OrganizationComponent implements OnInit { }) .subscribe( (data) => { - this.message.create("success", "拖拽成功!"); + this.message.create("success", "拖拽成功!"); this.nzTreeComponent.getExpandedNodeList().forEach((item) => { this.defaultExpandedKeys.push(item.key); }); diff --git a/src/app/system-management/push/push.component.ts b/src/app/system-management/push/push.component.ts index 940d49a..2aa201c 100644 --- a/src/app/system-management/push/push.component.ts +++ b/src/app/system-management/push/push.component.ts @@ -62,9 +62,9 @@ export class PushComponent implements OnInit { .subscribe((data: any) => { // console.log('设置短信推送状态成功', data) if (e) { - this.message.create("success", "开启成功!"); + this.message.create("success", "开启成功!"); } else { - this.message.create("success", "关闭成功!"); + this.message.create("success", "关闭成功!"); } }); } @@ -172,18 +172,18 @@ export class PushComponent implements OnInit { .subscribe({ next: (data) => { resolve(data); - this.message.create("success", "修改成功!"); + this.message.create("success", "修改成功!"); this.getViolation(); return true; }, error: (err) => { - this.message.create("success", "修改失败!"); + this.message.create("success", "修改失败!"); reject(err); }, }); }); } else { - this.message.create("warning", "请填写完整!"); + this.message.create("warning", "请填写完整!"); return false; } }, diff --git a/src/app/system-management/role/role.component.ts b/src/app/system-management/role/role.component.ts index fead5b2..35c0633 100644 --- a/src/app/system-management/role/role.component.ts +++ b/src/app/system-management/role/role.component.ts @@ -115,23 +115,23 @@ export class RoleComponent implements OnInit { .subscribe( (data) => { resolve(data); - this.message.create("success", "创建成功!"); + this.message.create("success", "创建成功!"); this.getAllRoles(); }, (err) => { - this.message.create("warning", "分配菜单错误!"); + this.message.create("warning", "分配菜单错误!"); reject(err); } ); }, (err) => { - this.message.create("warning", "创建角色错误!"); + this.message.create("warning", "创建角色错误!"); reject(err); } ); }); } else { - this.message.create("warning", "请填写完整!"); + this.message.create("warning", "请填写完整!"); return false; } }, @@ -178,24 +178,24 @@ export class RoleComponent implements OnInit { }) .subscribe( (data) => { - this.message.create("success", "修改成功!"); + this.message.create("success", "修改成功!"); this.getAllRoles(); resolve(data); }, (err) => { - this.message.create("warning", "分配菜单错误!"); + this.message.create("warning", "分配菜单错误!"); reject(err); } ); }, (err) => { - this.message.create("warning", "修改角色错误!"); + this.message.create("warning", "修改角色错误!"); reject(err); } ); }); } else { - this.message.create("warning", "请填写完整!"); + this.message.create("warning", "请填写完整!"); return false; } }, @@ -247,7 +247,7 @@ export class RoleComponent implements OnInit { }) .subscribe((data) => { resolve(data); - this.message.create("success", "分配成功!"); + this.message.create("success", "分配成功!"); this.getAllRoles(); return true; }); @@ -285,7 +285,7 @@ export class RoleComponent implements OnInit { }, }) .subscribe((data) => { - this.message.create("success", "删除成功!"); + this.message.create("success", "删除成功!"); this.getAllRoles(); }); }, diff --git a/src/app/system-management/update-of-license/update-of-license.component.ts b/src/app/system-management/update-of-license/update-of-license.component.ts index d108841..9a4e81d 100644 --- a/src/app/system-management/update-of-license/update-of-license.component.ts +++ b/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 => { resolve(data) - this.message.create('success', '创建成功!'); + this.message.create('success', '创建成功!'); this.getLicense() return true }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -106,13 +106,13 @@ export class UpdateOfLicenseComponent implements OnInit { } this.http.put('/api/services/app/ValidityLicenseType/Update', body).subscribe(data => { resolve(data) - this.message.create('success', '修改成功!'); + this.message.create('success', '修改成功!'); this.getLicense() return true }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); return false } } @@ -135,7 +135,7 @@ export class UpdateOfLicenseComponent implements OnInit { Id: item.id } }).subscribe(data => { - this.message.create('success', '删除成功!'); + this.message.create('success', '删除成功!'); this.getLicense() }) }, diff --git a/src/app/system-management/user/edituser/edituser.component.ts b/src/app/system-management/user/edituser/edituser.component.ts index 992c451..fa586a8 100644 --- a/src/app/system-management/user/edituser/edituser.component.ts +++ b/src/app/system-management/user/edituser/edituser.component.ts @@ -139,7 +139,7 @@ export class EdituserComponent implements OnInit { resolve(data) this.data.auditStatus = data.result.auditStatus this.isLoading = false - this.message.create('success', '保存成功!'); + this.message.create('success', '保存成功!'); }, err => { resolve(err) this.isLoading = false @@ -147,7 +147,7 @@ export class EdituserComponent implements OnInit { }) }) } else { - this.message.create('warning', '请填写完整!'); + this.message.create('warning', '请填写完整!'); } } //取消 diff --git a/src/app/ui/changepassword/changepassword.component.html b/src/app/ui/changepassword/changepassword.component.html index 383ae70..1277b29 100644 --- a/src/app/ui/changepassword/changepassword.component.html +++ b/src/app/ui/changepassword/changepassword.component.html @@ -30,7 +30,7 @@ [appConfirmpsw] = "newPassword.value">
    -
    密码输入不一致!
    +
    密码输入不一致!
    {{errmsg}} diff --git a/src/theme.less b/src/theme.less index e3c1f76..9de403f 100644 --- a/src/theme.less +++ b/src/theme.less @@ -641,6 +641,7 @@ } } + .ant-modal-close-x { color: #fff; }