ajax css js html 后台管理页面_weixin_30402085的博客-程序员秘密

技术标签: ViewUI  json  javascript  

主页面:apk.html

<!DOCTYPE html>
<html lang="en">
<head>
    
    <meta charset="UTF-8">
  <!--
    <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
      -->
    <title>apk信息管理</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="../css/iconfont.css">

<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jquery-1.9.1.js" ></script>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="../htmlPage/js/paging.js"></script>
 <style>
            * {
     
                padding: 0;
                margin: 0;
            }
            /*
            * 外面盒子样式---自己定义
            */
            .page_div {
     
                margin-bottom: 20px;
                font-size: 15px;
                font-family: "microsoft yahei";
                color: #666666;
                margin-right: 10px;
                padding-left: 20px;
                box-sizing: border-box;
                text-align:center;
            }
            /*
            * 页数按钮样式
            */
            .page_div a {
     
                min-width: 30px;
                height: 28px;
                border: 1px solid #dce0e0!important;
                text-align: center;
                margin: 0 4px;
                cursor: pointer;
                line-height: 28px;
                color: #666666;
                font-size: 13px;
                display: inline-block;
            }
            
            #firstPage,
            #lastPage {
     
                width: 50px;
                color: #0073A9;
                border: 1px solid #0073A9!important;
            }
            #prePage,
            #nextPage {
     
                width: 70px;
                color: #0073A9;
                border: 1px solid #0073A9!important;
            }
            .page_div .current {
     
                background-color: #0073A9;
                border-color: #0073A9;
                color: #FFFFFF;
            }
            .totalPages {
     
                margin: 0 10px;
            }
            .totalPages span,
            .totalSize span {
     
                color: #0073A9;
                margin: 0 5px;
            }
        </style>
<style type="text/css">
        .divstyle{
     
            margin-top: 80px;
            width: 900px;
            text-align:center;
        }   
        #btn{
     
            background: #5591FC;
            color: white;
        }
        .imei-detail ,.json-detail,.unuse-num,.use-num{
     
            background: #0a84d5;
            color: white;
            width: 50px;
            height: 33px;
            text-align:middle
        }
        .json-delete{
     
             background: #ff672b;
            color: white;
            width: 50px;
            height: 33px;
            text-align:middle
        }

        .imei-add,.json-fabu{
     
            background: #ff8d39;
            color: white;
            width: 50px;
            height: 33px;
            text-align:middle
        }
        .json-quxiao{
     
            background: #a6a5a5;
            color: white;
            width: 50px;
            height: 33px;
            text-align:middle

        }
        .json-deletetwo{
     
            background: #a6a5a5;
            color: white;
            width: 50px;
            height: 33px;
            text-align:middle
        }
        .use-num{
     
           
            margin-left:0px;
        }
        .json-detail{
     
            margin-left: 10px;
        }
    
        label{
     
            color:#5591FC;
            font-size:18px;
            text-align:left;
        }
        td{
     
            text-align:center;
            font-size:17px;
            color:#000000;
        }
        #td{
     
            
            font-size:17px;
            color:#000000;
            margin-left: -100px;
        }
        input,button,select,textarea{
     outline:none}textarea{
     resize:none}
        .div1{
     
            border:1px solid #000;
            width: 1000px;
            height: 200px;
        }   
        .property-cate {
     
            border: 1px solid #ccc;
            padding: 5px 20px;
            margin: 10px 15px;
        }
        .property-cate .manage-tabel .uploader-list .thumbnail img{
     width: 180px;height: 90px}
        .w725 {
     
            width:725px;
            margin:0 auto;
        }
        .w400{
     
            width:500px;
            margin:0 auto;
        }
        .w625{
     
             width:625px;
        }
        .w1030{
     
            width:1030px;
            margin:0 auto;
        }
        .ins-con .property-cate-p1 td:nth-child(2),
        .property-cate-p1.w400 td:nth-child(2),
        .property-cate-p1.w725 td:nth-child(2),
        .property-cate-p1.w1030 td:nth-child(2),
        .property-cate-p1.w625 td:nth-child(2){
     
                 width:190px;
        }
        .property-cate-p1 ul:before {
     
            clear: both;
            content: '';
            display: table;
        }
        .property-cate-p1 ul:after {
     
            clear: both;
            content: '';
            display: table
        }
        .property-cate-p1 li {
     
            display: inline-block;
            margin-right: 30px;
            line-height: 40px;
            float: left;
        }
        .property-cate-p1 li span {
     
            margin-right: 10px;
            line-height: 40px;
        }
        .sure{
     
            color:red;
        }
        .property-cate-p1 input,
        a{
     
            text-decoration:none;
        }
        i{
     
            color: #5591FC;
            font-size: 13px;
        }
        .span{
     
            color:#b3b3b3;
            margin-left: 10px;
            margin-right: 10px;
        }
        tr{
     
            height:50px; 
        }
</style>
</head>
<body >
    <div class="user-main query" style="position:relative;" >
    <div class="user-main-title property-title">
        <ul>
            <li >&nbsp&nbsp&nbsp&nbsp.apk信息</li>
        </ul>
    </div>
    <!--<form  id="myForm" class="myForm">-->
     <div class="property-cate">
        <div class="property-cate-p1">
            <ul>
                <!--
                <li>
                    <label >imei:</label>
                    <input type="text" name="imei" id="imei">
                </li>
                -->
                <form  id="myForm" class="myForm">
                <li>
                    <label >包名:</label>
                     <input type="text" name="packageName" id="packageName" >
                </li>
                <li>
                    <label  >型号:</label>
                    <input type="text" name="productinfo" id="productinfo" >
                </li>   
                </form>             
                <li style="margin-left:85px;float: right;" >
                    <button class="btn btn-query" id="btn" style="margin-right:15px;" ng-click="search()">
                    查询</button>
                    <button class="btn btn-reset"  id="btn" ng-click="reset()" onclick="formReset()">重置</button>
                     
                </li>
            </ul>
        </div>
    </div>
    <!--
        <i  id="ddd" class="btn ddd"  style="margin-left:40px;">详情</i>
        <i class="btn " disabled="true">详情</i>
    -->
    <!--</form>-->
    <div style="margin: 10px 15px;">
       <table id="myTable"  class="table table-striped" bordercolor="#B0C4DE" border="1" width="100%" cellpadding="2" cellspacing="0">
            <thead>
             <tr bgcolor="#DDDDDD">
                <td >imei号</td>
                <td >时间</td>
                <td >型号</td>
                <td >文件类型</td>
                <td >包名</td>
                <td >版本号(版本名)</td>
                <td >更新成功数</td>
                <td >更新成功</td>
                <td >更新失败数</td>
                <td >更新失败</td>
                <td >操作</td> 
             </tr>
            </thead>
            <tbody>
            </tbody>  
        </table>
    </div>
        <div value="1 0"></div>
        <div id="page" class="page_div"></div>
      
