"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getInfo = exports.getFieIds = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _utils = require("@vtx/utils");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }

function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }

var url = '/cloud/jcss-reborn/facility';

var getInfo = /*#__PURE__*/function () {
  var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(id) {
    var res;
    return _regenerator["default"].wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            _context.next = 2;
            return _utils.request.get("".concat(url, "/get"), {
              data: {
                id: id,
                coordType: 'bd09'
              }
            });

          case 2:
            res = _context.sent;

            if (!((res === null || res === void 0 ? void 0 : res.result) === 0)) {
              _context.next = 5;
              break;
            }

            return _context.abrupt("return", res === null || res === void 0 ? void 0 : res.data);

          case 5:
            return _context.abrupt("return", {});

          case 6:
          case "end":
            return _context.stop();
        }
      }
    }, _callee);
  }));

  return function getInfo(_x) {
    return _ref.apply(this, arguments);
  };
}();

exports.getInfo = getInfo;

var getFieIds = /*#__PURE__*/function () {
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
    var res, _res$data;

    return _regenerator["default"].wrap(function _callee2$(_context2) {
      while (1) {
        switch (_context2.prev = _context2.next) {
          case 0:
            _context2.next = 2;
            return _utils.request.get("".concat(url, "/type/view/detail"), {
              data: {
                code: 'gas_cz'
              }
            });

          case 2:
            res = _context2.sent;

            if (!((res === null || res === void 0 ? void 0 : res.result) === 0)) {
              _context2.next = 5;
              break;
            }

            return _context2.abrupt("return", res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.customFields);

          case 5:
            return _context2.abrupt("return", []);

          case 6:
          case "end":
            return _context2.stop();
        }
      }
    }, _callee2);
  }));

  return function getFieIds() {
    return _ref2.apply(this, arguments);
  };
}();

exports.getFieIds = getFieIds;
//# sourceMappingURL=api.js.map
