|
|
@ -4,7 +4,7 @@ import './list_item.less'; |
|
|
|
import { ListItemModel, ListItemModelXtype } from './list_item.model'; |
|
|
|
import { ListItemModel, ListItemModelXtype } from './list_item.model'; |
|
|
|
import { PAGE_INDEX } from '@constants/constant'; |
|
|
|
import { PAGE_INDEX } from '@constants/constant'; |
|
|
|
import { hasRegistered } from '../list.service'; |
|
|
|
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'; |
|
|
|
import { testConnection } from '../../../maintain/forms/form.server'; |
|
|
|
|
|
|
|
|
|
|
|
export const ListItemXtype = 'dec.dcm.connection.list_item'; |
|
|
|
export const ListItemXtype = 'dec.dcm.connection.list_item'; |
|
|
@ -71,6 +71,15 @@ export class ListItem extends BI.BasicButton { |
|
|
|
eventName: BI.SignEditor.EVENT_BLUR, |
|
|
|
eventName: BI.SignEditor.EVENT_BLUR, |
|
|
|
action: () => { |
|
|
|
action: () => { |
|
|
|
const newName = this.nameEditor.getValue(); |
|
|
|
const newName = this.nameEditor.getValue(); |
|
|
|
|
|
|
|
if (getChartLength(newName) > 200) { |
|
|
|
|
|
|
|
BI.Msg.toast(BI.i18nText(BI.i18nText('Dec-Dcm_Connection_Cannot_Too_Lang')), { |
|
|
|
|
|
|
|
level: 'error', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.store.setIsEdit(false, name); |
|
|
|
|
|
|
|
this.nameLabel.setText(name); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
this.store.changeName(name, newName).then(re => { |
|
|
|
this.store.changeName(name, newName).then(re => { |
|
|
|
this.store.setIsEdit(false, name); |
|
|
|
this.store.setIsEdit(false, name); |
|
|
|
if (re.errorCode) { |
|
|
|
if (re.errorCode) { |
|
|
|