</div>
</body>
<script type="text/javascript"> 
var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题 
var table = document.getElementById("myTable"); 
for (j = 0; j < table.rows[0].cells.length; j++) { 
table.rows[0].cells[j].onmousedown = function () { 
//记录单元格 
tTD = this; 
if (event.offsetX > tTD.offsetWidth - 10) { 
tTD.mouseDown = true; 
tTD.oldX = event.x; 
tTD.oldWidth = tTD.offsetWidth; 
} 
//记录Table宽度 
//table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement; 
//tTD.tableWidth = table.offsetWidth; 
}; 
table.rows[0].cells[j].onmouseup = function () { 
//结束宽度调整 
if (tTD == undefined) tTD = this; 
tTD.mouseDown = false; 
tTD.style.cursor = 'default'; 
}; 
table.rows[0].cells[j].onmousemove = function () { 
//更改鼠标样式 
if (event.offsetX > this.offsetWidth - 10) 
this.style.cursor = 'col-resize'; 
else 
this.style.cursor = 'default'; 
//取出暂存的Table Cell 
if (tTD == undefined) tTD = this; 
//调整宽度 
if (tTD.mouseDown != null && tTD.mouseDown == true) { 
tTD.style.cursor = 'default'; 
if (tTD.oldWidth + (event.x - tTD.oldX)>0) 
tTD.width = tTD.oldWidth + (event.x - tTD.oldX); 
//调整列宽 
tTD.style.width = tTD.width; 
tTD.style.cursor = 'col-resize'; 
//调整该列中的每个Cell 
table = tTD; while (table.tagName != 'TABLE') table = table.parentElement; 
for (j = 0; j < table.rows.length; j++) { 
table.rows[j].cells[tTD.cellIndex].width = tTD.width; 
} 
//调整整个表 
//table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth); 
//table.style.width = table.width; 
} 
}; 
} 
</script>

