"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = LDXX;
var _react = _interopRequireDefault(require("react"));
require("./index.less");
var _vmTable = _interopRequireDefault(require("../../../vm-table"));
var _vmIframeModal = _interopRequireDefault(require("../../../vm-iframe-modal"));
var _components = require("@vtx/components");
var _ahooks = require("ahooks");
var _api = require("../../api");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
function LDXX(_ref) {
  var _ref$theme = _ref.theme,
    theme = _ref$theme === void 0 ? 'light' : _ref$theme,
    ctlfxAndLdData = _ref.ctlfxAndLdData,
    id = _ref.id;
  var _a, _b;
  var _useSetState = (0, _ahooks.useSetState)({
      src: '',
      visible: false,
      title: ''
    }),
    _useSetState2 = _slicedToArray(_useSetState, 2),
    iframeModalInfo = _useSetState2[0],
    setIframeModalInfo = _useSetState2[1];
  var columns_top = [{
    name: '今日联单',
    key: 'hsxslc',
    num: (_a = ctlfxAndLdData === null || ctlfxAndLdData === void 0 ? void 0 : ctlfxAndLdData.orderCount) !== null && _a !== void 0 ? _a : 0,
    unit: '单'
  }, {
    name: '关联处置证',
    key: 'zysc',
    num: (_b = ctlfxAndLdData === null || ctlfxAndLdData === void 0 ? void 0 : ctlfxAndLdData.czzCount) !== null && _b !== void 0 ? _b : 0,
    unit: '个'
  }];
  var _BaseService$useLdLis = _api.BaseService.useLdList(id),
    ldListData = _BaseService$useLdLis.ldListData;
  var columns = [['联单编号', 'code', {
    width: 120,
    fixed: 'left',
    render: function render(text) {
      return text ? /*#__PURE__*/_react["default"].createElement(_components.VtxEllipsisText, {
        text: text
      }) : '-';
    }
  }], ['核准编号', 'disposalCertificateInfoCode', {
    width: 120,
    render: function render(text) {
      return text ? /*#__PURE__*/_react["default"].createElement(_components.VtxEllipsisText, {
        text: text
      }) : '-';
    }
  }], ['联单状态', 'jointOrderStatusName', {
    width: 120
  }], ['起运时间', 'stepOneOperateTime', {
    width: 180
  }], ['运输单位', 'transportUnitName', {
    width: 120,
    render: function render(text) {
      return text ? /*#__PURE__*/_react["default"].createElement(_components.VtxEllipsisText, {
        text: text
      }) : '-';
    }
  }], ['车牌号', 'carCode', {
    width: 120
  }], ['运输终点', 'endingPointName', {
    width: 120,
    render: function render(text) {
      return text ? /*#__PURE__*/_react["default"].createElement(_components.VtxEllipsisText, {
        text: text
      }) : '-';
    }
  }], ['终点行政区划', 'endingPointDivisionName', {
    width: 120,
    render: function render(text) {
      return text ? /*#__PURE__*/_react["default"].createElement(_components.VtxEllipsisText, {
        text: text
      }) : '-';
    }
  }], ['接收时间', 'stepThreeOperateTime', {
    width: 180
  }], ['建筑垃圾类别', 'garbageTypeName', {
    width: 120
  }], ['运量(吨)', 'receivedWeight', {
    width: 120,
    align: 'right'
  }], ['操作', 'action', {
    width: 60,
    fixed: 'right',
    render: function render(_, record) {
      return /*#__PURE__*/_react["default"].createElement("a", {
        onClick: function onClick() {
          setIframeModalInfo({
            visible: true,
            title: '联单信息',
            src: "/jzlj/#/constructionJointOrder?id=".concat(record.id)
          });
        }
      }, "\u67E5\u770B");
    }
  }]].map(function (item) {
    return Object.assign({
      title: item[0],
      dataIndex: item[1],
      key: item[1]
    }, item[2]);
  });
  var tableProps = {
    height: 200,
    columns: columns,
    dataSource: ldListData || [],
    indexFixed: true
  };
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
    className: "jzlj-card-title"
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: "jzlj-card-title-text"
  }, "\u8054\u5355\u4FE1\u606F")), /*#__PURE__*/_react["default"].createElement("div", {
    className: "jzlj-card-content"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "ldxx"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "ldxx-top"
  }, columns_top.map(function (item) {
    return /*#__PURE__*/_react["default"].createElement("div", {
      style: {
        textAlign: 'center'
      },
      key: item.key
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "name"
    }, item.name), /*#__PURE__*/_react["default"].createElement("div", {
      className: "num"
    }, /*#__PURE__*/_react["default"].createElement("span", null, item.num), /*#__PURE__*/_react["default"].createElement("span", {
      className: "unit"
    }, item.unit)));
  })), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_vmTable["default"], Object.assign({}, tableProps))))), /*#__PURE__*/_react["default"].createElement(_vmIframeModal["default"], Object.assign({}, iframeModalInfo, {
    theme: theme,
    onCancel: function onCancel() {
      return setIframeModalInfo({
        visible: false
      });
    }
  })));
}
//# sourceMappingURL=LDXX.js.map
