Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
Repair-app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chaiwat
Repair-app
Commits
3120dd73
Commit
3120dd73
authored
Mar 03, 2022
by
chaiwat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 3/3/2565
parent
ebf673ab
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
332 additions
and
70 deletions
+332
-70
index.less
src/assets/less/pages/dashboard/index.less
+9
-4
Pages.jsx
src/router/routes/Pages.jsx
+14
-0
Admin.jsx
src/view/Admin/Admin.jsx
+0
-3
Approve.jsx
src/view/Admin/Approve.jsx
+10
-0
Garage.jsx
src/view/Admin/Garage.jsx
+96
-59
garageDetail.jsx
src/view/Admin/garageDetail.jsx
+200
-0
ShowDetailMember.jsx
src/view/Dashboards/member/ShowDetailMember.jsx
+0
-1
googleMaps.jsx
src/view/Pages/CustomerService/RepairShop/googleMaps.jsx
+1
-1
googleMap.jsx
src/view/Registion/googleMap.jsx
+2
-2
No files found.
src/assets/less/pages/dashboard/index.less
View file @
3120dd73
...
@@ -124,10 +124,15 @@
...
@@ -124,10 +124,15 @@
color: #faed26;
color: #faed26;
}
}
// .left {
.text-left {
// // display: flex;
// display: flex;
// justify-content: left;
text-align: left;
// }
}
.pageHeader {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 1%;
}
src/router/routes/Pages.jsx
View file @
3120dd73
...
@@ -131,6 +131,20 @@ const PagesRoutes = [
...
@@ -131,6 +131,20 @@ const PagesRoutes = [
layout
:
'VerticalLayout'
,
layout
:
'VerticalLayout'
,
},
},
// Garage Detail
{
path
:
'/admin/all-garage/detail'
,
component
:
lazy
(()
=>
import
(
'../../view/Admin/garageDetail'
)),
layout
:
'VerticalLayout'
,
},
// Admin Approve
{
path
:
'/admin/approve'
,
component
:
lazy
(()
=>
import
(
'../../view/Admin/Approve'
)),
layout
:
'VerticalLayout'
,
},
];
];
...
...
src/view/Admin/Admin.jsx
View file @
3120dd73
...
@@ -12,9 +12,6 @@ function Admin() {
...
@@ -12,9 +12,6 @@ function Admin() {
const
[
datas
,
setDatas
]
=
useState
([]);
const
[
datas
,
setDatas
]
=
useState
([]);
useEffect
(()
=>
{
useEffect
(()
=>
{
const
getGarage
=
async
()
=>
{
const
getGarage
=
async
()
=>
{
await
FetchGarageAll
().
then
(
async
(
response
)
=>
{
await
FetchGarageAll
().
then
(
async
(
response
)
=>
{
...
...
src/view/Admin/Approve.jsx
0 → 100644
View file @
3120dd73
import
React
from
'react'
function
Approve
()
{
return
(
<>
Approve
</>
)
}
export
default
Approve
\ No newline at end of file
src/view/Admin/Garage.jsx
View file @
3120dd73
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
{
Collapse
,
Col
,
Row
,
Typography
,
Divider
}
from
"antd"
;
import
{
Collapse
,
Col
,
Row
,
Typography
,
Divider
}
from
"antd"
;
import
{
RightCircleOutlined
}
from
"@ant-design/icons"
;
import
{
Link
}
from
"react-router-dom"
;
// import services
// import services
import
{
FetchGarageAll
}
from
"../../services"
;
import
{
FetchGarageAll
}
from
"../../services"
;
const
{
Title
,
Text
}
=
Typography
;
const
{
Title
,
Text
}
=
Typography
;
const
{
Panel
}
=
Collapse
;
const
{
Panel
}
=
Collapse
;
const
text
=
`
A dog is a type of domesticated animal.
Known for its loyalty and faithfulness,
it can be found as a welcome guest in many households across the world.
`
;
function
Garage
()
{
function
Garage
()
{
const
[
datas
,
setDatas
]
=
useState
([]);
const
[
datas
,
setDatas
]
=
useState
([]);
useEffect
(()
=>
{
useEffect
(()
=>
{
const
getGarage
=
async
()
=>
{
const
getGarage
=
()
=>
{
await
FetchGarageAll
().
then
(
async
(
response
)
=>
{
FetchGarageAll
().
then
((
response
)
=>
{
if
(
response
.
code
===
500
)
{
if
(
response
.
data
)
{
console
.
log
(
"data"
,
response
);
setDatas
(
response
.
data
);
}
else
{
await
setDatas
(
response
.
data
[
0
]);
// console.log('data', response.data)
// console.log('data', response.data)
}
}
// console.log('data', response)
// console.log('data', response)
...
@@ -31,9 +27,28 @@ function Garage() {
...
@@ -31,9 +27,28 @@ function Garage() {
getGarage
();
getGarage
();
},
[]);
},
[]);
function
callback
(
key
)
{
// function callback(key) {
console
.
log
(
key
);
// // console.log(key);
}
// }
const
genExtra
=
(
id
,
data
)
=>
(
<
Link
to=
{
{
pathname
:
"/admin/all-garage/detail"
,
state
:
{
garageID
:
id
,
data
:
data
,
},
}
}
>
<
RightCircleOutlined
/>
</
Link
>
);
// const detailGarage = (id) => {
// console.log("id", id);
// };
return
(
return
(
<>
<>
...
@@ -43,64 +58,86 @@ function Garage() {
...
@@ -43,64 +58,86 @@ function Garage() {
</
Col
>
</
Col
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
<
Collapse
onChange=
{
callback
}
>
<
Collapse
>
<
Panel
header=
{
datas
.
garage_name
}
key=
"1"
extra=
{
datas
.
province
}
>
{
datas
.
length
!==
0
?
(
<
Row
gutter=
{
[
0
,
16
]
}
>
<>
{
datas
.
map
((
val
,
index
)
=>
{
return
(
<>
<
Panel
header=
{
val
.
garage_name
}
key=
{
index
}
extra=
{
genExtra
(
val
.
garageID
,
val
)
}
>
<
Row
gutter=
{
[
0
,
16
]
}
className=
"text-left"
>
<
Divider
orientation=
"left"
plain
>
<
Divider
orientation=
"left"
plain
>
รายละเอียดร้านซ่อม
รายละเอียดร้านซ่อม
</
Divider
>
</
Divider
>
<
Col
xs=
{
24
}
<
Col
xs=
{
24
}
lg=
{
{
span
:
7
,
offset
:
1
}
}
>
md=
{
{
span
:
11
,
offset
:
1
}
}
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
lg=
{
{
span
:
7
,
offset
:
1
}
}
ชื่อร้าน :
{
" "
}
>
</
Text
>
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
User ID :
</
Text
>
<
Text
>
{
val
.
garage_name
}
</
Text
>
<
Text
>
{
datas
.
garageID
}
</
Text
>
</
Col
>
</
Col
>
<
Col
<
Col
xs=
{
24
}
lg=
{
{
span
:
7
,
offset
:
1
}
}
>
xs=
{
24
}
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
md=
{
{
span
:
11
,
offset
:
1
}
}
ชื่อ-สกุล :
{
" "
}
lg=
{
{
span
:
7
,
offset
:
1
}
}
</
Text
>
>
<
Text
>
{
val
.
user_name
}
</
Text
>
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
ชื่อร้าน :
</
Text
>
<
Text
>
{
datas
.
garage_name
}
</
Text
>
</
Col
>
</
Col
>
<
Col
<
Col
xs=
{
24
}
lg=
{
{
span
:
7
,
offset
:
1
}
}
>
xs=
{
24
}
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
md=
{
{
span
:
11
,
offset
:
1
}
}
E-Mail :
{
" "
}
lg=
{
{
span
:
7
,
offset
:
1
}
}
</
Text
>
>
<
Text
>
{
val
.
email
}
</
Text
>
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
ชื่อ-สกุล :
</
Text
>
<
Text
>
{
datas
.
user_name
}
</
Text
>
</
Col
>
</
Col
>
<
Col
<
Col
xs=
{
24
}
lg=
{
{
span
:
7
,
offset
:
1
}
}
>
xs=
{
24
}
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
md=
{
{
span
:
11
,
offset
:
1
}
}
ประเภทร้านซ่อม :
{
" "
}
lg=
{
{
span
:
7
,
offset
:
1
}
}
</
Text
>
>
<
Text
>
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
E-Mail :
</
Text
>
{
JSON
.
parse
(
val
.
garage_type
).
join
(
", "
)
}{
" "
}
<
Text
>
{
datas
.
email
}
</
Text
>
</
Text
>
</
Col
>
</
Col
>
<
Col
<
Col
xs=
{
24
}
lg=
{
{
span
:
7
,
offset
:
1
}
}
>
xs=
{
24
}
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
md=
{
{
span
:
11
,
offset
:
1
}
}
เวลาเปิด - ปิด :
{
" "
}
lg=
{
{
span
:
7
,
offset
:
1
}
}
</
Text
>
>
<
Text
>
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
ประเภทร้านซ่อม :
</
Text
>
{
val
.
on_time
}
-
{
val
.
off_time
}{
" "
}
<
Text
>
{
datas
.
garage_type
}
</
Text
>
</
Text
>
</
Col
>
<
Col
xs=
{
24
}
lg=
{
{
span
:
7
,
offset
:
1
}
}
>
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
เบอร์โทรศัพท์ :
{
" "
}
</
Text
>
<
Text
>
{
val
.
tel
}
</
Text
>
</
Col
>
<
Col
xs=
{
24
}
lg=
{
{
span
:
15
,
offset
:
1
}
}
>
<
Text
style=
{
{
fontWeight
:
"bold"
}
}
>
ที่อยู่ :
{
" "
}
</
Text
>
<
Text
>
{
val
.
address_number
}
หมู่
{
val
.
moo
}
ซอย
{
" "
}
{
val
.
alley
}
ถนน
{
val
.
road
}
ต.
{
val
.
sub_district
}
อ.
{
val
.
district
}
จ.
{
val
.
province
}
{
val
.
pos_code
}{
" "
}
</
Text
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
<
Divider
/>
</
Panel
>
</
Panel
>
<
Panel
header=
"This is panel header 2"
key=
"2"
>
</>
<
p
>
{
text
}
</
p
>
);
</
Panel
>
})
}
<
Panel
header=
"This is panel header 3"
key=
"3"
>
</>
<
p
>
{
text
}
</
p
>
)
:
null
}
</
Panel
>
</
Collapse
>
</
Collapse
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
...
src/view/Admin/garageDetail.jsx
0 → 100644
View file @
3120dd73
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
{
PageHeader
,
Button
,
Statistic
,
Descriptions
,
Row
,
Col
,
Modal
,
}
from
"antd"
;
import
{
withScriptjs
,
withGoogleMap
,
GoogleMap
,
Marker
,
}
from
"react-google-maps"
;
import
{
useLocation
}
from
"react-router-dom"
;
// Import services
import
{
FetctDetailByGarage
}
from
"../../services"
;
import
IconCar
from
"../../assets/icons/car.png"
;
export
default
function
GarageDetail
()
{
let
location
=
useLocation
;
const
garageID
=
location
().
state
;
const
garage
=
location
().
state
.
data
;
const
[
datas
,
setDatas
]
=
useState
([]);
const
[
visible
,
setVisible
]
=
useState
(
false
);
// console.log(garage);
useEffect
(()
=>
{
const
getDetailByGarage
=
async
()
=>
{
await
FetctDetailByGarage
(
garageID
).
then
(
async
(
response
)
=>
{
await
setDatas
(
response
.
data
);
});
};
getDetailByGarage
();
},
[
garageID
]);
// console.log(datas);
let
newData
=
[];
let
car
=
[];
let
moto
=
[];
let
arg
=
[];
let
succeed
=
[];
let
notSucceed
=
[];
if
(
datas
!==
null
)
{
for
(
let
i
=
0
;
i
<
datas
.
length
;
i
++
)
{
newData
.
push
(
datas
[
i
]);
if
(
datas
[
i
].
device_type
===
"รถยนต์"
)
{
car
.
push
(
datas
[
i
]);
}
if
(
datas
[
i
].
device_type
===
"รถจักรยานยนต์"
)
{
moto
.
push
(
datas
[
i
]);
}
if
(
datas
[
i
].
device_type
===
"อุปกรณ์การเกษตร"
)
{
arg
.
push
(
datas
[
i
]);
}
if
(
datas
[
i
].
status
===
"สำเร็จ"
)
{
succeed
.
push
(
datas
[
i
]);
}
if
(
datas
[
i
].
status
===
"อยู่ระหว่างการซ่อม"
)
{
notSucceed
.
push
(
datas
[
i
]);
}
}
}
let
newLatLng
=
[
{
lat
:
JSON
.
parse
(
garage
.
address_map
)[
0
],
lng
:
JSON
.
parse
(
garage
.
address_map
)[
1
],
},
];
// console.log(newLatLng);
const
MapWithAMarker
=
withScriptjs
(
withGoogleMap
(()
=>
(
<
GoogleMap
defaultZoom=
{
15
}
defaultCenter=
{
newLatLng
[
0
]
}
>
<
Marker
position=
{
newLatLng
[
0
]
}
icon=
{
{
url
:
IconCar
,
scaledSize
:
new
window
.
google
.
maps
.
Size
(
40
,
40
),
}
}
/>
</
GoogleMap
>
))
);
return
(
<>
<
Row
className=
"div-p-5"
>
<
Col
span=
{
24
}
className=
"pageHeader"
style=
{
{
padding
:
"2%"
}
}
>
<
PageHeader
className=
"site-page-header"
onBack=
{
()
=>
window
.
history
.
back
()
}
title=
{
garage
.
garage_name
}
subTitle=
"ข้อมูลการซ่อมของร้าน"
extra=
{
[
<
Button
key=
"3"
onClick=
{
()
=>
setVisible
(
true
)
}
>
ดูตำแหน่งของร้าน
</
Button
>,
]
}
>
<
Row
gutter=
{
[
0
,
16
]
}
>
<
Col
span=
{
24
}
>
<
Descriptions
size=
"small"
column=
{
2
}
>
<
Descriptions
.
Item
label=
"เจ้าของร้าน"
>
คุณ
{
garage
.
user_name
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"ชื่อร้าน"
>
{
garage
.
garage_name
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"ประเภท"
>
{
JSON
.
parse
(
garage
.
garage_type
).
join
(
", "
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"เข้าร่วมระบบ"
>
{
garage
.
registration_date
}
</
Descriptions
.
Item
>
</
Descriptions
>
</
Col
>
<
Statistic
title=
"การซ่อมทั้งหมด"
value=
{
newData
.
length
}
style=
{
{
margin
:
"0 20px"
,
}
}
/>
<
Statistic
title=
"ที่สำเร็จ"
value=
{
succeed
.
length
}
style=
{
{
margin
:
"0 20px"
,
}
}
/>
<
Statistic
title=
"กำลังดำเนินการซ่อม"
value=
{
notSucceed
.
length
}
style=
{
{
margin
:
"0 20px"
,
}
}
/>
<
br
/>
<
Statistic
title=
"รถยนต์"
value=
{
car
.
length
}
style=
{
{
margin
:
"0 20px"
,
}
}
/>
<
Statistic
title=
"รถจักรยานยนต์"
value=
{
moto
.
length
}
style=
{
{
margin
:
"0 20px"
,
}
}
/>
<
Statistic
title=
"อุปกรณ์การเกษตร"
value=
{
arg
.
length
}
style=
{
{
margin
:
"0 20px"
,
}
}
/>
</
Row
>
</
PageHeader
>
</
Col
>
</
Row
>
<
Modal
title=
{
garage
.
garage_name
}
centered
visible=
{
visible
}
onOk=
{
()
=>
setVisible
(
false
)
}
onCancel=
{
()
=>
setVisible
(
false
)
}
width=
{
700
}
>
<
MapWithAMarker
googleMapURL=
"https://maps.googleapis.com/maps/api/js?key=AIzaSyBYQsoMGSxKVOe6vilIiEedgPhRDjcPbC8&libraries=geometry,drawing,places"
loadingElement=
{
<
div
style=
{
{
height
:
"100%"
}
}
/>
}
containerElement=
{
<
div
style=
{
{
height
:
"400px"
}
}
/>
}
mapElement=
{
<
div
style=
{
{
height
:
"100%"
}
}
/>
}
/>
</
Modal
>
</>
);
}
src/view/Dashboards/member/ShowDetailMember.jsx
View file @
3120dd73
...
@@ -8,7 +8,6 @@ import { useLocation } from "react-router-dom";
...
@@ -8,7 +8,6 @@ import { useLocation } from "react-router-dom";
// import Service
// import Service
import
{
FetctDetailByGarageID
,
FetchSpareByDetailID
}
from
"../../../services"
;
import
{
FetctDetailByGarageID
,
FetchSpareByDetailID
}
from
"../../../services"
;
// import { useLocation } from "react-router-dom";
const
{
Text
,
Title
}
=
Typography
;
const
{
Text
,
Title
}
=
Typography
;
const
{
Column
,
ColumnGroup
}
=
Table
;
const
{
Column
,
ColumnGroup
}
=
Table
;
...
...
src/view/Pages/CustomerService/RepairShop/googleMaps.jsx
View file @
3120dd73
...
@@ -70,7 +70,7 @@ function Map() {
...
@@ -70,7 +70,7 @@ function Map() {
<
h4
>
<
h4
>
<
b
>
{
selectPark
.
garage_name
}
</
b
>
<
b
>
{
selectPark
.
garage_name
}
</
b
>
</
h4
>
</
h4
>
<
p
>
{
JSON
.
parse
(
selectPark
.
garage_type
)
}
</
p
>
<
p
>
{
JSON
.
parse
(
selectPark
.
garage_type
)
.
join
(
", "
)
}
</
p
>
<
p
>
เปิด
{
selectPark
.
on_time
}
-
{
selectPark
.
off_time
}
</
p
>
<
p
>
เปิด
{
selectPark
.
on_time
}
-
{
selectPark
.
off_time
}
</
p
>
</
div
>
</
div
>
</
InfoWindow
>
</
InfoWindow
>
...
...
src/view/Registion/googleMap.jsx
View file @
3120dd73
import
{
Col
}
from
'antd'
import
{
Col
,
}
from
'antd'
import
{
import
{
withScriptjs
,
withScriptjs
,
withGoogleMap
,
withGoogleMap
,
...
@@ -11,7 +11,7 @@ import {
...
@@ -11,7 +11,7 @@ import {
const
onMarkerDragEnd
=
(
event
)
=>
{
const
onMarkerDragEnd
=
(
event
)
=>
{
newLatLng
[
0
].
lat
=
event
.
latLng
.
lat
()
newLatLng
[
0
].
lat
=
event
.
latLng
.
lat
()
newLatLng
[
0
].
lng
=
event
.
latLng
.
lng
()
newLatLng
[
0
].
lng
=
event
.
latLng
.
lng
()
console
.
log
(
'newLat'
,
newLatLng
[
0
].
lat
,
'newLng'
,
newLatLng
[
0
].
lng
)
//
console.log('newLat', newLatLng[0].lat, 'newLng', newLatLng[0].lng)
}
}
const
MapWithAMarker
=
withScriptjs
(
const
MapWithAMarker
=
withScriptjs
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment