瀏覽代碼

手写签名

lxl 2 年之前
父節點
當前提交
ba8a39943c

+ 22 - 11
EMIS.CommonLogic/Students/StudentsServices.cs

@@ -754,8 +754,10 @@ namespace EMIS.CommonLogic.Students
             UnitOfWork.Commit();
         }
 
-        public virtual void PicImport(IList<string> photoPaths)
+        public virtual DataTable PicImport(IList<string> photoPaths)
         {
+            //var errorWebPath = "";
+            var dt = new DataTable();
             var map = photoPaths
                 .Select(s => new
                 {
@@ -768,22 +770,17 @@ namespace EMIS.CommonLogic.Students
             var userIDList = StudentsDAL.Value.StudentRepository.Entities.Where(x => IDNumbers.Contains(x.IDNumber)).Select(x => x.UserID).ToList();
             var users = UserRepository.Value.GetList(w => userIDList.Contains(w.UserID), i => i.CF_Student).ToList();
             var idList = new List<string>();
+            //var importIDList = new List<>
             foreach (var idNumber in IDNumbers)
             {
                 var user = users.FirstOrDefault(w => w.CF_Student.IDNumber.Equals(idNumber, StringComparison.OrdinalIgnoreCase));
                 if (user == null)
                 {
-                    idList.Add(idNumber); 
+                    idList.Add(idNumber);
                 }
-            }
-            if (idList.Count() > 0)
-            {
-                string idstr = "";
-                for (int i = 0; i < (idList.Count() > 5 ? 5 : idList.Count()); i++)
-                {
-                    idstr += idList[i] + ",";
+                else { 
+                    
                 }
-                throw new Exception("导入照片中存在无法匹对信息,照片名字为:" + idstr.Remove(idstr.Length - 1) + "...,请检查系统是否存在对应学生。");
             }
             foreach (var m in map)
             {
@@ -796,7 +793,21 @@ namespace EMIS.CommonLogic.Students
                 
             }
             UnitOfWork.Commit();
-
+            if (idList.Count() > 0)
+            {
+                NpoiExcelHelper neh = new NpoiExcelHelper();
+                dt.Columns.Add("证件号码", Type.GetType("System.String"));
+                dt.Columns.Add("错误原因", Type.GetType("System.String"));
+                foreach (var id in idList)
+                {
+                    DataRow row = dt.NewRow();
+                    row["证件号码"] = id.ToString();
+                    row["错误原因"] = "系统不存在该学生";
+                    dt.Rows.Add(row);
+                }
+            }
+            return dt;
+            
         }
         private StudentsView[] MapToStudentsView(DataTable dataSource, List<ImportErrorRowView> errorList)
         {

+ 1 - 1
EMIS.ICommonLogic/Students/IStudentsServices.cs

@@ -58,7 +58,7 @@ namespace EMIS.CommonLogic.Students
 
         void GraduationPicImport(IList<string> photoPaths);
 
-        void PicImport(IList<string> photoPaths);
+        DataTable PicImport(IList<string> photoPaths);
 
         Sys_User GetUserByLoginID(Guid userid);
 

+ 26 - 7
EMIS.Web/Controllers/StudentManage/StudentProfile/StudentsController.cs

@@ -632,8 +632,9 @@ namespace EMIS.Web.Controllers.Students
         }
 
         [HttpGet]
-        public ActionResult PicImport()
+        public ActionResult PicImport(string errorFile)
         {
+            ViewBag.ErrorFile = errorFile;
             return View();
         }
 
@@ -672,14 +673,32 @@ namespace EMIS.Web.Controllers.Students
                     }
                 }
 
-                StudentfileServices.Value.PicImport(listphotoPaths);
+                var errorDatatable = StudentfileServices.Value.PicImport(listphotoPaths);
 
-                return RedirectToAction("MsgShow", "Common", new
+                if (errorDatatable.Rows.Count > 0) 
                 {
-                    WindowID = Request["WindowID"],
-                    msg = "导入照片成功!",
-                    url = Url.Action("List").AddMenuParameter()
-                });
+                    string filePath = Const.LOCAL_SETTING_UPLOAD_FILEPATH;
+                    var webFileName = filePath + "/" + Path.GetFileName("照片导入错误数据.xls");
+                    var sourcePhysicalPath = Server.MapPath(webFileName);
+                    var excel = new NpoiExcelHelper();
+                    excel.SaveInServer(errorDatatable, sourcePhysicalPath);
+                    var errorWebPath = webFileName.Substring(1,webFileName.Length - 1);
+                    return RedirectToAction("MsgShow", "Common", new
+                    {
+                        WindowID = "none",
+                        msg = "导入失败!",
+                        url = Url.Action("PicImport").AddMenuParameter() + "&errorFile=" + errorWebPath + "&WindowID=" + Request["WindowID"]
+                    });
+                }
+                else
+                {
+                    return RedirectToAction("MsgShow", "Common", new
+                    {
+                        WindowID = Request["WindowID"],
+                        msg = "导入照片成功!",
+                        url = Url.Action("List").AddMenuParameter()
+                    });
+                }
             }
             catch (Exception ex)
             {

+ 5 - 4
EMIS.Web/EMIS.Web.csproj

@@ -1178,6 +1178,11 @@
     <Content Include="Scripts\Bowin.Control.Core\Plugins\kindeditor\themes\qq\qq.css" />
     <Content Include="Scripts\Bowin.Control.Core\Plugins\kindeditor\themes\simple\simple.css" />
     <Content Include="Scripts\Bowin.Control.Core\Plugins\Lodop\LodopFuncs.js" />
+    <Content Include="Scripts\Bowin.Control.Core\Plugins\SignName\agree.jpg" />
+    <Content Include="Scripts\Bowin.Control.Core\Plugins\SignName\base.css" />
+    <Content Include="Scripts\Bowin.Control.Core\Plugins\SignName\layer\layer.js" />
+    <Content Include="Scripts\Bowin.Control.Core\Plugins\SignName\layer\need\layer.css" />
+    <Content Include="Scripts\Bowin.Control.Core\Plugins\SignName\online_agree.html" />
     <Content Include="Scripts\Bowin.Control.Core\Plugins\SyntaxHighlighter\shCore.js" />
     <Content Include="Scripts\Bowin.Control.Core\Plugins\SyntaxHighlighter\shCoreDefault.css" />
     <Content Include="Scripts\Bowin.Control.Core\Plugins\ueditor\CHANGELOG.TXT" />
@@ -2080,10 +2085,6 @@
     </Content>
     <Content Include="Views\Students\Edit.cshtml" />
     <Content Include="Views\Students\List.cshtml" />
-    <Content Include="Views\Test\agree.jpg" />
-    <Content Include="Views\Test\base.css" />
-    <Content Include="Views\Test\layer\layer.js" />
-    <Content Include="Views\Test\layer\need\layer.css" />
     <Content Include="Views\Test\online_agree.html" />
     <Content Include="Web.config">
       <SubType>Designer</SubType>

二進制
EMIS.Web/Scripts/Bowin.Control.Core/Plugins/SignName/agree.jpg


+ 33 - 0
EMIS.Web/Scripts/Bowin.Control.Core/Plugins/SignName/base.css

@@ -0,0 +1,33 @@
+a,abbr,acronym,address,applet,big,blockquote,body,caption,cite,code,dd,del,dfn,div,dl,dt,em,fieldset,font,form,h1,h2,h3,h4,h5,h6,html,iframe,img,input,ins,kbd,label,legend,li,object,ol,p,pre,q,s,samp,section,small,span,strike,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,ul,var{
+    margin:0;padding:0;border:0;list-style:none;text-decoration:none;-webkit-tap-highlight-color:transparent
+}
+*{
+    -webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box
+}
+input{
+    outline:0!important;-webkit-border-radius:0!important;-moz-border-radius:0!important;border-radius:0!important
+}
+i,em{
+    font-style:inherit
+}
+input[type="button"],input[type="submit"],input[type="reset"]{
+    -webkit-appearance:none
+}
+.clearfix:after{
+    display:block;clear:both;content:"";visibility:hidden;height:0
+}
+.clearfix{
+    zoom:1
+}
+body{
+    font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,\\5FAE\8F6F\96C5\9ED1,Arial,sans-serif;font-size:12px;color:#666;height:100%;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-overflow-scrolling:touch
+}
+html{
+    min-width:320px!important;margin:0 auto!important;font-size:60px!important;max-width:812px!important
+}
+.fl{
+    float:left
+}
+.fr{
+    float:right
+}

File diff suppressed because it is too large
+ 2 - 0
EMIS.Web/Scripts/Bowin.Control.Core/Plugins/SignName/layer/layer.js


+ 143 - 0
EMIS.Web/Scripts/Bowin.Control.Core/Plugins/SignName/layer/need/layer.css

@@ -0,0 +1,143 @@
+.layui-m-layer{
+    position:relative;z-index:19891014
+}
+.layui-m-layer *{
+    -webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box
+}
+.layui-m-layermain,.layui-m-layershade{
+    position:fixed;left:0;top:0;width:100%;height:100%
+}
+.layui-m-layershade{
+     background-color:rgba(0,0,0,.7);pointer-events:auto
+}
+.layui-m-layermain{
+      display:table;font-family:Helvetica,arial,sans-serif;pointer-events:none
+}
+.layui-m-layermain .layui-m-layersection{
+       display:table-cell;vertical-align:middle;text-align:center
+}
+.layui-m-layerchild{
+        position:relative;display:inline-block;text-align:left;background-color:#fff;font-size:14px;border-radius:5px;box-shadow:0 0 8px rgba(0,0,0,.1);
+        pointer-events:auto;-webkit-overflow-scrolling:touch;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.2s;animation-duration:.2s
+}
+@-webkit-keyframes layui-m-anim-scale{
+    0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}
+    100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}
+}
+@keyframes layui-m-anim-scale{
+    0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}
+    100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}
+}
+.layui-m-anim-scale{
+    animation-name:layui-m-anim-scale;-webkit-animation-name:layui-m-anim-scale
+}
+@-webkit-keyframes layui-m-anim-up{
+    0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}
+    100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}
+}
+@keyframes layui-m-anim-up{
+    0%{opacity:0;-webkit-transform:translateY(800px);transform:translateY(800px)}
+    100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}
+}
+.layui-m-anim-up{
+    -webkit-animation-name:layui-m-anim-up;animation-name:layui-m-anim-up
+}
+.layui-m-layer0 .layui-m-layerchild{
+    width:90%;max-width:640px
+}
+.layui-m-layer1 .layui-m-layerchild{
+    border:none;border-radius:0
+}
+.layui-m-layer2 .layui-m-layerchild{
+    width:auto;max-width:260px;min-width:40px;border:none;background:0 0;box-shadow:none;color:#fff
+}
+.layui-m-layerchild h3{
+    padding:0 10px;height:60px;line-height:60px;font-size:16px;font-weight:400;border-radius:5px 5px 0 0;text-align:center
+}
+.layui-m-layerbtn span,.layui-m-layerchild h3{
+    text-overflow:ellipsis;overflow:hidden;white-space:nowrap
+}
+.layui-m-layercont{
+    padding:60px 30px;line-height:22px;text-align:center;font-size: .28rem;
+}
+.layui-m-layer1 .layui-m-layercont{
+    padding:0;text-align:left
+}
+.layui-m-layer2 .layui-m-layercont{
+    text-align:center;padding:0;line-height:0
+}
+.layui-m-layer2 .layui-m-layercont i{
+    width:25px;height:25px;margin-left:8px;display:inline-block;background-color:#fff;border-radius:100%;-webkit-animation:layui-m-anim-loading 1.4s infinite ease-in-out;
+    animation:layui-m-anim-loading 1.4s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both
+}
+.layui-m-layerbtn,.layui-m-layerbtn span{
+    position:relative;text-align:center;border-radius:0 0 5px 5px
+}
+.layui-m-layer2 .layui-m-layercont p{
+    margin-top:20px
+}
+@-webkit-keyframes layui-m-anim-loading{
+    0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}
+    40%{transform:scale(1);-webkit-transform:scale(1)}
+}
+@keyframes layui-m-anim-loading{
+    0%,100%,80%{transform:scale(0);-webkit-transform:scale(0)}
+    40%{transform:scale(1);-webkit-transform:scale(1)}
+}
+.layui-m-layer2 .layui-m-layercont i:first-child{
+    margin-left:0;-webkit-animation-delay:-.32s;animation-delay:-.32s
+}
+.layui-m-layer2 .layui-m-layercont i.layui-m-layerload{
+    -webkit-animation-delay:-.16s;animation-delay:-.16s
+}
+.layui-m-layer2 .layui-m-layercont>div{
+    line-height:22px;padding-top:7px;margin-bottom:20px;font-size:14px
+}
+.layui-m-layerbtn{
+    display:box;display:-moz-box;display:-webkit-box;width:100%;height:40px;line-height:40px;font-size:0;border-top:1px solid #D0D0D0;background-color:#F2F2F2
+}
+.layui-m-layerbtn span{
+    display:block;-moz-box-flex:1;box-flex:1;-webkit-box-flex:1;font-size:.25rem;cursor:pointer
+}
+.layui-m-layerbtn span[yes]{
+    color:#40AFFE
+}
+.layui-m-layerbtn span[no]{
+    border-right:1px solid #D0D0D0;border-radius:0 0 0 5px
+}
+.layui-m-layerbtn span:active{
+    background-color:#F6F6F6
+}
+.layui-m-layerend{
+    position:absolute;right:7px;top:10px;width:30px;height:30px;border:0;font-weight:400;background:0 0;cursor:pointer;-webkit-appearance:none;font-size:30px
+}
+.layui-m-layerend::after,.layui-m-layerend::before{
+    position:absolute;left:5px;top:15px;content:'';width:18px;height:1px;background-color:#999;transform:rotate(45deg);-webkit-transform:rotate(45deg);border-radius:3px
+}
+.layui-m-layerend::after{
+    transform:rotate(-45deg);-webkit-transform:rotate(-45deg)
+}
+body .layui-m-layer .layui-m-layer-footer{
+    position:fixed;width:95%;max-width:100%;margin:0 auto;left:0;right:0;bottom:10px;background:0 0
+}
+.layui-m-layer-footer .layui-m-layercont{
+    padding:20px;border-radius:5px 5px 0 0;background-color:rgba(255,255,255,.8)
+}
+.layui-m-layer-footer .layui-m-layerbtn{
+    display:block;height:auto;background:0 0;border-top:none
+}
+.layui-m-layer-footer .layui-m-layerbtn span{
+    background-color:rgba(255,255,255,.8)
+}
+.layui-m-layer-footer .layui-m-layerbtn span[no]{
+    color:#FD482C;border-top:1px solid #c2c2c2;border-radius:0 0 5px 5px;font-size: .25rem;
+}
+.layui-m-layer-footer .layui-m-layerbtn span[yes]{
+    margin-top:10px;border-radius:5px;font-size: .25rem;
+}
+body .layui-m-layer .layui-m-layer-msg{
+    width:auto;max-width:90%;margin:0 auto;bottom:-150px;background-color:rgba(0,0,0,.7);color:#fff
+}
+.layui-m-layer-msg .layui-m-layercont{
+    padding: .2rem;font-size: .3rem;
+}

+ 493 - 0
EMIS.Web/Scripts/Bowin.Control.Core/Plugins/SignName/online_agree.html

@@ -0,0 +1,493 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="UTF-8">
+  <title>在线签署</title>
+  <meta content="IE=edge" http-equiv="X-UA-Compatible" />
+  <meta content="yes" name="apple-mobile-web-app-capable" />
+  <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
+  <meta content="black" name="apple-mobile-web-app-status-bar-style" />
+  <link href="base.css" rel="stylesheet" type="text/css">
+  <!--<link href="layer/need/layer.css" rel="stylesheet" type="text/css">-->
+  <script src="layer/layer.js" type="text/javascript"></script>
+  <style>
+    body, html {
+      overflow: hidden;
+      position: fixed;
+      width: 100%;
+      top: 0;
+      left: 0;
+    }
+    canvas {
+      background: white;
+      border: 1px dashed black;
+      /*position: absolute;
+      top: 0;
+      left: 0;*/
+    }
+
+    .top_bars {
+      /*position: fixed;*/
+      background: #f1f1f1;
+    }
+
+      .tools {
+          /*position: absolute;
+      width: 1.3rem;
+      height: .5rem;
+      left: -18px;*/
+          margin-left: 2.5rem;
+          margin-right: 2.5rem;
+          margin-top: 0.15rem;
+          float: left;
+          background: #495060;
+          color: white;
+          line-height: 0.5rem;
+          text-align: center;
+          /*transform: rotateZ(90deg);*/
+      }
+
+    .clearCanvas {
+      width: 1.3rem;
+    }
+
+      .pencilOrMove {
+          width: 1.3rem;
+      }
+
+    .finish {
+      width: 1.3rem;
+      background: #0590ff;
+    }
+
+      .reload {
+          width: 1.3rem;
+      }
+
+
+    .tips {
+      font-size: 0.32rem;
+      text-align: center;
+
+    }
+
+    /*.secondState {
+      transform: rotate(90deg);
+      z-index: 10;
+      position: fixed;
+      top: 50%;
+      width: 8.4rem;
+      left: 52px;
+      font-size: 0.25rem;
+    }*/
+
+    /*.btn_put {
+      border: 0;
+      padding: 10px;
+      color: white;
+      border-radius: 4px;
+      outline: none;
+    }
+
+    .btn_success {
+      background: #58c73d;
+    }
+
+    .btn_fail {
+      background: #d63c3c;
+    }*/
+
+    .flex_bottom {
+      position: fixed;
+      bottom: 10px;
+      z-index: 90;
+      display: flex;
+      justify-content: space-around;
+      align-items: center;
+      width: 100%;
+    }
+
+    .mask {
+      position: fixed;
+      top: 0;
+      left: 0;
+      background: white;
+      width: 100%;
+      height: 100%;
+      z-index: 40;
+    }
+
+    #canvas2 {
+      width: 100%;
+      height: 100%;
+    }
+    #resultImg{
+      position:absolute;
+      left:0;
+      top:0;
+      z-index: 50;
+    }
+  </style>
+</head>
+<body>
+    <div class="top_bars" id="top">
+        <div class="tools clearCanvas" id="clear">清除文字</div>
+        <div class="tools pencilOrMove" id="isUsePencil">移动签字板</div>
+        <div class="tools finish" id="finish">提交签名</div>
+        <div class="tools reload" id="reload">重新签署</div>
+    </div>
+    <div>
+        <canvas id="canvas"></canvas>
+    </div>
+    <div>
+        <p class="tips" id="tips">请在空白虚线区域内手写您的姓名</p>
+    </div>
+    <script>
+        var NAME = 0;//签名状态
+        var STATEMENT = 1;//抄写状态
+        var supportsPassive = false;
+        var canvasPaint = {};//画布相关状态变量
+        var events = null;//是移动端还是pc端
+        var state = NAME;
+        try {
+            var opts = Object.defineProperty({}, 'passive', {
+                get: function () {
+                    supportsPassive = true;
+                }
+            });
+            window.addEventListener("test", null, opts);
+        } catch (e) {
+        }
+        window.onload = function () {
+            //show_msg('请使用手机模式预览DEMO');
+            canvasPaint.canPaint = true;//是否可以写字
+            canvasPaint.piece = 17;//canvas的高度乘以了17倍(拖动画布功能)
+            canvasPaint.width = 1200;
+                //window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
+            canvasPaint.height = 600;
+            //window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
+            document.getElementById("top").style.width = canvasPaint.width + 'px';
+            document.getElementById("top").style.height = 50 + 'px';
+            //document.getElementById("top").style.height = canvasPaint.height + 'px';
+            //canvasPaint.width = canvasPaint.width - 40;//预留工具栏宽度
+            canvasPaint.clearBtn = document.getElementById("clear");
+            canvasPaint.pencilBtn = document.getElementById("isUsePencil");
+            canvasPaint.finish = document.getElementById("finish");
+            //canvasPaint.tips = document.getElementById("tips");
+            canvasPaint.reload = document.getElementById("reload");
+            //canvasPaint.secondState = document.getElementById("secondState");
+            //canvasPaint.back = document.getElementById("back");
+            //canvasPaint.btn_success = document.getElementById("btn_success");
+            //canvasPaint.btn_fail = document.getElementById("btn_fail");
+            if (state === NAME) {
+                //签名模式隐藏拖动画布按钮
+                canvasPaint.pencilBtn.style.display = 'none';
+            }
+            try {
+                canvasPaint.canvas = document.getElementById("canvas");
+                canvasPaint.ctx = document.getElementById("canvas").getContext("2d");
+                canvasPaint.canvas.width = canvasPaint.width;
+                canvasPaint.canvas.height = canvasPaint.height;
+                    //* canvasPaint.piece;
+                canvasPaint.canvas.style.width = canvasPaint.canvas.width + 'px';
+                canvasPaint.canvas.style.height = canvasPaint.canvas.height + 'px';
+            } catch (e) {
+                layer.open({
+                  content: '您的手机版本过低,不支持在线签署,请使用打印方式签字'
+                  , btn: ['确定'],
+                  shadeClose: false
+                  , yes: function (index) {
+                    layer.close(index);
+                    location.reload();
+                  }
+                });
+            }
+            canvasPaint.ctx.lineCap = 'round';
+            canvasPaint.ctx.lineJoin = 'round';
+            canvasPaint.ctx.strokeWidth = 8;
+            canvasPaint.ctx.lineWidth = 8;
+            canvasPaint.isSupportTouch = ("ontouchstart" in document);
+            events = ('ontouchstart' in window) ? ['touchstart', 'touchmove', 'touchend'] : ['mousedown', 'mousemove', 'mouseup'];
+            canvasPaint.canvas.addEventListener(events[0], startEventHandler, supportsPassive ? { passive: false } : false);
+            canvasPaint.clearBtn.addEventListener(events[0], clearCanvas, false);
+            canvasPaint.pencilBtn.addEventListener(events[0], togglePencil, false);
+            canvasPaint.finish.addEventListener(events[0], finish, false);
+            canvasPaint.reload.addEventListener(events[0], reload, false);
+            //canvasPaint.btn_fail.addEventListener(events[0], reload, false);
+            //canvasPaint.btn_success.addEventListener(events[0], putImg, false);
+            console.log(canvasPaint);
+        };
+
+        //清除画布
+        function clearCanvas() {
+            canvasPaint.ctx.clearRect(0, 0, canvasPaint.canvas.width, canvasPaint.canvas.height);
+        }
+        //根据base64加载图片
+        function preLoadImg(source, callBack, args) {
+            debugger;
+            var pr = [];
+            for (var i = 0; i < source.length; i++) {
+                var p = loadImage(source[i])
+                    .then(function (img) {
+                        return img;
+                    })
+                    .catch(function (err) {
+                        alert("绘制失败,您的手机不支持在线签署");
+                    });
+                pr.push(p);
+            }
+            Promise.all(pr)
+                .then(function (imgArray) {
+                    callBack(imgArray, args);
+                });
+        }
+
+        function loadImage(url) {
+            return new Promise((resolve, reject) => {
+                var img = new Image();
+                img.onload = function () {
+                    resolve(img);
+                };
+                img.onerror = reject;
+                img.src = url;
+            });
+        }
+        //点击完成时的逻辑处理函数
+        function finish() {
+            debugger;
+            canvasPaint.layerIndex = layer.open({ type: 2, shadeClose: false });//遮罩
+            if (state === NAME) {
+                let image = new Image();
+                image.src = canvasPaint.canvas.toDataURL("image/png");
+                console.log(image.src);
+                return image
+                //window.open(image);
+                //加载模板图和签的字,回调函数是result函数
+                //preLoadImg(['agree.jpg', canvasPaint.canvas.toDataURL()], result);
+                //var imgURL = canvasPaint.canvas.toDataURL();
+            }
+            if (state === STATEMENT) {
+                debugger;
+                //加载抄的字,回调函数是stateResult函数
+                preLoadImg([canvasPaint.canvas.toDataURL()], stateResult);
+            }
+        }
+
+        function stateResult(imgArr) {
+            try {
+                statementDraw(imgArr);
+                canvasPaint.canvas.removeEventListener(events[0], startEventHandler, false);
+                document.removeEventListener(events[0], documentStartEventHandler, false);
+                layer.close(canvasPaint.layerIndex);
+            } catch (e) {
+                layer.close(canvasPaint.layerIndex);
+                alert('绘制失败');
+            }
+        }
+
+        function result(imgArr) {
+            try {
+                drawName(imgArr);
+                layer.close(canvasPaint.layerIndex);
+            } catch (e) {
+                layer.close(canvasPaint.layerIndex);
+                alert('绘制失败');
+            }
+        }
+        //绘制抄写的句子的方法
+        function statementDraw(imgArr) {
+            canvasPaint.context2.save();
+            canvasPaint.context2.translate(490, 3085);
+            canvasPaint.context2.rotate(270 * Math.PI / 180);
+            canvasPaint.context2.drawImage(imgArr[0], 80, 50, 80, 80 * canvasPaint.ratio);//画反转后的名字
+            canvasPaint.context2.restore();
+            // console.log(canvasPaint.canvas2.toDataURL());
+            document.getElementById('resultImg').setAttribute('src', canvasPaint.canvas2.toDataURL());
+            document.getElementById('resultImg').style.display = "block";
+            document.getElementById('mask').style.display = "block";
+            document.getElementById('flex_bottom').style.visibility = "visible";
+            canvasPaint.imgResult = canvasPaint.canvas2.toDataURL();
+            console.warn(canvasPaint.imgResult);
+            show_msg('到控制台拷贝Base64到浏览器地址可查看大图');
+        }
+        //抄句子前的预处理
+        function prevDrawStatement() {
+            clearCanvas();//清除名字
+            canvasPaint.finish.innerHTML = "提交抄写";
+            canvasPaint.pencilBtn.style.display = 'block';
+            canvasPaint.secondState.style.display = 'block';
+            canvasPaint.tips.innerHTML = "(最后一步)请抄写屏幕上方引号内的确认语句";
+            canvasPaint.tips.style.color = 'red';
+            setTimeout(function () {
+                canvasPaint.tips.style.color = '#666';
+            }, 2000);
+            state = STATEMENT;//开始写句子
+        }
+        //写名字的函数
+        function drawName(imgArr) {
+            //绘制名字和底部的名字和日期
+            canvasPaint.canvas2 = document.getElementById('canvas2');
+            canvasPaint.context2 = canvasPaint.canvas2.getContext('2d');
+            canvasPaint.ratio = canvasPaint.canvas.height / canvasPaint.canvas.width;
+            canvasPaint.context2.drawImage(imgArr[0], 0, 0, 2480, 3507);//img0是底图原合同
+            canvasPaint.context2.save();
+            canvasPaint.context2.translate(455, 612);//1
+            canvasPaint.context2.rotate(270 * Math.PI / 180);
+            canvasPaint.context2.drawImage(imgArr[1], 80, 50, 70, 70 * canvasPaint.ratio);//画反转后的名字
+            canvasPaint.context2.restore();
+            canvasPaint.context2.save();
+            canvasPaint.context2.translate(550, 3210);//下方的字 2
+            canvasPaint.context2.rotate(270 * Math.PI / 180);
+            canvasPaint.context2.drawImage(imgArr[1], 80, 50, 70, 70 * canvasPaint.ratio);//画反转后的名字
+            canvasPaint.context2.restore();
+            canvasPaint.context2.save();
+            canvasPaint.context2.translate(1920, 3100);//下方的字
+            canvasPaint.context2.font = "32px bold 微软雅黑";
+            canvasPaint.context2.fillStyle = "#000";
+            canvasPaint.context2.textAlign = "center";
+            canvasPaint.context2.textBaseline = "middle";
+            var date = new Date();
+            var Y = date.getFullYear() + '/';
+            var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '/';
+            var D = date.getDate();
+            canvasPaint.context2.fillText((Y + M + D), 0, 0);
+            canvasPaint.context2.restore();
+            prevDrawStatement();
+        }
+        //是否写字的逻辑(拖动画布)
+        function togglePencil() {
+            if (canvasPaint.canPaint) {
+                canvasPaint.canPaint = false;
+                canvasPaint.pencilBtn.innerText = "使用签字笔";
+                //不能签字时应该把开始事件去掉,同时加上document事件
+                canvasPaint.canvas.removeEventListener(events[0], startEventHandler, false);
+                document.addEventListener(events[0], documentStartEventHandler, supportsPassive ? { passive: false } : false);
+            } else {
+                canvasPaint.canPaint = true;
+                canvasPaint.pencilBtn.innerText = "移动签字板";
+                //能签字时应该把开始事件绑定上去,同时去掉document事件
+                canvasPaint.canvas.addEventListener(events[0], startEventHandler, supportsPassive ? { passive: false } : false);
+                document.removeEventListener(events[0], documentStartEventHandler, false);
+            }
+        }
+
+        function reload() {
+            location.reload();
+        }
+
+        function documentStartEventHandler(event) {
+            event.preventDefault();
+            var evt = canvasPaint.isSupportTouch ? event.touches[0] : event;
+            canvasPaint.y = evt.clientY;
+            canvasPaint.top = parseFloat(canvasPaint.canvas.style.top);
+            document.addEventListener(events[1], documentMoveEventHandler, supportsPassive ? { passive: false } : false);
+            document.addEventListener(events[2], documentEndEventHandler, supportsPassive ? { passive: false } : false);
+        }
+
+        function documentMoveEventHandler(event) {
+            event.preventDefault();
+            var evt = canvasPaint.isSupportTouch ? event.touches[0] : event;
+            canvasPaint.newY = evt.clientY - canvasPaint.y;
+            if (canvasPaint.canPaint === false) {
+                //边界的判断
+                canvasPaint.canvas.style.top = canvasPaint.newY + canvasPaint.top + 'px';
+                if (parseFloat(canvasPaint.canvas.style.top) > 0) {
+                    canvasPaint.canvas.style.top = 0 + 'px';
+                }
+                if (Math.abs(parseFloat(canvasPaint.canvas.style.top)) > canvasPaint.canvas.height - canvasPaint.canvas.height / canvasPaint.piece) {
+                    canvasPaint.canvas.style.top = -(canvasPaint.canvas.height - canvasPaint.canvas.height / canvasPaint.piece) + 'px';
+                }
+            }
+        }
+
+        function documentEndEventHandler(event) {
+            event.preventDefault();
+        }
+
+        function startEventHandler(event) {
+            event.preventDefault();
+            canvasPaint.ctx.beginPath();
+            canvasPaint.canvas.addEventListener(events[1], moveEventHandler, supportsPassive ? { passive: false } : false);
+            canvasPaint.canvas.addEventListener(events[2], endEventHandler, supportsPassive ? { passive: false } : false);
+        }
+
+        function moveEventHandler(event) {
+            event.preventDefault();
+            var evt = canvasPaint.isSupportTouch ? event.touches[0] : event;
+            var coverPos = canvasPaint.canvas.getBoundingClientRect();
+            canvasPaint.mouseX = evt.clientX - coverPos.left;
+            canvasPaint.mouseY = evt.clientY - coverPos.top;
+            if (canvasPaint.canPaint === true) {
+                //根据坐标绘制
+                canvasPaint.ctx.lineTo(
+                    canvasPaint.mouseX,
+                    canvasPaint.mouseY
+                );
+                canvasPaint.ctx.stroke();
+            }
+        }
+
+        function endEventHandler(event) {
+            event.preventDefault();
+            canvasPaint.canvas.removeEventListener(events[1], moveEventHandler, false);
+            canvasPaint.canvas.removeEventListener(events[2], endEventHandler, false);
+        }
+
+        //提交图片
+        function putImg() {
+            canvasPaint.layerIndex = layer.open({ type: 2, shadeClose: false });
+            var formData = new FormData();
+            var file = canvasPaint.imgResult;
+            formData.append('record', file);
+            console.log('模拟成功');
+            layer.open({
+                content: '上传成功,请等待审核'
+                , btn: ['确定'],
+                shadeClose: false
+                , yes: function (index) {
+                    location.reload();
+                    layer.close(index);
+                },
+            });
+            layer.close(canvasPaint.layerIndex);
+            /*$.ajax({
+              url: "agreement_img",
+              type: 'POST',
+              data: formData,
+              processData: false,
+              contentType: false,
+              success: function (data) {
+                layer.close(canvasPaint.layerIndex);
+                if (data.code === 200) {
+                  layer.open({
+                    content: '上传成功,请等待审核'
+                    , btn: ['确定'],
+                    shadeClose: false
+                    , yes: function (index) {
+                      location.reload();
+                      layer.close(index);
+                    },
+                  });
+                } else {
+                  layer.close(canvasPaint.layerIndex);
+                  show_msg('上传失败,请重试');
+                }
+              },
+              error: function (error) {
+                layer.close(canvasPaint.layerIndex);
+                show_msg('上传失败,请重试');
+              }
+            });*/
+        }
+
+        function show_msg(content) {
+            layer.open({
+                content: content
+                , skin: 'msg'
+                , time: 5
+            });
+        }
+
+    </script>
+</body>
+</html>

