impl:完善项目
parent
f2f0a1394e
commit
0b2244132d
|
|
@ -1,6 +1,10 @@
|
|||
var okConfig = {
|
||||
theme: "blue_theme", //主题色orange_theme|blue_theme
|
||||
menuArrow: "ok-arrow2", //导航箭头ok-arrow2|ok-arrow3,不填为默认样式
|
||||
isTabMenu: true, //刷新后是否记住上次打开tab菜单
|
||||
isTabRefresh: false, //是否开启切换刷新
|
||||
};
|
||||
// 主题色orange_theme|blue_theme
|
||||
theme: "blue_theme",
|
||||
// 导航箭头ok-arrow2|ok-arrow3,不填为默认样式
|
||||
menuArrow: "ok-arrow2",
|
||||
//刷新后是否记住上次打开tab菜单
|
||||
isTabMenu: true,
|
||||
// 是否开启切换刷新
|
||||
isTabRefresh: false
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,53 +1,52 @@
|
|||
var ok_load_options = {
|
||||
time: 1000,
|
||||
content: "ok-admin..."
|
||||
time: 1000,
|
||||
content: "ok-admin..."
|
||||
};
|
||||
|
||||
!function (content, options) {
|
||||
var load_config = localStorage.getItem("okConfig") || window.okConfig || {};
|
||||
var load_config = localStorage.getItem("okConfig") || window.okConfig || {};
|
||||
|
||||
if (typeof load_config == "string") {
|
||||
load_config = JSON.parse(load_config);
|
||||
}
|
||||
if (typeof load_config == "string") {
|
||||
load_config = JSON.parse(load_config);
|
||||
}
|
||||
|
||||
function templateFun(options) {
|
||||
return "<div class='ok-loading ${config.theme}'>" +
|
||||
"<div class='ball-loader'>" +
|
||||
"<span></span><span></span><span></span><span></span>" +
|
||||
"</div>" +
|
||||
"</div>";
|
||||
}
|
||||
function templateFun(options) {
|
||||
return "<div class='ok-loading ${config.theme}'>" +
|
||||
"<div class='ball-loader'>" +
|
||||
"<span></span><span></span><span></span><span></span>" +
|
||||
"</div>" +
|
||||
"</div>";
|
||||
}
|
||||
|
||||
function headerInit(content, options) {
|
||||
options = options || {};
|
||||
if (typeof content == "string") {
|
||||
options["content"] = content || ok_load_options.content;
|
||||
} else if (typeof content == "object") {
|
||||
options = content;
|
||||
}
|
||||
options.time = options.time || ok_load_options.time;
|
||||
options.content = options.content || ok_load_options.content;
|
||||
return options;
|
||||
}
|
||||
function headerInit(content, options) {
|
||||
options = options || {};
|
||||
if (typeof content == "string") {
|
||||
options["content"] = content || ok_load_options.content;
|
||||
} else if (typeof content == "object") {
|
||||
options = content;
|
||||
}
|
||||
options.time = options.time || ok_load_options.time;
|
||||
options.content = options.content || ok_load_options.content;
|
||||
return options;
|
||||
}
|
||||
|
||||
ok_load_options = headerInit(content, options);
|
||||
var template = templateFun(ok_load_options);
|
||||
document.writeln(template);
|
||||
ok_load_options = headerInit(content, options);
|
||||
var template = templateFun(ok_load_options);
|
||||
document.writeln(template);
|
||||
}();
|
||||
|
||||
var okLoading = {
|
||||
close: function (time, dom) {
|
||||
time = time || ok_load_options.time;
|
||||
dom = dom || document.getElementsByClassName("ok-loading")[0];
|
||||
var setTime1 = setTimeout(function () {
|
||||
clearTimeout(setTime1);
|
||||
dom.classList.add("close");
|
||||
var setTime2 = setTimeout(function () {
|
||||
clearTimeout(setTime2);
|
||||
dom.parentNode.removeChild(dom);/**删除当前节点*/
|
||||
}, 800);
|
||||
}, time);
|
||||
}
|
||||
close: function (time, dom) {
|
||||
time = time || ok_load_options.time;
|
||||
dom = dom || document.getElementsByClassName("ok-loading")[0];
|
||||
var setTime1 = setTimeout(function () {
|
||||
clearTimeout(setTime1);
|
||||
dom.classList.add("close");
|
||||
var setTime2 = setTimeout(function () {
|
||||
clearTimeout(setTime2);
|
||||
// 删除当前节点
|
||||
dom.parentNode.removeChild(dom);
|
||||
}, 800);
|
||||
}, time);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@
|
|||
|
||||
laydate.render({elem: "#startTime", type: "datetime"});
|
||||
laydate.render({elem: "#endTime", type: "datetime"});
|
||||
|
||||
let userTable = table.render({
|
||||
elem: '#tableId',
|
||||
url: okMock.api.listUser,
|
||||
|
|
@ -252,7 +253,7 @@
|
|||
<a href="javascript:" title="编辑" lay-event="edit"><i class="layui-icon"></i></a>
|
||||
<a href="javascript:" title="删除" lay-event="del"><i class="layui-icon"></i></a>
|
||||
</script>
|
||||
<!-- 启用|停用模板 -->
|
||||
|
||||
<script type="text/html" id="statusTpl">
|
||||
{{# if(d.status == 0){ }}
|
||||
<span class="layui-btn layui-btn-normal layui-btn-xs">启用</span>
|
||||
|
|
@ -260,6 +261,7 @@
|
|||
<span class="layui-btn layui-btn-warm layui-btn-xs">停用</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="roleTpl">
|
||||
{{# if(d.role == 0){ }}
|
||||
<span class="layui-btn layui-btn-normal layui-btn-xs">超级会员</span>
|
||||
|
|
|
|||
Loading…
Reference in New Issue