function tpmeta(meta_act, ibd_id, ibd_Itemvalue = "", ibd_ItemType = "", ibd_ItemDescription = "") {
    if (meta_act == "save") {
        var url = "/info.php/infobokundata/save_meta"
    }
    if (meta_act == "delete") {
        if (confirm("是否删除该属性?")) {
            var url = "/info.php/infobokundata/delete_meta"
        } else {
            return false
        }
    }
    $.ajax({
        type: "post",
        dataType: "json",
        url: url,
        data: {
            "ibd_id": ibd_id,
            "ibd_Itemvalue": ibd_Itemvalue,
            "ibd_ItemType": ibd_ItemType,
            "ibd_ItemDescription": ibd_ItemDescription
        },
        success: function (data, textStatus) {
            for (var key in data) {
                if (data[key].name == "ok") {
                    if (meta_act == "delete") {
                       // alert("sss");
                        $("#" + ibd_id).closest("div.box").remove();
                       // alert("end");
                    }
                    $.modaldialog.success(data[key].value);
                    return true
                } else {
                    $.modaldialog.error(data[key].value)
                }
            }

        },
        error: function () {
            $.modaldialog.error("更新失败..")
        }
    })
}

function  addmeta(ibd_ic_id,ibd_parentId=0,ibd_ItemName,ibd_Itemvalue="",ibd_ItemType="",ibd_ItemDescription="") {
    var url = "/info.php/infobokundata/add_meta";
    if (ibd_ItemName=="" || typeof(ibd_ItemName) == undefined){
        $.modaldialog.error("更新失败，属性名称必须选择！")
        return false;
    }
    if (ibd_Itemvalue=="" || typeof(ibd_Itemvalue) == undefined){
        $.modaldialog.error("更新失败，属性值必须填写！")
        return false;
    }


    $.ajax({
        type: "post",
        dataType: "json",
        url: url,
        data: {
            "ibd_ic_id": ibd_ic_id,
            "ibd_parentId":ibd_parentId,
            "ibd_ItemName":ibd_ItemName,
            "ibd_Itemvalue": ibd_Itemvalue,
            "ibd_ItemType": ibd_ItemType,
            "ibd_ItemDescription": ibd_ItemDescription
        },
        success: function (data, textStatus) {
            for (var key in data) {
                if (data[key].name == "ok") {
                    $.modaldialog.success(data[key].value);
                    return true
                } else {
                    $.modaldialog.error(data[key].value)
                }
            }

        },
        error: function () {
            $.modaldialog.error("更新失败..")
        }
    })
}

function CheckAddBox() {
    if ($("#js_AddBokunBox").is(":visible")){
        $("#js_AddBokunBox").hide();
    }else{
        $("#js_AddBokunBox").show();
    }
}
