/*
此js用来处理会议记录模板
*/
Namespace.register("U.Boom.O.M"); //会议记录处理

//导航模板功能。原名U.O.W.Meeting,缩写:U.O.W.MT
Namespace.register("U.O.W.MT");


//初始化
window.onload = function () {
    var d = new Date();
    $("#U_Boom_O_M_Data span")[1].innerHTML += d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
    //获取传入id同时获取数据


    //事件处理
}

//获取数据
U.Boom.O.M.GetData = function () {

}


//获取数据回调处理
U.Boom.O.M.AsynGetData = function () {

}

//生成数据页面
U.Boom.O.M.Generate = function () {

}

//会议记录输入处理
U.Boom.O.M.GetData = function () {

    //此地方处理了 删除 删除的时候不允许把默认模板的样式删除


    //回车处理

}
//添加会议成员
U.Boom.O.M.AddPeople = function () {
    var _UFFD = $$("div",{"style":{"text-align": "center","margin": "15px"},"id": "test"}); //创建对话框中的内容div元素。
    $$("span",{"innerHTML": "请输入会议成员:"},_UFFD); //追加字符串
    var _h = $$("input",{'value': ''},_UFFD); //追加输入框
    $$("div",{},_UFFD); //追加div用于换行
    var _CUM = new U.UF.UI.confirm("会议成员", function () {
        U.Boom.O.M.Sub_Add(_h)
    }); //创建对话框
}
U.Boom.O.M.Sub_Add = function (r, add) {
    if (r.value == '' || r.value == null) {
        U.alert("请输入名称");
        return;
    }
    $$("li",{"style":{"list-style": "none"},"id": r.value},$("#U_Boom_O_M_PeopleList")[0]);
    var a = $("#U_Boom_O_M_PeopleList li");
    var number = a.length - 1;
    $$("a",{"style":{"list-style": "none"},"contenteditable": "true","innerHTML": r.value},$("#U_Boom_O_M_PeopleList li")[number]);
    $$("span",{
        "style":
     {
         "color": "red"
     },
        "id": "spana",
        "contenteditable": "flase",
        "innerHTML": " X",
        "onclick": function () {
            U.Boom.O.M.cy($("#U_Boom_O_M_PeopleList li")[number]);
        }
    },
        $("#U_Boom_O_M_PeopleList li")[number]);
}
U.Boom.O.M.cy = function (a) {
    $(a).remove();
}
//修改会议标题
/*U.Boom.O.M.ChangeTitle = function (metting_title) {
var _UFFD = $$("div", { "style": { "text-align": "center", "margin": "15px" }, "id": "test" }); //创建对话框中的内容div元素。
$$("span", { "innerHTML": "请输入会议主题:" }, _UFFD); //追加字符串
var _h = $$("input", { 'value': metting_title.innerHTML }, _UFFD); //追加输入框
$$("div", {}, _UFFD); //追加div用于换行
var _CUM = new U.UF.UI.confirm("会议主题", { "width": "350px", "text-align": "center" }, null, function(){U.Boom.O.M.ChangeMetting(_h, metting_title);}, _UFFD); //创建对话框 
}
U.Boom.O.M.ChangeMetting = function (r, area) {
if (r.value == '' || r.value == null) {
U.alert("请输入会议主题");
return;
}
area.innerHTML = r.value;
}
*/
//添加会议通知
U.Boom.O.M.AddNotice = function () {
    var _UFFD = $$("div",{"style":{"text-align": "center","margin": "15px"},"id": "test"}); //创建对话框中的内容div元素。
    $$("span",{"innerHTML": "请输入会议通知:"},_UFFD); //追加字符串
    var _h = $$("input",{'value': ''},_UFFD); //追加输入框
    $$("div",{},_UFFD); //追加div用于换行
    var _CUM = new U.UF.UI.confirm(_UFFD, function () {
        U.Boom.O.M.AddNotice_Add(_h)
    }); //创建对话框
}
U.Boom.O.M.AddNotice_Add = function (r, add) {
    if (r.value == '' || r.value == null) {
        U.alert("请输入通知");
        return;
    }
    $$("li",{"style":{
        "list-style": "none",
        "width": "50%",
        "text-align": "left",
        "height": "20px",
        "line-height": "20px"
    },
        "id": r.value
    },
           $("#U_Boom_O_M_List_tz")[0]);
    var a = $("#U_Boom_O_M_List_tz li");
    var number = a.length - 1;
    $$("a",{"style":{"list-style": "none"},"contenteditable": "true","innerHTML": r.value},$("#U_Boom_O_M_List_tz li")[number]);
    $$("span",
    {
        "style":
     {
         "color": "red"
     },
        "contenteditable": "flase",
        "innerHTML": " X",
        "onclick": function () {
            U.Boom.O.M.tz($("#U_Boom_O_M_List_tz li")[number]);
        }
    },
      $("#U_Boom_O_M_List_tz li")[number]);
}
U.Boom.O.M.tz = function (a) {
    $(a).remove();
}
//添加讨论
U.Boom.O.M.Discuss = function () {
    var _UFFD = $$("div",{"style":{"text-align": "center","margin": "15px"},"id": "test"}); //创建对话框中的内容div元素。
    $$("span",{"innerHTML": "请输入讨论内容:"},_UFFD); //追加字符串
    var _h = $$("input",{'value': ''},_UFFD); //追加输入框
    $$("div",{},_UFFD); //追加div用于换行
    var _CUM = new U.UF.UI.confirm(_UFFD, function () {
        U.Boom.O.M.Add_tl(_h)
    }); //创建对话框
}
U.Boom.O.M.Add_tl = function (r, add) {
    if (r.value == '' || r.value == null) {
        U.alert("请输入讨论");
        return;
    }
    $$("li",
    {
        "style":
     {
         "list-style": "none",
         "width": "50%",
         "text-align": "left",
         "height": "20px",
         "line-height": "20px"
     },
        "id": r.value
    },
          $("#U_Boom_O_M_tl")[0]);
    var a = $("#U_Boom_O_M_tl li");
    var number = a.length - 1;
    $$("a",{"style":{"list-style": "none"},"contenteditable": "true","innerHTML": r.value},$("#U_Boom_O_M_tl li")[number]);
    $$("span",
    {
        "style":
     {
         "color": "red"
     },
        "contenteditable": "flase",
        "innerHTML": " X",
        "onclick": function () {
            U.Boom.O.M.tz($("#U_Boom_O_M_tl li")[number]);
        }
    },
         $("#U_Boom_O_M_tl li")[number]);
}
U.Boom.O.M.tz = function (a) {
    $(a).remove();
}
function U_Boom_O_M_List_yl() {
    var a = $("#U_Boom_O_M_PeopleList li"); //会议成员个数
    var b = $("#U_Boom_O_M_List_tz li"); //通知个数
    var c = $("#U_Boom_O_M_tl li"); //讨论个数
    var U_Boom_O_M_Title = document.querySelectorAll(".U_Boom_O_M_Title")[0];
    var OutputDiv = document.createElement("div");
    var OutputDiv_Title = document.createElement("div");
    var OutputDiv_people = document.createElement("div");
    var Transparent = document.createElement("div");
    Transparent.style.cssText = "width:100%;height:100%;text-align:center;background:#aaa;margin:0 auto;position:fixed;top:0;left:0;filter:alpha(Opacity=80);-moz-opacity:0.8;opacity: 0.8;";
    OutputDiv.style.cssText = "border:1px solid #eee;width:50%;height:100%;text-align:center;background:#fff;margin:0 auto;position:fixed;left:25%;top:20px";
    OutputDiv_Title.style.cssText = "background-color:#595959;width:100%;height:40px;color:#fff;text-align:center;vertical-align:middle;font-size:26pt;font-family:'Microsoft YaHei UI',sans-serif;line-height:40px;";
    OutputDiv_Title.innerHTML = U_Boom_O_M_Title.innerHTML;
    OutputDiv_people.style.cssText = "margin:10px;font-size:17pt;line-height:33px;text-align:left;";
    OutputDiv_people.innerHTML = "会议人员";
    document.body.appendChild(Transparent);
    document.body.appendChild(OutputDiv);
    OutputDiv.appendChild(OutputDiv_Title);
    OutputDiv.appendChild(OutputDiv_people);
    for (var i = 0; i < a.length; i++) {
        var OutputDiv_people_user = document.createElement("div");
        OutputDiv_people_user.style.cssText = "color: #595959;font-weight:700px;font-size: 10.5pt;width:90%;text-align:left;height:30px;line-height:30px;margin-left:5%;"
        OutputDiv_people_user.innerHTML = a[i].id;
        OutputDiv.appendChild(OutputDiv_people_user);
    }
    var OutputDiv_Notice = document.createElement("div");
    OutputDiv_Notice.style.cssText = "margin:10px;color:#000;font-size:17pt;line-height:33px;text-align:left;";
    OutputDiv_Notice.innerHTML = "会议内容";
    OutputDiv.appendChild(OutputDiv_Notice);
    for (var x = 0; x < b.length; x++) {
        var OutputDiv_Notice_content = document.createElement("div");
        OutputDiv_Notice_content.style.cssText = "color: #595959;font-size: 10.5pt;width:90%;text-align:left;height:30px;line-height:30px;margin-left:5%;";
        OutputDiv_Notice_content.innerHTML = b[x].id;
        OutputDiv.appendChild(OutputDiv_Notice_content);
    }
    var OutputDiv_tl = document.createElement("div");
    OutputDiv_tl.style.cssText = "margin:10px;color:#000;font-size:17pt;line-height:33px;text-align:left;";
    OutputDiv_tl.innerHTML = "讨论";
    OutputDiv.appendChild(OutputDiv_tl);
    for (var y = 0; y < c.length; y++) {
        var OutputDiv_tl_content = document.createElement("div");
        OutputDiv_tl_content.style.cssText = "color: #595959;;font-size: 10.5pt;width:90%;text-align:left;height:30px;line-height:30px;margin-left:5%;";
        OutputDiv_tl_content.innerHTML = c[y].id;
        OutputDiv.appendChild(OutputDiv_tl_content);
    }
    Transparent.onclick = function () {
        OutputDiv.remove(OutputDiv);
        Transparent.remove(Transparent);

    }
}
window.onload = function () {
    var yl = document.querySelector("#U_Boom_O_M_head_yl");
    var U_Boom_O_M_body = document.querySelectorAll(".U_Boom_O_M_body")[0];
    yl.onclick = function () {
        var Opacity = document.createElement("div");
        Opacity.style.cssText = "width:100%;height:100%;position:fixed;top:0;left:0; z-index:999; background:#ccc;filter:alpha(Opacity=0);-moz-opacity:0;opacity: 0;"
        U_Boom_O_M_body.appendChild(Opacity);
    }

}