"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 _constant = require("./constant");

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 WorkTask = function WorkTask(_ref) {
  var _data$LastRichContent;

  var data = _ref.data;

  var handleShowTaskDetail = function handleShowTaskDetail() {
    // @ts-ignore
    window.Talent.app.vent.trigger("global-pull-screen", data.taskId, "task");
  };

  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-task-title"),
    style: {
      'paddingLeft': 24
    },
    onClick: handleShowTaskDetail
  }, /*#__PURE__*/_react["default"].createElement("i", {
    className: "".concat(preCls, "__table-row-title-icon ").concat(_constant.EStatusStatus2ClassType[data.iconStatus])
  }), /*#__PURE__*/_react["default"].createElement("span", {
    className: "".concat(preCls, "__table-task-title-text")
  }, _openData["default"].parseString((0, _tools.htmlDecodeByRegExp)(data.name))))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement(_progress["default"], {
    id: "".concat(data.id),
    type: "task",
    status: data.status === 1 || data.status === 2 && data.riskLevel === 4 ? "normal" : "risk",
    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 = WorkTask;
exports["default"] = _default;