新增 透過時間搜尋 、車牌搜尋

This commit is contained in:
威勝 張 2024-02-05 22:42:48 +08:00
parent d087812571
commit 315e2a9608
2 changed files with 104 additions and 2 deletions

View File

@ -9,7 +9,12 @@
<h1>違規車輛</h1> <h1>違規車輛</h1>
<div class="size2"> <div class="size2">
起始時間 : <input type="date" id="start_date_id">
結束時間 : <input type="date" id="end_date_id">
<button style="height:30px; " class="btn btn-outline-secondary" onclick="serch_date_click()">搜尋</button>
<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" />
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
@ -234,7 +239,52 @@
} }
</script> </script>
<!--透過車牌號碼搜尋-->
<script>
function serch_click() {
var license_plate_number = document.getElementById("serch_text_id").value
if (license_plate_number == "") {
get_data()
}
$.ajax({
type: "GET",
url: "http://140.125.20.183:7700/api/Violation_car_table/license_plate_number-" + license_plate_number,
data: {},
contentType: "application/json",
success: function (Model) {
console.log(Model)
All_Model = Model
set_data(Model)
}
});
}
</script>
<!--透過日期搜尋紀錄-->
<script>
function serch_date_click() {
var name = document.getElementById("parking_spaces_name_id").value
var start_date = document.getElementById("start_date_id").value
var end_date = document.getElementById("end_date_id").value
console.log(start_date)
$.ajax({
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,
data: {},
contentType: "application/json",
success: function (Model) {
console.log(Model)
All_Model = Model
set_data(Model)
}
});
}
</script>
<!--刪除資料--> <!--刪除資料-->
<script> <script>

View File

@ -8,7 +8,12 @@
<div class="size2"> <div class="size2">
起始時間 : <input type="date" id="start_date_id">
結束時間 : <input type="date" id="end_date_id">
<button style="height:30px; " class="btn btn-outline-secondary" onclick="serch_date_click()">搜尋</button>
<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" />
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
@ -158,7 +163,7 @@
} }
</script> </script>
<!--違規車輛詳細--> <!--車輛詳細-->
<script> <script>
function detail_data(location_name, car_serial_number, time) { function detail_data(location_name, car_serial_number, time) {
//console.log(location_name) //console.log(location_name)
@ -186,6 +191,53 @@
} }
</script> </script>
<!--透過車牌號碼搜尋-->
<script>
function serch_click() {
var license_plate_number = document.getElementById("serch_text_id").value
if (license_plate_number == "") {
get_data()
}
$.ajax({
type: "GET",
url: "http://140.125.20.183:7700/api/Yuntech_in_car_table/license_plate_number-" + license_plate_number,
data: {},
contentType: "application/json",
success: function (Model) {
console.log(Model)
All_Model = Model
set_data(Model)
}
});
}
</script>
<!--透過日期搜尋紀錄-->
<script>
function serch_date_click() {
var name = "大門口"
var start_date = document.getElementById("start_date_id").value
var end_date = document.getElementById("end_date_id").value
console.log(start_date)
$.ajax({
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,
data: {},
contentType: "application/json",
success: function (Model) {
console.log(Model)
All_Model = Model
set_data(Model)
}
});
}
</script>
<!--檢查token--> <!--檢查token-->
<script> <script>
function token_check() { function token_check() {