• 会议OA项目之我的审批


    一、会议查询

    1.后台

    当前登录账号 是 会议信息表 中 审批人字段值
    
    • 1

    Dao:

    /	我的审批
    	public List<Map<String, Object>> myAudit(MeetingInfo info, PageBean pageBean)
    			throws SQLException, InstantiationException, IllegalAccessException {
    		String sql = getSQL();
    		//		会议标题查询
    		String title = info.getTitle();
    		if(StringUtils.isNotBlank(title)) {
    			sql +=" and a.title like '%"+title+"%'";
    		}
    //		当前登录账号 是 会议信息表 中 审批人字段值
    		sql +=" and a.auditor = "+info.getAuditor();
    //		只查询会议状态为 2 即待审核的会议
    		sql +=" and a.state = 2";
    //		排序按照降序展示
    		sql +=" order by a.id desc";
    		return super.executeQuery(sql, pageBean);
    	}
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    web
    meetingInfoAction:

    //		我的审批
    		public String myAudit(HttpServletRequest req, HttpServletResponse resp) {
    			try {
    				PageBean pageBean = new PageBean();
    				pageBean.setRequest(req);
    				List<Map<String, Object>> list = infodao.myAudit(info, pageBean);
    			//注意:Layui中数据表的格式
    				ResponseUtil.writeJson(resp, R.ok(0, "我的审批数据查询成功", pageBean.getTotal(), list));
    			} catch (Exception e) {
    				e.printStackTrace();
    				try {
    					ResponseUtil.writeJson(resp, R.error(0, "我的审批会议数据查询失败"));
    				} catch (Exception e1) {
    					e1.printStackTrace();
    				}
    
    			}
    			return null;
    		}
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19

    2.前端

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

    MyAudit.js文件:

    let layer,table,$,form;
    var row;
    layui.use(['layer','table','jquery','form'],function(){
    	layer=layui.layer,
    	table=layui.table,
    	form=layui.form,
    	$=layui.jquery;
    	
    	initTable();
    	
    	//查询事件
    	$('#btn_search').click(function(){
    		query();
    	});
    	
    });
    
    //初始化数据表格(我的审批)
    function initTable(){
    	table.render({          //执行渲染
            elem: '#tb',   //指定原始表格元素选择器(推荐id选择器)
            height: 400,         //自定义高度
            loading: false,      //是否显示加载条(默认 true)
            cols: [[             //设置表头
                {field: 'id', title: '会议编号', width: 90},
                {field: 'title', title: '会议标题', width: 120},
                {field: 'location', title: '会议地点', width: 140},
                {field: 'startTime', title: '开始时间', width: 120},
                {field: 'endTime', title: '结束时间', width: 120},
                {field: 'meetingstate', title: '会议状态', width: 120},
                {field: 'seatPic', title: '会议排座', width: 120,
                	templet: function(d){
                        if(d.seatPic==null || d.seatPic=="")
                        	return "尚未排座";
                        else
                        	return "";
                    }
                },
                {field: '', title: '操作', width: 200,toolbar:'#tbar'},
            ]]
       });
    }
    
    //点击查询
    function query(){
    	table.reload('tb', {
            url: $("#ctx").val()+'/info.action',     //请求地址
            method: 'POST',                    //请求方式,GET或者POST
            loading: true,                     //是否显示加载条(默认 true)
            page: true,                        //是否分页
            where: {                           //设定异步数据接口的额外参数,任意设
            	'methodName':'myAudit',
            	'auditor':$('#auditor').val(),
            	'title':$('#title').val(),
            },  
            request: {                         //自定义分页请求参数名
                pageName: 'page', //页码的参数名称,默认:page
                limitName: 'rows' //每页数据量的参数名,默认:limit
            },
            done: function (res, curr, count) {
            	console.log(res);
            }
       });
    	
    	//工具条事件
    	table.on('tool(tb)', function(obj){ //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
    	  row = obj.data; //获得当前行数据
    	  var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
    	  var tr = obj.tr; //获得当前行 tr 的 DOM 对象(如果有的话)
    	  console.log(row);
    	  if(layEvent === 'edit'){ //审批
    		  openLayer(row.id);
    	  } else {
    		  
    	  }
    	});
    }
    
    
    
    
    }
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84

    测试:
    我的审批点击查询可以看到未审核的信息

    在这里插入图片描述

    二、会议签字审批

    对于会议签字我们可以到网上找一些插件,通过自己的需求进行修改
    在这里插入图片描述
    而小编要的效果如下:
    在这里插入图片描述
    所以我们进行一些修改,得到如下:
    在这里插入图片描述
    注:在找到插件之后,我们还要其css、js文件导入我们的项目中,否则其样式出不来

    我们需要一个新的表
    在这里插入图片描述

    实体类:

    package com.zking.entity;
    
    import java.io.Serializable;
    import java.util.Date;
    //对应审批表t_oa_meeting_aduit
    public class MeetingAudit implements Serializable {
    	private Integer id;
    	private Long meetingId;
    	private String auditor;
    	private String sign;
    	private Date createdate;
    	public Integer getId() {
    		return id;
    	}
    	public void setId(Integer id) {
    		this.id = id;
    	}
    	public Long getMeetingId() {
    		return meetingId;
    	}
    	public void setMeetingId(Long meetingId) {
    		this.meetingId = meetingId;
    	}
    	public String getAuditor() {
    		return auditor;
    	}
    	public void setAuditor(String auditor) {
    		this.auditor = auditor;
    	}
    	public String getSign() {
    		return sign;
    	}
    	public void setSign(String sign) {
    		this.sign = sign;
    	}
    	public Date getCreatedate() {
    		return createdate;
    	}
    	public void setCreatedate(Date createdate) {
    		this.createdate = createdate;
    	}
    	public MeetingAudit() {
    		super();
    		// TODO Auto-generated constructor stub
    	}
    	@Override
    	public String toString() {
    		return "MeetingAudit [id=" + id + ", meetingId=" + meetingId + ", auditor=" + auditor + ", sign=" + sign
    				+ ", createdate=" + createdate + "]";
    	}
    	
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52

    MeetingAuditDao:
    我们用到批处理

    package com.zking.dao;
    
    import com.zking.entity.MeetingAudit;
    import com.zking.util.BaseDao;
    import com.zking.util.StringUtils;
    
    public class MeetingAuditDao extends BaseDao<MeetingAudit>{
    
    	/**
    	 * 1、将图片的字符串转成图片保存起来
    	 * 2、将审批人的意见数据入库t_oa_meeting_audit
    	 * 3、修改会议状态t_oa_meeting_info
    	 */
    //	批处理(同时处理两个sql语句)
    	public int add(MeetingAudit aduit) {
    //		2、将审批人的意见数据入库t_oa_meeting_audit
    		String sql1 ="insert into t_oa_meeting_audit(meetingId,auditor,sign)"
    				+ "values("+aduit.getMeetingId()+","+aduit.getAuditor()+",'"+aduit.getSign()+"')";
    //		state状态有两种,审批 通过 即 待开4,审批  驳回 即 驳回 状态3
    		boolean flag = StringUtils.isNotBlank(aduit.getSign());
    		int state = flag ? 4 : 3;
    		//修改会议状态t_oa_meeting_info
    		String sql2 = "update t_oa_meeting_info set state="+state+" where id="+aduit.getMeetingId();
    //		同时执行多个sql语句,其目的在于事务的一致性,要么同时成功,要么同时失败
    		return super.executeUpdateBatch(new String[] {sql1,sql2});
    	}
    	
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29

    web
    meetingAuditAction:

    public class MeetingAuditAction extends ActionSupport implements ModelDriver<MeetingAudit>{
    
    	private MeetingAudit aduit = new MeetingAudit();
    	private MeetingAuditDao auditdao = new MeetingAuditDao();
    	
    	@Override
    	public MeetingAudit getModel() {
    //		注册一个转换器
    		ConvertUtils.register(new MyDateConverter(), Date.class);
    		return aduit;
    	}
    	
    	public String add(HttpServletRequest req, HttpServletResponse resp) {
    		try {
    			/**
    			 * 1、将图片的字符串转成图片保存起来
    			 * 2、将审批人的意见数据入库t_oa_meeting_audit
    			 * 3、修改会议状态t_oa_meeting_info
    			 */
    			
    			if(StringUtils.isNotBlank(aduit.getSign())) {
    //				dirPathSign=E:/temp/images/T280/sign/
    //				serverPathSign=/upload/sign/
    				
    //				拿到会议签字图片的存放地址
    				String dirPath = PropertiesUtil.getValue("dirPathSign");
    //				存储到数据库中地址,即浏览器访问地址
    				String serverPath = PropertiesUtil.getValue("serverPathSign");
    //				最终生产的图片名(原图)
    				String fileName1 = UUID.randomUUID().toString().replaceAll("-", "") + ".png";
    //				裁剪后的图片名
    				String fileName2 = UUID.randomUUID().toString().replaceAll("-", "") + ".png";
    //				生成签字图片
    				Base64ImageUtils.GenerateImage(aduit.getSign()
    						.replaceAll("data:image/png;base64,", ""), dirPath+fileName1);
    //				将原图进行裁剪
    				ImageUtils.shearImg(dirPath+fileName1, dirPath+fileName2);
    //				删除掉原图
    				File file = new File(dirPath+fileName1);
    				if(file.exists())
    					file.delete();
    				aduit.setSign(serverPath + fileName2);
    			}
    //				rs是sql语句执行的影响行数
    			int rs = auditdao.add(aduit);
    			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;
    	}
    
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65

    配置我们的xml
    在这里插入图片描述
    选中的是会议签字图片下载的路径
    在这里插入图片描述


    前端:
    当我们点击审批按钮时,会弹出审批界面
    在这里插入图片描述

    审批界面:
    addMeetingAudit:

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    	pageEncoding="UTF-8"%>
    <%@include file="/common/head.jsp"%>
    DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/static/js/plugins/sign/css/www.jsdaima.com.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/static/js/plugins/sign/font/iconfont.css">
    <script type="text/javascript" src="${pageContext.request.contextPath }/static/js/meeting/addMeetingAudit.js">script>
    <%-- <script type="text/javascript" src="${pageContext.request.contextPath }/static/js/jquery-3.3.1.min.js">script> --%>
    <%-- <script type="text/javascript" src="${pageContext.request.contextPath }/static/js/plugins/sign/index.js">script>  --%>
    <title>发布会议title>
    head>
    <style>
    body{
    	margin:5px;
    }
    style>
    <body>
    <div style="padding:10px 20px 10px 10px;">
        <form class="layui-form layui-form-pane" lay-filter="audit">
      		<input type="hidden" id="id" name="id"/>
      		<input type="hidden" id="auditor" value="${sessionScope.user.id }"/>
            <div class="layui-form-item">
                <label class="layui-form-label">会议标题label>
                <div class="layui-input-block">
                   <input type="text" name="title" autocomplete="off" class="layui-input" readonly="readonly">
                div>
            div>
            <div class="layui-form-item layui-form-text">
    		    <label class="layui-form-label">会议内容label>
    		    <div class="layui-input-block">
    		      <textarea placeholder="请输入内容" name="content" class="layui-textarea" readonly="readonly">textarea>
    		    div>
    		div>
    		
    		    
    		    
    		    	<div class="canvasBox">
    					<div class="contro">
    						<ul class="drawType">				
    							<li data-name="pen" data-nameNum="0">
    								<span class="icon iconfont icon-qianbi">span>
    								<span class="iconAlert">铅笔span>
    							li>		
    							<li class="downLoad">					
    								<span class="icon iconfont icon-baocun">span>
    								<span class="iconAlert">保存span>
    								<img src="" alt="" class="downImg">
    							li>						
    							<li data-name="eraser"  >
    								<span class="icon iconfont icon-xiangpi">span>
    								<span class="iconAlert">橡皮span>
    							li>	 
    							<li class="remote">
    								<span class="icon iconfont icon-delete">span>
    								<span class="iconAlert">清空span>
    							li>				
    						ul>			
    					div>	
    					<div class="canvasDraw">
    						<div class="drawFont" data-type="hide">
    							<span class="intoFont">span>
    							<input type="text" class="intoFontInput">
    						div>
    						<canvas id="canvas" width="550" height="150">canvas>			
    					div>		
    				div>
    		  
        form>
    div>
    body>
    html>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75

    addMeetingAudit.js文件:

    let layer,table,$,form;
    var row;
    layui.use(['layer','table','jquery','form'],function(){
    	layer=layui.layer,
    	table=layui.table,
    	form=layui.form,
    	$=layui.jquery;
    	
    	if(parent.row!=null){
    		form.val('audit',$.extend({}, parent.row||{}));
    	}
    	
    	
    	init();
    	function init() {
    		$('.strokeColorBox').css('border',"4px solid "+$('.strokeColor').val()).find('.icon').css('color',$('.strokeColor').val());
    		$('.weightBox .icon').html($('.weight').val()+'px');
    		$('.drawFont').css({
    			'height': $('.font_box_size').val()
    		})
    	}
    	/**
    	 * 右键按下不显示浏览器自带框
    	 */
    	$('#canvas').get(0).oncontextmenu = function (e) { 
    		showMyselfBox(e);
    		return false;
    	}; 
    
    	/**
    	 * 显示自定义框
    	 */
    	function showMyselfBox (e) {
    		var left = e.offsetX;
    		var top = e.offsetY;
    		$('.myselfBox').css({
    			left: left,
    			top: top
    		}).show();
    	}
    
    	/**
    	 * 鼠标滑过工具台
    	 */
    	
    	$('.contro li').on('mouseover', function () {
    		$(this).on('mouseout', function () {
    			$('.contro li').find('.iconAlert').hide()
    		});
    		$(this).find('.iconAlert').show();
    	});
    
    	/**
    	 * 点击工具台
    	*/
    
    	$('.drawType li').on('click touchstart', function (e) {
    		if (e.type == "touchstart") {
    			e.preventDefault();
    		}
    		$(this).addClass('drawTypeChoose').siblings().removeClass('drawTypeChoose');
    		initData.drawType = $(this).attr('data-name');
    		initData.drayTypeNum= $(this).attr('data-nameNum')
    	})
    
    
    	/**
    	 * 改变线条颜色
    	*/
    	$('.strokeColor').on('change', function (e) {
    		initData.color = $(this).val();
    		$('.strokeColorBox').css('border','4px solid '+initData.color).find('.icon').css('color',initData.color);
    	})
    
    	/**
    	 * 改变背景色
    	*/
    	$('.backgroundColor').on('change', function (e) {
    		initData.background = $(this).val();
    		$('.backgroundColor').css('border','4px solid '+initData.background).find('.icon').css('color',initData.background);
    	})
    	$('.fillDraw').on('click touchstart',function (e) {
    		if (e.type == "touchstart") {
    			e.preventDefault()
    		}
    		if ($(this).attr('data-choose') == 'false') {
    			$(this).attr('data-choose','true').addClass('fillBg');
    			$('.backgroundColorBox').css({'border':'4px solid '+initData.background,'background':'#fff'}).find('.icon').css('color',initData.background);
    			$('.backgroundColor').show();
    			initData.isFill = true;
    		} else {
    			initData.isFill = false;
    			$(this).attr('data-choose','false').removeClass('fillBg');
    			$('.backgroundColor').hide();
    			$('.backgroundColorBox').css({'border':'4px solid #07133d','background':'#07133d'}).find('.icon').css('color','#666');
    		}
    	})
    
    	/**
    	 * 改变线条粗细
    	*/
    
    	$('.weight').on('change', function () {
    		initData.size = $(this).val();
    		$('.weightBox .icon').html($('.weight').val()+'px');
    	})
    
    
    	/**
    	 * 绘制还是移动
    	*/
    	$('.drawOrMove').on('click touchstart',function (e) {
    		if (e.type == "touchstart") {
    			e.preventDefault()
    		}
    		$(this).addClass('drawOrmoveChoose').siblings('.drawOrMove').removeClass('drawOrmoveChoose');
    		if ($(this).attr('data-name') == 'move') {
    			// if (initData.drawType == 'line' || initData.drawType == 'pen' || initData.drawType == 'line' || initData.drawType == 'signet' || initData.drawType == 'eraser') {
    			// 	alert('')
    			// }
    			$('.maskLi').show();
    			initData.drawOrMove = $(this).attr('data-name');
    			$('#canvas').css('cursor','move');
    		} else {
    			initData.drawOrMove = $(this).attr('data-name');
    			$('.maskLi').hide();
    			$('#canvas').css('cursor','crosshair');
    		}
    	})
    
    	/**
    	 * 绘制文字
    	*/
    
    	$('.intoFontInput').on('input', function () {
    		$('.intoFont').html($(this).val());
    		initData.context = $(this).val();
    	})
    	$('.font_box_size').on('change',function () {
    		initData.fontSize = $(this).val();
    	})
    
    	/**
    	 * 清除画布
    	*/
    
    	$('.remote').on('mousedown touchstart',function (e) {
    		if (e.type == "touchstart") {
    			e.preventDefault()
    		}
    		initData.context2d.clearRect(0,0,initData.canvasWidth,initData.canvasHeight);
    		initData.drawHistoryArrData = [];
    		initData.drawHistoryArrData.length = 0;
    	})
    
    	/**
    	 * 保存图片
    	*/
    	$('.downLoad').on('mousedown touchstart',function (a) {
    		//debugger;
    		save();
    		
    	})
    	
    	
    	
    
    	/**
    	 * 鼠标在canvas按下
    	*/
    	$('#canvas').on('mousedown touchstart',function (e) {
    		if (e.type == "touchstart") {
    			e.preventDefault()
    		}
    		if (e.button == '0' || e.type == "touchstart") { // 判断是左键按下
    			$('.myselfBox').hide();
    			initData.mouseDown(e);
    			$(this).on('mousemove touchmove', function (e) {
    				if (e.type == "touchmove") {
    					e.preventDefault()
    				}
    				initData.mouseMove(e);
    			})
    		}
    	})
    
    
    	/**
    	 * 鼠标抬起
    	*/
    	$('html').on('mouseup touchend',function(){
    	    initData.mouseUp();
    	})
    
    	var initData= {
    		drawHistoryArrData: [], // 存放所有绘制图形的数据
    		context2d: $('#canvas').get(0).getContext('2d'), // canvas绘图2d环境
    		canvasWidth: $('#canvas').width(),
    		canvasHeight: $('#canvas').height(),
    		relPosX: 0, // 鼠标在绘制图形中按下相对该图形左面的距离
    		relPosY: 0, // 鼠标在绘制图形中按下相对该图形上面的距离
    		relPosToX: 0, // 鼠标在绘制图形中按下相对该图形左面的距离
    		relPosToY: 0, 
    		initLeft: 0,
    		initTop: 0,
    		chooseIndex: 0, // 选中图形在drawHistoryArrData数据中的index
    		drawOrMove: 'draw', // 当前模式是拖拽还是绘制
    		isMove: false, // 是否可以拖拽
    		drawType: 'pen', // 绘制图形的类型
    		drawTypeNum: '1', // 用于区分同一图形不同形状
    		size: 2, // 绘制的粗细
    		fontSize: $('.font_box_size').val(),
    		context:'',
    		color: $('.strokeColor').val(), // 绘制颜色
    		isFill: false, // 是否填充
    		background: $('.backgroundColor').val(),
    		msgArr:[], // 画笔信息
    		/**
    		 * 矩形绘制轨迹
    		*/
    		drawTypeArr: function (arr,j) {
    			var drawTypeFn = { // 绘制方法
    				rect: function () { // 矩形
    					initData.context2d.beginPath();
    					initData.context2d.lineWidth = arr[j].size;
    					initData.context2d.strokeStyle = arr[j].color;
    					initData.context2d.rect(arr[j].x, arr[j].y, arr[j].w,arr[j].h);
    					if (arr[j].fill) {
    						initData.context2d.fillStyle = arr[j].fill;
    						initData.context2d.fill();
    					}
    					initData.context2d.stroke();
    				},
    				line: function () { // 线
    					initData.context2d.beginPath();
    					initData.context2d.moveTo (arr[j].x,arr[j].y);       //设置起点状态
    					initData.context2d.lineTo (arr[j].toX,arr[j].toY);       //设置末端状态
    					initData.context2d.lineWidth = arr[j].size;          //设置线宽状态
    					initData.context2d.strokeStyle = arr[j].color;  //设置线的颜色状态
    					initData.context2d.stroke(); 
    				},
    				circle: function () { // 圆
    					initData.context2d.beginPath();
    					initData.context2d.lineWidth = arr[j].size;          //设置线宽状态
    					initData.context2d.strokeStyle = arr[j].color;
    					initData.context2d.arc(arr[j].x,arr[j].y,arr[j].r,0,2*Math.PI);
    					if (arr[j].fill) {
    						initData.context2d.fillStyle = arr[j].fill;
    						initData.context2d.fill();
    					}
    					initData.context2d.stroke()
    				},
    				delta: function () { // 三角
    					var w = arr[j].toX-arr[j].x;
    					var h = arr[j].toY-arr[j].y;
    					var harfDis = Math.tan(30/2)*h ;
    					if (arr[j].toX-arr[j].x>0) {
    						harfDis = harfDis
    					} else {
    						harfDis = -harfDis
    					}
    					initData.context2d.beginPath();
    					initData.context2d.moveTo (arr[j].x,arr[j].y);       //设置起点状态
    					initData.context2d.lineTo (arr[j].toX,arr[j].toY);
    					initData.context2d.lineTo (arr[j].toX + 2*harfDis,arr[j].toY);
    					initData.context2d.lineTo (arr[j].x,arr[j].y);       //设置末端状态
    					initData.context2d.lineWidth = arr[j].size;          //设置线宽状态
    					initData.context2d.strokeStyle = arr[j].color;  //设置线的颜色状态
    					if (arr[j].fill) {
    						initData.context2d.fillStyle = arr[j].fill;
    						initData.context2d.fill();
    					}
    					initData.context2d.stroke(); 
    				},
    				ellipse: function () {
    					initData.context2d.beginPath();
    					initData.context2d.lineWidth = arr[j].size;          //设置线宽状态
    					initData.context2d.strokeStyle = arr[j].color;
    					initData.context2d.ellipse(arr[j].x,arr[j].y,Math.abs(arr[j].toX - arr[j].x),Math.abs(arr[j].toY -arr[j].y),0,0,Math.PI*2); 
    					if (arr[j].fill) {
    						initData.context2d.fillStyle = arr[j].fill;
    						initData.context2d.fill();
    					}
    		            initData.context2d.stroke();
    				},
    				polygon: function () {
    					var y1 = (arr[j].toY-arr[j].y)/2;
    					var tan = Math.tan((90-(arr[j].reg/2))*(2*Math.PI/360));
    					var x1 = y1*tan;
    					initData.context2d.beginPath();
    					initData.context2d.moveTo (arr[j].x,arr[j].y);       //设置起点状态
    
    					initData.context2d.lineTo (arr[j].toX,arr[j].y);
    
    					initData.context2d.lineTo (arr[j].toX+x1,arr[j].y+y1);
    
    					initData.context2d.lineTo (arr[j].toX,arr[j].toY);       //设置末端状态
    
    					initData.context2d.lineTo (arr[j].x,arr[j].toY); 
    
    					initData.context2d.lineTo (arr[j].x-x1,arr[j].y+y1); 
    
    					initData.context2d.lineTo (arr[j].x,arr[j].y); 
    					initData.context2d.lineWidth = arr[j].size;          //设置线宽状态
    					initData.context2d.strokeStyle = arr[j].color;  //设置线的颜色状态
    					if (arr[j].fill) {
    						initData.context2d.fillStyle = arr[j].fill;
    						initData.context2d.fill();
    					}
    					initData.context2d.stroke(); 
    				},
    				font: function () {
    					// initData.context2d.beginPath();
    					initData.context2d.font = arr[j].fontSize+'px  Verdana';
    					initData.context2d.textAlign = 'center';
    					initData.context2d.textBaseline = 'bottom';
    					initData.context2d.fillStyle = arr[j].color;
    					// if (arr[j].fill) {
    					initData.context2d.fillText(arr[j].context, arr[j].x, arr[j].y); 
    					// }
    					// initData.context2d.strokeText(arr[j].context, arr[j].x, arr[j].y);
    					// initData.context2d.lineWidth = 1;
    					// initData.context2d.strokeStyle = 'transparent';
    					// initData.context2d.rect(arr[j].x, arr[j].y, arr[j].w,arr[j].h);
    					// initData.context2d.stroke();
    					$('.drawFont').hide();
    					// initData.context = ""
    					$('.intoFont').html('');
    					$('.intoFontInput').val('');
    					$('.drawFont').attr('data-type','hide');
    				},
    				signet: function () {
    					var img = new Image();
    					img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAHGCAMAAAC1uokeAAAC+lBMVEUAAAD1rhv1uh31uh31rhv1rhv1rhv1rhv1rhv1sRv1rhv1uR31rhv1rhv1rhv1rhv1rhv1rhv1wR/1rhv1rhv1rhv1rhv1rhv1rhv0yyH1rhv1rhv1rhv1rhv1rhv1rhv1rhv1rhv1rhv1rhv1rhvz3CX1rhv1rhv1rhv1rhv1rhv1rhv1rhv1rhvz3CX1rhv1rhvz3CX1rhv1rhv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kTYS1000bIvq7il5YUSI0COKOt1YnkSC4H32kh1Ad3WraEAmIJLpzLrz16AG0gW5Uon0eKLmlqAtMCC2u4ak2o5/2IFqoGziEsR9VTgTVxGpxaQtPKhUWw3lyODzMG+1iv9vq9XrnSplPhe3FUCdYvgKoLp6WFjy2ewAAAABJRU5ErkJggg==';
    					img.onload = function(){
    						initData.context2d.drawImage(img, arr[j].x-50, arr[j].y-50,100,100);
    					}
    				},
    				pen: function () {
    					var lineWidth = arr[j].size;
    					var radius=lineWidth/2;
    					var lineColor =arr[j].color;
    					initData.context2d.beginPath();
    					$.each(arr[j].msgArr,function (index,val) {
    		            	initData.context2d.lineWidth= lineWidth; 
    		                initData.context2d.lineTo(val.x, val.y);  
    		                initData.context2d.strokeStyle = lineColor;
    		                initData.context2d.stroke();  
    		                initData.context2d.beginPath();  
    		                initData.context2d.arc(val.x, val.y, radius, 0, 360, false);
    		                initData.context2d.fillStyle = lineColor;
    		                initData.context2d.fill();  
    		                initData.context2d.beginPath();  
    		                initData.context2d.moveTo(val.x, val.y);  
    		                initData.context2d.stroke(); 
    					})
    				},
    				eraser: function () {
    					$.each(arr[j].msgArr,function (index,val) {
    		            	initData.context2d.clearRect(val.x,val.y,arr[j].size,arr[j].size);
    					})
    				}
    			};
    			switch (arr[j].drawType) {
    				case 'rect':drawTypeFn.rect(); break;
    				case 'line':drawTypeFn.line(); break;
    				case 'circle':drawTypeFn.circle(); break;
    				case 'delta':drawTypeFn.delta(); break;
    				case 'ellipse':drawTypeFn.ellipse(); break;
    				case 'polygon': drawTypeFn.polygon(); break;
    				case 'font': drawTypeFn.font(); break;
    				case 'signet': drawTypeFn.signet(); break;
    				case 'pen': drawTypeFn.pen(); break;
    				case 'eraser': drawTypeFn.eraser(); break;
    			}
    
    		},
    
    		/**
    		 * 统一绘制方法
    		*/
    		drawArr: function (arr) {
    			for (var j in arr) {
    				this.drawTypeArr(arr,j)
    			}
    		},
    
    	
    		/**
    		 * 鼠标按下执行
    		*/
    		mouseDown: function (e) { // 鼠标按下
    			initData.initLeft = e.offsetX?e.offsetX:e.originalEvent.targetTouches[0].pageX - $('#canvas').offset().left;//获取鼠标起始位置
    			initData.initTop = e.offsetY?e.offsetY:e.originalEvent.targetTouches[0].pageY - $('#canvas').offset().top;	
    			initData.msgArr = [];
    			if (initData.drawHistoryArrData.length>0) {
    				function getChooseIndex() {
    					for(var i in initData.drawHistoryArrData) {
    		    			initData.drawArr([initData.drawHistoryArrData[i]]);
    		    			if (initData.drawOrMove == 'move') {
    		    				if(initData.context2d.isPointInPath(initData.initLeft,initData.initTop)) {
    				    			initData.drawArr(initData.drawHistoryArrData);
    				    			initData.relPosX = initData.initLeft - initData.drawHistoryArrData[i].x;
    				    			initData.relPosY = initData.initTop - initData.drawHistoryArrData[i].y;
    				    			initData.relPosToX = initData.initLeft - initData.drawHistoryArrData[i].toX;
    				    			initData.relPosToY = initData.initTop - initData.drawHistoryArrData[i].toY;
    				    			initData.isMove = true;
    				    			return i; 
    				    		} 
    		    			}
    			    	}
    			    	if (initData.drawOrMove == 'move') {
    			    		return -1;
    			    	} else {
    			    		return initData.drawHistoryArrData.length;
    			    	}
    			    	
    				}
    				initData.chooseIndex = getChooseIndex();
    			} else {
    				if (initData.drawOrMove == 'move') {
    			    	initData.chooseIndex =  -1;
    			    } 
    			}
    			if ($('.drawFont').attr('data-type') == 'hide') {
    				if (this.drawType == 'font') {
    					var x = initData.initLeft;
    					var y = initData.initTop;
    					$('.drawFont').attr('data-type','show');
    					$('.drawFont').css({
    						'left':initData.initLeft+"px",
    						'top':initData.initTop+"px"
    					}).show();
    					$('.intoFontInput').on('blur', function () {
    						initData.context = $('.intoFontInput').val();
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.isFill?initData.background:'',
    							size: initData.size,
    							fontSize: initData.fontSize,
    							context:initData.context,
    							color: initData.color,
    							x: x,
    							y: y,
    							w: $('.intoFontInput').width(),
    							h: $('.intoFontInput').height()
    						};
    						initData.drawArr(initData.drawHistoryArrData);
    					})
    				}
    			}
    			if (this.drawType == 'signet') {
    				initData.drawHistoryArrData[initData.chooseIndex] = {
    					drawType: initData.drawType,
    					drawTypeNum: initData.drawTypeNum,
    					fill: initData.isFill?initData.background:'',
    					size: initData.size,
    					color: initData.color,
    					x: initData.initLeft,
    					y: initData.initTop
    				};
    				initData.drawArr(initData.drawHistoryArrData);
    			}
    		}, 
    
    		/**
    		 * 鼠标移动执行
    		*/
    		mouseMove: function (e) { // 鼠标移动
    			initData.context2d.clearRect(0,0,initData.canvasWidth,initData.canvasHeight);
    			var moveX = e.offsetX?e.offsetX:e.originalEvent.targetTouches[0].pageX - $('#canvas').offset().left;
    			var moveY = e.offsetY?e.offsetY:e.originalEvent.targetTouches[0].pageY - $('#canvas').offset().top;
    			var moveWidth = moveX - initData.initLeft;
    			var moveHeight = moveY - initData.initTop;
    			if (initData.isMove) {
    				switch (initData.drawHistoryArrData[initData.chooseIndex].drawType) {
    					case 'rect':
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawHistoryArrData[initData.chooseIndex].drawType,
    							drawTypeNum: initData.drawHistoryArrData[initData.chooseIndex].drawTypeNum,
    							fill: initData.drawHistoryArrData[initData.chooseIndex].fill,
    							size: initData.drawHistoryArrData[initData.chooseIndex].size,
    							color: initData.drawHistoryArrData[initData.chooseIndex].color,
    							x: moveWidth + initData.initLeft  - initData.relPosX,
    							y: moveHeight + initData.initTop - initData.relPosY,
    							w: initData.drawHistoryArrData[initData.chooseIndex].w,
    							h: initData.drawHistoryArrData[initData.chooseIndex].h
    						}; break;
    					case 'line':
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawHistoryArrData[initData.chooseIndex].drawType,
    							drawTypeNum: initData.drawHistoryArrData[initData.chooseIndex].drawTypeNum,
    							fill: initData.drawHistoryArrData[initData.chooseIndex].fill,
    							size: initData.drawHistoryArrData[initData.chooseIndex].size,
    							color: initData.drawHistoryArrData[initData.chooseIndex].color,
    							x: initData.drawHistoryArrData[initData.chooseIndex].x+moveX,
    							y: initData.drawHistoryArrData[initData.chooseIndex].y +moveY,
    							toX: moveX,
    							toY: moveY
    						}; break;
    					case 'circle':
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawHistoryArrData[initData.chooseIndex].drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.drawHistoryArrData[initData.chooseIndex].fill,
    							size: initData.size,
    							color: initData.color,
    							x: moveWidth + initData.initLeft  - initData.relPosX,
    							y: moveHeight + initData.initTop - initData.relPosY,
    							r: initData.drawHistoryArrData[initData.chooseIndex].r,
    						}; break;
    					case 'delta':
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawHistoryArrData[initData.chooseIndex].drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.drawHistoryArrData[initData.chooseIndex].fill,
    							size: initData.size,
    							color: initData.color,
    							x: moveWidth + initData.initLeft  - initData.relPosX,
    							y: moveHeight + initData.initTop - initData.relPosY,
    							toX: moveWidth + initData.initLeft  - initData.relPosToX,
    							toY: moveHeight + initData.initTop - initData.relPosToY,
    						}; break;
    					case 'ellipse':
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawHistoryArrData[initData.chooseIndex].drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.drawHistoryArrData[initData.chooseIndex].fill,
    							size: initData.size,
    							color: initData.color,
    							x: moveWidth + initData.initLeft  - initData.relPosX,
    							y: moveHeight + initData.initTop - initData.relPosY,
    							toX: moveWidth + initData.initLeft  - initData.relPosToX,
    							toY: moveHeight + initData.initTop - initData.relPosToY,
    						}; break;
    					case 'polygon':// 六边形
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawHistoryArrData[initData.chooseIndex].drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.drawHistoryArrData[initData.chooseIndex].fill,
    							size: initData.size,
    							color: initData.color,
    							x: moveWidth + initData.initLeft  - initData.relPosX,
    							y: moveHeight + initData.initTop - initData.relPosY,
    							reg: initData.drawHistoryArrData[initData.chooseIndex].reg,
    							toX: moveWidth + initData.initLeft  - initData.relPosToX,
    							toY: moveHeight + initData.initTop - initData.relPosToY
    						}; break;
    				}
    			} else {
    				if (initData.chooseIndex != -1) {
    
    					switch (this.drawType) {
    					case 'rect': // 矩形
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.isFill?initData.background:'',
    							size: initData.size,
    							color: initData.color,
    							x: initData.initLeft,
    							y: initData.initTop,
    							w: moveWidth,
    							h: moveHeight
    						}; break;
    					case 'line': // 线
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.isFill?initData.background:'',
    							size: initData.size,
    							color: initData.color,
    							x: initData.initLeft,
    							y: initData.initTop,
    							toX: moveX,
    							toY: moveY
    						}; break;
    					case 'circle': //圆
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.isFill?initData.background:'',
    							size: initData.size,
    							color: initData.color,
    							x: initData.initLeft,
    							y: initData.initTop,
    							r: Math.sqrt(moveWidth*moveWidth+moveHeight*moveHeight)
    						}; break;
    					case 'delta': // 三角
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.isFill?initData.background:'',
    							size: initData.size,
    							color: initData.color,
    							x: initData.initLeft,
    							y: initData.initTop,
    							toX: moveX,
    							toY: moveY,
    						}; break;
    					case 'ellipse': // 椭圆
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.isFill?initData.background:'',
    							size: initData.size,
    							color: initData.color,
    							x: initData.initLeft,
    							y: initData.initTop,
    							toX: moveX,
    							toY: moveY,
    						}; break;
    					case 'polygon':// 六边形
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.isFill?initData.background:'',
    							size: initData.size,
    							color: initData.color,
    							x: initData.initLeft,
    							y: initData.initTop,
    							reg: $('.polygon_1_deg').val(),
    							toX: moveX,
    							toY: moveY,
    						}; break;
    					case 'pen':
    						initData.msgArr.push({
    							x: moveX,
    							y: moveY
    						})
    						var msg = initData.msgArr.concat();
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.isFill?initData.background:'',
    							size: initData.size,
    							color: initData.color,
    							x: initData.initLeft,
    							y: initData.initTop,
    							toX: moveX,
    							toY: moveY,
    							msgArr:msg
    						}; break;
    					case 'eraser': 
    						initData.msgArr.push({
    							x: moveX,
    							y: moveY
    						})
    						var msg = initData.msgArr.concat();
    						initData.drawHistoryArrData[initData.chooseIndex] = {
    							drawType: initData.drawType,
    							drawTypeNum: initData.drawTypeNum,
    							fill: initData.isFill?initData.background:'',
    							size: initData.size,
    							color: initData.color,
    							x: initData.initLeft,
    							y: initData.initTop,
    							toX: moveX,
    							toY: moveY,
    							msgArr:msg
    						}; break;
    					// case 'signet': // 印章
    					// 	initData.drawHistoryArrData[initData.chooseIndex] = {
    					// 		drawType: initData.drawType,
    					// 		drawTypeNum: initData.drawTypeNum,
    					// 		fill: initData.isFill?initData.background:'',
    					// 		size: initData.size,
    					// 		color: initData.color,
    					// 		x: initData.initLeft,
    					// 		y: initData.initTop,
    					// 		toX: moveX,
    					// 		toY: moveY,
    					// 	}; break;
    					// case 'delta'
    					// case 'circle'
    					// case 'ellipse'
    					// case 'line'
    					// 
    					// case 'signet'
    					// case 'pen'
    					// case 'brush'
    					}
    				}
    			}
    			initData.drawArr(initData.drawHistoryArrData);
    		},
    
    		/**
    		 * 鼠标抬起执行
    		*/
    		mouseUp: function () {
    			initData.msgArr = [];
    			initData.isMove = false;
    			initData.relPosX = 0;
    			initData.relPosY = 0;
    			$('#canvas').off('mousemove');
    		}
    	};
    
    });
    
    function save(){
    	var mycanvas = document.getElementById("canvas");  
        var image    = mycanvas.toDataURL("image/png");  
    	let params={
    		'sign':image
    	};
    	return params;
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
    • 310
    • 311
    • 312
    • 313
    • 314
    • 315
    • 316
    • 317
    • 318
    • 319
    • 320
    • 321
    • 322
    • 323
    • 324
    • 325
    • 326
    • 327
    • 328
    • 329
    • 330
    • 331
    • 332
    • 333
    • 334
    • 335
    • 336
    • 337
    • 338
    • 339
    • 340
    • 341
    • 342
    • 343
    • 344
    • 345
    • 346
    • 347
    • 348
    • 349
    • 350
    • 351
    • 352
    • 353
    • 354
    • 355
    • 356
    • 357
    • 358
    • 359
    • 360
    • 361
    • 362
    • 363
    • 364
    • 365
    • 366
    • 367
    • 368
    • 369
    • 370
    • 371
    • 372
    • 373
    • 374
    • 375
    • 376
    • 377
    • 378
    • 379
    • 380
    • 381
    • 382
    • 383
    • 384
    • 385
    • 386
    • 387
    • 388
    • 389
    • 390
    • 391
    • 392
    • 393
    • 394
    • 395
    • 396
    • 397
    • 398
    • 399
    • 400
    • 401
    • 402
    • 403
    • 404
    • 405
    • 406
    • 407
    • 408
    • 409
    • 410
    • 411
    • 412
    • 413
    • 414
    • 415
    • 416
    • 417
    • 418
    • 419
    • 420
    • 421
    • 422
    • 423
    • 424
    • 425
    • 426
    • 427
    • 428
    • 429
    • 430
    • 431
    • 432
    • 433
    • 434
    • 435
    • 436
    • 437
    • 438
    • 439
    • 440
    • 441
    • 442
    • 443
    • 444
    • 445
    • 446
    • 447
    • 448
    • 449
    • 450
    • 451
    • 452
    • 453
    • 454
    • 455
    • 456
    • 457
    • 458
    • 459
    • 460
    • 461
    • 462
    • 463
    • 464
    • 465
    • 466
    • 467
    • 468
    • 469
    • 470
    • 471
    • 472
    • 473
    • 474
    • 475
    • 476
    • 477
    • 478
    • 479
    • 480
    • 481
    • 482
    • 483
    • 484
    • 485
    • 486
    • 487
    • 488
    • 489
    • 490
    • 491
    • 492
    • 493
    • 494
    • 495
    • 496
    • 497
    • 498
    • 499
    • 500
    • 501
    • 502
    • 503
    • 504
    • 505
    • 506
    • 507
    • 508
    • 509
    • 510
    • 511
    • 512
    • 513
    • 514
    • 515
    • 516
    • 517
    • 518
    • 519
    • 520
    • 521
    • 522
    • 523
    • 524
    • 525
    • 526
    • 527
    • 528
    • 529
    • 530
    • 531
    • 532
    • 533
    • 534
    • 535
    • 536
    • 537
    • 538
    • 539
    • 540
    • 541
    • 542
    • 543
    • 544
    • 545
    • 546
    • 547
    • 548
    • 549
    • 550
    • 551
    • 552
    • 553
    • 554
    • 555
    • 556
    • 557
    • 558
    • 559
    • 560
    • 561
    • 562
    • 563
    • 564
    • 565
    • 566
    • 567
    • 568
    • 569
    • 570
    • 571
    • 572
    • 573
    • 574
    • 575
    • 576
    • 577
    • 578
    • 579
    • 580
    • 581
    • 582
    • 583
    • 584
    • 585
    • 586
    • 587
    • 588
    • 589
    • 590
    • 591
    • 592
    • 593
    • 594
    • 595
    • 596
    • 597
    • 598
    • 599
    • 600
    • 601
    • 602
    • 603
    • 604
    • 605
    • 606
    • 607
    • 608
    • 609
    • 610
    • 611
    • 612
    • 613
    • 614
    • 615
    • 616
    • 617
    • 618
    • 619
    • 620
    • 621
    • 622
    • 623
    • 624
    • 625
    • 626
    • 627
    • 628
    • 629
    • 630
    • 631
    • 632
    • 633
    • 634
    • 635
    • 636
    • 637
    • 638
    • 639
    • 640
    • 641
    • 642
    • 643
    • 644
    • 645
    • 646
    • 647
    • 648
    • 649
    • 650
    • 651
    • 652
    • 653
    • 654
    • 655
    • 656
    • 657
    • 658
    • 659
    • 660
    • 661
    • 662
    • 663
    • 664
    • 665
    • 666
    • 667
    • 668
    • 669
    • 670
    • 671
    • 672
    • 673
    • 674
    • 675
    • 676
    • 677
    • 678
    • 679
    • 680
    • 681
    • 682
    • 683
    • 684
    • 685
    • 686
    • 687
    • 688
    • 689
    • 690
    • 691
    • 692
    • 693
    • 694
    • 695
    • 696
    • 697
    • 698
    • 699
    • 700
    • 701
    • 702
    • 703
    • 704
    • 705
    • 706
    • 707
    • 708
    • 709
    • 710
    • 711

    保存图片点击事件
    在这里插入图片描述
    myAudit.js文件

    let layer,table,$,form;
    var row;
    layui.use(['layer','table','jquery','form'],function(){
    	layer=layui.layer,
    	table=layui.table,
    	form=layui.form,
    	$=layui.jquery;
    	
    	initTable();
    	
    	//查询事件
    	$('#btn_search').click(function(){
    		query();
    	});
    	
    });
    
    //初始化数据表格(我的审批)
    function initTable(){
    	table.render({          //执行渲染
            elem: '#tb',   //指定原始表格元素选择器(推荐id选择器)
            height: 400,         //自定义高度
            loading: false,      //是否显示加载条(默认 true)
            cols: [[             //设置表头
                {field: 'id', title: '会议编号', width: 90},
                {field: 'title', title: '会议标题', width: 120},
                {field: 'location', title: '会议地点', width: 140},
                {field: 'startTime', title: '开始时间', width: 120},
                {field: 'endTime', title: '结束时间', width: 120},
                {field: 'meetingstate', title: '会议状态', width: 120},
                {field: 'seatPic', title: '会议排座', width: 120,
                	templet: function(d){
                        if(d.seatPic==null || d.seatPic=="")
                        	return "尚未排座";
                        else
                        	return "";
                    }
                },
                {field: '', title: '操作', width: 200,toolbar:'#tbar'},
            ]]
       });
    }
    
    //点击查询
    function query(){
    	table.reload('tb', {
            url: $("#ctx").val()+'/info.action',     //请求地址
            method: 'POST',                    //请求方式,GET或者POST
            loading: true,                     //是否显示加载条(默认 true)
            page: true,                        //是否分页
            where: {                           //设定异步数据接口的额外参数,任意设
            	'methodName':'myAudit',
            	'auditor':$('#auditor').val(),
            	'title':$('#title').val(),
            },  
            request: {                         //自定义分页请求参数名
                pageName: 'page', //页码的参数名称,默认:page
                limitName: 'rows' //每页数据量的参数名,默认:limit
            },
            done: function (res, curr, count) {
            	console.log(res);
            }
       });
    	
    	//工具条事件
    	table.on('tool(tb)', function(obj){ //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
    	  row = obj.data; //获得当前行数据
    	  var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
    	  var tr = obj.tr; //获得当前行 tr 的 DOM 对象(如果有的话)
    	  console.log(row);
    	  if(layEvent === 'edit'){ //审批
    		  openLayer(row.id);
    	  } else {
    		  
    	  }
    	});
    }
    
    // 打开审批页面
    function openLayer(id){
        layer.open({
            type: 2,                    //layer提供了5种层类型。可传入的值有:0(信息框,默认)1(页面层)2(iframe层)3(加载层)4(tips层)
            title: '审批',                   //对话框标题
            area: ['600px', '500px'],   //宽高
            skin: 'layui-layer-rim',    //样式类名
            content: $("#ctx").val()+'/jsp/meeting/addMeetingAudit.jsp',                //弹出内容。可以传入普通的html内容,还可以指定DOM,更可以随着type的不同而不同
            btn:['审批通过','审批驳回'],
            yes:function(index,layero){
            	//layer.msg('保存');
            	//调用子页面中提供的getData方法,快速获取子页面的form表单数据
                let data= $(layero).find("iframe")[0].contentWindow.save();
                data['meetingId']=id;
                data['auditor']=$('#auditor').val();
                addMeetingAudit(data);
            },
            btn2:function(){
            	let data={};
            	data['sign']=null;
            	data['meetingId']=id;
                data['auditor']=$('#auditor').val();
                addMeetingAudit(data);
                return false;
            }
        });
    }
    
    // 添加审批意见
    function addMeetingAudit(params){
    	/**
    	 * 1、将图片的字符串转成图片保存起来
    	 * 2、将审批人的意见数据入库
    	 * 3、修改会议状态
    	 */
    	params['methodName']="add";
    	console.log(params);
    	$.post($("#ctx").val()+'/audit.action',params,function(rs){
    		if(rs.success){
    			layer.closeAll();
    			query();
    		}else{
    			layer.msg(rs.msg,{icon:5},function(){});
    		}
    	},'json');
    }
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126

    效果展示
    在这里插入图片描述
    如下图可以看到签字图片已出现在我们配置好的路径里面
    在这里插入图片描述

  • 相关阅读:
    Spring 面试题
    JAVA开发技术能力和学历哪个重要?
    Java do while循环语句如何使用呢?
    计算机未连接到互联网(win11系统)
    C语言问题解决实例1
    【前端面试必知】Vue常用的修饰符
    预测股票涨跌看什么指标,如何预测明天股票走势
    muduo源码剖析之EventLoopThread
    【华为OD机试真题 python】 分糖果II【2022 Q4 | 200分】
    Java并发编程--多线程间的同步控制和通信
  • 原文地址:https://blog.csdn.net/qq_65345936/article/details/126019631