You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.4 KiB
59 lines
1.4 KiB
import { requestGet } from './crud.service'; |
|
import { formulaData } from './formulaData'; |
|
export function getConnectionlist(): Promise<{data?: Connection[]}> { |
|
return requestGet('/v10/config/connection/list'); |
|
} |
|
|
|
export function getTableList(database: string, pattern = '', orderValue: string | number): Promise<string[]> { |
|
return requestGet('plugin/private/com.fr.solution.plugin.db.redis.v10/redis/keys', { |
|
database, |
|
pattern, |
|
orderValue, |
|
}); |
|
} |
|
|
|
/** |
|
* 获取公式框基本配置信息 |
|
*/ |
|
export function fetchFormulaConfig(): Promise<{ |
|
vars: { |
|
text: string; |
|
value: string; |
|
type: string; |
|
def: string; |
|
}[]; |
|
JSONs: { |
|
def: string; |
|
name: string; |
|
type: string; |
|
}[]; |
|
}> { |
|
// TODO 后台接口待完成 |
|
return new Promise(resolve => { |
|
resolve(formulaData); |
|
}); |
|
} |
|
|
|
/** |
|
* 校验公式 |
|
* @param formulaStr 公式 |
|
*/ |
|
export function validateForumula(formulaStr: string): Promise<{ |
|
validation: boolean; |
|
}> { |
|
// TODO 后台接口待完成 |
|
return new Promise(resolve => { |
|
resolve({ validation: true }); |
|
}); |
|
} |
|
|
|
export interface Connection { |
|
connectionId: string; |
|
connectionType: string; |
|
connectionName: string; |
|
creator?: string; |
|
privilegeDetailBeanList?: { |
|
privilegeType: number; |
|
privilegeValue: number; |
|
}[] |
|
}
|
|
|