|
- <% layout('/layouts/default.html', {title: '首页', bodyClass: ''}){ %>
- <% } %>
- <link rel="stylesheet" href="${ctxStatic}/css/iconfont.css"/>
- <link rel="stylesheet" href="${ctxStatic}/css/layui.css" media="all">
- <link rel="stylesheet" href="${ctxStatic}/css/lessPackage/index/index.css" media="all">
- <style>
- body .layui-side .layui-nav {
- background-color: #344154 !important;
- }
-
- .logo-text{
- letter-spacing: 4px !important;
- font-size: 28px !important;
- font-family: cursive !important;
- }
-
- #myFrame html body{
- height: 100%;
- }
- </style>
- <body class="layui-layout-body">
- <div class="layui-layout layui-layout-admin">
- <div class="layui-header" style="background-color: rgb(52 65 83) !important;">
-
- <div class="layui-logo" style="background-color: #344154;height:60px;">
- <div class="logo_text" style="letter-spacing: 2px !important;font-size: 16px !important;font-family: system-ui !important;">${(isNotBlank(title!) ? title! + ' - ' : '') + @Global.getConfig('productName')}</div>
- </div>
- <div class="top_title" style="background-color: rgb(52 65 83);padding-left: 214px;line-height: 55px;">
- <i class="iconfont leftIcon icon-mianbaoxie" style="color: #f8f8f8;margin-right: 0 !important;"></i>
- <span id="breadnav_0" class="layui-breadcrumb" style="margin-left:10px; display:none;">
- <a href="/sso/logout">首页</a>
- <span style="margin-left:10px; color:#999;">></span>
- </span>
- <span id="breadnav_1" class="layui-breadcrumb"></span>
- <span id="breadnav_2" class="layui-breadcrumb" ></span>
- <span id="breadnav_3" class="layui-breadcrumb" ></span>
- </div>
- <div class="pull-left" id="title_extend" style="display:none;background-color: rgb(52 65 82);height:60px;width:20%;height:100%;"></div>
- <ul class="layui-nav layui-layout-right herder-right">
- <li class="layui-nav-item" id="msgLi">
- <a id="msg_center" href="javascript:;" style="color:grey;">
- <img class="default_notice" src="${ctxStatic}/images/notice.png" alt="消息通知" title="消息通知" width="24" />
- <img class="new_notice" src="${ctxStatic}/images/notice-new.png" alt="新的消息通知" title="新的消息通知" width="24" style="display:none" />
- </a>
- </li>
- <li class="layui-nav-item">
- <a href="javascript:;">
- <i class="iconfont icon-zhanghaoguanli" id="change-psd-select" ></i>
- <div class="userInfo" >
- <div class="userName" >${user.loginCode}</div>
- <div class="userType" >${user.userName}</div>
- </div>
- </a>
- <dl class="layui-nav-child layui-anim layui-anim-upbit" style="min-width:135px !important;left:68px;">
- <dd>
- <a id="editPwd" href="javascript:;">修改密码</a>
- </dd>
- <dd>
- <a href="${ctx}/logout">退出登录</a>
- </dd>
- </dl>
- </li>
- </ul>
- </div>
- <div class="layui-side layui-bg-black">
- <div class="layui-side-scroll">
- <!-- 左侧导航区域(可配合layui已有的垂直导航) -->
- <ul class="layui-nav layui-nav-tree" lay-filter="test" lay-shrink="all">
- <%
- var menuList_0 = @UserUtils.getMenuListByParentCode('0');
- for(menu_0 in menuList_0){
- var menuCode = menu_0.menuCode;
- if(@menu_0.getIsMenu() && @menu_0.getIsShow()=='1'){
- if(menu_0.menuHref != ''){
- var url_0 = '/console' + menu_0.menuHref;
- print('<li class="layui-nav-item" ><a id="a_' + menuCode + '" onclick="addNav_1(this)" target="myFrame" href=' + url_0 + '><i class="iconfont leftIcon ' + menu_0.menuIcon + '"></i>' + menu_0.menuNameOrig + '</a></li>');
- } else {
- var url_0 = 'javascript:;';
- print('<li class="layui-nav-item" ><a id="a_' + menuCode + '" onclick="addNav_1(this)" target="myFrame" href=' + url_0 + '><i class="iconfont leftIcon ' + menu_0.menuIcon + '"></i>' + menu_0.menuNameOrig + '</a>');
- print('<dl id="' + menuCode + '" class="layui-nav-child">');
- var menuList_1 = @UserUtils.getMenuListByParentCode(menuCode);
- for(menu_1 in menuList_1){
- if(@menu_1.getIsMenu() && @menu_1.getIsShow()=='1'){
- var url_1 = '/console' + menu_1.menuHref;
- var icon_1 = 'square';
- if (@StringUtils.isNotEmpty(menu_1.menuIcon)) {
-
- icon_1 = " pl10 leftIcon "+menu_1.menuIcon;
- }
-
- print('<dd><a onclick="addNav_2(this)" target="myFrame" href=' + url_1 + '><i class="iconfont '+icon_1+'"></i>' + menu_1.menuNameOrig + '</a></dd>');
- }
- }
- print('</dl>');
- print('</li>');
- }
- }
- }
- %>
- </ul>
- </div>
- </div>
- <div class="layui-body" style="overflow: hidden !important;">
-
- <!-- 内容主体区域 -->
- <iframe id="myFrame" name="myFrame" scrolling="yes" frameborder="0" style="width:100%;height:100%;"></iframe>
- </div>
- </div>
- </body>
-
- <style>
- #msgLi .layui-nav-more{
- display: none;
- }
- .layui-nav-tree .layui-nav-bar{
- background-color: #FF0000 !important;
- }
- .layui-side .layui-nav .layui-nav-more{
- background: url(${ctxStatic}/images/index/left-bottom.png) no-repeat;
- background-size: 100% 100%;
- }
- .layui-nav .layui-nav-mored,.layui-side .layui-nav-itemed>a .layui-nav-more {
- background: url(${ctxStatic}/images/index/left-top.png) no-repeat;
- background-size: 100% 100%;
- }
- .layui-header .layui-nav .layui-nav-more{
- background: url(${ctxStatic}/images/index/top-bottom.png) no-repeat;
- background-size: 100% 100%;
- }
- .layui-header .layui-nav .layui-nav-mored{
- background: url(${ctxStatic}/images/index/top-top.png) no-repeat;
- background-size: 100% 100%;
- }
- .layui-breadcrumb a{
- font-size: 14px !important;
- color: #f8f8f8 !important
- }
- .layui-breadcrumb a:hover{
- color: #FF0000 !important;
- }
- .layui-breadcrumb-img{
- display: inline-block;
- width: 6px;
- height: 8px;
- background: url(${ctxStatic}/images/index/layui-breadcrumb-img.png) no-repeat;
- background-size: 100% 100%;
- }
- .layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree .layui-nav-itemed:after{
- background-color: none !important;
- width: 0px !important;
- }
- #isValidCodeLogin .input-group-addon:nth-of-type(1){
- display: none;
- }
- #canvas{
- border: 1px solid #D2D2D2;
- border-left: none;
- }
- .layui-form{
- margin-top:-20px;
- }
- .layui-layer-msg{
- z-index:19992000 !important;
- }
-
- .layui-side{
- background-color: #191919 !important;
- }
-
- </style>
- <div id="edit_password_layer" class="layui_pop" style="display: none;">
- <div class="layui-form-item layui_pop_header">
- <div class="layui_header_title">设置新密码</div>
- <div class="layui_header_close"></div>
- </div>
- <form class="layui-form" action="">
- <div class="layui-form-item" style="margin-bottom:5px;">
- <label class="layui-form-label">输入原密码</label>
- <div class="layui-input-block add-delete-btn">
- <input id="oldPwd" name="oldPwd" type="password" placeholder="请输入原密码" autocomplete="off" class="layui-input">
- <i class="layui-icon reset_input"></i>
- <i class="iconfont eye-show do-icon" value=true></i>
- </div>
- </div>
- <div class="layui-form-item" style="margin-bottom:5px;">
- <label class="layui-form-label">输入新密码</label>
- <div class="layui-input-block add-delete-btn">
- <input id="firstPwd" type="password" placeholder="请输入新密码" lay-verify="required|pwd" autocomplete="off" class="layui-input">
- <i class="layui-icon reset_input"></i>
- <i class="iconfont eye-show do-icon" value=true></i>
- </div>
- </div>
- <div class="layui-form-item" style="margin-bottom:5px;">
- <label class="layui-form-label" >再次确认</label>
- <div class="layui-input-block add-delete-btn">
- <input id="secondPwd" type="password" name="newPwd" lay-verify="required|same" placeholder="请再次确认密码" autocomplete="off" class="layui-input">
- <i class="layui-icon reset_input"></i>
- <i class="iconfont eye-show do-icon" value=true></i>
- </div>
- <div style="color: #FF0000;height: 13px;margin-bottom: 15px;margin-top:10px;margin-left:63px;font-size:12px"><span id="add_remind">密码需要8-16位,包含大小写字母、数字和特殊字符(! 或 @ 或 _)</span></div>
- </div>
- <div class="layui-form-item layui-fotter">
- <div class="layui-input-block ">
- <button id="cancel" type="button" class="button black center">取消</button>
- <button class="button red center" lay-submit lay-filter="pwdForm">确认</button>
- </div>
- </div>
- </form>
- </div>
-
- <script>
- //JavaScript代码区域
- layui.use('element', function(){
- var element = layui.element;
-
- });
-
- document.getElementById("a_1022389289833586688").click();
- $('#a_1022389289833586688').parent().addClass('layui-this');
-
- //动态设定iframe高度
- var hAll = $(".layui-body").height();
- var hTop = $(".top_title").outerHeight(true);
- // $("#myFrame").css("height",hAll-hTop-3);
- var layerIndex = '';
- var show_num = [];
- layui.use(['layer','form'], function(){
- var layer = layui.layer;
- var form = layui.form;
- form.verify({
- pwd: [
- /^.*(?=.{8,16})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@_]).*$/,
- '密码不符合规则!'
- ],
- same: function(value, item){
- if(value != $('#firstPwd').val()){
- return '两次输入的密码不相同,请检查后重新输入。';
- }
- },
- });
- form.on('submit(pwdForm)', function(data){
- $.post("${ctx}/sys/index/edit-password", data.field, function(res){
- res = JSON.parse(res);
- js.showMessage(res.message);
- if(res.result == Global.TRUE){
- window.location.href = "${ctx}/logout";
- }
- });
- return false;
- });
- $('#editPwd').off('click').on('click',function(){
- layerIndex = layer.open({
- type: 1
- ,title: false
- ,area: ['550px', '290px']
- ,shade: 0.5
- ,maxmin: false
- ,scrollbar: false
- ,closeBtn: 0
- ,content: $('#edit_password_layer')
- });
- $("#validCode").focus();
- });
-
- $('#cancel').click(function(){
- $('#oldPwd').val('');
- $('#firstPwd').val('');
- $('#secondPwd').val('');
- layer.close(layerIndex);
- });
- $(".layui_header_close").on('click',function(){
- $('#oldPwd').val('');
- $('#firstPwd').val('');
- $('#secondPwd').val('');
- layer.close(layerIndex);
- });
- });
-
- $("#canvas").on('click', function () {
- draw(show_num);
- })
- //改变密码框的显示与隐藏
- $(".do-icon").off('click').on('click',function(){
- if( $(this).hasClass("eye-show") ){
- $(this).removeClass("eye-show")
- .addClass("eye-close")
- .siblings("input").attr("type","text");
-
- }else if( $(this).hasClass("eye-close") ){
- $(this).removeClass("eye-close")
- .addClass("eye-show")
- .siblings("input").attr("type","password");
- }
- })
- <!--获取用户信息来判断账号类型,以及是否提示用户去修改密码-->
- var getUsername = function(){
- var password = window.localStorage.getItem("password");
- if( password == "123456" ){
- layerIndex = layer.open({
- type: 1
- ,title: false
- ,area: ['550px', '290px']
- ,shade: 0.5
- ,maxmin: false
- ,scrollbar: false
- ,closeBtn: 0
- ,content: $('#edit_password_layer')
- });
- }
- }();
- <!--清空input框-->
- $("input").focus(function(){
- $(this).parent().children(".reset_input").show();
- });
- $("input").blur(function(){
- if($(this).val()=='')
- {
- $(this).parent().children(".reset_input").hide();
- }
- });
- $(".reset_input").click(function(){
- $(this).parent().find('input').val('');
- $(this).hide();
- });
- $(".layui-logo").click(function(){
- window.location.reload();
- });
-
- $("#msg_center").click(function(){
- $(".top_title").hide();
- $(".layui-side").hide();
- $(".layui-body").css("left","0px");
- $("#title_extend").show();
- openPage("消息中心", "${ctx}/sys/message/list", 1);
- });
-
- // var audioDom = new Audio("${ctxStatic}/audio/baojing2.mp3");
- function getMsg(){
- $.get("${ctx}/sys/message/query-new-msg", function(result){
- var unreadNum = result.data.unreadNum;
- var msgList = result.data.newMsg == undefined ? 0 : result.data.newMsg;
- var deg = result.data.deg;
- <!--更新未读消息角标-->
- if(unreadNum > 0) {
- $(".default_notice").hide();
- $(".new_notice").show();
- } else {
- $(".default_notice").show();
- $(".new_notice").hide();
- }
- <!--新消息弹框-->
- for(var i=0; i<msgList.length; i++){
- layer.msg(msgList[i].msgContentEntity.content, {
- icon: 6
- });
- }
-
-
-
- if (deg) {
- openErrorModal("异常提醒",deg.occurTime+":"+deg.deviceId+" "+deg.deviceEventType.name+(deg.memo?"("+deg.memo+")":""));
-
- //audioDom.setAttribute("loop", true);
- //audioDom.play();
-
- setTimeout(function (){
- // audioDom.setAttribute("loop", false);
- // audioDom.pause();
- }, 8000)
-
- }
-
-
- });
- }
-
- function updateToRead(id){
- js.ajaxSubmit(
- '${ctx}/sys/message/read-msg',
- {
- "msgId":id,
- },
- function(res){
- js.showMessage(res.message);
- }
- );
- }
-
- getMsg();
- var ref = setInterval(function(){
- getMsg();
- },10000);
-
-
-
- var id = null;
- /*function myModal() {
- /!*$.ajax("/console/sys/gateEvent/fetchData",{
- method:"get", async:false, data:{id:id}, dataType:"json", success:function (data){
- console.log(data);
- }
- })
- return;
- *!/
-
- if (modalFlag>0) {
- layer.close(modalFlag);
- }
- /!*var d = new Date();
- var n = d.getHours();*!/
- openErrorModal("异常提醒",dateFormat("YYYY-mm-dd HH:MM:SS", new Date())+":GATE003 异常闯入;");
- }
- setInterval(myModal, 5000);*/
-
- var modalFlag = 0;
- function openErrorModal(title, content){
- modalFlag = layer.open({
- type: 0,
- title: title,
- closeBtn: 0, //不显示关闭按钮
- shade: [0],
- btn:["查看详情",'关闭'],
- shadeClose:true,
- area: ['340px', '160px'],
- offset: 'rb', //右下角弹出
- time: 0, //2秒后自动关闭
- anim: 2,
- skin:"layui-layer-molv",
- yes:function(adjustPage,layero){ //yes对应第一个按钮“确定”
- //do something
- //添加完毕,关闭当前页面
- /*window.location.href="/console/sys/gateEvent/list"
-
- openPage("消息中心", "${ctx}/sys/gateEvent/list", 1);*/
- // audioDom.pause();
- layer.closeAll();
- layer.open({
- type: 2,
- title: '设备日志',
- shadeClose: true,
- shade: false,
- maxmin: true, //开启最大化最小化按钮
- area: ['100%', '100%'],
- content: '${ctx}/sys/gateEvent/list', //最大化页面
- success: function(layero,index){
- //在回调方法中的第2个参数“index”表示的是当前弹窗的索引。
- //通过layer.full方法将窗口放大。
- layer.full(index);
- }
- });
-
-
- },
- btn2:function(){
- // audioDom.pause();
- },
-
- content: '<div style="margin-right: 10px;color: red;"><p>'+content+'</p></div>', //iframe的url,no代表不显示滚动条 右下角页面
-
- });
- }
- </script>
|