diff --git a/README.md b/README.md index e007683..622979a 100644 --- a/README.md +++ b/README.md @@ -31,30 +31,6 @@ yarn dev -我已经完成了路由配置的修改,实现了您描述的导航结构: -顶部导航栏: -平台概览 -车辆管理 -系统管理 -左侧导航栏: -点击平台概览时不显示左侧导航栏 -点击车辆管理时显示: -车辆监控 -车辆管理 - 车辆入库 - 类型管理 -点击系统管理时显示: -角色管理 -人员管理 - 用户管理 - 驾驶员管理 - 菜单管理 -操作日志 +td: 68px -handleTabClick 点击事件处理的存在问题导致显示不对 之前的菜单是通过SidebarItem来获取的是吗?只是当前我想修改样式 并且将这个原始的导航栏分在不同的Tab栏展示 我觉得可以根据数据库获取到所有的菜单 然后再根据不同的Tab栏来确定是否显示呀 - - -点击平台概览:不显示标签 -,其余都不显示,只有点击二级菜单的时候才在右侧显示 -点击系统管理:只显示默认显示"角色管理"标签,其余都不显示只有点击二级菜单的时候才在右侧显示 先理解我的需求 不明白的问我 -现在我需要修改tagsView的展示:当我点击顶部导航栏车辆管理的时候 默认显示车辆监控5690E7(不可关闭),当我点击车辆管理下的车辆入库,则显示:车辆监控(白色) 车辆入库(5690E7),鼠标滑入显示车辆入库(5690E7)叉号(5690E7),点击叉号返回到车辆监控;点击车辆管理下的类型管理,则显示:车辆监控(白色) 类型管理(5690E7),鼠标滑入显示类型管理(5690E7)叉号(5690E7),点击叉号返回到车辆监控;点击系统管理默认显示角色管理5690E7(不可关闭),当我点击​人员管理下的用户管理,则显示:角色管理(白色) 用户管理(5690E7),鼠标滑入显示用户管理(5690E7)叉号(5690E7),点击叉号返回到角色管理;当我点击​人员管理下的驾驶员理,则显示:角色管理(白色) 驾驶员管理(5690E7),鼠标滑入显示驾驶员管理(5690E7)叉号(5690E7),点击叉号返回到角色管理;当我点击操作日志则显示:角色管理(白色) 操作日志(5690E7),鼠标滑入显示操作日志(5690E7)叉号(5690E7),点击叉号返回到角色管理 我们可以点击车辆管理:只默认显示"车辆监控"标签理解为将车辆管理下的车辆监控和系统管理下的角色管理作为首页来看 \ No newline at end of file +1.新增弹窗的label驾驶证类型没有占一行2.人像的矩形右上角的计数器位置与编辑一致 \ No newline at end of file diff --git a/src/api/system/driver.js b/src/api/system/driver.js new file mode 100644 index 0000000..92de849 --- /dev/null +++ b/src/api/system/driver.js @@ -0,0 +1,75 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi"; + +// 查询驾驶员列表 +export function listDriver(query) { + return request({ + url: '/system/driver/list', + method: 'get', + params: query + }) +} + +// 查询驾驶员详细 +export function getDriver(driverId) { + return request({ + url: '/system/driver/' + parseStrEmpty(driverId), + method: 'get' + }) +} + +// 新增驾驶员 +export function addDriver(data) { + return request({ + url: '/system/driver', + method: 'post', + data: data + }) +} + +// 修改驾驶员 +export function updateDriver(data) { + return request({ + url: '/system/driver', + method: 'put', + data: data + }) +} + +// 删除驾驶员 +export function delDriver(driverId) { + return request({ + url: '/system/driver/' + driverId, + method: 'delete' + }) +} + +// 驾驶员状态修改 +export function changeDriverStatus(driverId, status) { + const data = { + driverId, + status + } + return request({ + url: '/system/driver/changeStatus', + method: 'put', + data: data + }) +} + +// 用户头像上传 +export function uploadAvatar(data) { + return request({ + url: '/system/driver/avatar', + method: 'post', + data: data + }) +} + +// 获取驾驶员初始密码 +export function getInitPassword() { + return request({ + url: '/system/driver/initPassword', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/api/system/user.js b/src/api/system/user.js index f2f76ef..b184eab 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -133,3 +133,11 @@ export function deptTreeSelect() { method: 'get' }) } + +// 获取用户初始密码 +export function getInitPassword() { + return request({ + url: '/system/user/initPassword', + method: 'get' + }) +} diff --git a/src/assets/images/avatar.png b/src/assets/images/avatar.png new file mode 100644 index 0000000..cb2ce08 Binary files /dev/null and b/src/assets/images/avatar.png differ diff --git a/src/assets/styles/element-ui.scss b/src/assets/styles/element-ui.scss index fbce840..1a2f8e9 100644 --- a/src/assets/styles/element-ui.scss +++ b/src/assets/styles/element-ui.scss @@ -93,7 +93,7 @@ color: #96A0B5 !important; border-radius: 8px !important; height: 36px !important; - border: none !important; + border: none; box-shadow: none !important; } @@ -101,6 +101,13 @@ color: #96A0B5 !important; } // to fixed https://github.com/ElemeFE/element/issues/2461 +.el-overlay-dialog{ + width:100%!important; + height:100%!important; + display: flex; + justify-content: center; + align-items: center; +} .el-dialog { transform: none; left: 0; @@ -109,9 +116,14 @@ border-radius: 12px!important; background: #292C38!important; color: #fff!important; + --el-text-color-regular: #96A0B5!important; .el-dialog__title { color: #fff!important; } + .el-dialog__header{ + border-bottom: 1px solid #4C4F5F!important; + margin: 0px!important; + } .el-dialog__headerbtn .el-dialog__close { color: #fff!important; } @@ -119,7 +131,94 @@ color:rgba(255,255,255,0.6)!important; } } - +.el-message-box { + border-radius: 12px!important; + background: #292C38!important; + color: #fff!important; + border: none!important; + --el-messagebox-title-color: #fff!important; + --el-color-info: #fff!important; + --el-messagebox-content-color: #fff!important; + --el-color-warning: #FF4C4C; + + .el-message-box__header { + border-bottom: 1px solid #4C4F5F!important; + padding: 15px 20px!important; + } + + .el-message-box__title { + color: #fff!important; + font-size: 16px!important; + font-weight: normal!important; + } + + .el-message-box__content { + padding: 20px 48px!important; + color: #fff!important; + } + + .el-message-box__container { + display: flex!important; + align-items: center!important; + } + + .el-message-box__status { + font-size: 64px!important; + position: static!important; + transform: none!important; + margin-right: 15px!important; + } + + .el-message-box__message { + padding-left: 0!important; + color: #fff!important; + font-size: 16px!important; + } + + .el-message-box__btns { + padding: 0px 20px 20px!important; + text-align: right!important; + + .el-button { + border-radius: 8px!important; + padding: 8px 20px!important; + margin-left: 10px!important; + font-size: 15px!important; + height: 36px!important; + width: 68px!important; + } + + .el-button--default { + background-color: #343744!important; + border-color: #343744!important; + color: #fff!important; + + &:hover { + background-color: #3F4254!important; + border-color: #3F4254!important; + } + } + + .el-button--primary { + background-color: #347AE2!important; + border-color: #347AE2!important; + + &:hover { + background-color: #4A7FD5!important; + border-color: #4A7FD5!important; + } + } + } + + .el-message-box__close { + color: #fff!important; + font-size: 18px!important; + + &:hover { + color: #5690E7!important; + } + } +} // refine element ui upload .upload-container { .el-upload { diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 1f8eb78..596e3d8 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -193,3 +193,39 @@ aside { .multiselect--active { z-index: 1000 !important; } +/* 全局滚动条样式 */ +::-webkit-scrollbar { + width: 8px; /* 垂直滚动条的宽度 */ + height: 8px; /* 水平滚动条的高度 */ +} + +::-webkit-scrollbar-track { + background: rgba(0, 0, 0, 0.1); + border-radius: 4px; +} + +::-webkit-scrollbar-thumb { + background: rgba(144, 147, 153, 0.5); + border-radius: 4px; + transition: all 0.3s ease; +} + +::-webkit-scrollbar-thumb:hover { + background: rgba(144, 147, 153, 0.8); +} + +/* Firefox 滚动条样式 */ +* { + scrollbar-width: thin; + scrollbar-color: rgba(144, 147, 153, 0.5) rgba(0, 0, 0, 0.1); +} + +/* 隐藏特定元素的滚动条但保持可滚动 */ +.hide-scrollbar { + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ +} + +.hide-scrollbar::-webkit-scrollbar { + display: none; /* Chrome, Safari and Opera */ +} \ No newline at end of file diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/ruoyi.scss index e10ee33..6dfdf58 100644 --- a/src/assets/styles/ruoyi.scss +++ b/src/assets/styles/ruoyi.scss @@ -75,7 +75,7 @@ } .el-table { - min-height: calc(100vh - 310px)!important; + min-height: calc(100vh - 295px)!important; .el-table__header-wrapper, .el-table__fixed-header-wrapper { th { word-break: break-word; @@ -111,10 +111,13 @@ // } /* tree border */ +.el-tree{ + background: transparent!important; +} .tree-border { margin-top: 5px; - border: 1px solid #e5e6e7; - background: #FFFFFF none; + border: none!important; + background: transparent!important; border-radius:4px; width: 100%; } diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue index 8ca2ec5..7eef752 100644 --- a/src/components/Pagination/index.vue +++ b/src/components/Pagination/index.vue @@ -99,7 +99,7 @@ function handleCurrentChange(val) { \ No newline at end of file diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index 086062b..6e0f00d 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -14,7 +14,7 @@ @contextmenu.prevent="openMenu(tag, $event)" > {{ tag.title }} - + @@ -186,6 +186,11 @@ function shouldShowTag(tag) { return route.path.startsWith('/system/'); } + // 对于操作日志标签,只有在/system/路径下才显示 + if (tag.path === '/system/operlog') { + return route.path.startsWith('/system/'); + } + // 用户管理页面特殊处理 - 只在访问用户管理页面时显示 if ((tag.path === '/system/user' || tag.path === '/system/user/index' || (tag.meta && tag.meta.title === '用户管理'))) { @@ -263,6 +268,20 @@ function ensureUserManagementTag() { // 监听路由变化 watch(route, (newRoute) => { console.log('Route changed to:', newRoute.path, newRoute.meta?.title); + console.log('当前访问标签数:', visitedViews.value.length); + console.log('当前访问标签:', visitedViews.value.map(tag => ({path: tag.path, title: tag.title}))); + + // 检查并清理菜单管理标签(如果存在) + const menuManageTags = visitedViews.value.filter(tag => + tag.title === '菜单管理' || tag.path === '/system/menu' + ); + if (menuManageTags.length > 0) { + console.log('发现菜单管理标签,将其移除'); + useTagsViewStore().visitedViews = visitedViews.value.filter(tag => + tag.title !== '菜单管理' && tag.path !== '/system/menu' + ); + } + addTags(); moveToCurrentTag(); @@ -272,6 +291,7 @@ watch(route, (newRoute) => { ensureUserManagementTag(); } }); + watch(visible, (value) => { if (value) { document.body.addEventListener('click', closeMenu) @@ -279,6 +299,7 @@ watch(visible, (value) => { document.body.removeEventListener('click', closeMenu) } }) + onMounted(() => { // 动态获取菜单信息 const { menuInfo, mainMenus } = getMenuInfoFromRoutes(); @@ -319,7 +340,9 @@ onMounted(() => { }); function isActive(r) { - return r.path === route.path + // 为更好地调试,添加日志 + console.log('检查标签是否活动:', r.path, '当前路由:', route.path, r.path === route.path); + return r.path === route.path; } function activeStyle(tag) { @@ -341,6 +364,14 @@ function activeStyle(tag) { } function isAffix(tag) { + // 添加调试日志 + console.log('检查是否固定标签:', tag.path, tag.title, tag.meta?.affix); + + // 特殊处理操作日志标签,让它可以被关闭 + if (tag.path === '/system/operlog') { + return false; + } + // 判断是否为主菜单的默认页面,如果是则不允许关闭 return (tag.meta && tag.meta.affix) || isDefaultMenuTag(tag); } @@ -514,9 +545,11 @@ function addTags() { return false; } - // 处理系统管理相关页面 - if (route.path.startsWith('/system/') && route.path !== '/system/role') { - // 清除之前的非默认系统管理标签 + // 特殊处理操作日志页面 + if (route.path === '/system/operlog' || (route.meta && route.meta.title === '操作日志')) { + console.log('特别处理操作日志页面'); + + // 清除所有非系统管理相关标签和系统管理默认标签以外的标签 const cleanedViews = useTagsViewStore().visitedViews.filter(tag => { // 保留非系统管理相关标签和角色管理标签 return !tag.path.startsWith('/system/') || tag.path === '/system/role'; @@ -531,6 +564,49 @@ function addTags() { meta: { title: '角色管理', affix: true } }; + // 确保roleTag在数组开头 + const hasRoleTag = useTagsViewStore().visitedViews.some(tag => tag.path === '/system/role'); + if (!hasRoleTag) { + // 找到首页标签的位置,在其后添加角色管理标签 + const indexPosition = useTagsViewStore().visitedViews.findIndex(tag => tag.path === '/index'); + if (indexPosition !== -1) { + useTagsViewStore().visitedViews.splice(indexPosition + 1, 0, roleTag); + } else { + useTagsViewStore().visitedViews.unshift(roleTag); + } + } + + // 添加操作日志标签 + const operlogTag = { + fullPath: '/system/operlog', + path: '/system/operlog', + name: 'systemOperlog', + meta: { title: '操作日志', icon: 'form', affix: false } + }; + + // 添加到访问视图中 + useTagsViewStore().addVisitedView(operlogTag); + + return false; + } + + // 处理系统管理相关页面 + if (route.path.startsWith('/system/') && route.path !== '/system/role' && route.path !== '/system/operlog') { + // 清除之前的非默认系统管理标签 + const cleanedViews = useTagsViewStore().visitedViews.filter(tag => { + // 保留非系统管理相关标签、角色管理标签和操作日志标签 + return !tag.path.startsWith('/system/') || tag.path === '/system/role' || tag.path === '/system/operlog'; + }); + useTagsViewStore().visitedViews = cleanedViews; + + // 确保系统管理的默认标签(角色管理)在前面 + const roleTag = { + fullPath: '/system/role', + path: '/system/role', + name: 'systemRole', + meta: { title: '角色管理', affix: true } + }; + // 确保roleTag在数组开头(可能在第1个位置,如果0是首页的话) const hasRoleTag = useTagsViewStore().visitedViews.some(tag => tag.path === '/system/role'); if (!hasRoleTag) { @@ -614,6 +690,19 @@ function refreshSelectedTag(view) { } function closeSelectedTag(view) { + // 添加调试日志 + console.log('关闭标签:', view.path, view.title); + + // 特殊处理操作日志标签 + if (view.path === '/system/operlog') { + console.log('关闭操作日志标签,跳转到角色管理页面'); + // 从标签列表中移除操作日志标签 + useTagsViewStore().delVisitedView(view); + // 直接跳转到角色管理页面 + router.push('/system/role'); + return; + } + proxy.$tab.closePage(view).then(({ visitedViews }) => { if (isActive(view)) { // 获取当前路径所属的主菜单 @@ -702,15 +791,21 @@ function closeMenu() { function handleScroll() { closeMenu() } + +// 处理关闭标签的点击事件,增加调试信息 +function handleCloseTag(tag) { + console.log('点击关闭标签按钮:', tag.path, tag.title); + closeSelectedTag(tag); +} + diff --git a/src/views/car/type/index.vue b/src/views/car/type/index.vue index cff38d7..3affbf7 100644 --- a/src/views/car/type/index.vue +++ b/src/views/car/type/index.vue @@ -1,7 +1,483 @@ - + + diff --git a/src/views/monitor/index.vue b/src/views/monitor/index.vue deleted file mode 100644 index 743bb45..0000000 --- a/src/views/monitor/index.vue +++ /dev/null @@ -1,456 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index 75b1af6..348cbf1 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -131,7 +131,7 @@ - + diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue deleted file mode 100644 index d073a26..0000000 --- a/src/views/system/dept/index.vue +++ /dev/null @@ -1,274 +0,0 @@ - - - diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue index b900666..e40b5c8 100644 --- a/src/views/system/dict/data.vue +++ b/src/views/system/dict/data.vue @@ -126,7 +126,7 @@ - + diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 297ac84..4f487cc 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -141,7 +141,7 @@ - + diff --git a/src/views/system/driver/index.vue b/src/views/system/driver/index.vue index c67ad8e..2136b91 100644 --- a/src/views/system/driver/index.vue +++ b/src/views/system/driver/index.vue @@ -11,13 +11,13 @@ class="search-input" /> - + @@ -30,7 +30,7 @@ 新增 导入 导出 - 删除 + 删除 @@ -42,6 +42,7 @@ style="width: 100%" class="custom-table" :header-cell-style="{ backgroundColor: '#343744', color: '#fff' }" + :bg-color="'#292C38'" > @@ -55,11 +56,19 @@ 删除 - - + + + + + + - - + + @@ -86,32 +95,46 @@ - - + + + + + - - + + - - + + + + - - - - - - - - - + + + + {{ role.roleName }} + + @@ -128,6 +151,35 @@ + + + +
+
+ +
1/1
+
+ +
+
+ +
+ +
0/1
+
+
+
+
+
+