From 9c67cddfd6f543587242ab6723598e858b4a58eb Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 8 Feb 2024 23:43:26 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E8=A8=88=E7=AE=9730?= =?UTF-8?q?=20=E5=85=A7=E8=B3=87=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Engineering/Engineering_Index.cshtml | 224 ++---------------- .../Engineering/Engineering_Violation.cshtml | 153 ++---------- .../Views/Manager/Manager_Index.cshtml | 220 ++--------------- 3 files changed, 62 insertions(+), 535 deletions(-) diff --git a/Parking_spaces/Views/Engineering/Engineering_Index.cshtml b/Parking_spaces/Views/Engineering/Engineering_Index.cshtml index 9cafa80..3dfe51a 100644 --- a/Parking_spaces/Views/Engineering/Engineering_Index.cshtml +++ b/Parking_spaces/Views/Engineering/Engineering_Index.cshtml @@ -242,10 +242,10 @@ var myLineChart = new Chart(ctx1, { type: 'line', data: { - labels: date.reverse(), + labels: date, datasets: [{ label: '車流量', - data: values.reverse(), + data: values, backgroundColor: 'rgba(75, 192, 192, 0.2)', // 設定背景色 borderColor: 'rgba(75, 192, 192, 1)', // 設定邊框色 pointHitRadius: 10, @@ -334,10 +334,10 @@ var myBarChart = new Chart(ctx, { type: 'bar', data: { - labels: date.reverse(), + labels: date, datasets: [{ label: '違規數量', - data: values.reverse(), + data: values, backgroundColor: 'rgba(255, 0, 0, 0.5)', // 設定半透明的紅色背景 borderColor: 'rgba(255, 0, 0, 1)', // 設定不透明的紅色邊框 borderWidth: 1 @@ -366,171 +366,45 @@ var token_ckeck //= document.getElementById("token_ckeck_id").value var position //職位 function get_violation_data_1() { + day = 30 violation_car_list = [] //console.log("start") //token_check = document.getElementById("token_check_id").value //console.log(token_check) $.ajax({ type: "GET", - url: "http://140.125.20.183:7700/api/Parking_spaces_violation_total_table", + url: "http://localhost:5174/api/Violation_car_table/get_day_violation-" + day, data: {}, contentType: "application/json", success: function (Model) { - get_violation_data_2(Model) - + //get_violation_data_2(Model) + console.log(Model) + set_violation_data_1(Model) } }); } - function get_violation_data_2(Model) { - if (Model.length > 0) { - for (var i = 0; i < Model.length; i++) { - var name = Model[i].parking_spaces_violation_name - ////console.log(name) - $.ajax({ - type: "GET", - url: "http://140.125.20.183:7700/api/Violation_car_table/violation_location_name-" + name, - data: {}, - contentType: "application/json", - success: function (Model) { - set_violation_data_1(Model) - } - }); - } - } - set_violation_data_3() - - } + @@ -540,18 +414,15 @@ @@ -483,6 +357,7 @@ + @@ -372,18 +246,15 @@