瀏覽代碼

决策大屏调整

ellisran 1 年之前
父節點
當前提交
fe5035f1f7
共有 1 個文件被更改,包括 18 次插入12 次删除
  1. 18 12
      app/view/datacollect/index4GY18Y.ejs

+ 18 - 12
app/view/datacollect/index4GY18Y.ejs

@@ -311,7 +311,7 @@
                             overflow: 'break',
                         }
                     }
-                }
+                },
             }
         ],
         yAxis: [
@@ -713,10 +713,11 @@
                 showDataShadow: false,
                 // dataZoomIndex: 10,
                 start: 0,
-                end: 8,
+                end: 1,
                 handleSize: 0,
                 height: 10,
                 bottom: '10%',
+                zoomLock: true,
             },
         ],
         legend: {
@@ -743,8 +744,8 @@
                     },
                     formatter: function(value) {
                         var res = value;
-                        if(res.length > 6) {
-                            res = res.substring(0, 5) + "..";
+                        if(res.length > 4) {
+                            res = res.substring(0, 4) + "..";
                         }
                         return res;
                     },
@@ -791,7 +792,8 @@
                 emphasis: {
                     focus: 'series'
                 },
-                data: []
+                data: [],
+                barMaxWidth: 30
             },
             {
                 name: '已支付',
@@ -800,7 +802,8 @@
                 emphasis: {
                     focus: 'series'
                 },
-                data: []
+                data: [],
+                barMaxWidth: 30
             }
         ]
     };
@@ -1189,7 +1192,7 @@
                         }
                         oneCbgl.end_df_tp = ZhCalc.sub(oneCbgl.end_yf_tp, oneCbgl.end_sf_tp);
                         gccbglhz.push(oneCbgl);
-                        dpgl_option.dataZoom[0].end = computedPosition(cbgl_tenders.length);
+                        dpgl_option.dataZoom[0].end = computedPosition(cbgl_tenders.length, 6);
                         dpgl_option.xAxis[0].data = dpgl_chart_option_name;
                         dpgl_option.series[0].data = dpgl_chart_option_data.end_gather_tp;
                         dpgl_option.series[1].data = dpgl_chart_option_data.end_sf_tp;
@@ -1213,10 +1216,10 @@
                 allgccb.end_gather_tp = ZhCalc.add(allgccb.end_gather_tp, cb.end_gather_tp);
                 allgccb.end_sf_tp = ZhCalc.add(allgccb.end_sf_tp, cb.end_sf_tp);
                 allgccb.end_yf_tp = ZhCalc.add(allgccb.end_yf_tp, cb.end_yf_tp);
-                hzHtml += '<tr class="bg-dark" style="line-height: 2rem;text-align: center;"><td style="text-align: left">' + cb.name + '</td><td>' + cb.end_gather_tp + '</td><td>' + cb.end_yf_tp + '</td><td>' + cb.end_sf_tp + '</td><td>' + cb.end_df_tp + '</td></tr>';
+                hzHtml += '<tr class="bg-dark" style="line-height: 2rem;text-align: center;"><td style="text-align: left;min-width: 95px;">' + cb.name + '</td><td>' + cb.end_gather_tp + '</td><td>' + cb.end_yf_tp + '</td><td>' + cb.end_sf_tp + '</td><td>' + cb.end_df_tp + '</td></tr>';
             }
             allgccb.end_df_tp = ZhCalc.sub(allgccb.end_yf_tp, allgccb.end_sf_tp);
-            hzHtml += '<tr class="bg-dark" style="line-height: 2rem;text-align: center;"><td style="text-align: left">' + allgccb.name + '</td><td>' + allgccb.end_gather_tp + '</td><td>' + allgccb.end_yf_tp + '</td><td>' + allgccb.end_sf_tp + '</td><td>' + allgccb.end_df_tp + '</td></tr>';
+            hzHtml += '<tr class="bg-dark" style="line-height: 2rem;text-align: center;"><td style="text-align: left;min-width: 95px;">' + allgccb.name + '</td><td>' + allgccb.end_gather_tp + '</td><td>' + allgccb.end_yf_tp + '</td><td>' + allgccb.end_sf_tp + '</td><td>' + allgccb.end_df_tp + '</td></tr>';
             $('.stage-data').html(hzHtml);
             setTableboxHeight();
             // console.log(sr_tenders, cb_tenders);
@@ -1309,9 +1312,12 @@
         });
     });
     // 计算显示滚动条长度
-    function computedPosition(xArrayLength) {
-        if (xArrayLength >= 8) {
-            return Math.floor(8 / xArrayLength * 100) > 100 ? 100 : Math.floor(8 / xArrayLength * 100);
+    function computedPosition(xArrayLength, maxNum = 8) {
+        if (xArrayLength >= maxNum) {
+            // return Math.floor(maxNum / xArrayLength * 100) > 100 ? 100 : Math.floor(maxNum / xArrayLength * 100);
+            const endValue = (maxNum / xArrayLength) * 100;
+            return endValue > Math.floor(endValue) + 0.5 ? Math.floor(endValue) + 0.5 : (Math.floor(endValue) === 0 ? 0.5 : Math.floor(endValue));
+            // return Math.round((maxNum / xArrayLength) * 100 * 100)/100;
             // return length <= 10 ? 35 : 100 - Math.floor(35 / length * 100);
         } else {
             return 100;