改良后的系统界面

发布时间 2023-04-17 17:14:29作者: 小趴菜且能喝66

//index.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="bean.policy" %><%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2023/4/10
  Time: 15:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link href="table.css" rel="stylesheet">
    <title>Title</title>
</head>
<body>
<center>
    <div style="color: #87CEFA;font-size: 40px">
<img src="LOGO.png" style="width: 50px;height: 50px;">  科技政策查询系统
    </div>
</center>
<%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");
    Object message=request.getAttribute("message");
    if(message!=null)
    {
        %>
    <script language="JavaScript">alert("<%=message%>")</script>
<%
    }
    ArrayList<policy> policies= (ArrayList<policy>) request.getAttribute("policies");
    if(policies==null){
%>
<form action="Servlet?method=suoyou" method="post">
    <input type="submit" value="查询" style="background-color: #87CEFA;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;">
</form>
<%
    }
    else if(policies!=null){
%>
    <br>
<center>
    <form action="Servlet?method=chadata" method="post">
        <p style="font-size: 20px">政策名称:<input type="text" name="name" placeholder="请输入政策名称" style="border: none;height: 30px" size="30px">
        发文字号:<input type="text" name="document" placeholder="请输入发文字号" style="border: none;height: 30px" size=30px">
        发文机构:<input type="text" name="organ" placeholder="请输入发文机构" style="border: none;height: 30px" size="30px">
        全文检索:<input type="text" name="data" style="border: none;height: 30px" size="30px">
        <input type="submit" value="搜索" style="background-color: #87CEFA;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;"></p>
    </form>
</center>
    <br>
<table border="0" cellspacing="0" style="table-layout: fixed">
    <th width="10%" style="font-size: 30px">id</th><th width="25%" style="font-size: 30px">政策名称</th><th width="25%" style="font-size: 30px">发文机构</th><th width="20%" style="font-size: 30px">颁布日期</th><th width="20%" style="font-size: 30px">政策分类</th>
    <c:forEach items="${policies}" var="item">
        <tr>
            <td style="height:40px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">${item.id}</td>
            <td style="height:40px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"><a href="Servlet?method=chakan&id=${item.id}" style="text-decoration: none;color: #87CEFA">${item.name}</a></td>
            <td style="height:40px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">${item.organ}</td>
            <td style="height:40px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">${item.pubdata}</td>
            <td style="height:40px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">${item.type}</td>
        </tr>
    </c:forEach>
</table>
    <br>
共${sum}条记录,当前第${cpage}/${tpage}页
    <%
        String dd= request.getAttribute("dd").toString();
        if(Integer.parseInt(request.getAttribute("sum").toString())<10){
        } else if(dd.equals("d")){%>
    <a href="Servlet?method=suoyou&cp=1" style="text-decoration: none;color: #87CEFA">首页</a>
    <a href="Servlet?method=suoyou&cp=${cpage-1<=0?1:cpage-1}" style="text-decoration: none;color: #87CEFA">上一页</a>
    <a href="Servlet?method=suoyou&cp=${cpage+1>=tpage?tpage:cpage+1}" style="text-decoration: none;color: #87CEFA">下一页</a>
    <a href="Servlet?method=suoyou&cp=${tpage}" style="text-decoration: none;color: #87CEFA">尾页</a>
    <%
        }
        else if(dd.equals("dd")){%>
    <a href="Servlet?method=chadata&cp=1&name=<%=request.getAttribute("name")%>&document=<%=request.getAttribute("document")%>&organ=<%=request.getAttribute("organ")%>" style="text-decoration: none;color: #87CEFA">首页</a>
    <a href="Servlet?method=chadata&cp=${cpage-1<=0?1:cpage-1}&name=<%=request.getAttribute("name")%>&document=<%=request.getAttribute("document")%>&organ=<%=request.getAttribute("organ")%>" style="text-decoration: none;color: #87CEFA">上一页</a>
    <a href="Servlet?method=chadata&cp=${cpage+1>=tpage?tpage:cpage+1}&name=<%=request.getAttribute("name")%>&document=<%=request.getAttribute("document")%>&organ=<%=request.getAttribute("organ")%>" style="text-decoration: none;color: #87CEFA">下一页</a>
    <a href="Servlet?method=chadata&cp=${tpage}&name=<%=request.getAttribute("name")%>&document=<%=request.getAttribute("document")%>&organ=<%=request.getAttribute("organ")%>" style="text-decoration: none;color: #87CEFA">尾页</a>
    <%
        }
    %>
<%
    }
%>
<div style="margin-top: 50px">
    河北省科学技术情报研究院      版权所有   <a target='_blank' href='https://beian.miit.gov.cn/#/Integrated/recordQuery'> 冀ICP备06001908-1  </a>
</div>

</body>
</html>