"use strict";

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

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

var _openData = _interopRequireDefault(require("../../../../../utils/open-data"));

var _progress = _interopRequireDefault(require("../progress"));

var _schedule = _interopRequireDefault(require("../schedule"));

var _utils = require("./utils");

require("./index.css");

var _tools = require("../../../../../utils/tools");

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

var preCls = 'tita-summary-work-progress';

var Work = function Work(_ref) {
  var _data$LastRichContent;

  var data = _ref.data;

  var handleShowWork = function handleShowWork(item) {
    window.open("#/work?&work_id=".concat(item.Id));
  };

  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "__table-row-title"),
    onClick: function onClick() {
      return handleShowWork(data);
    }
  }, /*#__PURE__*/_react["default"].createElement("i", {
    className: "".concat(preCls, "__table-row-title-icon tu-icon-project-s")
  }), /*#__PURE__*/_react["default"].createElement("span", {
    className: "".concat(preCls, "__table-row-title-text")
  }, _openData["default"].parseString((0, _tools.htmlDecodeByRegExp)(data.Name))), data.IsDeadLine === true && /*#__PURE__*/_react["default"].createElement("span", {
    className: "".concat(preCls, "__table-row-title-remain")
  }, data.DateContent))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement(_progress["default"], {
    id: "".concat(data.Id),
    type: "task",
    status: (0, _utils.getStatus)(data.RiskLevel || data.riskLevel || 1),
    value: Number(data.Progress)
  })), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement(_schedule["default"], {
    curContent: (data === null || data === void 0 ? void 0 : (_data$LastRichContent = data.LastRichContent) === null || _data$LastRichContent === void 0 ? void 0 : _data$LastRichContent.trim()) || (data === null || data === void 0 ? void 0 : data.LastContent) || "",
    value: data === null || data === void 0 ? void 0 : data.LastContents,
    id: data.Id
  }))));
};

var _default = Work;
exports["default"] = _default;