Kaynağa Gözat

图表顺序提交

laiguoran 3 yıl önce
ebeveyn
işleme
e523998a13
1 değiştirilmiş dosya ile 10 ekleme ve 6 silme
  1. 10 6
      app/view/datacollect/index.ejs

+ 10 - 6
app/view/datacollect/index.ejs

@@ -1191,14 +1191,16 @@
                     }
                 }
                 if (category[1] && category[1].value.length > 0) {
-                    for (const c of category[1].value) {
-                        for (const cc1 of chart_category_data.data1) {
+                    for (const cc1 of chart_category_data.data1) {
+                        for (const c of category[1].value) {
                             chart_category_data.data2.push([...cc1, {
                                 cid: category[1].id,
                                 value: c.id,
                             }]);
                         }
-                        for (const cd1 of chart_option5_data.data1) {
+                    }
+                    for (const cd1 of chart_option5_data.data1) {
+                        for (const c of category[1].value) {
                             chart_option5_data.data2.push({
                                 value: 0,
                                 name: cd1.name + ' ' + c.value,
@@ -1207,14 +1209,16 @@
                     }
                 }
                 if (category[2] && category[2].value.length > 0) {
-                    for (const c of category[2].value) {
-                        for (const cc2 of chart_category_data.data2) {
+                    for (const cc2 of chart_category_data.data2) {
+                        for (const c of category[2].value) {
                             chart_category_data.data3.push([...cc2, {
                                 cid: category[2].id,
                                 value: c.id,
                             }]);
                         }
-                        for (const cd2 of chart_option5_data.data2) {
+                    }
+                    for (const cd2 of chart_option5_data.data2) {
+                        for (const c of category[2].value) {
                             chart_option5_data.data3.push({
                                 value: 0,
                                 name: cd2.name + ' ' + c.value,