jsp数据导入

<%@ page language="java" contentType="text/html; charset=UTF-8"
 pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/pages/commons/taglibs.jsp"%>

<html>
<head>
<base href="${basePath}" />
<%@ include file="/WEB-INF/pages/commons/meta.jsp"%>
<link rel="stylesheet" type="text/css"
 href="scripts/jqueryEasyUI/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
 href="scripts/jqueryEasyUI/themes/icon.css">
<script type="text/javascript"
 src="scripts/jqueryEasyUI/src/jquery-1.3.2.min.js"></script>
<script type="text/javascript"
 src="scripts/jqueryEasyUI/src/jquery.easyui.min.js"></script>
<script type="text/javascript" src="scripts/jqueryEasyUI/src/jgxLoader.js"></script>
<style>
body{ font-family:Arial, Helvetica, sans-serif;}
.validate{
 height:18px;
 line-height:18px;
 margin-left:5px;
 display:inline-block;
 border:1px solid #CC9933;
 background:#FFFFCC;
 font-size:12px;
 }
</style>
    <script type="text/javascript">
 
    function other(){
  if($("#otherName").val() ==""){
   $('#validate_name').addClass('validate');
   $('#validate_name').html("* !");
   return;
  }else{
   $('#validate_name').removeClass('validate');
   $("#validate_name").html('');
    }
  }
 
  function del(id){
   $.messager.confirm("系统询问","您真的要删除当前选中文件吗?",function(t){
    if(t){
     $('#listFile').attr("action","fileInfo/delFileInfo?fid="+id);
     $.messager.alert("系统提示","删除成功!","",function(){
      $('#listFile').submit();
      return false;
     });
    }
   });
  }
  function edit(id,line){
   if(line>10000){
    $.messager.alert("系统提示","条数超过10000,不支持在线编辑!");
    return;
   }else{
    $('#listFile').attr("action","fileInfo/toEditFile?fid="+id);
    $('#listFile').submit();
    return false;
   }
  }
  function lookFile(id){
   window.open('${basePath}fileInfo/toLook?fid='+id);
  }
 </script>
 <script>
  $(function(){
   $('#tt2').datagrid({
    //title:'my table',
    fit: true,
    nowrap: true,
    striped: true,
    url:'fileInfo/json/fileInfoList.json',
    queryParams:{type:1},
    sortName: 'fid',
    sortOrder: 'desc',
    frozenColumns:[[     /* 被固定冻结的列*/
                   {field:'ck',checkbox:true},
                   {title:'别名',field:'otherName',width:80}
     ]],
    columns:[[
       {field:'originalName',title:'原文件名称',width:130,rowspan:2},
       {field:'realName',title:'文件名称',width:140,rowspan:2},
       {field:'time',title:'上传时间',width:130,rowspan:2},
       {field:'rowsNum',title:'条数',width:50,rowspan:2},
       {field:'opt',title:'操作',width:80,align:'center', rowspan:2,
        formatter:function(value,rec){
         return '<a href="javaScript:edit(\''+rec.fid+'\',\''+rec.rowsNum+'\')"><img src="scripts/jqueryEasyUI/themes/icons/ico_edit.gif" border=0 alt="编辑"/></a>&nbsp;&nbsp;&nbsp;      <a href="javaScript:lookFile(\''+rec.fid+'\')"><img src="scripts/jqueryEasyUI/themes/icons/View.gif" border=0 alt="查看"/></a> &nbsp;&nbsp;&nbsp; <a href="javaScript:del(\''+rec.fid+'\')"><img src="scripts/jqueryEasyUI/themes/icons/delete.gif" border=0 alt="删除"/></a>';
        }
       }
    ]],
    pagination:true,
    rownumbers:true
   });
   $('body').layout();
   $('#tree1').tree({url:'tree_data.json'});
  });
 </script> 
  <script>
  $(function(){
   $('#tt3').datagrid({
    //title:'my table',
    fit: true,
    nowrap: true,
    striped: true,
    url:'fileInfo/json/fileInfoList.json',
    queryParams:{type:2},
    sortName: 'fid',
    sortOrder: 'desc',
    frozenColumns:[[     /* 被固定冻结的列*/
                   {field:'ck',checkbox:true},
                   {title:'别名',field:'otherName',width:80}
     ]],
    columns:[[
       {field:'originalName',title:'原文件名称',width:130,rowspan:2},
       {field:'realName',title:'文件名称',width:140,rowspan:2},
       {field:'time',title:'上传时间',width:130,rowspan:2},
       {field:'rowsNum',title:'条数',width:50,rowspan:2},
       {field:'opt',title:'操作',width:80,align:'center', rowspan:2,
        formatter:function(value,rec){
         return '<a href="javaScript:lookFile(\''+rec.fid+'\')"><img src="scripts/jqueryEasyUI/themes/icons/View.gif" border=0 alt="查看"/></a> &nbsp;&nbsp;&nbsp; <a href="javaScript:del(\''+rec.fid+'\')"><img src="scripts/jqueryEasyUI/themes/icons/delete.gif" border=0 alt="删除"/></a>';
        }
       }
    ]],
    pagination:true,
    rownumbers:true
   });
   $('body').layout();
   $('#tree1').tree({url:'tree_data.json'});
  });
 </script>  
 <script>
  function sub(){
   if($('#otherName').val()==""){
    $.messager.alert("系统提示",'请填写文件别名!',"info");
    return;
   }
   if($('#myExcel').val()==""){
    $.messager.alert("系统提示",'请选择要上传的txt文件!',"info");
    return;
   }
   if($('#myExcel').val().substring($('#myExcel').val().length-3,$('#myExcel').val().length)!="txt"){
    $.messager.alert("系统提示",'只能上传txt文件!',"info");
    return;
    }
   window.parent.cli();
   $('#filesubmit').submit();
   return false;
 }

  $(function(){
   $('body').layout();
  });
  
 </script>
<title>文件管理</title>

</head>
<body>
<div title="文件管理" region="center">
<form name="listFile" id="listFile" method="post" style="padding:0;margin:0;"></form>
   <div class="tabs-container" fit="true" border="false">
    
    <div title="新增号码文件" icon="icon-add" closable="true" style="overflow:hidden;padding:15px; background-color:#FAFAFF">
                <form method="post"  action="fileInfo/doUpFile" id="filesubmit" name="filesubmit" method="post" enctype="multipart/form-data" style="padding:0;margin:0;line-height:24px;">
                    <p>文件类型:<input name="type" type="radio" id="type" value="1" checked="checked" /> 批量短信 (每行一个号码,批量发送)
                    <input name="type" id="type" type="radio" value="2" />个性短信 (号码与内容用半角“,”分隔,个性发送) </p>
                    <p>文件别名: <input type="text" id="otherName" name="otherName" οnblur="other()"> <span id="validate_name"></span></p>
                    <p><label for="file">号码文件:</label>
                            <input type="file" id="myExcel" name="myExcel"></p>
                    <p>
                        <input type="button" id="uploadFile" name="uploadFile" οnclick="sub()"  value="上传文件">
                    </p>
                </form>
                <hr color="#99BBE8"/>
                <p>* 注意:所上传的文本文件无论是批量短信还是个性短信,在尾部最后一个号码后必须有一行空行,并且只能有一行空行,如否则可能会导致在发送信息时最后一条手机号码会丢失或者上传文件错误,例如以下内容如果是一个文本文件:<br>
                批量短信示例&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;13800000002,个性短信内容2<br />
    13800000003 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;13800000003,个性短信内容3<br />
    这里必须要有一个空行,且只能有一行 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这里必须要有一个空行,且只能有一行<br />
    </div>
    <div title="TXT文件管理"  style="display:none;" fit="true">
                <table id="tt2"></table>
    </div>
    <div title="个性文件管理"  style="display:none;" fit="true">
                <table id="tt3"></table>
    </div>
   </div>
  </div>
  <c:if test="${status==1}">
  <script>
  $.messager.alert("系统提示","上传文件成功!","");
  window.parent.uncli();
  </script>
  </c:if>
</body>
</html>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值