"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.saveStoreAdd = exports.getUniFormList = exports.getChildList = void 0;
var _request = _interopRequireDefault(require("./request"));
/*
 * @Author: saiyi_lch 982492702@qq.com
 * @Date: 2023-06-30 11:37:52
 * @LastEditors: saiyi_lch 982492702@qq.com
 * @LastEditTime: 2023-07-04 10:57:20
 * @FilePath: /lowcode-material/src/utils/api.ts
 * @Description: 这是接口api
 */

//统一页面查询接口

var getUniFormList = function getUniFormList(obj, current, size) {
  var url = '/api/gzmpc-lowcode/uniForm/getList';
  if (current) {
    url += "?current=" + current + "&size=" + size;
  }
  return new Promise(function (resolve, reject) {
    (0, _request["default"])({
      url: url,
      method: 'post',
      data: obj
    }).then(function (res) {
      resolve(res.data);
    })["catch"](function (err) {
      reject();
    });
  });
};

// 统一保存接口
exports.getUniFormList = getUniFormList;
// 统一保存接口
var saveStoreAdd = function saveStoreAdd(obj) {
  var url = '/api/gzmpc-lowcode/uniForm/save';
  return new Promise(function (resolve, reject) {
    (0, _request["default"])({
      url: url,
      method: 'post',
      data: obj
    }).then(function (res) {
      resolve(res.data);
    })["catch"](function (err) {
      reject();
    });
  });
};

// 获取枚举值列表-子
exports.saveStoreAdd = saveStoreAdd;
var getChildList = function getChildList(parentId) {
  return new Promise(function (resolve, reject) {
    (0, _request["default"])({
      url: "/api/gzmpc-lowcode/enum/child-list?parentId=" + parentId,
      method: "GET"
    }).then(function (res) {
      resolve(res.data);
    });
  });
};
exports.getChildList = getChildList;