mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
refactor: 数据库操作界面小优化
This commit is contained in:
@@ -15,7 +15,7 @@ const config = {
|
|||||||
baseWsUrl: `${(window as any).globalConfig.BaseWsUrl || `${location.protocol == 'https:' ? 'wss:' : 'ws:'}//${getBaseApiUrl()}`}/api`,
|
baseWsUrl: `${(window as any).globalConfig.BaseWsUrl || `${location.protocol == 'https:' ? 'wss:' : 'ws:'}//${getBaseApiUrl()}`}/api`,
|
||||||
|
|
||||||
// 系统版本
|
// 系统版本
|
||||||
version: 'v1.5.3',
|
version: 'v1.5.4',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -566,4 +566,3 @@ onBeforeRouteUpdate((to) => {
|
|||||||
box-shadow: rgb(0 21 41 / 4%) 0px 1px 4px;
|
box-shadow: rgb(0 21 41 / 4%) 0px 1px 4px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@/components/contextmenu
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</page-table>
|
</page-table>
|
||||||
|
|
||||||
<el-dialog width="620" :title="`${db} 数据库导出`" v-model="exportDialog.visible">
|
<el-dialog width="720px" :title="`${db} 数据库导出`" v-model="exportDialog.visible">
|
||||||
<el-row justify="space-between">
|
<el-row justify="space-between">
|
||||||
<el-col :span="9">
|
<el-col :span="9">
|
||||||
<el-form-item label="导出内容: ">
|
<el-form-item label="导出内容: ">
|
||||||
@@ -413,6 +413,11 @@ const dumpDbs = () => {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
.db-list {
|
||||||
|
.el-transfer-panel {
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.el-dropdown-link-more {
|
.el-dropdown-link-more {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
|
|||||||
@@ -719,7 +719,7 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
|
|
||||||
.data-selection {
|
.data-selection {
|
||||||
background-color: var(--el-color-success-light-8);
|
background-color: var(--el-table-current-row-bg-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.data-spacing {
|
.data-spacing {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
<div class="mt5">
|
||||||
<el-link @click="onRefresh()" icon="refresh" :underline="false" class="ml5"> </el-link>
|
<el-link @click="onRefresh()" icon="refresh" :underline="false" class="ml5"> </el-link>
|
||||||
<el-divider direction="vertical" border-style="dashed" />
|
<el-divider direction="vertical" border-style="dashed" />
|
||||||
|
|
||||||
@@ -52,11 +53,14 @@
|
|||||||
<el-tooltip :show-after="500" v-if="hasUpdatedFileds" class="box-item" effect="dark" content="取消修改" placement="top">
|
<el-tooltip :show-after="500" v-if="hasUpdatedFileds" class="box-item" effect="dark" content="取消修改" placement="top">
|
||||||
<el-link @click="cancelUpdateFields" type="warning" :underline="false" class="f12">取消</el-link>
|
<el-link @click="cancelUpdateFields" type="warning" :underline="false" class="f12">取消</el-link>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-input
|
<el-input
|
||||||
|
ref="condInputRef"
|
||||||
|
@keyup.enter.native="onSelectByCondition()"
|
||||||
v-model="condition"
|
v-model="condition"
|
||||||
placeholder="若需条件过滤,可选择列并点击对应的字段并输入需要过滤的内容点击查询按钮即可"
|
placeholder="若需条件过滤,可选择列并点击对应的字段并输入需要过滤的内容后回车或点击查询按钮即可"
|
||||||
clearable
|
clearable
|
||||||
@clear="selectData"
|
@clear="selectData"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -146,7 +150,12 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="19">
|
<el-col :span="19">
|
||||||
<el-input ref="conditionInputRef" v-model="conditionDialog.value" :placeholder="conditionDialog.placeholder" />
|
<el-input
|
||||||
|
@keyup.enter.native="onConfirmCondition"
|
||||||
|
ref="oneCondInputRef"
|
||||||
|
v-model="conditionDialog.value"
|
||||||
|
:placeholder="conditionDialog.placeholder"
|
||||||
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@@ -195,9 +204,6 @@ import { ElMessage } from 'element-plus';
|
|||||||
import { DbInst } from '@/views/ops/db/db';
|
import { DbInst } from '@/views/ops/db/db';
|
||||||
import DbTableData from './DbTableData.vue';
|
import DbTableData from './DbTableData.vue';
|
||||||
|
|
||||||
const dataForm: any = ref(null);
|
|
||||||
const conditionInputRef: any = ref();
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
dbId: {
|
dbId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -217,8 +223,13 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const dataForm: any = ref(null);
|
||||||
const dbTableRef = ref(null) as Ref;
|
const dbTableRef = ref(null) as Ref;
|
||||||
const columnNameSearchInputRef = ref(null) as Ref;
|
const columnNameSearchInputRef = ref(null) as Ref;
|
||||||
|
const oneCondInputRef: any = ref();
|
||||||
|
const condInputRef = ref(null) as Ref;
|
||||||
|
|
||||||
|
const defaultPageSize = DbInst.DefaultLimit;
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
datas: [],
|
datas: [],
|
||||||
@@ -228,8 +239,16 @@ const state = reactive({
|
|||||||
loading: false, // 是否在加载数据
|
loading: false, // 是否在加载数据
|
||||||
columns: [] as any,
|
columns: [] as any,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: DbInst.DefaultLimit,
|
pageSize: defaultPageSize,
|
||||||
pageSizes: [25, 50, 100, 200, 500, 1000],
|
pageSizes: [
|
||||||
|
defaultPageSize,
|
||||||
|
defaultPageSize * 2,
|
||||||
|
defaultPageSize * 4,
|
||||||
|
defaultPageSize * 8,
|
||||||
|
defaultPageSize * 20,
|
||||||
|
defaultPageSize * 40,
|
||||||
|
defaultPageSize * 80,
|
||||||
|
],
|
||||||
count: 0,
|
count: 0,
|
||||||
selectionDatas: [] as any,
|
selectionDatas: [] as any,
|
||||||
condPopVisible: false,
|
condPopVisible: false,
|
||||||
@@ -374,7 +393,7 @@ const onConditionRowClick = (event: any) => {
|
|||||||
state.conditionDialog.columnRow = row;
|
state.conditionDialog.columnRow = row;
|
||||||
state.conditionDialog.visible = true;
|
state.conditionDialog.visible = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
conditionInputRef.value.focus();
|
oneCondInputRef.value.focus();
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -389,6 +408,7 @@ const onConfirmCondition = () => {
|
|||||||
condition += `${row.columnName} ${conditionDialog.condition} `;
|
condition += `${row.columnName} ${conditionDialog.condition} `;
|
||||||
state.condition = condition + DbInst.wrapColumnValue(row.columnType, conditionDialog.value);
|
state.condition = condition + DbInst.wrapColumnValue(row.columnType, conditionDialog.value);
|
||||||
onCancelCondition();
|
onCancelCondition();
|
||||||
|
condInputRef.value.focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
const onCancelCondition = () => {
|
const onCancelCondition = () => {
|
||||||
@@ -412,6 +432,7 @@ const onSelectByCondition = async () => {
|
|||||||
notEmpty(state.condition, '条件不能为空');
|
notEmpty(state.condition, '条件不能为空');
|
||||||
state.pageNum = 1;
|
state.pageNum = 1;
|
||||||
await selectData();
|
await selectData();
|
||||||
|
condInputRef.value.blur();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -565,8 +565,11 @@ const indexChanges = (row: any) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let prefix = row.unique ? 'udx_' : 'idx_';
|
let suffix = row.unique ? 'udx' : 'idx';
|
||||||
row.indexName = prefix + name;
|
let commentSuffix = row.unique ? '唯一索引' : '普通索引';
|
||||||
|
// 以表名为前缀
|
||||||
|
row.indexName = `${tableData.value.tableName}-${name}-${suffix}`;
|
||||||
|
row.indexComment = `${tableData.value.tableName}表(${name.replaceAll('_', ',')})${commentSuffix}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const oldData = { indexs: [] as any[], fields: [] as any[] };
|
const oldData = { indexs: [] as any[], fields: [] as any[] };
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import "fmt"
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
AppName = "mayfly-go"
|
AppName = "mayfly-go"
|
||||||
Version = "v1.5.3"
|
Version = "v1.5.4"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetAppInfo() string {
|
func GetAppInfo() string {
|
||||||
|
|||||||
Reference in New Issue
Block a user