Commit 13e21e21 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化页面

parent 81682abb
......@@ -16,6 +16,8 @@ import "@/assets/css/reset.css";
import "@/assets/css/common.less";
import "@/assets/css/tailwindcss.css";
// nprogress样式
// import "nprogress/nprogress.css";
// 事件总线
Vue.prototype.$bus = new Vue();
......
<template>
<div class="home flex min-h-full w-full flex-col items-center">
<div
class="home flex min-h-full w-full flex-col items-center"
v-loading="loading"
>
<div class="top-data-total flex h-[360px] w-full justify-center pt-[66px]">
<div class="flex h-full flex-col">
<div class="mb-[53px] flex flex-col items-center">
......@@ -86,6 +89,7 @@ export default {
},
data() {
return {
loading: false,
totalDataset: {
dimensions: ["name", "value"],
source: [],
......@@ -107,7 +111,9 @@ export default {
mounted() {},
methods: {
async getHomeData() {
this.loading = true;
let res = await getHomeData();
this.loading = false;
if (res.data.code == 1) {
let { data } = res.data;
let { thirtyPhStatList, thirtyPjStatList, thirtyStatList } = data;
......
......@@ -6,7 +6,7 @@ import router from "@/router";
import store from "@/store";
import { message } from "@/utils/resetMessage";
// 加载条插件
import NProgress from "nprogress";
// import NProgress from "nprogress";
// 请求超时时间
axios.defaults.timeout = 60 * 1000;
......@@ -20,7 +20,7 @@ axios.interceptors.request.use(
if (token) {
config.headers.Authorization = token;
}
NProgress.start();
// NProgress.start();
return config;
},
(err) => {
......@@ -52,7 +52,7 @@ axios.interceptors.response.use(
}, 2000);
}
}
NProgress.done();
// NProgress.done();
return response;
},
(error) => {
......@@ -103,8 +103,6 @@ axios.interceptors.response.use(
}
message.error({
message: error.message,
maxCount: 1,
duration: 1,
});
return Promise.resolve(error.response);
......
......@@ -22,7 +22,7 @@ const Messages = (opt) => {
if (typeof opt === "string") {
opt = {
message: opt,
duration: 1000,
duration: 3000,
};
}
......
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