You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
159 lines
5.9 KiB
159 lines
5.9 KiB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
|
<%@ include file="/common/ctx.jsp"%>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
<title>导入</title>
|
|
<!-- jQuery -->
|
|
<link type="text/css" rel="stylesheet" href="${ctx}/css/cjy_style.css" />
|
|
<link type="text/css" rel="stylesheet" href="${ctx}/css/cjy_biaodan.css" />
|
|
<script src="${ctx}/js/jquery.min.js"></script>
|
|
<link href="${ctx}/css/showDialog.css" rel="stylesheet" type="text/css" />
|
|
<script type="text/javascript" src="${ctx}/js/jquery.form.js"></script>
|
|
<script type="text/javascript">
|
|
var api = frameElement.api, W = api.opener; // api.opener 为载加lhgdialog.min.js文件的页面的window对象
|
|
//返回
|
|
function reback(){
|
|
document.mainForm.action ="${ctx}/tcdcoperrtimepeoplescenic/searchTcdcOperRtimepeoplescenicList.do";
|
|
document.mainForm.submit();
|
|
}
|
|
function import2(){
|
|
var s = document.getElementById("upfile").value;
|
|
if(s!=null&&s!=""){
|
|
if(s.indexOf("xls")!=-1){
|
|
document.mainForm.submit();
|
|
}else{
|
|
window.parent.customAlertTip("", "文件格式不正确!");
|
|
}
|
|
|
|
}else{
|
|
window.parent.customAlertTip("", "请选择excel文件!");
|
|
}
|
|
}
|
|
|
|
var dataStr;
|
|
var selectStr;
|
|
var ss;
|
|
//页面初始化
|
|
function init(){
|
|
var mesg=document.getElementById("mes").value;
|
|
var hst=document.getElementById("hst");
|
|
if(mesg!=null&&mesg!=""){
|
|
var sArr = mesg.split("\@cjy\@");
|
|
dataStr = sArr[1];//数据库内容
|
|
genselect();//生成option
|
|
|
|
var mesgArr=sArr[0].split(",");//Sheet1:政策新闻#新闻内容#22222#,Sheet2:aaaa#bbb#,Sheet3:,
|
|
var sheetStr=null;
|
|
var titleStr=null;
|
|
var str="";
|
|
var html="";
|
|
//rebackStr:Sheet1:政策新闻#新闻内容#22222#,Sheet2:aaaa#bbb#,Sheet3:,@cjy@zcxw_title&政策新闻#zcxw_content&内容
|
|
for(var i = 0; i < mesgArr.length; i++){
|
|
if(mesgArr[i].indexOf(":") > -1){
|
|
var sheetArr = mesgArr[i].split(":");
|
|
sheetStr = sheetArr[0];//Sheet1
|
|
titleStr = sheetArr[1];//政策新闻#新闻内容#22222#
|
|
|
|
|
|
|
|
html=html+"<li><p class=\"zwjm\"><i class=\"fa fa-file-excel-o\"></i>"+sheetStr+"</p>";
|
|
html=html+"<button class=\"btn btn-info waves-effect waves-light btn-sm w-xs m-l-10\" onclick=\"dianji('"+sheetStr+"','"+titleStr+"')\">选择</button>";
|
|
if(ss == sheetStr){
|
|
html=html+"<div class=\"xzx\" style=\"display:block;\">";
|
|
if(titleStr!=null&&titleStr!=""){
|
|
var mesgArr2=titleStr.split("#");//政策新闻#新闻内容#22222#
|
|
var str2="";
|
|
for(var j=0;j<mesgArr2.length;j++){
|
|
str2=mesgArr2[j];
|
|
if(str2 != null && str2 != ""){//政策新闻#新闻内容#22222#
|
|
html=html+"<div class=\"bd-xz\"><label class=\"bd-mc\">"+str2+"</label>";
|
|
html=html+"<div class=\"bd-xl\">";
|
|
html=html+"<select name=\"selnames\">";
|
|
html=html+""+selectStr+"</select> </div></div>";
|
|
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
html=html+"<div class=\"xzx\" style=\"display:none;\">";
|
|
}
|
|
|
|
|
|
|
|
html=html+"<div class=\"clear\"></div>";
|
|
html=html+"<div style=\"border-top:1px dashed #ddd; padding:10px;\">";
|
|
html=html+"<button class=\"btn btn-info btn-custom waves-effect waves-light btn-sm w-xs\" onclick='sure()'>确定</button>";
|
|
html=html+"</div><div class=\"clear\"></div></div></li>";
|
|
}
|
|
}
|
|
hst.innerHTML=html;
|
|
|
|
}
|
|
}
|
|
//select 生成option
|
|
function genselect(){
|
|
var s = "<option value=''>---请选择---</option>";
|
|
var StrArr=dataStr.split("#");
|
|
for(var i=0;i<StrArr.length;i++){
|
|
var params=StrArr[i].split("&");
|
|
var valu=params[0];
|
|
var zhi=params[1];
|
|
s =s+ "<option value='"+valu+"'>"+zhi+"</option>";
|
|
|
|
}
|
|
selectStr = s;
|
|
}
|
|
|
|
//点击选择按钮
|
|
function dianji(sheetStr, titleStr){
|
|
ss = sheetStr;
|
|
init();
|
|
document.getElementById("sheet").value = sheetStr;
|
|
}
|
|
//ajax提交表单(点击确定按钮)
|
|
function sure(){
|
|
var options = {
|
|
type: "post",
|
|
url: "${ctx}/tcdcoperrtimepeoplescenic/sure.do",
|
|
success:function(resp){
|
|
if(resp=="true"){
|
|
W.$.dialog({
|
|
parent:this,
|
|
lock:true,
|
|
content: '导入成功!',
|
|
ok: function(){
|
|
api.close();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
};
|
|
$('#mainForm').ajaxSubmit(options);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body style=" background:#fff;" onload="init()">
|
|
<form class="cmxform form-horizontal tasi-form" id="mainForm" name="mainForm" action="${ctx}/tcdcoperrtimepeoplescenic/daoru2.do" method="post" enctype="multipart/form-data">
|
|
<input type="hidden" id="mes" name="mes" value="${mes}">
|
|
<input type="hidden" id="path" name="path" value="${path}">
|
|
<input type="hidden" id="sheet" name="sheet" >
|
|
<div class="fileInput">
|
|
<input type="file" name="upfile" id="upfile" class="upfile" onchange="document.getElementById('upfileResult').innerHTML=this.value"/>
|
|
<input class="upFileBtn btn btn_lan" type="a" value="请选择EXCEL文件" onclick="document.getElementById('upfile').click()" />
|
|
</div>
|
|
<div class="scnr">
|
|
<div class="wjmc"><strong class="wjtb"><img src="${ctx}/img/xls.png" width="40"></strong><span class="tip" id="upfileResult">文件名称.xls</span></div>
|
|
<a class="btn btn_lv" onclick="import2()">导入</a>
|
|
<div class="wjnr">
|
|
<ul id="hst">
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<!--form validation-->
|
|
</body>
|
|
</html> |