import {WeaTools} from 'ecCom';

export const getDataShowList = params => {
    return WeaTools.callApi('/api/integration/datashow/getDataShowList', 'POST', params);
};

export const getDataShowRightMenu = params => {
    return WeaTools.callApi('/api/integration/datashow/getDataShowRightMenu', 'POST', params);
};

export const getDataShowCondition = params => {
    return WeaTools.callApi('/api/integration/datashow/getDataShowCondition', 'POST', params);
};

export const getDataShowEditForm = params => {
    return WeaTools.callApi('/api/integration/datashow/getDataShowEditForm', 'POST', params);
};


export const getDataShowEditForm4E7 = params => {
    return WeaTools.callApi('/api/integration/datashow/getDataShowEditForm4E7', 'POST', params);
};

export const getDataShowOperation4E7 = params => {
    return WeaTools.callApi('/api/integration/datashow/getDataShowOperation4E7', 'POST', params);
};

export const getDataShowOperation = params => {
    return WeaTools.callApi('/api/integration/datashow/getDataShowOperation', 'POST', params);
};

//获取测试的form
export const getDataShowTestForm = params => {
    return WeaTools.callApi('/api/integration/datashow/getDataShowTestForm', 'POST', params);
};

//校验数据源是否可连接
export const checkDataSource = params => {
    return WeaTools.callApi('/api/integration/datashow/checkDataSource', 'POST', params);
};
//校验数据库【查询SQL语句】是否能正常执行并返回查询结果
export const checkSqlOrProc = params => {
    return WeaTools.callApi('/api/integration/datashow/checkSqlOrProc', 'POST', params);
};

//判断数据库主键字段存不存在
export const checkKeyField = params => {
    return WeaTools.callApi('/api/integration/datashow/checkKeyField', 'POST', params);
};

//校验数据库【字段设置】中的【字段】项是否在【查询SQL语句】或【回显SQL语句】中存在
export const checkFieldSetting = params => {
    return WeaTools.callApi('/api/integration/datashow/checkFieldSetting', 'POST', params);
};

//校验数据库【字段设置】中的【转换方法】是否返回查询结果
export const checkTranSql = params => {
    return WeaTools.callApi('/api/integration/datashow/checkTranSql', 'POST', params);
};

//webservice接口返回内容是否是XML格式
export const checkIsXmlDocument = params => {
    return WeaTools.callApi('/api/integration/datashow/checkIsXmlDocument', 'POST', params);
};

//效验 自定义地址 是否可访问
export const checkURLS = params => {
    return WeaTools.callApi('/api/integration/datashow/checkURLS', 'POST', params);
};

//保存表单值
export const saveFormParam = params => {
    return WeaTools.callApi('/api/integration/datashow/saveFormParam', 'POST', params);
};

//查询参数form
export const getSqlTextForm = params => {
    return WeaTools.callApi('/api/integration/datashow/getSqlTextForm', 'POST', params);
};

//获取首页的测试数据
export const getIndexTest = (testId) => {
    return WeaTools.callApi(`/api/integration/datashow/test/${testId}`, 'GET');
};

// 缓存管理页面
export const getDataShowCacheSetCondition = params => WeaTools.callApi('/api/integration/datashow/getDataShowCacheSetCondition', 'POST', params); 
export const getDataShowCacheSetRightMenu = params => WeaTools.callApi('/api/integration/datashow/getDataShowCacheSetRightMenu', 'POST', params); 
export const getDataShowCacheSetList = params => WeaTools.callApi('/api/integration/datashow/getDataShowCacheSetList', 'POST', params); 
export const getDataShowCacheOperation = params => WeaTools.callApi('/api/integration/datashow/getDataShowCacheOperation', 'POST', params); 

// 缓存数据管理
export const getDataShowCacheDataCondition = params => WeaTools.callApi('/api/integration/datashow/getDataShowCacheDataCondition', 'POST', params); 
export const getDataShowCacheDataList = params => WeaTools.callApi('/api/integration/datashow/getDataShowCacheDataList', 'POST', params); 
export const getDataShowCacheDataRightMenu = params => WeaTools.callApi('/api/integration/datashow/getDataShowCacheDataRightMenu', 'POST', params); 

// 缓存数据新建form接口
export const getDataShowCacheDataForm = params => WeaTools.callApi('/api/integration/datashow/getDataShowCacheDataForm', 'POST', params); 
