"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireWildcard(require("react"));
require("./index.less");
var _index2 = require("../../index");
var _api = require("../../api");
var _antd = require("antd");
var _ahooks = require("ahooks");
var _vmTable = _interopRequireDefault(require("../../../vm-table"));
var _echartsForReact = _interopRequireDefault(require("echarts-for-react"));
var _moment = _interopRequireDefault(require("moment"));
var _vmFilter = require("../../../vm-filter");
var _vmNodata = _interopRequireDefault(require("../../../vm-nodata"));
var _icons = require("@ant-design/icons");
var _util = require("../../../util");
var _useSettings2 = _interopRequireDefault(require("../../../vm-hooks/useSettings"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
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; }
var Option = _antd.Select.Option;
var format = 'YYYY-MM-DD HH:mm:ss';
var Sjfx = function Sjfx() {
  var _a;
  var _useContext = (0, _react.useContext)(_index2.PumpContext),
    prefix = _useContext.prefix,
    id = _useContext.id;
  var _useSetState = (0, _ahooks.useSetState)({
      monitorTypeId: '',
      monitorTypeList: [],
      leftDataList: [],
      monitorItemCode: '',
      timeType: 'danTime',
      startTime: (0, _moment["default"])().subtract(1, 'hours').format(format),
      endTime: (0, _moment["default"])().format(format),
      // danTimeType: 'realtime',
      danTimeType: '24h',
      rightTrendDataList: [],
      xData: [],
      danTimeStartTime: (0, _moment["default"])().format('YYYY-MM-DD'),
      danTimeEndTime: (0, _moment["default"])().format('YYYY-MM-DD'),
      exColumns: [],
      duoTimeList: [{
        time: (0, _moment["default"])()
      }],
      duoTimeType: 'day',
      unit: '',
      collectFrequencyList: [],
      collectFrequency: '',
      maxValue: 0,
      minValue: 0,
      avgValue: 0,
      markLineValue: []
    }),
    _useSetState2 = _slicedToArray(_useSetState, 2),
    state = _useSetState2[0],
    setState = _useSetState2[1];
  var monitorTypeId = state.monitorTypeId,
    monitorTypeList = state.monitorTypeList,
    leftDataList = state.leftDataList,
    timeType = state.timeType,
    danTimeEndTime = state.danTimeEndTime,
    danTimeStartTime = state.danTimeStartTime,
    startTime = state.startTime,
    endTime = state.endTime,
    danTimeType = state.danTimeType,
    rightTrendDataList = state.rightTrendDataList,
    xData = state.xData,
    monitorItemCode = state.monitorItemCode,
    exColumns = state.exColumns,
    duoTimeList = state.duoTimeList,
    duoTimeType = state.duoTimeType,
    unit = state.unit,
    collectFrequencyList = state.collectFrequencyList,
    collectFrequency = state.collectFrequency,
    maxValue = state.maxValue,
    minValue = state.minValue,
    avgValue = state.avgValue,
    markLineValue = state.markLineValue;
  var _useSettings = (0, _useSettings2["default"])(),
    theme = _useSettings.theme;
  (0, _react.useEffect)(function () {
    _api.SjfxService.monitorTypeList(id).then(function (dataList) {
      if (dataList.length) {
        setState({
          monitorTypeList: dataList,
          monitorTypeId: dataList[0].id
        });
        return dataList[0].id;
      } else {
        setState({
          monitorTypeList: [],
          monitorTypeId: ''
        });
        return '';
      }
    });
  }, []);
  (0, _react.useEffect)(function () {
    getLeftData();
    _api.SjfxService.listCollectFrequency(id, monitorTypeId).then(function (data) {
      if (data) {
        setState({
          collectFrequencyList: data,
          collectFrequency: data.length ? data[0].id : ''
        });
      }
    });
  }, [monitorTypeId]);
  var getLeftData = function getLeftData() {
    _api.SjfxService.leftTableData({
      pumpId: id,
      monitorTypeId: monitorTypeId
    }).then(function (dataList) {
      if (dataList.length) {
        var devices = [],
          monitorItems = [];
        dataList.map(function (item) {
          devices.push(item.device);
          monitorItems.push(item.monitorItemName);
        });
        var columns = new Set(devices);
        monitorItems = Array.from(new Set(monitorItems));
        var newDataList = [];
        monitorItems.map(function (monitorItem) {
          var _a, _b;
          newDataList.push({
            monitorItemCode: (_a = dataList.find(function (item) {
              return item.monitorItemName === monitorItem;
            })) === null || _a === void 0 ? void 0 : _a.monitorItemCode,
            unit: (_b = dataList.find(function (item) {
              return item.monitorItemName === monitorItem;
            })) === null || _b === void 0 ? void 0 : _b.unit,
            monitorItemName: monitorItem,
            values: dataList.filter(function (item) {
              return item.monitorItemName === monitorItem;
            })
          });
        });
        setState({
          leftDataList: newDataList,
          monitorItemCode: dataList[0].monitorItemCode,
          exColumns: Array.from(columns)
        });
        return {
          monitorItemCode: dataList[0].monitorItemCode
        };
      } else {
        setState({
          leftDataList: [],
          monitorItemCode: ''
        });
        return {
          monitorItemCode: ''
        };
      }
    }).then(function (_ref) {
      var monitorItemCode = _ref.monitorItemCode;
      getRightTrendData(monitorItemCode);
    });
  };
  var getRightTrendData = function getRightTrendData(monitorItemCode) {
    var newStartTime = startTime,
      newEndTime = endTime;
    if (timeType === 'danTime') {
      switch (danTimeType) {
        case '1h':
          newStartTime = (0, _moment["default"])().subtract(1, 'hours').format(format);
          newEndTime = (0, _moment["default"])().format(format);
          break;
        case '24h':
          newStartTime = (0, _moment["default"])().subtract(24, 'hours').format(format);
          newEndTime = (0, _moment["default"])().format(format);
          break;
        case '3days':
          newStartTime = (0, _moment["default"])().subtract(3, 'days').format(format);
          newEndTime = (0, _moment["default"])().format(format);
          break;
        case '7days':
          newStartTime = (0, _moment["default"])().subtract(7, 'days').format(format);
          newEndTime = (0, _moment["default"])().format(format);
          break;
        case 'self':
          newStartTime = (0, _moment["default"])(danTimeStartTime).startOf('day').format(format);
          newEndTime = (0, _moment["default"])(danTimeEndTime).endOf('day').format(format);
          break;
        default:
          newStartTime = startTime;
          newEndTime = endTime;
          break;
      }
      _api.SjfxService.rightTrendData({
        startTime: newStartTime,
        endTime: newEndTime,
        monitorItemCode: monitorItemCode,
        collectFrequency: collectFrequency,
        // collectFrequency: danTimeType === '1h' ? 'realtime' : 'hour',
        facilityIds: id
      }).then(function (dataList) {
        var _a, _b, _c, _d, _e;
        if (dataList.length) {
          var firstItemValues = ((_a = dataList.find(function (item) {
            return item.values.length > 0;
          })) === null || _a === void 0 ? void 0 : _a.values) || [];
          setState({
            unit: ((_b = dataList.find(function (item) {
              return item.values.length > 0;
            })) === null || _b === void 0 ? void 0 : _b.unit) || '',
            maxValue: ((_c = dataList.find(function (item) {
              return item.values.length > 0;
            })) === null || _c === void 0 ? void 0 : _c.maxValue) || 0,
            minValue: ((_d = dataList.find(function (item) {
              return item.values.length > 0;
            })) === null || _d === void 0 ? void 0 : _d.minValue) || 0,
            avgValue: ((_e = dataList.find(function (item) {
              return item.values.length > 0;
            })) === null || _e === void 0 ? void 0 : _e.avgValue) || 0,
            xData: firstItemValues.length ? (danTimeType === '1h' ? firstItemValues.reverse() : firstItemValues).map(function (value) {
              return (0, _moment["default"])(value.x).format('HH:mm');
            }) : [],
            rightTrendDataList: dataList.map(function (data) {
              return Object.assign(Object.assign({}, data), {
                newName: "".concat(data.name, "-").concat(data.code).concat((data === null || data === void 0 ? void 0 : data.unit) ? "(".concat(data.unit, ")") : '')
              });
            })
          });
        } else {
          setState({
            xData: [],
            rightTrendDataList: []
          });
        }
      });
    } else if (timeType === 'duoTime') {
      Promise.all(duoTimeList.map(function (item) {
        return _api.SjfxService.rightTrendData({
          startTime: (0, _moment["default"])(item.time).startOf(duoTimeType === 'day' ? 'day' : 'month').format(format),
          endTime: (0, _moment["default"])(item.time).endOf(duoTimeType === 'day' ? 'day' : 'month').format(format),
          monitorItemCode: monitorItemCode,
          collectFrequency: collectFrequency,
          facilityIds: id
        }).then(function (data) {
          return {
            time: (0, _moment["default"])(item.time).format(duoTimeType === 'day' ? 'YYYY-MM-DD' : 'YYYY-MM'),
            data: data
          };
        });
      })).then(function (dataList) {
        var _a, _b, _c, _d, _e;
        var newDataList = [];
        dataList.map(function (list) {
          list.data.map(function (item) {
            newDataList.push(Object.assign(Object.assign({}, item), {
              name: "".concat(item.name, " (").concat(list.time, ")"),
              newName: "".concat(item.name, "-").concat(item.deviceId, " (").concat(list.time, ")")
            }));
          });
        });
        if (newDataList.length) {
          var firstItemValues = ((_a = newDataList.find(function (item) {
            return item.values.length > 0;
          })) === null || _a === void 0 ? void 0 : _a.values) || [];
          setState({
            unit: ((_b = newDataList.find(function (item) {
              return item.values.length > 0;
            })) === null || _b === void 0 ? void 0 : _b.unit) || '',
            maxValue: ((_c = newDataList.find(function (item) {
              return item.values.length > 0;
            })) === null || _c === void 0 ? void 0 : _c.maxValue) || 0,
            minValue: ((_d = newDataList.find(function (item) {
              return item.values.length > 0;
            })) === null || _d === void 0 ? void 0 : _d.minValue) || 0,
            avgValue: ((_e = newDataList.find(function (item) {
              return item.values.length > 0;
            })) === null || _e === void 0 ? void 0 : _e.avgValue) || 0,
            xData: firstItemValues.length ? firstItemValues.map(function (value) {
              return (0, _moment["default"])(value.x).format(duoTimeType === 'month' ? 'MM-DD' : 'HH:mm');
            }) : [],
            rightTrendDataList: newDataList
          });
        } else {
          setState({
            xData: [],
            rightTrendDataList: []
          });
        }
      });
    }
  };
  (0, _react.useEffect)(function () {
    if (monitorItemCode) {
      getRightTrendData(monitorItemCode);
    }
  }, [timeType, danTimeType, danTimeStartTime, danTimeEndTime, duoTimeType, duoTimeList, monitorItemCode, collectFrequency]);
  var options = {
    color: ['#0E85FF', '#49FF81', '#26D4FF', '#F5D629', '#C97CFF'],
    tooltip: {
      trigger: 'axis'
    },
    toolbox: {
      show: true,
      top: 15,
      feature: {
        saveAsImage: {
          show: true,
          name: ((_a = rightTrendDataList === null || rightTrendDataList === void 0 ? void 0 : rightTrendDataList[0]) === null || _a === void 0 ? void 0 : _a.newName) || '数据分析'
        }
      }
    },
    legend: {
      type: 'scroll',
      top: 0,
      left: 'center',
      textStyle: {
        color: '#000000'
      }
    },
    grid: {
      top: 55,
      left: 20,
      right: 40,
      bottom: 20,
      containLabel: true
    },
    xAxis: {
      data: xData,
      axisLabel: {
        color: '#000000',
        interval: 'auto'
      },
      axisTick: {
        show: false
      },
      axisLine: {
        show: true,
        lineStyle: {
          color: 'rgba(0,0,0,0.2)',
          type: 'dashed'
        }
      },
      z: 10
    },
    yAxis: {
      name: unit || '',
      nameTextStyle: {
        color: '#000000'
      },
      axisLine: {
        show: false
      },
      axisTick: {
        show: false
      },
      axisLabel: {
        color: '#000000'
      },
      splitLine: {
        show: true,
        lineStyle: {
          type: 'dashed',
          color: 'rgba(0,0,0,0.2)'
        }
      }
    },
    series: rightTrendDataList.map(function (item) {
      return {
        name: item.newName || item.name || '',
        type: 'line',
        smooth: true,
        data: item.values.map(function (value) {
          return value.y;
        }),
        markLine: {
          label: {
            show: true,
            position: 'end',
            formatter: '{b}'
          },
          data: [{
            name: '上限',
            key: 'maxValue',
            yAxis: maxValue
          }, {
            name: '下限',
            key: 'minValue',
            yAxis: minValue
          }, {
            name: '均值线',
            key: 'avgValue',
            yAxis: avgValue
          }].filter(function (item) {
            return markLineValue.includes(item.key);
          }),
          lineStyle: {
            color: '#f00'
          }
        }
      };
    })
  };
  var handleDuoTimeList = function handleDuoTimeList(index, value) {
    var newDuoTimeList = JSON.parse(JSON.stringify(duoTimeList));
    newDuoTimeList[index].time = value;
    setState({
      duoTimeList: newDuoTimeList
    });
  };
  var content = /*#__PURE__*/_react["default"].createElement(_antd.Checkbox.Group, {
    options: [{
      label: '上限',
      value: 'maxValue'
    }, {
      label: '下限',
      value: 'minValue'
    }, {
      label: '均值线',
      value: 'avgValue'
    }],
    value: markLineValue,
    onChange: function onChange(e) {
      setState({
        markLineValue: e
      });
    }
  });
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefix, "-sjfx")
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefix, "-sjfx-top")
  }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", null, "\u76D1\u6D4B\u7C7B\u578B\uFF1A"), /*#__PURE__*/_react["default"].createElement(_vmFilter.VMSelect, {
    style: {
      width: 200
    },
    value: monitorTypeId,
    onChange: function onChange(value) {
      setState({
        monitorTypeId: value
      });
    }
  }, monitorTypeList.map(function (item) {
    return /*#__PURE__*/_react["default"].createElement(Option, {
      key: item.id,
      value: item.id
    }, item.name);
  }))), /*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
    title: '历史数据'
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: require('../../imgs/historyIcon.png'),
    alt: "",
    style: {
      width: 18,
      height: 18,
      cursor: 'pointer'
    },
    onClick: function onClick() {
      var url = "/ecgs/#/historicalDataAnalysis?from=gs&tenantId=".concat((0, _util.getUrlPara)('tenantId'), "&userId=").concat((0, _util.getUrlPara)('userId'), "&token=").concat((0, _util.getUrlPara)('token'));
      window.open(url);
    }
  }))), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      height: 500
    }
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefix, "-sjfx-card")
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefix, "-sjfx-card-title")
  }, /*#__PURE__*/_react["default"].createElement(_vmFilter.VMSelect, {
    allowClear: false,
    style: {
      width: 100
    },
    value: timeType,
    onChange: function onChange(value) {
      setState({
        timeType: value
      });
    }
  }, /*#__PURE__*/_react["default"].createElement(Option, {
    value: 'danTime'
  }, "\u5355\u65F6\u6BB5"), /*#__PURE__*/_react["default"].createElement(Option, {
    value: 'duoTime'
  }, "\u591A\u65F6\u6BB5")), timeType === 'danTime' && (/*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
    style: {
      marginLeft: 10
    },
    options: [
    // { label: '近1小时', value: '1h' },
    {
      label: '24小时',
      value: '24h'
    }, {
      label: '3天',
      value: '3days'
    }, {
      label: '7天',
      value: '7days'
    }, {
      label: '自定义',
      value: 'self'
    }],
    optionType: "button",
    value: danTimeType,
    onChange: function onChange(e) {
      setState({
        danTimeType: e.target.value
      });
    }
  })), timeType === 'danTime' && danTimeType === 'self' && (/*#__PURE__*/_react["default"].createElement(_vmFilter.VMRangePicker, {
    style: {
      marginLeft: 10
    },
    value: [(0, _moment["default"])(danTimeStartTime), (0, _moment["default"])(danTimeEndTime)],
    onChange: function onChange(date) {
      setState({
        danTimeStartTime: date.length ? (0, _moment["default"])(date[0]).format(format) : '',
        danTimeEndTime: date.length ? (0, _moment["default"])(date[1]).format(format) : ''
      });
    }
  })), timeType === 'duoTime' && (/*#__PURE__*/_react["default"].createElement(_antd.Radio.Group, {
    style: {
      marginLeft: 10
    },
    options: [{
      label: '日',
      value: 'day'
    }, {
      label: '月',
      value: 'month'
    }],
    optionType: "button",
    value: duoTimeType,
    onChange: function onChange(e) {
      setState({
        duoTimeType: e.target.value
      });
    }
  })), timeType === 'duoTime' && duoTimeList.length !== 5 ? (/*#__PURE__*/_react["default"].createElement(_antd.Button, {
    type: "primary",
    icon: /*#__PURE__*/_react["default"].createElement(_icons.PlusOutlined, null),
    style: {
      marginLeft: 10
    },
    onClick: function onClick() {
      setState({
        duoTimeList: [].concat(_toConsumableArray(duoTimeList), [{
          time: duoTimeList.length ? (0, _moment["default"])(duoTimeList[duoTimeList.length - 1].time).subtract(1, duoTimeType === 'day' ? 'days' : 'months') : (0, _moment["default"])()
        }])
      });
    }
  }, "\u65B0\u589E")) : null, timeType === 'duoTime' && (/*#__PURE__*/_react["default"].createElement(_antd.Tooltip, {
    title: '最多可添加五个日期'
  }, /*#__PURE__*/_react["default"].createElement(_icons.InfoCircleOutlined, {
    style: {
      marginLeft: 10
    }
  }))), /*#__PURE__*/_react["default"].createElement("span", {
    style: {
      marginLeft: 10
    }
  }, "\u95F4\u9694\uFF1A"), /*#__PURE__*/_react["default"].createElement(_antd.Select, {
    value: collectFrequency,
    onChange: function onChange(e) {
      return setState({
        collectFrequency: e
      });
    },
    style: {
      minWidth: 150
    },
    dropdownClassName: "vm-select-dropdown ".concat(theme)
  }, collectFrequencyList.map(function (item) {
    return /*#__PURE__*/_react["default"].createElement(Option, {
      key: item.id
    }, item.name);
  })), /*#__PURE__*/_react["default"].createElement("span", {
    style: {
      margin: '5px 0px 0px 10px'
    }
  }, /*#__PURE__*/_react["default"].createElement(_antd.Popover, {
    content: content,
    title: "",
    zIndex: 1060
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: require('../../imgs/lineIcon.png'),
    style: {
      width: 18,
      height: 18,
      cursor: 'pointer'
    }
  })))), /*#__PURE__*/_react["default"].createElement("div", null, timeType === 'duoTime' && (/*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefix, "-sjfx-card-title")
  }, duoTimeList.map(function (item, index) {
    return /*#__PURE__*/_react["default"].createElement("span", {
      style: {
        marginRight: 15,
        position: 'relative'
      },
      key: index
    }, duoTimeType === 'day' ? (/*#__PURE__*/_react["default"].createElement(_vmFilter.VMDatePicker, {
      allowClear: false,
      value: (0, _moment["default"])(item.time),
      onChange: function onChange(date) {
        handleDuoTimeList(index, date);
      }
    })) : (/*#__PURE__*/_react["default"].createElement(_vmFilter.VMMonthPicker, {
      allowClear: false,
      value: (0, _moment["default"])(item.time),
      onChange: function onChange(date) {
        handleDuoTimeList(index, date);
      }
    })), index === 0 ? null : (/*#__PURE__*/_react["default"].createElement(_icons.CloseCircleOutlined, {
      style: {
        position: 'absolute',
        top: -7,
        right: -15,
        cursor: 'pointer'
      },
      onClick: function onClick() {
        setState({
          duoTimeList: duoTimeList.filter(function (_, timeIndex) {
            return timeIndex !== index;
          })
        });
      }
    })));
  })))), /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(prefix, "-sjfx-card-content")
  }, /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      width: '50%',
      height: '100%'
    }
  }, /*#__PURE__*/_react["default"].createElement(_vmTable["default"], {
    isIndex: false,
    pagination: false,
    columns: [{
      title: '监测项目',
      dataIndex: 'monitorItemName',
      key: 'monitorItemName',
      width: 100
    }, {
      title: '单位',
      dataIndex: 'unit',
      key: 'unit',
      width: 50
    }].concat(_toConsumableArray(exColumns.map(function (item) {
      return {
        title: item,
        dataIndex: item,
        key: item,
        width: 100,
        render: function render(_text, record) {
          var _a;
          return ((_a = record.values.find(function (value) {
            return value.device.indexOf(item) > -1;
          })) === null || _a === void 0 ? void 0 : _a.value) || '-';
        }
      };
    }))),
    dataSource: leftDataList,
    height: 350,
    onRow: function onRow(record) {
      return {
        onClick: function onClick() {
          setState({
            monitorItemCode: record.monitorItemCode
          });
          // getRightTrendData(record.monitorItemCode);
        }
      };
    }
  })), /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      width: '50%',
      height: '100%'
    }
  }, rightTrendDataList.length ? (/*#__PURE__*/_react["default"].createElement(_echartsForReact["default"], {
    option: options,
    notMerge: true,
    lazyUpdate: true,
    style: {
      height: 280,
      width: '100%'
    }
  })) : (/*#__PURE__*/_react["default"].createElement("div", {
    style: {
      height: 100
    }
  }, /*#__PURE__*/_react["default"].createElement(_vmNodata["default"], null))))))));
};
var _default = exports["default"] = Sjfx;
//# sourceMappingURL=index.js.map
