"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.USER_TABLE_INFOS_SUCCESS = exports.USER_TABLE_INFOS_ERROR = exports.USER_TABLE_INFOS = exports.USER_REGION_TREE_SUCCESS = exports.USER_REGION_TREE_ERROR = exports.USER_REGION_TREE = exports.USER_INFO_SUCCESS = exports.USER_INFO_ERROR = exports.USER_INFO = exports.USER_ENABLE_SUCCESS = exports.USER_ENABLE_ERROR = exports.USER_ENABLE = exports.USER_EDIT_SUCCESS = exports.USER_EDIT_PASSWORD_SUCCESS = exports.USER_EDIT_PASSWORD_ERROR = exports.USER_EDIT_PASSWORD = exports.USER_EDIT_ERROR = exports.USER_EDIT = exports.USER_DISABLE_SUCCESS = exports.USER_DISABLE_ERROR = exports.USER_DISABLE = exports.USER_DEPARTMENT_TREE_BY_COMPANY_SUCCESS = exports.USER_DEPARTMENT_TREE_BY_COMPANY_ERROR = exports.USER_DEPARTMENT_TREE_BY_COMPANY = exports.USER_DEL_SUCCESS = exports.USER_DEL_ERROR = exports.USER_DEL = exports.USER_COMPANY_SUPERIOR_LIST_SUCCESS = exports.USER_COMPANY_SUPERIOR_LIST_ERROR = exports.USER_COMPANY_SUPERIOR_LIST = exports.USER_ALL_ROLE_SUCCESS = exports.USER_ALL_ROLE_ERROR = exports.USER_ALL_ROLE = exports.USER_ADD_SUCCESS = exports.USER_ADD_ERROR = exports.USER_ADD = void 0, 
exports.default = _default;

var _actionCreator = _interopRequireDefault(require("amos-processor/lib/redux/actionCreator")), _urlFormat = _interopRequireDefault(require("amos-processor/lib/utils/urlFormat")), USER_ALL_ROLE = "USER_ALL_ROLE";

exports.USER_ALL_ROLE = USER_ALL_ROLE;

var USER_ALL_ROLE_SUCCESS = "USER_ALL_ROLE_SUCCESS";

exports.USER_ALL_ROLE_SUCCESS = USER_ALL_ROLE_SUCCESS;

var USER_ALL_ROLE_ERROR = "USER_ALL_ROLE_ERROR";

exports.USER_ALL_ROLE_ERROR = USER_ALL_ROLE_ERROR;

var USER_REGION_TREE = "USER_REGION_TREE";

exports.USER_REGION_TREE = USER_REGION_TREE;

var USER_REGION_TREE_SUCCESS = "USER_REGION_TREE_SUCCESS";

exports.USER_REGION_TREE_SUCCESS = USER_REGION_TREE_SUCCESS;

var USER_REGION_TREE_ERROR = "USER_REGION_TREE_ERROR";

exports.USER_REGION_TREE_ERROR = USER_REGION_TREE_ERROR;

var USER_TABLE_INFOS = "USER_TABLE_INFOS";

exports.USER_TABLE_INFOS = USER_TABLE_INFOS;

var USER_TABLE_INFOS_SUCCESS = "USER_TABLE_INFOS_SUCCESS";

exports.USER_TABLE_INFOS_SUCCESS = USER_TABLE_INFOS_SUCCESS;

var USER_TABLE_INFOS_ERROR = "USER_TABLE_INFOS_ERROR";

exports.USER_TABLE_INFOS_ERROR = USER_TABLE_INFOS_ERROR;

var USER_DEL = "USER_DEL";

exports.USER_DEL = USER_DEL;

var USER_DEL_SUCCESS = "USER_DEL_SUCCESS";

exports.USER_DEL_SUCCESS = USER_DEL_SUCCESS;

var USER_DEL_ERROR = "USER_DEL_ERROR";

exports.USER_DEL_ERROR = USER_DEL_ERROR;

var USER_ADD = "USER_ADD";

exports.USER_ADD = USER_ADD;

var USER_ADD_SUCCESS = "USER_ADD_SUCCESS";

exports.USER_ADD_SUCCESS = USER_ADD_SUCCESS;

var USER_ADD_ERROR = "USER_ADD_ERROR";

exports.USER_ADD_ERROR = USER_ADD_ERROR;

var USER_EDIT = "USER_EDIT";

exports.USER_EDIT = USER_EDIT;

var USER_EDIT_SUCCESS = "USER_EDIT_SUCCESS";

exports.USER_EDIT_SUCCESS = USER_EDIT_SUCCESS;

var USER_EDIT_ERROR = "USER_EDIT_ERROR";

exports.USER_EDIT_ERROR = USER_EDIT_ERROR;

var USER_INFO = "USER_INFO";

exports.USER_INFO = USER_INFO;

var USER_INFO_SUCCESS = "USER_INFO_SUCCESS";

exports.USER_INFO_SUCCESS = USER_INFO_SUCCESS;

var USER_INFO_ERROR = "USER_INFO_ERROR";

exports.USER_INFO_ERROR = USER_INFO_ERROR;

var USER_DISABLE = "USER_DISABLE";

exports.USER_DISABLE = USER_DISABLE;

var USER_DISABLE_SUCCESS = "USER_DISABLE_SUCCESS";

exports.USER_DISABLE_SUCCESS = USER_DISABLE_SUCCESS;

var USER_DISABLE_ERROR = "USER_DISABLE_ERROR";

