Commit 8d2fb69e authored by “yiyousong”'s avatar “yiyousong”

perf:修改页面

parent debf7335
......@@ -58,6 +58,9 @@ export default {
</script>
<style lang="less" scoped>
.app {
min-width: 1600px;
}
.export {
background-color: rgba(0, 0, 0, 0.3);
}
......
import http from "../request/http";
let baseURL = process.env.VUE_APP_API_BASE_URL
let baseURL = process.env.VUE_APP_API_BASE_URL;
// 1.16.1. 查询站点编排列表
export function appsListInterface(params) {
return http.post(`${baseURL}/zwfw/site/model/list`, params);
return http.post(`${baseURL}/zwfw/site/model/list/group`, params);
}
// 获取收藏
export function getCollect(params) {
return http.post(`${baseURL}/zwfw/user/model/collect/get`, params);
}
// 保存收藏
export function saveCollect(params) {
return http.post(`${baseURL}/zwfw/user/model/collect/save`, params);
}
......@@ -6,6 +6,11 @@ import store from "./store";
import Antd from "ant-design-vue";
import "ant-design-vue/dist/antd.css";
import { message } from "ant-design-vue";
message.config({
duration: 2,
maxCount: 1,
});
Vue.use(Antd);
import GlobalComponents from "./utils/js/globalComponents";
......
......@@ -21,19 +21,19 @@ const router = new VueRouter({
routes: routeConfig,
});
// router.beforeEach((to, from, next) => {
// let islogin = store.getters["user/token"];
// if (islogin) {
// next();
// } else {
// // 再次判断防止死循环
// if (to.path === "/") {
// next();
// } else {
// next({ path: "/" });
// }
// }
// });
router.beforeEach((to, from, next) => {
let islogin = store.getters["user/token"];
if (islogin) {
next();
} else {
// 再次判断防止死循环
if (to.path === "/") {
next();
} else {
next({ path: "/" });
}
}
});
router.afterEach((to, from, next) => {
window.scrollTo(0, 0);
......
......@@ -5,8 +5,8 @@ export default {
menuTree_X: [], //树型结构
},
getters: {
menuList_X: state => state.menuList_X,
menuTree_X: state => state.menuTree_X,
menuList_X: (state) => state.menuList_X,
menuTree_X: (state) => state.menuTree_X,
},
mutations: {
SET_menuList_X(state, data) {
......@@ -16,10 +16,7 @@ export default {
SET_menuTree_X(state, data) {
state.menuTree_X = data;
// console.log(state.menuTree_X);
}
},
actions: {
}
}
},
actions: {},
};
<template>
<div class="route-view min-h-full w-full flex">
<div class="header w-full flex justify-between items-center text-white">
<div
class="header w-full flex justify-between items-center text-white"
:class="{ inside: !isHomePage }"
>
<a-space>
<img
class="logo cursor-pointer"
......@@ -20,14 +23,28 @@
</div>
</a-space>
<!-- 菜单 -->
<a-menu :selectedKeys="current" @click="handelClick" mode="horizontal">
<a-menu
v-if="isHomePage"
:selectedKeys="current"
@click="handelClick"
mode="horizontal"
>
<a-menu-item v-for="v in homeMenus" :key="v.url">
{{ v.name }}
</a-menu-item>
</a-menu>
<!-- 时间、用户信息展示 -->
<div class="flex items-center">
<div class="show-time flex flex-col items-end">
<!-- 返回门户 -->
<div
v-if="!isHomePage"
class="flex flex-col items-center cursor-pointer"
@click="backHome"
>
<a-icon type="desktop" class="desktop mb-1" />
<p class="text-[14px]">返回门户</p>
</div>
<div v-if="isHomePage" class="show-time flex flex-col items-end">
<div class="time mb-1">{{ nowTime }}</div>
<div class="date">{{ nowDay }} {{ nowWeek }}</div>
</div>
......@@ -81,6 +98,12 @@ export default {
nowDay: "",
nowWeek: "",
visibleEditPwd: false,
homePage: [
"/home/dataManagement",
"/home/siteArrange",
"/home/dataActuary",
"/home/thePlatformIsSet/setPlatformes",
],
};
},
computed: {
......@@ -94,6 +117,11 @@ export default {
}
return [path];
},
isHomePage() {
let cur = this.$route.path;
let curParent = this.$route.matched[1]?.path;
return this.homePage.includes(cur) || this.homePage.includes(curParent);
},
},
created() {
this.setMoment();
......@@ -107,7 +135,12 @@ export default {
this.$router.go(0);
},
backHome() {
this.$router.push("/datamanage");
let path = storage.get(1, "routeInfo");
if (path) {
this.$router.push(path);
} else {
this.$router.push("/home");
}
},
setMoment() {
this.timer = setInterval(() => {
......@@ -144,6 +177,7 @@ export default {
});
},
handelClick(route) {
storage.set(1, "routeInfo", route.key);
this.$router.push(route.key);
},
},
......@@ -245,4 +279,7 @@ export default {
background: #ffffff;
}
}
.inside {
background: linear-gradient(90deg, #1845c6 0%, #2999ff 100%) !important;
}
</style>
\ No newline at end of file
......@@ -67,7 +67,7 @@
<script>
import { LoginInterface } from "@/api/user.js";
import { mapMutations } from "vuex";
import { mapMutations, mapState } from "vuex";
import { changeAccount } from "@/utils/js/validate";
import { encrypt } from "@/utils";
import storage from "@/utils/js/Storage";
......@@ -97,7 +97,13 @@ export default {
},
};
},
computed: {
...mapState("user", ["token"]),
},
created() {
if (this.token) {
this.$router.push("/home");
}
this.createCode();
},
methods: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment