-
-
-
-
-
-
-
-
\ No newline at end of file
+
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index b4c4059..1842e2f 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -8,6 +8,8 @@ import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import Pagination from '@/components/Pagination/index.vue';
import '@/permission';
+import Antd from 'ant-design-vue'
+import 'ant-design-vue/dist/reset.css' // Ant Design 全局样式重置
// 引入svg注册脚本
import 'virtual:svg-icons-register';
@@ -39,6 +41,7 @@ app
.component('Pagination', Pagination)
.use(router)
.use(ElementPlus)
+ .use(Antd)
.use(WujieVue)
.use(i18n)
.mount('#app');
diff --git a/frontend/src/permission.ts b/frontend/src/permission.ts
index 9be434e..d023247 100644
--- a/frontend/src/permission.ts
+++ b/frontend/src/permission.ts
@@ -5,20 +5,35 @@ import { usePermissionStoreHook } from '@/store/modules/permission';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
-NProgress.configure({ showSpinner: false }); // 进度条
+NProgress.configure({ showSpinner: false });
const permissionStore = usePermissionStoreHook();
// 白名单路由
const whiteList = ['/login'];
-if (import.meta.env.DEV) {
- whiteList.push('/process/antd-demo');
+// 查找第一个可用路由
+function findFirstAvailableRoute(routes: RouteRecordRaw[]): string | undefined {
+ for (const route of routes) {
+ if (route.meta?.hidden) continue;
+
+ if (route.children?.length > 0) {
+ const child = route.children[0];
+ // 优先使用 opturl 或 path
+ const targetPath = child.opturl || child.path;
+ return targetPath?.startsWith('/') ? targetPath : `/${targetPath}`;
+ }
+
+ const targetPath = route.opturl || route.path;
+ return targetPath;
+ }
+ return '/404';
}
router.beforeEach(async (to, from, next) => {
NProgress.start();
const userStore = useUserStoreHook();
+
if (userStore.Token) {
// 登录成功,跳转到首页
if (to.path === '/login') {
@@ -26,9 +41,19 @@ router.beforeEach(async (to, from, next) => {
NProgress.done();
} else {
const hasGetUserInfo = userStore.roles.length > 0;
- // const hasGetUserInfo = true;
+
if (hasGetUserInfo) {
+ // 已获取用户信息,检查路由匹配
if (to.matched.length === 0) {
+ // 路由未匹配,可能是访问根路径
+ if (to.path === '/') {
+ const firstRoute = findFirstAvailableRoute(permissionStore.routes);
+ if (firstRoute) {
+ next(firstRoute);
+ NProgress.done();
+ return;
+ }
+ }
from.name ? next({ name: from.name as any }) : next('/401');
} else {
next();
@@ -36,15 +61,25 @@ router.beforeEach(async (to, from, next) => {
} else {
try {
const { roles } = await userStore.getInfo();
- const accessRoutes: RouteRecordRaw[] =
- await permissionStore.generateRoutes(roles);
-
+ const accessRoutes: RouteRecordRaw[] = await permissionStore.generateRoutes(roles);
+
accessRoutes.forEach((route: any) => {
router.addRoute(route);
});
+
+ // 关键:如果是根路径,加载完路由后跳转到第一个可用路由
+ if (to.path === '/') {
+ const firstRoute = findFirstAvailableRoute(accessRoutes);
+ if (firstRoute) {
+ next(firstRoute);
+ NProgress.done();
+ return;
+ }
+ }
+
next({ ...to, replace: true });
} catch (error) {
- // 移除 token 并跳转登录页
+ console.log(error);
await userStore.resetToken();
next(`/login?redirect=${to.path}`);
NProgress.done();
@@ -64,4 +99,4 @@ router.beforeEach(async (to, from, next) => {
router.afterEach(() => {
NProgress.done();
-});
+});
\ No newline at end of file
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 9ba4531..0f4a2eb 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -26,48 +26,11 @@ export const constantRoutes: RouteRecordRaw[] = [
component: () => import('@/views/error-page/404.vue'),
meta: { hidden: true }
},
-
- {
- path: '/',
- component: Layout,
- redirect: '/dashboard',
- children: [
- {
- path: 'dashboard',
- opturl: '/dashboard',
- component: () => import('@/views/dashboard/index.vue'),
- name: '首页',
- icon: 'homepage',
- meta: { title: 'dashboard', icon: 'homepage', affix: true }
- },
- {
- path: 'personalCenter',
- component: () => import('@/views/system/user/personalCenter.vue'),
- name: '个人中心',
- meta: { title: 'personalCenter',hidden: true, icon: 'personalCenter' }
- },
- {
- path: '401',
- component: () => import('@/views/error-page/401.vue'),
- meta: { hidden: true }
- },
- ]
- },
- {
- path: '/process',
- opturl: '/process',
- component: Layout,
- redirect: '/process/antd-demo',
- children: [
- {
- path: 'antd-demo',
- opturl: '/process/antd-demo',
- component: () => import('@/views/process/antd-demo.vue'),
- name: 'AntD Demo',
- meta: { title: 'AntD Demo' }
- }
- ]
- }
+ {
+ path: '/401',
+ component: () => import('@/views/error-page/401.vue'),
+ meta: { hidden: true }
+ },
];
// 创建路由
diff --git a/frontend/src/settings.ts b/frontend/src/settings.ts
index cd9b78b..a304503 100644
--- a/frontend/src/settings.ts
+++ b/frontend/src/settings.ts
@@ -10,7 +10,7 @@ interface DefaultSettings {
}
const defaultSettings: DefaultSettings = {
- title: '公司开发平台框架',
+ title: '水电水利建设项目全过程环境管理信息平台',
showSettings: false,
tagsView: true,
fixedHeader: true,
diff --git a/frontend/src/store/modules/app.ts b/frontend/src/store/modules/app.ts
index eb4d628..c57f6f9 100644
--- a/frontend/src/store/modules/app.ts
+++ b/frontend/src/store/modules/app.ts
@@ -1,5 +1,4 @@
import {
- getSidebarStatus,
setSidebarStatus,
getSize,
setSize,
@@ -24,7 +23,12 @@ export enum SizeType {
large,
small
}
-
+export const usetTheme = {
+ token: {
+ colorPrimary: '#1890ff',
+ borderRadius: 2,
+ },
+};
// setup
export const useAppStore = defineStore('app', () => {
// state
@@ -32,7 +36,6 @@ export const useAppStore = defineStore('app', () => {
const size = ref(getSize() || 'default');
const language = ref(getLanguage());
const sidebar = reactive({
- opened: getSidebarStatus() !== 'closed',
withoutAnimation: false
});
@@ -44,32 +47,6 @@ export const useAppStore = defineStore('app', () => {
}
});
- // actions
- function toggleSidebar(withoutAnimation: boolean) {
- sidebar.opened = !sidebar.opened;
- sidebar.withoutAnimation = withoutAnimation;
- if (sidebar.opened) {
- setSidebarStatus('opened');
- } else {
- setSidebarStatus('closed');
- }
- }
-
- function closeSideBar(withoutAnimation: boolean) {
- sidebar.opened = false;
- sidebar.withoutAnimation = withoutAnimation;
- setSidebarStatus('closed');
- }
-
- function openSideBar(withoutAnimation: boolean) {
- sidebar.opened = true;
- sidebar.withoutAnimation = withoutAnimation;
- setSidebarStatus('opened');
- }
-
- function toggleDevice(val: string) {
- device.value = val;
- }
function changeSize(val: string) {
size.value = val;
@@ -87,11 +64,7 @@ export const useAppStore = defineStore('app', () => {
language,
locale,
size,
- toggleDevice,
changeSize,
changeLanguage,
- toggleSidebar,
- closeSideBar,
- openSideBar
};
});
diff --git a/frontend/src/store/modules/permission.ts b/frontend/src/store/modules/permission.ts
index 1e632ea..fcfe553 100644
--- a/frontend/src/store/modules/permission.ts
+++ b/frontend/src/store/modules/permission.ts
@@ -8,24 +8,18 @@ import { ref } from 'vue';
const modules = import.meta.glob('../../views/**/**.vue');
export const Layout = () => import('@/layout/index.vue');
-// const hasPermission = (roles: string[], route: RouteRecordRaw) => {
-// if (route.meta && route.meta.roles) {
-// if (roles.includes('ROOT')) {
-// return true;
-// }
-// return roles.some(role => {
-// if (route.meta?.roles !== undefined) {
-// return (route.meta.roles as string[]).includes(role);
-// }
-// });
-// }
-// return false;
-// };
-
const filterAsyncRoutes = (routes: RouteRecordRaw[], roles: string[]) => {
const res: RouteRecordRaw[] = [];
routes.forEach(route => {
const tmp = { ...route } as any;
+ // ✅ 保存原始名称到 meta,用于菜单显示
+ tmp.meta = {
+ ...tmp.meta,
+ title: tmp.name || tmp.menuName, // 原始名称用于显示
+ };
+ // ✅ name 使用路径生成唯一值
+ tmp.name = tmp.path || tmp.opturl;
+
// if (hasPermission(roles, tmp)) {
tmp.path = tmp.opturl;
if (tmp.type == '0') {
diff --git a/frontend/src/store/modules/settings.ts b/frontend/src/store/modules/settings.ts
deleted file mode 100644
index 0b69453..0000000
--- a/frontend/src/store/modules/settings.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import { defineStore } from 'pinia';
-import defaultSettings from '../../settings';
-import { ref } from 'vue';
-import { useStorage } from '@vueuse/core';
-
-/**
- * 主题类型
- */
-export enum ThemeType {
- light,
- dark
-}
-
-/**
- * 布局类型
- */
-export enum LayoutType {
- left,
- top,
- mix
-}
-
-export const useSettingsStore = defineStore('setting', () => {
- // state
- const showSettings = ref
(defaultSettings.showSettings);
- const tagsView = useStorage('tagsView', defaultSettings.tagsView);
- const fixedHeader = ref(defaultSettings.fixedHeader);
- const sidebarLogo = ref(defaultSettings.sidebarLogo);
-
- const layout = useStorage('layout', defaultSettings.layout);
-
- // actions
- function changeSetting(param: { key: string; value: any }) {
- const { key, value } = param;
- switch (key) {
- case 'showSettings':
- showSettings.value = value;
- break;
- case 'fixedHeader':
- fixedHeader.value = value;
- break;
- case 'tagsView':
- tagsView.value = value;
- break;
- case 'sidevarLogo':
- sidebarLogo.value = value;
- break;
- case 'layout':
- layout.value = value;
- break;
- default:
- break;
- }
- }
-
- return {
- showSettings,
- tagsView,
- fixedHeader,
- sidebarLogo,
- layout,
- changeSetting
- };
-});
diff --git a/frontend/src/styles/element-plus.scss b/frontend/src/styles/element-plus.scss
index a54cd78..3ccbefd 100644
--- a/frontend/src/styles/element-plus.scss
+++ b/frontend/src/styles/element-plus.scss
@@ -4,56 +4,4 @@
--el-color-primary-dark: #0d84ff;
// --el-font-size-base: 16px !important;
}
-.el-button--large, .el-input--large, .el-table--large, .el-form--large, .el-select__tags-text{
- font-size: 16px !important;
- .el-form-item__label{
- font-size: 16px !important;
- }
- --el-font-size-base: 16px !important;
-}
-
-
-// 覆盖 element-plus 的样式
-.el-breadcrumb__inner,
-.el-breadcrumb__inner a {
- font-weight: 400 !important;
-}
-
-.el-upload {
- input[type='file'] {
- display: none !important;
- }
-}
-
-.el-upload__input {
- display: none;
-}
-
-// dropdown
-.el-dropdown-menu {
- a {
- display: block;
- }
-}
-
-// to fix el-date-picker css style
-.el-range-separator {
- box-sizing: content-box;
-}
-
-// 选中行背景色值
-.el-table__body tr.current-row td {
- background-color: #e1f3d8b5 !important;
-}
-
-// card 的header统一高度
-.el-card__header {
- height: 60px !important;
-}
-
-// 表格表头和表体未对齐
-.el-table__header col[name='gutter'] {
- display: table-cell !important;
-}
-
diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss
index e6e58e4..b472870 100644
--- a/frontend/src/styles/index.scss
+++ b/frontend/src/styles/index.scss
@@ -1,26 +1,34 @@
-@use 'src/styles/variables.module' as variables;
@use 'src/styles/element-plus' as element-plus;
@use './sidebar' as sidebar;
@use './tailwind' as tailwind;
-html,body,#app{
+html,
+body,
+#app {
height: 100%;
+ font-family: auto;
}
+/* Webkit 浏览器 (Chrome, Safari, Edge) */
+body::-webkit-scrollbar {
+ display: none;
+ width: 0;
+ height: 0;
+}
// main-container global css
.app-container {
padding: 20px;
}
-.search{
+.search {
padding: 18px 0 0 10px;
margin-bottom: 10px;
border-radius: 5px;
border: 1px solid #ddd;
- box-shadow: 6px 2px 6px #CCC;
+ box-shadow: 6px 2px 6px #ccc;
}
-svg{
+svg {
display: inline-block;
}
.el-dialog {
@@ -28,12 +36,12 @@ svg{
flex-direction: column !important;
margin: auto !important;
position: absolute !important;
- top: 0 ;
- left: 0 ;
+ top: 0;
+ left: 0;
right: 0;
bottom: 0;
height: max-content;
}
.el-dialog__body {
padding: 20px !important;
-}
\ No newline at end of file
+}
diff --git a/frontend/src/styles/sidebar.scss b/frontend/src/styles/sidebar.scss
index a0e5c74..c0973f3 100644
--- a/frontend/src/styles/sidebar.scss
+++ b/frontend/src/styles/sidebar.scss
@@ -1,5 +1,3 @@
-@use 'src/styles/variables.module' as variables;
-
svg {
vertical-align: text-bottom !important;
}
@@ -7,249 +5,13 @@ svg {
.main-container {
// min-height: 100%;
transition: margin-left 0.28s;
- margin-left: variables.$sideBarWidth;
position: relative;
}
- .sidebar-container {
- transition: width 0.28s;
- width: variables.$sideBarWidth !important;
- background-color: variables.$menuBg;
- height: calc(100vh - 60px);
- padding-top: 15px;
- position: absolute;
- top: 60px;
- bottom: 0;
- left: 0;
- z-index: 98;
- overflow: hidden;
-
- // reset element-ui css
- .horizontal-collapse-transition {
- transition: 0s width ease-in-out, 0s padding-left ease-in-out,
- 0s padding-right ease-in-out;
- }
-
- .scrollbar-wrapper {
- overflow-x: hidden !important;
- }
-
- .el-scrollbar__bar.is-vertical {
- right: 0px;
- }
-
- .el-scrollbar {
- height: 100%;
- }
-
- &.has-logo {
- .el-scrollbar {
- height: calc(100% - 50px);
- }
- }
-
- .is-horizontal {
- display: none;
- }
-
-
- .svg-icon {
- margin-right: 16px;
- }
-
- .sub-el-icon {
- margin-right: 12px;
- margin-left: -2px;
- }
-
- .el-menu {
- border: none;
- height: 100%;
- width: 100% !important;
- }
-
- // menu hover
- .submenu-title-noDropdown,
- .el-sub-menu__title {
- &:hover {
- color: variables.$menuHover !important;
- }
- }
-
- // .is-active > .el-sub-menu__title {
- // color: variables.$subMenuActiveText !important;
- // }
-
- & .nest-menu .el-sub-menu > .el-sub-menu__title,
- & .el-sub-menu .el-menu-item {
- min-width: variables.$sideBarWidth !important;
- background-color: variables.$subMenuBg !important;
-
- &:hover {
- color: variables.$subMenuHover !important;
- }
- }
- .el-menu-item.is-active {
- border-right: 3px solid variables.$subMenuHover;
- background: #e8f3ff !important;
- }
- }
-
- .hideSidebar {
- .sidebar-container {
- width: 54px !important;
- .svg-icon {
- margin-right: 0px;
- }
- }
-
- .main-container {
- margin-left: 54px;
- }
-
- .submenu-title-noDropdown {
- padding: 0 !important;
- position: relative;
-
- .el-tooltip {
- padding: 0 !important;
-
- .svg-icon {
- margin-left: 20px;
- }
-
- .sub-el-icon {
- margin-left: 19px;
- }
- }
- }
-
- .el-sub-menu {
- overflow: hidden;
-
- & > .el-sub-menu__title {
- padding: 0 !important;
-
- .svg-icon {
- margin-left: 20px;
- }
-
- .sub-el-icon {
- margin-left: 19px;
- }
-
- .el-sub-menu__icon-arrow {
- display: none;
- }
- }
-
- }
-
- .el-menu--collapse {
- .el-sub-menu {
- & > .el-sub-menu__title {
- & > span {
- height: 0;
- width: 0;
- overflow: hidden;
- visibility: hidden;
- display: inline-block;
- }
- }
- }
- }
- }
-
- .el-menu--collapse .el-menu .el-sub-menu {
- min-width: variables.$sideBarWidth !important;
- }
-
- // mobile responsive
- .mobile {
- .main-container {
- margin-left: 0px;
- }
-
- .sidebar-container {
- transition: transform 0.28s;
- width: variables.$sideBarWidth !important;
- }
-
- &.hideSidebar {
- .sidebar-container {
- pointer-events: none;
- transition-duration: 0.3s;
- transform: translate3d(- variables.$sideBarWidth, 0, 0);
- }
- }
- }
-
- .withoutAnimation {
- .main-container,
- .sidebar-container {
- transition: none;
- }
- }
}
-// when menu collapsed
-.el-menu--vertical {
- & > .el-menu {
- .svg-icon {
- margin-right: 16px;
- }
- .sub-el-icon {
- margin-right: 12px;
- margin-left: -2px;
- }
- }
-
- .nest-menu .el-sub-menu > .el-sub-menu__title,
- .el-menu-item {
- &:hover {
- background-color: #ffffff;
- // you can use variables.$subMenuHover
- color: variables.$menuHover !important;
- }
- }
-
- // the scroll bar appears when the subMenu is too long
- > .el-menu--popup {
- max-height: 100vh;
- overflow-y: auto;
-
- &::-webkit-scrollbar-track-piece {
- background: #d3dce6;
- }
-
- &::-webkit-scrollbar {
- width: 6px;
- }
-
- &::-webkit-scrollbar-thumb {
- background: #99a9bf;
- border-radius: 20px;
- }
- }
-}
-body[layout="mix"] {
-
- .horizontal-header{
- .el-menu-item{
- height: 50px!important;
- line-height: 50px!important;
- }
-
- .el-sub-menu__title {
- background-color: #001529!important;
- height: 50px!important;
- }
- }
- .horizontal-header-right>div {
- color: #FFF;
- }
- .svg-icon{
+body[layout='mix'] {
+ .svg-icon {
margin-right: 16px;
}
-
-}
\ No newline at end of file
+}
diff --git a/frontend/src/styles/variables.module.css b/frontend/src/styles/variables.module.css
deleted file mode 100644
index 518a1f9..0000000
--- a/frontend/src/styles/variables.module.css
+++ /dev/null
@@ -1,11 +0,0 @@
-:export {
- menuText: #409eff;
- menuActiveText: #409eff;
- subMenuActiveText: #409eff;
- menuBg: #ffffff;
- menuHover: #409eff;
- subMenuBg: #ffffff;
- subMenuHover: #409eff;
- sideBarWidth: 210px;
-}
-/*# sourceMappingURL=variables.module.css.map */
\ No newline at end of file
diff --git a/frontend/src/styles/variables.module.css.map b/frontend/src/styles/variables.module.css.map
deleted file mode 100644
index b95fb87..0000000
--- a/frontend/src/styles/variables.module.css.map
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "version": 3,
- "mappings": "AAeA,AAAA,OAAO,CAAC;EACN,QAAQ,EAfC,OAAO;EAgBhB,cAAc,EAfC,OAAO;EAgBtB,iBAAiB,EAfC,OAAO;EAgBzB,MAAM,EAdC,OAAO;EAed,SAAS,EAdC,OAAO;EAejB,SAAS,EAbC,OAAO;EAcjB,YAAY,EAbC,OAAO;EAcpB,YAAY,EAZC,KAAK;CAanB",
- "sources": [
- "variables.module.scss"
- ],
- "names": [],
- "file": "variables.module.css"
-}
\ No newline at end of file
diff --git a/frontend/src/styles/variables.module.scss b/frontend/src/styles/variables.module.scss
index 0376220..ed3d169 100644
--- a/frontend/src/styles/variables.module.scss
+++ b/frontend/src/styles/variables.module.scss
@@ -1,25 +1,17 @@
-// sidebar
-$menuText: #505050;
-$menuActiveText: #409eff;
-$subMenuActiveText: #409eff;
+$main-menu-color: #fff;
+$main-menu-color-active: #00e6fc;
+$main-menu-bg-color-active: #003e6e;
-$menuBg: #ffffff;
-$menuHover: #409eff;
-
-$subMenuBg: #ffffff;
-$subMenuHover: #409eff;
-
-$sideBarWidth: 210px;
+$layout-header-height: 60px;
+$locationbar-height: 50px;
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
:export {
- menuText: $menuText;
- menuActiveText: $menuActiveText;
- subMenuActiveText: $subMenuActiveText;
- menuBg: $menuBg;
- menuHover: $menuHover;
- subMenuBg: $subMenuBg;
- subMenuHover: $subMenuHover;
- sideBarWidth: $sideBarWidth;
+ main-menu-color: $main-menu-color;
+ main-menu-color-active: $main-menu-color-active;
+ main-menu-bg-color-active: $main-menu-bg-color-active;
+
+ layout-header-height: $layout-header-height;
+ locationbar-height: $locationbar-height;
}
diff --git a/frontend/src/utils/localStorage.ts b/frontend/src/utils/localStorage.ts
index d5628e5..56c8bc8 100644
--- a/frontend/src/utils/localStorage.ts
+++ b/frontend/src/utils/localStorage.ts
@@ -21,12 +21,6 @@ export const localStorage = {
}
};
-// 侧边栏状态(显示/隐藏)
-const SidebarStatusKey = 'sidebarStatus';
-export function getSidebarStatus() {
- return localStorage.get(SidebarStatusKey);
-}
-
export function setSidebarStatus(sidebarStatus: string) {
localStorage.set(SidebarStatusKey, sidebarStatus);
}
diff --git a/frontend/src/utils/request.ts b/frontend/src/utils/request.ts
index abe108e..136e35d 100644
--- a/frontend/src/utils/request.ts
+++ b/frontend/src/utils/request.ts
@@ -1,5 +1,5 @@
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
-import { ElMessage, ElMessageBox } from 'element-plus';
+import { message, Modal } from 'ant-design-vue';
import { getToken } from '@/utils/auth';
import { useUserStoreHook } from '@/store/modules/user';
@@ -33,18 +33,14 @@ service.interceptors.request.use(
service.interceptors.response.use(
(response: AxiosResponse) => {
const { status, msg } = response;
+ console.log(msg)
+ console.log(response);
if (status === 200) {
if (response.data.code == 401) {
- ElMessage({
- message: '用户名或密码错误,请重试!',
- type: 'error'
- });
+ message.error(response.data.msg||'请求失败');
return;
}else if(response.data.code == 1){
- ElMessage({
- message: response.data.msg,
- type: 'error'
- });
+ message.error(response.data.msg);
return;
}
return response.data;
@@ -53,10 +49,7 @@ service.interceptors.response.use(
if (response.data instanceof ArrayBuffer) {
return response;
}
- ElMessage({
- message: msg || '系统出错',
- type: 'error'
- });
+ message.error( msg || '系统出错');
return Promise.reject(new Error(msg || 'Error'));
}
},
@@ -65,18 +58,18 @@ service.interceptors.response.use(
const { status, msg } = error.response.data;
// token 过期,重新登录
if (status === '403') {
- ElMessageBox.confirm('当前页面已失效,请重新登录', '提示', {
- confirmButtonText: 'OK',
- type: 'warning'
- }).then(() => {
- localStorage.clear();
- window.location.href = '/';
+ Modal.confirm({
+ title: "提示",
+ content: "当前页面已失效,请重新登录",
+ okText: "确定",
+ cancelButtonProps: { style: { display: "none" } },
+ onOk: () => {
+ localStorage.clear();
+ window.location.href = '/';
+ },
});
} else {
- ElMessage({
- message: msg || '当前页面已失效',
- type: 'error'
- });
+ message.error(msg || '当前页面已失效');
}
}
return Promise.reject(error.message);
diff --git a/frontend/src/utils/validate.ts b/frontend/src/utils/validate.ts
deleted file mode 100644
index bc8ccee..0000000
--- a/frontend/src/utils/validate.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Created by PanJiaChen on 16/11/18.
- */
-
-/**
- * @param {string} path
- * @returns {Boolean}
- */
-export function isExternal(path: string) {
- const isExternal = /^(https?:|http?:|mailto:|tel:)/.test(path);
- return isExternal;
-}
diff --git a/frontend/src/views/TaskSetting/index.vue b/frontend/src/views/TaskSetting/index.vue
deleted file mode 100644
index e295a48..0000000
--- a/frontend/src/views/TaskSetting/index.vue
+++ /dev/null
@@ -1,1288 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- 搜索
-
-
-
新增
-
-
- 删除
-
-
-
-
-
-
-
-
-
-
{{ scope.row.orderno }}
-
-
-
-
-
-
-
-
-
-
-
-
- 启用
- 暂停
-
-
-
-
-
-
-
-

-

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 设置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
秒
-
分
-
时
-
日
-
月
-
周
-
年
-
-
-
-
-
- 每秒 允许的通配符[,-*/]
-
- 周期
- 从
-
- -
-
- 秒
-
-
- 从
-
- 秒开始,每
-
- 秒执行一次
-
-
-
-
-
-
-
-
-
-
-
- 分钟 允许的通配符[,-*/]
-
- 周期
- 从
-
- -
-
- 分钟
-
-
- 从
-
- 分钟开始,每
-
- 分钟执行一次
-
-
-
-
-
-
-
-
-
-
-
- 小时允许的通配符[,-*/]
-
- 周期
- 从
-
- -
-
- 小时
-
-
- 从
-
- 小时开始,每
-
- 小时执行一次
-
-
-
-
-
-
-
-
-
-
-
- 日允许的通配符[,-*/LW]
-
- 不指定
- 周期
- 从
-
- -
-
- 日
-
-
- 从
-
- 日开始,每
-
- 天执行一次
-
- 每月
- 日最近的那个工作日
-
-
- 本月最后一天
-
-
-
-
-
-
-
- 月 允许的通配符[,-*/]
-
- 周期
- 从
-
- -
-
- 月
-
-
- 从
-
- 月开始,每
-
- 月执行一次
-
-
-
-
-
-
-
-
-
- 周 允许的通配符[,-*/L#]
-
- 不指定
- 周期
- 从星期
-
- -
-
-
-
- 第
-
- 周的星期
-
-
- 本月最后一个星期
-
-
-
-
-
-
-
-
-
-
- 不指定 允许的通配符[,-*/]
- 非必填
-
- 每年
-
-
- 周期
- 从
-
- -
-
-
-
-
-
-
-
-
- 表达式字段
-
- 表达式
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/src/views/component/editor.vue b/frontend/src/views/component/editor.vue
deleted file mode 100644
index b0f9a87..0000000
--- a/frontend/src/views/component/editor.vue
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/component/uploader.vue b/frontend/src/views/component/uploader.vue
deleted file mode 100644
index 8a4ab8b..0000000
--- a/frontend/src/views/component/uploader.vue
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/dashboard/components/Chart/BarChart.vue b/frontend/src/views/dashboard/components/Chart/BarChart.vue
deleted file mode 100644
index 05be0c4..0000000
--- a/frontend/src/views/dashboard/components/Chart/BarChart.vue
+++ /dev/null
@@ -1,174 +0,0 @@
-
-
-
-
-
-
diff --git a/frontend/src/views/dashboard/components/Chart/FunnelChart.vue b/frontend/src/views/dashboard/components/Chart/FunnelChart.vue
deleted file mode 100644
index 44206d2..0000000
--- a/frontend/src/views/dashboard/components/Chart/FunnelChart.vue
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/dashboard/components/Chart/PieChart.vue b/frontend/src/views/dashboard/components/Chart/PieChart.vue
deleted file mode 100644
index 2ad159f..0000000
--- a/frontend/src/views/dashboard/components/Chart/PieChart.vue
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/dashboard/components/Chart/RadarChart.vue b/frontend/src/views/dashboard/components/Chart/RadarChart.vue
deleted file mode 100644
index 998d62c..0000000
--- a/frontend/src/views/dashboard/components/Chart/RadarChart.vue
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/dashboard/components/Project/index.vue b/frontend/src/views/dashboard/components/Project/index.vue
deleted file mode 100644
index 63e471f..0000000
--- a/frontend/src/views/dashboard/components/Project/index.vue
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-
-
- 有来项目简介
-
-
-
-
- youlai-mall
-
- 是基于Spring Boot 2.7、Spring Cloud 2021 & Alibaba
- 2021、Vue3、Element-Plus、uni-app等主流技术栈构建的一整套全栈开源商城项目,
- 涉及
- 后端微服务
- 、
- 前端管理
- 、
- 微信小程序
-
- 和
- APP应用
- 等多端的开发。
-
-
-
-
-
- 项目地址
-
-
- 官方文档
-
-
- Github
-
-
- 码云
-
-
-
-
-
- 后端技术栈
-
- Spring Boot、Spring Cloud & Alibaba、Spring Security
- OAuth2、JWT、Elastic Stack 、K8s...
-
-
-
-
- 前端技术栈
-
- Vue3、TypeScript、Element-Plus、uni-app、vue3-element-admin ...
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/dashboard/components/Team/index.vue b/frontend/src/views/dashboard/components/Team/index.vue
deleted file mode 100644
index 8b0cf8d..0000000
--- a/frontend/src/views/dashboard/components/Team/index.vue
+++ /dev/null
@@ -1,240 +0,0 @@
-
-
-
-
-
- 有来开源组织 & 技术团队
-
-
-
-
-
- -
-
-
-
-
{{ item.nickname }}
-
- {{ position }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 群二维码过期可添加开发者微信由其拉入群,备注「有来」即可。
-
-
-
-
-
-
-
1. 人品良好、善于思考、执行力强;
-
2. 熟悉项目,且至少给项目提交(过)一个PR;
-
3. Git代码库活跃,个人主页或博客完善者优先;
-
4. 过分优秀者我们会主动联系您...
-
申请加入方式: 添加开发者微信申请即可。
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/dashboard/index.vue b/frontend/src/views/dashboard/index.vue
deleted file mode 100644
index d0f23a2..0000000
--- a/frontend/src/views/dashboard/index.vue
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/error-page/401.vue b/frontend/src/views/error-page/401.vue
index 59b6f1a..61c6ae6 100644
--- a/frontend/src/views/error-page/401.vue
+++ b/frontend/src/views/error-page/401.vue
@@ -40,7 +40,7 @@ function back() {
- 或者你可以去:
-
- 回首页
+ 回首页
-
随便看看
diff --git a/frontend/src/views/home/huanBaoSheShiYunXingZhuangKuang.vue b/frontend/src/views/home/huanBaoSheShiYunXingZhuangKuang.vue
new file mode 100644
index 0000000..1ad3d4e
--- /dev/null
+++ b/frontend/src/views/home/huanBaoSheShiYunXingZhuangKuang.vue
@@ -0,0 +1,5 @@
+
+
+
环保设施情况
+
+
diff --git a/frontend/src/views/home/huanBaoZhiLiangZhuangKuang.vue b/frontend/src/views/home/huanBaoZhiLiangZhuangKuang.vue
new file mode 100644
index 0000000..cc9fd2b
--- /dev/null
+++ b/frontend/src/views/home/huanBaoZhiLiangZhuangKuang.vue
@@ -0,0 +1,5 @@
+
+
+
监测工作开展情况
+
+
diff --git a/frontend/src/views/home/shuiDianKaiFaZhuangKuang.vue b/frontend/src/views/home/shuiDianKaiFaZhuangKuang.vue
new file mode 100644
index 0000000..20bd17d
--- /dev/null
+++ b/frontend/src/views/home/shuiDianKaiFaZhuangKuang.vue
@@ -0,0 +1,6 @@
+
+
+
+
水电开放平台
+
+
\ No newline at end of file
diff --git a/frontend/src/views/login/index.vue b/frontend/src/views/login/index.vue
index e49fb8b..755d431 100644
--- a/frontend/src/views/login/index.vue
+++ b/frontend/src/views/login/index.vue
@@ -1,119 +1,238 @@
-
-
-
+
+
-
-
-
-
{{$t('login.title')}}
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ smsCountdown > 0 ? `${smsCountdown}秒后重新获取` : "获取验证码"
+ }}
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ $t('login.login') }}
-
-
+ block
+ @click="handleResetPassword"
+ :loading="loading"
+ >
+
提交
+
+
+
-
-
{{ $t('login.copyright') }}
-
{{ $t('login.icp') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 换一张
+
+
+
+
+ 登录
+
+
+ 忘记密码
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ smsCountdown > 0
+ ? `${smsCountdown}秒后重新获取`
+ : "获取验证码"
+ }}
+
+
+
+
+
+
+ 登录
+
+
+
+
@@ -121,95 +240,101 @@
-
-
-
diff --git a/frontend/src/views/nested/level1/index.vue b/frontend/src/views/nested/level1/index.vue
deleted file mode 100644
index 7daf19c..0000000
--- a/frontend/src/views/nested/level1/index.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/frontend/src/views/nested/level1/level2/index.vue b/frontend/src/views/nested/level1/level2/index.vue
deleted file mode 100644
index abcc3a7..0000000
--- a/frontend/src/views/nested/level1/level2/index.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/frontend/src/views/nested/level1/level2/level3/index1.vue b/frontend/src/views/nested/level1/level2/level3/index1.vue
deleted file mode 100644
index 888f58e..0000000
--- a/frontend/src/views/nested/level1/level2/level3/index1.vue
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/frontend/src/views/nested/level1/level2/level3/index2.vue b/frontend/src/views/nested/level1/level2/level3/index2.vue
deleted file mode 100644
index a99c98e..0000000
--- a/frontend/src/views/nested/level1/level2/level3/index2.vue
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/frontend/src/views/process/antd-demo.vue b/frontend/src/views/process/antd-demo.vue
deleted file mode 100644
index 3b26af0..0000000
--- a/frontend/src/views/process/antd-demo.vue
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/shengTaiLiuLiang/shengTaiLiuLiangManZuQingKuang.vue b/frontend/src/views/shengTaiLiuLiang/shengTaiLiuLiangManZuQingKuang.vue
new file mode 100644
index 0000000..aede6af
--- /dev/null
+++ b/frontend/src/views/shengTaiLiuLiang/shengTaiLiuLiangManZuQingKuang.vue
@@ -0,0 +1,5 @@
+
+
+
生态流量达标情况
+
+
\ No newline at end of file
diff --git a/frontend/src/views/shuiZhiJianCe/shuiHuanJingZhiLiangZhuangKuang.vue b/frontend/src/views/shuiZhiJianCe/shuiHuanJingZhiLiangZhuangKuang.vue
new file mode 100644
index 0000000..6037b92
--- /dev/null
+++ b/frontend/src/views/shuiZhiJianCe/shuiHuanJingZhiLiangZhuangKuang.vue
@@ -0,0 +1,5 @@
+
+
+
水质监测
+
+
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
index 4f8945a..1f117ca 100644
--- a/frontend/tsconfig.json
+++ b/frontend/tsconfig.json
@@ -1,5 +1,7 @@
{
"compilerOptions": {
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
@@ -24,6 +26,6 @@
"./types"
] /* 指定多个文件夹,这些文件夹的作用类似于 './node_modules/@types'. */
},
- "include": ["src/**/*.ts", "src/**/*.vue", "types/**/*.d.ts"],
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"exclude": ["node_modules", "dist", "**/*.js"]
}
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index fa30c50..40abf92 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -27,7 +27,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
// 线上API地址
//target: 'http://192.168.1.20:8090/',
// 本地API地址
- target: 'http://localhost:8093',
+ target: 'http://10.84.1.66:8093',
changeOrigin: true,
rewrite: path =>
path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')
@@ -41,7 +41,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
resolve: {
// Vite路径别名配置
alias: {
- '@': path.resolve('./src')
+ '@': path.resolve(__dirname, './src')
}
},
css: {