Compare commits

...

4 Commits

Author SHA1 Message Date
Karson 0265c0b8ad 优化视图条件判断 2025-06-04 16:24:48 +08:00
Karson 91dea04a86 优化简洁菜单和多级菜单逻辑判断 2025-06-04 14:47:50 +08:00
Karson 77f10ce146 优化install.sql默认数据 2025-06-04 11:49:38 +08:00
Karson 346e3f8ffe 优化Favisible组件名称匹配模式 2025-06-04 11:49:18 +08:00
5 changed files with 25 additions and 4 deletions

View File

@ -261,6 +261,9 @@ INSERT INTO `fa_auth_rule` VALUES (81, 'file', 79, 'user/rule/del', 'Del', 'fa f
INSERT INTO `fa_auth_rule` VALUES (82, 'file', 79, 'user/rule/add', 'Add', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', 1491635035, 1491635035, 0, 'normal');
INSERT INTO `fa_auth_rule` VALUES (83, 'file', 79, 'user/rule/edit', 'Edit', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', 1491635035, 1491635035, 0, 'normal');
INSERT INTO `fa_auth_rule` VALUES (84, 'file', 79, 'user/rule/multi', 'Multi', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', 1491635035, 1491635035, 0, 'normal');
INSERT INTO `fa_auth_rule` VALUES (85, 'file', 3, 'category/dragsort', 'Dragsort', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', 1491635035, 1491635035, 0, 'normal');
INSERT INTO `fa_auth_rule` VALUES (86, 'file', 12, 'auth/rule/dragsort', 'Dragsort', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', 1491635035, 1491635035, 0, 'normal');
INSERT INTO `fa_auth_rule` VALUES (87, 'file', 79, 'user/rule/dragsort', 'Dragsort', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', 1491635035, 1491635035, 0, 'normal');
COMMIT;
-- ----------------------------

View File

@ -39,6 +39,10 @@ class Index extends Backend
config('fastadmin.' . $key, $cookieValue);
}
}
//如同时启用简洁和多级菜单,简洁菜单将失效
if (config('fastadmin.simplenav') && config('fastadmin.multiplenav')) {
config('fastadmin.simplenav', false);
}
//左侧菜单
list($menulist, $navlist, $fixedmenu, $referermenu) = $this->auth->getSidebar([
'dashboard' => 'hot',

View File

@ -32,7 +32,7 @@
<h4 class="control-sidebar-heading">{:__('Layout Options')}</h4>
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-config="simplenav" {if $Think.config.fastadmin.simplenav}checked{/if} class="pull-right"> {:__('Simple Nav')}</label><p>{:__("Simple nav tips")}</p></div>
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-config="multiplenav" {if $Think.config.fastadmin.multiplenav}checked{/if} class="pull-right"> {:__('Multiple Nav')}</label><p>{:__("Toggle the top menu state (multiple or single)")}</p></div>
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-config="multipletab" {if $Think.config.fastadmin.multipletab}checked{/if} class="pull-right"> {:__('Multiple Tab')}</label><p>{:__("Always show multiple tab when multiple nav is set")}</p></div>
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-config="multipletab" {if !$Think.config.fastadmin.multiplenav}disabled{/if} {if $Think.config.fastadmin.multipletab} checked{/if} class="pull-right"> {:__('Multiple Tab')}</label><p>{:__("Always show multiple tab when multiple nav is set")}</p></div>
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-layout="sidebar-collapse" class="pull-right"> {:__('Toggle Sidebar')}</label><p>{:__("Toggle the left sidebar's state (open or collapse)")}</p></div>
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-enable="expandOnHover" class="pull-right"> {:__('Sidebar Expand on Hover')}</label><p>{:__('Let the sidebar mini expand on hover')}</p></div>
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-menu="show-submenu" class="pull-right"> {:__('Show sub menu')}</label><p>{:__('Always show sub menu')}</p></div>

View File

@ -335,10 +335,13 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
}, 0);
});
// 切换简洁模式菜单
// 切换简洁菜单
$(document).on("click", "[data-config='simplenav']", function () {
var value = $(this).prop("checked") ? 1 : 0;
createCookie('simplenav', value);
if ($("[data-config='multiplenav']").prop("checked")) {
createCookie('multiplenav', 0);
}
location.reload();
});
@ -346,6 +349,9 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
$(document).on("click", "[data-config='multiplenav']", function () {
var value = $(this).prop("checked") ? 1 : 0;
createCookie('multiplenav', value);
if ($("[data-config='simplenav']").prop("checked")) {
createCookie('simplenav', 0);
}
location.reload();
});

View File

@ -540,7 +540,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
var checkCondition = function (condition) {
var conditionArr = condition.split(/&&/);
var success = 0;
var baseregex = /^([a-z0-9\_]+)([>|<|=|\!]=?)(.*)$/i, strregex = /^('|")(.*)('|")$/, regregex = /^regex:(.*)$/;
var baseregex = /^([a-z0-9\_\[\]]+)([>|<|=|\!]=?)(.*)$/i, strregex = /^('|")(.*)('|")$/, regregex = /^regex:(.*)$/;
// @formatter:off
var operator_result = {
'>': function (a, b) {
@ -595,7 +595,15 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
operator = 'regex';
value = regmatches[1];
}
var chkname = "row[" + name + "]";
var chkname;
if (name.match(/[\[\]]+/)) {
chkname = name;
} else {
chkname = "row[" + name + "]";
if (typeof dataObj[chkname] === 'undefined' && typeof dataObj[name] !== 'undefined') {
chkname = name;
}
}
if (typeof dataObj[chkname] === 'undefined') {
return false;
}