Skip to content

Commit 1857916

Browse files
committed
eslint
1 parent bd5202c commit 1857916

6 files changed

Lines changed: 20 additions & 22 deletions

File tree

chat2db-client/src/blocks/DatabaseTableEditor/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import lodash from 'lodash';
1414
interface IProps {
1515
dataSourceId: number;
1616
databaseName: string;
17-
schemaName: string | null;
17+
schemaName?: string | null;
1818
tableName?: string;
1919
databaseType: DatabaseTypeCode;
2020
changeTabDetails: (data: IWorkspaceTab) => void;

chat2db-client/src/blocks/EditTableData/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface IProps {
77
className?: string;
88
dataSourceId: number;
99
databaseName: string;
10-
schemaName: string | undefined;
10+
schemaName?: string | null;
1111
tableName?: string;
1212
databaseType: DatabaseTypeCode;
1313
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface ITabItem {
1010
key: number | string;
1111
popover?: string | React.ReactNode;
1212
children?: React.ReactNode;
13-
editableName?: boolean | undefined;
13+
editableName?: boolean;
1414
canClosed?: boolean;
1515
styles?: React.CSSProperties;
1616
}

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

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
4949
id: t.id,
5050
title: t.name,
5151
type: t.operationType,
52-
editableName: true,
5352
uniqueData: t,
5453
};
5554
});
@@ -112,7 +111,7 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
112111
if (doubleClickTreeNodeData.treeNodeType === TreeNodeType.VIEW) {
113112
const { extraParams } = doubleClickTreeNodeData;
114113
const { databaseName, schemaName, tableName, dataSourceId } = extraParams || {};
115-
const callback = (consoleId: number, workspaceTabList: IWorkspaceTab[]) => {
114+
const callback = (consoleId: number, _workspaceTabList: IWorkspaceTab[]) => {
116115
sqlService
117116
.getViewDetail({
118117
dataSourceId: dataSourceId!,
@@ -122,7 +121,7 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
122121
})
123122
.then((res) => {
124123
// 更新ddl
125-
const newList = workspaceTabList.map((t) => {
124+
const newList = _workspaceTabList.map((t) => {
126125
if (t.id === consoleId) {
127126
return {
128127
...t,
@@ -151,7 +150,7 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
151150
const { extraParams } = doubleClickTreeNodeData;
152151
const { databaseName, schemaName, triggerName, dataSourceId } = extraParams || {};
153152
const name = doubleClickTreeNodeData.name;
154-
const callback = (consoleId: number, workspaceTabList: IWorkspaceTab[]) => {
153+
const callback = (consoleId: number, _workspaceTabList: IWorkspaceTab[]) => {
155154
sqlService
156155
.getTriggerDetail({
157156
dataSourceId: dataSourceId!,
@@ -161,7 +160,7 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
161160
})
162161
.then((res) => {
163162
// 更新ddl
164-
const newList = workspaceTabList.map((t) => {
163+
const newList = _workspaceTabList.map((t) => {
165164
if (t.id === consoleId) {
166165
return {
167166
...t,
@@ -188,7 +187,7 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
188187
const { extraParams } = doubleClickTreeNodeData;
189188
const { databaseName, schemaName, procedureName, dataSourceId } = extraParams || {};
190189
const name = doubleClickTreeNodeData.name;
191-
const callback = (consoleId: number, workspaceTabList: IWorkspaceTab[]) => {
190+
const callback = (consoleId: number, _workspaceTabList: IWorkspaceTab[]) => {
192191
sqlService
193192
.getProcedureDetail({
194193
dataSourceId: dataSourceId!,
@@ -198,7 +197,7 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
198197
})
199198
.then((res) => {
200199
// 更新ddl
201-
const newList = workspaceTabList.map((t) => {
200+
const newList = _workspaceTabList.map((t) => {
202201
if (t.id === consoleId) {
203202
return {
204203
...t,
@@ -225,7 +224,7 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
225224
const { extraParams } = doubleClickTreeNodeData;
226225
const { databaseName, schemaName, dataSourceId, functionName } = extraParams || {};
227226
const name = doubleClickTreeNodeData.name;
228-
const callback = (consoleId: number, workspaceTabList: IWorkspaceTab[]) => {
227+
const callback = (consoleId: number, _workspaceTabList: IWorkspaceTab[]) => {
229228
sqlService
230229
.getFunctionDetail({
231230
dataSourceId: dataSourceId!,
@@ -235,7 +234,7 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
235234
})
236235
.then((res) => {
237236
// 更新ddl
238-
const newList = workspaceTabList?.map((t) => {
237+
const newList = _workspaceTabList?.map((t) => {
239238
if (t.id === consoleId) {
240239
return {
241240
...t,
@@ -327,11 +326,11 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
327326
doubleClickTreeNodeData: any;
328327
workSpaceTabType: WorkspaceTabType;
329328
name: string;
330-
callback?: Function;
329+
callback?: (res: number, list: any) => void;
331330
ddl?: string;
332331
}) {
333-
const { doubleClickTreeNodeData, workSpaceTabType, name, callback, ddl } = params;
334-
const { extraParams } = doubleClickTreeNodeData;
332+
const { doubleClickTreeNodeData: _doubleClickTreeNodeData, workSpaceTabType, name, callback, ddl } = params;
333+
const { extraParams } = _doubleClickTreeNodeData;
335334
const { databaseName, schemaName, dataSourceId, dataSourceName, databaseType } = extraParams || {};
336335
const newConsole: any = {
337336
name,
@@ -361,7 +360,7 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
361360
});
362361
}
363362

364-
function getConsoleList(callback?: Function) {
363+
function getConsoleList(callback?: () => void) {
365364
const p: any = {
366365
pageNo: 1,
367366
pageSize: 999,
@@ -434,7 +433,7 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
434433
};
435434

436435
const closeWindowTab = (key: number) => {
437-
let p: any = {
436+
const p: any = {
438437
id: key,
439438
tabOpened: 'n',
440439
};
@@ -457,11 +456,11 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
457456
}
458457

459458
function editableNameOnBlur(t: ITabItem) {
460-
let p: any = {
459+
const _params: any = {
461460
id: t.key,
462461
name: t.label,
463462
};
464-
historyService.updateSavedConsole(p).then(() => {
463+
historyService.updateSavedConsole(_params).then(() => {
465464
getConsoleList();
466465
dispatch({
467466
type: 'workspace/fetchGetSavedConsole',
@@ -499,7 +498,7 @@ const WorkspaceRight = memo<IProps>((props: IProps) => {
499498
prefixIcon: workspaceTabConfig[t.type]?.icon,
500499
label: t.title,
501500
key: t.id,
502-
editableName: t.editableName,
501+
editableName: t.type === WorkspaceTabType.CONSOLE,
503502
children: (
504503
<Fragment key={t.id}>
505504
{[

chat2db-client/src/typings/workspace.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export interface IWorkspaceTab {
1212
id: number | string; // Tab的id
1313
type: WorkspaceTabType; // 工作区tab的类型
1414
title: string; // 工作区tab的名称
15-
editableName?: boolean; // 可以编辑名称
1615
uniqueData?: any;
1716
}
1817

chat2db-client/src/utils/IntelliSense/table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const registerIntelliSenseTable = (
4949
databaseCode?: DatabaseTypeCode,
5050
dataSourceId?: number,
5151
databaseName?: string,
52-
schemaName?: string,
52+
schemaName?: string | null,
5353
) => {
5454
monaco.editor.registerCommand('addFieldList', (_: any, ...args: any[]) => {
5555
addIntelliSenseField(args[0]);

0 commit comments

Comments
 (0)