diff --git a/src/app.ts b/src/app.ts index 5b9560104..5e76f54b2 100644 --- a/src/app.ts +++ b/src/app.ts @@ -14,16 +14,16 @@ * limitations under the License. */ -import React from 'react'; import { setLocale } from '@umijs/max'; +import React from 'react'; import { initMetaStore } from './common/metaStore'; import DndHTML5Provider from './component/DndHTML5Provider'; import registerPlugins from './plugins/register'; import { isClient } from './util/env'; -import logger from './util/logger'; -import { getRoute } from './util/tracert/userRoutes'; import { initIntl } from './util/intl'; +import logger from './util/logger'; import { initSentry } from './util/sentry'; +import { getRoute } from './util/tracert/userRoutes'; if (isClient()) { import('@sentry/electron').then((_Sentry) => { _Sentry.init({ diff --git a/src/common/datasource/doris/index.tsx b/src/common/datasource/doris/index.tsx index a094aa634..58a517346 100644 --- a/src/common/datasource/doris/index.tsx +++ b/src/common/datasource/doris/index.tsx @@ -15,9 +15,9 @@ */ import { ConnectType, TaskType } from '@/d.ts'; +import { haveOCP } from '@/util/env'; import { IDataSourceModeConfig } from '../interface'; import MySQLColumnExtra from '../oceanbase/MySQLColumnExtra'; -import { haveOCP } from '@/util/env'; const tableConfig = { enableTableCharsetsAndCollations: true, diff --git a/src/common/datasource/index.tsx b/src/common/datasource/index.tsx index ffedc5e86..961b7363e 100644 --- a/src/common/datasource/index.tsx +++ b/src/common/datasource/index.tsx @@ -14,22 +14,22 @@ * limitations under the License. */ -import { ConnectType, ConnectionMode } from '@/d.ts'; -import { IDataSourceModeConfig } from './interface'; +import { ConnectionMode, ConnectType } from '@/d.ts'; import { IDataSourceType } from '@/d.ts/datasource'; -import obOracle from './oceanbase/oboracle'; -import obMySQL from './oceanbase/obmysql'; -import oracle from './oracle'; -import MySQL from './mysql'; -import Doris from './doris'; -import { ReactComponent as OBSvg } from '@/svgr/source_ob.svg'; -import { ReactComponent as DBOBSvg } from '@/svgr/database_oceanbase.svg'; -import { ReactComponent as MySQLSvg } from '@/svgr/mysql.svg'; +import { ReactComponent as DBDorisSvg } from '@/svgr/database_doris.svg'; import { ReactComponent as DBMySQLSvg } from '@/svgr/database_mysql.svg'; +import { ReactComponent as DBOBSvg } from '@/svgr/database_oceanbase.svg'; +import { ReactComponent as DBOracleSvg } from '@/svgr/database_oracle.svg'; import { ReactComponent as DorisSvg } from '@/svgr/doris.svg'; -import { ReactComponent as DBDorisSvg } from '@/svgr/database_doris.svg'; +import { ReactComponent as MySQLSvg } from '@/svgr/mysql.svg'; import { ReactComponent as OracleSvg } from '@/svgr/oracle.svg'; -import { ReactComponent as DBOracleSvg } from '@/svgr/database_oracle.svg'; +import { ReactComponent as OBSvg } from '@/svgr/source_ob.svg'; +import Doris from './doris'; +import { IDataSourceModeConfig } from './interface'; +import MySQL from './mysql'; +import obMySQL from './oceanbase/obmysql'; +import obOracle from './oceanbase/oboracle'; +import oracle from './oracle'; const _types: Map< IDataSourceType, diff --git a/src/common/datasource/mysql/index.tsx b/src/common/datasource/mysql/index.tsx index 71a9da843..5568e7e23 100644 --- a/src/common/datasource/mysql/index.tsx +++ b/src/common/datasource/mysql/index.tsx @@ -15,9 +15,9 @@ */ import { ConnectType, TaskType } from '@/d.ts'; +import { haveOCP } from '@/util/env'; import { IDataSourceModeConfig } from '../interface'; import MySQLColumnExtra from '../oceanbase/MySQLColumnExtra'; -import { haveOCP } from '@/util/env'; const tableConfig = { enableTableCharsetsAndCollations: true, diff --git a/src/common/datasource/oceanbase/MySQLColumnExtra.tsx b/src/common/datasource/oceanbase/MySQLColumnExtra.tsx index 17ad091b1..deb4f95a6 100644 --- a/src/common/datasource/oceanbase/MySQLColumnExtra.tsx +++ b/src/common/datasource/oceanbase/MySQLColumnExtra.tsx @@ -14,14 +14,14 @@ * limitations under the License. */ -import { dataTypesIns } from '@/util/dataType'; -import { columnExtraComponent } from '../interface'; import Character from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/Character'; import DataSync from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/DateSync'; import DefaultValue from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/DefaultValue'; import Enum from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/Enum'; import Generation from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/Generation'; import Number from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/Number'; +import { dataTypesIns } from '@/util/dataType'; +import { columnExtraComponent } from '../interface'; const MySQLColumnExtra: columnExtraComponent = ({ column, diff --git a/src/common/datasource/oceanbase/OracleColumnExtra.tsx b/src/common/datasource/oceanbase/OracleColumnExtra.tsx index e8ded7417..64c8c7e50 100644 --- a/src/common/datasource/oceanbase/OracleColumnExtra.tsx +++ b/src/common/datasource/oceanbase/OracleColumnExtra.tsx @@ -14,10 +14,10 @@ * limitations under the License. */ -import { dataTypesIns } from '@/util/dataType'; -import { columnExtraComponent } from '../interface'; import DefaultValue from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/DefaultValue'; import Precision from '@/page/Workspace/components/CreateTable/Columns/ColumnExtraInfo/Precision'; +import { dataTypesIns } from '@/util/dataType'; +import { columnExtraComponent } from '../interface'; const OracleColumnExtra: columnExtraComponent = ({ column, diff --git a/src/common/datasource/oceanbase/obmysql.ts b/src/common/datasource/oceanbase/obmysql.ts index 7bc697135..2a4e20bde 100644 --- a/src/common/datasource/oceanbase/obmysql.ts +++ b/src/common/datasource/oceanbase/obmysql.ts @@ -15,9 +15,9 @@ */ import { ConnectType, TaskType } from '@/d.ts'; +import { haveOCP } from '@/util/env'; import { IDataSourceModeConfig } from '../interface'; import MySQLColumnExtra from './MySQLColumnExtra'; -import { haveOCP } from '@/util/env'; const tableConfig = { enableTableCharsetsAndCollations: true, diff --git a/src/common/datasource/oceanbase/oboracle.ts b/src/common/datasource/oceanbase/oboracle.ts index bde695af3..8010be0df 100644 --- a/src/common/datasource/oceanbase/oboracle.ts +++ b/src/common/datasource/oceanbase/oboracle.ts @@ -15,10 +15,10 @@ */ import { ConnectType, TaskType } from '@/d.ts'; -import { IDataSourceModeConfig } from '../interface'; -import OracleColumnExtra from './OracleColumnExtra'; import { TableForeignConstraintOnDeleteType } from '@/d.ts/table'; import { haveOCP } from '@/util/env'; +import { IDataSourceModeConfig } from '../interface'; +import OracleColumnExtra from './OracleColumnExtra'; const oracleTableConfig = { constraintEnableConfigurable: true, diff --git a/src/common/datasource/oracle/index.tsx b/src/common/datasource/oracle/index.tsx index 98011e085..c7415922f 100644 --- a/src/common/datasource/oracle/index.tsx +++ b/src/common/datasource/oracle/index.tsx @@ -15,10 +15,10 @@ */ import { ConnectType, TaskType } from '@/d.ts'; -import { IDataSourceModeConfig } from '../interface'; -import OracleColumnExtra from '../oceanbase/OracleColumnExtra'; import { TableForeignConstraintOnDeleteType } from '@/d.ts/table'; import { haveOCP } from '@/util/env'; +import { IDataSourceModeConfig } from '../interface'; +import OracleColumnExtra from '../oceanbase/OracleColumnExtra'; const oracleTableConfig = { constraintEnableConfigurable: true, diff --git a/src/common/network/connection.ts b/src/common/network/connection.ts index 99fc812a1..c170d8360 100644 --- a/src/common/network/connection.ts +++ b/src/common/network/connection.ts @@ -207,9 +207,7 @@ export async function testExsitConnection( return ret; } -export async function batchTest( - cids: number[], -): Promise< +export async function batchTest(cids: number[]): Promise< Record< number, { @@ -318,9 +316,7 @@ export async function newSessionByDataSource( return data; } -export async function getSessionStatus( - sessionId?: string, -): Promise<{ +export async function getSessionStatus(sessionId?: string): Promise<{ settings: { autocommit: boolean; delimiter: string; @@ -366,9 +362,7 @@ export async function getConnectionExists(params: { name: string }): Promise; clusterName: Record; }> { diff --git a/src/common/network/database.ts b/src/common/network/database.ts index 10f611fd8..20939c14c 100644 --- a/src/common/network/database.ts +++ b/src/common/network/database.ts @@ -21,8 +21,6 @@ import notification from '@/util/notification'; import request from '@/util/request'; import { getDropSQL } from '@/util/sql'; import { executeSQL } from './sql'; -import { syncDatasource } from './connection'; -import login from '@/store/login'; export async function listDatabases( projectId?: number, @@ -36,7 +34,7 @@ export async function listDatabases( */ containsUnassigned?: boolean, existed?: boolean, - includesPermittedAction?: boolean + includesPermittedAction?: boolean, ): Promise> { const res = await request.get(`/api/v2/database/databases`, { params: { @@ -48,7 +46,7 @@ export async function listDatabases( environmentId, containsUnassigned, existed, - includesPermittedAction + includesPermittedAction, }, }); diff --git a/src/common/network/exportAndImport.ts b/src/common/network/exportAndImport.ts index e27953376..38550c0fa 100644 --- a/src/common/network/exportAndImport.ts +++ b/src/common/network/exportAndImport.ts @@ -35,11 +35,9 @@ export async function getExportObjects( databaseId: number, type?: DbObjectType, cid?: number, -): Promise< - { - [key in DbObjectType]: string[]; - } -> { +): Promise<{ + [key in DbObjectType]: string[]; +}> { const result = await request.get(`/api/v2/dataTransfer/getExportObjects`, { params: { connectionId: cid, diff --git a/src/common/network/project.ts b/src/common/network/project.ts index d1b51c2f9..e3591cd12 100644 --- a/src/common/network/project.ts +++ b/src/common/network/project.ts @@ -15,8 +15,8 @@ */ import { IResponseData, IUserSummary } from '@/d.ts'; -import { IProject, ProjectRole, PermissionSourceType, IDatabasePermission } from '@/d.ts/project'; import { DatabasePermissionType } from '@/d.ts/database'; +import { IDatabasePermission, IProject, PermissionSourceType, ProjectRole } from '@/d.ts/project'; import request from '@/util/request'; export async function listProjects( diff --git a/src/common/network/projectNotification.ts b/src/common/network/projectNotification.ts index fcc79b112..00f687709 100644 --- a/src/common/network/projectNotification.ts +++ b/src/common/network/projectNotification.ts @@ -16,13 +16,13 @@ import { IResponseData } from '@/d.ts'; import { + EChannelType, + EMessageStatus, IChannel, - ITestChannelResult, - IPolicy, IMessage, + IPolicy, + ITestChannelResult, TBatchUpdatePolicy, - EMessageStatus, - EChannelType, } from '@/d.ts/projectNotification'; import request from '@/util/request'; diff --git a/src/common/network/sql/executePL.tsx b/src/common/network/sql/executePL.tsx index 642892b55..f14da5ed2 100644 --- a/src/common/network/sql/executePL.tsx +++ b/src/common/network/sql/executePL.tsx @@ -16,8 +16,8 @@ import { PLType } from '@/constant/plType'; import { IFunction, IProcedure } from '@/d.ts'; -import { generateSessionSid } from '../pathUtil'; import request from '@/util/request'; +import { generateSessionSid } from '../pathUtil'; type params = | { diff --git a/src/common/network/table/index.ts b/src/common/network/table/index.ts index 2423fcd1b..fb62a2015 100644 --- a/src/common/network/table/index.ts +++ b/src/common/network/table/index.ts @@ -15,7 +15,7 @@ */ import { INlsObject, ITable, ITableColumn, LobExt, RSModifyDataType } from '@/d.ts'; -import { ITableModel, TableColumn } from '@/page/Workspace/components/CreateTable/interface'; +import { ITableModel } from '@/page/Workspace/components/CreateTable/interface'; import sessionManager from '@/store/sessionManager'; import setting from '@/store/setting'; import { getNlsValueKey } from '@/util/column'; diff --git a/src/common/network/task.ts b/src/common/network/task.ts index f7e67f1ab..95a9ca1f2 100644 --- a/src/common/network/task.ts +++ b/src/common/network/task.ts @@ -17,16 +17,18 @@ import { IShadowSyncAnalysisResult } from '@/component/Task/ShadowSyncTask/CreateModal/interface'; import { CommonTaskLogType, + CreateStructureComparisonTaskRecord, CreateTaskRecord, - IPartitionTablePreviewConfig, CycleTaskDetail, IAsyncTaskResultSet, ICycleSubTaskRecord, ICycleTaskRecord, + IDatasourceUser, IFunction, IPartitionPlan, - IPartitionPlanTable, IPartitionPlanKeyType, + IPartitionPlanTable, + IPartitionTablePreviewConfig, IResponseData, ISubTaskRecords, ITaskResult, @@ -36,15 +38,13 @@ import { TaskRecordParameters, TaskStatus, TaskType, - IDatasourceUser, - CreateStructureComparisonTaskRecord, } from '@/d.ts'; +import { IProject } from '@/d.ts/project'; +import { EOperationType, IComparisonResultData, IStructrueComparisonDetail } from '@/d.ts/task'; import setting from '@/store/setting'; import request from '@/util/request'; import { downloadFile } from '@/util/utils'; -import { IProject } from '@/d.ts/project'; import { generateFunctionSid } from './pathUtil'; -import { EOperationType, IComparisonResultData, IStructrueComparisonDetail } from '@/d.ts/task'; /** * 根据函数获取ddl sql diff --git a/src/component/Action/Group.tsx b/src/component/Action/Group.tsx index f09757323..da4f16de2 100644 --- a/src/component/Action/Group.tsx +++ b/src/component/Action/Group.tsx @@ -15,7 +15,7 @@ */ import { EllipsisOutlined, LoadingOutlined, MoreOutlined } from '@ant-design/icons'; -import { Button, Dropdown, Menu, Space, Tooltip, Typography } from 'antd'; +import { Button, Dropdown, Space, Tooltip, Typography } from 'antd'; import { isBoolean, max, omit } from 'lodash'; import React from 'react'; import type { BaseProps } from './Item'; diff --git a/src/component/AddDataSourceDropdown/index.tsx b/src/component/AddDataSourceDropdown/index.tsx index 75687f2cd..cb1fb37f6 100644 --- a/src/component/AddDataSourceDropdown/index.tsx +++ b/src/component/AddDataSourceDropdown/index.tsx @@ -14,10 +14,10 @@ * limitations under the License. */ -import { formatMessage } from '@/util/intl'; import { getAllConnectTypes } from '@/common/datasource'; import { ConnectTypeText } from '@/constant/label'; import { IDataSourceType } from '@/d.ts/datasource'; +import { formatMessage } from '@/util/intl'; import { Dropdown } from 'antd'; import { ItemType } from 'antd/lib/menu/hooks/useItems'; import { useMemo } from 'react'; diff --git a/src/component/BatchImportButton/modal.tsx b/src/component/BatchImportButton/modal.tsx index 9990ef847..fdde8d853 100644 --- a/src/component/BatchImportButton/modal.tsx +++ b/src/component/BatchImportButton/modal.tsx @@ -19,12 +19,12 @@ import login from '@/store/login'; import { formatMessage, getLocalTemplate } from '@/util/intl'; import { downloadFile } from '@/util/utils'; import { InfoCircleFilled } from '@ant-design/icons'; +import { getLocale } from '@umijs/max'; import { Alert, Button, Drawer, Form, Space } from 'antd'; import { useForm } from 'antd/es/form/Form'; import type { UploadFile } from 'antd/lib/upload/interface'; import Cookies from 'js-cookie'; import React, { useEffect, useState } from 'react'; -import { getLocale } from '@umijs/max'; import styles from './index.less'; // 20M const MAX_FILE_SIZE = 1024 * 1024 * 20; diff --git a/src/component/BigSelect/index.tsx b/src/component/BigSelect/index.tsx index 4c63020b6..f1fe94721 100644 --- a/src/component/BigSelect/index.tsx +++ b/src/component/BigSelect/index.tsx @@ -34,15 +34,8 @@ interface IBigSelectProps { bottom?: React.ReactNode; } const BigSelect: React.FC = (props) => { - const { - defaultValue, - options, - bottom, - icon, - iconColor, - onChange, - onDropdownVisibleChange, - } = props; + const { defaultValue, options, bottom, icon, iconColor, onChange, onDropdownVisibleChange } = + props; return (
diff --git a/src/component/Button/Reload/index.tsx b/src/component/Button/Reload/index.tsx index 329a9a6d5..dec5cdebc 100644 --- a/src/component/Button/Reload/index.tsx +++ b/src/component/Button/Reload/index.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { ReloadOutlined, LoadingOutlined } from '@ant-design/icons'; +import { LoadingOutlined, ReloadOutlined } from '@ant-design/icons'; import { useState } from 'react'; export default function Reload({ diff --git a/src/component/Crontab/index.less b/src/component/Crontab/index.less index 0d6fe49df..3cd3219f6 100644 --- a/src/component/Crontab/index.less +++ b/src/component/Crontab/index.less @@ -6,13 +6,13 @@ padding-bottom: 8px; } .content { - width: 100%; display: grid; grid-gap: 8px; + width: 100%; &.default-mode { + grid-template-columns: 120px 210px 1fr; padding: 8px; background: var(--background-tertraiy-color); - grid-template-columns: 120px 210px 1fr; &.daily { grid-template-columns: 120px 1fr; } diff --git a/src/component/DDLResultSetFilter/index.tsx b/src/component/DDLResultSetFilter/index.tsx index 521e8d06f..ce5425eae 100644 --- a/src/component/DDLResultSetFilter/index.tsx +++ b/src/component/DDLResultSetFilter/index.tsx @@ -18,9 +18,9 @@ import { FilterOutlined } from '@ant-design/icons'; import { Button, Checkbox, Input, Popover } from 'antd'; import { Component } from 'react'; // @ts-ignore +import { formatMessage } from '@/util/intl'; import { CheckboxValueType } from 'antd/lib/checkbox/Group'; import styles from './index.less'; -import { formatMessage } from '@/util/intl'; export default class DDLResultSetFilter extends Component< { diff --git a/src/component/DataTypeSelect/index.tsx b/src/component/DataTypeSelect/index.tsx index 6dd5405c7..adaf2cb96 100644 --- a/src/component/DataTypeSelect/index.tsx +++ b/src/component/DataTypeSelect/index.tsx @@ -28,9 +28,10 @@ const DataTypeSelect: React.FC<{ }> = forwardRef((props, ref) => { const { dataTypes, isOracle, ...rest } = props; const _dataTypes = dataTypes.filter((dataType) => { - return (isOracle - ? ['blob', 'clob'] - : ['tinyblob', 'blob', 'mediumblob', 'logblob', 'binary', 'varbinary'] + return ( + isOracle + ? ['blob', 'clob'] + : ['tinyblob', 'blob', 'mediumblob', 'logblob', 'binary', 'varbinary'] ).includes(dataType.databaseType?.toLowerCase()); }); return ( diff --git a/src/component/DisplayTable/index.tsx b/src/component/DisplayTable/index.tsx index 8a0860aa6..bd8a9181a 100644 --- a/src/component/DisplayTable/index.tsx +++ b/src/component/DisplayTable/index.tsx @@ -124,17 +124,19 @@ export default class DisplayTable extends React.Component< }); } - public handleResize = (index: number) => (e: any, { size }: { size: { width: number } }) => { - this.setState(({ columns }) => { - const nextColumns = [...columns]; - nextColumns[index] = { - ...nextColumns[index], - width: size.width, - }; + public handleResize = + (index: number) => + (e: any, { size }: { size: { width: number } }) => { + this.setState(({ columns }) => { + const nextColumns = [...columns]; + nextColumns[index] = { + ...nextColumns[index], + width: size.width, + }; - return { columns: nextColumns }; - }); - }; + return { columns: nextColumns }; + }); + }; public render() { const { diff --git a/src/component/EditPLParamsModal/ValueInput.tsx b/src/component/EditPLParamsModal/ValueInput.tsx index f15f46c6f..e2e3d4d70 100644 --- a/src/component/EditPLParamsModal/ValueInput.tsx +++ b/src/component/EditPLParamsModal/ValueInput.tsx @@ -17,7 +17,7 @@ import { ConnectionMode } from '@/d.ts'; import { formatMessage } from '@/util/intl'; import { MenuOutlined } from '@ant-design/icons'; -import { Dropdown, Input, Menu } from 'antd'; +import { Dropdown, Input } from 'antd'; import React, { useMemo } from 'react'; interface IProps { diff --git a/src/component/EditorToolBar/actions/pl.tsx b/src/component/EditorToolBar/actions/pl.tsx index c05b4107d..67e7e0608 100644 --- a/src/component/EditorToolBar/actions/pl.tsx +++ b/src/component/EditorToolBar/actions/pl.tsx @@ -25,13 +25,13 @@ import { SaveOutlined, } from '@ant-design/icons'; +import { getDataSourceModeConfig } from '@/common/datasource'; import { IConStatus } from '@/component/Toolbar/statefulIcon'; import plType, { PLType } from '@/constant/plType'; import { PLPage } from '@/page/Workspace/components/PLPage'; import { DebugStatus } from '@/store/debug/type'; import sqlStore from '@/store/sql'; import { ToolBarActions } from '..'; -import { getDataSourceModeConfig } from '@/common/datasource'; const { confirm } = Modal; diff --git a/src/component/EditorToolBar/actions/sql.tsx b/src/component/EditorToolBar/actions/sql.tsx index ed197d6d2..6102a0137 100644 --- a/src/component/EditorToolBar/actions/sql.tsx +++ b/src/component/EditorToolBar/actions/sql.tsx @@ -15,18 +15,17 @@ */ import DelimiterSelect from '@/component/DelimiterSelect'; +import { getKeyCodeText } from '@/component/Input/Keymap/keycodemap'; import SQLConfig from '@/component/SQLConfig'; import { IConStatus } from '@/component/Toolbar/statefulIcon'; import { TransState } from '@/d.ts'; import { SQLPage } from '@/page/Workspace/components/SQLPage'; import login from '@/store/login'; +import setting from '@/store/setting'; import sqlStore from '@/store/sql'; import { formatMessage } from '@/util/intl'; import { SaveOutlined } from '@ant-design/icons'; import { ToolBarActions } from '..'; -import setting from '@/store/setting'; -import { KeyCode } from 'monaco-editor'; -import { getKeyCodeText } from '@/component/Input/Keymap/keycodemap'; const sqlActions: ToolBarActions = { SQL_SAVE: { diff --git a/src/component/EditorToolBar/index.tsx b/src/component/EditorToolBar/index.tsx index f5e4d6b50..003ed483d 100644 --- a/src/component/EditorToolBar/index.tsx +++ b/src/component/EditorToolBar/index.tsx @@ -16,13 +16,13 @@ import Toolbar from '@/component/Toolbar'; import { formatMessage } from '@/util/intl'; -import { Menu, Space, Spin } from 'antd'; +import { Space, Spin } from 'antd'; +import { isFunction } from 'lodash'; import { Observer, observer } from 'mobx-react'; import { Component, ComponentType, ReactNode } from 'react'; import { ContainerQuery } from 'react-container-query'; import { IConStatus } from '../Toolbar/statefulIcon'; import { ACTIONS, ACTION_GROUPS } from './config'; -import { isFunction } from 'lodash'; interface IProps { ctx: any; actionGroupKey: string; diff --git a/src/component/ErrorConfirmModal/index.tsx b/src/component/ErrorConfirmModal/index.tsx index e14be68de..a03f86bf6 100644 --- a/src/component/ErrorConfirmModal/index.tsx +++ b/src/component/ErrorConfirmModal/index.tsx @@ -17,8 +17,8 @@ import type { ODCErrorsCode } from '@/d.ts'; import loginStore from '@/store/login'; import { formatMessage } from '@/util/intl'; -import { Modal } from 'antd'; import { history } from '@umijs/max'; +import { Modal } from 'antd'; const lockStore = { PermissionChanged: null, diff --git a/src/component/GrammerHelpSider/component/SnippetCard/index.tsx b/src/component/GrammerHelpSider/component/SnippetCard/index.tsx index f398432dd..4947ca103 100644 --- a/src/component/GrammerHelpSider/component/SnippetCard/index.tsx +++ b/src/component/GrammerHelpSider/component/SnippetCard/index.tsx @@ -24,7 +24,7 @@ import snippetStore, { import { formatMessage } from '@/util/intl'; import { getSnippetText, getWrapedSnippetBody } from '@/util/snippet'; import { CopyOutlined, EllipsisOutlined, QuestionCircleOutlined } from '@ant-design/icons'; -import { Card, Dropdown, Menu, message, Popover, Typography } from 'antd'; +import { Card, Dropdown, message, Popover, Typography } from 'antd'; import { CopyToClipboard } from 'react-copy-to-clipboard'; import styles from './index.less'; diff --git a/src/component/GrammerHelpSider/component/SnippetForm/index.tsx b/src/component/GrammerHelpSider/component/SnippetForm/index.tsx index 5b2e0544f..911ed4030 100644 --- a/src/component/GrammerHelpSider/component/SnippetForm/index.tsx +++ b/src/component/GrammerHelpSider/component/SnippetForm/index.tsx @@ -14,7 +14,10 @@ * limitations under the License. */ +import { getDataSourceModeConfig } from '@/common/datasource'; import EditorToolBar from '@/component/EditorToolBar'; +import MonacoEditor, { IEditor } from '@/component/MonacoEditor'; +import { ConnectType } from '@/d.ts'; import snippetStore, { EnumSnippetAction, EnumSnippetType, @@ -25,9 +28,6 @@ import { formatMessage } from '@/util/intl'; import { Button, Drawer, Form, Input, message, Modal, Select } from 'antd'; import type { FormInstance } from 'antd/lib/form'; import React, { PureComponent } from 'react'; -import MonacoEditor, { IEditor } from '@/component/MonacoEditor'; -import { getDataSourceModeConfig } from '@/common/datasource'; -import { ConnectType } from '@/d.ts'; const MAX_SNIPPRT_SIZE = 10000; const { Option } = Select; const { TextArea } = Input; @@ -52,8 +52,9 @@ class SnippetFormDrawer extends PureComponent { const data = await this.formRef?.current?.getFieldsValue(); // 用户有输入,加二次确认 if (data.description || data.body || data.prefix) { - const actionName = SNIPPET_ACTIONS.find((snippetAction) => snippetAction.key === action) - ?.name; + const actionName = SNIPPET_ACTIONS.find( + (snippetAction) => snippetAction.key === action, + )?.name; this.modal = Modal.confirm({ title: formatMessage( { @@ -291,8 +292,7 @@ class SnippetFormDrawer extends PureComponent { max: MAX_SNIPPRT_SIZE, message: formatMessage( { - id: - 'odc.src.component.GrammerHelpSider.component.SnippetForm.TheGrammarLengthCannotExceed', + id: 'odc.src.component.GrammerHelpSider.component.SnippetForm.TheGrammarLengthCannotExceed', }, { MAX_SNIPPRT_SIZE: MAX_SNIPPRT_SIZE, diff --git a/src/component/GrammerHelpSider/index.tsx b/src/component/GrammerHelpSider/index.tsx index 95147edfb..9229456ee 100644 --- a/src/component/GrammerHelpSider/index.tsx +++ b/src/component/GrammerHelpSider/index.tsx @@ -23,7 +23,7 @@ import { } from '@/store/snippet'; import { formatMessage } from '@/util/intl'; import { CloseOutlined, DownOutlined, PlusOutlined } from '@ant-design/icons'; -import { Dropdown, Empty, Input, Layout, Menu, message, Modal } from 'antd'; +import { Dropdown, Empty, Input, Layout, message, Modal } from 'antd'; import { inject, observer } from 'mobx-react'; import React, { Component } from 'react'; import SnippetCard from './component/SnippetCard'; diff --git a/src/component/HelpMenus/components/ModalHelpAbout/index.less b/src/component/HelpMenus/components/ModalHelpAbout/index.less index 3c6dc6c9d..071b07c00 100644 --- a/src/component/HelpMenus/components/ModalHelpAbout/index.less +++ b/src/component/HelpMenus/components/ModalHelpAbout/index.less @@ -39,8 +39,8 @@ justify-content: space-between; } .github { - font-size: 18px; color: var(--icon-color-normal); + font-size: 18px; :hover { color: #000; } diff --git a/src/component/HelpMenus/components/ModalHelpAbout/index.tsx b/src/component/HelpMenus/components/ModalHelpAbout/index.tsx index 12de19ed8..84ab7ba31 100644 --- a/src/component/HelpMenus/components/ModalHelpAbout/index.tsx +++ b/src/component/HelpMenus/components/ModalHelpAbout/index.tsx @@ -14,14 +14,14 @@ * limitations under the License. */ +import setting from '@/store/setting'; import { formatMessage, getLocalImg } from '@/util/intl'; +import { GithubFilled } from '@ant-design/icons'; import { Modal, Space } from 'antd'; import moment from 'moment'; import { PureComponent } from 'react'; -import { GithubFilled } from '@ant-design/icons'; import pkg from '../../../../../package.json'; import styles from './index.less'; -import setting from '@/store/setting'; export default class ModalHelp extends PureComponent<{ showModal: boolean; onCancel: () => void; diff --git a/src/component/HelpMenus/index.tsx b/src/component/HelpMenus/index.tsx index bd7ec30c8..8c6ef72e2 100644 --- a/src/component/HelpMenus/index.tsx +++ b/src/component/HelpMenus/index.tsx @@ -19,7 +19,6 @@ import odc from '@/plugins/odc'; import modal from '@/store/modal'; import { isClient } from '@/util/env'; import { formatMessage, getLocalDocs } from '@/util/intl'; -import { Menu } from 'antd'; import type { DropDownProps } from 'antd/lib/dropdown'; import classnames from 'classnames'; import React from 'react'; diff --git a/src/component/Input/Case/index.tsx b/src/component/Input/Case/index.tsx index 5d3778b74..d94156405 100644 --- a/src/component/Input/Case/index.tsx +++ b/src/component/Input/Case/index.tsx @@ -15,11 +15,10 @@ */ import { removeTableQuote } from '@/util/sql'; -import { getQuoteTableName } from '@/util/utils'; import { Input, InputProps } from 'antd'; import { InputRef, TextAreaProps } from 'antd/lib/input'; import { TextAreaRef } from 'antd/lib/input/TextArea'; -import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import React, { forwardRef, useEffect, useMemo, useRef, useState } from 'react'; interface Options { caseSensitive?: boolean; diff --git a/src/component/Input/Keymap/index.tsx b/src/component/Input/Keymap/index.tsx index eb2278951..399b78897 100644 --- a/src/component/Input/Keymap/index.tsx +++ b/src/component/Input/Keymap/index.tsx @@ -14,13 +14,13 @@ * limitations under the License. */ +import { PlusOutlined } from '@ant-design/icons'; import { useControllableValue } from 'ahooks'; import { Select, Tag } from 'antd'; -import React, { useMemo } from 'react'; -import { KEY_CODE_MAP, getKeyCodeText } from './keycodemap'; -import { KeyCode, KeyMod } from 'monaco-editor'; +import { KeyCode } from 'monaco-editor'; import { BaseSelectRef, CustomTagProps } from 'rc-select/lib/BaseSelect'; -import { PlusOutlined } from '@ant-design/icons'; +import React, { useMemo } from 'react'; +import { getKeyCodeText, KEY_CODE_MAP } from './keycodemap'; interface IProps { className?: string; diff --git a/src/component/LocalMenus/index.tsx b/src/component/LocalMenus/index.tsx index 391aa50d5..461a11728 100644 --- a/src/component/LocalMenus/index.tsx +++ b/src/component/LocalMenus/index.tsx @@ -18,9 +18,9 @@ import DropdownMenu from '@/component/DropdownMenu'; import { localeList } from '@/constant'; import { defaultLocale } from '@/util/intl'; import { GlobalOutlined } from '@ant-design/icons'; -import { Menu, Space } from 'antd'; -import React from 'react'; import { getLocale, setLocale } from '@umijs/max'; +import { Space } from 'antd'; +import React from 'react'; interface IProos { showIcon?: boolean; diff --git a/src/component/LockResultSetHint/index.tsx b/src/component/LockResultSetHint/index.tsx index a46108775..134281141 100644 --- a/src/component/LockResultSetHint/index.tsx +++ b/src/component/LockResultSetHint/index.tsx @@ -17,8 +17,8 @@ import { CloseOutlined } from '@ant-design/icons'; import { Component } from 'react'; // @ts-ignore -import styles from './index.less'; import { formatMessage } from '@/util/intl'; +import styles from './index.less'; export class LockResultSetHint extends Component<{ onClose(): void; diff --git a/src/component/Log/index.tsx b/src/component/Log/index.tsx index 4b283e971..b3983ad64 100644 --- a/src/component/Log/index.tsx +++ b/src/component/Log/index.tsx @@ -15,7 +15,7 @@ */ import { formatMessage } from '@/util/intl'; -import { getPrefixCls, downloadFile } from '@/util/utils'; +import { downloadFile, getPrefixCls } from '@/util/utils'; import { CopyOutlined, DownloadOutlined, diff --git a/src/component/Login/LoginForm.tsx b/src/component/Login/LoginForm.tsx index 17d67d81b..b5464813d 100644 --- a/src/component/Login/LoginForm.tsx +++ b/src/component/Login/LoginForm.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import setting from '@/store/setting'; +import { ESSOLgoinType } from '@/d.ts'; import { formatMessage } from '@/util/intl'; import { LockOutlined, @@ -29,7 +29,6 @@ import React, { useState } from 'react'; import type { LoginLocale } from '.'; import { getPrefix } from './index'; import './index.less'; -import { ESSOLgoinType } from '@/d.ts'; export interface Values { username: string; diff --git a/src/component/Login/RegisterForm.tsx b/src/component/Login/RegisterForm.tsx index 9957243d4..d7ce173c9 100644 --- a/src/component/Login/RegisterForm.tsx +++ b/src/component/Login/RegisterForm.tsx @@ -27,7 +27,8 @@ import './index.less'; * 冗余的转义符可以增强正则的可读性 */ // eslint-disable-next-line -export const PASSWORD_REGEX = /^(?=(.*[a-z]){2,})(?=(.*[A-Z]){2,})(?=(.*\d){2,})(?=(.*[ !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]){2,})[A-Za-z\d !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]{8,32}$/; +export const PASSWORD_REGEX = + /^(?=(.*[a-z]){2,})(?=(.*[A-Z]){2,})(?=(.*\d){2,})(?=(.*[ !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]){2,})[A-Za-z\d !"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\\]\^_`\{\|\}~]{8,32}$/; export interface IRegisterFormProps extends FormProps { locale?: LoginLocale; diff --git a/src/component/Login/index.less b/src/component/Login/index.less index a734415fc..5fc956058 100644 --- a/src/component/Login/index.less +++ b/src/component/Login/index.less @@ -68,8 +68,8 @@ } .@{prefix}-logo-small { display: block; - height: 32px; width: 116px; + height: 32px; // margin: 0 auto; // margin-bottom: 40px; } @@ -181,8 +181,8 @@ border-radius: 4px; } .@{prefix}-submit-ldap-btn { - background-image: linear-gradient(to right, #ffffff, #ffffff); color: rgba(0, 0, 0, 0.85); + background-image: linear-gradient(to right, #ffffff, #ffffff); border: 1px solid rgba(0, 0, 0, 0.15); } diff --git a/src/component/Login/index.tsx b/src/component/Login/index.tsx index 01e7a1b12..e653b3fc8 100644 --- a/src/component/Login/index.tsx +++ b/src/component/Login/index.tsx @@ -15,10 +15,12 @@ */ import LocalMenus from '@/component/LocalMenus'; +import { ESSOLgoinType } from '@/d.ts'; +import { LDAPLogin } from '@/page/Login/components/LDAPModal'; import { ReactComponent as LogoImg } from '@/svgr/ob_logo.svg'; -import { formatMessage, getLocalImg } from '@/util/intl'; +import { formatMessage } from '@/util/intl'; import { useControllableValue } from 'ahooks'; -import { Button, Divider, Form, Input, message, Space, Typography } from 'antd'; +import { Divider, message, Typography } from 'antd'; import type { AlertProps } from 'antd/lib/alert'; import type { FormProps } from 'antd/lib/form'; import React, { useCallback, useState } from 'react'; @@ -29,8 +31,6 @@ import type { ILoginFormProps } from './LoginForm'; import LoginForm from './LoginForm'; import type { IRegisterFormProps } from './RegisterForm'; import RegisterForm from './RegisterForm'; -import { ESSOLgoinType } from '@/d.ts'; -import { LDAPLogin } from '@/page/Login/components/LDAPModal'; export interface Values { username: string; password: string; diff --git a/src/component/LoginMenus/ChangeLockPwdModal.tsx b/src/component/LoginMenus/ChangeLockPwdModal.tsx index 20945be6e..a19bf24c7 100644 --- a/src/component/LoginMenus/ChangeLockPwdModal.tsx +++ b/src/component/LoginMenus/ChangeLockPwdModal.tsx @@ -74,8 +74,7 @@ const ChangeLockPwd: React.FC = function (props: IProps) { } else { message.error( formatMessage({ - id: - 'odc.component.LoginMenus.ChangeLockPwdModal.UnableToDeleteCheckWhether', + id: 'odc.component.LoginMenus.ChangeLockPwdModal.UnableToDeleteCheckWhether', }), // 删除失败,请确认密码是否正确 ); @@ -109,8 +108,7 @@ const ChangeLockPwd: React.FC = function (props: IProps) { if (values.password !== values.confirmPassword) { message.warning( formatMessage({ - id: - 'odc.component.LoginMenus.ChangeLockPwdModal.TheTwoPasswordsAreInconsistent', + id: 'odc.component.LoginMenus.ChangeLockPwdModal.TheTwoPasswordsAreInconsistent', }), // 两次密码输入不一致! ); diff --git a/src/component/MonacoEditor/DiffEditor.tsx b/src/component/MonacoEditor/DiffEditor.tsx index 3d7b0bd59..a05fe0f7f 100644 --- a/src/component/MonacoEditor/DiffEditor.tsx +++ b/src/component/MonacoEditor/DiffEditor.tsx @@ -14,13 +14,12 @@ * limitations under the License. */ -import * as monaco from 'monaco-editor'; -import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'; -import styles from './index.less'; import { SettingStore } from '@/store/setting'; import { inject, observer } from 'mobx-react'; -import classNames from 'classnames'; +import * as monaco from 'monaco-editor'; +import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'; import { getFontSize } from './config'; +import styles from './index.less'; export interface IDiffEditor { settingStore?: SettingStore; diff --git a/src/component/MonacoEditor/index.tsx b/src/component/MonacoEditor/index.tsx index 45c3e4971..ffb3090c5 100644 --- a/src/component/MonacoEditor/index.tsx +++ b/src/component/MonacoEditor/index.tsx @@ -22,14 +22,14 @@ import odc from '@/plugins/odc'; import SessionStore from '@/store/sessionManager/session'; import setting, { SettingStore } from '@/store/setting'; import editorUtils from '@/util/editor'; +import logger from '@/util/logger'; import { getUnWrapedSnippetBody } from '@/util/snippet'; import { inject, observer } from 'mobx-react'; +import { getFontSize } from './config'; import styles from './index.less'; import * as groovy from './plugins/languageSupport/groovy'; import { apply as markerPluginApply } from './plugins/marker'; import { getModelService } from './plugins/ob-language/service'; -import logger from '@/util/logger'; -import { getFontSize } from './config'; import { apply as themeApply } from './plugins/theme'; export interface IEditor extends monaco.editor.IStandaloneCodeEditor { doFormat: () => void; diff --git a/src/component/ODCSetting/Item/InputItem.tsx b/src/component/ODCSetting/Item/InputItem.tsx index 3c804c890..95c454065 100644 --- a/src/component/ODCSetting/Item/InputItem.tsx +++ b/src/component/ODCSetting/Item/InputItem.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Input, Radio, RadioGroupProps } from 'antd'; +import { Input } from 'antd'; import { useState } from 'react'; export default function InputItem(props: { diff --git a/src/component/ODCSetting/Item/SelectItem.tsx b/src/component/ODCSetting/Item/SelectItem.tsx index f627b2b06..0418fa676 100644 --- a/src/component/ODCSetting/Item/SelectItem.tsx +++ b/src/component/ODCSetting/Item/SelectItem.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Radio, RadioGroupProps, Select, SelectProps } from 'antd'; +import { Select, SelectProps } from 'antd'; import { useState } from 'react'; export default function SelectItem(props: { diff --git a/src/component/ODCSetting/Item/TextItem.tsx b/src/component/ODCSetting/Item/TextItem.tsx index 257638e04..61b4d7f11 100644 --- a/src/component/ODCSetting/Item/TextItem.tsx +++ b/src/component/ODCSetting/Item/TextItem.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Input, Radio, RadioGroupProps } from 'antd'; +import { Input } from 'antd'; import { useState } from 'react'; export default function TextAreaItem(props: { diff --git a/src/component/ODCSetting/config.tsx b/src/component/ODCSetting/config.tsx index fd8ea2c27..d6c06ee65 100644 --- a/src/component/ODCSetting/config.tsx +++ b/src/component/ODCSetting/config.tsx @@ -14,11 +14,11 @@ * limitations under the License. */ +import accountSettings from './config/account'; import databaseSettings from './config/database'; import editorSettings from './config/editor'; -import perferenceSettings from './config/preference'; import performanceSettings from './config/performance'; -import accountSettings from './config/account'; +import perferenceSettings from './config/preference'; export interface ODCSettingGroup { label: string; diff --git a/src/component/ODCSetting/config/account.tsx b/src/component/ODCSetting/config/account.tsx index 19a48f5ef..14f735f5f 100644 --- a/src/component/ODCSetting/config/account.tsx +++ b/src/component/ODCSetting/config/account.tsx @@ -14,10 +14,10 @@ * limitations under the License. */ +import { SpaceType } from '@/d.ts/_index'; import { formatMessage } from '@/util/intl'; -import RadioItem from '../Item/RadioItem'; import { IODCSetting, ODCSettingGroup } from '../config'; -import { SpaceType } from '@/d.ts/_index'; +import RadioItem from '../Item/RadioItem'; const accountGroup: ODCSettingGroup = { label: formatMessage({ id: 'src.component.ODCSetting.config.01FFDFB6' }), //'账号' diff --git a/src/component/ODCSetting/config/database.tsx b/src/component/ODCSetting/config/database.tsx index 367e8e6a8..7d0467ecb 100644 --- a/src/component/ODCSetting/config/database.tsx +++ b/src/component/ODCSetting/config/database.tsx @@ -14,13 +14,13 @@ * limitations under the License. */ +import { DragInsertTypeText } from '@/constant/label'; +import { AutoCommitMode, DragInsertType } from '@/d.ts'; import { formatMessage } from '@/util/intl'; -import RadioItem from '../Item/RadioItem'; import { IODCSetting, ODCSettingGroup } from '../config'; -import { AutoCommitMode, DragInsertType } from '@/d.ts'; import InputItem from '../Item/InputItem'; +import RadioItem from '../Item/RadioItem'; import SelectItem from '../Item/SelectItem'; -import { DragInsertTypeText } from '@/constant/label'; const databaseGroup: ODCSettingGroup = { label: formatMessage({ id: 'src.component.ODCSetting.config.9EC92943' }), //'数据库' diff --git a/src/component/ODCSetting/config/editor.tsx b/src/component/ODCSetting/config/editor.tsx index c2176de42..96d7c41a6 100644 --- a/src/component/ODCSetting/config/editor.tsx +++ b/src/component/ODCSetting/config/editor.tsx @@ -14,11 +14,10 @@ * limitations under the License. */ +import KeymapInput from '@/component/Input/Keymap'; import { formatMessage } from '@/util/intl'; -import RadioItem from '../Item/RadioItem'; import { IODCSetting, ODCSettingGroup } from '../config'; -import InputItem from '../Item/InputItem'; -import KeymapInput from '@/component/Input/Keymap'; +import RadioItem from '../Item/RadioItem'; import SelectItem from '../Item/SelectItem'; const editorGroup: ODCSettingGroup = { diff --git a/src/component/ODCSetting/config/preference.tsx b/src/component/ODCSetting/config/preference.tsx index 21c998af9..575eab13c 100644 --- a/src/component/ODCSetting/config/preference.tsx +++ b/src/component/ODCSetting/config/preference.tsx @@ -14,11 +14,11 @@ * limitations under the License. */ +import { localeList } from '@/constant'; +import { EThemeConfigKey } from '@/store/setting'; import { formatMessage } from '@/util/intl'; -import RadioItem from '../Item/RadioItem'; import { IODCSetting, ODCSettingGroup } from '../config'; -import { EThemeConfigKey } from '@/store/setting'; -import { localeList } from '@/constant'; +import RadioItem from '../Item/RadioItem'; const preferenceGroup: ODCSettingGroup = { label: formatMessage({ id: 'src.component.ODCSetting.config.774332B4' }), //'外观' diff --git a/src/component/ODCSetting/index.less b/src/component/ODCSetting/index.less index 99acef21e..f2083641f 100644 --- a/src/component/ODCSetting/index.less +++ b/src/component/ODCSetting/index.less @@ -1,11 +1,11 @@ .box { - height: 560px; position: relative; + height: 560px; .menu { position: absolute; - z-index: 1; - right: 20px; top: 0px; + right: 20px; + z-index: 1; width: 140px; padding: 12px 8px; :global { @@ -22,12 +22,12 @@ .content { position: absolute; top: 0px; + right: 0px; bottom: 0px; left: 0px; - right: 0px; - overflow-y: auto; padding: 16px; padding-right: 140px; + overflow-y: auto; } } diff --git a/src/component/ODCSetting/index.tsx b/src/component/ODCSetting/index.tsx index 6239e2291..14ed07211 100644 --- a/src/component/ODCSetting/index.tsx +++ b/src/component/ODCSetting/index.tsx @@ -15,18 +15,17 @@ */ import { formatMessage } from '@/util/intl'; -import { Button, Col, Form, Modal, Row, Space, Tabs, Typography, message } from 'antd'; +import { Button, Col, Form, message, Modal, Row, Space, Tabs, Typography } from 'antd'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import odcSetting, { IODCSetting, ODCSettingGroup, odcSettingMap } from './config'; -import styles from './index.less'; -import { inject, observer } from 'mobx-react'; -import modal, { ModalStore } from '@/store/modal'; +import { ModalStore } from '@/store/modal'; import setting from '@/store/setting'; -import { IUserConfig } from '@/d.ts'; import { getODCSetting, saveODCSetting } from '@/util/client'; import { isClient } from '@/util/env'; import { safeParseJson } from '@/util/utils'; +import { inject, observer } from 'mobx-react'; +import styles from './index.less'; interface IProps { modalStore?: ModalStore; diff --git a/src/component/OSSDragger2/index.tsx b/src/component/OSSDragger2/index.tsx index 33e62c45d..d61e5c039 100644 --- a/src/component/OSSDragger2/index.tsx +++ b/src/component/OSSDragger2/index.tsx @@ -26,12 +26,12 @@ import type { UploadFile } from 'antd/lib/upload/interface'; import update from 'immutability-helper'; import _ from 'lodash'; import React, { + forwardRef, useCallback, useEffect, + useImperativeHandle, useRef, useState, - useImperativeHandle, - forwardRef, } from 'react'; import FileList from './FileList'; import styles from './index.less'; diff --git a/src/component/PageContainer/index.tsx b/src/component/PageContainer/index.tsx index 338a7f82e..95700add6 100644 --- a/src/component/PageContainer/index.tsx +++ b/src/component/PageContainer/index.tsx @@ -61,15 +61,8 @@ const PageContainer: React.FC = (props) => { onTabChange, containerWrapStyle = {}, } = props; - const { - title, - type, - options, - defaultValue, - showDivider, - onChange, - onDropdownVisibleChange, - } = titleProps; + const { title, type, options, defaultValue, showDivider, onChange, onDropdownVisibleChange } = + titleProps; return (
diff --git a/src/component/PageLoading/index.less b/src/component/PageLoading/index.less index 6c871bf57..3e38cd69c 100644 --- a/src/component/PageLoading/index.less +++ b/src/component/PageLoading/index.less @@ -1,5 +1,7 @@ .odc-loading { position: fixed; + top: 0px; + left: 0px; display: flex; align-items: center; justify-content: center; @@ -7,24 +9,22 @@ height: 100%; margin: 0; padding: 0; - top: 0px; - left: 0px; background: #fff; } .tip { position: fixed; - left: calc(50% + 20px); top: calc(50% + 60px); - transform: translateX(-50%); + left: calc(50% + 20px); color: var(--text-color-placeholder); + transform: translateX(-50%); } .ob-loading-icon { position: fixed; bottom: 50px; + left: 0px; margin-left: 50%; transform: translateX(-50%); - left: 0px; } .dot-box { diff --git a/src/component/PartitionRange/DragableRange.tsx b/src/component/PartitionRange/DragableRange.tsx index 982c13c20..d4a2620d4 100644 --- a/src/component/PartitionRange/DragableRange.tsx +++ b/src/component/PartitionRange/DragableRange.tsx @@ -24,8 +24,8 @@ import Dragable, { IDragable } from '../Dragable'; import styles from './index.less'; // @ts-ignore import { ReactComponent as DragSvg } from '@/svgr/drag.svg'; -import PartitionValueInput from './PartitionValueInput'; import { formatMessage } from '@/util/intl'; +import PartitionValueInput from './PartitionValueInput'; export interface IDragableParamProps extends IDragable { deletable: boolean; diff --git a/src/component/PartitionRange/PartitionValueInput.tsx b/src/component/PartitionRange/PartitionValueInput.tsx index 10e4737b3..4df434d1e 100644 --- a/src/component/PartitionRange/PartitionValueInput.tsx +++ b/src/component/PartitionRange/PartitionValueInput.tsx @@ -22,8 +22,8 @@ import { DeleteOutlined, PlusCircleOutlined } from '@ant-design/icons'; import { Form, Input, Tooltip } from 'antd'; // @ts-ignore -import styles from './PartitionValueInput.less'; import { formatMessage } from '@/util/intl'; +import styles from './PartitionValueInput.less'; interface PartitionValueInputProps { index: number; diff --git a/src/component/PartitionRange/index.tsx b/src/component/PartitionRange/index.tsx index 311338362..09d01ec9a 100644 --- a/src/component/PartitionRange/index.tsx +++ b/src/component/PartitionRange/index.tsx @@ -23,8 +23,8 @@ import { Button, Form, Input, Table } from 'antd'; import update from 'immutability-helper'; import PartitionValueInput from './PartitionValueInput'; // @ts-ignore -import styles from './index.less'; import { formatMessage } from '@/util/intl'; +import styles from './index.less'; export interface ISinglePartitionRule { name: string; diff --git a/src/component/ProcedureParam/ExtraOptions.tsx b/src/component/ProcedureParam/ExtraOptions.tsx index 3937c6742..a5e543d45 100644 --- a/src/component/ProcedureParam/ExtraOptions.tsx +++ b/src/component/ProcedureParam/ExtraOptions.tsx @@ -14,9 +14,9 @@ * limitations under the License. */ -import { formatMessage } from '@/util/intl'; import { getDataSourceModeConfig } from '@/common/datasource'; import { ConnectType, DbObjectType } from '@/d.ts'; +import { formatMessage } from '@/util/intl'; import { Col, Form, Row, Select } from 'antd'; import HelpDoc from '../helpDoc'; export default function ExtraOptions({ diff --git a/src/component/ProcedureParam/index.tsx b/src/component/ProcedureParam/index.tsx index a5453311a..7a5bdc129 100644 --- a/src/component/ProcedureParam/index.tsx +++ b/src/component/ProcedureParam/index.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; import type { IPLParam } from '@/d.ts'; import { ConnectionMode, DbObjectType, ParamMode } from '@/d.ts'; import type { RowType } from '@/page/Workspace/components/EditableTable'; @@ -44,8 +45,6 @@ import React, { useState, } from 'react'; import Toolbar from '../Toolbar'; -import { isConnectionModeBeMySQLType } from '@/util/connection'; -import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; interface IProps { session: SessionStore; diff --git a/src/component/RecordPopover/components.tsx b/src/component/RecordPopover/components.tsx index eebe1c4db..0d071cd54 100644 --- a/src/component/RecordPopover/components.tsx +++ b/src/component/RecordPopover/components.tsx @@ -20,9 +20,9 @@ import type { ITableInstance, ITableLoadOptions } from '@/component/CommonTable/ import { CommonTableMode } from '@/component/CommonTable/interface'; import CommonDetailModal from '@/component/Manage/DetailModal'; import { TimeOptions } from '@/component/TimeSelect'; +import { getEventFilterAndOptions } from '@/constant/record'; import { IAudit, IAuditEvent, IResponseData } from '@/d.ts'; import { RecordContent } from '@/page/Secure/components/RecordPage/component'; -import { getEventFilterAndOptions } from '@/constant/record'; import { isClient } from '@/util/env'; import { formatMessage } from '@/util/intl'; import { Button, DatePicker } from 'antd'; diff --git a/src/component/RiskLevelLabel/index.tsx b/src/component/RiskLevelLabel/index.tsx index 4f4028e0b..cc13914fc 100644 --- a/src/component/RiskLevelLabel/index.tsx +++ b/src/component/RiskLevelLabel/index.tsx @@ -14,10 +14,10 @@ * limitations under the License. */ +import { EnvColorMap } from '@/constant'; import { Tag } from 'antd'; import { RiskLevelMap } from '../../page/Secure/interface'; import styles from './index.less'; -import { EnvColorMap } from '@/constant'; const RiskLevelLabel: React.FC<{ level?: number; diff --git a/src/component/SQLConfig/index.tsx b/src/component/SQLConfig/index.tsx index 4edb74169..f4140dc68 100644 --- a/src/component/SQLConfig/index.tsx +++ b/src/component/SQLConfig/index.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import setting, { SettingStore } from '@/store/setting'; +import { SettingStore } from '@/store/setting'; import { formatMessage } from '@/util/intl'; import { SettingOutlined } from '@ant-design/icons'; import { Popover, Row, Switch, Tooltip } from 'antd'; diff --git a/src/component/SQLExecuteModal/index.tsx b/src/component/SQLExecuteModal/index.tsx index bad3da876..a205602f0 100644 --- a/src/component/SQLExecuteModal/index.tsx +++ b/src/component/SQLExecuteModal/index.tsx @@ -14,15 +14,15 @@ * limitations under the License. */ +import { getDataSourceModeConfig } from '@/common/datasource'; import { executeSQL } from '@/common/network/sql'; -import { ConnectionMode, ISqlExecuteResultStatus } from '@/d.ts'; +import { ISqlExecuteResultStatus } from '@/d.ts'; import SessionStore from '@/store/sessionManager/session'; import { formatMessage } from '@/util/intl'; import notification from '@/util/notification'; import { message, Modal } from 'antd'; import { useCallback, useEffect, useState } from 'react'; import CommonIDE from '../CommonIDE'; -import { getDataSourceModeConfig } from '@/common/datasource'; function SQLExecuteModal(props: { isPL?: boolean; diff --git a/src/component/SelectDatabase/index.tsx b/src/component/SelectDatabase/index.tsx index f9ba7e8fe..dd55db6c1 100644 --- a/src/component/SelectDatabase/index.tsx +++ b/src/component/SelectDatabase/index.tsx @@ -15,12 +15,12 @@ */ import { getConnectionList } from '@/common/network/connection'; +import SessionSelect from '@/page/Workspace/components/SessionContextWrap/SessionSelect/SelectItem'; +import { ModalStore } from '@/store/modal'; import { formatMessage } from '@/util/intl'; import { useRequest } from 'ahooks'; -import { Form, Modal, Select } from 'antd'; -import SessionSelect from '@/page/Workspace/components/SessionContextWrap/SessionSelect/SelectItem'; +import { Form, Modal } from 'antd'; import { inject, observer } from 'mobx-react'; -import { ModalStore } from '@/store/modal'; interface IProps { modalStore?: ModalStore; diff --git a/src/component/SelectTransfer/index.tsx b/src/component/SelectTransfer/index.tsx index 53f5a65c5..ca0e0c1c0 100644 --- a/src/component/SelectTransfer/index.tsx +++ b/src/component/SelectTransfer/index.tsx @@ -155,7 +155,7 @@ export default function SelectTransfer(props: IProps) { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', - wordBreak: "break-all" + wordBreak: 'break-all', }} title={node.title} > diff --git a/src/component/StatusIcon/DataSourceIcon.tsx b/src/component/StatusIcon/DataSourceIcon.tsx index 802328405..1542c5d9d 100644 --- a/src/component/StatusIcon/DataSourceIcon.tsx +++ b/src/component/StatusIcon/DataSourceIcon.tsx @@ -15,9 +15,9 @@ */ import { IConnection, IConnectionStatus } from '@/d.ts'; -import { Tooltip } from 'antd'; -import Icon, { Loading3QuartersOutlined, MinusCircleFilled } from '@ant-design/icons'; import { formatMessage } from '@/util/intl'; +import Icon, { Loading3QuartersOutlined, MinusCircleFilled } from '@ant-design/icons'; +import { Tooltip } from 'antd'; import { getDataSourceStyleByConnectType } from '@/common/datasource'; import datasourceStatus from '@/store/datasourceStatus'; diff --git a/src/component/StatusIcon/DatabaseIcon.tsx b/src/component/StatusIcon/DatabaseIcon.tsx index e7c2169db..f15907161 100644 --- a/src/component/StatusIcon/DatabaseIcon.tsx +++ b/src/component/StatusIcon/DatabaseIcon.tsx @@ -15,13 +15,13 @@ */ import { IConnectionStatus } from '@/d.ts'; -import { Tooltip } from 'antd'; -import Icon, { Loading3QuartersOutlined, MinusCircleFilled } from '@ant-design/icons'; import { formatMessage } from '@/util/intl'; +import Icon, { Loading3QuartersOutlined, MinusCircleFilled } from '@ant-design/icons'; +import { Tooltip } from 'antd'; import { getDataSourceStyleByConnectType } from '@/common/datasource'; -import datasourceStatus from '@/store/datasourceStatus'; import { IDatabase } from '@/d.ts/database'; +import datasourceStatus from '@/store/datasourceStatus'; import { observer } from 'mobx-react'; export default observer(function DataBaseStatusIcon({ item }: { item: IDatabase }) { diff --git a/src/component/Task/AlterDdlTask/CreateModal/index.tsx b/src/component/Task/AlterDdlTask/CreateModal/index.tsx index 980899499..d5aea69fa 100644 --- a/src/component/Task/AlterDdlTask/CreateModal/index.tsx +++ b/src/component/Task/AlterDdlTask/CreateModal/index.tsx @@ -14,13 +14,14 @@ * limitations under the License. */ +import { getDataSourceModeConfig } from '@/common/datasource'; import { createTask, getDatasourceUsers, getLockDatabaseUserRequired } from '@/common/network/task'; import CommonIDE from '@/component/CommonIDE'; import FormItemPanel from '@/component/FormItemPanel'; import HelpDoc from '@/component/helpDoc'; import DescriptionInput from '@/component/Task/component/DescriptionInput'; import TaskTimer from '@/component/Task/component/TimerSelect'; -import { TaskExecStrategy, TaskPageScope, TaskPageType, TaskType, IDatasourceUser } from '@/d.ts'; +import { IDatasourceUser, TaskExecStrategy, TaskPageScope, TaskPageType, TaskType } from '@/d.ts'; import { openTasksPage } from '@/store/helper/page'; import type { ModalStore } from '@/store/modal'; import { useDBSession } from '@/store/sessionManager/hooks'; @@ -35,14 +36,13 @@ import { Modal, Radio, Row, - Space, Select, + Space, } from 'antd'; import { inject, observer } from 'mobx-react'; -import React, { useState, useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import DatabaseSelect from '../../component/DatabaseSelect'; import styles from './index.less'; -import { getDataSourceModeConfig } from '@/common/datasource'; interface IProps { modalStore?: ModalStore; projectId?: number; diff --git a/src/component/Task/AlterDdlTask/DetailContent/index.tsx b/src/component/Task/AlterDdlTask/DetailContent/index.tsx index 59bf65994..6392fe561 100644 --- a/src/component/Task/AlterDdlTask/DetailContent/index.tsx +++ b/src/component/Task/AlterDdlTask/DetailContent/index.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; import RiskLevelLabel from '@/component/RiskLevelLabel'; import { SQLContent } from '@/component/SQLContent'; import { getTaskExecStrategyMap } from '@/component/Task'; @@ -21,11 +22,10 @@ import type { ITaskResult, TaskDetail } from '@/d.ts'; import { TaskExecStrategy } from '@/d.ts'; import { formatMessage } from '@/util/intl'; import { getFormatDateTime } from '@/util/utils'; -import React from 'react'; import { Typography } from 'antd'; +import React from 'react'; import { SimpleTextItem } from '../../component/SimpleTextItem'; import { ClearStrategy, SwapTableType } from '../CreateModal'; -import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; const { Text } = Typography; interface IDDLAlterParamters { errorStrategy: TaskExecStrategy; diff --git a/src/component/Task/ApplyDatabasePermission/CreateButton.tsx b/src/component/Task/ApplyDatabasePermission/CreateButton.tsx index ce353375e..bcc4703a2 100644 --- a/src/component/Task/ApplyDatabasePermission/CreateButton.tsx +++ b/src/component/Task/ApplyDatabasePermission/CreateButton.tsx @@ -15,10 +15,10 @@ */ import { ModalStore } from '@/store/modal'; -import React from 'react'; import { Button, Space } from 'antd'; import type { ButtonProps } from 'antd/lib/button'; import { inject, observer } from 'mobx-react'; +import React from 'react'; import ApplyDatabasePermissionCreateModal from './CreateModal'; interface IProps extends ButtonProps { diff --git a/src/component/Task/ApplyDatabasePermission/CreateModal/index.tsx b/src/component/Task/ApplyDatabasePermission/CreateModal/index.tsx index eb0f49034..366c68a7c 100644 --- a/src/component/Task/ApplyDatabasePermission/CreateModal/index.tsx +++ b/src/component/Task/ApplyDatabasePermission/CreateModal/index.tsx @@ -15,30 +15,30 @@ import { formatMessage } from '@/util/intl'; * limitations under the License. */ +import { listProjects } from '@/common/network/project'; import { createTask } from '@/common/network/task'; +import HelpDoc from '@/component/helpDoc'; +import DatabaseSelecter from '@/component/Task/component/DatabaseSelecter'; import { TaskPageScope, TaskPageType, TaskType } from '@/d.ts'; import { DatabasePermissionType } from '@/d.ts/database'; import { openTasksPage } from '@/store/helper/page'; import type { ModalStore } from '@/store/modal'; +import { useRequest } from 'ahooks'; import { Button, + Checkbox, + DatePicker, Drawer, Form, + Input, + message, Modal, Select, Space, - Input, - message, - DatePicker, - Checkbox, } from 'antd'; import { inject, observer } from 'mobx-react'; -import React, { useEffect, useState } from 'react'; import moment from 'moment'; -import { useRequest } from 'ahooks'; -import { listProjects } from '@/common/network/project'; -import DatabaseSelecter from '@/component/Task/component/DatabaseSelecter'; -import HelpDoc from '@/component/helpDoc'; +import React, { useEffect, useState } from 'react'; import styles from './index.less'; const CheckboxGroup = Checkbox.Group; diff --git a/src/component/Task/ApplyDatabasePermission/DetailContent/index.tsx b/src/component/Task/ApplyDatabasePermission/DetailContent/index.tsx index e631e03bd..85adbf7bd 100644 --- a/src/component/Task/ApplyDatabasePermission/DetailContent/index.tsx +++ b/src/component/Task/ApplyDatabasePermission/DetailContent/index.tsx @@ -15,12 +15,12 @@ import { formatMessage } from '@/util/intl'; * limitations under the License. */ +import DisplayTable from '@/component/DisplayTable'; +import { SimpleTextItem } from '@/component/Task/component/SimpleTextItem'; import type { IApplyDatabasePermissionTaskParams, TaskDetail } from '@/d.ts'; import { getFormatDateTime } from '@/util/utils'; -import { SimpleTextItem } from '@/component/Task/component/SimpleTextItem'; -import DisplayTable from '@/component/DisplayTable'; import { Descriptions, Divider } from 'antd'; -import { permissionOptionsMap, getExpireTimeLabel } from '../'; +import { getExpireTimeLabel, permissionOptionsMap } from '../'; import styles from './index.less'; const getConnectionColumns = () => { diff --git a/src/component/Task/ApplyDatabasePermission/index.tsx b/src/component/Task/ApplyDatabasePermission/index.tsx index d63aa78e3..1e725b5b0 100644 --- a/src/component/Task/ApplyDatabasePermission/index.tsx +++ b/src/component/Task/ApplyDatabasePermission/index.tsx @@ -14,6 +14,6 @@ * limitations under the License. */ +export * from './CreateModal'; export { default } from './CreateModal'; export { default as ApplyDatabasePermissionTaskContent } from './DetailContent'; -export * from './CreateModal'; diff --git a/src/component/Task/ApplyPermission/CreateButton.tsx b/src/component/Task/ApplyPermission/CreateButton.tsx index fb2b7784a..6141eb79b 100644 --- a/src/component/Task/ApplyPermission/CreateButton.tsx +++ b/src/component/Task/ApplyPermission/CreateButton.tsx @@ -15,10 +15,10 @@ */ import { ModalStore } from '@/store/modal'; -import React from 'react'; import { Button, Space } from 'antd'; import type { ButtonProps } from 'antd/lib/button'; import { inject, observer } from 'mobx-react'; +import React from 'react'; import ApplyPermissionCreateModal from './CreateModal'; interface IProps extends ButtonProps { diff --git a/src/component/Task/ApplyPermission/CreateModal/index.tsx b/src/component/Task/ApplyPermission/CreateModal/index.tsx index 54fd6b38d..04afe4816 100644 --- a/src/component/Task/ApplyPermission/CreateModal/index.tsx +++ b/src/component/Task/ApplyPermission/CreateModal/index.tsx @@ -15,16 +15,16 @@ import { formatMessage } from '@/util/intl'; * limitations under the License. */ -import { createTask } from '@/common/network/task'; import { getResourceRoles } from '@/common/network/manager'; +import { createTask } from '@/common/network/task'; +import { useProjects } from '@/component/Task/hooks/useProjects'; import { TaskExecStrategy, TaskPageScope, TaskPageType, TaskType } from '@/d.ts'; +import { ProjectRole } from '@/d.ts/project'; import { openTasksPage } from '@/store/helper/page'; import type { ModalStore } from '@/store/modal'; -import { ProjectRole } from '@/d.ts/project'; -import { Button, Drawer, Form, Modal, Select, Space, Input, message, Typography, Tag } from 'antd'; +import { Button, Drawer, Form, Input, message, Modal, Select, Space, Tag, Typography } from 'antd'; import { inject, observer } from 'mobx-react'; import React, { useEffect, useState } from 'react'; -import { useProjects } from '@/component/Task/hooks/useProjects'; import styles from './index.less'; const { Text } = Typography; export const projectRoleMap = { diff --git a/src/component/Task/ApplyPermission/DetailContent/index.tsx b/src/component/Task/ApplyPermission/DetailContent/index.tsx index 2801bb56f..efb5507fb 100644 --- a/src/component/Task/ApplyPermission/DetailContent/index.tsx +++ b/src/component/Task/ApplyPermission/DetailContent/index.tsx @@ -50,8 +50,7 @@ const ApplyPermissionTaskContent: React.FC = (props) => { > { formatMessage({ - id: - 'odc.src.component.Task.ApplyPermission.DetailContent.ApplicationProjectPermissions', + id: 'odc.src.component.Task.ApplyPermission.DetailContent.ApplicationProjectPermissions', }) /* 申请项目权限 */ } diff --git a/src/component/Task/AsyncTask/DetailContent/index.tsx b/src/component/Task/AsyncTask/DetailContent/index.tsx index 46d98019c..d710e58a5 100644 --- a/src/component/Task/AsyncTask/DetailContent/index.tsx +++ b/src/component/Task/AsyncTask/DetailContent/index.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; import RiskLevelLabel from '@/component/RiskLevelLabel'; import { SQLContent } from '@/component/SQLContent'; import { getTaskExecStrategyMap } from '@/component/Task'; @@ -21,12 +22,11 @@ import type { IAsyncTaskParams, ITaskResult, TaskDetail } from '@/d.ts'; import { TaskExecStrategy } from '@/d.ts'; import { formatMessage } from '@/util/intl'; import { getFormatDateTime, milliSecondsToHour } from '@/util/utils'; +import { InfoCircleOutlined } from '@ant-design/icons'; import { Descriptions, Divider, Space, Tooltip } from 'antd'; +import DatabaseLabel from '../../component/DatabaseLabel'; import { DownloadFileAction } from '../../component/DownloadFileAction'; import { SimpleTextItem } from '../../component/SimpleTextItem'; -import DatabaseLabel from '../../component/DatabaseLabel'; -import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; -import { InfoCircleOutlined } from '@ant-design/icons'; export const ErrorStrategy = { ABORT: formatMessage({ id: 'odc.TaskManagePage.AsyncTask.StopATask', diff --git a/src/component/Task/Content.tsx b/src/component/Task/Content.tsx index 4ad29947f..88fd9874e 100644 --- a/src/component/Task/Content.tsx +++ b/src/component/Task/Content.tsx @@ -15,6 +15,7 @@ import { formatMessage } from '@/util/intl'; * limitations under the License. */ +import { getTaskDetail } from '@/common/network/task'; import type { ITableInstance, ITableLoadOptions } from '@/component/CommonTable/interface'; import type { IAlterScheduleTaskParams, @@ -27,19 +28,18 @@ import type { import { IConnectionType, ICycleTaskRecord, TaskPageType, TaskRecord, TaskType } from '@/d.ts'; import { ModalStore } from '@/store/modal'; import type { TaskStore } from '@/store/task'; +import tracert from '@/util/tracert'; import { getPreTime } from '@/util/utils'; +import { useLocation } from '@umijs/max'; +import { useSetState } from 'ahooks'; +import { message } from 'antd'; import { inject, observer } from 'mobx-react'; import type { Moment } from 'moment'; -import { useLocation } from '@umijs/max'; import React, { useEffect, useRef } from 'react'; import TaskTable from './component/TaskTable'; import DetailModal from './DetailModal'; import { isCycleTaskPage } from './helper'; import styles from './index.less'; -import tracert from '@/util/tracert'; -import { getTaskDetail } from '@/common/network/task'; -import { message } from 'antd'; -import { useSetState } from 'ahooks'; interface IProps { taskStore?: TaskStore; modalStore?: ModalStore; diff --git a/src/component/Task/CreateModals.tsx b/src/component/Task/CreateModals.tsx index b6318d33a..6b27e6bae 100644 --- a/src/component/Task/CreateModals.tsx +++ b/src/component/Task/CreateModals.tsx @@ -16,6 +16,8 @@ import React from 'react'; import AlterDDLTaskCreateModal from './AlterDdlTask'; +import ApplyDatabasePermissionCreateModal from './ApplyDatabasePermission'; +import ApplyPermissionCreateModal from './ApplyPermission'; import AsyncTaskCreateModal from './AsyncTask'; import DataArchiveTaskCreateModal from './DataArchiveTask'; import DataClearTaskCreateModal from './DataClearTask'; @@ -26,8 +28,6 @@ import PartitionTaskCreateModal from './PartitionTask'; import ResultSetExportTask from './ResultSetExportTask'; import ShadowSyncTaskCreateModal from './ShadowSyncTask'; import SQLPlanTaskCreateModal from './SQLPlanTask'; -import ApplyPermissionCreateModal from './ApplyPermission'; -import ApplyDatabasePermissionCreateModal from './ApplyDatabasePermission'; import StructureComparisonTask from './StructureComparisonTask'; interface IProps { diff --git a/src/component/Task/DataArchiveTask/CreateModal/ArchiveRange.tsx b/src/component/Task/DataArchiveTask/CreateModal/ArchiveRange.tsx index 34c52a4ae..c34b01dfe 100644 --- a/src/component/Task/DataArchiveTask/CreateModal/ArchiveRange.tsx +++ b/src/component/Task/DataArchiveTask/CreateModal/ArchiveRange.tsx @@ -19,8 +19,8 @@ import { formatMessage } from '@/util/intl'; import { DeleteOutlined, PlusOutlined } from '@ant-design/icons'; import { Button, Form, Input, Radio, Select, Space, Typography } from 'antd'; import classNames from 'classnames'; -import { IArchiveRange } from './index'; import ArchiveRangeTip from '../../component/ArchiveRangeTip'; +import { IArchiveRange } from './index'; import styles from './index.less'; const { Text } = Typography; interface IProps { diff --git a/src/component/Task/DataArchiveTask/CreateModal/VariableConfig.tsx b/src/component/Task/DataArchiveTask/CreateModal/VariableConfig.tsx index d0c419003..3ffffa59d 100644 --- a/src/component/Task/DataArchiveTask/CreateModal/VariableConfig.tsx +++ b/src/component/Task/DataArchiveTask/CreateModal/VariableConfig.tsx @@ -17,8 +17,8 @@ import HelpDoc from '@/component/helpDoc'; import { formatMessage } from '@/util/intl'; import { DeleteOutlined, MinusOutlined, PlusOutlined } from '@ant-design/icons'; -import { Button, Form, Input, InputNumber, Select, Space, Tooltip } from 'antd'; import type { FormInstance } from 'antd'; +import { Button, Form, Input, InputNumber, Select, Space, Tooltip } from 'antd'; import classNames from 'classnames'; import { variable } from './index'; import styles from './index.less'; @@ -185,8 +185,9 @@ const VariableConfig: React.FC = (props) => { {(subFields, { add: _add, remove: _remove }) => { const disabledAdd = subFields.length >= 3; - const required = !!Object.values(variables?.[index].pattern?.[0] ?? {})?.join('') - ?.length; + const required = !!Object.values(variables?.[index].pattern?.[0] ?? {})?.join( + '', + )?.length; return (
{subFields.map(({ key, name, ...restField }) => ( @@ -198,8 +199,7 @@ const VariableConfig: React.FC = (props) => { { required, message: formatMessage({ - id: - 'odc.src.component.Task.DataArchiveTask.CreateModal.PleaseChoose', + id: 'odc.src.component.Task.DataArchiveTask.CreateModal.PleaseChoose', }), //'请选择' }, ]} @@ -218,8 +218,7 @@ const VariableConfig: React.FC = (props) => { { required, message: formatMessage({ - id: - 'odc.src.component.Task.DataArchiveTask.CreateModal.PleaseEnter', + id: 'odc.src.component.Task.DataArchiveTask.CreateModal.PleaseEnter', }), //'请输入' }, ]} @@ -238,8 +237,7 @@ const VariableConfig: React.FC = (props) => { { required, message: formatMessage({ - id: - 'odc.src.component.Task.DataArchiveTask.CreateModal.PleaseChoose.1', + id: 'odc.src.component.Task.DataArchiveTask.CreateModal.PleaseChoose.1', }), //'请选择' }, ]} @@ -256,8 +254,7 @@ const VariableConfig: React.FC = (props) => { @@ -268,8 +265,7 @@ const VariableConfig: React.FC = (props) => { diff --git a/src/component/Task/DataArchiveTask/CreateModal/index.tsx b/src/component/Task/DataArchiveTask/CreateModal/index.tsx index 99bad5b0a..8ac1ed5a2 100644 --- a/src/component/Task/DataArchiveTask/CreateModal/index.tsx +++ b/src/component/Task/DataArchiveTask/CreateModal/index.tsx @@ -17,12 +17,13 @@ import { getTableListByDatabaseName } from '@/common/network/table'; import { createTask, getCycleTaskDetail, previewSqlStatements } from '@/common/network/task'; import Crontab from '@/component/Crontab'; -import { CrontabDateType, ICrontab, CrontabMode } from '@/component/Crontab/interface'; +import { CrontabDateType, CrontabMode, ICrontab } from '@/component/Crontab/interface'; import FormItemPanel from '@/component/FormItemPanel'; import DescriptionInput from '@/component/Task/component/DescriptionInput'; import { CreateTaskRecord, ICycleTaskTriggerConfig, + IDataArchiveJobParameters, ITable, MigrationInsertAction, TaskExecStrategy, @@ -30,26 +31,24 @@ import { TaskPageScope, TaskPageType, TaskType, - IDataArchiveJobParameters, } from '@/d.ts'; import { openTasksPage } from '@/store/helper/page'; import type { ModalStore } from '@/store/modal'; import { useDBSession } from '@/store/sessionManager/hooks'; import { isClient } from '@/util/env'; import { formatMessage } from '@/util/intl'; -import { mbToKb, kbToMb } from '@/util/utils'; +import { kbToMb, mbToKb } from '@/util/utils'; import { FieldTimeOutlined } from '@ant-design/icons'; import { Button, Checkbox, DatePicker, Drawer, Form, Modal, Radio, Space } from 'antd'; import { inject, observer } from 'mobx-react'; -import React, { useEffect, useRef, useState } from 'react'; import moment from 'moment'; +import React, { useEffect, useRef, useState } from 'react'; import DatabaseSelect from '../../component/DatabaseSelect'; import SQLPreviewModal from '../../component/SQLPreviewModal'; +import ThrottleFormItem from '../../component/ThrottleFormItem'; import ArchiveRange from './ArchiveRange'; import styles from './index.less'; -import VariableConfig from './VariableConfig'; -import ThrottleFormItem from '../../component/ThrottleFormItem'; -import { timeUnitOptions } from './VariableConfig'; +import VariableConfig, { timeUnitOptions } from './VariableConfig'; export enum IArchiveRange { PORTION = 'portion', ALL = 'all', diff --git a/src/component/Task/DataArchiveTask/DetailContent/index.tsx b/src/component/Task/DataArchiveTask/DetailContent/index.tsx index de1b48cf1..4467f94ff 100644 --- a/src/component/Task/DataArchiveTask/DetailContent/index.tsx +++ b/src/component/Task/DataArchiveTask/DetailContent/index.tsx @@ -14,25 +14,24 @@ * limitations under the License. */ +import { updateLimiterConfig } from '@/common/network/task'; import RiskLevelLabel from '@/component/RiskLevelLabel'; import { getTaskExecStrategyMap } from '@/component/Task'; -import { updateLimiterConfig } from '@/common/network/task'; import { SimpleTextItem } from '@/component/Task/component/SimpleTextItem'; import VariableConfigTable from '@/component/Task/component/VariableConfigTable'; import { isCycleTriggerStrategy } from '@/component/Task/helper'; -import setting from '@/store/setting'; import type { CycleTaskDetail, IDataArchiveJobParameters, TaskOperationType } from '@/d.ts'; import { TaskExecStrategy } from '@/d.ts'; +import setting from '@/store/setting'; import { formatMessage } from '@/util/intl'; -import { getFormatDateTime, kbToMb, mbToKb } from '@/util/utils'; +import { getFormatDateTime, getLocalFormatDateTime, kbToMb, mbToKb } from '@/util/utils'; import { DownOutlined, UpOutlined } from '@ant-design/icons'; -import { Collapse, Descriptions, Divider, Space, Typography, message } from 'antd'; +import { Collapse, Descriptions, Divider, message, Space, Typography } from 'antd'; import React from 'react'; +import ThrottleEditableCell from '../../component/ThrottleEditableCell'; import styles from '../../index.less'; import { InsertActionOptions } from '../CreateModal'; import ArchiveRange from './ArchiveRange'; -import ThrottleEditableCell from '../../component/ThrottleEditableCell'; -import { getLocalFormatDateTime } from '@/util/utils'; const { Text } = Typography; const { Panel } = Collapse; diff --git a/src/component/Task/DataClearTask/CreateModal/ArchiveRange.tsx b/src/component/Task/DataClearTask/CreateModal/ArchiveRange.tsx index e50f7e17a..e5eb0412c 100644 --- a/src/component/Task/DataClearTask/CreateModal/ArchiveRange.tsx +++ b/src/component/Task/DataClearTask/CreateModal/ArchiveRange.tsx @@ -19,8 +19,8 @@ import { formatMessage } from '@/util/intl'; import { DeleteOutlined, PlusOutlined } from '@ant-design/icons'; import { Button, Form, Input, Radio, Select, Space } from 'antd'; import classNames from 'classnames'; -import { IArchiveRange } from './index'; import ArchiveRangeTip from '../../component/ArchiveRangeTip'; +import { IArchiveRange } from './index'; import styles from './index.less'; interface IProps { tables: ITable[]; @@ -134,8 +134,7 @@ const ArchiveRange: React.FC = (props) => { diff --git a/src/component/Task/DataClearTask/CreateModal/VariableConfig.tsx b/src/component/Task/DataClearTask/CreateModal/VariableConfig.tsx index e8d5e8b9f..93a03d466 100644 --- a/src/component/Task/DataClearTask/CreateModal/VariableConfig.tsx +++ b/src/component/Task/DataClearTask/CreateModal/VariableConfig.tsx @@ -17,12 +17,12 @@ import HelpDoc from '@/component/helpDoc'; import { formatMessage } from '@/util/intl'; import { DeleteOutlined, MinusOutlined, PlusOutlined } from '@ant-design/icons'; -import { Button, Form, Input, InputNumber, Select, Space } from 'antd'; import type { FormInstance } from 'antd'; +import { Button, Form, Input, InputNumber, Select, Space } from 'antd'; import classNames from 'classnames'; +import { timeUnitOptions } from '../../DataArchiveTask/CreateModal/VariableConfig'; import { variable } from './index'; import styles from './index.less'; -import { timeUnitOptions } from '../../DataArchiveTask/CreateModal/VariableConfig'; const ENABLE_PATTERN_OPERATOR = false; const timeFormatOptions = ['yyyy-MM-dd', 'yyyyMMdd'].map((item) => ({ label: item, diff --git a/src/component/Task/DataClearTask/CreateModal/index.tsx b/src/component/Task/DataClearTask/CreateModal/index.tsx index 6a17c4d05..7d4921aac 100644 --- a/src/component/Task/DataClearTask/CreateModal/index.tsx +++ b/src/component/Task/DataClearTask/CreateModal/index.tsx @@ -17,11 +17,13 @@ import { getTableListByDatabaseName } from '@/common/network/table'; import { createTask, getCycleTaskDetail, previewSqlStatements } from '@/common/network/task'; import Crontab from '@/component/Crontab'; -import { CrontabDateType, ICrontab, CrontabMode } from '@/component/Crontab/interface'; +import { CrontabDateType, CrontabMode, ICrontab } from '@/component/Crontab/interface'; +import FormItemPanel from '@/component/FormItemPanel'; import DescriptionInput from '@/component/Task/component/DescriptionInput'; import { CreateTaskRecord, ICycleTaskTriggerConfig, + IDataClearJobParameters, ITable, TaskExecStrategy, TaskJobType, @@ -29,27 +31,25 @@ import { TaskPageScope, TaskPageType, TaskType, - IDataClearJobParameters, } from '@/d.ts'; import { openTasksPage } from '@/store/helper/page'; import type { ModalStore } from '@/store/modal'; import { useDBSession } from '@/store/sessionManager/hooks'; import { isClient } from '@/util/env'; import { formatMessage } from '@/util/intl'; -import { mbToKb, kbToMb } from '@/util/utils'; +import { kbToMb, mbToKb } from '@/util/utils'; import { FieldTimeOutlined } from '@ant-design/icons'; import { Button, DatePicker, Drawer, Form, Modal, Radio, Space } from 'antd'; import { inject, observer } from 'mobx-react'; -import React, { useEffect, useRef, useState } from 'react'; import moment from 'moment'; +import React, { useEffect, useRef, useState } from 'react'; import DatabaseSelect from '../../component/DatabaseSelect'; +import SQLPreviewModal from '../../component/SQLPreviewModal'; +import ThrottleFormItem from '../../component/ThrottleFormItem'; +import { getVariableValue } from '../../DataArchiveTask/CreateModal'; import ArchiveRange from './ArchiveRange'; import styles from './index.less'; import VariableConfig from './VariableConfig'; -import FormItemPanel from '@/component/FormItemPanel'; -import ThrottleFormItem from '../../component/ThrottleFormItem'; -import SQLPreviewModal from '../../component/SQLPreviewModal'; -import { getVariableValue } from '../../DataArchiveTask/CreateModal'; export enum IArchiveRange { PORTION = 'portion', ALL = 'all', diff --git a/src/component/Task/DataClearTask/DetailContent/index.tsx b/src/component/Task/DataClearTask/DetailContent/index.tsx index 6470a202a..78b09aba3 100644 --- a/src/component/Task/DataClearTask/DetailContent/index.tsx +++ b/src/component/Task/DataClearTask/DetailContent/index.tsx @@ -14,22 +14,22 @@ * limitations under the License. */ +import { updateLimiterConfig } from '@/common/network/task'; import RiskLevelLabel from '@/component/RiskLevelLabel'; import { getTaskExecStrategyMap } from '@/component/Task'; import { SimpleTextItem } from '@/component/Task/component/SimpleTextItem'; import VariableConfigTable from '@/component/Task/component/VariableConfigTable'; import { isCycleTriggerStrategy } from '@/component/Task/helper'; -import { updateLimiterConfig } from '@/common/network/task'; -import setting from '@/store/setting'; import type { CycleTaskDetail, IDataClearJobParameters, TaskOperationType } from '@/d.ts'; +import setting from '@/store/setting'; import { formatMessage } from '@/util/intl'; import { getFormatDateTime, kbToMb, mbToKb } from '@/util/utils'; import { DownOutlined, UpOutlined } from '@ant-design/icons'; -import { Collapse, Descriptions, Divider, Space, message, Typography } from 'antd'; +import { Collapse, Descriptions, Divider, message, Space, Typography } from 'antd'; import React from 'react'; +import ThrottleEditableCell from '../../component/ThrottleEditableCell'; import styles from '../../index.less'; import ArchiveRange from './ArchiveRange'; -import ThrottleEditableCell from '../../component/ThrottleEditableCell'; const { Panel } = Collapse; const { Text } = Typography; interface IProps { diff --git a/src/component/Task/DataMockerTask/CreateModal/index.tsx b/src/component/Task/DataMockerTask/CreateModal/index.tsx index ddcf7233f..ddc27638b 100644 --- a/src/component/Task/DataMockerTask/CreateModal/index.tsx +++ b/src/component/Task/DataMockerTask/CreateModal/index.tsx @@ -17,11 +17,11 @@ import { createTask } from '@/common/network/task'; import { ConnectionMode, + IServerMockTable, TaskExecStrategy, TaskPageScope, TaskPageType, TaskType, - IServerMockTable, } from '@/d.ts'; import { openTasksPage } from '@/store/helper/page'; import { ModalStore } from '@/store/modal'; @@ -30,7 +30,7 @@ import { Button, Drawer, message, Modal, Space } from 'antd'; import { DrawerProps } from 'antd/es/drawer'; import { FormInstance } from 'antd/es/form/Form'; import { inject, observer } from 'mobx-react'; -import React, { useCallback, useRef, useState, useEffect } from 'react'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; import DataMockerForm, { converFormToServerData } from './form'; import { IMockFormData } from './type'; diff --git a/src/component/Task/DataMockerTask/DetailContent/index.tsx b/src/component/Task/DataMockerTask/DetailContent/index.tsx index b88775450..f1f7e13bf 100644 --- a/src/component/Task/DataMockerTask/DetailContent/index.tsx +++ b/src/component/Task/DataMockerTask/DetailContent/index.tsx @@ -28,8 +28,8 @@ import { } from '@/d.ts'; import { formatMessage } from '@/util/intl'; import { getFormatDateTime } from '@/util/utils'; -import DatabaseLabel from '../../component/DatabaseLabel'; import Form from 'antd/lib/form/Form'; +import DatabaseLabel from '../../component/DatabaseLabel'; export function getItems(task: TaskDetail, result: ITaskResult, hasFlow: boolean) { if (!task) { return []; diff --git a/src/component/Task/DetailModal.tsx b/src/component/Task/DetailModal.tsx index 37c5494df..a8171c7d2 100644 --- a/src/component/Task/DetailModal.tsx +++ b/src/component/Task/DetailModal.tsx @@ -22,22 +22,22 @@ import { getTaskLog, getTaskResult, } from '@/common/network/task'; +import type { ITableLoadOptions } from '@/component/CommonTable/interface'; import CommonDetailModal from '@/component/Task/component/CommonDetailModal'; import DataTransferTaskContent from '@/component/Task/component/DataTransferModal'; import type { ILog } from '@/component/Task/component/Log'; -import type { ITableLoadOptions } from '@/component/CommonTable/interface'; import type { CycleTaskDetail, IAsyncTaskParams, ICycleSubTaskRecord, IDataArchiveJobParameters, IDataClearJobParameters, + IIPartitionPlanTaskDetail, IPartitionPlanParams, + IResponseData, ITaskResult, TaskDetail, TaskRecord, - IIPartitionPlanTaskDetail, - IResponseData, } from '@/d.ts'; import { CommonTaskLogType, @@ -49,6 +49,8 @@ import { } from '@/d.ts'; import React, { useEffect, useRef, useState } from 'react'; import { getItems as getDDLAlterItems } from './AlterDdlTask'; +import { ApplyDatabasePermissionTaskContent } from './ApplyDatabasePermission'; +import { ApplyPermissionTaskContent } from './ApplyPermission'; import { AsyncTaskContent } from './AsyncTask'; import TaskTools from './component/ActionBar'; import ApprovalModal from './component/ApprovalModal'; @@ -61,8 +63,6 @@ import { PartitionTaskContent } from './PartitionTask'; import { getItems as getResultSetExportTaskContentItems } from './ResultSetExportTask/DetailContent'; import { getItems as getShadowSyncItems } from './ShadowSyncTask'; import { SqlPlanTaskContent } from './SQLPlanTask'; -import { ApplyPermissionTaskContent } from './ApplyPermission'; -import { ApplyDatabasePermissionTaskContent } from './ApplyDatabasePermission'; import { StructureComparisonTaskContent } from './StructureComparisonTask'; interface IProps { diff --git a/src/component/Task/ExportTask/CreateModal/ExportForm/ConfigPanel/index.tsx b/src/component/Task/ExportTask/CreateModal/ExportForm/ConfigPanel/index.tsx index 73cd47d88..cf98c853c 100644 --- a/src/component/Task/ExportTask/CreateModal/ExportForm/ConfigPanel/index.tsx +++ b/src/component/Task/ExportTask/CreateModal/ExportForm/ConfigPanel/index.tsx @@ -14,19 +14,19 @@ * limitations under the License. */ +import { getDataSourceModeConfig } from '@/common/datasource'; import FormItemPanel from '@/component/FormItemPanel'; import HelpDoc from '@/component/helpDoc'; import SysFormItem from '@/component/SysFormItem'; import DescriptionInput from '@/component/Task/component/DescriptionInput'; import TaskTimer from '@/component/Task/component/TimerSelect'; +import { ENABLED_SYS_FROM_ITEM } from '@/component/Task/helper'; import { EXPORT_CONTENT, EXPORT_TYPE, IConnection, IMPORT_ENCODING } from '@/d.ts'; import odc from '@/plugins/odc'; import { formatMessage } from '@/util/intl'; import { AutoComplete, Checkbox, Col, Form, FormInstance, InputNumber, Row, Select } from 'antd'; import React, { useContext } from 'react'; import FormContext from '../FormContext'; -import { getDataSourceModeConfig } from '@/common/datasource'; -import { ENABLED_SYS_FROM_ITEM } from '@/component/Task/helper'; const FormItem = Form.Item; const Option = Select.Option; diff --git a/src/component/Task/ExportTask/CreateModal/ExportForm/ExportSelecter/index.tsx b/src/component/Task/ExportTask/CreateModal/ExportForm/ExportSelecter/index.tsx index a0cdc0f47..ad2b39fb4 100644 --- a/src/component/Task/ExportTask/CreateModal/ExportForm/ExportSelecter/index.tsx +++ b/src/component/Task/ExportTask/CreateModal/ExportForm/ExportSelecter/index.tsx @@ -16,7 +16,7 @@ import { getExportObjects } from '@/common/network'; import ExportCard from '@/component/ExportCard'; -import { DbObjectType, ConnectionMode } from '@/d.ts'; +import { ConnectionMode, DbObjectType } from '@/d.ts'; import { formatMessage } from '@/util/intl'; import Icon, { DeleteOutlined } from '@ant-design/icons'; import { Empty, Popconfirm, Spin, Tree } from 'antd'; @@ -238,8 +238,9 @@ const ExportSelecter: React.FC = function ({ const allTreeDataCount = Object.entries(allTreeData).reduce((prev, current) => { return prev + current?.[1]?.children.length; }, 0); - const selectedTreeDataCount = checkedKeys.filter((key) => !getObjTypeList().includes(key)) - ?.length; + const selectedTreeDataCount = checkedKeys.filter( + (key) => !getObjTypeList().includes(key), + )?.length; return (
@@ -333,8 +334,9 @@ const ExportSelecter: React.FC = function ({ /** * 说明这里删除的是根节点 */ - const typeList = selectedTreeData.find((d) => d.key === nodeKey) - ?.children; + const typeList = selectedTreeData.find( + (d) => d.key === nodeKey, + )?.children; const filterAllkeys = typeList?.map((item) => item.key); setCheckedKeys( checkedKeys.filter((key) => !filterAllkeys?.includes(key)), diff --git a/src/component/Task/ExportTask/CreateModal/ExportForm/ObjSelecterPanel/index.tsx b/src/component/Task/ExportTask/CreateModal/ExportForm/ObjSelecterPanel/index.tsx index 6079b3b1d..75c055b9b 100644 --- a/src/component/Task/ExportTask/CreateModal/ExportForm/ObjSelecterPanel/index.tsx +++ b/src/component/Task/ExportTask/CreateModal/ExportForm/ObjSelecterPanel/index.tsx @@ -14,17 +14,14 @@ * limitations under the License. */ -import { EXPORT_CONTENT, IConnection, TaskType } from '@/d.ts'; -import { useDBSession } from '@/store/sessionManager/hooks'; +import { EXPORT_CONTENT, TaskType } from '@/d.ts'; +import { IDatabase } from '@/d.ts/database'; import { formatMessage } from '@/util/intl'; import { Form, Radio } from 'antd'; import { FormInstance } from 'antd/es/form'; -import React, { useEffect } from 'react'; +import React from 'react'; import DatabaseSelect from '../../../../component/DatabaseSelect'; import ExportSelecter from '../ExportSelecter'; -import { useRequest } from 'ahooks'; -import { getDatabase } from '@/common/network/database'; -import { IDatabase } from '@/d.ts/database'; const FormItem = Form.Item; @@ -39,7 +36,6 @@ const ObjSelecterPanel: React.FC = function ({ form, projectId, database const databaseId = database?.id; const connectionId = connection?.id; - const handleChange = () => { form.setFieldsValue({ exportDbObjects: [], diff --git a/src/component/Task/ExportTask/CreateModal/ExportForm/index.tsx b/src/component/Task/ExportTask/CreateModal/ExportForm/index.tsx index 065f41deb..1d6c1efac 100644 --- a/src/component/Task/ExportTask/CreateModal/ExportForm/index.tsx +++ b/src/component/Task/ExportTask/CreateModal/ExportForm/index.tsx @@ -16,20 +16,20 @@ import { isReadonlyPublicConnection } from '@/component/Acess'; import { formatMessage } from '@/util/intl'; -import React, { forwardRef, useEffect, useImperativeHandle, useState } from 'react'; +import React, { forwardRef, useEffect, useImperativeHandle } from 'react'; -import { ExportFormData, IConnection } from '@/d.ts'; +import { ExportFormData } from '@/d.ts'; // compatible import { Form, message } from 'antd'; import { inject, observer } from 'mobx-react'; import { ModalStore } from '@/store/modal'; +import { getDatabase } from '@/common/network/database'; +import { useRequest } from 'ahooks'; import { useForm } from 'antd/es/form/Form'; import ConfigPanel from './ConfigPanel'; import ObjSelecterPanel from './ObjSelecterPanel'; -import { useRequest } from 'ahooks'; -import { getDatabase } from '@/common/network/database'; export enum FormType { ObjSelecter, diff --git a/src/component/Task/ExportTask/CreateModal/index.tsx b/src/component/Task/ExportTask/CreateModal/index.tsx index 1f80ea4e9..b3e2e8437 100644 --- a/src/component/Task/ExportTask/CreateModal/index.tsx +++ b/src/component/Task/ExportTask/CreateModal/index.tsx @@ -39,7 +39,6 @@ import React from 'react'; import ExportForm, { FormType } from './ExportForm'; import FormContext from './ExportForm/FormContext'; import styles from './index.less'; -import { getDataSourceModeConfig } from '@/common/datasource'; export interface IProps { modalStore?: ModalStore; projectId?: number; diff --git a/src/component/Task/ImportTask/CreateModal/ImportForm/ConfigPanel/index.tsx b/src/component/Task/ImportTask/CreateModal/ImportForm/ConfigPanel/index.tsx index 609dc5937..b6362b045 100644 --- a/src/component/Task/ImportTask/CreateModal/ImportForm/ConfigPanel/index.tsx +++ b/src/component/Task/ImportTask/CreateModal/ImportForm/ConfigPanel/index.tsx @@ -14,12 +14,14 @@ * limitations under the License. */ +import { getDataSourceModeConfig } from '@/common/datasource'; import { getTableListByDatabaseName } from '@/common/network/table'; import { isReadonlyPublicConnection } from '@/component/Acess'; import FormItemPanel from '@/component/FormItemPanel'; import SysFormItem from '@/component/SysFormItem'; import DescriptionInput from '@/component/Task/component/DescriptionInput'; import TaskTimer from '@/component/Task/component/TimerSelect'; +import { ENABLED_SYS_FROM_ITEM } from '@/component/Task/helper'; import { ConnectionMode, EXPORT_CONTENT, IMPORT_TYPE, TaskType } from '@/d.ts'; import odc from '@/plugins/odc'; import { useDBSession } from '@/store/sessionManager/hooks'; @@ -30,8 +32,6 @@ import DatabaseSelect from '../../../../component/DatabaseSelect'; import CsvMapping from '../../csvMapping'; import CsvProvider from '../CsvProvider'; import StructDataFormItem from '../formitem/StructDataFormItem'; -import { getDataSourceModeConfig } from '@/common/datasource'; -import { ENABLED_SYS_FROM_ITEM } from '@/component/Task/helper'; const FormItem = Form.Item; diff --git a/src/component/Task/ImportTask/CreateModal/ImportForm/FileSelecterPanel/index.tsx b/src/component/Task/ImportTask/CreateModal/ImportForm/FileSelecterPanel/index.tsx index 59cfa1e18..b045122f9 100644 --- a/src/component/Task/ImportTask/CreateModal/ImportForm/FileSelecterPanel/index.tsx +++ b/src/component/Task/ImportTask/CreateModal/ImportForm/FileSelecterPanel/index.tsx @@ -298,9 +298,9 @@ const FileSelecterPanel: React.FC = function ({ isSingleImport, form }) {({ getFieldValue }) => { - const importObjects = (getFieldValue( - 'importFileName', - ) as ImportFormData['importFileName'])?.[0]?.response?.data?.importObjects; + const importObjects = ( + getFieldValue('importFileName') as ImportFormData['importFileName'] + )?.[0]?.response?.data?.importObjects; if (importObjects) { const data = Object.entries(importObjects).map(([dataType, list]) => { const ObjIcon = DbObjsIcon[dataType]; diff --git a/src/component/Task/ImportTask/CreateModal/ImportForm/formitem/StructDataFormItem.tsx b/src/component/Task/ImportTask/CreateModal/ImportForm/formitem/StructDataFormItem.tsx index 2021becef..be0c879de 100644 --- a/src/component/Task/ImportTask/CreateModal/ImportForm/formitem/StructDataFormItem.tsx +++ b/src/component/Task/ImportTask/CreateModal/ImportForm/formitem/StructDataFormItem.tsx @@ -133,8 +133,7 @@ const StructDataFormItem: React.FC = function (props) { { formatMessage({ - id: - 'odc.ImportForm.formitem.StructDataFormItem.ImportStructureSettingsWhenThe', + id: 'odc.ImportForm.formitem.StructDataFormItem.ImportStructureSettingsWhenThe', }) /* 导入结构设置:结构已存在时 */ } diff --git a/src/component/Task/ImportTask/CreateModal/ImportForm/index.tsx b/src/component/Task/ImportTask/CreateModal/ImportForm/index.tsx index ec34c9144..6f469eeb6 100644 --- a/src/component/Task/ImportTask/CreateModal/ImportForm/index.tsx +++ b/src/component/Task/ImportTask/CreateModal/ImportForm/index.tsx @@ -49,14 +49,8 @@ interface IImportFormProps { const ImportForm: React.FC = inject('modalStore')( observer( forwardRef(function (props, ref) { - const { - modalStore, - formData, - formType, - projectId, - onFormValueChange, - onSessionChange, - } = props; + const { modalStore, formData, formType, projectId, onFormValueChange, onSessionChange } = + props; const [form] = useForm(); const formConfigContext = useContext(FormConfigContext); const isSingleImport = !!modalStore.importModalData; diff --git a/src/component/Task/PartitionTask/CreateModal/index.tsx b/src/component/Task/PartitionTask/CreateModal/index.tsx index 357bfcd30..ba97f5b0e 100644 --- a/src/component/Task/PartitionTask/CreateModal/index.tsx +++ b/src/component/Task/PartitionTask/CreateModal/index.tsx @@ -15,48 +15,48 @@ */ import { createTask, getPartitionPlanTables } from '@/common/network/task'; +import Crontab from '@/component/Crontab'; +import { CrontabDateType, ICrontab } from '@/component/Crontab/interface'; +import FormItemPanel from '@/component/FormItemPanel'; import { - TaskPageScope, - TaskPageType, - TaskType, - TaskExecStrategy, + IPartitionPlanKeyType, + IPartitionTableConfig, PARTITION_KEY_INVOKER, PARTITION_NAME_INVOKER, - TaskPartitionStrategy, TaskErrorStrategy, - IPartitionPlanKeyType, - IPartitionTableConfig, + TaskExecStrategy, + TaskPageScope, + TaskPageType, + TaskPartitionStrategy, + TaskType, } from '@/d.ts'; import { openTasksPage } from '@/store/helper/page'; import { ModalStore } from '@/store/modal'; import { useDBSession } from '@/store/sessionManager/hooks'; import { formatMessage } from '@/util/intl'; import { hourToMilliSeconds } from '@/util/utils'; -import FormItemPanel from '@/component/FormItemPanel'; import { + Alert, Button, + Checkbox, + Divider, Drawer, Form, Input, + InputNumber, Modal, + Radio, Space, Tooltip, - Checkbox, Typography, - Radio, - InputNumber, - Alert, - Divider, } from 'antd'; -import moment from 'moment'; import { DrawerProps } from 'antd/es/drawer'; import { inject, observer } from 'mobx-react'; -import React, { useCallback, useEffect, useState, useRef } from 'react'; +import moment from 'moment'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import DatabaseSelect from '../../component/DatabaseSelect'; import PartitionPolicyFormTable from '../../component/PartitionPolicyFormTable'; import { START_DATE } from '../../component/PartitionPolicyFormTable/const'; -import DatabaseSelect from '../../component/DatabaseSelect'; -import Crontab from '@/component/Crontab'; -import { CrontabDateType, ICrontab } from '@/component/Crontab/interface'; import styles from './index.less'; const { Paragraph, Text } = Typography; diff --git a/src/component/Task/PartitionTask/DetailContent/CycleDescriptionItem.tsx b/src/component/Task/PartitionTask/DetailContent/CycleDescriptionItem.tsx index 98c9ec142..5168f1779 100644 --- a/src/component/Task/PartitionTask/DetailContent/CycleDescriptionItem.tsx +++ b/src/component/Task/PartitionTask/DetailContent/CycleDescriptionItem.tsx @@ -19,9 +19,9 @@ import { SimpleTextItem } from '@/component/Task/component/SimpleTextItem'; import { getCronCycle } from '@/component/Task/component/TaskTable'; import type { ICycleTaskTriggerConfig } from '@/d.ts'; import { getFormatDateTime } from '@/util/utils'; +import { DownOutlined, UpOutlined } from '@ant-design/icons'; import { Collapse, Descriptions, Space } from 'antd'; import React from 'react'; -import { DownOutlined, UpOutlined } from '@ant-design/icons'; import styles from './index.less'; const { Panel } = Collapse; diff --git a/src/component/Task/PartitionTask/DetailContent/index.tsx b/src/component/Task/PartitionTask/DetailContent/index.tsx index ee5811831..7181f4d90 100644 --- a/src/component/Task/PartitionTask/DetailContent/index.tsx +++ b/src/component/Task/PartitionTask/DetailContent/index.tsx @@ -16,14 +16,14 @@ import { formatMessage } from '@/util/intl'; */ import RiskLevelLabel from '@/component/RiskLevelLabel'; -import type { IPartitionPlanParams, ITaskResult, IIPartitionPlanTaskDetail } from '@/d.ts'; +import type { IIPartitionPlanTaskDetail, IPartitionPlanParams, ITaskResult } from '@/d.ts'; +import { getFormatDateTime, milliSecondsToHour } from '@/util/utils'; +import { Descriptions, Divider, Typography } from 'antd'; +import React from 'react'; +import DatabaseLabel from '../../component/DatabaseLabel'; import PartitionPolicyTable from '../../component/PartitionPolicyTable'; import { ErrorStrategyMap } from '../../const'; -import { getFormatDateTime, milliSecondsToHour } from '@/util/utils'; import CycleDescriptionItem from './CycleDescriptionItem'; -import { Divider, Descriptions, Typography } from 'antd'; -import DatabaseLabel from '../../component/DatabaseLabel'; -import React from 'react'; const { Text } = Typography; diff --git a/src/component/Task/ResultSetExportTask/CreateModal/CsvFormItemPanel.tsx b/src/component/Task/ResultSetExportTask/CreateModal/CsvFormItemPanel.tsx index 9eb82db48..a8ba53a23 100644 --- a/src/component/Task/ResultSetExportTask/CreateModal/CsvFormItemPanel.tsx +++ b/src/component/Task/ResultSetExportTask/CreateModal/CsvFormItemPanel.tsx @@ -69,8 +69,7 @@ export const CsvFormItemPanel: React.FC = (props) => { { formatMessage({ - id: - 'odc.src.component.Task.ResultSetExportTask.CreateModal.EmptyStringTurnsToEmpty', + id: 'odc.src.component.Task.ResultSetExportTask.CreateModal.EmptyStringTurnsToEmpty', }) /* 空字符串转为空值 */ } @@ -84,8 +83,7 @@ export const CsvFormItemPanel: React.FC = (props) => { }} label={ formatMessage({ - id: - 'odc.src.component.Task.ResultSetExportTask.CreateModal.FieldSeparator', + id: 'odc.src.component.Task.ResultSetExportTask.CreateModal.FieldSeparator', }) /* 字段分隔符 */ } name={['csvFormat', 'columnSeparator']} @@ -93,15 +91,13 @@ export const CsvFormItemPanel: React.FC = (props) => { { required: true, message: formatMessage({ - id: - 'odc.src.component.Task.ResultSetExportTask.CreateModal.PleaseFillInTheField', + id: 'odc.src.component.Task.ResultSetExportTask.CreateModal.PleaseFillInTheField', }), //'请填写字段分隔符' }, { max: 1, message: formatMessage({ - id: - 'odc.src.component.Task.ResultSetExportTask.CreateModal.YouCanOnlyEnterOne', + id: 'odc.src.component.Task.ResultSetExportTask.CreateModal.YouCanOnlyEnterOne', }), //'只能输入一个字符' }, ]} @@ -122,8 +118,7 @@ export const CsvFormItemPanel: React.FC = (props) => { }} label={ formatMessage({ - id: - 'odc.src.component.Task.ResultSetExportTask.CreateModal.TextRecognitionSymbol', + id: 'odc.src.component.Task.ResultSetExportTask.CreateModal.TextRecognitionSymbol', }) /* 文本识别符 */ } name={['csvFormat', 'columnDelimiter']} @@ -131,8 +126,7 @@ export const CsvFormItemPanel: React.FC = (props) => { { required: true, message: formatMessage({ - id: - 'odc.src.component.Task.ResultSetExportTask.CreateModal.PleaseFillInTheText', + id: 'odc.src.component.Task.ResultSetExportTask.CreateModal.PleaseFillInTheText', }), //'请填写文本识别符' }, ]} @@ -154,8 +148,7 @@ export const CsvFormItemPanel: React.FC = (props) => { }} label={ formatMessage({ - id: - 'odc.src.component.Task.ResultSetExportTask.CreateModal.ReplacementSymbol', + id: 'odc.src.component.Task.ResultSetExportTask.CreateModal.ReplacementSymbol', }) /* 换行符号 */ } name={['csvFormat', 'lineSeparator']} @@ -163,8 +156,7 @@ export const CsvFormItemPanel: React.FC = (props) => { { required: true, message: formatMessage({ - id: - 'odc.src.component.Task.ResultSetExportTask.CreateModal.PleaseFillInTheChange', + id: 'odc.src.component.Task.ResultSetExportTask.CreateModal.PleaseFillInTheChange', }), //'请填写换行符号' }, ]} @@ -209,8 +201,7 @@ export const CsvFormItemPanel: React.FC = (props) => { { formatMessage({ - id: - 'odc.src.component.Task.ResultSetExportTask.CreateModal.SpecifiedTableName', + id: 'odc.src.component.Task.ResultSetExportTask.CreateModal.SpecifiedTableName', }) /* 指定表名 */ @@ -269,8 +260,7 @@ export const CsvFormItemPanel: React.FC = (props) => { { formatMessage({ - id: - 'odc.src.component.Task.ResultSetExportTask.CreateModal.ExportSQLToAnotherSheet', + id: 'odc.src.component.Task.ResultSetExportTask.CreateModal.ExportSQLToAnotherSheet', }) /* 导出 SQL 到另一个 Sheet */ } diff --git a/src/component/Task/ResultSetExportTask/CreateModal/index.tsx b/src/component/Task/ResultSetExportTask/CreateModal/index.tsx index 673f85645..120381e2a 100644 --- a/src/component/Task/ResultSetExportTask/CreateModal/index.tsx +++ b/src/component/Task/ResultSetExportTask/CreateModal/index.tsx @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { getDataSourceModeConfig } from '@/common/datasource'; import { createTask } from '@/common/network/task'; import CommonIDE from '@/component/CommonIDE'; import FormItemPanel from '@/component/FormItemPanel'; @@ -20,7 +21,6 @@ import InputBigNumber from '@/component/InputBigNumber'; import DescriptionInput from '@/component/Task/component/DescriptionInput'; import TaskTimer from '@/component/Task/component/TimerSelect'; import { - ConnectionMode, EXPORT_TYPE, IExportResultSetFileType, IMPORT_ENCODING, @@ -41,7 +41,6 @@ import React, { useEffect, useState } from 'react'; import DatabaseSelect from '../../component/DatabaseSelect'; import { CsvFormItemPanel } from './CsvFormItemPanel'; import styles from './index.less'; -import { getDataSourceModeConfig } from '@/common/datasource'; const { Text } = Typography; const { Option } = Select; interface IProps { @@ -232,8 +231,7 @@ const CreateModal: React.FC = (props) => { { formatMessage({ - id: - 'odc.src.component.Task.ResultSetExportTask.CreateModal.OnlySupportInputSingleSQL', + id: 'odc.src.component.Task.ResultSetExportTask.CreateModal.OnlySupportInputSingleSQL', }) /* 仅支持输入单条 SQL */ } diff --git a/src/component/Task/ResultSetExportTask/DetailContent/index.tsx b/src/component/Task/ResultSetExportTask/DetailContent/index.tsx index 70d22494e..b18ccd284 100644 --- a/src/component/Task/ResultSetExportTask/DetailContent/index.tsx +++ b/src/component/Task/ResultSetExportTask/DetailContent/index.tsx @@ -15,16 +15,16 @@ import { formatMessage } from '@/util/intl'; * limitations under the License. */ +import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; import RiskLevelLabel from '@/component/RiskLevelLabel'; import { SQLContent } from '@/component/SQLContent'; import { getTaskExecStrategyMap } from '@/component/Task'; -import DatabaseLabel from '../../component/DatabaseLabel'; import type { IResultSetExportTaskParams, ITaskResult, TaskDetail } from '@/d.ts'; -import { ConnectionMode, IExportResultSetFileType, TaskExecStrategy } from '@/d.ts'; +import { IExportResultSetFileType, TaskExecStrategy } from '@/d.ts'; import { getFormatDateTime } from '@/util/utils'; import { Divider } from 'antd'; +import DatabaseLabel from '../../component/DatabaseLabel'; import { SimpleTextItem } from '../../component/SimpleTextItem'; -import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; export const getItems = ( _task: TaskDetail, result: ITaskResult, diff --git a/src/component/Task/SQLPlanTask/CreateModal/index.tsx b/src/component/Task/SQLPlanTask/CreateModal/index.tsx index dbc4b87c7..91f766149 100644 --- a/src/component/Task/SQLPlanTask/CreateModal/index.tsx +++ b/src/component/Task/SQLPlanTask/CreateModal/index.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import { getDataSourceModeConfig } from '@/common/datasource'; import { createTask, getAsyncTaskUploadUrl, getCycleTaskDetail } from '@/common/network/task'; import CommonIDE from '@/component/CommonIDE'; import Crontab from '@/component/Crontab'; @@ -22,7 +23,6 @@ import FormItemPanel from '@/component/FormItemPanel'; import ODCDragger from '@/component/OSSDragger2'; import DescriptionInput from '@/component/Task/component/DescriptionInput'; import { - ConnectionMode, CreateTaskRecord, ISqlPlayJobParameters, SQLContentType, @@ -56,7 +56,6 @@ import { inject, observer } from 'mobx-react'; import React, { useEffect, useRef, useState } from 'react'; import DatabaseSelect from '../../component/DatabaseSelect'; import styles from './index.less'; -import { getDataSourceModeConfig } from '@/common/datasource'; const MAX_FILE_SIZE = 1024 * 1024 * 256; interface IProps { diff --git a/src/component/Task/SQLPlanTask/DetailContent/index.tsx b/src/component/Task/SQLPlanTask/DetailContent/index.tsx index ad68cf3dd..1947865fc 100644 --- a/src/component/Task/SQLPlanTask/DetailContent/index.tsx +++ b/src/component/Task/SQLPlanTask/DetailContent/index.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; import RiskLevelLabel from '@/component/RiskLevelLabel'; import { SQLContent } from '@/component/SQLContent'; import { operationTypeMap } from '@/component/Task/component/CommonDetailModal/TaskOperationRecord'; @@ -27,7 +28,6 @@ import { Collapse, Descriptions, Divider, Space } from 'antd'; import React from 'react'; import { getCronCycle } from '../../component/TaskTable'; import styles from '../../index.less'; -import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; const { Panel } = Collapse; const ErrorStrategy = { diff --git a/src/component/Task/ShadowSyncTask/CreateModal/SelectPanel/index.tsx b/src/component/Task/ShadowSyncTask/CreateModal/SelectPanel/index.tsx index d7b0065dc..d1d8c9cd6 100644 --- a/src/component/Task/ShadowSyncTask/CreateModal/SelectPanel/index.tsx +++ b/src/component/Task/ShadowSyncTask/CreateModal/SelectPanel/index.tsx @@ -17,10 +17,10 @@ import { getTableListByDatabaseName } from '@/common/network/table'; import { getShadowSyncAnalysisResult, startShadowSyncAnalysis } from '@/common/network/task'; import ExportCard from '@/component/ExportCard'; -import { ModalStore } from '@/store/modal'; import HelpDoc from '@/component/helpDoc'; import { DbObjsIcon } from '@/constant'; import { TaskType } from '@/d.ts'; +import { ModalStore } from '@/store/modal'; import { formatMessage } from '@/util/intl'; import Icon, { DeleteOutlined } from '@ant-design/icons'; import { useUnmountedRef } from 'ahooks'; diff --git a/src/component/Task/ShadowSyncTask/CreateModal/StructConfigPanel/RecordSQLView/index.tsx b/src/component/Task/ShadowSyncTask/CreateModal/StructConfigPanel/RecordSQLView/index.tsx index 7d31ea57c..f294f7e1f 100644 --- a/src/component/Task/ShadowSyncTask/CreateModal/StructConfigPanel/RecordSQLView/index.tsx +++ b/src/component/Task/ShadowSyncTask/CreateModal/StructConfigPanel/RecordSQLView/index.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; import { getShadowSyncAnalysisRecordResult } from '@/common/network/task'; import MonacoEditor from '@/component/MonacoEditor'; import SimpleTextItem from '@/component/SimpleTextItem'; @@ -23,7 +24,6 @@ import { useRequest } from 'ahooks'; import { Drawer, Row, Space, Spin } from 'antd'; import { forwardRef, useImperativeHandle, useState } from 'react'; import { IShadowSyncAnalysisResult } from '../../interface'; -import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; export interface IViewRef { open: (record: IShadowSyncAnalysisResult['tables'][number]) => void; diff --git a/src/component/Task/ShadowSyncTask/CreateModal/StructConfigPanel/StructAnalysisResult/index.tsx b/src/component/Task/ShadowSyncTask/CreateModal/StructConfigPanel/StructAnalysisResult/index.tsx index a6ce8d1b0..052d93f02 100644 --- a/src/component/Task/ShadowSyncTask/CreateModal/StructConfigPanel/StructAnalysisResult/index.tsx +++ b/src/component/Task/ShadowSyncTask/CreateModal/StructConfigPanel/StructAnalysisResult/index.tsx @@ -14,6 +14,7 @@ * limitations under the License. */ +import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; import CommonTable from '@/component/CommonTable'; import { CommonTableMode } from '@/component/CommonTable/interface'; import MonacoEditor from '@/component/MonacoEditor'; @@ -24,7 +25,6 @@ import { useMemo, useRef, useState } from 'react'; import { IShadowSyncAnalysisResult, ShadowTableSyncTaskResult } from '../../interface'; import RecordSQLView, { IViewRef } from '../RecordSQLView'; import { useColumns } from './column'; -import { getDataSourceModeConfigByConnectionMode } from '@/common/datasource'; enum TabKeys { SYNC = 'sync', diff --git a/src/component/Task/ShadowSyncTask/CreateModal/index.tsx b/src/component/Task/ShadowSyncTask/CreateModal/index.tsx index 52086e8d6..f3841ebdc 100644 --- a/src/component/Task/ShadowSyncTask/CreateModal/index.tsx +++ b/src/component/Task/ShadowSyncTask/CreateModal/index.tsx @@ -26,7 +26,7 @@ import SelectPanel from './SelectPanel'; import StructConfigPanel from './StructConfigPanel'; import { createTask } from '@/common/network/task'; -import { ConnectionMode, TaskExecStrategy, TaskPageScope, TaskPageType, TaskType } from '@/d.ts'; +import { TaskExecStrategy, TaskPageScope, TaskPageType, TaskType } from '@/d.ts'; import { openTasksPage } from '@/store/helper/page'; import styles from './index.less'; diff --git a/src/component/Task/ShadowSyncTask/DetailContent/index.tsx b/src/component/Task/ShadowSyncTask/DetailContent/index.tsx index 3c8271125..d2f127281 100644 --- a/src/component/Task/ShadowSyncTask/DetailContent/index.tsx +++ b/src/component/Task/ShadowSyncTask/DetailContent/index.tsx @@ -22,13 +22,13 @@ import { ShadowTableSyncTaskResult, } from '@/component/Task/ShadowSyncTask/CreateModal/interface'; import StructAnalysisResult from '@/component/Task/ShadowSyncTask/CreateModal/StructConfigPanel/StructAnalysisResult'; -import DatabaseLabel from '../../component/DatabaseLabel'; import { ConnectionMode, TaskDetail, TaskExecStrategy } from '@/d.ts'; import { formatMessage } from '@/util/intl'; import { getFormatDateTime } from '@/util/utils'; import { Spin } from 'antd'; import { useEffect, useState } from 'react'; import { getTaskExecStrategyMap } from '../..'; +import DatabaseLabel from '../../component/DatabaseLabel'; interface IShadowSyncParamters { errorStrategy: ErrorStrategy; connectionId: string; diff --git a/src/component/Task/StructureComparisonTask/CreateModal/TableSelector.tsx b/src/component/Task/StructureComparisonTask/CreateModal/TableSelector.tsx index 7e10f1798..c0b280e50 100644 --- a/src/component/Task/StructureComparisonTask/CreateModal/TableSelector.tsx +++ b/src/component/Task/StructureComparisonTask/CreateModal/TableSelector.tsx @@ -14,17 +14,17 @@ * limitations under the License. */ -import { formatMessage } from '@/util/intl'; -import { Popconfirm, Spin, Tree } from 'antd'; -import React, { useEffect, useState } from 'react'; -import styles from './index.less'; +import { getTableListByDatabaseName } from '@/common/network/table'; import ExportCard from '@/component/ExportCard'; -import Icon, { DeleteOutlined } from '@ant-design/icons'; import { DbObjsIcon } from '@/constant'; import { DbObjectType } from '@/d.ts'; -import classNames from 'classnames'; -import { getTableListByDatabaseName } from '@/common/network/table'; import { useDBSession } from '@/store/sessionManager/hooks'; +import { formatMessage } from '@/util/intl'; +import Icon, { DeleteOutlined } from '@ant-design/icons'; +import { Popconfirm, Spin, Tree } from 'antd'; +import classNames from 'classnames'; +import React, { useEffect, useState } from 'react'; +import styles from './index.less'; const TableSelector: React.FC<{ databaseId?: number; diff --git a/src/component/Task/StructureComparisonTask/CreateModal/index.less b/src/component/Task/StructureComparisonTask/CreateModal/index.less index 2361a95c2..d78ea7451 100644 --- a/src/component/Task/StructureComparisonTask/CreateModal/index.less +++ b/src/component/Task/StructureComparisonTask/CreateModal/index.less @@ -2,8 +2,8 @@ margin-top: 24px; .label { - color: var(--text-color-primary); margin-bottom: 4px; + color: var(--text-color-primary); } } @@ -14,9 +14,9 @@ .content { flex: 1 1 50%; + width: 50%; height: 400px; overflow-y: auto; - width: 50%; border: 1px solid var(--odc-border-color); border-right: 0; @@ -43,8 +43,8 @@ .centerContainer { display: flex; - justify-content: center; align-items: center; + justify-content: center; height: 100%; } } diff --git a/src/component/Task/StructureComparisonTask/CreateModal/index.tsx b/src/component/Task/StructureComparisonTask/CreateModal/index.tsx index 99c0098c0..0e404a6a1 100644 --- a/src/component/Task/StructureComparisonTask/CreateModal/index.tsx +++ b/src/component/Task/StructureComparisonTask/CreateModal/index.tsx @@ -14,13 +14,9 @@ * limitations under the License. */ -import { formatMessage } from '@/util/intl'; -import { Button, Drawer, Form, Input, Modal, Radio, Space, message } from 'antd'; -import { useForm } from 'antd/lib/form/Form'; -import React, { useEffect, useState } from 'react'; +import { getDatabase } from '@/common/network/database'; +import { createStructureComparisonTask } from '@/common/network/task'; import FormItemPanel from '@/component/FormItemPanel'; -import { ModalStore } from '@/store/modal'; -import { inject, observer } from 'mobx-react'; import { ConnectionMode, CreateStructureComparisonTaskRecord, @@ -28,15 +24,19 @@ import { TaskPageType, TaskType, } from '@/d.ts'; -import { comparisonScopeMap } from './interface'; -import DatabaseSelect from '../../component/DatabaseSelect'; -import { createStructureComparisonTask } from '@/common/network/task'; -import TableSelector from './TableSelector'; +import { EComparisonScope } from '@/d.ts/task'; import { openTasksPage } from '@/store/helper/page/openPage'; -import { getDatabase } from '@/common/network/database'; +import { ModalStore } from '@/store/modal'; +import { formatMessage } from '@/util/intl'; import { useRequest } from 'ahooks'; -import { EComparisonScope } from '@/d.ts/task'; +import { Button, Drawer, Form, Input, message, Modal, Radio, Space } from 'antd'; +import { useForm } from 'antd/lib/form/Form'; +import { inject, observer } from 'mobx-react'; +import React, { useEffect, useState } from 'react'; import { getTaskExecStrategyMap } from '../..'; +import DatabaseSelect from '../../component/DatabaseSelect'; +import { comparisonScopeMap } from './interface'; +import TableSelector from './TableSelector'; interface IProps { projectId?: number; modalStore?: ModalStore; diff --git a/src/component/Task/StructureComparisonTask/CreateModal/interface.ts b/src/component/Task/StructureComparisonTask/CreateModal/interface.ts index f2c1fd8af..e6dfbce45 100644 --- a/src/component/Task/StructureComparisonTask/CreateModal/interface.ts +++ b/src/component/Task/StructureComparisonTask/CreateModal/interface.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { formatMessage } from '@/util/intl'; import { EComparisonScope, EOperationType } from '@/d.ts/task'; +import { formatMessage } from '@/util/intl'; export const comparisonScopeMap = { [EComparisonScope.ALL]: formatMessage({ id: 'src.component.Task.StructureComparisonTask.CreateModal.9C98407E', diff --git a/src/component/Task/StructureComparisonTask/DetailContent/index.less b/src/component/Task/StructureComparisonTask/DetailContent/index.less index d8cb53aa2..5f040989d 100644 --- a/src/component/Task/StructureComparisonTask/DetailContent/index.less +++ b/src/component/Task/StructureComparisonTask/DetailContent/index.less @@ -43,8 +43,8 @@ } .tip { - color: var(--text-color-placeholder); margin-top: 8px; + color: var(--text-color-placeholder); } .descriptionItem { diff --git a/src/component/Task/StructureComparisonTask/DetailContent/index.tsx b/src/component/Task/StructureComparisonTask/DetailContent/index.tsx index 05dc4cc8c..fdae2bfc9 100644 --- a/src/component/Task/StructureComparisonTask/DetailContent/index.tsx +++ b/src/component/Task/StructureComparisonTask/DetailContent/index.tsx @@ -14,51 +14,51 @@ * limitations under the License. */ +import { getDataSourceModeConfig } from '@/common/datasource'; +import { + getStructrueComparison, + getStructrueComparisonDetail, + getStructureComparisonTaskFile, + getTaskDetail, + getTaskResult, +} from '@/common/network/task'; +import CommonTable from '@/component/CommonTable'; +import { + CommonTableMode, + ITableInstance, + ITableLoadOptions, +} from '@/component/CommonTable/interface'; +import MonacoEditor from '@/component/MonacoEditor'; +import DiffEditor from '@/component/MonacoEditor/DiffEditor'; +import SearchFilter from '@/component/SearchFilter'; import { SQLContent } from '@/component/SQLContent'; import { getTaskExecStrategyMap } from '@/component/Task'; import { + IResponseDataPage, SubTaskStatus, + TaskStatus, type ConnectType, type IStructureComparisonTaskParams, type ITaskResult, type TaskDetail, - IResponseDataPage, - TaskStatus, } from '@/d.ts'; +import { + EOperationType, + IComparisonResult, + IComparisonResultData, + IStructrueComparisonDetail, +} from '@/d.ts/task'; +import { ModalStore } from '@/store/modal'; import { formatMessage } from '@/util/intl'; import { downloadFile, getFormatDateTime } from '@/util/utils'; -import { ConfigProvider, Descriptions, Divider, Empty, Modal, Tabs } from 'antd'; -import { SimpleTextItem } from '../../component/SimpleTextItem'; -import SearchFilter from '@/component/SearchFilter'; import { SearchOutlined } from '@ant-design/icons'; +import { ConfigProvider, Descriptions, Divider, Empty, Modal, Tabs } from 'antd'; +import { inject, observer } from 'mobx-react'; import { useEffect, useRef, useState } from 'react'; +import { SimpleTextItem } from '../../component/SimpleTextItem'; import { TaskTypeMap } from '../../component/TaskTable'; -import { EOperationTypeMap, comparisonScopeMap } from '../CreateModal/interface'; +import { comparisonScopeMap, EOperationTypeMap } from '../CreateModal/interface'; import styles from './index.less'; -import { - getStructrueComparison, - getStructrueComparisonDetail, - getStructureComparisonTaskFile, - getTaskDetail, - getTaskResult, -} from '@/common/network/task'; -import { getDataSourceModeConfig } from '@/common/datasource'; -import DiffEditor from '@/component/MonacoEditor/DiffEditor'; -import { ModalStore } from '@/store/modal'; -import { inject, observer } from 'mobx-react'; -import { - IComparisonResult, - EOperationType, - IStructrueComparisonDetail, - IComparisonResultData, -} from '@/d.ts/task'; -import CommonTable from '@/component/CommonTable'; -import { - CommonTableMode, - ITableInstance, - ITableLoadOptions, -} from '@/component/CommonTable/interface'; -import MonacoEditor from '@/component/MonacoEditor'; interface IStructureComparisonTaskContentProps { modalStore?: ModalStore; visible?: boolean; diff --git a/src/component/Task/component/ActionBar/index.tsx b/src/component/Task/component/ActionBar/index.tsx index fcd0b69c4..50a07b8ed 100644 --- a/src/component/Task/component/ActionBar/index.tsx +++ b/src/component/Task/component/ActionBar/index.tsx @@ -24,18 +24,18 @@ import { } from '@/common/network/task'; import Action from '@/component/Action'; import { + IApplyDatabasePermissionTaskParams, IAsyncTaskParams, IMockDataParams, ITaskResult, RollbackType, + SubTaskStatus, TaskDetail, TaskExecStrategy, TaskRecord, TaskRecordParameters, - IApplyDatabasePermissionTaskParams, TaskStatus, TaskType, - SubTaskStatus, } from '@/d.ts'; import type { UserStore } from '@/store/login'; import type { ModalStore } from '@/store/modal'; @@ -50,7 +50,6 @@ import { inject, observer } from 'mobx-react'; import React, { useEffect, useState } from 'react'; import { isCycleTask } from '../../helper'; import RollBackModal from '../RollbackModal'; -import { cloneDeep } from 'lodash'; interface IProps { userStore?: UserStore; diff --git a/src/component/Task/component/ApprovalModal/index.tsx b/src/component/Task/component/ApprovalModal/index.tsx index 13a9b6c8b..7e0ab3fbc 100644 --- a/src/component/Task/component/ApprovalModal/index.tsx +++ b/src/component/Task/component/ApprovalModal/index.tsx @@ -145,8 +145,7 @@ const ApprovalModal: React.FC = inject('taskStore')(