mirror of https://gitee.com/karson/fastadmin.git
Compare commits
5 Commits
76abb2dcd7
...
a9a6065fde
| Author | SHA1 | Date |
|---|---|---|
|
|
a9a6065fde | |
|
|
6a94a07903 | |
|
|
5bf63c557b | |
|
|
5d3d667143 | |
|
|
8a0e8b1d3b |
|
|
@ -371,8 +371,7 @@ class Auth extends \fast\Auth
|
||||||
$childrenAdminIds = [];
|
$childrenAdminIds = [];
|
||||||
if (!$this->isSuperAdmin()) {
|
if (!$this->isSuperAdmin()) {
|
||||||
$groupIds = $this->getChildrenGroupIds(false);
|
$groupIds = $this->getChildrenGroupIds(false);
|
||||||
$authGroupList = \app\admin\model\AuthGroupAccess::
|
$authGroupList = \app\admin\model\AuthGroupAccess::field('uid,group_id')
|
||||||
field('uid,group_id')
|
|
||||||
->where('group_id', 'in', $groupIds)
|
->where('group_id', 'in', $groupIds)
|
||||||
->select();
|
->select();
|
||||||
foreach ($authGroupList as $k => $v) {
|
foreach ($authGroupList as $k => $v) {
|
||||||
|
|
@ -418,7 +417,6 @@ class Auth extends \fast\Auth
|
||||||
$titleArr[$pathArr[$rule['name']]] = $rule['title'];
|
$titleArr[$pathArr[$rule['name']]] = $rule['title'];
|
||||||
$menuArr[$pathArr[$rule['name']]] = $rule;
|
$menuArr[$pathArr[$rule['name']]] = $rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
ksort($menuArr);
|
ksort($menuArr);
|
||||||
$this->breadcrumb = $menuArr;
|
$this->breadcrumb = $menuArr;
|
||||||
|
|
@ -444,9 +442,9 @@ class Auth extends \fast\Auth
|
||||||
foreach ($params as $k => $v) {
|
foreach ($params as $k => $v) {
|
||||||
$url = $k;
|
$url = $k;
|
||||||
if (is_array($v)) {
|
if (is_array($v)) {
|
||||||
$nums = isset($v[0]) ? $v[0] : 0;
|
$nums = $v[0] ?? 0;
|
||||||
$color = isset($v[1]) ? $v[1] : $colorArr[(is_numeric($nums) ? $nums : strlen($nums)) % $colorNums];
|
$color = $v[1] ?? $colorArr[(is_numeric($nums) ? $nums : strlen($nums)) % $colorNums];
|
||||||
$class = isset($v[2]) ? $v[2] : 'label';
|
$class = $v[2] ?? 'label';
|
||||||
} else {
|
} else {
|
||||||
$nums = $v;
|
$nums = $v;
|
||||||
$color = $colorArr[(is_numeric($nums) ? $nums : strlen($nums)) % $colorNums];
|
$color = $colorArr[(is_numeric($nums) ? $nums : strlen($nums)) % $colorNums];
|
||||||
|
|
@ -485,7 +483,7 @@ class Auth extends \fast\Auth
|
||||||
}
|
}
|
||||||
$v['icon'] = $v['icon'] . ' fa-fw';
|
$v['icon'] = $v['icon'] . ' fa-fw';
|
||||||
$v['url'] = isset($v['url']) && $v['url'] ? $v['url'] : '/' . $module . '/' . $v['name'];
|
$v['url'] = isset($v['url']) && $v['url'] ? $v['url'] : '/' . $module . '/' . $v['name'];
|
||||||
$v['badge'] = isset($badgeList[$v['name']]) ? $badgeList[$v['name']] : '';
|
$v['badge'] = $badgeList[$v['name']] ?? '';
|
||||||
$v['title'] = __($v['title']);
|
$v['title'] = __($v['title']);
|
||||||
$v['url'] = preg_match("/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i", $v['url']) ? $v['url'] : url($v['url']);
|
$v['url'] = preg_match("/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i", $v['url']) ? $v['url'] : url($v['url']);
|
||||||
$v['menuclass'] = in_array($v['menutype'], ['dialog', 'ajax']) ? 'btn-' . $v['menutype'] : '';
|
$v['menuclass'] = in_array($v['menutype'], ['dialog', 'ajax']) ? 'btn-' . $v['menutype'] : '';
|
||||||
|
|
|
||||||
|
|
@ -391,7 +391,7 @@ trait Backend
|
||||||
}
|
}
|
||||||
|
|
||||||
//导入文件首行类型,默认是注释,如果需要使用字段名称请使用name
|
//导入文件首行类型,默认是注释,如果需要使用字段名称请使用name
|
||||||
$importHeadType = isset($this->importHeadType) ? $this->importHeadType : 'comment';
|
$importHeadType = $this->importHeadType ?? 'comment';
|
||||||
|
|
||||||
$table = $this->model->getQuery()->getTable();
|
$table = $this->model->getQuery()->getTable();
|
||||||
$database = \think\Config::get('database.database');
|
$database = \think\Config::get('database.database');
|
||||||
|
|
@ -460,7 +460,7 @@ trait Backend
|
||||||
if ($has_admin_id) {
|
if ($has_admin_id) {
|
||||||
$auth = Auth::instance();
|
$auth = Auth::instance();
|
||||||
foreach ($insert as &$val) {
|
foreach ($insert as &$val) {
|
||||||
if (!isset($val['admin_id']) || empty($val['admin_id'])) {
|
if (empty($val['admin_id'])) {
|
||||||
$val['admin_id'] = $auth->isLogin() ? $auth->id : 0;
|
$val['admin_id'] = $auth->isLogin() ? $auth->id : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -269,7 +269,8 @@ class Backend extends Controller
|
||||||
$sort = $this->request->get("sort", !empty($this->model) && $this->model->getPk() ? $this->model->getPk() : 'id');
|
$sort = $this->request->get("sort", !empty($this->model) && $this->model->getPk() ? $this->model->getPk() : 'id');
|
||||||
$order = $this->request->get("order", "DESC");
|
$order = $this->request->get("order", "DESC");
|
||||||
$offset = $this->request->get("offset/d", 0);
|
$offset = $this->request->get("offset/d", 0);
|
||||||
$limit = $this->request->get("limit/d", 999999);
|
$limit = $this->request->get("limit/d", 0);
|
||||||
|
$limit = $limit ?: 999999;
|
||||||
//新增自动计算页码
|
//新增自动计算页码
|
||||||
$page = $limit ? intval($offset / $limit) + 1 : 1;
|
$page = $limit ? intval($offset / $limit) + 1 : 1;
|
||||||
if ($this->request->has("page")) {
|
if ($this->request->has("page")) {
|
||||||
|
|
|
||||||
|
|
@ -623,6 +623,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'cookie']
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Template.helper("__", __);
|
Template.helper("__", __);
|
||||||
|
tables = [];
|
||||||
Layer.confirm(Template("uninstalltpl", {addon: Config['addons'][name]}), {focusBtn: false, title: __("Warning")}, function (index, layero) {
|
Layer.confirm(Template("uninstalltpl", {addon: Config['addons'][name]}), {focusBtn: false, title: __("Warning")}, function (index, layero) {
|
||||||
uninstall(name, false, $("input[name='droptables']", layero).prop("checked"));
|
uninstall(name, false, $("input[name='droptables']", layero).prop("checked"));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
that.onCommonSearch();
|
that.onCommonSearch();
|
||||||
}, 0);
|
}, 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -591,7 +591,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
|
||||||
form.on("keyup change click configchange", "input,textarea,select", function () {
|
form.on("keyup change click configchange", "input,textarea,select", function () {
|
||||||
$("[data-favisible][data-favisible!='']", form).each(function () {
|
$("[data-favisible][data-favisible!='']", form).each(function () {
|
||||||
var visible = $(this).data("favisible");
|
var visible = $(this).data("favisible");
|
||||||
var groupArr = visible.split(/\|\|/);
|
var groupArr = visible ? visible.toString().split(/\|\|/) : [];
|
||||||
var success = 0;
|
var success = 0;
|
||||||
$.each(groupArr, function (i, j) {
|
$.each(groupArr, function (i, j) {
|
||||||
if (checkCondition(j)) {
|
if (checkCondition(j)) {
|
||||||
|
|
@ -610,7 +610,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
var validator = form.data('validator');
|
var validator = form.data('validator');
|
||||||
if (validator) {
|
if (validator) {
|
||||||
validator.options.ignore += ((validator.options.ignore ? ',' : '') + '[data-favisible] :hidden,[data-favisible]:hidden');
|
validator.options.ignore += ((validator.options.ignore ? ',' : '') + '.hidden[data-favisible] :hidden,.hidden[data-favisible]:hidden');
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue