"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")), _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")), _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")), _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")), _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")), _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")), _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")), _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")), _react = _interopRequireWildcard(require("react")), _amosReactRouter = require("amos-react-router"), _amosTool = require("amos-tool"), _amosFramework = require("amos-framework"), _amosAntd = require("amos-antd"), _rayEventpool = require("ray-eventpool"), _urlFormat = _interopRequireDefault(require("amos-processor/lib/utils/urlFormat")), endConf = _interopRequireWildcard(require("amos-processor/lib/config/endconf")), _urlConsts = require("./../../consts/urlConsts"), _customRoutes = require("./../../routes/customRoutes"), _mainframe = _interopRequireDefault(require("../common/mainframe")), _nodeConf = require("./../zonglan/home/statistics/modelConf/nodeConf"), _AlarmTools = _interopRequireDefault(require("./extratools/AlarmTools")), _Help = _interopRequireDefault(require("./extratools/Help")), _outterUrlConsts = require("../../consts/outterUrlConsts");

function _getRequireWildcardCache(e) {
  if ("function" != typeof WeakMap) return null;
  var t = new WeakMap, r = new WeakMap;
  return (_getRequireWildcardCache = function(e) {
    return e ? r : t;
  })(e);
}

function _interopRequireWildcard(e, t) {
  if (!t && e && e.__esModule) return e;
  if (null === e || "object" !== _typeof(e) && "function" != typeof e) return {
    default: e
  };
  var r = _getRequireWildcardCache(t);
  if (r && r.has(e)) return r.get(e);
  var o = {}, i = Object.defineProperty && Object.getOwnPropertyDescriptor;
  for (var n in e) if ("default" !== n && Object.prototype.hasOwnProperty.call(e, n)) {
    var a = i ? Object.getOwnPropertyDescriptor(e, n) : null;
    a && (a.get || a.set) ? Object.defineProperty(o, n, a) : o[n] = e[n];
  }
  return o.default = e, r && r.set(e, o), o;
}

function _createSuper(e) {
  var t = _isNativeReflectConstruct();
  return function() {
    var r, o = (0, _getPrototypeOf2.default)(e);
    if (t) {
      var i = (0, _getPrototypeOf2.default)(this).constructor;
      r = Reflect.construct(o, arguments, i);
    } else r = o.apply(this, arguments);
    return (0, _possibleConstructorReturn2.default)(this, r);
  };
}

function _isNativeReflectConstruct() {
  if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  if (Reflect.construct.sham) return !1;
  if ("function" == typeof Proxy) return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {}))), 
    !0;
  } catch (e) {
    return !1;
  }
}

require("../../styles/view/mainframe/mainframe.scss");

var enhanceStorage = _amosFramework.Connect.enhanceStorage, lsTool = _amosTool.Store.lsTool, AmosConfig = endConf.AmosConfig, loginURI = AmosConfig.httpURI.loginURI, MenuItem = _amosAntd.Menu.Item, RootView = function(e) {
  (0, _inherits2.default)(r, e);
  var t = _createSuper(r);
  function r(e) {
    var o;
    return (0, _classCallCheck2.default)(this, r), o = t.call(this, e), (0, _defineProperty2.default)((0, 
    _assertThisInitialized2.default)(o), "onOpenDefaultPage", (function(e) {
      if ("/main" === location.pathname) {
        var t = e.filter((function(e) {
          return e.url;
        }))[0] || {};
        _amosTool.utils.isEmpty(t) || t.url && (_amosReactRouter.browserHistory.push(t.url), 
        o.setState({
          siderMenusList: t.children || []
        }));
      }
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(o), "getFrameConfig", (function() {
      return {
        opSearchMenusUrl: (0, _urlFormat.default)(_urlConsts.secExtUrl.opSearchMenusUrl),
        defaultLink: "/biz",
        loginLink: o.login
      };
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(o), "getSysToolProps", (function() {
      return {
        userPic: require("./../../assets/user/normal.png"),
        loginOutUrl: _urlConsts.secExtUrl.loginOutUrl,
        userInfoLink: "/main/securityConfig",
        userExtra: !0
      };
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(o), "login", (function() {
      window.location.href = loginURI;
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(o), "clickTestMenu", (function() {})), 
    (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(o), "renderExtraSub", (function() {
      var e = (0, _outterUrlConsts.analysis)();
      return [ _react.default.createElement("div", {
        key: "extra-1",
        className: "amos-dropnav-item extra-temp-style"
      }, _react.default.createElement("a", {
        href: e,
        target: "_blank"
      }, "数据分析")) ];
    })), o.state = {
      siderMenusList: [],
      selectedSubMenuKey: ""
    }, o;
  }
  return (0, _createClass2.default)(r, [ {
    key: "componentDidMount",
    value: function() {}
  }, {
    key: "componentWillUnmount",
    value: function() {}
  }, {
    key: "render",
    value: function() {
      var e = this.getFrameConfig(), t = this.getSysToolProps(), r = this.state, o = r.siderMenusList, i = r.selectedSubMenuKey;
      return _react.default.createElement(_mainframe.default, (0, _extends2.default)({}, e, {
        onMenuLoadCompleted: this.openDefaultPage,
        sysToolPorps: t,
        siderMenusList: o,
        selectedSubMenuKey: i,
        menuWidth: "160px"
      }, this.props));
    }
  } ]), r;
}(_react.Component);

RootView.displayName = "RootView";

var _default = RootView;

exports.default = _default;