import Request from '@/utils/request/request-util';

/**
 * low_code -视图api
 *
 */
export class SheetViewApi {
  /**
   * 添加
   * @param {*} params
   * @returns
   */
  static add(params) {
    return Request.post('/devopsView/add', params);
  }
  /**
   * 编辑
   * @param {*} params
   * @returns
   */
  static edit(params) {
    return Request.post('/devopsView/edit', params);
  }
  /**
   * 删除单个
   * @param {*} params
   * @returns
   */
  static delete(params) {
    return Request.post('/devopsView/delete', params);
  }

  /**
   * 批量删除
   * @param {*} params
   * @returns
   */
  static batchDelete(params) {
    return Request.post('/devopsView/batchDelete', params);
  }
  /**
   * 详情
   * @param {*} params
   * @returns
   */
  static detail(params) {
    return Request.getAndLoadData('/devopsView/detail', params);
  }
  /**
   * 列表
   * @param {*} params
   * @returns
   */
  static list(params) {
    return Request.getAndLoadData('/devopsView/list', params);
  }

  /**
   * 分页列表
   * @param {*} params
   * @returns
   */
  static page(params) {
    return Request.getAndLoadData('/devopsView/page', params);
  }

  /**
   * 获取视图设计详情
   * @param {*} params
   * @returns
   */
  static getViewConfig(params) {
    return Request.getAndLoadData('/devopsViewDetail/getViewConfig', params);
  }

  /**
   * 获取所有转化器列表
   * @param {*} params
   * @returns
   */
  static getParserList(params) {
    return Request.getAndLoadData('/devopsViewDetail/getParserList', params);
  }

  /**
   * 保存视图设计配置
   * @param {*} params
   * @returns
   */
  static saveViewConfig(params) {
    return Request.post('/devopsViewDetail/saveViewConfig', params);
  }

  /**
   * 获取一键导入的字段列表
   * @param {*} params
   * @returns
   */
  static getImportFieldList(params) {
    return Request.getAndLoadData('/devopsViewDetail/getImportFieldList', params);
  }

  /**
   * 获取自定义接口下拉列表
   * @param {*} params
   * @returns
   */
  static getCustomRenderApiList(params) {
    return Request.getAndLoadData('/businessRenderConfig/getCustomRenderApiList', params);
  }

  /**
   * 获取视图对应业务下的表单列表
   * @param {*} params
   * @returns
   */
  static getViewBusinessFormList(params) {
    return Request.getAndLoadData('/commonView/getViewBusinessFormList', params);
  }

  /**
   * 获取表单字段列表
   * @param {*} params
   * @returns
   */
  static getFormFieldList(params) {
    return Request.getAndLoadData('/formItem/getFormFieldList', params);
  }

  /**
   * 获取基于表单的字段列表和搜索条件列表
   * @param {*} params
   * @returns
   */
  static getFormBasedFieldList(params) {
    return Request.get('/devopsViewDetail/getFormBasedFieldList', params);
  }
}
