| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <?php
- /**
- * The singleproductbugstatistic block view file of block module of ZenTaoPMS.
- * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
- * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
- * @author Mengyi Liu <liumengyi@easycorp.ltd>
- * @package block
- * @link https://www.zentao.net
- */
- namespace zin;
- $uniqid = uniqid();
- $isEn = $app->getClientLang() == 'en';
- panel
- (
- to::titleSuffix
- (
- icon
- (
- setClass('text-light text-sm cursor-pointer'),
- toggle::tooltip
- (
- array
- (
- 'title' => sprintf($lang->block->tooltips['metricTime'], $metricTime),
- 'placement' => $isEn ? 'bottom-end' : 'bottom',
- 'type' => 'white',
- 'className' => 'text-dark border border-light leading-5'
- )
- ),
- 'help'
- )
- ),
- setClass('singlebugstatistic-block ' . ($longBlock ? 'block-long' : 'block-sm')),
- set::bodyClass('no-shadow border-t p-0'),
- set::title($block->title),
- div
- (
- setClass('flex' . ($longBlock ? ' flex-nowrap' : ' flex-wrap')),
- cell
- (
- setClass('flex flex-wrap items-center content-center progress-circle' . (!$longBlock ? ' pt-8 pb-4' : '')),
- set::width($longBlock ? '30%' : '100%'),
- div(setClass('flex justify-center w-full'), progressCircle
- (
- set::percent($resolvedRate),
- set::size($isEn ? 140 : 112),
- set::text(false),
- set::circleWidth(0.06),
- div(span(setClass('text-2xl font-bold'), $resolvedRate), '%'),
- div
- (
- setClass('row text-sm text-gray items-center gap-1'),
- $lang->block->qastatistic->fixBugRate,
- icon
- (
- setClass('text-light text-sm'),
- toggle::tooltip
- (
- array
- (
- 'title' => $lang->block->tooltips['resolvedRate'],
- 'placement' => 'bottom-end',
- 'type' => 'white',
- 'className' => 'text-dark border border-light leading-5'
- )
- ),
- 'help'
- )
- )
- )),
- cell
- (
- setClass('flex justify-center w-full mt-3 gap-x-4'),
- col
- (
- span
- (
- setClass('flex justify-center'),
- $totalBugs
- ),
- span
- (
- setClass('text-sm text-gray'),
- $lang->block->bugstatistic->effective
- )
- ),
- col
- (
- span
- (
- setClass('flex justify-center'),
- $closedBugs
- ),
- span
- (
- setClass('text-sm text-gray'),
- $lang->block->bugstatistic->fixed
- )
- ),
- col
- (
- span
- (
- setClass('flex justify-center'),
- $unresovledBugs
- ),
- span
- (
- setClass('text-sm text-gray'),
- $lang->block->bugstatistic->activated
- )
- )
- )
- ),
- cell
- (
- setClass('p-4' . ($longBlock ? ' mt-3' : ' pb-0')),
- set::width($longBlock ? '70%' : '100%'),
- echarts
- (
- set::title(array('text' => $lang->block->qastatistic->bugStatusStat, 'textStyle' => array('fontSize' => '12'))),
- set::color(array('#66a2ff', '#9ea3b0')),
- set::width('100%'),
- set::height(200),
- set::tooltip(array('trigger' => 'axis')),
- set::grid(array('left' => '10px', 'top' => '50px', 'right' => '0', 'bottom' => '10px', 'containLabel' => true)),
- set::legend(array('show' => true, 'right' => '0', 'top' => '25px', 'textStyle' => array('fontSize' => '11'))),
- set::xAxis(array('type' => 'category', 'data' => array_keys($activateBugs), 'splitLine' => array('show' => false), 'axisTick' => array('alignWithLabel' => true, 'interval' => 0), 'axisLabel' => array('fontSize' => $longBlock ? '8' : '10'))),
- set::yAxis(array('type' => 'value', 'splitLine' => array('show' => false), 'axisLine' => array('show' => true, 'color' => '#DDD'), 'axisLabel' => array('showMaxLabel' => true, 'interval' => 'auto'))),
- set::tooptop(array('show' => true, 'formatter' => '{b}: {c}')),
- set::series
- (
- array
- (
- array
- (
- 'type' => 'bar',
- 'barWidth' => '8',
- 'name' => $lang->bug->createAB,
- 'data' => array_values($activateBugs)
- ),
- array
- (
- 'type' => 'bar',
- 'barWidth' => '8',
- 'name' => $lang->bug->close,
- 'data' => array_values($closeBugs)
- )
- )
- )
- )
- )
- )
- );
- render();
|