ming 4 лет назад
Родитель
Сommit
927c18cccf

+ 12 - 10
api/request.js

@@ -1,9 +1,9 @@
-// // 动态获取url
-// const BASEURL = getRequestPrefix();
+// 动态获取url
+const BASEURL = getRequestPrefix();
 
-// // 动态获取用户名密码
-// const LOGIN_NAME = sessionStorage.getItem('V_LOGINNAME');
-// const LOGIN_PASSWORD = sessionStorage.getItem('V_PASSWORD');
+// 动态获取用户名密码
+const LOGIN_NAME = sessionStorage.getItem('V_LOGINNAME');
+const LOGIN_PASSWORD = sessionStorage.getItem('V_PASSWORD');
 
 
 
@@ -14,12 +14,12 @@
 // //最新测试url
 // // const BASEURL = "http://121.40.217.77:8080/Device_Manager/";
 
-//本地调试url
-const BASEURL = "http://127.0.0.1:8080/Device_Manager/";
+// //本地调试url
+// const BASEURL = "http://127.0.0.1:8080/Device_Manager/";
 
-// 用户名、 密码
-const LOGIN_NAME = "admin";
-const LOGIN_PASSWORD = "e10adc3949ba59abbe56e057f20f883e";
+// // 用户名、 密码
+// const LOGIN_NAME = "admin";
+// const LOGIN_PASSWORD = "e10adc3949ba59abbe56e057f20f883e";
 
 
 
@@ -51,6 +51,8 @@ const MENU_ADD = "menu/addMenu"; //菜单新增
 const MENU_UPDATE = "menu/updateMenu"; //菜单编辑          
 const ROLE_AUTH_UPDATA = "user/updateRoleMenu"; //角色权限编辑
 
+const MENU_DETAIL_INFO = "menu/queryMenuInfo"; //菜单详情查询
+
 
 
 const SECURITY_LIST = "user/querySecurityMechanism"; //安全机制列表

+ 33 - 6
css/common.css

@@ -89,13 +89,10 @@ body {
     margin: 0;
     padding: 0;
     background: url(../images/bg.png) no-repeat #000;
-    background-size: 100% 100%;
+    background-size: 100% auto;
     line-height: 1.15;
     font-size: 0.2rem!important;
-    /* min-width:1280px;
-    min-height:700px;
-    height:100vh; */
-    /* background-size:contain; */
+    height: 100vh;
 }
 
 .color-green {
@@ -156,6 +153,9 @@ a.button {
     html {
         font-size: 42px !important
     }
+    body {
+        background-size: 100% 100%;
+    }
 }
 
 @media screen and (min-width:1920) {
@@ -539,6 +539,7 @@ li.parent_li ul li ul li {
     position: absolute;
     left: 0;
     bottom: .3rem;
+    bottom: 0;
     width: 100%;
     line-height: 22px
 }
@@ -869,4 +870,30 @@ border: 1px solid #ffffff;
 .pure-table-inner tr th:nth-child(5),
 .pure-table-inner tr td:nth-child(5) {
     width: 16%
-}
+}
+
+
+/* 占满屏幕 start */
+
+
+/* body {
+    height: 100%;
+    width: 100%;
+    overflow: hidden;
+    min-height: 723px;
+}
+
+.content-box {
+    width: 100%;
+    height: calc(100% - .9rem);
+    overflow: hidden;
+}
+
+.content-box .column3 {
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+} */
+
+
+/* 占满屏幕 end */

+ 29 - 5
css/index.css

@@ -40,7 +40,7 @@
         
         .panel {
             position: relative;
-    /*    //    background: rgba(255, 255, 255, .01) url(../images/line\(1\) .png);
+            /*    //    background: rgba(255, 255, 255, .01) url(../images/line\(1\) .png);
             background: rgba(255, 255, 255, .01) url(../images/line\(1\) .png);*/
             background-repeat: no-repeat;
             padding: 0 .1875rem .5rem;
@@ -84,7 +84,7 @@
             color: #fff;
             font-weight: 400;
             font-size: .2rem;
-            line-height: .5rem;
+            /* line-height: .5rem; */
             text-align: center
         }
         
@@ -95,7 +95,13 @@
         }
         
         table tr th {
-            background: rgba(3, 64, 128, .4)
+            background: rgba(3, 64, 128, .4);
+            /* padding: .0625rem; */
+        }
+        
+        table tr td {
+            padding: .0625rem;
+            line-height: 1.5
         }
         
         table tr:first-child th:first-child {
@@ -254,6 +260,9 @@
         
         .huan table {
             width: 100%;
+        }
+        
+        .huan>table {
             margin-top: 0.25rem;
         }
         
@@ -293,17 +302,32 @@
             width: 100%
         }
         
