|
|
|
@ -37,13 +37,24 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
|
|
|
|
|
$scope.loadPartnersInTypes();
|
|
|
|
|
$scope.doAnalysis();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.loadRoyalpayindustry = function () {
|
|
|
|
|
$http.get('/static/data/royalpayindustry.json').then(function (resp) {
|
|
|
|
|
$scope.royalpayindustry = resp.data;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
$scope.loadRoyalpayindustry();
|
|
|
|
|
|
|
|
|
|
var getType = function (industryCode) {
|
|
|
|
|
var industryLabel = '';
|
|
|
|
|
angular.forEach(industryMap.configs(), function (industry) {
|
|
|
|
|
if (industry.value == industryCode) {
|
|
|
|
|
angular.forEach($scope.royalpayindustry, function (industry) {
|
|
|
|
|
if (industry.mccCode == industryCode) {
|
|
|
|
|
industryLabel = industry.label;
|
|
|
|
|
}else {
|
|
|
|
|
angular.forEach(industry.children, function (children){
|
|
|
|
|
if (children.mccCode == industryCode) {
|
|
|
|
|
industryLabel = children.label;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return industryLabel;
|
|
|
|
@ -57,17 +68,115 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
|
|
|
|
|
$scope.legends = [];
|
|
|
|
|
for (var i = 0; i < resp.data.length; i++) {
|
|
|
|
|
$scope.legends[i] = resp.data[i].partner_type;
|
|
|
|
|
var partner_type= getType(resp.data[i].industry);
|
|
|
|
|
var partner_type= getType(resp.data[i].mccCode);
|
|
|
|
|
resp.data[i].partner_type = partner_type;
|
|
|
|
|
$scope.legends[i] = partner_type;
|
|
|
|
|
}
|
|
|
|
|
$scope.PartnerTypes = angular.copy(resp.data);
|
|
|
|
|
var legend = $scope.legends;
|
|
|
|
|
$scope.partners_type_chart = chartParser.parse(partnerTypesConfig(legend), $scope.PartnerTypes);
|
|
|
|
|
childrenType(0);
|
|
|
|
|
$scope.partners_type_chart = partnerTypesConfig($scope.PartnerTypes,$scope.children);;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.partner_type_chart = function (chart) {
|
|
|
|
|
chart.on('click', function (params) {
|
|
|
|
|
childrenType(params.dataIndex);
|
|
|
|
|
$scope.partners_type_chart = partnerTypesConfig($scope.PartnerTypes,$scope.children);
|
|
|
|
|
try {
|
|
|
|
|
$scope.$digest();
|
|
|
|
|
}catch (err){}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var childrenType = function (index) {
|
|
|
|
|
$scope.partners_type = $scope.PartnerTypes[index];
|
|
|
|
|
$scope.children = $scope.partners_type.children;
|
|
|
|
|
for (var i = 0; i < $scope.children.length; i++) {
|
|
|
|
|
$scope.legends[i] = $scope.children.children_partner_type;
|
|
|
|
|
var children_partner_type= getType($scope.children[i].royalpayindustry);
|
|
|
|
|
$scope.children[i].children_partner_type = children_partner_type;
|
|
|
|
|
}
|
|
|
|
|
$scope.PartnerTypes[index].children = $scope.children;
|
|
|
|
|
/*$scope.type_count = $scope.PartnerTypes[index].count_value;*/
|
|
|
|
|
}
|
|
|
|
|
$scope.loadPartnersInTypes();
|
|
|
|
|
var partnerTypesConfig = function (legend) {
|
|
|
|
|
var partnerTypesConfig = function (innerData,outerData) {
|
|
|
|
|
outerData = outerData||[];
|
|
|
|
|
var innerSeriesTemplate = {
|
|
|
|
|
name: '商户类别',
|
|
|
|
|
type: 'pie',
|
|
|
|
|
radius: outerData.length==0?'80%':'40%',
|
|
|
|
|
center: ['50%', '40%'],
|
|
|
|
|
selectedMode: 'single',
|
|
|
|
|
itemStyle: {
|
|
|
|
|
emphasis: {
|
|
|
|
|
shadowBlur: 10,
|
|
|
|
|
shadowOffsetX: 0,
|
|
|
|
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
|
|
},
|
|
|
|
|
normal : {
|
|
|
|
|
label : {
|
|
|
|
|
position : 'inner'
|
|
|
|
|
},
|
|
|
|
|
labelLine : {
|
|
|
|
|
show : false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data:[]
|
|
|
|
|
};
|
|
|
|
|
angular.forEach(innerData,function (item) {
|
|
|
|
|
innerSeriesTemplate.data.push({
|
|
|
|
|
name:item.partner_type,
|
|
|
|
|
value:item.count_value,
|
|
|
|
|
selected:$scope.partners_type.partner_type===item.partner_type
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
var outerSeriesTemplate = {
|
|
|
|
|
name: '商户类别', type: 'pie',
|
|
|
|
|
radius : ['50%', '63%'],
|
|
|
|
|
center: ['50%', '40%'],
|
|
|
|
|
label: {
|
|
|
|
|
normal: {
|
|
|
|
|
formatter: '{b} : {c} ({d}%)'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
emphasis: {
|
|
|
|
|
shadowBlur: 10,
|
|
|
|
|
shadowOffsetX: 0,
|
|
|
|
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data:[]
|
|
|
|
|
};
|
|
|
|
|
angular.forEach(outerData,function (item) {
|
|
|
|
|
outerSeriesTemplate.data.push({
|
|
|
|
|
name:item.children_partner_type,
|
|
|
|
|
value:item.partner_counts})
|
|
|
|
|
});
|
|
|
|
|
var series = [innerSeriesTemplate];
|
|
|
|
|
if(outerData.length){
|
|
|
|
|
series.push(outerSeriesTemplate)
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'item',
|
|
|
|
|
formatter: "{a} <br/>{b} : {c} ({d}%)"
|
|
|
|
|
},
|
|
|
|
|
color: colors,
|
|
|
|
|
/* legend: {
|
|
|
|
|
orient: 'horizontal',
|
|
|
|
|
/!*y: '450px',
|
|
|
|
|
left: 'right',*!/
|
|
|
|
|
x: 'center',
|
|
|
|
|
y: 'bottom',
|
|
|
|
|
data: $scope.legends
|
|
|
|
|
},*/
|
|
|
|
|
series: series
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
/*var partnerTypesConfig = function (legend) {
|
|
|
|
|
return {
|
|
|
|
|
chart: {
|
|
|
|
|
tooltip: {
|
|
|
|
@ -99,7 +208,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
|
|
|
|
|
column: {key: 'partner_counts', name: 'partner_type'}
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
};*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.today = new Date();
|
|
|
|
|