From b7d054ab18f59c7a23d4c3ecd2b9fd031a6ffe0c Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Tue, 28 Dec 2021 10:02:41 +0800 Subject: [PATCH] edit --- .../system-logs/system-logs.component.ts | 7 +++--- .../user-logs/user-logs.component.ts | 6 ++--- .../version-logs/version-logs.component.ts | 9 ++++--- .../from-to-search/from-to-search.widget.html | 22 +++++------------ .../from-to-search.widget.spec.ts | 24 ------------------- 5 files changed, 16 insertions(+), 52 deletions(-) delete mode 100644 src/app/shared/widget/from-to-search/from-to-search.widget.spec.ts diff --git a/src/app/routes/sys-setting/components/system-logs/system-logs.component.ts b/src/app/routes/sys-setting/components/system-logs/system-logs.component.ts index 818d024c..dcb8fa1e 100644 --- a/src/app/routes/sys-setting/components/system-logs/system-logs.component.ts +++ b/src/app/routes/sys-setting/components/system-logs/system-logs.component.ts @@ -55,9 +55,8 @@ export class SystemLogsComponent implements OnInit { title: '登录时间', type: 'string', ui: { - widget: 'item-date', + widget: 'sl-from-to-search', format: 'yyyy-MM-dd HH:mm:ss', - placeholder: '请选择', nzShowTime: true, visibleIf: { expand: (value: boolean) => value @@ -85,8 +84,8 @@ export class SystemLogsComponent implements OnInit { if (this.sf) { Object.assign(requestOptions.body, { ...this.sf.value, - endTime: this.sf.value.time?.end ? dateTimePickerUtil.format(this.sf.value.time?.end, 'yyyy-MM-dd HH:mm:ss') : null, - startTime: this.sf.value.time?.start ? dateTimePickerUtil.format(this.sf.value.time?.start, 'yyyy-MM-dd HH:mm:ss') : null + endTime: this.sf.value.time?.[1] || null, + startTime: this.sf.value.time?.[0] || null }); } return requestOptions; diff --git a/src/app/routes/sys-setting/components/user-logs/user-logs.component.ts b/src/app/routes/sys-setting/components/user-logs/user-logs.component.ts index 17327a1c..de514d33 100644 --- a/src/app/routes/sys-setting/components/user-logs/user-logs.component.ts +++ b/src/app/routes/sys-setting/components/user-logs/user-logs.component.ts @@ -68,7 +68,7 @@ export class UserLogsComponent implements OnInit { title: '登录时间', type: 'string', ui: { - widget: 'item-date', + widget: 'sl-from-to-search', format: 'yyyy-MM-dd HH:mm:ss', placeholder: '请选择', nzShowTime: true, @@ -100,8 +100,8 @@ export class UserLogsComponent implements OnInit { 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 + start: this.sf.value.time?.[0] || null, + end: this.sf.value.time?.[1] || null } }); } diff --git a/src/app/routes/sys-setting/components/version-logs/version-logs.component.ts b/src/app/routes/sys-setting/components/version-logs/version-logs.component.ts index 6ab9b2f5..246531b9 100644 --- a/src/app/routes/sys-setting/components/version-logs/version-logs.component.ts +++ b/src/app/routes/sys-setting/components/version-logs/version-logs.component.ts @@ -61,12 +61,11 @@ export class VersionLogsComponent implements OnInit { placeholder: '请输入' } }, - createTime: { + time: { title: '发布时间', type: 'string', ui: { - widget: 'date', - mode: 'range', + widget: 'sl-from-to-search', format: 'yyyy-MM-dd', visibleIf: { expand: (value: boolean) => value @@ -97,8 +96,8 @@ export class VersionLogsComponent implements OnInit { Object.assign(requestOptions.body, { ...this.sf.value, publishTime: { - 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 + start: this.sf.value.time?.[0] || null, + end: this.sf.value.time?.[1] || null } }); } diff --git a/src/app/shared/widget/from-to-search/from-to-search.widget.html b/src/app/shared/widget/from-to-search/from-to-search.widget.html index 09bb8e2a..a93299cd 100644 --- a/src/app/shared/widget/from-to-search/from-to-search.widget.html +++ b/src/app/shared/widget/from-to-search/from-to-search.widget.html @@ -1,21 +1,11 @@ -
- +
+ - - +
- + \ No newline at end of file diff --git a/src/app/shared/widget/from-to-search/from-to-search.widget.spec.ts b/src/app/shared/widget/from-to-search/from-to-search.widget.spec.ts deleted file mode 100644 index b6c2ac84..00000000 --- a/src/app/shared/widget/from-to-search/from-to-search.widget.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SLFromToSearchWidget } from './from-to-search.widget'; - -describe('SLFromToSearchWidget', () => { - let component: SLFromToSearchWidget; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [SLFromToSearchWidget], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(SLFromToSearchWidget); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -});