"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _FormModal = _interopRequireDefault(require("../../../FormModal"));
var _index = _interopRequireDefault(require("./index.less"));
var _timeline = _interopRequireDefault(require("antd/lib/timeline"));
var _config = _interopRequireDefault(require("../config"));
var _ProcessDetails = _interopRequireDefault(require("./ProcessDetails"));
var _ProcessDetailsService = _interopRequireDefault(require("./ProcessDetailsService"));
var _CreateTicket = require("../../Components/ServiceComponents/CreateTicket");
var _PublicService = _interopRequireDefault(require("../../../../_mapUtil/PublicService"));
var _CheckCircleOutlined = _interopRequireDefault(require("@ant-design/icons/CheckCircleOutlined"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
var processDetailParams = _config["default"].processDetailParams,
  processOperateTypeName = _config["default"].processOperateTypeName,
  processTypeJudge = _config["default"].processTypeJudge,
  processOperateTypeNameService = _config["default"].processOperateTypeNameService;
var ProcessDetailPage = function ProcessDetailPage(props) {
  var _props$formData = props.formData,
    formData = _props$formData === void 0 ? {} : _props$formData,
    _props$detailsVal = props.detailsVal,
    detailsVal = _props$detailsVal === void 0 ? {} : _props$detailsVal,
    orderType = props.orderType;
  var modalType = orderType ? (processOperateTypeName === null || processOperateTypeName === void 0 ? void 0 : processOperateTypeName[formData === null || formData === void 0 ? void 0 : formData.operateTypeCode]) || '' : processDetailParams(formData) || '';
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, orderType ? /*#__PURE__*/_react["default"].createElement(_ProcessDetails["default"], {
    detailsVal: formData,
    details: detailsVal,
    modalType: modalType,
    orderType: orderType
  }) :
  /*#__PURE__*/
  // 客服工单详情
  _react["default"].createElement(_ProcessDetailsService["default"], {
    detailsVal: formData,
    details: detailsVal,
    modalType: modalType,
    orderType: orderType
  }));
};

// 流程信息展示---客服工单
var ProcessItems = function ProcessItems(props) {
  var _props$detailsVal2 = props.detailsVal,
    detailsVal = _props$detailsVal2 === void 0 ? {} : _props$detailsVal2;
  var taskList = (detailsVal === null || detailsVal === void 0 ? void 0 : detailsVal.taskList) || [];
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(_index["default"].processItemWrap)
  }, /*#__PURE__*/_react["default"].createElement(_timeline["default"], null, taskList !== null && taskList !== void 0 && taskList.length ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, taskList.map(function (val, idx) {
    return /*#__PURE__*/_react["default"].createElement(_timeline["default"].Item, {
      key: idx,
      dot: /*#__PURE__*/_react["default"].createElement(_CheckCircleOutlined["default"], null)
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: _index["default"].processItem
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: _index["default"].processTime
    }, val === null || val === void 0 ? void 0 : val.operateTime), (val === null || val === void 0 ? void 0 : val.operateTypeCode) === 8 && (val === null || val === void 0 ? void 0 : val.operateContent) !== '再次办理' ? /*#__PURE__*/_react["default"].createElement("div", {
      className: _index["default"].itemTitle
    }, /*#__PURE__*/_react["default"].createElement("div", null, "\u81EA\u52A8\u7ED3\u6848")) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
      className: _index["default"].itemTitle
    }, /*#__PURE__*/_react["default"].createElement("div", null, ['撤销', '再次办理'].includes(val === null || val === void 0 ? void 0 : val.operateContent) || (val === null || val === void 0 ? void 0 : val.operateTypeCode) === 4 ? val === null || val === void 0 ? void 0 : val.operateContent : processOperateTypeNameService(val)
    // processOperateTypeName?.[val?.operateTypeCode] || val?.operateType
    ), (val === null || val === void 0 ? void 0 : val.operateTypeCode) == -1 ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", null, "\u4E0A\u62A5\u4EBA\uFF1A", (val === null || val === void 0 ? void 0 : val.operateMan) || '-'), /*#__PURE__*/_react["default"].createElement("div", null, "\u4E0A\u62A5\u65F6\u95F4\uFF1A", (val === null || val === void 0 ? void 0 : val.reportTime) || '-')) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", null, "\u529E\u7406\u4EBA\uFF1A", val !== null && val !== void 0 && val.disposeDeptName ? "".concat(val === null || val === void 0 ? void 0 : val.disposeDeptName).concat(val !== null && val !== void 0 && val.operateMan ? "-".concat(val === null || val === void 0 ? void 0 : val.operateMan) : '') : (val === null || val === void 0 ? void 0 : val.operateMan) || '-'),
    // ['催办', '批示', '再次办理', '回访'].includes(
    //   val?.operateType,
    // )
    processTypeJudge({
      typeList: ['催办', '批示', '再次办理', '回访'],
      processVal: val
    }) ? null : /*#__PURE__*/_react["default"].createElement("div", null, "\u529E\u7406\u65F6\u957F\uFF1A", _PublicService["default"].minutesToTime(val === null || val === void 0 ? void 0 : val.disposeMinute)))), /*#__PURE__*/_react["default"].createElement("div", {
      className: _index["default"].processDetail
    },
    // ['上报', '撤销', '催办'].includes(val?.operateType)
    processTypeJudge({
      typeList: ['上报', '撤销', '催办'],
      processVal: val
    }) || ['撤销'].includes(val === null || val === void 0 ? void 0 : val.operateContent) ? null : /*#__PURE__*/_react["default"].createElement(ProcessDetailPage, _extends({}, props, {
      formData: val
    }))))));
  })) : null));
};

// 流程信息展示---内部工单
var InnerProcessItems = function InnerProcessItems(props) {
  var _props$detailsVal3 = props.detailsVal,
    detailsVal = _props$detailsVal3 === void 0 ? {} : _props$detailsVal3;
  var taskList = (detailsVal === null || detailsVal === void 0 ? void 0 : detailsVal.taskList) || [];
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(_index["default"].processItemWrap)
  }, /*#__PURE__*/_react["default"].createElement(_timeline["default"], null, taskList !== null && taskList !== void 0 && taskList.length ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, taskList.map(function (val, idx) {
    return /*#__PURE__*/_react["default"].createElement(_timeline["default"].Item, {
      key: idx,
      dot: /*#__PURE__*/_react["default"].createElement(_CheckCircleOutlined["default"], null)
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: _index["default"].processItem
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: _index["default"].processTime
    }, val === null || val === void 0 ? void 0 : val.operateTime), /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
      className: _index["default"].itemTitle
    }, /*#__PURE__*/_react["default"].createElement("div", null, ['撤销'].includes(val === null || val === void 0 ? void 0 : val.operateContent) ? val === null || val === void 0 ? void 0 : val.operateContent : (processOperateTypeName === null || processOperateTypeName === void 0 ? void 0 : processOperateTypeName[val === null || val === void 0 ? void 0 : val.operateTypeCode]) || (val === null || val === void 0 ? void 0 : val.operateType)), (val === null || val === void 0 ? void 0 : val.operateTypeCode) == -1 ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", null, "\u4E0A\u62A5\u4EBA\uFF1A", (val === null || val === void 0 ? void 0 : val.operateMan) || '-'), /*#__PURE__*/_react["default"].createElement("div", null, "\u4E0A\u62A5\u65F6\u95F4\uFF1A", (val === null || val === void 0 ? void 0 : val.reportTime) || '-')) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", null, "\u529E\u7406\u4EBA\uFF1A", val !== null && val !== void 0 && val.disposeDeptName ? "".concat(val === null || val === void 0 ? void 0 : val.disposeDeptName).concat(val !== null && val !== void 0 && val.operateMan ? "-".concat(val === null || val === void 0 ? void 0 : val.operateMan) : '') : (val === null || val === void 0 ? void 0 : val.operateMan) || '-'), ['催办'].includes(val === null || val === void 0 ? void 0 : val.operateType) ? null : ['到场'].includes(processOperateTypeName === null || processOperateTypeName === void 0 ? void 0 : processOperateTypeName[val === null || val === void 0 ? void 0 : val.operateTypeCode]) ? /*#__PURE__*/_react["default"].createElement("div", null, "\u5230\u573A\u65F6\u957F\uFF1A", _PublicService["default"].minutesToTime(val === null || val === void 0 ? void 0 : val.disposeMinute)) : /*#__PURE__*/_react["default"].createElement("div", null, "\u529E\u7406\u65F6\u957F\uFF1A", _PublicService["default"].minutesToTime(val === null || val === void 0 ? void 0 : val.disposeMinute)))), /*#__PURE__*/_react["default"].createElement("div", {
      className: _index["default"].processDetail
    }, ['上报', '撤销', '催办'].includes(val === null || val === void 0 ? void 0 : val.operateType) || ['撤销'].includes(val === null || val === void 0 ? void 0 : val.operateContent) ? null : /*#__PURE__*/_react["default"].createElement(ProcessDetailPage, _extends({}, props, {
      formData: val
    }))))));
  })) : null));
};
var ProcessInfo = function ProcessInfo(props) {
  var isProcess = props.isProcess,
    sortClick = props.sortClick,
    _props$sortType = props.sortType,
    sortType = _props$sortType === void 0 ? 'dx' : _props$sortType,
    orderType = props.orderType;
  var items = [{
    type: 'card',
    label: /*#__PURE__*/_react["default"].createElement(_CreateTicket.MyAnchor, {
      title: "\u6D41\u7A0B\u4FE1\u606F",
      href: "processInfo"
    }),
    items: [{
      type: 'blank',
      content: orderType ? /*#__PURE__*/_react["default"].createElement(InnerProcessItems, props) : /*#__PURE__*/_react["default"].createElement(ProcessItems, props)
    }]
  }];
  var sortList = [{
    label: '正序',
    iconUrl: 'zx',
    iconUrlOn: 'zxOn',
    params: {}
  }, {
    label: '倒序',
    iconUrl: 'dx',
    iconUrlOn: 'dxOn',
    params: {}
  }];
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(_index["default"].orderProcessWrap, " ").concat(isProcess && _index["default"].orderProcessWrapOther)
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: _index["default"].mySort
  }, sortList.map(function (val, idx) {
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(_index["default"].sortitem, " ").concat(sortType === val.iconUrl && _index["default"].sortitemOn),
      key: idx,
      onClick: function onClick() {
        return sortClick(val);
      }
    }, /*#__PURE__*/_react["default"].createElement("img", {
      src: require("../../assets/".concat(sortType === val.iconUrl ? val === null || val === void 0 ? void 0 : val.iconUrlOn : val.iconUrl, ".png")),
      className: _index["default"].sortIcon
    }), /*#__PURE__*/_react["default"].createElement("div", {
      className: _index["default"].label
    }, val.label));
  })), /*#__PURE__*/_react["default"].createElement(_FormModal["default"], {
    width: 1200,
    column: 3,
    visible: true,
    title: "",
    items: items,
    disabled: true,
    isShowModal: false,
    footerShow: false,
    formStyle: {
      width: '100%'
    }
  }));
};
var _default = exports["default"] = ProcessInfo;
//# sourceMappingURL=index.js.map
