Browse Source

[完善]完善接口

master
邵佳豪 3 years ago
parent
commit
b0a542d862
  1. 12686
      package-lock.json
  2. 22
      src/app/pages/criminal-records-admin/criminal-records-admin.component.html
  3. 54
      src/app/pages/criminal-records-admin/criminal-records-admin.component.ts
  4. 7
      src/app/pages/get-out-of-line-details/get-out-of-line-details.component.html
  5. 39
      src/app/pages/get-out-of-line-details/get-out-of-line-details.component.ts
  6. 4
      src/app/pages/home/home.component.html
  7. 81
      src/app/pages/home/home.component.ts
  8. 8
      src/app/pages/login/login.component.ts

12686
package-lock.json generated

File diff suppressed because it is too large Load Diff

22
src/app/pages/criminal-records-admin/criminal-records-admin.component.html

@ -67,14 +67,14 @@
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="searchParams">
<!-- <nz-form-item class="searchParams">
<nz-form-control>
<nz-select nzAllowClear formControlName="disposalState" nzPlaceHolder="请选择处置状态">
<nz-option nzValue="0" nzLabel="已处置"></nz-option>
<nz-option nzValue="1" nzLabel="未处置"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</nz-form-item> -->
<nz-form-item class="searchParams searchParams2">
<nz-form-control>
<nz-range-picker [nzAllowClear]="false" formControlName="datePicker"></nz-range-picker>
@ -117,10 +117,10 @@
<div nz-col nzSpan="2">
所属公司
</div>
<div nz-col nzSpan="3">
<div nz-col nzSpan="4">
管理区域
</div>
<div nz-col nzSpan="2">
<div nz-col nzSpan="3">
加油站
</div>
<div nz-col nzSpan="2">
@ -132,9 +132,9 @@
<div nz-col nzSpan="3">
预警时间
</div>
<div nz-col nzSpan="2">
<!-- <div nz-col nzSpan="2">
状态
</div>
</div> -->
<div nz-col nzSpan="1">
操作
</div>
@ -167,10 +167,10 @@
<div nz-col nzSpan="2" [title]="item.gasStation.companyName">
{{item.gasStation.companyName}}
</div>
<div nz-col nzSpan="3" [title]="item.gasStation.locationName">
<div nz-col nzSpan="4" [title]="item.gasStation.locationName">
{{item.gasStation.locationName}}
</div>
<div nz-col nzSpan="2" [title]="item.gasStation.stationName">
<div nz-col nzSpan="3" [title]="item.gasStation.stationName">
{{item.gasStation.stationName}}
</div>
<div nz-col nzSpan="2" [title]="item.violateArea">
@ -182,10 +182,10 @@
<div nz-col nzSpan="3">
{{item.violateTime | date:"yyyy-MM-dd HH:mm:ss"}}
</div>
<div nz-col nzSpan="2">
<!-- <div nz-col nzSpan="2">
<span *ngIf="item.handleTime">已处置</span>
<span *ngIf="!item.handleTime" style="color: #FF4B65;">未处置</span>
</div>
</div> -->
<div nz-col nzSpan="1">
<span class="look" (click)="look(item)" style="margin-right: 12px;">查看</span>
</div>
@ -252,4 +252,4 @@
</div> -->
</div>
</div>
</div>

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

@ -10,6 +10,8 @@ import { GetOutOfLineDetailsComponent } from '../get-out-of-line-details/get-out
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';
@Component({
selector: 'app-criminal-records-admin',
@ -43,7 +45,7 @@ export class CriminalRecordsAdminComponent implements OnInit {
type: [null],
event: [null],
site: [null],
disposalState: [null],
// disposalState: [null],
datePicker: [[this.startdate, this.enddate]]
});
@ -95,27 +97,28 @@ export class CriminalRecordsAdminComponent implements OnInit {
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
} else {
disposalState = null
}
// let disposalState
// if (this.validateForm.value.disposalState == '0') {
// disposalState = true
// } else if (this.validateForm.value.disposalState == '1') {
// disposalState = false
// } else {
// disposalState = null
// }
let params = {
Level: this.validateForm.value.level,
ViolationIds: ViolationIds,
ViolateArea: this.validateForm.value.site,
OrganizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
IsContainsChildren: 'true',
IsHandled: disposalState,
IsCensored: 'false',
// IsHandled: disposalState,
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
MaxResultCount: this.MaxResultCount //每页50条
}
this.tableSpin = true
this.http.get('/api/services/app/ViolateRecord/GetAll', {
this.http.get('/api/services/app/ViolateRecordCensorship/GetAll', {
params: params
}).subscribe((data: any) => {
this.list = this.list.concat(data.result.items);
@ -124,7 +127,6 @@ export class CriminalRecordsAdminComponent implements OnInit {
this.totalCount = data.result.totalCount
console.log('违规记录列表', data)
this.tableSpin = false
console.log(this.list.length)
})
}
@ -139,6 +141,18 @@ export class CriminalRecordsAdminComponent implements OnInit {
}
}
});
SignalRAspNetCoreHelper.initSignalR();
abp.event.on('abp.notifications.received', this.reloadPage);
}
reloadPage = (userNotification) => {
console.log('abp.notifications.received收到通知', userNotification);
};
ngOnDestroy() {
console.log('退出')
abp.event.off('abp.notifications.received', this.reloadPage);
abp.signalr.disconnect()
}
getThirtyDays() {
//获取当前日期
@ -321,7 +335,20 @@ export class CriminalRecordsAdminComponent implements OnInit {
},
nzFooter: null,
nzOnOk: async () => {
console.log('推送成功了!!!', item)
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.SkipCount = String(Number(this.SkipCount) - 1)
}
}
// this.list = []
// this.SkipCount = '0'
// this.getViolateRecordList()
console.log(this.totalCount)
}
});
const instance = modal.getContentComponent();
@ -334,4 +361,5 @@ export class CriminalRecordsAdminComponent implements OnInit {
return (document.getElementById('tablebox').clientHeight - 32) + 'px'
}
}

