mirror of https://gitee.com/karson/fastadmin.git
parent
b7300ea558
commit
3a92ef5564
|
|
@ -30,7 +30,6 @@ class Admin extends Backend
|
||||||
$this->childrenGroupIds = $this->auth->getChildrenGroupIds($this->auth->isSuperAdmin() ? true : false);
|
$this->childrenGroupIds = $this->auth->getChildrenGroupIds($this->auth->isSuperAdmin() ? true : false);
|
||||||
|
|
||||||
$groupList = collection(AuthGroup::where('id', 'in', $this->childrenGroupIds)->select())->toArray();
|
$groupList = collection(AuthGroup::where('id', 'in', $this->childrenGroupIds)->select())->toArray();
|
||||||
$groupIds = $this->auth->getGroupIds();
|
|
||||||
Tree::instance()->init($groupList);
|
Tree::instance()->init($groupList);
|
||||||
$result = [];
|
$result = [];
|
||||||
if ($this->auth->isSuperAdmin())
|
if ($this->auth->isSuperAdmin())
|
||||||
|
|
@ -39,9 +38,10 @@ class Admin extends Backend
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach ($groupIds as $m => $n)
|
$groups = $this->auth->getGroups();
|
||||||
|
foreach ($groups as $m => $n)
|
||||||
{
|
{
|
||||||
$result = array_merge($result, Tree::instance()->getTreeList(Tree::instance()->getTreeArray($n)));
|
$result = array_merge($result, Tree::instance()->getTreeList(Tree::instance()->getTreeArray($n['pid'])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$groupName = [];
|
$groupName = [];
|
||||||
|
|
@ -61,7 +61,6 @@ class Admin extends Backend
|
||||||
{
|
{
|
||||||
if ($this->request->isAjax())
|
if ($this->request->isAjax())
|
||||||
{
|
{
|
||||||
|
|
||||||
$childrenGroupIds = $this->childrenGroupIds;
|
$childrenGroupIds = $this->childrenGroupIds;
|
||||||
$groupName = AuthGroup::where('id', 'in', $childrenGroupIds)
|
$groupName = AuthGroup::where('id', 'in', $childrenGroupIds)
|
||||||
->column('id,name');
|
->column('id,name');
|
||||||
|
|
@ -75,7 +74,11 @@ class Admin extends Backend
|
||||||
if (isset($groupName[$v['group_id']]))
|
if (isset($groupName[$v['group_id']]))
|
||||||
$adminGroupName[$v['uid']][$v['group_id']] = $groupName[$v['group_id']];
|
$adminGroupName[$v['uid']][$v['group_id']] = $groupName[$v['group_id']];
|
||||||
}
|
}
|
||||||
|
$groups = $this->auth->getGroups();
|
||||||
|
foreach ($groups as $m => $n)
|
||||||
|
{
|
||||||
|
$adminGroupName[$this->auth->id][$n['id']] = $n['name'];
|
||||||
|
}
|
||||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||||
$total = $this->model
|
$total = $this->model
|
||||||
->where($where)
|
->where($where)
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class Group extends Backend
|
||||||
$this->childrenGroupIds = $this->auth->getChildrenGroupIds(true);
|
$this->childrenGroupIds = $this->auth->getChildrenGroupIds(true);
|
||||||
|
|
||||||
$groupList = collection(AuthGroup::where('id', 'in', $this->childrenGroupIds)->select())->toArray();
|
$groupList = collection(AuthGroup::where('id', 'in', $this->childrenGroupIds)->select())->toArray();
|
||||||
$groupIds = $this->auth->getGroupIds();
|
|
||||||
Tree::instance()->init($groupList);
|
Tree::instance()->init($groupList);
|
||||||
$result = [];
|
$result = [];
|
||||||
if ($this->auth->isSuperAdmin())
|
if ($this->auth->isSuperAdmin())
|
||||||
|
|
@ -40,9 +40,10 @@ class Group extends Backend
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach ($groupIds as $m => $n)
|
$groups = $this->auth->getGroups();
|
||||||
|
foreach ($groups as $m => $n)
|
||||||
{
|
{
|
||||||
$result = array_merge($result, Tree::instance()->getTreeList(Tree::instance()->getTreeArray($n)));
|
$result = array_merge($result, Tree::instance()->getTreeList(Tree::instance()->getTreeArray($n['pid'])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$groupName = [];
|
$groupName = [];
|
||||||
|
|
|
||||||
|
|
@ -180,24 +180,26 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
|
||||||
|
|
||||||
//绑定tabs事件,如果需要点击强制刷新iframe,则请将iframeForceRefresh置为true
|
//绑定tabs事件,如果需要点击强制刷新iframe,则请将iframeForceRefresh置为true
|
||||||
$('#nav').addtabs({iframeHeight: "100%", iframeForceRefresh: false});
|
$('#nav').addtabs({iframeHeight: "100%", iframeForceRefresh: false});
|
||||||
|
|
||||||
var addtabs = localStorage.getItem("addtabs");
|
|
||||||
if ($("ul.sidebar-menu li.active a").size() > 0) {
|
if ($("ul.sidebar-menu li.active a").size() > 0) {
|
||||||
$("ul.sidebar-menu li.active a").trigger("click");
|
$("ul.sidebar-menu li.active a").trigger("click");
|
||||||
} else {
|
} else {
|
||||||
$("ul.sidebar-menu li a[url!='javascript:;']:first").trigger("click");
|
$("ul.sidebar-menu li a[url!='javascript:;']:first").trigger("click");
|
||||||
}
|
}
|
||||||
if (addtabs) {
|
//如果是刷新操作则直接返回刷新前的页面
|
||||||
|
var addtabs = Config.referer ? localStorage.getItem("addtabs") : null;
|
||||||
|
if (Config.referer) {
|
||||||
|
if (Config.referer === $(addtabs).attr("url")) {
|
||||||
var active = $("ul.sidebar-menu li a[addtabs=" + $(addtabs).attr("addtabs") + "]");
|
var active = $("ul.sidebar-menu li a[addtabs=" + $(addtabs).attr("addtabs") + "]");
|
||||||
if (active.size() > 0) {
|
if (active.size() > 0) {
|
||||||
active.trigger("click");
|
active.trigger("click");
|
||||||
} else {
|
} else {
|
||||||
$(addtabs).appendTo(document.body).addClass("hide").trigger("click");
|
$(addtabs).appendTo(document.body).addClass("hide").trigger("click");
|
||||||
}
|
}
|
||||||
} else if (Config.referer) {
|
} else {
|
||||||
//刷新页面后跳到到刷新前的页面
|
//刷新页面后跳到到刷新前的页面
|
||||||
Backend.api.addtabs(Config.referer);
|
Backend.api.addtabs(Config.referer);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of all the available skins
|
* List of all the available skins
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue