|
@ -46,9 +46,7 @@ |
|
|
mode="horizontal" |
|
|
mode="horizontal" |
|
|
class="aui-navbar__menu mr-auto z-div" |
|
|
class="aui-navbar__menu mr-auto z-div" |
|
|
> |
|
|
> |
|
|
<el-menu-item |
|
|
<el-menu-item @click="toIndexPage"> |
|
|
@click="toIndexPage" |
|
|
|
|
|
> |
|
|
|
|
|
<span>首页</span> |
|
|
<span>首页</span> |
|
|
</el-menu-item> |
|
|
</el-menu-item> |
|
|
|
|
|
|
|
@ -104,12 +102,11 @@ |
|
|
<i class="el-icon-arrow-down"></i> |
|
|
<i class="el-icon-arrow-down"></i> |
|
|
</span> |
|
|
</span> |
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
<el-dropdown-item |
|
|
<el-dropdown-item @click.native="updatePasswordHandle()">{{ |
|
|
@click.native="updatePasswordHandle()" |
|
|
$t("updatePassword.title") |
|
|
>{{ $t('updatePassword.title') }}</el-dropdown-item |
|
|
}}</el-dropdown-item> |
|
|
> |
|
|
|
|
|
<el-dropdown-item @click.native="logoutHandle()">{{ |
|
|
<el-dropdown-item @click.native="logoutHandle()">{{ |
|
|
$t('logout') |
|
|
$t("logout") |
|
|
}}</el-dropdown-item> |
|
|
}}</el-dropdown-item> |
|
|
</el-dropdown-menu> |
|
|
</el-dropdown-menu> |
|
|
</el-dropdown> |
|
|
</el-dropdown> |
|
@ -127,119 +124,121 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { messages } from '@/i18n' |
|
|
import { messages } from "@/i18n"; |
|
|
import { mapGetters } from 'vuex' |
|
|
import { mapGetters } from "vuex"; |
|
|
import screenfull from 'screenfull' |
|
|
import screenfull from "screenfull"; |
|
|
import UpdatePasswordWork from './main-navbar-update-password-work' |
|
|
import UpdatePasswordWork from "./main-navbar-update-password-work"; |
|
|
import { clearLoginInfo } from '@/utils' |
|
|
import { clearLoginInfo } from "@/utils"; |
|
|
export default { |
|
|
export default { |
|
|
inject: ['refresh'], |
|
|
inject: ["refresh"], |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
showHeader: true, |
|
|
showHeader: true, |
|
|
i18nMessages: messages, |
|
|
i18nMessages: messages, |
|
|
updatePassowrdVisible: false, |
|
|
updatePassowrdVisible: false, |
|
|
customerName: localStorage.getItem('customerName') |
|
|
customerName: "", |
|
|
} |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
components: { |
|
|
components: { |
|
|
UpdatePasswordWork |
|
|
UpdatePasswordWork, |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
let platformToken = localStorage.getItem('showHeader') || '' |
|
|
let platformToken = localStorage.getItem("showHeader") || ""; |
|
|
if ( |
|
|
if ( |
|
|
typeof platformToken !== 'undefined' && |
|
|
typeof platformToken !== "undefined" && |
|
|
platformToken !== 'undefined' && |
|
|
platformToken !== "undefined" && |
|
|
platformToken !== '' |
|
|
platformToken !== "" |
|
|
) { |
|
|
) { |
|
|
this.showHeader = false |
|
|
this.showHeader = false; |
|
|
} |
|
|
} |
|
|
console.log('=============================', this.userType) |
|
|
this.changeCustomerName(); |
|
|
|
|
|
console.log("=============================", this.userType); |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
userType() { |
|
|
userType() { |
|
|
return localStorage.getItem('userType') |
|
|
return localStorage.getItem("userType"); |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
toIndexPage(){ |
|
|
toIndexPage() { |
|
|
this.$router.replace('/indexWork') |
|
|
this.$router.replace("/indexWork"); |
|
|
}, |
|
|
}, |
|
|
// 通过menuId与动态(菜单)路由进行匹配跳转至指定路由 |
|
|
// 通过menuId与动态(菜单)路由进行匹配跳转至指定路由 |
|
|
gotoRouteHandle(menuId, idx) { |
|
|
gotoRouteHandle(menuId, idx) { |
|
|
var route = window.SITE_CONFIG['dynamicMenuRoutes'].filter( |
|
|
var route = window.SITE_CONFIG["dynamicMenuRoutes"].filter( |
|
|
(item) => item.meta.menuId === menuId |
|
|
(item) => item.meta.menuId === menuId |
|
|
)[0] |
|
|
)[0]; |
|
|
if (route) { |
|
|
if (route) { |
|
|
this.$router.push({ name: route.name }) |
|
|
this.$router.push({ name: route.name }); |
|
|
} |
|
|
} |
|
|
this.$store.state.LevelOneMenuActiveName = menuId |
|
|
this.$store.state.LevelOneMenuActiveName = menuId; |
|
|
this.$store.state.sidebarActiveSubMenuList = |
|
|
this.$store.state.sidebarActiveSubMenuList = |
|
|
this.$store.state.sidebarMenuList[idx].children || [] |
|
|
this.$store.state.sidebarMenuList[idx].children || []; |
|
|
}, |
|
|
}, |
|
|
changeCustomerName(customerName) { |
|
|
changeCustomerName(customerName) { |
|
|
this.customerName = localStorage.getItem('customerName') |
|
|
this.customerName = |
|
|
|
|
|
localStorage.getItem("customerName") || "党建引领基层治理互联管理平台"; |
|
|
}, |
|
|
}, |
|
|
// 全屏 |
|
|
// 全屏 |
|
|
fullscreenHandle() { |
|
|
fullscreenHandle() { |
|
|
if (!screenfull.enabled) { |
|
|
if (!screenfull.enabled) { |
|
|
return this.$message({ |
|
|
return this.$message({ |
|
|
message: this.$t('fullscreen.prompt'), |
|
|
message: this.$t("fullscreen.prompt"), |
|
|
type: 'warning', |
|
|
type: "warning", |
|
|
duration: 500 |
|
|
duration: 500, |
|
|
}) |
|
|
}); |
|
|
} |
|
|
} |
|
|
screenfull.toggle() |
|
|
screenfull.toggle(); |
|
|
}, |
|
|
}, |
|
|
// 修改密码 |
|
|
// 修改密码 |
|
|
updatePasswordHandle() { |
|
|
updatePasswordHandle() { |
|
|
this.updatePassowrdVisible = true |
|
|
this.updatePassowrdVisible = true; |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.$refs.updatePassowrd.init() |
|
|
this.$refs.updatePassowrd.init(); |
|
|
}) |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
// 退出 |
|
|
// 退出 |
|
|
logoutHandle() { |
|
|
logoutHandle() { |
|
|
this.$confirm( |
|
|
this.$confirm( |
|
|
this.$t('prompt.info', { handle: this.$t('logout') }), |
|
|
this.$t("prompt.info", { handle: this.$t("logout") }), |
|
|
this.$t('prompt.title'), |
|
|
this.$t("prompt.title"), |
|
|
{ |
|
|
{ |
|
|
confirmButtonText: this.$t('confirm'), |
|
|
confirmButtonText: this.$t("confirm"), |
|
|
cancelButtonText: this.$t('cancel'), |
|
|
cancelButtonText: this.$t("cancel"), |
|
|
type: 'warning' |
|
|
type: "warning", |
|
|
} |
|
|
} |
|
|
) |
|
|
) |
|
|
.then(() => { |
|
|
.then(() => { |
|
|
//关闭所有标签页 |
|
|
//关闭所有标签页 |
|
|
// tabs, 关闭全部 |
|
|
// tabs, 关闭全部 |
|
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter( |
|
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter( |
|
|
(item) => item.name === 'home' |
|
|
(item) => item.name === "home" |
|
|
) |
|
|
); |
|
|
|
|
|
|
|
|
this.$http |
|
|
this.$http |
|
|
.post('/auth/login/logout') |
|
|
.post("/auth/login/logout") |
|
|
.then(({ data: res }) => { |
|
|
.then(({ data: res }) => { |
|
|
if (res.code !== 0) { |
|
|
if (res.code !== 0) { |
|
|
//别处登陆时 退出不提示 直接跳登陆页即可 |
|
|
//别处登陆时 退出不提示 直接跳登陆页即可 |
|
|
if (res.code !== 10007) { |
|
|
if (res.code !== 10007) { |
|
|
this.$message.error(res.msg) |
|
|
this.$message.error(res.msg); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
clearLoginInfo() |
|
|
clearLoginInfo(); |
|
|
this.$router.push({ name: 'login' }) |
|
|
this.$router.push({ name: "login" }); |
|
|
// if (localStorage.getItem('userType') === 'work') { |
|
|
// if (localStorage.getItem('userType') === 'work') { |
|
|
// this.$router.push({ name: 'loginWork' }) |
|
|
// this.$router.push({ name: 'loginWork' }) |
|
|
// } else { |
|
|
// } else { |
|
|
// this.$router.push({ name: 'login' }) |
|
|
// this.$router.push({ name: 'login' }) |
|
|
// } |
|
|
// } |
|
|
}) |
|
|
}) |
|
|
.catch(() => {}) |
|
|
.catch(() => {}); |
|
|
}) |
|
|
}) |
|
|
.catch(() => {}) |
|
|
.catch(() => {}); |
|
|
} |
|
|
}, |
|
|
} |
|
|
}, |
|
|
} |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
.main-line { |
|
|
.main-line { |
|
|