Browse Source

首页高亮,早上好中午好晚上好自动判断,项目进度四舍五入

master
xiejiahao 4 years ago
parent
commit
b80fbf5ab8
  1. 13
      src/views/layout/components/Navbar.vue
  2. 5
      src/views/layout/components/Sidebar/index.vue
  3. 5
      src/views/xm/XmOverview2.vue

13
src/views/layout/components/Navbar.vue

@ -31,7 +31,7 @@
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<img v-if="userInfo && userInfo.headimgurl && userInfo.headimgurl!=null && userInfo.headimgurl!=='' " class="user-avatar" :src="userInfo.headimgurl"> <img v-if="userInfo && userInfo.headimgurl && userInfo.headimgurl!=null && userInfo.headimgurl!=='' " class="user-avatar" :src="userInfo.headimgurl">
<img v-else class="user-avatar" src="../../../assets/image/user_img.gif"> <img v-else class="user-avatar" src="../../../assets/image/user_img.gif">
<span class="username">早上好<b>{{userInfo.username}}</b></span>
<span class="username">{{getTimeStatus}}<b>{{userInfo.username}}</b></span>
<i class="el-icon-caret-bottom"></i> <i class="el-icon-caret-bottom"></i>
</div> </div>
<el-dropdown-menu slot="dropdown" style="width:400px;"> <el-dropdown-menu slot="dropdown" style="width:400px;">
@ -119,6 +119,7 @@ import Screenfull from '@/components/Screenfull'
import LangSelect from '@/components/LangSelect' import LangSelect from '@/components/LangSelect'
import ThemePicker from '@/components/ThemePicker'; import ThemePicker from '@/components/ThemePicker';
import NoticeMsgBar from '@/components/NoticeMsgBar' import NoticeMsgBar from '@/components/NoticeMsgBar'
import dayjs from 'dayjs'
//import selectShopLocationBySysDept from '@/views/mdp/app/selectShopLocationBySysDept/selectShopLocationBySysDept'; //import selectShopLocationBySysDept from '@/views/mdp/app/selectShopLocationBySysDept/selectShopLocationBySysDept';
export default { export default {
@ -204,6 +205,16 @@ export default {
} }
}) })
return myShops return myShops
},
getTimeStatus() {
let hour = dayjs().hour();
let msg = '早上好';
if(hour >= 13 || hour <= 18) {
msg = '下午好';
}else if (hour >= 19 || hour <= 24){
msg = '晚上好';
}
return msg;
} }
}, },
methods: { methods: {

5
src/views/layout/components/Sidebar/index.vue

@ -11,7 +11,7 @@
text-color="rgba(255,255,255,.6)" text-color="rgba(255,255,255,.6)"
active-text-color="#409EFF" active-text-color="#409EFF"
> >
<sidebar-item :routes="permission_routers"></sidebar-item>
<sidebar-item :routes="permission_routers"></sidebar-item>
</el-menu> </el-menu>
</scroll-bar> </scroll-bar>
</section> </section>
@ -38,11 +38,10 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.el-menu .menu-wrapper a:nth-child(1) .el-menu-item{
.el-menu .menu-wrapper :first-child .submenu-title-noDropdown{
background-image: linear-gradient(to right, rgba(42,63,104,.2), rgb(52,87,150), rgb(62,111,225)) !important; background-image: linear-gradient(to right, rgba(42,63,104,.2), rgb(52,87,150), rgb(62,111,225)) !important;
color: #fff !important; color: #fff !important;
} }
</style> </style>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

5
src/views/xm/XmOverview2.vue

@ -173,12 +173,14 @@ export default {
remainWorkload:function (){ remainWorkload:function (){
return this.xmBranchState.totalPlanWorkload - this.xmBranchState.totalActWorkload; return this.xmBranchState.totalPlanWorkload - this.xmBranchState.totalActWorkload;
}, },
planProgress:function (){ planProgress:function (){
if(!this.xmBranchState.totalPlanWorkload){ if(!this.xmBranchState.totalPlanWorkload){
return 0; return 0;
} }
return parseInt( this.xmBranchState.estimateWorkload/this.xmBranchState.totalPlanWorkload*100)
return Math.round( this.xmBranchState.estimateWorkload/this.xmBranchState.totalPlanWorkload*100)
}, },
realProgress:function (){ realProgress:function (){
if(!this.xmBranchState.totalPlanWorkload){ if(!this.xmBranchState.totalPlanWorkload){
return 0; return 0;
@ -189,6 +191,7 @@ export default {
return 100; return 100;
} }
}, },
xmBranchStateCpd(){ xmBranchStateCpd(){
return this.xmBranchState return this.xmBranchState
}, },

Loading…
Cancel
Save