"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = TodayWorkCC;
var _react = _interopRequireDefault(require("react"));
var _moment = _interopRequireDefault(require("moment"));
var _vmTable = _interopRequireDefault(require("../../../vm-table"));
var _api = require("../../api");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**
 * 今日作业-垃圾收运
 */

function TodayWorkCC(_ref) {
  var id = _ref.id,
    garbageType = _ref.garbageType;
  var _BaseService$useToday = _api.BaseService.useTodayWorkCC(id, (0, _moment["default"])().format('YYYY-MM-DD 00:00:00'), (0, _moment["default"])().format('YYYY-MM-DD 23:59:59'), garbageType),
    todayRunCCRes = _BaseService$useToday.todayRunCCRes;
  var columns = garbageType === 'fqyz' ? [{
    title: '产生单位	',
    dataIndex: 'restaurantName',
    key: 'restaurantName',
    width: 100,
    ellipsis: true
  }, {
    title: '煎炸油收运桶数(桶)',
    dataIndex: 'jzyTrashNum',
    key: 'jzyTrashNum',
    width: 170,
    align: 'right',
    sorter: function sorter(a, b) {
      return a.jzyTrashNum - b.jzyTrashNum;
    }
  }, {
    title: '其他废弃油脂收运桶数(桶)',
    dataIndex: 'qtfqyzTrashNum',
    key: 'qtfqyzTrashNum',
    width: 210,
    align: 'right',
    sorter: function sorter(a, b) {
      return a.qtfqyzTrashNum - b.qtfqyzTrashNum;
    }
  }] : [{
    title: '商户名称',
    dataIndex: 'restaurantName',
    key: 'restaurantName',
    width: 130,
    ellipsis: true
  }, {
    title: '收集桶数(桶)',
    dataIndex: 'trashNum',
    key: 'trashNum',
    width: 90,
    align: 'right'
  }, {
    title: '收集重量(kg)',
    dataIndex: 'netWeight',
    key: 'netWeight',
    width: 100,
    align: 'right',
    sorter: function sorter(a, b) {
      return a.netWeight - b.netWeight;
    }
  }];
  var tableProps = {
    height: (todayRunCCRes === null || todayRunCCRes === void 0 ? void 0 : todayRunCCRes.length) > 0 ? 180 : 246,
    paganitation: false,
    dataSource: todayRunCCRes || []
  };
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_vmTable["default"], Object.assign({
    columns: columns,
    isIndex: false,
    rowKey: "index"
  }, tableProps)));
}
//# sourceMappingURL=TodayWorkCC.js.map
