解决冲突

This commit is contained in:
wangshiming
2022-04-07 18:27:27 +08:00
parent deec1b0bd6
commit 7b0f2d49b5
9 changed files with 209 additions and 33 deletions

View File

@ -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 18:02:02
* @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 {
@ -64,6 +67,7 @@ export class DatatableDatascreenComponent implements OnInit {
this.initST();
this.initOrderST();
this.initData();
this.genData2();
// this.initLineData();
}
setTime() {
@ -126,24 +130,46 @@ 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) => {
initPillarData(){
this.service.request(this.service.$api_getTradingTrend).subscribe(res => {
if (res) {
res.forEach((element: any) => {
ress.push({
time: element.time,
y1: element.billQuantity,
y2: element.wayBillQuantity
this.chartData2 = res
this.curve.reRender()
}
})
}
public genData2(): G2TimelineData[] {
let value1: any[] = [];
this.monthData2 =[];
this.service.request(this.service.$api_getTradingTrend).subscribe((res: any) => {
if (res) {
// var data1 = new Date('2022.1.1')
// var time1 = data1.getTime();
// console.log(time1);
var data2 = new Date('2022.2.1')
var time2 = data2.getTime();
console.log(time2);
var data3 = new Date('2022.3.1')
res.forEach((element: any,i:any) => {
console.log(element);
console.log(new Date().getTime() + 1000 * 60 * 60 * 24 * 2);
console.log(time2);
value1.push({
time:'Feb',
y1: element?.y1,
y2: element?.y2
});
});
console.log(ress);
this.monthData2 = res;
console.log(this.monthData2);
}
});
if(!ress) {
setTimeout(() => {},100)
}
return ress;
console.log(this.monthData2);
return value1;
}
/**
* 初始化数据列表