* [task#133002,doing,0.5h] add feature of switch version.

This commit is contained in:
zhouxin
2024-11-22 13:35:07 +08:00
committed by 綦新志
parent 1bafc4790a
commit 88353ccb3f
3 changed files with 21 additions and 2 deletions
+1
View File
@@ -85,6 +85,7 @@ class pivot extends control
$this->view->versionSpecs = $this->pivot->getPivotVersions($pivotID);
$this->view->version = $version == 'newest' ? $this->pivot->getMaxVersion($pivotID) : $version;
$this->view->pivot = $pivot;
$this->view->groupID = $groupID;
$this->display();
}
+7
View File
@@ -0,0 +1,7 @@
function switchVersion(e)
{
const groupID = $(e.target).attr('data-group');
const pivotID = $(e.target).attr('data-pivot');
const version = $(e.target).attr('data-version');
loadModal($.createLink('pivot', 'versions', `groupID=${groupID}&pivotID=${pivotID}&version=${version}`));
}
+13 -2
View File
@@ -16,8 +16,19 @@ foreach($versionSpecs as $versionSpec)
{
$versionsTableBody[] = h::tr
(
h::td('#' . $versionSpec->version),
h::td($versionSpec->desc),
h::td
(
h::a
(
'#' . $versionSpec->version,
set::href("javascript:;"),
on::click("switchVersion"),
setData('pivot', $pivot->id),
setData('version', $versionSpec->version),
setData('group', $groupID)
)
),
h::td($versionSpec->desc)
);
}