Merge branch 'dev' of http://120.46.213.136:9528/isoftstone/lc_frontend into dev
This commit is contained in:
@@ -231,15 +231,8 @@ const getCachedRegionOption = (): any[] | null => {
|
||||
const cached = sessionStorage.getItem(CACHE_KEY)
|
||||
if (cached) {
|
||||
const cacheData: CacheData = JSON.parse(cached)
|
||||
const now = Date.now()
|
||||
// 检查缓存是否在有效期内
|
||||
if (now - cacheData.timestamp < CACHE_DURATION) {
|
||||
console.log('使用缓存的 regionOption 数据')
|
||||
return cacheData.records
|
||||
} else {
|
||||
console.log('缓存已过期,清除缓存')
|
||||
sessionStorage.removeItem(CACHE_KEY)
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('读取缓存失败:', error)
|
||||
|
||||
@@ -237,15 +237,8 @@ const getCachedRegionOption = (): any[] | null => {
|
||||
const cached = sessionStorage.getItem(CACHE_KEY)
|
||||
if (cached) {
|
||||
const cacheData: CacheData = JSON.parse(cached)
|
||||
const now = Date.now()
|
||||
// 检查缓存是否在有效期内
|
||||
if (now - cacheData.timestamp < CACHE_DURATION) {
|
||||
console.log('使用缓存的 regionOption 数据')
|
||||
return cacheData.records
|
||||
} else {
|
||||
console.log('缓存已过期,清除缓存')
|
||||
sessionStorage.removeItem(CACHE_KEY)
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('读取缓存失败:', error)
|
||||
@@ -643,13 +636,21 @@ const handleRiskTabChange = async (tab: TabType) => {
|
||||
|
||||
// 同时获取维保任务和巡检任务的数据
|
||||
const [maintenanceResponse, inspectionResponse] = await Promise.all([
|
||||
getWorkOrderStatistics({workOrderType, taskType: '维保任务', campus_id: query.campus_id}).catch(error => {
|
||||
getWorkOrderStatistics({
|
||||
workOrderType,
|
||||
taskType: '维保任务',
|
||||
campus_id: query.campus_id
|
||||
}).catch(error => {
|
||||
console.error('获取维保任务数据失败:', error)
|
||||
return { records: [] }
|
||||
return {records: []}
|
||||
}),
|
||||
getWorkOrderStatistics({workOrderType, taskType: '巡检任务', campus_id: query.campus_id}).catch(error => {
|
||||
getWorkOrderStatistics({
|
||||
workOrderType,
|
||||
taskType: '巡检任务',
|
||||
campus_id: query.campus_id
|
||||
}).catch(error => {
|
||||
console.error('获取巡检任务数据失败:', error)
|
||||
return { records: [] }
|
||||
return {records: []}
|
||||
})
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user