This commit is contained in:
Taric Xin
2021-12-02 17:35:43 +08:00
parent d1467d4f45
commit 436dd750d3
18 changed files with 2900 additions and 10 deletions

View File

@ -0,0 +1,52 @@
<page-header-wrapper title="货物名称配置">
</page-header-wrapper>
<nz-card>
<div class="d-flex">
<div style="width: 250px;">
<nz-list nzBordered [nzHeader]="listHeader">
<nz-list-item *ngFor="let item of typeList;let i = index"
[ngClass]="{'select-type': selectedType===item.id}">
<div class="d-flex justify-content-between align-items-center" style="width: 100%;">
<label style="flex:1">{{item.title}}</label>
<i nz-icon nzType="more" nzTheme="outline" style="font-size: 18px;cursor: pointer;" nz-dropdown
[nzDropdownMenu]="menu" nzTrigger="click"></i>
</div>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li nz-menu-item>编辑{{i}}</li>
<li nz-menu-item>上移</li>
<li nz-menu-item>下移</li>
<li nz-menu-item nzDanger>删除</li>
</ul>
</nz-dropdown-menu>
</nz-list-item>
</nz-list>
<ng-template #listHeader>
<div class="d-flex justify-content-between align-items-center">
<label style="font-weight: 700;font-size: 16px;">货物类型</label>
<button nz-button nzType="primary"><i nz-icon nzType="plus" nzTheme="outline"></i>新增</button>
</div>
</ng-template>
</div>
<div style="flex: 1;" class="ml-md">
<div class="d-flex justify-content-between align-items-center mb-md">
<nz-input-group [nzSuffix]="suffixTemplateInfo" style="width: 300px;">
<input type="text" nz-input placeholder="请输入货物名称" />
</nz-input-group>
<ng-template #suffixTemplateInfo><i nz-icon nzType="search" nzTheme="outline"></i></ng-template>
<button nz-button nzType="primary"><i nz-icon nzType="plus" nzTheme="outline"></i>新增</button>
</div>
<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' }"></st>
</div>
</div>
</nz-card>

View File

@ -0,0 +1,11 @@
:host::ng-deep {
.ant-list-items {
max-height: 600px;
overflow : auto;
}
}
.select-type {
color : #1890ff;
background-color: rgb(230 247 255);
}

View File

@ -0,0 +1,74 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { STComponent, STColumn } from '@delon/abc/st';
import { NzModalService } from 'ng-zorro-antd/modal';
import { SystemService } from '../../services/system.service';
@Component({
selector: 'app-goods-name-config',
templateUrl: './goods-name-config.component.html',
styleUrls: ['./goods-name-config.component.less']
})
export class GoodsNameConfigComponent implements OnInit {
typeList = [
{ title: '零件配件', sort: 1, id: 1 },
{ title: '衣用物资', sort: 2, id: 2 },
{ title: '空包装', sort: 3, id: 3 },
{ title: '废品废料', sort: 4, id: 4 },
{ title: '家具家居', sort: 8, id: 5 },
{ title: '衣用物资', sort: 6, id: 6 },
{ title: '空包装', sort: 7, id: 7 },
{ title: '衣用物资', sort: 8, id: 8 },
{ title: '空包装', sort: 9, id: 9 },
{ title: '废品废料', sort: 10, id: 10 },
{ title: '废品废料2', sort: 11, id: 11 },
{ title: '废品废料3', sort: 12, id: 12 },
{ title: '零件配件', sort: 1, id: 1 },
{ title: '衣用物资', sort: 2, id: 2 },
{ title: '空包装', sort: 3, id: 3 },
{ title: '废品废料', sort: 4, id: 4 },
{ title: '家具家居', sort: 8, id: 5 },
{ title: '衣用物资', sort: 6, id: 6 },
{ title: '空包装', sort: 7, id: 7 },
{ title: '衣用物资', sort: 8, id: 8 },
{ title: '空包装', sort: 9, id: 9 },
{ title: '废品废料', sort: 10, id: 10 },
{ title: '废品废料2', sort: 11, id: 11 },
{ title: '废品废料3', sort: 12, id: 12 }
];
selectedType = 1;
@ViewChild('st', { static: true })
st!: STComponent;
url = `/rule?_allow_anonymous=true`;
reqParams = {};
columns: STColumn[] = [
{ title: '货物名称', index: 'no' },
{ title: '更新时间', index: 'description' },
{
title: '操作',
buttons: [
{
text: '编辑'
// click: item => this.staffAction(item)
},
{
text: '上移',
iif: item => item.no !== 0
// click: item => this.action(2)
},
{
text: '下移',
iif: item => item.status !== 10
// click: item => this.action(1)
},
{
text: '删除',
// click: item => this.action(3)
}
]
}
];
constructor(public service: SystemService, private nzModalService: NzModalService) {}
ngOnInit(): void {}
}