Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
潘晓云
2022-04-13 15:21:17 +08:00
16 changed files with 99 additions and 66 deletions

View File

@ -4,8 +4,8 @@
* @Author : Shiming
* @Date : 2022-04-06 17:57:07
* @LastEditors : Shiming
* @LastEditTime : 2022-04-13 10:17:44
* @LastEditTime : 2022-04-13 14:30:10
* @FilePath : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\datascreen\\map\\map.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<g2-custom div style="height: 680px; " delay="200" (render)="render($event)" ></g2-custom>
<g2-custom #map div style="height: 680px; " delay="200" (render)="render($event)" ></g2-custom>

View File

@ -1,4 +1,4 @@
import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
import { Component, ElementRef, Input, NgZone, OnChanges, OnInit, SimpleChanges, ViewChild, AfterViewInit } from '@angular/core';
import { Chart } from '@antv/g2';
import DataSet from '@antv/data-set';
import { DataService } from 'src/app/routes/datatable/services/data.service';
@ -7,9 +7,11 @@ import { DataService } from 'src/app/routes/datatable/services/data.service';
templateUrl: './map.component.html',
styleUrls: ['./map.component.less']
})
export class DatatableCustomindexMapComponent implements OnInit, OnChanges {
export class DatatableCustomindexMapComponent implements OnInit, OnChanges, AfterViewInit {
el: any;
@Input() chartData: any;
@ViewChild('auditModal', { static: false }) auditModal!: any;
@ViewChild('map',{static: false}) map!: any;
chart: any;
mapData: any;
ds!: DataSet ;
@ -18,6 +20,10 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges {
userDv: any;
userData: any = [];
constructor(private service: DataService, private ngZone: NgZone) {}
ngAfterViewInit(): void {
this.map.el.nativeElement.style.height = this.map.el.nativeElement.clientWidth + 'px'
this.chart.render();
}
ngOnChanges(changes: SimpleChanges): void {
if (this.chartData) {
@ -26,7 +32,7 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges {
// }, 1000)
}
}
ngOnInit(): void {}
reRender() {
console.log('5454545');
@ -84,18 +90,6 @@ export class DatatableCustomindexMapComponent implements OnInit, OnChanges {
stroke: '#ccc',
lineWidth: 1
});
// 可视化用户数据
// this.userData = [
// { name: '山东', value: 21 },
// { name: '山东', value: 22},
// { name: '广东', value: 20, },
// { name: '广东', value: 20 },
// { name: '四川', value: 120 },
// { name: '湖南', value: 200 },
// { name: '河北', value: 30 },
// ];
let value: any = []
this.service.request(this.service.$api_getTransactionDistribution).subscribe((res: any) => {
if(res) {