Skip to content

Commit ab28876

Browse files
committed
【New Features】Supports the ctrl/cmd+c shortcut to copy row data or cell data
【New Features】Supports the shortcut key ctrl/cmd+v to paste and copy row data/cell data to row/cell
1 parent 8a0cdca commit ab28876

19 files changed

Lines changed: 509 additions & 334 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
11
# 3.0.10
22
`2023-11-05`
33
**Changelog**
4-
- ⭐【New Features】The tree node operation menu supports right-clicking
5-
- ⭐【New Features】The tree node operation menu can copy the names of tables, fields, keys, indexes, and functions
6-
- ⭐【New Features】Edit table structure supports setting primary keys in columns
7-
- ⭐【New Features】Edit data to support cell-level undo changes
84
- ⭐【New Features】 Edit data support right click operation
95
1. Supports single-row replication of Insert, Update, table header fields, and row data
106
2. Clone the selected row
117
3. Replication of cell data is supported
128
4. You can set the cell to Null or Default
139
5. Row deletion is supported
10+
6. Supports zooming in to view or modify data
11+
- ⭐【New Features】Supports the ctrl/cmd+c shortcut to copy row data or cell data
12+
- ⭐【New Features】Supports the shortcut key ctrl/cmd+v to paste and copy row data/cell data to row/cell
13+
- ⭐【New Features】The tree node operation menu can copy the names of tables, fields, keys, indexes, and functions
14+
- ⭐【New Features】Edit table structure supports setting primary keys in columns
1415
- ⭐【New Features】History is added to the foldable panel on the right
16+
- ⭐【New Features】Edit data to support cell-level undo changes
1517
- ⚡️【Optimize】Edit the table structure to add loading
18+
- ⚡️【Optimize】The tree node operation menu supports right-clicking
1619
- 🐞【Fixed】Fixed table structure editing floating-point decimal Settings display exception
1720

1821
**更新日志**
19-
- ⭐【新功能】树节点操作菜单支持右键唤出
20-
- ⭐【新功能】树节点操作菜单支持复制表、字段、key、index、函数等名称
21-
- ⭐【新功能】编辑表结构支持在列中设置主键
22-
- ⭐【新功能】编辑数据支持单元格级别撤销修改
2322
- ⭐【新功能】编辑数据支持右键操作
2423
1. 支持单行复制 Insert、Update、表头字段、行数据
2524
2. 支持克隆选中行
2625
3. 支持复制单元格数据
2726
4. 支持设置单元格为Null和Default
2827
5. 支持删除行
28+
6. 支持放大查看或修改数据
29+
- ⭐【新功能】支持快捷键ctrl/cmd+c 复制行数据/单元格数据
30+
- ⭐【新功能】支持快捷键ctrl/cmd+v 粘贴复制行数据/单元格数据到行/单元格
31+
- ⭐【新功能】树节点操作菜单支持复制表、字段、key、index、函数等名称
32+
- ⭐【新功能】编辑表结构支持在列中设置主键
2933
- ⭐【新功能】右侧可折叠面板中增加历史记录
34+
- ⭐【新功能】编辑数据支持单元格级别撤销修改
3035
- ⚡️【优化】编辑表结构添加loading
36+
- ⚡️【优化】树节点操作菜单支持右键唤出
3137
- 🐞【修复】修复表结构编辑浮点数小数位设置显示异常
3238

3339

chat2db-client/src/components/CascaderDB/index.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
&:hover {
99
background-color: var(--color-hover-bg);
1010
}
11-
1211
}
1312

1413
.optionItem {

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { formatParams } from '@/utils/common';
44
import connectToEventSource from '@/utils/eventSource';
55
import { Button, Spin, message, Drawer, Modal } from 'antd';
66
import ChatInput, { SyncModelType } from './ChatInput';
7-
import Editor, { IEditorOptions, IExportRefFunction, IRangeType } from './MonacoEditor';
7+
import MonacoEditor, { IEditorOptions, IExportRefFunction, IRangeType } from './MonacoEditor';
88
import historyServer from '@/service/history';
99
import aiServer from '@/service/ai';
1010
import { v4 as uuidv4 } from 'uuid';
@@ -113,7 +113,6 @@ function Console(props: IProps, ref: ForwardedRef<IConsoleRef>) {
113113
// 上一次同步的console数据
114114
const lastSyncConsole = useRef<any>(defaultValue);
115115
const [saveStatus, setSaveStatus] = useState<ConsoleStatus>(executeParams.status || ConsoleStatus.DRAFT);
116-
117116
/**
118117
* 当前选择的AI类型是Chat2DBAI
119118
*/
@@ -540,9 +539,7 @@ function Console(props: IProps, ref: ForwardedRef<IConsoleRef>) {
540539
}}
541540
/>
542541
)}
543-
{/* <div key={uuid()}>{chatContent.current}</div> */}
544-
545-
<Editor
542+
<MonacoEditor
546543
id={uid}
547544
defaultValue={defaultValue}
548545
isActive={isActive}
@@ -556,7 +553,6 @@ function Console(props: IProps, ref: ForwardedRef<IConsoleRef>) {
556553

557554
{/* <NewEditor id={uid} dataSource={props.executeParams.type} database={props.executeParams.databaseName} /> */}
558555

559-
{/* <Modal open={modelConfig.open}>{modelConfig.content}</Modal> */}
560556
<Drawer open={isAiDrawerOpen} getContainer={false} mask={false} onClose={() => setIsAiDrawerOpen(false)}>
561557
<Spin spinning={isAiDrawerLoading} style={{ height: '100%' }}>
562558
<div className={styles.aiBlock}>{aiContent}</div>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ if (__ENV__ === 'local') {
99
/* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
1010
@font-face {
1111
font-family: 'iconfont'; /* Project id 3633546 */
12-
src: url('//at.alicdn.com/t/c/font_3633546_yovsu3nzmms.woff2?t=1699021481938') format('woff2'),
13-
url('//at.alicdn.com/t/c/font_3633546_yovsu3nzmms.woff?t=1699021481938') format('woff'),
14-
url('//at.alicdn.com/t/c/font_3633546_yovsu3nzmms.ttf?t=1699021481938') format('truetype');
12+
src: url('//at.alicdn.com/t/c/font_3633546_ewpuk721ep5.woff2?t=1699026105234') format('woff2'),
13+
url('//at.alicdn.com/t/c/font_3633546_ewpuk721ep5.woff?t=1699026105234') format('woff'),
14+
url('//at.alicdn.com/t/c/font_3633546_ewpuk721ep5.ttf?t=1699026105234') format('truetype');
1515
}
1616
`;
1717
const style = document.createElement('style');

chat2db-client/src/components/SearchResult/RightClickMenu/index.tsx

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import MenuLabel from '@/components/MenuLabel';
66
interface IProps {
77
className?: string;
88
children?: React.ReactNode;
9-
menuList: IMenu[]
9+
menuList: IMenu[] | null;
1010
}
1111

1212
export interface IMenu {
@@ -15,10 +15,10 @@ export interface IMenu {
1515
children?: {
1616
callback: () => void;
1717
hide?: boolean;
18-
}[]
18+
}[];
1919
}
2020

21-
export enum AllSupportedMenusType {
21+
export enum AllSupportedMenusType {
2222
CopyCell = 'copy-cell',
2323
CopyRow = 'copy-row',
2424
CloneRow = 'clone-row',
@@ -59,7 +59,7 @@ export default memo<IProps>((props) => {
5959
label: i18n('common.button.tabularSeparatedValuesFieldNameAndData'),
6060
key: 'copy-row-5',
6161
},
62-
]
62+
],
6363
},
6464
[AllSupportedMenusType.CloneRow]: {
6565
label: <MenuLabel icon="&#xe8db;" label={i18n('common.button.cloneRow')} />,
@@ -81,25 +81,33 @@ export default memo<IProps>((props) => {
8181
label: <MenuLabel icon="&#xe788;" label={i18n('common.button.viewData')} />,
8282
key: AllSupportedMenusType.ViewData,
8383
},
84-
}
84+
};
8585

86-
const items = useMemo(()=>{
87-
return menuList.map((menu) => {
86+
const items = useMemo(() => {
87+
return menuList?.map((menu) => {
8888
return {
8989
...allSupportedMenus[menu.key],
9090
onClick: menu.callback,
91-
children: menu.children?.map((child,index) => {
91+
children: menu.children?.map((child, index) => {
9292
if (child.hide) return null;
9393
return {
9494
...allSupportedMenus[menu.key]['children'][index],
9595
onClick: child.callback,
96-
}
97-
})
98-
}
99-
})
100-
}, [menuList])
96+
};
97+
}),
98+
};
99+
});
100+
}, [menuList]);
101101

102-
return <Dropdown menu={{ items }} trigger={["contextMenu"]} >
103-
{children}
104-
</Dropdown>;
102+
return (
103+
<Dropdown
104+
menu={{
105+
items: items || [],
106+
style: items ? {} : {display: 'none'},
107+
}}
108+
trigger={['contextMenu']}
109+
>
110+
{children}
111+
</Dropdown>
112+
);
105113
});

0 commit comments

Comments
 (0)