增加表格导出多数据库支持

This commit is contained in:
piexlMax
2024-03-15 23:22:20 +08:00
parent 3b3441851c
commit 5ef4b21858
3 changed files with 68 additions and 3 deletions

View File

@@ -116,6 +116,16 @@
>
<template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
</el-table-column>
<el-table-column
align="left"
label="数据库"
prop="name"
width="120"
>
<template #defalut="scope">
<span>{{ scope.row.dbNname || "GVA库" }}</span>
</template>
</el-table-column>
<el-table-column
align="left"
label="模板名称"
@@ -188,6 +198,40 @@
:rules="rule"
label-width="100px"
>
<el-form-item
label="业务库"
prop="dbName"
>
<template #label>
<el-tooltip
content="需要提前到db-list自行配置多数据库如未配置需配置后重启服务方可使用若无法选择请到config.yaml中设置disabled:false选择导入导出的目标库"
placement="bottom"
effect="light"
>
<div> 业务库 <el-icon><QuestionFilled /></el-icon> </div>
</el-tooltip>
</template>
<el-select
v-model="formData.dbName"
clearable
placeholder="选择业务库"
>
<el-option
v-for="item in dbList"
:key="item.aliasName"
:value="item.aliasName"
:label="item.aliasName"
:disabled="item.disable"
>
<div>
<span>{{ item.aliasName }}</span>
<span style="float:right;color:#8492a6;font-size:13px">{{ item.dbName }}</span>
</div>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="模板名称:"
prop="name"
@@ -319,6 +363,7 @@ import { formatDate } from '@/utils/format'
import { ElMessage, ElMessageBox } from 'element-plus'
import { ref, reactive } from 'vue'
import WarningBar from '@/components/warningBar/warningBar.vue'
import { getDB } from '@/api/autoCode'
defineOptions({
name: 'ExportTemplate'
@@ -456,6 +501,16 @@ const total = ref(0)
const pageSize = ref(10)
const tableData = ref([])
const searchInfo = ref({})
const dbList = ref([])
const getDbFunc = async() => {
const res = await getDB()
if (res.code === 0) {
dbList.value = res.data.dbList
}
}
getDbFunc()
// 重置
const onReset = () => {
@@ -525,7 +580,6 @@ const deleteRow = (row) => {
})
}
// 多选删除
const onDelete = async() => {
ElMessageBox.confirm('确定要删除吗?', '提示', {