feat: 接口文档生成

This commit is contained in:
lbw 2023-02-08 16:03:41 +08:00
parent 31c2ac8968
commit 7c5152857d
3 changed files with 30 additions and 23 deletions

View File

@ -1,5 +1,5 @@
export default {
datasourceconf: {
datasourceconf: {
index: 'index',
importDatasourceConfTip: ' import DatasourceConf',
id: 'id',
@ -7,6 +7,7 @@ export default {
url: 'url',
username: 'username',
password: 'password',
docBtn: 'doc',
createTime: 'createTime',
updateTime: 'updateTime',
delFlag: 'delFlag',

View File

@ -1,5 +1,5 @@
export default {
datasourceconf: {
datasourceconf: {
index: '序号',
importDatasourceConfTip: '导入数据源',
id: '主键',
@ -7,6 +7,7 @@ export default {
url: 'jdbcurl',
username: '用户名',
password: '密码',
docBtn: '文档',
createTime: '创建时间',
updateTime: '更新',
delFlag: '删除标记',
@ -17,20 +18,20 @@ export default {
instance: '实例',
port: '端口',
host: '主机',
inputidTip: '请输入主键',
inputnameTip: '请输入别名',
inputurlTip: '请输入jdbcurl',
inputusernameTip: '请输入用户名',
inputpasswordTip: '请输入密码',
inputcreateTimeTip: '请输入创建时间',
inputupdateTimeTip: '请输入更新',
inputdelFlagTip: '请输入删除标记',
inputtenantIdTip: '请输入租户ID',
inputdsTypeTip: '请输入数据库类型',
inputconfTypeTip: '请输入配置类型',
inputdsNameTip: '请输入数据库名称',
inputinstanceTip: '请输入实例',
inputportTip: '请输入端口',
inputhostTip: '请输入主机',
inputidTip: '请输入主键',
inputnameTip: '请输入别名',
inputurlTip: '请输入jdbcurl',
inputusernameTip: '请输入用户名',
inputpasswordTip: '请输入密码',
inputcreateTimeTip: '请输入创建时间',
inputupdateTimeTip: '请输入更新',
inputdelFlagTip: '请输入删除标记',
inputtenantIdTip: '请输入租户ID',
inputdsTypeTip: '请输入数据库类型',
inputconfTypeTip: '请输入配置类型',
inputdsNameTip: '请输入数据库名称',
inputinstanceTip: '请输入实例',
inputportTip: '请输入端口',
inputhostTip: '请输入主机',
}
}

View File

@ -20,11 +20,7 @@
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()">
{{ $t('common.addBtn') }}
</el-button>
<el-button icon="upload-filled" type="primary" class="ml10" @click="excelUploadRef.show()">
{{ $t('common.importBtn') }}
</el-button>
<el-button :disabled="multiple" icon="Delete" type="primary" class="ml10"
@click="handleDelete(undefined)">
<el-button :disabled="multiple" icon="Delete" type="primary" class="ml10" @click="handleDelete(undefined)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@ -42,6 +38,11 @@
<el-table-column prop="createTime" :label="t('datasourceconf.createTime')" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button text type="primary" @click="downloadDoc(scope.row.name)">{{
$t('datasourceconf.docBtn')
}}</el-button>
<el-button text type="primary" @click="formDialogRef.openDialog(scope.row.id)">{{
$t('common.editBtn')
}}</el-button>
@ -65,6 +66,7 @@ import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObj } from "/@/api/gen/datasource";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useI18n } from "vue-i18n";
import { downBlobFile } from "/@/utils/other";
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
@ -72,7 +74,6 @@ const { t } = useI18n()
//
const formDialogRef = ref()
const excelUploadRef = ref()
//
const queryRef = ref()
const showSearch = ref(true)
@ -93,6 +94,10 @@ const {
} = useTable(state)
const downloadDoc = (dsName: string) => {
downBlobFile('/gen/dsconf/doc', { dsName }, `${dsName}.html`)
}
//
const resetQuery = () => {
queryRef.value.resetFields()