- 一、会议排座
- 1、为什么会有排座功能
- 2、查找资料
- 3、配置路径
- 3、后台
- 4、前端
- 二、会议送审
集团公司的日常管理会议、人事任命会议所需 在参会人员每个人的位置都是不同的,不是随便坐的2、查找资料
我们直接通过jquery上查找相关资料,进行修改即可
第一种:
第二种:
第三种:
从上面比较,第三中比较好,将其修改
双击进入tomcat,配置
完成会议排座的sql语句:
-- 第一个参数:数据库列段 -- 第二个参数:是列段的条件 SELECt * from t_oa_user where FIND_IN_SET (id,(select CONCAt(canyuze,',',liexize,',',zhuchiren) from t_oa_meeting_info where id = 8))
dao:
// 设置会议排座图片
public int updateSeatPicById(MeetingInfo info) throws Exception {
String sql = "update t_oa_meeting_info set seatPic=? where id=?";
return super.executeUpdate(sql, info, new String[] {"seatPic","id"});
}
web:
public String updateSeatPicById(HttpServletRequest req, HttpServletResponse resp) {
try {
// 获取到图片的存放地址
String dirPath = PropertiesUtil.getValue("dirPath");
// 获取浏览器请求路径,为了保存到数据库 serverPath=upload/paizuo/
String serverPath = PropertiesUtil.getValue("serverPath");
// 随机生产一个图片名称
String fileName = UUID.randomUUID().toString().replaceAll("-", "") + ".png";
info.getSeatPic();//图片字符串
Base64ImageUtils.GenerateImage(info.getSeatPic()
.replaceAll("data:image/png;base64,", ""), dirPath+fileName);
// 将setPic中的内容改为请求地址
info.setSeatPic(serverPath + fileName);
//修改会议排座数据库图片对应的数据库列段
int rs = infodao.updateSeatPicById(info);
if(rs >0) {
ResponseUtil.writeJson(resp, R.ok(200, "会议排座成功"));
}
else {
ResponseUtil.writeJson(resp, R.error(0, "会议排座失败"));
}
} catch (Exception e) {
e.printStackTrace();
try {
ResponseUtil.writeJson(resp, R.error(0, "会议排座失败"));
} catch (Exception e1) {
e1.printStackTrace();
}
}
return null;
}
4、前端
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
会议座位安排
Mymeeting.js:
//打开会议排座对话框
function open(id){
layer.open({
type: 2, //layer提供了5种层类型。可传入的值有:0(信息框,默认)1(页面层)2(iframe层)3(加载层)4(tips层)
title: '会议排座', //对话框标题
area: ['460px', '340px'], //宽高
skin: 'layui-layer-rim', //样式类名
content: $("#ctx").val()+'/jsp/meeting/seatPic.jsp?id='+id, //弹出内容。可以传入普通的html内容,还可以指定DOM,更可以随着type的不同而不同
});
}
调用:
导入下面两个js文件,目录格式如下:
展示:
点击下载之后,图片会我们配置好的对应的文件夹里面
会议送审的效果图:
mymeeting.js:
let layer,$,table,form;
var row;
layui.use(['jquery', 'layer', 'table','form'], function(){
layer = layui.layer
,$ = layui.jquery
,table = layui.table
,form = layui.form;
//初始化数据表格
initTable();
//绑定查询按钮的点击事件
$('#btn_search').click(function(){
query();
});
initFormSelects();
//送审
$('#btn_auditor').click(function(){
$.post($("#ctx").val()+'/info.action',{
'methodName':'updateAuditorById',
'id':$('#meetingId').val(),
'auditor':$('#auditor').val()
},function(rs){
if(rs.success){
//关闭对话框
layer.closeAll();
//刷新列表
query();
}else{
layer.msg(rs.msg,{icon:5},function(){});
}
},'json');
return false;
});
});
//1.初始化数据表格
function initTable(){
table.render({ //执行渲染
elem: '#tb', //指定原始表格元素选择器(推荐id选择器)
// url: 'user.action?methodName=list', //请求地址
height: 340, //自定义高度
loading: false, //是否显示加载条(默认 true)
cols: [[ //设置表头
{field: 'id', title: '会议编号', width: 120},
{field: 'title', title: '会议标题', width: 120},
{field: 'location', title: '会议地点', width: 140},
{field: 'startTime', title: '开始时间', width: 140},
{field: 'endTime', title: '结束时间', width: 140},
{field: 'meetingstate', title: '会议状态', width: 140},
{field: 'seatPic', title: '会议排座', width: 140,templet: function(d){
console.log(d);
//得到当前行数据,并拼接成自定义模板
return '
'
}},
{field: 'auditorname', title: '审批人', width: 140},
{field: '', title: '操作', width: 220,toolbar:'#tbar'},
]]
});
//在页面中的