+ 18 - 1
EMIS.Web/Views/Students/PicImport.cshtml

@@ -16,7 +16,8 @@
                 <tr>
                     <td>
                         <label>
-                            导入文件:</label>
+                            导入文件:
+                        </label>
                     </td>
                     <td>
                         <input type="file" name="file" accept="*.zip;*.rar;" value=" " />
@@ -27,6 +28,11 @@
                         @EMIS.Resources.Strings.STUDENT_PICIMPORT_TIPS
                     </td>
                 </tr>
+                <tr>
+                    <td colspan="2" style="text-align: center;">
+                        <span id="error" style="display: none;">&nbsp;&nbsp;<a href="@ViewBag.ErrorFile" target="_blank">错误数据下载</a></span>
+                    </td>
+                </tr>
             </table>
         </div>
     }
@@ -41,4 +47,15 @@
         }
         $(document.forms[0]).submitWithLoading();
     }
+     $(function () {
+        var errorFile = '@ViewBag.ErrorFile';
+
+        if (errorFile != '') {
+            $('#error').show();
+        }
+        var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='StudentsImport']");
+        if (customerUrl.attr("value")) {
+            $("#importExcel").attr("href", customerUrl.attr("value"))
+        }
+    });
 </script>

+ 4 - 485
EMIS.Web/Views/Test/SignName.cshtml

