function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
export var OverViewLeftFields = [{
  key: 'householdNum',
  label: '居民户数(户)'
}, {
  key: 'supervisorNum',
  label: '督导员数量'
}, {
  key: 'personNum',
  label: '居民人数(人)'
}, {
  key: 'throwPointNum',
  label: '投放点数量'
}, {
  key: 'divisionName',
  label: '行政区划'
}, {
  key: 'jcssTypeName',
  label: '分类主体'
},
//   {
//     key: 'jcssTypeName',
//     label: '投放时间',
//   },
{
  key: 'manageOrgName',
  label: '管理单位'
}, {
  key: 'responsibleOrgName',
  label: '运营公司'
}, {
  key: 'address',
  label: '地址'
}];

// 过滤echarts数据
export var getFilterEcharts = function getFilterEcharts(data, filterList) {
  var _data = [];
  if (!(data !== null && data !== void 0 && data.length)) return;
  filterList.forEach(function (item) {
    switch (item) {
      case 'CHUYU_QUALITY':
        _data = _data.concat(data === null || data === void 0 ? void 0 : data.filter(function (ele) {
          return ele.alarmTypeName === '厨余混投' || ele.alarmTypeName === '厨余未破袋';
        }));
        break;
      case 'LANDING':
        _data = _data.concat(data === null || data === void 0 ? void 0 : data.filter(function (ele) {
          return ele.alarmTypeName === '误时落地' || ele.alarmTypeName === '正时落地';
        }));
        break;
      case 'OVERFLOW':
        _data = _data.concat(data === null || data === void 0 ? void 0 : data.filter(function (ele) {
          return ele.alarmTypeName === '满溢';
        }));
        break;
      default:
        _data = data;
        break;
    }
  });
  return _data;
};

// 取两个数组的交集
export var filterCode = function filterCode(arr, codes) {
  var newArr = new Set(arr);
  var newCodes = new Set(codes);
  return new Set(_toConsumableArray(newArr).filter(function (x) {
    return newCodes.has(x);
  }));
};