From 81a0e91f1f56574802839f26d5b6870d2aaa5ff3 Mon Sep 17 00:00:00 2001 From: austinqli <1344583166@qq.com> Date: Thu, 9 Nov 2023 15:33:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E7=9B=91=E6=8E=A7=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E8=87=AA=E6=B5=8Bbug=E4=BF=AE=E5=A4=8D=20#1531=20(#17?= =?UTF-8?q?01)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/frontend/src/locales/zh-cn.json | 4 ++-- .../monitor-strategy/components/content/Index.vue | 2 ++ .../components/edit-strategy/Index.vue | 10 ++++++++++ .../global-strategy/components/content/Index.vue | 1 + .../rotation-setting/components/edit-rule/Index.vue | 5 ++--- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index a75230da5e..ab8812c1fb 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -2282,7 +2282,7 @@ "目标从库实例不存在": "目标从库实例不存在", "待重建从库主机": "待重建从库主机", "新从库主机不能为空": "新从库主机不能为空", - "不能超过 128 个字符": "不能超过 128 个字符", + "不能超过n个字符": "不能超过 {n} 个字符", "已值班人": "已值班人", "时间段重叠了": "时间段重叠了", "告警组名称重复": "告警组名称重复", @@ -2294,4 +2294,4 @@ "集": "集", "长度不能大于n": "长度不能大于{0}", "这行勿动!新增翻译请在上一行添加!": "" -} +} \ No newline at end of file diff --git a/dbm-ui/frontend/src/views/monitor-alarm-db/monitor-strategy/components/content/Index.vue b/dbm-ui/frontend/src/views/monitor-alarm-db/monitor-strategy/components/content/Index.vue index bada4acc26..548fbc7fed 100644 --- a/dbm-ui/frontend/src/views/monitor-alarm-db/monitor-strategy/components/content/Index.vue +++ b/dbm-ui/frontend/src/views/monitor-alarm-db/monitor-strategy/components/content/Index.vue @@ -160,8 +160,10 @@ { label: t('策略名称'), field: 'name', + fixed: 'left', minWidth: 150, width: 280, + showOverflowTooltip: false, render: ({ row }: {row: RowData}) => { const isInner = row.bk_biz_id === 0; const isDanger = row.event_count > 0; diff --git a/dbm-ui/frontend/src/views/monitor-alarm-db/monitor-strategy/components/edit-strategy/Index.vue b/dbm-ui/frontend/src/views/monitor-alarm-db/monitor-strategy/components/edit-strategy/Index.vue index 449d45bb33..9ea5ff7ae6 100644 --- a/dbm-ui/frontend/src/views/monitor-alarm-db/monitor-strategy/components/edit-strategy/Index.vue +++ b/dbm-ui/frontend/src/views/monitor-alarm-db/monitor-strategy/components/edit-strategy/Index.vue @@ -286,6 +286,16 @@ message: t('策略名称不能为空'), trigger: 'blur', }, + { + validator: (value: string) => { + if (value.length > 128) { + return false; + } + return true; + }, + message: t('不能超过n个字符', { n: 128 }), + trigger: 'blur', + }, { validator: (value: string) => { if (!isEditPage.value) { diff --git a/dbm-ui/frontend/src/views/monitor-alarm-plat/global-strategy/components/content/Index.vue b/dbm-ui/frontend/src/views/monitor-alarm-plat/global-strategy/components/content/Index.vue index 473543c9d0..0d81d20e0e 100644 --- a/dbm-ui/frontend/src/views/monitor-alarm-plat/global-strategy/components/content/Index.vue +++ b/dbm-ui/frontend/src/views/monitor-alarm-plat/global-strategy/components/content/Index.vue @@ -114,6 +114,7 @@ { label: t('策略名称'), field: 'name', + fixed: 'left', minWidth: 150, render: ({ row }: { row: RowData }) => { const isNew = dayjs().isBefore(dayjs(row.create_at).add(24, 'hour')); diff --git a/dbm-ui/frontend/src/views/monitor-alarm-plat/rotation-setting/components/edit-rule/Index.vue b/dbm-ui/frontend/src/views/monitor-alarm-plat/rotation-setting/components/edit-rule/Index.vue index 87aedc5045..cf3039ea81 100644 --- a/dbm-ui/frontend/src/views/monitor-alarm-plat/rotation-setting/components/edit-rule/Index.vue +++ b/dbm-ui/frontend/src/views/monitor-alarm-plat/rotation-setting/components/edit-rule/Index.vue @@ -225,13 +225,12 @@ ruleName: [ { validator: (value: string) => { - if (value.length > 128) { - // 克隆才需要校验 + if (value.length > 80) { return false; } return true; }, - message: t('不能超过 128 个字符'), + message: t('不能超过n个字符', { n: 80 }), trigger: 'blur', }, {