解决冲突
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-07 09:30:20 | ||||
|  * @LastEditTime : 2022-04-07 14:59:12 | ||||
|  * @FilePath     : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\datascreen.component.ts | ||||
|  * Copyright (C) 2022 huzhenhong. All rights reserved. | ||||
|  */ | ||||
| @ -32,7 +32,14 @@ export class DatatableDatascreenComponent implements OnInit { | ||||
|   columns: STColumn[] = []; | ||||
|   chartData: G2TimelineData[] = []; | ||||
|   orderColumns: STColumn[] = []; | ||||
|   salesData = this.genData(); | ||||
|   allDeal: any; | ||||
|   headDeal: any; | ||||
|   classifyDeal: any; | ||||
|   todaysDeal: any; | ||||
|    | ||||
|   monthData: G2TimelineData[] = []; | ||||
|   salesData :any; | ||||
|   salesData2 :any = this.genData(); | ||||
|   constructor(public service: DataService) { | ||||
|     | ||||
|    } | ||||
| @ -49,8 +56,6 @@ export class DatatableDatascreenComponent implements OnInit { | ||||
|   get reqParams() { | ||||
|     const params = { | ||||
|     } | ||||
|   | ||||
|  | ||||
|     return { ...params }; | ||||
|   } | ||||
|   ngOnInit(): void { | ||||
| @ -61,55 +66,74 @@ export class DatatableDatascreenComponent implements OnInit { | ||||
|   } | ||||
|   initData(){ | ||||
|     this.service.request(this.service.$api_getAnnualTransactions).subscribe((res: any) => { | ||||
|       console.log(res); | ||||
|        | ||||
|       this.allDeal = res | ||||
|     }) | ||||
|   } | ||||
|     this.service.request(this.service.$api_getTransactionAmount).subscribe((res: any) => { | ||||
|       this.headDeal = res | ||||
|     }) | ||||
|     this.service.request(this.service.$api_getCustomerStatistics).subscribe((res: any) => { | ||||
|       this.classifyDeal = res | ||||
|     }) | ||||
|     this.service.request(this.service.$api_getTradingToday).subscribe((res: any) => { | ||||
|       this.todaysDeal = res | ||||
|     }) | ||||
| } | ||||
|   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, | ||||
|       }); | ||||
|     } | ||||
|     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); | ||||
|     res.forEach((element: any) => { | ||||
|      value.push({ | ||||
|       x: element.city, | ||||
|       y: element.weight, | ||||
|     }); | ||||
|     }); | ||||
|     this.salesData = value | ||||
|     console.log(this.salesData); | ||||
|   }) | ||||
|   } | ||||
|   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, | ||||
|   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; | ||||
|     } | ||||
|     return res; | ||||
|   } | ||||
|   /** | ||||
| * 初始化数据列表 | ||||
| */ | ||||
|   initST() { | ||||
|     this.columns = [ | ||||
|       { title: '序号', index: 'carNo', className: 'text-center' }, | ||||
|       { title: '发货地', index: 'carNoColorLabel', className: 'text-center' }, | ||||
|       { title: '卸货地', index: 'carModelLabel', className: 'text-center' }, | ||||
|       { title: '货物', index: 'carStatus', className: 'text-center'}, | ||||
|       { title: '数量', index: 'approvalStatus', className: 'text-center' }, | ||||
|       { 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' }, | ||||
|     ]; | ||||
|     console.log(this.map); | ||||
|     setTimeout(() => { | ||||
|       if(this.map) { | ||||
|         this.map.reRender() | ||||
|       } | ||||
|     }, 500); | ||||
|     | ||||
|   } | ||||
|   initOrderST() { | ||||
|     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'} | ||||
|       { 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'} | ||||
|     ]; | ||||
|   } | ||||
|    | ||||
|  | ||||
		Reference in New Issue
	
	Block a user