<script type="text/javascript">
//重置 
function formReset()
{
    document.getElementById("myForm").reset();
}
var list=[];
var listNum="";
var totalpage=""; 
var status=true;
var pageNo=1;
var pageSize=10;
var packageName="";
var productinfo="";
$(function test(){
   // $('.ddd').attr("disabled",true);
    var n=0;
    console.log("包名:"+packageName);
    console.log("型号:"+productinfo);
    console.log("当前页:"+pageNo);
    demo(pageNo-1,pageSize,packageName,productinfo);
    totalpage= Number(totalpage);
    $("#page").paging({
            pageNo:pageNo,
            totalPage:totalpage,
            totalSize: listNum,
            callback: function(num){
                   // alert(num); 
                pageNo=num;
                test();
            }
    }); 
    if(list.length<=10){
        var margin=(10-list.length)*50+35;
        document.getElementById('page').style.marginTop=margin+"px";
    }
    console.log("list集合");
    console.log(list);
    var tbody=$('<tbody></tbody>');
    $(list).each(function (index){
        var val=list[index];
        var type="其他";
        var dis = "";
        var txtQuxiao="";
        var txtFabu="";
        var fabu="";
        var quxiao="";
        var fabu_able="";
        if(val.fileType==0){
            type="apk";
        }
        else if(val.fileType==1){
            type="视频";
        }
        else if(val.fileType==2){
           type="图片";
        }
        else if(val.fileType==3){
            type="其他";
        }
        if(val.status=="0"){
            txtQuxiao="disabled";
            $('.json-quxiao').attr("disabled","disabled");
            dis = "none"; 
        }
        else if(val.status=="1"){
            txtFabu="disabled";
            $('.json-fabu').attr("disabled","disabled");
            fabu="none";
        }
        var tr=$('<tr></tr>');
        tr.append('<td><button class="btn imei-detail"  id="imeidetail'+index+'">详情</button><span class="span">|</span><button class="btn imei-add" id="imeiadd'+index+'">新增</button></td>'+'<td id="chgDate">'+val.chgDate+'</td>'+'<td id="productinfo">'+val.productinfo+'</td>'+'<td id="type">'+type+'</td>'+'<td id="packageName">'+val.packageName+'</td>'+'<td id="versionCode">'+val.versionCode+'('+val.versionName+')'+'</td>'+'<td id="successNum">'+val.successNum+'</td>'+'<td><button class="btn use-num"  id="usenum'+index+'">详情</button></td>'+'<td  id="falseNum">'+val.falseNum+'</td>'+'<td><button class="btn unuse-num"  id="unusenum'+index+'">详情</button></td>'+'<td> <button class="btn json-detail"  id="jsondetai'+index+'" >详情</button><span class="span"  >|</span><button class="btn json-delete"  id="jsondelete'+index+'"  style="display: '+fabu+';" >删除</button><button class="btn json-deletetwo"  id="jsondelete'+index+'"   style="display: '+dis+';" '+txtFabu+'>删除</button><span class="span"  style="display: '+fabu+';">|</span><button class="btn json-fabu"  id="fabu'+index+'" style="display: '+fabu+';" >发布</button><span class="span"  style="display: '+dis+';">|</span><button class="btn json-quxiao"  id="quxiao'+index+'" style="display: '+dis+';">取消</button></td>');
        tbody.append(tr);
    });
    $('#myTable tbody').replaceWith(tbody); 
    //查询所有列表 
    function demo(pageNo,pageSize,packageName,productinfo){  
        $.ajax({
            url:"http://192.168.1.147:6792/flowsweb/apk.do?method=queryApkJson",
            type:'get',
            dataType:'json',//服务器返回的json数据格式
            data:{
     "versionStatus":"0","pageNo":pageNo,"pageSize":pageSize,"packageName":packageName,"productinfo":productinfo},
            timeout:10000,//超时时间设置为10秒;
            async:false,//同步操作
            success:function(data){
            list=data.apkJsonList;
            listNum=data.listNum;
            totalpage=data.totalPage;
            console.log(list);
            var obj=eval(data);
            /*
            var tbody=$('<tbody></tbody>');
            $(obj.apkJsonList).each(function (index){
                list=obj.apkJsonList;
                //console.log(list);
                var val=obj.apkJsonList[index];
                var tr=$('<tr></tr>');
                tr.append('<td></td>'+'<td>'+val.chgDate+'</td>'+'<td>'+val.productinfo+'</td>'+'<td>'+val.fileType+'</td>'+'<td>'+val.packageName+'</td>'+'<td>'+val.versionCode+'</td>'+'<td></td>'+'<td></td>'+'<td></td>');
                tbody.append(tr);
            });
            $('#myTable tbody').replaceWith(tbody);
            */
          }
        })
    };
    $(".btn-query").click(function(){
   // $('.btn-query').on('click',function(){
     
        pageNo="1";
        productinfo =$("#productinfo").val();
        packageName=$("#packageName").val();
        productinfo=productinfo.trim();
       packageName=packageName.trim();       
        console.log("查询按钮的包名:"+packageName);
        console.log("查询按钮的型号:"+productinfo);
        test();
    });
    $(".icon-details",this).click(function(){
        console.log("进入详情2:");
        var packageName=$(this).parents("tr").find("#packageName").text();
        console.log("输出包名2:"+packageName);
       // var recordTime=$(this).parents("tr").find("#productinfo").text();
      // window.location="";
    });
    //$(".json-delete",this).click(function(){
     
    $('.json-delete').on('click',function(){
        console.log("进入删除页");
        var packageName=$(this).parents("tr").find("#packageName").text(); 
        var productinfo=$(this).parents("tr").find("#productinfo").text();
        var versionCode=$(this).parents("tr").find("#versionCode").text();
        versionCode = versionCode.split("(");
        console.log("版本号:"+versionCode[0]);
        console.log("包名:"+packageName);
        $.ajax({
            url:"http://192.168.1.147:6792/flowsweb/apk.do?method=deleteApkJson",
            type:"get",
            dataType:"json",
            data:{
     "packageName":packageName,"productinfo":productinfo,"versionCode":versionCode[0]},
            timeout:10000,
            success:function(data){
                if(data.errorCode==0000){
                    alert(data.errorMsg);
                }
                location.reload(); //刷新页面
            }
        })
    });
    $('.imei-detail').on('click',function(){
        console.log("进入imei详情页");
        var packageName=$(this).parents("tr").find("#packageName").text(); 
        var productinfo=$(this).parents("tr").find("#productinfo").text();
        var versionCode=$(this).parents("tr").find("#versionCode").text();
        versionCode = versionCode.split("(");
        console.log("版本号:"+versionCode[0]);
        console.log("包名:"+packageName);
        //window.location.href="http://www.baidu.com";
        window.open("http://192.168.1.147:6792/flowsweb/htmlPage/imeiDetail.html?packageName="+packageName+"&productinfo="+productinfo+"&versionCode="+versionCode[0]);
    }); 
    //$(".imei-add",this).click(function(){
     
    $('.imei-add').on('click',function(){
        console.log("进入imei详情页");
        var packageName=$(this).parents("tr").find("#packageName").text();
        var productinfo=$(this).parents("tr").find("#productinfo").text();
        var versionCode=$(this).parents("tr").find("#versionCode").text();
        versionCode = versionCode.split("(");
        console.log("版本号:"+versionCode[0]);
        console.log("包名:"+packageName);
        window.open("http://192.168.1.147:6792/flowsweb/htmlPage/imeiAdd.html?packageName="+packageName+"&productinfo="+productinfo+"&versionCode="+versionCode[0]); 
    });
    $('.use-num').on('click',function(){
        console.log("进入apk更新成功详情页");
        var packageName=$(this).parents("tr").find("#packageName").text(); 
        var productinfo=$(this).parents("tr").find("#productinfo").text();
        var versionCode=$(this).parents("tr").find("#versionCode").text();
        versionCode = versionCode.split("(");
        console.log("版本号:"+versionCode[0]);
        console.log("包名:"+packageName);
         window.open("http://192.168.1.147:6792/flowsweb/htmlPage/sucessApk.html?packageName="+packageName+"&productinfo="+productinfo+"&versionCode="+versionCode[0]+"&type=true");
    });
   $('.unuse-num').on('click',function(){
        console.log("进入apk更新成功详情页");
        var packageName=$(this).parents("tr").find("#packageName").text(); 
        var productinfo=$(this).parents("tr").find("#productinfo").text();
        var versionCode=$(this).parents("tr").find("#versionCode").text();
        versionCode = versionCode.split("(");
        console.log("版本号:"+versionCode[0]);
        console.log("包名:"+packageName);
         window.open("http://192.168.1.147:6792/flowsweb/htmlPage/sucessApk.html?packageName="+packageName+"&productinfo="+productinfo+"&versionCode="+versionCode[0]+"&type=false");
    });
    //$(".json-fabu",this).click(function(){
     
    $('.json-fabu').on('click',function(){
        console.log("进入发布页");
        var packageName=$(this).parents("tr").find("#packageName").text(); 
        var productinfo=$(this).parents("tr").find("#productinfo").text();
        var versionCode=$(this).parents("tr").find("#versionCode").text();
        versionCode = versionCode.split("(");
        var status="1";
        console.log("版本号:"+versionCode[0]);
        console.log("包名:"+packageName);
        $.ajax({
            url:"http://192.168.1.147:6792/flowsweb/apk.do?method=updatePublishStatus",
            type:"get",
            dataType:"json",
            data:{
     "packageName":packageName,"productinfo":productinfo,"versionCode":versionCode[0],"status":status},
            timeout:10000,
            success:function(data){
                if(data.errorCode==0000){
                   // alert(data.errorMsg);
                }
                location.reload(); //刷新页面
            }
        })
    });
    //$(".json-quxiao",this).click(function(){
     
    $('.json-quxiao').on('click',function(){
        console.log("进入取消页");
        var packageName=$(this).parents("tr").find("#packageName").text(); 
        var productinfo=$(this).parents("tr").find("#productinfo").text();
        var versionCode=$(this).parents("tr").find("#versionCode").text();
        versionCode = versionCode.split("(");
        var status="0";
        console.log("版本号:"+versionCode[0]);
        console.log("包名:"+packageName);
         $.ajax({
            url:"http://192.168.1.147:6792/flowsweb/apk.do?method=updatePublishStatus",
            type:"get",
            dataType:"json",
            data:{
     "packageName":packageName,"productinfo":productinfo,"versionCode":versionCode[0],"status":status},
            timeout:10000,
            success:function(data){
                if(data.errorCode==0000){
                  //  alert(data.errorMsg);
                }
                location.reload(); //刷新页面
            }
        })
     });
    //$(".json-detail",this).click(function(){
     
    $('.json-detail').on('click',function(){
        console.log("进入操作详情页");
        var packageName=$(this).parents("tr").find("#packageName").text(); 
        var productinfo=$(this).parents("tr").find("#productinfo").text();
        var versionCode=$(this).parents("tr").find("#versionCode").text();
        versionCode = versionCode.split("(");
        console.log("版本号:"+versionCode[0]);
        console.log("包名:"+packageName);
        window.open("http://192.168.1.147:6792/flowsweb/htmlPage/apkJson.html?packageName="+packageName+"&productinfo="+productinfo+"&versionCode="+versionCode[0]);
    })
})
//$(".json-delete",this).click(function(){
     
//$('.json-delete').on('click',function(){
     
</script>
</html>

 

跳转页面imeiDetail.html

 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>imei信息管理</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="../css/iconfont.css">
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jquery-1.9.1.js" ></script>
<style type="text/css">
        .divstyle{
     
            margin-top: 80px;
            width: 900px;
            text-align:center;
        }    
        .btn{
     
            background: #5591FC;
            color: white;
        }
        label{
     
            color:#5591FC;
            font-size:18px;
            text-align:left;
        }
        td{
     
            text-align:center;
            font-size:17px;
            color:#000000;
        }
        input,button,select,textarea{
     outline:none}textarea{
     resize:none}
        .div1{
     
            border:1px solid #000;
            width: 1000px;
            height: 200px;
        }    
        .property-cate {
     
            border: 1px solid #ccc;
            padding: 5px 20px;
            margin: 10px 15px;
        }
        .property-cate .manage-tabel .uploader-list .thumbnail img{
     width: 380px;height: 90px}
        .w725 {
     
            width:725px;
            margin:0 auto;
        }
        .w400{
     
            width:500px;
            margin:0 auto;
        }
        .w625{
     
             width:625px;
        }
        .w1030{
     
            width:1030px;
            margin:0 auto;
        }
        .ins-con .property-cate-p1 td:nth-child(2),
        .property-cate-p1.w400 td:nth-child(2),
        .property-cate-p1.w725 td:nth-child(2),
        .property-cate-p1.w1030 td:nth-child(2),
        .property-cate-p1.w625 td:nth-child(2){
     
                 width:190px;
        }
        .property-cate-p1 ul:before {
     
            clear: both;
            content: '';
            display: table;
        }
        .property-cate-p1 ul:after {
     
            clear: both;
            content: '';
            display: table
        }
        .property-cate-p1 li {
     
            display: inline-block;
            margin-right: 30px;
            line-height: 40px;
            float: left;
        }
        .property-cate-p1 li span {
     
            margin-right: 10px;
            line-height: 40px;
        }
        .sure{
     
            color:red;
        }
        .property-cate-p1 input,
         label{
     
             margin-left: 150px;
        }
        a{
     
            text-decoration:none;
        }
        i{
     
            color: #5591FC;
            font-size: 13px;
        }
        span{
     
            color:#b3b3b3;
        }
        tr{
     
            height:50px; 
        }
        .describe {
     
            width:900px;
            height:400px;
            margin-left: 150px;
        }
        .pw-bottom{
     
            text-align:center;
        }
</style>
</head>
<body>
    <div class="user-main-title property-title">
        <ul>
            <li>imei详情</li>
        </ul>
    </div>
    <div class="property-cate">
        <div class="property-cate-p1" id="myTable">
            <ul>
                <li>
                    <label>imei:</label><br>
                    <textarea class="describe" id="imei" ></textarea>
                </li>                              
            </ul>
        </div>
        <div class="pw-bottom">
                <button type="submit" class="btn save" >保存</button>
                <button type="submit" class="btn quxiao"  style="margin-left:15px;">关闭</button>
       </div>
    </div>
   
</body>

<script type="text/javascript">

    //通过url 获取参数值
function parseUrl(){
    var url=location.href    ;
    var i=url.indexOf('?');
    if(i==-1) return;
    var querystr=url.substr(i+1);
    var arr1=querystr.split('&');
    var arr2=new Object();
    for(i in arr1){
       var ta=arr1[i].split('=');
       arr2[ta[0]]=ta[1];
    }
    return arr2;
}
    var v=parseUrl();
    var packageName=v['packageName'];
    var productinfo=v['productinfo'];
    var versionCode=v['versionCode'];
    console.log("输出包名:"+v['packageName']);
