Browse Source

[完善]完善接口

master
邵佳豪 3 years ago
parent
commit
b0a542d862
  1. 13880
      package-lock.json
  2. 20
      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. 5
      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

13880
package-lock.json generated

File diff suppressed because it is too large Load Diff

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

@ -67,14 +67,14 @@
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item class="searchParams"> <!-- <nz-form-item class="searchParams">
<nz-form-control> <nz-form-control>
<nz-select nzAllowClear formControlName="disposalState" nzPlaceHolder="请选择处置状态"> <nz-select nzAllowClear formControlName="disposalState" nzPlaceHolder="请选择处置状态">
<nz-option nzValue="0" nzLabel="已处置"></nz-option> <nz-option nzValue="0" nzLabel="已处置"></nz-option>
<nz-option nzValue="1" nzLabel="未处置"></nz-option> <nz-option nzValue="1" nzLabel="未处置"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item> -->
<nz-form-item class="searchParams searchParams2"> <nz-form-item class="searchParams searchParams2">
<nz-form-control> <nz-form-control>
<nz-range-picker [nzAllowClear]="false" formControlName="datePicker"></nz-range-picker> <nz-range-picker [nzAllowClear]="false" formControlName="datePicker"></nz-range-picker>
@ -117,10 +117,10 @@
<div nz-col nzSpan="2"> <div nz-col nzSpan="2">
所属公司 所属公司
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="4">
管理区域 管理区域
</div> </div>
<div nz-col nzSpan="2"> <div nz-col nzSpan="3">
加油站 加油站
</div> </div>
<div nz-col nzSpan="2"> <div nz-col nzSpan="2">
@ -132,9 +132,9 @@
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
预警时间 预警时间
</div> </div>
<div nz-col nzSpan="2"> <!-- <div nz-col nzSpan="2">
状态 状态
</div> </div> -->
<div nz-col nzSpan="1"> <div nz-col nzSpan="1">
操作 操作
</div> </div>
@ -167,10 +167,10 @@
<div nz-col nzSpan="2" [title]="item.gasStation.companyName"> <div nz-col nzSpan="2" [title]="item.gasStation.companyName">
{{item.gasStation.companyName}} {{item.gasStation.companyName}}
</div> </div>
<div nz-col nzSpan="3" [title]="item.gasStation.locationName"> <div nz-col nzSpan="4" [title]="item.gasStation.locationName">
{{item.gasStation.locationName}} {{item.gasStation.locationName}}
</div> </div>
<div nz-col nzSpan="2" [title]="item.gasStation.stationName"> <div nz-col nzSpan="3" [title]="item.gasStation.stationName">
{{item.gasStation.stationName}} {{item.gasStation.stationName}}
</div> </div>
<div nz-col nzSpan="2" [title]="item.violateArea"> <div nz-col nzSpan="2" [title]="item.violateArea">
@ -182,10 +182,10 @@
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
{{item.violateTime | date:"yyyy-MM-dd HH:mm:ss"}} {{item.violateTime | date:"yyyy-MM-dd HH:mm:ss"}}
</div> </div>
<div nz-col nzSpan="2"> <!-- <div nz-col nzSpan="2">
<span *ngIf="item.handleTime">已处置</span> <span *ngIf="item.handleTime">已处置</span>
<span *ngIf="!item.handleTime" style="color: #FF4B65;">未处置</span> <span *ngIf="!item.handleTime" style="color: #FF4B65;">未处置</span>
</div> </div> -->
<div nz-col nzSpan="1"> <div nz-col nzSpan="1">
<span class="look" (click)="look(item)" style="margin-right: 12px;">查看</span> <span class="look" (click)="look(item)" style="margin-right: 12px;">查看</span>
</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 { NzMessageService } from 'ng-zorro-antd/message';
import { TreeService } from 'src/app/service/tree.service'; import { TreeService } from 'src/app/service/tree.service';
import { DisposeequipmentComponent } from '../disposeequipment/disposeequipment.component'; import { DisposeequipmentComponent } from '../disposeequipment/disposeequipment.component';
import { SignalRAspNetCoreHelper } from '../../../shared/helpers/SignalRAspNetCoreHelper';
declare var abp: any
import 'linqjs'; import 'linqjs';
@Component({ @Component({
selector: 'app-criminal-records-admin', selector: 'app-criminal-records-admin',
@ -43,7 +45,7 @@ export class CriminalRecordsAdminComponent implements OnInit {
type: [null], type: [null],
event: [null], event: [null],
site: [null], site: [null],
disposalState: [null], // disposalState: [null],
datePicker: [[this.startdate, this.enddate]] datePicker: [[this.startdate, this.enddate]]
}); });
@ -95,27 +97,28 @@ export class CriminalRecordsAdminComponent implements OnInit {
item.id ? ViolationIds.push(item.id) : null item.id ? ViolationIds.push(item.id) : null
}); });
} }
let disposalState // let disposalState
if (this.validateForm.value.disposalState == '0') { // if (this.validateForm.value.disposalState == '0') {
disposalState = true // disposalState = true
} else if (this.validateForm.value.disposalState == '1') { // } else if (this.validateForm.value.disposalState == '1') {
disposalState = false // disposalState = false
} else { // } else {
disposalState = null // disposalState = null
} // }
let params = { let params = {
Level: this.validateForm.value.level, Level: this.validateForm.value.level,
ViolationIds: ViolationIds, ViolationIds: ViolationIds,
ViolateArea: this.validateForm.value.site, ViolateArea: this.validateForm.value.site,
OrganizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id, OrganizationUnitId: JSON.parse(sessionStorage.getItem('userdata')).organization.id,
IsContainsChildren: 'true', 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, 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, SkipCount: this.SkipCount,
MaxResultCount: this.MaxResultCount MaxResultCount: this.MaxResultCount //每页50条
} }
this.tableSpin = true this.tableSpin = true
this.http.get('/api/services/app/ViolateRecord/GetAll', { this.http.get('/api/services/app/ViolateRecordCensorship/GetAll', {
params: params params: params
}).subscribe((data: any) => { }).subscribe((data: any) => {
this.list = this.list.concat(data.result.items); this.list = this.list.concat(data.result.items);
@ -124,7 +127,6 @@ export class CriminalRecordsAdminComponent implements OnInit {
this.totalCount = data.result.totalCount this.totalCount = data.result.totalCount
console.log('违规记录列表', data) console.log('违规记录列表', data)
this.tableSpin = false this.tableSpin = false
console.log(this.list.length) 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() { getThirtyDays() {
//获取当前日期 //获取当前日期
@ -321,7 +335,20 @@ export class CriminalRecordsAdminComponent implements OnInit {
}, },
nzFooter: null, nzFooter: null,
nzOnOk: async () => { 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(); const instance = modal.getContentComponent();
@ -334,4 +361,5 @@ export class CriminalRecordsAdminComponent implements OnInit {
return (document.getElementById('tablebox').clientHeight - 32) + 'px' return (document.getElementById('tablebox').clientHeight - 32) + 'px'
} }
} }

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

@ -49,7 +49,8 @@
</div> </div>
</div> --> </div> -->
<div class="btnbox"> <div class="btnbox">
<button nz-button nzType="primary" (click)="push()">推送</button> <button nz-button nzType="primary" [nzLoading]="isPushLoading" (click)="push()">推送</button>
<button nz-button nzType="primary" nzDanger (click)="misinformation()">误报</button> <button nz-button nzType="primary" [nzLoading]="isMisinformationLoading" nzDanger
(click)="misinformation()">误报</button>
</div> </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) { contentType(type) {
this.selectedType = type this.selectedType = type
} }
submit() { isPushLoading = false
isMisinformationLoading = false
//推送
push() {
this.isPushLoading = true
let body = { let body = {
id: this.data.id, 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.message.create('success', '处置成功!');
this.data.handleTime = new Date() this.isPushLoading = false
this.data.handleRecord = this.content
})
}
//推送
push() {
this.initialModal.triggerOk() this.initialModal.triggerOk()
}, err => {
this.message.create('error', '处置失败!请联系管理员');
this.isPushLoading = false
})
} }
//误报 //误报
misinformation() { misinformation() {
this.modal.confirm({ this.modal.confirm({
nzTitle: '判定该预警为误报吗?', nzTitle: '判定该预警为误报吗?',
// nzContent: '<b style="color: red;">Some descriptions</b>',
nzOkText: '确定', nzOkText: '确定',
nzOkType: 'danger', nzOkType: 'danger',
nzOnOk: () => { nzOnOk: () => {
this.isMisinformationLoading = true
let body = { let body = {
id: this.data.id, id: this.data.id,
handleRecord: this.content ? this.content : '此条预警为误报', positive: false
isFalsePositive: 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.message.create('success', '处置成功!');
// this.data.handleTime = new Date() this.isMisinformationLoading = false
// this.content ? this.data.handleRecord = this.content : this.data.handleRecord = '此条预警为误报' this.initialModal.triggerOk()
// }) }, err => {
this.isMisinformationLoading = false
this.message.create('error', '处置失败!请联系管理员');
})
}, },
nzCancelText: '取消', nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel') nzOnCancel: () => console.log('Cancel')

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

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

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

@ -34,53 +34,15 @@ export class HomeComponent implements OnInit {
}); });
} }
isGasStationNav: boolean
isGasStation: boolean isGasStation: boolean
isGasStationBack: boolean
num num
surname: string surname: string
userName: string userName: string
ngOnInit(): void { 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(() => { setInterval(() => {
this.getTime() this.getTime()
}, 1000); }, 1000);
@ -92,8 +54,7 @@ export class HomeComponent implements OnInit {
this.surname = JSON.parse(sessionStorage.getItem('userdata')).name this.surname = JSON.parse(sessionStorage.getItem('userdata')).name
this.userName = JSON.parse(sessionStorage.getItem('userdata')).userName this.userName = JSON.parse(sessionStorage.getItem('userdata')).userName
} }
//修改密码提示框
if ((sessionStorage.getItem('isDefaultPassword') == 'true' || sessionStorage.getItem('isPasswordExpired') == 'true') && JSON.parse(sessionStorage.getItem('userdata')).userName != 'admin') { if ((sessionStorage.getItem('isDefaultPassword') == 'true' || sessionStorage.getItem('isPasswordExpired') == 'true') && JSON.parse(sessionStorage.getItem('userdata')).userName != 'admin') {
this.changePasswordPopup() this.changePasswordPopup()
} }
@ -127,6 +88,7 @@ export class HomeComponent implements OnInit {
this.isVisible = false; this.isVisible = false;
//清除sessionStorage //清除sessionStorage
sessionStorage.removeItem('isDefaultPassword') sessionStorage.removeItem('isDefaultPassword')
sessionStorage.removeItem('isPasswordExpired')
}, err => { }, err => {
this.message.create('warning', err.error.error.message); this.message.create('warning', err.error.error.message);
this.isConfirmLoading = false; this.isConfirmLoading = false;
@ -150,8 +112,8 @@ export class HomeComponent implements OnInit {
}; };
ngAfterViewInit() { ngAfterViewInit() {
SignalRAspNetCoreHelper.initSignalR(); // SignalRAspNetCoreHelper.initSignalR();
abp.event.on('abp.notifications.received', this.reloadPage); // abp.event.on('abp.notifications.received', this.reloadPage);
} }
messageId = [] messageId = []
receiptOfNotification(userNotification) { receiptOfNotification(userNotification) {
@ -294,17 +256,7 @@ export class HomeComponent implements OnInit {
this.notificationService.remove(element.messageId) this.notificationService.remove(element.messageId)
} }
}) })
this.readMess(item.notification.id) // 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('标记已读成功')
}) })
} }
close(item) { close(item) {
@ -318,9 +270,9 @@ export class HomeComponent implements OnInit {
ngOnDestroy() { ngOnDestroy() {
console.log('退出') // console.log('退出')
abp.event.off('abp.notifications.received', this.reloadPage); // abp.event.off('abp.notifications.received', this.reloadPage);
abp.signalr.disconnect() // abp.signalr.disconnect()
} }
//获得时间 //获得时间
@ -358,15 +310,6 @@ export class HomeComponent implements OnInit {
this.router.navigate(['/login']) this.router.navigate(['/login'])
} }
navChange(router) {
this.router.navigate([router])
}
goback() {
this.router.navigate(['/plan'])
this.isGasStationNav = false
}
//全屏 //全屏
isfullscreen: boolean = false; isfullscreen: boolean = false;
@ -408,9 +351,7 @@ export class HomeComponent implements OnInit {
this.isfullscreen = false; this.isfullscreen = false;
} }
//修改密码 //修改密码
changePassword() { changePassword() {
const modal: any = this.modal.create({ const modal: any = this.modal.create({
nzTitle: '修改密码', nzTitle: '修改密码',

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

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

Loading…
Cancel
Save