diff --git a/dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/Index.vue b/dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/Index.vue index 264eac830a..81a45cdf13 100644 --- a/dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/Index.vue +++ b/dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/Index.vue @@ -67,6 +67,7 @@ :get-table-list="getTableList" :is-remote-pagination="isRemotePagination" :last-values="lastValues" + :multiple="multiple" :role-filter-list="roleFilterList" :status-filter="statusFilter" :table-setting="tableSetting" @@ -104,6 +105,7 @@ interface Props { lastValues: InstanceSelectorValues; tableSetting: TableSetting; + multiple?: NonNullable; firsrColumn?: TableConfigType['firsrColumn']; roleFilterList?: TableConfigType['roleFilterList']; isRemotePagination?: TableConfigType['isRemotePagination']; @@ -128,6 +130,7 @@ topoAlertContent: undefined, roleFilterList: undefined, filterClusterId: undefined, + multiple: true, }); const emits = defineEmits(); diff --git a/dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/table/Index.vue b/dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/table/Index.vue index 0a94b9f838..df1532f0df 100644 --- a/dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/table/Index.vue +++ b/dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/table/Index.vue @@ -30,7 +30,8 @@ style="margin-top: 12px" @page-limit-change="handeChangeLimit" @page-value-change="handleChangePage" - @refresh="fetchResources" /> + @refresh="fetchResources" + @row-click.stop.prevent="handleRowClick" /> @@ -60,6 +61,7 @@ lastValues: InstanceSelectorValues, tableSetting: TableSetting, clusterId?: number, + multiple?: TableConfigType['multiple'], isRemotePagination?: TableConfigType['isRemotePagination'], firsrColumn?: TableConfigType['firsrColumn'], // eslint-disable-next-line vue/no-unused-properties @@ -128,7 +130,7 @@ { width: 60, fixed: 'left', - label: () => ( + label: () => props.multiple && ( ); } - return ( + return props.multiple ? ( handleTableSelectOne(value, data)} /> + ) : ( + handleTableSelectOne(value, data)} + /> ); }, }, @@ -276,8 +285,22 @@ } }; + const handleRowClick = (row: unknown, data: T) => { + if (props.disabledRowConfig && props.disabledRowConfig.handler(data)) { + return; + } + + const isChecked = !!checkedMap.value[data[firstColumnFieldId.value]]; + if (isChecked && !props.multiple) { + // 单选不允许取消 + return; + } + + handleTableSelectOne(!isChecked, data); + }; + const handleTableSelectOne = (checked: boolean, data: T) => { - const lastCheckMap = { ...checkedMap.value }; + const lastCheckMap = props.multiple ? { ...checkedMap.value } : {}; if (checked) { lastCheckMap[data[firstColumnFieldId.value]] = formatValue(data); } else { diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index 5fc550b117..f1b555ab3d 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3529,5 +3529,11 @@ "不允许输入系统库和特殊库,如mysql、sys 等": "不允许输入系统库和特殊库,如mysql、sys 等", "支持 %(指代任意长度字符串), ?(指代单个字符串), *(指代全部)三个通配符": "支持 %(指代任意长度字符串), ?(指代单个字符串), *(指代全部)三个通配符", "包含通配符时, 每一单元格只允许输入单个对象。% ? 不能独立使用, * 只能单独使用": "包含通配符时, 每一单元格只允许输入单个对象。% ? 不能独立使用, * 只能单独使用", + "选择实例": "选择实例", + "格式不正确": "格式不正确", + "ip不存在": "ip不存在", + "请输入或选择主机": "请输入或选择主机", + "实例/IP重复": "实例/IP重复", + "同主机关联的其他集群,勾选后一同克隆": "同主机关联的其他集群,勾选后一同克隆", "这行勿动!新增翻译请在上一行添加!": "" } \ No newline at end of file diff --git a/dbm-ui/frontend/src/types/auto-imports.d.ts b/dbm-ui/frontend/src/types/auto-imports.d.ts index 6bc2ae2a45..79be9ca2a4 100644 --- a/dbm-ui/frontend/src/types/auto-imports.d.ts +++ b/dbm-ui/frontend/src/types/auto-imports.d.ts @@ -3,7 +3,6 @@ // @ts-nocheck // noinspection JSUnusedGlobalSymbols // Generated by unplugin-auto-import -// biome-ignore lint: disable export {} declare global { const EffectScope: (typeof import('vue'))['EffectScope']; diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/checksum/pages/page1/components/RenderData/Row.vue b/dbm-ui/frontend/src/views/db-manage/mysql/checksum/pages/page1/components/RenderData/Row.vue index d087f3f32d..a86d482a5c 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/checksum/pages/page1/components/RenderData/Row.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/checksum/pages/page1/components/RenderData/Row.vue @@ -124,6 +124,7 @@ id: 0, }, version: '', + is_stand_by: false, }); export type IDataRowBatchKey = keyof Pick; diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/common/edit-field/InstanceWithSelector.vue b/dbm-ui/frontend/src/views/db-manage/mysql/common/edit-field/InstanceWithSelector.vue index 4d5313afda..cfbd672f98 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/common/edit-field/InstanceWithSelector.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/common/edit-field/InstanceWithSelector.vue @@ -49,13 +49,14 @@ @change="handleInstancesChange" />