import React, { Component } from 'react'
import {
  Card,
  Tooltip,
  Popover,
  message,
  Radio,
  Button,
  Icon,
  Tabs,
  Spin,
  Table,
  Tag,
  Input,
  Collapse,
  Modal,
  Form,
  Anchor,
  Pagination,
  Select,
} from 'antd'
import WrappedIframe from '../../../components/iframePdb'
import request from '../../../utils/request'
import Molstar from 'molstar-react'
import { Jsme } from 'jsme-react'
import qs from 'qs'
import './index.css'
const { Panel } = Collapse
const { TabPane } = Tabs
const { Option } = Select
const { Link } = Anchor

let id = 0
@Form.create()
export default class LigandDetails extends Component {
  state = {
    name: '',
    Structure: [],
    dataOne: qs.parse(this.props.location.search.slice(1)),
    visible: false,
    pdbId: '6f6s',
    DetailsData: {
      PubChemCID: 5462310,
      MolecularWeight: 12.011,
      smiles: 'cccc',
    },
    panelList: {
      Bioassay: [],
    },
    statusMutation: 0,
    OLDMutationList: [],
    CalculatedPropeties: {},
    targetsDetail: {
      Structure: [],
      Sequence: [],
      Mutation: [],
      Gene_name: [],
    },
    loading: true,
    getStructureList: {
      ligand_up_list: [],
      ligand_list: [],
      chain: [],
      References: [],
    },
    listData: {
      pdb_code: '',
      ligand: '',
      resolution: 0,
    },
    fileData: {
      filestring: '',
      type: 'pdb',
    },
    SequenceAlignment: {
      reference: '',
      aligns: '',
    },
    SequenceAlignmentList: [],
    MutationSearch: {
      page: 1,
      page_size: 10,
      dataid: qs.parse(this.props.location.search.slice(1)).dataid,
      status: 0,
      desc: 1,
    },
    VirantsDiseaseListSearch: {
      page: 1,
      page_size: 10,
      dataid: qs.parse(this.props.location.search.slice(1)).dataid,
    },
    VirantsDiseaseList: [],
    total_num: 0,
    total_num2: 0,
    pdbLink: '',
    aciveKey: '',
    directoryState: false,
    ProteinPositioList: [],
    ProteinPosition_total_num: 0,
    SegmentList: []
  }
  componentDidMount () {
    this.getDetails()
    this.add()
    this.geSegmentList()
  }
  getProteinPosition = (e) => {
    let ProteinPositionData = {
      dataid: qs.parse(this.props.location.search.slice(1)).dataid,
      protein_data: e['Protein Position'],
    }
    console.log(ProteinPositionData)
    this.setState({ visible: true })
    request
      .post('gpcr/mutation_detail/search_by_protein', ProteinPositionData)
      .then((res) => {
        if (res) {
          console.log(res)
          this.setState({ ProteinPosition_total_num: res.data.total_num })
          this.setState({
            ProteinPositioList: res.data.data,
          })
        }
      })
      .catch((err) => {
        console.error(err)
      })
  }
  getDetails () {
    // this.setState({loading:true})
    this.setState({ loading: true })
    request
      .post(
        '/gpcr/mutation_detail',
        qs.parse(this.props.location.search.slice(1))
      )
      .then((res) => {
        this.setState({ loading: false })
        if (res.data.code === 200) {
          this.getMutationList()
          this.getVirantsDiseaseList()
          let data = res.data.data
          this.setState({ targetsDetail: data })
          this.setState({ CalculatedPropeties: data.Calcilated_propeties })
          let StructureList = data.Structure
          if (StructureList.length > 0) {
            this.getStructure(StructureList[0].pdb)
            this.setState({
              aciveKey: StructureList[0].pdb,
            })
          }

          this.setState({ loading: false })
        } else {
          message.error(res.data.msg)
        }
      })
      .catch((err) => {
        console.error(err)
      })
  }
  getPdid (e) {
    console.log(e)
    this.setState({ visible: true })
    this.setState({ pdbId: e })
  }
  getTag = (e) => {
    console.log(e)
    this.setState({ visible: true })
    this.setState({ pdbId: e })
  }
  getReferences = (e) => {
    window.open(`https://pubmed.ncbi.nlm.nih.gov/${e}`)
  }
  getReferences2 = (e) => {
    window.open(e)
  }
  getDrug = (e) => {
    console.log(e)
    let data = {
      dataid: e,
    }
    this.props.history.push({
      pathname: '/home/SearchDetails',
      search: qs.stringify(data),
    })
  }

