* Finish task #89846.

This commit is contained in:
liumengyi
2023-04-06 16:07:30 +08:00
parent 70a775c2f6
commit 4692ea5d61
3 changed files with 62 additions and 37 deletions
+15 -8
View File
@@ -1,7 +1,7 @@
.mt-m {margin-top: 16px;}
.flex-center {display: flex; justify-content: center; align-items: center;}
#mainContent {display: flex; gap: 16px; height: calc(100vh - 120px);}
#mainContent > .main {flex: 1 1 75%; overflow-y: auto; min-height: 480px;}
#mainContent {display: flex; gap: 16px; height: calc(100vh - 165px);}
#mainContent > .main {flex: 1 1 75%; overflow-y: auto; min-height: 445px;}
#mainContent > .side {flex: 1 1 25%;}
.priv-panel {background: #fff; padding: 10px; box-shadow: 0 1px 1px rgb(0 0 0 / 5%), 0 2px 6px 0 rgb(0 0 0 / 5%);}
.priv-panel > .panel-content {height: calc(50vh - 160px); overflow-y: auto; min-height: 140px;}
@@ -13,7 +13,7 @@
.empty-tip {height: 100%;}
.table-bymodule select.form-control {height: 250px;}
.group-item {display: block; width: 220px; float: left; font-size: 14px;}
.group-item {display: block; width: 180px; float: left; font-size: 14px;}
.group-item .checkbox-inline label {padding-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.table.table-form tbody > tr:last-child td {border-top: 1px solid #ddd;}
@-moz-document url-prefix() {.table.table-form tbody > tr:last-child td, .table.table-form tbody > tr:last-child th {border-bottom: 1px solid #ddd;};}
@@ -27,16 +27,23 @@ td.menus + td {border-left: 0;}
.menus .checkbox-primary:first-child {float: left; width: auto;}
.menus a {margin-left: 10px;}
#privList th.module {width: 142px; background-color: #E6EAF1; font-weight: 600;}
#privList th.package {width: 142px; background-color: #EDEEF2; font-weight: 600;}
#privList th.method {min-width: 685px;}
#privList th.module > .check-all, #privList th.package > .check-all {font-weight: 600;}
#mainContent .main-content {padding: 2px;}
#privList .table-bordered th {border: 1px solid #FFF;}
#privList th.module {width: 142px; min-width: 142px; background-color: #EDEEF2CC; font-weight: 600;}
#privList th.package {width: 142px; min-width: 142px; background-color: #F4F5F7; font-weight: 600;}
#privList th.method {min-width: 585px;}
#privList th .checkbox-inline input {margin-left: 0px;}
#privList .check-all {display: inline-block;}
#privList .check-all > label {padding-left: 0;}
#privList .check-all > label {padding-left: 0; font-weight: 600;}
#privList .text-middle.text-left {padding-left: 24px;}
#privList tbody > tr > td {padding: 4px 20px 20px 20px;}
#privList .group-item {margin-top: 16px;}
#privList .group-item .checkbox-inline label {padding-left: 3px;}
#privList.table-bordered td, #privList.table-bordered th {border-top-style: dashed; border-bottom-style: dashed;}
#privList .check-all>label.checkbox-indeterminate-block:before {content: ' '; opacity: 1; transform: scale(1);}
.priv-footer {padding: 14px; z-index: 3; box-shadow: inset 0 0px 0px rgb(0 0 0 / 10%), 0 0 5px rgb(0 0 0 / 10%); position: relative; min-height: 40px; background: #fff; border-radius: 0 0 4px 4px;}
.priv-footer .btn {margin 0px; padding-top: 7px;}
.priv-footer .check-all {display: inline-block;}
.priv-footer .check-all label {padding-left: 0px; margin-bottom: 0px; font-weight: 400;}
.priv-footer #submit {margin: 0px 20px;}
main#main {padding-bottom: 0px;}
+37 -29
View File
@@ -233,39 +233,42 @@ function updateRelations(e)
getSideRelation(selectedID);
}
function checkAllChange()
{
var id = $(this).find('input[type=checkbox]').attr('id');
var checked = $(this).find('input[type=checkbox]').prop('checked');
if(id == 'allChecker')
{
$('input[type=checkbox]').prop('checked', checked);
if(checked) $('input[type=checkbox]').attr('checked', checked);
if(!checked) $('input[type=checkbox]').removeAttr('checked');
$(this).closest('.priv-footer').siblings('#mainContent').find('#privList tbody .checkbox-indeterminate-block').removeClass('checkbox-indeterminate-block');
}
else
{
var moduleName = $(this).closest('th').attr('data-module');
var packageID = $(this).closest('th').hasClass('package') ? $(this).closest('th').attr('data-package') : '';
var $children = $(this).closest('th').hasClass('package') ? $(this).closest('tbody').find('[data-module=' + moduleName +'][data-package=' + packageID +']') : $(this).closest('tbody').find('[data-module=' + moduleName +']');
$children.find('input[type=checkbox]').prop('checked', checked);
$children.find('.checkbox-indeterminate-block').removeClass('checkbox-indeterminate-block');
if(checked) $children.find('input[type=checkbox]').attr('checked', checked);
if(!checked) $children.find('input[type=checkbox]').removeAttr('checked');
changeParentChecked($(this), moduleName, packageID);
}
}
$(function()
{
initRecomendTree([]);
initDependTree([]);
$('#privList > tbody > tr > th .check-all').change(function()
{
var id = $(this).find('input[type=checkbox]').attr('id');
var checked = $(this).find('input[type=checkbox]').prop('checked');
if(id == 'allChecker')
{
$('input[type=checkbox]').prop('checked', checked);
if(checked) $('input[type=checkbox]').attr('checked', checked);
if(!checked) $('input[type=checkbox]').removeAttr('checked');
$(this).closest('tbody').find('.checkbox-indeterminate-block').removeClass('checkbox-indeterminate-block');
}
else
{
var moduleName = $(this).closest('th').attr('data-module');
var packageID = $(this).closest('th').hasClass('package') ? $(this).closest('th').attr('data-package') : '';
var $children = $(this).closest('th').hasClass('package') ? $(this).closest('tbody').find('[data-module=' + moduleName +'][data-package=' + packageID +']') : $(this).closest('tbody').find('[data-module=' + moduleName +']');
$children.find('input[type=checkbox]').prop('checked', checked);
$children.find('.checkbox-indeterminate-block').removeClass('checkbox-indeterminate-block');
if(checked) $children.find('input[type=checkbox]').attr('checked', checked);
if(!checked) $children.find('input[type=checkbox]').removeAttr('checked');
changeParentChecked($(this), moduleName, packageID);
}
});
$('#privList > tbody > tr > th .check-all').change(checkAllChange);
$('.priv-footer .check-all').change(checkAllChange);
$('#privList > tbody > tr > td input[type=checkbox]').change(function()
{
@@ -282,4 +285,9 @@ $(function()
var packageID = $(this).closest('.group-item').attr('data-package');
changeParentChecked($(this), moduleName, packageID);
});
})
$('#submit').click(function()
{
$('#managePrivForm').submit();
});
});
+10
View File
@@ -185,6 +185,16 @@
</div>
</div>
</div>
<div class='priv-footer'>
<div class='text-center text-middle'>
<div class="checkbox-primary checkbox-inline check-all">
<input type='checkbox' id='allChecker'>
<label class='text-right' for='allChecker'><?php echo $lang->selectAll;?></label>
</div>
<?php echo html::submitButton($lang->save, '', 'btn btn-primary btn-wide');?>
<?php echo html::a($this->createLink('group', 'browse'), $lang->goback, '', 'class="btn btn-wide"');?>
</div>
</div>
<?php endif;?>
<?php js::set('groupID', $groupID);?>
<?php js::set('menu', $menu);?>