修正 admin.js 代码
parent
5fedee6314
commit
7bd1f5eceb
|
|
@ -15,34 +15,34 @@ layui.define(['table', 'jquery', 'element', 'form', 'tab', 'menu', 'frame'],
|
||||||
|
|
||||||
var pearAdmin = new function() {
|
var pearAdmin = new function() {
|
||||||
|
|
||||||
this.render = function(option) {
|
this.render = function() {
|
||||||
var option = getData();
|
var param = getData();
|
||||||
this.menuRender(option);
|
this.keepLoad(param);
|
||||||
this.bodyRender(option);
|
this.logoRender(param);
|
||||||
this.keepLoad(option);
|
this.menuRender(param);
|
||||||
this.logoRender(option);
|
this.bodyRender(param);
|
||||||
this.themeRender(option);
|
this.themeRender(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logoRender = function(option) {
|
this.logoRender = function(param) {
|
||||||
$(".layui-logo .logo").attr("src", option.logo.image);
|
$(".layui-logo .logo").attr("src", param.logo.image);
|
||||||
$(".layui-logo .title").html(option.logo.title);
|
$(".layui-logo .title").html(param.logo.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.menuRender = function(option) {
|
this.menuRender = function(param) {
|
||||||
sideMenu = pearMenu.render({
|
sideMenu = pearMenu.render({
|
||||||
elem: 'sideMenu', //依赖容器
|
elem: 'sideMenu',
|
||||||
async: true, //数据形式
|
async: true,
|
||||||
theme: "dark-theme",
|
theme: "dark-theme",
|
||||||
height: '100%',
|
height: '100%',
|
||||||
control: option.menu.control ? 'control' : false, // control
|
control: param.menu.control ? 'control' : false, // control
|
||||||
defaultMenu: 1,
|
defaultMenu: 1,
|
||||||
defaultOpen: 0, //默认打开菜单
|
defaultOpen: 0,
|
||||||
accordion: option.menu.accordion,
|
accordion: param.menu.accordion,
|
||||||
url: option.menu.data, //数据地址
|
url: param.menu.data,
|
||||||
parseData: false
|
parseData: false
|
||||||
})
|
})
|
||||||
sideMenu.selectItem(option.menu.select);
|
sideMenu.selectItem(param.menu.select);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bodyRender = function(option) {
|
this.bodyRender = function(option) {
|
||||||
|
|
@ -129,15 +129,14 @@ layui.define(['table', 'jquery', 'element', 'form', 'tab', 'menu', 'frame'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.keepLoad = function(option) {
|
this.keepLoad = function(param) {
|
||||||
compatible()
|
compatible()
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$(".loader-main").fadeOut(option.done);
|
$(".loader-main").fadeOut(200);
|
||||||
}, option.other.keepLoad)
|
}, param.other.keepLoad)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.themeRender = function(option) {
|
this.themeRender = function(option) {
|
||||||
|
|
||||||
if (option.theme.allowCustom == false) {
|
if (option.theme.allowCustom == false) {
|
||||||
$(".setting").remove();
|
$(".setting").remove();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue