fix(menu): 菜单显示组织&应用包类型判断调整

This commit is contained in:
baiqi 2024-07-16 11:42:44 +08:00 committed by 刘瑞斌
parent 89fef39731
commit 0c4aebd30a
4 changed files with 25 additions and 16 deletions

View File

@ -53,7 +53,7 @@
try { try {
appStore.initSystemVersion(); // appStore.initSystemVersion(); //
// license // license
if (appStore.packageType === 'enterprise') { if (appStore.getPackageType === 'enterprise') {
licenseStore.getValidateLicense(); licenseStore.getValidateLicense();
} }
if (licenseStore.hasLicense()) { if (licenseStore.hasLicense()) {
@ -96,6 +96,7 @@
setLongType('LARK'); setLongType('LARK');
setLoginExpires(); setLoginExpires();
} catch (err) { } catch (err) {
// eslint-disable-next-line no-console
console.log(err); console.log(err);
} }
} }
@ -107,6 +108,7 @@
setLongType('LARK_SUITE'); setLongType('LARK_SUITE');
setLoginExpires(); setLoginExpires();
} catch (err) { } catch (err) {
// eslint-disable-next-line no-console
console.log(err); console.log(err);
} }
} }

View File

@ -221,11 +221,11 @@
} }
watch( watch(
() => xPack.value, () => [xPack.value, appStore.getPackageType],
async (val) => { async ([val, packageType]) => {
if (val) { if (val) {
personalMenus.value = [...copyPersonalMenus.value]; personalMenus.value = [...copyPersonalMenus.value];
if (appStore.packageType === 'enterprise' && licenseStore.hasLicense()) { if (packageType === 'enterprise') {
getOrgList(); getOrgList();
} }
} else { } else {
@ -248,7 +248,7 @@
watchEffect(() => { watchEffect(() => {
if (switchOrgVisible.value || menuSwitchOrgVisible.value) { if (switchOrgVisible.value || menuSwitchOrgVisible.value) {
if (appStore.packageType === 'enterprise' && licenseStore.hasLicense()) { if (appStore.getPackageType === 'enterprise' && licenseStore.hasLicense()) {
getOrgList(); getOrgList();
} }
nextTick(() => { nextTick(() => {
@ -424,13 +424,17 @@
) : ( ) : (
t(element?.meta?.locale || '') t(element?.meta?.locale || '')
)} )}
<a-tooltip content={currentOrgName.value} position="right"> {xPack.value ? (
<div <a-tooltip content={currentOrgName.value} position="right">
class={collapsed.value ? 'hidden' : 'current-org-tag'} // <div
> class={collapsed.value ? 'hidden' : 'current-org-tag'} //
{currentOrgName.value.substring(0, 1)} >
</div> {currentOrgName.value.substring(0, 1)}
</a-tooltip> </div>
</a-tooltip>
) : (
''
)}
</div> </div>
</a-menu-item> </a-menu-item>
) : ( ) : (

View File

@ -36,7 +36,7 @@
function checkAuthMenu() { function checkAuthMenu() {
const topMenus = appStore.getTopMenus; const topMenus = appStore.getTopMenus;
if (appStore.packageType === 'community') { if (appStore.getPackageType === 'community') {
appStore.setTopMenus(topMenus.filter((item) => item.name !== RouteEnum.SETTING_SYSTEM_AUTHORIZED_MANAGEMENT)); appStore.setTopMenus(topMenus.filter((item) => item.name !== RouteEnum.SETTING_SYSTEM_AUTHORIZED_MANAGEMENT));
} else { } else {
appStore.setTopMenus(topMenus); appStore.setTopMenus(topMenus);
@ -120,7 +120,7 @@
() => appStore.currentOrgId, () => appStore.currentOrgId,
async () => { async () => {
await appStore.initSystemPackage(); await appStore.initSystemPackage();
if (appStore.packageType === 'enterprise') { if (appStore.getPackageType === 'enterprise') {
licenseStore.getValidateLicense(); licenseStore.getValidateLicense();
} }
}, },
@ -130,8 +130,8 @@
); );
watch( watch(
() => appStore.packageType, () => appStore.getPackageType,
(val) => { () => {
checkAuthMenu(); checkAuthMenu();
} }
); );

View File

@ -116,6 +116,9 @@ const useAppStore = defineStore('app', {
getLoginLoadingStatus(state: AppState): boolean { getLoginLoadingStatus(state: AppState): boolean {
return state.loginLoading; return state.loginLoading;
}, },
getPackageType(state: AppState): string {
return state.packageType;
},
}, },
actions: { actions: {
/** /**