|
|
@ -5,6 +5,8 @@ import {IndexService} from '../../../services/index.service'; |
|
|
|
import {environment} from '../../../../environments/environment'; |
|
|
|
import {environment} from '../../../../environments/environment'; |
|
|
|
import {NzMessageService} from 'ng-zorro-antd'; |
|
|
|
import {NzMessageService} from 'ng-zorro-antd'; |
|
|
|
import {Router} from '@angular/router'; |
|
|
|
import {Router} from '@angular/router'; |
|
|
|
|
|
|
|
import {CommonsService} from "../../../services/commons.service"; |
|
|
|
|
|
|
|
import {HttpClient , HttpClientJsonpModule} from '@angular/common/http'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
@ -42,21 +44,40 @@ export class IndexComponent implements OnInit { |
|
|
|
tyBalance; |
|
|
|
tyBalance; |
|
|
|
webSocket: WebSocket; |
|
|
|
webSocket: WebSocket; |
|
|
|
adminInfoObject: {}; |
|
|
|
adminInfoObject: {}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 根据年月日查询总交易金额
|
|
|
|
|
|
|
|
orderStatisticsByYMDData: any; |
|
|
|
|
|
|
|
// 查询每日交易总额
|
|
|
|
|
|
|
|
orderStatisticsByProductTypeByDay: any; |
|
|
|
|
|
|
|
orderStatisticsByProductTypeAll: any; |
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
private store: LocalStorageService, // 数据缓存
|
|
|
|
private store: LocalStorageService, // 数据缓存
|
|
|
|
|
|
|
|
private http: HttpClient, |
|
|
|
private message: NzMessageService, // 信息提示
|
|
|
|
private message: NzMessageService, // 信息提示
|
|
|
|
private router: Router, |
|
|
|
private router: Router, |
|
|
|
private index: IndexService |
|
|
|
private index: IndexService, |
|
|
|
|
|
|
|
private common: CommonsService |
|
|
|
) { |
|
|
|
) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.http.jsonp('/areas_v3/bound/510000_full.json' , 'features').subscribe(data => { |
|
|
|
|
|
|
|
console.log(data); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.adminInfoObject = this.store.get(ADMIN_INFO_OBJECT); |
|
|
|
this.adminInfoObject = this.store.get(ADMIN_INFO_OBJECT); |
|
|
|
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType; |
|
|
|
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType; |
|
|
|
if (this.roleType === 1) { |
|
|
|
if (this.roleType === 1) { |
|
|
|
this.getIndexCount(); |
|
|
|
this.getIndexCount(); |
|
|
|
this.getLineCount(); |
|
|
|
this.getLineCount(); |
|
|
|
this.queryCompanyAccountInfo2JD(); |
|
|
|
this.queryCompanyAccountInfo2JD(); |
|
|
|
|
|
|
|
this.orderStatisticsByYMD(1); |
|
|
|
|
|
|
|
this.orderStatisticsByProductType(1); |
|
|
|
|
|
|
|
this.orderStatisticsByProductTypeByAll(3); |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) { |
|
|
|
if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) { |
|
|
|
this.code = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id; |
|
|
|
this.code = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id; |
|
|
@ -314,5 +335,142 @@ export class IndexComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
}).then(r => console.log(r)); |
|
|
|
}).then(r => console.log(r)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询
|
|
|
|
|
|
|
|
public orderStatisticsByYMD(type: number): void { |
|
|
|
|
|
|
|
const queryParams = { |
|
|
|
|
|
|
|
dateType: type, |
|
|
|
|
|
|
|
num: this.common.dateTimeType(type) |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
this.index.orderStatisticsByYMD(queryParams , data => { |
|
|
|
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
|
|
|
const timeData = []; |
|
|
|
|
|
|
|
const sumData = []; |
|
|
|
|
|
|
|
for (const i of data['return_data']) { |
|
|
|
|
|
|
|
timeData.push(i['time']); |
|
|
|
|
|
|
|
sumData.push(i['sum']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.orderStatisticsByYMDData = { |
|
|
|
|
|
|
|
title: { |
|
|
|
|
|
|
|
text: this.common.dateType(type) + '总交易额(元)', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
xAxis: { |
|
|
|
|
|
|
|
type: 'category', |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data: timeData |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
yAxis: { |
|
|
|
|
|
|
|
type: 'value' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
series: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
data: sumData, |
|
|
|
|
|
|
|
label: { |
|
|
|
|
|
|
|
show: true, |
|
|
|
|
|
|
|
color: 'black', |
|
|
|
|
|
|
|
position: 'top' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
type: 'bar', |
|
|
|
|
|
|
|
showBackground: true, |
|
|
|
|
|
|
|
color: '#1890ff', |
|
|
|
|
|
|
|
backgroundStyle: { |
|
|
|
|
|
|
|
color: 'rgba(180, 180, 180, 0.2)' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.message.error(data['return_msg']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public orderStatisticsByProductType(type): void { |
|
|
|
|
|
|
|
const queryParams = { |
|
|
|
|
|
|
|
dateType: type, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
this.index.orderStatisticsByProductType(queryParams , data => { |
|
|
|
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
|
|
|
const productData = []; |
|
|
|
|
|
|
|
const sumData = []; |
|
|
|
|
|
|
|
for (const i of data['return_data']) { |
|
|
|
|
|
|
|
productData.push(this.common.productType(i['name'])); |
|
|
|
|
|
|
|
sumData.push(i['value']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.orderStatisticsByProductTypeByDay = { |
|
|
|
|
|
|
|
title: { |
|
|
|
|
|
|
|
text: '今日交易总额(元)', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
xAxis: { |
|
|
|
|
|
|
|
type: 'value' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
yAxis: { |
|
|
|
|
|
|
|
type: 'category', |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data: productData |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
series: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
data: sumData, |
|
|
|
|
|
|
|
label: { |
|
|
|
|
|
|
|
show: true, |
|
|
|
|
|
|
|
color: 'black', |
|
|
|
|
|
|
|
position: 'right' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
type: 'bar', |
|
|
|
|
|
|
|
showBackground: true, |
|
|
|
|
|
|
|
color: '#1890ff', |
|
|
|
|
|
|
|
backgroundStyle: { |
|
|
|
|
|
|
|
color: 'rgba(180, 180, 180, 0.2)' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.message.error(data['return_msg']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public orderStatisticsByProductTypeByAll(type): void { |
|
|
|
|
|
|
|
const queryParams = { |
|
|
|
|
|
|
|
dateType: type, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
this.index.orderStatisticsByProductType(queryParams , data => { |
|
|
|
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
|
|
|
const dataShow = []; |
|
|
|
|
|
|
|
for (const i of data['return_data']) { |
|
|
|
|
|
|
|
dataShow.push({ |
|
|
|
|
|
|
|
name: this.common.productType(i['name']), |
|
|
|
|
|
|
|
value: i['value'] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.orderStatisticsByProductTypeAll = { |
|
|
|
|
|
|
|
title: { |
|
|
|
|
|
|
|
text: this.common.dateType(type) + '交易占比分布', |
|
|
|
|
|
|
|
left: 'center' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
tooltip: { |
|
|
|
|
|
|
|
trigger: 'item' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
series: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name: '交易金额总额(元)', |
|
|
|
|
|
|
|
type: 'pie', |
|
|
|
|
|
|
|
radius: '50%', |
|
|
|
|
|
|
|
data: dataShow, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.message.error(data['return_msg']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|