7
src/app/pages/get-out-of-line-details/get-out-of-line-details.component.html

@ -49,7 +49,8 @@
</div>
</div> -->
<div class="btnbox">
<button nz-button nzType="primary" (click)="push()">推送</button>
<button nz-button nzType="primary" nzDanger (click)="misinformation()">误报</button>
<button nz-button nzType="primary" [nzLoading]="isPushLoading" (click)="push()">推送</button>
<button nz-button nzType="primary" [nzLoading]="isMisinformationLoading" nzDanger
(click)="misinformation()">误报</button>
</div>
</div>
</div>

39
src/app/pages/get-out-of-line-details/get-out-of-line-details.component.ts

@ -31,39 +31,44 @@ export class GetOutOfLineDetailsComponent implements OnInit {
contentType(type) {
this.selectedType = type
}
submit() {
isPushLoading = false
isMisinformationLoading = false
//推送
push() {
this.isPushLoading = true
let body = {
id: this.data.id,
handleRecord: this.content
positive: true
}
this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
this.http.post('/api/services/app/ViolateRecordCensorship/CensorViolateRecord', body).subscribe(data => {
this.message.create('success', '处置成功!');
this.data.handleTime = new Date()
this.data.handleRecord = this.content
this.isPushLoading = false
this.initialModal.triggerOk()
}, err => {
this.message.create('error', '处置失败!请联系管理员');
this.isPushLoading = false
})
}
//推送
push() {
this.initialModal.triggerOk()
}
//误报
misinformation() {
this.modal.confirm({
nzTitle: '判定该预警为误报吗?',
// nzContent: '<b style="color: red;">Some descriptions</b>',
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
this.isMisinformationLoading = true
let body = {
id: this.data.id,
handleRecord: this.content ? this.content : '此条预警为误报',
isFalsePositive: true
positive: false
}
// this.http.post('/api/services/app/ViolateRecord/HandleViolateRecord', body).subscribe(data => {
// this.message.create('success', '处置成功!');
// this.data.handleTime = new Date()
// this.content ? this.data.handleRecord = this.content : this.data.handleRecord = '此条预警为误报'
// })
this.http.post('/api/services/app/ViolateRecordCensorship/CensorViolateRecord', body).subscribe(data => {
this.message.create('success', '处置成功!');
this.isMisinformationLoading = false
this.initialModal.triggerOk()
}, err => {
this.isMisinformationLoading = false
this.message.create('error', '处置失败!请联系管理员');
})
},
nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel')

4
src/app/pages/home/home.component.html

@ -37,9 +37,9 @@
<li nz-menu-item (click)="signOut()">退出系统</li>
</ul>
</nz-dropdown-menu>
<span style="margin: 0 12px;" *ngIf="isGasStationBack">|</span>
<!-- <span style="margin: 0 12px;" *ngIf="isGasStationBack">|</span>
<img style="cursor: pointer;" *ngIf="isGasStationBack" src="../../../assets/images/goback.png" alt=""
(click)="goback()">
(click)="goback()"> -->
</div>
</div>

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

@ -34,53 +34,15 @@ export class HomeComponent implements OnInit {
});
}
isGasStationNav: boolean
isGasStation: boolean
isGasStationBack: boolean
num
surname: string
userName: string
ngOnInit(): void {
this.navChangeService.getMessage().subscribe((message: any) => {
console.log(message);//send a message
if (message.name == 'oilstation') {
this.isGasStationNav = true
}
});
if (this.router.url.indexOf('petrolStation') != -1 && sessionStorage.getItem('isGasStation') == 'false') {//控制返回按钮显示
this.isGasStationBack = true
} else {
this.isGasStationBack = false
}
// if (this.router.url.indexOf('petrolStation') != -1 && sessionStorage.getItem('isGasStation') == 'true') {
// this.isGasStation = true
// } else {
// this.isGasStation = false
// }
if (sessionStorage.getItem('isGasStation') == 'true') {
this.isGasStation = true
this.isGasStationNav = true
} else {
this.isGasStation = false
this.isGasStationNav = false
}
this.router.events.pipe(
filter(event => event instanceof NavigationEnd)
).subscribe((event: any) => {
if (event.url.indexOf('petrolStation') != -1 && sessionStorage.getItem('isGasStation') == 'false') {//控制返回按钮显示
this.isGasStationBack = true
} else {
this.isGasStationBack = false
}
});
//右上角信息
setInterval(() => {
this.getTime()
}, 1000);
@ -92,8 +54,7 @@ export class HomeComponent implements OnInit {
this.surname = JSON.parse(sessionStorage.getItem('userdata')).name
this.userName = JSON.parse(sessionStorage.getItem('userdata')).userName
}
//修改密码提示框
if ((sessionStorage.getItem('isDefaultPassword') == 'true' || sessionStorage.getItem('isPasswordExpired') == 'true') && JSON.parse(sessionStorage.getItem('userdata')).userName != 'admin') {
this.changePasswordPopup()
}
@ -127,6 +88,7 @@ export class HomeComponent implements OnInit {
this.isVisible = false;
//清除sessionStorage
sessionStorage.removeItem('isDefaultPassword')
sessionStorage.removeItem('isPasswordExpired')
}, err => {
this.message.create('warning', err.error.error.message);
this.isConfirmLoading = false;
@ -150,8 +112,8 @@ export class HomeComponent implements OnInit {
};
ngAfterViewInit() {
SignalRAspNetCoreHelper.initSignalR();
abp.event.on('abp.notifications.received', this.reloadPage);
// SignalRAspNetCoreHelper.initSignalR();
// abp.event.on('abp.notifications.received', this.reloadPage);
}
messageId = []
receiptOfNotification(userNotification) {
@ -294,17 +256,7 @@ export class HomeComponent implements OnInit {
this.notificationService.remove(element.messageId)
}
})
this.readMess(item.notification.id)
})
}
//标记为已读
readMess(id) {
let body = {
id: id
}
this.http.post('/api/services/app/Notification/Read', body).subscribe((data: any) => {
console.log('标记已读成功')
// this.readMess(item.notification.id)
})
}
close(item) {
@ -318,9 +270,9 @@ export class HomeComponent implements OnInit {
ngOnDestroy() {
console.log('退出')
abp.event.off('abp.notifications.received', this.reloadPage);
abp.signalr.disconnect()
// console.log('退出')
// abp.event.off('abp.notifications.received', this.reloadPage);
// abp.signalr.disconnect()
}
//获得时间
@ -358,15 +310,6 @@ export class HomeComponent implements OnInit {
this.router.navigate(['/login'])
}
navChange(router) {
this.router.navigate([router])
}
goback() {
this.router.navigate(['/plan'])
this.isGasStationNav = false
}
//全屏
isfullscreen: boolean = false;
@ -408,9 +351,7 @@ export class HomeComponent implements OnInit {
this.isfullscreen = false;
}
//修改密码
changePassword() {
const modal: any = this.modal.create({
nzTitle: '修改密码',

8
src/app/pages/login/login.component.ts

@ -97,7 +97,7 @@ export class LoginComponent implements OnInit {
(data: any) => {
sessionStorage.setItem("token", data.result.accessToken);
sessionStorage.setItem("encryptedAccessToken", data.result.encryptedAccessToken);
console.log('token', data.result)
// console.log('token', data.result)
this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe((data: any) => {
console.log('GetCurrentLoginInformations', data.result)
sessionStorage.setItem('userdata', JSON.stringify(data.result.user))
@ -109,9 +109,13 @@ export class LoginComponent implements OnInit {
this.rememberInfo()
//自动登录
this.autoLogin()
if (data.result.user.userName == 'admin') {
if (data.result.user.roles.find((item) => {
return item.name == 'ViolationPositiveCensorer'
})) {
this.router.navigate(['/records'])
this.message.create('success', `登录成功`);
} else {
this.message.create('warning', `该账号没有预警审核权限`);
}
}, err => {
this.isLoading = false;

Loading…
Cancel
Save