import React from "react";
import { personInfoCard, CheckBoxItem } from "../../utils";
import { Row ,Col,Checkbox} from 'antd';
import BaseTitleCard from './BaseTitleCard';
const CheckGroup=Checkbox.Group
class personCard extends React.Component {
  render() {
    let { personData, searchKeyChange, selectDataList, click } = this.props;
    let id = personData.personId||personData.aid||(personData.bindAids&&personData.bindAids[0])
    let selectKeys = selectDataList[id] || [];
    return (
      <>
        {personInfoCard(personData, click)}
        <div className="relation-search-box ">
          <div className="relation-search-title">资源碰撞：</div>
          <div
            className="relation-search-content"
            style={{ padding: "0 0 10px 0" }}
          >
            <CheckGroup onChange={searchKeyChange} defaultValue={selectKeys}>
              <Row type="flex" gutter={16}>
                <Col span={12}>
                  <BaseTitleCard
                    style={{ padding: "0 0 8px 0" }}
                    icon="icon-S_Bar_PeopleAll"
                    title={<span className="relational-type-title">人</span>}
                    content={
                      <>
                        {CheckBoxItem(
                          selectKeys,
                          "queryPersonAccompanies",
                          "同行"
                        )}
                        {CheckBoxItem(
                          selectKeys,
                          "getAidsTogetherByAid",
                          "常同出现"
                        )}
                        {/* {CheckBoxItem(
                          selectKeys,
                          "companion",
                          "同乘"
                        )} */}
                      </>
                    }
                  />
                </Col>
                <Col span={12}>
                  <BaseTitleCard
                    style={{ padding: "0 0 8px 0" }}
                    icon="icon-S_Point_Camera"
                    title={<span className="relational-type-title">设备</span>}
                    content={CheckBoxItem(
                      selectKeys,
                      "queryAidAndCidRelation",
                      "经过次数最多"
                    )}
                  />
                </Col>
                <Col span={12}>
                  <BaseTitleCard
                    style={{ padding: "0 0 8px 0" }}
                    icon="icon-S_Place_Place"
                    title={<span className="relational-type-title">场所</span>}
                    content={
                      <>
                        {CheckBoxItem(
                          selectKeys,
                          "getPersonFrequentedPlaces7",
                          "最近一周常去地"
                        )}
                        {CheckBoxItem(
                          selectKeys,
                          "getPersonFrequentedPlaces30",
                          "最近一月常去地"
                        )}
                        {CheckBoxItem(
                          selectKeys,
                          "getLivePlaceByAid",
                          "疑似居住地"
                        )}
                      </>
                    }
                  />
                </Col>
                {/* <Col span={12}>
                  <BaseTitleCard
                    style={{ padding: "0 0 8px 0" }}
                    icon="icon-S_Bar_Motor"
                    title={<span className="relational-type-title">车辆</span>}
                    content={
                      <>
                        {CheckBoxItem(
                          selectKeys,
                          "getPersonVehicle",
                          "驾驶车辆"
                        )}
                      </>
                    }
                  />
                </Col> */}
              </Row>
            </CheckGroup>
          </div>
        </div>
      </>
    );
  }
}

export default personCard;
