查看
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;
}