|
|
@@ -11,17 +11,14 @@ import SoftLeaderboard from './components/SoftLeaderboard'
|
|
|
import { cardTypeMap, cyclicalOp } from './consts'
|
|
|
import BusinessChar from './components/BusinessChar'
|
|
|
import RatioPanels from './components/RatioPanels'
|
|
|
-import PermSelect from '@/pages/Customer/Company/components/PermSelect'
|
|
|
-import { getAuthCache, setAuthCache } from '@/utils/auth'
|
|
|
-import { PERMISSION_SELECT_KEY, WORKBENCH_CYCLICAL_KEY } from '@/utils/cache/cacheEnum'
|
|
|
+import PermSelect, { PermDataTypeEunm } from '@/pages/Customer/Company/components/PermSelect'
|
|
|
+import { getAuthCache, getPermAuthCache, setAuthCache } from '@/utils/auth'
|
|
|
+import { WORKBENCH_CYCLICAL_KEY } from '@/utils/cache/cacheEnum'
|
|
|
|
|
|
const Dashboard = () => {
|
|
|
const timer = useRef(null)
|
|
|
- const permAuthCache = getAuthCache(PERMISSION_SELECT_KEY)
|
|
|
- let defaultPermValue = 'oneself'
|
|
|
- if (permAuthCache && permAuthCache.workbench) {
|
|
|
- defaultPermValue = permAuthCache.workbench
|
|
|
- }
|
|
|
+ const [defaultPermAuthCache, defaultStaffIds] = getPermAuthCache(PermDataTypeEunm.WORKBENCH)
|
|
|
+
|
|
|
const cyclicalAuthCache = getAuthCache(WORKBENCH_CYCLICAL_KEY)
|
|
|
let defaultCyclicalValue = 'week'
|
|
|
if (cyclicalAuthCache) {
|
|
|
@@ -44,7 +41,8 @@ const Dashboard = () => {
|
|
|
businessChar: {},
|
|
|
params: {
|
|
|
businessGroupId: '',
|
|
|
- dataPermission: defaultPermValue,
|
|
|
+ dataPermission: defaultPermAuthCache,
|
|
|
+ staffIds: defaultStaffIds,
|
|
|
cyclical: defaultCyclicalValue
|
|
|
}
|
|
|
})
|
|
|
@@ -214,7 +212,7 @@ const Dashboard = () => {
|
|
|
setState({
|
|
|
...state,
|
|
|
immediate: true,
|
|
|
- params: { ...state.params, staffIds, dataPermission: null }
|
|
|
+ params: { ...state.params, staffIds, dataPermission: 'custom' }
|
|
|
})
|
|
|
return
|
|
|
}
|