exports.USER_DISABLE_ERROR = USER_DISABLE_ERROR;

var USER_ENABLE = "USER_ENABLE";

exports.USER_ENABLE = USER_ENABLE;

var USER_ENABLE_SUCCESS = "USER_ENABLE_SUCCESS";

exports.USER_ENABLE_SUCCESS = USER_ENABLE_SUCCESS;

var USER_ENABLE_ERROR = "USER_ENABLE_ERROR";

exports.USER_ENABLE_ERROR = USER_ENABLE_ERROR;

var USER_EDIT_PASSWORD = "USER_EDIT_PASSWORD";

exports.USER_EDIT_PASSWORD = USER_EDIT_PASSWORD;

var USER_EDIT_PASSWORD_SUCCESS = "USER_EDIT_PASSWORD_SUCCESS";

exports.USER_EDIT_PASSWORD_SUCCESS = USER_EDIT_PASSWORD_SUCCESS;

var USER_EDIT_PASSWORD_ERROR = "USER_EDIT_PASSWORD_ERROR";

exports.USER_EDIT_PASSWORD_ERROR = USER_EDIT_PASSWORD_ERROR;

var USER_DEPARTMENT_TREE_BY_COMPANY = "USER_DEPARTMENT_TREE_BY_COMPANY";

exports.USER_DEPARTMENT_TREE_BY_COMPANY = USER_DEPARTMENT_TREE_BY_COMPANY;

var USER_DEPARTMENT_TREE_BY_COMPANY_SUCCESS = "USER_DEPARTMENT_TREE_BY_COMPANY_SUCCESS";

exports.USER_DEPARTMENT_TREE_BY_COMPANY_SUCCESS = USER_DEPARTMENT_TREE_BY_COMPANY_SUCCESS;

var USER_DEPARTMENT_TREE_BY_COMPANY_ERROR = "USER_DEPARTMENT_TREE_BY_COMPANY_ERROR";

exports.USER_DEPARTMENT_TREE_BY_COMPANY_ERROR = USER_DEPARTMENT_TREE_BY_COMPANY_ERROR;

var USER_COMPANY_SUPERIOR_LIST = "USER_COMPANY_SUPERIOR_LIST";

exports.USER_COMPANY_SUPERIOR_LIST = USER_COMPANY_SUPERIOR_LIST;

var USER_COMPANY_SUPERIOR_LIST_SUCCESS = "USER_COMPANY_SUPERIOR_LIST_SUCCESS";

exports.USER_COMPANY_SUPERIOR_LIST_SUCCESS = USER_COMPANY_SUPERIOR_LIST_SUCCESS;

var USER_COMPANY_SUPERIOR_LIST_ERROR = "USER_COMPANY_SUPERIOR_LIST_ERROR";

exports.USER_COMPANY_SUPERIOR_LIST_ERROR = USER_COMPANY_SUPERIOR_LIST_ERROR;

var defaultPageable = {
  current: 0,
  pageSize: 10
}, buildPageable = function(E) {
  var R = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : defaultPageable, _ = R.current, S = R.pageSize;
  return "".concat(E, "?current=").concat(_, "&pageSize=").concat(S);
};

function _default(E) {
  var R = completeSecurityUrl(E);
  return {
    userTableAction: function(E, _, S) {
      return (0, _actionCreator.default)({
        type: USER_TABLE_INFOS,
        method: "get",
        url: "".concat(buildPageable(R.userInfos, E), "&filter=").concat(_).concat(S)
      });
    },
    userDelAction: function(E) {
      return (0, _actionCreator.default)({
        type: USER_DEL,
        method: "del",
        url: "".concat(R.delUser, "?ids=").concat(E)
      });
    },
    userAddAction: function(E) {
      return (0, _actionCreator.default)({
        type: USER_ADD,
        method: "put",
        url: R.addUser,
        data: E
      });
    },
    userEditAction: function(E) {
      return (0, _actionCreator.default)({
        type: USER_EDIT,
        method: "put",
        url: R.editUser,
        data: E
      });
    },
    userEditPasswordAction: function(E) {
      return (0, _actionCreator.default)({
        type: USER_EDIT_PASSWORD,
        method: "put",
        url: R.editPassword,
        data: E
      });
    },
    userDisableAction: function(E) {
      return (0, _actionCreator.default)({
        type: USER_DISABLE,
        method: "put",
        url: "".concat(R.userDisable, "/").concat(E)
      });
    },
    userEnableAction: function(E) {
      return (0, _actionCreator.default)({
        type: USER_ENABLE,
        method: "put",
        url: "".concat(R.userEnable, "/").concat(E)
      });
    },
    getUserByIdAction: function(E) {
      return (0, _actionCreator.default)({
        type: USER_INFO,
        method: "get",
        url: "".concat(R.getUserById, "?userId=").concat(E)
      });
    },
    getAllRoleAction: function() {
      return (0, _actionCreator.default)({
        type: USER_ALL_ROLE,
        method: "get",
        url: R.getAllRole
      });
    },
    superiorUnitAction: function() {
      return (0, _actionCreator.default)({
        type: USER_COMPANY_SUPERIOR_LIST,
        method: "get",
        url: R.superiorUnitUrl
      });
    },
    getDepartmentByCompanyAction: function(E) {
      return (0, _actionCreator.default)({
        type: USER_DEPARTMENT_TREE_BY_COMPANY,
        method: "get",
        url: (0, _urlFormat.default)(R.getDepartmentByCompany, {
          id: E
        })
      });
    }
  };
}