Merge remote-tracking branch 'soybean/main' into dev
# Conflicts: # src/layouts/modules/global-header/index.vue
This commit is contained in:
commit
538a04b894
@ -45,7 +45,7 @@ const tenantId = ref<CommonType.IdType>(authStore.userInfo?.user?.tenantId || '0
|
|||||||
</div>
|
</div>
|
||||||
<div class="h-full flex-y-center justify-end">
|
<div class="h-full flex-y-center justify-end">
|
||||||
<TenantSelect v-if="!appStore.isMobile" v-model:value="tenantId" class="mr-12px w-150px" />
|
<TenantSelect v-if="!appStore.isMobile" v-model:value="tenantId" class="mr-12px w-150px" />
|
||||||
<GlobalSearch />
|
<GlobalSearch v-if="themeStore.header.globalSearch.visible" />
|
||||||
<MessageButton />
|
<MessageButton />
|
||||||
<FullScreen v-if="!appStore.isMobile" :full="isFullscreen" @click="toggle" />
|
<FullScreen v-if="!appStore.isMobile" :full="isFullscreen" @click="toggle" />
|
||||||
<LangSwitch
|
<LangSwitch
|
||||||
|
|||||||
@ -130,6 +130,9 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra
|
|||||||
<SettingItem key="9" :label="$t('theme.header.multilingual.visible')">
|
<SettingItem key="9" :label="$t('theme.header.multilingual.visible')">
|
||||||
<NSwitch v-model:value="themeStore.header.multilingual.visible" />
|
<NSwitch v-model:value="themeStore.header.multilingual.visible" />
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
|
<SettingItem key="10" :label="$t('theme.header.globalSearch.visible')">
|
||||||
|
<NSwitch v-model:value="themeStore.header.globalSearch.visible" />
|
||||||
|
</SettingItem>
|
||||||
</TransitionGroup>
|
</TransitionGroup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -135,6 +135,9 @@ const local: App.I18n.Schema = {
|
|||||||
},
|
},
|
||||||
multilingual: {
|
multilingual: {
|
||||||
visible: 'Display multilingual button'
|
visible: 'Display multilingual button'
|
||||||
|
},
|
||||||
|
globalSearch: {
|
||||||
|
visible: 'Display GlobalSearch button'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tab: {
|
tab: {
|
||||||
|
|||||||
@ -135,6 +135,9 @@ const local: App.I18n.Schema = {
|
|||||||
},
|
},
|
||||||
multilingual: {
|
multilingual: {
|
||||||
visible: '显示多语言按钮'
|
visible: '显示多语言按钮'
|
||||||
|
},
|
||||||
|
globalSearch: {
|
||||||
|
visible: '显示全局搜索按钮'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tab: {
|
tab: {
|
||||||
|
|||||||
@ -25,8 +25,8 @@ export function setupAppVersionNotification() {
|
|||||||
|
|
||||||
const buildTime = await getHtmlBuildTime();
|
const buildTime = await getHtmlBuildTime();
|
||||||
|
|
||||||
// If build time hasn't changed, no update is needed
|
// If failed to get build time or build time hasn't changed, no update is needed.
|
||||||
if (buildTime === BUILD_TIME) {
|
if (!buildTime || buildTime === BUILD_TIME) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,16 +88,22 @@ export function setupAppVersionNotification() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getHtmlBuildTime() {
|
async function getHtmlBuildTime(): Promise<string | null> {
|
||||||
const baseUrl = import.meta.env.VITE_BASE_URL || '/';
|
const baseUrl = import.meta.env.VITE_BASE_URL || '/';
|
||||||
|
|
||||||
|
try {
|
||||||
const res = await fetch(`${baseUrl}index.html?time=${Date.now()}`);
|
const res = await fetch(`${baseUrl}index.html?time=${Date.now()}`);
|
||||||
|
|
||||||
|
if (!res.ok) {
|
||||||
|
console.error('getHtmlBuildTime error:', res.status, res.statusText);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const html = await res.text();
|
const html = await res.text();
|
||||||
|
|
||||||
const match = html.match(/<meta name="buildTime" content="(.*)">/);
|
const match = html.match(/<meta name="buildTime" content="(.*)">/);
|
||||||
|
return match?.[1] || null;
|
||||||
const buildTime = match?.[1] || '';
|
} catch (error) {
|
||||||
|
console.error('getHtmlBuildTime error:', error);
|
||||||
return buildTime;
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,9 @@ export const themeSettings: App.Theme.ThemeSetting = {
|
|||||||
},
|
},
|
||||||
multilingual: {
|
multilingual: {
|
||||||
visible: true
|
visible: true
|
||||||
|
},
|
||||||
|
globalSearch: {
|
||||||
|
visible: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tab: {
|
tab: {
|
||||||
|
|||||||
7
src/typings/app.d.ts
vendored
7
src/typings/app.d.ts
vendored
@ -58,6 +58,10 @@ declare namespace App {
|
|||||||
/** Whether to show the multilingual */
|
/** Whether to show the multilingual */
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
};
|
};
|
||||||
|
globalSearch: {
|
||||||
|
/** Whether to show the GlobalSearch */
|
||||||
|
visible: boolean;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
/** Tab */
|
/** Tab */
|
||||||
tab: {
|
tab: {
|
||||||
@ -415,6 +419,9 @@ declare namespace App {
|
|||||||
multilingual: {
|
multilingual: {
|
||||||
visible: string;
|
visible: string;
|
||||||
};
|
};
|
||||||
|
globalSearch: {
|
||||||
|
visible: string;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
tab: {
|
tab: {
|
||||||
visible: string;
|
visible: string;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user