• 会议OA项目(六)--- (待开会议、历史会议、所有会议)


    前言

            上一篇分享了会议通知以及会议反馈,根据需求来今天应该到了,历史会议、待开会议以及所有会议了。


    一、需求分析

    历史会议:登录人员,属于参与者列席者或者主人其中一个时,并且会议状态为已结束时,要将数据查询出来。

    待开会议:登录人员,属于参与者列席者或者主人其中一个时,并且会议状态为待开时,要将数据查询出来。

    所有会议:登录人员,属于参与者列席者或者主人其中一个时,要将数据查询出来。

    编写SQL语句

     待开会议

    1. select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren
    2. ,b.name zhuchirenname,
    3. a.location,
    4. DATE_FORMAT(a.startTime,'%Y-%m-%d %H-%m-%s') startTime,
    5. DATE_FORMAT(a.endTime,'%Y-%m-%d %H-%m-%s') endTime,
    6. a.state,
    7. (case a.state
    8. when 0 then '取消会议'
    9. when 1 then '新建'
    10. when 2 then '待审核'
    11. when 3 then '驳回'
    12. when 4 then '待开'
    13. when 5 then '进行中'
    14. when 6 then '开启投票'
    15. when 7 then '结束会议'
    16. else '其他' end
    17. ) meetingstate,
    18. a.seatPic,a.remark,a.auditor,
    19. c.name auditorname
    20. from t_oa_meeting_info a
    21. inner join t_oa_user b on a.zhuchiren=b.id
    22. left join t_oa_user c on a.auditor=c.id where 1=1
    23. and state = 4 and FIND_IN_SET(6,CONCAT(canyuze,',',liexize,',',zhuchiren))

    所有会议

    1. select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren
    2. ,b.name zhuchirenname,
    3. a.location,
    4. DATE_FORMAT(a.startTime,'%Y-%m-%d %H-%m-%s') startTime,
    5. DATE_FORMAT(a.endTime,'%Y-%m-%d %H-%m-%s') endTime,
    6. a.state,
    7. (case a.state
    8. when 0 then '取消会议'
    9. when 1 then '新建'
    10. when 2 then '待审核'
    11. when 3 then '驳回'
    12. when 4 then '待开'
    13. when 5 then '进行中'
    14. when 6 then '开启投票'
    15. when 7 then '结束会议'
    16. else '其他' end
    17. ) meetingstate,
    18. a.seatPic,a.remark,a.auditor,
    19. c.name auditorname
    20. from t_oa_meeting_info a
    21. inner join t_oa_user b on a.zhuchiren=b.id
    22. left join t_oa_user c on a.auditor=c.id where 1=1
    23. and FIND_IN_SET(6,CONCAT(a.canyuze,',',a.liexize,',',a.zhuchiren,',',IFNULL(a.auditor,-1)))

    历史会议

    1. select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren
    2. ,b.name zhuchirenname,
    3. a.location,
    4. DATE_FORMAT(a.startTime,'%Y-%m-%d %H-%m-%s') startTime,
    5. DATE_FORMAT(a.endTime,'%Y-%m-%d %H-%m-%s') endTime,
    6. a.state,
    7. (case a.state
    8. when 0 then '取消会议'
    9. when 1 then '新建'
    10. when 2 then '待审核'
    11. when 3 then '驳回'
    12. when 4 then '待开'
    13. when 5 then '进行中'
    14. when 6 then '开启投票'
    15. when 7 then '结束会议'
    16. else '其他' end
    17. ) meetingstate,
    18. a.seatPic,a.remark,a.auditor,
    19. c.name auditorname
    20. from t_oa_meeting_info a
    21. inner join t_oa_user b on a.zhuchiren=b.id
    22. left join t_oa_user c on a.auditor=c.id where 1=1
    23. and state = 7 and FIND_IN_SET(6,CONCAT(canyuze,',',liexize,',',zhuchiren))

     二、编码

            后端:

            MeetingInfoDao

    1. package com.zking.dao;
    2. import java.sql.SQLException;
    3. import java.util.List;
    4. import java.util.Map;
    5. import com.zking.entity.MeetingInfo;
    6. import com.zking.util.BaseDao;
    7. import com.zking.util.PageBean;
    8. import com.zking.util.StringUtils;
    9. public class MeetingInfoDao extends BaseDao {
    10. // 添加会议信息
    11. public int add(MeetingInfo info) throws Exception {
    12. String sql = "insert into t_oa_meeting_info(title,content,canyuze,liexize,zhuchiren,\r\n"
    13. + "location,startTime,endTime,remark) values(?,?,?,?,?,?,?,?,?)";
    14. return super.executeUpdate(sql, info, new String[] { "title", "content", "canyuze", "liexize", "zhuchiren",
    15. "location", "startTime", "endTime", "remark" });
    16. }
    17. //我的会议SQL,后续其他的菜单也会使用
    18. private String getSQL() {
    19. return "select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren\r\n" +
    20. ",b.name zhuchirenname,\r\n" +
    21. "a.location,\r\n" +
    22. "DATE_FORMAT(a.startTime,'%Y-%m-%d %H-%m-%s') startTime,\r\n" +
    23. "DATE_FORMAT(a.endTime,'%Y-%m-%d %H-%m-%s') endTime,\r\n" +
    24. "a.state,\r\n" +
    25. "(\r\n" +
    26. " case a.state\r\n" +
    27. " when 0 then '取消会议'\r\n" +
    28. " when 1 then '新建'\r\n" +
    29. " when 2 then '待审核'\r\n" +
    30. " when 3 then '驳回'\r\n" +
    31. " when 4 then '待开'\r\n" +
    32. " when 5 then '进行中'\r\n" +
    33. " when 6 then '开启投票'\r\n" +
    34. " when 7 then '结束会议'\r\n" +
    35. " else '其他' end\r\n" +
    36. ") meetingstate,\r\n" +
    37. "a.seatPic,a.remark,a.auditor,\r\n" +
    38. "c.name auditorname\r\n" +
    39. "from t_oa_meeting_info a\r\n" +
    40. "inner join t_oa_user b on a.zhuchiren=b.id\r\n" +
    41. "left join t_oa_user c on a.auditor=c.id where 1=1 ";
    42. }
    43. //我的会议
    44. public List> myInfos(MeetingInfo info, PageBean pageBean)
    45. throws SQLException, InstantiationException, IllegalAccessException {
    46. String sql = getSQL();
    47. //会议标题
    48. String title = info.getTitle();
    49. if(StringUtils.isNotBlank(title)) {
    50. sql+=" and title like '%"+title+"%'";
    51. }
    52. sql+=" and zhuchiren="+info.getZhuchiren();
    53. // 排序按照降序展示
    54. sql+=" order by a.id desc ";
    55. return super.executeQuery(sql, pageBean);
    56. }
    57. // 设置会议排座图片
    58. public int updateSeatPicById(MeetingInfo info) throws Exception {
    59. String sql =" update t_oa_meeting_info set seatPic=? where id=?";
    60. return super.executeUpdate(sql, info, new String[] {"seatPic","id"});
    61. }
    62. // 根据会议ID更新会议的审批人(送审)
    63. public int updateAuditorById(MeetingInfo info) throws Exception {
    64. String sql="update t_oa_meeting_info set auditor=?,state=2 where id=?";
    65. return super.executeUpdate(sql, info, new String[] {"auditor","id"});
    66. }
    67. public List> myAudit(MeetingInfo info, PageBean pageBean) throws Exception {
    68. String sql = getSQL();
    69. //会议标题
    70. String title = info.getTitle();
    71. if(StringUtils.isNotBlank(title)) {
    72. sql+=" and title like '%"+title+"%'";
    73. }
    74. // 当前登录账号是会议信息表中 审批人字段值
    75. sql+=" and a.auditor="+info.getAuditor();
    76. // 只查询会议状态为 2 即待审核的会议
    77. sql+=" and state = 2 ";
    78. // 排序按照降序展示
    79. sql+=" order by a.id desc ";
    80. return super.executeQuery(sql, pageBean);
    81. }
    82. // 待开会议
    83. public List> queryMeetingInfoByState(MeetingInfo info, PageBean pageBean) throws InstantiationException, IllegalAccessException, SQLException {
    84. String sql="select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren \r\n" +
    85. " ,b.name zhuchirenname,\r\n" +
    86. " a.location,\r\n" +
    87. " DATE_FORMAT(a.startTime,'%Y-%m-%d %H-%m-%s') startTime,\r\n" +
    88. " DATE_FORMAT(a.endTime,'%Y-%m-%d %H-%m-%s') endTime, \r\n" +
    89. " a.state, \r\n" +
    90. " (case a.state\r\n" +
    91. " when 0 then '取消会议'\r\n" +
    92. " when 1 then '新建' \r\n" +
    93. " when 2 then '待审核' \r\n" +
    94. " when 3 then '驳回' \r\n" +
    95. " when 4 then '待开'\r\n" +
    96. " when 5 then '进行中'\r\n" +
    97. " when 6 then '开启投票' \r\n" +
    98. " when 7 then '结束会议'\r\n" +
    99. " else '其他' end\r\n" +
    100. " ) meetingstate,\r\n" +
    101. " a.seatPic,a.remark,a.auditor, \r\n" +
    102. " c.name auditorname \r\n" +
    103. " from t_oa_meeting_info a \r\n" +
    104. " inner join t_oa_user b on a.zhuchiren=b.id \r\n" +
    105. " left join t_oa_user c on a.auditor=c.id where 1=1 \r\n" +
    106. " and state = 4 and FIND_IN_SET("+info.getZhuchiren()+",CONCAT(canyuze,',',liexize,',',zhuchiren))";
    107. return super.executeQuery(sql, pageBean);
    108. }
    109. // 所有会议
    110. public List> allInfos(MeetingInfo info, PageBean pageBean) throws InstantiationException, IllegalAccessException, SQLException {
    111. String sql="select a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren \r\n" +
    112. " ,b.name zhuchirenname,\r\n" +
    113. " a.location,\r\n" +
    114. " DATE_FORMAT(a.startTime,'%Y-%m-%d %H-%m-%s') startTime,\r\n" +
    115. " DATE_FORMAT(a.endTime,'%Y-%m-%d %H-%m-%s') endTime, \r\n" +
    116. " a.state, \r\n" +
    117. " (case a.state\r\n" +
    118. " when 0 then '取消会议'\r\n" +
    119. " when 1 then '新建' \r\n" +
    120. " when 2 then '待审核' \r\n" +
    121. " when 3 then '驳回' \r\n" +
    122. " when 4 then '待开'\r\n" +
    123. " when 5 then '进行中'\r\n" +
    124. " when 6 then '开启投票' \r\n" +
    125. " when 7 then '结束会议'\r\n" +
    126. " else '其他' end\r\n" +
    127. " ) meetingstate,\r\n" +
    128. " a.seatPic,a.remark,a.auditor, \r\n" +
    129. " c.name auditorname \r\n" +
    130. " from t_oa_meeting_info a \r\n" +
    131. " inner join t_oa_user b on a.zhuchiren=b.id \r\n" +
    132. " left join t_oa_user c on a.auditor=c.id where 1=1 \r\n" +
    133. " and FIND_IN_SET("+info.getZhuchiren()+",CONCAT(a.canyuze,',',a.liexize,',',a.zhuchiren,',',IFNULL(a.auditor,-1)))";
    134. return super.executeQuery(sql, pageBean);
    135. }
    136. //历史会议
    137. public List> queryMeetingHistoryInfoByState(MeetingInfo info, PageBean pageBean) throws InstantiationException, IllegalAccessException, SQLException {
    138. String sql = "select CONCAT(\r\n" +
    139. " canyuze,',',liexize,',',zhuchiren),a.id,a.title,a.content,a.canyuze,a.liexize,a.zhuchiren,\r\n" +
    140. " b.`name` zhuchirenname,\r\n" +
    141. " a.location,\r\n" +
    142. " DATE_FORMAT(a.startTime,'%y-%m-%d %h-%M-%s') startTime,\r\n" +
    143. " DATE_FORMAT(a.endTime,'%y-%m-%d %h-%M-%s') endTime,\r\n" +
    144. " a.state,\r\n" +
    145. " (\r\n" +
    146. " case a.state\r\n" +
    147. " when 0 then '取消会议'\r\n" +
    148. " when 1 then '新建'\r\n" +
    149. " when 2 then '待审核'\r\n" +
    150. " when 3 then '驳回'\r\n" +
    151. " when 4 then '待开'\r\n" +
    152. " when 5 then '进行中'\r\n" +
    153. " when 6 then '开启投票'\r\n" +
    154. " when 7 then '结束'\r\n" +
    155. " else '其它' end \r\n" +
    156. " ) meetingstate,\r\n" +
    157. " a.seatPic,a.remark,a.auditor,\r\n" +
    158. " c.`name` auditorname from t_oa_meeting_info a\r\n" +
    159. " inner join t_oa_user b on a.zhuchiren = b.id\r\n" +
    160. " left join t_oa_user c on a.auditor = c.id where 1=1\r\n" +
    161. " and state = 7 and FIND_IN_SET("+info.getZhuchiren()+",CONCAT(\r\n" +
    162. " canyuze,',',liexize,',',zhuchiren))";
    163. return super.executeQuery(sql, pageBean);
    164. }
    165. }

            MeetingInfoAction

    1. package com.zking.web;
    2. import java.util.Date;
    3. import java.util.List;
    4. import java.util.Map;
    5. import java.util.UUID;
    6. import javax.servlet.http.HttpServletRequest;
    7. import javax.servlet.http.HttpServletResponse;
    8. import org.apache.commons.beanutils.ConvertUtils;
    9. import com.zking.dao.MeetingInfoDao;
    10. import com.zking.entity.MeetingInfo;
    11. import com.zking.framework.ActionSupport;
    12. import com.zking.framework.ModelDriver;
    13. import com.zking.util.Base64ImageUtils;
    14. import com.zking.util.MyDateConverter;
    15. import com.zking.util.PageBean;
    16. import com.zking.util.PropertiesUtil;
    17. import com.zking.util.R;
    18. import com.zking.util.ResponseUtil;
    19. public class MeetingInfoAction extends ActionSupport implements ModelDriver{
    20. private MeetingInfo info = new MeetingInfo();
    21. private MeetingInfoDao infoDao = new MeetingInfoDao();
    22. @Override
    23. public MeetingInfo getModel() {
    24. // 注册一个转换器
    25. ConvertUtils.register(new MyDateConverter(), Date.class);
    26. return info;
    27. }
    28. public String add(HttpServletRequest req, HttpServletResponse resp) {
    29. try {
    30. // rs是sql语句执行的影响行数
    31. int rs = infoDao.add(info);
    32. if(rs > 0) {
    33. ResponseUtil.writeJson(resp, R.ok(200, "会议信息数据新增成功"));
    34. }else {
    35. ResponseUtil.writeJson(resp, R.error(0, "会议信息数据新增失败"));
    36. }
    37. } catch (Exception e) {
    38. e.printStackTrace();
    39. try {
    40. ResponseUtil.writeJson(resp, R.error(0, "会议信息数据新增失败"));
    41. } catch (Exception e1) {
    42. e1.printStackTrace();
    43. }
    44. }
    45. return null;
    46. }
    47. // 我的会议
    48. public String myInfos(HttpServletRequest req, HttpServletResponse resp) {
    49. try {
    50. PageBean pageBean = new PageBean();
    51. pageBean.setRequest(req);
    52. List> list = infoDao.myInfos(info, pageBean);
    53. // 注意:layui中的数据表格的格式
    54. ResponseUtil.writeJson(resp, R.ok(0, "我的会议数据查询成功" , pageBean.getTotal(), list));
    55. } catch (Exception e) {
    56. e.printStackTrace();
    57. try {
    58. ResponseUtil.writeJson(resp, R.error(0, "我的会议数据查询失败"));
    59. } catch (Exception e1) {
    60. e1.printStackTrace();
    61. }
    62. }
    63. return null;
    64. }
    65. // 我的审批
    66. public String myAudit(HttpServletRequest req, HttpServletResponse resp) {
    67. try {
    68. PageBean pageBean = new PageBean();
    69. pageBean.setRequest(req);
    70. List> infos = infoDao.myAudit(info, pageBean);
    71. ResponseUtil.writeJson(resp, R.ok(0, "我的审批查询成功", pageBean.getTotal(), infos));
    72. } catch (Exception e) {
    73. e.printStackTrace();
    74. try {
    75. ResponseUtil.writeJson(resp, R.error(0, "我的审批查询失败"));
    76. } catch (Exception e1) {
    77. e1.printStackTrace();
    78. }
    79. }
    80. return null;
    81. }
    82. // 取消会议
    83. public String del(HttpServletRequest req, HttpServletResponse resp) {
    84. try {
    85. PageBean pageBean = new PageBean();
    86. pageBean.setRequest(req);
    87. int upd = infoDao.updateState(info);
    88. // 注意:layui中的数据表格的格式
    89. if(upd > 0) {
    90. ResponseUtil.writeJson(resp, R.ok(200, "会议取消成功"));
    91. }else {
    92. ResponseUtil.writeJson(resp, R.error(0, "会议取消失败"));
    93. }
    94. } catch (Exception e) {
    95. e.printStackTrace();
    96. try {
    97. ResponseUtil.writeJson(resp, R.error(0, "会议取消失败"));
    98. } catch (Exception e1) {
    99. e1.printStackTrace();
    100. }
    101. }
    102. return null;
    103. }
    104. // 根据会议id更新排座
    105. public String updateSeatPicById(HttpServletRequest req,
    106. HttpServletResponse resp) throws Exception{
    107. try {
    108. //1.将排座图片保存到指定的位置并得到图片路径
    109. //1) 定义会议图片的保存路径
    110. String serverPath=PropertiesUtil.getValue("serverPath");
    111. String dirPath=PropertiesUtil.getValue("dirPath");
    112. //2) 定义会议排座图片的名称(最终要保存到数据库表中),例如:/uploads/xxxxx.jpg
    113. String fileName=UUID.randomUUID().toString().replace("-", "")+".jpg";
    114. //3) 拼接成完整的路径
    115. String realPath=dirPath+fileName;
    116. //4) 将图片保存到指定位置
    117. Base64ImageUtils.GenerateImage(info.getSeatPic().replace("data:image/png;base64,",""), realPath);
    118. //2.根据会议ID修改会议图片信息
    119. info.setSeatPic(serverPath+fileName);
    120. infoDao.updateSeatPicById(info);
    121. ResponseUtil.writeJson(resp, R.ok(200, "更新会议的排座图片成功"));
    122. } catch (Exception e) {
    123. e.printStackTrace();
    124. try {
    125. ResponseUtil.writeJson(resp, R.error(0, "更新会议的排座图片失败"));
    126. } catch (Exception e1) {
    127. e1.printStackTrace();
    128. }
    129. }
    130. return null;
    131. }
    132. // 根据会议ID更新会议的审批人(送审)
    133. public String updateAuditorById(HttpServletRequest req, HttpServletResponse resp) {
    134. try {
    135. int rs = infoDao.updateAuditorById(info);
    136. if (rs > 0) {
    137. ResponseUtil.writeJson(resp, R.ok(200, "会议审批成功"));
    138. }else {
    139. ResponseUtil.writeJson(resp, R.error(0, "会议审批失败"));
    140. }
    141. } catch (Exception e) {
    142. e.printStackTrace();
    143. try {
    144. ResponseUtil.writeJson(resp, R.error(0, "会议审批失败"));
    145. } catch (Exception e1) {
    146. e1.printStackTrace();
    147. }
    148. }
    149. return null;
    150. }
    151. // 历史会议
    152. public String queryMeetingHistoryInfoByState(HttpServletRequest req, HttpServletResponse resp) {
    153. try {
    154. PageBean pageBean = new PageBean();
    155. pageBean.setRequest(req);
    156. List> infos = infoDao.queryMeetingHistoryInfoByState(info, pageBean);
    157. ResponseUtil.writeJson(resp, R.ok(0, "历史会议查询成功!!!", pageBean.getTotal(), infos));
    158. } catch (Exception e) {
    159. e.printStackTrace();
    160. try {
    161. ResponseUtil.writeJson(resp, R.error(0, "历史会议查询失败!!!"));
    162. } catch (Exception e1) {
    163. e1.printStackTrace();
    164. }
    165. }
    166. return null;
    167. }
    168. public String queryMeetingInfoByState(HttpServletRequest req, HttpServletResponse resp) {
    169. try {
    170. PageBean pageBean = new PageBean();
    171. pageBean.setRequest(req);
    172. List> infos = infoDao.queryMeetingInfoByState(info, pageBean);
    173. ResponseUtil.writeJson(resp, R.ok(0, "会议查询成功!!!", pageBean.getTotal(), infos));
    174. } catch (Exception e) {
    175. e.printStackTrace();
    176. try {
    177. ResponseUtil.writeJson(resp, R.error(0, "会议查询失败"));
    178. } catch (Exception e1) {
    179. e1.printStackTrace();
    180. }
    181. }
    182. return null;
    183. }
    184. public String allInfos(HttpServletRequest req, HttpServletResponse resp) {
    185. try {
    186. PageBean pageBean = new PageBean();
    187. pageBean.setRequest(req);
    188. List> infos = infoDao.allInfos(info, pageBean);
    189. ResponseUtil.writeJson(resp, R.ok(0, "会议查询成功!!!", pageBean.getTotal(), infos));
    190. } catch (Exception e) {
    191. e.printStackTrace();
    192. try {
    193. ResponseUtil.writeJson(resp, R.error(0, "会议查询失败"));
    194. } catch (Exception e1) {
    195. e1.printStackTrace();
    196. }
    197. }
    198. return null;
    199. }
    200. }

            前端:

            meetingAll.jsp

    1. <%@ page language="java" contentType="text/html; charset=UTF-8"
    2. pageEncoding="UTF-8"%>
    3. <%@include file="/common/header.jsp"%>
    4. html>
    5. <html>
    6. <head>
    7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    8. <script type="text/javascript" src="${pageContext.request.contextPath }/static/js/meeting/meetingAll.js">script>
    9. head>
    10. <style>
    11. body{
    12. margin:15px;
    13. }
    14. .layui-table-cell {height: inherit;}
    15. .layui-layer-page .layui-layer-content { overflow: visible !important;}
    16. style>
    17. <body>
    18. <div class="layui-form-item">
    19. <div class="layui-inline">
    20. <label class="layui-form-label">会议标题:label>
    21. <div class="layui-input-inline">
    22. <input type="hidden" id="userid" value="${sessionScope.user.id }"/>
    23. <input type="text" id="title" autocomplete="off"
    24. class="layui-input">
    25. div>
    26. div>
    27. <div class="layui-inline">
    28. <button id="btn_meeting_search" class="layui-btn layui-btn-normal">
    29. <i class="layui-icon">i> 查询
    30. button>
    31. div>
    32. div>
    33. <table style="margin-top: -15px;" id="tb_meeting" lay-filter="tb_meeting">table>
    34. body>
    35. html>

            meetingAll.js

    1. let layer,form,table,$;
    2. var row;
    3. layui.use(['layer','form','table'],function(){
    4. layer=layui.layer,form=layui.form,table=layui.table,$=layui.jquery;
    5. //初始化会议列表
    6. initMeeting();
    7. //绑定查询按钮的点击事件
    8. $('#btn_meeting_search').click(function(){
    9. query();
    10. });
    11. });
    12. //1.初始化会议列表
    13. function initMeeting(){
    14. table.render({ //执行渲染
    15. elem: '#tb_meeting', //指定原始表格元素选择器(推荐id选择器)
    16. height: 400, //自定义高度
    17. loading: false, //是否显示加载条(默认 true)
    18. cols: [[ //设置表头
    19. {field: 'title', title: '会议标题', width: 180},
    20. {field: 'location', title: '会议地点', width: 120},
    21. {field: 'startTime', title: '开始时间', width: 180},
    22. {field: 'endTime', title: '结束时间', width: 180},
    23. {field: 'meetingState', title: '会议状态', width: 90},
    24. {field: 'name', title: '主持人', width: 120},
    25. //{field: '', title: '操作', width: 260, toolbar: '#tbMeeting'}
    26. ]]
    27. });
    28. }
    29. //2.查询所有会议
    30. function query(){
    31. table.reload('tb_meeting', {
    32. url: 'info.action', //请求地址
    33. method: 'POST', //请求方式,GET或者POST
    34. loading: true, //是否显示加载条(默认 true)
    35. page: true, //是否分页
    36. where: { //设定异步数据接口的额外参数,任意设
    37. 'methodName':'allInfos',
    38. 'title':$('#title').val(),
    39. 'zhuchiren':$('#userid').val()
    40. },
    41. request: { //自定义分页请求参数名
    42. pageName: 'page', //页码的参数名称,默认:page
    43. limitName: 'rows' //每页数据量的参数名,默认:limit
    44. },
    45. done: function (res, curr, count) {
    46. //查询完成的回调函数
    47. }
    48. });
    49. }

            meetingWaiting.jsp

    1. <%@ page language="java" contentType="text/html; charset=UTF-8"
    2. pageEncoding="UTF-8"%>
    3. <%@include file="/common/header.jsp"%>
    4. html>
    5. <html>
    6. <head>
    7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    8. <script type="text/javascript" src="${pageContext.request.contextPath }/static/js/meeting/meetingWaiting.js">script>
    9. head>
    10. <style>
    11. body{
    12. margin:15px;
    13. }
    14. .layui-table-cell {height: inherit;}
    15. .layui-layer-page .layui-layer-content { overflow: visible !important;}
    16. style>
    17. <body>
    18. <div class="layui-form-item">
    19. <div class="layui-inline">
    20. <label class="layui-form-label">会议标题:label>
    21. <div class="layui-input-inline">
    22. <input type="hidden" id="userid" value="${sessionScope.user.id }"/>
    23. <input type="text" id="title" autocomplete="off"
    24. class="layui-input">
    25. div>
    26. div>
    27. <div class="layui-inline">
    28. <button id="btn_meeting_search" class="layui-btn layui-btn-normal">
    29. <i class="layui-icon">i> 查询
    30. button>
    31. div>
    32. div>
    33. <table style="margin-top: -15px;" id="tb_meeting" lay-filter="tb_meeting">table>
    34. body>
    35. html>

            meetingWaiting.js

    1. let layer,form,table,$;
    2. var row;
    3. layui.use(['layer','form','table'],function(){
    4. layer=layui.layer,form=layui.form,table=layui.table,$=layui.jquery;
    5. //初始化会议列表
    6. initMeeting();
    7. //绑定查询按钮的点击事件
    8. $('#btn_meeting_search').click(function(){
    9. query();
    10. });
    11. });
    12. //1.初始化会议列表
    13. function initMeeting(){
    14. table.render({ //执行渲染
    15. elem: '#tb_meeting', //指定原始表格元素选择器(推荐id选择器)
    16. height: 400, //自定义高度
    17. loading: false, //是否显示加载条(默认 true)
    18. cols: [[ //设置表头
    19. {field: 'title', title: '会议标题', width: 180},
    20. {field: 'location', title: '会议地点', width: 120},
    21. {field: 'startTime', title: '开始时间', width: 180},
    22. {field: 'endTime', title: '结束时间', width: 180},
    23. {field: 'meetingstate', title: '会议状态', width: 90},
    24. {field: 'auditorname', title: '主持人', width: 120},
    25. //{field: '', title: '操作', width: 260, toolbar: '#tbMeeting'}
    26. ]]
    27. });
    28. }
    29. //2.待开会议
    30. function query(){
    31. table.reload('tb_meeting', {
    32. url: 'info.action', //请求地址
    33. method: 'POST', //请求方式,GET或者POST
    34. loading: true, //是否显示加载条(默认 true)
    35. page: true, //是否分页
    36. where: { //设定异步数据接口的额外参数,任意设
    37. 'methodName':'queryMeetingInfoByState',
    38. 'title':$('#title').val(),
    39. 'zhuchiren':$('#userid').val(),
    40. 'state':4
    41. },
    42. request: { //自定义分页请求参数名
    43. pageName: 'page', //页码的参数名称,默认:page
    44. limitName: 'rows' //每页数据量的参数名,默认:limit
    45. },
    46. done: function (res, curr, count) {
    47. //查询完成的回调函数
    48. }
    49. });
    50. }

            meetingHistory.jsp

    1. <%@ page language="java" contentType="text/html; charset=UTF-8"
    2. pageEncoding="UTF-8"%>
    3. <%@include file="/common/header.jsp"%>
    4. html>
    5. <html>
    6. <head>
    7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    8. <script type="text/javascript" src="${pageContext.request.contextPath }/static/js/meeting/meetingHistory.js">script>
    9. head>
    10. <style>
    11. history
    12. body{
    13. margin:15px;
    14. }
    15. .layui-table-cell {height: inherit;}
    16. .layui-layer-page .layui-layer-content { overflow: visible !important;}
    17. style>
    18. <body>
    19. <div class="layui-form-item">
    20. <div class="layui-inline">
    21. <label class="layui-form-label">会议标题:label>
    22. <div class="layui-input-inline">
    23. <input type="hidden" id="userid" value="${sessionScope.user.id }"/>
    24. <input type="text" id="title" autocomplete="off"
    25. class="layui-input">
    26. div>
    27. div>
    28. <div class="layui-inline">
    29. <button id="btn_meeting_search" class="layui-btn layui-btn-normal">
    30. <i class="layui-icon">i> 查询
    31. button>
    32. div>
    33. div>
    34. <table style="margin-top: -15px;" id="tb_meeting" lay-filter="tb_meeting">table>
    35. body>
    36. html>

            meetingHistory.js

    1. let layer,form,table,$;
    2. var row;
    3. layui.use(['layer','form','table'],function(){
    4. layer=layui.layer,form=layui.form,table=layui.table,$=layui.jquery;
    5. //初始化会议列表
    6. initMeeting();
    7. //绑定查询按钮的点击事件
    8. $('#btn_meeting_search').click(function(){
    9. query();
    10. });
    11. });
    12. //1.初始化会议列表
    13. function initMeeting(){
    14. table.render({ //执行渲染
    15. elem: '#tb_meeting', //指定原始表格元素选择器(推荐id选择器)
    16. height: 400, //自定义高度
    17. loading: false, //是否显示加载条(默认 true)
    18. cols: [[ //设置表头
    19. {field: 'title', title: '会议标题', width: 180},
    20. {field: 'location', title: '会议地点', width: 120},
    21. {field: 'startTime', title: '开始时间', width: 180},
    22. {field: 'endTime', title: '结束时间', width: 180},
    23. {field: 'meetingstate', title: '会议状态', width: 90},
    24. {field: 'auditorname', title: '主持人', width: 120},
    25. //{field: '', title: '操作', width: 260, toolbar: '#tbMeeting'}
    26. ]]
    27. });
    28. }
    29. //2.待开会议
    30. function query(){
    31. table.reload('tb_meeting', {
    32. url: 'info.action', //请求地址
    33. method: 'POST', //请求方式,GET或者POST
    34. loading: true, //是否显示加载条(默认 true)
    35. page: true, //是否分页
    36. where: { //设定异步数据接口的额外参数,任意设
    37. 'methodName':'queryMeetingHistoryInfoByState',
    38. 'title':$('#title').val(),
    39. 'zhuchiren':$('#userid').val(),
    40. 'state':4
    41. },
    42. request: { //自定义分页请求参数名
    43. pageName: 'page', //页码的参数名称,默认:page
    44. limitName: 'rows' //每页数据量的参数名,默认:limit
    45. },
    46. done: function (res, curr, count) {
    47. //查询完成的回调函数
    48. console.log(res);
    49. }
    50. });
    51. }

    三、运行效果

            

     

     

     

  • 相关阅读:
    OpenCV学习笔记-环境搭建
    91. 存钱罐
    IIS短文件名泄露漏洞复现
    基于Matlab实现多个图像去噪案例(附上源码+数据集)
    Ground Truth
    sharding分片键 groovy公式带有非数字字符启动失败
    maven本地仓库同步上传到nexus远程仓库
    python使用appium打开程序后,为什么没有操作后程序就自动退出了
    服务访问质量(QoS)介绍与技术 二
    C++输入输出总结
  • 原文地址:https://blog.csdn.net/qq_62331938/article/details/126078583