首页 > 其他分享 >4月19号总结

4月19号总结

时间:2023-04-19 22:34:49浏览次数:32  
标签:总结 分页 pageSize 19 num tempStr var endRow

今天完成了河北科技政策查询的改良

增加了题目左对齐,显示字数一致,当鼠标悬浮在题目时,显示完整题目

按日期排序

点击题目就可以查看内容,取消原先右边的查看按钮

<%--
  Created by IntelliJ IDEA.
  User: wanghongbing
  Date: 2023/4/10
  Time: 15:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page language= "java" contentType= "text/html; charset=UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xmlns:th="http://www.thymeleaf.org">
<head>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <%@ page import="java.sql.*"%>
  <title>www.科技政策查询</title>
  <style type="">

    td{
      max-width: 320px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }</style>
  <script>
    /**
     * 分页函数
     * pno--页数
     * psize--每页显示记录数
     * 分页部分是从真实数据行开始,因而存在加减某个常数,以确定真正的记录数
     * 纯js分页实质是数据行全部加载,通过是否显示属性完成分页功能
     **/
    function goPage(pno,psize){
      var itable = document.getElementById("idData");
      var num = itable.rows.length;//表格所有行数(所有记录数)
      console.log(num);
      var totalPage = 0;//总页数
      var pageSize = 11;//每页显示行数
      //总共分几页
      if(num/pageSize > parseInt(num/pageSize)){
        totalPage=parseInt(num/(pageSize-1))+1;
      }else{
        totalPage=parseInt(num/(pageSize-1));
      }
      var currentPage = pno;//当前页数
      var startRow = (currentPage - 1) * pageSize+1;//开始显示的行 31
      var endRow = currentPage * pageSize;//结束显示的行  40
      endRow = (endRow > num)? num : endRow;  //40
      console.log(endRow);
      //遍历显示数据实现分页
      for(var i=1;i<(num+1);i++){
        var irow = itable.rows[i-1];
        if(i>=startRow && i<=endRow){
          irow.style.display = "block";
        }else{
          irow.style.display = "none";
        }
      }
      var tempStr = "共"+num+"条记录 共"+totalPage+"页 当前第"+currentPage+"页";
      if(currentPage>1){
        tempStr += "<a href=\"#\" onClick=\"goPage("+(1)+","+psize+")\">首页</a>";
        tempStr += "<a href=\"#\" onClick=\"goPage("+(currentPage-1)+","+psize+")\"><上一页</a>"
      }else{
        tempStr += "首页";
        tempStr += "<上一页  ";
      }
      if(currentPage<totalPage){
        tempStr += "<a href=\"#\" onClick=\"goPage("+(currentPage+1)+","+psize+")\">下一页></a>";
        tempStr += "<a href=\"#\" onClick=\"goPage("+(totalPage)+","+psize+")\">尾页</a>";
      }else{
        tempStr += "  下一页>";
        tempStr += "尾页";
      }
      document.getElementById("barcon").innerHTML = tempStr;
    }
  </script>
  <script th:src="@{/layuimini/js/lay-module/echarts/echarts.js}"></script>
  <script th:src="@{/layuimini/js/lay-module/echarts/wordcloud.js}"></script>
  <link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui/css/layui.css" />
  <script src="https://www.layuicdn.com/layui/layui.js"></script>
</head>
<body onl oad="goPage(1,10);">
<div style="text-align:center;">
  <img src="images/LOGO.png" width="40" height="40" style="margin-right: 10px;">
  <span style="font-size: 35px; color:#1571b2;">科技政策查询系统</span>
</div>

<div   style="text-align:center;width:100%;height:65px;float:left; position:relative; display: table-cell;vertical-align: middle;  background-color: rgba(232,232,232,0.76) ">
  <form class="layui-form" action="servlet?method=SelectAll" method="post" align="center" >
    <p> </p>
    <div class="layui-form-item">

      <div class="layui-inline">

        <label class="layui-form-label">
          政策名称:
        </label>
        <div class="layui-input-inline">
          <input type="text" name="name"  class="layui-input">
        </div>
      </div>
      <div class="layui-inline">
        <label class="layui-form-label">
          政策文号:
        </label>
        <div class="layui-input-inline">
          <input type="text" name="document"  class="layui-input">
        </div>
      </div>
      <div class="layui-inline">
        <label class="layui-form-label">
          发文机构:
        </label>
        <div class="layui-input-inline">
          <input type="text" name="organ"  class="layui-input">
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-input-inline">
          <button type="submit" class="layui-btn" lay-submit lay-filter="demo1"style="background-color: #1571b2">查询</button>
        </div>
      </div>
    </div>
  </form>
