Browse Source

滚动顶部停留,适配多分辨率设备,同步服务器版本

konghe 1 year ago
parent
commit
57889ce66c

+ 2 - 2
wwwroot/main/DashBoard/rpt011/index.html

@@ -39,8 +39,8 @@
                 <thead id="报表表头">
                     <tr>
                         <th scope="col" data-field="组别" data-width="160" class="text-center dk-report-row2">组别</th>
-                        <th scope="col" data-field="成型工号" data-width="160" class="text-center dk-report-row2">成型工号</th>
-                        <th scope="col" data-field="物料名称" data-width="180" class="text-center dk-report-row2">物料名称</th>
+                        <th scope="col" data-field="成型工号" data-width="200" class="text-center dk-report-row2">成型工号</th>
+                        <th scope="col" data-field="物料名称" data-width="200" class="text-center dk-report-row2">物料名称</th>
                         <th scope="col" data-field="成型" class="text-center dk-report-row2">成型</th>
                         <th scope="col" data-field="成型线号" data-width="180" class="text-center dk-report-row2">成型线号</th>
                         <th scope="col" data-field="接收数量" data-width="120" class="text-center dk-report-row2">接收数量</th>

+ 77 - 66
wwwroot/main/DashBoard/rpt012/index.html

@@ -34,62 +34,63 @@
         <h4 class="text-center pb-2 dk-report-title2">一次烧成型缺陷统计表</h4>
         <table id="表头" class="table table-bordered table-hover table-striped pb-0 mb-0" style="font-size:14px;">
         </table>
