diff --git a/module/metric/control.php b/module/metric/control.php index 545aadc512..7726efa6ed 100755 --- a/module/metric/control.php +++ b/module/metric/control.php @@ -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. diff --git a/module/metric/css/details.ui.css b/module/metric/css/details.ui.css new file mode 100644 index 0000000000..6933633a5b --- /dev/null +++ b/module/metric/css/details.ui.css @@ -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;} diff --git a/module/metric/ui/details.html.php b/module/metric/ui/details.html.php new file mode 100644 index 0000000000..9bd24f85ca --- /dev/null +++ b/module/metric/ui/details.html.php @@ -0,0 +1,89 @@ + + * @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(); diff --git a/module/metric/ui/previewsingle.html.php b/module/metric/ui/previewsingle.html.php index 05955974e5..1c121108dc 100644 --- a/module/metric/ui/previewsingle.html.php +++ b/module/metric/ui/previewsingle.html.php @@ -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 (