| | |
| | | trigger="click" |
| | | > |
| | | <div class="avatar-wrapper"> |
| | | <img :src="avatar" class="user-avatar" /> |
| | | <img |
| | | :src=" |
| | | sex == 1 |
| | | ? require('@/assets/images/yisn.jpg') |
| | | : require('@/assets/images/yisna.jpg') |
| | | " |
| | | class="user-avatar" |
| | | /> |
| | | <i class="el-icon-caret-bottom" /> |
| | | </div> |
| | | <el-dropdown-menu slot="dropdown"> |
| | |
| | | SizeSelect, |
| | | Search, |
| | | RuoYiGit, |
| | | RuoYiDoc, |
| | | RuoYiDoc |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["sidebar", "avatar", "device"]), |
| | |
| | | set(val) { |
| | | this.$store.dispatch("settings/changeSetting", { |
| | | key: "showSettings", |
| | | value: val, |
| | | value: val |
| | | }); |
| | | }, |
| | | } |
| | | }, |
| | | topNav: { |
| | | get() { |
| | | return this.$store.state.settings.topNav; |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | isBadgeHidden: true, |
| | | badgeVal: 0, |
| | | sex: this.$store.state.user.sex |
| | | }; |
| | | }, |
| | | mounted() { |
| | | // this.returs(); |
| | | }, |
| | | methods: { |
| | | // async returs() { |
| | | // await listSystemmessageCount() |
| | | // .then((res) => { |
| | | // this.badgeVal = res.data; |
| | | // console.log('跑'); |
| | | // if (this.badgeVal > 0) { |
| | | // this.isBadgeHidden = false; |
| | | // } |
| | | // }) |
| | | // .catch((error) => {}); |
| | | // }, |
| | | // async returs() { |
| | | // await listSystemmessageCount() |
| | | // .then((res) => { |
| | | // this.badgeVal = res.data; |
| | | // console.log('跑'); |
| | | // if (this.badgeVal > 0) { |
| | | // this.isBadgeHidden = false; |
| | | // } |
| | | // }) |
| | | // .catch((error) => {}); |
| | | // }, |
| | | clickMessage() { |
| | | this.$router.push({ |
| | | path: "/message", |
| | | |
| | | path: "/message" |
| | | }); |
| | | }, |
| | | toggleSideBar() { |
| | |
| | | this.$confirm("确定注销并退出系统吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | this.$store.dispatch("LogOut").then(() => { |
| | |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | } |
| | | }, |
| | | watch: { |
| | | badgeVal: function () { |
| | | badgeVal: function() { |
| | | const timer = setInterval(() => { |
| | | this.returs(); |
| | | },5000); |
| | | this.$once("hook:beforeDestroy",()=>{ |
| | | }, 5000); |
| | | this.$once("hook:beforeDestroy", () => { |
| | | clearInterval(timer); |
| | | }) |
| | | }, |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="scss" > |
| | | <style lang="scss"> |
| | | .el-badge { |
| | | .el-badge__content.is-fixed { |
| | | top: 13px !important ; |