fix: 将导出列表分成三个模块
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m40s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m40s
This commit is contained in:
55
src/config/constants/exportTask.ts
Normal file
55
src/config/constants/exportTask.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { ExportTaskScene } from '@/types/api'
|
||||
|
||||
export interface ExportTaskScenePermissions {
|
||||
detail: string
|
||||
download: string
|
||||
cancel: string
|
||||
}
|
||||
|
||||
export interface ExportTaskSceneConfig {
|
||||
scene: ExportTaskScene
|
||||
sceneName: string
|
||||
pageTitle: string
|
||||
permissions: ExportTaskScenePermissions
|
||||
}
|
||||
|
||||
export const EXPORT_TASK_SCENE_CONFIG: Record<ExportTaskScene, ExportTaskSceneConfig> = {
|
||||
device: {
|
||||
scene: 'device',
|
||||
sceneName: '设备管理',
|
||||
pageTitle: '导出设备',
|
||||
permissions: {
|
||||
detail: 'export_task:device_detail',
|
||||
download: 'export_task:device_download',
|
||||
cancel: 'export_task:device_cancel'
|
||||
}
|
||||
},
|
||||
iot_card: {
|
||||
scene: 'iot_card',
|
||||
sceneName: 'IOT卡管理',
|
||||
pageTitle: '导出IOT卡',
|
||||
permissions: {
|
||||
detail: 'export_task:iot_card_detail',
|
||||
download: 'export_task:iot_card_download',
|
||||
cancel: 'export_task:iot_card_cancel'
|
||||
}
|
||||
},
|
||||
order: {
|
||||
scene: 'order',
|
||||
sceneName: '订单管理',
|
||||
pageTitle: '导出订单',
|
||||
permissions: {
|
||||
detail: 'export_task:order_detail',
|
||||
download: 'export_task:order_download',
|
||||
cancel: 'export_task:order_cancel'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const getExportTaskSceneConfig = (scene?: ExportTaskScene) => {
|
||||
return scene ? EXPORT_TASK_SCENE_CONFIG[scene] : undefined
|
||||
}
|
||||
|
||||
export const getExportTaskSceneName = (scene?: ExportTaskScene) => {
|
||||
return getExportTaskSceneConfig(scene)?.sceneName || '-'
|
||||
}
|
||||
@@ -31,3 +31,6 @@ export * from './roleTypes'
|
||||
|
||||
// 启用状态相关
|
||||
export * from './enableStatus'
|
||||
|
||||
// 导出任务相关
|
||||
export * from './exportTask'
|
||||
|
||||
Reference in New Issue
Block a user