Files
bbq/src/app/routes/logs/components/system-supply-logs/system-supply-logs.component.ts
Taric Xin 7a459bb031 edit
2022-04-06 14:40:57 +08:00

92 lines
2.5 KiB
TypeScript

/*
* @Author: your name
* @Date: 2022-01-04 14:42:30
* @LastEditTime: 2022-01-04 16:04:46
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\sys-setting\components\system-supply-logs\system-supply-logs.component.ts
*/
import { Component, OnInit, ViewChild } from '@angular/core';
import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form';
import { dateTimePickerUtil } from '@delon/util';
import { NzModalService } from 'ng-zorro-antd/modal';
import { LogsService } from '../../services/logs.service';
@Component({
selector: 'app-system-logs',
templateUrl: './system-supply-logs.component.html',
styleUrls: ['../../../commom/less/box.less', '../../../commom/less/expend-but.less']
})
export class SystemSupplyLogsComponent implements OnInit {
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
searchSchema: SFSchema = {
properties: {
operateObject: {
type: 'string',
title: '货源编码',
ui: {
placeholder: '请输入',
}
},
time: {
title: '操作时间',
type: 'string',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd HH:mm:ss',
nzShowTime: true,
} as SFDateWidgetSchema
}
}
};
columns: STColumn[] = [
{ title: 'ID', index: 'id' },
{ title: '货源编码', index: 'operateObject' },
{ title: '说明', index: 'operationContent' },
{ title: '操作人', index: 'operator' },
{ title: '操作时间', index: 'operatorTimestamp', type: 'date' },
];
_$expand = false;
constructor(public service: LogsService, private nzModalService: NzModalService) {}
ngOnInit(): void {}
beforeReq = (requestOptions: STRequestOptions) => {
requestOptions.body.operateType = '4'
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value,
operateType: '4',
endTime: this.sf.value.time?.[1] || null,
startTime: this.sf.value.time?.[0] || null
});
}
return requestOptions;
};
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
this._$expand = false;
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/expand', this._$expand);
}
}