fix(auth): 完善权限控制与强制改密流程
This commit is contained in:
@@ -21,6 +21,7 @@ import type {
|
||||
ReportTaskResponseDto,
|
||||
ReportTasksQueryDto,
|
||||
} from '@/api/management/types'
|
||||
import { useLoginStore } from '@/stores/login'
|
||||
|
||||
import DepartmentDistributionChart from './components/DepartmentDistributionChart.vue'
|
||||
import ReportDetailTable from './components/ReportDetailTable.vue'
|
||||
@@ -77,6 +78,12 @@ const exportDownloadLoading = ref(false)
|
||||
const exportJob = ref<ReportExportJobResponseDto | null>(null)
|
||||
const exportErrorMessage = ref('')
|
||||
const router = useRouter()
|
||||
const loginStore = useLoginStore()
|
||||
const canExportReport = computed(
|
||||
() =>
|
||||
!loginStore.isReadOnly &&
|
||||
(isReportsMockEnabled || loginStore.hasWritePermission('report:signing:export')),
|
||||
)
|
||||
|
||||
let reportRequestId = 0
|
||||
let taskRequestId = 0
|
||||
@@ -850,6 +857,11 @@ function handleRetryTasks() {
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
if (!canExportReport.value) {
|
||||
ElMessage.warning('当前账号没有导出签署报表的权限')
|
||||
return
|
||||
}
|
||||
|
||||
if (exportLoading.value) {
|
||||
return
|
||||
}
|
||||
@@ -1056,6 +1068,7 @@ onUnmounted(() => {
|
||||
:method-options="methodOptions"
|
||||
:export-loading="exportLoading"
|
||||
:export-status="exportStatusText"
|
||||
:can-export="canExportReport"
|
||||
@update:period="updatePeriod"
|
||||
@update:campus="updateCampus"
|
||||
@update:department="updateDepartment"
|
||||
|
||||
Reference in New Issue
Block a user