diff --git a/src/modules/pages/connection/list/list.model.ts b/src/modules/pages/connection/list/list.model.ts index 6699eac..c3d08aa 100644 --- a/src/modules/pages/connection/list/list.model.ts +++ b/src/modules/pages/connection/list/list.model.ts @@ -1,13 +1,13 @@ import { model, Model } from '@core/core'; -import { ConnectionModel } from '../connection.model'; -import { ApiFactory } from 'src/modules/crud/apiFactory'; +import { ApiFactory } from '../../..//crud/apiFactory'; +import { AppModel } from '../../../app.model'; const api = new ApiFactory().create(); export const ConnectionListModelXtype = 'dec.dcm.model.connection.list'; @model(ConnectionListModelXtype) export class ConnectionListModel extends Model<{ context : { - connections: ConnectionModel['$$childContext']['connections']; - connectionSelected: ConnectionModel['$$childContext']['connectionSelected']; + connections: AppModel['$$childContext']['connections']; + connectionSelected: AppModel['$$childContext']['connectionSelected']; } }> { context = ['connections', 'connectionSelected']; @@ -18,7 +18,7 @@ export class ConnectionListModel extends Model<{ this.model.connections = data.data; this.model.connections.forEach(item => { // 后端传过来的是字符串,转为对象 - item.connectionData = JSON.parse(item.connectionData); + item.connectionData = JSON.parse(item.connectionData as string); }); this.model.connectionSelected = data.data[0].connectionName; } else { diff --git a/src/modules/pages/connection/list/list.ts b/src/modules/pages/connection/list/list.ts index 2cf066c..a208382 100644 --- a/src/modules/pages/connection/list/list.ts +++ b/src/modules/pages/connection/list/list.ts @@ -2,7 +2,6 @@ import { shortcut, store } from '@core/core'; import { CenterAdapt, Label, Layout, Vtape, Loader } from 'ui'; import { ListItemXtype } from './list_item/list_item'; import { ConnectionListModel, ConnectionListModelXtype } from './list.model'; -import { Connection } from '../../../crud/crud.typings'; import { getCreator, getDatabaseType } from './list.service'; export const ConnectionListXtype = 'dec.dcm.connection.list'; @shortcut(ConnectionListXtype) @@ -68,7 +67,7 @@ export class ConnectionList extends BI.LoadingPane { } private renderList(start = 0, end = 0) { - return this.model.connections.slice(start, end).map((item: Connection, index: number) => { + return this.model.connections.slice(start, end).map((item, index) => { return { type: ListItemXtype, name: item.connectionName,