This commit is contained in:
Taric Xin
2021-11-30 19:42:42 +08:00
parent 3c753a3b4f
commit 8aca1f7b83
33 changed files with 1588 additions and 12 deletions

View File

@ -0,0 +1,27 @@
<page-header-wrapper title="版本发布记录">
</page-header-wrapper>
<nz-card class="search-box">
<div nz-row nzGutter="8">
<div nz-col [nzSpan]="_$expand ? 24 : 18">
<sf #sf [schema]="searchSchema" [ui]="{ '*': { spanLabelFixed: 90,grid: { span: 8 } }}" [compact]="true"
[button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="6" [nzOffset]="_$expand ? 18 : 0" [class.expend-options]="_$expand" class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</div>
</nz-card>
<nz-card class="content-box">
<st #st [data]="url" [columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading" [scroll]="{ y: '370px' }" (change)="stChange($event)"></st>
</nz-card>

View File

@ -0,0 +1,21 @@
:host::ng-deep {
.search-box {
.ant-card-body {
padding-bottom: 18px;
}
}
.content-box {
.ant-card-body {
padding-top: 14px;
}
}
nz-range-picker {
width: 100%;
}
}
.expend-options {
margin-top: -40px;
}

View File

@ -0,0 +1,109 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STComponent, STColumn, STChange } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { SystemService } from '../../services/system.service';
@Component({
selector: 'app-version-logs',
templateUrl: './version-logs.component.html',
styleUrls: ['./version-logs.component.less']
})
export class VersionLogsComponent implements OnInit {
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false })
sf!: SFComponent;
url = `/rule?_allow_anonymous=true`;
searchSchema: SFSchema = {
properties: {
expand: {
type: 'boolean',
ui: {
hidden: true
}
},
receiveName: {
type: 'string',
title: '端口',
ui: { placeholder: '请输入' }
},
phone: {
type: 'string',
title: '端口方式',
ui: { placeholder: '请输入' }
},
page: {
type: 'string',
title: '版本号',
ui: {
placeholder: '请输入'
}
},
createTime: {
title: '发布时间',
type: 'string',
ui: {
widget: 'date',
mode: 'range',
format: 'yyyy-MM-dd',
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
}
}
};
columns: STColumn[] = [
{ title: '端口', index: 'no' },
{ title: '端口方式', index: 'description' },
{ title: '版本号', index: 'description' },
{
title: '发布时间',
index: 'updatedAt',
type: 'date'
},
{ title: '更新内容', index: 'description' }
];
selectedRows: any[] = [];
reqParams = { pageIndex: 1, pageSize: 10 };
_$expand = false;
constructor(public service: SystemService, private nzModalService: NzModalService) {}
ngOnInit(): void {}
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
break;
case 'filter':
this.st.load();
break;
}
}
roleAction(item?: any) {}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
this._$expand = false;
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/expand', this._$expand);
}
}