新增出去加改Bug

This commit is contained in:
qi_0527 2024-11-18 16:41:34 +08:00
parent a4c1b36779
commit fae5651f14
32 changed files with 909 additions and 686 deletions

View File

@ -29,7 +29,7 @@ namespace Parking_spaces.Controllers
_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(token); _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(token);
// 构建 API 请求的 URL // 构建 API 请求的 URL
string apiUrl = "http://140.125.20.183:7700/Users/token"; string apiUrl = "http://localhost:7700/Users/token";
// 调用需要身份验证的 API // 调用需要身份验证的 API
HttpResponseMessage response = await _httpClient.GetAsync(apiUrl); HttpResponseMessage response = await _httpClient.GetAsync(apiUrl);

View File

@ -3,7 +3,7 @@
"windowsAuthentication": false, "windowsAuthentication": false,
"anonymousAuthentication": true, "anonymousAuthentication": true,
"iisExpress": { "iisExpress": {
"applicationUrl": "http://140.125.20.183:2361", "applicationUrl": "http://localhost:2361",
"sslPort": 44352 "sslPort": 44352
} }
}, },

View File

@ -83,7 +83,7 @@
console.log(token_check) console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam", url: "http://localhost:7700/api/Parking_spaces_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -105,7 +105,7 @@
console.log(token_check) console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table", url: "http://localhost:7700/api/Parking_spaces_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -127,7 +127,7 @@
console.log(token_check) console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_violation_total_table", url: "http://localhost:7700/api/Parking_spaces_violation_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -238,7 +238,7 @@
var stringify_obj = JSON.stringify(obj); var stringify_obj = JSON.stringify(obj);
$.ajax({ $.ajax({
type: "Post", type: "Post",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam", url: "http://localhost:7700/api/Parking_spaces_cam",
//data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" }, //data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" },
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
@ -292,7 +292,7 @@
var stringify_obj = JSON.stringify(obj); var stringify_obj = JSON.stringify(obj);
$.ajax({ $.ajax({
type: "Post", type: "Post",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_pass", url: "http://localhost:7700/api/Parking_spaces_roi_pass",
//data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" }, //data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" },
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
@ -350,7 +350,7 @@
var stringify_obj = JSON.stringify(obj); var stringify_obj = JSON.stringify(obj);
$.ajax({ $.ajax({
type: "Post", type: "Post",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam_ptz_pass", url: "http://localhost:7700/api/Parking_spaces_cam_ptz_pass",
//data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" }, //data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" },
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
@ -383,7 +383,7 @@
var stringify_obj = JSON.stringify(obj); var stringify_obj = JSON.stringify(obj);
$.ajax({ $.ajax({
type: "Post", type: "Post",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam_ptz_violation", url: "http://localhost:7700/api/Parking_spaces_cam_ptz_violation",
//data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" }, //data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" },
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
@ -431,7 +431,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -455,7 +455,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -471,7 +471,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -97,7 +97,7 @@
console.log(parking_spaces_name) console.log(parking_spaces_name)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_cam/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -123,7 +123,7 @@
if (mode == "pass") { if (mode == "pass") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam_ptz_pass/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_cam_ptz_pass/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -144,7 +144,7 @@
if (mode == "car_num_check") { if (mode == "car_num_check") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam_ptz_car_num_check/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_cam_ptz_car_num_check/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -166,7 +166,7 @@
if (mode == "violation") { if (mode == "violation") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam_ptz_violation/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_cam_ptz_violation/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -193,7 +193,7 @@
if (mode == "pass") { if (mode == "pass") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_pass/" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_pass/" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -208,7 +208,7 @@
if (mode == "car_num_check") { if (mode == "car_num_check") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_car_num_check/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_car_num_check/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -223,7 +223,7 @@
if (mode == "violation") { if (mode == "violation") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_violation/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_violation/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -371,7 +371,7 @@
serial_num_choose = serial_num serial_num_choose = serial_num
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam_ptz_car_num_check/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_cam_ptz_car_num_check/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -568,7 +568,7 @@
if (mode == "pass") { if (mode == "pass") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_pass/" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_pass/" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -590,7 +590,7 @@
if (mode == "car_num_check") { if (mode == "car_num_check") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_car_num_check/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_car_num_check/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -614,7 +614,7 @@
console.log('violation') console.log('violation')
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_violation/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_violation/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -646,7 +646,7 @@
console.log(stringify_obj) console.log(stringify_obj)
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_pass/" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_pass/" + parking_spaces_name,
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
@ -671,7 +671,7 @@
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_car_num_check/parking_spaces_name-" + parking_spaces_name + "-serial_num-" + serial_num_choose.toString(), url: "http://localhost:7700/api/Parking_spaces_roi_car_num_check/parking_spaces_name-" + parking_spaces_name + "-serial_num-" + serial_num_choose.toString(),
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
@ -816,7 +816,7 @@
console.log(stringify_obj) console.log(stringify_obj)
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_car_num_check/", url: "http://localhost:7700/api/Parking_spaces_roi_car_num_check/",
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -835,7 +835,7 @@
if (mode == "violation") { if (mode == "violation") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_violation/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_violation/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -868,7 +868,7 @@
console.log(stringify_obj) console.log(stringify_obj)
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_violation/", url: "http://localhost:7700/api/Parking_spaces_roi_violation/",
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -950,7 +950,7 @@
function put_violation_roi_1() { function put_violation_roi_1() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi/" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi/" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -978,7 +978,7 @@
console.log(stringify_obj) console.log(stringify_obj)
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi/" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi/" + parking_spaces_name,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1051,7 +1051,7 @@
if (mode == "violation") { if (mode == "violation") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_violation/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_violation/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1084,7 +1084,7 @@
console.log(stringify_obj) console.log(stringify_obj)
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_violation/", url: "http://localhost:7700/api/Parking_spaces_roi_violation/",
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1166,7 +1166,7 @@
if (mode == "pass") { if (mode == "pass") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_pass/" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_pass/" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1196,7 +1196,7 @@
console.log(stringify_obj) console.log(stringify_obj)
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_pass/" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_pass/" + parking_spaces_name,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1271,7 +1271,7 @@
if (mode == "violation") { if (mode == "violation") {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_violation/parking_spaces_name-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_roi_violation/parking_spaces_name-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1304,7 +1304,7 @@
console.log(stringify_obj) console.log(stringify_obj)
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "http://140.125.20.183:7700/api/Parking_spaces_roi_violation/", url: "http://localhost:7700/api/Parking_spaces_roi_violation/",
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1332,7 +1332,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -1354,7 +1354,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -1370,7 +1370,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -83,7 +83,7 @@
var stringify_obj = JSON.stringify(obj); var stringify_obj = JSON.stringify(obj);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "http://140.125.20.183:7700/api/El125_car_table", url: "http://localhost:7700/api/El125_car_table",
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -145,7 +145,7 @@
function get_data() { function get_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/El125_car_table", url: "http://localhost:7700/api/El125_car_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -168,7 +168,7 @@
function delet_data(license_plate_number) { function delet_data(license_plate_number) {
$.ajax({ $.ajax({
type: "DELETE", type: "DELETE",
url: "http://140.125.20.183:7700/api/El125_car_table/" + license_plate_number, url: "http://localhost:7700/api/El125_car_table/" + license_plate_number,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -193,7 +193,7 @@
//console.log(token) //console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -215,7 +215,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -231,7 +231,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -84,10 +84,10 @@
<h1>工程模式</h1> <h1>工程模式</h1>
<div class="row"> <div class="row">
<!--每日違規數量--> <!-- 左側內容 -->
<div class="col-xl-8 col-lg-8"> <div class="col-xl-8 col-lg-8">
<!-- 每日違規數量 -->
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<!-- 將 mb-8 改為 mb-4 -->
<div class="card-header py-3"> <div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary"> <h6 class="m-0 font-weight-bold text-primary">
每日違規數量 每日違規數量
@ -100,7 +100,8 @@
</div> </div>
</div> </div>
</div> </div>
<!--即時影像-->
<!-- 即時影像 -->
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">即時影像</h6> <h6 class="m-0 font-weight-bold text-primary">即時影像</h6>
@ -109,10 +110,75 @@
<div id="myMap"></div> <div id="myMap"></div>
</div> </div>
</div> </div>
<!-- 每日車流量 -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">
每日車流量
<button class="btn btn-info btn-circle btn-sm" style="float:right; background-image: url('/image/icon/F5.png'); background-size: cover;" onclick="get_in_yuntech_data_1()"></button>
</h6>
</div>
<div class="card-body">
<div class="chart-area">
<canvas id="in_car_Bar"></canvas>
</div>
</div>
</div>
<!-- 校園總車位數量與校園當前車流量 -->
<div class="card shadow mb-4">
<div class="card-header py-3" style="display: flex; justify-content: space-between; align-items: center;">
<h6 class="m-0 font-weight-bold text-primary">
下載 總車位與月租Excel 文件 及 校園車位信息
</h6>
<button class="btn btn-primary" onclick="downloadExcel()">即時車位下載 Excel</button>
</div>
<div class="card-body">
<div class="row">
<!-- 校園總車位數量 -->
<div class="col-md-6">
<h6 class="font-weight-bold text-primary text-center">校園總車位數量</h6>
<table class="table table-bordered">
<thead>
<tr>
<th>總車位</th>
<th>剩餘車位</th>
</tr>
</thead>
<tbody id="parking_all_table">
<!-- 動態更新校園總車位與剩餘車位 -->
</tbody>
</table>
</div>
<!-- 校園當前車流量 -->
<div class="col-md-6">
<h6 class="font-weight-bold text-primary text-center">校園當前車流量</h6>
<table class="table table-bordered">
<thead>
<tr>
<th>類別</th>
<th>數量</th>
</tr>
</thead>
<tbody id="monthly_table">
<!-- 動態更新月租與臨停車輛數據 -->
</tbody>
</table>
</div>
</div>
</div>
</div>
</div> </div>
<!--演算法狀態--> <!-- 右側內容 -->
<div class="col-xl-4 col-lg-4"> <div class="col-xl-4 col-lg-4">
<!-- 演算法狀態 -->
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">演算法狀態</h6> <h6 class="m-0 font-weight-bold text-primary">演算法狀態</h6>
@ -130,7 +196,7 @@
</div> </div>
</div> </div>
<!--字幕機狀態--> <!-- 字幕機狀態 -->
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary"> <h6 class="m-0 font-weight-bold text-primary">
@ -144,7 +210,7 @@
<tr> <tr>
<th>停車場位置</th> <th>停車場位置</th>
<th>字幕機IP</th> <th>字幕機IP</th>
<th>顯示參數</th> <th>參數</th>
</tr> </tr>
</thead> </thead>
<tbody id="LED_table"></tbody> <tbody id="LED_table"></tbody>
@ -153,85 +219,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<!--每日車流量-->
<div class="col-xl-8 col-lg-8">
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">
每日車流量<button class="btn btn-info btn-circle btn-sm" style="float:right; background-image: url('/image/icon/F5.png'); background-size: cover;" onclick="get_in_yuntech_data_1()"></button>
</h6>
</div>
<div class="card-body">
<div class="chart-area">
<canvas id="in_car_Bar"></canvas>
</div>
</div>
</div>
</div>
<!-- 總車位與月租Excel 文件 及 校園車位信息 -->
<style>
.table th, .table td {
text-align: center; /* 居中對齊 */
}
.table th:nth-child(1), .table td:nth-child(1) {
width: 200px; /* 根據需要調整寬度 */
}
.table th:nth-child(2), .table td:nth-child(2) {
width: 200px; /* 根據需要調整寬度 */
}
</style>
<div class="col-xl-8 col-lg-8">
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">
下載 總車位與月租Excel 文件 及 校園車位信息
<button class="btn btn-info btn-circle btn-sm" style="float:right; background-image: url('/image/icon/F5.png'); background-size: cover;" onclick="get_yuntech_parking_data()"></button>
</h6>
</div>
<div class="card-body">
<!-- 下載 Excel 文件按鈕 -->
<div class="mb-3">
<button class="btn btn-primary" onclick="downloadExcel()">即時車位下載 Excel</button>
</div>
<!-- 校園總車位數量表格 -->
<div>
<h6 class="font-weight-bold text-primary">校園總車位數量</h6>
<table class="table table-bordered">
<thead>
<tr>
<th>總車位</th>
<th>剩餘車位</th>
</tr>
</thead>
<tbody id="parking_all_table">
`
<!-- 動態更新校園總車位與剩餘車位 -->
</tbody>
</table>
</div>
<!-- 校園當前車流量表格 -->
<div>
<h6 class="font-weight-bold text-primary">校園當前車流量</h6>
<table class="table table-bordered">
<thead>
<tr>
<th>類別</th>
<th>數量</th>
</tr>
</thead>
<tbody id="monthly_table">
<!-- 動態更新月租與臨停車輛數據 -->
</tbody>
</table>
</div>
</div>
</div>
</div>
@ -249,7 +236,7 @@
<!--Excel下載--> <!--Excel下載-->
<script> <script>
function downloadExcel() { function downloadExcel() {
fetch('http://140.125.20.183:7700/api/ParkingLogs/DownloadCurrentStatusExcel', { fetch('http://localhost:7700/api/ParkingLogs/DownloadCurrentStatusExcel', {
method: 'GET', method: 'GET',
headers: { headers: {
'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' 'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
@ -436,7 +423,7 @@
//console.log(token_check) //console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/get_day_violation-" + day, url: "http://localhost:7700/api/Violation_car_table/get_day_violation-" + day,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -485,7 +472,7 @@
in_car_list = [] in_car_list = []
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/get_day_in_car-" + day, url: "http://localhost:7700/api/Yuntech_in_car_table/get_day_in_car-" + day,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -525,7 +512,7 @@
function get_algorithm_data() { function get_algorithm_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm", url: "http://localhost:7700/api/Parking_space_algorithm",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -540,7 +527,7 @@
function get_algorithm_data_1() { function get_algorithm_data_1() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm", url: "http://localhost:7700/api/Parking_space_algorithm",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -569,7 +556,7 @@
var stringify_obj = JSON.stringify(data_1); var stringify_obj = JSON.stringify(data_1);
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm/" + Model[i].algorithm_serial_num, url: "http://localhost:7700/api/Parking_space_algorithm/" + Model[i].algorithm_serial_num,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -623,7 +610,7 @@
function get_LED_data() { function get_LED_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_lcd_instand", url: "http://localhost:7700/api/Parking_spaces_lcd_instand",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -668,7 +655,7 @@
function get_monthly_rent_data() { function get_monthly_rent_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_monthly_rent_number", url: "http://localhost:7700/api/Yuntech_monthly_rent_number",
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -695,7 +682,7 @@
table += "<td>" + Model[i].category + "</td>" table += "<td>" + Model[i].category + "</td>"
table += "<td>" + '<input type="text" id = "parking_space_amount_id" value =' + Model[i].number + ' />' + "</td > " table += "<td>" + '<input type="text" id = "parking_space_amount_id" value =' + Model[i].number + ' />' + "</td > "
table += "<td>" + '<button class="btn btn-outline-warning " onclick="Update_monthly_rent_number(' + "'" + i + "'" + ')">更新並上傳</button>' //table += "<td>" + '<button class="btn btn-outline-warning " onclick="Update_monthly_rent_number(' + "'" + i + "'" + ')">更新並上傳</button>'
} }
table += "</tr>" table += "</tr>"
table += "<tr>" table += "<tr>"
@ -719,7 +706,7 @@
var stringify_obj = JSON.stringify(data); var stringify_obj = JSON.stringify(data);
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Yuntech_monthly_rent_number/" + category, url: "http://localhost:7700/api/Yuntech_monthly_rent_number/" + category,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -739,7 +726,7 @@
function get_yuntech_parking_data() { function get_yuntech_parking_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_parking", url: "http://localhost:7700/api/Yuntech_parking",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -762,7 +749,7 @@
table += "<td>" + Model[i].all_num + "</td>" table += "<td>" + Model[i].all_num + "</td>"
table += "<td>" + '<input type="text" id = "parking_space_amount_id" value =' + Model[i].now_num + ' />' + "</td > " table += "<td>" + '<input type="text" id = "parking_space_amount_id" value =' + Model[i].now_num + ' />' + "</td > "
table += "<td>" + '<button class="btn btn-outline-warning " onclick="Update_now_num(' + "'" + Model[i].all_num + "'" + ')">更新並上傳</button>' //table += "<td>" + '<button class="btn btn-outline-warning " onclick="Update_now_num(' + "'" + Model[i].all_num + "'" + ')">更新並上傳</button>'
} }
table += "</tr>" table += "</tr>"
table += "<tr>" table += "<tr>"
@ -777,7 +764,7 @@
function Update_now_num(all_num) { function Update_now_num(all_num) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_parking/" + all_num, url: "http://localhost:7700/api/Yuntech_parking/" + all_num,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -796,7 +783,7 @@
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Yuntech_parking/" + Model.all_num, url: "http://localhost:7700/api/Yuntech_parking/" + Model.all_num,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -828,7 +815,7 @@
IP_1 = IP IP_1 = IP
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP, url: 'http://localhost:7705/IP/' + IP,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -850,7 +837,7 @@
//console.log(IP_1) //console.log(IP_1)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP_1, url: 'http://localhost:7705/IP/' + IP_1,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -1049,7 +1036,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table", url: "http://localhost:7700/api/Parking_spaces_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1067,7 +1054,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_violation_total_table", url: "http://localhost:7700/api/Parking_spaces_violation_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1085,7 +1072,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_cam_total_table", url: "http://localhost:7700/api/Yuntech_cam_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1104,7 +1091,7 @@
location_name = location_name location_name = location_name
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam", url: "http://localhost:7700/api/Parking_spaces_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1123,7 +1110,7 @@
location_name = location_name location_name = location_name
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_cam", url: "http://localhost:7700/api/Yuntech_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1256,7 +1243,7 @@
//console.log(token) //console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -1278,7 +1265,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -1294,7 +1281,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -51,7 +51,7 @@
function get_data(){ function get_data(){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm", url: "http://localhost:7700/api/Parking_space_algorithm",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -66,7 +66,7 @@
function get_data_1() { function get_data_1() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm", url: "http://localhost:7700/api/Parking_space_algorithm",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -96,7 +96,7 @@
var stringify_obj = JSON.stringify(data_1); var stringify_obj = JSON.stringify(data_1);
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm/" + Model[i].algorithm_serial_num, url: "http://localhost:7700/api/Parking_space_algorithm/" + Model[i].algorithm_serial_num,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -157,7 +157,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -179,7 +179,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -195,7 +195,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -372,7 +372,7 @@
//console.log(token_check) //console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/get_day_violation-" + day, url: "http://localhost:7700/api/Violation_car_table/get_day_violation-" + day,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -421,7 +421,7 @@
in_car_list = [] in_car_list = []
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/get_day_in_car-" + day, url: "http://localhost:7700/api/Yuntech_in_car_table/get_day_in_car-" + day,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -461,7 +461,7 @@
function get_algorithm_data() { function get_algorithm_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm", url: "http://localhost:7700/api/Parking_space_algorithm",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -476,7 +476,7 @@
function get_algorithm_data_1() { function get_algorithm_data_1() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm", url: "http://localhost:7700/api/Parking_space_algorithm",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -505,7 +505,7 @@
var stringify_obj = JSON.stringify(data_1); var stringify_obj = JSON.stringify(data_1);
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm/" + Model[i].algorithm_serial_num, url: "http://localhost:7700/api/Parking_space_algorithm/" + Model[i].algorithm_serial_num,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -559,7 +559,7 @@
function get_LED_data() { function get_LED_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_lcd_instand", url: "http://localhost:7700/api/Parking_spaces_lcd_instand",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -618,7 +618,7 @@
IP_1 = IP IP_1 = IP
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP, url: 'http://localhost:7705/IP/' + IP,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -640,7 +640,7 @@
//console.log(IP_1) //console.log(IP_1)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP_1, url: 'http://localhost:7705/IP/' + IP_1,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -839,7 +839,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table", url: "http://localhost:7700/api/Parking_spaces_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -857,7 +857,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_violation_total_table", url: "http://localhost:7700/api/Parking_spaces_violation_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -875,7 +875,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_cam_total_table", url: "http://localhost:7700/api/Yuntech_cam_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -894,7 +894,7 @@
location_name = location_name location_name = location_name
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam", url: "http://localhost:7700/api/Parking_spaces_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -913,7 +913,7 @@
location_name = location_name location_name = location_name
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_cam", url: "http://localhost:7700/api/Yuntech_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1035,7 +1035,7 @@
/*0523*/ /*0523*/
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "http://140.125.20.183:7700/Users/authenticate", url: "http://localhost:7700/Users/authenticate",
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
success: function (msg) { success: function (msg) {
@ -1076,7 +1076,7 @@
//console.log(token) //console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -1098,7 +1098,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -1114,7 +1114,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -54,7 +54,7 @@
function get_data(){ function get_data(){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_lcd_instand", url: "http://localhost:7700/api/Parking_spaces_lcd_instand",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -117,7 +117,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -139,7 +139,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -155,7 +155,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -68,7 +68,7 @@
function get_data() { function get_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_lcd_instand", url: "http://localhost:7700/api/Parking_spaces_lcd_instand",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -116,7 +116,7 @@
function Update_detail(parking_spaces_name){ function Update_detail(parking_spaces_name){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table/" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_total_table/" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -135,7 +135,7 @@
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table/" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_total_table/" + parking_spaces_name,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -151,7 +151,7 @@
function Update_detail_2() { function Update_detail_2() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_lcd_instand/parking_space_area-" + parking_spaces_name, url: "http://localhost:7700/api/Parking_spaces_lcd_instand/parking_space_area-" + parking_spaces_name,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -177,7 +177,7 @@
var stringify_obj = JSON.stringify(Model); var stringify_obj = JSON.stringify(Model);
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Parking_spaces_lcd_instand/" + Model.lcd_ip, url: "http://localhost:7700/api/Parking_spaces_lcd_instand/" + Model.lcd_ip,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -208,7 +208,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -230,7 +230,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -246,7 +246,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -69,7 +69,7 @@
console.log(token_check) console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam", url: "http://localhost:7700/api/Parking_spaces_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -129,7 +129,7 @@
IP_1 = IP IP_1 = IP
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP_1, url: 'http://localhost:7705/IP/' + IP_1,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -147,7 +147,7 @@
console.log(IP_1) console.log(IP_1)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP_1, url: 'http://localhost:7705/IP/' + IP_1,
headers: { headers: {
'Authorization':token 'Authorization':token
}, },
@ -195,7 +195,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -219,7 +219,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -235,7 +235,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -219,7 +219,7 @@
console.log(token_check) console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_violation_total_table", url: "http://localhost:7700/api/Parking_spaces_violation_total_table",
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -275,7 +275,7 @@
function get_recidivst_1(){ function get_recidivst_1(){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/recidivists", url: "http://localhost:7700/api/Violation_car_table/recidivists",
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -327,7 +327,7 @@
//console.log(token_check) //console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/get_day_violation-" + day, url: "http://localhost:7700/api/Violation_car_table/get_day_violation-" + day,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -370,7 +370,7 @@
<script> <script>
function export_excel() { function export_excel() {
// 發送HTTP GET請求到Web API動作方法 // 發送HTTP GET請求到Web API動作方法
fetch('http://140.125.20.183:7700/api/Violation_car_table/export-all_excel',{ fetch('http://localhost:7700/api/Violation_car_table/export-all_excel',{
method: 'GET', method: 'GET',
headers: { headers: {
'Authorization': token 'Authorization': token
@ -418,7 +418,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -440,7 +440,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -456,7 +456,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -55,7 +55,7 @@
} }
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_parking_user_list/license_plate_number-" + license_plate_number, // 使用車牌號碼查詢 url: "http://localhost:7700/api/Yuntech_parking_user_list/license_plate_number-" + license_plate_number, // 使用車牌號碼查詢
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -144,7 +144,7 @@
var stringify_obj = JSON.stringify(obj); var stringify_obj = JSON.stringify(obj);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "http://140.125.20.183:7700/api/Yuntech_parking_user_list", url: "http://localhost:7700/api/Yuntech_parking_user_list",
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -169,7 +169,7 @@
<!--上傳excel--> <!--上傳excel-->
<script> <script>
const api_url = 'http://140.125.20.183:7700'; // 定义 api_url const api_url = 'http://localhost:7700'; // 定义 api_url
document.getElementById('uploadForm').onsubmit = function (event) { document.getElementById('uploadForm').onsubmit = function (event) {
event.preventDefault(); event.preventDefault();
@ -233,7 +233,7 @@
function delet_data(license_plate_number) { function delet_data(license_plate_number) {
$.ajax({ $.ajax({
type: "DELETE", type: "DELETE",
url: "http://140.125.20.183:7700/api/Yuntech_parking_user_list/" + license_plate_number, url: "http://localhost:7700/api/Yuntech_parking_user_list/" + license_plate_number,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -252,7 +252,7 @@
function get_data() { function get_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_parking_user_list", url: "http://localhost:7700/api/Yuntech_parking_user_list",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -303,7 +303,7 @@
//console.log(token) //console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -325,7 +325,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -341,7 +341,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -194,7 +194,7 @@
var license_plate_number = document.getElementById("serch_text_id").value var license_plate_number = document.getElementById("serch_text_id").value
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_instant/license_plate_number-" + license_plate_number, url: "http://localhost:7700/api/Parking_spaces_instant/license_plate_number-" + license_plate_number,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -225,7 +225,7 @@
console.log(token_check) console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table", url: "http://localhost:7700/api/Parking_spaces_total_table",
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -297,7 +297,7 @@
function get_single_parking_space_car(name){ function get_single_parking_space_car(name){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_instant/parking_space_area-" + name, url: "http://localhost:7700/api/Parking_spaces_instant/parking_space_area-" + name,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -328,8 +328,8 @@
var stringify_obj = JSON.stringify(obj); var stringify_obj = JSON.stringify(obj);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table", url: "http://localhost:7700/api/Parking_spaces_total_table",
//url: "http://140.125.20.183:7700/api/Postural_Analysis_1", //url: "http://localhost:7700/api/Postural_Analysis_1",
//data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" }, //data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" },
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
@ -353,7 +353,7 @@
function delet_data(name){ function delet_data(name){
$.ajax({ $.ajax({
type: "DELETE", type: "DELETE",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table/"+name, url: "http://localhost:7700/api/Parking_spaces_total_table/"+name,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -391,7 +391,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -413,7 +413,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -429,7 +429,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -72,7 +72,7 @@
IP_1 = IP IP_1 = IP
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP, url: 'http://localhost:7705/IP/' + IP,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -94,7 +94,7 @@
console.log(IP_1) console.log(IP_1)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP_1, url: 'http://localhost:7705/IP/' + IP_1,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -294,7 +294,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table", url: "http://localhost:7700/api/Parking_spaces_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -312,7 +312,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_violation_total_table", url: "http://localhost:7700/api/Parking_spaces_violation_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -330,7 +330,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_cam_total_table", url: "http://localhost:7700/api/Yuntech_cam_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -350,7 +350,7 @@
location_name = location_name location_name = location_name
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam", url: "http://localhost:7700/api/Parking_spaces_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -369,7 +369,7 @@
location_name = location_name location_name = location_name
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_cam", url: "http://localhost:7700/api/Yuntech_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -488,7 +488,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -512,7 +512,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -528,7 +528,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -26,7 +26,7 @@
</head> </head>
<body> <body>
<div class="container mt-1"> <div class="container mt-1">
<h1>查詢所有時間車位數</h1> <h1>查詢車位數</h1>
<div class="col-xl-32 col-lg32"> <div class="col-xl-32 col-lg32">
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3 d-flex justify-content-between align-items-center"> <div class="card-header py-3 d-flex justify-content-between align-items-center">
@ -119,7 +119,7 @@
params.append('interval', timeInterval); // 傳遞時間間隔 params.append('interval', timeInterval); // 傳遞時間間隔
params.append('page', page); // 傳遞當前頁碼 params.append('page', page); // 傳遞當前頁碼
const url = `http://140.125.20.183:7700/api/ParkingLogs/GetHourlyParkingLogs?${params.toString()}`; // 調用 GetHourlyParkingLogs API const url = `http://localhost:7700/api/ParkingLogs/GetHourlyParkingLogs?${params.toString()}`; // 調用 GetHourlyParkingLogs API
fetch(url) fetch(url)
.then(response => { .then(response => {
@ -195,7 +195,7 @@
} }
// 傳遞時間間隔以便後端生成相應的 Excel // 傳遞時間間隔以便後端生成相應的 Excel
window.open(`http://140.125.20.183:7700/api/ParkingLogs/DownloadExcel?startDate=${startDate}&endDate=${endDate}&interval=${timeInterval}`, '_blank'); window.open(`http://localhost:7700/api/ParkingLogs/DownloadExcel?startDate=${startDate}&endDate=${endDate}&interval=${timeInterval}`, '_blank');
} }
</script> </script>
@ -212,7 +212,7 @@
//console.log(token) //console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -234,7 +234,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -250,7 +250,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -102,7 +102,7 @@
//console.log(name) //console.log(name)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/violation_location_name-" + name, url: "http://localhost:7700/api/Violation_car_table/violation_location_name-" + name,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -160,7 +160,7 @@
console.log(time) console.log(time)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/location_nam-" + violation_location_name + "-time-" + time, url: "http://localhost:7700/api/Violation_car_table/location_nam-" + violation_location_name + "-time-" + time,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -181,7 +181,7 @@
var stringify_obj = JSON.stringify(Model); var stringify_obj = JSON.stringify(Model);
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Violation_car_table/location_nam-" + violation_location_name + "-time-" + time, url: "http://localhost:7700/api/Violation_car_table/location_nam-" + violation_location_name + "-time-" + time,
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -237,7 +237,7 @@
serial_number = car_serial_number serial_number = car_serial_number
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/location_nam-" + location_name + "-time-" + time, url: "http://localhost:7700/api/Violation_car_table/location_nam-" + location_name + "-time-" + time,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -269,7 +269,7 @@
} }
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/license_plate_number-" + license_plate_number, url: "http://localhost:7700/api/Violation_car_table/license_plate_number-" + license_plate_number,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -295,7 +295,7 @@
console.log(start_date) console.log(start_date)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/location_name_1_-" + name + "-start_time-" + start_date + "-end_time-" + end_date, url: "http://localhost:7700/api/Violation_car_table/location_name_1_-" + name + "-start_time-" + start_date + "-end_time-" + end_date,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -320,7 +320,7 @@
var start_date = document.getElementById("start_date_id").value var start_date = document.getElementById("start_date_id").value
var end_date = document.getElementById("end_date_id").value var end_date = document.getElementById("end_date_id").value
// 發送HTTP GET請求到Web API動作方法 // 發送HTTP GET請求到Web API動作方法
fetch('http://140.125.20.183:7700/api/Violation_car_table/export-excel_location_name_1_-' + name + "-start_time-" + start_date + "-end_time-" + end_date, { fetch('http://localhost:7700/api/Violation_car_table/export-excel_location_name_1_-' + name + "-start_time-" + start_date + "-end_time-" + end_date, {
method: 'GET', method: 'GET',
headers: { headers: {
'Authorization': token 'Authorization': token
@ -361,7 +361,7 @@
function plate_export_excel() { function plate_export_excel() {
var license_plate_number = document.getElementById("serch_text_id").value var license_plate_number = document.getElementById("serch_text_id").value
// 發送HTTP GET請求到Web API動作方法 // 發送HTTP GET請求到Web API動作方法
fetch('http://140.125.20.183:7700/api/Violation_car_table/export-excel_license_plate_number-'+license_plate_number, { fetch('http://localhost:7700/api/Violation_car_table/export-excel_license_plate_number-'+license_plate_number, {
method: 'GET', method: 'GET',
headers: { headers: {
'Authorization': token 'Authorization': token
@ -407,7 +407,7 @@
console.log(time) console.log(time)
$.ajax({ $.ajax({
type: "DELETE", type: "DELETE",
url: "http://140.125.20.183:7700/api/Violation_car_table/location_name-" + location_name + "-time-" + time, url: "http://localhost:7700/api/Violation_car_table/location_name-" + location_name + "-time-" + time,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -431,7 +431,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -453,7 +453,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -469,7 +469,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -3,47 +3,49 @@
ViewData["Title"] = "Yuntech_in_car"; ViewData["Title"] = "Yuntech_in_car";
Layout = "~/Views/Shared/_Layout_Engineering.cshtml"; Layout = "~/Views/Shared/_Layout_Engineering.cshtml";
} }
<h1>查詢進出車輛</h1>
<h1>進入車輛</h1>
<div class="size2"> <div class="size2">
起始時間 : <input type="date" id="start_date_id"> 起始日期時間 : <input type="datetime-local" id="start_date_id">
結束時間 : <input type="date" id="end_date_id"> &nbsp;&nbsp;&nbsp;結束日期時間 : <input type="datetime-local" id="end_date_id">
<button style="height:30px; " class="btn btn-outline-secondary" onclick="serch_date_click()">搜尋</button> <button style="height:30px; " class="btn btn-outline-secondary" onclick="serch_date_click()">搜尋</button>
<!--下載時間段進入車輛excel檔按鍵--> <div style="float:right; display: flex; align-items: center;">
時間段內進入車輛 :
<th>
<button class="btn btn-outline-info" onclick="export_excel_1()" style="position: relative;">
<img class="img-profile rounded-circle" style="width:20%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" src="~/image/icon/724933.png">
<span style="visibility: hidden;">下載</span>
</button>
</th>
<!--下載時間段進入車輛-->
下載時間段內進入車輛 :
<th>
<button class="btn btn-outline-info" onclick="export_excel_1()" style="position: relative; width: 50px; height: 30px; padding: 0;">
<img class="img-profile rounded-circle" style="width:20%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" src="~/image/icon/724933.png">
<span style="visibility: hidden;">下載</span>
</button>
</th>
<!--下載總進入車輛-->
&nbsp; &nbsp;&nbsp;&nbsp;下載總進入車輛 :
<th>
<button class="btn btn-outline-info" onclick="export_excel_1()" style="position: relative; width: 50px; height: 30px; padding: 0;">
<img class="img-profile rounded-circle" style="width:20%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" src="~/image/icon/724933.png">
<span style="visibility: hidden;">下載</span>
</button>
</th>
</div>
<!--下載總進入車輛excel檔按鍵--> <br />
總進入車輛 : 選擇進入區域 :
<th>
<button class="btn btn-outline-info" onclick="export_excel()" style="position: relative;">
<img class="img-profile rounded-circle" style="width:20%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" src="~/image/icon/724933.png">
<span style="visibility: hidden;">下載</span>
</button>
</th>
<button style="height:30px;float:right " class="btn btn-outline-secondary" onclick="serch_click()">搜尋</button>
<input type="text" style="float:right" placeholder="請輸入車牌 ex:ABC4321" id="serch_text_id" />
<br/>
<select style="width:10%" id="location_select_id" onchange="location_select()"></select> <select style="width:10%" id="location_select_id" onchange="location_select()"></select>
<div style="float:right; display: flex; align-items: center;">
<input type="text" style="margin-right: 5px;" placeholder="請輸入車牌 ex:ABC4321" id="serch_text_id" />
<button style="height:30px;" class="btn btn-outline-secondary" onclick="serch_click()">搜尋</button>
</div>
<!--<th>
離開區域選擇:
<select style="width:10%" id="out_location_select_id" onchange="out_location_select()"></select>
</th>-->
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th> <th>
區域 進入區域
</th> </th>
<th> <th>
車牌號碼 車牌號碼
@ -57,6 +59,12 @@
<th> <th>
時間 時間
</th> </th>
<th>
出去區域
</th>
<th>
出去時間
</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -73,7 +81,6 @@
</div> </div>
<div class="col-xl-10 col-lg-10"> <div class="col-xl-10 col-lg-10">
</div> </div>
<div class="col-xl-1 col-lg-1"> <div class="col-xl-1 col-lg-1">
<div> <div>
@ -104,6 +111,7 @@
<th> <th>
進入圖片 進入圖片
</th> </th>
<th>
<th> <th>
時間 時間
</th> </th>
@ -130,10 +138,10 @@
var car_table_num = 0 var car_table_num = 0
function get_data() { function get_data() {
var name = "大門口" var name = "大門口"
//console.log(name)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/Amount-" + car_table_num, url: "http://localhost:7700/api/Yuntech_in_car_table/Amount-" + car_table_num,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -143,8 +151,8 @@
'Authorization': token 'Authorization': token
}, },
success: function (Model) { success: function (Model) {
//console.log(Model)
All_Model = Model All_Model = Model
set_data(Model) set_data(Model)
} }
}); });
@ -158,10 +166,38 @@
} }
}); });
*/ */
// 載入 out_location_name 下拉選單資料
var outLocationSelect = document.getElementById("out_location_select_id");
$.ajax({
type: "GET",
url: "http://localhost:7700/api/Yuntech_in_car_table/out_location_name",
data: {},
headers: {
'Authorization': token
},
contentType: "application/json",
success: function (Model) {
console.log(Model);
outLocationSelect.innerHTML = "";
Model.forEach(function (item) {
var option = document.createElement('option');
option.text = item.out_location_name;
outLocationSelect.add(option);
});
},
error: function (xhr, status, error) {
console.error("獲取 out_location_name 資料失敗:", error);
}
});
var select = document.getElementById("location_select_id") var select = document.getElementById("location_select_id")
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/location_name" , url: "http://localhost:7700/api/Yuntech_in_car_table/location_name",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -172,9 +208,9 @@
}, },
success: function (Model) { success: function (Model) {
console.log(Model) console.log(Model)
// 清除现有的选项
select.innerHTML = ""; select.innerHTML = "";
// 添加新的选项
Model.forEach(function (item) { Model.forEach(function (item) {
var option = document.createElement('option'); var option = document.createElement('option');
option.text = item.location_name; option.text = item.location_name;
@ -188,17 +224,17 @@
// 定義抓取資料的函式 // 定義抓取資料的函式
function fetchData_Up() { function fetchData_Up() {
car_table_num = car_table_num - 100 car_table_num = car_table_num - 100
if (car_table_num < 0) { if (car_table_num < 0) {
window.alert('無上一筆資料') window.alert('無上一筆資料')
car_table_num = 0 car_table_num = 0
return return
} }
var name = "大門口" var name = "大門口"
//console.log(name)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/Amount-" + car_table_num, url: "http://localhost:7700/api/Yuntech_in_car_table/Amount-" + car_table_num,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -208,7 +244,7 @@
'Authorization': token 'Authorization': token
}, },
success: function (Model) { success: function (Model) {
//console.log(Model)
All_Model = Model All_Model = Model
set_data(Model) set_data(Model)
} }
@ -218,10 +254,10 @@
function fetchData_Down() { function fetchData_Down() {
car_table_num = car_table_num + 100 car_table_num = car_table_num + 100
var name = "大門口" var name = "大門口"
//console.log(name)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/Amount-" + car_table_num, url: "http://localhost:7700/api/Yuntech_in_car_table/Amount-" + car_table_num,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -231,7 +267,7 @@
'Authorization': token 'Authorization': token
}, },
success: function (Model) { success: function (Model) {
//console.log(Model)
All_Model = Model All_Model = Model
set_data(Model) set_data(Model)
} }
@ -244,60 +280,103 @@
<!--放置資料--> <!--放置資料-->
<script> <script>
function set_data(Model) { function set_data(Model) {
document.getElementById("demo").innerHTML = '' document.getElementById("demo").innerHTML = '';
var table = "<tr>";
console.log(Model.length) var table = "<table>";
console.log(Model.length);
if (Model.length > 0) { if (Model.length > 0) {
for (var i = 0; i < Model.length; i++) { for (var i = 0; i < Model.length; i++) {
if (Model[i].location != null) { if (Model[i].location != null) {
table += "<td>" + Model[i].location + "</td>"
table += "<td>" + Model[i].license_plate_number + "</td>"
// 将字符串转换为 Date 对象
var timestampDt = new Date(Model[i].in_time);
// 转换为其他格式
var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' };
var formattedDate = timestampDt.toLocaleDateString('en-US', options);
table += "<td>" + formattedDate + "</td>"
table += "<td>" + '<button class="btn btn-outline-success" onclick="detail_data(' + "'" + Model[i].location + "','" + i + "','" + Model[i].in_time + "'" + ')">詳細</button>'
table += "<tr>";
// 顯示地點、車牌號碼等
table += "<td>" + Model[i].location + "</td>";
table += "<td>" + Model[i].license_plate_number + "</td>";
// 進入時間
if (Model[i].in_time) {
var timestampDtIn = new Date(Model[i].in_time);
var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' };
var formattedInDate = timestampDtIn.toLocaleDateString('en-US', options);
table += "<td>" + formattedInDate + "</td>";
} else {
table += "<td>沒有資料</td>";
}
// 出去地點
if (Model[i].out_location) {
table += "<td>" + Model[i].out_location + "</td>";
} else {
table += "<td>沒有資料</td>";
}
// 離開時間
if (Model[i].out_time) {
var timestampDtOut = new Date(Model[i].out_time);
var formattedOutDate = timestampDtOut.toLocaleDateString('en-US', options);
table += "<td>" + formattedOutDate + "</td>";
} else {
table += "<td>沒有資料</td>";
}
// 詳細按鈕
table += "<td><button class='btn btn-outline-success' onclick=\"detail_data('" + Model[i].location + "','" + i + "','" + Model[i].in_time + "')\">詳細</button></td>";
table += "</tr>";
} }
table += "</tr>"
table += "<tr>"
} }
} else {
table += "<tr><td colspan='6'>No data available</td></tr>";
} }
table += "</table>";
document.getElementById("demo").innerHTML = table document.getElementById("demo").innerHTML = table
// 移動到最上面 // 移動到最上面
window.scrollTo(0, 0); window.scrollTo(0, 0);
} }
function set_data_license_plate_and_date(Model) { function set_data_license_plate_and_date(Model) {
table = "<tr>"; var table = "<tr>";
console.log(Model.length) console.log(Model.length)
if (Model.length > 0) { if (Model.length > 0) {
for (var i = 0; i < Model.length; i++) { for (var i = 0; i < Model.length; i++) {
if (Model[i].location != null) { if (Model[i].location != null) {
table += "<td>" + Model[i].location + "</td>"
table += "<td>" + Model[i].license_plate_number + "</td>" table += "<td>" + Model[i].location + "</td>";
// 将字符串转换为 Date 对象 table += "<td>" + Model[i].license_plate_number + "</td>";
var timestampDt = new Date(Model[i].in_time); var timestampDt = new Date(Model[i].in_time);
// 转换为其他格式
var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' }; var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' };
var formattedDate = timestampDt.toLocaleDateString('en-US', options); var formattedDate = timestampDt.toLocaleDateString('en-US', options);
table += "<td>" + formattedDate + "</td>" table += "<td>" + formattedDate + "</td>";
table += "<td>" + '<button class="btn btn-outline-success" onclick="detail_data(' + "'" + Model[i].location + "','" + i + "','" + Model[i].in_time + "'" + ')">詳細</button>'
if (Model[i].out_location && Model[i].out_time) {
table += "<td>" + Model[i].out_location + "</td>";
var outTimestampDt = new Date(Model[i].out_time);
var outFormattedDate = outTimestampDt.toLocaleDateString('en-US', options);
table += "<td>" + outFormattedDate + "</td>";
} else {
table += "<td>沒有資料</td>";
table += "<td>沒有資料</td>";
}
table += "<td><button class='btn btn-outline-success' onclick=\"detail_data('" + Model[i].location + "','" + i + "','" + Model[i].in_time + "')\">詳細</button></td>";
} }
table += "</tr>" table += "</tr>";
table += "<tr>" table += "<tr>";
} }
} }
document.getElementById("demo").innerHTML = table document.getElementById("demo").innerHTML = table;
} }
</script> </script>
@ -333,21 +412,21 @@
<!--車輛詳細--> <!--車輛詳細-->
<script> <script>
function detail_data(location_name, car_serial_number, time) { function detail_data(location_name, car_serial_number, time, out_location_name) {
// 設定車輛序列號 // 設定車輛序列號
serial_number = car_serial_number serial_number = car_serial_number
// 發送AJAX GET請求 // 發送AJAX GET請求
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/location_name-" + location_name + "-time-" + time, url: "http://localhost:7700/api/Yuntech_in_car_table/location_name-" + location_name + "-time-" + time,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
success: function (Model) { success: function (Model) {
// 在控制台列印返回的模型資料
console.log(Model) console.log(Model)
// 設定固定車輛圖片 // 設定固定車輛圖片
@ -357,21 +436,29 @@
if (Model.out_time == null) { if (Model.out_time == null) {
// 如果沒有離開時間,顯示進入時間和車輛圖像 // 如果沒有離開時間,顯示進入時間和車輛圖像
table = "<tr>"; table = "<tr>";
table += "<td>" + Model.location + "</td>"; table += "<td>進入區域 " + "<br>" + Model.location + "</td>";
table += "<td>" + '<input type="text" id="license_plate_number_text_id" value="' + Model.license_plate_number + '"/>' + "</td>"; table += "<td>" + '<input type="text" id="license_plate_number_text_id" value="' + Model.license_plate_number + '"/>' + "</td>";
// 添加固定車輛圖片 // 添加固定車輛圖片
if (Model.car_img == null || Model.car_img == "") { if (Model.car_img == null || Model.car_img == "") {
table += "<td>" + "<img src='" + "/bootstrap_1/img/maxresdefault.jpg" + "' style='width:80%' />" + "</td>"; table += "<td>" + "<img src='" + "/bootstrap_1/img/maxresdefault.jpg" + "' style='width:80%' />" + "</td>";
} else { } else {
table += "<td>" + "<img src='" + Model.car_img + "' style='width:80%' />" + "</td>"; table += "<td>" + "<img src='" + Model.car_img + "' style='width:80%' />" + "</td>";
} }
var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' };
table += "<td id='create_data_time_id'>" + Model.in_time + "</td>"; // 格式化進入時間
var timestampDtIn = new Date(Model.in_time);
var formattedInDate = timestampDtIn.toLocaleDateString('en-US', options);
// 建立表格內容
table += "<td id='create_data_time_id'>" +
"進入時間: " + formattedInDate + "<br/><br/>" + "</td>";
document.getElementById("detail_car_data").innerHTML = table; document.getElementById("detail_car_data").innerHTML = table;
} else { } else {
// 如果有離開時間,顯示進入和離開時間以及車輛圖像 // 如果有離開時間,顯示進入和離開時間以及車輛圖像
table = "<tr>"; table = "<tr>";
table += "<td>" + Model.location + "</td>"; table += "<td>進入區域 " + Model.location + " <br>" + "<br>出去區域 " + (Model.out_location ? Model.out_location : '沒有資料') + "</td>";
table += "<td>" + '<input type="text" id="license_plate_number_text_id" value="' + Model.license_plate_number + '"/>' + "</td>"; table += "<td>" + '<input type="text" id="license_plate_number_text_id" value="' + Model.license_plate_number + '"/>' + "</td>";
// 添加固定車輛圖片 // 添加固定車輛圖片
@ -387,12 +474,26 @@
table += "<td>" + "<img src='" + Model.car_img + "' style='width:40%' />" + "<img src='" + Model.out_car_img + "' style='width:40%' />" + "</td>"; table += "<td>" + "<img src='" + Model.car_img + "' style='width:40%' />" + "<img src='" + Model.out_car_img + "' style='width:40%' />" + "</td>";
} }
table += "<td id='create_data_time_id'>" + "進入時間:" + Model.in_time + "<br/><br/>" + "出去時間: " + Model.out_time + "</td>"; var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' };
// 格式化進入時間
var timestampDtIn = new Date(Model.in_time);
var formattedInDate = timestampDtIn.toLocaleDateString('en-US', options);
// 格式化出去時間
var timestampDtOut = new Date(Model.out_time);
var formattedOutDate = timestampDtOut.toLocaleDateString('en-US', options);
// 建立表格內容
table += "<td id='create_data_time_id'>" +
"進入時間: " + formattedInDate + "<br/><br/>" +
"出去時間: " + (Model.out_time ? formattedOutDate : '沒有資料') +
"</td>";
document.getElementById("detail_car_data").innerHTML = table; document.getElementById("detail_car_data").innerHTML = table;
} }
} }
}); });
// 顯示詳細資料的對話框
detail_car_data_view.showModal(); detail_car_data_view.showModal();
} }
</script> </script>
@ -407,7 +508,7 @@
} }
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/license_plate_number-" + license_plate_number, url: "http://localhost:7700/api/Yuntech_in_car_table/license_plate_number-" + license_plate_number,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -443,7 +544,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/location_name_1_-" + name + "-start_time-" + start_date + "-end_time-" + end_date, url: "http://localhost:7700/api/Yuntech_in_car_table/location_name_1_-" + name + "-start_time-" + start_date + "-end_time-" + end_date,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -474,7 +575,7 @@
console.log(select_location) console.log(select_location)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/location-" + select_location, url: "http://localhost:7700/api/Yuntech_in_car_table/location-" + select_location,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -492,22 +593,28 @@
} }
</script> </script>
<!--輸出時間EXCEL-->
<!--輸出時間段內EXCEL-->
<script> <script>
function export_excel_1() { function export_excel_1() {
var name = document.getElementById("location_select_id").value; var name = document.getElementById("location_select_id").value;
var start_date = document.getElementById("start_date_id").value; var start_date = document.getElementById("start_date_id").value;
var end_date = document.getElementById("end_date_id").value; var end_date = document.getElementById("end_date_id").value;
// 將日期格式轉換為後端期望的格式(如 'YYYY-MM-DDTHH:MM:SS'
if (!start_date || !end_date) {
alert("請選擇起始日期和結束日期");
return;
}
var start_time = new Date(start_date).toISOString(); var start_time = new Date(start_date).toISOString();
var end_time = new Date(end_date).toISOString(); var end_time = new Date(end_date).toISOString();
// 構建請求URL
var url = "http://140.125.20.183:7700/api/Yuntech_in_car_table/location_name_2_-" + name + "-start_time-" + start_date + "-end_time-" + end_date + "-export_excel";
// 發送HTTP GET請求到Web API動作方法 var sanitizedStartDate = start_date.replace(/[^\x20-\x7E]/g, "_");
var sanitizedEndDate = end_date.replace(/[^\x20-\x7E]/g, "_");
var url = `http://localhost:7700/api/Yuntech_in_car_table/location_name_2_-${name}-start_time-${sanitizedStartDate}-end_time-${sanitizedEndDate}-export_excel`;
fetch(url, { fetch(url, {
method: 'GET', method: 'GET',
headers: { headers: {
@ -515,70 +622,77 @@
} }
}) })
.then(response => { .then(response => {
// 確認響應的狀態碼是否為200成功
if (!response.ok) { if (!response.ok) {
throw new Error('Network response was not ok'); throw new Error('Network response was not ok');
} }
// 將響應的數據轉換為Blob對象
return response.blob(); return response.blob();
}) })
.then(blob => { .then(blob => {
// 創建URL對象
const url = window.URL.createObjectURL(blob); const blobUrl = window.URL.createObjectURL(blob);
// 創建當前時間 const currentTime = new Date();
const currentTime = new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d{3}/g, ""); const options = {
// 構建檔案名稱 year: 'numeric',
const filename = `時間段內進入車輛-${currentTime}.xlsx`; month: '2-digit',
// 創建<a>元素 day: '2-digit',
hour: '2-digit',
minute: '2-digit',
hour12: false
};
const formattedTime = currentTime.toLocaleString('en-US', options)
.replace(/\//g, '-')
.replace(',', '')
.replace(/\s+/g, '_')
.replace(/:/g, '-');
const filename = `時間段內進入車輛-${encodeURIComponent(formattedTime)}.xlsx`;
const a = document.createElement('a'); const a = document.createElement('a');
a.href = url; a.href = blobUrl;
a.download = filename; // 下載時的文件名稱 a.download = filename;
// 模擬單擊<a>元素
a.click(); a.click();
// 釋放URL對象 window.URL.revokeObjectURL(blobUrl);
window.URL.revokeObjectURL(url);
}) })
.catch(error => { .catch(error => {
console.error('There was a problem with your fetch operation:', error); console.error('There was a problem with your fetch operation:', error);
}); });
} }
</script> </script>
<!--輸出總EXCEL--> <!--輸出總EXCEL-->
<script> <script>
function export_excel() { function export_excel() {
// 發送HTTP GET請求到Web API動作方法
fetch('http://140.125.20.183:7700/api/Yuntech_in_car_table/export-all_excel', { fetch('http://localhost:7700/api/Yuntech_in_car_table/export-all_excel', {
method: 'GET', method: 'GET',
headers: { headers: {
'Authorization': token 'Authorization': token
} }
}) })
.then(response => { .then(response => {
// 確認響應的狀態碼是否為200成功
if (!response.ok) { if (!response.ok) {
throw new Error('Network response was not ok'); throw new Error('Network response was not ok');
} }
// 將響應的數據轉換為Blob對象
return response.blob(); return response.blob();
}) })
.then(blob => { .then(blob => {
// 創建URL對象
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
// 創建當前時間
const currentTime = new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d{3}/g, ""); const currentTime = new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d{3}/g, "");
// 構建檔案名稱
const filename = `總進入車輛-${currentTime}.xlsx`; const filename = `總進入車輛-${currentTime}.xlsx`;
// 創建<a>元素
const a = document.createElement('a'); const a = document.createElement('a');
a.href = url; a.href = url;
a.download = filename; // 下載時的文件名稱 a.download = filename;
// 模擬單擊<a>元素
a.click(); a.click();
// 釋放URL對象
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url);
}) })
.catch(error => { .catch(error => {
@ -594,12 +708,12 @@
<script> <script>
var token var token
function token_check() { function token_check() {
// 检查本地存储中是否存在JWT令牌
token = localStorage.getItem('token_park_space'); token = localStorage.getItem('token_park_space');
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -611,7 +725,7 @@
error: function (xhr) { error: function (xhr) {
token_check = "false" token_check = "false"
window.location.href = '/'; window.location.href = '/';
// 处理错误响应,例如跳转到未授权页面
//window.location.href = 'https://example.com/unauthorized_page'; //window.location.href = 'https://example.com/unauthorized_page';
} }
}); });
@ -621,7 +735,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -637,7 +751,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -131,7 +131,7 @@
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "http://140.125.20.183:7700/Users/authenticate", url: "http://localhost:7700/Users/authenticate",
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
success: function (msg) { success: function (msg) {

View File

@ -97,10 +97,10 @@
<h1>管理員模式</h1> <h1>管理員模式</h1>
<div class="row"> <div class="row">
<!--每日違規數量--> <!-- 左側內容:每日違規數量 + 每日車流量 + 總車位與月租信息 -->
<div class="col-xl-8 col-lg-8"> <div class="col-xl-8 col-lg-8">
<div class="card shadow mb-0"> <!-- 每日違規數量 -->
<!-- 將 mb-2 改為 mb-0 --> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary"> <h6 class="m-0 font-weight-bold text-primary">
每日違規數量 每日違規數量
@ -114,57 +114,12 @@
</div> </div>
</div> </div>
</div> <!-- 每日車流量 -->
<!--演算法狀態-->
<div class="col-xl-4 col-lg-4">
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">演算法狀態</h6>
</div>
<div>
<table class="table">
<thead>
<tr>
<th>演算法名稱</th>
<th>狀態</th>
</tr>
</thead>
<tbody id="demo"></tbody>
</table>
</div>
</div>
<!--字幕機狀態-->
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary"> <h6 class="m-0 font-weight-bold text-primary">
字幕機狀態 每日車流量
<button class="btn btn-info btn-circle btn-sm" style="float:right; background-image: url('/image/icon/F5.png'); background-size: cover;" onclick="get_LED_data()"></button> <button class="btn btn-info btn-circle btn-sm" style="float:right; background-image: url('/image/icon/F5.png'); background-size: cover;" onclick="get_in_yuntech_data_1()"></button>
</h6>
</div>
<div>
<table class="table">
<thead>
<tr>
<th>停車場位置</th>
<th>字幕機IP</th>
<th>顯示參數</th>
</tr>
</thead>
<tbody id="LED_table"></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--每日車流量-->
<div class="col-xl-8 col-lg-8">
<div class="card shadow mb-0">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">
每日車流量<button class="btn btn-info btn-circle btn-sm" style="float:right; background-image: url('/image/icon/F5.png'); background-size: cover;" onclick="get_in_yuntech_data_1()"></button>
</h6> </h6>
</div> </div>
<div class="card-body"> <div class="card-body">
@ -173,35 +128,19 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- 總車位與月租Excel 文件 及 校園車位信息 -->
<style>
.table th, .table td {
text-align: center; /* 居中對齊 */
}
.table th:nth-child(1), .table td:nth-child(1) { <!-- 總車位與月租信息 -->
width: 200px; /* 根據需要調整寬度 */
}
.table th:nth-child(2), .table td:nth-child(2) {
width: 200px; /* 根據需要調整寬度 */
}
</style>
<div class="col-xl-8 col-lg-8">
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3" style="display: flex; justify-content: space-between; align-items: center;">
<h6 class="m-0 font-weight-bold text-primary"> <h6 class="m-0 font-weight-bold text-primary">
下載 總車位與月租Excel 文件 及 校園車位信息 下載 總車位與月租Excel 文件 及 校園車位信息
<button class="btn btn-info btn-circle btn-sm" style="float:right; background-image: url('/image/icon/F5.png'); background-size: cover;" onclick="get_yuntech_parking_data()"></button>
</h6> </h6>
<!--<button class="btn btn-info btn-circle btn-sm" style="float:right; background-image: url('/image/icon/F5.png'); background-size: cover;" onclick="get_yuntech_parking_data()"></button>-->
<button class="btn btn-primary" onclick="downloadExcel()">即時車位下載 Excel</button>
</div> </div>
<div class="card-body">
<!-- 下載 Excel 文件按鈕 -->
<div class="mb-3">
<button class="btn btn-primary" onclick="downloadExcel()">即時車位下載 Excel</button>
</div>
<div class="card-body">
<!-- 校園總車位數量表格 --> <!-- 校園總車位數量表格 -->
<div> <div>
<h6 class="font-weight-bold text-primary">校園總車位數量</h6> <h6 class="font-weight-bold text-primary">校園總車位數量</h6>
@ -213,7 +152,6 @@
</tr> </tr>
</thead> </thead>
<tbody id="parking_all_table"> <tbody id="parking_all_table">
`
<!-- 動態更新校園總車位與剩餘車位 --> <!-- 動態更新校園總車位與剩餘車位 -->
</tbody> </tbody>
</table> </table>
@ -238,9 +176,49 @@
</div> </div>
</div> </div>
<!-- 右側內容:演算法狀態 + 字幕機狀態 -->
<div class="col-xl-4 col-lg-4">
<!-- 演算法狀態 -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">演算法狀態</h6>
</div>
<div>
<table class="table">
<thead>
<tr>
<th>演算法名稱</th>
<th>狀態</th>
</tr>
</thead>
<tbody id="demo"></tbody>
</table>
</div>
</div>
<!-- 字幕機狀態 -->
<div class="card shadow">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">
字幕機狀態
<button class="btn btn-info btn-circle btn-sm" style="float:right; background-image: url('/image/icon/F5.png'); background-size: cover;" onclick="get_LED_data()"></button>
</h6>
</div>
<div>
<table class="table">
<thead>
<tr>
<th>停車場位置</th>
<th>字幕機IP</th>
<th>參數</th>
</tr>
</thead>
<tbody id="LED_table"></tbody>
</table>
</div>
</div>
</div>
</div>
<!--彈跳視窗--> <!--彈跳視窗-->
<div> <div>
<dialog id="RTSP_view" style="width:80%;"> <dialog id="RTSP_view" style="width:80%;">
@ -254,7 +232,7 @@
<!--Excel下載--> <!--Excel下載-->
<script> <script>
function downloadExcel() { function downloadExcel() {
fetch('http://140.125.20.183:7700/api/ParkingLogs/DownloadCurrentStatusExcel', { fetch('http://localhost:7700/api/ParkingLogs/DownloadCurrentStatusExcel', {
method: 'GET', method: 'GET',
headers: { headers: {
'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' 'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
@ -441,7 +419,7 @@
//console.log(token_check) //console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/get_day_violation-" + day, url: "http://localhost:7700/api/Violation_car_table/get_day_violation-" + day,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -490,7 +468,7 @@
in_car_list = [] in_car_list = []
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/get_day_in_car-" + day, url: "http://localhost:7700/api/Yuntech_in_car_table/get_day_in_car-" + day,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -530,7 +508,7 @@
function get_algorithm_data() { function get_algorithm_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm", url: "http://localhost:7700/api/Parking_space_algorithm",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -545,7 +523,7 @@
function get_algorithm_data_1() { function get_algorithm_data_1() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm", url: "http://localhost:7700/api/Parking_space_algorithm",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -574,7 +552,7 @@
var stringify_obj = JSON.stringify(data_1); var stringify_obj = JSON.stringify(data_1);
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Parking_space_algorithm/" + Model[i].algorithm_serial_num, url: "http://localhost:7700/api/Parking_space_algorithm/" + Model[i].algorithm_serial_num,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -628,7 +606,7 @@
function get_LED_data() { function get_LED_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_lcd_instand", url: "http://localhost:7700/api/Parking_spaces_lcd_instand",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -673,7 +651,7 @@
function get_monthly_rent_data() { function get_monthly_rent_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_monthly_rent_number", url: "http://localhost:7700/api/Yuntech_monthly_rent_number",
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -700,7 +678,7 @@
table += "<td>" + Model[i].category + "</td>" table += "<td>" + Model[i].category + "</td>"
table += "<td>" + '<input type="text" id = "parking_space_amount_id" value =' + Model[i].number + ' />' + "</td > " table += "<td>" + '<input type="text" id = "parking_space_amount_id" value =' + Model[i].number + ' />' + "</td > "
table += "<td>" + '<button class="btn btn-outline-warning " onclick="Update_monthly_rent_number(' + "'" + i + "'" + ')">更新並上傳</button>' //table += "<td>" + '<button class="btn btn-outline-warning " onclick="Update_monthly_rent_number(' + "'" + i + "'" + ')">更新並上傳</button>'
} }
table += "</tr>" table += "</tr>"
table += "<tr>" table += "<tr>"
@ -724,7 +702,7 @@
var stringify_obj = JSON.stringify(data); var stringify_obj = JSON.stringify(data);
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Yuntech_monthly_rent_number/" + category, url: "http://localhost:7700/api/Yuntech_monthly_rent_number/" + category,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -744,7 +722,7 @@
function get_yuntech_parking_data() { function get_yuntech_parking_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_parking", url: "http://localhost:7700/api/Yuntech_parking",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -767,7 +745,7 @@
table += "<td>" + Model[i].all_num + "</td>" table += "<td>" + Model[i].all_num + "</td>"
table += "<td>" + '<input type="text" id = "parking_space_amount_id" value =' + Model[i].now_num + ' />' + "</td > " table += "<td>" + '<input type="text" id = "parking_space_amount_id" value =' + Model[i].now_num + ' />' + "</td > "
table += "<td>" + '<button class="btn btn-outline-warning " onclick="Update_now_num(' + "'" + Model[i].all_num + "'" + ')">更新並上傳</button>' //table += "<td>" + '<button class="btn btn-outline-warning " onclick="Update_now_num(' + "'" + Model[i].all_num + "'" + ')">更新並上傳</button>'
} }
table += "</tr>" table += "</tr>"
table += "<tr>" table += "<tr>"
@ -782,7 +760,7 @@
function Update_now_num(all_num) { function Update_now_num(all_num) {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_parking/" + all_num, url: "http://localhost:7700/api/Yuntech_parking/" + all_num,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -801,7 +779,7 @@
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Yuntech_parking/" + Model.all_num, url: "http://localhost:7700/api/Yuntech_parking/" + Model.all_num,
data: stringify_obj, data: stringify_obj,
headers: { headers: {
'Authorization': token 'Authorization': token
@ -833,7 +811,7 @@
IP_1 = IP IP_1 = IP
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP, url: 'http://localhost:7705/IP/' + IP,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -855,7 +833,7 @@
//console.log(IP_1) //console.log(IP_1)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP_1, url: 'http://localhost:7705/IP/' + IP_1,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -966,7 +944,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table", url: "http://localhost:7700/api/Parking_spaces_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -984,7 +962,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_violation_total_table", url: "http://localhost:7700/api/Parking_spaces_violation_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1002,7 +980,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_cam_total_table", url: "http://localhost:7700/api/Yuntech_cam_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1021,7 +999,7 @@
location_name = location_name location_name = location_name
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam", url: "http://localhost:7700/api/Parking_spaces_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1040,7 +1018,7 @@
location_name = location_name location_name = location_name
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_cam", url: "http://localhost:7700/api/Yuntech_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -1173,7 +1151,7 @@
//console.log(token) //console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -1195,7 +1173,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -1211,7 +1189,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -215,7 +215,7 @@
console.log(token_check) console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_violation_total_table", url: "http://localhost:7700/api/Parking_spaces_violation_total_table",
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -271,7 +271,7 @@
function get_recidivst_1() { function get_recidivst_1() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/recidivists", url: "http://localhost:7700/api/Violation_car_table/recidivists",
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -323,7 +323,7 @@
//console.log(token_check) //console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/get_day_violation-" + day, url: "http://localhost:7700/api/Violation_car_table/get_day_violation-" + day,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -367,7 +367,7 @@
<script> <script>
function export_excel() { function export_excel() {
// 發送HTTP GET請求到Web API動作方法 // 發送HTTP GET請求到Web API動作方法
fetch('http://140.125.20.183:7700/api/Violation_car_table/export-all_excel', { fetch('http://localhost:7700/api/Violation_car_table/export-all_excel', {
method: 'GET', method: 'GET',
headers: { headers: {
'Authorization': token 'Authorization': token
@ -414,7 +414,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -436,7 +436,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -452,7 +452,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -56,7 +56,7 @@
} }
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_parking_user_list/license_plate_number-" + license_plate_number, // 使用車牌號碼查詢 url: "http://localhost:7700/api/Yuntech_parking_user_list/license_plate_number-" + license_plate_number, // 使用車牌號碼查詢
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -143,7 +143,7 @@
var stringify_obj = JSON.stringify(obj); var stringify_obj = JSON.stringify(obj);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "http://140.125.20.183:7700/api/Yuntech_parking_user_list", url: "http://localhost:7700/api/Yuntech_parking_user_list",
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -167,7 +167,7 @@
<!--上傳excel--> <!--上傳excel-->
<script> <script>
const api_url = 'http://140.125.20.183:7700'; // 定义 api_url const api_url = 'http://localhost:7700'; // 定义 api_url
document.getElementById('uploadForm').onsubmit = function (event) { document.getElementById('uploadForm').onsubmit = function (event) {
event.preventDefault(); event.preventDefault();
@ -232,7 +232,7 @@
function delet_data(license_plate_number) { function delet_data(license_plate_number) {
$.ajax({ $.ajax({
type: "DELETE", type: "DELETE",
url: "http://140.125.20.183:7700/api/Yuntech_parking_user_list/" + license_plate_number, url: "http://localhost:7700/api/Yuntech_parking_user_list/" + license_plate_number,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -251,7 +251,7 @@
function get_data() { function get_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_parking_user_list", url: "http://localhost:7700/api/Yuntech_parking_user_list",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -303,7 +303,7 @@
//console.log(token) //console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -327,7 +327,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -343,7 +343,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -73,7 +73,7 @@
IP_1 = IP IP_1 = IP
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP, url: 'http://localhost:7705/IP/' + IP,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -95,7 +95,7 @@
console.log(IP_1) console.log(IP_1)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7705/IP/' + IP_1, url: 'http://localhost:7705/IP/' + IP_1,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -295,7 +295,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table", url: "http://localhost:7700/api/Parking_spaces_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -313,7 +313,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_violation_total_table", url: "http://localhost:7700/api/Parking_spaces_violation_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -331,7 +331,7 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_cam_total_table", url: "http://localhost:7700/api/Yuntech_cam_total_table",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -351,7 +351,7 @@
location_name = location_name location_name = location_name
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_cam", url: "http://localhost:7700/api/Parking_spaces_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -370,7 +370,7 @@
location_name = location_name location_name = location_name
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_cam", url: "http://localhost:7700/api/Yuntech_cam",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -489,7 +489,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -513,7 +513,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -529,7 +529,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -11,7 +11,7 @@
<link rel="stylesheet" href="/bootstrap_1/css/bootstrap.min.css"> <link rel="stylesheet" href="/bootstrap_1/css/bootstrap.min.css">
<style> <style>
.table th, .table td { .table th, .table td {
text-align: center; /* 居中對齊 */ text-align: center;
} }
#loading { #loading {
@ -20,13 +20,13 @@
} }
.pagination { .pagination {
justify-content: center; /* 分頁居中 */ justify-content: center;
} }
</style> </style>
</head> </head>
<body> <body>
<div class="container mt-1"> <div class="container mt-1">
<h1>查詢所有時間車位數</h1> <h1>查詢車位數</h1>
<div class="col-xl-32 col-lg32"> <div class="col-xl-32 col-lg32">
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3 d-flex justify-content-between align-items-center"> <div class="card-header py-3 d-flex justify-content-between align-items-center">
@ -64,7 +64,7 @@
</tr> </tr>
</thead> </thead>
<tbody id="parking_logs_table"> <tbody id="parking_logs_table">
<!-- 停車紀錄會動態填充到這裡 -->
</tbody> </tbody>
</table> </table>
<div id="noDataMessage" class="text-danger" style="display:none;"> <div id="noDataMessage" class="text-danger" style="display:none;">
@ -89,8 +89,8 @@
</div> </div>
<script> <script>
let currentPage = 1; // 當前頁碼 let currentPage = 1;
const recordsPerPage = 20; // 每頁顯示的紀錄數 const recordsPerPage = 20;
function fetchParkingLogs(page = 1) { function fetchParkingLogs(page = 1) {
const startDate = document.getElementById('startDate').value; const startDate = document.getElementById('startDate').value;
@ -102,7 +102,7 @@
return; return;
} }
// 確保開始時間早於結束時間
if (new Date(startDate) >= new Date(endDate)) { if (new Date(startDate) >= new Date(endDate)) {
alert('結束日期必須晚於開始日期!'); alert('結束日期必須晚於開始日期!');
return; return;
@ -110,16 +110,16 @@
const logsTable = document.getElementById('parking_logs_table'); const logsTable = document.getElementById('parking_logs_table');
const loadingIndicator = document.getElementById('loading'); const loadingIndicator = document.getElementById('loading');
loadingIndicator.style.display = 'block'; // 顯示加載中 loadingIndicator.style.display = 'block';
// 使用 URLSearchParams 來構建查詢字串
const params = new URLSearchParams(); const params = new URLSearchParams();
params.append('startDate', startDate); params.append('startDate', startDate);
params.append('endDate', endDate); params.append('endDate', endDate);
params.append('interval', timeInterval); // 傳遞時間間隔 params.append('interval', timeInterval);
params.append('page', page); // 傳遞當前頁碼 params.append('page', page);
const url = `http://140.125.20.183:7700/api/ParkingLogs/GetHourlyParkingLogs?${params.toString()}`; // 調用 GetHourlyParkingLogs API const url = `http://localhost:7700/api/ParkingLogs/GetHourlyParkingLogs?${params.toString()}`;
fetch(url) fetch(url)
.then(response => { .then(response => {
@ -129,14 +129,14 @@
return response.json(); return response.json();
}) })
.then(data => { .then(data => {
logsTable.innerHTML = ''; // 清空現有的表格 logsTable.innerHTML = '';
if (data.logs.length === 0) { if (data.logs.length === 0) {
document.getElementById('noDataMessage').style.display = 'block'; // 顯示無數據提示 document.getElementById('noDataMessage').style.display = 'block';
document.getElementById('paginationContainer').style.display = 'none'; document.getElementById('paginationContainer').style.display = 'none';
} else { } else {
document.getElementById('noDataMessage').style.display = 'none'; // 隱藏無數據提示 document.getElementById('noDataMessage').style.display = 'none';
// Sort logs by timestamp
data.logs.sort((a, b) => new Date(a.timestamp) - new Date(b.timestamp)); data.logs.sort((a, b) => new Date(a.timestamp) - new Date(b.timestamp));
data.logs.forEach(log => { data.logs.forEach(log => {
@ -152,10 +152,10 @@
logsTable.appendChild(row); logsTable.appendChild(row);
}); });
// 更新分頁顯示
currentPage = page; // 更新當前頁碼 currentPage = page;
document.getElementById('paginationContainer').style.display = 'block'; document.getElementById('paginationContainer').style.display = 'block';
updatePagination(data.totalRecords); // 更新分頁按鈕顯示 updatePagination(data.totalRecords);
} }
}) })
.catch(error => { .catch(error => {
@ -163,21 +163,21 @@
alert('獲取停車紀錄時出現錯誤,請稍後再試。'); alert('獲取停車紀錄時出現錯誤,請稍後再試。');
}) })
.finally(() => { .finally(() => {
loadingIndicator.style.display = 'none'; // 隱藏加載指示器 loadingIndicator.style.display = 'none';
}); });
} }
function updatePagination(totalRecords) { function updatePagination(totalRecords) {
const totalPages = Math.ceil(totalRecords / recordsPerPage); // 計算總頁數 const totalPages = Math.ceil(totalRecords / recordsPerPage);
document.getElementById('nextPageItem').style.display = currentPage < totalPages ? 'block' : 'none'; document.getElementById('nextPageItem').style.display = currentPage < totalPages ? 'block' : 'none';
document.getElementById('prevPageItem').style.display = currentPage > 1 ? 'block' : 'none'; document.getElementById('prevPageItem').style.display = currentPage > 1 ? 'block' : 'none';
document.getElementById('paginationContainer').dataset.totalRecords = totalRecords; // 存儲總記錄數 document.getElementById('paginationContainer').dataset.totalRecords = totalRecords;
} }
function changePage(page) { function changePage(page) {
const totalPages = Math.ceil(Number(document.getElementById('paginationContainer').dataset.totalRecords) / recordsPerPage); const totalPages = Math.ceil(Number(document.getElementById('paginationContainer').dataset.totalRecords) / recordsPerPage);
if (page < 1 || page > totalPages) return; // 確保不會小於 1 或超過總頁數 if (page < 1 || page > totalPages) return;
fetchParkingLogs(page); // 重新獲取該頁的數據 fetchParkingLogs(page);
} }
function goToHomePage() { function goToHomePage() {
@ -194,8 +194,8 @@
return; return;
} }
// 傳遞時間間隔以便後端生成相應的 Excel
window.open(`http://140.125.20.183:7700/api/ParkingLogs/DownloadExcel?startDate=${startDate}&endDate=${endDate}&interval=${timeInterval}`, '_blank'); window.open(`http://localhost:7700/api/ParkingLogs/DownloadExcel?startDate=${startDate}&endDate=${endDate}&interval=${timeInterval}`, '_blank');
} }
</script> </script>
@ -207,24 +207,24 @@
<script> <script>
var token var token
function token_check() { function token_check() {
// 检查本地存储中是否存在JWT令牌
token = localStorage.getItem('token_park_space'); token = localStorage.getItem('token_park_space');
//console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
success: function (response) { success: function (response) {
//console.log(response)
token_check = "true" token_check = "true"
from_token_import_id() from_token_import_id()
}, },
error: function (xhr) { error: function (xhr) {
token_check = "false" token_check = "false"
window.location.href = '/'; window.location.href = '/';
// 处理错误响应,例如跳转到未授权页面
//window.location.href = 'https://example.com/unauthorized_page'; //window.location.href = 'https://example.com/unauthorized_page';
} }
}); });
@ -234,12 +234,12 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
success: function (response) { success: function (response) {
//console.log(response)
from_id_import_user_data(response) from_id_import_user_data(response)
@ -250,14 +250,14 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
success: function (model) { success: function (model) {
model = model.result model = model.result
position = model.lastname position = model.lastname
//console.log(position)
if (position == "manager") { if (position == "manager") {
get_data() get_data()
} }

View File

@ -102,7 +102,7 @@
//console.log(name) //console.log(name)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/violation_location_name-" + name, url: "http://localhost:7700/api/Violation_car_table/violation_location_name-" + name,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -160,7 +160,7 @@
console.log(time) console.log(time)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/location_nam-" + violation_location_name + "-time-" + time, url: "http://localhost:7700/api/Violation_car_table/location_nam-" + violation_location_name + "-time-" + time,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -181,7 +181,7 @@
var stringify_obj = JSON.stringify(Model); var stringify_obj = JSON.stringify(Model);
$.ajax({ $.ajax({
type: "PUT", type: "PUT",
url: "http://140.125.20.183:7700/api/Violation_car_table/location_nam-" + violation_location_name + "-time-" + time, url: "http://localhost:7700/api/Violation_car_table/location_nam-" + violation_location_name + "-time-" + time,
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -237,7 +237,7 @@
serial_number = car_serial_number serial_number = car_serial_number
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/location_nam-" + location_name + "-time-" + time, url: "http://localhost:7700/api/Violation_car_table/location_nam-" + location_name + "-time-" + time,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -269,7 +269,7 @@
} }
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/license_plate_number-" + license_plate_number, url: "http://localhost:7700/api/Violation_car_table/license_plate_number-" + license_plate_number,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -295,7 +295,7 @@
console.log(start_date) console.log(start_date)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/location_name_1_-" + name + "-start_time-" + start_date + "-end_time-" + end_date, url: "http://localhost:7700/api/Violation_car_table/location_name_1_-" + name + "-start_time-" + start_date + "-end_time-" + end_date,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -321,7 +321,7 @@
var start_date = document.getElementById("start_date_id").value var start_date = document.getElementById("start_date_id").value
var end_date = document.getElementById("end_date_id").value var end_date = document.getElementById("end_date_id").value
// 發送HTTP GET請求到Web API動作方法 // 發送HTTP GET請求到Web API動作方法
fetch('http://140.125.20.183:7700/api/Violation_car_table/export-excel_location_name_1_-' + name + "-start_time-" + start_date + "-end_time-" + end_date, { fetch('http://localhost:7700/api/Violation_car_table/export-excel_location_name_1_-' + name + "-start_time-" + start_date + "-end_time-" + end_date, {
method: 'GET', method: 'GET',
headers: { headers: {
'Authorization': token 'Authorization': token
@ -362,7 +362,7 @@
function plate_export_excel() { function plate_export_excel() {
var license_plate_number = document.getElementById("serch_text_id").value var license_plate_number = document.getElementById("serch_text_id").value
// 發送HTTP GET請求到Web API動作方法 // 發送HTTP GET請求到Web API動作方法
fetch('http://140.125.20.183:7700/api/Violation_car_table/export-excel_license_plate_number-' + license_plate_number, { fetch('http://localhost:7700/api/Violation_car_table/export-excel_license_plate_number-' + license_plate_number, {
method: 'GET', method: 'GET',
headers: { headers: {
'Authorization': token 'Authorization': token
@ -406,7 +406,7 @@
console.log(time) console.log(time)
$.ajax({ $.ajax({
type: "DELETE", type: "DELETE",
url: "http://140.125.20.183:7700/api/Violation_car_table/location_name-" + location_name + "-time-" + time, url: "http://localhost:7700/api/Violation_car_table/location_name-" + location_name + "-time-" + time,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -430,7 +430,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -452,7 +452,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -468,7 +468,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -4,41 +4,51 @@
Layout = "~/Views/Shared/_Layout_Manager.cshtml"; Layout = "~/Views/Shared/_Layout_Manager.cshtml";
} }
<h1>進入車輛</h1> <h1>查詢進出車輛</h1>
<div class="size2"> <div class="size2">
起始時間 : <input type="date" id="start_date_id"> 起始日期時間 : <input type="datetime-local" id="start_date_id">
結束時間 : <input type="date" id="end_date_id"> 結束日期時間 : <input type="datetime-local" id="end_date_id">
<button style="height:30px; " class="btn btn-outline-secondary" onclick="serch_date_click()">搜尋</button> <button style="height:30px; " class="btn btn-outline-secondary" onclick="serch_date_click()">搜尋</button>
<!--下載時間段進入車輛excel檔按鍵--> <div style="float:right; display: flex; align-items: center;">
時間段內進入車輛 :
<th>
<button class="btn btn-outline-info" onclick="export_excel_1()" style="position: relative;">
<img class="img-profile rounded-circle" style="width:20%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" src="~/image/icon/724933.png">
<span style="visibility: hidden;">下載</span>
</button>
</th>
<!--下載進入車輛excel檔按鍵--> <!--下載時間段進入車輛-->
進入車輛 : 下載時間段內進入車輛 :
<th> <th>
<button class="btn btn-outline-info" onclick="export_excel()" style="position: relative;"> <button class="btn btn-outline-info" onclick="export_excel_1()" style="position: relative; width: 50px; height: 30px; padding: 0;">
<img class="img-profile rounded-circle" style="width:20%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" src="~/image/icon/724933.png"> <img class="img-profile rounded-circle" style="width:20%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" src="~/image/icon/724933.png">
<span style="visibility: hidden;">下載</span> <span style="visibility: hidden;">下載</span>
</button> </button>
</th> </th>
<!--下載總進入車輛-->
&nbsp; &nbsp;&nbsp;下載總進入車輛 :
<th>
<button class="btn btn-outline-info" onclick="export_excel_1()" style="position: relative; width: 50px; height: 30px; padding: 0;">
<img class="img-profile rounded-circle" style="width:20%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);" src="~/image/icon/724933.png">
<span style="visibility: hidden;">下載</span>
</button>
</th>
</div>
<button style="height:30px;float:right " class="btn btn-outline-secondary" onclick="serch_click()">搜尋</button>
<input type="text" style="float:right" placeholder="請輸入車牌 ex:ABC4321" id="serch_text_id" />
<br /> <br />
選擇進入區域:
<select style="width:10%" id="location_select_id" onchange="location_select()"></select> <select style="width:10%" id="location_select_id" onchange="location_select()"></select>
<div style="float:right; display: flex; align-items: center;">
<input type="text" style="margin-right: 5px;" placeholder="請輸入車牌 ex:ABC4321" id="serch_text_id" />
<button style="height:30px;" class="btn btn-outline-secondary" onclick="serch_click()">搜尋</button>
</div>
<!--<th>
離開區域選擇:
<select style="width:10%" id="out_location_select_id" onchange="out_location_select()"></select>
</th>-->
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th> <th>
區域 進入區域
</th> </th>
<th> <th>
車牌號碼 車牌號碼
@ -52,14 +62,18 @@
<th> <th>
時間 時間
</th> </th>
<th>
出去區域
</th>
<th>
出去時間
</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody id="demo"> <tbody id="demo">
</tbody> </tbody>
</table> </table>
<div class="row"> <div class="row">
<div class="col-xl-1 col-lg-1"> <div class="col-xl-1 col-lg-1">
@ -67,6 +81,7 @@
<button id="lastPageButton" class="btn btn-outline-secondary" onclick="fetchData_Up()">上一頁</button> <button id="lastPageButton" class="btn btn-outline-secondary" onclick="fetchData_Up()">上一頁</button>
</div> </div>
</div> </div>
<div class="col-xl-10 col-lg-10"> <div class="col-xl-10 col-lg-10">
</div> </div>
@ -77,8 +92,10 @@
</div> </div>
</div> </div>
</div> </div>
<!--車輛詳細-彈跳視窗--> <!--車輛詳細-彈跳視窗-->
<div> <div>
<dialog id="detail_car_data_view" style="width:100%;"> <dialog id="detail_car_data_view" style="width:100%;">
@ -123,10 +140,10 @@
var car_table_num = 0 var car_table_num = 0
function get_data() { function get_data() {
var name = "大門口" var name = "大門口"
//console.log(name)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/Amount-" + car_table_num, url: "http://localhost:7700/api/Yuntech_in_car_table/Amount-" + car_table_num,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -136,7 +153,7 @@
'Authorization': token 'Authorization': token
}, },
success: function (Model) { success: function (Model) {
//console.log(Model)
All_Model = Model All_Model = Model
set_data(Model) set_data(Model)
} }
@ -151,10 +168,38 @@
} }
}); });
*/ */
// 載入 out_location_name 下拉選單資料
var outLocationSelect = document.getElementById("out_location_select_id");
$.ajax({
type: "GET",
url: "http://localhost:7700/api/Yuntech_in_car_table/out_location_name",
data: {},
headers: {
'Authorization': token
},
contentType: "application/json",
success: function (Model) {
console.log(Model);
outLocationSelect.innerHTML = "";
Model.forEach(function (item) {
var option = document.createElement('option');
option.text = item.out_location_name;
outLocationSelect.add(option);
});
},
error: function (xhr, status, error) {
console.error("獲取 out_location_name 資料失敗:", error);
}
});
var select = document.getElementById("location_select_id") var select = document.getElementById("location_select_id")
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/location_name", url: "http://localhost:7700/api/Yuntech_in_car_table/location_name",
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -165,9 +210,9 @@
}, },
success: function (Model) { success: function (Model) {
console.log(Model) console.log(Model)
// 清除现有的选项
select.innerHTML = ""; select.innerHTML = "";
// 添加新的选项
Model.forEach(function (item) { Model.forEach(function (item) {
var option = document.createElement('option'); var option = document.createElement('option');
option.text = item.location_name; option.text = item.location_name;
@ -175,6 +220,7 @@
}); });
} }
}); });
} }
@ -187,10 +233,10 @@
return return
} }
var name = "大門口" var name = "大門口"
//console.log(name)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/Amount-" + car_table_num, url: "http://localhost:7700/api/Yuntech_in_car_table/Amount-" + car_table_num,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -200,7 +246,7 @@
'Authorization': token 'Authorization': token
}, },
success: function (Model) { success: function (Model) {
//console.log(Model)
All_Model = Model All_Model = Model
set_data(Model) set_data(Model)
} }
@ -210,10 +256,10 @@
function fetchData_Down() { function fetchData_Down() {
car_table_num = car_table_num + 100 car_table_num = car_table_num + 100
var name = "大門口" var name = "大門口"
//console.log(name)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/Amount-" + car_table_num, url: "http://localhost:7700/api/Yuntech_in_car_table/Amount-" + car_table_num,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -223,7 +269,7 @@
'Authorization': token 'Authorization': token
}, },
success: function (Model) { success: function (Model) {
//console.log(Model)
All_Model = Model All_Model = Model
set_data(Model) set_data(Model)
} }
@ -236,62 +282,104 @@
<!--放置資料--> <!--放置資料-->
<script> <script>
function set_data(Model) { function set_data(Model) {
document.getElementById("demo").innerHTML = '' document.getElementById("demo").innerHTML = '';
var table = "<tr>";
console.log(Model.length) var table = "<table>";
console.log(Model.length);
if (Model.length > 0) { if (Model.length > 0) {
for (var i = 0; i < Model.length; i++) { for (var i = 0; i < Model.length; i++) {
if (Model[i].location != null) { if (Model[i].location != null) {
table += "<td>" + Model[i].location + "</td>"
table += "<td>" + Model[i].license_plate_number + "</td>"
// 将字符串转换为 Date 对象
var timestampDt = new Date(Model[i].in_time);
// 转换为其他格式
var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' };
var formattedDate = timestampDt.toLocaleDateString('en-US', options);
table += "<td>" + formattedDate + "</td>"
table += "<td>" + '<button class="btn btn-outline-success" onclick="detail_data(' + "'" + Model[i].location + "','" + i + "','" + Model[i].in_time + "'" + ')">詳細</button>'
table += "<tr>";
// 顯示地點、車牌號碼等
table += "<td>" + Model[i].location + "</td>";
table += "<td>" + Model[i].license_plate_number + "</td>";
// 進入時間
if (Model[i].in_time) {
var timestampDtIn = new Date(Model[i].in_time);
var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' };
var formattedInDate = timestampDtIn.toLocaleDateString('en-US', options);
table += "<td>" + formattedInDate + "</td>";
} else {
table += "<td>沒有資料</td>";
}
// 出去地點
if (Model[i].out_location) {
table += "<td>" + Model[i].out_location + "</td>";
} else {
table += "<td>沒有資料</td>";
}
// 離開時間
if (Model[i].out_time) {
var timestampDtOut = new Date(Model[i].out_time);
var formattedOutDate = timestampDtOut.toLocaleDateString('en-US', options);
table += "<td>" + formattedOutDate + "</td>";
} else {
table += "<td>沒有資料</td>";
}
// 詳細按鈕
table += "<td><button class='btn btn-outline-success' onclick=\"detail_data('" + Model[i].location + "','" + i + "','" + Model[i].in_time + "')\">詳細</button></td>";
table += "</tr>";
} }
table += "</tr>"
table += "<tr>"
} }
} else {
table += "<tr><td colspan='6'>No data available</td></tr>";
} }
table += "</table>";
document.getElementById("demo").innerHTML = table document.getElementById("demo").innerHTML = table
// 移動到最上面 // 移動到最上面
window.scrollTo(0, 0); window.scrollTo(0, 0);
} }
function set_data_license_plate_and_date(Model) { function set_data_license_plate_and_date(Model) {
table = "<tr>"; var table = "<tr>";
console.log(Model.length) console.log(Model.length)
if (Model.length > 0) { if (Model.length > 0) {
for (var i = 0; i < Model.length; i++) { for (var i = 0; i < Model.length; i++) {
if (Model[i].location != null) { if (Model[i].location != null) {
table += "<td>" + Model[i].location + "</td>"
table += "<td>" + Model[i].license_plate_number + "</td>" table += "<td>" + Model[i].location + "</td>";
// 将字符串转换为 Date 对象 table += "<td>" + Model[i].license_plate_number + "</td>";
var timestampDt = new Date(Model[i].in_time); var timestampDt = new Date(Model[i].in_time);
// 转换为其他格式
var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' }; var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' };
var formattedDate = timestampDt.toLocaleDateString('en-US', options); var formattedDate = timestampDt.toLocaleDateString('en-US', options);
table += "<td>" + formattedDate + "</td>" table += "<td>" + formattedDate + "</td>";
table += "<td>" + '<button class="btn btn-outline-success" onclick="detail_data(' + "'" + Model[i].location + "','" + i + "','" + Model[i].in_time + "'" + ')">詳細</button>'
if (Model[i].out_location && Model[i].out_time) {
table += "<td>" + Model[i].out_location + "</td>";
var outTimestampDt = new Date(Model[i].out_time);
var outFormattedDate = outTimestampDt.toLocaleDateString('en-US', options);
table += "<td>" + outFormattedDate + "</td>";
} else {
table += "<td>沒有資料</td>";
table += "<td>沒有資料</td>";
}
table += "<td><button class='btn btn-outline-success' onclick=\"detail_data('" + Model[i].location + "','" + i + "','" + Model[i].in_time + "')\">詳細</button></td>";
} }
table += "</tr>" table += "</tr>";
table += "<tr>" table += "<tr>";
} }
} }
document.getElementById("demo").innerHTML = table document.getElementById("demo").innerHTML = table;
} }
</script>
</script>
<!--下一筆資料--> <!--下一筆資料-->
@ -326,21 +414,21 @@
<!--車輛詳細--> <!--車輛詳細-->
<script> <script>
function detail_data(location_name, car_serial_number, time) { function detail_data(location_name, car_serial_number, time, out_location_name) {
// 設定車輛序列號 // 設定車輛序列號
serial_number = car_serial_number serial_number = car_serial_number
// 發送AJAX GET請求 // 發送AJAX GET請求
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/location_name-" + location_name + "-time-" + time, url: "http://localhost:7700/api/Yuntech_in_car_table/location_name-" + location_name + "-time-" + time,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
success: function (Model) { success: function (Model) {
// 在控制台列印返回的模型資料
console.log(Model) console.log(Model)
// 設定固定車輛圖片 // 設定固定車輛圖片
@ -350,7 +438,7 @@
if (Model.out_time == null) { if (Model.out_time == null) {
// 如果沒有離開時間,顯示進入時間和車輛圖像 // 如果沒有離開時間,顯示進入時間和車輛圖像
table = "<tr>"; table = "<tr>";
table += "<td>" + Model.location + "</td>"; table += "<td>進入區域 " + "<br>" + Model.location + "</td>";
table += "<td>" + '<input type="text" id="license_plate_number_text_id" value="' + Model.license_plate_number + '"/>' + "</td>"; table += "<td>" + '<input type="text" id="license_plate_number_text_id" value="' + Model.license_plate_number + '"/>' + "</td>";
// 添加固定車輛圖片 // 添加固定車輛圖片
if (Model.car_img == null || Model.car_img == "") { if (Model.car_img == null || Model.car_img == "") {
@ -358,28 +446,56 @@
} else { } else {
table += "<td>" + "<img src='" + Model.car_img + "' style='width:80%' />" + "</td>"; table += "<td>" + "<img src='" + Model.car_img + "' style='width:80%' />" + "</td>";
} }
var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' };
table += "<td id='create_data_time_id'>" + Model.in_time + "</td>"; // 格式化進入時間
var timestampDtIn = new Date(Model.in_time);
var formattedInDate = timestampDtIn.toLocaleDateString('en-US', options);
// 建立表格內容
table += "<td id='create_data_time_id'>" +
"進入時間: " + formattedInDate + "<br/><br/>" + "</td>";
document.getElementById("detail_car_data").innerHTML = table; document.getElementById("detail_car_data").innerHTML = table;
} else { } else {
// 如果有離開時間,顯示進入和離開時間以及車輛圖像 // 如果有離開時間,顯示進入和離開時間以及車輛圖像
table = "<tr>"; table = "<tr>";
table += "<td>" + Model.location + "</td>"; table += "<td>進入區域 " + Model.location + " <br>" + "<br>出去區域 " + (Model.out_location ? Model.out_location : '沒有資料') + "</td>";
table += "<td>" + '<input type="text" id="license_plate_number_text_id" value="' + Model.license_plate_number + '"/>' + "</td>"; table += "<td>" + '<input type="text" id="license_plate_number_text_id" value="' + Model.license_plate_number + '"/>' + "</td>";
// 添加固定車輛圖片 // 添加固定車輛圖片
if (Model.car_img == null || Model.car_img == "") { if (Model.out_car_img == null || Model.out_car_img == "") {
table += "<td>" + "<img src='" + "/bootstrap_1/img/maxresdefault.jpg" + "' style='width:40%' />" + "<img src='" + "/bootstrap_1/img/maxresdefault.jpg" + "' style='width:40%' />" + "</td>"; if (Model.car_img == null || Model.car_img == "") {
table += "<td>" + "<img src='" + "/bootstrap_1/img/maxresdefault.jpg" + "' style='width:40%' />" + "<img src='" + "/bootstrap_1/img/maxresdefault.jpg" + "' style='width:40%' />" + "</td>";
}
else {
table += "<td>" + "<img src='" + Model.car_img + "' style='width:40%' />" + "<img src='" + "/bootstrap_1/img/maxresdefault.jpg" + "' style='width:40%' />" + "</td>";
}
} else { } else {
table += "<td>" + "<img src='" + Model.car_img + "' style='width:40%' />" + "<img src='" + Model.out_car_img + "' style='width:40%' />" + "</td>"; table += "<td>" + "<img src='" + Model.car_img + "' style='width:40%' />" + "<img src='" + Model.out_car_img + "' style='width:40%' />" + "</td>";
} }
table += "<td id='create_data_time_id'>" + "進入時間:" + Model.in_time + "<br/><br/>" + "出去時間: " + Model.out_time + "</td>"; var options = { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' };
// 格式化進入時間
var timestampDtIn = new Date(Model.in_time);
var formattedInDate = timestampDtIn.toLocaleDateString('en-US', options);
// 格式化出去時間
var timestampDtOut = new Date(Model.out_time);
var formattedOutDate = timestampDtOut.toLocaleDateString('en-US', options);
// 建立表格內容
table += "<td id='create_data_time_id'>" +
"進入時間: " + formattedInDate + "<br/><br/>" +
"出去時間: " + (Model.out_time ? formattedOutDate : '沒有資料') +
"</td>";
document.getElementById("detail_car_data").innerHTML = table; document.getElementById("detail_car_data").innerHTML = table;
} }
} }
}); });
// 顯示詳細資料的對話框
detail_car_data_view.showModal(); detail_car_data_view.showModal();
} }
</script> </script>
@ -394,8 +510,11 @@
} }
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/license_plate_number-" + license_plate_number, url: "http://localhost:7700/api/Yuntech_in_car_table/license_plate_number-" + license_plate_number,
data: {}, data: {},
headers: {
'Authorization': token
},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
'Authorization': token 'Authorization': token
@ -404,7 +523,7 @@
console.log(Model) console.log(Model)
All_Model = Model All_Model = Model
set_data(Model) set_data_license_plate_and_date(Model)
} }
}); });
@ -427,8 +546,11 @@
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/location_name_1_-" + name + "-start_time-" + start_date + "-end_time-" + end_date, url: "http://localhost:7700/api/Yuntech_in_car_table/location_name_1_-" + name + "-start_time-" + start_date + "-end_time-" + end_date,
data: {}, data: {},
headers: {
'Authorization': token
},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
'Authorization': token 'Authorization': token
@ -436,7 +558,9 @@
success: function (Model) { success: function (Model) {
console.log(Model) console.log(Model)
All_Model = Model All_Model = Model
set_data(Model) set_data_license_plate_and_date(Model)
} }
}); });
@ -445,6 +569,7 @@
} }
</script> </script>
<!--透過進入位置搜尋--> <!--透過進入位置搜尋-->
<script> <script>
function location_select() { function location_select() {
@ -452,7 +577,7 @@
console.log(select_location) console.log(select_location)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/location-" + select_location, url: "http://localhost:7700/api/Yuntech_in_car_table/location-" + select_location,
data: {}, data: {},
headers: { headers: {
'Authorization': token 'Authorization': token
@ -470,21 +595,27 @@
} }
</script> </script>
<!--輸出時間段內EXCEL-->
<script> <script>
function export_excel_1() { function export_excel_1() {
var name = document.getElementById("location_select_id").value; var name = document.getElementById("location_select_id").value;
var start_date = document.getElementById("start_date_id").value; var start_date = document.getElementById("start_date_id").value;
var end_date = document.getElementById("end_date_id").value; var end_date = document.getElementById("end_date_id").value;
// 將日期格式轉換為後端期望的格式(如 'YYYY-MM-DDTHH:MM:SS' // 檢查日期是否有效
if (!start_date || !end_date) {
alert("請選擇起始日期和結束日期");
return;
}
// 將日期格式
var start_time = new Date(start_date).toISOString(); var start_time = new Date(start_date).toISOString();
var end_time = new Date(end_date).toISOString(); var end_time = new Date(end_date).toISOString();
// 構建請求URL
var url = "http://140.125.20.183:7700/api/Yuntech_in_car_table/location_name_2_-" + name + "-start_time-" + start_date + "-end_time-" + end_date + "-export_excel";
// 發送HTTP GET請求到Web API動作方法 var url = `http://localhost:7700/api/Yuntech_in_car_table/location_name_2_-${name}-start_time-${start_date}-end_time-${end_date}-export_excel`;
fetch(url, { fetch(url, {
method: 'GET', method: 'GET',
headers: { headers: {
@ -496,23 +627,37 @@
if (!response.ok) { if (!response.ok) {
throw new Error('Network response was not ok'); throw new Error('Network response was not ok');
} }
// 將響應的數據轉換為Blob對象
return response.blob(); return response.blob();
}) })
.then(blob => { .then(blob => {
// 創建URL對象 // 創建URL對象
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
// 創建當前時間
const currentTime = new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d{3}/g, ""); // 獲取當前時間並格式化
// 構建檔案名稱 const currentTime = new Date();
const filename = `時間段內進入車輛-${currentTime}.xlsx`; const options = {
// 創建<a>元素 year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
hour12: false // 設置 24 小時制
};
const formattedTime = currentTime.toLocaleString('en-US', options).replace(/\//g, '-').replace(',', '').replace(/\s+/g, '_');
const filename = `時間段內進入車輛-${formattedTime}.xlsx`;
const a = document.createElement('a'); const a = document.createElement('a');
a.href = url; a.href = url;
a.download = filename; // 下載時的文件名稱 a.download = filename;
// 模擬單擊<a>元素
a.click(); a.click();
// 釋放URL對象
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url);
}) })
.catch(error => { .catch(error => {
@ -520,39 +665,38 @@
}); });
} }
</script> </script>
<!--輸出總EXCEL--> <!--輸出總EXCEL-->
<script> <script>
function export_excel() { function export_excel() {
// 發送HTTP GET請求到Web API動作方法
fetch('http://140.125.20.183:7700/api/Yuntech_in_car_table/export-all_excel', { fetch('http://localhost:7700/api/Yuntech_in_car_table/export-all_excel', {
method: 'GET', method: 'GET',
headers: { headers: {
'Authorization': token 'Authorization': token
} }
}) })
.then(response => { .then(response => {
// 確認響應的狀態碼是否為200成功
if (!response.ok) { if (!response.ok) {
throw new Error('Network response was not ok'); throw new Error('Network response was not ok');
} }
// 將響應的數據轉換為Blob對象
return response.blob(); return response.blob();
}) })
.then(blob => { .then(blob => {
// 創建URL對象
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
// 創建當前時間
const currentTime = new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d{3}/g, ""); const currentTime = new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d{3}/g, "");
// 構建檔案名稱
const filename = `進入車輛-${currentTime}.xlsx`; const filename = `進入車輛-${currentTime}.xlsx`;
// 創建<a>元素
const a = document.createElement('a'); const a = document.createElement('a');
a.href = url; a.href = url;
a.download = filename; // 下載時的文件名稱 a.download = filename;
// 模擬單擊<a>元素
a.click(); a.click();
// 釋放URL對象
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url);
}) })
.catch(error => { .catch(error => {
@ -566,12 +710,12 @@
<script> <script>
var token var token
function token_check() { function token_check() {
// 检查本地存储中是否存在JWT令牌
token = localStorage.getItem('token_park_space'); token = localStorage.getItem('token_park_space');
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -583,7 +727,7 @@
error: function (xhr) { error: function (xhr) {
token_check = "false" token_check = "false"
window.location.href = '/'; window.location.href = '/';
// 处理错误响应,例如跳转到未授权页面
//window.location.href = 'https://example.com/unauthorized_page'; //window.location.href = 'https://example.com/unauthorized_page';
} }
}); });
@ -593,7 +737,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -609,7 +753,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -49,7 +49,7 @@
var date = document.getElementById("serch_text_id").value var date = document.getElementById("serch_text_id").value
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_history/date-" + date, url: "http://localhost:7700/api/Parking_spaces_history/date-" + date,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -70,8 +70,8 @@
function get_data() { function get_data() {
$.ajax({ $.ajax({
type: "GET", type: "GET",
//url: "http://140.125.20.183:7700/api/Parking_spaces_history/parking_space_area-" + name, //url: "http://localhost:7700/api/Parking_spaces_history/parking_space_area-" + name,
url: "http://140.125.20.183:7700/api/Parking_spaces_history", url: "http://localhost:7700/api/Parking_spaces_history",
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -117,7 +117,7 @@
function select_data(){ function select_data(){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table", url: "http://localhost:7700/api/Parking_spaces_total_table",
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -142,7 +142,7 @@
var name = document.getElementById("select_id").value var name = document.getElementById("select_id").value
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_history/parking_space_area-" + name, url: "http://localhost:7700/api/Parking_spaces_history/parking_space_area-" + name,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {

View File

@ -194,7 +194,7 @@
var license_plate_number = document.getElementById("serch_text_id").value var license_plate_number = document.getElementById("serch_text_id").value
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_instant/license_plate_number-" + license_plate_number, url: "http://localhost:7700/api/Parking_spaces_instant/license_plate_number-" + license_plate_number,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -225,7 +225,7 @@
console.log(token_check) console.log(token_check)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table", url: "http://localhost:7700/api/Parking_spaces_total_table",
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -297,7 +297,7 @@
function get_single_parking_space_car(name){ function get_single_parking_space_car(name){
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_instant/parking_space_area-" + name, url: "http://localhost:7700/api/Parking_spaces_instant/parking_space_area-" + name,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -328,8 +328,8 @@
var stringify_obj = JSON.stringify(obj); var stringify_obj = JSON.stringify(obj);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table", url: "http://localhost:7700/api/Parking_spaces_total_table",
//url: "http://140.125.20.183:7700/api/Postural_Analysis_1", //url: "http://localhost:7700/api/Postural_Analysis_1",
//data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" }, //data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" },
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
@ -353,7 +353,7 @@
function delet_data(name){ function delet_data(name){
$.ajax({ $.ajax({
type: "DELETE", type: "DELETE",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table/"+name, url: "http://localhost:7700/api/Parking_spaces_total_table/"+name,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -394,7 +394,7 @@
console.log(token) console.log(token)
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token_check', url: 'http://localhost:7700/Users/token_check',
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -416,7 +416,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/token-' + token, url: 'http://localhost:7700/Users/token-' + token,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },
@ -432,7 +432,7 @@
var token = localStorage.getItem('token_park_space'); var token = localStorage.getItem('token_park_space');
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: 'http://140.125.20.183:7700/Users/user_id-' + id, url: 'http://localhost:7700/Users/user_id-' + id,
headers: { headers: {
'Authorization': token 'Authorization': token
}, },

View File

@ -115,7 +115,7 @@
console.log(stringify_obj) console.log(stringify_obj)
$.ajax({ $.ajax({
type: "Post", type: "Post",
url: "http://140.125.20.183:7700/api/Parking_spaces_instant", url: "http://localhost:7700/api/Parking_spaces_instant",
//data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" }, //data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" },
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
@ -151,7 +151,7 @@
console.log(stringify_obj) console.log(stringify_obj)
$.ajax({ $.ajax({
type: "Post", type: "Post",
url: "http://140.125.20.183:7700/api/Parking_spaces_history", url: "http://localhost:7700/api/Parking_spaces_history",
//data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" }, //data: {test_id: test_id, test_date: test_date, test_time: test_time, test_analyst: test_analyst, img: img, data_creat_time: "2022-10-04T18:47:40.887014" },
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
@ -194,7 +194,7 @@
var name = document.getElementById("parking_spaces_name_id").value var name = document.getElementById("parking_spaces_name_id").value
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_instant/parking_space_area-" + name, url: "http://localhost:7700/api/Parking_spaces_instant/parking_space_area-" + name,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -274,7 +274,7 @@
serial_number = car_serial_number serial_number = car_serial_number
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_instant/parking_space_area_name-" + location_name + "-time-" + time, url: "http://localhost:7700/api/Parking_spaces_instant/parking_space_area_name-" + location_name + "-time-" + time,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {
@ -327,7 +327,7 @@
$.ajax({ $.ajax({
type: "Post", type: "Post",
url: "http://140.125.20.183:7700/api/Parking_spaces_history", url: "http://localhost:7700/api/Parking_spaces_history",
data: stringify_obj, data: stringify_obj,
contentType: "application/json", contentType: "application/json",
success: function (msg) { success: function (msg) {
@ -340,7 +340,7 @@
function delet_data_2(location_name, name, time) { function delet_data_2(location_name, name, time) {
$.ajax({ $.ajax({
type: "DELETE", type: "DELETE",
url: "http://140.125.20.183:7700/api/Parking_spaces_instant/parking_space_name-" + location_name + "-time-" + time, url: "http://localhost:7700/api/Parking_spaces_instant/parking_space_name-" + location_name + "-time-" + time,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {

View File

@ -61,7 +61,7 @@
var name = document.getElementById("parking_spaces_name_id").value var name = document.getElementById("parking_spaces_name_id").value
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: "http://140.125.20.183:7700/api/Parking_spaces_total_table/" + name, url: "http://localhost:7700/api/Parking_spaces_total_table/" + name,
data: {}, data: {},
contentType: "application/json", contentType: "application/json",
headers: { headers: {

View File

@ -78,11 +78,11 @@
<a class="collapse-item" asp-controller="Engineering" asp-action="Engineering_CAM">查看WEBCAM</a> <a class="collapse-item" asp-controller="Engineering" asp-action="Engineering_CAM">查看WEBCAM</a>
<a class="collapse-item" asp-controller="Engineering" asp-action="Engineering_LED">字幕機顯示</a> <a class="collapse-item" asp-controller="Engineering" asp-action="Engineering_LED">字幕機顯示</a>
<a class="collapse-item" asp-controller="Engineering" asp-action="Engineering_Violation"> 違規區域</a> <a class="collapse-item" asp-controller="Engineering" asp-action="Engineering_Violation"> 違規區域</a>
<a class="collapse-item" asp-controller="Engineering" asp-action="Yuntech_in_car"> 進入車輛</a> <a class="collapse-item" asp-controller="Engineering" asp-action="Yuntech_in_car"> 查詢進出車輛</a>
<a class="collapse-item" asp-controller="Engineering" asp-action="Map_RTSP"> 即時影像</a> <a class="collapse-item" asp-controller="Engineering" asp-action="Map_RTSP"> 即時影像</a>
<a class="collapse-item" asp-controller="Engineering" asp-action="Engineering_parking_user_list_index"> 月租名單 </a> <a class="collapse-item" asp-controller="Engineering" asp-action="Engineering_parking_user_list_index"> 月租名單 </a>
<a class="collapse-item" asp-controller="Engineering" asp-action="Engineering_EL125_car"> 私人名單 </a> <a class="collapse-item" asp-controller="Engineering" asp-action="Engineering_EL125_car"> 私人名單 </a>
<a class="collapse-item" asp-controller="Engineering" asp-action="ParkingLog"> 查詢車流資訊 </a> <a class="collapse-item" asp-controller="Engineering" asp-action="ParkingLog"> 查詢車位數 </a>
</div> </div>
</div> </div>
</li> </li>

View File

@ -76,10 +76,10 @@
<div class="bg-white py-2 collapse-inner rounded"> <div class="bg-white py-2 collapse-inner rounded">
<!--<h6 class="collapse-header">Custom Components:</h6>--> <!--<h6 class="collapse-header">Custom Components:</h6>-->
<a class="collapse-item" asp-controller="Manager" asp-action="Manager_Violation"> 違規區域</a> <a class="collapse-item" asp-controller="Manager" asp-action="Manager_Violation"> 違規區域</a>
<a class="collapse-item" asp-controller="Manager" asp-action="Yuntech_in_car"> 進入車輛</a> <a class="collapse-item" asp-controller="Manager" asp-action="Yuntech_in_car"> 查詢進出車輛</a>
<a class="collapse-item" asp-controller="Manager" asp-action="Map_RTSP"> 即時影像</a> <a class="collapse-item" asp-controller="Manager" asp-action="Map_RTSP"> 即時影像</a>
<a class="collapse-item" asp-controller="Manager" asp-action="Manager_parking_user_list_index"> 月租名單 </a> <a class="collapse-item" asp-controller="Manager" asp-action="Manager_parking_user_list_index"> 月租名單 </a>
<a class="collapse-item" asp-controller="Manager" asp-action="ParkingLog"> 查詢車流資訊 </a> <a class="collapse-item" asp-controller="Manager" asp-action="ParkingLog"> 查詢車位數 </a>
</div> </div>