From 7c350be747b967fd088e02ca8279cf3e620d97ce Mon Sep 17 00:00:00 2001 From: Austin <1344583166@qq.com> Date: Tue, 10 Sep 2024 10:07:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20mysql=E3=80=81spider=E5=BA=93?= =?UTF-8?q?=E8=A1=A8=E6=A0=A1=E9=AA=8C=E8=A7=84=E5=88=99=E8=B0=83=E6=95=B4?= =?UTF-8?q?=20#6595?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RenderData/RenderDbName.vue | 10 ++- .../execute-objects/RenderData/Row.vue | 3 +- .../pages/page1/components/RenderData/Row.vue | 3 +- .../render-target-db/TargetDbPreview.vue | 63 ++++++++++--------- .../pages/page1/components/RenderData/Row.vue | 9 ++- .../pages/page1/components/RenderData/Row.vue | 3 +- .../pages/page1/components/RenderData/Row.vue | 9 ++- 7 files changed, 56 insertions(+), 44 deletions(-) diff --git a/dbm-ui/frontend/src/views/db-manage/common/sql-execute/execute-objects/RenderData/RenderDbName.vue b/dbm-ui/frontend/src/views/db-manage/common/sql-execute/execute-objects/RenderData/RenderDbName.vue index 6c71446a04..4f186b48dc 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/sql-execute/execute-objects/RenderData/RenderDbName.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/sql-execute/execute-objects/RenderData/RenderDbName.vue @@ -31,6 +31,7 @@ import { makeMap, random } from '@utils'; interface Props { + allowEmpty?: boolean; checkDuplicate?: boolean; } @@ -39,6 +40,7 @@ } const props = withDefaults(defineProps(), { + allowEmpty: false, checkDuplicate: false, }); @@ -57,7 +59,13 @@ const rules = [ { - validator: (value: string[]) => value && value.length > 0, + validator: (value: string[]) => { + if (props.allowEmpty) { + return true; + } + + return value && value.length > 0; + }, message: t('DB 名不能为空'), }, { diff --git a/dbm-ui/frontend/src/views/db-manage/common/sql-execute/execute-objects/RenderData/Row.vue b/dbm-ui/frontend/src/views/db-manage/common/sql-execute/execute-objects/RenderData/Row.vue index 6936ec1317..a579b7672a 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/sql-execute/execute-objects/RenderData/Row.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/sql-execute/execute-objects/RenderData/Row.vue @@ -23,7 +23,8 @@ + v-model="localIgnoreDbnames" + allow-empty /> + :model-value="data.ignoreTables" + :required="false" /> {{ name }} @@ -72,7 +73,7 @@ import RenderDbName from '@views/mysql/common/edit-field/DbName.vue'; - export type DbsType = Omit + export type DbsType = Omit; interface Props { data: { @@ -147,38 +148,40 @@ }); diff --git a/dbm-ui/frontend/src/views/mysql/db-clear/pages/page1/components/RenderData/Row.vue b/dbm-ui/frontend/src/views/mysql/db-clear/pages/page1/components/RenderData/Row.vue index 7b82892e62..08bdcc0a2f 100644 --- a/dbm-ui/frontend/src/views/mysql/db-clear/pages/page1/components/RenderData/Row.vue +++ b/dbm-ui/frontend/src/views/mysql/db-clear/pages/page1/components/RenderData/Row.vue @@ -163,11 +163,10 @@ }; const handleIgnoreDbsChange = (value: string[]) => { - if (isDropDatabase.value && value.length > 0) { - ignoreTables.value = ['*']; - return; - } - + // if (isDropDatabase.value && value.length > 0) { + // ignoreTables.value = ['*']; + // return; + // } ignoreTables.value = []; }; diff --git a/dbm-ui/frontend/src/views/spider-manage/checksum/pages/page1/components/RenderData/Row.vue b/dbm-ui/frontend/src/views/spider-manage/checksum/pages/page1/components/RenderData/Row.vue index e5a855024d..6df094ff8c 100644 --- a/dbm-ui/frontend/src/views/spider-manage/checksum/pages/page1/components/RenderData/Row.vue +++ b/dbm-ui/frontend/src/views/spider-manage/checksum/pages/page1/components/RenderData/Row.vue @@ -82,7 +82,8 @@ ref="ignoreTablesRefs" :allow-asterisk="false" :cluster-id="localClusterId" - :model-value="backupInfoItem.ignoreTables" /> + :model-value="backupInfoItem.ignoreTables" + :required="false" /> { - if (isDropDatabase.value && value.length > 0) { - ignoreTables.value = ['*']; - return; - } - + // if (isDropDatabase.value && value.length > 0) { + // ignoreTables.value = ['*']; + // return; + // } ignoreTables.value = []; };