mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-15 12:16:34 +08:00
refactor: 前端样式调整
This commit is contained in:
@@ -57,7 +57,7 @@ const initCurrentRouteMeta = (meta: object) => {
|
|||||||
// 设置 main 的高度
|
// 设置 main 的高度
|
||||||
const initHeaderHeight = () => {
|
const initHeaderHeight = () => {
|
||||||
let { isTagsview } = themeConfig.value;
|
let { isTagsview } = themeConfig.value;
|
||||||
if (isTagsview) return (state.headerHeight = `84px`);
|
if (isTagsview) return (state.headerHeight = `77px`);
|
||||||
else return (state.headerHeight = `50px`);
|
else return (state.headerHeight = `50px`);
|
||||||
};
|
};
|
||||||
// 页面加载前
|
// 页面加载前
|
||||||
@@ -67,7 +67,7 @@ onBeforeMount(() => {
|
|||||||
});
|
});
|
||||||
// 监听 themeConfig 配置文件的变化,更新菜单 el-scrollbar 的高度
|
// 监听 themeConfig 配置文件的变化,更新菜单 el-scrollbar 的高度
|
||||||
watch(themeConfig.value, (val) => {
|
watch(themeConfig.value, (val) => {
|
||||||
state.headerHeight = val.isTagsview ? '84px' : '50px';
|
state.headerHeight = val.isTagsview ? '77px' : '50px';
|
||||||
if (val.isFixedHeaderChange !== val.isFixedHeader) {
|
if (val.isFixedHeaderChange !== val.isFixedHeader) {
|
||||||
if (!proxy.$refs.layoutScrollbarRef) return false;
|
if (!proxy.$refs.layoutScrollbarRef) return false;
|
||||||
proxy.$refs.layoutScrollbarRef.update();
|
proxy.$refs.layoutScrollbarRef.update();
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="tag-tree">
|
<div class="tag-tree">
|
||||||
<el-row type="flex" justify="space-between">
|
|
||||||
<el-col :span="24" class="el-scrollbar flex-auto" style="overflow: auto">
|
|
||||||
<el-input v-model="filterText" placeholder="输入关键字->搜索已展开节点信息" clearable size="small" class="mb5" />
|
<el-input v-model="filterText" placeholder="输入关键字->搜索已展开节点信息" clearable size="small" class="mb5" />
|
||||||
|
<el-scrollbar :style="{ height: state.height, maxHeight: state.height, backgroundColor: 'var(--el-fill-color-blank)' }">
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
:style="{ maxHeight: state.height, height: state.height, overflow: 'auto' }"
|
|
||||||
:highlight-current="true"
|
:highlight-current="true"
|
||||||
:indent="10"
|
:indent="10"
|
||||||
:load="loadNode"
|
:load="loadNode"
|
||||||
@@ -35,19 +32,18 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</el-col>
|
</el-scrollbar>
|
||||||
</el-row>
|
|
||||||
<contextmenu :dropdown="state.dropdown" :items="state.contextmenuItems" ref="contextmenuRef" @currentContextmenuClick="onCurrentContextmenuClick" />
|
<contextmenu :dropdown="state.dropdown" :items="state.contextmenuItems" ref="contextmenuRef" @currentContextmenuClick="onCurrentContextmenuClick" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, reactive, ref, watch, toRefs, onUnmounted } from 'vue';
|
import { onMounted, reactive, ref, watch, toRefs } from 'vue';
|
||||||
import { NodeType, TagTreeNode } from './tag';
|
import { NodeType, TagTreeNode } from './tag';
|
||||||
import TagInfo from './TagInfo.vue';
|
import TagInfo from './TagInfo.vue';
|
||||||
import { Contextmenu } from '@/components/contextmenu';
|
import { Contextmenu } from '@/components/contextmenu';
|
||||||
import { tagApi } from '../tag/api';
|
import { tagApi } from '../tag/api';
|
||||||
import { useWindowSize } from '@vueuse/core';
|
import { useEventListener, useWindowSize } from '@vueuse/core';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
resourceType: {
|
resourceType: {
|
||||||
@@ -94,17 +90,13 @@ const { filterText } = toRefs(state);
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
setHeight();
|
setHeight();
|
||||||
window.addEventListener('resize', setHeight);
|
useEventListener(window, 'resize', setHeight);
|
||||||
});
|
});
|
||||||
|
|
||||||
const setHeight = () => {
|
const setHeight = () => {
|
||||||
state.height = vh.value - 150 + 'px';
|
state.height = vh.value - 138 + 'px';
|
||||||
};
|
};
|
||||||
|
|
||||||
onUnmounted(() => {
|
|
||||||
window.removeEventListener('resize', setHeight);
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(filterText, (val) => {
|
watch(filterText, (val) => {
|
||||||
treeRef.value?.filter(val);
|
treeRef.value?.filter(val);
|
||||||
});
|
});
|
||||||
@@ -203,9 +195,6 @@ defineExpose({
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.tag-tree {
|
.tag-tree {
|
||||||
overflow: 'auto';
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
|
||||||
border: 1px solid var(--el-border-color-light, #ebeef5);
|
border: 1px solid var(--el-border-color-light, #ebeef5);
|
||||||
|
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ import { getDbDialect } from './dialect/index';
|
|||||||
import { sleep } from '@/common/utils/loading';
|
import { sleep } from '@/common/utils/loading';
|
||||||
import { TagResourceTypeEnum } from '@/common/commonEnum';
|
import { TagResourceTypeEnum } from '@/common/commonEnum';
|
||||||
import { Splitpanes, Pane } from 'splitpanes';
|
import { Splitpanes, Pane } from 'splitpanes';
|
||||||
|
import { useEventListener } from '@vueuse/core';
|
||||||
|
|
||||||
const DbSqlEditor = defineAsyncComponent(() => import('./component/sqleditor/DbSqlEditor.vue'));
|
const DbSqlEditor = defineAsyncComponent(() => import('./component/sqleditor/DbSqlEditor.vue'));
|
||||||
const DbTableDataOp = defineAsyncComponent(() => import('./component/table/DbTableDataOp.vue'));
|
const DbTableDataOp = defineAsyncComponent(() => import('./component/table/DbTableDataOp.vue'));
|
||||||
@@ -387,7 +388,7 @@ const { nowDbInst } = toRefs(state);
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
setHeight();
|
setHeight();
|
||||||
// 监听浏览器窗口大小变化,更新对应组件高度
|
// 监听浏览器窗口大小变化,更新对应组件高度
|
||||||
window.onresize = () => setHeight();
|
useEventListener(window, 'resize', setHeight);
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
@@ -399,7 +400,7 @@ onBeforeUnmount(() => {
|
|||||||
*/
|
*/
|
||||||
const setHeight = () => {
|
const setHeight = () => {
|
||||||
state.dataTabsTableHeight = window.innerHeight - 255 + 'px';
|
state.dataTabsTableHeight = window.innerHeight - 255 + 'px';
|
||||||
state.tablesOpHeight = window.innerHeight - 220 + 'px';
|
state.tablesOpHeight = window.innerHeight - 212 + 'px';
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选择数据库,改变当前正在操作的数据库信息
|
// 选择数据库,改变当前正在操作的数据库信息
|
||||||
@@ -609,8 +610,6 @@ const getNowDbInfo = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#data-exec {
|
#data-exec {
|
||||||
min-height: calc(100vh - 155px);
|
|
||||||
|
|
||||||
.el-tabs {
|
.el-tabs {
|
||||||
--el-tabs-header-height: 30px;
|
--el-tabs-header-height: 30px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
@resize="resizeTableHeight"
|
@resize="resizeTableHeight"
|
||||||
horizontal
|
horizontal
|
||||||
class="default-theme"
|
class="default-theme"
|
||||||
style="height: calc(100vh - 225px)"
|
style="height: calc(100vh - 220px)"
|
||||||
>
|
>
|
||||||
<Pane :size="state.editorSize" max-size="80">
|
<Pane :size="state.editorSize" max-size="80">
|
||||||
<MonacoEditor ref="monacoEditorRef" class="mt5" v-model="state.sql" language="sql" height="100%" :id="'MonacoTextarea-' + getKey()" />
|
<MonacoEditor ref="monacoEditorRef" class="mt5" v-model="state.sql" language="sql" height="100%" :id="'MonacoTextarea-' + getKey()" />
|
||||||
@@ -276,8 +276,9 @@ const onRemoveTab = (targetId: number) => {
|
|||||||
const resizeTableHeight = (e: any) => {
|
const resizeTableHeight = (e: any) => {
|
||||||
const vh = window.innerHeight;
|
const vh = window.innerHeight;
|
||||||
state.editorSize = e[0].size;
|
state.editorSize = e[0].size;
|
||||||
const editorHeight = (vh - 225) * (state.editorSize / 100);
|
const plitpaneHeight = vh - 210;
|
||||||
state.tableDataHeight = vh - 225 - 40 - editorHeight + 'px';
|
const editorHeight = plitpaneHeight * (state.editorSize / 100);
|
||||||
|
state.tableDataHeight = plitpaneHeight - editorHeight - 40 + 'px';
|
||||||
};
|
};
|
||||||
|
|
||||||
const getKey = () => {
|
const getKey = () => {
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ const NodeTypeColl = new NodeType(MongoNodeType.Coll).withNodeClickFunc((nodeDat
|
|||||||
const findParamInputRef: any = ref(null);
|
const findParamInputRef: any = ref(null);
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
tags: [],
|
tags: [],
|
||||||
dataHeight: `${window.innerHeight - 194 - 35}px`,
|
dataHeight: `${window.innerHeight - 220}px`,
|
||||||
mongoList: [] as any,
|
mongoList: [] as any,
|
||||||
activeName: '', // 当前操作的tab
|
activeName: '', // 当前操作的tab
|
||||||
dataTabs: {} as any, // 数据tabs
|
dataTabs: {} as any, // 数据tabs
|
||||||
|
|||||||
@@ -88,13 +88,15 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-tree
|
<el-scrollbar
|
||||||
:style="{
|
:style="{
|
||||||
maxHeight: state.keyTreeHeight,
|
maxHeight: state.keyTreeHeight,
|
||||||
height: state.keyTreeHeight,
|
height: state.keyTreeHeight,
|
||||||
overflow: 'auto',
|
backgroundColor: 'var(--el-fill-color-blank)',
|
||||||
border: '1px solid var(--el-border-color-light, #ebeef5)',
|
border: '1px solid var(--el-border-color-light, #ebeef5)',
|
||||||
}"
|
}"
|
||||||
|
>
|
||||||
|
<el-tree
|
||||||
ref="keyTreeRef"
|
ref="keyTreeRef"
|
||||||
:highlight-current="true"
|
:highlight-current="true"
|
||||||
:data="keyTreeData"
|
:data="keyTreeData"
|
||||||
@@ -121,6 +123,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
|
</el-scrollbar>
|
||||||
|
|
||||||
<contextmenu :dropdown="state.contextmenu.dropdown" :items="state.contextmenu.items" ref="contextmenuRef" />
|
<contextmenu :dropdown="state.contextmenu.dropdown" :items="state.contextmenu.items" ref="contextmenuRef" />
|
||||||
</div>
|
</div>
|
||||||
@@ -178,6 +181,7 @@ import { Contextmenu, ContextmenuItem } from '@/components/contextmenu';
|
|||||||
import { sleep } from '../../../common/utils/loading';
|
import { sleep } from '../../../common/utils/loading';
|
||||||
import { TagResourceTypeEnum } from '@/common/commonEnum';
|
import { TagResourceTypeEnum } from '@/common/commonEnum';
|
||||||
import { Splitpanes, Pane } from 'splitpanes';
|
import { Splitpanes, Pane } from 'splitpanes';
|
||||||
|
import { useEventListener } from '@vueuse/core';
|
||||||
|
|
||||||
const KeyDetail = defineAsyncComponent(() => import('./KeyDetail.vue'));
|
const KeyDetail = defineAsyncComponent(() => import('./KeyDetail.vue'));
|
||||||
|
|
||||||
@@ -275,7 +279,7 @@ const state = reactive({
|
|||||||
tags: [],
|
tags: [],
|
||||||
redisList: [] as any,
|
redisList: [] as any,
|
||||||
dbList: [],
|
dbList: [],
|
||||||
keyTreeHeight: window.innerHeight - 147 - 30 + 'px',
|
keyTreeHeight: '100px',
|
||||||
loadingKeyTree: false,
|
loadingKeyTree: false,
|
||||||
keys: [] as any,
|
keys: [] as any,
|
||||||
keySeparator: ':',
|
keySeparator: ':',
|
||||||
@@ -315,11 +319,11 @@ const { scanParam, keyTreeData, newKeyDialog } = toRefs(state);
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
setHeight();
|
setHeight();
|
||||||
// 监听浏览器窗口大小变化,更新对应组件高度
|
// 监听浏览器窗口大小变化,更新对应组件高度
|
||||||
window.onresize = () => setHeight();
|
useEventListener(window, 'resize', setHeight);
|
||||||
});
|
});
|
||||||
|
|
||||||
const setHeight = () => {
|
const setHeight = () => {
|
||||||
state.keyTreeHeight = window.innerHeight - 174 + 'px';
|
state.keyTreeHeight = window.innerHeight - 165 + 'px';
|
||||||
};
|
};
|
||||||
|
|
||||||
const scan = async (appendKey = false) => {
|
const scan = async (appendKey = false) => {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ require (
|
|||||||
github.com/go-playground/universal-translator v0.18.1
|
github.com/go-playground/universal-translator v0.18.1
|
||||||
github.com/go-playground/validator/v10 v10.14.0
|
github.com/go-playground/validator/v10 v10.14.0
|
||||||
github.com/go-sql-driver/mysql v1.7.1
|
github.com/go-sql-driver/mysql v1.7.1
|
||||||
github.com/golang-jwt/jwt/v5 v5.1.0
|
github.com/golang-jwt/jwt/v5 v5.2.0
|
||||||
github.com/gorilla/websocket v1.5.1
|
github.com/gorilla/websocket v1.5.1
|
||||||
github.com/kanzihuang/vitess/go/vt/sqlparser v0.0.0-20231018071450-ac8d9f0167e9
|
github.com/kanzihuang/vitess/go/vt/sqlparser v0.0.0-20231018071450-ac8d9f0167e9
|
||||||
github.com/lionsoul2014/ip2region/binding/golang v0.0.0-20230712084735-068dc2aee82d
|
github.com/lionsoul2014/ip2region/binding/golang v0.0.0-20230712084735-068dc2aee82d
|
||||||
@@ -25,7 +25,7 @@ require (
|
|||||||
github.com/redis/go-redis/v9 v9.3.0
|
github.com/redis/go-redis/v9 v9.3.0
|
||||||
github.com/robfig/cron/v3 v3.0.1 // 定时任务
|
github.com/robfig/cron/v3 v3.0.1 // 定时任务
|
||||||
github.com/stretchr/testify v1.8.4
|
github.com/stretchr/testify v1.8.4
|
||||||
go.mongodb.org/mongo-driver v1.12.1 // mongo
|
go.mongodb.org/mongo-driver v1.13.1 // mongo
|
||||||
golang.org/x/crypto v0.16.0 // ssh
|
golang.org/x/crypto v0.16.0 // ssh
|
||||||
golang.org/x/oauth2 v0.14.0
|
golang.org/x/oauth2 v0.14.0
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
|
|||||||
Reference in New Issue
Block a user