/** * 通过搜索获得地图列表(保安人员) */ import React, { Component } from "react"; import { Pagination, message, Icon, Input, Button } from "antd"; import "./person.less"; import { getComPerLocationByKeyword } from "../../../../services/api"; export default class PersonSearch extends Component { constructor(props) { super(props); this.state = { layerSatatus: props.layerSatatus, searchData: { pageNumber: 1, pageSize: 7, keyWord: null }, personList: [], //人员列表数据 personClickIndex: props.personClickIndex || null, //选中的是哪个人员 height: null, //最大高度 beijing: false, //北京搜索框的展示状态 beijingVideo: false, //北京视频的展示状态 gaoqi: false //高崎搜索框的展示状态 }; } componentDidMount() { const height = document.documentElement.clientHeight - 120 - 130 - 40; this.setState({ height }); } componentWillReceiveProps(nextProps) { this.setState({ layerSatatus: nextProps.layerSatatus, personClickIndex: nextProps.personClickIndex }); } getPersonList(pageNumber) { if (this.state.searchData.keyWord === "北京展览馆") { this.setState({ beijing: true, personList: [], gaoqi: false }); this.props.markesBeiJing(); this.props.personList([]); } else if ( this.state.searchData.keyWord === "厦门机场" || this.state.searchData.keyWord === "厦门高崎机场" ) { this.setState({ gaoqi: true, personList: [], beijing: false }); this.props.markesGaoQi(); this.props.personList([]); } else if ( this.state.searchData.keyWord === "厦门百川信" || this.state.searchData.keyWord === "百川信" || this.state.searchData.keyWord === "厦门软件园三期" || this.state.searchData.keyWord === "软件园三期" ) { const keyWord = this.state.searchData.keyWord; this.setState( { searchData: { keyWord: "", pageNumber: 1, pageSize: 1000 }, beijing: false, gaoqi: false }, () => { getComPerLocationByKeyword({ ...this.state.searchData }).then(res => { if (res.retType === "0") { this.setState({ personList: res.data.data, total: 1000 }); this.props.personList(res.data.data, keyWord); } }); } ); } else { this.setState( { searchData: { ...this.state.searchData, pageNumber, pageSize: 7 }, personClickIndex: null, //清空是点击哪个人员数据 beijing: false, gaoqi: false }, () => { getComPerLocationByKeyword({ ...this.state.searchData }).then(res => { if (res.retType === "0") { this.setState({ personList: res.data.data, total: res.data.total }); this.props.personList(res.data.data); } }); } ); } } render() { return (