功能优化

main
ysn 5 days ago
parent eb9311b6e3
commit 8dc209f8fc
  1. 32
      src/layout/components/Navbar.vue
  2. 4
      src/layout/components/SystemSettingDialog.vue
  3. 2
      src/store/getters.js
  4. 12
      src/store/modules/user.js

@ -51,7 +51,24 @@
> >
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<img :src="avatar" class="user-avatar" /> <img :src="avatar" class="user-avatar" />
<span class="user-nickname"> {{ nickName }} </span> <span class="user-nickname">
{{ nickName }}
</span>
<span class="user-nickname">
<el-link
type="primary"
icon="el-icon-circle-check"
:underline="false"
>
{{ selectDictLabel(dict.type.sys_normal_disable, status) || "-" }}
</el-link>
</span>
<span class="user-nickname">
所属单位
<el-link type="primary" :underline="false">
{{ dept.deptName }}
</el-link>
</span>
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<router-link to="/user/profile"> <router-link to="/user/profile">
@ -115,6 +132,7 @@ import SystemSettingDialog from "./SystemSettingDialog";
import AboutDialog from "./AboutDialog"; import AboutDialog from "./AboutDialog";
export default { export default {
dicts: ["sys_normal_disable"],
components: { components: {
Breadcrumb, Breadcrumb,
Logo, Logo,
@ -149,7 +167,14 @@ export default {
}, },
}, },
computed: { computed: {
...mapGetters(["sidebar", "avatar", "device", "nickName"]), ...mapGetters([
"sidebar",
"avatar",
"device",
"nickName",
"dept",
"status",
]),
setting: { setting: {
get() { get() {
return this.$store.state.settings.showSettings; return this.$store.state.settings.showSettings;
@ -166,6 +191,9 @@ export default {
}, },
}, },
}, },
created() {
console.log(this.$store.state.user);
},
methods: { methods: {
toggleSideBar() { toggleSideBar() {
this.$store.dispatch("app/toggleSideBar"); this.$store.dispatch("app/toggleSideBar");

@ -92,9 +92,9 @@
</el-checkbox> </el-checkbox>
</el-form-item> </el-form-item>
<!-- 只能在软件中使用需要访问本地文件系统 --> <!-- 只能在软件中使用需要访问本地文件系统 -->
<!-- <el-form-item label="缓存"> <el-form-item label="缓存">
<el-button type="primary" >清除客户端缓存</el-button> <el-button type="primary" >清除客户端缓存</el-button>
</el-form-item> --> </el-form-item>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>

@ -14,6 +14,8 @@ const getters = {
nickName: state => state.user.nickName, nickName: state => state.user.nickName,
introduction: state => state.user.introduction, introduction: state => state.user.introduction,
roles: state => state.user.roles, roles: state => state.user.roles,
status: state => state.user.status,
dept: state => state.user.dept,
permissions: state => state.user.permissions, permissions: state => state.user.permissions,
permission_routes: state => state.permission.routes, permission_routes: state => state.permission.routes,
topbarRouters: state => state.permission.topbarRouters, topbarRouters: state => state.permission.topbarRouters,

@ -15,7 +15,9 @@ const user = {
nickName: '', nickName: '',
avatar: '', avatar: '',
roles: [], roles: [],
permissions: [] permissions: [],
dept: '',
status: ''
}, },
mutations: { mutations: {
@ -39,6 +41,12 @@ const user = {
}, },
SET_PERMISSIONS: (state, permissions) => { SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions state.permissions = permissions
},
SET_DEPT: (state, dept) => {
state.dept = dept
},
SET_STATUS: (state, status) => {
state.status = status
} }
}, },
@ -80,6 +88,8 @@ const user = {
commit('SET_NAME', user.userName) commit('SET_NAME', user.userName)
commit('SET_NICK_NAME', user.nickName) commit('SET_NICK_NAME', user.nickName)
commit('SET_AVATAR', avatar) commit('SET_AVATAR', avatar)
commit('SET_DEPT', user.dept)
commit('SET_STATUS', user.status)
cache.session.set('pwrChrtype', res.pwdChrtype) cache.session.set('pwrChrtype', res.pwdChrtype)
/* 初始密码提示 */ /* 初始密码提示 */
if(res.isDefaultModifyPwd) { if(res.isDefaultModifyPwd) {

Loading…
Cancel
Save