//定义事件列表的信息窗体
import {  Modal } from "antd";
const { confirm } = Modal;
export default function(data){
    const { name, time, describe } = data;
    var content = [];
    content.push(
      "<div class='event-content-text'><div class='text center'>" +
        name +
        "</div><div class='text'>" +
        describe +
        "</div></div>"
    );
    content.join("<br/>");
    var info = document.createElement("div");
    info.className = "content-window-card";
    //可以通过下面的方式修改自定义窗体的宽高
    info.style.width = "200px";
    // 定义内容
    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.style.marginLeft = '95px';
    a.onclick = () => {
      // this.state.map.clearInfoWindow();
      this.clear('setEventSelectIndex')
    };
    detail.appendChild(a);
    info.appendChild(detail);

    var top = document.createElement("div");
    top.className = "info-button";
    info.appendChild(top);
    // 定义底部内容
    var bottom = document.createElement("div");
    bottom.className = "info-bottom";
    bottom.style.position = "relative";
    bottom.style.top = "-1px";
    bottom.style.margin = "0 auto";
    var sharp = document.createElement("img");
    sharp.src = "https://webapi.amap.com/images/sharp.png";
    bottom.appendChild(sharp);
    info.appendChild(bottom);
    return info;
}