eclipse页面
lunwen.htm
l
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>论文检索</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=9;IE=8;IE=7;IE=EDGE">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="layuimini/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="layuimini/css/public.css" media="all">
<script src="js/echarts.min.js"></script>
<script src="js/echarts-wordcloud.js"></script>
<style type="text/css">
body {background-color: yellow}
h1 {background-color: #00ff00}
h2 {background-color: transparent}
</style>
<style>
#main {
100%;
height: 400px;
border: 1px solid #ddd;
float: center;
margin:0; padding:0;
}
html,body{
100%;height: 100%;
}
body{
background: url(1.jpg);
background-size: 100% 100%;
background-position: center center;
overflow: auto;
color:#c4f762;
}
</style>
</head>
<body>
<div class="layuimini-container">
<h2 align="center">论文汇总</h2>
<div class="layuimini-main">
<div class="layuimini-main">
<fieldset class="table-search-fieldset">
<div style="margin: 10px 10px 10px">
<form class="layui-form layui-form-pane" action="">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">论文名称</label>
<div class="layui-input-inline">
<input type="text" name="flunwenname" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">关键字</label>
<div class="layui-input-inline">
<input type="text" name="fkeywords" class="layui-input">
</div>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">作者</label>
<div class="layui-input-inline">
<input type="text" name="fauther" id="fauther" class="layui-input" >
</div>
</div>
<div class="layui-inline">
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"> 搜 索</button>
</div>
</div>
</form>
</div>
</fieldset>
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
<script type="text/html" id="currentTableBar">
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
</script>
</div>
</div>
<script src="layuimini/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form', 'laydate', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
laydate = layui.laydate,
table = layui.table;
laydate.render({
elem: '#fdate'
});
// 监听搜索操作
form.on('submit(data-search-btn1)', function (data) {
var result = JSON.stringify(data.field);
console.log("搜索");
$.ajax({
url: "YunServlet?method=tu&num="+data.field.num,
async: false,
dataType: "json",
success: function(data) {
dt = data;
var mydata = new Array(0);
for (var i = 0; i < dt.length; i++) {
var d = {};
d["name"] = dt[i].name;
d["value"] = dt[i].value;
mydata.push(d);
}
var myChart = echarts.init(document.getElementById('main'));
//设置点击效果
myChart.setOption({
title: {
text: '热词TOP'
},
tooltip: {},
series: [{
type: 'wordCloud', //类型为字符云
shape: 'smooth', //平滑
gridSize: 8, //网格尺寸
size: ['50%', '50%'],
//sizeRange : [ 50, 100 ],
rotationRange: [-45, 0, 45, 90], //旋转范围
textStyle: {
normal: {
fontFamily: '微软雅黑',
color: function() {
return 'rgb(' +
Math.round(Math.random() * 255) +
', ' + Math.round(Math.random() * 255) +
', ' + Math.round(Math.random() * 255) + ')'
}
},
emphasis: {
shadowBlur: 5, //阴影距离
shadowColor: '#333' //阴影颜色
}
},
left: 'center',
top: 'center',
'100%',
height: '100%',
data: mydata
}]
});
myChart.on('click', function(params) {
table.reload('currentTableId', {
url: 'ClickServlet'
,where: {keywords:params.name} //设定异步数据接口的额外参数
});
});
},
error: function() {
alert("请求失败");
},
});
table.render({
elem: '#currentTableId1',
url: 'YunServlet',
where: { method: 'tongji', num:data.field.num},
page: true,
limit:15,
cols: [[
{field: 'keyword', 100, title: '关键词'},
{field: 'number', 200, title: '出现次数',sort: true},
]],
skin: 'line'
});
layer.msg("搜索成功",{icon:1});
return false;
});
// 监听搜索操作
form.on('submit(data-search-btn)', function (data) {
var result = JSON.stringify(data.field);
console.log("搜索");
table.reload('currentTableId', {
url: 'LunwenServlet'
,where: {method: 'search',flunwenname: data.field.flunwenname,fkeywords:data.field.fkeywords,fauther:data.field.fauther} //设定异步数据接口的额外参数
});
layer.msg("搜索成功",{icon:1});
return false;
});
table.render({
elem: '#currentTableId',
url: 'LunwenServlet',
where: {method: 'select'},
request: {
pageName: 'page' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
},
page: true,
limit:15,
cols: [[
{field: 'idlunwen', 80, title: 'ID', sort: true },
{field: 'title', 250, title: '标题', sort: true ,totalRow: true},
{field: 'auther', 200, title: '作者'},
{field: 'abs', 250, title: '摘要'},
{field: 'link', 250, title: '链接'},
{field: 'code', 80, title: '编号', sort: true},
{field: 'keywords', 100, title: '关键词', sort: true},
{title: '操作', minWidth: 120, toolbar: '#currentTableBar', align: "center"}
]],
skin: 'line'
});
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data; //获得当前行数据
var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
var tr = obj.tr; //获得当前行 tr 的DOM对象
if (obj.event === 'edit') {
//do something
//向服务端发送修改指令
var index = layer.open({
title: '编辑用户',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['450px', '500px'],
content: 'editbill.html',
btn: ['修改'],
success : function(layero, index){
var body = layer.getChildFrame('body', index);
if(data){
body.find("#sbillnum").val(data.billnum);
body.find("#stype").val(data.type);
body.find("#sbeizhu").val(data.beizhu);
};
},
yes: function(index, layero){
var body = layer.getChildFrame("body", index);
var data1 = body.find("#sbillnum").val();
var data2 = body.find("#stype").val();
var data3 = body.find("#sbeizhu").val();
obj.update({
billnum: data1
,type: data2
,beizhu: data3
});
console.log(data1);
$.ajax({
url:'LunwenServlet?method=change',
type:'post',
data:{'id':data.billid,'billnum':data1,'stype':data2,'sbeizhu':data3},//向服务端发送删除的id
success:function(flag){
console.log(flag);
if(flag=="true"){
layer.msg("修改成功",{icon:1});
}
else{
layer.msg("修改失败",{icon:5});
}
}
});
layer.close(index);
}
});
} else if (obj.event === 'delete') {
layer.confirm('真的删除吗?', function(index){
//向服务端发送删除指令
$.ajax({
url:'LunwenServlet?method=delete',
type:'post',
data:{'id':data.idlunwen},//向服务端发送删除的id
success:function(flag){
console.log(flag);
console.log(typeof flag);
if(flag=="true"){
obj.del(); //删除对应行(tr)的DOM结构,并更新缓存
layer.close(index);
console.log(index);
layer.msg("删除成功",{icon:1});
}
else{
layer.msg("删除失败",{icon:5});
}
}
});
layer.close(index);
});
}
});
});
</script>
</body>
</html>
select.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>热词云</title>
<meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="layuimini/lib/layui-v2.5.5/css/layui.css" media="all">
<link rel="stylesheet" href="layuimini/css/public.css" media="all">
<script src="js/echarts.min.js"></script>
<script src="js/echarts-wordcloud.js"></script>
<style>
#main {
100%;
height: 400px;
border: 1px solid rgb(128, 255, 255);
float: center;
margin:0; padding:0;
}
html,body{
100%;height: 100%;
}
body{
background: url(1.jpg);
background-size: 100% 100%;
background-position: center center;
overflow: auto;
color:#c4f762
}
</style>
</head>
<body>
<div class="layuimini-container">
<h1 align="center">热词云</h1>
<div>
<li><a href="lunwen.html">论文检索 </a></li>
</div>
<fieldset class="table-search-fieldset">
<div style="margin: 10px 10px 10px">
<form class="layui-form layui-form-pane" action="">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">排行数</label>
<div class="layui-input-inline">
<input type="text" name="num" class="layui-input">
</div>
</div>
<div class="layui-inline">
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn1"> 搜 索</button>
</div>
</div>
</form>
</div>
</fieldset>
<div id="main" align="center">
</div>
<div>
<table class="layui-hide" id="currentTableId1" lay-filter="currentTableFilter1"></table>
</div>
<script src="layuimini/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
layui.use(['form', 'laydate', 'table'], function () {
var $ = layui.jquery,
form = layui.form,
laydate = layui.laydate,
table = layui.table;
laydate.render({
elem: '#fdate'
});
// 监听搜索操作
form.on('submit(data-search-btn1)', function (data) {
var result = JSON.stringify(data.field);
console.log("搜索");
$.ajax({
url: "YunServlet?method=tu&num="+data.field.num,
async: false,
dataType: "json",
success: function(data) {
dt = data;
var mydata = new Array(0);
for (var i = 0; i < dt.length; i++) {
var d = {};
d["name"] = dt[i].name;
d["value"] = dt[i].value;
mydata.push(d);
}
var myChart = echarts.init(document.getElementById('main'));
//设置点击效果
myChart.setOption({
title: {
text: '热词TOP'
},
tooltip: {},
series: [{
type: 'wordCloud', //类型为字符云
shape: 'smooth', //平滑
gridSize: 8, //网格尺寸
size: ['50%', '50%'],
//sizeRange : [ 50, 100 ],
rotationRange: [-45, 0, 45, 90], //旋转范围
textStyle: {
normal: {
fontFamily: '黑体',
color: function() {
return 'rgb(' +
Math.round(Math.random() * 255) +
', ' + Math.round(Math.random() * 255) +
', ' + Math.round(Math.random() * 255) + ')'
}
},
emphasis: {
shadowBlur: 5, //阴影距离
shadowColor: '#000000' //阴影颜色
}
},
left: 'center',
top: 'center',
'100%',
height: '100%',
data: mydata
}]
});
myChart.on('click', function(params) {
table.reload('currentTableId', {
url: 'ClickServlet'
,where: {keywords:params.name} //设定异步数据接口的额外参数
});
});
},
error: function() {
alert("请求失败");
},
});
table.render({
elem: '#currentTableId1',
url: 'YunServlet',
where: { method: 'tongji', num:data.field.num},
page: true,
limit:15,
cols: [[
{field: 'keyword', 100, title: '关键词'},
{field: 'number', 200, title: '出现次数',sort: true},
]],
skin: 'line'
});
layer.msg("搜索成功",{icon:1});
return false;
});
// 监听搜索操作
form.on('submit(data-search-btn)', function (data) {
var result = JSON.stringify(data.field);
console.log("搜索");
table.reload('currentTableId', {
url: 'LunwenServlet'
,where: {method: 'search',flunwenname: data.field.flunwenname,fkeywords:data.field.fkeywords,fauther:data.field.fauther} //设定异步数据接口的额外参数
});
layer.msg("搜索成功",{icon:1});
return false;
});
table.render({
elem: '#currentTableId',
url: 'LunwenServlet',
where: {method: 'select'},
request: {
pageName: 'page' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
},
page: true,
limit:15,
cols: [[
{field: 'idlunwen', 80, title: 'ID', sort: true },
{field: 'title', 250, title: '标题', sort: true ,totalRow: true},
{field: 'auther', 200, title: '作者'},
{field: 'abs', 250, title: '摘要'},
{field: 'link', 250, title: '链接'},
{field: 'code', 80, title: '编号', sort: true},
{field: 'keywords', 100, title: '关键词', sort: true},
{title: '操作', minWidth: 120, toolbar: '#currentTableBar', align: "center"}
]],
skin: 'line'
});
table.on('tool(currentTableFilter)', function (obj) {
var data = obj.data; //获得当前行数据
var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
var tr = obj.tr; //获得当前行 tr 的DOM对象
if (obj.event === 'edit') {
//do something
//向服务端发送修改指令
var index = layer.open({
title: '编辑用户',
type: 2,
shade: 0.2,
maxmin:true,
shadeClose: true,
area: ['450px', '500px'],
content: 'editbill.html',
btn: ['修改'],
success : function(layero, index){
var body = layer.getChildFrame('body', index);
if(data){
body.find("#sbillnum").val(data.billnum);
body.find("#stype").val(data.type);
body.find("#sbeizhu").val(data.beizhu);
};
},
yes: function(index, layero){
var body = layer.getChildFrame("body", index);
var data1 = body.find("#sbillnum").val();
var data2 = body.find("#stype").val();
var data3 = body.find("#sbeizhu").val();
obj.update({
billnum: data1
,type: data2
,beizhu: data3
});
console.log(data1);
$.ajax({
url:'LunwenServlet?method=change',
type:'post',
data:{'id':data.billid,'billnum':data1,'stype':data2,'sbeizhu':data3},//向服务端发送删除的id
success:function(flag){
console.log(flag);
if(flag=="true"){
layer.msg("修改成功",{icon:1});
}
else{
layer.msg("修改失败",{icon:5});
}
}
});
layer.close(index);
}
});
} else if (obj.event === 'delete') {
layer.confirm('真的删除吗?', function(index){
//向服务端发送删除指令
$.ajax({
url:'LunwenServlet?method=delete',
type:'post',
data:{'id':data.idlunwen},//向服务端发送删除的id
success:function(flag){
console.log(flag);
console.log(typeof flag);
if(flag=="true"){
obj.del(); //删除对应行(tr)的DOM结构,并更新缓存
layer.close(index);
console.log(index);
layer.msg("删除成功",{icon:1});
}
else{
layer.msg("删除失败",{icon:5});
}
}
});
layer.close(index);
});
}
});
});
</script>
</body>
</html>