ArticleShow.php
2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
+-----------------------------------------------------------------------------------------------------------------------
* 管理端详情show trait层:渲染生成 Article 详情
+-----------------------------------------------------------------------------------------------------------------------
*
* PHP version 7
*
* @category App\Admin\Shows
* @package App\Admin\Shows
* @author Richer <yangzi1028@163.com>
* @date 2023年2月21日10:04:39
* @copyright 2020-2022 Richer (http://www.Richer.com/)
* @license http://www.Richer.com/ License
* @link http://www.Richer.com/
*/
namespace App\Admin\Shows;
/**
* Trait ArticleShow
* @package App\Admin\Shows
*/
trait ArticleShow
{
/**
* 为详情show渲染字段
*
* @return void
*/
protected function renderShowFields()
{
$this->showTextField('id', __('ID'));
$this->showTextField('section.title', __('section'));
$this->showTextField('description');
$this->showSingleImageField();
$this->showMultipleImageField();
$this->showRichTextField();
$this->showTextField('status_color_show', __('status'));
$this->showTextField('created_at', __('created_at'));
$this->showTextField('updated_at', __('updated_at'));
$this->show->divider();
$this->show->auditRecords('审核记录明细')->as(function ($records) {
$html = '<div class="track-list track-list-date"><ul>';
$records->each(function ($record, $index) use (&$html) {
if ($index === 0) {
$html .= '<li class="afterdate node-to-change track-node-0008 first">';
} else {
$html .= '<li class="">';
}
$html .= '<i class="node-icon"><i class="dot"></i><i class="state-icon"></i></i>';
$html .= ' <span class="date">' .$record->created_at . '</span>';
$html .= ' <span class="auditor">' .optional($record->user)->name . '</span>';
$html .= ' <span class="status">' .$record->audited_status_show_color . '</span>';
$html .= ' <span class="txt">' .$record->audited_opinion . '</span>';
});
return $html;
})->setGroupClass('col-sm-12 clear-both')
->setWidth(11, 1);
}
}