"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

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

var _react = _interopRequireWildcard(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _reactCollapse = require("react-collapse");

var _okrTree = _interopRequireDefault(require("../components/okr-tree"));

var _blockLine = _interopRequireDefault(require("../components/block-line"));

var _addParentOkr = _interopRequireDefault(require("./add-parent-okr"));

var _createKrItem = _interopRequireDefault(require("./create-kr-item"));

var _context2 = require("../context");

var _changeOkrModal = _interopRequireDefault(require("../../change-okr-modal"));

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

var _requestApis = require("../request-apis");

var _paddingLayout = _interopRequireDefault(require("../components/padding-layout"));

var _empty = _interopRequireDefault(require("./empty"));

var _bsGlobal = require("../../../utils/bs-global");

var _dragOrderKr = require("./drag-order-kr");

var _loading = _interopRequireDefault(require("../loading"));

var _auth = require("../../../utils/auth");

var _getLocale = require("../../../utils/getLocale");

var _helper = require("../helper");

require("./index.css");

var _excluded = ["mileStoneId"];

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

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

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); }); }; }

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

var _getUserInfo = (0, _bsGlobal.getUserInfo)(),
    Name = _getUserInfo.Name,
    Id = _getUserInfo.Id,
    UserAvatar = _getUserInfo.UserAvatar;

var preCls = 'okr-detail-okrs-list';

var treeDataFormate = function treeDataFormate(nodes) {
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'kr';
  var canEditOkr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  var formateNodes = [];
  nodes.forEach(function (it, index) {
    var title = ''; // if (type == "kr" || type == "kr-parent") title = it.mileStoneName;

    if (type == 'o-child' || type == 'o-parent') title = it.workName;
    formateNodes.push({
      key: it.mileStoneId,
      index: index,
      title: title,
      isLeaf: true,
      nodeType: type,
      data: it,
      canEditOkr: canEditOkr
    });
  });
  return formateNodes;
};

