From 3727ee4b944be58af6f0fec7a52fd6ffc21b020b Mon Sep 17 00:00:00 2001 From: alan Date: Wed, 25 Sep 2019 15:11:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E6=8E=89=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/connection/list/list.model.ts | 10 +++++----- src/modules/pages/connection/list/list.ts | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) 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,