From ed90f4090a8aeabd72118abe684cbe08e723c9ee Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 29 Mar 2022 11:10:12 +0800 Subject: [PATCH 01/14] fix bug --- .../bulk-detail-change.component.html | 2 +- .../bulk-detail/bulk-detail.component.html | 4 +- .../vehicle-detail-change.component.html | 2 +- .../vehicle-detail.component.html | 2 +- .../add-partnerlist.component.ts | 44 ++++++++++------- .../rebate-setting/add/add.component.html | 31 ++++++------ .../rebate-setting/add/add.component.ts | 38 +++++++++----- .../rebate-setting.component.html | 15 ++++-- .../rebate-setting.component.ts | 47 +++++++++++++----- .../services/rebate-management.service.ts | 2 + .../bulk-detail/bulk-detail.component.html | 2 +- .../vehicle-detail.component.html | 4 +- .../rebate-table/rebate-table.component.html | 9 ++-- .../rebate-table/rebate-table.component.ts | 49 +++++++++++-------- 14 files changed, 159 insertions(+), 92 deletions(-) diff --git a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html index a76a0439..7be8c803 100644 --- a/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html +++ b/src/app/routes/order-management/components/bulk-detail-change/bulk-detail-change.component.html @@ -360,7 +360,7 @@ - +
暂无附件信息
diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html index bc0f83bd..50746e93 100644 --- a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-06 20:20:26 * @LastEditors : Shiming - * @LastEditTime : 2022-03-28 20:30:13 + * @LastEditTime : 2022-03-29 11:09:00 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -247,7 +247,7 @@ - +
暂无附件信息
diff --git a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html index bffdaa4c..4bdf02bd 100644 --- a/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html +++ b/src/app/routes/order-management/components/vehicle-detail-change/vehicle-detail-change.component.html @@ -333,7 +333,7 @@ - +
暂无附件信息
diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html index bba736fc..ccb172f1 100644 --- a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html @@ -230,7 +230,7 @@ - +
暂无附件信息
diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.ts b/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.ts index e78d09ef..65ce3f8c 100644 --- a/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.ts +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add-partnerlist/add-partnerlist.component.ts @@ -1,6 +1,14 @@ import { Component, OnInit, ViewChild, Type } from '@angular/core'; import { STComponent, STColumn, STChange } from '@delon/abc/st'; -import { SFComponent, SFDateWidgetSchema, SFRadioWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; +import { + SFComponent, + SFDateWidgetSchema, + SFRadioWidgetSchema, + SFSchema, + SFSchemaEnum, + SFSelectWidgetSchema, + SFUISchema +} from '@delon/form'; import { ShipperBaseService } from '@shared'; import { NzModalService, NzModalRef } from 'ng-zorro-antd/modal'; import { of } from 'rxjs'; @@ -28,8 +36,6 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit { editId = false; selectedIndex = 0; - - columns: STColumn[] = [ { title: '', type: 'checkbox', width: '50px', className: 'text-center' }, { @@ -42,20 +48,22 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit { { title: '手机号', index: 'contactMobile', className: 'text-center', width: 150 }, { title: '类型', index: 'partnerType', className: 'text-center', width: 130, type: 'enum', enum: { 1: '企业', 2: '个人' } }, { - title: '操作', width: '90px', fixed: 'right', + title: '操作', + width: '90px', + fixed: 'right', buttons: [ { text: '添加', click: _record => this.add(_record), acl: { ability: ['AbnormalAppear-reply'] } - }, + } ] - }, + } ]; get reqParams() { - // signStatus固定传20 代表签约完成 - let params: any = { ...this.sf?.value,signStatus: 20 }; + // signStatus固定传20 代表签约完成 signStatus: 20 + let params: any = { ...this.sf?.value, }; return params; } @@ -67,12 +75,11 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit { public service: RebateManagementService, public shipperSrv: ShipperBaseService, private modal: NzModalService, - private modals: NzModalRef, - - ) { } + private modals: NzModalRef + ) {} ngOnInit(): void { - this.initSF() + this.initSF(); } initSF() { this.schema = { @@ -97,19 +104,19 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit { } }, default: '' - }, } - } + } + }; this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } }; } search() { - this.st?.load(1) + this.st?.load(1); } selectedIndexChange(event: any) { if (this.selectedIndex === 0) { - this.st?.load(1) + this.st?.load(1); } } /** @@ -121,8 +128,7 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit { // 回复操作 add(item: any) { console.log(item); - this.modals.destroy(item) - + this.modals.destroy(item); } // 批量回复操作 batchReply() { @@ -130,6 +136,6 @@ export class ParterRebateManageMentAddPartnerListComponent implements OnInit { // this.service.msgSrv.warning('请勾选数据!') // return; // } - this.modals.destroy(this.selectedRows) + this.modals.destroy(this.selectedRows); } } diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.html b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.html index e0092a17..65cd23f9 100644 --- a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.html +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-02-24 20:09:49 * @LastEditors : Shiming - * @LastEditTime : 2022-03-28 19:46:23 + * @LastEditTime : 2022-03-29 10:47:02 * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -26,17 +26,17 @@    - + 关联合伙人配置    - - + + + + +   添加 -    - - - + + 1 + 2 + 3 + 4 + 5    -    - +    +
-
diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts index 8cec166a..958809db 100644 --- a/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/add/add.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-03-21 09:26:45 * @LastEditors : Shiming - * @LastEditTime : 2022-03-28 19:47:56 + * @LastEditTime : 2022-03-29 10:53:39 * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\add\\add.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -24,13 +24,17 @@ import { inRange } from '@delon/util'; templateUrl: './add.component.html' }) export class ParterRebateManageMentAddComponent implements OnInit { + @ViewChild('table') table!: any; + tabelData: any; configName: string = ''; - accountingRate: Number = 2; - partnerPeople: any; + partnerType: string = ''; + remarke: string = ''; + accountingRate: Number = 0; + priority: string = ''; partnerPeopleList: any; - peopleStatus: boolean = true; configType = '1'; precision = 2; + partnerId :Array =[]; inputValue = ''; @ViewChild('st', { static: true }) st!: STComponent; @@ -67,7 +71,7 @@ export class ParterRebateManageMentAddComponent implements OnInit { initSF(data?: any) { this.schema1 = { properties: { - content: { + ruleDescription: { type: 'string', title: '', ui: { @@ -77,7 +81,7 @@ export class ParterRebateManageMentAddComponent implements OnInit { height: 650 } }, - default: data?.agreementContent || '' + // default: data?.agreementContent || '' } } }; @@ -85,7 +89,6 @@ export class ParterRebateManageMentAddComponent implements OnInit { ngOnInit() { this.initSF(); } - submit() {} goBack() { window.history.go(-1); } @@ -103,15 +106,19 @@ export class ParterRebateManageMentAddComponent implements OnInit { nzFooter: null }); modalRef.afterClose.subscribe((res: any) => { + this.partnerId = []; if (res) { console.log(Array.isArray(res)); console.log(res); if(Array.isArray(res)) { this.partnerPeopleList = res; - this.peopleStatus = false + res.forEach((ele: any) => { + this.partnerId.push(ele?.id); + }) } else { - this.partnerPeople = res?.enterpriseName; - } + this.partnerPeopleList = [res]; + this.partnerId.push(res?.id); + } } }); } @@ -123,12 +130,19 @@ export class ParterRebateManageMentAddComponent implements OnInit { accountingRate: this.accountingRate, configName: this.configName, configType: this.configType, - rebateConfigLineDTO: {} + rebateConfigLineDTO: this.table.data, + priority: this.priority,// 优先级 + partnerId: this.partnerId.join(','), + ruleDescription: this.sf.value.ruleDescription, + remarke: this.remarke, + partnerType: this.partnerType } + console.log(params); this.service.request(this.service.$api_save_rebateConfig, params).subscribe((res: any) => { if(res) { console.log(res); - + this.service.msgSrv.success('新增成功!') + this.router.navigate(['/partner/rebate/setting']) } }) } diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html index efa2e94f..251f9c00 100644 --- a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-02-24 20:09:49 * @LastEditors : Shiming - * @LastEditTime : 2022-03-22 14:42:27 + * @LastEditTime : 2022-03-29 10:51:52 * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\rebate-setting.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -47,8 +47,17 @@ [loadingDelay]="500" [loading]="service.http.loading" > - -
1223
+ +
按全部等级配置
+
按不同等级配置
+
+ +
全部合伙人
+
新注册合伙人
+
自定义合伙人
+
+ +
{{item?.stateLocked ? '启用' : '禁用'}}
diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts index 7baea11d..795f64ee 100644 --- a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts @@ -69,12 +69,12 @@ export class ParterRebateManageMentSettingComponent implements OnInit { _$expand: { type: 'boolean', ui: { hidden: true } }, month: { type: 'string', - title: '时间月份', - format: 'month', + title: '配置名称', + format: 'configName', }, - partnerId: { + stateLocked: { type: 'string', - title: '合伙人名称' + title: '状态' }, } }; @@ -89,12 +89,12 @@ export class ParterRebateManageMentSettingComponent implements OnInit { initST() { this.columns = [ { - title: '月份', - index: '配置名称' + title: '配置名称', + index: 'configName' }, { title: '配置类型', - index: 'configType' + render: 'configType' }, { title: '备注', @@ -102,7 +102,7 @@ export class ParterRebateManageMentSettingComponent implements OnInit { }, { title: '关联合伙人范围', - index: 'partnerType' + render: 'partnerType' }, { title: '创建时间', @@ -118,7 +118,7 @@ export class ParterRebateManageMentSettingComponent implements OnInit { }, { title: '状态', - index: 'stateLocked' + render: 'stateLocked' }, { title: '操作', @@ -132,6 +132,12 @@ export class ParterRebateManageMentSettingComponent implements OnInit { }, { text: '禁用', + iif: (_record) =>{ return _record.stateLocked == true}, + click: _record => this.viewEvaluate(_record), + }, + { + text: '启用', + iif: (_record) =>{ return _record.stateLocked == false}, click: _record => this.viewEvaluate(_record), }, ] @@ -142,10 +148,29 @@ export class ParterRebateManageMentSettingComponent implements OnInit { *禁用 */ viewEvaluate(item: any) { + console.log(item.stateLocked); + let title = '' + let stateLocked: boolean; + if(item.stateLocked) { + title = '是否禁用该配置?' + stateLocked = false + } else { + title = '是否启用该配置?' + stateLocked = true + } this.modal.confirm({ - nzTitle: '是否禁用该配置?', + nzTitle: title, nzOnOk: () => { - + const params = { + id: item?.id, + stateLocked: stateLocked, + } + this.service.request(this.service.$api_set_updateRebateConfig,params).subscribe((res: any) => { + if(res) { + this.service.msgSrv.success('设置成功!') + this.st.reload(); + } + }) } }); } diff --git a/src/app/routes/partner/rebate-management/services/rebate-management.service.ts b/src/app/routes/partner/rebate-management/services/rebate-management.service.ts index 2049cbba..2e68c860 100644 --- a/src/app/routes/partner/rebate-management/services/rebate-management.service.ts +++ b/src/app/routes/partner/rebate-management/services/rebate-management.service.ts @@ -21,6 +21,8 @@ export class RebateManagementService extends BaseService { public $api_get_rebateConfig = '/api/mdc/rebateConfig/list/page'; // 保存返佣配置表 public $api_save_rebateConfig = '/api/mdc/rebateConfig/save'; + // 启用/禁用返佣配置 + public $api_set_updateRebateConfig = '/api/mdc/rebateConfig/updateRebateConfig';   // 查询合伙人信息-分页 public $api_get_partner_page = '/api/mdc/partner/list/page'; constructor(public injector: Injector) { diff --git a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.html index 4a638401..b41651d5 100644 --- a/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.html +++ b/src/app/routes/waybill-management/components/bulk-detail/bulk-detail.component.html @@ -247,7 +247,7 @@ - +
暂无附件信息
diff --git a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html index 352f900e..2a2d1380 100644 --- a/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html +++ b/src/app/routes/waybill-management/components/vehicle-detail/vehicle-detail.component.html @@ -1,7 +1,7 @@ @@ -37,10 +37,9 @@
- - - - + + +
diff --git a/src/app/shared/components/rebate-table/rebate-table.component.ts b/src/app/shared/components/rebate-table/rebate-table.component.ts index 5274f3b1..d2b3fa09 100644 --- a/src/app/shared/components/rebate-table/rebate-table.component.ts +++ b/src/app/shared/components/rebate-table/rebate-table.component.ts @@ -1,41 +1,49 @@ import { debounceTime } from 'rxjs/operators'; import { Subject } from 'rxjs'; -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, Output, ViewChild } from '@angular/core'; import { BaseService } from '@shared'; import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; - +import { EventEmitter} from '@angular/core' @Component({ selector: 'app-rebate-table', templateUrl: './rebate-table.component.html', styleUrls: ['./rebate-table.component.less'] }) export class RebateTableComponent implements OnInit { - data: any[] = [ - { - gradeConfigId: '', - startAmount: 0, - endAmount: 0, - managementFeeRatio: 0, - } - ]; + @Input() data: any =[]; + @Output() + private dataChange: EventEmitter = new EventEmitter(); + emit() { + this.dataChange.emit(this.data) + } headers: any[] = []; + gradeConfigId: string =''; + grage: any[] = []; formatterDollar = (value: number): string => `${value}`; changeSub = new Subject(); constructor(public service: BaseService, private cdr: ChangeDetectorRef) {} ngOnInit(): void { + this.data = [ + { + gradeConfigId: '', + startAmount: 0, + endAmount: 0, + managementFeeRatio: 0, + } + ]; this.loadData(); this.changeendAmountAction(); } loadData() { - // this.service.request('/api/mdc/cuc/insuranceConfig/list').subscribe(res => { - // if (res) { - // console.log(res); - // this.data = res; - // this.cdr.detectChanges(); - // } - // }); + this.service.request('/api/mdc/partnerGradeConfig/listPartnerGradeConfig').subscribe(res => { + if (res) { + console.log(res); + this.grage = res; + this.cdr.detectChanges(); + } + }); // this.service.request('/api/mdc/pbc/sysConfigItem/findItemValueByItemKeys', [ // "rebate.config.minrebatePrice" // ]).subscribe(res => { @@ -66,12 +74,13 @@ export class RebateTableComponent implements OnInit { const num = Number(paras[0]); const i = Number(paras[1]); - if (num <= this.data[i].startAmount) { + if (num <= this.data[i]?.startAmount) { + console.log(this.data[i].endAmount); this.data[i].endAmount = null; setTimeout(() => { - this.data[i].endAmount = this.data[i].startAmount + 1 ; + this.data[i].endAmount = this.data[i]?.startAmount + 1 ; }, 0); - this.changeNextstartAmount(this.data[i].startAmount + 1, i + 1); + this.changeNextstartAmount(this.data[i]?.startAmount + 1, i + 1); return; } this.data[i].endAmount = num; From fb21d5fdebe58d879c5d6e7a144de3987de3a347 Mon Sep 17 00:00:00 2001 From: Lingzi Date: Tue, 29 Mar 2022 11:26:55 +0800 Subject: [PATCH 02/14] fix bug --- .../customindex/customindex.component.html | 6 + .../customindex/customindex.component.spec.ts | 24 ++ .../customindex/customindex.component.ts | 45 ++++ .../customtable/customtable.component.html | 6 + .../customtable/customtable.component.spec.ts | 24 ++ .../customtable/customtable.component.ts | 45 ++++ .../customtable/driver/driver.component.html | 6 + .../driver/driver.component.spec.ts | 24 ++ .../customtable/driver/driver.component.ts | 45 ++++ .../customtable/owner/owner.component.html | 5 + .../customtable/owner/owner.component.spec.ts | 24 ++ .../customtable/owner/owner.component.ts | 45 ++++ .../dataindex/dataindex.component.html | 69 +++++ .../dataindex/dataindex.component.less | 0 .../dataindex/dataindex.component.spec.ts | 0 .../dataindex/dataindex.component.ts | 249 +++++++++++++++++ .../dataindex_line.component.html | 69 +++++ .../dataindex_line.component.less | 0 .../dataindex_line.component.spec.ts | 24 ++ .../dataindex_line.component.ts | 249 +++++++++++++++++ .../operationtable/curve/curve.component.html | 69 +++++ .../operationtable/curve/curve.component.less | 0 .../curve/curve.component.spec.ts | 24 ++ .../operationtable/curve/curve.component.ts | 249 +++++++++++++++++ .../operationtable.component.html | 46 ++++ .../operationtable.component.less | 11 + .../operationtable.component.spec.ts | 24 ++ .../operationtable.component.ts | 89 +++++++ .../operationtable/pie/pie.component.html | 1 + .../operationtable/pie/pie.component.less | 0 .../operationtable/pie/pie.component.spec.ts | 24 ++ .../operationtable/pie/pie.component.ts | 252 ++++++++++++++++++ .../dataindex/dataindex.component.html | 32 --- .../dataindex/dataindex.component.ts | 37 --- .../datatable/datatable-routing.module.ts | 15 +- src/app/routes/datatable/datatable.module.ts | 17 +- .../routes/datatable/services/data.service.ts | 30 +++ src/app/shared/shared-g2.module.ts | 3 +- 38 files changed, 1807 insertions(+), 75 deletions(-) create mode 100644 src/app/routes/datatable/components/customtable/customindex/customindex.component.html create mode 100644 src/app/routes/datatable/components/customtable/customindex/customindex.component.spec.ts create mode 100644 src/app/routes/datatable/components/customtable/customindex/customindex.component.ts create mode 100644 src/app/routes/datatable/components/customtable/customtable.component.html create mode 100644 src/app/routes/datatable/components/customtable/customtable.component.spec.ts create mode 100644 src/app/routes/datatable/components/customtable/customtable.component.ts create mode 100644 src/app/routes/datatable/components/customtable/driver/driver.component.html create mode 100644 src/app/routes/datatable/components/customtable/driver/driver.component.spec.ts create mode 100644 src/app/routes/datatable/components/customtable/driver/driver.component.ts create mode 100644 src/app/routes/datatable/components/customtable/owner/owner.component.html create mode 100644 src/app/routes/datatable/components/customtable/owner/owner.component.spec.ts create mode 100644 src/app/routes/datatable/components/customtable/owner/owner.component.ts create mode 100644 src/app/routes/datatable/components/dataindex/dataindex.component.html rename src/app/routes/datatable/{ => components}/dataindex/dataindex.component.less (100%) rename src/app/routes/datatable/{ => components}/dataindex/dataindex.component.spec.ts (100%) create mode 100644 src/app/routes/datatable/components/dataindex/dataindex.component.ts create mode 100644 src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.html create mode 100644 src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.less create mode 100644 src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.spec.ts create mode 100644 src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.ts create mode 100644 src/app/routes/datatable/components/operationtable/curve/curve.component.html create mode 100644 src/app/routes/datatable/components/operationtable/curve/curve.component.less create mode 100644 src/app/routes/datatable/components/operationtable/curve/curve.component.spec.ts create mode 100644 src/app/routes/datatable/components/operationtable/curve/curve.component.ts create mode 100644 src/app/routes/datatable/components/operationtable/operationtable.component.html create mode 100644 src/app/routes/datatable/components/operationtable/operationtable.component.less create mode 100644 src/app/routes/datatable/components/operationtable/operationtable.component.spec.ts create mode 100644 src/app/routes/datatable/components/operationtable/operationtable.component.ts create mode 100644 src/app/routes/datatable/components/operationtable/pie/pie.component.html create mode 100644 src/app/routes/datatable/components/operationtable/pie/pie.component.less create mode 100644 src/app/routes/datatable/components/operationtable/pie/pie.component.spec.ts create mode 100644 src/app/routes/datatable/components/operationtable/pie/pie.component.ts delete mode 100644 src/app/routes/datatable/dataindex/dataindex.component.html delete mode 100644 src/app/routes/datatable/dataindex/dataindex.component.ts create mode 100644 src/app/routes/datatable/services/data.service.ts diff --git a/src/app/routes/datatable/components/customtable/customindex/customindex.component.html b/src/app/routes/datatable/components/customtable/customindex/customindex.component.html new file mode 100644 index 00000000..56092666 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customindex/customindex.component.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/app/routes/datatable/components/customtable/customindex/customindex.component.spec.ts b/src/app/routes/datatable/components/customtable/customindex/customindex.component.spec.ts new file mode 100644 index 00000000..09bf44a2 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customindex/customindex.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableCustomindexComponent } from './customindex.component'; + +describe('DatatableCustomindexComponent', () => { + let component: DatatableCustomindexComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableCustomindexComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableCustomindexComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/customtable/customindex/customindex.component.ts b/src/app/routes/datatable/components/customtable/customindex/customindex.component.ts new file mode 100644 index 00000000..7e720e39 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customindex/customindex.component.ts @@ -0,0 +1,45 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-datatable-customindex', + templateUrl: './customindex.component.html', +}) +export class DatatableCustomindexComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + +} diff --git a/src/app/routes/datatable/components/customtable/customtable.component.html b/src/app/routes/datatable/components/customtable/customtable.component.html new file mode 100644 index 00000000..56092666 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customtable.component.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/app/routes/datatable/components/customtable/customtable.component.spec.ts b/src/app/routes/datatable/components/customtable/customtable.component.spec.ts new file mode 100644 index 00000000..980fc9d9 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customtable.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableCustomtableComponent } from './customtable.component'; + +describe('DatatableCustomtableComponent', () => { + let component: DatatableCustomtableComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableCustomtableComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableCustomtableComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/customtable/customtable.component.ts b/src/app/routes/datatable/components/customtable/customtable.component.ts new file mode 100644 index 00000000..292a9c25 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/customtable.component.ts @@ -0,0 +1,45 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-datatable-customtable', + templateUrl: './customtable.component.html', +}) +export class DatatableCustomtableComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + +} diff --git a/src/app/routes/datatable/components/customtable/driver/driver.component.html b/src/app/routes/datatable/components/customtable/driver/driver.component.html new file mode 100644 index 00000000..56092666 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/driver/driver.component.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/app/routes/datatable/components/customtable/driver/driver.component.spec.ts b/src/app/routes/datatable/components/customtable/driver/driver.component.spec.ts new file mode 100644 index 00000000..6a2084a2 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/driver/driver.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableDriverComponent } from './driver.component'; + +describe('DatatableDriverComponent', () => { + let component: DatatableDriverComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableDriverComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableDriverComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/customtable/driver/driver.component.ts b/src/app/routes/datatable/components/customtable/driver/driver.component.ts new file mode 100644 index 00000000..f27f6788 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/driver/driver.component.ts @@ -0,0 +1,45 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-datatable-driver', + templateUrl: './driver.component.html', +}) +export class DatatableDriverComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + +} diff --git a/src/app/routes/datatable/components/customtable/owner/owner.component.html b/src/app/routes/datatable/components/customtable/owner/owner.component.html new file mode 100644 index 00000000..3a90b91b --- /dev/null +++ b/src/app/routes/datatable/components/customtable/owner/owner.component.html @@ -0,0 +1,5 @@ + + + + + diff --git a/src/app/routes/datatable/components/customtable/owner/owner.component.spec.ts b/src/app/routes/datatable/components/customtable/owner/owner.component.spec.ts new file mode 100644 index 00000000..8c518688 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/owner/owner.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableOwnerComponent } from './owner.component'; + +describe('DatatableOwnerComponent', () => { + let component: DatatableOwnerComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableOwnerComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableOwnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/customtable/owner/owner.component.ts b/src/app/routes/datatable/components/customtable/owner/owner.component.ts new file mode 100644 index 00000000..af6bf032 --- /dev/null +++ b/src/app/routes/datatable/components/customtable/owner/owner.component.ts @@ -0,0 +1,45 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { SFSchema } from '@delon/form'; +import { ModalHelper, _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'app-datatable-owner', + templateUrl: './owner.component.html', +}) +export class DatatableOwnerComponent implements OnInit { + url = `/user`; + searchSchema: SFSchema = { + properties: { + no: { + type: 'string', + title: '编号' + } + } + }; + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '编号', index: 'no' }, + { title: '调用次数', type: 'number', index: 'callNo' }, + { title: '头像', type: 'img', width: '50px', index: 'avatar' }, + { title: '时间', type: 'date', index: 'updatedAt' }, + { + title: '', + buttons: [ + // { text: '查看', click: (item: any) => `/form/${item.id}` }, + // { text: '编辑', type: 'static', component: FormEditComponent, click: 'reload' }, + ] + } + ]; + + constructor(private http: _HttpClient, private modal: ModalHelper) { } + + ngOnInit(): void { } + + add(): void { + // this.modal + // .createStatic(FormEditComponent, { i: { id: 0 } }) + // .subscribe(() => this.st.reload()); + } + +} diff --git a/src/app/routes/datatable/components/dataindex/dataindex.component.html b/src/app/routes/datatable/components/dataindex/dataindex.component.html new file mode 100644 index 00000000..3f148bfd --- /dev/null +++ b/src/app/routes/datatable/components/dataindex/dataindex.component.html @@ -0,0 +1,69 @@ + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+
+
+ + + +
+
+ + + +
+
+
+
+ + + + +
+
+ + + + +
+
\ No newline at end of file diff --git a/src/app/routes/datatable/dataindex/dataindex.component.less b/src/app/routes/datatable/components/dataindex/dataindex.component.less similarity index 100% rename from src/app/routes/datatable/dataindex/dataindex.component.less rename to src/app/routes/datatable/components/dataindex/dataindex.component.less diff --git a/src/app/routes/datatable/dataindex/dataindex.component.spec.ts b/src/app/routes/datatable/components/dataindex/dataindex.component.spec.ts similarity index 100% rename from src/app/routes/datatable/dataindex/dataindex.component.spec.ts rename to src/app/routes/datatable/components/dataindex/dataindex.component.spec.ts diff --git a/src/app/routes/datatable/components/dataindex/dataindex.component.ts b/src/app/routes/datatable/components/dataindex/dataindex.component.ts new file mode 100644 index 00000000..0881c73c --- /dev/null +++ b/src/app/routes/datatable/components/dataindex/dataindex.component.ts @@ -0,0 +1,249 @@ +import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area'; +import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie'; +import { format } from 'date-fns'; +import { DataService } from '../../services/data.service'; +import { Chart, registerShape, Util } from '@antv/g2'; +import { G2TimelineClickItem, G2TimelineData } from '@delon/chart/timeline'; + +@Component({ + selector: 'app-datatable-dataindex', + templateUrl: './dataindex.component.html', + styleUrls: ['./dataindex.component.less'] +}) +export class DatatableDataindexComponent implements OnInit { + @ViewChild('pie', { static: false }) pie!: G2PieComponent; + chartData: G2TimelineData[] = []; + visitData = this.genData(); + salesData = this.genData(); + salesPieData: G2PieData[] = []; + total = ''; + + constructor(private service: DataService, private ngZone: NgZone) { + + } + + ngOnInit(): void { + this.refreshPie(); + this.initLineData() + } + initLineData(){ + for (let i = 0; i < 20; i += 1) { + this.chartData.push({ + time: new Date().getTime() + 1000 * 60 * 60 * 24 * i, + y1: Math.floor(Math.random() * 100) + 1000, + y2: Math.floor(Math.random() * 100) + 10, + }); + } + } + private genData(): G2MiniAreaData[] { + const beginDay = new Date().getTime(); + const res: G2MiniAreaData[] = []; + for (let i = 0; i < 20; i += 1) { + res.push({ + x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'), + y: Math.floor(Math.random() * 100) + 10, + }); + } + return res; + } + + refresh(): void { + this.visitData = this.genData(); + } + refreshPie(): void { + const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min); + this.salesPieData = [ + { + x: '家用电器', + y: rv(), + }, + { + x: '食用酒水', + y: rv(), + }, + { + x: '个护健康', + y: rv(), + }, + { + x: '服饰箱包', + y: rv(), + }, + { + x: '母婴产品', + y: rv(), + }, + ]; + if (Math.random() > 0.5) { + this.salesPieData.push({ + x: '其他', + y: rv(), + }); + } + this.total = `¥ ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`; + if (this.pie) { + // 等待组件渲染 + setTimeout(() => { + console.log('a') + this.pie.changeData() + }); + } + } + + handleClick(data: G2MiniAreaClickItem): void { + this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`); + } + format(val: number): string { + return `¥ ${val.toFixed(2)}`; + } + render(el: ElementRef): void { + this.ngZone.runOutsideAngular(() => this.init(el.nativeElement)); + } + private init(el: HTMLElement): void { + const data = [ + { item: '货源单', count: 40, percent: 0.4 }, + { item: '合同单', count: 21, percent: 0.21 }, + { item: '事例三', count: 17, percent: 0.17 }, + { item: '事例四', count: 13, percent: 0.13 }, + { item: '事例五', count: 9, percent: 0.09 }, + ]; + const chart = new Chart({ + container: el, + autoFit: true, + height: 400, + }); + // 新建一个 view 用来单独渲染Annotation + const innerView = chart.createView(); + chart.coordinate('theta', { + radius: 0.6, + innerRadius: 0.7, + }); + + chart.data(data); + + chart.scale('percent', { + formatter: val => { + val = val * 100 + '%'; + return val; + }, + }); + + chart.tooltip(false); + + // 声明需要进行自定义图例字段: 'item' + chart.legend('item', { + position: 'right', // 配置图例显示位置 + custom: true, // 关键字段,告诉 G2,要使用自定义的图例 + items: data.map((obj, index) => { + return { + name: obj.item, // 对应 itemName + value: obj.percent, // 对应 itemValue + marker: { + symbol: 'square', // marker 的形状 + style: { + r: 5, // marker 图形半径 + fill: chart.getTheme().colors10[index], // marker 颜色,使用默认颜色,同图形对应 + }, + }, // marker 配置 + }; + }), + itemValue: { + style: { + fill: '#999', + }, // 配置 itemValue 样式 + formatter: (val: any) => `${val * 100}%` // 格式化 itemValue 内容 + }, + }); + + chart + .interval() + .adjust('stack') + .position('percent') + .color('item') + .style({ + fillOpacity: 1, + stroke: 'white', + lineWidth: 8, + }) + .state({ + active: { + style: element => { + const shape = element.shape; + return { + lineWidth: 1, + stroke: 'white', + strokeOpacity: shape.attr('fillOpacity'), + }; + }, + }, + }); + + // 移除图例点击过滤交互 + chart.removeInteraction('legend-filter'); + chart.interaction('element-active'); + + chart.render(); + + // 监听 element 上状态的变化来动态更新 Annotation 信息 + chart.on('element:statechange', (ev: any) => { + const { state, stateStatus, element } = ev.gEvent.originalEvent; + + // 本示例只需要监听 active 的状态变化 + if (state === 'active') { + const data = element.getData(); + if (stateStatus) { + // 更新 Annotation + updateAnnotation(data); + } else { + // 隐藏 Annotation + clearAnnotation(); + } + } + }); + + // 绘制 annotation + let lastItem: any; + function updateAnnotation(data: any) { + if (data.item !== lastItem) { + innerView.annotation().clear(true); + innerView + .annotation() + .text({ + position: ['50%', '50%'], + content: data.item, + style: { + fontSize: 20, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetY: -20, + }) + .text({ + position: ['50%', '50%'], + content: data.count, + style: { + fontSize: 28, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetX: -10, + offsetY: 20, + }) + innerView.render(true); + lastItem = data.item; + } + } + + // 清空 annotation + function clearAnnotation() { + innerView.annotation().clear(true); + innerView.render(true); + lastItem = null; + } + + } +} + + diff --git a/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.html b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.html new file mode 100644 index 00000000..3f148bfd --- /dev/null +++ b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.html @@ -0,0 +1,69 @@ + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+
+
+ + + +
+
+ + + +
+
+
+
+ + + + +
+
+ + + + +
+
\ No newline at end of file diff --git a/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.less b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.spec.ts b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.spec.ts new file mode 100644 index 00000000..cd009e56 --- /dev/null +++ b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableDataindexComponent } from './dataindex.component'; + +describe('DatatableDataindexComponent', () => { + let component: DatatableDataindexComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableDataindexComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableDataindexComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.ts b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.ts new file mode 100644 index 00000000..eb15c985 --- /dev/null +++ b/src/app/routes/datatable/components/dataindex/dataindex_line/dataindex_line.component.ts @@ -0,0 +1,249 @@ +import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area'; +import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie'; +import { format } from 'date-fns'; +import { DataindexService } from '../services/dataindex.service'; +import { Chart, registerShape, Util } from '@antv/g2'; +import { G2TimelineClickItem, G2TimelineData } from '@delon/chart/timeline'; + +@Component({ + selector: 'app-datatable-dataindex', + templateUrl: './dataindex.component.html', + styleUrls: ['./dataindex.component.less'] +}) +export class DatatableDataindexComponent implements OnInit { + @ViewChild('pie', { static: false }) pie!: G2PieComponent; + chartData: G2TimelineData[] = []; + visitData = this.genData(); + salesData = this.genData(); + salesPieData: G2PieData[] = []; + total = ''; + + constructor(private service: DataindexService, private ngZone: NgZone) { + + } + + ngOnInit(): void { + this.refreshPie(); + this.initLineData() + } + initLineData(){ + for (let i = 0; i < 20; i += 1) { + this.chartData.push({ + time: new Date().getTime() + 1000 * 60 * 60 * 24 * i, + y1: Math.floor(Math.random() * 100) + 1000, + y2: Math.floor(Math.random() * 100) + 10, + }); + } + } + private genData(): G2MiniAreaData[] { + const beginDay = new Date().getTime(); + const res: G2MiniAreaData[] = []; + for (let i = 0; i < 20; i += 1) { + res.push({ + x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'), + y: Math.floor(Math.random() * 100) + 10, + }); + } + return res; + } + + refresh(): void { + this.visitData = this.genData(); + } + refreshPie(): void { + const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min); + this.salesPieData = [ + { + x: '家用电器', + y: rv(), + }, + { + x: '食用酒水', + y: rv(), + }, + { + x: '个护健康', + y: rv(), + }, + { + x: '服饰箱包', + y: rv(), + }, + { + x: '母婴产品', + y: rv(), + }, + ]; + if (Math.random() > 0.5) { + this.salesPieData.push({ + x: '其他', + y: rv(), + }); + } + this.total = `¥ ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`; + if (this.pie) { + // 等待组件渲染 + setTimeout(() => { + console.log('a') + this.pie.changeData() + }); + } + } + + handleClick(data: G2MiniAreaClickItem): void { + this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`); + } + format(val: number): string { + return `¥ ${val.toFixed(2)}`; + } + render(el: ElementRef): void { + this.ngZone.runOutsideAngular(() => this.init(el.nativeElement)); + } + private init(el: HTMLElement): void { + const data = [ + { item: '货源单', count: 40, percent: 0.4 }, + { item: '合同单', count: 21, percent: 0.21 }, + { item: '事例三', count: 17, percent: 0.17 }, + { item: '事例四', count: 13, percent: 0.13 }, + { item: '事例五', count: 9, percent: 0.09 }, + ]; + const chart = new Chart({ + container: el, + autoFit: true, + height: 400, + }); + // 新建一个 view 用来单独渲染Annotation + const innerView = chart.createView(); + chart.coordinate('theta', { + radius: 0.6, + innerRadius: 0.7, + }); + + chart.data(data); + + chart.scale('percent', { + formatter: val => { + val = val * 100 + '%'; + return val; + }, + }); + + chart.tooltip(false); + + // 声明需要进行自定义图例字段: 'item' + chart.legend('item', { + position: 'right', // 配置图例显示位置 + custom: true, // 关键字段,告诉 G2,要使用自定义的图例 + items: data.map((obj, index) => { + return { + name: obj.item, // 对应 itemName + value: obj.percent, // 对应 itemValue + marker: { + symbol: 'square', // marker 的形状 + style: { + r: 5, // marker 图形半径 + fill: chart.getTheme().colors10[index], // marker 颜色,使用默认颜色,同图形对应 + }, + }, // marker 配置 + }; + }), + itemValue: { + style: { + fill: '#999', + }, // 配置 itemValue 样式 + formatter: (val: any) => `${val * 100}%` // 格式化 itemValue 内容 + }, + }); + + chart + .interval() + .adjust('stack') + .position('percent') + .color('item') + .style({ + fillOpacity: 1, + stroke: 'white', + lineWidth: 8, + }) + .state({ + active: { + style: element => { + const shape = element.shape; + return { + lineWidth: 1, + stroke: 'white', + strokeOpacity: shape.attr('fillOpacity'), + }; + }, + }, + }); + + // 移除图例点击过滤交互 + chart.removeInteraction('legend-filter'); + chart.interaction('element-active'); + + chart.render(); + + // 监听 element 上状态的变化来动态更新 Annotation 信息 + chart.on('element:statechange', (ev: any) => { + const { state, stateStatus, element } = ev.gEvent.originalEvent; + + // 本示例只需要监听 active 的状态变化 + if (state === 'active') { + const data = element.getData(); + if (stateStatus) { + // 更新 Annotation + updateAnnotation(data); + } else { + // 隐藏 Annotation + clearAnnotation(); + } + } + }); + + // 绘制 annotation + let lastItem: any; + function updateAnnotation(data: any) { + if (data.item !== lastItem) { + innerView.annotation().clear(true); + innerView + .annotation() + .text({ + position: ['50%', '50%'], + content: data.item, + style: { + fontSize: 20, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetY: -20, + }) + .text({ + position: ['50%', '50%'], + content: data.count, + style: { + fontSize: 28, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetX: -10, + offsetY: 20, + }) + innerView.render(true); + lastItem = data.item; + } + } + + // 清空 annotation + function clearAnnotation() { + innerView.annotation().clear(true); + innerView.render(true); + lastItem = null; + } + + } +} + + diff --git a/src/app/routes/datatable/components/operationtable/curve/curve.component.html b/src/app/routes/datatable/components/operationtable/curve/curve.component.html new file mode 100644 index 00000000..3f148bfd --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/curve/curve.component.html @@ -0,0 +1,69 @@ + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+ + + + + + +
+
+
+
+ + + +
+
+ + + +
+
+
+
+ + + + +
+
+ + + + +
+
\ No newline at end of file diff --git a/src/app/routes/datatable/components/operationtable/curve/curve.component.less b/src/app/routes/datatable/components/operationtable/curve/curve.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/operationtable/curve/curve.component.spec.ts b/src/app/routes/datatable/components/operationtable/curve/curve.component.spec.ts new file mode 100644 index 00000000..cd009e56 --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/curve/curve.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableDataindexComponent } from './dataindex.component'; + +describe('DatatableDataindexComponent', () => { + let component: DatatableDataindexComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableDataindexComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableDataindexComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/operationtable/curve/curve.component.ts b/src/app/routes/datatable/components/operationtable/curve/curve.component.ts new file mode 100644 index 00000000..aedbf57a --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/curve/curve.component.ts @@ -0,0 +1,249 @@ +import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area'; +import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie'; +import { format } from 'date-fns'; +import { Chart, registerShape, Util } from '@antv/g2'; +import { G2TimelineClickItem, G2TimelineData } from '@delon/chart/timeline'; +import { DataService } from '../../../services/data.service'; + +@Component({ + selector: 'app-datatable-curve', + templateUrl: './curve.component.html', + styleUrls: ['./curve.component.less'] +}) +export class DatatableDataindexComponent implements OnInit { + @ViewChild('pie', { static: false }) pie!: G2PieComponent; + chartData: G2TimelineData[] = []; + visitData = this.genData(); + salesData = this.genData(); + salesPieData: G2PieData[] = []; + total = ''; + + constructor(private service: DataService, private ngZone: NgZone) { + + } + + ngOnInit(): void { + this.refreshPie(); + this.initLineData() + } + initLineData(){ + for (let i = 0; i < 20; i += 1) { + this.chartData.push({ + time: new Date().getTime() + 1000 * 60 * 60 * 24 * i, + y1: Math.floor(Math.random() * 100) + 1000, + y2: Math.floor(Math.random() * 100) + 10, + }); + } + } + private genData(): G2MiniAreaData[] { + const beginDay = new Date().getTime(); + const res: G2MiniAreaData[] = []; + for (let i = 0; i < 20; i += 1) { + res.push({ + x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'), + y: Math.floor(Math.random() * 100) + 10, + }); + } + return res; + } + + refresh(): void { + this.visitData = this.genData(); + } + refreshPie(): void { + const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min); + this.salesPieData = [ + { + x: '家用电器', + y: rv(), + }, + { + x: '食用酒水', + y: rv(), + }, + { + x: '个护健康', + y: rv(), + }, + { + x: '服饰箱包', + y: rv(), + }, + { + x: '母婴产品', + y: rv(), + }, + ]; + if (Math.random() > 0.5) { + this.salesPieData.push({ + x: '其他', + y: rv(), + }); + } + this.total = `¥ ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`; + if (this.pie) { + // 等待组件渲染 + setTimeout(() => { + console.log('a') + this.pie.changeData() + }); + } + } + + handleClick(data: G2MiniAreaClickItem): void { + this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`); + } + format(val: number): string { + return `¥ ${val.toFixed(2)}`; + } + render(el: ElementRef): void { + this.ngZone.runOutsideAngular(() => this.init(el.nativeElement)); + } + private init(el: HTMLElement): void { + const data = [ + { item: '货源单', count: 40, percent: 0.4 }, + { item: '合同单', count: 21, percent: 0.21 }, + { item: '事例三', count: 17, percent: 0.17 }, + { item: '事例四', count: 13, percent: 0.13 }, + { item: '事例五', count: 9, percent: 0.09 }, + ]; + const chart = new Chart({ + container: el, + autoFit: true, + height: 400, + }); + // 新建一个 view 用来单独渲染Annotation + const innerView = chart.createView(); + chart.coordinate('theta', { + radius: 0.6, + innerRadius: 0.7, + }); + + chart.data(data); + + chart.scale('percent', { + formatter: val => { + val = val * 100 + '%'; + return val; + }, + }); + + chart.tooltip(false); + + // 声明需要进行自定义图例字段: 'item' + chart.legend('item', { + position: 'right', // 配置图例显示位置 + custom: true, // 关键字段,告诉 G2,要使用自定义的图例 + items: data.map((obj, index) => { + return { + name: obj.item, // 对应 itemName + value: obj.percent, // 对应 itemValue + marker: { + symbol: 'square', // marker 的形状 + style: { + r: 5, // marker 图形半径 + fill: chart.getTheme().colors10[index], // marker 颜色,使用默认颜色,同图形对应 + }, + }, // marker 配置 + }; + }), + itemValue: { + style: { + fill: '#999', + }, // 配置 itemValue 样式 + formatter: (val: any) => `${val * 100}%` // 格式化 itemValue 内容 + }, + }); + + chart + .interval() + .adjust('stack') + .position('percent') + .color('item') + .style({ + fillOpacity: 1, + stroke: 'white', + lineWidth: 8, + }) + .state({ + active: { + style: element => { + const shape = element.shape; + return { + lineWidth: 1, + stroke: 'white', + strokeOpacity: shape.attr('fillOpacity'), + }; + }, + }, + }); + + // 移除图例点击过滤交互 + chart.removeInteraction('legend-filter'); + chart.interaction('element-active'); + + chart.render(); + + // 监听 element 上状态的变化来动态更新 Annotation 信息 + chart.on('element:statechange', (ev: any) => { + const { state, stateStatus, element } = ev.gEvent.originalEvent; + + // 本示例只需要监听 active 的状态变化 + if (state === 'active') { + const data = element.getData(); + if (stateStatus) { + // 更新 Annotation + updateAnnotation(data); + } else { + // 隐藏 Annotation + clearAnnotation(); + } + } + }); + + // 绘制 annotation + let lastItem: any; + function updateAnnotation(data: any) { + if (data.item !== lastItem) { + innerView.annotation().clear(true); + innerView + .annotation() + .text({ + position: ['50%', '50%'], + content: data.item, + style: { + fontSize: 20, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetY: -20, + }) + .text({ + position: ['50%', '50%'], + content: data.count, + style: { + fontSize: 28, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetX: -10, + offsetY: 20, + }) + innerView.render(true); + lastItem = data.item; + } + } + + // 清空 annotation + function clearAnnotation() { + innerView.annotation().clear(true); + innerView.render(true); + lastItem = null; + } + + } +} + + diff --git a/src/app/routes/datatable/components/operationtable/operationtable.component.html b/src/app/routes/datatable/components/operationtable/operationtable.component.html new file mode 100644 index 00000000..d50b08b2 --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/operationtable.component.html @@ -0,0 +1,46 @@ + + + + +
+ +
+ + + + + + +
+ + +
+ +
+
+ +
+ +
+ + +
+ +
+ + + + +
+ +
+
+
+
+
+ + + \ No newline at end of file diff --git a/src/app/routes/datatable/components/operationtable/operationtable.component.less b/src/app/routes/datatable/components/operationtable/operationtable.component.less new file mode 100644 index 00000000..6b4b1cba --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/operationtable.component.less @@ -0,0 +1,11 @@ +.chooseBox{ + display: flex; +} +.timeBox{ + display: flex; + margin: 0 0 0 10px; +} +.dateBox{ + display: inline-block; + margin: 0 0 0 10px; +} \ No newline at end of file diff --git a/src/app/routes/datatable/components/operationtable/operationtable.component.spec.ts b/src/app/routes/datatable/components/operationtable/operationtable.component.spec.ts new file mode 100644 index 00000000..3b100f2c --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/operationtable.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableOperationtableComponent } from './operationtable.component'; + +describe('DatatableOperationtableComponent', () => { + let component: DatatableOperationtableComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableOperationtableComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableOperationtableComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/operationtable/operationtable.component.ts b/src/app/routes/datatable/components/operationtable/operationtable.component.ts new file mode 100644 index 00000000..bfa13aea --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/operationtable.component.ts @@ -0,0 +1,89 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STColumn, STComponent } from '@delon/abc/st'; +import { DatePipe, _HttpClient } from '@delon/theme'; +import { DataService } from '../../services/data.service'; +import { differenceInCalendarDays } from 'date-fns'; + +@Component({ + selector: 'app-datatable-operationtable', + templateUrl: './operationtable.component.html', + styleUrls: ['./operationtable.component.less'], + providers: [DatePipe] + +}) +export class DatatableOperationtableComponent implements OnInit {; + type = 1; + mode = 'year'; + date: any = null; + defineDate = []; + time: any = [] + dateFormat = 'yyyy-MM-dd'; + today = new Date(); + @ViewChild('st') private readonly st!: STComponent; + columns: STColumn[] = [ + { title: '运营主体', index: 'networkTransporterName', className: 'text-center' }, + { title: '订单数', index: 'zsl', className: 'text-center' }, + { title: '应收金额', index: 'yingsje', className: 'text-center' }, + { title: '承运数', index: 'cys', className: 'text-center' }, + { title: '应付运费', index: 'yingfyf', className: 'text-center' }, + { title: '运量(吨)', index: 'yl', className: 'text-center' }, + { title: '待接单数', index: 'djd', className: 'text-center' }, + { title: '在途数', index: 'ysz', className: 'text-center' }, + { title: '运输完成', index: 'yswc', className: 'text-center' }, + { title: '已收金额', index: 'yisje', className: 'text-center' }, + { title: '已付运费', index: 'yifyf', className: 'text-center' } + ]; + /** + * 查询参数 + */ + get reqParams() { + if(this.mode === 'year') { + this.type = 1 + } else if(this.mode === 'month') { + this.type = 2 + } else if(this.mode === 'date') { + this.type = 3 + } else { + this.type = 4 + } + let params: any = { + time: this.time, + type: this.type + }; + + delete params._$expand; + return { ...params }; + } + + constructor(public service: DataService, private datePipe: DatePipe) { } + ngOnInit(): void { } + + changeData(){ + if(this.mode === 'year') { + this.dateFormat = 'yyyy' + } else if(this.mode === 'month') { + this.dateFormat = 'yyyy-MM' + } else { + this.dateFormat = 'yyyy-MM-dd' + } + } + onChange(result: any) { + if(this.mode === 'year') { + this.time = [this.datePipe.transform(this.date, 'yyyy') + '-01-01 00:00:00'] + } else if(this.mode === 'month') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM') + '-01 00:00:00'] + } else if(this.mode === 'date') { + this.time = [this.datePipe.transform(this.date, 'yyyy-MM-dd') + ' 00:00:00'] + } else{ + this.time = [this.datePipe.transform(this.defineDate[0], 'yyyy-MM-dd') + '00:00:00', this.datePipe.transform(this.defineDate[1], 'yyyy-MM-dd') + ' 00:00:00'] + } + this.st.reload({ ...this.reqParams }); + } + disabledDate = (current: Date): boolean => + // Can not select days before today and today + differenceInCalendarDays(current, this.today) > 0; + exportFun(){ + + } + +} diff --git a/src/app/routes/datatable/components/operationtable/pie/pie.component.html b/src/app/routes/datatable/components/operationtable/pie/pie.component.html new file mode 100644 index 00000000..0640a4d4 --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/pie/pie.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/routes/datatable/components/operationtable/pie/pie.component.less b/src/app/routes/datatable/components/operationtable/pie/pie.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/datatable/components/operationtable/pie/pie.component.spec.ts b/src/app/routes/datatable/components/operationtable/pie/pie.component.spec.ts new file mode 100644 index 00000000..cd009e56 --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/pie/pie.component.spec.ts @@ -0,0 +1,24 @@ +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; +import { DatatableDataindexComponent } from './dataindex.component'; + +describe('DatatableDataindexComponent', () => { + let component: DatatableDataindexComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ DatatableDataindexComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DatatableDataindexComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/routes/datatable/components/operationtable/pie/pie.component.ts b/src/app/routes/datatable/components/operationtable/pie/pie.component.ts new file mode 100644 index 00000000..1e69183a --- /dev/null +++ b/src/app/routes/datatable/components/operationtable/pie/pie.component.ts @@ -0,0 +1,252 @@ +import { Component, ElementRef, NgZone, OnInit, ViewChild } from '@angular/core'; +import { ModalHelper, _HttpClient } from '@delon/theme'; +import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area'; +import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie'; +import { format } from 'date-fns'; +import { Chart, registerShape, Util } from '@antv/g2'; +import { G2TimelineClickItem, G2TimelineData } from '@delon/chart/timeline'; +import { DataService } from '../../../services/data.service'; + +@Component({ + selector: 'app-opeationtable-pie', + templateUrl: './pie.component.html', + styleUrls: ['./pie.component.less'] +}) +export class OperationtablePieComponent implements OnInit { + @ViewChild('pie', { static: false }) pie!: G2PieComponent; + chartData: G2TimelineData[] = []; + visitData = this.genData(); + salesData = this.genData(); + salesPieData: G2PieData[] = []; + total = ''; + + constructor(private service: DataService, private ngZone: NgZone) { + + } + + ngOnInit(): void { + this.refreshPie(); + this.initLineData() + } + initLineData() { + for (let i = 0; i < 20; i += 1) { + this.chartData.push({ + time: new Date().getTime() + 1000 * 60 * 60 * 24 * i, + y1: Math.floor(Math.random() * 100) + 1000, + y2: Math.floor(Math.random() * 100) + 10, + }); + } + } + private genData(): G2MiniAreaData[] { + const beginDay = new Date().getTime(); + const res: G2MiniAreaData[] = []; + for (let i = 0; i < 20; i += 1) { + res.push({ + x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'), + y: Math.floor(Math.random() * 100) + 10, + }); + } + return res; + } + + refresh(): void { + this.visitData = this.genData(); + } + refreshPie(): void { + const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min); + this.salesPieData = [ + { + x: '家用电器', + y: rv(), + }, + { + x: '食用酒水', + y: rv(), + }, + { + x: '个护健康', + y: rv(), + }, + { + x: '服饰箱包', + y: rv(), + }, + { + x: '母婴产品', + y: rv(), + }, + ]; + if (Math.random() > 0.5) { + this.salesPieData.push({ + x: '其他', + y: rv(), + }); + } + this.total = `¥ ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`; + if (this.pie) { + // 等待组件渲染 + setTimeout(() => { + console.log('a') + this.pie.changeData() + }); + } + } + + handleClick(data: G2MiniAreaClickItem): void { + this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`); + } + format(val: number): string { + return `¥ ${val.toFixed(2)}`; + } + render(el: ElementRef): void { + this.ngZone.runOutsideAngular(() => this.init(el.nativeElement)); + } + private init(el: HTMLElement): void { + const data = [ + { item: '货源单', count: 40, percent: 0.4 }, + { item: '合同单', count: 21, percent: 0.21 }, + { item: '事例三', count: 17, percent: 0.17 }, + { item: '事例四', count: 13, percent: 0.13 }, + { item: '事例五', count: 9, percent: 0.09 }, + ]; + const chart = new Chart({ + container: el, + autoFit: true, + height: 400, + }); + // 新建一个 view 用来单独渲染Annotation + const innerView = chart.createView(); + chart.coordinate('theta', { + radius: 0.6, + innerRadius: 0.7, + }); + + chart.data(data); + + chart.scale('percent', { + formatter: val => { + val = val * 100 + '%'; + return val; + }, + }); + + chart.tooltip(false); + + // 声明需要进行自定义图例字段: 'item' + chart.legend('item', { + position: 'right', // 配置图例显示位置 + custom: true, // 关键字段,告诉 G2,要使用自定义的图例 + items: data.map((obj, index) => { + return { + name: obj.item, // 对应 itemName + value: obj.percent, // 对应 itemValue + marker: { + symbol: 'square', // marker 的形状 + style: { + r: 5, // marker 图形半径 + fill: chart.getTheme().colors10[index], // marker 颜色,使用默认颜色,同图形对应 + }, + }, // marker 配置 + }; + }), + itemValue: { + style: { + fill: '#999', + }, // 配置 itemValue 样式 + formatter: (val: any) => `${val * 100}%` // 格式化 itemValue 内容 + }, + }); + + const interval = chart + .interval() + .adjust('stack') + .position('percent') + .color('item') + .style({ + fillOpacity: 1, + stroke: 'white', + lineWidth: 8, + }) + .state({ + active: { + style: element => { + const shape = element.shape; + return { + lineWidth: 1, + stroke: 'white', + strokeOpacity: shape.attr('fillOpacity'), + }; + }, + }, + }); + + // 移除图例点击过滤交互 + chart.removeInteraction('legend-filter'); + chart.interaction('element-active'); + + chart.render(); + // 默认选择 + interval.elements[0].setState('selected', true); + // 监听 element 上状态的变化来动态更新 Annotation 信息 + chart.on('element:statechange', (ev: any) => { + const { state, stateStatus, element } = ev.gEvent.originalEvent; + + // 本示例只需要监听 active 的状态变化 + if (state === 'active') { + const data = element.getData(); + if (stateStatus) { + // 更新 Annotation + updateAnnotation(data); + } else { + // 隐藏 Annotation + clearAnnotation(); + } + } + }); + + // 绘制 annotation + let lastItem: any; + function updateAnnotation(data: any) { + if (data.item !== lastItem) { + innerView.annotation().clear(true); + innerView + .annotation() + .text({ + position: ['50%', '50%'], + content: data.item, + style: { + fontSize: 20, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetY: -20, + }) + .text({ + position: ['50%', '50%'], + content: data.count, + style: { + fontSize: 28, + fill: '#8c8c8c', + textAlign: 'center', + }, + offsetX: -10, + offsetY: 20, + }) + innerView.render(true); + + + lastItem = data.item; + } + } + + // 清空 annotation + function clearAnnotation() { + innerView.annotation().clear(true); + innerView.render(true); + lastItem = null; + } + + } +} + + diff --git a/src/app/routes/datatable/dataindex/dataindex.component.html b/src/app/routes/datatable/dataindex/dataindex.component.html deleted file mode 100644 index ffa275ac..00000000 --- a/src/app/routes/datatable/dataindex/dataindex.component.html +++ /dev/null @@ -1,32 +0,0 @@ - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
diff --git a/src/app/routes/datatable/dataindex/dataindex.component.ts b/src/app/routes/datatable/dataindex/dataindex.component.ts deleted file mode 100644 index b180b8a5..00000000 --- a/src/app/routes/datatable/dataindex/dataindex.component.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { ModalHelper, _HttpClient } from '@delon/theme'; -import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area'; -import { format } from 'date-fns'; - -@Component({ - selector: 'app-datatable-dataindex', - templateUrl: './dataindex.component.html', - styleUrls: ['./dataindex.component.less'] -}) -export class DatatableDataindexComponent implements OnInit { - visitData = this.genData(); - - constructor(private http: _HttpClient, private modal: ModalHelper) { } - - ngOnInit(): void { } - private genData(): G2MiniAreaData[] { - const beginDay = new Date().getTime(); - const res: G2MiniAreaData[] = []; - for (let i = 0; i < 20; i += 1) { - res.push({ - x: format(new Date(beginDay + 1000 * 60 * 60 * 24 * i), 'yyyy-MM-dd'), - y: Math.floor(Math.random() * 100) + 10, - }); - } - return res; - } - - refresh(): void { - this.visitData = this.genData(); - } - - handleClick(data: G2MiniAreaClickItem): void { - //this.msg.info(`${data.item.x} - ${data.item.y}`); - } - -} diff --git a/src/app/routes/datatable/datatable-routing.module.ts b/src/app/routes/datatable/datatable-routing.module.ts index 76a62af8..3f26a99f 100644 --- a/src/app/routes/datatable/datatable-routing.module.ts +++ b/src/app/routes/datatable/datatable-routing.module.ts @@ -1,10 +1,19 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { DatatableDataindexComponent } from './dataindex/dataindex.component'; +import { DatatableCustomtableComponent } from './components/customtable/customtable.component'; +import { DatatableCustomindexComponent } from './components/customtable/customindex/customindex.component'; +import { DatatableOwnerComponent } from './components/customtable/owner/owner.component'; +import { DatatableDriverComponent } from './components/customtable/driver/driver.component'; +import { DatatableOperationtableComponent } from './components/operationtable/operationtable.component'; +import { DatatableDataindexComponent } from './components/dataindex/dataindex.component'; const routes: Routes = [ - - { path: 'dataindex', component: DatatableDataindexComponent }]; + { path: 'dataindex', component: DatatableDataindexComponent }, + { path: 'customtable', component: DatatableCustomtableComponent }, + { path: 'customindex', component: DatatableCustomindexComponent }, + { path: 'owner', component: DatatableOwnerComponent }, + { path: 'driver', component: DatatableDriverComponent }, + { path: 'operationtable', component: DatatableOperationtableComponent }]; @NgModule({ imports: [RouterModule.forChild(routes)], diff --git a/src/app/routes/datatable/datatable.module.ts b/src/app/routes/datatable/datatable.module.ts index f996d3b5..10668149 100644 --- a/src/app/routes/datatable/datatable.module.ts +++ b/src/app/routes/datatable/datatable.module.ts @@ -1,10 +1,23 @@ import { NgModule, Type } from '@angular/core'; import { SharedModule, SHARED_G2_MODULES } from '@shared'; import { DatatableRoutingModule } from './datatable-routing.module'; -import { DatatableDataindexComponent } from './dataindex/dataindex.component'; +import { DatatableCustomtableComponent } from './components/customtable/customtable.component'; +import { DatatableCustomindexComponent } from './components/customtable/customindex/customindex.component'; +import { DatatableOwnerComponent } from './components/customtable/owner/owner.component'; +import { DatatableDriverComponent } from './components/customtable/driver/driver.component'; +import { DatatableOperationtableComponent } from './components/operationtable/operationtable.component'; +import { DatatableDataindexComponent } from './components/dataindex/dataindex.component'; +import { OperationtablePieComponent } from './components/operationtable/pie/pie.component'; const COMPONENTS: Type[] = [ - DatatableDataindexComponent]; + DatatableDataindexComponent, + DatatableCustomtableComponent, + DatatableCustomindexComponent, + DatatableOwnerComponent, + DatatableDriverComponent, + DatatableOperationtableComponent, + OperationtablePieComponent +]; @NgModule({ imports: [ diff --git a/src/app/routes/datatable/services/data.service.ts b/src/app/routes/datatable/services/data.service.ts new file mode 100644 index 00000000..be36c9cf --- /dev/null +++ b/src/app/routes/datatable/services/data.service.ts @@ -0,0 +1,30 @@ +/* + * @Description : + * @Version : 1.0 + * @Author : Shiming + * @Date : 2021-12-27 10:30:56 + * @LastEditors : Shiming + * @LastEditTime : 2022-01-18 17:14:59 + * @FilePath : \\tms-obc-web\\src\\app\\routes\\account\\services\\account.service.ts + * Copyright (C) 2022 huzhenhong. All rights reserved. + */ + +import { Injectable, Injector } from '@angular/core'; +import { _HttpClient } from '@delon/theme'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { map } from 'rxjs/operators'; +import { BaseService } from 'src/app/shared/services/core/base.service'; +import { EAFileUtil } from 'src/app/shared/utils/file.util'; + +@Injectable({ + providedIn: 'root', +}) +export class DataService extends BaseService { + + // 查询运营报表 + $api_listOperationalReportPage = `/api/sdc/report/listOperationalReportPage`; + + constructor(public injector: Injector) { + super(injector); + } +} diff --git a/src/app/shared/shared-g2.module.ts b/src/app/shared/shared-g2.module.ts index 93863e08..10ea8fcc 100644 --- a/src/app/shared/shared-g2.module.ts +++ b/src/app/shared/shared-g2.module.ts @@ -3,6 +3,7 @@ import { G2MiniAreaModule } from '@delon/chart/mini-area'; import { G2PieModule } from '@delon/chart/pie'; import { G2TimelineModule } from '@delon/chart/timeline'; import { G2CardModule } from '@delon/chart/card'; +import { G2CustomModule } from '@delon/chart/custom'; -export const SHARED_G2_MODULES = [G2BarModule, G2PieModule, G2TimelineModule, G2MiniAreaModule, G2CardModule]; +export const SHARED_G2_MODULES = [G2BarModule, G2PieModule, G2TimelineModule, G2MiniAreaModule, G2CardModule, G2CustomModule]; From ca0cc0f24cfd4afbe1a390e52ebf1b316be91c25 Mon Sep 17 00:00:00 2001 From: Lingzi Date: Tue, 29 Mar 2022 11:35:23 +0800 Subject: [PATCH 03/14] fix bug --- .../components/operationtable/operationtable.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/routes/datatable/components/operationtable/operationtable.component.ts b/src/app/routes/datatable/components/operationtable/operationtable.component.ts index bfa13aea..aa4ed793 100644 --- a/src/app/routes/datatable/components/operationtable/operationtable.component.ts +++ b/src/app/routes/datatable/components/operationtable/operationtable.component.ts @@ -16,7 +16,7 @@ export class DatatableOperationtableComponent implements OnInit {; mode = 'year'; date: any = null; defineDate = []; - time: any = [] + time: any = ['2022-01-01 00:00:00'] dateFormat = 'yyyy-MM-dd'; today = new Date(); @ViewChild('st') private readonly st!: STComponent; From f5fc1b901d38d56bcd85d97c801d78a6b3d6fb83 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 29 Mar 2022 13:53:23 +0800 Subject: [PATCH 04/14] fix bug --- .../rebate-record.component.html | 8 +-- .../rebate-record/rebate-record.component.ts | 28 ++------- .../rebate-setting.component.html | 3 +- .../rebate-setting.component.ts | 59 +++++++++---------- .../services/rebate-management.service.ts | 6 +- 5 files changed, 44 insertions(+), 60 deletions(-) diff --git a/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.html b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.html index 50b366ea..2456985d 100644 --- a/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.html +++ b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-02-24 20:09:49 * @LastEditors : Shiming - * @LastEditTime : 2022-03-10 15:12:03 + * @LastEditTime : 2022-03-29 13:40:16 * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-record\\rebate-record.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -33,7 +33,7 @@ - -
1223
+ +
123212{{item?.abnormalFeedback}}
diff --git a/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.ts b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.ts index 1f98579d..e1d2b4c3 100644 --- a/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.ts +++ b/src/app/routes/partner/rebate-management/components/rebate-record/rebate-record.component.ts @@ -32,30 +32,12 @@ export class ParterRebateManageMentRecordComponent implements OnInit { public shipperservice: ShipperBaseService, ) {} /** - * 查询字段个数 - */ - get queryFieldCount(): number { - return Object.keys(this.schema?.properties || {}).length; - } - /** - * 伸缩查询条件 - */ - expandToggle(): void { - this._$expand = !this._$expand; - this.sf?.setValue('/_$expand', this._$expand); - } - /** * 查询参数 */ get reqParams() { const params: any = Object.assign({}, this.sf?.value || {}); - delete params._$expand; return { ...params, - deadlineTime: { - start: this.sf?.value?.deadlineTime?.[0] || '', - end: this.sf?.value?.deadlineTime?.[1] || '', - }, }; } ngOnInit() { @@ -66,7 +48,6 @@ export class ParterRebateManageMentRecordComponent implements OnInit { initSF() { this.schema = { properties: { - _$expand: { type: 'boolean', ui: { hidden: true } }, month: { type: 'string', title: '时间月份', @@ -90,7 +71,8 @@ export class ParterRebateManageMentRecordComponent implements OnInit { this.columns = [ { title: '月份', - index: 'name1' + index: 'month', + format: (item: any) => {return item?.month ? item?.month + '月' : ''} }, { title: '返佣金额(元)', @@ -98,7 +80,7 @@ export class ParterRebateManageMentRecordComponent implements OnInit { }, { title: '合伙人名称', - index: 'name1' + index: 'partnerName' }, { title: '实际等级', @@ -106,7 +88,7 @@ export class ParterRebateManageMentRecordComponent implements OnInit { }, { title: '管理费比例', - index: 'name1' + index: 'rebateRatio' }, { title: '返佣时间', @@ -114,7 +96,7 @@ export class ParterRebateManageMentRecordComponent implements OnInit { }, { title: '异常反馈', - render: 'name44' + render: 'abnormalFeedback' }, { title: '操作', diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html index 251f9c00..5d636436 100644 --- a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-02-24 20:09:49 * @LastEditors : Shiming - * @LastEditTime : 2022-03-29 10:51:52 + * @LastEditTime : 2022-03-29 11:14:08 * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\components\\rebate-setting\\rebate-setting.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -41,6 +41,7 @@ #st [data]="service.$api_get_rebateConfig" [columns]="columns" + [scroll]="{x: '1200px'}" [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] }" diff --git a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts index 795f64ee..ee9b5b9d 100644 --- a/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts +++ b/src/app/routes/partner/rebate-management/components/rebate-setting/rebate-setting.component.ts @@ -23,7 +23,6 @@ export class ParterRebateManageMentSettingComponent implements OnInit { sf!: SFComponent; spuStatus = '1'; _$expand = false; - data = [{ name1: 1111 }]; constructor( public router: Router, public ar: ActivatedRoute, @@ -32,30 +31,12 @@ export class ParterRebateManageMentSettingComponent implements OnInit { public shipperservice: ShipperBaseService, ) {} /** - * 查询字段个数 - */ - get queryFieldCount(): number { - return Object.keys(this.schema?.properties || {}).length; - } - /** - * 伸缩查询条件 - */ - expandToggle(): void { - this._$expand = !this._$expand; - this.sf?.setValue('/_$expand', this._$expand); - } - /** * 查询参数 */ get reqParams() { const params: any = Object.assign({}, this.sf?.value || {}); - delete params._$expand; return { ...params, - deadlineTime: { - start: this.sf?.value?.deadlineTime?.[0] || '', - end: this.sf?.value?.deadlineTime?.[1] || '', - }, }; } ngOnInit() { @@ -66,15 +47,22 @@ export class ParterRebateManageMentSettingComponent implements OnInit { initSF() { this.schema = { properties: { - _$expand: { type: 'boolean', ui: { hidden: true } }, - month: { + configName: { type: 'string', title: '配置名称', - format: 'configName', }, stateLocked: { type: 'string', - title: '状态' + title: '状态', + enum: [ + {label: '全部', value: ''}, + {label: '启用', value: 0}, + {label: '禁用', value: 1}, + ], + ui: { + widget: 'select', + }, + }, } }; @@ -90,35 +78,44 @@ export class ParterRebateManageMentSettingComponent implements OnInit { this.columns = [ { title: '配置名称', - index: 'configName' + index: 'configName', + width: '200px', }, { title: '配置类型', - render: 'configType' + render: 'configType', + width: '200px', + }, { title: '备注', - index: 'remark' + index: 'remark', + width: '250px', }, { title: '关联合伙人范围', - render: 'partnerType' + render: 'partnerType', + width: '200px', }, { title: '创建时间', - index: 'enableTime' + index: 'enableTime', + width: '200px', }, { title: '启用时间', - index: 'enableTime' + index: 'enableTime', + width: '200px', }, { title: '优先级', - index: 'priority' + index: 'priority', + width: '100px', }, { title: '状态', - render: 'stateLocked' + render: 'stateLocked', + width: '100px', }, { title: '操作', diff --git a/src/app/routes/partner/rebate-management/services/rebate-management.service.ts b/src/app/routes/partner/rebate-management/services/rebate-management.service.ts index 2e68c860..fd12644c 100644 --- a/src/app/routes/partner/rebate-management/services/rebate-management.service.ts +++ b/src/app/routes/partner/rebate-management/services/rebate-management.service.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-03-10 11:19:00 * @LastEditors : Shiming - * @LastEditTime : 2022-03-10 13:51:05 + * @LastEditTime : 2022-03-29 11:26:38 * @FilePath : \\tms-obc-web\\src\\app\\routes\\partner\\rebate-management\\services\\rebate-management.service.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -23,6 +23,10 @@ export class RebateManagementService extends BaseService { public $api_save_rebateConfig = '/api/mdc/rebateConfig/save'; // 启用/禁用返佣配置 public $api_set_updateRebateConfig = '/api/mdc/rebateConfig/updateRebateConfig'; + + + // 运营端查询合伙人返佣 + public $api_get_getIncomeByBillpage = '/api/bpc/partnerIncomeHead/getIncomeByBillpage';   // 查询合伙人信息-分页 public $api_get_partner_page = '/api/mdc/partner/list/page'; constructor(public injector: Injector) { From f9f4b11da55c8540ee9f291b24a3d202e1c0896d Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 29 Mar 2022 14:30:55 +0800 Subject: [PATCH 05/14] fix bug --- .../components/bulk-detail/bulk-detail.component.html | 4 ++-- .../components/bulk-detail/bulk-detail.component.ts | 9 ++++++--- .../compliance-audit/compliance-audit.component.html | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html index 50746e93..464766ad 100644 --- a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-06 20:20:26 * @LastEditors : Shiming - * @LastEditTime : 2022-03-29 11:09:00 + * @LastEditTime : 2022-03-29 14:30:12 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -222,7 +222,7 @@
- + diff --git a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts index d0da463c..816be5a7 100644 --- a/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts +++ b/src/app/routes/order-management/components/bulk-detail/bulk-detail.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-06 20:20:26 * @LastEditors : Shiming - * @LastEditTime : 2022-03-23 14:44:43 + * @LastEditTime : 2022-03-29 14:30:11 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail\\bulk-detail.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -65,14 +65,17 @@ export class OrderManagementBulkeDetailComponent implements OnInit { mapList:any[] = []; //地图点位数据组 addressItems:any[] = []; //打点地址数据组 constructor( - private route: ActivatedRoute, + public route: ActivatedRoute, private msgSrv: NzMessageService, private service: OrderManagementService, private router: Router, private modal: NzModalService - ) {} + ) { + } ngOnInit(): void { + console.log(this.route?.snapshot?.queryParams?.sts); + this.initData(); this.getTrajectory(); } diff --git a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.html b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.html index f08ba4b1..f586416d 100644 --- a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.html +++ b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-12 10:52:50 * @LastEditors : Shiming - * @LastEditTime : 2022-03-25 13:44:42 + * @LastEditTime : 2022-03-29 14:28:39 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\compliance-audit\\compliance-audit.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -88,7 +88,7 @@ {{ item.billCode }} - {{ item.billCode }} + {{ item.billCode }} {{ item.billCode }}
{{ item?.billStatusLabel }} From 69daae8e32e504ada4cbbfc22baab8cc76875644 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 29 Mar 2022 14:52:38 +0800 Subject: [PATCH 06/14] fix bug --- .../contract-template-frame.component.ts | 2 +- .../contract-template-partner.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.ts b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.ts index 8fa79108..0241608e 100644 --- a/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.ts +++ b/src/app/routes/contract-management/components/contract-template-frame/contract-template-frame.component.ts @@ -244,7 +244,7 @@ export class ContractManagementTemplateFrameComponent implements OnInit { this.service.request(this.service.$api_deletebatch_contractTemplate, [value.id]).subscribe(res => { if (res) { this.service.msgSrv.success('删除成功!'); - this.st.reload(1) + this.st.reload() } }) }); diff --git a/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.ts b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.ts index 71ca4229..24d93d4e 100644 --- a/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.ts +++ b/src/app/routes/contract-management/components/contract-template-partner/contract-template-partner.component.ts @@ -244,7 +244,7 @@ export class ContractManagementTemplatePartnerComponent implements OnInit { this.service.request(this.service.$api_deletebatch_contractTemplate, [value.id]).subscribe(res => { if (res) { this.service.msgSrv.success('删除成功!'); - this.st.reload(1) + this.st.reload() } }) }); From 950155c7996cacc123495e73fd1d4d56366fbfd1 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Tue, 29 Mar 2022 15:01:38 +0800 Subject: [PATCH 07/14] edit --- proxy.conf.js | 2 +- .../partner-audit-modal.component.ts | 1 + .../partner-detail/partner-detail.component.ts | 10 ++++++---- .../partner-list/services/partner-list.service.ts | 2 +- .../shared/services/business/shipper-base.service.ts | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/proxy.conf.js b/proxy.conf.js index 67c15ee2..10071e14 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -20,7 +20,7 @@ module.exports = { // } '//api': { target: { - host: 'tms-api-test.eascs.com', + host: 'tms-api-dev.eascs.com', protocol: 'https:', port: 443 }, diff --git a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts index 6e271d70..f6fbcaac 100644 --- a/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts +++ b/src/app/routes/partner/partner-list/components/partner-audit-modal/partner-audit-modal.component.ts @@ -112,6 +112,7 @@ export class PartnerAuditModalComponent implements OnInit { }; this.service .request(this.service.$api_audit_partner, { + ...params, auditStatusEnum: params.auditStatusEnum, id: params.id, approvalOpinion: params.approvalOpinion, diff --git a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts index 61559772..f7545511 100644 --- a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts +++ b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts @@ -117,8 +117,10 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { freezeOrResume(type: number) { this.service.http .post(this.service.$api_lock_freight, { - id: this.route.snapshot.params.id, - statedLocked: !!type + appUserId: [this.route.snapshot.params.id], + freezeOrResume: !!type, + pageName: '合伙人详情', + telephone: this.detailData.adminUserInfo.mobile }) .subscribe(res => { if (res.data === true) { @@ -138,7 +140,7 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { const modal = this.nzModalService.create({ nzTitle: '审核', nzContent: PartnerAuditModalComponent, - nzComponentParams: { info: { ...this.detailData, isPass },sourcePage:'合伙人审核详情' }, + nzComponentParams: { info: { ...this.detailData, isPass }, sourcePage: '合伙人审核详情' }, nzFooter: null }); } @@ -274,7 +276,7 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { operatingEndTime: this.datePipe.transform(dateil.operatingEndTime, 'yyyy-MM-dd'), operatingStartTime: this.datePipe.transform(dateil.operatingStartTime, 'yyyy-MM-dd') }); - + this.service.request(this.service.$api_save_entp_partner, params).subscribe(res => { if (res) { this.service.msgSrv.success('企业合伙人修改成功'); diff --git a/src/app/routes/partner/partner-list/services/partner-list.service.ts b/src/app/routes/partner/partner-list/services/partner-list.service.ts index 5a00d758..b714c47c 100644 --- a/src/app/routes/partner/partner-list/services/partner-list.service.ts +++ b/src/app/routes/partner/partner-list/services/partner-list.service.ts @@ -38,7 +38,7 @@ export class PartnerListService extends ShipperBaseService { // 渠道销售修改详情 $api_get_partner_change_list = '/api/mdc/partnerChannelRelLog/partnerChannelUpdateDetaiList'; // 冻结/启用企业业 - $api_lock_freight = '/api/mdc/cuc/enterpriseInfo/operate/lock'; + $api_lock_freight = '/api/mdc/cuc/userApp/freezeOrResume'; // 根据地区code查询列表 $api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode'; diff --git a/src/app/shared/services/business/shipper-base.service.ts b/src/app/shared/services/business/shipper-base.service.ts index bba9056d..045ca354 100644 --- a/src/app/shared/services/business/shipper-base.service.ts +++ b/src/app/shared/services/business/shipper-base.service.ts @@ -297,7 +297,7 @@ export class ShipperBaseService extends BaseService { map(res => { if (res) { return res.map((m: any) => { - return { label: `${m.employeeVO?.empName}/${m.employeeVO?.mobile}`, value: m.userAppId }; + return { label: `${m.employeeVO?.empName}/${m.employeeVO?.mobile}`, value: m.id }; }); } else { return []; From d1c0f7a05f1d3c1a1f1499a95f2fd1eac3ce029f Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Tue, 29 Mar 2022 15:12:01 +0800 Subject: [PATCH 08/14] edit --- .../components/index/partner-list.component.ts | 6 ++++++ .../partner-detail/partner-detail.component.html | 8 ++++---- .../components/partner-detail/partner-detail.component.ts | 2 +- .../personal-partner-detail.component.html | 8 ++++---- .../personal-partner-detail.component.ts | 6 ++++-- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/app/routes/partner/partner-list/components/index/partner-list.component.ts b/src/app/routes/partner/partner-list/components/index/partner-list.component.ts index 2e47723a..7d1cafb2 100644 --- a/src/app/routes/partner/partner-list/components/index/partner-list.component.ts +++ b/src/app/routes/partner/partner-list/components/index/partner-list.component.ts @@ -71,6 +71,9 @@ export class PartnerListComponent { nzComponentParams: { info: { ...item, enterpriseName: item.enterpriseName || item.contactName }, sourcePage: '合伙人审核列表' }, nzFooter: null }); + modal.afterClose.subscribe(res => { + modal.destroy(); + }); } editTemplateAction(item: any) { @@ -102,6 +105,7 @@ export class PartnerListComponent { .subscribe(res => { if (res) { this.service.msgSrv.success('修改成功'); + this.st.load(1); this.nzModalService.closeAll(); } }); @@ -161,6 +165,7 @@ export class PartnerListComponent { if (res) { this.service.msgSrv.success('修改成功'); this.nzModalService.closeAll(); + this.st.load(1); } }); } @@ -185,6 +190,7 @@ export class PartnerListComponent { } else { this.service.msgSrv.warning('发起失败'); } + this.st.load(1); }); } }); diff --git a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html index c4abbd48..dc271a74 100644 --- a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html +++ b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.html @@ -16,8 +16,8 @@

{{ detailData?.enterpriseName }}

- - + +
@@ -46,12 +46,12 @@ diff --git a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts index f7545511..b65e7695 100644 --- a/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts +++ b/src/app/routes/partner/partner-list/components/partner-detail/partner-detail.component.ts @@ -117,7 +117,7 @@ export class PartnerDetailComponent implements OnInit, OnDestroy { freezeOrResume(type: number) { this.service.http .post(this.service.$api_lock_freight, { - appUserId: [this.route.snapshot.params.id], + appUserId: [this.detailData.appUserId], freezeOrResume: !!type, pageName: '合伙人详情', telephone: this.detailData.adminUserInfo.mobile diff --git a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html index 96041864..b34aef70 100644 --- a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html +++ b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.html @@ -16,8 +16,8 @@

{{ detailData?.adminUserInfo?.name }}

- - + +
@@ -46,12 +46,12 @@ diff --git a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts index 6ee8f6d5..ce1cec65 100644 --- a/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts +++ b/src/app/routes/partner/partner-list/components/personal-partner-detail/personal-partner-detail.component.ts @@ -92,8 +92,10 @@ export class PersonalPartnerDetailComponent implements OnInit { freezeOrResume(type: number) { this.service.http .post(this.service.$api_lock_freight, { - id: this.route.snapshot.params.id, - statedLocked: !!type + appUserId: [this.detailData.appUserId], + freezeOrResume: !!type, + pageName: '合伙人详情', + telephone: this.detailData.adminUserInfo.mobile }) .subscribe(res => { if (res.data === true) { From f4d4c19754be54b2ba5eba7d61af221ddf3674b0 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 29 Mar 2022 15:25:13 +0800 Subject: [PATCH 09/14] fix bug --- .../compliance-audit/compliance-audit.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts index 5a524963..7beb1cda 100644 --- a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts +++ b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts @@ -25,6 +25,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit { changeId: any; // 主页面查看运费变更记录id - 用于运费变更记录 changeViewId: any; // 查看运费变更记录id - 用于查看 auditId: any; + auditIdR: any; auditMany = false; isVisibleView = false; isVisibleEvaluate = false; @@ -629,7 +630,7 @@ export class OrderManagementComplianceAuditComponent implements OnInit { idList.push(item.id); }); } else { - idList.push(this.sfView.value.billCode) + idList.push(this?.auditIdR) } const parms = { ids: idList, @@ -681,7 +682,8 @@ export class OrderManagementComplianceAuditComponent implements OnInit { audit(item?: any) { if (item) { this.isVisibleRE = true; - this.auditId = item.id; + this.auditId = item.billCode; + this.auditIdR = item.id; this.initSTAudit(1); } else { if (this.selectedRows.length <= 0) { From ab29dc7af68ce554bc2555bc36532b07e24e3bb1 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 29 Mar 2022 15:58:23 +0800 Subject: [PATCH 10/14] fix bug --- .../components/compliance-audit/compliance-audit.component.ts | 1 - .../components/receipts-audit/receipts-audit.component.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts index 7beb1cda..fdea46af 100644 --- a/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts +++ b/src/app/routes/order-management/components/compliance-audit/compliance-audit.component.ts @@ -143,7 +143,6 @@ export class OrderManagementComplianceAuditComponent implements OnInit { type: 'string', title: '订单号', ui: { - placeholder: '最多100个单号,空号隔开' } }, resourceCode: { diff --git a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts index d198a894..c20719db 100644 --- a/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts +++ b/src/app/routes/order-management/components/receipts-audit/receipts-audit.component.ts @@ -146,14 +146,14 @@ export class OrderManagementReceiptsAuditComponent implements OnInit { type: 'string', title: '订单号', ui: { - placeholder: '最多100个单号,空号隔开' + placeholder: '请输入' } }, wayBillCode: { type: 'string', title: '运单号', ui: { - placeholder: '最多100个运单,空号隔开' + placeholder: '请输入' } }, resourceCode: { From d29aa5293bf83dec79751ff36eae9959aa253e6f Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 29 Mar 2022 16:06:07 +0800 Subject: [PATCH 11/14] fix bug --- .../components/complaint/complaint.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/routes/order-management/components/complaint/complaint.component.ts b/src/app/routes/order-management/components/complaint/complaint.component.ts index f0df957e..31a6edee 100644 --- a/src/app/routes/order-management/components/complaint/complaint.component.ts +++ b/src/app/routes/order-management/components/complaint/complaint.component.ts @@ -106,7 +106,7 @@ export class OrderManagementComplaintComponent implements OnInit { type: 'string', ui: { widget: 'dict-select', - params: { dictKey: 'complaint:cause' }, + params: { dictKey: 'drvcomplaint:cause' }, containsAllLabel: true, } as SFSelectWidgetSchema }, @@ -145,7 +145,7 @@ export class OrderManagementComplaintComponent implements OnInit { className: 'text-center', }, { title: '托运方', index: 'shipperAppUserName', width: '200px', className: 'text-center' }, - { title: '司机', index: 'driverIdLabel', width: '120px', className: 'text-center' }, + { title: '司机', index: 'driverName', width: '120px', className: 'text-center' }, { title: '投诉原因', className: 'text-center', From eb12dd8db7dade8427b005aa4799d0e26435d788 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 29 Mar 2022 16:09:25 +0800 Subject: [PATCH 12/14] fix bug --- .../vehicle-detail.component.html | 25 ++++++++++++++++++- .../vehicle-detail.component.ts | 18 +++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html index ccb172f1..8a89ec51 100644 --- a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.html @@ -229,7 +229,30 @@
- + + + + +
+ 您的订单可能存在交易风险,请及时提交申诉材料,提交成功后,平台将及时完成审核并通知您! +
+
如果您的运单没有问题,可以提出申诉,并提供相关资料,我们将24小时内审核反馈
+
    +
  • 系统识别:{{item?.complianceTypeName}}
  • +
  • {{item?.determineDetails}},您可在企业端提交申诉材料或联系客服。
  • +
  • 2021-11-07 03:20:15
  • +
+
+ + + + + + + + +
+
暂无附件信息
diff --git a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts index 4bbe0ef8..2089b4f3 100644 --- a/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts +++ b/src/app/routes/order-management/components/vehicle-detail/vehicle-detail.component.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-28 14:42:03 * @LastEditors : Shiming - * @LastEditTime : 2022-03-23 14:45:58 + * @LastEditTime : 2022-03-29 16:08:56 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail\\vehicle-detail.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -29,6 +29,7 @@ export class OrderManagementVehicleDetailComponent implements OnInit { mapList: any[] = []; //地图点位数据组 pois: any[] = []; addressItems: any[] = []; //打点地址数据组 + abnormalList: any[] = []; i: any = { unLoadingPlaceList: [], billExpenseDetails: [], @@ -66,7 +67,7 @@ export class OrderManagementVehicleDetailComponent implements OnInit { } ]; constructor( - private route: ActivatedRoute, + public route: ActivatedRoute, private msgSrv: NzMessageService, private service: OrderManagementService, private router: Router, @@ -102,6 +103,19 @@ export class OrderManagementVehicleDetailComponent implements OnInit { this.i.scheduleVOList = this.i?.scheduleVOList?.filter((data: any) => data.displayStatus !== 'HIDE'); } }); + this.service.request(this.service.$api_listBillComplianceAbnormalByBillId, { id: this.id }).subscribe(res => { + if (res) { + console.log('风险详情') + console.log(res) + this.abnormalList = res + } + }); + this.service.request(this.service.$api_getAbnormalWarningByBillId, { id: this.id }).subscribe(res => { + if (res) { + console.log('异常预警') + console.log(res) + } + }); } // 取消订单 cancellation() { From d5de70daf60a2b210c33be0330f450f09b1467ad Mon Sep 17 00:00:00 2001 From: wangshiming Date: Tue, 29 Mar 2022 16:17:05 +0800 Subject: [PATCH 13/14] fix bug --- .../components/complaint/complaint.component.html | 6 +++--- .../components/complaint/complaint.component.ts | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app/routes/order-management/components/complaint/complaint.component.html b/src/app/routes/order-management/components/complaint/complaint.component.html index 6ced1c60..288f1e05 100644 --- a/src/app/routes/order-management/components/complaint/complaint.component.html +++ b/src/app/routes/order-management/components/complaint/complaint.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-01-12 10:52:50 * @LastEditors : Shiming - * @LastEditTime : 2022-03-23 10:11:08 + * @LastEditTime : 2022-03-29 16:13:40 * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\complaint\\complaint.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -21,10 +21,10 @@
-
+
-
+
-

投诉单号:{{datailList?.id}}

+

投诉单号:{{datailList?.complaintCode}}