+        .no table th,
+        .no table td {
+            border-bottom: 1px solid rgba(0, 212, 233, .1);
+        }
+        
         .no tr td:first-child,
         .no tr th:first-child {
-            width: 1.5rem
+            width: 1rem
         }
         
         .no tr td:nth-child(2),
         .no tr th:nth-child(2) {
-            width: 2.5rem
+            width: 2.3rem
         }
         
         .no tr td:nth-child(3),
         .no tr th:nth-child(3) {
+            width: 1rem
+        }
+        
+        .no tr td:nth-child(4),
+        .no tr th:nth-child(4) {
+            width: 5rem
+        }
+        
+        .no tr td:nth-child(5),
+        .no tr th:nth-child(5) {
             width: 1.5rem
         }

+ 11 - 9
css/per-manage.css

@@ -3,11 +3,12 @@
 .mainbox {
     min-width: 1024px;
     max-width: 1920px;
-    padding: 0.8125rem 1.1rem 1rem .9rem;
+    /* padding: 0.8125rem 1.1rem 1rem .9rem; */
+    padding: 3.3% 5% 4% 4%;
     /* display: flex; */
-    /* height: 100%; */
-    height: 100vh;
-    min-height: 723px
+    height: 100%;
+    /* height: 100vh;
+    min-height: 723px */
     /* min-height: 10rem; */
 }
 
@@ -21,9 +22,9 @@
 
 .column3 {
     overflow: hidden;
-    /* height: 10rem; */
-    height: calc(100vh - 2.7rem);
-    min-height: 10.5rem;
+    height: 10rem;
+    /* height: calc(100vh - 2.7rem); */
+    /* min-height: 10.5rem; */
     position: relative;
 }
 
@@ -74,13 +75,14 @@
 
 .departlist-box,
 .memberbox {
-    /* border:1px solid red; */
     padding: 0.25rem;
+    /* padding: 20px 10px */
 }
 
 .departlist-box {
     width: 100%;
     padding: 0.25rem 0.25rem 0rem 0.1rem;
+    /* padding: 20px 10px 0 10px; */
 }
 
 .departtit,
@@ -204,7 +206,7 @@ ul.depart-opera {
     overflow: hidden;
     text-overflow: ellipsis;
     white-space: nowrap;
-    max-width: 100px;
+    max-width: 5rem;
     /* width: 0.3375rem */
 }
 

+ 3 - 21
index.html

@@ -48,7 +48,7 @@
         <div class="column">
 
             <div class="map">
-                 <iframe style="width:100%;height:100%" src='http://www.thingjs.com/s/ef7ee6a73896c01bda77e679?params=105b0f77fd24654d4eebc434e9'></iframe>
+                <iframe style="width:100%;height:100%" src='http://www.thingjs.com/s/ef7ee6a73896c01bda77e679?params=105b0f77fd24654d4eebc434e9'></iframe>
             </div>
             <div class="no panel">
                 <h2>实时告警信息</h2>
@@ -91,10 +91,7 @@
                 <h2>园区实时报警统计</h2>
 
                 <div class="total-squares">
-                    <!-- <div class="total-square">1</div>
-                    <div class="total-square">3</div>
-                    <div class="total-square">5</div>
-                    <div class="total-square">7</div> -->
+
                 </div>
                 <div class="yq-total">当前时间</div>
 
@@ -104,22 +101,7 @@
             <div class="panel huan right-bottom">
                 <h2>设备隐患处理</h2>
                 <ul id="pop">
-                    <!-- <li>
-                        <p class="num-huan color-green">3</p>
-                        <p class="des-huan">巡检人员数量</p>
-                    </li>
-                    <li>
-                        <p class="num-huan color-blue">10</p>
-                        <p class="des-huan">今日任务</p>
-                    </li>
-                    <li>
-                        <p class="num-huan color-red">0</p>
-                        <p class="des-huan">超时任务</p>
-                    </li>
-                    <li>
-                        <p class="num-huan color-yellow">8</p>
-                        <p class="des-huan">今日完成任务</p>
-                    </li> -->
+
 
                 </ul>
                 <div class="title-btn">异常设备数</div>

+ 27 - 2
js/auth-manage.js