var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
  var okrId = props.okrId,
      okrInfo = props.okrInfo;
  var wrapperRef = (0, _react.useRef)();
  var parenOkrtRef = (0, _react.useRef)();

  var _useState = (0, _react.useState)([]),
      _useState2 = _slicedToArray(_useState, 2),
      pureKrs = _useState2[0],
      setPureKrs = _useState2[1];

  var _useState3 = (0, _react.useState)([]),
      _useState4 = _slicedToArray(_useState3, 2),
      krs = _useState4[0],
      setKrs = _useState4[1];

  var _useState5 = (0, _react.useState)(false),
      _useState6 = _slicedToArray(_useState5, 2),
      createKrShow = _useState6[0],
      setCreateKrShow = _useState6[1];

  var _useState7 = (0, _react.useState)(),
      _useState8 = _slicedToArray(_useState7, 2),
      toUser = _useState8[0],
      setToUser = _useState8[1];

  var _useState9 = (0, _react.useState)(true),
      _useState10 = _slicedToArray(_useState9, 2),
      loading = _useState10[0],
      setLoading = _useState10[1];

  var _useContext = (0, _react.useContext)(_context2.GeneralDataContext),
      _useContext$generalPa = _useContext.generalParent,
      generalParent = _useContext$generalPa === void 0 ? {} : _useContext$generalPa,
      setGeneralParent = _useContext.setGeneralParent,
      setShowOkrEvalute = _useContext.setShowOkrEvalute;

  var _useContext2 = (0, _react.useContext)(_context2.CommonContext),
      refreshAll = _useContext2.refreshAll,
      approvalSetting = _useContext2.approvalSetting;

  var parentId = generalParent.parentId,
      parentOkr = generalParent.parentOkr,
      parentKr = generalParent.parentKr;

  var _useState11 = (0, _react.useState)(true),
      _useState12 = _slicedToArray(_useState11, 2),
      isOpened = _useState12[0],
      setIsOpened = _useState12[1];

  var _useState13 = (0, _react.useState)(),
      _useState14 = _slicedToArray(_useState13, 2),
      childOkrs = _useState14[0],
      setChildOkrs = _useState14[1]; // 权限


  var _useState15 = (0, _react.useState)(function () {
    var principalUser = okrInfo.principalUser,
        createUserId = okrInfo.createUserId;
    var hasAuth = new _auth.OAuth({
      principalUser: principalUser,
      createUserId: createUserId
    }).hasAuth();
    var livetime = okrInfo.status != 2;
    return hasAuth && livetime;
  }),
      _useState16 = _slicedToArray(_useState15, 1),
      canEditOkr = _useState16[0];

  var getParentAndChildWorks = /*#__PURE__*/function () {
    var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
      var _yield$getRelWorks, Data, _Data$childWorks, childWorks, parentWork, parentKr, authChildWorks;

      return regeneratorRuntime.wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              _context.next = 2;
              return (0, _requestApis.getRelWorks)(okrInfo.workId);

            case 2:
              _yield$getRelWorks = _context.sent;
              Data = _yield$getRelWorks.Data;
              _Data$childWorks = Data.childWorks, childWorks = _Data$childWorks === void 0 ? [] : _Data$childWorks, parentWork = Data.parentWork, parentKr = Data.parentKr;
              authChildWorks = (childWorks || []).filter(function (item) {
                return item.OkrVisible;
              });

              if (authChildWorks.length > 0) {
                setChildOkrs(treeDataFormate(authChildWorks, 'o-child'));
              } else {
                setChildOkrs(null);
              }

              parentWork && setGeneralParent({
                parentId: parentKr ? parentKr.mileStoneId : parentWork.workId,
                parentType: parentKr ? 2 : 1,
                parentOkr: parentWork,
                parentKr: parentKr
              });

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

    return function getParentAndChildWorks() {
      return _ref.apply(this, arguments);
    };
  }(); // 权限 目标参与人


  var _useState17 = (0, _react.useState)(false),
      _useState18 = _slicedToArray(_useState17, 2),
      isInnerUser = _useState18[0],
      setIsInnerUser = _useState18[1];

  (0, _react.useEffect)(function () {
    (0, _requestApis.getOkrUsers)(okrInfo.workId).then(function (res) {
      var _res$Data$filter = res.Data.filter(function (it) {
        return it.order == 2;
      }),
          _res$Data$filter2 = _slicedToArray(_res$Data$filter, 1),
          innerUser = _res$Data$filter2[0];

      var hasUser = innerUser.users.filter(function (it) {
        return it.userId == Id;
      });
      if (hasUser.length) setIsInnerUser(true);
    });
    getParentAndChildWorks();
  }, []);

  var updateKrs = function updateKrs() {
    return (0, _requestApis.getKrs)({
      okrId: okrId
    }).then(function (pureKrs) {
      var arr = pureKrs.filter(function (item) {
        return item.mileStoneId !== 0;
      });
      setPureKrs(arr);
      setLoading(false);
      setShowOkrEvalute(arr.length > 0 && arr.filter(function (item) {
        return !item.isEvaluate;
      }) == 0);
    });
  };

  (0, _react.useImperativeHandle)(ref, function () {
    return {
      updateKrs: updateKrs
    };
  });
  (0, _react.useEffect)(function () {
    updateKrs();
  }, []);
  (0, _react.useEffect)(function () {
    var strucKrs = treeDataFormate(pureKrs, 'kr', canEditOkr);
    setKrs(strucKrs);
  }, [pureKrs, canEditOkr]);

  var onAddKrHandler = function onAddKrHandler(kr) {
    refreshAll();
    updateKrs();

    _toast["default"].Success((0, _getLocale.getLocale)('OKR_Db_Success'), {
      canClose: false
    });
  };

  var changeParentOkrHandler = function changeParentOkrHandler(confirm) {
    var workId = confirm.workId,
        _okrInfo = confirm._okrInfo;
    var params = {
      okrId: okrInfo.workId,
      parentId: okrInfo.parentId || okrInfo.parentKrId,
      parentType: 1,
      parentKr: null,
      parentOkr: null
    };

    if (workId === 0) {
      // 说明对齐目标是KR
      var mileStoneId = confirm.mileStoneId,
          restConfirm = _objectWithoutProperties(confirm, _excluded);

      params.parentId = mileStoneId;
      params.parentType = 2;
      params.parentKr = _objectSpread(_objectSpread({
        mileStoneId: mileStoneId
      }, restConfirm), {}, {
        workId: _okrInfo.workId
      });
      params.parentOkr = _okrInfo;
    } else {
      // 我就是对齐目标
      var _workId = confirm.workId;
      params.parentId = _workId;
      params.parentType = 1;
      params.parentOkr = confirm;
    }

    (0, _requestApis.updateParentId)(params).then(function (data) {
      if (data.Code == 1) {
        _toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));

        setGeneralParent({
          parentId: params.parentId,
          parentType: params.parentType,
          parentOkr: params.parentOkr,
          parentKr: params.parentKr
        });
      } else {
        _toast["default"].Error(data.Message);
      }
    });
  };

  var onAddParentOkrHandler = function onAddParentOkrHandler() {
    (0, _requestApis.getOrg)().then(function (res) {
      if (res.Code == 1) {
        var SuperiorUser = res.Data.SuperiorUser;

        if (SuperiorUser) {
          setToUser({
            name: SuperiorUser.Name,
            userId: SuperiorUser.Id,
            avatar: SuperiorUser.UserAvatar
          });
        } else {
          setToUser({});
        }

        parenOkrtRef.current && parenOkrtRef.current.show(document.body, 0);
      }
    });
  };

  var onKrRemoveHandler = function onKrRemoveHandler(krId) {
    setPureKrs(_toConsumableArray(pureKrs.filter(function (item) {
      return item.mileStoneId !== krId;
    })));
  };

  var onParentRemoveHandler = function onParentRemoveHandler() {
    setGeneralParent({
      parentId: 0,
      parentType: 0,
      parentOkr: null
    });
  };

  var onOkrItemDropHandler = function onOkrItemDropHandler(info) {
    if (!canEditOkr) return;
    var dropNode = info.node;
    var dragNode = info.dragNode;
    var dropPos = info.node.pos.split('-');
    var dropPosition = info.dropPosition - Number(dropPos[dropPos.length - 1]); // 移动类型，after 1 before 2

    var isDown = dropPosition != -1;
    (0, _requestApis.krChangeOrder)({
      baseOn: 0,
      workId: okrInfo.workId,
      positionType: isDown ? 1 : 2,
      movingObjId: dragNode.key,
      referenceObjId: dropNode.key
    }).then(function (res) {
      // 修改UI数据相应
      if (res.Code != 1) return;
      var pureNewKrs = [];

      if (dropPosition == -1) {
        // 拖到了顶部
        pureNewKrs = (0, _dragOrderKr.moveFront)(krs, dragNode);
      } else {
        // 下
        pureNewKrs = (0, _dragOrderKr.moveNext)(krs, dropNode, dragNode);
      }

      setPureKrs(pureNewKrs);
    });
  };

  var okrParent;

  if (parentKr) {
    var newParentKr = _objectSpread(_objectSpread({}, parentKr), {}, {
      parentOkr: parentOkr
    });

    okrParent = treeDataFormate([newParentKr], 'kr-parent');
  } else if (parentOkr) {
    okrParent = treeDataFormate([parentOkr], 'o-parent');
  }

  var isShowAlignOkr = (0, _react.useMemo)(function () {
    return childOkrs && childOkrs.length > 0 || // 有子目标
    parentOkr || // 有父目标
    !parentOkr && canEditOkr;
  }, // 无父目标但有权限编辑
  [parentOkr, childOkrs, canEditOkr]);

  var renderKrs = function renderKrs() {
    var _classNames, _okrInfo$aiteUsers;

    if (!loading && !krs.length && !createKrShow) {
      return /*#__PURE__*/_react["default"].createElement(_empty["default"], {
        onCreateKr: function onCreateKr() {
          return setCreateKrShow(true);
        },
        canEditOkr: canEditOkr || isInnerUser || okrInfo.isParticipant,
        style: isShowAlignOkr ? {
          padding: '40px 0 24px 0'
        } : {
          padding: '100px 0'
        }
      });
    }

    return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
      className: (0, _classnames["default"])("".concat(preCls, "__okr-list"), (_classNames = {}, _defineProperty(_classNames, "".concat(preCls, "__okr-list--draggable"), canEditOkr), _defineProperty(_classNames, "".concat(preCls, "__okr-list--readonly"), !(canEditOkr || isInnerUser)), _classNames))
    }, /*#__PURE__*/_react["default"].createElement(_paddingLayout["default"], {
      padding: "0 32px 0 18px"
    }, /*#__PURE__*/_react["default"].createElement(_okrTree["default"], {
      data: krs,
      approvalSetting: approvalSetting,
      okrInfo: okrInfo,
      draggable: canEditOkr && (okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState) !== _helper.EApproveStatus.UnderApproval,
      onDrop: onOkrItemDropHandler
    }))), (canEditOkr || isInnerUser || ((_okrInfo$aiteUsers = okrInfo.aiteUsers) === null || _okrInfo$aiteUsers === void 0 ? void 0 : _okrInfo$aiteUsers.find(function (item) {
      return (0, _bsGlobal.getUserInfo)().Id == item;
    }))) && (0, _helper.getApprovalOkr)(approvalSetting, 'createOkr', okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.applyState, okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes) && /*#__PURE__*/_react["default"].createElement("div", {
      ref: wrapperRef,
      className: (0, _classnames["default"])("".concat(preCls, "__addkr"))
    }, /*#__PURE__*/_react["default"].createElement(_paddingLayout["default"], null, createKrShow ? /*#__PURE__*/_react["default"].createElement(_createKrItem["default"], {
      startDate: okrInfo.startDate,
      endDate: okrInfo.endDate,
      workId: okrInfo.workId,
      getWrapperRef: function getWrapperRef() {
        return wrapperRef;
      },
      addKr: onAddKrHandler,
      onHide: function onHide() {
        return setCreateKrShow(false);
      }
    }) : /*#__PURE__*/_react["default"].createElement("div", {
      onClick: function onClick() {
        return setCreateKrShow(true);
      }
    }, /*#__PURE__*/_react["default"].createElement("span", {
      className: (0, _classnames["default"])("".concat(preCls, "__addkr-prefix"), 'tu-icon-add1')
    }), /*#__PURE__*/_react["default"].createElement("span", {
      className: (0, _classnames["default"])("".concat(preCls, "__addkr-text"))
    }, (0, _getLocale.getLocale)('OKR_MyO_Pop_Butt_AddKR'))))));
  };

  return /*#__PURE__*/_react["default"].createElement(_context2.OkrListContext.Provider, {
    value: {
      // O 行，点击修改对齐目标触发事件
      modifyOParent: onAddParentOkrHandler,
      removeKr: onKrRemoveHandler,
      removeParent: onParentRemoveHandler,
      updateKrs: updateKrs,
      getParentAndChildWorks: getParentAndChildWorks
    }
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])(preCls)
  }, !loading ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, renderKrs(), isShowAlignOkr && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_blockLine["default"], {
    style: {
      padding: '0 32px'
    }
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(preCls, "__align-to"))
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(preCls, "__align-to-title"))
  }, (0, _getLocale.getLocale)('OKR_MyO_Pop_SetAlignment')), !parentOkr && canEditOkr ? /*#__PURE__*/_react["default"].createElement(_addParentOkr["default"], {
    onClick: onAddParentOkrHandler
  }) : /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(preCls, "__align-to-tree"))
  }, /*#__PURE__*/_react["default"].createElement(_okrTree["default"], {
    data: okrParent
  }))), childOkrs && childOkrs.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(preCls, "__align-on"))
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(preCls, "__align-on-title"), _defineProperty({}, "".concat(preCls, "__align-on-title--open"), isOpened)),
    onClick: function onClick() {
      return setIsOpened(!isOpened);
    }
  }, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_KRP_OKRs_Alignedmeobje'), "\uFF08", childOkrs.length, "\uFF09")), /*#__PURE__*/_react["default"].createElement(_reactCollapse.Collapse, {
    isOpened: isOpened
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(preCls, "__align-on-tree"))
  }, /*#__PURE__*/_react["default"].createElement(_okrTree["default"], {
    data: childOkrs
  }))))), toUser && /*#__PURE__*/_react["default"].createElement(_changeOkrModal["default"], {
    className: "parent-target-pop-index",
    alilgn: "top",
    eventBridge: "",
    hideCancelBtn: true,
    okrPopType: 1,
    toUser: toUser // 这里异步数据
    ,
    ref: parenOkrtRef,
    parentId: parentId,
    onConfirm: changeParentOkrHandler
  })) : /*#__PURE__*/_react["default"].createElement(_loading["default"], {
    type: "panel"
  })));
});

exports["default"] = _default;