fix: 修复帮助文档跳转404

This commit is contained in:
TsMask
2023-11-28 16:43:51 +08:00
parent a22213eae3
commit 534f261bd4
3 changed files with 33 additions and 11 deletions

View File

@@ -120,6 +120,16 @@ function fnComponentSetName(component: any, to: any) {
// 清空导航栏标签
tabsStore.clear();
/**系统使用手册跳转 */
function fnClickHelpDoc(language?: string) {
const routeData = router.resolve({ name: 'HelpDoc' });
let href = routeData.href;
if (language) {
href = `${routeData.href}?language=${language}`;
}
window.open(href, '_blank');
}
/**
* 国际化翻译转换
*/
@@ -285,9 +295,8 @@ document.addEventListener('visibilitychange', function () {
</a-button>
<a-button
type="link"
href="/help"
target="_blank"
size="small"
@click="fnClickHelpDoc()"
v-if="appStore.getHelpDoc !== '#'"
>
{{ t('loayouts.basic.helpDoc') }}

View File

@@ -32,6 +32,16 @@ function fnClickAlarm() {
router.push({ path: '/faultManage/active-alarm' });
}
/**系统使用手册跳转 */
function fnClickHelpDoc(language?: string) {
const routeData = router.resolve({ name: 'HelpDoc' });
let href = routeData.href;
if (language) {
href = `${routeData.href}?language=${language}`;
}
window.open(href, '_blank');
}
/**改变多语言 */
function fnChangeLocale(e: any) {
changeLocale(e.key);
@@ -54,7 +64,7 @@ function fnChangeLocale(e: any) {
<a-tooltip placement="bottom" v-if="appStore.getHelpDoc !== '#'">
<template #title>{{ t('loayouts.rightContent.helpDoc') }}</template>
<a-button type="text" href="/help" target="_blank">
<a-button type="text" @click="fnClickHelpDoc()">
<template #icon>
<QuestionCircleOutlined />
</template>

View File

@@ -1,16 +1,13 @@
<script lang="ts" setup>
import { Modal, message } from 'ant-design-vue/lib';
import { onMounted, reactive } from 'vue';
import useAppStore from '@/store/modules/app';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { transferHelpDoc } from '@/api/index';
import { uploadFileChunk } from '@/api/tool/file';
import { FileType } from 'ant-design-vue/lib/upload/interface';
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
import { sessionGet } from '@/utils/cache-session-utils';
import { useRouter } from 'vue-router';
const appStore = useAppStore();
const router = useRouter();
const { t, currentLocale, optionsLocale } = useI18n();
@@ -99,6 +96,16 @@ function fnSave() {
});
}
/**系统使用手册跳转 */
function fnClickHelpDoc(language?: string) {
const routeData = router.resolve({ name: 'HelpDoc' });
let href = routeData.href;
if (language) {
href = `${routeData.href}?language=${language}`;
}
window.open(href, '_blank');
}
onMounted(() => {
state.language = currentLocale.value;
});
@@ -168,11 +175,7 @@ onMounted(() => {
{{ opt.label }}
</a-select-option>
</a-select>
<a-button
type="link"
:href="'/help?language=' + state.language"
target="_blank"
>
<a-button type="link" @click="fnClickHelpDoc(state.language)">
<template #icon>
<QuestionCircleOutlined />
{{ t('views.system.setting.sysHelpDocOpen') }}