refactor:

1.修改表后,刷新表数据
2.修改索引sql拼接bug
3.暂时只有mysql支持编辑表
This commit is contained in:
刘宗洋
2022-10-29 17:11:44 +08:00
parent ba311c3504
commit f936331dff
3 changed files with 22 additions and 15 deletions

View File

@@ -55,7 +55,7 @@
<el-dropdown :show-timeout="70" :hide-timeout="50" @command="onHandleCommandClick">
<span class="layout-navbars-breadcrumb-user-link" style="cursor: pointer">
<img :src="getUserInfos.photo" class="layout-navbars-breadcrumb-user-link-photo mr5" />
{{ getUserInfos.username === '' ? 'test' : getUserInfos.username }}
{{ getUserInfos.name || 'test' }}
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<template #dropdown>

View File

@@ -144,7 +144,9 @@
<template #default="scope">
<el-link @click.prevent="showColumns(scope.row)" type="primary">字段</el-link>
<el-link class="ml5" @click.prevent="showTableIndex(scope.row)" type="success">索引</el-link>
<el-link class="ml5" @click.prevent="openEditTable(scope.row)" type="warning">编辑表</el-link>
<el-link class="ml5"
v-if="tableCreateDialog.enableEditTypes.indexOf(tableCreateDialog.type) > -1"
@click.prevent="openEditTable(scope.row)" type="warning">编辑表</el-link>
<el-link class="ml5" @click.prevent="showCreateDdl(scope.row)" type="info">DDL</el-link>
</template>
</el-table-column>
@@ -347,11 +349,13 @@ const state = reactive({
title: '创建表',
visible: false,
activeName: '1',
type: '',
enableEditTypes:['mysql'], // 支持"编辑表"的数据库类型
data: { // 修改表时,传递修改数据
edit: false,
row: {},
indexs: [],
columns: []
columns: [],
},
},
filterDb: {
@@ -569,6 +573,7 @@ const showTableInfo = async (row: any, db: string) => {
state.tableInfoDialog.visible = true;
try {
state.tableInfoDialog.infos = await dbApi.tableInfos.request({ id: row.id, db });
state.tableCreateDialog.type = row.type
state.dbId = row.id;
state.row = row;
state.db = db;
@@ -579,6 +584,8 @@ const showTableInfo = async (row: any, db: string) => {
}
};
// 给子组件调用,勿删
// eslint-disable-next-line no-unused-vars
const refreshTableInfo = async () => {
state.tableInfoDialog.infos = await dbApi.tableInfos.request({ id: state.dbId, db: state.db });
}