dd/resources/views/nasa/v1/_lists/subfile.blade.php
2026-07-04 19:01:35 +08:00

44 lines
2.2 KiB
PHP

<table class="mac-table">
<thead>
<tr>
@foreach ($aData["aListField"] as $k => $v)
<th>{{$v}}</th>
@endforeach
<th>操作</th>
</tr>
</thead>
<tbody>
@foreach ($aData["cList"] as $aRow)
<tr>
@foreach ($aRow as $k => $v)
@php
$sValueType = $aData["aFieldTypes"][$k] ?? '';
$sMapValue = $aData["aMap"][$k][$v] ?? $v;
$sShowValue = $aData["aValueStyle"][$sMapValue] ?? $sMapValue;
if ($sMapValue != $v) {
$sShowValue = $sShowValue." <span class='text-muted'>(".$v.")</span>";
}
if ($sValueType == 'article') {
$sShowValue = "<a class='text-info js-tom-modal-open-article' tom-modal-field='".$k."' tom-modal-save-id='".$aRow['id']."'>文章 <span class='text-muted'>(".strlen($v).")</span></a>";
} else if ($sValueType == 'json') {
$sShowValue = "<a class='text-info js-tom-modal-open-json' tom-modal-field='".$k."' tom-modal-save-id='".$aRow['id']."'>json <span class='text-muted'>(".strlen($v).")</span></a>";
} else if ($sValueType == 'byte') {
$sShowValue = "<span class=''>".(int)($v / 1024 / 1024 / 1204)."g <span class='text-muted'>(".$v.")</span></span>";
} else if ($sValueType == 'text') {
$sShowValue = "<a class='text-info js-tom-modal-open-text' tom-modal-field='".$k."' tom-modal-save-id='".$aRow['id']."'>文本 <span class='text-muted'>(".strlen($v).")</span></a>";
}
@endphp
<td>{!! $sShowValue !!}</td>
@endforeach
<td>
<a class="mac-table-operation-btn text-muted js-open-detail" open-detail-id="{{ $aRow['id'] }}"><i class="ri-article-line"></i></a>
<!-- <a class="js-tom-modal-open" tom-modal-open="detail" hidden></a> -->
<a class="text-muted js-tom-modal-open" tom-modal-open="tool" tom-modal-data-id="{{ $aRow['id'] }}"><i class="ri-tools-fill"></i></a>
</td>
</tr>
@endforeach
</tbody>
</table>