class StatusFilter {
  static StatusFilter (status, command) {
    if (status === 1) {
      command.disabled = true
    } else {
      command.disabled = false
    }
    return command
  }
  static allStatus (device, command, flag) {
    // if (device.status === 2 || device.deviceStatus === 1) {
    //   command.disabled = true
    // } else {
    //   command.disabled = false
    // }
    if (flag === 1 || device.deviceStatus === 1) {
      command.disabled = true
    } else {
      command.disabled = false
    }
    return command
  }
  // 过滤未规划状态
  static unsolvedStatusFilter (status, command) {
    if (status === 2) {
      command.disabled = true
    } else {
      command.disabled = false
    }
    return command
  }
  // 过滤已规划状态
  static solvedStatusFilter (status, command) {
    if (status === 2) {
      command.disabled = false
    } else {
      command.disabled = true
    }
    return command
  }
  // 过滤链路未规划状态
  static linkUnsolvedStatusFilter (status, command) {
    if (status === 1) {
      command.disabled = true
    } else {
      command.disabled = false
    }
    return command
  }
  // 过滤链路已规划状态
  static linkSolvedStatusFilter (status, command) {
    if (status === 1) {
      command.disabled = false
    } else {
      command.disabled = true
    }
    return command
  }
  // 过滤是否可删除（子网下无设备/SDNC服务器下无管辖设备）
  static deleteStatusFilter (deleteFlag, command) {
    if (deleteFlag === 0) {
      command.disabled = true
    } else {
      command.disabled = false
    }
    return command
  }
  // 过滤链路加入规划
  static linkStatusAddPlanFilter (addPlanFlag, command) {
    if (addPlanFlag === 0) {
      command.disabled = true
    } else {
      command.disabled = false
    }
    return command
  }
  // 设备停用过滤
  static downStatusFilter (status, command) {
    if (status === 0) {
      command.disabled = false
    } else {
      command.disabled = true
    }
    return command
  }
  // 设备面板图可用状态过滤
  static devicePanelFilter (device, command) {
    if (device.deviceTypeKey !== 0) {
      if (device.deviceModel === '' || device.deviceModel === null) {
        command.disabled = true
      } else {
        command.disabled = false
      }
    } else {
      command.disabled = true
    }
    return command
  }
  static rtPerformanceFilter (device, command) {
    if (device.deviceStatus === 1) {
      command.disabled = true
    }
    if (device.deviceStatus === 0) {
      command.disabled = false
    }
    return command
  }
  // 端口查看光功率过滤
  static portDownStatusFilter (port, command) {
    if (port.status === '2') {
      command.disabled = true
    } else {
      if (port.portType === 0) {
        command.disabled = true
      } else {
        command.disabled = false
      }
    }
    return command
  }
  // 设备加入子网过滤
  static devAddToSubnetStatusFilter (device, command) {
    if (device.subnetKey === '' || device.subnetKey === null) {
      command.disabled = true
    } else {
      command.disabled = false
    }
    return command
  }
  // 过滤传统设备
  static deviceTARDFilter (device, command) {
    if (device.deviceType === 1) {
      command.disabled = true
    } else {
      command.disabled = false
    }
    return command
  }
}
export default StatusFilter
