Ver código fonte

成本大屏修改

ellisran 5 dias atrás
pai
commit
35b9d92f65
1 arquivos alterados com 25 adições e 3 exclusões
  1. 25 3
      app/view/datacollect/index_cost.ejs

+ 25 - 3
app/view/datacollect/index_cost.ejs

@@ -195,9 +195,9 @@
                                     <table id="profit_tableId">
                                     <table id="profit_tableId">
                                         <thead>
                                         <thead>
                                         <tr class="text-center">
                                         <tr class="text-center">
-                                            <th>排名</th>
+                                            <th width="50">排名</th>
                                             <th>标段</th>
                                             <th>标段</th>
-                                            <th>利润率</th>
+                                            <th width="80">利润率</th>
                                         </tr>
                                         </tr>
                                         </thead>
                                         </thead>
                                         <tbody class="tender-data">
                                         <tbody class="tender-data">
@@ -280,6 +280,28 @@
             axisPointer: {            // 坐标轴指示器,坐标轴触发有效
             axisPointer: {            // 坐标轴指示器,坐标轴触发有效
                 type: 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
                 type: 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
             },
             },
+            formatter: function (params) {
+
+                let html = params[0].axisValue + '<br/>';
+
+                params.forEach(function (item) {
+
+                    let value = item.value;
+
+                    if (item.seriesName === '利润率') {
+                        value += '%';
+                    }
+
+                    html += `
+            <div style="display:flex;justify-content:space-between;min-width:150px;">
+                <span>${item.marker}${item.seriesName}</span>
+                <span style="font-weight:bold;">${value}</span>
+            </div>
+        `;
+                });
+
+                return html;
+            }
         },
         },
 
 
         dataZoom: [
         dataZoom: [
@@ -916,7 +938,7 @@
                     tender_html += `<tr class="bg-dark">
                     tender_html += `<tr class="bg-dark">
                     <td class="text-center py-2">${rankDisplay}</td>
                     <td class="text-center py-2">${rankDisplay}</td>
                     <td class="py-2">${t.name}</td>
                     <td class="py-2">${t.name}</td>
-                    <td class="text-center py-2">${stage_tp.profit_percent}</td>
+                    <td class="text-center py-2">${stage_tp.profit_percent}%</td>
                 </tr>`;
                 </tr>`;
                     index++;
                     index++;
                 }
                 }