Browse Source

修改用户分配权限问题,修改整个系统的所有巡视统一改为巡检

master
douyage 2 weeks ago
parent
commit
4cc7ee8b53
46 changed files with 607 additions and 316 deletions
  1. +1
    -1
      .env.development
  2. +1
    -1
      .env.htjc6
  3. +1
    -1
      .env.production
  4. +1
    -1
      .env.staging
  5. +1
    -1
      src/api/analysis/index.js
  6. +4
    -4
      src/api/area/area.js
  7. +7
    -7
      src/api/basedata/area/area.js
  8. +1
    -1
      src/api/basedata/patrolpointmnt/patroltype.js
  9. +1
    -1
      src/api/device.js
  10. +3
    -3
      src/api/home/index.js
  11. +4
    -4
      src/api/inspectionDataManage/inspectionArchive.js
  12. +1
    -1
      src/api/inspectionDataManage/inspectionReporter.js
  13. +7
    -7
      src/api/videosMonitor/index.js
  14. +179
    -41
      src/assets/styles/sidebar.scss
  15. +5
    -2
      src/assets/styles/variables.scss
  16. +6
    -6
      src/components/InspectionArchiveContrastDialog.vue
  17. +1
    -1
      src/lang/en/index.js
  18. +1
    -1
      src/lang/zh/administration.json
  19. +1
    -1
      src/lang/zh/index.js
  20. +35
    -29
      src/layout/components/Navbar.vue
  21. +27
    -18
      src/layout/components/Sidebar/Item.vue
  22. +4
    -1
      src/layout/components/Sidebar/SidebarItem.vue
  23. +94
    -30
      src/layout/components/Sidebar/index.vue
  24. +27
    -4
      src/layout/index.vue
  25. +8
    -23
      src/permission.js
  26. +18
    -18
      src/router/index.js
  27. +11
    -0
      src/store/modules/permission.js
  28. +31
    -0
      src/utils/embeddedAuth.js
  29. +5
    -0
      src/utils/patrolName.js
  30. +18
    -27
      src/utils/request.js
  31. +11
    -9
      src/views/administration/edit_task.vue
  32. +11
    -9
      src/views/administration/new_task.vue
  33. +1
    -1
      src/views/cards/components/ImagePreview/index.vue
  34. +1
    -1
      src/views/cards/defectRecord/index.vue
  35. +1
    -1
      src/views/cards/error_statistics/patrolAbnormalStatistics.vue
  36. +7
    -5
      src/views/cards/patrolPlan/summary_editTask.vue
  37. +9
    -7
      src/views/cards/patrolPlan/summary_newTask.vue
  38. +6
    -6
      src/views/cards/patrolReport/InspectionReporter.vue
  39. +12
    -12
      src/views/cards/patrolReport/patrolReportDetail.vue
  40. +7
    -5
      src/views/cards/site_management/algorithm.vue
  41. +4
    -2
      src/views/cards/site_management/site_management.vue
  42. +8
    -8
      src/views/cards/taskSummary/inspectionTask.vue
  43. +4
    -4
      src/views/cards/taskSummary/newInspectionTaskDetail.vue
  44. +12
    -4
      src/views/login.vue
  45. +6
    -5
      src/views/point/algorithm.vue
  46. +3
    -2
      src/views/point/site_management.vue

+ 1
- 1
.env.development View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 智能巡
VUE_APP_TITLE = 智能巡
# 开发环境配置
ENV = 'development'


+ 1
- 1
.env.htjc6 View File

@ -1,7 +1,7 @@
NODE_ENV = 'production'
ENV = 'production'
VUE_APP_TITLE = 智能巡
VUE_APP_TITLE = 智能巡
VUE_APP_BASE_API = '/app/htjc6/api'
VUE_APP_NVR_API = '/nvr-api'


+ 1
- 1
.env.production View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 智能巡
VUE_APP_TITLE = 智能巡
# 生产环境配置
ENV = 'production'


+ 1
- 1
.env.staging View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 智能巡
VUE_APP_TITLE = 智能巡
BABEL_ENV = production


+ 1
- 1
src/api/analysis/index.js View File

