"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getCycleSetting = exports.addWorkManageSetting = exports.addListWorkManage = exports.addCycleSetting = void 0;

var _request = _interopRequireDefault(require("../../utils/request"));

var _toast = _interopRequireDefault(require("../toast"));

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

;
var rget = _request["default"].rget,
    rpost = _request["default"].rpost;

var addWorkManageSetting = function addWorkManageSetting(data) {
  var url = "WorkManageSetting/Add";
  return rpost('v1')(url, data).then(function (res) {
    if (!!res.Code) {
      return res.Data;
    } else {
      _toast["default"].Error(res.Message || '操作失败，请联系客服');

      return false;
    }
  })["catch"](function (err) {
    _toast["default"].Error('操作失败，请联系客服');
  });
};

exports.addWorkManageSetting = addWorkManageSetting;

var addListWorkManage = function addListWorkManage(data) {
  return rpost('v1')('WorkManageSetting/AddList', data).then(function (res) {
    return res.Data;
  });
};

exports.addListWorkManage = addListWorkManage;

var addCycleSetting = function addCycleSetting(data) {
  return rpost('v1')('okr/addCycleSetting', data).then(function (res) {
    return res.Data;
  });
};

exports.addCycleSetting = addCycleSetting;

var getCycleSetting = function getCycleSetting() {
  return rget('v1')('okr/cycleSetting').then(function (res) {
    return res.Data;
  });
};

exports.getCycleSetting = getCycleSetting;