feat: 日常优化

This commit is contained in:
meilin.huang
2022-02-14 14:58:25 +08:00
parent 2698157ce7
commit 5def4bc26d
14 changed files with 234 additions and 139 deletions

View File

@@ -196,7 +196,7 @@
</template>
<script lang="ts">
import { h, toRefs, reactive, computed, defineComponent, ref } from 'vue';
import { toRefs, reactive, computed, defineComponent, ref } from 'vue';
import { dbApi } from './api';
import _ from 'lodash';
@@ -218,7 +218,7 @@ import { ElMessage, ElMessageBox } from 'element-plus';
import ProjectEnvSelect from '../component/ProjectEnvSelect.vue';
import config from '@/common/config';
import { getSession } from '@/common/utils/storage';
import SqlExecBox from './SqlExecBox';
import SqlExecBox from './component/SqlExecBox';
export default defineComponent({
name: 'SqlExec',
@@ -828,8 +828,8 @@ export default defineComponent({
// 添加新数据行
const addRow = async () => {
const tableNmae = state.nowTableName;
const columns = await getColumns(tableNmae);
const tableName = state.nowTableName;
const columns = await getColumns(tableName);
// key: 字段名value: 字段名提示
let obj: any = {};
@@ -840,7 +840,7 @@ export default defineComponent({
let values = Object.values(obj).join(',');
let sql = `INSERT INTO ${state.nowTableName} (${columnNames}) VALUES (${values});`;
promptExeSql(sql, null, () => {
onRefresh(tableNmae);
onRefresh(tableName);
});
};