diff --git a/src/app/routes/datatable/components/datascreen/curve/map.component.ts b/src/app/routes/datatable/components/datascreen/curve/map.component.ts index 9775b4a1..5702547c 100644 --- a/src/app/routes/datatable/components/datascreen/curve/map.component.ts +++ b/src/app/routes/datatable/components/datascreen/curve/map.component.ts @@ -106,7 +106,7 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { type: 'map', callback: (obj: { trend: string; value: number }) => { - obj.trend = obj.value > 100 ? '蓝色地区' : '红色地区'; + obj.trend = obj.value > 100 ? '蓝色地区' : '灰色地区'; return obj; } }); @@ -120,7 +120,7 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { console.log(this.userView); console.log('45545'); - this.userView.polygon().position('longitude*latitude').color('trend', ['#000', '#76ddb2']).tooltip('').style({fillOpacity: 0.85 }) + this.userView.polygon().position('longitude*latitude').color('trend', ['#c7daf3', '#1779f3']).tooltip('').style({fillOpacity: 0.85 }) // .animate({ // leave: { // animation: 'fade-out' diff --git a/src/app/routes/datatable/components/datascreen/datascreen.component.html b/src/app/routes/datatable/components/datascreen/datascreen.component.html index 34d6aa64..4a4eb567 100644 --- a/src/app/routes/datatable/components/datascreen/datascreen.component.html +++ b/src/app/routes/datatable/components/datascreen/datascreen.component.html @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2022-04-06 10:57:56 * @LastEditors : Shiming - * @LastEditTime : 2022-04-07 16:37:05 + * @LastEditTime : 2022-04-07 16:57:05 * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> @@ -44,11 +44,11 @@ diff --git a/src/app/routes/datatable/components/datascreen/datascreen.component.ts b/src/app/routes/datatable/components/datascreen/datascreen.component.ts index bc0dd745..58a942d4 100644 --- a/src/app/routes/datatable/components/datascreen/datascreen.component.ts +++ b/src/app/routes/datatable/components/datascreen/datascreen.component.ts @@ -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:31:17 + * @LastEditTime : 2022-04-07 16:58:19 * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -37,10 +37,10 @@ export class DatatableDatascreenComponent implements OnInit { headDeal: any; classifyDeal: any; todaysDeal: any; - todayTime: string =''; + todayTime: string = ''; monthData: G2TimelineData[] = []; - salesData: any; + monthData2: Array = this.genData2(); salesData2: Array = this.genData(); constructor(public service: DataService) {} ngOnChanges(changes: any): void { @@ -58,16 +58,15 @@ export class DatatableDatascreenComponent implements OnInit { return { ...params }; } ngOnInit(): void { - setInterval(() => { - this.setTime() - },1000) + this.setTime(); + }, 1000); this.initST(); this.initOrderST(); this.initData(); - this.initLineData(); + // this.initLineData(); } - setTime () { + setTime() { var myDate = new Date(); var mytime = myDate.toLocaleTimeString(); //获取当前时间 myDate.getFullYear(); //获取完整的年份(4位,1970-????) @@ -103,43 +102,16 @@ 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()); - } - // for (let i = 0; i < 20; i += 1) { - // this.monthData.push({ - // time: new Date().getTime() + 1000 * 60 * 60 * 24 * i, - // y1: Math.floor(Math.random() * 100) + 1000, - // y2: Math.floor(Math.random() * 100) + 10, - // }); - // } - }); - let value: any = []; - this.service.request(this.service.$api_getShipmentRanking).subscribe((res: any) => { - console.log(res); - res.forEach((element: any) => { - value.push({ - x: element.city, - y: element.weight - }); - }); - this.salesData = value; - // if (this.pie) { - // // 等待组件渲染 - // setTimeout(() => { - // console.log('a') - // this.pie.changeData() - // }); - // } - console.log(this.salesData); - }); - } + // 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) => { @@ -154,6 +126,25 @@ 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; + } /** * 初始化数据列表 */