增加 swagger、druid、skywalking、admin 的自定义路径

This commit is contained in:
shizhong
2023-06-13 11:49:19 +08:00
parent 1ba37bfca4
commit 789ac414e9
5 changed files with 90 additions and 39 deletions

View File

@ -1,45 +1,37 @@
<template>
<ContentWrap title="数据库文档">
<!-- 操作工具栏 -->
<div class="mb-10px">
<XButton
type="primary"
preIcon="ep:download"
:title="t('action.export') + ' HTML'"
@click="handleExport('HTML')"
/>
<XButton
type="primary"
preIcon="ep:download"
:title="t('action.export') + ' Word'"
@click="handleExport('Word')"
/>
<XButton
type="primary"
preIcon="ep:download"
:title="t('action.export') + ' Markdown'"
@click="handleExport('Markdown')"
/>
<el-button type="primary" plain @click="handleExport('HTML')">
<Icon icon="ep:download" /> 导出 HTML
</el-button>
<el-button type="primary" plain @click="handleExport('Word')">
<Icon icon="ep:download" /> 导出 Word
</el-button>
<el-button type="primary" plain @click="handleExport('Markdown')">
<Icon icon="ep:download" /> 导出 Markdown
</el-button>
</div>
<IFrame v-if="!loding" v-loading="loding" :src="src" />
<IFrame v-if="!loading" v-loading="loading" :src="src" />
</ContentWrap>
</template>
<script setup lang="ts" name="DbDoc">
import download from '@/utils/download'
import * as DbDocApi from '@/api/infra/dbDoc'
const { t } = useI18n() // 国际化
const src = ref('')
const loding = ref(true)
const loading = ref(true) // 是否加载中
const src = ref('') // HTML 的地址
/** 页面加载 */
const init = async () => {
const res = await DbDocApi.exportHtmlApi()
let blob = new Blob([res], { type: 'text/html' })
let blobUrl = window.URL.createObjectURL(blob)
src.value = blobUrl
loding.value = false
try {
const data = await DbDocApi.exportHtmlApi()
const blob = new Blob([data], { type: 'text/html' })
src.value = window.URL.createObjectURL(blob)
} finally {
loading.value = false
}
}
/** 处理导出 */
const handleExport = async (type: string) => {
if (type === 'HTML') {
@ -55,6 +47,8 @@ const handleExport = async (type: string) => {
download.markdown(res, '数据库文档.md')
}
}
/** 初始化 */
onMounted(async () => {
await init()
})