From feb67c706f28a5e8eee5ca5880cc5ee2e01218ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=92=8F=E5=92=8C?= Date: Thu, 9 Nov 2023 15:09:39 +0800 Subject: [PATCH] PullRequest: 227 fix/dev-4.2.2-bp-bugs-xyh-1109 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge branch 'fix/dev-4.2.2-bp-bugs-xyh-1109 of git@code.alipay.com:oceanbase/oceanbase-developer-center.git into dev-4.2.2 https://code.alipay.com/oceanbase/oceanbase-developer-center/pull_requests/227 Signed-off-by: 晓康 * Fixes oceanbase/odc#729 * Fixes oceanbase/odc#729(style) --- .../BlobFormatter/BlobViewModal.tsx | 19 +++++++++++-------- .../hooks/components/BlobFormatter/index.less | 11 ++++++++++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/page/Workspace/components/DDLResultSet/hooks/components/BlobFormatter/BlobViewModal.tsx b/src/page/Workspace/components/DDLResultSet/hooks/components/BlobFormatter/BlobViewModal.tsx index 477a3e1cb..3a369f84a 100644 --- a/src/page/Workspace/components/DDLResultSet/hooks/components/BlobFormatter/BlobViewModal.tsx +++ b/src/page/Workspace/components/DDLResultSet/hooks/components/BlobFormatter/BlobViewModal.tsx @@ -23,7 +23,7 @@ import { SettingStore } from '@/store/setting'; import { formatMessage } from '@/util/intl'; import { formatBytes, getBlobValueKey } from '@/util/utils'; import type { FormatterProps } from '@oceanbase-odc/ob-react-data-grid'; -import { Alert, Button, Image, Input, Modal, Radio, Row, Space, Spin } from 'antd'; +import { Alert, Button, Image, Input, Modal, Radio, Row, Space, Spin, Typography } from 'antd'; import { UploadFile } from 'antd/es/upload/interface'; import Cookies from 'js-cookie'; import { inject, observer } from 'mobx-react'; @@ -92,10 +92,7 @@ const CreateFileLoader = (params: { request: Request; callback: Callback }) => { fileLoader(size); if (isFinish) { callback({ - content: contents - ?.slice(1) - ?.map((item) => item?.content) - ?.join(''), + content: contents?.map((item) => item?.content)?.join(''), size, }); } @@ -241,7 +238,7 @@ const BlobViewModal: React.FC = (props) => { case DISPLAY_MODE.TEXT: case DISPLAY_MODE.HEXTEXT: { const maxSizeText = formatBytes(maxTextSize); - + const disabled = !isModeEditable || !resultContext.isEditing; return (
@@ -260,19 +257,25 @@ const BlobViewModal: React.FC = (props) => { )} {mode === DISPLAY_MODE.HEXTEXT ? ( { setHexText(v); }} /> + ) : disabled ? ( +
+ + {mode == DISPLAY_MODE.TEXT ? text : hexText} + +
) : ( { if (mode === DISPLAY_MODE.TEXT) { setText(e.target.value); diff --git a/src/page/Workspace/components/DDLResultSet/hooks/components/BlobFormatter/index.less b/src/page/Workspace/components/DDLResultSet/hooks/components/BlobFormatter/index.less index 8006c23ec..9d1f8bb8e 100644 --- a/src/page/Workspace/components/DDLResultSet/hooks/components/BlobFormatter/index.less +++ b/src/page/Workspace/components/DDLResultSet/hooks/components/BlobFormatter/index.less @@ -31,11 +31,13 @@ .textNull { color: var(--text-color-secondary); } -.contenttext { +.contenttext, +.contenttext-disabled { flex: 1; padding: 8px; background: #f8f9fb; border: none; + white-space: pre; &:focus { box-shadow: none; } @@ -45,3 +47,10 @@ cursor: unset; } } +.contenttext-disabled { + border: 1px solid #d9d9d9; + overflow-y: scroll; + color: rgba(0, 0, 0, 0.85); + background-color: #f8f9fb; + cursor: unset; +}