Browse Source

[完善]操作日志的完善

非煤矿山灾害智能感知和预警系统
邵佳豪 2 years ago
parent
commit
dc3f4522e7
  1. 12
      src/app/home/basic-info/unit-details/operation-log/operation-log.component.html
  2. 3
      src/app/home/basic-info/unit-details/operation-log/operation-log.component.scss
  3. 17
      src/app/home/basic-info/unit-details/operation-log/operation-log.component.ts
  4. 2
      src/app/home/nav/nav.component.html
  5. 3
      src/app/home/nav/nav.component.ts
  6. 8
      src/app/home/task/station-task-execution/station-task-execution.component.ts
  7. 1
      src/app/http-interceptors/base-interceptor.ts
  8. 4
      src/app/service/cache-token.service.ts

12
src/app/home/basic-info/unit-details/operation-log/operation-log.component.html

@ -1,10 +1,16 @@
<div class="box">
<div *ngFor="let item of logList" class="item">
{{item.userName}}在{{item.auditTime | date:"yyyy-MM-dd hh:mm:ss"}}{{item.entityState}}了{{item.auditDetails['详情数据'] ? '基本情况表格' : '单位基本信息'}}
{{item.userName}}在{{item.auditTime | date:"yyyy-MM-dd hh:mm:ss"}}进行了{{item.entityState}}操作
<div *ngIf="item.list.length != 0">
修改内容 :
操作内容 :
<span *ngFor="let item of item.list">
{{item.name}}修改为<span class="blue">{{item.value}}</span> ;
<ng-container *ngIf="item.name == '详情数据'; else elseTemplate">
修改了基本情况表格 ;&nbsp;
</ng-container>
<ng-template #elseTemplate>
将{{item.name}}从<span class="blue">{{item.value.originalValue || '无'}}</span>修改为<span
class="blue">{{item.value.currentValue}}</span> ;&nbsp;
</ng-template>
</span>
</div>
</div>

3
src/app/home/basic-info/unit-details/operation-log/operation-log.component.scss

@ -4,7 +4,8 @@
}
.item{
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
flex-wrap: wrap;
box-sizing: border-box;
padding: 10px 0;

17
src/app/home/basic-info/unit-details/operation-log/operation-log.component.ts

@ -27,18 +27,17 @@ export class OperationLogComponent implements OnInit {
data.forEach(element => {
element.list = []
if (!element.auditDetails['详情数据']) {
for (const key in element.auditDetails) {
if (Object.prototype.hasOwnProperty.call(element.auditDetails, key)) {
const item = element.auditDetails[key];
let obj = {
name: key,
value: item
}
element.list.push(obj)
for (const key in element.auditDetails) {
if (Object.prototype.hasOwnProperty.call(element.auditDetails, key)) {
const item = element.auditDetails[key];
let obj = {
name: key,
value: item
}
element.list.push(obj)
}
}
});
this.logList = data
console.log('日志', this.logList)

2
src/app/home/nav/nav.component.html

@ -19,7 +19,7 @@
</li>
</ul>
<div class="headerbtn">
<div class="username">欢迎 , {{user}}</div>
<div class="username" [title]="user">欢迎 , {{user}}</div>
<div class="iconbox" nz-popover nzPopoverTitle="消息列表" [(nzPopoverVisible)]="visible" [nzPopoverTrigger]=null
[nzPopoverContent]="contentTemplateMess" nzPopoverPlacement="bottomRight" (click)="clickMe()"
[nzPopoverOverlayStyle]="{'padding': '0'}">

3
src/app/home/nav/nav.component.ts

@ -38,8 +38,9 @@ export class NavComponent implements OnInit {
signalR.initSR();
// 接收来自中心的消息
(signalR.SR as any).on('receiveNotification', (message: any, senderName: string) => {
console.log('收到消息---', message)
//1.右下角弹窗(新增任务提示)
console.log('收到消息---', message)
this.methodService.notificationsList.unshift(message)
if (message.planTaskState == 'added') {
this.createBasicNotification(message)

8
src/app/home/task/station-task-execution/station-task-execution.component.ts

@ -221,10 +221,10 @@ export class StationTaskExecutionComponent implements OnInit {
let date = '2022-9-10'
let t2 = Date.parse(date)
this.methodService.countdown(t1, t2, (res) => {
// console.log(666, res)
this.time1 = res.day + '天' + res.hour + '小时'
})
// this.methodService.countdown(t1, t2, (res) => {
// // console.log(666, res)
// this.time1 = res.day + '天' + res.hour + '小时'
// })
}
timer

1
src/app/http-interceptors/base-interceptor.ts

@ -30,6 +30,7 @@ export class BaseInterceptor implements HttpInterceptor {
url: req.hadBaseurl ? `${req.url}` : `${req.url}`,
});
if (!req.cancelToken) {
/*获取token*/
let token = sessionStorage.getItem('token')
/*此处设置额外请求头,token令牌*/

4
src/app/service/cache-token.service.ts

@ -21,8 +21,8 @@ export class CacheTokenService {
refreshToken: refreshToken
}).subscribe((data: any) => {
// console.log('定时刷新token成功', data)
// sessionStorage.setItem("token", data.token);
// sessionStorage.setItem("refreshToken", data.refreshToken);
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
})
}, 60 * 1000)
console.log('启动定时刷新token')

Loading…
Cancel
Save