@ -1,7 +1,7 @@
// 告警确认
import request from '@/utils/request'
// 巡结果列表
// 巡结果列表
export function getPatrolData(query) {
return request({
url: '/patrol/statistics/listMulti',


+ 4
- 4
src/api/area/area.js View File

@ -127,7 +127,7 @@ export function editSave (data) {
data: data
})
}
//主设备下巡检点和巡检点巡检设备树(巡任务回显)
//主设备下巡检点和巡检点巡检设备树(巡任务回显)
export function editList (query) {
return request({
url: '/basedata/prodevmnt/device/treeProMainDevicePatrolEquSelectByEqookCode',
@ -135,7 +135,7 @@ export function editList (query) {
params: query
})
}
// 巡任务编辑回显
// 巡任务编辑回显
export function editTask (taskId) {
return request({
url: '/patrol/task/' + taskId,
@ -178,7 +178,7 @@ export function controlChange (id) {
method: 'get',
})
}
//巡任务列表修改任务状态(列表开关)
//巡任务列表修改任务状态(列表开关)
export function changeStatus (query) {
return request({
url: '/patrol/task/changeStatus',
@ -195,7 +195,7 @@ export function addPatrol (data) {
data: data
})
}
// 巡任务管理列表
// 巡任务管理列表
export function taskPatrol (query) {
return request({
url: 'patrol/task/list',


+ 7
- 7
src/api/basedata/area/area.js View File

@ -68,7 +68,7 @@ export function editSave (data) {
data: data
})
}
// 修改巡任务(绍兴)
// 修改巡任务(绍兴)
export function shaoxingEditSave (data) {
return request({
url: '/patrol/task/shaoxing/save',
@ -76,7 +76,7 @@ export function shaoxingEditSave (data) {
data: data
})
}
//主设备下巡检点和巡检点巡检设备树(巡任务回显)
//主设备下巡检点和巡检点巡检设备树(巡任务回显)
export function editList (query) {
return request({
url: '/basedata/prodevmnt/device/treeProMainDevicePatrolEquSelectByEqookCode',
@ -84,14 +84,14 @@ export function editList (query) {
params: query
})
}
// 巡任务编辑回显
// 巡任务编辑回显
export function editTask (taskId) {
return request({
url: '/patrol/task/' + taskId,
method: 'get',
})
}
// 巡任务编辑回显(绍兴)
// 巡任务编辑回显(绍兴)
export function editTaskShaoxing (taskId) {
return request({
url: '/patrol/task/shaoxing/' + taskId,
@ -134,7 +134,7 @@ export function controlChange (id) {
method: 'get',
})
}
//巡任务列表修改任务状态(列表开关)
//巡任务列表修改任务状态(列表开关)
export function changeStatus (query) {
return request({
url: '/patrol/task/changeStatus',
@ -151,7 +151,7 @@ export function addPatrol (data) {
data: data
})
}
// 绍兴站新增/修改巡任务
// 绍兴站新增/修改巡任务
export function shaoxingAddPatrol (data) {
return request({
url: '/patrol/task/shaoxing/add',
@ -159,7 +159,7 @@ export function shaoxingAddPatrol (data) {
data: data
})
}
// 巡任务管理列表
// 巡任务管理列表
export function taskPatrol (query) {
return request({
url: 'patrol/task/list',


+ 1
- 1
src/api/basedata/patrolpointmnt/patroltype.js View File

@ -39,7 +39,7 @@ export function postRemove(query) {
// params: query
})
}
// 查询巡类型列表
// 查询巡类型列表
export function listPatroltype(query) {
return request({
url: "/basedata/patrolpointmnt/patroltype/list",


+ 1
- 1
src/api/device.js View File

@ -91,7 +91,7 @@ export function getDeviceChannelList (deviceCode) {
/**
* 根据任务获取巡设备及视频通道树
* 根据任务获取巡设备及视频通道树
*/
export function taskByEqbookchannel (taskCode) {
return request({


+ 3
- 3
src/api/home/index.js View File

@ -27,7 +27,7 @@ export function alarmDeviceList(query) {
});
}
// 巡告警详情
// 巡告警详情
export function alarmPatrolList(query) {
return request({
url: "/basedata/eqpbook/alarmList/alarm",
@ -36,7 +36,7 @@ export function alarmPatrolList(query) {
});
}
// 巡异常详情
// 巡异常详情
export function abnormalPatrolList(query) {
return request({
url: "/basedata/eqpbook/alarmList/abnormal",
@ -44,7 +44,7 @@ export function abnormalPatrolList(query) {
params: query,
});
}
// 巡异常
// 巡异常
export function getAbnormalPatrolList(query) {
return request({
url: "/patrol/analysis/list_exception",


+ 4
- 4
src/api/inspectionDataManage/inspectionArchive.js View File

@ -3,7 +3,7 @@
import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";
// 巡结果列表
// 巡结果列表
export function listPartrolResult (query) {
return request({
url: '/patrol/resultmain/list',
@ -12,7 +12,7 @@ export function listPartrolResult (query) {
})
}
// 巡结果修正
// 巡结果修正
export function correctPartrolResult (params) {
return request({
url: '/patrol/partrolresult/edit',
@ -21,7 +21,7 @@ export function correctPartrolResult (params) {
})
}
// 巡详情
// 巡详情
export function partrolResultDetail (params) {
return request({
url: '/patrol/partrolresult/detail',
@ -30,7 +30,7 @@ export function partrolResultDetail (params) {
})
}
// 巡详情列表
// 巡详情列表
export function listPartrolResultDetail (params) {
return request({
url: '/patrol/partrolresult/list',


+ 1
- 1
src/api/inspectionDataManage/inspectionReporter.js View File

@ -1,4 +1,4 @@
// 巡报告
// 巡报告
import request from "@/utils/request";
import { parseStrEmpty } from "@/utils/ruoyi";


+ 7
- 7
src/api/videosMonitor/index.js View File

@ -2,7 +2,7 @@ import request from "@/utils/request";
import { defectList } from "../home/index";
/**
* 设备树
* 设备树
* @param {*} data
* @returns
*/
@ -23,7 +23,7 @@ export function getAreaEqubookTreeSelect(params) {
});
}
/**
* 任务--任务展示--
* 任务--任务展示--
* @param {*} data
* @returns
*/
@ -35,7 +35,7 @@ export function list(params) {
});
}
/**
* 任务--任务展示--
* 任务--任务展示--
* @param {*} data
* @returns
*/
@ -72,7 +72,7 @@ export function taskInfo(params) {
});
}
// 查询巡类型列表
// 查询巡类型列表
export function listPatroltype(query) {
return request({
url: "/basedata/patrolpointmnt/patroltype/list",
@ -278,7 +278,7 @@ export function getDefectAlarmList(params = {}) {
}
/**
* 任务--任务日历展示年
* 任务--任务日历展示年
* @param {*} data
* @returns
*/
@ -292,7 +292,7 @@ export function getDefectAlarmList(params = {}) {
/**
* 任务--任务日历展示月
* 任务--任务日历展示月
* @param {*} data
* @returns
*/
@ -305,7 +305,7 @@ export function getDefectAlarmList(params = {}) {
}
/**
* 任务--任务日历展示日
* 任务--任务日历展示日
* @param {*} data
* @returns
*/


+ 179
- 41
src/assets/styles/sidebar.scss View File

@ -85,9 +85,9 @@
}
.menu-item-inner.is-root {
width: 100%;
justify-content: center;
gap: 10px;
justify-content: flex-start;
gap: 8px;
min-width: 0;
}
.menu-item-inner.is-root .svg-icon,
@ -129,18 +129,91 @@
white-space: nowrap !important;
}
// Center the first-level icon/text group inside the narrower sidebar.
// 全部菜单项统一行高保证上下级之间垂直间距一致
.el-menu-item,
.el-submenu__title {
height: 48px !important;
line-height: 48px !important;
}
// 子分组的小三角紧跟文字排布不钉在导航右缘
.el-submenu__title .el-submenu__icon-arrow {
position: static;
margin-top: 0;
margin-left: 6px;
margin-right: 0;
vertical-align: middle;
line-height: 1;
flex-shrink: 0;
}
// 子级菜单逐级缩进每一级固定缩进 16px紧凑但层级分明
// 二级缩进 44px 与一级文字起点对齐子级始终缩在父级里面
.el-submenu > .el-menu > div > a > .el-menu-item,
.el-submenu > .el-menu > div > .el-submenu > .el-submenu__title {
padding-left: 44px !important;
font-size: 13px;
color: rgba(255, 255, 255, 0.78) !important;
}
.el-submenu > .el-menu > div > .el-submenu > .el-menu > div > a > .el-menu-item,
.el-submenu > .el-menu > div > .el-submenu > .el-menu > div > .el-submenu > .el-submenu__title {
padding-left: 60px !important;
}
.el-submenu > .el-menu > div > .el-submenu > .el-menu > div > .el-submenu > .el-menu > div > a > .el-menu-item,
.el-submenu > .el-menu > div > .el-submenu > .el-menu > div > .el-submenu > .el-menu > div > .el-submenu > .el-submenu__title {
padding-left: 76px !important;
}
// 子级菜单保持激活/悬停高亮使用主题色
.el-submenu > .el-menu .el-menu-item.is-active {
color: $base-menu-color-active !important;
}
// 展开的每一级子菜单左侧画一条淡淡的引导竖线强化层级感
.el-submenu > .el-menu {
position: relative;
&::before {
content: "";
position: absolute;
top: 6px;
bottom: 6px;
left: 32px;
width: 1px;
background: linear-gradient(180deg, rgba(84, 255, 255, 0) 0%, rgba(84, 255, 255, 0.28) 18%, rgba(84, 255, 255, 0.28) 82%, rgba(84, 255, 255, 0) 100%);
pointer-events: none;
}
}
.el-submenu .el-submenu > .el-menu::before {
left: 48px;
}
.el-submenu .el-submenu .el-submenu > .el-menu::before {
left: 64px;
}
// 一级菜单靠左对齐图标+文字子级缩进在其右侧形成明确的父子层级
// 字号 13px + 加粗 120px 宽度下仍能容纳文字与展开小三角加粗保持与子级的层级对比
.el-menu > div > a > .submenu-title-noDropdown,
.el-menu > div > .el-submenu > .el-submenu__title {
display: flex !important;
align-items: center;
justify-content: center;
width: 100%;
padding-left: 0 !important;
padding-right: 0 !important;
padding-left: 18px !important;
padding-right: 4px !important;
font-size: 13px;
font-weight: 600;
box-sizing: border-box;
}
// 叶子项图标inner与标题文字title 插槽之间的间距
.el-menu > div > a > .submenu-title-noDropdown {
gap: 8px;
}
// menu hover
.submenu-title-noDropdown,
.el-submenu__title {
@ -182,6 +255,26 @@
}
}
.sidebarWide2.openSidebar {
.main-container {
margin-left: $base-sidebar-wide2-width;
}
.sidebar-container {
width: $base-sidebar-wide2-width !important;
}
}
.sidebarWide3.openSidebar {
.main-container {
margin-left: $base-sidebar-wide3-width;
}
.sidebar-container {
width: $base-sidebar-wide3-width !important;
}
}
.hideSidebar {
.sidebar-container {
width: 54px !important;
@ -191,51 +284,40 @@
margin-left: 54px;
}
// 收起时所有根级图标统一靠 margin 对齐覆盖一级标题的靠左缩进
.el-menu > div > a > .submenu-title-noDropdown,
.el-menu > div > .el-submenu > .el-submenu__title {
padding-left: 0 !important;
padding-right: 0 !important;
}
.submenu-title-noDropdown {
padding: 0 !important;
position: relative;
}
.el-tooltip {
padding: 0 !important;
// 收起时只保留图标不显示文字
.sidebar-container .el-menu-item > span.menu-item-title {
display: none !important;
}
.svg-icon {
margin-left: 20px;
}
.sidebar-container .el-submenu__title .menu-item-inner > span:not(.menu-icon-img):not(.menu-icon-placeholder) {
display: none !important;
}
.menu-icon-img {
margin-left: 20px;
}
}
// 收起时只保留图标行高压缩为 38px保证全部根级图标一屏内可见
.sidebar-container .el-menu-item,
.sidebar-container .el-submenu__title {
height: 38px !important;
line-height: 38px !important;
}
.el-submenu {
overflow: hidden;
&>.el-submenu__title {
padding: 0 !important;
.svg-icon {
margin-left: 20px;
}
.menu-icon-img {
margin-left: 20px;
}
}
}
.el-menu--collapse {
.el-submenu {
&>.el-submenu__title {
&>span {
height: 0;
width: 0;
overflow: hidden;
visibility: hidden;
display: inline-block;
}
}
// 收起时只保留图标不显示展开箭头
.el-submenu__icon-arrow {
display: none;
}
}
@ -251,6 +333,62 @@
}
}
// 收起模式作用域挂在 Element 自身的 el-menu--collapse 类上与收起状态强一致
// 不依赖外层 hideSidebar 类的挂载时序行高 38px 保证 13 个根级图标一屏内可见
.el-menu--collapse {
.el-menu-item,
.el-submenu__title {
height: 38px !important;
line-height: 38px !important;
padding-left: 0 !important;
padding-right: 0 !important;
position: relative;
justify-content: center;
gap: 0;
}
// 分组标题内的图标容器与叶子的 tooltip 覆盖层同样绝对定位居中
.el-submenu__title .menu-item-inner {
position: absolute !important;
left: 0 !important;
top: 0 !important;
height: 100% !important;
width: 100% !important;
display: flex !important;
align-items: center;
justify-content: center;
}
// 只保留图标隐藏文字与展开箭头箭头在 hover 弹层里另行展示子菜单
.menu-item-inner > span:not(.menu-icon-img):not(.menu-icon-placeholder),
span.menu-item-title,
.el-submenu__icon-arrow {
display: none !important;
}
.menu-icon-img,
.svg-icon,
.menu-icon-placeholder {
margin-left: 0 !important;
margin-right: 0 !important;
}
// 分组标题内部的图标容器撑满标题并居中与叶子图标对齐
.el-submenu__title .menu-item-inner {
display: flex;
justify-content: center;
width: 100%;
}
// 叶子项收起后由 el-tooltip 覆盖层承载图标去掉其内边距并用 flex 居中
.submenu-title-noDropdown .el-tooltip {
padding: 0 !important;
display: flex !important;
align-items: center;
justify-content: center;
}
}
.el-menu--collapse .el-menu .el-submenu {
min-width: $base-sidebar-width !important;
}


+ 5
- 2
src/assets/styles/variables.scss View File

@ -40,8 +40,11 @@ $base-sub-menu-background:#000c17;
$base-sub-menu-hover:#001528;
*/
$base-sidebar-width: 160px;
$base-sidebar-wide-width: 200px;
$base-sidebar-width: 120px;
$base-sidebar-wide-width: 180px;
// 侧边栏随展开层级逐级加宽展开一级 180px两级 205px三级 230px
$base-sidebar-wide2-width: 205px;
$base-sidebar-wide3-width: 230px;
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass


+ 6
- 6
src/components/InspectionArchiveContrastDialog.vue View File

@ -45,15 +45,15 @@
<div class="home_box_title">详情数据</div>
<el-descriptions :column="3" border>
<el-descriptions-item>
<template slot="label"> 设备 </template>
<template slot="label"> 设备 </template>
{{ showInfo.patroldeviceName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 编号 </template>
<template slot="label"> 编号 </template>
{{ showInfo.patroldeviceCode }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 任务执行ID </template>
<template slot="label"> 任务执行ID </template>
{{ showInfo.taskPatrolledId }}
</el-descriptions-item>
<el-descriptions-item>
@ -133,7 +133,7 @@
{{ originalInfo.checkTime }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"> 结论 </template>
<template slot="label"> 结论 </template>
{{ originalInfo.checkResult }}
</el-descriptions-item>
</el-descriptions>
@ -281,7 +281,7 @@
import ImagePreviewDialog from "../../components/ImagePreviewDialog/index.vue";
import AsyncVideo from "../../components/AsyncVideo/index.vue";
import { getAllAlgorithmList } from "@/api/inspectionDataManage/alarmConfirm.js";
//
//
export default {
name: "InspectionArchiveContrastDialog",
components: { ImagePreviewDialog, AsyncVideo },
@ -294,7 +294,7 @@ export default {
//
title: {
type: String,
default: "巡结果详情",
default: "巡结果详情",
},
//
visible: {


+ 1
- 1
src/lang/en/index.js View File

@ -24,7 +24,7 @@ export default {
routerIl8n: {
homePage: 'homePage'
},
logName:"Smart patrols",
logName:"Smart inspection",
navBar: {
IndividualCenter: 'Individual center',
LayoutSetting: 'Layout setting',


+ 1
- 1
src/lang/zh/administration.json View File

@ -20,7 +20,7 @@
"PeriodicExecution": "周期执行",
"IntervalExecution": "间隔执行",
"ExecutionDate": "执行日期",
"WalkThrough": "现场巡",
"WalkThrough": "现场巡",
"timeSetting": "时间设置",
"SelectByWeek": "按周选择",
"MonthlySelection": "按月选择",


+ 1
- 1
src/lang/zh/index.js View File

@ -24,7 +24,7 @@ export default {
routerIl8n: {
homePage: '首页'
},
logName:"智能巡",
logName:"智能巡",
navBar: {
IndividualCenter: '个人中心',
LayoutSetting: '布局设置',


+ 35
- 29
src/layout/components/Navbar.vue View File

@ -51,6 +51,7 @@
import { mapGetters } from "vuex";
import TopNav from "@/components/TopNav";
import Screenfull from "@/components/Screenfull";
import { getEmbeddedUser } from "@/utils/embeddedAuth";
import headerLogo from "@/assets/images/header/logo.png";
import xfdhTitleNavbar from "@/assets/images/header/xfdh-title-navbar.png";
import xfdhBrand from "@/assets/images/header/xfdh-brand.png";
@ -81,7 +82,14 @@ export default {
return true
},
displayName() {
return (this.frameworkUser && (this.frameworkUser.realName || this.frameworkUser.userName || this.frameworkUser.username)) || this.name || '超级管理员'
return (
(this.frameworkUser &&
(this.frameworkUser.realName ||
this.frameworkUser.userName ||
this.frameworkUser.username)) ||
this.name ||
""
);
},
displayAvatar() {
return this.loginAvatar
@ -96,28 +104,14 @@ export default {
},
methods: {
loadFrameworkUser() {
try {
const contexts = [window]
try { if (window.parent && contexts.indexOf(window.parent) === -1) contexts.push(window.parent) } catch (e) {}
try { if (window.top && contexts.indexOf(window.top) === -1) contexts.push(window.top) } catch (e) {}
let cachedUser = null
for (let index = 0; index < contexts.length && !cachedUser; index += 1) {
try { cachedUser = contexts[index].sessionStorage.getItem('main_userInfo') } catch (e) {}
// (宿) name
const user = getEmbeddedUser();
if (user) {
this.frameworkUser = user;
if (this.frameworkUserPoller) {
window.clearInterval(this.frameworkUserPoller);
this.frameworkUserPoller = null;
}
if (cachedUser) {
const user = JSON.parse(cachedUser)
if (user && typeof user === 'object') {
this.frameworkUser = user
if (this.frameworkUserPoller) {
window.clearInterval(this.frameworkUserPoller)
this.frameworkUserPoller = null
}
}
}
return
} catch (error) {
// 使
console.warn('[framework-auth] unable to load external user', error)
}
},
async logout() {
@ -127,19 +121,31 @@ export default {
type: "warning",
})
.then(() => {
sessionStorage.removeItem('joinbright-token');
sessionStorage.removeItem('main_userInfo');
sessionStorage.removeItem('main_joinbright_token');
sessionStorage.removeItem('main_islogin');
try {
sessionStorage.removeItem('joinbright-token');
sessionStorage.removeItem('main_userInfo');
sessionStorage.removeItem('main_joinbright_token');
sessionStorage.removeItem('main_islogin');
} catch (e) {}
if (window.parent && window.parent !== window) {
window.parent.postMessage(JSON.stringify({
event: { type: "LOGOUT" },
source: "xfdh"
}), "*");
}
this.$store.dispatch("LogOut").then(() => {
location.href = "/index";
});
const toLoginPage = () => {
// 退
try { sessionStorage.setItem('manual-login', '1'); } catch (e) {}
const base = (process.env.VUE_APP_PUBLIC_PATH || "/").replace(/\/+$/, "");
location.href = base + "/login";
};
if (this.$store.getters.token) {
//
this.$store.dispatch("LogOut").then(toLoginPage).catch(toLoginPage);
} else {
// token
this.$store.dispatch("FedLogOut").then(toLoginPage).catch(toLoginPage);
}
})
.catch(() => {});
}


+ 27
- 18
src/layout/components/Sidebar/Item.vue View File

@ -1,28 +1,27 @@
<script>
const dataNavIcon = require('@/assets/images/nav/nav-base-data.png')
const reservedIconTitles = new Set([
'巡任务',
'巡方案',
'巡任务',
'巡方案',
'点位管理',
'巡报告',
'巡计划',
'巡报告',
'巡计划',
'缺陷记录'
])
const navIconMap = {
'首页': require('@/assets/images/nav/nav-home.png'),
'Home': require('@/assets/images/nav/nav-home.png'),
'巡任务': require('@/assets/images/nav/nav-patrol-task.png'),
'巡方案': require('@/assets/images/nav/nav-patrol-plan.png'),
'巡任务': require('@/assets/images/nav/nav-patrol-task.png'),
'巡方案': require('@/assets/images/nav/nav-patrol-plan.png'),
'点位管理': require('@/assets/images/nav/nav-site.png'),
'巡报告': require('@/assets/images/nav/nav-patrol-report.png'),
'巡计划': require('@/assets/images/nav/nav-patrol-schedule.png'),
'巡报告': require('@/assets/images/nav/nav-patrol-report.png'),
'巡计划': require('@/assets/images/nav/nav-patrol-schedule.png'),
'缺陷记录': require('@/assets/images/nav/nav-defect.png'),
'实时监控': require('@/assets/images/nav/nav-video-preview.png'),
'历史回放': require('@/assets/images/nav/nav-video-playback.png'),
'遥视任务管理': require('@/assets/images/nav/nav-task-management.png'),
'巡检任务管理': require('@/assets/images/nav/nav-task-management.png'),
'巡视任务管理': require('@/assets/images/nav/nav-task-management.png'),
'巡检任务': require('@/assets/images/nav/nav-task-management.png'),
'设备管理': require('@/assets/images/nav/nav-device.png'),
'点位管理(实施用)': require('@/assets/images/nav/nav-site-implementation.png'),
@ -32,6 +31,9 @@ const navIconMap = {
'基础数据': dataNavIcon
}
// ××
const normalizeNavTitle = (title) => String(title || '').replace(/巡视/g, '巡检')
export default {
name: 'MenuItem',
functional: true,
@ -44,6 +46,12 @@ export default {
type: String,
default: ''
},
// title
// tooltip title
navKey: {
type: String,
default: ''
},
menuKey: {
type: String,
default: ''
@ -54,30 +62,31 @@ export default {
}
},
render(h, context) {
const { icon, title, menuKey, isNest } = context.props
const { icon, title, navKey, menuKey, isNest } = context.props
const vnodes = []
const normalizedTitle = title && title.includes('|') ? title.split('|')[0] : title
const normalizedTitle = (navKey || title || '').includes('|')
? (navKey || title).split('|')[0]
: (navKey || title)
const compactTitle = (normalizedTitle || '').replace(/\s/g, '').toLowerCase()
const isBaseDataMenu = compactTitle.includes('基础数据') ||
compactTitle.includes('basicdata') ||
compactTitle.includes('basedata') ||
(!isNest && menuKey.toLowerCase().startsWith('/basedata'))
const navIcon = navIconMap[normalizedTitle] || (isBaseDataMenu ? dataNavIcon : null)
const navTitle = normalizeNavTitle(normalizedTitle)
const navIcon = navIconMap[navTitle] || (isBaseDataMenu ? dataNavIcon : null)
if (navIcon) {
vnodes.push(<img class="menu-icon-img" src={navIcon}/>)
} else if (icon) {
vnodes.push(<svg-icon icon-class={icon}/>)
} else if (reservedIconTitles.has(normalizedTitle)) {
} else if (reservedIconTitles.has(navTitle) || isNest) {
//
vnodes.push(<span class="menu-icon-placeholder" aria-hidden="true" />)
}
if (title) {
if (title.length > 5) {
vnodes.push(<span slot='title' title={(title)}>{(title)}</span>)
} else {
vnodes.push(<span slot='title'>{(title)}</span>)
}
// title
vnodes.push(<span slot='title' title={(title)}>{(title)}</span>)
}
return h(
"span",


+ 4
- 1
src/layout/components/Sidebar/SidebarItem.vue View File

@ -20,8 +20,11 @@
:icon="onlyOneChild.meta.icon || (item.meta && item.meta.icon)"
:is-nest="isNest"
:menu-key="resolvePath(onlyOneChild.path)"
:title="titleFn(onlyOneChild.meta.title)"
:nav-key="titleFn(onlyOneChild.meta.title)"
/>
<!-- title 具名插槽收起模式下 Element 依赖它渲染悬浮名称
title 原生属性文字被省略号截断时悬浮显示全称 -->
<span slot="title" class="menu-item-title" :title="titleFn(onlyOneChild.meta.title)">{{ titleFn(onlyOneChild.meta.title) }}</span>
</el-menu-item>
</app-link>
</template>


+ 94
- 30
src/layout/components/Sidebar/index.vue View File

@ -7,11 +7,12 @@
:collapse="isCollapse"
:background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
:unique-opened="true"
:unique-opened="false"
:active-text-color="variables.menuColorActive"
:collapse-transition="false"
:default-openeds="defaultOpeneds"
mode="vertical"
@open="handleMenuOpen"
@close="handleMenuClose"
>
<sidebar-item
v-for="(route, index) in displayedRoutes"
@ -27,29 +28,57 @@
<script>
import { mapGetters, mapState } from "vuex";
import path from "path";
import { isExternal } from "@/utils/validate";
import Logo from "./Logo";
import SidebarItem from "./SidebarItem";
import variables from "@/assets/styles/variables.scss";
// SidebarItem.resolvePath
function resolveMenuPath(basePath, routePath) {
if (isExternal(routePath)) return routePath;
return path.resolve(basePath, routePath);
}
export default {
components: { SidebarItem, Logo },
data() {
return {
// index
openMenuIndexes: [],
};
},
computed: {
...mapState(["settings"]),
...mapGetters(["sidebarRouters", "sidebar"]),
...mapGetters(["sidebarRouters", "sidebar", "roles"]),
// admin
isAdminAccount() {
if ((this.roles || []).indexOf("admin") !== -1) return true;
return this.$store.state.user.username === "admin";
},
displayedRoutes() {
const temporarilyHiddenRootMenus = new Set([
"设备管理",
"系统管理",
"区域管理",
"系统监控",
"基础数据",
]);
const filterHiddenNavigation = (routes = [], depth = 0) => routes.reduce((result, route) => {
const temporarilyHiddenRootMenus = this.isAdminAccount
? new Set()
: new Set([
"设备管理",
"系统管理",
"区域管理",
"系统监控",
"基础数据",
]);
// () /site-management
// (/site-management)
const isImplementationPointsMenu = (route) => {
const title = String(route.meta && route.meta.title || "").split("|")[0];
const isTaskManagement = title === "巡视任务管理";
const isImplementationPoints = title === "点位管理" &&
return title === "点位管理" &&
route.path !== "/site-management" &&
route.path !== "/inspection-workspace/points";
};
const filterHiddenNavigation = (routes = [], depth = 0) => routes.reduce((result, route) => {
const title = String(route.meta && route.meta.title || "").split("|")[0];
//
const isTaskManagement = ["巡检任务管理", "巡视任务管理"].includes(title);
const isImplementationPoints = !this.isAdminAccount && isImplementationPointsMenu(route);
const isTemporarilyHiddenRootMenu = depth === 0 && temporarilyHiddenRootMenus.has(title);
if (isTaskManagement || isImplementationPoints || isTemporarilyHiddenRootMenu) return result;
@ -82,7 +111,10 @@ export default {
children: patrolRoutes,
});
const routePath = this.$route.path;
if (routePath === "/index" || routePath === "/" || routePath === "/xfdh/index" || patrolRoutes.some(route => routePath.indexOf(route.path + "/") === 0 || routePath === route.path)) {
if (
!this.isAdminAccount &&
(routePath === "/index" || routePath === "/" || routePath === "/xfdh/index" || patrolRoutes.some(route => routePath.indexOf(route.path + "/") === 0 || routePath === route.path))
) {
return patrolRoutes;
}
return [...patrolRoutes, ...otherRoutes];
@ -97,7 +129,7 @@ export default {
"/video-preview": "/inspection-workspace/video-preview",
"/video-playback": "/inspection-workspace/video-playback",
};
return visibleRoutes
const workspaceMenus = visibleRoutes
.filter((route) => workspacePaths[route.path])
.map((route) => {
const workspacePath = workspacePaths[route.path];
@ -118,6 +150,11 @@ export default {
}] : [],
};
});
// ()
if (this.isAdminAccount) {
return [...workspaceMenus, ...visibleRoutes.filter(isImplementationPointsMenu)];
}
return workspaceMenus;
},
activeMenu() {
const route = this.$route;
@ -128,10 +165,35 @@ export default {
}
return path;
},
defaultOpeneds() {
if (this.isCollapse) return [];
const paths = (this.displayedRoutes || []).map(route => route.path);
return paths.filter(path => path === "/inspection-menu");
// index -> 1 2
// SidebarItem item.path basePath
// index el-menu open/close index
submenuDepthMap() {
const map = {};
const walk = (routes, parentBase, depth) => {
(routes || []).forEach(route => {
if (!route || route.hidden) return;
const itemBase = resolveMenuPath(parentBase, route.path);
const visibleChildren = (route.children || []).filter(child => !child.hidden);
if (route.alwaysShow || visibleChildren.length > 1) {
map[resolveMenuPath(itemBase, route.path)] = depth;
walk(route.children, itemBase, depth + 1);
} else if (visibleChildren.length === 1) {
walk(route.children, itemBase, depth);
}
});
};
walk(this.displayedRoutes, "", 1);
return map;
},
// 0
openDepthLevel() {
let max = 0;
(this.openMenuIndexes || []).forEach(index => {
const depth = this.submenuDepthMap[index];
if (depth && depth > max) max = depth;
});
return max;
},
variables() {
return variables;
@ -139,25 +201,27 @@ export default {
isCollapse() {
return !this.sidebar.opened;
},
hasNestedMenus() {
return this.displayedRoutes.some(route => this.hasVisibleNestedMenu(route));
},
},
watch: {
hasNestedMenus: {
openDepthLevel: {
immediate: true,
handler(hasNestedMenus) {
this.$emit("menu-depth-change", hasNestedMenus);
handler(level) {
this.$emit("menu-depth-change", level);
},
},
},
methods: {
hasVisibleNestedMenu(route) {
const visibleChildren = (route.children || []).filter(child => !child.hidden);
if (route.alwaysShow || visibleChildren.length > 1) {
return true;
// unique-opened
handleMenuOpen(index) {
if (this.openMenuIndexes.indexOf(index) === -1) {
this.openMenuIndexes = [...this.openMenuIndexes, index];
}
return visibleChildren.some(child => this.hasVisibleNestedMenu(child));
},
handleMenuClose(index) {
const prefix = index + "/";
this.openMenuIndexes = this.openMenuIndexes.filter(
item => item !== index && String(item).indexOf(prefix) !== 0
);
},
}
};


+ 27
- 4
src/layout/index.vue View File

@ -53,7 +53,8 @@ export default {
},
data() {
return {
sidebarWide: false,
// 0=160px1=200px2=240px3=280px
sidebarWidthLevel: 0,
moduleLinks: [
{ key: 'home', label: '', path: '/index' }
]
@ -76,7 +77,9 @@ export default {
withoutAnimation: this.sidebar.withoutAnimation,
mobile: this.device === 'mobile',
patrolWorkspace: this.isPatrolWorkspace,
sidebarWide: this.sidebarWide
sidebarWide: this.sidebarWidthLevel >= 1,
sidebarWide2: this.sidebarWidthLevel >= 2,
sidebarWide3: this.sidebarWidthLevel >= 3
}
},
isPatrolWorkspace() {
@ -93,8 +96,8 @@ export default {
goModule(path) {
if (this.$route.path !== path) this.$router.push({ path }).catch(() => undefined)
},
setSidebarWide(hasNestedMenus) {
this.sidebarWide = hasNestedMenus
setSidebarWide(level) {
this.sidebarWidthLevel = Number(level) || 0
},
handleClickOutside() {
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
@ -250,6 +253,26 @@ export default {
}
}
.sidebarWide2 .layout-header {
margin-left: -$base-sidebar-wide2-width;
width: calc(100% + #{$base-sidebar-wide2-width});
.tags-view-container {
width: calc(100% - #{$base-sidebar-wide2-width});
margin-left: $base-sidebar-wide2-width;
}
}
.sidebarWide3 .layout-header {
margin-left: -$base-sidebar-wide3-width;
width: calc(100% + #{$base-sidebar-wide3-width});
.tags-view-container {
width: calc(100% - #{$base-sidebar-wide3-width});
margin-left: $base-sidebar-wide3-width;
}
}
.hideSidebar .module-links {
margin-left: 54px;
}


+ 8
- 23
src/permission.js View File

@ -4,6 +4,7 @@ import { Message } from "element-ui";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
import { getToken } from "@/utils/auth";
import { isEmbeddedSession } from "@/utils/embeddedAuth";
import { isRelogin } from "@/utils/request";
import md5 from 'md5.js'
@ -11,27 +12,9 @@ NProgress.configure({ showSpinner: false });
const whiteList = ["/login", "/auth-redirect", "/bind", "/register"];
// The embedded framework provides the authenticated user in sessionStorage.
// During the first navigation its token cookie may not be available yet, so
// treat this session as authenticated and avoid rendering the login route.
function hasEmbeddedSession() {
const contexts = [window];
try { if (window.parent && window.parent !== window) contexts.push(window.parent); } catch (e) {}
try { if (window.top && window.top !== window && contexts.indexOf(window.top) === -1) contexts.push(window.top); } catch (e) {}
for (let index = 0; index < contexts.length; index++) {
try {
const raw = contexts[index].sessionStorage.getItem("main_userInfo");
if (!raw) continue;
const user = JSON.parse(raw);
if (user && (user.id || user.username || user.realName)) return true;
} catch (e) {}
}
return false;
}
router.beforeEach(async (to, from, next) => {
// NProgress.start();
const embeddedSession = hasEmbeddedSession();
const embeddedSession = isEmbeddedSession();
if (getToken() || embeddedSession) {
to.meta.title && store.dispatch("settings/setTitle", to.meta.title);
/* has token*/
@ -39,10 +22,12 @@ router.beforeEach(async (to, from, next) => {
console.info("[GAB] to next");
next({ path: "/xfdh/index", replace: true });
// NProgress.done();
} else if (embeddedSession && !getToken()) {
// The host framework already authenticated this embedded page. Avoid
// calling the standalone admin API, which would fail without its token
// and cause a redirect to the login screen during first paint.
} else if (embeddedSession) {
// 外部系统跳转进入:宿主框架已提供登录用户,无需再走登录页,
// 默认只挂载本地菜单(即非 admin 账号看到的默认内容)。
if (store.getters.sidebarRouters.length === 0) {
await store.dispatch("GenerateDefaultRoutes");
}
next();
} else {
console.info("[GAB] to next 2");


+ 18
- 18
src/router/index.js View File

@ -35,13 +35,13 @@ export const constantRoutes = [
component: Layout,
hidden: true,
redirect: '/xfdh/index',
meta: { title: '巡任务', xfdhHeader: true },
meta: { title: '巡任务', xfdhHeader: true },
children: [
{
path: 'index',
component: () => import('@/views/cards/taskSummary/inspectionTask'),
name: 'XfdhIndex',
meta: { title: '巡任务', activeMenu: '/task-summary/inspectionTask', xfdhHeader: true }
meta: { title: '巡任务', activeMenu: '/task-summary/inspectionTask', xfdhHeader: true }
}
]
},
@ -86,13 +86,13 @@ export const constantRoutes = [
path: 'task',
component: () => import('@/views/cards/taskSummary/inspectionTask'),
name: 'InspectionWorkspaceTask',
meta: { title: '巡任务', activeMenu: '/inspection-workspace/task', patrolWorkspace: true }
meta: { title: '巡任务', activeMenu: '/inspection-workspace/task', patrolWorkspace: true }
},
{
path: 'plan',
component: () => import('@/views/cards/patrolPlan/notstart'),
name: 'InspectionWorkspacePlan',
meta: { title: '巡方案', activeMenu: '/inspection-workspace/plan', patrolWorkspace: true }
meta: { title: '巡方案', activeMenu: '/inspection-workspace/plan', patrolWorkspace: true }
},
{
path: 'points',
@ -104,20 +104,20 @@ export const constantRoutes = [
path: 'report',
component: () => import('@/views/cards/patrolReport/InspectionReporter'),
name: 'InspectionWorkspaceReport',
meta: { title: '巡报告', activeMenu: '/inspection-workspace/report', patrolWorkspace: true }
meta: { title: '巡报告', activeMenu: '/inspection-workspace/report', patrolWorkspace: true }
},
{
path: 'report/detail',
component: () => import('@/views/cards/patrolReport/patrolReportDetail'),
name: 'InspectionWorkspaceReportDetail',
hidden: true,
meta: { title: '巡报告详情', activeMenu: '/inspection-workspace/report', patrolWorkspace: true }
meta: { title: '巡报告详情', activeMenu: '/inspection-workspace/report', patrolWorkspace: true }
},
{
path: 'schedule',
component: () => import('@/views/cards/tasksShow/index'),
name: 'InspectionWorkspaceSchedule',
meta: { title: '巡计划', activeMenu: '/inspection-workspace/schedule', patrolWorkspace: true }
meta: { title: '巡计划', activeMenu: '/inspection-workspace/schedule', patrolWorkspace: true }
},
{
path: 'defects',
@ -149,7 +149,7 @@ export const constantRoutes = [
path: 'index',
component: () => import('@/views/cards/taskSummary/inspectionTask'),
name: 'Index',
meta: { title: '巡任务', icon: 'dashboard', affix: true, activeMenu: '/task-summary/inspectionTask' }
meta: { title: '巡任务', icon: 'dashboard', affix: true, activeMenu: '/task-summary/inspectionTask' }
}
]
},
@ -170,15 +170,15 @@ export const constantRoutes = [
{
path: '/task-summary',
component: Layout,
// 与默认首页 /index 渲染同一组件,重定向过去复用固定的巡任务页签,避免出现两个同名页签
// 与默认首页 /index 渲染同一组件,重定向过去复用固定的巡任务页签,避免出现两个同名页签
redirect: '/index',
meta: { title: '巡任务' },
meta: { title: '巡任务' },
children: [
{
path: 'inspectionTask',
redirect: '/index',
name: 'InspectionTaskSummary',
meta: { title: '巡任务', activeMenu: '/task-summary/inspectionTask' }
meta: { title: '巡任务', activeMenu: '/task-summary/inspectionTask' }
}
]
},
@ -186,13 +186,13 @@ export const constantRoutes = [
path: '/patrol-plan',
component: Layout,
redirect: '/patrol-plan/notstart',
meta: { title: '巡方案', icon: 'task' },
meta: { title: '巡方案', icon: 'task' },
children: [
{
path: 'notstart',
component: () => import('@/views/cards/patrolPlan/notstart'),
name: 'PatrolPlan',
meta: { title: '巡方案', icon: 'task', activeMenu: '/patrol-plan/notstart' }
meta: { title: '巡方案', icon: 'task', activeMenu: '/patrol-plan/notstart' }
}
]
},
@ -217,20 +217,20 @@ export const constantRoutes = [
path: '/patrol-report',
component: Layout,
redirect: '/patrol-report/index',
meta: { title: '巡报告' },
meta: { title: '巡报告' },
children: [
{
path: 'index',
component: () => import('@/views/cards/patrolReport/InspectionReporter'),
name: 'PatrolReport',
meta: { title: '巡报告', activeMenu: '/patrol-report/index' }
meta: { title: '巡报告', activeMenu: '/patrol-report/index' }
},
{
path: 'detail',
component: () => import('@/views/cards/patrolReport/patrolReportDetail'),
name: 'patrolReportDetail',
hidden: true,
meta: { title: '巡报告详情', activeMenu: '/patrol-report/index' }
meta: { title: '巡报告详情', activeMenu: '/patrol-report/index' }
}
]
},
@ -238,13 +238,13 @@ export const constantRoutes = [
path: '/patrol-schedule',
component: Layout,
redirect: '/patrol-schedule/index',
meta: { title: '巡计划' },
meta: { title: '巡计划' },
children: [
{
path: 'index',
component: () => import('@/views/cards/tasksShow/index'),
name: 'PatrolSchedule',
meta: { title: '巡计划', activeMenu: '/patrol-schedule/index' }
meta: { title: '巡计划', activeMenu: '/patrol-schedule/index' }
}
]
},


+ 11
- 0
src/store/modules/permission.js View File

@ -29,6 +29,17 @@ const permission = {
},
},
actions: {
// 外部系统跳转进入时使用本地默认菜单,不请求后台路由
GenerateDefaultRoutes({ commit }) {
return new Promise(resolve => {
commit('SET_ROUTES', [])
commit('SET_SIDEBAR_ROUTERS', constantRoutes)
commit('SET_DEFAULT_ROUTES', [])
commit('SET_TOPBAR_ROUTES', [])
router.addRoutes([{ path: '*', redirect: '/404', hidden: true }])
resolve([])
})
},
// 生成路由
GenerateRoutes({ commit }) {
return new Promise(resolve => {


+ 31
- 0
src/utils/embeddedAuth.js View File

@ -0,0 +1,31 @@
// 外部系统(宿主框架)跳转进入时的会话识别。
// 宿主框架会把已登录用户写入 sessionStorage 的 main_userInfo,
// 本系统据此免登录进入,并默认使用本地菜单。
const EMBEDDED_USER_KEY = "main_userInfo";
export function getEmbeddedUser() {
const contexts = [window];
try {
if (window.parent && window.parent !== window) contexts.push(window.parent);
} catch (e) {}
try {
if (window.top && window.top !== window && contexts.indexOf(window.top) === -1) {
contexts.push(window.top);
}
} catch (e) {}
for (let index = 0; index < contexts.length; index++) {
try {
const raw = contexts[index].sessionStorage.getItem(EMBEDDED_USER_KEY);
if (!raw) continue;
const user = JSON.parse(raw);
if (user && typeof user === "object" && (user.id || user.username || user.realName)) {
return user;
}
} catch (e) {}
}
return null;
}
export function isEmbeddedSession() {
return !!getEmbeddedUser();
}

+ 5
- 0
src/utils/patrolName.js View File

@ -0,0 +1,5 @@
// 后端字典/接口里的类型名可能仍是旧命名“××巡视”,统一归一成“巡检”,
// 用于展示文案以及按名称做的相等判断
export function normalizePatrolName(name) {
return String(name || "").replace(/巡视/g, "巡检");
}

+ 18
- 27
src/utils/request.js View File

@ -9,6 +9,7 @@ import cache from '@/plugins/cache'
import { saveAs } from 'file-saver'
import { urlWhiteList } from '@/settings'
import md5 from 'md5.js'
import { isEmbeddedSession } from '@/utils/embeddedAuth'
import Vue from 'vue'
@ -95,33 +96,23 @@ service.interceptors.response.use((res) => {
console.log('[GAB] code: ' + code)
if (code === 401) {
isRelogin.show = false;
const postData = new LoginEntity();
postData.username = "admin";
postData.password = new md5().update("admin@123").digest('hex')
store.dispatch("Login", postData).then(() => {
console.info("[GAB] Login then");
router.push({ path: "/" }).catch(() => { });
})
// store.dispatch('LogOut').then(() => {
// location.href = '/index';
// })
// if (!isRelogin.show) {
// isRelogin.show = true;
// MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
// confirmButtonText: '重新登录',
// cancelButtonText: '取消',
// type: 'warning'
// }
// ).then(() => {
// isRelogin.show = false;
// store.dispatch('LogOut').then(() => {
// location.href = '/index';
// })
// }).catch(() => {
// isRelogin.show = false;
// });
// }
// return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
if (isEmbeddedSession()) {
// 外部系统跳转进入:宿主框架未提供本系统token,静默登录(默认普通账号)保证页面数据可用
const postData = new LoginEntity();
postData.username = "htjc";
postData.password = new md5().update("htjc@123").digest('hex')
store.dispatch("Login", postData).then(() => {
console.info("[GAB] Login then");
router.push({ path: "/" }).catch(() => { });
})
} else {
// 本系统登录的用户:会话过期后回到登录页,不能悄悄换成别的账号
store.dispatch("FedLogOut").then(() => {
Message.error("登录状态已过期,请重新登录");
router.push({ path: "/login" }).catch(() => { });
});
}
return Promise.reject(new Error('无效的会话,或者会话已过期,请重新登录。'))
} else if (code === 500) {
if (!res.config.noAlert) {
console.log(res);


+ 11
- 9
src/views/administration/edit_task.vue View File

@ -376,6 +376,8 @@ import TreeSelect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import linq from "linq";
import { listPatroltype } from "@/api/basedata/patrolpointmnt/patroltype";
import { normalizePatrolName } from "@/utils/patrolName";
export default {
name: "edit_task",
props: ["editid"],
@ -612,23 +614,23 @@ export default {
typeOptions: [
{
value: "1",
label: "例行巡",
label: "例行巡",
},
{
value: "2",
label: "特殊巡",
label: "特殊巡",
},
{
value: "3",
label: "专项巡",
label: "专项巡",
},
{
value: "4",
label: "自定义巡",
label: "自定义巡",
},
{
value: "5",
label: "联动巡",
label: "联动巡",
},
{
value: "6",
@ -721,14 +723,14 @@ export default {
.select((q) => {
return {
id: q.patrolTypeCode,
label: q.patrolTypeName,
label: normalizePatrolName(q.patrolTypeName),
};
})
.toArray();
ptype = {
id: node.patrolTypeCode,
isOpen: true,
label: node.patrolTypeName,
label: normalizePatrolName(node.patrolTypeName),
// isDisabled: false,
};
if (childs.length > 0) {
@ -990,7 +992,7 @@ export default {
let res = this.$refs.tree.getCheckedNodes(true);
this.addList = res;
if (this.addList.length == 0) {
this.$modal.msgError("请选择巡设备");
this.$modal.msgError("请选择巡设备");
} else {
// let li = []
// this.addList.map(d=>{
@ -1002,7 +1004,7 @@ export default {
return child.eqpbookId;
});
if (!bool) {
this.$modal.msgError("请选择巡设备");
this.$modal.msgError("请选择巡设备");
return;
}
if (this.radio == 1) {


+ 11
- 9
src/views/administration/new_task.vue View File

@ -257,6 +257,8 @@ import TreeSelect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import linq from "linq";
import { listPatroltype } from "@/api/basedata/patrolpointmnt/patroltype";
import { normalizePatrolName } from "@/utils/patrolName";
export default {
name: "new_task",
data () {
@ -314,23 +316,23 @@ export default {
typeOptions: [
{
value: "1",
label: "例行巡",
label: "例行巡",
},
{
value: "2",
label: "特殊巡",
label: "特殊巡",
},
{
value: "3",
label: "专项巡",
label: "专项巡",
},
{
value: "4",
label: "自定义巡",
label: "自定义巡",
},
{
value: "5",
label: "联动巡",
label: "联动巡",
},
{
value: "6",
@ -608,14 +610,14 @@ export default {
.select((q) => {
return {
id: q.patrolTypeCode,
label: q.patrolTypeName,
label: normalizePatrolName(q.patrolTypeName),
};
})
.toArray();
ptype = {
id: node.patrolTypeCode,
isOpen: true,
label: node.patrolTypeName,
label: normalizePatrolName(node.patrolTypeName),
// isDisabled: false,
};
if (childs.length > 0) {
@ -821,13 +823,13 @@ export default {
this.addList = res;
if (this.addList.length == 0) {
this.$modal.msgError("请选择巡设备");
this.$modal.msgError("请选择巡设备");
} else {
var bool = this.addList.every((child) => {
return child.eqpbookId;
});
if (!bool) {
this.$modal.msgError("请选择巡设备");
this.$modal.msgError("请选择巡设备");
return;
}
// let li = [];


+ 1
- 1
src/views/cards/components/ImagePreview/index.vue View File

@ -172,7 +172,7 @@ export default {
// ? 'http://192.168.1.116:33333/'+this.dataImageUrls[this.selectIndex]
// : "";
//
//
return this.dataImageUrls.length > this.selectIndex
? this.dataImageUrls[this.selectIndex]
: "";


+ 1
- 1
src/views/cards/defectRecord/index.vue View File

@ -423,7 +423,7 @@ export default {
width: 260px;
}
//
//
.query-reset-btn {
background: linear-gradient(#01016b, #01016b) padding-box,
linear-gradient(135deg, #3988ff, #0351c6) border-box !important;


+ 1
- 1
src/views/cards/error_statistics/patrolAbnormalStatistics.vue View File

@ -152,7 +152,7 @@ import { getAbnormalPatrolList } from "@/api/home";
import { getAllAlgorithmList } from "@/api/inspectionDataManage/alarmConfirm.js";
import debounce from "lodash.debounce";
import ImagePreview from "@/views/cards/components/ImagePreview/index.vue";
//
//
export default {
name: "PatrolAbnormalStatistics",
components: { CardPagination, ImagePreview },


+ 7
- 5
src/views/cards/patrolPlan/summary_editTask.vue View File

@ -351,6 +351,8 @@ import TreeSelect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import linq from "linq";
import { listPatroltype } from "@/api/basedata/patrolpointmnt/patroltype";
import { normalizePatrolName } from "@/utils/patrolName";
import { getWeekdaysInRange, getDaysInRange } from "@/utils/index.js";
import { treeAreaDeviceSelectFilterByPresetRight } from "@/api/basedata/patrolpointmnt/patrolpoint";
@ -433,7 +435,7 @@ export default {
patrolPointIds: [],
},
specialPatrolConditions: `特殊巡已开启,启动条件包括:
specialPatrolConditions: `特殊巡已开启,启动条件包括:
1. 恶劣天气情况
- 大风后
- 雷雨后
@ -470,7 +472,7 @@ export default {
if (!this.formData.type) return false;
const findSpecialPatrol = (items) => {
for (const item of items) {
if (item.id === this.formData.type && item.label === "特殊巡")
if (item.id === this.formData.type && item.label === "特殊巡")
return true;
if (item.children && findSpecialPatrol(item.children)) return true;
}
@ -537,13 +539,13 @@ export default {
.where((c) => c.parentId === node.patrolTypeId)
.select((q) => ({
id: q.patrolTypeCode,
label: q.patrolTypeName,
label: normalizePatrolName(q.patrolTypeName),
}))
.toArray();
const ptype = {
id: node.patrolTypeCode,
isOpen: true,
label: node.patrolTypeName,
label: normalizePatrolName(node.patrolTypeName),
};
if (childs.length) ptype.children = childs;
list.push(ptype);
@ -715,7 +717,7 @@ export default {
handlePatrolTypeSelect(node) {},
showSpecialPatrolAlert() {
this.$alert(this.specialPatrolConditions, "特殊巡启动条件", {
this.$alert(this.specialPatrolConditions, "特殊巡启动条件", {
confirmButtonText: "确定",
customClass: "special-patrol-alert",
showClose: false,


+ 9
- 7
src/views/cards/patrolPlan/summary_newTask.vue View File

@ -349,6 +349,8 @@ import TreeSelect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import linq from "linq";
import { listPatroltype } from "@/api/basedata/patrolpointmnt/patroltype";
import { normalizePatrolName } from "@/utils/patrolName";
import { getWeekdaysInRange, getDaysInRange } from "@/utils/index.js";
import { treeAreaDeviceSelectFilterByPresetRight } from "@/api/basedata/patrolpointmnt/patrolpoint";
@ -420,7 +422,7 @@ export default {
},
areaList: [],
selectAreaIdList: [],
specialPatrolConditions: `特殊巡已开启,启动条件包括:
specialPatrolConditions: `特殊巡已开启,启动条件包括:
1. 恶劣天气情况
- 大风后
- 雷雨后
@ -457,7 +459,7 @@ export default {
if (!this.type) return false;
const findSpecialPatrol = (items) => {
for (const item of items) {
if (item.id === this.type && item.label === "特殊巡") return true;
if (item.id === this.type && item.label === "特殊巡") return true;
if (item.children && findSpecialPatrol(item.children)) return true;
}
return false;
@ -609,13 +611,13 @@ export default {
.where((c) => c.parentId === node.patrolTypeId)
.select((q) => ({
id: q.patrolTypeCode,
label: q.patrolTypeName,
label: normalizePatrolName(q.patrolTypeName),
}))
.toArray();
const ptype = {
id: node.patrolTypeCode,
isOpen: true,
label: node.patrolTypeName,
label: normalizePatrolName(node.patrolTypeName),
};
if (childs.length) ptype.children = childs;
list.push(ptype);
@ -624,8 +626,8 @@ export default {
if (this.listPatroltype.length) {
const routinePatrol = list.find(
(item) =>
item.label === "例行巡" ||
item.children?.some((child) => child.label === "例行巡")
item.label === "例行巡" ||
item.children?.some((child) => child.label === "例行巡")
);
this.type = routinePatrol
? routinePatrol.id
@ -635,7 +637,7 @@ export default {
},
handlePatrolTypeSelect(node) {},
showSpecialPatrolAlert() {
this.$alert(this.specialPatrolConditions, "特殊巡启动条件", {
this.$alert(this.specialPatrolConditions, "特殊巡启动条件", {
confirmButtonText: "确定",
customClass: "special-patrol-alert",
showClose: false,


+ 6
- 6
src/views/cards/patrolReport/InspectionReporter.vue View File

@ -10,10 +10,10 @@
:inline="true"
label-width="90px"
>
<el-form-item label="巡任务" prop="inspectionTaskName">
<el-form-item label="巡任务" prop="inspectionTaskName">
<el-input
v-model="queryParams.inspectionTaskName"
placeholder="请输入巡任务"
placeholder="请输入巡任务"
clearable
@keyup.enter.native="handleQuery"
/>
@ -72,20 +72,20 @@
:index="table_index"
/>
<el-table-column
label="巡任务"
label="巡任务"
align="left"
prop="inspectionTaskName"
width="620"
header-align="center"
/>
<el-table-column
label="巡开始时间"
label="巡开始时间"
align="center"
prop="inspectionStartTime"
width="190"
/>
<el-table-column
label="巡结束时间"
label="巡结束时间"
align="center"
prop="inspectionEndTime"
width="190"
@ -257,7 +257,7 @@ export default {
this.isLock = false;
} else {
this.isLock = true;
this.$modal.msgWarning("巡报告正在生成,请稍后");
this.$modal.msgWarning("巡报告正在生成,请稍后");
}
});
}


+ 12
- 12
src/views/cards/patrolReport/patrolReportDetail.vue View File

@ -72,10 +72,10 @@
></el-table-column>
<el-table-column
prop="inspectionResults"
label="巡结果"
label="巡结果"
align="center"
></el-table-column>
<el-table-column prop="inspectionImg" label="巡图像" align="center">
<el-table-column prop="inspectionImg" label="巡图像" align="center">
<template slot-scope="scope">
<div class="inspection-img-wrap">
<!-- 直接使用原来的 inspectionImg AsyncImage 自己处理 -->
@ -148,10 +148,10 @@
></el-table-column>
<el-table-column
prop="inspectionResults"
label="巡结果"
label="巡结果"
align="center"
></el-table-column>
<el-table-column prop="inspectionImg" label="巡图像" align="center">
<el-table-column prop="inspectionImg" label="巡图像" align="center">
<template slot-scope="scope">
<div class="inspection-img-wrap">
<!-- 直接使用原来的 inspectionImg AsyncImage 自己处理 -->
@ -288,7 +288,7 @@ export default {
try {
report.detail = JSON.parse(report.detail);
} catch (error) {
console.warn("巡报告详情解析失败", error);
console.warn("巡报告详情解析失败", error);
}
}
this.reportInfo = report || {};
@ -300,8 +300,8 @@ export default {
}).catch((error) => {
this.reportInfo = {};
this.pointInfo = {};
console.error("获取巡报告详情失败", error);
this.$modal && this.$modal.msgError("巡报告详情加载失败");
console.error("获取巡报告详情失败", error);
this.$modal && this.$modal.msgError("巡报告详情加载失败");
});
},
@ -320,19 +320,19 @@ export default {
info2: this.reportInfo.checkTime,
},
{
title1: "巡开始时间",
title1: "巡开始时间",
info1: this.reportInfo.inspectionStartTime,
title2: "巡结束时间",
title2: "巡结束时间",
info2: this.reportInfo.inspectionEndTime,
},
{
title1: "巡任务",
title1: "巡任务",
info1: this.reportInfo.inspectionTaskName,
title2: "巡统计",
title2: "巡统计",
info2: this.reportInfo.patrolStatistics,
},
{
title1: "巡结论",
title1: "巡结论",
info1: this.reportInfo.description,
title2: "",
info2: "",


+ 7
- 5
src/views/cards/site_management/algorithm.vue View File

@ -157,13 +157,13 @@
placeholder="请输入审核人"
/>
</el-form-item>
<el-form-item label="巡结论" prop="taskResult">
<el-form-item label="巡结论" prop="taskResult">
<el-input
style="resize: none"
type="textarea"
:rows="3"
v-model="contrastForm.taskResult"
placeholder="请输入巡结论"
placeholder="请输入巡结论"
/>
</el-form-item>
</el-form>
@ -195,6 +195,8 @@ import {
} from "@/api/inspectionDataManage/inspectionArchive";
import debounce from "lodash.debounce";
import { listPatroltype } from "@/api/algorithmConfiguration/index";
import { normalizePatrolName } from "@/utils/patrolName";
import { openDialog } from "../common.js";
import CardPagination from "../components/CardPagination/index.vue";
import CardBox from "../components/cardBox.vue";
@ -253,7 +255,7 @@ export default {
{ required: true, message: "请输入审核人", trigger: "change" },
],
taskResult: [
{ required: true, message: "请输入巡结论", trigger: "change" },
{ required: true, message: "请输入巡结论", trigger: "change" },
],
},
//
@ -291,7 +293,7 @@ export default {
(item) => item.patrolTypeCode == type
);
if (element) {
return element.patrolTypeName;
return normalizePatrolName(element.patrolTypeName);
}
return "";
},
@ -369,7 +371,7 @@ export default {
// openDialog({
// sourceCardId: "wuhan@videoMonitor-card-45",
// targetCardId: "wuhan@videoMonitor-card-46",
// dialogTitle: "",
// dialogTitle: "",
// });
// }
},


+ 4
- 2
src/views/cards/site_management/site_management.vue View File

@ -1332,6 +1332,8 @@ import DrawShape, {
} from "@/components/Canvas/DrawShape.vue";
import linq from "linq";
import { listData } from "@/api/system/dict/data";
import { normalizePatrolName } from "@/utils/patrolName";
import {
listPatroltype,
getDeviceList,
@ -1655,14 +1657,14 @@ export default {
.select((q) => {
return {
id: q.patrolTypeId,
label: q.patrolTypeName,
label: normalizePatrolName(q.patrolTypeName),
};
})
.toArray();
ptype = {
id: node.patrolTypeId,
isOpen: true,
label: node.patrolTypeName,
label: normalizePatrolName(node.patrolTypeName),
};
if (childs.length > 0) {
ptype.children = childs;


+ 8
- 8
src/views/cards/taskSummary/inspectionTask.vue View File

@ -35,7 +35,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="巡时间">
<el-form-item label="巡时间">
<el-date-picker
v-model="dateRange"
size="small"
@ -292,7 +292,7 @@
</div>
</div>
<el-dialog
title="巡任务详情"
title="巡任务详情"
:visible.sync="showDetail"
:close-on-click-modal="false"
:close-on-press-escape="false"
@ -369,13 +369,13 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="巡结论" prop="taskResult">
<el-form-item label="巡结论" prop="taskResult">
<el-input
style="resize: none"
type="textarea"
:rows="3"
v-model="contrastForm.taskResult"
placeholder="请输入巡结论"
placeholder="请输入巡结论"
/>
</el-form-item>
</el-form>
@ -430,13 +430,13 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="巡结论" prop="taskResult">
<el-form-item label="巡结论" prop="taskResult">
<el-input
style="resize: none"
type="textarea"
:rows="3"
v-model="batchArchiveForm.taskResult"
placeholder="请输入巡结论"
placeholder="请输入巡结论"
/>
</el-form-item>
</el-form>
@ -576,7 +576,7 @@ export default {
{ required: true, message: "请输入审核人", trigger: "change" },
],
taskResult: [
{ required: true, message: "请输入巡结论", trigger: "change" },
{ required: true, message: "请输入巡结论", trigger: "change" },
],
},
//
@ -592,7 +592,7 @@ export default {
{ required: true, message: "请输入审核人", trigger: "change" },
],
taskResult: [
{ required: true, message: "请输入巡结论", trigger: "change" },
{ required: true, message: "请输入巡结论", trigger: "change" },
],
},
userList: [],


+ 4
- 4
src/views/cards/taskSummary/newInspectionTaskDetail.vue View File

@ -626,16 +626,16 @@ export default {
const patrolType = Number(this.taskInfo.patrolType);
switch (patrolType) {
case 1:
patrolTypeText = "例行巡";
patrolTypeText = "例行巡";
break;
case 2:
patrolTypeText = "特殊巡";
patrolTypeText = "特殊巡";
break;
case 3:
patrolTypeText = "专项巡";
patrolTypeText = "专项巡";
break;
case 4:
patrolTypeText = "自定义巡";
patrolTypeText = "自定义巡";
break;
case 5:
patrolTypeText = "联动任务";


+ 12
- 4
src/views/login.vue View File

@ -61,6 +61,7 @@
<script>
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { getToken } from "@/utils/auth";
import { encrypt, decrypt } from '@/utils/jsencrypt'
import md5 from 'md5.js'
@ -70,8 +71,8 @@ export default {
return {
codeUrl: "",
loginForm: {
username: "admin",
password: "admin@123",
username: "htjc",
password: "htjc@123",
rememberMe: false,
code: "",
uuid: ""
@ -104,7 +105,13 @@ export default {
created() {
this.getCode();
this.getCookie();
this.login()
// (htjc)
// 退( manual-login )
if (!getToken() && sessionStorage.getItem('manual-login') !== '1') {
this.loginForm.username = 'htjc';
this.loginForm.password = 'htjc@123';
this.login();
}
},
methods: {
getCode() {
@ -144,7 +151,8 @@ export default {
this.$store.dispatch("Login", postData).then(() => {
// return
//
sessionStorage.removeItem('manual-login');
this.$router.push({ path: this.redirect || "/" }).catch(() => { });
}).catch(() => {


+ 6
- 5
src/views/point/algorithm.vue View File

@ -157,13 +157,13 @@
placeholder="请输入审核人"
/>
</el-form-item>
<el-form-item label="巡结论" prop="taskResult">
<el-form-item label="巡结论" prop="taskResult">
<el-input
style="resize: none"
type="textarea"
:rows="3"
v-model="contrastForm.taskResult"
placeholder="请输入巡结论"
placeholder="请输入巡结论"
/>
</el-form-item>
</el-form>
@ -196,6 +196,7 @@ import {
// import InspectionArchiveContrastDialog from "@/views/components/InspectionArchiveContrastDialog.vue";
import debounce from "lodash.debounce";
import { listPatroltype } from "@/api/algorithmConfiguration/index";
import { normalizePatrolName } from "@/utils/patrolName";
import { openDialog } from "../common.js";
import CardPagination from "@/components/CardPagination/index.vue";
import CardBox from "@/components/cardBox.vue";
@ -257,7 +258,7 @@ export default {
{ required: true, message: "请输入审核人", trigger: "change" },
],
taskResult: [
{ required: true, message: "请输入巡结论", trigger: "change" },
{ required: true, message: "请输入巡结论", trigger: "change" },
],
},
//
@ -295,7 +296,7 @@ export default {
(item) => item.patrolTypeCode == type
);
if (element) {
return element.patrolTypeName;
return normalizePatrolName(element.patrolTypeName);
}
return "";
},
@ -373,7 +374,7 @@ export default {
// openDialog({
// sourceCardId: "wuhan@videoMonitor-card-45",
// targetCardId: "wuhan@videoMonitor-card-46",
// dialogTitle: "",
// dialogTitle: "",
// });
// }
},


+ 3
- 2
src/views/point/site_management.vue View File

@ -1338,6 +1338,7 @@ import DrawShape, {
ShapeEnum,
} from "@/components/Canvas/DrawShape.vue";
import linq from "linq";
import { normalizePatrolName } from "@/utils/patrolName";
import {
listPatroltype,
getDeviceList,
@ -1586,14 +1587,14 @@ export default {
.select((q) => {
return {
id: q.patrolTypeId,
label: q.patrolTypeName,
label: normalizePatrolName(q.patrolTypeName),
};
})
.toArray();
ptype = {
id: node.patrolTypeId,
isOpen: true,
label: node.patrolTypeName,
label: normalizePatrolName(node.patrolTypeName),
// isDisabled: false
};
if (childs.length > 0) {


Loading…
Cancel
Save