/**
 * 定义个人的信息窗体
 * @param type:用于基础图层与一张图的图层区分（两者除了展示的字段不一样，其余功能都一样）'police'是警保联动
 */
import { Modal, Button } from "antd";
const { confirm } = Modal;
export default function (data, type = '', marker) {
  const { address, name, phone, latitude, longitude } = data;
  const that = this;
  var content = [];
  content.push(
    "<div><div class='head'>" +
    name +
    "</div><div class='content-text'><div class='text'>联系地址：" +
    address +
    "</div><div class='text'>联系电话：" +
    phone +
    "</div></div>"
  );
  content.join("<br/>");
  var info = document.createElement("div");
  info.className = "content-window-card-address";
  //可以通过下面的方式修改自定义窗体的宽高
  // info.style.width = "400px";
  // 定义内容
  var middle = document.createElement("div");
  middle.className = "info-middle";
  middle.innerHTML = content;
  info.appendChild(middle);
  //定义详情
  var detail = document.createElement("div");
  detail.className = "detail-div";
  info.appendChild(detail);
  //定义关闭按钮
  var detail = document.createElement("div");
  detail.className = "close-div";
  var a = document.createElement("a");
  a.innerHTML = "x";
  a.onclick = () => {
    // this.state.map.clearInfoWindow();
    this.clear('setPersonSelectIndex')
  };
  detail.appendChild(a);
  info.appendChild(detail);
  var top = document.createElement("div");
  top.className = "info-button";
  var button1 = document.createElement("span");
  button1.className = "button";
  button1.innerHTML = "周边搜索";
  button1.onclick = () => {
    this.clear('setPersonSelectIndex')
    // this.character(data);
    that.setState({
      searchAround: {
        show: true,
        type: 'aPicture',
        lnglat: {
          latitude: latitude,
          longitude: longitude
        }
      }
    })
  };
  top.appendChild(button1);
  info.appendChild(top);
  return info;
}