  callback () { }
  childTargetClassChange = () => { }
  getStructure = (e) => {
    request
      .post(
        '/search_pdb_data',
        qs.stringify({
          pdb: e,
        })
      )
      .then((res) => {
        this.setState({ loading: false })
        if (res.data.code === 200) {
          this.setState({ getStructureList: res.data.data })
          let listData = this.state.listData
          listData.pdb_code = res.data.data.name
          listData.ligand = ''
          listData.resolution = 0
          this.setState({ listData })
          let pdbLink =
            'http://52.83.169.190:3004/?id=' + JSON.stringify(listData)
          this.setState({
            pdbLink,
          })
        } else {
          message.error(res.data.msg)
        }
      })
      .catch((err) => {
        console.error(err)
      })
  }
  ChangeTabs = (e) => {
    this.setState({
      aciveKey: e,
    })
    this.setState({
      pdbLink: '',
    })
    let listData = this.state.listData
    listData.ligand = ''
    listData.resolution = 0
    if (listData.pdbList) {
      delete listData.pdbList
    }
    this.setState({
      listData: listData,
      pdbLink: '',
    })
    this.getStructure(e)
  }
  getList = () => {
    let fileData = this.state.fileData
    fileData.filestring = ''
    this.setState({
      fileData: fileData,
    })

    // if (this.state.listData.ligand==='') {
    //   message.warning('输入查询条件');
    //   return
    // }
    // if (this.state.getStructureList.resolution>this.state.listData.resolution) {
    //   message.warning('搜索半径不能小于resolution');
    //   return
    // }
    request
      .post('/search_pdb_ligand_resolution', qs.stringify(this.state.listData))
      .then((res) => {
        let fileData = JSON.parse(JSON.stringify(this.state.fileData))
        fileData.filestring = res.data
        this.setState({
          fileData: fileData,
        })

        this.setState({
          visible: true,
        })

        this.setState({ loading: false })
        console.log(this.state.fileData)
      })
      .catch((err) => {
        console.error(err)
      })
  }
  getResolutionData = (e) => {
    console.log(e)
    let listData = this.state.listData
    listData.resolution = e
    this.setState({
      listData,
    })
  }
  LigandChange = (e) => {
    let listData = this.state.listData
    listData.ligand = e
    this.setState({
      listData,
    })
  }
  onChangeRadio = (e) => {
    let value = e.target.value
    let MutationSearch = this.state.MutationSearch
    MutationSearch.status = value
    this.setState(() => ({ MutationSearch: MutationSearch }))
    this.getMutationList()
  }
  sequenceAlign = () => {
    request
      .post('/gpcr/sequence_align', qs.stringify(this.state.SequenceAlignment))
      .then((res) => {
        console.log(res)
        this.setState({ loading: false })
        if (res.data.code === 200) {
          this.setState({ SequenceAlignmentList: res.data.data })
        } else {
          message.error(res.data.msg)
        }
      })
      .catch((err) => {
        console.error(err)
      })
  }
  remove = (k) => {
    const { form } = this.props
    // can use data-binding to get
    const keys = form.getFieldValue('keys')
    // We need at least one passenger
    if (keys.length === 1) {
      return
    }

    // can use data-binding to set
    form.setFieldsValue({
      keys: keys.filter((key) => key !== k),
    })
  }

  add = () => {
    const { form } = this.props
    // can use data-binding to get
    const keys = form.getFieldValue('keys')
    const nextKeys = keys.concat(id++)
    // can use data-binding to set
    // important! notify form to detect changes
    form.setFieldsValue({
      keys: nextKeys,
    })
  }

  handleSubmit = (e) => {
    e.preventDefault()
    this.props.form.validateFields((err, values) => {
      const { keys, names } = values
      // console.log('Received values of form: ', values);
      // console.log('Merged values:', keys.map(key => names[key]));
      // let names=keys.map(key => names[key])
      console.log(names)

      for (let index = 0; index < names.length; index++) {
        var element = names[index]
        if (element == undefined) {
          names[index] = ''
        }
      }
      let newArr = names.filter((i) => i && i.trim())
      console.log(newArr)

      let SequenceAlignment = this.state.SequenceAlignment
      SequenceAlignment.aligns = newArr.toString()
      SequenceAlignment.reference = this.state.targetsDetail.name
      this.setState(() => ({ SequenceAlignment: SequenceAlignment }))

      this.sequenceAlign()
    })
  }
  getSequence = (e) => {
    const { value } = e.target
    let SequenceAlignment = this.state.SequenceAlignment
    SequenceAlignment.reference = value
    this.setState(() => ({ SequenceAlignment: SequenceAlignment }))
  }
  handleAnchorClick = (e) => {
    e.preventDefault()
  }
  getMutationList = () => {
    console.log(this.state.dataOne)
    const { dataid } = this.state.dataOne
    this.setState({ loading: true })
    console.log(this.state.MutationSearch)
    request
      .post('gpcr/mutation_detail/mutation', this.state.MutationSearch)
      .then((res) => {
        this.setState({ loading: false })
        if (res) {
          console.log(res)
          let DetailsData = this.state.DetailsData
          DetailsData.Target = res.data.data
          this.setState({ total_num: res.data.total_num })
          this.setState({
            OLDMutationList: res.data.data,
          })
        }
      })
      .catch((err) => {
        console.error(err)
      })
  }
  geSegmentList = () => {
    request
      .post('gpcr/search_segment', {
        page: 1,
        page_size: 20,
      })
      .then((res) => {
        this.setState({ loading: false })
        if (res) {
          console.log(res)
          this.setState({
            SegmentList: res.data.data,
          })
        }
      })
      .catch((err) => {
        console.error(err)
      })
  }
  getVirantsDiseaseList = () => {
    console.log(this.state.dataOne)
    this.setState({ loading: true })
    console.log(this.state.VirantsDiseaseListSearch)
    request
      .post('/gpcr/mutation_detail/virant', this.state.VirantsDiseaseListSearch)
      .then((res) => {
        this.setState({ loading: false })
        if (res) {
          console.log(res)
          // let DetailsData = this.state.DetailsData
          // DetailsData.Target = res.data.data
          this.setState({ total_num2: res.data.total_num })
          this.setState({
            VirantsDiseaseList: res.data.data,
          })
        }
      })
      .catch((err) => {
        console.error(err)
      })
  }
  onChangeTable = (pagination, filters, sorter, extra) => {
    // console.log('params', pagination, filters, sorter, extra)
    console.log(sorter)
    if (sorter.order === 'ascend') {
      let MutationSearch = this.state.MutationSearch
      MutationSearch.desc = 1
      this.setState(() => ({ MutationSearch: MutationSearch }))
      this.getMutationList()
    }
    if (sorter.order === 'descend') {
      let MutationSearch = this.state.MutationSearch
      MutationSearch.desc = 2
      this.setState(() => ({ MutationSearch: MutationSearch }))
      this.getMutationList()
    }
  }
  onShowSizeChange = (current, pageSize) => {
    console.log(current, pageSize)
    let MutationSearch = this.state.MutationSearch
    MutationSearch.page = current
    MutationSearch.page_size = pageSize
    this.setState({
      MutationSearch,
    })
    this.getMutationList()
  }
  onChange = (current, pageSize) => {
    console.log(current, pageSize)
    let MutationSearch = this.state.MutationSearch
    MutationSearch.page = current
    MutationSearch.page_size = pageSize
    this.setState({
      MutationSearch,
    })
    this.getMutationList()
  }
  onShowSizeChange2 = (current, pageSize) => {
    console.log(current, pageSize)
    let VirantsDiseaseListSearch = this.state.VirantsDiseaseListSearch
    VirantsDiseaseListSearch.page = current
    VirantsDiseaseListSearch.page_size = pageSize
    this.setState({
      VirantsDiseaseListSearch,
    })
    this.getVirantsDiseaseList()
  }
  onChange2 = (current, pageSize) => {
    console.log(current, pageSize)
    let VirantsDiseaseListSearch = this.state.VirantsDiseaseListSearch
    VirantsDiseaseListSearch.page = current
    VirantsDiseaseListSearch.page_size = pageSize
    this.setState({
      VirantsDiseaseListSearch,
    })
    this.getVirantsDiseaseList()
  }
  SelectChange = (e) => {
    let MutationSearch = this.state.MutationSearch
    MutationSearch.segment = e
    this.setState(() => ({ MutationSearch: MutationSearch }))
    this.getMutationList()
  }
  getColumnSearchProps = (dataIndex) => ({
    filterDropdown: ({
      setSelectedKeys,
      selectedKeys,
      confirm,
      clearFilters,
    }) => (
      <div style={{ padding: 8 }}>
        <Select
          style={{ width: 120 }}
          onChange={this.SelectChange}>
          {
            this.state.SegmentList.map((item, index) => {
              return (<Option key={index} value={item.segment}>
                {item.segment}
              </Option>)
            })
          }
        </Select>
      </div>
    ),
  })
  render () {
    const {
      visible,
      panelList,
      Structure,
      OLDMutationList,
      name,
      pdbId,
      targetsDetail,
      SequenceAlignmentList,
      status,
      MutationSearch,
      VirantsDiseaseList,
      total_num,
      total_num2,
      directoryState,
      ProteinPosition_total_num,
      ProteinPositioList,

    } = this.state
    const { getFieldDecorator, getFieldValue } = this.props.form

    const expandedRowRender = (e) => {
      console.log(e)
      const { Association } = e
      const columns = [
        {
          title: 'Disease',
          dataIndex: 'Disease',
          key: 'Disease',
        },

        {
          title: 'Reference',
          dataIndex: 'Reference',
          render: (Reference) => (
            <span>
              {Reference != 'Null' &&
                Reference.map((item, index) => {
                  return (
                    <Tag
                      color="blue"
                      key={index}
                      onClick={() => {
                        this.getReferences2(item.url)
                      }}>
                      {item.name.toUpperCase()}
                    </Tag>
                  )
                })}
            </span>
          ),
        },
      ]
      return (
        <Table columns={columns} dataSource={Association} pagination={false} />
      )
    }

    const columnsMutation = [
      {
        title: 'Generic number',
        dataIndex: 'Generic',
        key: 'Generic',
      },
      {
        title: 'Position',
        dataIndex: 'Position',
        key: 'Position',
      },
      {
        title: 'Segment',
        dataIndex: 'Segment',
        key: 'Segment',
        ...this.getColumnSearchProps('Segment'),
      },
      {
        title: 'Mutation',
        dataIndex: 'Mutation',
        key: 'Mutation',
      },
      {
        title: 'Ligand',
        dataIndex: 'Ligand',
        key: 'Ligand',
        render: (Ligand) => (
          <div>
            <Jsme
              height="100px"
              width="100px"
              options="depict,useopenchemlib"
              smiles={Ligand.smile}
            />
          </div>
        ),
      },
      {
        title: 'Activity type',
        dataIndex: 'Activity type',
        key: 'Activity type',
      },
      {
        title: 'Activity value',
        dataIndex: 'Activity value',
        key: 'Activity value',
      },
      {
        title: 'Units',
        dataIndex: 'units',
        key: 'units',
      },
      {
        title: 'Ratio',
        dataIndex: 'ratio',
        key: 'ratio',
      },
      // {
      //   title: 'PercentChange(%)',
      //   dataIndex: 'Foldchange',
      //   key: 'Foldchange',
      //   defaultSortOrder: 'ascend',
      //   sorter: (a, b) => {

      //   },
      //   onFilter: (value, record) => {

      //   },
      // },

      // {
      //   title: 'Year of approval',
      //   dataIndex: 'Year of approval',
      //   key: 'Year of approval',
      // },
      {
        title: 'Reference',
        dataIndex: 'Reference',
        render: (Reference) => (
          <span>
            <Tag
              color="blue"
              onClick={() => {
                this.getReferences(Reference)
              }}>
              {Reference.toUpperCase()}
            </Tag>
          </span>
        ),
      },
    ]
    const columnsMutation2 = [
      {
        title: 'Generic number',
        dataIndex: 'Generic',
        key: 'Generic',
      },
      {
        title: 'Position',
        dataIndex: 'Position',
        key: 'Position',
      },
      {
        title: 'Segment',
        dataIndex: 'Segment',
        key: 'Segment',

      },
      {
        title: 'Mutation',
        dataIndex: 'Mutation',
        key: 'Mutation',
      },
      {
        title: 'Ligand',
        dataIndex: 'Ligand',
        key: 'Ligand',
        render: (Ligand) => (
          <div>
            <Jsme
              height="100px"
              width="100px"
              options="depict,useopenchemlib"
              smiles={Ligand.smile}
            />
          </div>
        ),
      },
      {
        title: 'Activity type',
        dataIndex: 'Activity type',
        key: 'Activity type',
      },
      {
        title: 'Activity value',
        dataIndex: 'Activity value',
        key: 'Activity value',
      },
      {
        title: 'Units',
        dataIndex: 'units',
        key: 'units',
      },
      // {
      //   title: 'PercentChange(%)',
      //   dataIndex: 'Foldchange',
      //   key: 'Foldchange',
      //   defaultSortOrder: 'ascend',
      //   sorter: (a, b) => {

      //   },
      //   onFilter: (value, record) => {

      //   },
      // },

      // {
      //   title: 'Year of approval',
      //   dataIndex: 'Year of approval',
      //   key: 'Year of approval',
      // },
      {
        title: 'Reference',
        dataIndex: 'Reference',
        render: (Reference) => (
          <span>
            <Tag
              color="blue"
              onClick={() => {
                this.getReferences(Reference)
              }}>
              {Reference.toUpperCase()}
            </Tag>
          </span>
        ),
      },
    ]
    const columnsVirantsDisease = [
      {
        title: 'Consequence Type',
        dataIndex: 'Consequence Type',
        key: 'Consequence Type',
      },
      {
        title: 'Gene Position',
        dataIndex: 'Gene Position',
        key: 'Gene Position',
      },
      {
        title: 'Protein Position',
        dataIndex: 'Protein Position',
        key: 'Protein Position',
        render: (Reference, record) => (
          <span>
            <Tag
              color="blue"
              onClick={() => {
                this.getProteinPosition(record)
              }}>
              {record['Protein Position'].toUpperCase()}
            </Tag>
          </span>
        ),
      },
    ]
    const columns2 = [
      {
        title: 'name',
        dataIndex: 'name',
        key: 'name',
      },
      {
        title: 'sequence',
        dataIndex: 'sequence',
        key: 'sequence',
        width: 600,
      },
      {
        title: 'identity',
        dataIndex: 'identity',
        key: 'identity',
      },
      {
        title: 'similarity',
        dataIndex: 'similarity',
        key: 'similarity',
      },
    ]

    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 4 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 20 },
      },
    }
    const formItemLayoutWithOutLabel = {
      wrapperCol: {
        xs: { span: 24, offset: 0 },
        sm: { span: 20, offset: 4 },
      },
    }
    const formItemLayout3 = {
      labelCol: { span: 8 },
      wrapperCol: { span: 12 },
    }

    getFieldDecorator('keys', { initialValue: [] })
    const keys = getFieldValue('keys')
    const formItems = keys.map((k, index) => (
      <Form.Item
        {...(index === 0 ? formItemLayout : formItemLayoutWithOutLabel)}
        label={index === 0 ? 'AlignSequence: ' : ''}
        required={false}
        key={k}>
        {getFieldDecorator(`names[${k}]`)(
          <Input
            placeholder="Please input uniprot name"
            style={{ width: '60%', marginRight: 8 }}
          />
        )}
        {keys.length > 1 ? (
          <Icon
            className="dynamic-delete-button"
            type="minus-circle-o"
            onClick={() => this.remove(k)}
          />
        ) : null}
      </Form.Item>
    ))

    return (
      <div className="MutationDetails-div">
        <div className="Anchor-div">
          {directoryState && (
            <Button
              type="primary"
              style={{ width: '100%' }}
              onClick={() => this.setState({ directoryState: false })}>
              收起目录
            </Button>
          )}
          {!directoryState && (
            <Button
              type="primary"
              style={{ width: '100%' }}
              onClick={() => this.setState({ directoryState: true })}>
              展开目录
            </Button>
          )}
          {directoryState && (
            <div>
              <Anchor onClick={this.handleAnchorClick}>
                <Link href="#card" title="Title" />
                <Link href="#Sequence" title="Sequence" />
                <Link href="#Mutation" title="Mutation" />
                <Link href="#Structure" title="Structure" />
                <Link href="#VirantsDisease" title="VirantsDisease" />
              </Anchor>
            </div>
          )}
        </div>
        {/* <Modal
          footer={null}
          closable={false}
          width={1000}
          visible={visible}
          wrapClassName="vertical-center-modal"
          onCancel={() => this.setState({ visible: false })}>
          <div className="form-div">
            <Form onSubmit={this.handleSubmit}>
              <Form.Item label="Ref. Sequence:" {...formItemLayout}>
                <Input
                  placeholder=""
                  style={{ width: '60%', marginRight: 8 }}
                  disabled
                  value={targetsDetail.name}
                />
              </Form.Item>

              {formItems}
              <Form.Item {...formItemLayoutWithOutLabel}>
                <Button
                  type="dashed"
                  onClick={this.add}
                  style={{ width: '60%' }}>
                  <Icon type="plus" /> Add field
                </Button>
              </Form.Item>
              <Form.Item {...formItemLayoutWithOutLabel}>
                <Button type="primary" htmlType="submit">
                  Align
                </Button>
              </Form.Item>
            </Form>
          </div>
          <div className="SequenceAlignmentList-div">
            {SequenceAlignmentList.length > 0 && (
              <Table
                bordered
                rowKey="item"
                dataSource={SequenceAlignmentList}
                pagination={false}
                columns={columns2}
                scroll={{ x: 1200 }}
              />
            )}
          </div>
        </Modal> */}
        <Modal
          footer={null}
          closable={false}
          width='100%'
          height={800}
          visible={visible}
          wrapClassName="vertical-center-modal"
          onCancel={() => this.setState({ visible: false })}>
          <div className="SequenceAlignmentList-div">
            <Table
              bordered
              rowKey="item"
              dataSource={ProteinPositioList}
              pagination={false}
              columns={columnsMutation2}
              onChange={this.onChangeTable}
            />
            {/* <Pagination
              showSizeChanger
              onShowSizeChange={this.onShowSizeChange}
              onChange={this.onChange}
              total={ProteinPosition_total_num}
            /> */}
          </div>
        </Modal>
        <Spin tip="Loading..." size="large" spinning={this.state.loading}>
          <Card hoverable id="card">
            <div>
              <div className="title-div">{targetsDetail.name}</div>
              <div className="title-div-top">
                <div className="DataList-left">
                  <div>
                    <div className="div-list">
                      <div className="list-one">
                        <div className="left-title">Gene name</div>
                        <div />
                        {targetsDetail.Gene_name.map((item) => {
                          return <Tag>{item}</Tag>
                        })}
                      </div>
                      <div className="list-one">
                        <div className="left-title">Species</div>
                        <div />
                        {targetsDetail.Species}
                      </div>
                      <div className="list-one">
                        <div className="left-title">Uniport id</div>
                        <div />
                        {targetsDetail.Uniport_id}
                      </div>
                      <div className="list-one">
                        <div className="left-title">Class</div>
                        <div />
                        {targetsDetail.Class}
                      </div>
                    </div>
                  </div>
                </div>
                {/* <div className='Jsme-div'>
                            <Jsme height="300px" width="300px" options="depict,useopenchemlib" smiles={targetsDetail.smile} />
                            </div> */}
              </div>
            </div>
          </Card>
          {/* {PanelList} */}
          <Collapse
            defaultActiveKey={['1', '2', '3', '4']}
            onChange={this.callback}>
            <Panel header="Sequence" key="1" id="Sequence">
              {/* <Button type="primary" onClick={() => this.setState({ visible: true })}>筛选配体结合位点</Button> */}
              <div className="Sequence-div">
                {targetsDetail.Sequence.map((item, index) => {
                  // console.log(item);
                  //   console.log(Object.entries(item));
                  return (
                    <div className="Sequenceone-div" key={index}>
                      {Object.entries(item)[0][0]}
                      <div className="zimu-div">
                        {Object.entries(item)[0][1].map((item2, index2) => {
                          //   console.log(item2);
                          return (
                            <Tooltip
                              placement="top"
                              key={index2}
                              title={item2.title}>
                              <div className={'res-color-' + item2.thum}>
                                {item2.thum}
                              </div>
                            </Tooltip>
                          )
                        })}
                      </div>
                    </div>
                  )
                })}
              </div>
            </Panel>
            <Panel header="Mutation" key="2" id="Mutation">
              <div className="Radio-div">
                <Radio.Group
                  onChange={this.onChangeRadio}
                  value={this.state.MutationSearch.status}>
                  <Radio value={0}>Full data</Radio>
                  <Radio value={1}>Increase only</Radio>
                  <Radio value={2}>Decrease only</Radio>
                </Radio.Group>
              </div>

              <Table
                bordered
                rowKey="item"
                dataSource={OLDMutationList}
                pagination={false}
                columns={columnsMutation}
                onChange={this.onChangeTable}
              />
              <Pagination
                showSizeChanger
                onShowSizeChange={this.onShowSizeChange}
                onChange={this.onChange}
                total={total_num}
              />
            </Panel>
            <Panel header="Structure" key="3" id="Structure">
              <Tabs
                defaultActiveKey="0"
                // type="card"
                tabPosition="left"
                style={{ height: 500 }}
                onChange={this.ChangeTabs}>
                {targetsDetail.Structure.map((item, index) => {
                  return (
                    <TabPane tab={item.pdb} key={item.pdb}>
                      <div className="TabPane-center">
                        <div className="Molstar-div2">
                          {this.state.aciveKey == item.pdb && (
                            <WrappedIframe pdbLink={this.state.pdbLink} />
                          )}
                        </div>
                      </div>
                    </TabPane>
                  )
                })}
              </Tabs>
            </Panel>
            <Panel header="Virants & Disease" key="4" id="VirantsDisease">
              <Table
                bordered
                rowKey="item"
                dataSource={VirantsDiseaseList}
                pagination={false}
                columns={columnsVirantsDisease}
                expandedRowRender={expandedRowRender}
              />
              <Pagination
                showSizeChanger
                onShowSizeChange={this.onShowSizeChange2}
                onChange={this.onChange2}
                total={total_num2}
              />
            </Panel>
          </Collapse>
        </Spin>
      </div>
    )
  }
}