$(function(){
    demo();
    function demo(){
       $.ajax({
            url:"http://192.168.1.147:6792/flowsweb/apk.do?method=querySingleApk",
            type:'get',
            dataType:'json',//服务器返回的json数据格式
            data:{
     "packageName":packageName,"productinfo":productinfo,"versionCode":versionCode},
            timeout:10000,//超时时间设置为10秒;
            async:false,//同步操作
            success:function(data){
                imei=data.imei;
                console.log("imei号:"+imei);
                var textarea=$('<textarea   class="describe" id="imei"></textarea>');
                textarea.append(imei);
                $('#myTable textarea').replaceWith(textarea); 
            }
       })
    }
    $(".quxiao").click(function(){
        window.close();
    });
    $(".save",this).click(function(){
       var imei=document.getElementById('imei').innerHTML  //var imei =$("#imei").val();
       console.log("输出需要修改的imei号:"+imei);
    })
})
</script>
</html>

imeiAdd.html

 

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>导入imei号</title>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/iconfont.css">
    <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../js/jquery-1.9.1.js" ></script>
    <style type="text/css">
        .divstyle{
     
            margin-top: 80px;
            width: 900px;
            text-align:center;
        }    
        .btn{
     
            background: #5591FC;
            color: white;
        }
        
        td{
     
            text-align:center;
            font-size:17px;
            color:#000000;
        }
        input,button,select,textarea{
     outline:none}textarea{
     resize:none}
        .div1{
     
            border:1px solid #000;
            width: 1000px;
            height: 200px;
        }    
        .property-cate {
     
            border: 1px solid #ccc;
            padding: 5px 20px;
            margin: 10px 15px;
        }
        .property-cate .manage-tabel .uploader-list .thumbnail img{
     width: 380px;height: 90px}
        .w725 {
     
            width:725px;
            margin:0 auto;
        }
        .w400{
     
            width:500px;
            margin:0 auto;
        }
        .w625{
     
             width:625px;
        }
        .w1030{
     
            width:1030px;
            margin:0 auto;
        }
        .ins-con .property-cate-p1 td:nth-child(2),
        .property-cate-p1.w400 td:nth-child(2),
        .property-cate-p1.w725 td:nth-child(2),
        .property-cate-p1.w1030 td:nth-child(2),
        .property-cate-p1.w625 td:nth-child(2){
     
                 width:190px;
        }
        .property-cate-p1 ul:before {
     
            clear: both;
            content: '';
            display: table;
        }
        .property-cate-p1 ul:after {
     
            clear: both;
            content: '';
            display: table
        }
        .property-cate-p1 li {
     
            display: inline-block;
            margin-right: 30px;
            line-height: 40px;
            float: left;
        }
        .property-cate-p1 li span {
     
            margin-right: 10px;
            line-height: 40px;
        }
        .sure{
     
            color:red;
        }
        .property-cate-p1 input,

         label{
     
             margin-left: 150px;
        }
        label{
     
            color:#5591FC;
            font-size:18px;
            text-align:left;
        }
        a{
     
            text-decoration:none;

        }
        i{
     
            color: #5591FC;
            font-size: 13px;
        }
        span{
     
            font-size:18px;
            color:#5591FC;
        }
        tr{
     
            height:50px; 
        }
        .pw-bottom{
     
            text-align:center;
        }
        a{
     
            margin-right: 100px;
              font-size:16px;
            color:#0073A9;
        }
</style>
</head>
<body>
    <div class="user-main-title property-title">
        <ul>
            <li>imei新增</li>
        </ul>
  </div>
    <div class="property-cate">
        <div class="property-cate-p1" id="myTable">
            <ul>
                <li>
                    <span>导入设备信息:</span>
                   
                    <input type="file" id="files" value="文件上传" onchange="getPhotoSize(this)">
                </li>                                   
            </ul>
            <ul>
                <li><a href="http://192.168.1.147:6792/flowsweb/deviceMessage.do?method=downExcel&fileName=devicesImei.xls">Excel模板下载</a></li>    
            </ul>
        </div>
        <div class="pw-bottom">
                <button type="submit" class="btn save" >提交</button>
                <button type="submit" class="btn quxiao"  style="margin-left:15px;">关闭</button>
       </div>
  </div>
</body>
<script type="text/javascript">
    //通过url 获取参数值
    function parseUrl(){
    var url=location.href    ;
    var i=url.indexOf('?');
    if(i==-1) return;
    var querystr=url.substr(i+1);
    var arr1=querystr.split('&');
    var arr2=new Object();
    for(i in arr1){
       var ta=arr1[i].split('=');
       arr2[ta[0]]=ta[1];
    }
    return arr2;
}
    var v=parseUrl();
    var packageName=v['packageName'];
    var productinfo=v['productinfo'];
    var versionCode=v['versionCode'];
    console.log("输出包名:"+v['packageName']);
    $(function(){
       $(".save").click(function(){
                    var Data = {};
                    Data.packageName=packageName;
                    Data.productinfo=productinfo;
                    Data.versionCode=versionCode;
                   base64($('input[type="file"]'), function(data){
                           console.log("base64 加密文件");
                        console.log(data.base64);     
                        Data.excelData=data.base64;
                        var name = $('#files').val();
                        options = {
                            type:"post",
                            data:{
                                "data":JSON.stringify(Data)    
                            },  
                            url: "http://192.168.1.147:6792/flowsweb/apk.do?method=addDeviceImei",
                            dataType: 'json',
                            success:function(result){
                                alert(result.errorMsg);
                                   //if(result.errorCode==0000){
     
                                   //location.reload(); //刷新页面
                                   //}
                                   console.log(JSON.stringify(result));
                               }
                        };
                           $.ajax(options);
                })
       });
           $(".quxiao").click(function(){
            window.close();
        });
    })
</script>
<script type="text/javascript">
//base64转码函数
      function base64(file, callback){
          var coolFile = {};
          function readerOnload(e)
          {
          var base64 = btoa(e.target.result);
          coolFile.base64 = base64;
          callback(coolFile)
          };
  
          var reader = new FileReader();
         reader.onload = readerOnload;
  
          var file = file[0].files[0];
      
          if(file==null || file ==undefined){
          alert("请上传后缀名为xls的EXCEL文件!");
          }
          else{
              coolFile.filetype = file.type;
              coolFile.size = file.size;
              coolFile.filename = file.name;
              reader.readAsBinaryString(file);
          }
      }

//判断文件大小
      function getPhotoSize(obj){
          console.log("文件 ");
          console.log(obj);
          if(obj==null)
        {
              alert("请上传EXCEL文件!");
        }
           photoExt=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();//获得文件后缀名
           if(photoExt!='.xls'){
            alert("请上传后缀名为xls的EXCEL文件!");
             return false;
           }
           var fileSize = 0;
           var isIE = /msie/i.test(navigator.userAgent) && !window.opera;      
           if (isIE && !obj.files) {     
              var filePath = obj.value;      
              var fileSystem = new ActiveXObject("Scripting.FileSystemObject");  
              var file = fileSystem.GetFile (filePath);        
              fileSize = file.Size;     
           }else { 
              fileSize = obj.files[0].size;   
           } 
           fileSize=Math.round(fileSize/1024*100)/100; //单位为KB
           if(fileSize>=1024){
             alert("Excel最大尺寸为1024KB,请重新上传!");
             return false;
           }
    }
</script>
</html>

sucessApk.html

 

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>更新Apk页面</title>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="../css/iconfont.css">

<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jquery-1.9.1.js" ></script>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="../htmlPage/js/paging.js"></script>
<style>
            * {
     
                padding: 0;
                margin: 0;
            }
            /*
            * 外面盒子样式---自己定义
            */
            .page_div {
     
                
                margin-bottom: 20px;
                font-size: 15px;
                font-family: "microsoft yahei";
                color: #666666;
                margin-right: 10px;
                padding-left: 20px;
                box-sizing: border-box;
                text-align:center;
            }
            /*
            * 页数按钮样式
            */
            .page_div a {
     
                min-width: 30px;
                height: 28px;
                border: 1px solid #dce0e0!important;
                text-align: center;
                margin: 0 4px;
                cursor: pointer;
                line-height: 28px;
                color: #666666;
                font-size: 13px;
                display: inline-block;
            }
            
            #firstPage,
            #lastPage {
     
                width: 50px;
                color: #0073A9;
                border: 1px solid #0073A9!important;
            }
            #prePage,
            #nextPage {
     
                width: 70px;
                color: #0073A9;
                border: 1px solid #0073A9!important;
            }
            .page_div .current {
     
                background-color: #0073A9;
                border-color: #0073A9;
                color: #FFFFFF;
            }
            .totalPages {
     
                margin: 0 10px;
            }
            .totalPages span,
            .totalSize span {
     
                color: #0073A9;
                margin: 0 5px;
            }
        </style>
<style type="text/css">
        .divstyle{
     
            margin-top: 80px;
            width: 900px;
            text-align:center;
        }    
        #btn{
     
            background: #5591FC;
            color: white;
        }
        .imei-detail ,.imei-add,.json-detail,.json-delete,.json-fabu,.json-quxiao,.unuse-num,.use-num{
     
            background: #0073A9;
            color: white;
            width: 50px;
            height: 33px;
            text-align:middle
        }
        .use-num{
     
            margin-right:-20px; 
            margin-left:-10px;
        }
        .json-detail{
     
            margin-left: -10px;
        }
    
        label{
     
            color:#5591FC;
            font-size:18px;
            text-align:left;
        }
        td{
     
            text-align:center;
            font-size:17px;
            color:#000000;
        }
        #td{
     
            
            font-size:17px;
            color:#000000;
            margin-left: -100px;
        }
        input,button,select,textarea{
     outline:none}textarea{
     resize:none}
        .div1{
     
            border:1px solid #000;
            width: 1000px;
            height: 200px;
        }    
        .property-cate {
     
            border: 1px solid #ccc;
            padding: 5px 20px;
            margin: 10px 15px;
        }
        .property-cate .manage-tabel .uploader-list .thumbnail img{
     width: 180px;height: 90px}
        .w725 {
     
            width:725px;
            margin:0 auto;
        }
        .w400{
     
            width:500px;
            margin:0 auto;
        }
        .w625{
     
             width:625px;
        }
        .w1030{
     
            width:1030px;
            margin:0 auto;
        }
        .ins-con .property-cate-p1 td:nth-child(2),
        .property-cate-p1.w400 td:nth-child(2),
        .property-cate-p1.w725 td:nth-child(2),
        .property-cate-p1.w1030 td:nth-child(2),
        .property-cate-p1.w625 td:nth-child(2){
     
                 width:190px;
        }
        .property-cate-p1 ul:before {
     
            clear: both;
            content: '';
            display: table;
        }
        .property-cate-p1 ul:after {
     
            clear: both;
            content: '';
            display: table
        }
        .property-cate-p1 li {
     
            display: inline-block;
            margin-right: 30px;
            line-height: 40px;
            float: left;
        }
        .property-cate-p1 li span {
     
            margin-right: 10px;
            line-height: 40px;
        }
        .sure{
     
            color:red;
        }
        .property-cate-p1 input,
        a{
     
            text-decoration:none;
        }
        i{
     
            color: #5591FC;
            font-size: 13px;
        }
        .span{
     
            color:#b3b3b3;
        }
        tr{
     
            height:50px; 
        }
