"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _vtxBaseModal = _interopRequireDefault(require("../vtx-base-modal"));
var _components = require("./components");
var _api = require("./api");
require("../style");
var _StaticInfo = _interopRequireDefault(require("./components/StaticInfo"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var TABS_BASE = 'staff-base';
var TABS_CALENDAR = 'staff-calender';
var TABS_DETAIL = 'staff-detail';
var TABS_ALARM = 'staff-alarm';
var TABS_ATTENDANCE = 'staff-attendance';
var TABS_EUQIPMENT = 'staff-equipment';
var tabs = [{
  key: TABS_BASE,
  title: '总览信息'
}, {
  key: TABS_CALENDAR,
  title: '作业日历'
}, {
  key: TABS_DETAIL,
  title: '详细信息'
}, {
  key: TABS_ALARM,
  title: '报警信息'
}, {
  key: TABS_ATTENDANCE,
  title: '考勤信息'
}, {
  key: TABS_EUQIPMENT,
  title: '设备信息'
}];
var VtxQyryModal = function VtxQyryModal(props) {
  var id = props.id,
    title = props.title,
    subTitle = props.subTitle,
    theme = props.theme,
    source = props.source,
    visible = props.visible,
    onCancel = props.onCancel,
    _props$top = props.top,
    top = _props$top === void 0 ? 50 : _props$top,
    _props$frameParams = props.frameParams,
    frameParams = _props$frameParams === void 0 ? {} : _props$frameParams,
    _props$customMapInfo = props.customMapInfo,
    customMapInfo = _props$customMapInfo === void 0 ? {} : _props$customMapInfo,
    _props$tabChose = props.tabChose,
    tabChose = _props$tabChose === void 0 ? '' : _props$tabChose;
  var _BaseService$useTabCo = _api.BaseService.useTabConfig(id),
    tabConfig = _BaseService$useTabCo.tabConfig,
    tabIsFilter = _BaseService$useTabCo.tabIsFilter;
  var _BaseService$useBaseI = _api.BaseService.useBaseInfo(id),
    baseInfo = _BaseService$useBaseI.baseInfo,
    detail = _BaseService$useBaseI.detail;
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, visible && (/*#__PURE__*/_react["default"].createElement(_vtxBaseModal["default"], {
    id: id,
    type: "qyry",
    title: title,
    subTitle: subTitle,
    visible: visible,
    source: source,
    theme: theme,
    onCancel: onCancel,
    frameParams: frameParams,
    tabChose: tabChose,
    top: top,
    tabs: tabIsFilter ? tabs.filter(function (item) {
      return tabConfig === null || tabConfig === void 0 ? void 0 : tabConfig.map(function (ele) {
        return ele.key;
      }).includes(item.key);
    }) : tabs,
    contents: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TABS_BASE, /*#__PURE__*/_react["default"].createElement(_components.BaseInfo, {
      id: id,
      baseInfo: baseInfo,
      employmentTypeCode: detail === null || detail === void 0 ? void 0 : detail.employmentTypeCode,
      customMapInfo: customMapInfo
    })), TABS_CALENDAR, /*#__PURE__*/_react["default"].createElement(_StaticInfo["default"], {
      id: id
    })), TABS_DETAIL, /*#__PURE__*/_react["default"].createElement(_components.DetailInfo, {
      id: id,
      detail: detail
    })), TABS_ALARM, /*#__PURE__*/_react["default"].createElement(_components.AlarmInfo, {
      id: id
    })), TABS_ATTENDANCE, /*#__PURE__*/_react["default"].createElement(_components.Attendance, {
      id: id
    })), TABS_EUQIPMENT, /*#__PURE__*/_react["default"].createElement(_components.Equipment, {
      id: id
    }))
  })));
};
var _default = exports["default"] = VtxQyryModal;
//# sourceMappingURL=index.js.map
