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

View File

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

View File

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

View File

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