feat: 帮助文档页面多语言

This commit is contained in:
TsMask
2023-11-29 09:59:36 +08:00
parent ab79f577af
commit 1c83d7ca46
3 changed files with 26 additions and 8 deletions

View File

@@ -1319,5 +1319,12 @@ export default {
noChange: "No change in interface settings",
},
},
tool: {
help: {
download: "Download",
pdfViewer: "In-browser preview",
pdfViewerErr: "Sorry, your browser does not support PDF preview!",
}
},
},
};

View File

@@ -495,7 +495,6 @@ export default {
},
sub: {
subInfo:'签约信息',
neTypePlease: '查询网元类型',
neType: 'UDM网元类型',
export: '导出',
exportConfirm: '确认导出全部签约用户数据吗?',
@@ -530,15 +529,12 @@ export default {
ardTip:'接入控制标志(Access-Restriction-Data),可用于区分2G/3G/LTE用户,便于为2G/3G/LTE网络共存时,对不同类型用户进行区分服务',
},
base5G: {
neTypePlease: '查询网元类型',
neType: 'AMF网元对象',
},
ue: {
neTypePlease: '查询网元类型',
neType: 'SMF网元对象',
},
ims: {
neTypePlease: '查询网元类型',
neType: 'IMS网元对象',
},
},
@@ -1323,5 +1319,12 @@ export default {
noChange: "接口设置无变更",
},
},
tool: {
help: {
download: "下载",
pdfViewer: "浏览器内预览",
pdfViewerErr: "很抱歉,您的浏览器不支持 PDF 预览!",
}
},
},
};

View File

@@ -79,7 +79,13 @@ function fnDownload() {
/**系统使用手册跳转 */
function fnClickHelpDoc() {
window.open(docUrl.value, '_blank');
// 浏览器支持 PDF 预览
if (navigator.pdfViewerEnabled) {
window.open(docUrl.value, '_blank');
} else {
// 浏览器不支持 PDF 预览
alert(t('views.tool.help.pdfViewerErr'));
}
}
onMounted(() => {
@@ -104,11 +110,11 @@ onMounted(() => {
<a-space :size="12" align="center">
<a-button type="default" @click="fnClickHelpDoc()">
<template #icon><ToTopOutlined /> </template>
浏览器内打开
{{ t('views.tool.help.pdfViewer') }}
</a-button>
<a-button type="primary" @click="fnDownload()">
<template #icon><DownloadOutlined /></template>
下载
{{ t('views.tool.help.download') }}
</a-button>
</a-space>
</a-col>
@@ -126,7 +132,9 @@ onMounted(() => {
</a-col>
<a-col :span="20" class="right">
<div class="right-view">
<a-spin size="large" style="margin: 50%" v-if="pages === 0" />
<VuePDF
v-else
:pdf="pdf"
:page="viewPage"
:scale="viewScale"
@@ -134,7 +142,7 @@ onMounted(() => {
:annotations-filter="['Link']"
@annotation="fnAnnotation"
>
<a-spin style="margin: 50%" />
<a-spin size="large" style="margin: 50%" />
</VuePDF>
</div>
</a-col>