优化刷新机制,新增搜索框

pull/1/head
wangziyangyang 2020-03-24 14:05:16 +08:00
parent aba6f46cc4
commit 49ac10515a
4 changed files with 53 additions and 29 deletions

View File

@ -30,7 +30,7 @@ layui.define(['layer'], function (exports) {
if (param.reload !== false) {
// 刷新父页面注意一定要在关闭当前iframe层之前执行刷新
parent.location.reload();
location.reload();
}
}
},

File diff suppressed because one or more lines are too long

View File

@ -46,10 +46,12 @@
<a href="javascript:;">admin</a>
<dl class="layui-nav-child">
<dd>
<a href="javascript:;" data-iframe-tab="page/user-setting.html" data-title="基本资料" data-icon="fa fa-gears">基本资料</a>
<a href="javascript:;" data-iframe-tab="page/user-setting.html" data-title="基本资料"
data-icon="fa fa-gears">基本资料</a>
</dd>
<dd>
<a href="javascript:;" data-iframe-tab="page/user-password.html" data-title="修改密码" data-icon="fa fa-gears">修改密码</a>
<a href="javascript:;" data-iframe-tab="page/user-password.html" data-title="修改密码"
data-icon="fa fa-gears">修改密码</a>
</dd>
<dd>
<a class="login-out" href="${request.contextPath}/login-ui">退出登录</a>
@ -61,11 +63,17 @@
</li>
</ul>
</div>
<div class="layui-side layui-bg-black">
<div class="layui-side-scroll layui-left-menu">
<form class="layui-form" style=" display: flex; flex-direction: column;">
<div class="layui-side layui-bg-black">
<div layui-left-menu style="height: 33px;">
<input name="search" type="text" placeholder="搜索..." class="layui-input layui-input-search"
autocomplete="off">
</div>
<div class="layui-side-scroll layui-left-menu">
</div>
<button class="layui-btn layui-hide" lay-submit lay-filter="js-search-filter">搜索</button>
</div>
</div>
</form>
<div class="layui-body">
<div class="layui-tab" lay-filter="splayuiTab" id="top_tabs_box">
@ -76,8 +84,10 @@
<li class="layui-nav-item">
<a href="javascript:;"> <i class="fa fa-dot-circle-o"></i> 页面操作</a>
<dl class="layui-nav-child">
<dd><a href="javascript:;" data-page-close="other"><i class="fa fa-window-close"></i> 关闭其他</a></dd>
<dd><a href="javascript:;" data-page-close="all"><i class="fa fa-window-close-o"></i> 关闭全部</a></dd>
<dd><a href="javascript:;" data-page-close="other"><i class="fa fa-window-close"></i> 关闭其他</a>
</dd>
<dd><a href="javascript:;" data-page-close="all"><i class="fa fa-window-close-o"></i> 关闭全部</a>
</dd>
</dl>
</li>
</ul>
@ -89,12 +99,21 @@
</div>
</div>
<script>
layui.use(['element', 'layer', 'spLayui'], function () {
layui.use(['element', 'layer', 'spLayui', 'form'], function () {
var element = layui.element,
layer = layui.layer,
spLayui = layui.spLayui;
spLayui = layui.spLayui,
form = layui.form;
spLayui.init('${request.contextPath}/admin/list/index/menu/tree');
form.on('submit(js-search-filter)', function (data) {
console.log(data.elem) //被执行事件的元素DOM对象一般为button对象
console.log(data.form) //被执行提交的form对象一般在存在form标签时才会返回
console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
// 阻止表单跳转。如果需要表单跳转,去掉这段即可。
return false;
});
});
</script>
</body>

View File

@ -11,44 +11,48 @@
<meta name="format-detection" content="telephone=no">
<#include "${request.contextPath}/common/common.ftl">
<style type="text/css">
html,body{
height:100%;
html, body {
height: 100%;
}
</style>
</head>
<style>
.splayUi-container {
background-size: 100% 100%;
-moz-background-size:100% 100%;
background-image: url(/image/hk.png) ;
height: 98.5%;
-moz-background-size: 100% 100%;
background-image: url(/image/hk.png);
height: 97%;
width: 100%;
position: relative;
display: flex;
}
.box {
display: inline-flex;
.flexBox {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.wrap {
flex-wrap: wrap;
display: flex;
align-items:stretch;
.wrap {
flex-direction: column;
display: flex;
}
</style>
<body >
<body>
<div class="wrap" style="height: 100%">
<div class="splayUi-container">
</div>
<div class=" box">
<b>开发者:王子杨</b>
<div class="box" id="div_timer">
<div class="flexBox">
<div>
<b>开发者:王子杨</b>
</div>
<div id="div_timer" style="margin-left:auto">
</div>
</div>
</div>
<script type="text/javascript">
//获取系统时间
showTime();
function showTime() {
nowtime = new Date();
year = nowtime.getFullYear();//年
@ -57,10 +61,11 @@
hour = nowtime.getHours();//时
minutes = nowtime.getMinutes();//分
seconds = nowtime.getSeconds();//秒//文字增加空格
document.getElementById("div_timer").style = "white-space:pre;";//显示时间
document.getElementById("div_timer").innerText = '当前时间:' + year + "." + p(month) + "." + p(day) + " " + p(hour) + ":" + p(minutes) + ":" + p(seconds);
}
setInterval("showTime()", 1000);
// setInterval("showTime()", 1000);
//月日时分秒小于10补0
function p(s) {
return s < 10 ? '0' + s : s;