* Add prompt information when the data is empty.

This commit is contained in:
tianshujie
2023-10-17 16:45:32 +08:00
parent 06920432b2
commit 68cf3cd9c5
6 changed files with 66 additions and 45 deletions
+2
View File
@@ -0,0 +1,2 @@
.table-empty-tip {padding: 80px 10px; text-align: center; background: #fff;}
.table-empty-tip .btn-group .btn {background-color: rgba(var(--color-primary-50-rgb),var(--tw-bg-opacity)); color: var(--nav-active-color); --tw-ring-color: rgba(var(--color-primary-50-rgb),var(--tw-bg-opacity));}
+1
View File
@@ -117,6 +117,7 @@ $lang->api->control = 'Access Control';
$lang->api->noLib = 'No API library yet.';
$lang->api->noApi = 'No API yet.';
$lang->api->noStruct = 'No API yet.';
$lang->api->noRelease = 'No version yet.';
$lang->api->lib = 'API Library';
$lang->api->apiList = 'API List';
$lang->api->formTitle = 'API Name';
+1
View File
@@ -117,6 +117,7 @@ $lang->api->control = 'Access Control';
$lang->api->noLib = 'No API library yet.';
$lang->api->noApi = 'No API yet.';
$lang->api->noStruct = 'No API yet.';
$lang->api->noRelease = 'No version yet.';
$lang->api->lib = 'API Library';
$lang->api->apiList = 'API List';
$lang->api->formTitle = 'API Name';
+1
View File
@@ -117,6 +117,7 @@ $lang->api->control = 'Access Control';
$lang->api->noLib = 'No API library yet.';
$lang->api->noApi = 'No API yet.';
$lang->api->noStruct = 'No API yet.';
$lang->api->noRelease = 'No version yet.';
$lang->api->lib = 'API Library';
$lang->api->apiList = 'API List';
$lang->api->formTitle = 'API Name';
+1
View File
@@ -117,6 +117,7 @@ $lang->api->control = '访问控制';
$lang->api->noLib = '暂时没有库。';
$lang->api->noApi = '暂时没有接口。';
$lang->api->noStruct = '暂时没有数据结构。';
$lang->api->noRelease = '暂时没有版本。';
$lang->api->lib = '所属库';
$lang->api->apiList = '接口列表';
$lang->api->formTitle = '接口名称';
+60 -45
View File
@@ -12,58 +12,73 @@ namespace zin;
set::title($lang->api->releases);
$tbody = array();
foreach($releases as $release)
if(empty($release))
{
$tbody[] = h::tr
div
(
h::td(str_pad((string)$release->id, 3, '0', STR_PAD_LEFT)),
h::td($release->version),
h::td($release->desc),
h::td(zget($users, $release->addedBy)),
h::td(substr($release->addedDate, 0, 10)),
h::td
setClass('table-empty-tip flex justify-center items-center'),
span
(
common::hasPriv('api', 'deleteRelease') ? html(html::a(helper::createLink('api', 'deleteRelease', "libID=$libID&id=$release->id"), '<i class="icon-trash"></i>', '', "data-confirm={$lang->custom->notice->confirmDelete} class='ghost ajax-submit'")) : null
setClass('text-gray'),
$lang->api->noRelease
),
);
}
else
{
$tbody = array();
foreach($releases as $release)
{
$tbody[] = h::tr
(
h::td(str_pad((string)$release->id, 3, '0', STR_PAD_LEFT)),
h::td($release->version),
h::td($release->desc),
h::td(zget($users, $release->addedBy)),
h::td(substr($release->addedDate, 0, 10)),
h::td
(
common::hasPriv('api', 'deleteRelease') ? html(html::a(helper::createLink('api', 'deleteRelease', "libID=$libID&id=$release->id"), '<i class="icon-trash"></i>', '', "data-confirm={$lang->custom->notice->confirmDelete} class='ghost ajax-submit'")) : null
),
);
}
h::table
(
setClass('table condensed bordered'),
h::tr
h::table
(
h::th
setClass('table condensed bordered'),
h::tr
(
width('60px'),
$lang->idAB
h::th
(
width('60px'),
$lang->idAB
),
h::th
(
width('160px'),
$lang->api->version
),
h::th
(
width('160px'),
$lang->api->desc
),
h::th
(
width('100px'),
$lang->api->addedBy
),
h::th
(
width('100px'),
$lang->api->structAddedDate
),
h::th
(
width('50px'),
$lang->actions
)
),
h::th
(
width('160px'),
$lang->api->version
),
h::th
(
width('160px'),
$lang->api->desc
),
h::th
(
width('100px'),
$lang->api->addedBy
),
h::th
(
width('100px'),
$lang->api->structAddedDate
),
h::th
(
width('50px'),
$lang->actions
)
),
$tbody
);
$tbody
);
}