/** * 驻勤点的搜索列表 */ import React, { Component } from "react"; import { Pagination, Button, Input, Icon } from "antd"; import "./attendance.less"; import PersonSearchList from "./PersonSearchList"; import { getComTaskList, getComTempTaskList } from "../../../../services/api"; export default class AttendanceSearch extends Component { constructor(props) { super(props); this.state = { layerSatatus: props.layerSatatus, activityNo: props.activityNo, // isSecuOrAtten: props.isSecuOrAtten, searchData: { //搜索数据 pageNumber: 1, pageSize: 7, taskName: null }, // selectedIndex: props.selectedIndex || null, //选中哪个列表 selectedIndex: null, //选中哪个列表 selectedAttenData: props.selectedAttenData || null, //选中的驻勤点的信息 clickAttenPersonIndex: props.clickAttenPersonIndex || null, clickEventIndex: props.clickEventIndex || null, total: 0, //搜索总页数 attendanceList: [], //搜索出的驻勤点的数据 iconData: props.iconData || [], //图标列表 // attenPersonList: [] //驻勤点对应的人员信息 height: null, //搜索列表的最大高度 eventList: [{ name: '活动事件1', lnglat: [106.22445, 38.486085], describe: '活动事件测试信息', id: '1' }, { name: '活动事件2', lnglat: [106.225293, 38.485052], describe: '活动事件测试信息', id: '2' }, { name: '活动事件3', lnglat: [106.222696, 38.485312], describe: '活动事件测试信息', id: '3' }], }; } componentDidMount() { const height = document.documentElement.clientHeight - 120 - 130 - 40; this.setState({ height }); this.getAttendanceList(1); //默认页面中是空搜索 this.props.eventList(this.state.eventList); } componentWillReceiveProps(nextPorps) { this.setState({ layerSatatus: nextPorps.layerSatatus, // selectedIndex: nextPorps.selectedIndex, selectedAttenData: nextPorps.selectedAttenData, clickAttenPersonIndex: nextPorps.clickAttenPersonIndex, iconData: nextPorps.iconData, activityNo: nextPorps.activityNo, clickEventIndex:nextPorps.clickEventIndex }); } //获取搜索值 getAttendanceList(pageNumber) { // this.props.onClickSelectedAttenData(null); this.props.attenPersonList([]); //先重置分页数据 this.setState( { searchData: { ...this.state.searchData, pageNumber }, selectedIndex: null, //清空驻勤的点击哪个列表的信息 selectedAttenData: null }, () => { //临保任务的列表(与普通防控的不同之处) // getComTaskList({ getComTempTaskList({ ...this.state.searchData, activityNo: this.state.activityNo }).then(res => { if (res.retType === "0") { this.setState({ attendanceList: res.data.data, total: res.data.total }); this.props.attendanceList(res.data.data); } }); } ); } render() { return (