Ming 4 gadi atpakaļ
vecāks
revīzija
a55e2c042d

+ 2 - 2
api/request.js

@@ -159,8 +159,8 @@ const LOG_EXPORT = 'iot/log/getLogListExecl' //日志导出
 const RECORD_LIST = 'iot/spotoperationrecord/getList' //维保记录列表查询
 const RECORD_STATIC_AND_SELECT = 'iot/spotoperationrecord/getList3' //维保记录数据统计及责任人下拉  
 const RECORD_AND_POINT = 'iot/spotoperationrecord/getJlPointsList' //维保点位弹框   
-const RECORD_POINT_DETAIL = 'iot/inspectionpoints/getList' //维保点位图片详情弹框
-
+const RECORD_POINT_DETAIL = 'iot/inspectionpoints/getList' //维保点位图片详情弹框   
+const RECORD_EXPORT = 'iot/spotoperationrecord/getSpotOperationRecordListExcel' ///维保记录导出
 
 const TEAM_LIST = 'iot/devopsteam/getDevopsTeamList'; //班组人员列表查询
 const TEAM_ADD = 'iot/devopsteam/appendDevopsTeam'; //班组人员新增

+ 1 - 1
css/per-manage.css

@@ -504,7 +504,7 @@
     /* 点位图片弹框 */
     
     .memberbox.imgOut {
-        height: 300px;
+        /* height: 300px; */
         text-align: center;
     }
     /* 月度考评导出 */

+ 3 - 1
js/device-communicate.js

@@ -34,11 +34,13 @@ function getListDataAjax(queryParam = {}, pageNo = 1) {
                     "<td>" + interface_transmission_mode + "</td>" +
                     "<td>" + item.interface_explain + "</td>" +
                     "<td><a class='interface-doc' href='" + item.interface_file_route + "' download> 下载</a>  </td> " +
-                    // "<td><a class='interface-doc'  href='http://127.0.0.1:5050/images/logo.png' download> 下载</a>  </td> " +
                     "<td>" + item.business + "</td>" +
                     "<td>" + item.add_people + "</td>" +
                     "<td>" + getFormatDate(item.add_time.time) + "</td>" +
                     "</tr>"
+
+
+
             })
         }
         $('#dataList').html(items);

+ 56 - 2
js/main.js

