温红权 преди 7 години
родител
ревизия
a3a72098e9

+ 145 - 140
VisualInspection/fwq/js/task/add.js

@@ -2,6 +2,7 @@ var selectedData = { cols: [], array: [] };
 var checkusersselect = null;
 var checkuserlist = null;
 var tabledatagride = null;
+var datac = null;
 $(document).ready(function() {
     $.jeDate("#month_date", {
         isinitVal: true,
@@ -101,82 +102,15 @@ function inittAreaable(time, dept) {
             var data = redata.areas;
             checkuserlist = redata.checkusers;
 
-            var datac = { cols: [], array: [] };
+            datatemp = {
+                data: data,
+                t: t,
+                starttime: starttime,
+                endtime: endtime,
+                time: time
+            };
+            reloadtableData();
 
-            var days = endtime.diff(starttime, 'days');
-
-            datac.cols.push({ width: 120, name: 'type', label: "", });
-
-            for (var i = 1; i <= days; i++) {
-                var temp = moment(moment(t + "-25T23:00:00", "YYYY-MM-DD HH:mm:ss").subtract(1, 'month'));
-                var currentday = temp.add(i, "day");
-                var day = currentday.date();
-                datac.cols.push({ width: 80, name: "day_" + i, label: currentday.format("MM-DD"), html: true, className: "table_content" });
-            }
-            arealist = data;
-            stimemonth = time;
-
-            for (var index in data) {
-                var area = data[index];
-                var data_table = {};
-                data_table.type = area.name;
-                for (var i = 1; i <= days; i++) {
-                    //内容
-                    var temp = moment(moment(t + "-25T23:00:00", "YYYY-MM-DD HH:mm:ss").subtract(1, 'month'));
-                    var currentday = temp.add(i, "day");
-                    var key = area.id + "_" + currentday.format("YYYY-MM-DD");
-
-                    var temphtml = "";
-
-                    if (taskMap.get(key) != null) {
-                        //存在稽查记录
-                        var list = taskMap.get(key);
-                        var hasc = 0;
-                        var invc = 0;
-                        list.forEach(t => {
-                            if (t.check_status == 4 || t.check_status == 16 || t.check_status == 6) {
-                                //完成稽查
-                                hasc++;
-                            }
-                            if (t.check_status == 22) {
-                                //存在无效任务
-                                invc++;
-                            }
-                        });
-                        //无效
-                        if (invc == list.length) {
-                            temphtml = '<div class="btn-group btn_c" data-toggle="buttons" id="div_' + area.id + '_' + i + '" >' +
-                                '<label class="btn btn-info6" >' +
-                                '<input type="checkbox" name="options" onchange="selectedTask(this)" id="' + area.id + '_' + i + '"> 无效' +
-                                '</label>';
-                        } else
-                        //已完成
-                        if (hasc + invc == list.length) {
-                            temphtml = '<div class="btn-group btn_c" data-toggle="buttons"  id="div_' + area.id + '_' + i + '">' +
-                                '<label class="btn btn-info5 " >' +
-                                '<input type="checkbox" name="options" onchange="selectedTask(this)" id="' + area.id + '_' + i + '"> 已稽查' +
-                                '</label>';
-                        } else {
-                            //进行中
-                            temphtml = '<div class="btn-group btn_c" data-toggle="buttons" id="div_' + area.id + '_' + i + '" >' +
-                                '<label class="btn btn-info3" >' +
-                                '<input type="checkbox" name="options" onchange="selectedTask(this)" id="' + area.id + '_' + i + '"> 稽查中' +
-                                '</label>';
-                        }
-
-
-                    } else {
-                        //不存在稽查
-                        temphtml = '<div class="btn-group btn_c" data-toggle="buttons" id="div_' + area.id + '_' + i + '" >' +
-                            '<label class="btn btn-info2" >' +
-                            '<input type="checkbox" name="options" onchange="selectedTask(this)" id="' + area.id + '_' + i + '"> 待稽查' +
-                            '</label>';
-                    }
-
-                    data_table["day_" + i] = temphtml;
-                }
-                datac.array.push(data_table);
-            }
             // console.log(datac);
             if (tabledatagride != null) {
                 tabledatagride.dataSource.data = null;
@@ -188,6 +122,11 @@ function inittAreaable(time, dept) {
                     dataSource: datac,
                     states: { fixedLeftUntil: 1, fixedTopUntil: 0 },
                     showRowIndex: false,
+                    partialRendering: true,
+                    checkByClickRow: true,
+                    selectable: true,
+                    hoverCol: false,
+                    hoverRow: false,
 
                     onRender: function() {
                         $(".datagrid-cell-index").mouseover(function() {
@@ -234,63 +173,15 @@ function inittAreaable(time, dept) {
                                     time: 0,
                                     width: '240px'
                                 });
+                            } else {
+                                return;
                             }
                         });
                         $(".btn_c").mouseout(function() {
                             layer.close(layer.index);
                         });
                     },
-                    onScroll: function() {
-                        $(".datagrid-cell-index").mouseover(function() {
-                            // console.log(this.id);
-                            var id = this.id.split("-")[4] - 1;
-                            var titlehtml = "<div>" + datac.array[id].type + "</div>";
-                            layer.tips(titlehtml, "#" + this.id, {
-                                tips: [1, '#8e8e8e'],
-                                time: 0,
-                                width: '240px'
-                            });
-                        });
-                        $(".datagrid-cell-index").mouseout(function() {
-                            layer.close(layer.index);
-                        });
 
-                        $(".btn_c").mouseover(function() {
-                            var tempids = this.id.split("_");
-                            var t = stimemonth.replace("/", "-") + "";
-                            var starttime = moment(moment(t + "-25T23:00:00", "YYYY-MM-DD HH:mm:ss").subtract(1, 'month'));
-                            var ctime = starttime.add(tempids[2], "day");
-                            var key = tempids[1] + "_" + ctime.format("YYYY-MM-DD");
-                            if (taskMap.get(key) != null) {
-                                var temphtml = "";
-                                var list = taskMap.get(key);
-                                //console.log(list);
-
-                                list.forEach(t => {
-                                    var startus = "";
-                                    if (t.check_status == 4 || t.check_status == 16 || t.check_status == 6) {
-                                        startus = "已完成";
-                                    } else
-                                    if (t.check_status == 22) {
-                                        startus = "无效";
-                                    } else {
-                                        startus = "进行中";
-                                    }
-                                    temphtml += '<tr><td>' + moment(t.start_time).format("HH:mm:ss") + '</td><td>' + moment(t.end_time).format("HH:mm:ss") + '</td><td>' + startus + '</td></tr>';
-                                });
-
-                                var thtml = '<table border=1 style="border:solid 1px;width:180px;"><tr><th>开始时间</th><th>结束时间</th><th>状态</th></tr>' + temphtml + '</table>';
-                                layer.tips(thtml, "#" + this.id, {
-                                    tips: [1, '#8e8e8e'],
-                                    time: 0,
-                                    width: '240px'
-                                });
-                            }
-                        });
-                        $(".btn_c").mouseout(function() {
-                            layer.close(layer.index);
-                        });
-                    },
                     configs: {
                         C1: { className: "datagrid-cell-index", style: { 'text-align': 'center', }, },
                         R0: { style: { 'text-align': 'center', 'line-height': '36px' } }
@@ -301,23 +192,19 @@ function inittAreaable(time, dept) {
                 tabledatagride = $('#table_s').data('zui.datagrid');
             }
 
-
-
-
             for (var index in checkuserlist) {
                 var p = checkuserlist[index];
                 p.title = p.truename;
             }
 
-
             if (checkusersselect != null) {
                 reset();
-            } else {
-                checkusersselect = $('#check_users').comboTree({
-                    source: checkuserlist,
-                    isMultiple: true
-                });
             }
+            checkusersselect = $('#check_users').comboTree({
+                source: checkuserlist,
+                isMultiple: true
+            });
+
 
         });
 
@@ -334,12 +221,7 @@ function reset() {
 
     if (checkusersselect != null) {
         $("#check_users").val("");
-        checkusersselect.unbind();
-        checkusersselect.closeDropDownMenu();
-        checkusersselect.bindings();
-        $(".ComboTreeItemChlid").find("input").prop('checked', false);
-
-
+        checkusersselect.destroy();
     }
     $("#starttime").val("");
     $("#endtime").val("");
@@ -404,6 +286,12 @@ function addlisttable(area, time, id) {
     myDataGrid.setPager(1, selectedData.array.length, selectedData.array.length);
     myDataGrid.render();
 
+    reloadtableData();
+    tabledatagride.dataSource.data = null;
+    tabledatagride.setDataSource(datac);
+    tabledatagride.setPager(1, datac.array.length, datac.array.length);
+    tabledatagride.render();
+
     // $('#selected_table').data('zui.datagrid').setDataSource(selectedData);
     // $('#selected_table').data('zui.datagrid').renderData();
 }
@@ -421,6 +309,12 @@ function removelisttable(area, time) {
     myDataGrid.setPager(1, selectedData.array.length, selectedData.array.length);
 
     myDataGrid.render();
+
+    reloadtableData();
+    tabledatagride.dataSource.data = null;
+    tabledatagride.setDataSource(datac);
+    tabledatagride.setPager(1, datac.array.length, datac.array.length);
+    tabledatagride.render();
     //reloadtable();
 }
 
@@ -468,7 +362,118 @@ function addTask() {
     post_common_service('/f/task/add', param, function(redata) {
         // layer.msg('已添加', { icon: 1 });
         inittAreaable($("#month_date").val(), $("#fwq").val());
+
     });
 
 
+}
+
+
+
+
+var datatemp = {};
+
+function reloadtableData() {
+    var data = datatemp.data;
+    var t = datatemp.t;
+    var starttime = datatemp.starttime;
+    var endtime = datatemp.endtime;
+    var time = datatemp.time;
+
+    datac = { cols: [], array: [] };
+
+    var days = endtime.diff(starttime, 'days');
+
+    datac.cols.push({ width: 200, name: 'type', label: "", });
+
+    for (var i = 1; i <= days; i++) {
+        var temp = moment(moment(t + "-25T23:00:00", "YYYY-MM-DD HH:mm:ss").subtract(1, 'month'));
+        var currentday = temp.add(i, "day");
+        var day = currentday.date();
+        datac.cols.push({ width: 80, name: "day_" + i, label: currentday.format("MM-DD"), html: true, className: "table_content" });
+    }
+    arealist = data;
+    stimemonth = time;
+
+    for (var index in data) {
+        var area = data[index];
+        var data_table = {};
+        data_table.type = area.name;
+        for (var i = 1; i <= days; i++) {
+            //内容
+            var temp = moment(moment(t + "-25T23:00:00", "YYYY-MM-DD HH:mm:ss").subtract(1, 'month'));
+            var currentday = temp.add(i, "day");
+            var key = area.id + "_" + currentday.format("YYYY-MM-DD");
+
+            var temphtml = "";
+
+            if (taskMap.get(key) != null) {
+                //存在稽查记录
+                var list = taskMap.get(key);
+                var hasc = 0;
+                var invc = 0;
+                list.forEach(t => {
+                    if (t.check_status == 4 || t.check_status == 16 || t.check_status == 6) {
+                        //完成稽查
+                        hasc++;
+                    }
+                    if (t.check_status == 22) {
+                        //存在无效任务
+                        invc++;
+                    }
+                });
+                //无效
+                if (invc == list.length) {
+                    temphtml = '<div class="btn-group btn_c" data-toggle="buttons" id="div_' + area.id + '_' + i + '" >' +
+                        '<label class="btn btn-info6" >' +
+                        '<input type="checkbox" name="options" onchange="selectedTask(this)" id="' + area.id + '_' + i + '"> 无效' +
+                        '</label></div>';
+                } else
+                //已完成
+                if (hasc + invc == list.length) {
+                    temphtml = '<div class="btn-group btn_c" data-toggle="buttons"  id="div_' + area.id + '_' + i + '">' +
+                        '<label class="btn btn-info5 " >' +
+                        '<input type="checkbox" name="options" onchange="selectedTask(this)" id="' + area.id + '_' + i + '"> 已稽查' +
+                        '</label></div>';
+                } else {
+                    //进行中
+                    temphtml = '<div class="btn-group btn_c" data-toggle="buttons" id="div_' + area.id + '_' + i + '" >' +
+                        '<label class="btn btn-info3" >' +
+                        '<input type="checkbox" name="options" onchange="selectedTask(this)" id="' + area.id + '_' + i + '"> 稽查中' +
+                        '</label></div>';
+                }
+
+            } else {
+
+                var isin = false;
+                if (selectedData != null && selectedData.array != null && selectedData.array.length > 0) {
+
+                    var yy = stimemonth.replace("/", "-") + "";
+                    var starttime1 = moment(moment(yy + "-25T23:00:00", "YYYY-MM-DD HH:mm:ss").subtract(1, 'month'));
+                    var ctime1 = starttime1.add(i, "day");
+                    for (var index1 in selectedData.array) {
+                        var o = selectedData.array[index1];
+
+                        if (o != null && o.areaInfo.id == area.id && ctime1.format("YYYY-MM-DD") == o.time) {
+                            isin = true;
+                            console.log(o != null && o.areaInfo.id == area.id && ctime1.format("YYYY-MM-DD") == o.time)
+                            break;
+                        }
+                    }
+
+                }
+
+
+
+                //不存在稽查
+                temphtml = '<div class="btn-group btn_c" data-toggle="buttons" id="div_' + area.id + '_' + i + '" >' +
+                    '<label class="btn btn-info2  ' + (isin ? 'active' : '') + '" >' +
+                    '<input type="checkbox" name="options" ' + (isin ? 'checked="true"' : '') + '  onchange="selectedTask(this)" id="' + area.id + '_' + i + '"> 待稽查' +
+                    '</label></div>';
+            }
+
+            data_table["day_" + i] = temphtml;
+        }
+        datac.array.push(data_table);
+    }
 }

+ 13 - 3
VisualInspection/fwq/view/task/add.html

@@ -22,9 +22,19 @@
     table th {
         text-align: center;
     }
-    .laydate-time-list{padding-bottom:0;overflow:hidden}
-    .laydate-time-list>li{width:50%!important;}
-    .laydate-time-list>li:last-child { display: none;} 
+    
+    .laydate-time-list {
+        padding-bottom: 0;
+        overflow: hidden
+    }
+    
+    .laydate-time-list>li {
+        width: 50%!important;
+    }
+    
+    .laydate-time-list>li:last-child {
+        display: none;
+    }
 </style>
 
 <div class="container-fluid ">

+ 1 - 0
VisualInspection/js/lib/combotree/comboTreePlugin.js

@@ -26,6 +26,7 @@
         this._defaults = defaults;
         this._name = comboTreePlugin;
 
+
         this.init();
     }
 

+ 11 - 0
VisualInspection/js/util/util.js

@@ -858,4 +858,15 @@ function getCurrentTimeFormat() {
 
 function GV(selector) {
     return $(selector).val();
+}
+
+function deepCopy(obj) {
+    if (typeof obj != 'object') {
+        return obj;
+    }
+    var newobj = {};
+    for (var attr in obj) {
+        newobj[attr] = deepCopy(obj[attr]);
+    }
+    return newobj;
 }

+ 189 - 186
VisualInspection/node_modules/zui/dist/lib/datagrid/zui.datagrid.js

@@ -1,7 +1,7 @@
 /*!
  * ZUI: 数据表格② - v1.8.1 - 2018-01-18
  * http://zui.sexy
- * GitHub: https://github.com/easysoft/zui.git 
+ * GitHub: https://github.com/easysoft/zui.git
  * Copyright (c) 2018 cnezsoft.com; Licensed MIT
  */
 
@@ -13,8 +13,8 @@
  * http://jquery.org/license
  */
 
-(function (factory) {
-    if ( typeof define === 'function' && define.amd ) {
+(function(factory) {
+    if (typeof define === 'function' && define.amd) {
         // AMD. Register as an anonymous module.
         define(['jquery'], factory);
     } else if (typeof exports === 'object') {
@@ -24,17 +24,16 @@
         // Browser globals
         factory(jQuery);
     }
-}(function ($) {
+}(function($) {
 
-    var toFix  = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
-        toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
-                    ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
-        slice  = Array.prototype.slice,
+    var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
+        toBind = ('onwheel' in document || document.documentMode >= 9) ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
+        slice = Array.prototype.slice,
         nullLowestDeltaTimeout, lowestDelta;
 
-    if ( $.event.fixHooks ) {
-        for ( var i = toFix.length; i; ) {
-            $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
+    if ($.event.fixHooks) {
+        for (var i = toFix.length; i;) {
+            $.event.fixHooks[toFix[--i]] = $.event.mouseHooks;
         }
     }
 
@@ -42,9 +41,9 @@
         version: '3.1.12',
 
         setup: function() {
-            if ( this.addEventListener ) {
-                for ( var i = toBind.length; i; ) {
-                    this.addEventListener( toBind[--i], handler, false );
+            if (this.addEventListener) {
+                for (var i = toBind.length; i;) {
+                    this.addEventListener(toBind[--i], handler, false);
                 }
             } else {
                 this.onmousewheel = handler;
@@ -55,9 +54,9 @@
         },
 
         teardown: function() {
-            if ( this.removeEventListener ) {
-                for ( var i = toBind.length; i; ) {
-                    this.removeEventListener( toBind[--i], handler, false );
+            if (this.removeEventListener) {
+                for (var i = toBind.length; i;) {
+                    this.removeEventListener(toBind[--i], handler, false);
                 }
             } else {
                 this.onmousewheel = null;
@@ -82,7 +81,7 @@
 
         settings: {
             adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
-            normalizeOffset: true  // calls getBoundingClientRect for each event
+            normalizeOffset: true // calls getBoundingClientRect for each event
         }
     };
 
@@ -98,25 +97,25 @@
 
 
     function handler(event) {
-        var orgEvent   = event || window.event,
-            args       = slice.call(arguments, 1),
-            delta      = 0,
-            deltaX     = 0,
-            deltaY     = 0,
-            absDelta   = 0,
-            offsetX    = 0,
-            offsetY    = 0;
+        var orgEvent = event || window.event,
+            args = slice.call(arguments, 1),
+            delta = 0,
+            deltaX = 0,
+            deltaY = 0,
+            absDelta = 0,
+            offsetX = 0,
+            offsetY = 0;
         event = $.event.fix(orgEvent);
         event.type = 'mousewheel';
 
         // Old school scrollwheel delta
-        if ( 'detail'      in orgEvent ) { deltaY = orgEvent.detail * -1;      }
-        if ( 'wheelDelta'  in orgEvent ) { deltaY = orgEvent.wheelDelta;       }
-        if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY;      }
-        if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
+        if ('detail' in orgEvent) { deltaY = orgEvent.detail * -1; }
+        if ('wheelDelta' in orgEvent) { deltaY = orgEvent.wheelDelta; }
+        if ('wheelDeltaY' in orgEvent) { deltaY = orgEvent.wheelDeltaY; }
+        if ('wheelDeltaX' in orgEvent) { deltaX = orgEvent.wheelDeltaX * -1; }
 
         // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
-        if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
+        if ('axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS) {
             deltaX = deltaY * -1;
             deltaY = 0;
         }
@@ -125,62 +124,62 @@
         delta = deltaY === 0 ? deltaX : deltaY;
 
         // New school wheel delta (wheel event)
-        if ( 'deltaY' in orgEvent ) {
+        if ('deltaY' in orgEvent) {
             deltaY = orgEvent.deltaY * -1;
-            delta  = deltaY;
+            delta = deltaY;
         }
-        if ( 'deltaX' in orgEvent ) {
+        if ('deltaX' in orgEvent) {
             deltaX = orgEvent.deltaX;
-            if ( deltaY === 0 ) { delta  = deltaX * -1; }
+            if (deltaY === 0) { delta = deltaX * -1; }
         }
 
         // No change actually happened, no reason to go any further
-        if ( deltaY === 0 && deltaX === 0 ) { return; }
+        if (deltaY === 0 && deltaX === 0) { return; }
 
         // Need to convert lines and pages to pixels if we aren't already in pixels
         // There are three delta modes:
         //   * deltaMode 0 is by pixels, nothing to do
         //   * deltaMode 1 is by lines
         //   * deltaMode 2 is by pages
-        if ( orgEvent.deltaMode === 1 ) {
+        if (orgEvent.deltaMode === 1) {
             var lineHeight = $.data(this, 'mousewheel-line-height');
-            delta  *= lineHeight;
+            delta *= lineHeight;
             deltaY *= lineHeight;
             deltaX *= lineHeight;
-        } else if ( orgEvent.deltaMode === 2 ) {
+        } else if (orgEvent.deltaMode === 2) {
             var pageHeight = $.data(this, 'mousewheel-page-height');
-            delta  *= pageHeight;
+            delta *= pageHeight;
             deltaY *= pageHeight;
             deltaX *= pageHeight;
         }
 
         // Store lowest absolute delta to normalize the delta values
-        absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
+        absDelta = Math.max(Math.abs(deltaY), Math.abs(deltaX));
 
-        if ( !lowestDelta || absDelta < lowestDelta ) {
+        if (!lowestDelta || absDelta < lowestDelta) {
             lowestDelta = absDelta;
 
             // Adjust older deltas if necessary
-            if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+            if (shouldAdjustOldDeltas(orgEvent, absDelta)) {
                 lowestDelta /= 40;
             }
         }
 
         // Adjust older deltas if necessary
-        if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+        if (shouldAdjustOldDeltas(orgEvent, absDelta)) {
             // Divide all the things by 40!
-            delta  /= 40;
+            delta /= 40;
             deltaX /= 40;
             deltaY /= 40;
         }
 
         // Get a whole, normalized value for the deltas
-        delta  = Math[ delta  >= 1 ? 'floor' : 'ceil' ](delta  / lowestDelta);
-        deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
-        deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
+        delta = Math[delta >= 1 ? 'floor' : 'ceil'](delta / lowestDelta);
+        deltaX = Math[deltaX >= 1 ? 'floor' : 'ceil'](deltaX / lowestDelta);
+        deltaY = Math[deltaY >= 1 ? 'floor' : 'ceil'](deltaY / lowestDelta);
 
         // Normalise offsetX and offsetY properties
-        if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
+        if (special.settings.normalizeOffset && this.getBoundingClientRect) {
             var boundingRect = this.getBoundingClientRect();
             offsetX = event.clientX - boundingRect.left;
             offsetY = event.clientY - boundingRect.top;
@@ -238,7 +237,7 @@
 (function($, undefined) {
     'use strict';
 
-    var loadDataSourceFromTable = function ($table) {
+    var loadDataSourceFromTable = function($table) {
         var cols = [];
         $table.find('thead>tr:first>th').each(function(idx) {
             var $th = $(this);
@@ -291,12 +290,11 @@
         }
     };
 
-    var DEFAULT_CONFIGS = {
-    };
+    var DEFAULT_CONFIGS = {};
 
     var DEFAULT_PAGER = {
-        page: 0,        // current page index
-        recTotal: 0,    // records total count
+        page: 0, // current page index
+        recTotal: 0, // records total count
         recPerPage: 10, // records count per page
     };
 
@@ -319,7 +317,8 @@
     var DEFAULT_SEARCH_FUNC = function(item, searchKeyArr) {
         var score = 0;
         var searchKeyLength = searchKeyArr.length;
-        var matchKeysCount = 0, matchKeys = {};
+        var matchKeysCount = 0,
+            matchKeys = {};
         $.each(item, function(key, value) {
             var valueType = typeof value;
             if (valueType === 'number' || valueType === 'number') {
@@ -328,7 +327,7 @@
                 value = JSON.stringify(valueType);
             }
             var keyScore = 0;
-            for(var i = 0; i < searchKeyLength; ++i) {
+            for (var i = 0; i < searchKeyLength; ++i) {
                 var search = searchKeyArr[i];
                 if (value.includes(search)) {
                     if (value.startsWith(search)) {
@@ -374,20 +373,20 @@
 
     // The datagrid modal class
     var DataGrid = function(element, options) {
-        var that       = this;
-        var $element   = that.$ = $(element);
-        that.name      = NAME;
-        that.uuid      = $.zui.uuid();
-        that.id        = 'zui-datagrid-' + that.uuid;
-        options        = $.extend({}, DataGrid.DEFAULTS, that.$.data(), options);
+        var that = this;
+        var $element = that.$ = $(element);
+        that.name = NAME;
+        that.uuid = $.zui.uuid();
+        that.id = 'zui-datagrid-' + that.uuid;
+        options = $.extend({}, DataGrid.DEFAULTS, that.$.data(), options);
 
-        var lang   = options.lang || 'zh_cn';
-        that.lang  = $.isPlainObject(lang) ? ($.extend(true, {}, LANG[lang.lang || $.zui.clientLang()], lang)) : LANG[lang];
+        var lang = options.lang || 'zh_cn';
+        that.lang = $.isPlainObject(lang) ? ($.extend(true, {}, LANG[lang.lang || $.zui.clientLang()], lang)) : LANG[lang];
 
-        options.valueOperator    = $.extend({}, DEFAULT_VALUE_OPERATOR, options.valueOperator);
+        options.valueOperator = $.extend({}, DEFAULT_VALUE_OPERATOR, options.valueOperator);
         options.rowDefaultHeight = options.rowDefaultHeight || 30;
-        options.headerHeight     = options.headerHeight || options.rowDefaultHeight || 30;
-        that.options             = options;
+        options.headerHeight = options.headerHeight || options.rowDefaultHeight || 30;
+        that.options = options;
         if (typeof options.borderWidth !== 'number') {
             options.borderWidth = 1;
         }
@@ -404,7 +403,7 @@
             $container = $('<div class="datagrid-container" />').appendTo($element);
         }
         $container.css({
-            width:       options.width,
+            width: options.width,
             borderWidth: options.borderWidth
         });
         var $document = $(document);
@@ -430,7 +429,7 @@
                 if (isClickBar) {
                     offset = (lastPos - startPagePos) + startScrollOffset;
                 } else {
-                    offset = Math.max(0, Math.min(scroll.space, pos - Math.round(scroll.barSize/2)));
+                    offset = Math.max(0, Math.min(scroll.space, pos - Math.round(scroll.barSize / 2)));
                 }
                 if (direction === 'h') {
                     that.setScrollbarOffset(offset);
@@ -479,22 +478,22 @@
             $cells = $('<div class="datagrid-cells" />').appendTo($container);
         }
         $cells.toggleClass('datagrid-hover-cell', !!options.hoverCell)
-              .toggleClass('datagrid-hover-row', !!options.hoverRow)
-              .toggleClass('datagrid-hover-col', !!options.hoverCol)
-              .toggleClass('datagrid-hover-shadow', !!options.hoverCol);
+            .toggleClass('datagrid-hover-row', !!options.hoverRow)
+            .toggleClass('datagrid-hover-col', !!options.hoverCol)
+            .toggleClass('datagrid-hover-shadow', !!options.hoverCol);
         that.$cells = $cells;
 
         // configs is an object
         that.isFuncConfigs = $.isFunction(options.configs);
         that.configs = that.isFuncConfigs ? options.configs : $.extend({}, DEFAULT_CONFIGS, options.configs);
 
-        that.layout       = {scrollLeft: 0, scrollTop: 0};
+        that.layout = { scrollLeft: 0, scrollTop: 0 };
         that.configsCache = {};
-        that.userConfigs  = {};
+        that.userConfigs = {};
 
         // states is 2D arrays
-        that.states    = $.extend(true, {}, DEFAULT_STATES, options.states);
-        that.cells     = [];
+        that.states = $.extend(true, {}, DEFAULT_STATES, options.states);
+        that.cells = [];
         that.setPager(that.states.pager);
 
         that.setDataSource(options.dataSource);
@@ -581,9 +580,9 @@
         // Init searchbox
         if ($.fn.searchBox) {
             var $searchBox = that.$.find('.search-box');
-            if($searchBox)  {
+            if ($searchBox) {
                 that.searchbox = $searchBox.searchBox({
-                    onSearchChange: function (searchString) {
+                    onSearchChange: function(searchString) {
                         that.search(searchString);
                     }
                 });
@@ -676,7 +675,7 @@
             dataSource.array = data;
             dataSource.length = data.length;
             that.setPager('', data.length);
-        } else  if ($.isPlainObject(data)) {
+        } else if ($.isPlainObject(data)) {
             dataSource = $.extend(dataSource, data);
         } else if (typeof data === 'string') {
             dataSource.remote = data;
@@ -703,7 +702,7 @@
             for (var i = 0; i < cols.length; ++i) {
                 var col = cols[i];
                 if (typeof col === 'string') {
-                    cols[i] = {name: col};
+                    cols[i] = { name: col };
                 }
             }
         }
@@ -765,11 +764,11 @@
         var that = this;
         var states = that.states;
         return {
-            page:       that.pager.page,
+            page: that.pager.page,
             recPerPage: that.pager.recPerPage,
-            search:     states.search,
-            sortBy:     states.sortBy,
-            order:      states.order
+            search: states.search,
+            sortBy: states.sortBy,
+            order: states.order
         };
     };
 
@@ -803,7 +802,7 @@
             var remote = dataSource.remote;
             if (!loadData && remote) {
                 loadData = function(params, onFinish) {
-                    var ajaxOptions = $.isFunction(remote) ? remote(params, that) : {url: remote};
+                    var ajaxOptions = $.isFunction(remote) ? remote(params, that) : { url: remote };
                     $.ajax($.extend({
                         type: 'GET',
                         data: params,
@@ -971,7 +970,7 @@
                 height: layout.headerHeight
             };
         }
-        var rowHeight =  layout.rowHeight;
+        var rowHeight = layout.rowHeight;
         return {
             height: rowHeight,
             top: layout.headerHeight + (rowIndex > 1 ? ((rowIndex - 1) * rowHeight) : 0) + rowIndex * layout.borderWidth
@@ -979,15 +978,15 @@
     };
 
     DataGrid.prototype.updateLayout = function() {
-        var that            = this;
-        var options         = that.options;
-        var layout          = that.layout;
-        var data            = that.data;
-        var pager           = that.pager;
-        var dataLength      = pager.pageRecCount;
-        var $container      = that.$container;
-        var containerWidth  = $container.width();
-        var dataSource      = that.dataSource;
+        var that = this;
+        var options = that.options;
+        var layout = that.layout;
+        var data = that.data;
+        var pager = that.pager;
+        var dataLength = pager.pageRecCount;
+        var $container = that.$container;
+        var containerWidth = $container.width();
+        var dataSource = that.dataSource;
 
         if (!dataSource.cols.length && dataLength) {
             $.each(that.getDataItem(0), function(name) {
@@ -999,21 +998,21 @@
 
         // Caculate cols layout
         if (!layout.cols) {
-            var cols                = dataSource.cols;
-            var colAutoMinWidth     = options.colAutoMinWidth;
+            var cols = dataSource.cols;
+            var colAutoMinWidth = options.colAutoMinWidth;
             var colAutoDefaultWidth = options.colAutoDefaultWidth;
-            var growTotal           = 0;
-            var minGrowWidth        = 0;
-            var rowIndexWidth       = options.rowIndexWidth;
-            var colsLayout          = [{
+            var growTotal = 0;
+            var minGrowWidth = 0;
+            var rowIndexWidth = options.rowIndexWidth;
+            var colsLayout = [{
                 left: 0,
                 width: options.showRowIndex ? (rowIndexWidth === 'auto' ? ((dataLength + that.pager.skip + '').length * 8 + 18) : rowIndexWidth) : 0
             }];
-            var cellsTotalWidth     = 0;
-            var fixedWidth          = colsLayout[0].width;
-            var lastGrowColIndex    = false;
-            var lastMaxGrow         = 0;
-            var checkBoxColIndex    = 0;
+            var cellsTotalWidth = 0;
+            var fixedWidth = colsLayout[0].width;
+            var lastGrowColIndex = false;
+            var lastMaxGrow = 0;
+            var checkBoxColIndex = 0;
             var colLayout, colWidth;
 
             for (var i = 0; i < cols.length; ++i) {
@@ -1023,13 +1022,13 @@
                 if (!colWidth || colWidth === 'auto') {
                     colWidth = 0.1;
                 }
-                colLayout = {left: 0};
+                colLayout = { left: 0 };
                 if (colWidth >= 1) {
                     if (col.minWidth !== undefined) {
                         colWidth = Math.max(colWidth, col.minWidth);
                     }
                     colLayout.width = colWidth;
-                    fixedWidth     += colWidth;
+                    fixedWidth += colWidth;
                 } else {
                     if (col.minWidth === undefined) {
                         col.minWidth = colAutoMinWidth;
@@ -1038,13 +1037,13 @@
                     growTotal += colWidth;
                     minGrowWidth += col.minWidth;
                     if (lastMaxGrow <= colLayout.grow) {
-                        lastMaxGrow      = colLayout.grow;
+                        lastMaxGrow = colLayout.grow;
                         lastGrowColIndex = i + 1;
                     }
                 }
                 colLayout.minWidth = col.minWidth;
                 if (!checkBoxColIndex && col.checkbox) {
-                    checkBoxColIndex   = i + 1;
+                    checkBoxColIndex = i + 1;
                     colLayout.checkbox = true;
                 }
                 colsLayout.push(colLayout);
@@ -1056,9 +1055,9 @@
                     fixedWidth += 30;
                 }
             }
-            var flexWidth    = containerWidth - fixedWidth;
+            var flexWidth = containerWidth - fixedWidth;
             var autoOverflow = flexWidth < minGrowWidth;
-            var colsLenght   = colsLayout.length;
+            var colsLenght = colsLayout.length;
             for (var j = 0; j < colsLenght; ++j) {
                 colLayout = colsLayout[j];
                 colWidth = colLayout.width;
@@ -1087,14 +1086,14 @@
             layout.cols = colsLayout;
         }
 
-        layout.containerWidth  = containerWidth;
-        layout.rowHeight       = options.rowDefaultHeight;
-        layout.borderWidth     = options.borderWidth;
-        layout.headerHeight    = options.showHeader ? (options.headerHeight) : 0;
-        layout.rowsLength      = dataLength + 1;
-        layout.colsLength      = layout.cols.length;
-        layout.height          = layout.headerHeight + dataLength * (layout.rowHeight + layout.borderWidth);
-        layout.spanMap         = {};
+        layout.containerWidth = containerWidth;
+        layout.rowHeight = options.rowDefaultHeight;
+        layout.borderWidth = options.borderWidth;
+        layout.headerHeight = options.showHeader ? (options.headerHeight) : 0;
+        layout.rowsLength = dataLength + 1;
+        layout.colsLength = layout.cols.length;
+        layout.height = layout.headerHeight + dataLength * (layout.rowHeight + layout.borderWidth);
+        layout.spanMap = {};
 
         var containerHeight = options.height;
         if (containerHeight === 'page') {
@@ -1103,8 +1102,8 @@
         $container.css('height', containerHeight);
         layout.containerHeight = containerHeight;
 
-        layout.vScrollSpare    = layout.height - layout.containerHeight;
-        layout.hScrollSpare    = layout.width - layout.containerWidth;
+        layout.vScrollSpare = layout.height - layout.containerHeight;
+        layout.hScrollSpare = layout.width - layout.containerWidth;
 
         that.layout = layout;
 
@@ -1124,8 +1123,8 @@
         var cell = {
             rowIndex: rowIndex,
             colIndex: colIndex,
-            config:   config,
-            checked:  that.isRowChecked(config.rowId)
+            config: config,
+            checked: that.isRowChecked(config.rowId)
         };
         if (colIndex === 0) {
             type = 'index';
@@ -1167,8 +1166,8 @@
     };
 
     DataGrid.prototype.getRowConfig = function(rowIndex) {
-        var that   = this;
-        var rowId  = 'R' + rowIndex;
+        var that = this;
+        var rowId = 'R' + rowIndex;
         var config = that.configsCache[rowId];
         if (!config) {
             config = $.extend({
@@ -1200,8 +1199,7 @@
         // var config = that.configsCache[colId];
         var config = null;
         if (!config) {
-            config = $.extend(
-                {
+            config = $.extend({
                     // html: false,
                     // style: null,
                     // className: '',
@@ -1225,8 +1223,7 @@
         // var config = that.configsCache[cellId];
         var config = null;
         if (!config) {
-            config = $.extend(
-                {id: cellId},
+            config = $.extend({ id: cellId },
                 that.getColConfig(colIndex),
                 that.getRowConfig(rowIndex),
                 that.isFuncConfigs ? that.configs(cellId) : that.configs[cellId],
@@ -1242,10 +1239,10 @@
     };
 
     DataGrid.prototype.checkRow = function(rowIndex, checked) {
-        var that       = this;
+        var that = this;
         var selections = that.states.selections;
-        var rowConfig  = that.getRowConfig(rowIndex);
-        var rowId      = rowConfig.rowId;
+        var rowConfig = that.getRowConfig(rowIndex);
+        var rowId = rowConfig.rowId;
         if (checked === undefined) {
             checked = !selections[rowId];
         }
@@ -1281,29 +1278,29 @@
     };
 
     DataGrid.prototype.renderCell = function(rowIndex, colIndex, $row) {
-        var that       = this;
-        var options    = that.options;
-        var cell       = that.getCell(rowIndex, colIndex);
-        var config     = cell.config;
+        var that = this;
+        var options = that.options;
+        var cell = that.getCell(rowIndex, colIndex);
+        var config = cell.config;
 
         if (cell.hidden) {
             return;
         }
 
         var isCheckbox = config.checkbox;
-        var elementId  = [that.id, 'cell', rowIndex, colIndex].join('-');
-        var $cell      = $('#' + elementId);
+        var elementId = [that.id, 'cell', rowIndex, colIndex].join('-');
+        var $cell = $('#' + elementId);
         if (!$cell.length) {
             $row = $row || $('#' + that.id + '-row-' + rowIndex);
             $cell = (options.cellCreator ? options.cellCreator(cell, that) : $('<div class="datagrid-cell" />')).appendTo($row);
             $cell.attr({
-                id: elementId,
-                'data-type': cell.type,
-                'data-col': cell.colIndex,
-                'data-row': cell.rowIndex
-            }).toggleClass('datagrid-cell-head', rowIndex === 0)
-              .toggleClass('datagrid-cell-cell', cell.type === 'cell')
-              .toggleClass('datagrid-cell-index', colIndex === 0);
+                    id: elementId,
+                    'data-type': cell.type,
+                    'data-col': cell.colIndex,
+                    'data-row': cell.rowIndex
+                }).toggleClass('datagrid-cell-head', rowIndex === 0)
+                .toggleClass('datagrid-cell-cell', cell.type === 'cell')
+                .toggleClass('datagrid-cell-index', colIndex === 0);
 
             if (isCheckbox) {
                 var $checkbox = $cell.find('.datagrid-checkbox');
@@ -1315,9 +1312,9 @@
         }
 
         // Caculate cell style
-        var borderWidth     = options.borderWidth;
-        var layout          = that.layout;
-        var colsLength      = layout.colsLength;
+        var borderWidth = options.borderWidth;
+        var layout = that.layout;
+        var colsLength = layout.colsLength;
         var cellBoundsStyle = {
             top: borderWidth ? -borderWidth : 0,
             bottom: borderWidth ? -borderWidth : 0,
@@ -1365,7 +1362,7 @@
                 $cell.addClass('datagrid-col-sortable');
             }
             $sorter.toggleClass('datagrid-sort-up', sorted === 'up')
-                   .toggleClass('datagrid-sort-down', sorted === 'down');
+                .toggleClass('datagrid-sort-down', sorted === 'down');
         }
 
         if (isCheckbox) {
@@ -1376,25 +1373,25 @@
     };
 
     DataGrid.prototype.renderRow = function(rowIndex) {
-        var that       = this;
-        var layout     = that.layout;
-        var options    = that.options;
-        var rowLayout  = that.getRowLayout(rowIndex);
+        var that = this;
+        var layout = that.layout;
+        var options = that.options;
+        var rowLayout = that.getRowLayout(rowIndex);
         var colsLength = layout.colsLength;
-        var elementId  = that.id + '-row-' + rowIndex;
-        var $row       = $('#' + elementId);
+        var elementId = that.id + '-row-' + rowIndex;
+        var $row = $('#' + elementId);
         if (!$row.length) {
             $row = (options.rowCreator ? options.rowCreator(rowIndex, that) : $('<div class="datagrid-row" />')).appendTo(that.$cells);
             $row.attr({
-                id: elementId,
-                'data-row': rowIndex,
-                'data-id': rowIndex
-            }).css({
-                top: layout.partialRendering ? (rowLayout.top - layout.scrollTop) : rowLayout.top,
-                height: rowLayout.height
-            }).toggleClass('datagrid-row-head', rowIndex === 0)
-              .toggleClass('datagrid-row-cell', rowIndex !== 0);
-        } else if(layout.partialRendering) {
+                    id: elementId,
+                    'data-row': rowIndex,
+                    'data-id': rowIndex
+                }).css({
+                    top: layout.partialRendering ? (rowLayout.top - layout.scrollTop) : rowLayout.top,
+                    height: rowLayout.height
+                }).toggleClass('datagrid-row-head', rowIndex === 0)
+                .toggleClass('datagrid-row-cell', rowIndex !== 0);
+        } else if (layout.partialRendering) {
             $row.css('top', rowLayout.top - layout.scrollTop);
         }
         for (var i = 0; i < colsLength; ++i) {
@@ -1403,20 +1400,21 @@
         return $row;
     };
 
+
     DataGrid.prototype.renderData = function() {
-        var that           = this;
-        var layout         = that.layout;
+        var that = this;
+        var layout = that.layout;
 
         if (!layout.cols) {
             that.updateLayout();
         }
 
         var startRenderRow = 1;
-        var endRenderRow   = layout.rowsLength - 1;
+        var endRenderRow = layout.rowsLength - 1;
         if (layout.partialRendering) {
             var rowHeight = layout.rowHeight + layout.borderWidth;
-            startRenderRow = Math.min(endRenderRow, Math.max(1, Math.floor((layout.scrollTop - layout.headerHeight)/rowHeight)));
-            endRenderRow = Math.min(endRenderRow, Math.max(1, Math.ceil((layout.scrollTop + layout.containerHeight - layout.headerHeight)/rowHeight)));
+            startRenderRow = Math.min(endRenderRow, Math.max(1, Math.floor((layout.scrollTop - layout.headerHeight) / rowHeight)));
+            endRenderRow = Math.min(endRenderRow, Math.max(1, Math.ceil((layout.scrollTop + layout.containerHeight - layout.headerHeight) / rowHeight)));
             that.$cells.find('.datagrid-row').each(function() {
                 var $row = $(this);
                 var rowIndex = $row.data('row');
@@ -1424,6 +1422,8 @@
                     $row.remove();
                 }
             });
+
+            // console.log("---------------------");
         }
 
         // Render header
@@ -1454,10 +1454,13 @@
         if (that.pagerObj) {
             that.pagerObj.set(that.pager);
         }
+        if (layout.partialRendering) {
+            that.$.callComEvent(that, 'onRender');
+        }
     };
 
     DataGrid.prototype.render = function(ignoreDelay) {
-        var that    = this;
+        var that = this;
         var options = that.options;
 
         if (!ignoreDelay && options.renderDelay) {
@@ -1498,10 +1501,10 @@
     };
 
     DataGrid.prototype.setScrollbarOffset = function(offsetX, offsetY) {
-        var that       = this;
-        var layout     = that.layout;
+        var that = this;
+        var layout = that.layout;
         var scrollLeft = layout.scrollLeft;
-        var scrollTop  = layout.scrollTop;
+        var scrollTop = layout.scrollTop;
         if (typeof offsetX === 'number') {
             var hScroll = layout.hScroll;
             if (hScroll.offset !== offsetX) {
@@ -1518,10 +1521,10 @@
     };
 
     DataGrid.prototype.renderScrolls = function() {
-        var that     = this;
-        var layout   = that.layout;
-        var vSize    = layout.vScrollSpare;
-        var hSize    = layout.hScrollSpare;
+        var that = this;
+        var layout = that.layout;
+        var vSize = layout.vScrollSpare;
+        var hSize = layout.hScrollSpare;
         var showVBar = vSize > 0;
         var showHBar = hSize > 0;
         that.$vScroll.toggle(showVBar);
@@ -1574,7 +1577,7 @@
 
     DataGrid.prototype.scroll = function(scrollLeft, scrollTop, ignoreDelay) {
         var that = this;
-        var now  = new Date();
+        var now = new Date();
         var scrollDelay = that.options.scrollDelay;
         if (scrollDelay) {
             if (!ignoreDelay && that.lastScrollTime && (now - that.lastScrollTime) < scrollDelay) {
@@ -1594,7 +1597,8 @@
             that.lastScrollTime = now;
         }
         var layout = that.layout;
-        var hScrolled = false, vScrolled = false;
+        var hScrolled = false,
+            vScrolled = false;
         if (typeof scrollLeft === 'number') {
             scrollLeft = Math.max(0, Math.min(scrollLeft, layout.width - layout.containerWidth));
             if (scrollLeft !== layout.scrollLeft) {
@@ -1619,11 +1623,11 @@
             that.renderFixeds();
         }
 
-        that.$.callComEvent(that, 'onScroll', [scrollLeft, scrollTop, {vScrolled: vScrolled, hScrolled: hScrolled}]);
+        that.$.callComEvent(that, 'onScroll', [scrollLeft, scrollTop, { vScrolled: vScrolled, hScrolled: hScrolled }]);
     };
 
     DataGrid.prototype.renderFixeds = function() {
-        var that   = this;
+        var that = this;
         var states = that.states;
         var layout = that.layout;
 
@@ -1807,9 +1811,9 @@
             var data = $this.data(NAME);
             var options = typeof option == 'object' && option;
 
-            if(!data) $this.data(NAME, (data = new DataGrid(this, options)));
+            if (!data) $this.data(NAME, (data = new DataGrid(this, options)));
 
-            if(typeof option == 'string') data[option]();
+            if (typeof option == 'string') data[option]();
         });
     };
 
@@ -1821,5 +1825,4 @@
     $(function() {
         $('[data-ride="datagrid"]').datagrid();
     });
-}(jQuery, undefined));
-
+}(jQuery, undefined));

Файловите разлики са ограничени, защото са твърде много
+ 21 - 2601
VisualInspection_server/visual/visual.log


+ 5 - 3
Visuallnspection_fjq/visuallnspection_fjq/src/main/resources/application.properties

@@ -18,15 +18,17 @@ dubbo.protocol.status = server
 ## RegistryConfig Bean
 dubbo.registry.id = fjq_service
 #dubbo.registry.address = zookeeper://git.topm.win:9994
-dubbo.registry.address = zookeeper://100.0.0.3:2181
+#dubbo.registry.address = zookeeper://100.0.0.3:2181
+dubbo.registry.address = zookeeper://127.0.0.1:2181
+
 dubbo.registry.file = ./output/dubbo1.cache
 dubbo.reference.check=false
 dubbo.consumer.check=false
 
 
 
-master.datasource.url = jdbc:mysql://10.112.0.199:3306/visualinspection_2?useUnicode=true&characterEncoding=utf-8
-#master.datasource.url = jdbc:mysql://xt.wenhq.top:8082/visualinspection_2?useUnicode=true&characterEncoding=utf-8
+#master.datasource.url = jdbc:mysql://10.112.0.199:3306/visualinspection_2?useUnicode=true&characterEncoding=utf-8
+master.datasource.url = jdbc:mysql://xt.wenhq.top:8082/visualinspection_2?useUnicode=true&characterEncoding=utf-8
 #master.datasource.url = jdbc:mysql://git.topm.win:6381/visualinspection?useUnicode=true&characterEncoding=utf-8
 #master.datasource.url = jdbc:mysql://10.112.0.199:7002/visualinspection_2?useUnicode=true&characterEncoding=utf-8
 master.datasource.username = root

Някои файлове не бяха показани, защото твърде много файлове са промени