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.

429 lines
13 KiB

2 years ago
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" isELIgnored="false" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!-- 页面meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>数据 - AdminLTE2定制版</title>
<meta name="description" content="AdminLTE2定制版">
<meta name="keywords" content="AdminLTE2定制版">
<!-- Tell the browser to be responsive to screen width -->
<meta
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"
name="viewport">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/iCheck/square/blue.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/morris/morris.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/datepicker/datepicker3.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/daterangepicker/daterangepicker.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/datatables/dataTables.bootstrap.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/treeTable/jquery.treetable.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/treeTable/jquery.treetable.theme.default.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/select2/select2.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/colorpicker/bootstrap-colorpicker.min.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/adminLTE/css/AdminLTE.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/adminLTE/css/skins/_all-skins.min.css">
<link rel="stylesheet" href="<%=basePath %>admin/css/style.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/ionslider/ion.rangeSlider.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/ionslider/ion.rangeSlider.skinNice.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/bootstrap-slider/slider.css">
<link rel="stylesheet" href="<%=basePath %>admin/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.css">
<script type="text/javascript" src="<%=basePath%>/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" charset="utf-8" src="<%=basePath%>/utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<%=basePath%>/utf8-jsp/ueditor.all.min.js">
</script>
<script type="text/javascript" charset="utf-8" src="<%=basePath%>/utf8-jsp/lang/zh-cn/zh-cn.js"></script>
<script src="<%=basePath %>admin/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
var ue2;
var idd;
$(function(){
getdetails();
loadfenlei();
})
function ModifyXinwen()
{
if($('#fsimgtitle').val()!='')
{
try
{
var form = document.getElementById('modifyForm');
//再次修改input内容
form.submit();
}
catch(e)
{
}
}
var ueaa = UE.getEditor('editor');
/*
var validate = $("#addForm").form("validate");
if(!validate){
$.messager.alert("消息提醒","请检查你输入的数据!","warning");
return;
} else{
var Fenleiid = $("fenleiid").val();
}*/
$.ajax({
type: "post",
url: "../../XinWenServlet?method=EditXinWen",
//data: $("#addForm").serialize(),
dataType:'json',
data:{
title:$('#title').val(),
fenleiid:$('#fenleiid').val(),
shijian:$("#shijian").val(),
neirong:ueaa.getContent(),
fsimgtitle:$('#fsimgtitle').val(),
id:idd
},
success: function(msg){
}
});
alert('操作成功');
window.location.href="XinWenList.jsp";
}
function loadfenlei() {
$.ajax({
type : "post",
url : "../../FenLeiServlet?method=getFenLeiList&t="
+ new Date().getTime() + "&from=combox",
dataType : 'json',
success : function(data) {
var totalhtml = '';
for (var i = 0; i < data.length; i++) {
totalhtml += '<option value="'+data[i]["id"]+'">'
+ data[i]["name"] + '</option>';
}
$('#fenleiid').html(totalhtml);
}
});
}
function getdetails()
{
var Request = GetRequest();
idd = Request["id"];
var totalhtml='';
var html = "";
$.ajax({
url: "../../XinWenServlet?method=getXinWenList",
type: "POST",
async: false,
dataType:'json',
data:{
id:idd
},
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
success: function (data) {
$.each(data.rows, function (i, val) {
$('#title').val(data.rows[i]["title"]);
$('#shijian').val(data.rows[i]["shijian"]);
$('#fenleiid').val(data.rows[i]["fenleiid"]);
$('#hidid').val(data.rows[i]["id"])
//alert(data.rows[i]["neirong"]);
ue2 = UE.getEditor('editor');
// editor准备好之后才可以使用
ue2.addListener("ready", function () {
//赋值
ue2.setContent(data.rows[i]["neirong"]);
//取值
//var content = ue2.getContent();
})
})
}
});
}
function GetRequest() {
var url = location.search; //获取url中"?"符后的字串
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}
</script>
</head>
<body class="hold-transition skin-purple sidebar-mini">
<!-- 内容区域 -->
<div class="content-wrapper111">
<!-- 内容头部 -->
<section class="content-header">
<h1>
新闻管理 <small>新闻表单</small>
</h1>
<ol class="breadcrumb">
<li><a href="<%=basePath %>admin/index.jsp"><i
class="fa fa-dashboard"></i> 首页</a></li>
<li><a
href="<%=basePath%>admin/pages/user-list">新闻管理</a></li>
<li class="active">新闻表单</li>
</ol>
</section>
<!-- 内容头部 /-->
<form id="modifyForm" method="post" enctype="multipart/form-data" action="../../imgeupload" >
<!-- 正文区域 -->
<section class="content"> <!--产品信息-->
<div class="panel panel-default">
<div class="panel-heading">新闻信息</div>
<div class="row data-type">
<div class="col-md-2 title">新闻标题</div>
<div class="col-md-4 data">
<input type="text" class="form-control" name="title" id="title"
placeholder="新闻标题" value="">
</div>
<div class="col-md-2 title">时间</div>
<div class="col-md-4 data">
<input type="text" class="form-control" onclick="WdatePicker()" name="shijian" id="shijian" placeholder="时间" value="">
</div>
<div class="col-md-2 title">分类</div>
<div class="col-md-4 data">
<select id="fenleiid" name="fenleiid">
<option value=""></option>
</select>
</div>
<div class="col-md-2 title">图片</div>
<div class="col-md-4 data">
<input id="fsimgtitle" type="file" name="fsimgtitle"
accept="image/jpeg, image/x-png" />
</div>
<div class="col-md-2 title">内容</div>
<div class="col-md-4 data" style="height:100%;width:auto;">
<script id="editor" type="text/plain" style="width:624px;"></script>
<script type="text/javascript">
//实例化编辑器
//建议使用工厂方法getEditor创建和引用编辑器实例如果在某个闭包下引用该编辑器直接调用UE.getEditor('editor')就能拿到相关的实例
var ue = UE.getEditor('editor');
</script>
</div>
</div>
</div>
<!--订单信息/--> <!--工具栏-->
<div class="box-tools text-center">
<input type="hidden" value="" name="id" id="hidid">
<button type="button" onclick="ModifyXinwen()" class="btn bg-maroon">保存</button>
<button type="button" class="btn bg-default"
onclick="history.back(-1);">返回</button>
</div>
<!--工具栏/--> </section>
<!-- 正文区域 /-->
</form>
</div>
<!-- 内容区域 /-->
<!-- 底部导航 -->
<!-- 底部导航 /-->
<script
src="<%=basePath %>admin/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script
src="<%=basePath %>admin/plugins/jQueryUI/jquery-ui.min.js"></script>
<script>
$.widget.bridge('uibutton', $.ui.button);
</script>
<script
src="<%=basePath %>admin/plugins/bootstrap/js/bootstrap.min.js"></script>
<script
src="<%=basePath %>admin/plugins/raphael/raphael-min.js"></script>
<script
src="<%=basePath %>admin/plugins/morris/morris.min.js"></script>
<script
src="<%=basePath %>admin/plugins/sparkline/jquery.sparkline.min.js"></script>
<script
src="<%=basePath %>admin/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script
src="<%=basePath %>admin/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script
src="<%=basePath %>admin/plugins/knob/jquery.knob.js"></script>
<script
src="<%=basePath %>admin/plugins/daterangepicker/moment.min.js"></script>
<script
src="<%=basePath %>admin/plugins/daterangepicker/daterangepicker.js"></script>
<script
src="<%=basePath %>admin/plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
<script
src="<%=basePath %>admin/plugins/datepicker/bootstrap-datepicker.js"></script>
<script
src="<%=basePath %>admin/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script
src="<%=basePath %>admin/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script
src="<%=basePath %>admin/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script
src="<%=basePath %>admin/plugins/fastclick/fastclick.js"></script>
<script
src="<%=basePath %>admin/plugins/iCheck/icheck.min.js"></script>
<script
src="<%=basePath %>admin/plugins/adminLTE/js/app.min.js"></script>
<script
src="<%=basePath %>admin/plugins/treeTable/jquery.treetable.js"></script>
<script
src="<%=basePath %>admin/plugins/select2/select2.full.min.js"></script>
<script
src="<%=basePath %>admin/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script
src="<%=basePath %>admin/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
<script
src="<%=basePath %>admin/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
<script
src="<%=basePath %>admin/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
<script
src="<%=basePath %>admin/plugins/bootstrap-markdown/js/markdown.js"></script>
<script
src="<%=basePath %>admin/plugins/bootstrap-markdown/js/to-markdown.js"></script>
<script
src="<%=basePath %>admin/plugins/ckeditor/ckeditor.js"></script>
<script
src="<%=basePath %>admin/plugins/input-mask/jquery.inputmask.js"></script>
<script
src="<%=basePath %>admin/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script
src="<%=basePath %>admin/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script
src="<%=basePath %>admin/plugins/datatables/jquery.dataTables.min.js"></script>
<script
src="<%=basePath %>admin/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script
src="<%=basePath %>admin/plugins/chartjs/Chart.min.js"></script>
<script
src="<%=basePath %>admin/plugins/flot/jquery.flot.min.js"></script>
<script
src="<%=basePath %>admin/plugins/flot/jquery.flot.resize.min.js"></script>
<script
src="<%=basePath %>admin/plugins/flot/jquery.flot.pie.min.js"></script>
<script
src="<%=basePath %>admin/plugins/flot/jquery.flot.categories.min.js"></script>
<script
src="<%=basePath %>admin/plugins/ionslider/ion.rangeSlider.min.js"></script>
<script
src="<%=basePath %>admin/plugins/bootstrap-slider/bootstrap-slider.js"></script>
<script
src="<%=basePath %>admin/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script>
$(document).ready(function() {
// 选择框
$(".select2").select2();
// WYSIHTML5编辑器
$(".textarea").wysihtml5({
locale : 'zh-CN'
});
});
// 设置激活新闻
function setSidebarActive(tagUri) {
var liObj = $("#" + tagUri);
if (liObj.length > 0) {
liObj.parent().parent().addClass("active");
liObj.addClass("active");
}
}
</script>
</body>
</html>