Skip to content

Commit 696a41d

Browse files
committed
fix:1.windos shortcut key problem 2.Table list switching page problem
1 parent a5b055a commit 696a41d

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

chat2db-client/src/components/SearchResult/TableBox/index.less

+3-1
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,11 @@
169169
.tableItemContent{
170170
overflow: hidden;
171171
max-height: 30px;
172-
line-height: 15px;
172+
line-height: 30px;
173+
flex: 1;
173174
&:hover{
174175
overflow: auto;
176+
line-height: 16px;
175177
}
176178
}
177179

chat2db-client/src/components/ShortcutKey/index.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ const shortcutsList = [
3131
title: i18n('common.text.optimizeSQL'),
3232
keys: [i18n('common.text.editorRightClick')],
3333
},
34-
{
35-
title: i18n('common.text.executeSelectedSQL'),
36-
keys: [keyboardKey.command, 'Enter'],
37-
},
3834
{
3935
title: i18n('common.text.executeSelectedSQL'),
4036
keys: [keyboardKey.command, 'R'],

chat2db-client/src/pages/main/workspace/components/TableList/index.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ const TableList = dvaModel((props: any) => {
235235

236236
useEffect(() => {
237237
setCurList([]);
238+
setPagingData(defaultPaddingData);
238239
if (isReady) {
239240
setCurType({ ...optionsList[0] });
240241
}
@@ -367,6 +368,7 @@ const TableList = dvaModel((props: any) => {
367368
const handleChangePageSize = (value: number) => {
368369
setPagingData({
369370
...pagingData,
371+
pageNo: 1,
370372
pageSize: value,
371373
});
372374
};

chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.tsx

+11-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { connect } from 'umi';
33
import i18n from '@/i18n';
44
import styles from './index.less';
55
import classnames from 'classnames';
6-
import { ConsoleOpenedStatus, ConsoleStatus, TreeNodeType, WorkspaceTabType, workspaceTabConfig } from '@/constants';
6+
import { ConsoleOpenedStatus, ConsoleStatus, OSType, TreeNodeType, WorkspaceTabType, workspaceTabConfig } from '@/constants';
77
import historyService from '@/service/history';
88
import sqlService from '@/service/sql';
99
import TabsNew, { ITabItem } from '@/components/TabsNew';
@@ -26,6 +26,7 @@ import {
2626
registerIntelliSenseTable,
2727
} from '@/utils/IntelliSense';
2828
import indexedDB from '@/indexedDB';
29+
import { osNow } from '@/utils';
2930

3031
interface IProps {
3132
className?: string;
@@ -69,8 +70,15 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
6970
// 注册快捷键command+shift+L新建console
7071
useEffect(() => {
7172
const handleKeyDown = (e: KeyboardEvent) => {
72-
if (e.metaKey && e.shiftKey && e.code === 'KeyL') {
73-
addConsole();
73+
// 如果是mac系统
74+
if(osNow().isMac){
75+
if (e.metaKey && e.shiftKey && e.code === 'KeyL') {
76+
addConsole();
77+
}
78+
}else{
79+
if (e.ctrlKey && e.shiftKey && e.code === 'KeyL') {
80+
addConsole();
81+
}
7482
}
7583
};
7684
window.addEventListener('keydown', handleKeyDown);

0 commit comments

Comments
 (0)