From 5f9f2e38616af9ab4618c831b366d25b936b56fa Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 7 Apr 2022 15:33:04 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datascreen/curve/map.component.ts | 47 ++++++++++--------- .../datascreen/datascreen.component.ts | 30 ++++++++++-- .../routes/datatable/services/data.service.ts | 4 +- 3 files changed, 55 insertions(+), 26 deletions(-) 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 5a66c684..5ce91326 100644 --- a/src/app/routes/datatable/components/datascreen/curve/map.component.ts +++ b/src/app/routes/datatable/components/datascreen/curve/map.component.ts @@ -20,7 +20,11 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { constructor(private service: DataService, private ngZone: NgZone) {} ngOnChanges(changes: SimpleChanges): void { - if (this.chartData) { + if (changes.chartData && !changes.chartData.isFirstChange()) { + this.userData = changes.chartData.currentValue; + console.log(this.userView); + + this.userView.source(this.userData) // setTimeout(()=>{ // this.chart.render(true) // }, 1000) @@ -49,7 +53,7 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { this.chart = new Chart({ container: el, autoFit: true, - height: 700, + height: 680, padding: [0, 0] }); this.chart.tooltip({ @@ -87,17 +91,21 @@ 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.userDv = this.ds.createView().source(this.userData).transform({ + this.userData = this.chartData + console.log(this.userData); + + // 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', type: 'geo.region', @@ -105,6 +113,7 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { }).transform({ type: 'map', callback: (obj: { trend: string; value: number }) => { + console.log(this.userData); obj.trend = obj.value > 100 ? '蓝色地区' : '红色地区'; return obj; @@ -117,9 +126,6 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { // alias: '蓝色地区数量' // } // }); - console.log(this.userView); - console.log('45545'); - this.userView.polygon().position('longitude*latitude').color('trend', ['#000', '#76ddb2']).tooltip('').style({fillOpacity: 0.85 }) // .animate({ // leave: { @@ -128,13 +134,10 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { // }); this.userView.interaction('element-active'); this.chart.render(); + // } + // }); - - }); - - console.log('9999'); - - + }) } } diff --git a/src/app/routes/datatable/components/datascreen/datascreen.component.ts b/src/app/routes/datatable/components/datascreen/datascreen.component.ts index df261bc6..0c72e06f 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 14:59:12 + * @LastEditTime : 2022-04-07 15:16:53 * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -30,7 +30,7 @@ export class DatatableDatascreenComponent implements OnInit { @ViewChild('orderSt') private readonly orderSt!: STComponent; @ViewChild('map') private readonly map!: DatatableCustomindexMapComponent; columns: STColumn[] = []; - chartData: G2TimelineData[] = []; + chartData: any[] = []; orderColumns: STColumn[] = []; allDeal: any; headDeal: any; @@ -77,6 +77,20 @@ export class DatatableDatascreenComponent implements OnInit { this.service.request(this.service.$api_getTradingToday).subscribe((res: any) => { this.todaysDeal = res }) + 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.chartData = value + this.map.reRender() + } + }) } initLineData(){ this.service.request(this.service.$api_getTradingTrend).subscribe((res: any) => { @@ -88,7 +102,17 @@ export class DatatableDatascreenComponent implements OnInit { // y2: Math.floor(Math.random() * 100) + 10, // }); // } - }) + }) + this.service.request(this.service.$api_getTradingTrend).subscribe((res: any) => { + this.monthData = res + // 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); diff --git a/src/app/routes/datatable/services/data.service.ts b/src/app/routes/datatable/services/data.service.ts index 32f2c4e0..e7443148 100644 --- a/src/app/routes/datatable/services/data.service.ts +++ b/src/app/routes/datatable/services/data.service.ts @@ -4,7 +4,7 @@ * @Author : Shiming * @Date : 2021-12-27 10:30:56 * @LastEditors : Shiming - * @LastEditTime : 2022-04-07 09:30:16 + * @LastEditTime : 2022-04-07 15:07:27 * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\services\\data.service.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -82,6 +82,8 @@ export class DataService extends BaseService { $api_getTradingTrend = `/api/sdc/reportDataLargeScreen/getTradingTrend`; // 数据大屏-交易额(今日,本月,累计) $api_getTransactionAmount = `/api/sdc/reportDataLargeScreen/getTransactionAmount`; + // 数据大屏-交易分布 + $api_getTransactionDistribution = `/api/sdc/reportDataLargeScreen/getTransactionDistribution`; From 977e153c5da107cb87bcae3622ce5d3e7ce0272d Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Thu, 7 Apr 2022 16:04:21 +0800 Subject: [PATCH 2/5] edit --- .../invoice-requested/invoice-requested.component.ts | 4 ++-- .../requested-invoice-modal.component.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts index 6b00085b..1978a0f9 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts +++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts @@ -224,7 +224,7 @@ export class InvoiceRequestedComponent { }; this.service.request(this.service.$api_get_applyBatchFicoVatinv, params).subscribe((res: any) => { if (res) { - this.service.msgSrv.success('开票成功!'); + this.service.msgSrv.success('提交成功!'); modal.destroy(); this.st.load(1); } @@ -248,7 +248,7 @@ export class InvoiceRequestedComponent { }; this.service.request(this.service.$api_get_applyBatchFicoVatinv, params).subscribe((res: any) => { if (res) { - this.service.msgSrv.success('开票成功!'); + this.service.msgSrv.success('提交成功!'); modal.destroy(); this.st.load(1); } diff --git a/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts index 4a536279..615ed34d 100644 --- a/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts +++ b/src/app/routes/ticket-management/components/invoice-requested/requested-invoice-modal/requested-invoice-modal.component.ts @@ -133,7 +133,7 @@ export class RequestedInvoiceModalComponent { this.nzModalService.confirm({ nzTitle: '是否进入销票处理页面完成开票', nzOnOk: () => { - this.service.msgSrv.success('开票成功'); + this.service.msgSrv.success('提交成功'); this.modal.destroy(true); this.router.navigate(['/ticket/cancellation-invoice']); }, From a959b4708b85effc4d5bbdc858a35b65a201ae2c Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 7 Apr 2022 16:17:34 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datascreen/curve/map.component.html | 12 ++++- .../datascreen/curve/map.component.ts | 45 +++++++++---------- .../datascreen/datascreen.component.html | 13 +++--- .../datascreen/datascreen.component.ts | 36 +++++++++------ 4 files changed, 62 insertions(+), 44 deletions(-) diff --git a/src/app/routes/datatable/components/datascreen/curve/map.component.html b/src/app/routes/datatable/components/datascreen/curve/map.component.html index 0640a4d4..4bdcc4de 100644 --- a/src/app/routes/datatable/components/datascreen/curve/map.component.html +++ b/src/app/routes/datatable/components/datascreen/curve/map.component.html @@ -1 +1,11 @@ - \ No newline at end of file + + \ No newline at end of file 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 5ce91326..9775b4a1 100644 --- a/src/app/routes/datatable/components/datascreen/curve/map.component.ts +++ b/src/app/routes/datatable/components/datascreen/curve/map.component.ts @@ -20,11 +20,7 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { constructor(private service: DataService, private ngZone: NgZone) {} ngOnChanges(changes: SimpleChanges): void { - if (changes.chartData && !changes.chartData.isFirstChange()) { - this.userData = changes.chartData.currentValue; - console.log(this.userView); - - this.userView.source(this.userData) + if (this.chartData) { // setTimeout(()=>{ // this.chart.render(true) // }, 1000) @@ -91,21 +87,17 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { }); // 可视化用户数据 - this.userData = this.chartData - console.log(this.userData); - - // 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({ + this.userData = [ + { name: '山东', value: 21 }, + { name: '山东', value: 22}, + { name: '广东', value: 20, }, + { name: '广东', value: 20 }, + { name: '四川', value: 120 }, + { name: '湖南', value: 200 }, + { name: '河北', value: 30 }, + + ]; + this.userDv = this.ds.createView().source(this.userData).transform({ geoDataView: this.worldMap, field: 'name', type: 'geo.region', @@ -113,7 +105,6 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { }).transform({ type: 'map', callback: (obj: { trend: string; value: number }) => { - console.log(this.userData); obj.trend = obj.value > 100 ? '蓝色地区' : '红色地区'; return obj; @@ -126,6 +117,9 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { // alias: '蓝色地区数量' // } // }); + console.log(this.userView); + console.log('45545'); + this.userView.polygon().position('longitude*latitude').color('trend', ['#000', '#76ddb2']).tooltip('').style({fillOpacity: 0.85 }) // .animate({ // leave: { @@ -134,10 +128,13 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges { // }); this.userView.interaction('element-active'); this.chart.render(); - // } - // }); - }) + + }); + + console.log('9999'); + + } } diff --git a/src/app/routes/datatable/components/datascreen/datascreen.component.html b/src/app/routes/datatable/components/datascreen/datascreen.component.html index 0c3e37dc..939d29dd 100644 --- a/src/app/routes/datatable/components/datascreen/datascreen.component.html +++ b/src/app/routes/datatable/components/datascreen/datascreen.component.html @@ -4,14 +4,15 @@ * @Author : Shiming * @Date : 2022-04-06 10:57:56 * @LastEditors : Shiming - * @LastEditTime : 2022-04-07 14:59:07 + * @LastEditTime : 2022-04-07 16:16:57 * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. --> -
-

运多星网络货运平台实时交易监控

+
+

运多星网络货运平台

+

实时交易监控

@@ -34,10 +35,12 @@ - @@ -86,7 +89,7 @@ - +
diff --git a/src/app/routes/datatable/components/datascreen/datascreen.component.ts b/src/app/routes/datatable/components/datascreen/datascreen.component.ts index 0c72e06f..a0ff7310 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 15:16:53 + * @LastEditTime : 2022-04-07 15:53:41 * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -15,7 +15,7 @@ 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 { G2TimelineComponent, G2TimelineData } from '@delon/chart/timeline'; import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area'; import { format } from 'date-fns'; @@ -29,6 +29,8 @@ export class DatatableDatascreenComponent implements OnInit { @ViewChild('st') private readonly st!: STComponent; @ViewChild('orderSt') private readonly orderSt!: STComponent; @ViewChild('map') private readonly map!: DatatableCustomindexMapComponent; + @ViewChild('timeline', { static: false }) timeline!: G2TimelineComponent; + columns: STColumn[] = []; chartData: any[] = []; orderColumns: STColumn[] = []; @@ -39,11 +41,14 @@ export class DatatableDatascreenComponent implements OnInit { monthData: G2TimelineData[] = []; salesData :any; - salesData2 :any = this.genData(); + salesData2 :Array = this.genData(); constructor(public service: DataService) { } - + ngOnChanges(changes: any): void { + console.log(changes); + + } /** * 查询参数 */ @@ -95,16 +100,12 @@ export class DatatableDatascreenComponent implements OnInit { initLineData(){ this.service.request(this.service.$api_getTradingTrend).subscribe((res: any) => { this.monthData = res - // 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, - // }); - // } - }) - 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, @@ -123,6 +124,13 @@ export class DatatableDatascreenComponent implements OnInit { }); }); this.salesData = value + // if (this.pie) { + // // 等待组件渲染 + // setTimeout(() => { + // console.log('a') + // this.pie.changeData() + // }); + // } console.log(this.salesData); }) } From 465ae51f6c92c9301feb09665eaa13f3c65cc6e0 Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 7 Apr 2022 16:39:51 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datascreen/datascreen.component.html | 12 +- .../datascreen/datascreen.component.ts | 176 +++++++++--------- src/assets/images/oclock.svg | 6 + 3 files changed, 107 insertions(+), 87 deletions(-) create mode 100644 src/assets/images/oclock.svg diff --git a/src/app/routes/datatable/components/datascreen/datascreen.component.html b/src/app/routes/datatable/components/datascreen/datascreen.component.html index 939d29dd..34d6aa64 100644 --- a/src/app/routes/datatable/components/datascreen/datascreen.component.html +++ b/src/app/routes/datatable/components/datascreen/datascreen.component.html @@ -4,15 +4,23 @@ * @Author : Shiming * @Date : 2022-04-06 10:57:56 * @LastEditors : Shiming - * @LastEditTime : 2022-04-07 16:16:57 + * @LastEditTime : 2022-04-07 16:37:05 * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.html * Copyright (C) 2022 huzhenhong. All rights reserved. -->
-

运多星网络货运平台

+
+

运多星网络货运平台

+
+   + {{todayTime}} +
+
+

实时交易监控

+
diff --git a/src/app/routes/datatable/components/datascreen/datascreen.component.ts b/src/app/routes/datatable/components/datascreen/datascreen.component.ts index a0ff7310..bc0dd745 100644 --- a/src/app/routes/datatable/components/datascreen/datascreen.component.ts +++ b/src/app/routes/datatable/components/datascreen/datascreen.component.ts @@ -1,11 +1,11 @@ import { map } from 'rxjs/operators'; /* - * @Description : + * @Description : * @Version : 1.0 * @Author : Shiming * @Date : 2022-04-06 10:57:56 * @LastEditors : Shiming - * @LastEditTime : 2022-04-07 15:53:41 + * @LastEditTime : 2022-04-07 16:31:17 * @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.ts * Copyright (C) 2022 huzhenhong. All rights reserved. */ @@ -19,7 +19,6 @@ import { G2TimelineComponent, G2TimelineData } from '@delon/chart/timeline'; import { G2MiniAreaClickItem, G2MiniAreaData } from '@delon/chart/mini-area'; import { format } from 'date-fns'; - @Component({ selector: 'app-datatable-datascreen', templateUrl: './datascreen.component.html', @@ -38,71 +37,78 @@ export class DatatableDatascreenComponent implements OnInit { headDeal: any; classifyDeal: any; todaysDeal: any; - + todayTime: string =''; + monthData: G2TimelineData[] = []; - salesData :any; - salesData2 :Array = this.genData(); - constructor(public service: DataService) { - - } - ngOnChanges(changes: any): void { + salesData: any; + salesData2: Array = this.genData(); + constructor(public service: DataService) {} + ngOnChanges(changes: any): void { console.log(changes); - } /** * 查询参数 */ get reqOrderParams() { - const params = { - - } + const params = {}; return { ...params }; } get reqParams() { - const params = { - } + const params = {}; return { ...params }; } ngOnInit(): void { - this.initST() - this.initOrderST() - this.initData() - this.initLineData() + + setInterval(() => { + this.setTime() + },1000) + this.initST(); + this.initOrderST(); + this.initData(); + this.initLineData(); } - initData(){ + setTime () { + var myDate = new Date(); + var mytime = myDate.toLocaleTimeString(); //获取当前时间 + myDate.getFullYear(); //获取完整的年份(4位,1970-????) + myDate.getMonth(); //获取当前月份(0-11,0代表1月) + myDate.getDate(); //获取当前日(1-31) + this.todayTime = myDate.getFullYear() + '-' + myDate.getMonth() + 1 + '-' + myDate.getDate() + ' ' + mytime; + } + initData() { this.service.request(this.service.$api_getAnnualTransactions).subscribe((res: any) => { - this.allDeal = res - }) + this.allDeal = res; + }); this.service.request(this.service.$api_getTransactionAmount).subscribe((res: any) => { - this.headDeal = res - }) + this.headDeal = res; + }); this.service.request(this.service.$api_getCustomerStatistics).subscribe((res: any) => { - this.classifyDeal = res - }) + this.classifyDeal = res; + }); this.service.request(this.service.$api_getTradingToday).subscribe((res: any) => { - this.todaysDeal = res - }) - 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.chartData = value - this.map.reRender() + this.todaysDeal = res; + }); + 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.chartData = value; + this.map.reRender(); } - }) -} - initLineData(){ + }); + } + initLineData() { this.service.request(this.service.$api_getTradingTrend).subscribe((res: any) => { - this.monthData = res + this.monthData = res; if (this.timeline) { console.log(this.timeline); - + // 等待组件渲染 setTimeout(() => this.timeline.changeData()); } @@ -113,62 +119,62 @@ export class DatatableDatascreenComponent implements OnInit { // 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); - }) - } - public genData(): G2MiniAreaData[] { - let value: any = [] + 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, + 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); + }); + } + public genData(): G2MiniAreaData[] { + 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 + }); }); - }) + }); console.log(value); return value; - } + } /** -* 初始化数据列表 -*/ + * 初始化数据列表 + */ initST() { this.columns = [ - { title: '序号', render: 'index', className: 'text-center',width: '70px' }, - { title: '发货地', index: 'loadAddress', className: 'text-center',width: '90px' }, - { title: '卸货地', index: 'dischargeAddress', className: 'text-center' ,width: '90px'}, - { title: '货物', index: 'goodsName', className: 'text-center',width: '90px'}, - { title: '数量', render: 'weight', className: 'text-center',width: '120px' }, + { title: '序号', render: 'index', className: 'text-center', width: '70px' }, + { title: '发货地', index: 'loadAddress', className: 'text-center', width: '90px' }, + { title: '卸货地', index: 'dischargeAddress', className: 'text-center', width: '90px' }, + { title: '货物', index: 'goodsName', className: 'text-center', width: '90px' }, + { title: '数量', render: 'weight', className: 'text-center', width: '120px' } ]; } initOrderST() { this.orderColumns = [ - { title: '运单号', index: 'wayCode', 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: 'wayCode', 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' } ]; } - + handleClick(data: G2MiniAreaClickItem): void { this.service.msgSrv.info(`${data.item.x} - ${data.item.y}`); } diff --git a/src/assets/images/oclock.svg b/src/assets/images/oclock.svg new file mode 100644 index 00000000..596ea29d --- /dev/null +++ b/src/assets/images/oclock.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From deec1b0bd6d677501d8ede092a1666bafdd8346e Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 7 Apr 2022 16:59:19 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datascreen/curve/map.component.ts | 4 +- .../datascreen/datascreen.component.html | 6 +- .../datascreen/datascreen.component.ts | 81 +++++++++---------- 3 files changed, 41 insertions(+), 50 deletions(-) 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; + } /** * 初始化数据列表 */