Browse Source

修改系统管理的样式风格

inspection_yanyuan
douyage 3 weeks ago
parent
commit
0d7dc791e8
4 changed files with 136 additions and 10 deletions
  1. +91
    -2
      src/assets/styles/ruoyi.scss
  2. +11
    -3
      src/layout/components/Sidebar/index.vue
  3. +17
    -3
      src/layout/index.vue
  4. +17
    -2
      src/views/portal/index.vue

+ 91
- 2
src/assets/styles/ruoyi.scss View File

@ -1243,16 +1243,105 @@ body .task-toolbar-btn:not(:has(.el-icon-search)) {
color: #43c0ff !important;
}
/* Table operation buttons use the same treatment as the reset button. */
body .el-table .el-button {
/* Toolbar actions share the add button color: green, pink, yellow, and gray. */
body .el-button.el-button--success,
body button.el-button--success,
body .el-button.el-button--danger,
body button.el-button--danger,
body .el-button.el-button--warning,
body button.el-button--warning,
body .el-button.el-button--info,
body button.el-button--info {
background: linear-gradient(#01016b, #01016b) padding-box,
linear-gradient(135deg, #3988ff, #0351c6) border-box !important;
background-image: linear-gradient(#01016b, #01016b) padding-box,
linear-gradient(135deg, #3988ff, #0351c6) border-box !important;
border: 1px solid transparent !important;
color: #43c0ff !important;
}
body .el-button.el-button--success:hover,
body .el-button.el-button--success:focus,
body .el-button.el-button--success:active,
body button.el-button--success:hover,
body button.el-button--success:focus,
body button.el-button--success:active,
body .el-button.el-button--danger:hover,
body .el-button.el-button--danger:focus,
body .el-button.el-button--danger:active,
body button.el-button--danger:hover,
body button.el-button--danger:focus,
body button.el-button--danger:active,
body .el-button.el-button--warning:hover,
body .el-button.el-button--warning:focus,
body .el-button.el-button--warning:active,
body button.el-button--warning:hover,
body button.el-button--warning:focus,
body button.el-button--warning:active,
body .el-button.el-button--info:hover,
body .el-button.el-button--info:focus,
body .el-button.el-button--info:active,
body button.el-button--info:hover,
body button.el-button--info:focus,
body button.el-button--info:active {
background: linear-gradient(#01016b, #01016b) padding-box,
linear-gradient(135deg, #3988ff, #0351c6) border-box !important;
background-image: linear-gradient(#01016b, #01016b) padding-box,
linear-gradient(135deg, #3988ff, #0351c6) border-box !important;
border: 1px solid transparent !important;
color: #43c0ff !important;
}
body .el-button.el-button--success.is-disabled,
body .el-button.el-button--success.is-disabled:hover,
body .el-button.el-button--success.is-disabled:focus,
body .el-button.el-button--success.is-disabled:active,
body button.el-button--success.is-disabled,
body button.el-button--success.is-disabled:hover,
body button.el-button--success.is-disabled:focus,
body button.el-button--success.is-disabled:active,
body .el-button.el-button--danger.is-disabled,
body .el-button.el-button--danger.is-disabled:hover,
body .el-button.el-button--danger.is-disabled:focus,
body .el-button.el-button--danger.is-disabled:active,
body button.el-button--danger.is-disabled,
body button.el-button--danger.is-disabled:hover,
body button.el-button--danger.is-disabled:focus,
body button.el-button--danger.is-disabled:active,
body .el-button.el-button--warning.is-disabled,
body .el-button.el-button--warning.is-disabled:hover,
body .el-button.el-button--warning.is-disabled:focus,
body .el-button.el-button--warning.is-disabled:active,
body button.el-button--warning.is-disabled,
body button.el-button--warning.is-disabled:hover,
body button.el-button--warning.is-disabled:focus,
body button.el-button--warning.is-disabled:active,
body .el-button.el-button--info.is-disabled,
body .el-button.el-button--info.is-disabled:hover,
body .el-button.el-button--info.is-disabled:focus,
body .el-button.el-button--info.is-disabled:active,
body button.el-button--info.is-disabled,
body button.el-button--info.is-disabled:hover,
body button.el-button--info.is-disabled:focus,
body button.el-button--info.is-disabled:active {
background: linear-gradient(#01016b, #01016b) padding-box,
linear-gradient(135deg, #3988ff, #0351c6) border-box !important;
background-image: linear-gradient(#01016b, #01016b) padding-box,
linear-gradient(135deg, #3988ff, #0351c6) border-box !important;
border: 1px solid transparent !important;
color: rgba(67, 192, 255, 0.45) !important;
}
/* Table operation buttons use the same treatment as the reset button. */
body .el-table .el-button {
border: 1px solid transparent !important;
// background: linear-gradient(#01016b, #01016b) padding-box,
// linear-gradient(135deg, #3988ff, #0351c6) border-box !important;
background-image: linear-gradient(#01016b, #01016b) padding-box,
linear-gradient(135deg, #3988ff, #0351c6) border-box !important;
// color: #43c0ff !important;
}
body .el-table .el-button:hover,
body .el-table .el-button:focus,
body .el-table .el-button:active {


+ 11
- 3
src/layout/components/Sidebar/index.vue View File

@ -57,11 +57,13 @@ export default {
return this.$store.state.user.username === "admin";
},
displayedRoutes() {
// 汇聚入口正在看系统管理时,非管理员也要放出「系统管理」,否则侧边栏是空的
const keepSystemMenu = this.fromPortal && this.$route.path.indexOf("/system") === 0;
const temporarilyHiddenRootMenus = this.isAdminAccount
? new Set()
: new Set([
"设备管理",
"系统管理",
...(keepSystemMenu ? [] : ["系统管理"]),
"区域管理",
"系统监控",
"基础数据",
@ -95,6 +97,11 @@ export default {
}, []);
const visibleRoutes = filterHiddenNavigation(this.sidebarRouters);
// 汇聚横向导航切到系统管理时,侧边栏只留系统管理(菜单、角色等),不再混着动环巡检
if (this.fromPortal && this.$route.path.indexOf("/system") === 0) {
return visibleRoutes.filter(route => route.path === "/system");
}
if (!this.$route.meta.patrolWorkspace) {
const inspectionOrder = [
"/task-summary", "/video-preview", "/patrol-plan", "/site-management",
@ -115,8 +122,9 @@ export default {
});
const routePath = this.$route.path;
if (
!this.isAdminAccount &&
(routePath === "/index" || routePath === "/" || routePath === "/xfdh/index" || patrolRoutes.some(route => routePath.indexOf(route.path + "/") === 0 || routePath === route.path))
this.fromPortal ||
(!this.isAdminAccount &&
(routePath === "/index" || routePath === "/" || routePath === "/xfdh/index" || patrolRoutes.some(route => routePath.indexOf(route.path + "/") === 0 || routePath === route.path)))
) {
return patrolRoutes;
}


+ 17
- 3
src/layout/index.vue View File

@ -118,14 +118,13 @@ export default {
this.$store.dispatch('siteContext/setWorkspaceStation', value)
}
},
// 从门户跳转进入时展示:首页回门户,动环巡检为当前单站系统
// 从门户跳转进入时展示:首页回门户,动环巡检为当前单站系统,系统管理进菜单/角色配置
moduleLinks() {
if (!this.fromPortal) return []
return [
{ key: 'home', label: '首页', path: '/portal' },
{ key: 'patrol', label: '动环巡检', path: '/index' },
// { key: 'system', label: '系统管理', path: '/system/user' }
// { key: 'system', label: '系统管理', path: '' }
{ key: 'system', label: '系统管理', path: '/system/menu' }
]
},
activeModule() {
@ -162,8 +161,23 @@ export default {
})
},
goModule(path) {
if (path === '/system/menu') {
const target = this.systemEntryPath()
if (this.$route.path !== target) this.$router.push({ path: target }).catch(() => undefined)
return
}
if (this.$route.path !== path) this.$router.push({ path }).catch(() => undefined)
},
// 系统管理落到当前账号能看到的第一个页面,没有菜单权限时退回用户管理
systemEntryPath() {
const routes = this.$store.getters.sidebarRouters || []
const system = routes.find(route => route && route.path === '/system' && !route.hidden)
const child = system && (system.children || []).find(item => item && !item.hidden)
if (!child) return '/system/user'
const childPath = String(child.path || '')
if (!childPath) return '/system/user'
return childPath.startsWith('/') ? childPath : `/system/${childPath}`
},
setSidebarWide(level) {
this.sidebarWidthLevel = Number(level) || 0
},


+ 17
- 2
src/views/portal/index.vue View File

@ -394,7 +394,8 @@ export default {
treeCollapseIcon,
navItems: [
{ key: "home", label: "首页" },
{ key: "patrol", label: "动环巡检" }
{ key: "patrol", label: "动环巡检" },
{ key: "system", label: "系统管理" }
],
stationButtons: STATION_BUTTONS,
defectSlides: DEFECT_SLIDES,
@ -983,6 +984,15 @@ export default {
this.cancelPortalStarts();
this.stopPortalVideos();
},
systemEntryPath() {
const routes = this.$store.getters.sidebarRouters || [];
const system = routes.find(route => route && route.path === "/system" && !route.hidden);
const child = system && (system.children || []).find(item => item && !item.hidden);
if (!child) return "/system/user";
const childPath = String(child.path || "");
if (!childPath) return "/system/user";
return childPath.startsWith("/") ? childPath : `/system/${childPath}`;
},
onNavClick(item) {
if (item.key === "home") {
if (this.$route.path !== "/portal") this.$router.push("/portal").catch(() => undefined);
@ -995,7 +1005,12 @@ export default {
this.releasePortalPage();
this.$router.push("/index").catch(() => undefined);
} else if (item.key === "system") {
this.$router.push("/system/user");
// 系统管理:同样打上来源标记,进入后保留横向导航。
// 落到当前账号能看到的第一个系统页面,没有菜单权限时退回用户管理。
this.$store.dispatch("siteContext/markFromPortal");
this.$store.dispatch("siteContext/exitSite");
this.releasePortalPage();
this.$router.push(this.systemEntryPath()).catch(() => undefined);
}
},
// 场站入口:跳转后端为该站配置的访问地址(portalUrl)


Loading…
Cancel
Save