• FaultDiagnoseInfo.js 分页等


    var classRow = 15, total = 0, pageIndex = 0;
    
    
    function GetCount() {
    
        var serchmsg = $("#keyOrdoc").val();
        var UrlKey = "";
        if (serchmsg.length > 0) {
            if ($("#radKey").attr("checked") == "checked") {
                UrlKey = "&KeyWord=" + $("#keyOrdoc").val();
            }
            else {
                UrlKey = "&DocNo=" + $("#keyOrdoc").val();
            }
        }
        $.ajax({
            type: 'POST',
            dataType: 'json',
            url: 'Handler/FaultDiagnoseInfo.ashx',
            async: false,
            data: "OperationType=GetCount" + UrlKey + "&From=Idea",
            success: function (data) {
                total = data.total;
            },
            error: function (a, b, c) {
    
            }
        });
    }
    
    function pageselectCallback(pageIndex) {
        initData("#Result", pageIndex + 1, classRow);
    }
    
    function PaginationClick() {
    
        GetCount();
        $("#Pagination").pagination(total, //总条目数(必选)
                {
                items_per_page: classRow, //每页显示的条目数(可选,默认10)
                num_display_entries: 5, //连续分页主题部分显示的分页条目数(可选,默认10)
                current_page: pageIndex, //当前选中的页面(可选,默认0,表示第一页)
                num_edge_entries: 0, //两侧显示的首尾分页的条目数(可选,默认0)
                ellipse_text: '...', //省略的页数用什么文字表示(可选,默认...)
                first_text: '<img src="../v/images/notice/arrow_l01.gif" width="12" height="13" border="0" style="cursor:pointer" >',
                prev_text: '<img src="../v/images/notice/arrow_l02.gif" width="12" height="13" border="0"  style="cursor:pointer" >',
                next_text: '<img src="../v/images/notice/arrow_r02.gif" width="15" height="13" border="0"  style="cursor:pointer" >',
                last_text: '<img src="../v/images/notice/arrow_r01.gif" width="12" height="13" border="0"  style="cursor:pointer" >',
                callback: pageselectCallback//回调函数
            });
    }
    //加载数据
    function initData(name, pageIndex, row) {
    
        var serchmsg = $("#keyOrdoc").val();
        var UrlKey = "";
        if (serchmsg.length > 0) {
            if ($("#radKey").attr("checked") == "checked") {
                UrlKey = "&KeyWord=" + $("#keyOrdoc").val();
            }
            else {
                UrlKey = "&DocNo=" + $("#keyOrdoc").val();
            }
        }
        var tbody = '';
        $.ajax({
            type: 'POST',
            dataType: 'json',
            async: true,
            url: 'Handler/FaultDiagnoseInfo.ashx',
            data: "OperationType=InitData&pageIndex=" + pageIndex + "&pageSize=" + row + UrlKey + "&From=Idea",
            success: function (data) {
    
                var MyData = data.rows;
    
    
    
    
    
                $.each(MyData, function (i, n) {
    
                    var NowDate = new Date();
                    var UpdateDate = n.UpdateTime;
                    var dt2 = new Date(Date.parse(UpdateDate.replace(/-/g, '/')));
                    var datedeff = NowDate - dt2;
                    var days = Math.floor(datedeff / (24 * 3600 * 1000));
    
                    if (days <= 3) {
                        tbody = tbody + "<li class=\"mina_right_box03_content_list_FaultDiagnoseInfo_li01\"><image src=\"Image/xin.gif\" /><span class='aclink'><a href=\"FaultDiagnoseDetail.aspx?EditID=" + n.EditId + "\"";
                    }
                    else {
                        tbody = tbody + "<li class=\"mina_right_box03_content_list_FaultDiagnoseInfo_li01\"><span class='aclink'><a href=\"FaultDiagnoseDetail.aspx?EditID=" + n.EditId + "\"";
                    }
                    tbody = tbody + " target='_blank' title='" + n.DiagnoseTitle + "'>";
    
                    var title = n.DiagnoseTitle;
                    if (title.length >= 30) {
                        title = title.substring(0, 30) + "...";
                    }
                    tbody = tbody + title + "</a></span></li>";
                    tbody = tbody + "<li class='mina_right_box03_content_list_FaultDiagnoseInfo_li02'>";
                    tbody = tbody + n.DiagnoseCode + "</li>";
                    tbody = tbody + "<li class='mina_right_box03_content_list_FaultDiagnoseInfo_li03'>";
    
                    tbody = tbody + n.UpdateTime + "</li>";
                    tbody = tbody + "<li class='mina_right_box03_content_list_FaultDiagnoseInfo_li04'>";
                    tbody = tbody + n.DiagnoseTypeName + "</li>";
    
                })
                $(name).html(tbody);
            },
            error: function (a, b) {
                //$(name).html("暂无文章!");
                //$(name).html('<p>&nbsp;</p><div class="mina_right_msg png">如果您需要其他帮助请访问 <a href="http://ask.lenovo.com.cn">联想问吧</a>&nbsp;也可以通过 <a href="../usercenter/chat/GoChatClient.aspx">在线咨询</a> 获得技术支持</div>');
    
                var content = '<br/><br/><p align="center"><font size = "3px">很抱歉,没有找到您查询的相关内容,建议您尝试其他帮助获取支持。</font></p><br/>';
    
                content = content + '<div style="margin-left: 180px;">';
                content = content + '<a target="_blank" href="http://support1.lenovo.com.cn/lenovo/wsi/usercenter/login/Login.aspx" class="mina_right_box01_content_right_btn_a02">在线咨询</a> ';
                content = content + '<a target="_blank" href="http://support1.lenovo.com.cn/lenovo/wsi/wsbx/lenovo/#minarepairInfo" class="mina_right_box01_content_right_btn_a02">网上报修</a> ';
                content = content + '<a target="_blank" href="http://ask.lenovo.com.cn/" class="mina_right_box01_content_right_btn_a02">联想问吧</a> ';
                content = content + '<a target="_blank" href="http://support1.lenovo.com.cn/lenovo/wsi/Modules/doclist.aspx" class="mina_right_box01_content_right_btn_a02">常见问题查询</a>';
                content = content + '</div>';
    
                $(name).html(content);
                $("#Pagination").html('');
            }
        });
    }
    
    $(document).ready(function () {
    
        PaginationClick();
    });
  • 相关阅读:
    SCCM2012 R2实战系列之四:初始化配置
    SCCM 2012 R2实战系列之一:SQL安装
    hdu 1242(bfs)
    hdu 1728(bfs)
    hdu 1253(bfs)
    hdu 3661
    hdu 1072(bfs)
    AC模版
    hdu 1010(dfs)
    poj 3628(01_page, dfs)
  • 原文地址:https://www.cnblogs.com/feifu/p/2965734.html
Copyright © 2020-2023  润新知