Skip to content

Commit

Permalink
系统管理功能完善
Browse files Browse the repository at this point in the history
  • Loading branch information
penggle committed May 10, 2017
1 parent 8e0eb54 commit 7f58dee
Show file tree
Hide file tree
Showing 13 changed files with 160 additions and 48 deletions.
4 changes: 2 additions & 2 deletions xproject-admin/src/main/webapp/admin/resource/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
</style>
</head>
<body>
<div id="app" class="el-container el-hidden">
<div class="el-container-inner">
<div id="app" class="el-container el-container-noscroll el-vhidden">
<div class="el-container-inner el-container-inner-noscroll">
<el-breadcrumb class="el-breadcrumb-admin" separator="/">
<i class="el-icon-fa-home"></i>
<el-breadcrumb-item>系统管理</el-breadcrumb-item>
Expand Down
6 changes: 3 additions & 3 deletions xproject-admin/src/main/webapp/admin/role/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
</style>
</head>
<body>
<div id="app" class="el-container el-hidden">
<div class="el-container-inner">
<div id="app" class="el-container el-container-noscroll el-vhidden">
<div class="el-container-inner el-container-inner-noscroll">
<el-breadcrumb class="el-breadcrumb-admin" separator="/">
<i class="el-icon-fa-home"></i>
<el-breadcrumb-item>系统管理</el-breadcrumb-item>
Expand Down Expand Up @@ -101,7 +101,7 @@ <h3 class="el-title">
<el-button type="primary" size="small" icon="fa-plus-circle" @click="openRoleEditDialog('add')">新增角色</el-button>
</div>
<div class="el-search-list">
<el-table v-loading="loadingRoleList" element-loading-text="拼命加载中..." element-loading-class="el-loading-mask-opacity" :class="{loading: loadingRoleList}" :data="roleList" :default-sort="roleQuerySort" @sort-change="onRoleQuerySortChange" style="width:100%;" class="el-table el-table-primary el-table-sortable" empty-text="暂无数据">
<el-table v-loading="loadingRoleList" element-loading-text="拼命加载中..." element-loading-class="el-loading-mask-opacity" :class="{loading: loadingRoleList}" :data="roleList" :default-sort="roleQuerySort" @sort-change="onRoleQuerySortChange" width="1346" class="el-table el-table-primary el-table-sortable" empty-text="暂无数据">
<el-table-column label="#" type="index" width="40"></el-table-column>
<el-table-column label="角色名称" prop="roleName" width="170" sortable="custom"></el-table-column>
<el-table-column label="角色代码" prop="roleCode" width="170" sortable="custom"></el-table-column>
Expand Down
6 changes: 3 additions & 3 deletions xproject-admin/src/main/webapp/admin/user/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
</style>
</head>
<body>
<div id="app" class="el-container el-hidden">
<div class="el-container-inner">
<div id="app" class="el-container el-container-noscroll el-vhidden">
<div class="el-container-inner el-container-inner-noscroll">
<el-breadcrumb class="el-breadcrumb-admin" separator="/">
<i class="el-icon-fa-home"></i>
<el-breadcrumb-item>系统管理</el-breadcrumb-item>
Expand Down Expand Up @@ -96,7 +96,7 @@ <h3 class="el-title">
<el-button type="primary" size="small" icon="fa-plus-circle" @click="openUserEditDialog('add')">新增用户</el-button>
</div>
<div class="el-search-list">
<el-table v-loading="loadingUserList" element-loading-text="拼命加载中..." element-loading-class="el-loading-mask-opacity" :class="{loading: loadingUserList}" :data="userList" :default-sort="userQuerySort" @sort-change="onUserQuerySortChange" style="width:100%;" class="el-table el-table-primary el-table-sortable" empty-text="暂无数据">
<el-table id="userTable" v-loading="loadingUserList" element-loading-text="拼命加载中..." element-loading-class="el-loading-mask-opacity" :class="{loading: loadingUserList}" :data="userList" :default-sort="userQuerySort" @sort-change="onUserQuerySortChange" style="width:100%;" class="el-table el-table-primary el-table-sortable el-table-overflow-x-hidden" empty-text="暂无数据">
<el-table-column label="#" type="index" width="40"></el-table-column>
<el-table-column label="用户名" prop="userName" width="170" sortable="custom">
<template scope="scope">
Expand Down
33 changes: 25 additions & 8 deletions xproject-admin/src/main/webapp/common/error/400.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,32 @@
</style>
</head>
<body>
<div class="el-container el-hidden">
<div class="admin-errorpage">
<h3 class="admin-errorpage-error">ERROR</h3>
<h1 class="admin-errorpage-code">400</h1>
<h3 class="admin-errorpage-title">BAD REQUEST YOU GET ...</h3>
<p class="admin-errorpage-desc"><b>PS: </b>不好意思,错误的请求!(请求方法或参数有误)</p>
</div>
<div id="app" class="el-container">
<transition name="el-fade15">
<div v-show="showContent" class="admin-errorpage">
<h3 class="admin-errorpage-error">ERROR</h3>
<h1 class="admin-errorpage-code">400</h1>
<h3 class="admin-errorpage-title">BAD REQUEST YOU GET ...</h3>
<p class="admin-errorpage-desc"><b>PS: </b>不好意思,错误的请求!(请求方法或参数有误)</p>
</div>
</transition>
</div>
<script type="text/javascript" src="../../resources/js/vue.min.js"></script>
<script type="text/javascript" src="../../resources/js/vue.pageloading.js"></script>
<script type="text/javascript">
new Vue({
el: '#app',
data: {
showContent: false
},
mounted: function(){
var _this = this;
setTimeout(function(){
Vue.nextTick(function(){
_this.showContent = true;
});
}, 100);
}
});
</script>
</body>
</html>
33 changes: 25 additions & 8 deletions xproject-admin/src/main/webapp/common/error/401.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,32 @@
</style>
</head>
<body>
<div class="el-container el-hidden">
<div class="admin-errorpage">
<h3 class="admin-errorpage-error">ERROR</h3>
<h1 class="admin-errorpage-code">401</h1>
<h3 class="admin-errorpage-title">UNAUTHORIZED RESOURCE YOU GET ...</h3>
<p class="admin-errorpage-desc"><b>PS: </b>不好意思,您没有权限访问该资源!</p>
</div>
<div id="app" class="el-container">
<transition name="el-fade15">
<div v-show="showContent" class="admin-errorpage">
<h3 class="admin-errorpage-error">ERROR</h3>
<h1 class="admin-errorpage-code">401</h1>
<h3 class="admin-errorpage-title">UNAUTHORIZED RESOURCE YOU GET ...</h3>
<p class="admin-errorpage-desc"><b>PS: </b>不好意思,您没有权限访问该资源!</p>
</div>
</transition>
</div>
<script type="text/javascript" src="../../resources/js/vue.min.js"></script>
<script type="text/javascript" src="../../resources/js/vue.pageloading.js"></script>
<script type="text/javascript">
new Vue({
el: '#app',
data: {
showContent: false
},
mounted: function(){
var _this = this;
setTimeout(function(){
Vue.nextTick(function(){
_this.showContent = true;
});
}, 100);
}
});
</script>
</body>
</html>
33 changes: 25 additions & 8 deletions xproject-admin/src/main/webapp/common/error/403.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,32 @@
</style>
</head>
<body>
<div class="el-container el-hidden">
<div class="admin-errorpage">
<h3 class="admin-errorpage-error">ERROR</h3>
<h1 class="admin-errorpage-code">403</h1>
<h3 class="admin-errorpage-title">FORBIDDEN RESOURCE YOU GET ...</h3>
<p class="admin-errorpage-desc"><b>PS: </b>不好意思,禁止访问该资源!</p>
</div>
<div id="app" class="el-container">
<transition name="el-fade15">
<div v-show="showContent" class="admin-errorpage">
<h3 class="admin-errorpage-error">ERROR</h3>
<h1 class="admin-errorpage-code">403</h1>
<h3 class="admin-errorpage-title">FORBIDDEN RESOURCE YOU GET ...</h3>
<p class="admin-errorpage-desc"><b>PS: </b>不好意思,禁止访问该资源!</p>
</div>
</transition>
</div>
<script type="text/javascript" src="../../resources/js/vue.min.js"></script>
<script type="text/javascript" src="../../resources/js/vue.pageloading.js"></script>
<script type="text/javascript">
new Vue({
el: '#app',
data: {
showContent: false
},
mounted: function(){
var _this = this;
setTimeout(function(){
Vue.nextTick(function(){
_this.showContent = true;
});
}, 100);
}
});
</script>
</body>
</html>
33 changes: 25 additions & 8 deletions xproject-admin/src/main/webapp/common/error/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,32 @@
</style>
</head>
<body>
<div class="el-container el-hidden">
<div class="admin-errorpage">
<h3 class="admin-errorpage-error">ERROR</h3>
<h1 class="admin-errorpage-code">500</h1>
<h3 class="admin-errorpage-title">INTERNAL SERVER ERROR ...</h3>
<p class="admin-errorpage-desc"><b>PS: </b>不好意思,服务器内部出现错误!</p>
</div>
<div id="app" class="el-container">
<transition name="el-fade15">
<div v-show="showContent" class="admin-errorpage">
<h3 class="admin-errorpage-error">ERROR</h3>
<h1 class="admin-errorpage-code">500</h1>
<h3 class="admin-errorpage-title">INTERNAL SERVER ERROR ...</h3>
<p class="admin-errorpage-desc"><b>PS: </b>不好意思,服务器内部出现错误!</p>
</div>
</transition>
</div>
<script type="text/javascript" src="../../resources/js/vue.min.js"></script>
<script type="text/javascript" src="../../resources/js/vue.pageloading.js"></script>
<script type="text/javascript">
new Vue({
el: '#app',
data: {
showContent: false
},
mounted: function(){
var _this = this;
setTimeout(function(){
Vue.nextTick(function(){
_this.showContent = true;
});
}, 100);
}
});
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion xproject-admin/src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<link rel="stylesheet" type="text/css" href="resources/css/admin-index.css">
</head>
<body>
<div id="app" class="admin-container el-hidden">
<div id="app" class="admin-container el-vhidden">
<div class="admin-container-inner">
<div class="admin-container-content">
<header class="el-row admin-header">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/**
* 浏览器窗口高度,宽度
*/
var WINDOW_HEIGHT = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
var WINDOW_WIDTH = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;

/**
* 去页面滚动条
*/
var scrollContainerInner = document.querySelector(".el-container-inner-noscroll");
if(scrollContainerInner){
scrollContainerInner.style.width = (WINDOW_WIDTH + 18) + 'px'; //18px为滚动条的宽度
if(window.parent !== window.self){ //当前页面在iframe中时存在两边padding不对齐的情况,fix
scrollContainerInner.style.paddingLeft = '8px';
scrollContainerInner.style.paddingRight = '12px';
}
}

/**
* 解决input readonly样式各浏览器之间的差异问题
* @param event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
padding: 0;
margin: 0;
}
html, body {
height: 100%;
}
body {
color: #1f2f3d;
font-size: 14px;
Expand All @@ -29,6 +32,12 @@ a {
box-sizing: border-box;
max-width: 100%;
}
.el-container-noscroll {
width: 100%;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
}
.el-container-inner, .el-container-content {
display: block;
position: relative;
Expand All @@ -38,12 +47,21 @@ a {
.el-container-inner {
padding: 0 10px;
}
.el-container-inner-noscroll {
overflow-x: hidden;
overflow-y: scroll;
width: 102%;
height: 100%;
}
.el-container-content {
padding: 0 0 10px 0;
}
.el-hidden {
display: none;
}
.el-vhidden {
visibility: hidden;
}
.el-noscroll {
overflow: hidden;
}
Expand Down Expand Up @@ -1062,6 +1080,15 @@ a {
.el-table--striped .el-table__body tr:nth-child(2n) td {
background-color: #efefef;
}
.el-table-overflow-x-hidden .el-table__body-wrapper {
overflow-x: hidden;
}
.el-table-overflow-y-hidden .el-table__body-wrapper {
overflow-y: hidden;
}
.el-table-overflow-hidden .el-table__body-wrapper {
overflow: hidden;
}

.el-table-primary.el-table {
border-color: #7196db;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function removeClass(el, cls) {
}

if(pageContainer){
addClass(pageContainer, 'el-hidden');
addClass(pageContainer, 'el-vhidden');
}

var ElPageLoading = Vue.extend({
Expand All @@ -57,7 +57,7 @@ var ElPageLoading = Vue.extend({
},
methods: {
handleLeave: function(){
removeClass(pageContainer, 'el-hidden');
removeClass(pageContainer, 'el-vhidden');
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
var TOP_NAV_HEIGHT = 50;
/**
* 浏览器窗口高度
* 浏览器窗口高度,宽度
*/
var WINDOW_HEIGHT = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
var WINDOW_WIDTH = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
Expand All @@ -17,8 +17,6 @@ window.onresize = function(){
MIN_MAIN_FRAME_HEIGHT = WINDOW_HEIGHT - TOP_NAV_HEIGHT;
}

/*var adminContainerContent = document.querySelector(".admin-container-content");
adminContainerContent.style.height = WINDOW_HEIGHT + 'px';*/
var adminContainerInner = document.querySelector(".admin-container-inner");
adminContainerInner.style.width = (WINDOW_WIDTH + 20) + 'px';

Expand Down
5 changes: 3 additions & 2 deletions xproject-admin/src/main/webapp/resources/scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ if(axios){
}, function (error) {
var statusCode = error.response.status;
if(statusCode == 401){
if(window.parent){
window.top.href = ADMIN_CONTEXT_PATH + '/login';
/*if(window.parent){
window.parent.location.href = ADMIN_CONTEXT_PATH + '/login';
}else{
window.location.href = ADMIN_CONTEXT_PATH + '/login';
}
}*/
return Promise.reject(error);
}
});
Expand Down

0 comments on commit 7f58dee

Please sign in to comment.