* @package task * @link https://www.zentao.net */ namespace zin; jsVar('executionID', $executionID); jsVar('browseType', $browseType); detailHeader ( to::title ( entityLabel ( set::level(1), set::text($lang->task->report->common) ) ), ); $selectCharts = array(); foreach($lang->task->report->charts as $code => $name) { $chart = array(); $chart['text'] = $name; $chart['value'] = $code; $selectCharts[] = $chart; } $echarts = array(); foreach($charts as $type => $option) { $chartData = $datas[$type]; $echarts[] = tableChart ( set::type($option->type), set::title($lang->task->report->charts[$type]), set::datas((array)$chartData), set::tableWidth('40%'), set::tableHeaders(array( 'item' => $lang->task->report->$type->item, 'value' => $lang->task->report->value, 'percent' => $lang->report->percent, )), ); } $chartContents = array(); foreach($lang->report->typeList as $type => $typeName) { $link = createLink('task', 'report', "executionID=$executionID&browseType=$browseType&type=%s"); $chartContents[] = tabPane ( set::key($type), set::title($typeName), set::active($type == $chartType), set::param(sprintf($link, $type)), to::prefix(icon($type == 'default' ? 'list-alt' : "chart-{$type}")), div ( set::className('pb-4'), span(set::className('text-gray'), html(str_replace('%tab%', $lang->task->waitTask . $lang->testcase->common, $lang->report->notice->help))) ), div($echarts) ); } div ( setClass('flex flex-nowrap'), cell ( set::width('240'), formPanel ( setID('chartForm'), set('title', $lang->task->report->select), set('actions', array ( array ( 'text' => $lang->selectAll, 'class' => 'btn-select-all space', 'url' => 'javascript:triggerChecked();' ), array ( 'type' => 'primary', 'text' => $lang->task->report->create, 'class' => 'btn-select-all space', 'url' => 'javascript:createChart();' ), )), checkList ( set::primary(true), set::name('charts[]'), set::value('code'), set::inline(false), set::items($selectCharts), ), ), ), cell ( setID('chartContainer'), setClass('flex-auto ml-4 bg-white px-4 py-2'), tabs ( on::click('.font-medium', 'changeTab'), $chartContents ) ) );