@@ -1,485 +1,4 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="UTF-8">
-    <title>在线签署</title>
-    <meta content="IE=edge" http-equiv="X-UA-Compatible" />
-    <meta content="yes" name="apple-mobile-web-app-capable" />
-    <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
-    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
-    <link href="base.css" rel="stylesheet" type="text/css">
-    <link href="layer/need/layer.css" rel="stylesheet" type="text/css">
-    <script src="layer/layer.js" type="text/javascript"></script>
-    <style>
-        body, html {
-            overflow: hidden;
-            position: fixed;
-            width: 100%;
-            top: 0;
-            left: 0;
-        }
-
-        canvas {
-            background: white;
-            border: 1px dashed black;
-            position: absolute;
-            top: 0;
-            left: 0;
-        }
-
-        .top_bars {
-            position: fixed;
-            width: 40px;
-            background: #f1f1f1;
-            right: 0;
-            top: 0
-        }
-
-        .tools {
-            position: absolute;
-            width: 1.3rem;
-            height: .5rem;
-            left: -18px;
-            background: #495060;
-            color: white;
-            line-height: .5rem;
-            text-align: center;
-            transform: rotateZ(90deg);
-        }
-
-        .clearCanvas {
-            bottom: 1.9rem;
-        }
-
-        .pencilOrMove {
-            bottom: .5rem;
-        }
-
-        .finish {
-            width: 1.3rem;
-            bottom: 47%;
-            background: #0590ff;
-        }
-
-        .reload {
-            top: .5rem;
-        }
-
-
-        .tips {
-            font-size: .32rem;
-            text-align: center;
-            position: fixed;
-            top: 50%;
-            left: -2.3rem;
-            transform: rotate(90deg);
-            z-index: 10;
-        }
-
-        .secondState {
-            transform: rotate(90deg);
-            z-index: 10;
-            position: fixed;
-            top: 50%;
-            width: 8.4rem;
-            left: 52px;
-            font-size: 0.25rem;
-        }
-
-        .btn_put {
-            border: 0;
-            padding: 10px;
-            color: white;
-            border-radius: 4px;
-            outline: none;
-        }
-
-        .btn_success {
-            background: #58c73d;
-        }
-
-        .btn_fail {
-            background: #d63c3c;
-        }
-
-        .flex_bottom {
-            position: fixed;
-            bottom: 10px;
-            z-index: 90;
-            display: flex;
-            justify-content: space-around;
-            align-items: center;
-            width: 100%;
-        }
-
-        .mask {
-            position: fixed;
-            top: 0;
-            left: 0;
-            background: white;
-            width: 100%;
-            height: 100%;
-            z-index: 40;
-        }
-
-        #canvas2 {
-            width: 2480px;
-            height: 3507px;
-        }
-
-        #resultImg {
-            position: absolute;
-            left: 0;
-            top: 0;
-            z-index: 50;
-        }
-    </style>
-</head>
-<body>
-    <img src="" id="resultImg" width="100%" alt="" style="display: none" />
-    <div class="mask" id="mask" style="display: none"></div>
-    <canvas id="canvas2" width="2480" height="3507" style="display: none">无</canvas>
-    <p class="tips" id="tips">(第一步)请在空白虚线区域内手写您的姓名</p>
-    <div class="top_bars" id="top">
-        <div class="tools clearCanvas" id="clear">清除文字</div>
-        <div class="tools pencilOrMove" id="isUsePencil">移动签字板</div>
-        <div class="tools finish" id="finish">提交签名</div>
-        <div class="tools reload" id="reload">重新签署</div>
-    </div>
-    <div class="flex_bottom" style="visibility: hidden" id="flex_bottom">
-        <button class="btn_put btn_success" id="btn_success">提交审核</button>
-        <button class="btn_put btn_fail" id="btn_fail">重新签署</button>
-    </div>
-    <p class="secondState" id="secondState" style="display: none">"以上&lt;&lt;xxxxxxxx&gt;&gt;的各项内容,本人已阅读并确认无异议"</p>
-    <canvas id="canvas" style="top:0">您的手机不支持在线签署</canvas>
-    <script>var NAME = 0;//签名状态
-var STATEMENT = 1;//抄写状态
-var supportsPassive = false;
-var canvasPaint = {};//画布相关状态变量
-var events = null;//是移动端还是pc端
-var state = NAME;
-try {
-  var opts = Object.defineProperty({}, 'passive', {
-    get: function () {
-      supportsPassive = true;
-    }
-  });
-  window.addEventListener("test", null, opts);
-} catch (e) {
-}
-window.onload = function () {
-  show_msg('请使用手机模式预览DEMO');
-  canvasPaint.canPaint = true;//是否可以写字
-  canvasPaint.piece = 17;//canvas的高度乘以了17倍(拖动画布功能)
-  canvasPaint.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
-  canvasPaint.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
-  document.getElementById("top").style.height = canvasPaint.height + 'px';
-  canvasPaint.width = canvasPaint.width - 40;//预留工具栏宽度
-  canvasPaint.clearBtn = document.getElementById("clear");
-  canvasPaint.pencilBtn = document.getElementById("isUsePencil");
-  canvasPaint.finish = document.getElementById("finish");
-  canvasPaint.tips = document.getElementById("tips");
-  canvasPaint.reload = document.getElementById("reload");
-  canvasPaint.secondState = document.getElementById("secondState");
-  canvasPaint.back = document.getElementById("back");
-  canvasPaint.btn_success = document.getElementById("btn_success");
-  canvasPaint.btn_fail = document.getElementById("btn_fail");
-  if (state === NAME) {
-    //签名模式隐藏拖动画布按钮
-    canvasPaint.pencilBtn.style.display = 'none';
-  }
-  try {
-    canvasPaint.canvas = document.getElementById("canvas");
-    canvasPaint.ctx = document.getElementById("canvas").getContext("2d");
-    canvasPaint.canvas.width = canvasPaint.width;
-    canvasPaint.canvas.height = canvasPaint.height * canvasPaint.piece;
-    canvasPaint.canvas.style.width = canvasPaint.canvas.width + 'px';
-    canvasPaint.canvas.style.height = canvasPaint.canvas.height + 'px';
-  } catch (e) {
-    layer.open({
-      content: '您的手机版本过低,不支持在线签署,请使用打印方式签字'
-      , btn: ['确定'],
-      shadeClose: false
-      , yes: function (index) {
-        layer.close(index);
-        location.reload();
-      }
-    });
-  }
-  canvasPaint.ctx.lineCap = 'round';
-  canvasPaint.ctx.lineJoin = 'round';
-  canvasPaint.ctx.strokeWidth = 8;
-  canvasPaint.ctx.lineWidth = 8;
-  canvasPaint.isSupportTouch = ("ontouchstart" in document);
-  events = ('ontouchstart' in window) ? ['touchstart', 'touchmove', 'touchend'] : ['mousedown', 'mousemove', 'mouseup'];
-  canvasPaint.canvas.addEventListener(events[0], startEventHandler, supportsPassive ? {passive: false} : false);
-  canvasPaint.clearBtn.addEventListener(events[0], clearCanvas, false);
-  canvasPaint.pencilBtn.addEventListener(events[0], togglePencil, false);
-  canvasPaint.finish.addEventListener(events[0], finish, false);
-  canvasPaint.reload.addEventListener(events[0], reload, false);
-  canvasPaint.btn_fail.addEventListener(events[0], reload, false);
-  canvasPaint.btn_success.addEventListener(events[0], putImg, false);
-};
-
-//清除画布
-function clearCanvas() {
-  canvasPaint.ctx.clearRect(0, 0, canvasPaint.canvas.width, canvasPaint.canvas.height);
-}
-//根据base64加载图片
-function preLoadImg(source, callBack, args) {
-  var pr = [];
-  for (var i = 0; i < source.length; i++) {
-    var p = loadImage(source[i])
-      .then(function (img) {
-        return img;
-      })
-      .catch(function (err) {
-        alert("绘制失败,您的手机不支持在线签署");
-      });
-    pr.push(p);
-  }
-  Promise.all(pr)
-    .then(function (imgArray) {
-      callBack(imgArray, args);
-    });
-}
-
-function loadImage(url) {
-  return new Promise((resolve, reject) => {
-    var img = new Image();
-    img.onload = function () {
-      resolve(img);
-    };
-    img.onerror = reject;
-    img.src = url;
-  });
-}
-//点击完成时的逻辑处理函数
-function finish() {
-  canvasPaint.layerIndex = layer.open({type: 2, shadeClose: false});//遮罩
-  if (state === NAME) {
-    //加载模板图和签的字,回调函数是result函数
-    preLoadImg(['agree.jpg', canvasPaint.canvas.toDataURL()], result);
-  }
-  if (state === STATEMENT) {
-    //加载抄的字,回调函数是stateResult函数
-    preLoadImg([canvasPaint.canvas.toDataURL()], stateResult);
-  }
-}
-
-function stateResult(imgArr) {
-  try {
-    statementDraw(imgArr);
-    canvasPaint.canvas.removeEventListener(events[0], startEventHandler, false);
-    document.removeEventListener(events[0], documentStartEventHandler, false);
-    layer.close(canvasPaint.layerIndex);
-  } catch (e) {
-    layer.close(canvasPaint.layerIndex);
-    alert('绘制失败');
-  }
-}
-
-function result(imgArr) {
-  try {
-    drawName(imgArr);
-    layer.close(canvasPaint.layerIndex);
-  } catch (e) {
-    layer.close(canvasPaint.layerIndex);
-    alert('绘制失败');
-  }
-}
-//绘制抄写的句子的方法
-function statementDraw(imgArr) {
-  canvasPaint.context2.save();
-  canvasPaint.context2.translate(490, 3085);
-  canvasPaint.context2.rotate(270 * Math.PI / 180);
-  canvasPaint.context2.drawImage(imgArr[0], 80, 50, 80, 80 * canvasPaint.ratio);//画反转后的名字
-  canvasPaint.context2.restore();
-  // console.log(canvasPaint.canvas2.toDataURL());
-  document.getElementById('resultImg').setAttribute('src', canvasPaint.canvas2.toDataURL());
-  document.getElementById('resultImg').style.display = "block";
-  document.getElementById('mask').style.display = "block";
-  document.getElementById('flex_bottom').style.visibility = "visible";
-  canvasPaint.imgResult = canvasPaint.canvas2.toDataURL();
-  console.warn(canvasPaint.imgResult);
-  show_msg('到控制台拷贝Base64到浏览器地址可查看大图');
-}
-//抄句子前的预处理
-function prevDrawStatement() {
-  clearCanvas();//清除名字
-  canvasPaint.finish.innerHTML = "提交抄写";
-  canvasPaint.pencilBtn.style.display = 'block';
-  canvasPaint.secondState.style.display = 'block';
-  canvasPaint.tips.innerHTML = "(最后一步)请抄写屏幕上方引号内的确认语句";
-  canvasPaint.tips.style.color = 'red';
-  setTimeout(function () {
-    canvasPaint.tips.style.color = '#666';
-  }, 2000);
-  state = STATEMENT;//开始写句子
-}
-//写名字的函数
-function drawName(imgArr) {
-  //绘制名字和底部的名字和日期
-  canvasPaint.canvas2 = document.getElementById('canvas2');
-  canvasPaint.context2 = canvasPaint.canvas2.getContext('2d');
-  canvasPaint.ratio = canvasPaint.canvas.height / canvasPaint.canvas.width;
-  canvasPaint.context2.drawImage(imgArr[0], 0, 0, 2480, 3507);//img0是底图原合同
-  canvasPaint.context2.save();
-  canvasPaint.context2.translate(455, 612);//1
-  canvasPaint.context2.rotate(270 * Math.PI / 180);
-  canvasPaint.context2.drawImage(imgArr[1], 80, 50, 70, 70 * canvasPaint.ratio);//画反转后的名字
-  canvasPaint.context2.restore();
-  canvasPaint.context2.save();
-  canvasPaint.context2.translate(550, 3210);//下方的字 2
-  canvasPaint.context2.rotate(270 * Math.PI / 180);
-  canvasPaint.context2.drawImage(imgArr[1], 80, 50, 70, 70 * canvasPaint.ratio);//画反转后的名字
-  canvasPaint.context2.restore();
-  canvasPaint.context2.save();
-  canvasPaint.context2.translate(1920, 3100);//下方的字
-  canvasPaint.context2.font = "32px bold 微软雅黑";
-  canvasPaint.context2.fillStyle = "#000";
-  canvasPaint.context2.textAlign = "center";
-  canvasPaint.context2.textBaseline = "middle";
-  var date = new Date();
-  var Y = date.getFullYear() + '/';
-  var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '/';
-  var D = date.getDate();
-  canvasPaint.context2.fillText((Y + M + D), 0, 0);
-  canvasPaint.context2.restore();
-  prevDrawStatement();
-}
-//是否写字的逻辑(拖动画布)
-function togglePencil() {
-  if (canvasPaint.canPaint) {
-    canvasPaint.canPaint = false;
-    canvasPaint.pencilBtn.innerText = "使用签字笔";
-    //不能签字时应该把开始事件去掉,同时加上document事件
-    canvasPaint.canvas.removeEventListener(events[0], startEventHandler, false);
-    document.addEventListener(events[0], documentStartEventHandler, supportsPassive ? {passive: false} : false);
-  } else {
-    canvasPaint.canPaint = true;
-    canvasPaint.pencilBtn.innerText = "移动签字板";
-    //能签字时应该把开始事件绑定上去,同时去掉document事件
-    canvasPaint.canvas.addEventListener(events[0], startEventHandler, supportsPassive ? {passive: false} : false);
-    document.removeEventListener(events[0], documentStartEventHandler, false);
-  }
-}
-
-function reload() {
-  location.reload();
-}
-
-function documentStartEventHandler(event) {
-  event.preventDefault();
-  var evt = canvasPaint.isSupportTouch ? event.touches[0] : event;
-  canvasPaint.y = evt.clientY;
-  canvasPaint.top = parseFloat(canvasPaint.canvas.style.top);
-  document.addEventListener(events[1], documentMoveEventHandler, supportsPassive ? {passive: false} : false);
-  document.addEventListener(events[2], documentEndEventHandler, supportsPassive ? {passive: false} : false);
-}
-
-function documentMoveEventHandler(event) {
-  event.preventDefault();
-  var evt = canvasPaint.isSupportTouch ? event.touches[0] : event;
-  canvasPaint.newY = evt.clientY - canvasPaint.y;
-  if (canvasPaint.canPaint === false) {
-    //边界的判断
-    canvasPaint.canvas.style.top = canvasPaint.newY + canvasPaint.top + 'px';
-    if (parseFloat(canvasPaint.canvas.style.top) > 0) {
-      canvasPaint.canvas.style.top = 0 + 'px';
-    }
-    if (Math.abs(parseFloat(canvasPaint.canvas.style.top)) > canvasPaint.canvas.height - canvasPaint.canvas.height / canvasPaint.piece) {
-      canvasPaint.canvas.style.top = -(canvasPaint.canvas.height - canvasPaint.canvas.height / canvasPaint.piece) + 'px';
-    }
-  }
-}
-
-function documentEndEventHandler(event) {
-  event.preventDefault();
-}
-
-function startEventHandler(event) {
-  event.preventDefault();
-  canvasPaint.ctx.beginPath();
-  canvasPaint.canvas.addEventListener(events[1], moveEventHandler, supportsPassive ? {passive: false} : false);
-  canvasPaint.canvas.addEventListener(events[2], endEventHandler, supportsPassive ? {passive: false} : false);
-}
-
-function moveEventHandler(event) {
-  event.preventDefault();
-  var evt = canvasPaint.isSupportTouch ? event.touches[0] : event;
-  var coverPos = canvasPaint.canvas.getBoundingClientRect();
-  canvasPaint.mouseX = evt.clientX - coverPos.left;
-  canvasPaint.mouseY = evt.clientY - coverPos.top;
-  if (canvasPaint.canPaint === true) {
-    //根据坐标绘制
-    canvasPaint.ctx.lineTo(
-      canvasPaint.mouseX,
-      canvasPaint.mouseY
-    );
-    canvasPaint.ctx.stroke();
-  }
-}
-
-function endEventHandler(event) {
-  event.preventDefault();
-  canvasPaint.canvas.removeEventListener(events[1], moveEventHandler, false);
-  canvasPaint.canvas.removeEventListener(events[2], endEventHandler, false);
-}
-
-//提交图片
-function putImg() {
-  canvasPaint.layerIndex = layer.open({type: 2, shadeClose: false});
-  var formData = new FormData();
-  var file = canvasPaint.imgResult;
-  formData.append('record', file);
-  console.log('模拟成功');
-  layer.open({
-    content: '上传成功,请等待审核'
-    , btn: ['确定'],
-    shadeClose: false
-    , yes: function (index) {
-      location.reload();
-      layer.close(index);
-    },
-  });
-  layer.close(canvasPaint.layerIndex);
-  /*$.ajax({
-    url: "agreement_img",
-    type: 'POST',
-    data: formData,
-    processData: false,
-    contentType: false,
-    success: function (data) {
-      layer.close(canvasPaint.layerIndex);
-      if (data.code === 200) {
-        layer.open({
-          content: '上传成功,请等待审核'
-          , btn: ['确定'],
-          shadeClose: false
-          , yes: function (index) {
-            location.reload();
-            layer.close(index);
-          },
-        });
-      } else {
-        layer.close(canvasPaint.layerIndex);
-        show_msg('上传失败,请重试');
-      }
-    },
-    error: function (error) {
-      layer.close(canvasPaint.layerIndex);
-      show_msg('上传失败,请重试');
-    }
-  });*/
-}
-
-function show_msg(content) {
-  layer.open({
-    content: content
-    , skin: 'msg'
-    , time: 5
-  });
-}</script>
-</body>
-</html>
+
+<div style="align-content:center;">
+    <iframe id="iframe1" style="width:1200px;height:800px" frameborder="0" scrolling="auto" src="~/Scripts/Bowin.Control.Core/Plugins/SignName/online_agree.html"></iframe>
+</div>