解决冲突
This commit is contained in:
@ -5,7 +5,7 @@ import { map } from 'rxjs/operators';
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-04-06 10:57:56
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-04-06 20:39:15
|
||||
* @LastEditTime : 2022-04-07 01:48:44
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.ts
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
*/
|
||||
@ -15,6 +15,10 @@ import { SFSchema } from '@delon/form';
|
||||
import { ModalHelper, _HttpClient } from '@delon/theme';
|
||||
import { DataService } from '../../services/data.service';
|
||||
import { DatatableCustomindexMapComponent } from './curve/map.component';
|
||||
import { G2TimelineData } from '@delon/chart/timeline';
|
||||
import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area';
|
||||
import { format } from 'date-fns';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-datatable-datascreen',
|
||||
@ -26,8 +30,9 @@ export class DatatableDatascreenComponent implements OnInit {
|
||||
@ViewChild('orderSt') private readonly orderSt!: STComponent;
|
||||
@ViewChild('map') private readonly map!: DatatableCustomindexMapComponent;
|
||||
columns: STColumn[] = [];
|
||||
chartData: any = [];
|
||||
orderColumns!: STColumn[];
|
||||
chartData: G2TimelineData[] = [];
|
||||
orderColumns: STColumn[] = [];
|
||||
salesData = this.genData();
|
||||
constructor(public service: DataService) {
|
||||
|
||||
}
|
||||
@ -51,6 +56,27 @@ export class DatatableDatascreenComponent implements OnInit {
|
||||
ngOnInit(): void {
|
||||
this.initST()
|
||||
this.initOrderST()
|
||||
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;
|
||||
}
|
||||
/**
|
||||
* 初始化数据列表
|
||||
@ -72,11 +98,15 @@ export class DatatableDatascreenComponent implements OnInit {
|
||||
|
||||
}
|
||||
initOrderST() {
|
||||
this.columns = [
|
||||
this.orderColumns = [
|
||||
{ title: '运单号', index: 'carNo', className: 'text-center' },
|
||||
{ title: '货主', index: 'carNoColorLabel', className: 'text-center' },
|
||||
{ title: '时间', index: 'carModelLabel', className: 'text-center' },
|
||||
{ title: '风险等级', index: 'carStatus', className: 'text-center'}
|
||||
];
|
||||
}
|
||||
|
||||
handleClick(data: G2MiniAreaClickItem): void {
|
||||
this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user