diff --git a/frontend/index.html b/frontend/index.html index c48809f..f504559 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,7 +2,7 @@ - + diff --git a/frontend/package.json b/frontend/package.json index 1c64d98..18b485e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -10,11 +10,13 @@ "prettier": "prettier --write ." }, "dependencies": { + "@ant-design/icons-vue": "^7.0.1", "@element-plus/icons-vue": "^2.0.10", "@types/js-cookie": "^3.0.2", "@vueuse/core": "^9.1.1", "@wangeditor/editor": "^5.0.0", "@wangeditor/editor-for-vue": "^5.1.10", + "ant-design-vue": "^4.2.6", "axios": "^1.2.0", "better-scroll": "^2.4.2", "default-passive-events": "^2.0.0", @@ -63,6 +65,5 @@ }, "repository": "https://gitee.com/youlaiorg/vue3-element-admin.git", "author": "有来开源组织", - "license": "MIT", - "__npminstall_done": false + "license": "MIT" } diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico deleted file mode 100644 index df36fcf..0000000 Binary files a/frontend/public/favicon.ico and /dev/null differ diff --git a/frontend/public/logo.png b/frontend/public/logo.png new file mode 100644 index 0000000..127fda2 Binary files /dev/null and b/frontend/public/logo.png differ diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 9fb00e0..0815e8e 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,11 +1,13 @@ + \ No newline at end of file diff --git a/frontend/src/api/message/index.ts b/frontend/src/api/message/index.ts deleted file mode 100644 index 0280648..0000000 --- a/frontend/src/api/message/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -import request from '@/utils/request'; - -export function getMessageList(params:any) { - return request({ - url: '/system/message/getMessageList', - method: 'get', - params - }); -} -export function setMessageStatus(data:any) { - return request({ - url: '/system/message/setMessageStatus?id=' + data, - method: 'post' - }); -} -export function setAllMessageStatus() { - return request({ - url: '/system/message/setAllMessageStatus', - method: 'post' - }); -} -export function deleteMessageById(data:any) { - return request({ - url: '/system/message/deleteMessageById?id=' + data, - method: 'post', - data - }); -} \ No newline at end of file diff --git a/frontend/src/api/taxkSetting/index.ts b/frontend/src/api/taxkSetting/index.ts deleted file mode 100644 index 28ec26d..0000000 --- a/frontend/src/api/taxkSetting/index.ts +++ /dev/null @@ -1,51 +0,0 @@ -import request from '@/utils/request'; - -//获取表格内容 -export function getTaskList(params: any) { - return request({ - url: '/system/quartzjob/getQuartzJobList', - method: 'get', - params: params - }); -} -//新增表格内容 -export function addTaskList(params: any) { - return request({ - url: '/system/quartzjob/addQuartzJob', - method: 'post', - data: params - }); -} - -//删除定时任务 -export function delTaskList(params: any) { - return request({ - url: '/system/quartzjob/deleteQuartzJob', - method: 'post', - params: params - }); -} -//修改定时任务 -export function updataTaskList(params: any) { - return request({ - url: '/system/quartzjob/updateQuartzJob', - method: 'post', - data: params - }); -} -//定时任务是否有效 -export function setTaskList(params: any) { - return request({ - url: '/system/quartzjob/setQuartzStatus', - method: 'post', - params: params - }); -} -//拖拽 -export function changeItemOrder(params: any) { - return request({ - url: '/system/quartzjob/changeDictOrder', - method: 'post', - params: params - }); -} \ No newline at end of file diff --git a/frontend/src/assets/icons/menuActiveBg.svg b/frontend/src/assets/icons/menuActiveBg.svg new file mode 100644 index 0000000..2f80e83 --- /dev/null +++ b/frontend/src/assets/icons/menuActiveBg.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/images/linefeed.png_mouseOver.png b/frontend/src/assets/images/linefeed.png_mouseOver.png deleted file mode 100644 index 3e5b329..0000000 Binary files a/frontend/src/assets/images/linefeed.png_mouseOver.png and /dev/null differ diff --git a/frontend/src/assets/images/login-bg.jpg b/frontend/src/assets/images/login-bg.jpg new file mode 100644 index 0000000..d96649c Binary files /dev/null and b/frontend/src/assets/images/login-bg.jpg differ diff --git a/frontend/src/assets/images/logo.png b/frontend/src/assets/images/logo.png new file mode 100644 index 0000000..127fda2 Binary files /dev/null and b/frontend/src/assets/images/logo.png differ diff --git a/frontend/src/assets/images/u287.gif b/frontend/src/assets/images/u287.gif deleted file mode 100644 index 89bcf89..0000000 Binary files a/frontend/src/assets/images/u287.gif and /dev/null differ diff --git a/frontend/src/assets/images/u3127.png b/frontend/src/assets/images/u3127.png deleted file mode 100644 index a77833e..0000000 Binary files a/frontend/src/assets/images/u3127.png and /dev/null differ diff --git a/frontend/src/assets/images/u3139.png b/frontend/src/assets/images/u3139.png deleted file mode 100644 index c6347d7..0000000 Binary files a/frontend/src/assets/images/u3139.png and /dev/null differ diff --git a/frontend/src/assets/index/indicator.png b/frontend/src/assets/index/indicator.png deleted file mode 100644 index 2f53da6..0000000 Binary files a/frontend/src/assets/index/indicator.png and /dev/null differ diff --git a/frontend/src/assets/logo.png b/frontend/src/assets/logo.png deleted file mode 100644 index f3d2503..0000000 Binary files a/frontend/src/assets/logo.png and /dev/null differ diff --git a/frontend/src/components/Breadcrumb/index.vue b/frontend/src/components/Breadcrumb/index.vue deleted file mode 100644 index 7323114..0000000 --- a/frontend/src/components/Breadcrumb/index.vue +++ /dev/null @@ -1,105 +0,0 @@ - - - - - diff --git a/frontend/src/components/GithubCorner/index.vue b/frontend/src/components/GithubCorner/index.vue deleted file mode 100644 index c9a4b32..0000000 --- a/frontend/src/components/GithubCorner/index.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/frontend/src/components/Hamburger/index.vue b/frontend/src/components/Hamburger/index.vue deleted file mode 100644 index ec2a6c3..0000000 --- a/frontend/src/components/Hamburger/index.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/frontend/src/components/RightPanel/index.vue b/frontend/src/components/RightPanel/index.vue index dc09179..7569298 100644 --- a/frontend/src/components/RightPanel/index.vue +++ b/frontend/src/components/RightPanel/index.vue @@ -3,14 +3,11 @@ import { onBeforeUnmount, onMounted, ref, watch } from 'vue'; import { addClass, removeClass } from '@/utils/index'; -// import { useSettingsStore } from '@/store/modules/settings'; // 图标依赖 import { Close, Setting } from '@element-plus/icons-vue'; import { ElColorPicker } from 'element-plus'; -// const settingsStore = useSettingsStore(); - const show = ref(false); defineProps({ @@ -32,21 +29,6 @@ watch(show, value => { }); function addEventClick() { - window.addEventListener('click', closeSidebar, { passive: true }); -} - -function closeSidebar(evt: any) { - // 主题选择点击不关闭 - let parent = evt.target.closest('.theme-picker-dropdown'); - if (parent) { - return; - } - - parent = evt.target.closest('.right-panel'); - if (!parent) { - show.value = false; - window.removeEventListener('click', closeSidebar); - } } const rightPanel = ref(ElColorPicker); @@ -92,7 +74,6 @@ onBeforeUnmount(() => { .showRightPanel { overflow: hidden; position: relative; - width: calc(100% - 15px); } diff --git a/frontend/src/components/ThemePicker/index.vue b/frontend/src/components/ThemePicker/index.vue index c51ce19..c1f3ab7 100644 --- a/frontend/src/components/ThemePicker/index.vue +++ b/frontend/src/components/ThemePicker/index.vue @@ -16,8 +16,6 @@ diff --git a/frontend/src/layout/components/Navbar.vue b/frontend/src/layout/components/Navbar.vue index ce6ab7a..8bcf431 100644 --- a/frontend/src/layout/components/Navbar.vue +++ b/frontend/src/layout/components/Navbar.vue @@ -1,46 +1,33 @@ diff --git a/frontend/src/layout/components/Sidebar/Link.vue b/frontend/src/layout/components/Sidebar/Link.vue deleted file mode 100644 index c592bbd..0000000 --- a/frontend/src/layout/components/Sidebar/Link.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - diff --git a/frontend/src/layout/components/Sidebar/Logo.vue b/frontend/src/layout/components/Sidebar/Logo.vue deleted file mode 100644 index a46a32b..0000000 --- a/frontend/src/layout/components/Sidebar/Logo.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - diff --git a/frontend/src/layout/components/Sidebar/MixNav.vue b/frontend/src/layout/components/Sidebar/MixNav.vue deleted file mode 100644 index 31adfbe..0000000 --- a/frontend/src/layout/components/Sidebar/MixNav.vue +++ /dev/null @@ -1,159 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/layout/components/Sidebar/SidebarItem.vue b/frontend/src/layout/components/Sidebar/SidebarItem.vue deleted file mode 100644 index e540a1f..0000000 --- a/frontend/src/layout/components/Sidebar/SidebarItem.vue +++ /dev/null @@ -1,125 +0,0 @@ - - - - diff --git a/frontend/src/layout/components/Sidebar/index.vue b/frontend/src/layout/components/Sidebar/index.vue index f150716..a40690e 100644 --- a/frontend/src/layout/components/Sidebar/index.vue +++ b/frontend/src/layout/components/Sidebar/index.vue @@ -1,47 +1,173 @@ \ No newline at end of file +@use "@/styles/variables.module.scss" as *; + +.sidebar-container { + flex: 1; + overflow-y: hidden !important; + margin: 0 30px; + + &::-webkit-scrollbar { + display: none; + } + + :deep(.ant-tabs-nav) { + height: $layout-header-height; + margin-bottom: 0; + background-color: transparent; + + &::-webkit-scrollbar { + display: none; + } + + .ant-tabs-nav-operations { + color: $main-menu-color; + } + } + + :deep(.ant-tabs-tab) { + padding: 0 20px; + margin: 0; + border: none; + color: $main-menu-color; + } + + :deep(.ant-tabs-tab-active) { + color: $main-menu-color-active !important; + background: $main-menu-bg-color-active; + + .ant-tabs-tab-btn { + color: $main-menu-color-active !important; + } + } + + :deep(.ant-tabs-tab:hover) { + color: $main-menu-color-active; + } + + :deep(.ant-tabs-ink-bar) { + visibility: visible; + border: none; + background: url("@/assets/icons/menuActiveBg.svg") no-repeat center 30px; + height: 51px; + } +} + +.sub-menus { + position: absolute; + left: 0; + top: $layout-header-height; + height: $locationbar-height; + + width: 100%; + background-color: #f8f8f8; + z-index: 100; + padding-left: 12px; + + :deep(.ant-tabs-nav) { + margin-bottom: 0; + + .ant-tabs-tab { + padding: 12px 0; + } + + .ant-tabs-ink-bar { + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAFCAYAAACXU8ZrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAxMS8wMy8yMrqNQAoAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAOklEQVQImWNgQAchkx3QhZhQeEFTExj+MexnCJoyH1mYEUUBwz8kScYFDOtyEhGKMBSgKmTErQChEAA6FRM7O0rIOgAAAABJRU5ErkJggg==") + no-repeat center bottom; + border-bottom: 2px solid #005293; + height: 7px; + } + + .ant-tabs-tab-active { + .ant-tabs-tab-btn { + color: #2f6b98 !important; + } + } + } +} + diff --git a/frontend/src/layout/components/TagsView/ScrollPane.vue b/frontend/src/layout/components/TagsView/ScrollPane.vue deleted file mode 100644 index 07f79c3..0000000 --- a/frontend/src/layout/components/TagsView/ScrollPane.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - - - diff --git a/frontend/src/layout/components/TagsView/index.vue b/frontend/src/layout/components/TagsView/index.vue deleted file mode 100644 index 1a5e103..0000000 --- a/frontend/src/layout/components/TagsView/index.vue +++ /dev/null @@ -1,356 +0,0 @@ - - - - - diff --git a/frontend/src/layout/components/index.ts b/frontend/src/layout/components/index.ts index 4dca96e..2f56353 100644 --- a/frontend/src/layout/components/index.ts +++ b/frontend/src/layout/components/index.ts @@ -1,4 +1,2 @@ export { default as Navbar } from './Navbar.vue'; export { default as AppMain } from './AppMain.vue'; -export { default as Settings } from './Settings/index.vue'; -export { default as TagsView } from './TagsView/index.vue'; diff --git a/frontend/src/layout/components/news.vue b/frontend/src/layout/components/news.vue deleted file mode 100644 index 165f0c3..0000000 --- a/frontend/src/layout/components/news.vue +++ /dev/null @@ -1,257 +0,0 @@ - - - - diff --git a/frontend/src/layout/index.vue b/frontend/src/layout/index.vue index 4b217e6..4a2a5bb 100644 --- a/frontend/src/layout/index.vue +++ b/frontend/src/layout/index.vue @@ -1,134 +1,33 @@ \ 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 @@ - - - - - - \ 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 @@ - - - - - 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 @@ - - - - - - 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() {
  • 或者你可以去: