Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop
This commit is contained in:
@ -0,0 +1,2 @@
|
||||
<g2-custom delay="100" (render)="render($event)"></g2-custom>
|
||||
|
||||
@ -0,0 +1,132 @@
|
||||
/*
|
||||
* @Description :
|
||||
* @Version : 1.0
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-04-07 17:57:23
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-04-07 19:28:24
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\curve\\curve.component.ts
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
*/
|
||||
import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { G2MiniAreaClickItem } from '@delon/chart/mini-area';
|
||||
import { DataService } from '../../../services/data.service';
|
||||
// import DataSet from '@antv/data-set';
|
||||
const DataSet = require('@antv/data-set');
|
||||
import { Chart } from '@antv/g2';
|
||||
@Component({
|
||||
selector: 'app-financetable-curve-min',
|
||||
templateUrl: './curve.component.html',
|
||||
styleUrls: ['./curve.component.less']
|
||||
})
|
||||
export class DatatableCustomindexCurveMinComponent implements OnInit,OnChanges {
|
||||
el: any;
|
||||
@Input() chartData: any;
|
||||
chart: any;
|
||||
data = [
|
||||
{ time: '01', type: '订单数', temperature: 7 },
|
||||
{ time: '02', type: '运单数', temperature: 3.9 },
|
||||
{ time: '03', type: '订单数', temperature: 6.9 },
|
||||
{ time: '04', type: '订单数', temperature: 4.2 },
|
||||
{ time: '05', type: '订单数', temperature: 9.5 },
|
||||
{ time: '06', type: '订单数', temperature: 5.7 },
|
||||
{ time: '06', type: '运单数', temperature: 5.7 },
|
||||
{ time: '07', type: '运单数', temperature: 14.5 },
|
||||
{ time: '08', type: '订单数', temperature: 8.5 },
|
||||
{ time: '09', type: '订单数', temperature: 18.4 },
|
||||
{ time: '10', type: '订单数', temperature: 11.9 },
|
||||
{ time: '11', type: '订单数', temperature: 21.5 },
|
||||
{ time: '12', type: '订单数', temperature: 15.2 },
|
||||
{ time: '08', type: '运单数', temperature: 8.5 },
|
||||
{ time: '09', type: '运单数', temperature: 18.4 },
|
||||
{ time: '10', type: '运单数', temperature: 11.9 },
|
||||
{ time: '11', type: '运单数', temperature: 21.5 },
|
||||
{ time: '12', type: '订单数', temperature: 15.2 },
|
||||
];
|
||||
constructor(private service: DataService, private ngZone: NgZone) {
|
||||
|
||||
}
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (this.chartData) {
|
||||
// setTimeout(()=>{
|
||||
// this.chart.render(true)
|
||||
// }, 1000)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
}
|
||||
reRender() {
|
||||
setTimeout(() => {
|
||||
this.chart.data(this.chartData);
|
||||
this.chart.render();
|
||||
}, 1000)
|
||||
}
|
||||
render(el: ElementRef<HTMLDivElement>): void {
|
||||
this.el = el.nativeElement
|
||||
setTimeout(() => {
|
||||
this.ngZone.runOutsideAngular(() => this.init(this.el));
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
private init(el: HTMLElement): void {
|
||||
this.chart = new Chart({
|
||||
container: el,
|
||||
autoFit: true,
|
||||
height: 200,
|
||||
});
|
||||
let value: any = []
|
||||
this.service.request(this.service.$api_getTradingTrend).subscribe((res: any) => {
|
||||
if(res) {
|
||||
res.forEach((element: any) => {
|
||||
value.push({
|
||||
time: element?.time,
|
||||
type: element?.type == 'DD' ? '订单数' : '运单数',
|
||||
temperature: element?.value,
|
||||
});
|
||||
});
|
||||
console.log(value);
|
||||
this.chartData = value
|
||||
this.chart.data(this.chartData);
|
||||
this.chart.scale({
|
||||
time: {
|
||||
range: [0, 1],
|
||||
},
|
||||
number: {
|
||||
nice: true,
|
||||
},
|
||||
});
|
||||
|
||||
this.chart.tooltip({
|
||||
showCrosshairs: true,
|
||||
shared: true,
|
||||
});
|
||||
|
||||
|
||||
this.chart.axis('temperature', {
|
||||
label: {
|
||||
formatter: (val: any) => {
|
||||
return val + '万';
|
||||
},
|
||||
},
|
||||
});
|
||||
this.chart
|
||||
.line()
|
||||
.position('time*temperature')
|
||||
.color('type')
|
||||
.shape('smooth');
|
||||
|
||||
this.chart
|
||||
.point()
|
||||
.position('time*temperature')
|
||||
.color('type')
|
||||
.shape('circle');
|
||||
this.chart.render();
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-04-06 10:57:56
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-04-07 16:57:05
|
||||
* @LastEditTime : 2022-04-07 19:51:32
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
@ -42,16 +42,8 @@
|
||||
</nz-col>
|
||||
</nz-row>
|
||||
</nz-card>
|
||||
<nz-card nzTitle="本月交易趋势">
|
||||
<g2-timeline repaint='true'
|
||||
[data]="monthData2"
|
||||
#timeline
|
||||
[titleMap]="{ y1: '订单数', y2: '运单数' }"
|
||||
[height]="200"
|
||||
[delay]='200'
|
||||
mask="MM月DD日"
|
||||
[slider]="false"
|
||||
></g2-timeline>
|
||||
<nz-card nzTitle="本月交易趋势" >
|
||||
<app-financetable-curve-min #curve [chartData]='chartData2'></app-financetable-curve-min>
|
||||
</nz-card>
|
||||
<nz-card nzTitle="实时货源">
|
||||
<st
|
||||
@ -173,6 +165,9 @@
|
||||
[page]="{ show: false, showSize: false, pageSizes: [5, 50, 100] }"
|
||||
[loading]="service.http.loading"
|
||||
>
|
||||
<ng-template st-row="carNo" let-item let-index="index">
|
||||
{{ item?.driverName }}{{ item?.carNo ? '/' + item?.carNo : '' }}
|
||||
</ng-template>
|
||||
</st>
|
||||
</nz-card>
|
||||
</div>
|
||||
|
||||
@ -5,7 +5,7 @@ import { map } from 'rxjs/operators';
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-04-06 10:57:56
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-04-07 16:58:19
|
||||
* @LastEditTime : 2022-04-07 19:48:19
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.ts
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
*/
|
||||
@ -14,10 +14,11 @@ import { STColumn, STComponent } from '@delon/abc/st';
|
||||
import { SFSchema } from '@delon/form';
|
||||
import { ModalHelper, _HttpClient } from '@delon/theme';
|
||||
import { DataService } from '../../services/data.service';
|
||||
import { DatatableCustomindexMapComponent } from './curve/map.component';
|
||||
import { DatatableCustomindexMapComponent } from './map/map.component';
|
||||
import { G2TimelineComponent, G2TimelineData } from '@delon/chart/timeline';
|
||||
import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area';
|
||||
import { format } from 'date-fns';
|
||||
import { FinanceTableCurveComponent } from '../financetable/curve/curve.component';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-datatable-datascreen',
|
||||
@ -29,10 +30,12 @@ export class DatatableDatascreenComponent implements OnInit {
|
||||
@ViewChild('orderSt') private readonly orderSt!: STComponent;
|
||||
@ViewChild('map') private readonly map!: DatatableCustomindexMapComponent;
|
||||
@ViewChild('timeline', { static: false }) timeline!: G2TimelineComponent;
|
||||
@ViewChild('curve') private readonly curve!: FinanceTableCurveComponent;
|
||||
|
||||
columns: STColumn[] = [];
|
||||
chartData: any[] = [];
|
||||
orderColumns: STColumn[] = [];
|
||||
chartData2: any = {}
|
||||
allDeal: any;
|
||||
headDeal: any;
|
||||
classifyDeal: any;
|
||||
@ -40,7 +43,7 @@ export class DatatableDatascreenComponent implements OnInit {
|
||||
todayTime: string = '';
|
||||
|
||||
monthData: G2TimelineData[] = [];
|
||||
monthData2: Array<any> = this.genData2();
|
||||
monthData2:G2TimelineData[] =[];
|
||||
salesData2: Array<any> = this.genData();
|
||||
constructor(public service: DataService) {}
|
||||
ngOnChanges(changes: any): void {
|
||||
@ -102,16 +105,6 @@ export class DatatableDatascreenComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
// initLineData() {
|
||||
// this.service.request(this.service.$api_getTradingTrend).subscribe((res: any) => {
|
||||
// this.monthData = res;
|
||||
// if (this.timeline) {
|
||||
// console.log(this.timeline);
|
||||
// // 等待组件渲染
|
||||
// setTimeout(() => this.timeline.changeData(), 100);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
public genData(): G2MiniAreaData[] {
|
||||
let value: any = [];
|
||||
this.service.request(this.service.$api_getShipmentRanking).subscribe((res: any) => {
|
||||
@ -126,24 +119,8 @@ export class DatatableDatascreenComponent implements OnInit {
|
||||
console.log(value);
|
||||
return value;
|
||||
}
|
||||
private genData2(): G2TimelineData[] {
|
||||
let ress: G2TimelineData[] = [];
|
||||
this.service.request(this.service.$api_getTradingTrend).subscribe((res: any) => {
|
||||
if (res) {
|
||||
res.forEach((element: any) => {
|
||||
ress.push({
|
||||
time: element.time,
|
||||
y1: element.billQuantity,
|
||||
y2: element.wayBillQuantity
|
||||
});
|
||||
});
|
||||
console.log(ress);
|
||||
}
|
||||
});
|
||||
if(!ress) {
|
||||
setTimeout(() => {},100)
|
||||
}
|
||||
return ress;
|
||||
initPillarData(){
|
||||
this.curve.reRender()
|
||||
}
|
||||
/**
|
||||
* 初始化数据列表
|
||||
@ -159,10 +136,11 @@ export class DatatableDatascreenComponent implements OnInit {
|
||||
}
|
||||
initOrderST() {
|
||||
this.orderColumns = [
|
||||
{ title: '运单号', index: 'wayCode', className: 'text-center', width: '120px' },
|
||||
{ title: '运单号', index: 'wayCode', className: 'text-center', width: '150px' },
|
||||
{ title: '司机/车辆', index: 'carNo', className: 'text-center', width: '120px' },
|
||||
{ title: '货主', index: 'shipperName', className: 'text-center', width: '70px' },
|
||||
{ title: '时间', index: 'createTime', className: 'text-center', width: '200px' },
|
||||
{ title: '风险等级', index: 'warningType', className: 'text-center', width: '90px' }
|
||||
{ title: '异常预警', index: 'warningTypeLabel', className: 'text-center', width: '120px' }
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-04-06 17:57:07
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-04-07 15:48:36
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\curve\\map.component.html
|
||||
* @LastEditTime : 2022-04-07 19:44:32
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\map\\map.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
<g2-custom delay="200" (render)="render($event)"></g2-custom>
|
||||
<g2-custom delay="200" (render)="render($event)" ></g2-custom>
|
||||
@ -87,16 +87,27 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges {
|
||||
});
|
||||
|
||||
// 可视化用户数据
|
||||
this.userData = [
|
||||
{ name: '山东', value: 21 },
|
||||
{ name: '山东', value: 22},
|
||||
{ name: '广东', value: 20, },
|
||||
{ name: '广东', value: 20 },
|
||||
{ name: '四川', value: 120 },
|
||||
{ name: '湖南', value: 200 },
|
||||
{ name: '河北', value: 30 },
|
||||
// this.userData = [
|
||||
// { name: '山东', value: 21 },
|
||||
// { name: '山东', value: 22},
|
||||
// { name: '广东', value: 20, },
|
||||
// { name: '广东', value: 20 },
|
||||
// { name: '四川', value: 120 },
|
||||
// { name: '湖南', value: 200 },
|
||||
// { name: '河北', value: 30 },
|
||||
|
||||
];
|
||||
// ];
|
||||
let value: any = []
|
||||
this.service.request(this.service.$api_getTransactionDistribution).subscribe((res: any) => {
|
||||
if(res) {
|
||||
res.forEach((element: any) => {
|
||||
value.push({
|
||||
name: element.province,
|
||||
value: element.weight,
|
||||
});
|
||||
});
|
||||
console.log(value);
|
||||
this.userData = value
|
||||
this.userDv = this.ds.createView().source(this.userData).transform({
|
||||
geoDataView: this.worldMap,
|
||||
field: 'name',
|
||||
@ -105,31 +116,37 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges {
|
||||
}).transform({
|
||||
type: 'map',
|
||||
callback: (obj: { trend: string; value: number }) => {
|
||||
|
||||
obj.trend = obj.value > 100 ? '蓝色地区' : '灰色地区';
|
||||
if(obj.value < 500) {
|
||||
obj.trend = '500以下';
|
||||
} else if(obj.value >= 500 && obj.value < 1000){
|
||||
obj.trend = '500-1000';
|
||||
} else if(obj.value >= 1000 ){
|
||||
obj.trend = '>1000';
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
});
|
||||
this.userView = this.chart.createView();
|
||||
this.userView.data(this.userDv.rows);
|
||||
// this.userView.scale({
|
||||
// trend: {
|
||||
// alias: '蓝色地区数量'
|
||||
// }
|
||||
// });
|
||||
this.userView.scale({
|
||||
trend: {
|
||||
alias: '蓝色地区数量'
|
||||
}
|
||||
});
|
||||
console.log(this.userView);
|
||||
console.log('45545');
|
||||
|
||||
this.userView.polygon().position('longitude*latitude').color('trend', ['#c7daf3', '#1779f3']).tooltip('').style({fillOpacity: 0.85 })
|
||||
// .animate({
|
||||
// leave: {
|
||||
// animation: 'fade-out'
|
||||
// }
|
||||
// });
|
||||
this.userView.polygon().position('longitude*latitude').color('trend', ['#0a3f80', '#1b6aca', '#5d93d4']).tooltip('name*trend*value').style({fillOpacity: 0.85 })
|
||||
.animate({
|
||||
leave: {
|
||||
animation: 'fade-out'
|
||||
}
|
||||
});
|
||||
this.userView.interaction('element-active');
|
||||
this.chart.render();
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
console.log('9999');
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-04-06 11:02:17
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-04-06 17:22:44
|
||||
* @LastEditTime : 2022-04-07 18:29:39
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\datatable.module.ts
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
*/
|
||||
@ -40,7 +40,8 @@ import { FinancetablePillarComponent } from './components/financetable/pillar/pi
|
||||
import { ComplianceCurveComponent } from './components/compliance/index/curve/curve.component';
|
||||
import { BusitableCurveComponent } from './components/busitable/busiindex/curve/curve.component';
|
||||
import { DatatableCustomindexCurveComponent } from './components/customtable/customindex/curve/curve.component';
|
||||
import { DatatableCustomindexMapComponent } from './components/datascreen/curve/map.component';
|
||||
import { DatatableCustomindexMapComponent } from './components/datascreen/map/map.component';
|
||||
import { DatatableCustomindexCurveMinComponent } from './components/datascreen/curve/curve.component';
|
||||
import { DatatableReportingvViewTrackComponent } from './reporting/components/view-track/view-track.component';
|
||||
|
||||
const COMPONENTS: Type<void>[] = [
|
||||
@ -76,6 +77,7 @@ const COMPONENTS: Type<void>[] = [
|
||||
BusitableCurveComponent,
|
||||
DatatableCustomindexCurveComponent,
|
||||
DatatableCustomindexMapComponent,
|
||||
DatatableCustomindexCurveMinComponent,
|
||||
DatatableReportingvViewTrackComponent
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user