-        <div id="mTable" style="height:826px;overflow-y:hidden;">
-            <table id="报表" data-show-header="false" class="table table-bordered table-hover table-striped" style="font-size:14px;">
-                <thead id="报表表头">
-                    <!--<tr>
-                        <th scope="col" data-field="组别" data-width="96" class="text-center dk-report-row2">组别</th>
-                        <th scope="col" data-field="工号" data-width="79" class="text-center dk-report-row2">工号</th>
-                        <th scope="col" data-field="姓名" data-width="233" class="text-center dk-report-row2">姓名</th>
-                        <th scope="col" data-field="产品编码" data-width="110" class="text-center dk-report-row2">产品编码</th>
-                        <th scope="col" data-field="出窑数" data-width="80" class="text-center dk-report-row2">出窑数</th>
-                        <th scope="col" data-field="合格数" data-width="80" class="text-center dk-report-row2">合格数</th>
-                        <th scope="col" data-field="缺陷率" data-width="80" class="text-center dk-report-row2">缺陷率</th>
-                        <th scope="col" data-field="成裂" data-width="60" class="text-center dk-report-row2">成裂</th>
-                        <th scope="col" data-field="棕眼" data-width="60" class="text-center dk-report-row2">棕眼</th>
-                        <th scope="col" data-field="糙活" data-width="60" class="text-center dk-report-row2">糙活</th>
-                        <th scope="col" data-field="成脏" data-width="60" class="text-center dk-report-row2">成脏</th>
-                        <th scope="col" data-field="成走" data-width="60" class="text-center dk-report-row2">成走</th>
-                        <th scope="col" data-field="注泡" data-width="60" class="text-center dk-report-row2">注泡</th>
-                        <th scope="col" data-field="坯脏" data-width="60" class="text-center dk-report-row2">坯脏</th>
-                        <th scope="col" data-field="孔不良" data-width="60" class="text-center dk-report-row2">孔</th>
-                        <th scope="col" data-field="排水不良" data-width="60" class="text-center dk-report-row2">排水</th>
-                        <th scope="col" data-field="泥绺" data-width="60" class="text-center dk-report-row2">泥绺</th>
-                        <th scope="col" data-field="漏气" data-width="60" class="text-center dk-report-row2">漏气</th>
-                        <th scope="col" data-field="卡球" data-width="60" class="text-center dk-report-row2">卡球</th>
-                        <th scope="col" data-field="炸圈" data-width="60" class="text-center dk-report-row2">炸圈</th>
-                        <th scope="col" data-field="合计" data-width="60" class="text-center dk-report-row2">合计</th>
-                    </tr>-->
-                    <tr>
-                        <th scope="col" data-field="组别" data-width="96"  class="text-center dk-report-row2">组别</th>
-                        <th scope="col" data-field="工号" data-width="79" class="text-center dk-report-row2">工号</th>
-                        <th scope="col" data-field="姓名" data-width="233" class="text-center dk-report-row2">姓名</th>
-                        <th scope="col" data-field="产品编码"  data-width="110" class="text-center dk-report-row2">产品编码</th>
-                        <th scope="col" data-field="出窑数" data-width="80" class="text-center dk-report-row2">出窑数</th>
-                        <th scope="col" data-field="合格数" data-width="80" class="text-center dk-report-row2">合格数</th>
-                        <th scope="col" data-field="缺陷率" data-width="80" class="text-center dk-report-row2">缺陷率</th>
-                        <th scope="col" data-field="成裂" data-width="60" class="text-center dk-report-row2">成裂</th>
-                        <th scope="col" data-field="棕眼" data-width="60" class="text-center dk-report-row2">棕眼</th>
-                        <th scope="col" data-field="糙活" data-width="60" class="text-center dk-report-row2">糙活</th>
-                        <th scope="col" data-field="成脏" data-width="60" class="text-center dk-report-row2">成脏</th>
-                        <th scope="col" data-field="成走" data-width="59" class="text-center dk-report-row2">成走</th>
-                        <th scope="col" data-field="注泡" data-width="58" class="text-center dk-report-row2">注泡</th>
-                        <th scope="col" data-field="坯脏" data-width="50" class="text-center dk-report-row2">坯脏</th>
-                        <th scope="col" data-field="孔不良" data-width="58" class="text-center dk-report-row2">孔</th>
-                        <th scope="col" data-field="排水不良" data-width="58" class="text-center dk-report-row2">排水</th>
-                        <th scope="col" data-field="泥绺" data-width="58" class="text-center dk-report-row2">泥绺</th>
-                        <th scope="col" data-field="漏气" data-width="58" class="text-center dk-report-row2">漏气</th>
-                        <th scope="col" data-field="卡球" data-width="58" class="text-center dk-report-row2">卡球</th>
-                        <th scope="col" data-field="炸圈" data-width="58" class="text-center dk-report-row2">炸圈</th>
-                        <th scope="col" data-field="合计"  class="text-center dk-report-row2">合计</th>
-                    </tr>
-                </thead>
-                <tbody>
-                </tbody>
-            </table>
+        <div style="height:1183px;overflow-y:hidden;">
+            <div id="mTable" style="height: 1146px; overflow-y: hidden;">
+                <table id="报表" data-show-header="false" class="table table-bordered table-hover table-striped" style="font-size:14px;">
+                    <thead id="报表表头">
+                        <!--<tr>
+                    <th scope="col" data-field="组别" data-width="96" class="text-center dk-report-row2">组别</th>
+                    <th scope="col" data-field="工号" data-width="79" class="text-center dk-report-row2">工号</th>
+                    <th scope="col" data-field="姓名" data-width="233" class="text-center dk-report-row2">姓名</th>
+                    <th scope="col" data-field="产品编码" data-width="110" class="text-center dk-report-row2">产品编码</th>
+                    <th scope="col" data-field="出窑数" data-width="80" class="text-center dk-report-row2">出窑数</th>
+                    <th scope="col" data-field="合格数" data-width="80" class="text-center dk-report-row2">合格数</th>
+                    <th scope="col" data-field="缺陷率" data-width="80" class="text-center dk-report-row2">缺陷率</th>
+                    <th scope="col" data-field="成裂" data-width="60" class="text-center dk-report-row2">成裂</th>
+                    <th scope="col" data-field="棕眼" data-width="60" class="text-center dk-report-row2">棕眼</th>
+                    <th scope="col" data-field="糙活" data-width="60" class="text-center dk-report-row2">糙活</th>
+                    <th scope="col" data-field="成脏" data-width="60" class="text-center dk-report-row2">成脏</th>
+                    <th scope="col" data-field="成走" data-width="60" class="text-center dk-report-row2">成走</th>
+                    <th scope="col" data-field="注泡" data-width="60" class="text-center dk-report-row2">注泡</th>
+                    <th scope="col" data-field="坯脏" data-width="60" class="text-center dk-report-row2">坯脏</th>
+                    <th scope="col" data-field="孔不良" data-width="60" class="text-center dk-report-row2">孔</th>
+                    <th scope="col" data-field="排水不良" data-width="60" class="text-center dk-report-row2">排水</th>
+                    <th scope="col" data-field="泥绺" data-width="60" class="text-center dk-report-row2">泥绺</th>
+                    <th scope="col" data-field="漏气" data-width="60" class="text-center dk-report-row2">漏气</th>
+                    <th scope="col" data-field="卡球" data-width="60" class="text-center dk-report-row2">卡球</th>
+                    <th scope="col" data-field="炸圈" data-width="60" class="text-center dk-report-row2">炸圈</th>
+                    <th scope="col" data-field="合计" data-width="60" class="text-center dk-report-row2">合计</th>
+                </tr>-->
+                        <tr>
+                            <th scope="col" data-field="组别" data-width="96" class="text-left dk-report-row2">组别</th>
+                            <th scope="col" data-field="工号" data-width="79" class="text-left dk-report-row2">工号</th>
+                            <th scope="col" data-field="姓名" data-width="243" class="text-left dk-report-row2">姓名</th>
+                            <th scope="col" data-field="产品编码" data-width="150" class="text-left dk-report-row2">产品编码</th>
+                            <th scope="col" data-field="出窑数" data-width="70" class="text-left dk-report-row2">出窑数</th>
+                            <th scope="col" data-field="合格数" data-width="70" class="text-left dk-report-row2">合格数</th>
+                            <th scope="col" data-field="缺陷率" data-width="70" class="text-left dk-report-row2">缺陷率</th>
+                            <th scope="col" data-field="成裂" data-width="50" class="text-left dk-report-row2">成裂</th>
+                            <th scope="col" data-field="棕眼" data-width="50" class="text-left dk-report-row2">棕眼</th>
+                            <th scope="col" data-field="糙活" data-width="50" class="text-left dk-report-row2">糙活</th>
+                            <th scope="col" data-field="成脏" data-width="50" class="text-left dk-report-row2">成脏</th>
+                            <th scope="col" data-field="成走" data-width="50" class="text-left dk-report-row2">成走</th>
+                            <th scope="col" data-field="注泡" data-width="50" class="text-left dk-report-row2">注泡</th>
+                            <th scope="col" data-field="坯脏" data-width="50" class="text-left dk-report-row2">坯脏</th>
+                            <th scope="col" data-field="孔不良" data-width="50" class="text-left dk-report-row2">孔</th>
+                            <th scope="col" data-field="排水不良" data-width="50" class="text-left dk-report-row2">排水</th>
+                            <th scope="col" data-field="泥绺" data-width="50" class="text-left dk-report-row2">泥绺</th>
+                            <th scope="col" data-field="漏气" data-width="50" class="text-left dk-report-row2">漏气</th>
+                            <th scope="col" data-field="卡球" data-width="50" class="text-left dk-report-row2">卡球</th>
+                            <th scope="col" data-field="炸圈" data-width="50" class="text-left dk-report-row2">炸圈</th>
+                            <th scope="col" data-field="合计" data-width="80" class="text-left dk-report-row2">合计</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                    </tbody>
+                </table>
+            </div>
         </div>
 