</div>
<div style="float:top"  align="center">
  <form class="layui-form" action="servlet?method=SelectAll" method="post" align="center" >
    <table id="idData"  border="1px" align="center" class="layui-table"style="table-layout: fixed;word-wrap:break-word;" >
      <thead>
      <tr align="center">
        <td style="width: 320px">政策名称</td>
        <td style="width:320px">发文机构</td>
        <td style="width: 320px">颁布日期</td>
        <td style="width:320px">政策分类</td>

      </tr>
      </thead>
      <tbody>
      <c:forEach items="${kc}" var="Policy">
        <tr align="center">
          <td style="width: 320px" title="${Policy.name}"><a href="servlet1?method1=${Policy.name}"><c:out value="${Policy.name}"></c:out> </td>
          <td style="width: 320px" title="${Policy.organ}"><c:out value="${Policy.organ}"></c:out></td>
          <td style="width: 320px" title="${Policy.date}"><c:out value="${Policy.date}"></c:out></td>
          <td style="width: 320px" title="${Policy.type}"><c:out value="${Policy.type}"></c:out></td>
        </tr>
      </c:forEach>
      </tbody>
    </table>
  </form>
</div>
<table width="100%" align="center">
  <tr><td style="text-align:center;"><div id="barcon" name="barcon"></div></td></tr>
</table>
</body>
</html>

 

标签:总结,分页,pageSize,19,num,tempStr,var,endRow
From: https://www.cnblogs.com/liucaizhi/p/17334905.html

相关文章

  • 2023.4.19
    1//1.7最佳存款方案2//假设银行一年整存零取的月息为0.63%。现在某人手中有一笔钱,他打算在今后的3//五年中的每年年底取出1000元,到第五年时正好取完,请算出他存钱时应存入多少4#include<iostream>5usingnamespacestd;6intmain()7{8floatm,n;9......
  • 每日总结 4.19
    今天进行了供货商web的编写,首先进行了登陆界面的设计优化,对于数据的查询用表格显示,明天继续对供货商页面继续进行数据的操作,登陆界面已经完成。 <!DOCTYPEHTML><html><head><title>登录界面</title><metacharset="utf-8"><metahttp-equiv="pragma"con......
  • 每日总结2023-04-19
    今天完成了对Android的界面优化,增添了昨日收入查看,总收入查看,并对三项收入增添了密文显示, 完成了下部分额外部分显示、跳转补货界面的Spinner使用   目前地址的当前详细位置还未完成,期望明天完成。 ......
  • 前端面试题总结
     1递归是什么?  递归确定只是函数自调用吗? 如果非得要用递归渲染一个菜单,你要怎么做.说具体的步骤. 说核心.//第n项的和sum(n)=sum(n-1)+n终止条件n=1functionsum(n){if(n==1)return1returnsum(n-1)+n}letamount=sum(100)console.log......
  • 2023.4.19每日会议
    今天完成了什么:将图片识别的结果录入到数据库遇到了什么困难:将图片识别的结果录入到数据库后,我们有一个需要用户确认录入的信息是否正确的功能,如果不正确则让用户实现更改,但在更改时不断的报错以及数据库响应数为0,折腾一晚上也没有得到结果,打算明天解决明天打算做什么:解决今天遇......
  • 每日总结
    今天继续对前台页面进行过设计遇到的问题:前台按钮失效,无法使用。解决方法:在eclipse点击openwith。而不是直接运行   ......
  • 4/19打卡
    classPeople{protected:intage;stringname;public:People(){}People(inta,stringn):age(a),name(n){}virtual~People(){}voidsetValue(intm,stringstr){age=m;name=str;}virtualvoiddi......
  • 4.19
    1#include<iostream>2usingnamespacestd;3intmain()4{5intx;6cin>>x;7cout<<"gongxinikaole90fen!";8return0;9} 1#include<iostream>2usingnamespacestd;3intmain()4{5......
  • 单调栈_20230419
    通常是一维数组,要寻找任一个元素的右边或者左边第一个比自己大或者小的元素的位置,此时我们就要想到可以用单调栈了739.每日温度题目说明请根据每日气温列表,重新生成一个列表。对应位置的输出为:要想观测到更高的气温,至少需要等待的天数。如果气温在这之后都不会升高,请在该位置......
  • 2023 4 19
    #include<iostream>usingnamespacestd;voidspeed(doublea){doublev;v=(a-95859)/2;cout<<"汽车的车速为"<<v<<endl;}intmain(){inti,j;doubles;intA[5]={0};for(i=95860;i<100000;i++){intt=i;for(j=0;j<5......