|
|
@ -1,13 +1,13 @@ |
|
|
|
import { model, Model } from '@core/core'; |
|
|
|
import { model, Model } from '@core/core'; |
|
|
|
import { ConnectionModel } from '../connection.model'; |
|
|
|
import { ApiFactory } from '../../..//crud/apiFactory'; |
|
|
|
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
|
|
|
import { AppModel } from '../../../app.model'; |
|
|
|
const api = new ApiFactory().create(); |
|
|
|
const api = new ApiFactory().create(); |
|
|
|
export const ConnectionListModelXtype = 'dec.dcm.model.connection.list'; |
|
|
|
export const ConnectionListModelXtype = 'dec.dcm.model.connection.list'; |
|
|
|
@model(ConnectionListModelXtype) |
|
|
|
@model(ConnectionListModelXtype) |
|
|
|
export class ConnectionListModel extends Model<{ |
|
|
|
export class ConnectionListModel extends Model<{ |
|
|
|
context : { |
|
|
|
context : { |
|
|
|
connections: ConnectionModel['$$childContext']['connections']; |
|
|
|
connections: AppModel['$$childContext']['connections']; |
|
|
|
connectionSelected: ConnectionModel['$$childContext']['connectionSelected']; |
|
|
|
connectionSelected: AppModel['$$childContext']['connectionSelected']; |
|
|
|
} |
|
|
|
} |
|
|
|
}> { |
|
|
|
}> { |
|
|
|
context = ['connections', 'connectionSelected']; |
|
|
|
context = ['connections', 'connectionSelected']; |
|
|
@ -18,7 +18,7 @@ export class ConnectionListModel extends Model<{ |
|
|
|
this.model.connections = data.data; |
|
|
|
this.model.connections = data.data; |
|
|
|
this.model.connections.forEach(item => { |
|
|
|
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; |
|
|
|
this.model.connectionSelected = data.data[0].connectionName; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|