| | |
| | | <div>
|
| | | <a-layout id="components-layout-demo-custom-trigger" :style="{ height: '100vh' }">
|
| | | <a-layout-sider v-model="collapsed" :trigger="null" collapsible>
|
| | | <div class="logo">{{ collapsed ? collapsed : '预警响应系统' }}</div>
|
| | | <div class="logo" v-if="!collapsed">{{ '预警响应系统' }}</div>
|
| | | <div class="logo" v-else><a-icon type="alert" /></div>
|
| | | <menuSider />
|
| | | </a-layout-sider>
|
| | | <a-layout>
|
| | |
| | | margin: '15px 16px 24px 16px',
|
| | | }">
|
| | | <!-- Content -->
|
| | | <router-view ref="tabContent"></router-view>
|
| | | <keep-alive include="notice">
|
| | | <router-view ref="tabContent"></router-view>
|
| | | </keep-alive>
|
| | | <div style="height: 30px;text-align: center;line-height: 30px">
|
| | | 技术支持:中国科学院
|
| | | </div>
|
| | |
| | | import menuSider from "@/layout/menuSider";
|
| | | import TabsHeader from '@/components/TabsHeader';
|
| | | import pwdMod from "@/views/Admin/components/pwdMod";
|
| | | import { loginOut } from "@/api/login";
|
| | | import { Session } from '@/util/storage';
|
| | | import Cookies from 'js-cookie';
|
| | | import { loginOut, getDistrictInfo } from "@/api/login";
|
| | | import { Session, getUserInfo} from '@/util/storage';
|
| | | import Cookies from "js-cookie";
|
| | | export default {
|
| | | name: "Home",
|
| | | data() {
|
| | | return {
|
| | | userInfo: {},
|
| | | userInfo: getUserInfo(),
|
| | | collapsed: false, //返回logo图片或表述
|
| | | pageList: [],
|
| | | activePage: '',
|
| | |
| | | pwdMod
|
| | | },
|
| | | created() {
|
| | | this.userInfo = JSON.parse(Cookies.get('userInfo'))
|
| | | const route = this.$route
|
| | | if (this.pageList.findIndex(item => item.path === route.path) === -1) {
|
| | | this.pageList.push(this.createPage(route))
|
| | |
| | | cancelText: '取消',
|
| | | okText: '确认',
|
| | | centered: true,
|
| | | async onOk() {
|
| | | const res = await loginOut()
|
| | | if (res.data.code === 100) {
|
| | | Session.clear(); // 清除缓存/token等
|
| | | // 使用 reload 时,不需要调用 resetRoute() 重置路由
|
| | | t.$router.push('/')
|
| | | // window.location.reload();
|
| | | } else {
|
| | | this.$message.warning(res.data.msg);
|
| | | }
|
| | | onOk() {
|
| | | loginOut().then(res=>{
|
| | | if (res.data.code === 100) {
|
| | | Session.clear(); // 清除缓存/token等
|
| | | // 使用 reload 时,不需要调用 resetRoute() 重置路由
|
| | | t.$router.push('/')
|
| | | // window.location.reload();
|
| | | } else {
|
| | | this.$message.warning(res.data.msg);
|
| | | }
|
| | | })
|
| | | },
|
| | | onCancel() {
|
| | | console.log('Cancel');
|
| | |
| | | class: 'test',
|
| | | });
|
| | | },
|
| | |
|
| | | // async getDistrictInfo(){
|
| | | // let res = await getDistrictInfo()
|
| | | // if(res.data.code == 100){
|
| | | // console.log(res.data.data)
|
| | | // Cookies.set('district', res.data.data);
|
| | | // console.log(Cookies.get('district'),666)
|
| | | // } else {
|
| | | // this.$message.warning(res.data.msg);
|
| | | // }
|
| | | // },
|
| | |
|
| | | changePage(key) {
|
| | | this.activePage = key
|
| | | const page = this.pageList.find(item => item.path === key)
|