diff --git a/build_ui/src/views/train/analysis/dashboard/index.vue b/build_ui/src/views/train/analysis/dashboard/index.vue index 44adb97bd..6265d9cc1 100644 --- a/build_ui/src/views/train/analysis/dashboard/index.vue +++ b/build_ui/src/views/train/analysis/dashboard/index.vue @@ -109,35 +109,21 @@
业务运行待办与治理提醒 - 点击可直接跳转业务处理 + {{ hasAnyClickableReminder ? '点击具备权限的卡片可直接跳转业务处理' : '业务客观运行指标提示' }}
-
-
+
+
-
{{ overview.abnormalAttendanceCount || 0 }}
-
异常考勤人次
-
-
-
-
-
-
{{ overview.pendingReportCount || 0 }}
-
待报到参训学员
-
-
-
-
-
-
{{ overview.preallocatedAccommodationCount || 0 }}
-
住宿预分配待入住
-
-
-
-
-
-
{{ overview.abnormalAuthCount || 0 }}
-
门禁授权异常数
+
{{ item.count }}
+
{{ item.label }}
+
去处理
@@ -237,6 +223,67 @@ export default { computed: { planStatus() { return this.overview.planStatusCounts || {} + }, + reminders() { + const o = this.overview || {} + const items = [ + { + key: 'attendance', + label: '异常考勤人次', + count: o.abnormalAttendanceCount || 0, + route: '/analysis/attendance', + permission: 'train:analysis:attendance', + icon: 'el-icon-time', + iconBg: 'bg-danger', + numClass: 'text-danger' + }, + { + key: 'report', + label: '待报到参训学员', + count: o.pendingReportCount || 0, + route: '/analysis/report', + permission: 'train:report:list', + icon: 'el-icon-document-checked', + iconBg: 'bg-warning', + numClass: 'text-warning' + }, + { + key: 'accommodation', + label: '住宿预分配待入住', + count: o.preallocatedAccommodationCount || 0, + route: '/equip/accommodation', + permission: 'train:accommodation:list', + icon: 'el-icon-office-building', + iconBg: 'bg-primary', + numClass: 'text-primary' + }, + { + key: 'auth', + label: '门禁授权异常数', + count: o.abnormalAuthCount || 0, + route: '/equip/extra', + permission: null, + icon: 'el-icon-key', + iconBg: 'bg-danger', + numClass: 'text-danger' + } + ] + return items.map(item => { + let clickable = false + if (item.key === 'auth') { + // 门禁授权异常跳 /equip/extra(设备物联页面),系统管理员与培训管理员均在角色菜单中配置了该路由 + clickable = this.$auth.hasRoleOr(['admin', 'train_admin']) + } else if (item.permission) { + clickable = this.$auth.hasPermi(item.permission) + } + return { + ...item, + clickable + } + }) + }, + hasAnyClickableReminder() { + return this.reminders.some(r => r.clickable) } }, created() { @@ -466,6 +513,11 @@ export default { if (this.statusChartInstance) { this.statusChartInstance.dispose(); this.statusChartInstance = null } if (this.venueChartInstance) { this.venueChartInstance.dispose(); this.venueChartInstance = null } }, + handleReminderClick(item) { + if (item && item.clickable && item.route) { + this.$router.push(item.route) + } + }, goTo(path) { if (path) this.$router.push(path) } @@ -597,6 +649,10 @@ export default { background: #f0f7ff; border-color: #b3d8ff; } + &.non-clickable { + cursor: default; + opacity: 0.9; + } .alert-icon { width: 36px; height: 36px; @@ -620,6 +676,11 @@ export default { font-size: 12px; color: #909399; } + .action-hint { + font-size: 11px; + color: #409EFF; + margin-top: 2px; + } } } }