| | |
| | | <link rel="stylesheet" href="../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../static/css/loader.css" media="all"> |
| | | <link rel="stylesheet" href="../static/css/originTable.css" media="all"> |
| | | <style> |
| | | .layui-logo img { |
| | | width: 25px; |
| | |
| | | </ul> |
| | | <ul class="layui-nav layui-layout-right"> |
| | | <li class="layui-nav-item" lay-unselect> |
| | | <a ew-event="note" title="便签"><i class="layui-icon layui-icon-note"></i></a> |
| | | <a id="hostName"></a> |
| | | </li> |
| | | <!-- <li class="layui-nav-item" lay-unselect>--> |
| | | <!-- <a ew-event="note" title="便签"><i class="layui-icon layui-icon-note"></i></a>--> |
| | | <!-- </li>--> |
| | | <li class="layui-nav-item layui-hide-xs" lay-unselect> |
| | | <a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a> |
| | | </li> |
| | |
| | | <div class="layui-body"></div> |
| | | <!-- 底部 --> |
| | | <div class="layui-footer layui-text"> |
| | | copyright © 2022 <a href="http://www.zoneyung.com" target="_blank">浙江中扬立库技术有限公司</a> all rights reserved. |
| | | copyright © 2024 <a href="http://www.zoneyung.com" target="_blank">浙江中扬立库技术有限公司</a> all rights reserved. |
| | | <span class="pull-right">Version 1.0.0</span> |
| | | </div> |
| | | |
| | |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | | notice: 'notice/notice', |
| | | }).use(['index', 'element', 'layer', 'admin', 'notice'], function () { |
| | | }).use(['index', 'element', 'layer', 'admin', 'notice', 'table'], function () { |
| | | var $ = layui.jquery; |
| | | var index = layui.index; |
| | | var element = layui.element; |
| | | var layer = layui.layer; |
| | | var admin = layui.admin; |
| | | var notice = layui.notice; |
| | | var table = layui.table; |
| | | |
| | | var easywebIframeMsg = localStorage.getItem("easyweb-iframe"); |
| | | if (!isEmpty(easywebIframeMsg)) { |
| | |
| | | } |
| | | }); |
| | | |
| | | // 检测是否为超级管理员 |
| | | $.ajax({ |
| | | url: baseUrl + "/show/host.action", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (!isEmpty(res.data.hostName)) { |
| | | $('#hostName').text(res.data.hostName); |
| | | } |
| | | if (res.data.root) { |
| | | showHost(); |
| | | } |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/login"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 默认加载主页 |
| | | index.loadHome({ |
| | | menuPath: baseUrl+'/views/home/navigation.html', |
| | | menuPath: baseUrl + '/views/home/navigation.html', |
| | | menuName: '<i class="layui-icon layui-icon-home"></i>' |
| | | }); |
| | | |
| | | $('#username').text(localStorage.getItem('username')); |
| | | |
| | | $(document).on('click','#logout', function () { |
| | | $(document).on('click', '#logout', function () { |
| | | window.location.href = "login.html"; |
| | | localStorage.removeItem('token'); |
| | | localStorage.removeItem('username'); |
| | |
| | | var url = logout.getAttribute('href'); |
| | | logout.setAttribute('href', baseUrl + "/login"); |
| | | |
| | | // 多仓库模式 |
| | | function showHost() { |
| | | // var dele = layer.msg('正在删除', {icon: 16, time: 10000}, function(){ |
| | | // layer.msg('成功删除', {icon: 1}) |
| | | // }); |
| | | admin.open({ |
| | | type: 1, |
| | | title: '仓库选择', |
| | | area: '250px', |
| | | offset: 'r', |
| | | shade: false, |
| | | shadeClose: true, |
| | | content: '<table id="originTable" lay-filter="originTable"></table>', |
| | | success: function (layero) { |
| | | var insTb = table.render({ |
| | | elem: '#originTable', |
| | | url: baseUrl + '/host/list/auth', |
| | | height: 'full-500', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | defaultToolbar: [], |
| | | cols: [[ |
| | | {field: 'id', title: '编号', width: 70, align: 'center'}, |
| | | {field: 'name', title: '项目名称'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | $('.layui-table, .layui-table-view').css("margin", 0); |
| | | // $('#originTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click'); |
| | | } |
| | | }); |
| | | /* 监听行单击事件 */ |
| | | table.on('row(originTable)', function (obj) { |
| | | obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click'); |
| | | // 检测是否为超级管理员 |
| | | $.ajax({ |
| | | url: baseUrl + "/root/change/host/auth?hostId=" + obj.data.id, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | window.location.reload(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/login"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | </script> |
| | | <script type="text/html" id="menuTpl"> |
| | |
| | | <a><i class="layui-icon {{this.menuIcon}}"></i> <cite>{{this.menu}}</cite></a> |
| | | <dl class="layui-nav-child"> |
| | | {{#each this.subMenu}} |
| | | <dd><a lay-href="{{this.code}}?resourceId={{this.id}}">{{this.name}}</a></dd> |
| | | <dd><a lay-href="{{this.code}}?resourceId={{this.id}}{{this.param}}">{{this.name}}</a></dd> |
| | | {{/each}} |
| | | </dl> |
| | | </li> |