|
|
@ -6,8 +6,11 @@ import { get } from 'lodash-es'; |
|
|
|
import { computed, ref, toRef } from 'vue'; |
|
|
|
|
|
|
|
const ORGID = sessionStorage.getItem('ORGID') ? Number(sessionStorage.getItem('ORGID')) : ''; |
|
|
|
|
|
|
|
const isAdmin = sessionStorage.getItem('ISADMIN') |
|
|
|
? Boolean(sessionStorage.getItem('ISADMIN')) |
|
|
|
: false; |
|
|
|
const selectDefaultValue = ref(ORGID); |
|
|
|
const selectDefaultDisabled = ref(isAdmin); |
|
|
|
const transform = (data, map) => { |
|
|
|
return Object.keys(map).reduce((pre, cur) => { |
|
|
|
pre[cur] = data[map[cur]]; |
|
|
@ -43,6 +46,7 @@ export const appConfig = { |
|
|
|
api: '/carbon-smart/user/login/logInInfo', |
|
|
|
size: 'large', |
|
|
|
defaultValue: selectDefaultValue, |
|
|
|
disabled: selectDefaultDisabled, |
|
|
|
// autoSelectFirst: true,
|
|
|
|
placeholder: '请选择', |
|
|
|
onSelect: async (cur, record) => { |
|
|
@ -91,8 +95,11 @@ export const appConfig = { |
|
|
|
projectId: 'projectId', |
|
|
|
linkList: 'linkList', |
|
|
|
permissionVos: 'permissionVos', |
|
|
|
adminFlag: 'adminFlag', |
|
|
|
}); |
|
|
|
sessionStorage.setItem('ORGID', info.orgId); |
|
|
|
sessionStorage.setItem('ISADMIN', trD?.adminFlag === '1'); |
|
|
|
selectDefaultDisabled.value = info?.adminFlag === '1'; |
|
|
|
selectDefaultValue.value = info.orgId; |
|
|
|
return { data: { ...trD } }; |
|
|
|
}); |
|
|
|