| | |
| | | <div v-if="showCollapse" |
| | | :class="[{ 'avue-breadcrumb--active': isCollapse }]" |
| | | class="avue-breadcrumb"> |
| | | <i class="icon-navicon" |
| | | @click="setCollapse"></i> |
| | | <i class="icon-navicon" @click="setCollapse"></i> |
| | | </div> |
| | | </div> |
| | | <div class="top-bar__title"> |
| | |
| | | <top-color></top-color> |
| | | </div> |
| | | </el-tooltip> |
| | | <!-- 错误日志--> |
| | | <!-- <el-tooltip v-if="showDebug"--> |
| | | <!-- :content="logsFlag?$t('navbar.bug'):logsLen+$t('navbar.bugs')"--> |
| | | <!-- effect="dark"--> |
| | | <!-- placement="bottom">--> |
| | | <!-- <div class="top-bar__item">--> |
| | | <!-- <top-logs></top-logs>--> |
| | | <!-- </div>--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- 错误日志--> |
| | | <!-- <el-tooltip v-if="showDebug"--> |
| | | <!-- :content="logsFlag?$t('navbar.bug'):logsLen+$t('navbar.bugs')"--> |
| | | <!-- effect="dark"--> |
| | | <!-- placement="bottom">--> |
| | | <!-- <div class="top-bar__item">--> |
| | | <!-- <top-logs></top-logs>--> |
| | | <!-- </div>--> |
| | | <!-- </el-tooltip>--> |
| | | <el-tooltip v-if="showLock" |
| | | :content="$t('navbar.lock')" |
| | | effect="dark" |
| | |
| | | <top-theme></top-theme> |
| | | </div> |
| | | </el-tooltip> |
| | | <!-- 消息通知--> |
| | | <!-- <el-tooltip :content="$t('navbar.notice')"--> |
| | | <!-- effect="dark"--> |
| | | <!-- placement="bottom">--> |
| | | <!-- <div class="top-bar__item top-bar__item--show">--> |
| | | <!-- <top-notice></top-notice>--> |
| | | <!-- </div>--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- 消息通知--> |
| | | <!-- <el-tooltip :content="$t('navbar.notice')"--> |
| | | <!-- effect="dark"--> |
| | | <!-- placement="bottom">--> |
| | | <!-- <div class="top-bar__item top-bar__item--show">--> |
| | | <!-- <top-notice></top-notice>--> |
| | | <!-- </div>--> |
| | | <!-- </el-tooltip>--> |
| | | <el-tooltip :content="$t('navbar.language')" |
| | | effect="dark" |
| | | placement="bottom"> |
| | |
| | | @click="handleScreen"></i> |
| | | </div> |
| | | </el-tooltip> |
| | | <img :src="userInfo.avatar" |
| | | class="top-bar__img"> |
| | | <el-dropdown> |
| | | <span class="el-dropdown-link"> |
| | | <el-tooltip content="个人信息"> |
| | | <div> |
| | | <img :src="avatar" |
| | | class="top-bar__img" |
| | | @click="gotoInfo"> |
| | | </div> |
| | | </el-tooltip> |
| | | |
| | | <el-tooltip content="退出登录"> |
| | | <div> |
| | | <span style="font-size: 16px" @click="logout"> |
| | | {{ userInfo.userName }} |
| | | <i class="el-icon-arrow-down el-icon--right"></i> |
| | | </span> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item> |
| | | <router-link to="/">{{ $t('navbar.dashboard') }}</router-link> |
| | | </el-dropdown-item> |
| | | <el-dropdown-item @click.native="changePasswordHandler"> |
| | | <!-- <router-link to="/info/index">{{ $t('navbar.userinfo') }}</router-link>--> |
| | | 修改密码 |
| | | </el-dropdown-item> |
| | | <el-dropdown-item v-if="this.website.switchMode" @click.native="switchDept" |
| | | >{{ $t('navbar.switchDept') }} |
| | | </el-dropdown-item> |
| | | <el-dropdown-item divided |
| | | @click.native="logout">{{ $t('navbar.logOut') }} |
| | | </el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </div> |
| | | </el-tooltip> |
| | | |
| | | <el-dialog :visible.sync="userBox" |
| | | append-to-body |
| | | title="用户信息选择" |
| | |
| | | <avue-form ref="form" v-model="userForm" :option="userOption" @submit="submitSwitch"/> |
| | | </el-dialog> |
| | | |
| | | <!-- 修改密码对话框 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="passwordVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="修改密码" |
| | | width="50%"> |
| | | <avue-form ref="form" v-model="passwordForm" :option="passwordOption" @submit="submitSwitch"/> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import {resetRouter} from '@/router/router' |
| | | import {resetRouter} from '../../../router/router' |
| | | import {mapGetters, mapState} from "vuex"; |
| | | import {fullscreenToggel, listenfullscreen} from "@/util/util"; |
| | | import topLock from "./top-lock"; |
| | |
| | | import topColor from "./top-color"; |
| | | import topNotice from './top-notice' |
| | | import topLang from "./top-lang"; |
| | | import {changePassword} from "@/api/user" |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | name: "top", |
| | | data() { |
| | | return { |
| | | passwordVisible: false, |
| | | passwordForm: {}, |
| | | passwordOption: { |
| | | submitText:'保存', |
| | | column: [ |
| | | { |
| | | label: '登陆密码', |
| | | prop: 'oldPassword', |
| | | span: 24, |
| | | labelWidth:"15%", |
| | | type:'password', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入登陆密码', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '新登陆密码', |
| | | prop: 'password', |
| | | span: 24, |
| | | labelWidth:"15%", |
| | | type:'password', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入新登陆密码', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '新密码登陆确认', |
| | | prop: 'confirmPassword', |
| | | span: 24, |
| | | labelWidth:"15%", |
| | | type:'password', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请确认登陆密码', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | }, |
| | | userBox: false, |
| | | userForm: { |
| | | deptId: '', |
| | |
| | | listenfullscreen(this.setScreen); |
| | | }, |
| | | computed: { |
| | | avatar(){ |
| | | return this.userInfo.avatar |
| | | }, |
| | | ...mapState({ |
| | | showDebug: state => state.common.showDebug, |
| | | showTheme: state => state.common.showTheme, |
| | |
| | | ]) |
| | | }, |
| | | methods: { |
| | | // 修改密码 |
| | | changePasswordHandler() { |
| | | this.passwordVisible = true; |
| | | }, |
| | | handleScreen() { |
| | | fullscreenToggel(); |
| | | }, |
| | |
| | | }, |
| | | setScreen() { |
| | | this.$store.commit("SET_FULLSCREN"); |
| | | }, |
| | | gotoInfo() { |
| | | this.$router.push({path: '/info'}); |
| | | }, |
| | | switchDept() { |
| | | const userId = this.userInfo.user_id; |
| | |
| | | roleColumn.display = true; |
| | | this.userBox = true; |
| | | }, |
| | | submitSwitch(form, done) { |
| | | let userInfo = JSON.parse(localStorage.getItem('saber-userInfo')); |
| | | |
| | | let params = { |
| | | userOid:userInfo.content.userOid, |
| | | oldPassword:func.encryptData(form.oldPassword,'daliantan0v0vcip'), |
| | | password:func.encryptData(form.password,'daliantan0v0vcip'), |
| | | confirmPassword:func.encryptData(form.confirmPassword,'daliantan0v0vcip'), |
| | | |
| | | } |
| | | changePassword(params).then(res =>{ |
| | | if(res.data.code === 200){ |
| | | this.$message.success(res.data.msg); |
| | | this.passwordVisible = false; |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | // this.$store.dispatch("refreshToken", form).then(() => { |
| | | // this.userBox = false; |
| | | // this.$router.push({path: "/"}); |
| | | // }) |
| | | done(); |
| | | // 关闭修改密码对话框 |
| | | passwordClose() { |
| | | this.$refs.form.resetFields(); |
| | | }, |
| | | |
| | | logout() { |
| | | this.$confirm(this.$t("logoutTip"), this.$t("tip"), { |
| | | confirmButtonText: this.$t("submitText"), |
| | |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.$store.dispatch("LogOut").then(() => { |
| | | console.log('123'); |
| | | resetRouter(); |
| | | this.$router.push({path: "/login"}); |
| | | }); |