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

perf:修改页面

parent debf7335
...@@ -58,6 +58,9 @@ export default { ...@@ -58,6 +58,9 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.app {
min-width: 1600px;
}
.export { .export {
background-color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.3);
} }
......
import http from "../request/http"; 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. 查询站点编排列表 // 1.16.1. 查询站点编排列表
export function appsListInterface(params) { 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"; ...@@ -6,6 +6,11 @@ import store from "./store";
import Antd from "ant-design-vue"; import Antd from "ant-design-vue";
import "ant-design-vue/dist/antd.css"; import "ant-design-vue/dist/antd.css";
import { message } from "ant-design-vue";
message.config({
duration: 2,
maxCount: 1,
});
Vue.use(Antd); Vue.use(Antd);
import GlobalComponents from "./utils/js/globalComponents"; import GlobalComponents from "./utils/js/globalComponents";
......
...@@ -21,19 +21,19 @@ const router = new VueRouter({ ...@@ -21,19 +21,19 @@ const router = new VueRouter({
routes: routeConfig, routes: routeConfig,
}); });
// router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// let islogin = store.getters["user/token"]; let islogin = store.getters["user/token"];
// if (islogin) { if (islogin) {
// next(); next();
// } else { } else {
// // 再次判断防止死循环 // 再次判断防止死循环
// if (to.path === "/") { if (to.path === "/") {
// next(); next();
// } else { } else {
// next({ path: "/" }); next({ path: "/" });
// } }
// } }
// }); });
router.afterEach((to, from, next) => { router.afterEach((to, from, next) => {
window.scrollTo(0, 0); window.scrollTo(0, 0);
......
...@@ -5,8 +5,8 @@ export default { ...@@ -5,8 +5,8 @@ export default {
menuTree_X: [], //树型结构 menuTree_X: [], //树型结构
}, },
getters: { getters: {
menuList_X: state => state.menuList_X, menuList_X: (state) => state.menuList_X,
menuTree_X: state => state.menuTree_X, menuTree_X: (state) => state.menuTree_X,
}, },
mutations: { mutations: {
SET_menuList_X(state, data) { SET_menuList_X(state, data) {
...@@ -16,10 +16,7 @@ export default { ...@@ -16,10 +16,7 @@ export default {
SET_menuTree_X(state, data) { SET_menuTree_X(state, data) {
state.menuTree_X = data; state.menuTree_X = data;
// console.log(state.menuTree_X); // console.log(state.menuTree_X);
}
}, },
actions: { },
actions: {},
} };
}
<template> <template>
<div class="route-view min-h-full w-full flex"> <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> <a-space>
<img <img
class="logo cursor-pointer" class="logo cursor-pointer"
...@@ -20,14 +23,28 @@ ...@@ -20,14 +23,28 @@
</div> </div>
</a-space> </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"> <a-menu-item v-for="v in homeMenus" :key="v.url">
{{ v.name }} {{ v.name }}
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
<!-- 时间、用户信息展示 --> <!-- 时间、用户信息展示 -->
<div class="flex items-center"> <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="time mb-1">{{ nowTime }}</div>
<div class="date">{{ nowDay }} {{ nowWeek }}</div> <div class="date">{{ nowDay }} {{ nowWeek }}</div>
</div> </div>
...@@ -81,6 +98,12 @@ export default { ...@@ -81,6 +98,12 @@ export default {
nowDay: "", nowDay: "",
nowWeek: "", nowWeek: "",
visibleEditPwd: false, visibleEditPwd: false,
homePage: [
"/home/dataManagement",
"/home/siteArrange",
"/home/dataActuary",
"/home/thePlatformIsSet/setPlatformes",
],
}; };
}, },
computed: { computed: {
...@@ -94,6 +117,11 @@ export default { ...@@ -94,6 +117,11 @@ export default {
} }
return [path]; 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() { created() {
this.setMoment(); this.setMoment();
...@@ -107,7 +135,12 @@ export default { ...@@ -107,7 +135,12 @@ export default {
this.$router.go(0); this.$router.go(0);
}, },
backHome() { backHome() {
this.$router.push("/datamanage"); let path = storage.get(1, "routeInfo");
if (path) {
this.$router.push(path);
} else {
this.$router.push("/home");
}
}, },
setMoment() { setMoment() {
this.timer = setInterval(() => { this.timer = setInterval(() => {
...@@ -144,6 +177,7 @@ export default { ...@@ -144,6 +177,7 @@ export default {
}); });
}, },
handelClick(route) { handelClick(route) {
storage.set(1, "routeInfo", route.key);
this.$router.push(route.key); this.$router.push(route.key);
}, },
}, },
...@@ -245,4 +279,7 @@ export default { ...@@ -245,4 +279,7 @@ export default {
background: #ffffff; background: #ffffff;
} }
} }
.inside {
background: linear-gradient(90deg, #1845c6 0%, #2999ff 100%) !important;
}
</style> </style>
\ No newline at end of file
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<script> <script>
import { LoginInterface } from "@/api/user.js"; import { LoginInterface } from "@/api/user.js";
import { mapMutations } from "vuex"; import { mapMutations, mapState } from "vuex";
import { changeAccount } from "@/utils/js/validate"; import { changeAccount } from "@/utils/js/validate";
import { encrypt } from "@/utils"; import { encrypt } from "@/utils";
import storage from "@/utils/js/Storage"; import storage from "@/utils/js/Storage";
...@@ -97,7 +97,13 @@ export default { ...@@ -97,7 +97,13 @@ export default {
}, },
}; };
}, },
computed: {
...mapState("user", ["token"]),
},
created() { created() {
if (this.token) {
this.$router.push("/home");
}
this.createCode(); this.createCode();
}, },
methods: { 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