Prechádzať zdrojové kódy

Merge branch 'rprofit' of 39.97.239.116:gyfl/xyzshop into rprofit

stanley-king 2 rokov pred
rodič
commit
091471edf7

+ 7 - 24
admin/templates/default/analysis.provider.php

@@ -228,11 +228,6 @@
             data.map(item => {
                 qualitys[item.value] = {
                     name: item.name,
-                    ratio: 0,
-                    succ: 0,
-                    commit: 0,
-                    succ_time: 0,
-                    fail_time: 0,
                     checked: false,
                     value: item.value
                 }
@@ -263,11 +258,11 @@
                             <input type="checkbox" name="channelValue" ${item.checked?'checked="checked"':''}  value="${item.value}" />
                             ${item.name}
                             ${pageInit ? `(
-                            ${sortType == 'ratio'? "<span style='color:red;'>"+`${item.checked?item.ratio:0}`+"</span>": item.checked?item.ratio:0},
-                            ${sortType == 'succ'? "<span style='color:red;'>"+`${item.checked?item.succ:0}`+"</span>": item.checked?item.succ:0},
-                            ${sortType == 'commit'? "<span style='color:red;'>"+`${item.checked?item.commit:0}`+"</span>": item.checked?item.commit:0},
-                            ${sortType == 'succ_time'? "<span style='color:red;'>"+`${item.checked?item.succ_time:0}`+"</span>": item.checked?item.succ_time:0},
-                            ${sortType == 'fail_time'? "<span style='color:red;'>"+`${item.checked?item.fail_time:0}`+"</span>": item.checked?item.fail_time:0}
+                            ${sortType == 'ratio'? "<span style='color:red;'>"+`${item.ratio}`+"</span>": item.ratio},
+                            ${sortType == 'succ'? "<span style='color:red;'>"+`${item.succ}`+"</span>": item.succ},
+                            ${sortType == 'commit'? "<span style='color:red;'>"+`${item.commit}`+"</span>": item.commit},
+                            ${sortType == 'succ_time'? "<span style='color:red;'>"+`${item.succ_time}`+"</span>": item.succ_time},
+                            ${sortType == 'fail_time'? "<span style='color:red;'>"+`${item.fail_time}`+"</span>": item.fail_time}
                             )`:''}</label></td>
                     </tr>
                 `;
@@ -323,27 +318,15 @@
             let newQualityList = [];
 
             Object.keys(allQualityList).map(key => {
-                // if (!allQualityList[key].checked) {
-                //     allQualityList[key].ratio = 0;
-                //     allQualityList[key].succ = 0;
-                //     allQualityList[key].commit = 0;
-                //     allQualityList[key].succ_time = 0;
-                //     allQualityList[key].fail_time = 0;
-                // }
                 newQualityList.push(allQualityList[key])
             })
 
             //根据类型排序
-            const checkedQualitys = newQualityList.filter(item => {
-                return item.checked;
-            }).sort(function(a, b) {
+            const sortQualitys = newQualityList.sort(function(a, b) {
                 return b[sortType] - a[sortType];
             })
 
-            const noCheckedQualitys = newQualityList.filter(item => {
-                return !item.checked;
-            })
-            formatChannelTable([...checkedQualitys, ...noCheckedQualitys]);
+            formatChannelTable([...sortQualitys]);
             qualitys = allQualityList;
         }