Browse Source

[新增]查询条件和按钮

master
邵佳豪 2 years ago
parent
commit
c22a1295a9
  1. 4
      proxy.config.json
  2. 31
      src/app/pages/histories/histories.component.html
  3. 12
      src/app/pages/histories/histories.component.scss
  4. 537
      src/app/pages/histories/histories.component.ts
  5. 3
      src/app/pages/histories/img-list/img-list.component.html
  6. 8
      src/app/pages/histories/img-list/img-list.component.scss
  7. 25
      src/app/pages/histories/img-list/img-list.component.spec.ts
  8. 17
      src/app/pages/histories/img-list/img-list.component.ts
  9. 122
      src/app/pages/pages.module.ts

4
proxy.config.json

@ -1,11 +1,11 @@
{
"/api": {
"target": "http://10.156.134.53:8200",
"target": "http://121.36.37.70:8200",
"secure": false,
"changeOrigin": true
},
"/signalr": {
"target": "http://10.156.134.53:8200",
"target": "http://121.36.37.70:8200",
"secure": false,
"ws": true,
"logLevel": "debug"

31
src/app/pages/histories/histories.component.html

@ -52,6 +52,7 @@
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select nzAllowClear id="site" formControlName="site" nzPlaceHolder="请选择区域">
@ -64,6 +65,26 @@
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select nzAllowClear formControlName="manufacturer" nzPlaceHolder="请选择厂商">
<nz-option nzValue="null" nzLabel="交大"></nz-option>
<nz-option nzValue="1" nzLabel="黄海"></nz-option>
<nz-option nzValue="2" nzLabel="安信"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select nzAllowClear formControlName="operation" nzPlaceHolder="请选择操作记录">
<nz-option nzValue="null" nzLabel="未处理"></nz-option>
<nz-option nzValue="HandlerNotified" nzLabel="已推送"></nz-option>
<nz-option nzValue="VerifierNotified" nzLabel="误报"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<nz-form-control>
<nz-select nzAllowClear formControlName="disposalState" nzPlaceHolder="请选择处置状态">
@ -91,6 +112,13 @@
[nzType]="'sync'"></i>重置</button>
</nz-form-control>
</nz-form-item>
<nz-form-item class="btn">
<nz-form-control>
<button nz-button type="button" class="reset" (click)="imgUrls()"><i nz-icon
[nzType]="'vertical-align-bottom'"></i>图片</button>
</nz-form-control>
</nz-form-item>
</form>
</div>
@ -187,7 +215,8 @@
</div>
<div nz-col nzSpan="2">
<span *ngIf="item.operationLog == 'Pushed'">已推送</span>
<span *ngIf="item.operationLog == 'MarkedAsFalsePositive'" style="color: #FF4B65;">标记误报</span>
<span *ngIf="item.operationLog == 'MarkedAsFalsePositive'"
style="color: #FF4B65;">标记误报</span>
</div>
<div nz-col nzSpan="2">
<span *ngIf="item.positive">已通过</span>

12
src/app/pages/histories/histories.component.scss

@ -9,31 +9,35 @@
box-sizing: border-box;
padding: 0 36px;
width: 100%;
height: 32px;
margin-bottom: 16px;
min-height: 32px;
margin-bottom: 4px;
form {
width: 100%;
height: 32px;
min-height: 32px;
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
.searchParams,
.btn {
margin: 0 3px;
margin-bottom: 12px;
}
.searchParams {
// flex: 5;
margin-bottom: 12px;
width: 150px;
}
.searchParamsLong {
width: 250px;
margin-bottom: 12px;
}
.searchParams2 {
width: 220px;
margin-bottom: 12px;
}
.btn {

537
src/app/pages/histories/histories.component.ts

@ -1,44 +1,63 @@
import { HttpClient } from '@angular/common/http';
import { Component, ElementRef, OnInit, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router'
import { fromEvent } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import * as moment from 'moment';
import { NzModalService } from 'ng-zorro-antd/modal';
import { GetOutOfLineDetailsComponent } from '../get-out-of-line-details/get-out-of-line-details.component';
import { NzMessageService } from 'ng-zorro-antd/message';
import { TreeService } from 'src/app/service/tree.service';
import { DisposeequipmentComponent } from '../disposeequipment/disposeequipment.component';
import { SignalRAspNetCoreHelper } from '../../../shared/helpers/SignalRAspNetCoreHelper';
declare var abp: any
import 'linqjs';
import { HttpClient } from "@angular/common/http";
import { Component, ElementRef, OnInit, ViewContainerRef } from "@angular/core";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { Router } from "@angular/router";
import { fromEvent } from "rxjs";
import { debounceTime } from "rxjs/operators";
import * as moment from "moment";
import { NzModalService } from "ng-zorro-antd/modal";
import { GetOutOfLineDetailsComponent } from "../get-out-of-line-details/get-out-of-line-details.component";
import { NzMessageService } from "ng-zorro-antd/message";
import { TreeService } from "src/app/service/tree.service";
import { DisposeequipmentComponent } from "../disposeequipment/disposeequipment.component";
import { SignalRAspNetCoreHelper } from "../../../shared/helpers/SignalRAspNetCoreHelper";
declare var abp: any;
import "linqjs";
import { ImgListComponent } from "./img-list/img-list.component";
@Component({
selector: 'app-histories',
templateUrl: './histories.component.html',
styleUrls: ['./histories.component.scss']
selector: "app-histories",
templateUrl: "./histories.component.html",
styleUrls: ["./histories.component.scss"],
})
export class HistoriesComponent implements OnInit {
validateForm!: FormGroup;
constructor(private element: ElementRef, private toTree: TreeService, private http: HttpClient, private fb: FormBuilder, private router: Router, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { }
constructor(
private element: ElementRef,
private toTree: TreeService,
private http: HttpClient,
private fb: FormBuilder,
private router: Router,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private message: NzMessageService
) {}
startdate
enddate
startdate;
enddate;
ngOnInit(): void {
//当前日期
let myDate: any = new Date();
let nowY = myDate.getFullYear();
let nowM = myDate.getMonth() + 1;
let nowD = myDate.getDate();
this.enddate = nowY + "-" + (nowM < 10 ? "0" + nowM : nowM) + "-" + (nowD < 10 ? "0" + nowD : nowD);//当前日期
this.enddate =
nowY +
"-" +
(nowM < 10 ? "0" + nowM : nowM) +
"-" +
(nowD < 10 ? "0" + nowD : nowD); //当前日期
//获取三十天前日期
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 30);//最后一个数字30可改,30天的意思
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 30); //最后一个数字30可改,30天的意思
let lastY = lw.getFullYear();
let lastM = lw.getMonth() + 1;
let lastD = lw.getDate();
this.startdate = lastY + "-" + (lastM < 10 ? "0" + lastM : lastM) + "-" + (lastD < 10 ? "0" + lastD : lastD);//三十天之前日期
this.startdate =
lastY +
"-" +
(lastM < 10 ? "0" + lastM : lastM) +
"-" +
(lastD < 10 ? "0" + lastD : lastD); //三十天之前日期
this.validateForm = this.fb.group({
level: [null],
@ -46,99 +65,224 @@ export class HistoriesComponent implements OnInit {
type: [null],
event: [null],
site: [null],
manufacturer: [null], //厂商
operation: [null], //操作记录
disposalState: [null],
datePicker: [[this.startdate, this.enddate]]
datePicker: [[this.startdate, this.enddate]],
});
this.warningType()
this.tableSpin = true
this.getAllOrganization()
this.warningType();
this.tableSpin = true;
this.getAllOrganization();
}
defaultOrId: string
defaultOrId: string;
//获取所有组织机构
nodes: any = []
nodes: any = [];
getAllOrganization() {
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id
let OrganizationUnitId =
sessionStorage.getItem("isGasStation") == "true"
? JSON.parse(sessionStorage.getItem("userdataOfgasstation"))
.organization.id
: JSON.parse(sessionStorage.getItem("userdata")).organization.id;
let params = {
OrganizationUnitId: OrganizationUnitId,
IsContainsChildren: "true"
}
this.http.get('/api/services/app/Organization/GetAll', {
params: params
}).subscribe((data: any) => {
data.result.items.forEach(element => {
if (element.id == OrganizationUnitId) {
element.parentId = null
}
element.key = element.id
element.title = element.displayName
IsContainsChildren: "true",
};
this.http
.get("/api/services/app/Organization/GetAll", {
params: params,
})
.subscribe((data: any) => {
data.result.items.forEach((element) => {
if (element.id == OrganizationUnitId) {
element.parentId = null;
}
element.key = element.id;
element.title = element.displayName;
});
this.nodes = [...this.toTree.toTree(data.result.items)];
this.defaultOrId = JSON.parse(
sessionStorage.getItem("userdata")
).organization.id;
this.validateForm.value.organization = this.defaultOrId;
this.getViolateRecordList();
});
this.nodes = [...this.toTree.toTree(data.result.items)]
this.defaultOrId = JSON.parse(sessionStorage.getItem('userdata')).organization.id
this.validateForm.value.organization = this.defaultOrId
this.getViolateRecordList()
})
}
//获得违规记录列表
SkipCount: string = '0'
MaxResultCount: string = '50'
list: any = []
totalCount: string
tableSpin: boolean = false
SkipCount: string = "0";
MaxResultCount: string = "50";
list: any = [];
totalCount: string;
tableSpin: boolean = false;
getViolateRecordList() {
let ViolationIds = []
let ViolationIds = [];
if (this.validateForm.value.event) {
ViolationIds.push(this.validateForm.value.event)
ViolationIds.push(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 VendorId: any = -1;
if (this.validateForm.value.manufacturer) {
if (this.validateForm.value.manufacturer === "null") {
VendorId = null;
} else {
VendorId = this.validateForm.value.manufacturer;
}
}
let NotificationState: any = "All";
if (this.validateForm.value.operation) {
if (this.validateForm.value.operation === "null") {
NotificationState = null;
} else {
NotificationState = this.validateForm.value.operation;
}
}
let params = {
Level: this.validateForm.value.level,
ViolationIds: ViolationIds,
ViolateArea: this.validateForm.value.site,
OrganizationUnitId: this.validateForm.value.organization,
IsContainsChildren: 'true',
CanVerify: 'false',
ViolateTime: this.validateForm.value.datePicker ? [moment(this.validateForm.value.datePicker[0]).format('yyyy-MM-DD'), moment(this.validateForm.value.datePicker[1]).format('yyyy-MM-DD')] : null,
IsContainsChildren: "true",
CanVerify: "false",
ViolateTime: this.validateForm.value.datePicker
? [
moment(this.validateForm.value.datePicker[0]).format("yyyy-MM-DD"),
moment(this.validateForm.value.datePicker[1]).format("yyyy-MM-DD"),
]
: null,
SkipCount: this.SkipCount,
MaxResultCount: this.MaxResultCount, //每页50条
Positive: this.validateForm.value.disposalState
}
this.tableSpin = true
this.http.get('/api/services/app/ViolateRecordVerification/GetAll', {
params: params
}).subscribe((data: any) => {
this.list = this.list.concat(data.result.items);
this.list = [...this.list]
// this.list = data.result.items
this.totalCount = data.result.totalCount
console.log('违规记录列表', data)
this.tableSpin = false
console.log(this.list.length)
},
(err) => {
this.tableSpin = false;
this.message.create('error', err.error.error.details);
Positive: this.validateForm.value.disposalState,
VendorId: VendorId,
NotificationState: NotificationState,
};
this.tableSpin = true;
this.http
.get("/api/services/app/ViolateRecordVerification/GetAll", {
params: params,
})
.subscribe(
(data: any) => {
this.list = this.list.concat(data.result.items);
this.list = [...this.list];
// this.list = data.result.items
this.totalCount = data.result.totalCount;
console.log("违规记录列表", data);
this.tableSpin = false;
console.log(this.list.length);
},
(err) => {
this.tableSpin = false;
this.message.create("error", err.error.error.details);
}
);
}
ngAfterViewInit(): void {
fromEvent(this.element.nativeElement.querySelector(`#tbody`) as HTMLCanvasElement, 'scroll').pipe(debounceTime(100)).subscribe((event: any) => { //监听 DOM 滚动事件
if (event.target.scrollHeight - (event.target.scrollTop + event.target.clientHeight) <= 10) {
if (this.totalCount > this.list.length) {
console.log('需要加载数据了', event)
this.SkipCount = String(Number(this.SkipCount) + 50)
this.getViolateRecordList()
}
imgUrls() {
let ViolationIds = [];
if (this.validateForm.value.event) {
ViolationIds.push(this.validateForm.value.event);
}
if (this.validateForm.value.type && !this.validateForm.value.event) {
this.warningTypesDetails.forEach((item) => {
item.id ? ViolationIds.push(item.id) : null;
});
}
let VendorId: any = -1;
if (this.validateForm.value.manufacturer) {
if (this.validateForm.value.manufacturer === "null") {
VendorId = null;
} else {
VendorId = this.validateForm.value.manufacturer;
}
}
let NotificationState: any = "All";
if (this.validateForm.value.operation) {
if (this.validateForm.value.operation === "null") {
NotificationState = null;
} else {
NotificationState = this.validateForm.value.operation;
}
}
let params = {
Level: this.validateForm.value.level,
ViolationIds: ViolationIds,
ViolateArea: this.validateForm.value.site,
OrganizationUnitId: this.validateForm.value.organization,
IsContainsChildren: "true",
CanVerify: "false",
ViolateTime: this.validateForm.value.datePicker
? [
moment(this.validateForm.value.datePicker[0]).format("yyyy-MM-DD"),
moment(this.validateForm.value.datePicker[1]).format("yyyy-MM-DD"),
]
: null,
Positive: this.validateForm.value.disposalState,
VendorId: VendorId,
NotificationState: NotificationState,
};
this.http
.get("/api/services/app/ViolateRecordVerification/GetRecordImageUrls", {
params: params,
})
.subscribe(
(data: any) => {
console.log("图片列表");
this.openImgModel(data.result);
},
(err) => {
this.tableSpin = false;
this.message.create("error", err.error.error.details);
}
);
}
openImgModel(data) {
const modal = this.modal.create({
nzTitle: "图片列表",
nzContent: ImgListComponent,
nzViewContainerRef: this.viewContainerRef,
nzGetContainer: () => document.body,
nzComponentParams: {
data: data,
},
nzWidth:700,
nzOnOk: () => new Promise((resolve) => setTimeout(resolve, 1000)),
nzFooter: null,
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log("[afterOpen] emitted!"));
// Return a result when closed
modal.afterClose.subscribe((result) =>
console.log("[afterClose] The result is:", result)
);
}
ngAfterViewInit(): void {
fromEvent(
this.element.nativeElement.querySelector(`#tbody`) as HTMLCanvasElement,
"scroll"
)
.pipe(debounceTime(100))
.subscribe((event: any) => {
//监听 DOM 滚动事件
if (
event.target.scrollHeight -
(event.target.scrollTop + event.target.clientHeight) <=
10
) {
if (this.totalCount > this.list.length) {
console.log("需要加载数据了", event);
this.SkipCount = String(Number(this.SkipCount) + 50);
this.getViolateRecordList();
}
}
});
}
getThirtyDays() {
@ -147,30 +291,39 @@ export class HistoriesComponent implements OnInit {
var nowY = myDate.getFullYear();
var nowM = myDate.getMonth() + 1;
var nowD = myDate.getDate();
var enddateStr = nowY + "-" + (nowM < 10 ? "0" + nowM : nowM) + "-" + (nowD < 10 ? "0" + nowD : nowD);//当前日期
var enddateStr =
nowY +
"-" +
(nowM < 10 ? "0" + nowM : nowM) +
"-" +
(nowD < 10 ? "0" + nowD : nowD); //当前日期
var enddate = new Date(enddateStr);
//获取三十天前日期
var lw = new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 30);//最后一个数字30可改,30天的意思
var lw = new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 30); //最后一个数字30可改,30天的意思
var lastY = lw.getFullYear();
var lastM = lw.getMonth() + 1;
var lastD = lw.getDate();
var startdateStr = lastY + "-" + (lastM < 10 ? "0" + lastM : lastM) + "-" + (lastD < 10 ? "0" + lastD : lastD);//三十天之前日期
var startdateStr =
lastY +
"-" +
(lastM < 10 ? "0" + lastM : lastM) +
"-" +
(lastD < 10 ? "0" + lastD : lastD); //三十天之前日期
var startDate = new Date(startdateStr);
const dateList = []
const dateList = [];
while (true) {
startDate.setDate(startDate.getDate() + 1)
startDate.setDate(startDate.getDate() + 1);
if (startDate.getTime() <= enddate.getTime()) {
if (startDate.getDate() < 10) {
// startDate.getFullYear() 获取年,此处没加上年份
dateList.push((startDate.getMonth() + 1) + '.0' + startDate.getDate())
dateList.push(startDate.getMonth() + 1 + ".0" + startDate.getDate());
} else {
dateList.push((startDate.getMonth() + 1) + '.' + startDate.getDate())
dateList.push(startDate.getMonth() + 1 + "." + startDate.getDate());
}
} else {
break
break;
}
}
return dateList;
@ -180,9 +333,9 @@ export class HistoriesComponent implements OnInit {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
this.list = []
this.SkipCount = '0'
this.getViolateRecordList()
this.list = [];
this.SkipCount = "0";
this.getViolateRecordList();
}
resetForm(e: MouseEvent): void {
e.preventDefault();
@ -192,27 +345,32 @@ export class HistoriesComponent implements OnInit {
this.validateForm.controls[key].updateValueAndValidity();
}
this.validateForm.patchValue({
organization: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
datePicker: [this.startdate, this.enddate]
organization: JSON.parse(sessionStorage.getItem("userdata")).organization
.id,
datePicker: [this.startdate, this.enddate],
});
this.list = []
this.SkipCount = '0'
this.getViolateRecordList()
this.list = [];
this.SkipCount = "0";
this.getViolateRecordList();
}
//预警类型接口
warningTypes: any //预警接口数据
warningTypesDetails: any
warningTypes: any; //预警接口数据
warningTypesDetails: any;
warningType() {
this.http.get('/api/services/app/Violation/GetAllList').subscribe((data: any) => {
this.warningTypesDetails = data.result
this.warningTypes = (data.result as any).groupBy((t) => { return t.violationType });
})
this.http
.get("/api/services/app/Violation/GetAllList")
.subscribe((data: any) => {
this.warningTypesDetails = data.result;
this.warningTypes = (data.result as any).groupBy((t) => {
return t.violationType;
});
});
}
typeChange(e: any) {
this.warningTypes.forEach(element => {
this.warningTypes.forEach((element) => {
if (element.key == e) {
this.warningTypesDetails = element
this.warningTypesDetails = element;
}
});
this.validateForm.patchValue({
@ -221,84 +379,112 @@ export class HistoriesComponent implements OnInit {
}
look(item) {
console.log('点击item', item)
if (item.violation.eventSystemName == '灭火器维护') {
item.violatedItemSnapshotObj = JSON.parse(item.violatedItemSnapshot)
console.log("点击item", item);
if (item.violation.eventSystemName == "灭火器维护") {
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 {
@ -306,25 +492,28 @@ export class HistoriesComponent implements OnInit {
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,
nzBodyStyle: {
'border': '1px solid #6d9cc7',
'border-radius': '0px',
'padding': '0px',
'box-shadow': '0 0 8px 0 #fff',
'background': '#000D21',
border: "1px solid #6d9cc7",
"border-radius": "0px",
padding: "0px",
"box-shadow": "0 0 8px 0 #fff",
background: "#000D21",
},
nzComponentParams: {
data: item,
isBtn: false
isBtn: false,
},
nzFooter: null,
nzOnOk: async () => {
console.log('推送成功了!!!', item)
}
console.log("推送成功了!!!", item);
},
});
const instance = modal.getContentComponent();
}
}
}

3
src/app/pages/histories/img-list/img-list.component.html

@ -0,0 +1,3 @@
<div class="box">
<textarea name="" id="">{{data}}</textarea>
</div>

8
src/app/pages/histories/img-list/img-list.component.scss

@ -0,0 +1,8 @@
.box{
width: 100%;
min-height: 500px;
textarea{
width: 100%;
height: 500px;
}
}

25
src/app/pages/histories/img-list/img-list.component.spec.ts

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

17
src/app/pages/histories/img-list/img-list.component.ts

@ -0,0 +1,17 @@
import { Component, Input, OnInit } from '@angular/core';
@Component({
selector: 'app-img-list',
templateUrl: './img-list.component.html',
styleUrls: ['./img-list.component.scss']
})
export class ImgListComponent implements OnInit {
@Input() data?: string;
constructor() { }
ngOnInit(): void {
}
}

122
src/app/pages/pages.module.ts

@ -1,53 +1,64 @@
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { A11yModule } from '@angular/cdk/a11y';
import { DragDropModule } from '@angular/cdk/drag-drop';
import { PortalModule } from '@angular/cdk/portal';
import { ScrollingModule } from '@angular/cdk/scrolling';
import { CdkStepperModule } from '@angular/cdk/stepper';
import { CdkTableModule } from '@angular/cdk/table';
import { CdkTreeModule } from '@angular/cdk/tree';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { LoginComponent } from './login/login.component';
import { HomeComponent } from './home/home.component';
import { NzFormModule } from 'ng-zorro-antd/form';
import { NzInputModule } from 'ng-zorro-antd/input';
import { UiModule } from '../ui/ui.module';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { PagesRoutingModule } from './pages-routing.module';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzGridModule } from 'ng-zorro-antd/grid';
import { NzModalModule } from 'ng-zorro-antd/modal';
import { NzPaginationModule } from 'ng-zorro-antd/pagination';
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
import { NzMessageModule } from 'ng-zorro-antd/message';
import { NzSpinModule } from 'ng-zorro-antd/spin';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { NzCollapseModule } from 'ng-zorro-antd/collapse';
import { NzStepsModule } from 'ng-zorro-antd/steps';
import { NzTableModule } from 'ng-zorro-antd/table';
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { NzTimePickerModule } from 'ng-zorro-antd/time-picker';
import { NzProgressModule } from 'ng-zorro-antd/progress';
import { NzPopconfirmModule } from 'ng-zorro-antd/popconfirm';
import { NzBadgeModule } from 'ng-zorro-antd/badge';
import { NzRadioModule } from 'ng-zorro-antd/radio';
import { CriminalRecordsAdminComponent } from './criminal-records-admin/criminal-records-admin.component';
import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select';
import { GetOutOfLineDetailsComponent } from './get-out-of-line-details/get-out-of-line-details.component';
import { NzNotificationModule } from 'ng-zorro-antd/notification';
import { OilUnloadingProcessComponent } from './oil-unloading-process/oil-unloading-process.component';
import { OilUnloadingProcessListComponent } from './oil-unloading-process-list/oil-unloading-process-list.component';
import { ChangePasswordComponent } from './change-password/change-password.component';
import { DisposeequipmentComponent } from './disposeequipment/disposeequipment.component';
import { HistoriesComponent } from './histories/histories.component';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
import { CommonModule } from "@angular/common";
import { A11yModule } from "@angular/cdk/a11y";
import { DragDropModule } from "@angular/cdk/drag-drop";
import { PortalModule } from "@angular/cdk/portal";
import { ScrollingModule } from "@angular/cdk/scrolling";
import { CdkStepperModule } from "@angular/cdk/stepper";
import { CdkTableModule } from "@angular/cdk/table";
import { CdkTreeModule } from "@angular/cdk/tree";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { RouterModule } from "@angular/router";
import { LoginComponent } from "./login/login.component";
import { HomeComponent } from "./home/home.component";
import { NzFormModule } from "ng-zorro-antd/form";
import { NzInputModule } from "ng-zorro-antd/input";
import { UiModule } from "../ui/ui.module";
import { NzButtonModule } from "ng-zorro-antd/button";
import { PagesRoutingModule } from "./pages-routing.module";
import { NzSelectModule } from "ng-zorro-antd/select";
import { NzDatePickerModule } from "ng-zorro-antd/date-picker";
import { NzIconModule } from "ng-zorro-antd/icon";
import { NzGridModule } from "ng-zorro-antd/grid";
import { NzModalModule } from "ng-zorro-antd/modal";
import { NzPaginationModule } from "ng-zorro-antd/pagination";
import { NzDropDownModule } from "ng-zorro-antd/dropdown";
import { NzMessageModule } from "ng-zorro-antd/message";
import { NzSpinModule } from "ng-zorro-antd/spin";
import { NzTreeModule } from "ng-zorro-antd/tree";
import { NzCollapseModule } from "ng-zorro-antd/collapse";
import { NzStepsModule } from "ng-zorro-antd/steps";
import { NzTableModule } from "ng-zorro-antd/table";
import { NzCheckboxModule } from "ng-zorro-antd/checkbox";
import { NzTimePickerModule } from "ng-zorro-antd/time-picker";
import { NzProgressModule } from "ng-zorro-antd/progress";
import { NzPopconfirmModule } from "ng-zorro-antd/popconfirm";
import { NzBadgeModule } from "ng-zorro-antd/badge";
import { NzRadioModule } from "ng-zorro-antd/radio";
import { CriminalRecordsAdminComponent } from "./criminal-records-admin/criminal-records-admin.component";
import { NzTreeSelectModule } from "ng-zorro-antd/tree-select";
import { GetOutOfLineDetailsComponent } from "./get-out-of-line-details/get-out-of-line-details.component";
import { NzNotificationModule } from "ng-zorro-antd/notification";
import { OilUnloadingProcessComponent } from "./oil-unloading-process/oil-unloading-process.component";
import { OilUnloadingProcessListComponent } from "./oil-unloading-process-list/oil-unloading-process-list.component";
import { ChangePasswordComponent } from "./change-password/change-password.component";
import { DisposeequipmentComponent } from "./disposeequipment/disposeequipment.component";
import { HistoriesComponent } from "./histories/histories.component";
import { ImgListComponent } from "./histories/img-list/img-list.component";
@NgModule({
declarations: [LoginComponent, HomeComponent, CriminalRecordsAdminComponent, GetOutOfLineDetailsComponent, OilUnloadingProcessComponent, OilUnloadingProcessListComponent, ChangePasswordComponent, DisposeequipmentComponent, HistoriesComponent],
declarations: [
LoginComponent,
HomeComponent,
CriminalRecordsAdminComponent,
GetOutOfLineDetailsComponent,
OilUnloadingProcessComponent,
OilUnloadingProcessListComponent,
ChangePasswordComponent,
DisposeequipmentComponent,
HistoriesComponent,
ImgListComponent,
],
imports: [
PagesRoutingModule,
@ -86,10 +97,15 @@ import { HistoriesComponent } from './histories/histories.component';
NzNotificationModule,
NzPopconfirmModule,
NzBadgeModule,
NzRadioModule
NzRadioModule,
],
entryComponents: [GetOutOfLineDetailsComponent, OilUnloadingProcessComponent, ChangePasswordComponent, DisposeequipmentComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
entryComponents: [
GetOutOfLineDetailsComponent,
OilUnloadingProcessComponent,
ChangePasswordComponent,
DisposeequipmentComponent,
ImgListComponent,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class PagesModule { }
export class PagesModule {}

Loading…
Cancel
Save