fix: sql脚本默认账号密码调整&终端默认配色调整

This commit is contained in:
meilin.huang
2022-08-04 20:47:13 +08:00
parent 12f8cf0111
commit e1afb1ed54
6 changed files with 47 additions and 13 deletions

View File

@@ -107,11 +107,11 @@ const themeConfigModule: Module<ThemeConfigState, RootStateTypes> = {
layout: 'classic',
// ssh终端字体颜色
terminalForeground: '#7e9192',
terminalForeground: '#d0d0d0',
// ssh终端背景色
terminalBackground: '#002833',
terminalBackground: '#1c1c1c',
// ssh终端cursor色
terminalCursor: '#268F81',
terminalCursor: '#e4c9af',
terminalFontSize: 15,

View File

@@ -100,9 +100,17 @@
<el-button type="primary" size="small" @click="tableCreateDialog.visible = true">创建表</el-button>
</el-row>
<el-table v-loading="tableInfoDialog.loading" border stripe :data="tableInfoDialog.infos" size="small">
<el-table-column property="tableName" label="表名" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column property="tableComment" label="备注" min-width="150" show-overflow-tooltip></el-table-column>
<el-table v-loading="tableInfoDialog.loading" border stripe :data="filterTableInfos" size="small">
<el-table-column property="tableName" label="表名" min-width="150" show-overflow-tooltip>
<template #header>
<el-input v-model="tableInfoDialog.tableNameSearch" size="small" placeholder="表名: 输入可过滤" clearable />
</template>
</el-table-column>
<el-table-column property="tableComment" label="备注" min-width="150" show-overflow-tooltip>
<template #header>
<el-input v-model="tableInfoDialog.tableCommentSearch" size="small" placeholder="备注: 输入可过滤" clearable />
</template>
</el-table-column>
<el-table-column
prop="tableRows"
label="Rows"
@@ -244,7 +252,7 @@
</template>
<script lang='ts'>
import { toRefs, reactive, onMounted, defineComponent } from 'vue';
import { toRefs, reactive, computed, onMounted, defineComponent } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { formatByteSize } from '@/common/utils/format';
import DbEdit from './DbEdit.vue';
@@ -317,6 +325,8 @@ export default defineComponent({
loading: false,
visible: false,
infos: [],
tableNameSearch: '',
tableCommentSearch: '',
},
columnDialog: {
visible: false,
@@ -345,6 +355,26 @@ export default defineComponent({
state.projects = await projectApi.accountProjects.request(null);
});
const filterTableInfos = computed(() => {
const infos = state.tableInfoDialog.infos;
const tableNameSearch = state.tableInfoDialog.tableNameSearch;
const tableCommentSearch = state.tableInfoDialog.tableCommentSearch;
if (!tableNameSearch && !tableCommentSearch) {
return infos;
}
return infos.filter((data: any) => {
let tnMatch = true;
let tcMatch = true;
if (tableNameSearch) {
tnMatch = data.tableName.toLowerCase().includes(tableNameSearch.toLowerCase());
}
if (tableCommentSearch) {
tcMatch = data.tableComment.includes(tableCommentSearch);
}
return tnMatch && tcMatch;
});
});
const choose = (item: any) => {
if (!item) {
return;
@@ -572,6 +602,7 @@ export default defineComponent({
return {
...toRefs(state),
filterTableInfos,
enums,
search,
choose,

View File

@@ -65,9 +65,9 @@ export default defineComponent({
// cursorStyle: 'underline', //光标样式
disableStdin: false,
theme: {
foreground: getThemeConfig.value.terminalForeground || '#7e9192', //字体
background: getThemeConfig.value.terminalBackground || '#002833', //背景色
cursor: getThemeConfig.value.terminalCursor || '#268F81', //设置光标
foreground: getThemeConfig.value.terminalForeground || '#d0d0d0', //字体
background: getThemeConfig.value.terminalBackground || '#1c1c1c', //背景色
cursor: getThemeConfig.value.terminalCursor || '#e4c9af', //设置光标
} as any,
});
const fitAddon = new FitAddon();