Merge branch 'sprint/247_wzm_72350' into 'sprint/247'
* finish task 72350 See merge request easycorp/zentaopms!5845
This commit is contained in:
@@ -371,15 +371,49 @@ class report extends control
|
||||
|
||||
if(empty($dept) and empty($userID)) $data['statusStat'] = $this->report->getAllTimeStatusStat();
|
||||
|
||||
$contributionGroups = array();
|
||||
$maxCount = 0;
|
||||
$contributions = 0;
|
||||
foreach($years as $yearValue)
|
||||
{
|
||||
$contributionList = $this->report->getUserYearContributions($accounts, $yearValue);
|
||||
$contributionCount = 0;
|
||||
$max = 0;
|
||||
$radarData = array('product' => 0, 'execution' => 0, 'devel' => 0, 'qa' => 0, 'other' => 0);
|
||||
foreach($contributionList as $objectType => $objectContributions)
|
||||
{
|
||||
$sum = array_sum($objectContributions);
|
||||
if($sum > $max) $max = $sum;
|
||||
$contributionCount += $sum;
|
||||
|
||||
foreach($objectContributions as $actionName => $count)
|
||||
{
|
||||
$radarTypes = isset($this->config->report->annualData['radar'][$objectType][$actionName]) ? $this->config->report->annualData['radar'][$objectType][$actionName] : array('other');
|
||||
foreach($radarTypes as $radarType) $radarData[$radarType] += $count;
|
||||
}
|
||||
$contributionGroups[$yearValue] = $radarData;
|
||||
}
|
||||
|
||||
if($yearValue == $year)
|
||||
{
|
||||
$maxCount = $max;
|
||||
$contributions = $contributionCount;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->title = sprintf($this->lang->report->annualData->title, ($userID ? zget($users, $userID, '') : (($dept !== '') ? substr($depts[$dept], strrpos($depts[$dept], '/') + 1) : $depts[''])), $year);
|
||||
$this->view->data = $data;
|
||||
$this->view->year = $year;
|
||||
$this->view->users = $users;
|
||||
$this->view->depts = $depts;
|
||||
$this->view->years = $years;
|
||||
$this->view->dept = $dept;
|
||||
$this->view->userID = $userID;
|
||||
$this->view->months = $this->report->getYearMonths($year);
|
||||
$this->view->data = $data;
|
||||
$this->view->year = $year;
|
||||
$this->view->users = $users;
|
||||
$this->view->depts = $depts;
|
||||
$this->view->years = $years;
|
||||
$this->view->dept = $dept;
|
||||
$this->view->userID = $userID;
|
||||
$this->view->months = $this->report->getYearMonths($year);
|
||||
$this->view->contributionGroups = $contributionGroups;
|
||||
$this->view->radarData = $contributionGroups[$year];
|
||||
$this->view->maxCount = $maxCount;
|
||||
$this->view->contributions = $contributions;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ section.active {border: 1px solid rgb(0, 166, 255);}
|
||||
#actionData .ratio .item {display: inline-block; text-align: center;}
|
||||
|
||||
#radar {width: 350px; height: 330px; padding-left:10px;}
|
||||
#radarCanvas {width: 330px; height: 310px; margin: 0 auto;}
|
||||
#radarCanvas {width: 330px; height: 300px; margin: 0 auto;}
|
||||
|
||||
#executionData, #productData {width: 633px; height: 350px; margin-top: 20px; position: relative;}
|
||||
#executionData div.has-table, #productData div.has-table {margin-top: 30px; height: 285px; overflow: auto;}
|
||||
@@ -81,4 +81,4 @@ section.active {border: 1px solid rgb(0, 166, 255);}
|
||||
.dataYearStat > div {margin-top: 5px;}
|
||||
.dataYearStat .canvas {float: left; height: 305px; padding-left: 30px;}
|
||||
.dataYearStat .canvas.left {width: 450px;}
|
||||
.dataYearStat .canvas.right {width: 810px; float: right;}
|
||||
.dataYearStat .canvas.right {width: 810px; float: right;}
|
||||
@@ -1,10 +1,12 @@
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<?php include '../../common/view/chosen.html.php';?>
|
||||
<?php js::import($jsRoot . 'echarts/echarts.common.min.js'); ?>
|
||||
<?php js::import($jsRoot . 'echarts/timeline.min.js'); ?>
|
||||
<?php js::import($jsRoot . 'html2canvas/min.js'); ?>
|
||||
<?php $annualDataLang = $lang->report->annualData;?>
|
||||
<?php $annualDataConfig = $config->report->annualData;?>
|
||||
<?php $soFar = sprintf($annualDataLang->soFar, $year);?>
|
||||
<?php js::set('contributionGroups', $contributionGroups); ?>
|
||||
<div id='container' style='background-image: url(<?php echo $config->webRoot . 'theme/default/images/main/annual_data_bg.png'?>)'>
|
||||
<main id='main' style='background: url(<?php echo $config->webRoot . 'theme/default/images/main/annual_layout_header.png'?>) top no-repeat'>
|
||||
<header id='header'>
|
||||
@@ -48,23 +50,6 @@
|
||||
<li><span class='todoStatus'><?php echo $annualDataLang->todoStatus['done'];?></span><span><?php echo (int)$data['todos']->done;?></span></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
$contributions = 0;
|
||||
$maxCount = 0;
|
||||
$radarData = array('product' => 0, 'execution' => 0, 'devel' => 0, 'qa' => 0, 'other' => 0);
|
||||
foreach($data['contributions'] as $objectType => $objectContributions)
|
||||
{
|
||||
$sum = array_sum($objectContributions);
|
||||
if($sum > $maxCount) $maxCount = $sum;
|
||||
$contributions += $sum;
|
||||
|
||||
foreach($objectContributions as $actionName => $count)
|
||||
{
|
||||
$radarTypes = isset($annualDataConfig['radar'][$objectType][$actionName]) ? $annualDataConfig['radar'][$objectType][$actionName] : array('other');
|
||||
foreach($radarTypes as $radarType) $radarData[$radarType] += $count;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if($dept !== '' or !empty($userID)):?>
|
||||
<li>
|
||||
<?php echo $annualDataLang->contributions;?>
|
||||
@@ -248,38 +233,117 @@
|
||||
</main>
|
||||
<div id='loadIndicator' class='load-indicator'></div>
|
||||
</div>
|
||||
<?php echo js::set('exportByZentao', $annualDataLang->exportByZentao);?>
|
||||
<?php js::set('exportByZentao', $annualDataLang->exportByZentao);?>
|
||||
<?php js::set('radarData1', $radarData); ?>
|
||||
<?php js::set('annualDataLang1', $annualDataLang); ?>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
var radarChart = echarts.init(document.getElementById('radarCanvas'));
|
||||
var radarOption = {
|
||||
tooltip: {},
|
||||
radar: {
|
||||
splitArea:{areaStyle:{color: ['#010419']}},
|
||||
radius:'65%',
|
||||
<?php
|
||||
$max = max($radarData);
|
||||
if($max == 0) $max = 1;
|
||||
$indicator = array();
|
||||
foreach($annualDataLang->radarItems as $radarKey => $radarName)
|
||||
{
|
||||
$indicator[$radarKey]['name'] = $radarName;
|
||||
$indicator[$radarKey]['max'] = $max;
|
||||
}
|
||||
?>
|
||||
indicator: <?php echo json_encode(array_values($indicator));?>
|
||||
},
|
||||
series: [{
|
||||
name:'<?php echo $annualDataLang->radar;?>',
|
||||
areaStyle:{color: 'rgb(45, 40, 33)'},
|
||||
type: 'radar',
|
||||
itemStyle: {color: "#fff", borderColor:"rgb(247, 193, 35)"},
|
||||
lineStyle: {color: "rgb(247, 193, 35)"},
|
||||
data: [{value: <?php echo json_encode(array_values($radarData));?>}]
|
||||
}]
|
||||
};
|
||||
<?php
|
||||
$indicator = array();
|
||||
foreach($annualDataLang->radarItems as $radarKey => $radarName)
|
||||
{
|
||||
$indicator[$radarKey]['name'] = $radarName;
|
||||
$indicator[$radarKey]['max'] = 0;
|
||||
}
|
||||
?>
|
||||
var indicator = <?php echo json_encode(array_values($indicator));?>;
|
||||
var contributionData = [];
|
||||
var yearsData = [];
|
||||
if(contributionGroups) {
|
||||
for(var contributionKey in contributionGroups)
|
||||
{
|
||||
yearsData.push(contributionKey);
|
||||
var itemData = [];
|
||||
var newIndicator = [];
|
||||
for(var itemKey in contributionGroups[contributionKey])
|
||||
{
|
||||
itemData.push(contributionGroups[contributionKey][itemKey]);
|
||||
}
|
||||
itemMax = Math.max.apply(null,itemData);
|
||||
var resultIndicator = indicator.map(function(item,index)
|
||||
{
|
||||
item.max = itemMax;
|
||||
return {...item};
|
||||
})
|
||||
var contributionItem = {
|
||||
year: contributionKey,
|
||||
data: itemData || [],
|
||||
max: itemMax,
|
||||
indicator: resultIndicator,
|
||||
}
|
||||
contributionData.push(contributionItem);
|
||||
}
|
||||
}
|
||||
var radarChart = echarts.init(document.getElementById('radarCanvas'));
|
||||
|
||||
var radarIndicatorData = [];
|
||||
for(var k = 0; k < contributionData.length; k++)
|
||||
{
|
||||
optionsItem = {
|
||||
'radarIndicator': contributionData[k].indicator,
|
||||
'tradeRange': contributionData[k].data,
|
||||
}
|
||||
radarIndicatorData.push(optionsItem);
|
||||
}
|
||||
var radarOption = {
|
||||
baseOption: {
|
||||
title: {},
|
||||
timeline: {
|
||||
show: yearsData.length && yearsData.length > 1,
|
||||
axisType: 'category',
|
||||
autoPlay: true,
|
||||
playInterval: 1000,
|
||||
left: "1%",
|
||||
bottom: "1%",
|
||||
width: '90%',
|
||||
data: yearsData,
|
||||
symbolSize: [8, 4],
|
||||
label: {
|
||||
normal: {
|
||||
color: '#fff',
|
||||
interval: 'auto',
|
||||
fontSize: 12,
|
||||
lineHeight: 20
|
||||
},
|
||||
interval: 'auto',
|
||||
},
|
||||
lineStyle: {
|
||||
width: 5,
|
||||
},
|
||||
controlStyle: {
|
||||
itemSize: 18
|
||||
},
|
||||
|
||||
},
|
||||
series: [{
|
||||
name:'<?php echo $annualDataLang->radar;?>',
|
||||
areaStyle:{color: 'rgb(45, 40, 33)'},
|
||||
type: 'radar',
|
||||
itemStyle: {color: "#fff", borderColor:"rgb(247, 193, 35)"},
|
||||
lineStyle: {color: "rgb(247, 193, 35)"},
|
||||
}]
|
||||
},
|
||||
options: []
|
||||
};
|
||||
var newOptions = [];
|
||||
for(var k = 0; k < radarIndicatorData.length; k++)
|
||||
{
|
||||
optionsItem = {
|
||||
radar: {
|
||||
splitNumber: 5,
|
||||
radius: 88,
|
||||
indicator: radarIndicatorData[k].radarIndicator
|
||||
},
|
||||
series: [{
|
||||
data: [{
|
||||
value: radarIndicatorData[k].tradeRange
|
||||
}]
|
||||
}]
|
||||
}
|
||||
newOptions.push(optionsItem);
|
||||
}
|
||||
radarOption.options = (radarOption.options).concat(newOptions);
|
||||
radarChart.setOption(radarOption);
|
||||
|
||||
var overviewCSS = {position: 'absolute', left: '172px', top: '160px'};
|
||||
|
||||
Vendored
+21
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user