@@ -53,7 +53,7 @@ function getMenuListDataAjax(queryParam = {}) {
             delete(item.perms)
 
             items += "<tr>" +
-                "<td class='status' data-perm=" + permSave + "  data-user='" + JSON.stringify(item) + "'></td>" +
+                "<td class='status' data-perm=" + permSave + "  data-user='" + JSON.stringify(item) + "' data-id='" + item.menuId + "'></td>" +
                 "<td>" + item.name + "</td>" +
                 "<td>" + statusMenu + "</td>" +
                 "<td>" + item.orderNum + "</td>" +
@@ -127,18 +127,43 @@ layui.use('layer', function() {
 
                 let userInfo = $('.pure-table tr').find('.checked').data('user');
                 let perm = $('.pure-table tr').find('.checked').data('perm');
+
                 var reg = new RegExp('\r\n', 'g');
 
                 $('.editMenuOut select[name=parented]').val(userInfo.parented)
                 $('.editMenuOut select[name=parentId]').val(userInfo.parentId)
                 $('.editMenuOut input[name=name]').val(userInfo.name)
                 $('.editMenuOut input[name=url').val(userInfo.url)
-                $('.editMenuOut textarea[name=perms').val(perm.replace(reg, '<br/>'))
+                    // $('.editMenuOut textarea[name=perms').val(perm.replace(reg, '<br/>'))
                 $('.editMenuOut select[name=type').val(userInfo.type)
                 $('.editMenuOut input[name=icon').val(userInfo.icon)
                 $('.editMenuOut input[name=orderNum').val(userInfo.orderNum)
                 $('.editMenuOut input[name=menuId').val(userInfo.menuId)
 
+
+                let id = $('.pure-table tr').find('.checked').data('id');
+                alert(id)
+
+                //获取详情信息
+                getMenuDetailInfo({ 'id': id });
+                //获取详情信息 ajax请求
+                function getMenuDetailInfo(queryParam = {}) {
+
+
+                    ajaxRequest(MENU_DETAIL_INFO, "POST", queryParam, function(result) {
+                        var data = result.data[0]
+                        console.log(data.url)
+                        $('.editMenuOut textarea[name=perms').val(data.perms)
+
+
+                    }, function(errorMsg) {
+                        alert("请求数据失败!");
+                    })
+                }
+
+
+
+
                 layerUpdateIndex = layer.open({
                     type: 1,
                     title: false,

+ 22 - 9
js/index.js

@@ -351,7 +351,7 @@ function getIndexDate(queryParam = {}) {
                 grid: {
                     // width: '100%',
                     top: '15%',
-                    right: '10%',
+                    right: '0%',
                     bottom: '10%',
                     left: '10%'
                 },
@@ -426,7 +426,7 @@ function getIndexDate(queryParam = {}) {
                         itemStyle: {
                             normal: {
                                 color: 'rgba(255, 255, 255, 0.15)',
-                                barBorderRadius: 6,
+                                // barBorderRadius: 6,
                             }
                         },
                         z: 0
@@ -510,9 +510,7 @@ function getIndexDate(queryParam = {}) {
 (function() {
     function getDate() {
         $.ajax({
-            //  type : "post",
-            // url : "data/pie.json", 
-            // data : {},
+
             url: "data/pie.json",
             type: "GET",
             dataType: "json", //返回数据格式为json
@@ -552,6 +550,7 @@ function getIndexDate(queryParam = {}) {
 
 //实时告警信息 (websocket实时推送)
 (function() {
+    var arrData = [];
     var wsUri = "wss://iot.usky.cn:55120";
 
     function initWebSocket() {
@@ -572,9 +571,23 @@ function getIndexDate(queryParam = {}) {
                 initWebSocket();
             };
             websocket.onmessage = function(evt) {
-                console.log("Received:", evt.data);
-                var jData = eval('(' + evt.data + ')');
-                alert(jData.dwtype)
+                var warningInfo = eval('(' + evt.data + ')');
+                if (warningInfo.dwtype) {
+                    arrData.push(warningInfo)
+                    console.log('arrData')
+                    console.log(arrData)
+                }
+                var items = '';
+                arrData.forEach(function(item, index) {
+                    items += ` <tr>
+                    <td>${index+1}</td>
+                    <td>${item.time}</td>
+                    <td>${item.dwtype}</td>
+                    <td> ${item.evtname} </td>
+                    <td>${item.insertid} </td>
+                </tr>`
+                })
+                $('.warning-info').html(items)
             };
             websocket.onerror = function(evt) {
                 console.log("Error:", evt.data);
@@ -585,5 +598,5 @@ function getIndexDate(queryParam = {}) {
             (function() {})()
         }
     }
-    // initWebSocket();
+    initWebSocket();
 })()

+ 64 - 2
js/userAccount.js

@@ -76,9 +76,10 @@ function getListDataAjax(queryParam = {}, pageNo = 1) {
 
 //按钮搜索
 $('#buttonClick').on('click', function() {
-    param1 = $('#userName').val()
     pageNo = 1;
     getListDataAjax(getSearchParamObj());
+
+    param1 = $('#userName').val()
 })
 
 //拼接搜索条件
@@ -474,4 +475,65 @@ function linkDep(element) {
             alert("请求数据失败!");
         })
     })
-}
+}
+
+
+// 导出 start
+$('.export').click(function() {
+    getDataExport({ "userName": param1, "roleId": 1 })
+})
+
+
+function getDataExport(queryParam = {}) {
+    // 输出base64编码
+    const base64 = s => window.btoa(unescape(encodeURIComponent(s)));
+    ajaxRequest(USER_EXPORT, "POST", queryParam, function(result) {
+        let data = result.data;
+        let newData = [];
+        data.forEach(function(item, index) {
+            let posName = "";
+            if (item.posname == 1) {
+                posName = "超级管理员"
+            } else if (item.posname == 2) {
+                posName = "普通员工"
+            }
+            let locked = item.locked ? '未锁定' : '锁定';
+            let time = getFormatDate(item.ctime.time)
+            newData.push({ truename: item.truename, sex: item.sex, posname: posName, time: time, addman: item.addman, locked: locked, wrongtimes: item.wrongtimes })
+        });
+        let str = '<tr style="text-align:center"><th>姓名</th><th>性别</th><th>用户身份</th><th>创建时间</th><th>创建人</th><th>锁定状态</th><th>错误次数</th></tr>';
+        // 循环遍历,每行加入tr标签,每个单元格加td标签
+        for (let i = 0; i < newData.length; i++) {
+            str += '<tr style="text-align:center">';
+            for (const key in newData[i]) {
+                // 增加\t为了不让表格显示科学计数法或者其他格式
+                str += `<td x:str>${ newData[i][key] + '\t'}</td>`;
+            }
+            str += '</tr>';
+        }
+        // Worksheet名
+        const worksheet = 'Sheet1'
+        const uri = 'data:application/vnd.ms-excel;base64,';
+
+        // 下载的表格模板数据
+        let template = `<html xmlns:o="urn:schemas-microsoft-com:office:office"
+          xmlns:x="urn:schemas-microsoft-com:office:excel"
+          xmlns="http://www.w3.org/TR/REC-html40">
+          <head><meta charset='UTF-8'><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>
+            <x:Name>${worksheet}</x:Name>
+            <x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>
+            </x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->
+            </head><body><table>${str}</table></body></html>`;
+
+        // 通过创建a标签实现
+        const link = document.createElement("a");
+        link.href = uri + base64(template);
+        // 对下载的文件命名
+        link.download = "用户管理数据表.xls";
+        link.click();
+
+    }, function(errorMsg) {
+        alert("请求数据失败!");
+    })
+}
+// 导出  end

+ 1 - 1
pages/account-manage/userAccount-manage.html

@@ -26,7 +26,7 @@
             <a class="button edit">修改</a>
             <a class="button add">+ 新增</a>
             <a class="button delete ">- 删除</a>
-            <a class="button">导出</a>
+            <a class="button export">导出</a>
         </ul>
 
         <table class="pure-table" cellspacing="0px">

+ 2 - 2
pages/system-manage/auth-manage.html

@@ -12,7 +12,7 @@
     <script src="../../js/flexible-inner.js"></script>
 </head>
 
-<body style="background:rgba(0,0,0,0)">
+<body style="background:rgba(0,0,0,0);">
     <div class="content-box flex">
         <div class="column column2 flex2">
             <div class="departlist-box">
@@ -162,7 +162,7 @@
                     </div>
                     <div>
                         <span>菜单配置:<i class="necessary">*</i></span>
-                        <textarea name="perms" id="" cols="20" rows="10"></textarea>
+                        <textarea name="perms" id="" cols="20" rows="10" readonly></textarea>
                     </div>
                     <div>
                         <span>菜单类型:<i class="necessary">*</i></span>

+ 11 - 1
system-manage.html

@@ -11,7 +11,7 @@
     <link rel="stylesheet" href="css/per-manage.css" />
 </head>
 
-<body style="background-image:url(images/big-bg.png)">
+<body style="background-image:url(images/big-bg.png)" class="outerBody">
     <section class="mainbox ">
         <div class="tit-box flex">
             <h2 class="title flex2">系统管理
@@ -46,6 +46,16 @@
                 $(this).addClass('selected')
             })
         })
+
+
+        // var aa = document.body.clientWidth;
+        // var bb = document.body.clientHeight;
+        // if (0.5625 < bb / aa) {
+        //     alert(1)
+        //     $("body").css({
+        //         backgroundSize: '100% 100%',
+        //     })
+        // }
     </script>
 </body>