Browse Source

KERNEL-1473后台接口修改,调整creator字段位置

qufenxi
alan 5 years ago
parent
commit
fcbf3329e4
  1. 1
      src/modules/crud/crud.typings.d.ts
  2. 16
      src/modules/pages/connection/list/list.service.ts
  3. 4
      src/modules/pages/connection/list/list.ts
  4. 2
      src/modules/pages/maintain/forms/form.ts

1
src/modules/crud/crud.typings.d.ts vendored

@ -18,6 +18,7 @@ export interface Connection {
connectionId: string;
connectionType: string;
connectionName: string;
creator?: string;
connectionData: ConnectionJDBC | ConnectionJNDI | ConnectionPlugin | string;
privilegeDetailBeanList?: {
privilegeType: number;

16
src/modules/pages/connection/list/list.service.ts

@ -1,22 +1,8 @@
import { Connection, ConnectionJDBC, ConnectionJNDI, ConnectionPlugin } from '../../../crud/crud.typings';
import { Connection, ConnectionJDBC } from '../../../crud/crud.typings';
import { connectionType } from '@constants/env';
import { getAllDatabaseTypes, getJdbcDatabaseType } from 'src/modules/app.service';
import { DATA_BASE_TYPES_OTHER } from '@constants/constant';
export function getCreator(connection: Connection) {
if (!connection.connectionData) {
return '';
}
switch (connection.connectionType) {
case connectionType.JDBC:
return (connection.connectionData as ConnectionJDBC).creator;
case connectionType.JNDI:
return (connection.connectionData as ConnectionJNDI).creator;
default:
return (connection.connectionData as ConnectionPlugin).creator;
}
}
export function getDatabaseType(connection: Connection) {
switch (connection.connectionType) {
case connectionType.JDBC:

4
src/modules/pages/connection/list/list.ts

@ -2,7 +2,7 @@ import { shortcut, store } from '@core/core';
import { CenterAdapt, Label, Layout, Vtape, Loader, Tab } from 'ui';
import { ListItemXtype } from './list_item/list_item';
import { ConnectionListModel, ConnectionListModelXtype } from './list.model';
import { getCreator, getDatabaseType } from './list.service';
import { getDatabaseType } from './list.service';
export const ConnectionListXtype = 'dec.dcm.connection.list';
@shortcut(ConnectionListXtype)
@store(ConnectionListModelXtype)
@ -86,7 +86,7 @@ export class ConnectionList extends BI.LoadingPane {
type: ListItemXtype,
name: item.connectionName,
value: item.connectionName,
creator: getCreator(item),
creator: BI.get(item, 'creator'),
databaseType: getDatabaseType(item),
selected: this.model.connectionSelected ? this.model.connectionSelected === item.connectionName : index === 0,
};

2
src/modules/pages/maintain/forms/form.ts

@ -30,7 +30,7 @@ export class MaintainForm extends BI.Widget {
}
if (this.connectionName && !this.model.isCopy) {
const value = this.form.getSubmitValue();
(value.connectionData as ConnectionJDBC).creator = BI.get(this.getFormData().connectionData, 'creator');
(value.connectionData as ConnectionJDBC).creator = BI.get(this.getFormData(), 'creator');
this.store.updateConnection(this.connectionName, value).then(result => {
if (result.errorCode) {
this.showError(result);

Loading…
Cancel
Save