</style>
</head>
<body>
<div class="user-main query" style="position:relative;" >
    <br><br><br>
    <div class="user-main-title property-title">
        <ul>
            <li >&nbsp&nbsp&nbsp.apk升级信息</li>
        </ul>
    </div>
    <div style="margin: 10px 15px;">
       <table id="myTable"  bordercolor="#B0C4DE" border="1" width="100%" cellpadding="2" cellspacing="0" >
            <thead>
             <tr bgcolor="#DDDDDD">
                <td >imei号</td>
                <td >更新时间</td>
                <td>型号</td>
                <td >包名</td>
                <td>版本号</td>
                <td >更新状态</td>
            <!--
                <td style="width:300px;" height:50px">imei号</td>
                <td style="width:420px;" height:50px">更新时间</td>
                <td style="width:180px;" height:50px">型号</td>
                <td style="width:130px;" height:50px">包名</td>
                <td style="width:200px;" height:50px">版本号</td>
                <td style="width:300px;" height:50px">更新状态</td>
             </tr>
                -->
             </tr>
            </thead>
            <tbody>
            </tbody>  
        </table>
    </div>
    <div value="1 0"></div>
    <div id="page" class="page_div"></div>
</div>
</body>

<script type="text/javascript"> 
var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题 
var table = document.getElementById("myTable"); 
for (j = 0; j < table.rows[0].cells.length; j++) { 
table.rows[0].cells[j].onmousedown = function () { 
//记录单元格 
tTD = this; 
if (event.offsetX > tTD.offsetWidth - 10) { 
tTD.mouseDown = true; 
tTD.oldX = event.x; 
tTD.oldWidth = tTD.offsetWidth; 
} 
//记录Table宽度 
//table = tTD; while (table.tagName != ‘TABLE') table = table.parentElement; 
//tTD.tableWidth = table.offsetWidth; 
}; 
table.rows[0].cells[j].onmouseup = function () { 
//结束宽度调整 
if (tTD == undefined) tTD = this; 
tTD.mouseDown = false; 
tTD.style.cursor = 'default'; 
}; 
table.rows[0].cells[j].onmousemove = function () { 
//更改鼠标样式 
if (event.offsetX > this.offsetWidth - 10) 
this.style.cursor = 'col-resize'; 
else 
this.style.cursor = 'default'; 
//取出暂存的Table Cell 
if (tTD == undefined) tTD = this; 
//调整宽度 
if (tTD.mouseDown != null && tTD.mouseDown == true) { 
tTD.style.cursor = 'default'; 
if (tTD.oldWidth + (event.x - tTD.oldX)>0) 
tTD.width = tTD.oldWidth + (event.x - tTD.oldX); 
//调整列宽 
tTD.style.width = tTD.width; 
tTD.style.cursor = 'col-resize'; 
//调整该列中的每个Cell 
table = tTD; while (table.tagName != 'TABLE') table = table.parentElement; 
for (j = 0; j < table.rows.length; j++) { 
table.rows[j].cells[tTD.cellIndex].width = tTD.width; 
} 
//调整整个表 
//table.width = tTD.tableWidth + (tTD.offsetWidth – tTD.oldWidth); 
//table.style.width = table.width; 
} 
}; 
} 
</script>

<script type="text/javascript">
//通过url 获取参数值
function parseUrl(){
    var url=location.href;
    var i=url.indexOf('?');
    if(i==-1) return;
    var querystr=url.substr(i+1);
    var arr1=querystr.split('&');
    var arr2=new Object();
    for(i in arr1){
       var ta=arr1[i].split('=');
       arr2[ta[0]]=ta[1];
    }
    return arr2;
}
var v=parseUrl();
var packageName=v['packageName'];
var productinfo=v['productinfo'];
var versionCode=v['versionCode'];
var type=v['type'];
console.log("输出包名:"+v['packageName']);
var list=[];
var listNum="";
var totalpage=""; 
var status=true;
var pageNo=1;
var pageSize=10;
$(function test(){
    demo(pageNo-1,pageSize);
    totalpage= Number(totalpage);
    $("#page").paging({
                pageNo:pageNo,
                totalPage:totalpage,
                totalSize: listNum,
                callback: function(num){
                   // alert(num); 
                    pageNo=num;
                    test();
                }
    });
    if(list.length<=10){
        var margin=(10-list.length)*50+35;
        document.getElementById('page').style.marginTop=margin+"px";
    }
    var tbody=$('<tbody></tbody>');
    $(list).each(function (index){
        var val=list[index];
        var typename="";
        if(val.type=="true"){
            typename="apk更新成功";
        }
        else if(val.type=="false"){
            typename="apk更新失败";
        }
        var tr=$('<tr></tr>');
        tr.append('<td>'+val.imei+'</td>'+'<td id="chgDate">'+val.chgDate+'</td>'+'<td id="productinfo">'+val.productinfo+'</td>'+'<td id="packageName">'+val.packageName+'</td>'+'<td id="versionCode">'+val.versionCode+'</td>'+'<td >'+typename+'</td>');
        tbody.append(tr);
    });
    $('#myTable tbody').replaceWith(tbody); 
    //查询所有列表 
    function demo(pageNo,pageSize){     
        $.ajax({
            url:"http://192.168.1.147:6792/flowsweb/apk.do?method=updateApkType",
            type:'get',
            dataType:'json',//服务器返回的json数据格式
            data:{
     "packageName":packageName,"productinfo":productinfo,"versionCode":versionCode,"pageNo":pageNo,"pageSize":pageSize,"type":type},
            timeout:10000,//超时时间设置为10秒;
            async:false,//同步操作
            success:function(data){
            list=data.apkRecordList;
            listNum=data.listNum;
            totalpage=data.totalPage;
            console.log(list);
            var obj=eval(data);

          }
        })
    };
})
</script>
</html>

 

转载于:https://www.cnblogs.com/yangxiaomei/p/9509771.html

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_30402085/article/details/95411787

智能推荐

ubuntu 命令行界面无法使用sudo_不浪不欢的博客-程序员秘密

alt + ctrl +F1打开命令行界面后,输入用户名,然后输入密码此时使用sudo + 命令 时,要再输入一次输入密码才会正常

【wikioi】1018 单词接龙_aocong4527的博客-程序员秘密

题目链接算法:DFS+考你阅题题目描述:单词接龙是一个与我们经常玩的成语接龙相类似的游戏,现在我们已知一组单词,且给定一个开头的字母,要求出以这个字母开头的最长的“龙”(每个单词都最多在“龙”中出现两次),在两个单词相连时,其重合部分合为一部分,例如beast和astonish,如果接成一条龙则变为beastonish,另外相邻的两部分不能存在包含关系,例如at和atid...

Django第九篇-----关于模板的高级话题--上半篇_海人001的博客-程序员秘密

目录RequestContext 和上下文处理器 authdebugi18nmediastaticcsrfrequestmessages自动转义 HTML在单个变量中禁用在模板中的块里禁用RequestContext 和上下文处理器首先,我们快速回顾一下前面介绍的几个术语:• 模板是文本文档或普通的 Python 字符串,使用 Djang...

FPGA课程设计——数字频率计_数字频率计fpga_璇璇璇璇涵涵子的博客-程序员秘密

这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Mar

拓展模块使用教程和心得(6):步进电机及其驱动与算法_The Road of Engineer的博客-程序员秘密

成就更好的自己。一个学期都没有更新博客了,一是平常太忙没有时间,二是经过一个学期时间的反思和沉淀,某些知识才能有更完善的见解。在这个学期中,博主经历了吉林省的全国大学生电子设计大赛,由于电路上的某些原因,最终以毫厘之差错失省一,取得了省级二等奖。毕竟这是博主在大学期间参加的第一次省级及以上比赛,也算是为今后的大型比赛采坑积累经验。我们选中的A题用到了步进电机,在比赛后我结合比赛区间遇到的一些情况又对步进电机进行了系统性的总结分析,此篇博客就是记录前前后后关于步进电机的所有知识。目录步进电

神经架构搜索方法综述_神经结构搜索技术与集成技术_人工智障之深度瞎学的博客-程序员秘密

讨论常见搜索空间以及基于强化学习原理和进化算法的常用架构优化算法搜索空间的设计构成了神经架构搜索的另一个重要组成部分。除了加快搜索过程外,这还会影响搜索的持续时间和搜索得到的解决方案的质量。...

随便推点

1997-2007,KDD CUP的二十年_chengyensesewang_笨笨的粽子妞的博客-程序员秘密

2017年8月13-17日,第23届KDD大会在加拿大哈利法克斯召开。KDD CUP是ACM SIGKDD组织的有关数据挖掘和知识发现领域的年度赛事,作为KDD年会的重要组成部分,从1997年至今,已有二十年的历史,是目前数据挖掘领域最有影响力的赛事。今天,我们就一起来回顾下这二十年的KDD CUP吧。

MATLAB 暖通,MATLAB在暖通空调课程教学中的应用_weixin_39615741的博客-程序员秘密

神经网络在非线性系统参数辨识中应用丁晓贵变风量空调系统应用研究周向阳;GMSK信号仿真研究刘业辉积分分离模糊PID控制在中央空调温湿度控制中的应用常继彬;基于MATLAB的灰色系统沉降预测周卫基于MATLAB的静定梁内力图的绘制唐前辉,张友利MATLAB在测绘中的应用周卫“自动控制教学与实验系统”CAI软件的研究与实现陈卫红,刘先广,...

python绘制3d坐标轴_Python中使用Matplotlib绘制3D图形示例_weixin_39719732的博客-程序员秘密

原标题:Python中使用Matplotlib绘制3D图形示例3D图形能给我们对数据带来更加深入地理解。python的matplotlib库就包含了丰富的3D绘图工具。3D图形在数据分析、数据建模、图形和图像处理等领域中都有着广泛的应用,下面将给大家介绍一下如何在Python中使用 matplotlib进行3D图形的绘制,包括3D散点、3D表面、3D轮廓、3D直线(曲线)以及3D文字等的绘制。准备...

关于网页请求URL中文乱码的Java服务端(Tomcat 7)解决方法 - 极简_ACTIM__的博客-程序员秘密

/*接收请求*/String username = request.getParameter(&quot;username&quot;);String password = request.getParameter(&quot;password&quot;);/*转码为正常UTF-8编码*/username = new String(username.getBytes(&quot;iso8859-1&quot;),&quot;UTF-8&quot;);passwo...

【深度学习】利用深度可分离卷积减小计算量及提升网络性能_(1) 采用相同通道的深度分离卷积降低内存访问时间 目前降低网络参数量的主要方式_李响Superb的博客-程序员秘密

【深度学习】利用深度可分离卷积减小计算量及提升网络性能文章目录1 深度可分离卷积2 一个深度可分离卷积层的代码示例(keras)3 优势与创新 3.1 Depthwise 过程 3.2 Pointwise 过程4 Mobilenet v15 Xception1 深度可分离卷积深度可分离卷积提出了一种新的思路:对于不同的输入channel采取不同的卷积核进行卷积,它将普通的卷积操作分解为两个过程。深度可分离卷积层对每个channel分别执行卷积,然后通过逐点卷积将这些输出混合。这

[译] APT分析报告:05.Turla新型水坑攻击后门(NetFlash和PyFlash)_Eastmount的博客-程序员秘密

这是作者新开的一个专栏,主要翻译国外知名的安全厂商APT报告文章,了解它们的安全技术,学习它们溯源APT组织的方法,希望对您有所帮助。前文分享了一种新型无文件APT攻击Kraken,它会利用Windows错误报告服务逃避检测。这篇文章将介绍Turla新型水坑攻击后门(NetFlash和PyFlash),研究人员发现Turla对Armenian的知名网站发起水坑攻击,通过伪造Adobe Flash更新,欺骗受害者下载两个新型恶意软件NetFlash和PyFlash,从而实现恶意攻击,整个攻击的TTP基本没有变

推荐文章

热门文章

相关标签