"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _echartsForReact = _interopRequireDefault(require("echarts-for-react"));
var _vmSubTitle = _interopRequireDefault(require("../../../vm-sub-title"));
var _vmCharts = require("../../../vm-charts");
var _api = require("../../api");
var _Trend = require("../OverView/Trend");
var _RightBottom = require("../OverView/RightBottom");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var getPieOption = function getPieOption() {
  return {
    tooltip: {
      trigger: 'item'
    },
    legend: {
      top: 'center',
      left: '45%',
      type: 'scroll',
      orient: 'vertical',
      formatter: function formatter(name) {
        return "{a|".concat(name, "}{a|20\u6B21}{a|\u5747\u503C\uFF1A30\u6B21}");
      },
      textStyle: {
        color: '#fff',
        rich: {
          a: {
            width: 60
          }
        }
      }
    },
    series: [{
      name: 'Access From',
      type: 'pie',
      radius: ['50%', '80%'],
      center: ['25%', '50%'],
      avoidLabelOverlap: false,
      labelLine: {
        show: false
      },
      label: {
        show: false
      },
      data: [{
        value: 1048,
        name: 'Search'
      }, {
        value: 735,
        name: 'Direct'
      }, {
        value: 580,
        name: 'Email'
      }, {
        value: 484,
        name: 'Union'
      }, {
        value: 300,
        name: 'Video'
      }]
    }]
  };
};
var LDB = function LDB(_ref) {
  var _ref$classPrefix = _ref.classPrefix,
    classPrefix = _ref$classPrefix === void 0 ? '' : _ref$classPrefix,
    id = _ref.id;
  // 工单处理效率
  var efficiencyData = _api.overViewService.resolveEfficiency({
    housingEstateId: id
  });
  // 一周趋势
  var sumByPoint = _api.overViewService.throwSumByDayAndPoint({
    housingEstateId: id
  });
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(classPrefix, "-ldb")
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(classPrefix, "-ldb-item")
  }, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u5DE5\u5355\u5904\u7406\u6548\u7387"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      flex: 1,
      display: 'flex'
    }
  }, /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      flex: 1
    }
  }, /*#__PURE__*/_react["default"].createElement(_vmCharts.Gauge1, {
    name: "AI\u5DE5\u5355\u5173\u95ED\u7387",
    unit: "%",
    min: 0,
    max: 100,
    num: (efficiencyData === null || efficiencyData === void 0 ? void 0 : efficiencyData.closeRate) || 0,
    average: (efficiencyData === null || efficiencyData === void 0 ? void 0 : efficiencyData.closeRateAverage) || 0
  })), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      flex: 1
    }
  }, /*#__PURE__*/_react["default"].createElement(_vmCharts.Gauge1, {
    name: "AI\u5DE5\u5355\u5904\u7406\u65F6\u957F",
    unit: "\u5206",
    min: 0,
    max: (0, _RightBottom.getMinHundred)(Math.max((efficiencyData === null || efficiencyData === void 0 ? void 0 : efficiencyData.resolveMinute) || 0, (efficiencyData === null || efficiencyData === void 0 ? void 0 : efficiencyData.resolveMinuteAverage) || 0)),
    num: (efficiencyData === null || efficiencyData === void 0 ? void 0 : efficiencyData.resolveMinute) || 0,
    average: (efficiencyData === null || efficiencyData === void 0 ? void 0 : efficiencyData.resolveMinuteAverage) || 0
  })), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      flex: 1
    }
  }, /*#__PURE__*/_react["default"].createElement(_vmCharts.Gauge1, {
    name: "AI\u5DE5\u5355\u53CA\u65F6\u5173\u95ED\u7387",
    unit: "%",
    min: 0,
    max: 100,
    num: (efficiencyData === null || efficiencyData === void 0 ? void 0 : efficiencyData.closeInTimeRate) || 0,
    average: (efficiencyData === null || efficiencyData === void 0 ? void 0 : efficiencyData.closeInTimeRateAverage) || 0
  })))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(classPrefix, "-ldb-item2")
  }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u53A8\u4F59\u672A\u7834\u888B\u6295\u653E\u5360\u6BD4"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      flex: 1
    }
  }, /*#__PURE__*/_react["default"].createElement(_echartsForReact["default"], {
    option: getPieOption(),
    style: {
      width: '100%',
      height: '100%'
    }
  }))), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u53A8\u4F59\u6DF7\u5408\u6295\u653E\u5360\u6BD4"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      flex: 1
    }
  }, /*#__PURE__*/_react["default"].createElement(_echartsForReact["default"], {
    option: getPieOption(),
    style: {
      width: '100%',
      height: '100%'
    }
  })))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(classPrefix, "-ldb-item")
  }, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u6DF7\u6295\u5783\u573E\u6392\u884C"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      flex: 1
    }
  })), /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(classPrefix, "-ldb-item")
  }, /*#__PURE__*/_react["default"].createElement(_vmSubTitle["default"], {
    title: "\u53D1\u751F\u6B21\u6570\u4E00\u5468\u8D8B\u52BF"
  }), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      flex: 1
    }
  }, /*#__PURE__*/_react["default"].createElement(_vmCharts.Line1, Object.assign({}, (0, _Trend.transferLineData)(sumByPoint))))));
};
var _default = LDB;
exports["default"] = _default;
//# sourceMappingURL=FLZL.js.map
