<commit_before>/**
 * Created by lilu on 2017/9/18.
 */
import React from 'react';
import {connect} from 'react-redux';
import {Row, Col} from 'antd';
import ContentHead from '../../component/ContentHead'
import StationList from './StationList';
import StationMenu from './StationMenu'
import {stationAction, stationSelector} from './redux';

class StationManage extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      curUserId: -1,
      selectedRowId: undefined,
      selectedRowData: undefined,
    }
  }

  selectStation(rowId,rowData){
    this.setState({selectedRowId: rowId, selectedRowData: rowData},()=>{console.log('selectRow========>',this.state.selectRowId)})
  }

  componentWillMount() {
    this.props.requestStations({success:()=>{console.log('hahhahah')}});
  }

  refresh(){
    this.props.requestStations({...this.state})
  }

  setStatus(){
    if(this.state.selectedRowId&&this.state.selectedRowData){
      let payload = {
        stationId: this.state.selectedRowId,
        success: ()=>{this.refresh()},
        error: ()=>{console.log('i m false')}
      }
      let data = this.state.selectedRowData[0]
      if(data.status==1){
        this.props.closeStation(payload)
      }else{
        this.props.openStation(payload)
      }
    }
  }

  render() {
    // console.log('[DEBUG] ---> SysUser props: ', this.props);
    return (
      <div><commit_msg>status<commit_after>/**
 * Created by lilu on 2017/9/18.
 */
import React from 'react';
import {connect} from 'react-redux';
import {Row, Col} from 'antd';
import ContentHead from '../../component/ContentHead'
import StationList from './StationList';
import StationMenu from './StationMenu'
import {stationAction, stationSelector} from './redux';

class StationManage extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      curUserId: -1,
      selectedRowId: undefined,
      selectedRowData: undefined,
    }
  }

  selectStation(rowId,rowData){
    this.setState({selectedRowId: rowId, selectedRowData: rowData},()=>{console.log('selectRow========>',this.state.selectRowId)})
  }

  componentWillMount() {
    this.props.requestStations({success:()=>{console.log('hahhahah')}});
  }

  refresh(){
    // this.props.requestStations({...this.state})
  }

  setStatus(){
    if(this.state.selectedRowId){
      let data = undefined
      this.props.stations.forEach((item,key)=>{
        if(item.id==this.state.selectedRowId){
          data = item
        }
    })
      let payload = {
        stationId: this.state.selectedRowId,
        success: ()=>{this.refresh()},
        error: ()=>{console.log('i m false')}
      }
      if(data.status==1){
        this.props.closeStation(payload)
      }else{
        this.props.openStation(payload)
      }
    }
  }

  render() {
    // console.log('[DEBUG] ---> SysUser props: ', this.props);
    return (
      <div>
{'fraction_non_alphanumeric': 0.16700889801505817, 'fraction_numerical': 0.006502395619438741, 'mean_word_length': 3.0767085076708507, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4638428', 'n_tokens_mistral': 938, 'n_tokens_neox': 920, 'n_words': 171}