* Add details page.
This commit is contained in:
@@ -223,6 +223,25 @@ class metric extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看度量项的详情。
|
||||
* View metric details.
|
||||
*
|
||||
* @param int $metricID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function details($metricID)
|
||||
{
|
||||
$metric = $this->metric->getByID($metricID);
|
||||
|
||||
$this->view->metric = $metric;
|
||||
$this->view->legendBasic = $this->metricZen->getBasicInfo($this->view);
|
||||
$this->view->createEditInfo = $this->metricZen->getCreateEditInfo($this->view);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算度量项。
|
||||
* Excute metric.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
.border-bottom {border-bottom: solid 1px var(--color-slate-300);}
|
||||
.border-bottom span {padding: 4px 12px; background-color: var(--color-slate-100);}
|
||||
.tab-margin {margin-top: 8px; margin-bottom: 8px;}
|
||||
.verify-content {height: 300px; border: solid 1px var(--color-slate-300);}
|
||||
|
||||
.clear-shadow {border: none; box-shadow: none;}
|
||||
.panel-body .relative {position: relative;}
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The implement file of metric 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 zhouxin<zhouxin@easycorp.ltd>
|
||||
* @package metric
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
$buildItems = function($items): array
|
||||
{
|
||||
$itemList = array();
|
||||
foreach($items as $item)
|
||||
{
|
||||
$itemList[] = item
|
||||
(
|
||||
set::name($item['name']),
|
||||
!empty($item['href']) ? a
|
||||
(
|
||||
set::href($item['href']),
|
||||
!empty($item['attr']) && is_array($item['attr']) ? set($item['attr']) : null,
|
||||
$item['text']
|
||||
) : $item['text'],
|
||||
set::collapse(!empty($item['text'])),
|
||||
);
|
||||
}
|
||||
|
||||
return $itemList;
|
||||
};
|
||||
|
||||
detailHeader
|
||||
(
|
||||
to::title
|
||||
(
|
||||
entityLabel
|
||||
(
|
||||
set::level(1),
|
||||
set::text($lang->metric->details)
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
panel
|
||||
(
|
||||
setClass('clear-shadow'),
|
||||
set::bodyClass('relative'),
|
||||
div
|
||||
(
|
||||
h1
|
||||
(
|
||||
setClass('border-bottom tab-margin'),
|
||||
span
|
||||
(
|
||||
|
||||
$lang->metric->legendBasicInfo,
|
||||
setClass('gray-pale text-md font-bold')
|
||||
),
|
||||
),
|
||||
div
|
||||
(
|
||||
tableData
|
||||
(
|
||||
$buildItems($legendBasic),
|
||||
),
|
||||
),
|
||||
h1
|
||||
(
|
||||
setClass('border-bottom tab-margin'),
|
||||
span
|
||||
(
|
||||
$lang->metric->legendCreateInfo,
|
||||
setClass('gray-pale text-md font-bold')
|
||||
),
|
||||
),
|
||||
div
|
||||
(
|
||||
tableData
|
||||
(
|
||||
$buildItems($createEditInfo),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
render();
|
||||
@@ -170,9 +170,10 @@ div
|
||||
(
|
||||
haspriv('metric', 'details') ? item(set(array
|
||||
(
|
||||
'text' => $this->lang->metric->details,
|
||||
'class' => 'ghost details',
|
||||
'url' => '#',
|
||||
'text' => $this->lang->metric->details,
|
||||
'class' => 'ghost details',
|
||||
'url' => helper::createLink('metric', 'details', "metricID=$current->id"),
|
||||
'data-toggle' => 'modal'
|
||||
))) : null,
|
||||
haspriv('metric', 'filters') ? item(set(array
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user