| | |
| | | setGreeting() { |
| | | const currentTime = new Date(); |
| | | const currentHour = currentTime.getHours(); |
| | | console.log(this.$store.state.user) |
| | | let name = this.$store.state.user.name |
| | | //alert(this.$store.state.user.userName) |
| | | let userName = this.$store.state.user.userName |
| | | let lnm = this.getLastName(name) |
| | | if(this.xm[lnm]!=null) |
| | | this.ximg = require("@/assets/images/"+this.xm[lnm]) |
| | | else |
| | | this.ximg = require("@/assets/images/login_logo.png") |
| | | if (currentHour < 12) { |
| | | this.greeting = "早上好,"+name; |
| | | this.greeting = "早上好,"+userName; |
| | | } else if (currentHour < 14) { |
| | | this.greeting = "中午好,"+name; |
| | | this.greeting = "中午好,"+userName; |
| | | } else if (currentHour < 18) { |
| | | this.greeting = "下午好,"+name; |
| | | this.greeting = "下午好,"+userName; |
| | | } else { |
| | | this.greeting = "晚上好,"+name; |
| | | this.greeting = "晚上好,"+userName; |
| | | } |
| | | }, |
| | | toggleSideBar() { |
| | |
| | | SET_NAME: (state, name) => { |
| | | state.name = name |
| | | }, |
| | | SET_USERNAME: (state, uname) => { |
| | | state.userName = uname |
| | | }, |
| | | SET_AVATAR: (state, avatar) => { |
| | | state.avatar = avatar |
| | | }, |
| | |
| | | commit('SET_USERID', res.user.userId) |
| | | commit('SET_CLANID', res.user.clanId) |
| | | commit('SET_NAME', user.userName) |
| | | commit('SET_USERNAME', user.nickName) |
| | | commit('SET_AVATAR', avatar) |
| | | resolve(res) |
| | | }).catch(error => { |
| | |
| | | <el-table-column label="用户姓名" align="center" key="userName" prop="userName" v-if="columns[2].visible" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="性别" align="center" key="sex" prop="sex" v-if="columns[2].visible" :show-overflow-tooltip="true" > |
| | | |
| | | <template slot-scope="scope">{{scope.row.sex==0? '男': '女'}}</template> |
| | | <template slot-scope="scope">{{scope.row.sex===0? '男': '女'}}</template> |
| | | |
| | | </el-table-column> |
| | | <!-- <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> --> |