-
     </div>
 
     <!--版权信息-->
@@ -106,15 +107,15 @@
         //缺陷统计刷新时间
         var refreshTime1 = 15000;
         var currentTime1 = 0;
-
+        var tableHeight;
+        var frameHeight;
+        var offsetHeight = 31.5;
         var doGetData;
         var doGetTime;
 
         $(document).ready(function () {
             //设置缩放
-            //setScale(0.95);
-            setScale(1.2);
-
+            setScale(0.85);
             //首次加载
             loadData();
             //定时刷新数据
@@ -191,7 +192,9 @@
         var date_str = year+"年"+month+"月"+day+"日 "+hours+":"+minutes+":"+seconds+" "+week;
             $('#当前时间').html(date_str);
         }
-
+	function sleep(d) {
+            for (var t = Date.now(); Date.now() - t <= d;);
+        }
         function loadData() {
 
             //每页31行 行高30.4
@@ -199,8 +202,8 @@
             //加载缺陷统计
             if (currentTime1 == 0) {
                 currentTime1 = -1000;
-                $('#mTable').animate({ scrollTop: 0 }, 1000);
-
+                 
+		
                 loadTable('#报表', 'rpt.ashx?m=master&p=' + request('p') + '&r=' + Math.random(), function (jsonData) {
                     //for (var i = 0; i < jsonData.length; i++) {
                     //    for (var key in jsonData[i]) {
@@ -213,7 +216,8 @@
                     //设置固定表头
                     $('#表头').html($('#报表表头').html());
 
-                    //大于31 每页31行
+                    //大于31 
+                    //refreshTime1 = Math.round((tableHeight - frameHeight) / 31.25) * 1000 + 10000;
                     if (jsonData.length > 32) {
                         refreshTime1 = (jsonData.length - 32 + 8 ) * 1000;
                     }
@@ -222,9 +226,12 @@
             }
             else {
                 if (currentTime1 > 0) {
-                    if (currentTime1 / 1000 % 2 == 0)
-                        $('#mTable').animate({ scrollTop: (refreshTime1 - currentTime1) / 31.25 }, 1000);
-
+                    if (currentTime1 <= 5000) {
+                        $('#mTable').animate({ scrollTop: 0 }, 1000)
+                    } else {
+                        if (currentTime1 / 1000 % 2 == 0)
+                            $('#mTable').animate({ scrollTop: (refreshTime1 - currentTime1) / 31.25 }, 1000);
+                    }
                     $('#报表加载').html('刷新倒计时(秒):' + currentTime1 / 1000);
                     currentTime1 = currentTime1 - 1000;
                 }
@@ -240,7 +247,11 @@
                 if (json['success'] == true) {
                     $(id).bootstrapTable({
                         toggle: "table",
-                        locale: "zh-CN"
+                        locale: "zh-CN",
+                        onPostBody: function () {
+                            frameHeight = $('#mTable').height();
+                            tableHeight = $('#报表').height();
+                        }
                     });
                     callback(json['rows']);
                 }

+ 2 - 4
wwwroot/main/DashBoard/rpt0131/index.html

@@ -34,7 +34,7 @@
         <h4 class="text-center pb-2 dk-report-title2">施釉缺陷统计表</h4>
         <table id="表头" class="table table-bordered table-hover table-striped pb-0 mb-0" style="font-size:10px;">
         </table>
-        <div id="mTable" style="height:685px;overflow-y:hidden;">
+        <div id="mTable" style="height:985px;overflow-y:hidden;">
             <table id="报表" data-show-header="false" class="table table-bordered table-hover table-striped" style="font-size:10px;">
                 <thead id="报表表头">
                     <tr>
@@ -114,9 +114,7 @@
 
         $(document).ready(function () {
             //设置缩放
-            setScale(0.90);
-            //setScale(1);
-
+            setScale(0.80);
             //首次加载
             loadData();
             //定时刷新数据

+ 2 - 2
wwwroot/main/DashBoard/rpt01311/index.html

@@ -34,7 +34,7 @@
         <h4 class="text-center pb-2 dk-report-title2">施釉缺陷统计表</h4>
         <table id="表头" class="table table-bordered table-hover table-striped pb-0 mb-0" style="font-size:10px;">
         </table>
-        <div id="mTable" style="height:650px;overflow-y:hidden;">
+        <div id="mTable" style="height:750px;overflow-y:hidden;">
             <table id="报表" data-show-header="false" class="table table-bordered table-hover table-striped" style="font-size:10px;">
                 <thead id="报表表头">
                     <tr>
@@ -94,7 +94,7 @@
 
         $(document).ready(function () {
             //设置缩放
-            setScale(0.95);
+            setScale(0.85);
             //setScale(1);
 
             //首次加载

+ 2 - 2
wwwroot/main/DashBoard/rpt01313/index.html

@@ -215,7 +215,7 @@
                     //设置固定表头
                     $('#表头').html($('#报表表头').html());
 
-                    refreshTime1 = Math.round((tableHeight - frameHeight) / offsetHeight + 2) * 1000;
+					refreshTime1 = (Math.round((tableHeight - frameHeight) / offsetHeight + 2) * 1000) * 2 + 5000;
                     currentTime1 = refreshTime1;
 
                     if (refreshTime1 < 10000) {
@@ -228,7 +228,7 @@
             else {
                 if (currentTime1 > 0) {
                     if (currentTime1 / 1000 % 2 == 0)
-                        $('#mTable').animate({ scrollTop: (refreshTime1 - currentTime1) / 2 / offsetHeight }, 1000);
+                        $('#mTable').animate({ scrollTop: (refreshTime1 - currentTime1) / 2 / (offsetHeight*2) }, 1000);
 
                     $('#报表加载').html('刷新倒计时(秒):' + currentTime1 / 1000);
                     currentTime1 = currentTime1 - 1000;