Skip to content

Commit

Permalink
Merge pull request #237 from aspnetboilerplate/issue-235
Browse files Browse the repository at this point in the history
Issue 235
  • Loading branch information
ismcagdas authored May 14, 2018
2 parents 88b8bd2 + 3fa10b9 commit 33306f9
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 38 deletions.
2 changes: 1 addition & 1 deletion vue/src/components/lockscreen/components/locking-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
lockScreenBack.style.zIndex = -1;
lockScreenBack.style.boxShadow = '0 0 0 0 #667aa6 inset';
this.$router.push({
name: Cookies.get('last_page_name') // 解锁之后跳转到锁屏之前的页面
name: Cookies.get('last_page_name')
});
}
},
Expand Down
2 changes: 1 addition & 1 deletion vue/src/components/lockscreen/components/unlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default class UnLock extends AbpBase {
Cookies.set('locking', '0');
this.$emit('on-unlock');
} else {
this.$Message.error('密码错误,请重新输入');
this.$Message.error('WrongPassword,Wrong password');
}
}
unlockMousedown () {
Expand Down
2 changes: 1 addition & 1 deletion vue/src/components/lockscreen/lockscreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class LockScreen extends AbpBase {
lockScreenBack.style.boxShadow = '0 0 0 ' + this.lockScreenSize + 'px #667aa6 inset';
this.showUnlock = true;
let name=this.$route.name?this.$route.name:'';
Cookies.set('last_page_name', name); // 本地存储锁屏之前打开的页面以便解锁后打开
Cookies.set('last_page_name', name);
setTimeout(() => {
lockScreenBack.style.transition = 'all 0s';
this.$router.push({
Expand Down
5 changes: 1 addition & 4 deletions vue/src/components/tags-page-opened.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,9 @@ export default class TagsPageOpened extends AbpBase {
moveToView (tag:any) {
let scrollCon=this.$refs.scrollCon as any;
if (tag.offsetLeft < -this.tagBodyLeft) {
// 标签在可视区域左侧
this.tagBodyLeft = -tag.offsetLeft + 10;
} else if (tag.offsetLeft + 10 > -this.tagBodyLeft && tag.offsetLeft + tag.offsetWidth < -this.tagBodyLeft + scrollCon.offsetWidth - 100) {
// 标签在可视区域
} else {
// 标签在可视区域右侧
this.tagBodyLeft = -(tag.offsetLeft - (scrollCon.offsetWidth - 100 - tag.offsetWidth) + 20);
}
}
Expand All @@ -149,7 +146,7 @@ export default class TagsPageOpened extends AbpBase {
this.moveToView(tag);
}
})
}, 1); // 这里不设定时器就会有偏移bug
}, 1);
this.tagsCount = this.tagsList.length;
}
@Watch('$route')
Expand Down
3 changes: 1 addition & 2 deletions vue/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Vue from 'vue'
import App from './App.vue'
import App from './app.vue'
import iView from 'iview'
import {router} from './router/index';
//import 'iview/dist/styles/iview.css';
Expand Down Expand Up @@ -39,7 +39,6 @@ Ajax.get('/AbpUserConfiguration/GetAll').then(data=>{
}
}
this.$store.commit('app/initCachepage');
// 权限菜单过滤相关
this.$store.commit('app/updateMenulist');
},
created () {
Expand Down
12 changes: 6 additions & 6 deletions vue/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,35 @@ export const router = new VueRouter(RouterConfig);
router.beforeEach((to, from, next) => {
iView.LoadingBar.start();
Util.title(to.meta.title);
if (Cookies.get('locking') === '1' && to.name !== 'locking') { // 判断当前是否是锁定状态
if (Cookies.get('locking') === '1' && to.name !== 'locking') {
next({
replace: true,
name: 'locking'
});
}else if (Cookies.get('locking') === '0' && to.name === 'locking') {
next(false);
} else {
if (!Util.abp.session.userId&& to.name !== 'login') { // 判断是否已经登录且前往的页面不是登录页
if (!Util.abp.session.userId&& to.name !== 'login') {
next({
name: 'login'
});
} else if (!!Util.abp.session.userId && to.name === 'login') { // 判断是否已经登录且前往的是登录页
} else if (!!Util.abp.session.userId && to.name === 'login') {
Util.title(to.meta.title);
next({
name: 'home'
});
} else {
const curRouterObj = Util.getRouterObjByName([otherRouters, ...appRouters], to.name);
if (curRouterObj && curRouterObj.permission) { // 需要判断权限的路由
if (curRouterObj && curRouterObj.permission) {
if (window.abp.auth.hasPermission(curRouterObj.permission)) {
Util.toDefaultPage([otherRouters, ...appRouters], to.name, router, next); // 如果在地址栏输入的是一级菜单则默认打开其第一个二级菜单的页面
Util.toDefaultPage([otherRouters, ...appRouters], to.name, router, next);
} else {
next({
replace: true,
name: 'error-403'
});
}
} else { // 没有配置权限的路由, 直接通过
} else {
Util.toDefaultPage([...routers], to.name, router, next);
}
}
Expand Down
14 changes: 7 additions & 7 deletions vue/src/store/modules/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ interface AppState{
cachePage:Array<any>;
lang:string;
isFullScreen: boolean;
openedSubmenuArr: Array<any>; // 要展开的菜单数组
menuTheme: string; // 主题
openedSubmenuArr: Array<any>;
menuTheme: string;
themeColor: string,
pageOpenedList:Array<any>;
currentPageName: string;
currentPath:Array<any>; // 面包屑数组
currentPath:Array<any>;
menuList: Array<any>;
routers:Array<any>;
tagsList: Array<any>;
Expand All @@ -29,8 +29,8 @@ class AppModule implements Module<AppState,any>{
cachePage: [],
lang: '',
isFullScreen: false,
openedSubmenuArr: [], // 要展开的菜单数组
menuTheme: 'dark', // 主题
openedSubmenuArr: [],
menuTheme: 'dark',
themeColor: '',
pageOpenedList: [{
meta:{title: 'HomePage'},
Expand All @@ -44,7 +44,7 @@ class AppModule implements Module<AppState,any>{
path: '',
name: 'home'
}
], // 面包屑数组
],
menuList: [],
routers: [
otherRouters,
Expand All @@ -53,7 +53,7 @@ class AppModule implements Module<AppState,any>{
tagsList: [...otherRouters.children],
messageCount: 0,
dontCache: [],
noticeList:[{read:false,type:0,title:'第一条通知',description:'一天前'},{read:false,type:1},{read:false,type:0,title:'第二条通知',description:'一月前'}]
noticeList:[{read:false,type:0,title:'First notice',description:'One day ago'},{read:false,type:1},{read:false,type:0,title:'Second notice',description:'One month ago'}]
};
mutations= {
logout(state:AppState){
Expand Down
7 changes: 7 additions & 0 deletions vue/src/views/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@
display: inline-block;
vertical-align: middle;
}
i{
height: 64px;
width: auto;
display: inline-block;
vertical-align: middle;
padding: 16px 0px 16px 24px;
}
}
.page-body{
margin: 8px;
Expand Down
8 changes: 4 additions & 4 deletions vue/src/views/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:menu-list="menuList">
<div slot="top" class="logo-con">
<a>
<img src="../images/logo-min.jpg" key="min-logo" />
<Icon type="cube" size="32"></Icon>
<h1 >{{L('AppName')}}</h1>
</a>

Expand Down Expand Up @@ -97,10 +97,10 @@
return this.$store.state.app.menuList;
}
get pageTagsList () {
return this.$store.state.app.pageOpenedList as Array<any>; // 打开的页面的页面对象
return this.$store.state.app.pageOpenedList as Array<any>;
}
get currentPath () {
return this.$store.state.app.currentPath; // 当前面包屑数组
return this.$store.state.app.currentPath;
}
get lang(){
return this.$store.state.app.lang;
Expand Down Expand Up @@ -150,7 +150,7 @@
return false
}
});
if (!openpageHasTag) { // 解决关闭当前标签后再点击回退按钮会退到当前页时没有标签的问题
if (!openpageHasTag) {
util.openNewPage(this, name as string, this.$route.params || {}, this.$route.query || {});
}
}
Expand Down
7 changes: 1 addition & 6 deletions vue/src/views/setting/role/role.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,4 @@
})
}
}
</script>

<style>
</style>

</script>
7 changes: 1 addition & 6 deletions vue/src/views/setting/user/user.vue
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,4 @@
})
}
}
</script>

<style>
</style>

</script>

0 comments on commit 33306f9

Please sign in to comment.