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

/**
 * low_code -表单api
 *
 */
export class SheetFormApi {
  /**
   * 添加
   * @param {*} params
   * @returns
   */
  static add(params) {
    return Request.post('/formModel/add', params);
  }
  /**
   * 编辑
   * @param {*} params
   * @returns
   */
  static edit(params) {
    return Request.post('/formModel/edit', params);
  }
  /**
   * 删除单个
   * @param {*} params
   * @returns
   */
  static delete(params) {
    return Request.post('/formModel/delete', params);
  }
  /**
   * 详情
   * @param {*} params
   * @returns
   */
  static detail(params) {
    return Request.getAndLoadData('/formModel/detail', params);
  }
  /**
   * 列表
   * @param {*} params
   * @returns
   */
  static list(params) {
    return Request.getAndLoadData('/formModel/list', params);
  }

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

  /**
   * 升级表单模型
   * @param {*} params
   * @returns
   */
  static upgradeModel(params) {
    return Request.post('/formModel/upgradeModel', params);
  }

  /**
   * 复制模式
   * @param {*} params
   * @returns
   */
  static copyModel(params) {
    return Request.get('/formModel/copyModel', params);
  }

  /**
   * 自动生成表单
   * @param {*} params
   * @returns
   */
  static doGenerate(params) {
    return Request.post('/formAutoGenerate/doGenerate', params);
  }
}
