车辆对接
This commit is contained in:
		| @ -0,0 +1,37 @@ | ||||
| <!-- | ||||
|  * @Author: your name | ||||
|  * @Date: 2021-12-24 15:38:08 | ||||
|  * @LastEditTime: 2021-12-24 15:58:48 | ||||
|  * @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\crm-management\crm-management.component.html | ||||
| --> | ||||
| <page-header-wrapper title="网络货运人"> | ||||
| </page-header-wrapper> | ||||
|  | ||||
| <nz-card class="search-box"> | ||||
|     <div nz-row nzGutter="8"> | ||||
|         <div nz-col [nzSpan]="6"> | ||||
|             <sf #sf [schema]="searchSchema" [ui]="{ '*': { spanLabelFixed: 90,grid: { span: 24 } }}" [compact]="true" | ||||
|                 [button]="'none'"></sf> | ||||
|         </div> | ||||
|         <div nz-col [nzSpan]="8" nzOffset="1"> | ||||
|             <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button> | ||||
|             <button nz-button (click)="resetSF()">重置</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </nz-card> | ||||
|  | ||||
| <nz-card class="content-box"> | ||||
|  | ||||
|     <div class="d-flex justify-content-end mb-sm"> | ||||
|         <div> | ||||
|             <button nz-button nzType="primary" (click)="roleAction()" >新建角色</button> | ||||
|         </div> | ||||
|     </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' }" (change)="stChange($event)"></st> | ||||
| </nz-card> | ||||
| @ -0,0 +1,13 @@ | ||||
| :host::ng-deep{ | ||||
|     .search-box{ | ||||
|         .ant-card-body{ | ||||
|             padding-bottom: 18px; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     .content-box{ | ||||
|         .ant-card-body{ | ||||
|             padding-top: 14px; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,100 @@ | ||||
| import { Component, OnInit, ViewChild } from '@angular/core'; | ||||
| import { STComponent, STColumn, STChange } from '@delon/abc/st'; | ||||
| import { SFComponent, SFSchema } from '@delon/form'; | ||||
| import { NzModalService } from 'ng-zorro-antd/modal'; | ||||
| import { SystemService } from '../../services/system.service'; | ||||
|  | ||||
| @Component({ | ||||
|   selector: 'app-network-freight-component', | ||||
|   templateUrl: './network-freight.component.html', | ||||
|   styleUrls: ['./network-freight.component.less'] | ||||
| }) | ||||
| export class NetworkFreightComponent implements OnInit { | ||||
|   @ViewChild('st', { static: true }) | ||||
|   st!: STComponent; | ||||
|   @ViewChild('sf', { static: false }) | ||||
|   sf!: SFComponent; | ||||
|  | ||||
|   url = `/rule?_allow_anonymous=true`; | ||||
|  | ||||
|   searchSchema: SFSchema = { | ||||
|     properties: { | ||||
|       receiveName: { | ||||
|         type: 'string', | ||||
|         title: '角色名称', | ||||
|         ui: { placeholder: '请输入' } | ||||
|       } | ||||
|     } | ||||
|   }; | ||||
|  | ||||
|   columns: STColumn[] = [ | ||||
|     { title: '角色名称', index: 'no' }, | ||||
|     { title: '角色描述', index: 'description' }, | ||||
|     { title: '创建人手机号', index: 'description' }, | ||||
|     { | ||||
|       title: '创建时间', | ||||
|       index: 'updatedAt', | ||||
|       type: 'date' | ||||
|     }, | ||||
|     { | ||||
|       title: '操作', | ||||
|       buttons: [ | ||||
|         { | ||||
|           text: '编辑', | ||||
|           click: item => this.roleAction(item) | ||||
|         }, | ||||
|         { | ||||
|           text: '删除', | ||||
|           click: item => this.deleteAction(item) | ||||
|         } | ||||
|       ] | ||||
|     } | ||||
|   ]; | ||||
|  | ||||
|   selectedRows: any[] = []; | ||||
|  | ||||
|   reqParams = { pageIndex: 1, pageSize: 10 }; | ||||
|  | ||||
|   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) { | ||||
|     const modal = this.nzModalService.create({ | ||||
|       // nzContent: SettingRoleEditComponent, | ||||
|       nzWidth: 900, | ||||
|       nzComponentParams: item ? { i: { ...item } } : { i: { id: 0 } }, | ||||
|       nzFooter: null | ||||
|     }); | ||||
|     modal.afterClose.subscribe(res => { | ||||
|       this.st.load(); | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   deleteAction(item?: any) { | ||||
|     this.nzModalService.error({ | ||||
|       nzTitle: '确认删除?', | ||||
|       nzClosable: false, | ||||
|       nzCancelText: '取消', | ||||
|       nzOnOk: () => {} | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * 重置表单 | ||||
|    */ | ||||
|   resetSF() { | ||||
|     this.sf.reset(); | ||||
|   } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user