From d61a9d832e152a3a4d9e072a31ea53f55094b4d5 Mon Sep 17 00:00:00 2001 From: alan Date: Mon, 30 Sep 2019 14:05:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=B3=E4=BE=A7=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E6=97=B6=E4=B9=9F=E5=8A=A0=E5=85=A5=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/connection/list/list_item/list_item.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/pages/connection/list/list_item/list_item.ts b/src/modules/pages/connection/list/list_item/list_item.ts index 3fb61b5..dbcdb5a 100644 --- a/src/modules/pages/connection/list/list_item/list_item.ts +++ b/src/modules/pages/connection/list/list_item/list_item.ts @@ -4,7 +4,7 @@ import './list_item.less'; import { ListItemModel, ListItemModelXtype } from './list_item.model'; import { PAGE_INDEX } from '@constants/constant'; import { hasRegistered } from '../list.service'; -import { connectionCanEdit, getTextByDatabaseType } from '../../../../app.service'; +import { connectionCanEdit, getTextByDatabaseType, getChartLength } from '../../../../app.service'; import { testConnection } from '../../../maintain/forms/form.server'; export const ListItemXtype = 'dec.dcm.connection.list_item'; @@ -71,6 +71,13 @@ export class ListItem extends BI.BasicButton { eventName: BI.SignEditor.EVENT_BLUR, action: () => { const newName = this.nameEditor.getValue(); + if (getChartLength(newName) > 200) { + BI.Msg.toast(BI.i18nText(BI.i18nText('Dec-Dcm_Connection_Cannot_Too_Lang')), { + level: 'error', + }); + + return; + } this.store.changeName(name, newName).then(re => { this.store.setIsEdit(false, name); if (re.errorCode) {