This commit is contained in:
Taric Xin
2021-12-27 17:06:31 +08:00
parent 1a41c2999e
commit 7e6d86d00e
15 changed files with 229 additions and 99 deletions

View File

@ -1,7 +1,9 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STComponent, STColumn, STChange } from '@delon/abc/st';
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form';
import { dateTimePickerUtil } from '@delon/util';
import { NzModalService } from 'ng-zorro-antd/modal';
import { SFItemDateWidget } from 'src/app/shared/widget/sl-form-item-date/sl-form-item-date.widget';
import { SystemService } from '../../services/system.service';
@Component({
@ -25,24 +27,34 @@ export class UserLogsComponent implements OnInit {
hidden: true
}
},
receiveName: {
roleName: {
type: 'string',
title: '登录端口',
ui: { placeholder: '请输入' }
},
phone: {
loginType: {
type: 'string',
title: '登录方式',
ui: { placeholder: '请输入' }
enum: [
{ label: '全部', value: null },
{ label: 'PC', value: '1' },
{ label: 'APP', value: '2' },
{ label: '小程序', value: '3' }
],
ui: {
widget: 'select',
placeholder: '请选择'
},
default: null
},
page: {
address: {
type: 'string',
title: '位置',
ui: {
placeholder: '请输入'
}
},
content: {
terminalIp: {
type: 'string',
title: 'ip',
ui: {
@ -52,13 +64,14 @@ export class UserLogsComponent implements OnInit {
}
}
},
createTime: {
time: {
title: '登录时间',
type: 'string',
ui: {
widget: 'date',
mode: 'range',
format: 'yyyy-MM-dd',
widget: 'item-date',
format: 'yyyy-MM-dd HH:mm:ss',
placeholder: '请选择',
nzShowTime: true,
visibleIf: {
expand: (value: boolean) => value
}
@ -68,36 +81,36 @@ export class UserLogsComponent implements OnInit {
};
columns: STColumn[] = [
{ title: '登录时间', index: 'updatedAt', type: 'date' },
{ title: '登录端口', index: 'description' },
{ title: '姓名', index: 'description' },
{ title: '登录方式', index: 'description' },
{ title: '位置', index: 'description' },
{ title: 'ip', index: 'description' }
{ title: '登录时间', index: 'createTime', type: 'date' },
{ title: '登录端口', index: 'roleName' },
{ title: '姓名', index: 'userName' },
{ title: '登录方式', index: 'loginType', enum: { '1': 'PC', '2': 'APP', '3': '小程序' }, type: 'enum' },
{ title: '位置', index: 'address' },
{ title: 'ip', index: 'terminalIp' }
];
selectedRows: any[] = [];
reqParams = { pageIndex: 1, pageSize: 10 };
_$expand = false;
constructor(public service: SystemService, private nzModalService: NzModalService) {}
constructor(public service: SystemService) {}
ngOnInit(): void {}
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
break;
case 'filter':
this.st.load();
break;
beforeReq = (requestOptions: STRequestOptions) => {
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value,
time: {
start: this.sf.value.time?.start ? dateTimePickerUtil.format(this.sf.value.time?.start, 'yyyy-MM-dd HH:mm:ss') : null,
end: this.sf.value.time?.end ? dateTimePickerUtil.format(this.sf.value.time?.end, 'yyyy-MM-dd HH:mm:ss') : null
}
});
}
}
return requestOptions;
};
roleAction(item?: any) {}
/**
/**
* 重置表单
*/
resetSF() {