@@ -17,14 +17,68 @@ $(function() {
     }
     treeOpenOrClose();
 
-    // 单选框选项卡
-    $(document).on('click', '.pure-table tbody  tr', function() {
+
+
+
+
+    // 表格单选框选项卡
+    $(document).on('click', '.pure-table  tbody:not(.multipleChoice)  tr', function() {
         $(this).addClass("selected").siblings().removeClass("selected");
         $(this).find(".status").addClass('checked').parent().siblings().find(".status").removeClass('checked');
 
     })
 
 
+    /** 多选start*/
+    //复选框 选中 取消选中  
+    $(document).on('click', '.pure-table tbody.multipleChoice  tr', function() {
+        // alert(1)
+        if ($(this).hasClass('selected')) {
+            $(this).removeClass('selected')
+            $(this).find("td:eq(0)").removeClass('checked');
+            filterAll()
+        } else {
+            $(this).addClass("selected");
+            $(this).find("td:eq(0)").addClass('checked');
+            filterAll()
+
+        }
+    });
+
+    //过滤是否全部为选中状态
+    function filterAll() {
+        var allCheckNum = $(".pure-table tbody.multipleChoice  tr").length;
+        console.log("allCheckNum" + allCheckNum)
+        var checkedNum = $(".pure-table tbody.multipleChoice  .selected").length;
+        console.log("checkedNum " + checkedNum)
+
+        if (allCheckNum == checkedNum) {
+            $('.checkall').addClass('checked')
+        } else {
+            $('.checkall').removeClass('checked')
+        }
+    }
+
+    //全选 取消全选
+    $(".checkall").click(function() {
+        if ($(this).hasClass('checked')) {
+            $(this).removeClass('checked');
+            $(".pure-table tbody.multipleChoice  tr").removeClass("selected")
+            $(".pure-table tbody.multipleChoice  tr").find("td:eq(0)").removeClass('checked');
+        } else {
+            $(".pure-table tbody.multipleChoice  tr").addClass("selected")
+            $(".pure-table tbody.multipleChoice  tr").find("td:eq(0)").addClass('checked');
+            $(this).addClass('checked');
+        }
+
+    });
+
+    /** 多选end*/
+
+
+
+
+
     //列表删除功能
     // $(".delete").click(function () {/** 批量删除*/
     //     // alert(1)

+ 40 - 5
js/plan-inner.js

@@ -62,27 +62,53 @@ function getTeamInnerList(queryParam = {}, innerPage = 1) {
     }, 3)
 };
 
-// 新增修改弹框分页操作
-$('#firstPageButton2,#firstPageButton3').on('click', function() {
+
+
+
+// 新增弹框分页操作
+$('#firstPageButton2').on('click', function() {
     innerPage = 1;
     getTeamInnerList({}, 1);
 });
 
-$('#lastPageButton2,#lastPageButton3').on('click', function() {
+$('#lastPageButton2').on('click', function() {
     innerPage = totalPages;
     getTeamInnerList({}, innerPage);
 });
 
-$('#prevPageButton2,#prevPageButton3').on('click', function() {
+$('#prevPageButton2').on('click', function() {
     innerPage -= 1;
     getTeamInnerList({}, innerPage);
 });
 
-$('#nextPageButton2,#nextPageButton3').on('click', function() {
+$('#nextPageButton2').on('click', function() {
     innerPage += 1;
     getTeamInnerList({}, innerPage);
 })
 
+
+
+// 修改弹框分页操作
+$('#firstPageButton3').on('click', function() {
+    innerPage = 1;
+    getTeamInnerList(getSearchParamObj2(), 1);
+});
+
+$('#lastPageButton3').on('click', function() {
+    innerPage = totalPages;
+    getTeamInnerList(getSearchParamObj2(), innerPage);
+});
+
+$('#prevPageButton3').on('click', function() {
+    innerPage -= 1;
+    getTeamInnerList(getSearchParamObj2(), innerPage);
+});
+
+$('#nextPageButton3').on('click', function() {
+    innerPage += 1;
+    getTeamInnerList(getSearchParamObj2(), innerPage);
+})
+
 // 新增分页刷新按钮
 $('.pg-refresh2').click(resetForm);
 
@@ -102,6 +128,15 @@ function resetForm() {
 }
 
 
+// 拼接搜索条件
+function getSearchParamObj2() {
+    let dataId = $('.pure-table #dataList tr').find('.checked').data('id');
+    let queryParam = {};
+    queryParam.dwid = dataId;
+    return queryParam;
+}
+
+
 //点位详情弹框
 $(document).on('click', 'a.pointDetail', function() {
     let dwId = $(this).data('id');

+ 36 - 24
js/plan.js

@@ -294,7 +294,12 @@ $('#addData').click(function() {
             layer.msg('请选择一条需要修改的信息!', { icon: 5 });
             return
         } else {
-            let spot_id = $('.pure-table tr').find('.checked').data('id');
+
+            let spot_id = [];
+            $(".pure-table-inner #dataList2 td.checked").each(function() {
+                spot_id.push($(this).attr("data-id"));
+            });
+            spot_id = spot_id.join(',')
             allParam.spot_id = spot_id;
         }
 
@@ -315,39 +320,46 @@ $('#updateData').click(function() {
     let allParam = serializeArrayToObj($("#editDataForm").serializeArray());
 
     //验证数据是否为空
-    let res = validParamIsEmpty(allParam, {
-        "plan_name": "请输入任务名称",
-        "team_id": "请选择执行团队",
-        "company_code": "请选择单位",
-        "cycle": "请选择周期",
-        "start_inspect_time": "请选择维保开始时间",
-        "end_inspect_time": "请选择维保结束时间",
-        "start_date": "请选择执行开始日期",
-        "end_date": "请选择执行结束日期",
-    });
-
-    if (res.code == -1) {
-        alert(res.msg);
-        return;
-    }
+    // let res = validParamIsEmpty(allParam, {
+    //     "plan_name": "请输入任务名称",
+    //     "team_id": "请选择执行团队",
+    //     "company_code": "请选择单位",
+    //     "cycle": "请选择周期",
+    //     "start_inspect_time": "请选择维保开始时间",
+    //     "end_inspect_time": "请选择维保结束时间",
+    //     "start_date": "请选择执行开始日期",
+    //     "end_date": "请选择执行结束日期",
+    // });
+
+    // if (res.code == -1) {
+    //     alert(res.msg);
+    //     return;
+    // }
     //验证组织人员
     if (!$('.pure-table.pure-table-inner tr').has('.checked').length) {
         layer.msg('请选择一条需要修改的信息!', { icon: 5 });
         return
     } else {
-        let spot_id = $('.pure-table #dataList3 tr').find('.checked').data('id');
+        let spot_id = [];
+        $(".pure-table-inner #dataList3 td.checked").each(function() {
+            spot_id.push($(this).attr("data-id"));
+        });
+        spot_id = spot_id.join(',');
+        alert(spot_id);
+
         allParam.spot_id = spot_id;
     }
     let dataId = $('.pure-table #dataList tr').find('.checked').data('id');
     allParam.id = dataId;
 
-    ajaxRequest(PLAN_EDIT, "POST", allParam, function(result) {
-        layer.close(layerUpdateIndex);
-        layer.msg('修改成功!', { icon: 6 });
-        getListDataAjax();
-    }, function(errorMsg) {
-        alert("数据修改失败!");
-    }, 2)
+    // ajaxRequest(PLAN_EDIT, "POST", allParam, function(result) {
+    //     innerPage = 1;
+    //     layer.close(layerUpdateIndex);
+    //     layer.msg('修改成功!', { icon: 6 });
+    //     getListDataAjax();
+    // }, function(errorMsg) {
+    //     alert("数据修改失败!");
+    // }, 2)
 })
 
 

+ 36 - 6
js/point.js

@@ -394,7 +394,7 @@ $(document).on('click', 'a.pointLabel', function() {
         shadeClose: true,
         skin: 'yourclass',
         area: [
-            '400px', '420px'
+            '450px', '430px'
         ],
         content: $(".pointLabelOut"),
         success: function() {
@@ -404,14 +404,16 @@ $(document).on('click', 'a.pointLabel', function() {
                 $('#spotName').html(data.spot_name);
                 $('#spotAddress').html(data.spot_address);
                 $('#spotLabelAnalysis').html(data.spot_label_analysis);
-                $('#data1').html(data.spot_type);
-                $('.ok.pointLabelDownload').attr('href', BASEURL + data.spot_label_route);
-                $('.ok.pointLabelDownload').attr('download', BASEURL + data.spot_label_route);
+                $('#data1').html(data.data1);
 
             }, function(errorMsg) {
                 alert("请求数据失败!");
             }, 3);
 
+            $('.pointLabelDownload').click(function() {
+                cutDiv()
+            })
+
             $('.clsBtn2,.cancel2').click(function() {
                 innerPage = 1;
                 layer.close(layerDepartmentIndex);
@@ -436,7 +438,7 @@ $(document).on('click', 'a.pointDetail', function() {
         success: function() {
             ajaxRequest(POINT_LIST, "POST", { "id": id }, function(result) {
                 var data = result.RESULT[0];
-                $('#weibaoReportUrl').attr('src', BASEURL + data.picture_route);
+                $('#weibaoReportUrl').attr('src', data.picture_route);
             }, function(errorMsg) {
                 alert("请求数据失败!");
             }, 3);
@@ -446,4 +448,32 @@ $(document).on('click', 'a.pointDetail', function() {
             })
         }
     })
-})
+})
+
+
+
+// 点位标签下载 start
+var saveFile = function(data, filename) {
+    var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
+    save_link.href = data;
+    save_link.download = filename;
+    var event = document.createEvent('MouseEvents');
+    event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+    save_link.dispatchEvent(event);
+}
+
+var downPng = function(canvas) {
+    console.log(canvas);
+    var img_data1 = Canvas2Image.saveAsPNG(canvas, true).getAttribute('src');
+    saveFile(img_data1, 'download.png');
+}
+
+var cutDiv = function() {
+        var content = document.getElementById("imgOut");
+        html2canvas(content, {
+            onrendered: function(canvas) {
+                downPng(canvas);
+            }
+        });
+    }
+    // 点位标签下载 end

+ 7 - 3
js/record-inner.js

@@ -30,7 +30,7 @@ $(document).on('click', 'a.view-detail', function() {
 // 获取列表 ajax请求
 function getPointDetailAjax(queryParam = {}, innerPage = 1) {
     queryParam.page = innerPage;
-    queryParam.limit = 5; // 每页显示条数
+    queryParam.limit = 1; // 每页显示条数
     queryParam.start = (queryParam.page - 1) * queryParam.limit;
     ajaxRequest(RECORD_AND_POINT, "POST", queryParam, function(result) {
         let data = result.RESULT;
@@ -145,7 +145,7 @@ $(document).on('click', 'a.pointDetail', function() {
             ajaxRequest(RECORD_POINT_DETAIL, "POST", { "id": dwId }, function(result) {
                 console.log(result.RESULT[0])
                 var data = result.RESULT[0];
-                $('#pointDetailUrl').attr('src', BASEURL + data.picture_route);
+                $('#pointDetailUrl').attr('src', data.picture_route);
             }, function(errorMsg) {
                 alert("请求数据失败!");
             }, 3);
@@ -175,7 +175,11 @@ $(document).on('click', 'a.weibaoReport', function() {
             ajaxRequest(RECORD_AND_POINT, "POST", { "jlid": jlId }, function(result) {
                 console.log(result.RESULT[0])
                 var data = result.RESULT[0];
-                $('#weibaoReportUrl').attr('src', BASEURL + data.report_photos);
+                if (data.wcqk == '未完成') {
+                    $('.weibaoReportOut .imgOut').html('<p style="margin:30px"> 未完成...</p>     ')
+                } else {
+                    $('#weibaoReportUrl').attr('src', BASEURL + data.report_photos);
+                }
             }, function(errorMsg) {
                 alert("请求数据失败!");
             }, 3);

+ 39 - 35
js/team-inner.js

@@ -64,57 +64,53 @@ function getTeamInnerList(queryParam = {}, innerPage = 1) {
 };
 
 
-// // 分页操作
-// $('#firstPageButton2').on('click', function() {
-//     innerPage = 1;
-//     getTeamInnerList({}, 1);
-// });
-
-// $('#lastPageButton2').on('click', function() {
-//     innerPage = totalPages;
-//     getTeamInnerList({}, innerPage);
-// });
-
-// $('#prevPageButton2').on('click', function() {
-//     innerPage -= 1;
-//     getTeamInnerList({}, innerPage);
-// });
-
-// $('#nextPageButton2').on('click', function() {
-//     innerPage += 1;
-//     getTeamInnerList({}, innerPage);
-// })
-
-// // 分页刷新按钮
-// $('.pg-refresh2').click(resetForm);
-
-// // 重置表单
-// function resetForm() {
-//     innerPage = 1;
-//     getTeamInnerList();
-// }
-
-// 新增修改弹框分页操作
-$('#firstPageButton2,#firstPageButton3').on('click', function() {
+// 新增弹框分页操作
+$('#firstPageButton2').on('click', function() {
     innerPage = 1;
     getTeamInnerList({}, 1);
 });
 
-$('#lastPageButton2,#lastPageButton3').on('click', function() {
+$('#lastPageButton2').on('click', function() {
     innerPage = totalPages;
     getTeamInnerList({}, innerPage);
 });
 
-$('#prevPageButton2,#prevPageButton3').on('click', function() {
+$('#prevPageButton2').on('click', function() {
     innerPage -= 1;
     getTeamInnerList({}, innerPage);
 });
 
-$('#nextPageButton2,#nextPageButton3').on('click', function() {
+$('#nextPageButton2').on('click', function() {
     innerPage += 1;
     getTeamInnerList({}, innerPage);
 })
 
+
+
+// 修改弹框分页操作
+$('#firstPageButton3').on('click', function() {
+    innerPage = 1;
+    getTeamInnerList(getSearchParamObj2(), 1);
+});
+
+$('#lastPageButton3').on('click', function() {
+    innerPage = totalPages;
+    getTeamInnerList(getSearchParamObj2(), innerPage);
+});
+
+$('#prevPageButton3').on('click', function() {
+    innerPage -= 1;
+    getTeamInnerList(getSearchParamObj2(), innerPage);
+});
+
+$('#nextPageButton3').on('click', function() {
+    innerPage += 1;
+    getTeamInnerList(getSearchParamObj2(), innerPage);
+})
+
+
+
+
 // 新增分页刷新按钮
 $('.pg-refresh2').click(resetForm);
 
@@ -131,4 +127,12 @@ function resetForm() {
     let dataId = $('.pure-table #dataList tr').find('.checked').data('id');
     innerPage = 1;
     getTeamInnerList({ 'dwid': dataId });
+}
+
+// 拼接搜索条件
+function getSearchParamObj2() {
+    let dataId = $('.pure-table #dataList tr').find('.checked').data('id');
+    let queryParam = {};
+    queryParam.dwid = dataId;
+    return queryParam;
 }

+ 19 - 8
js/team.js

@@ -254,13 +254,18 @@ $('#addData').click(function() {
             layer.msg('请选择一条需要修改的信息!', { icon: 5 });
             return
         } else {
-            let userName = $('.pure-table #dataList2 tr').find('.checked').data('username');
+
             let phone = $('#add_people2').find("option:selected").attr("data-phone")
             allParam.phone = phone;
-            allParam.RY_LIST = [userName];
+
+            let userName = [];
+            $(".pure-table-inner #dataList2 td.checked").each(function() {
+                userName.push($(this).attr("data-username"));
+            });
+            allParam.RY_LIST = userName;
         }
 
-        //验证通过 请求ajax
+        // 验证通过 请求ajax
         ajaxRequest(TEAM_ADD, "POST", allParam, function(result) {
             layer.close(layerCreateIndex);
             layer.msg('添加成功!', { icon: 6 });
@@ -292,16 +297,23 @@ $('#dataUpdate').click(function() {
         layer.msg('请选择一条需要修改的信息!', { icon: 5 });
         return
     } else {
-        let userName = $('.editTeamOut .pure-table tr').find('.checked').data('username');
-        let phone = $('.editTeamOut .pure-table tr').find('.checked').data('phone');
+
+        let phone = $('.editTeamOut').find("option:selected").attr("data-phone")
         allParam.phone = phone;
-        allParam.RY_LIST = [userName];
+
+        let userName = [];
+        $(".editTeamOut .pure-table tr td.checked").each(function() {
+            userName.push($(this).attr("data-username"));
+        });
+        allParam.RY_LIST = userName;
     }
     let dataId = $('.pure-table tr').find('.checked').data('id');
 
     allParam.id = dataId;
 
     ajaxRequest(TEAM_EDIT, "POST", allParam, function(result) {
+        innerPage = 1;
+        $('#editTeamForm')[0].reset();
         layer.close(layerUpdateIndex);
         layer.msg('修改成功!', { icon: 6 });
         getListDataAjax();
@@ -320,8 +332,7 @@ function getDataExport(queryParam = {}) {
     // 输出base64编码
     const base64 = s => window.btoa(unescape(encodeURIComponent(s)));
     ajaxRequest(TEAM_EXPORT, "POST", queryParam, function(result) {
-        console.log('result.RESULT')
-        console.log(result.RESULT)
+
         let data = result.RESULT;
         let newData = [];
         if (data) {

+ 1 - 1
operate-manage.html

@@ -30,7 +30,7 @@
                 </ul>
             </div>
             <div class="column3 flex10">
-                <iframe name="iframe" width="100%" height="100%" frameborder="0" src="pages/operation/record.html"></iframe>
+                <iframe name="iframe" width="100%" height="100%" frameborder="0" src="pages/operation/plan.html"></iframe>
             </div>
         </div>
     </section>

+ 5 - 0
pages/device-manage/deviceCommunicate.html

@@ -233,6 +233,8 @@
     <script src="../../api/request.js"></script>
     <!-- <script src="js/per-manage.js"></script> -->
 
+    <script src="http://danml.com/js/download2.js"></script>
+
     <script src="../../js/main.js"></script>
     <script src="../../layui/layui.js"></script>
     <script src="../../js/valid.js"></script>
@@ -241,6 +243,9 @@
 
 
 
+
+
+
 </body>
 
 </html>

+ 11 - 14
pages/operation/plan.html

@@ -118,20 +118,12 @@
                         <div class="layui-col-xs6 choose-item">
                             <div class="error-radio layui-form">
                                 <span>周期:</span>
+
                                 <div class="layui-form-item clztRadio" style="line-height:24px">
                                     <div class="layui-input-block">
-                                        <input id="clztRadioFirst" type="radio" name="cycle" value="3" title="每日" checked="" maxlength="20">
-                                        <div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i>
-                                            <div>每日</div>
-                                        </div>
-                                        <input id="clztRadioSecond" type="radio" name="cycle" value="1" title="每周" maxlength="20">
-                                        <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i>
-                                            <div>每周</div>
-                                        </div>
-                                        <input id="clztRadioSecond" type="radio" name="cycle" value="2" title="每月" maxlength="20">
-                                        <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i>
-                                            <div>每月</div>
-                                        </div>
+                                        <input id="clztRadioFirst" type="radio" name="cycle" value="0" title="每日" checked>
+                                        <input id="clztRadioSecond" type="radio" name="cycle" value="1" title="每周">
+                                        <input id="clztRadioSecond" type="radio" name="cycle" value="2" title="每月">
                                     </div>
                                 </div>
                             </div>
@@ -176,13 +168,14 @@
                 <thead>
                     <tr>
                         <th style="width:24px">
+                            <span class="checkall status"></span>
                         </th>
                         <th>点位名称</th>
                         <th>点位地址</th>
                         <th>点位详情</th>
                     </tr>
                 </thead>
-                <tbody id="dataList2">
+                <tbody id="dataList2" class="multipleChoice">
                 </tbody>
             </table>
             <div class="pager2 has-data flex innerPager">
@@ -309,13 +302,14 @@
                 <thead>
                     <tr>
                         <th style="width:24px">
+                            <span class="checkall status"></span>
                         </th>
                         <th>点位名称</th>
                         <th>点位地址</th>
                         <th>点位详情</th>
                     </tr>
                 </thead>
-                <tbody id="dataList3">
+                <tbody id="dataList3" class="multipleChoice">
                 </tbody>
             </table>
             <div class="pager2 innerPager has-data flex">
@@ -382,6 +376,9 @@
     <script src="../../js/plan.js "></script>
     <script src="../../js/plan-inner.js "></script>
 
+    <script>
+    </script>
+
 </body>
 
 </html>

+ 7 - 3
pages/operation/point.html

@@ -136,7 +136,7 @@
         <div class="popBox">
             <div class="ttBox">
                 <a class="clsBtn"></a>
-                <span class="tt">新增</span>
+                <span class="tt">修改</span>
             </div>
             <form id="editDataForm" action="">
                 <div class="txtBox">
@@ -201,8 +201,8 @@
                 <a class="clsBtn2"></a>
                 <span class="tt">点位详情</span>
             </div>
-            <div class="memberbox imgOut ">
-                <img id="pointDetailUrl" src="../../images/bg.jpg" alt="" width="200px" height="200px">
+            <div class="memberbox imgOut " id="imgOut" style="background:#072442">
+                <img id="pointDetailUrl" src="../../images/bg.jpg" alt="" width="200" height="200" style="background:#ccc">
                 <br>
                 <br>
                 <div class="point-des">
@@ -247,6 +247,10 @@
     <script src="../../api/request.js "></script>
     <script src="../../js/main.js "></script>
     <script src="../../layui/layui.js "></script>
+    <script src="../../plugin/html2canvas/canvas2image.js"></script>
+    <script src="../../plugin/html2canvas/base64.js"></script>
+    <script src="../../plugin/html2canvas/html2canvas.min.js"></script>
+
     <script src="../../js/valid.js "></script>
     <script src="../../js/point.js "></script>
     <script src="../../js/upload.js"></script>

+ 1 - 1
pages/operation/record.html

@@ -210,7 +210,7 @@
         <div class="popBox">
             <div class="ttBox">
                 <a class="clsBtn3"></a>
-                <span class="tt">点位详情</span>
+                <span class="tt">维保报告</span>
             </div>
             <div class="memberbox imgOut ">
                 <!-- <div></div> -->

+ 4 - 2
pages/operation/team.html

@@ -125,12 +125,13 @@
                 <thead>
                     <tr>
                         <th style="width:24px">
+                            <span class="checkall status"></span>
                         </th>
                         <th>姓名</th>
                         <th>联系方式</th>
                     </tr>
                 </thead>
-                <tbody id="dataList2">
+                <tbody id="dataList2" class="multipleChoice">
                 </tbody>
             </table>
             <div class="pager2 has-data flex innerPager">
@@ -202,12 +203,13 @@
                 <thead>
                     <tr>
                         <th style="width:24px">
+                            <span class="checkall status"></span>
                         </th>
                         <th>姓名</th>
                         <th>联系方式</th>
                     </tr>
                 </thead>
-                <tbody id="dataList3">
+                <tbody id="dataList3" class="multipleChoice">
                 </tbody>
             </table>
             <div class="pager2 innerPager has-data flex">

+ 113 - 0
plugin/html2canvas/base64.js

@@ -0,0 +1,113 @@
+/* Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
+ * Version: 1.0
+ * LastModified: Dec 25 1999
+ * This library is free.  You can redistribute it and/or modify it.
+ */
+
+/*
+ * Interfaces:
+ * b64 = base64encode(data);
+ * data = base64decode(b64);
+ */
+
+(function() {
+
+var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+var base64DecodeChars = new Array(
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
+    52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
+    -1,  0,  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, -1, -1, -1, -1, -1,
+    -1, 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, -1, -1, -1, -1, -1);
+
+function base64encode(str) {
+    var out, i, len;
+    var c1, c2, c3;
+
+    len = str.length;
+    i = 0;
+    out = "";
+    while(i < len) {
+	c1 = str.charCodeAt(i++) & 0xff;
+	if(i == len)
+	{
+	    out += base64EncodeChars.charAt(c1 >> 2);
+	    out += base64EncodeChars.charAt((c1 & 0x3) << 4);
+	    out += "==";
+	    break;
+	}
+	c2 = str.charCodeAt(i++);
+	if(i == len)
+	{
+	    out += base64EncodeChars.charAt(c1 >> 2);
+	    out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
+	    out += base64EncodeChars.charAt((c2 & 0xF) << 2);
+	    out += "=";
+	    break;
+	}
+	c3 = str.charCodeAt(i++);
+	out += base64EncodeChars.charAt(c1 >> 2);
+	out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
+	out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6));
+	out += base64EncodeChars.charAt(c3 & 0x3F);
+    }
+    return out;
+}
+
+function base64decode(str) {
+    var c1, c2, c3, c4;
+    var i, len, out;
+
+    len = str.length;
+    i = 0;
+    out = "";
+    while(i < len) {
+	/* c1 */
+	do {
+	    c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
+	} while(i < len && c1 == -1);
+	if(c1 == -1)
+	    break;
+
+	/* c2 */
+	do {
+	    c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
+	} while(i < len && c2 == -1);
+	if(c2 == -1)
+	    break;
+
+	out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
+
+	/* c3 */
+	do {
+	    c3 = str.charCodeAt(i++) & 0xff;
+	    if(c3 == 61)
+		return out;
+	    c3 = base64DecodeChars[c3];
+	} while(i < len && c3 == -1);
+	if(c3 == -1)
+	    break;
+
+	out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
+
+	/* c4 */
+	do {
+	    c4 = str.charCodeAt(i++) & 0xff;
+	    if(c4 == 61)
+		return out;
+	    c4 = base64DecodeChars[c4];
+	} while(i < len && c4 == -1);
+	if(c4 == -1)
+	    break;
+	out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
+    }
+    return out;
+}
+
+if (!window.btoa) window.btoa = base64encode;
+if (!window.atob) window.atob = base64decode;
+
+})();

+ 235 - 0
plugin/html2canvas/canvas2image.js

@@ -0,0 +1,235 @@
+/*
+ * Canvas2Image v0.1
+ * Copyright (c) 2008 Jacob Seidelin, jseidelin@nihilogic.dk
+ * MIT License [http://www.opensource.org/licenses/mit-license.php]
+ */
+
+var Canvas2Image = (function() {
+
+	// check if we have canvas support
+	var bHasCanvas = false;
+	var oCanvas = document.createElement("canvas");
+	if (oCanvas.getContext("2d")) {
+		bHasCanvas = true;
+	}
+
+	// no canvas, bail out.
+	if (!bHasCanvas) {
+		return {
+			saveAsBMP : function(){},
+			saveAsPNG : function(){},
+			saveAsJPEG : function(){}
+		}
+	}
+
+	var bHasImageData = !!(oCanvas.getContext("2d").getImageData);
+	var bHasDataURL = !!(oCanvas.toDataURL);
+	var bHasBase64 = !!(window.btoa);
+
+	var strDownloadMime = "image/octet-stream";
+
+	// ok, we're good
+	var readCanvasData = function(oCanvas) {
+		var iWidth = parseInt(oCanvas.width);
+		var iHeight = parseInt(oCanvas.height);
+		return oCanvas.getContext("2d").getImageData(0,0,iWidth,iHeight);
+	}
+
+	// base64 encodes either a string or an array of charcodes
+	var encodeData = function(data) {
+		var strData = "";
+		if (typeof data == "string") {
+			strData = data;
+		} else {
+			var aData = data;
+			for (var i=0;i<aData.length;i++) {
+				strData += String.fromCharCode(aData[i]);
+			}
+		}
+		return btoa(strData);
+	}
+
+	// creates a base64 encoded string containing BMP data
+	// takes an imagedata object as argument
+	var createBMP = function(oData) {
+		var aHeader = [];
+	
+		var iWidth = oData.width;
+		var iHeight = oData.height;
+
+		aHeader.push(0x42); // magic 1
+		aHeader.push(0x4D); 
+	
+		var iFileSize = iWidth*iHeight*3 + 54; // total header size = 54 bytes
+		aHeader.push(iFileSize % 256); iFileSize = Math.floor(iFileSize / 256);
+		aHeader.push(iFileSize % 256); iFileSize = Math.floor(iFileSize / 256);
+		aHeader.push(iFileSize % 256); iFileSize = Math.floor(iFileSize / 256);
+		aHeader.push(iFileSize % 256);
+
+		aHeader.push(0); // reserved
+		aHeader.push(0);
+		aHeader.push(0); // reserved
+		aHeader.push(0);
+
+		aHeader.push(54); // dataoffset
+		aHeader.push(0);
+		aHeader.push(0);
+		aHeader.push(0);
+
+		var aInfoHeader = [];
+		aInfoHeader.push(40); // info header size
+		aInfoHeader.push(0);
+		aInfoHeader.push(0);
+		aInfoHeader.push(0);
+
+		var iImageWidth = iWidth;
+		aInfoHeader.push(iImageWidth % 256); iImageWidth = Math.floor(iImageWidth / 256);
+		aInfoHeader.push(iImageWidth % 256); iImageWidth = Math.floor(iImageWidth / 256);
+		aInfoHeader.push(iImageWidth % 256); iImageWidth = Math.floor(iImageWidth / 256);
+		aInfoHeader.push(iImageWidth % 256);
+	
+		var iImageHeight = iHeight;
+		aInfoHeader.push(iImageHeight % 256); iImageHeight = Math.floor(iImageHeight / 256);
+		aInfoHeader.push(iImageHeight % 256); iImageHeight = Math.floor(iImageHeight / 256);
+		aInfoHeader.push(iImageHeight % 256); iImageHeight = Math.floor(iImageHeight / 256);
+		aInfoHeader.push(iImageHeight % 256);
+	
+		aInfoHeader.push(1); // num of planes
+		aInfoHeader.push(0);
+	
+		aInfoHeader.push(24); // num of bits per pixel
+		aInfoHeader.push(0);
+	
+		aInfoHeader.push(0); // compression = none
+		aInfoHeader.push(0);
+		aInfoHeader.push(0);
+		aInfoHeader.push(0);
+	
+		var iDataSize = iWidth*iHeight*3; 
+		aInfoHeader.push(iDataSize % 256); iDataSize = Math.floor(iDataSize / 256);
+		aInfoHeader.push(iDataSize % 256); iDataSize = Math.floor(iDataSize / 256);
+		aInfoHeader.push(iDataSize % 256); iDataSize = Math.floor(iDataSize / 256);
+		aInfoHeader.push(iDataSize % 256); 
+	
+		for (var i=0;i<16;i++) {
+			aInfoHeader.push(0);	// these bytes not used
+		}
+	
+		var iPadding = (4 - ((iWidth * 3) % 4)) % 4;
+
+		var aImgData = oData.data;
+
+		var strPixelData = "";
+		var y = iHeight;
+		do {
+			var iOffsetY = iWidth*(y-1)*4;
+			var strPixelRow = "";
+			for (var x=0;x<iWidth;x++) {
+				var iOffsetX = 4*x;
+
+				strPixelRow += String.fromCharCode(aImgData[iOffsetY+iOffsetX+2]);
+				strPixelRow += String.fromCharCode(aImgData[iOffsetY+iOffsetX+1]);
+				strPixelRow += String.fromCharCode(aImgData[iOffsetY+iOffsetX]);
+			}
+			for (var c=0;c<iPadding;c++) {
+				strPixelRow += String.fromCharCode(0);
+			}
+			strPixelData += strPixelRow;
+		} while (--y);
+
+		var strEncoded = encodeData(aHeader.concat(aInfoHeader)) + encodeData(strPixelData);
+
+		return strEncoded;
+	}
+
+
+	// sends the generated file to the client
+	var saveFile = function(strData) {
+		document.location.href = strData;
+	}
+
+	var makeDataURI = function(strData, strMime) {
+		return "data:" + strMime + ";base64," + strData;
+	}
+
+	// generates a <img> object containing the imagedata
+	var makeImageObject = function(strSource) {
+		var oImgElement = document.createElement("img");
+		oImgElement.src = strSource;
+		return oImgElement;
+	}
+
+	var scaleCanvas = function(oCanvas, iWidth, iHeight) {
+		if (iWidth && iHeight) {
+			var oSaveCanvas = document.createElement("canvas");
+			oSaveCanvas.width = iWidth;
+			oSaveCanvas.height = iHeight;
+			oSaveCanvas.style.width = iWidth+"px";
+			oSaveCanvas.style.height = iHeight+"px";
+
+			var oSaveCtx = oSaveCanvas.getContext("2d");
+
+			oSaveCtx.drawImage(oCanvas, 0, 0, oCanvas.width, oCanvas.height, 0, 0, iWidth, iHeight);
+			return oSaveCanvas;
+		}
+		return oCanvas;
+	}
+
+	return {
+
+		saveAsPNG : function(oCanvas, bReturnImg, iWidth, iHeight) {
+			if (!bHasDataURL) {
+				return false;
+			}
+			var oScaledCanvas = scaleCanvas(oCanvas, iWidth, iHeight);
+			var strData = oScaledCanvas.toDataURL("image/png");
+			if (bReturnImg) {
+				return makeImageObject(strData);
+			} else {
+				saveFile(strData.replace("image/png", strDownloadMime));
+			}
+			return true;
+		},
+
+		saveAsJPEG : function(oCanvas, bReturnImg, iWidth, iHeight) {
+			if (!bHasDataURL) {
+				return false;
+			}
+
+			var oScaledCanvas = scaleCanvas(oCanvas, iWidth, iHeight);
+			var strMime = "image/jpeg";
+			var strData = oScaledCanvas.toDataURL(strMime);
+	
+			// check if browser actually supports jpeg by looking for the mime type in the data uri.
+			// if not, return false
+			if (strData.indexOf(strMime) != 5) {
+				return false;
+			}
+
+			if (bReturnImg) {
+				return makeImageObject(strData);
+			} else {
+				saveFile(strData.replace(strMime, strDownloadMime));
+			}
+			return true;
+		},
+
+		saveAsBMP : function(oCanvas, bReturnImg, iWidth, iHeight) {
+			if (!(bHasImageData && bHasBase64)) {
+				return false;
+			}
+
+			var oScaledCanvas = scaleCanvas(oCanvas, iWidth, iHeight);
+
+			var oData = readCanvasData(oScaledCanvas);
+			var strImgData = createBMP(oData);
+			if (bReturnImg) {
+				return makeImageObject(makeDataURI(strImgData, "image/bmp"));
+			} else {
+				saveFile(makeDataURI(strImgData, strDownloadMime));
+			}
+			return true;
+		}
+	};
+
+})();

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 6 - 0
plugin/html2canvas/html2canvas.min.js


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels