Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
A
Aqbits Trace Code
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mai Thanh Cong
Aqbits Trace Code
Commits
4371fd59
Commit
4371fd59
authored
Jul 09, 2021
by
Mai Thanh Cong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update modal diary
parent
54c48d51
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
71 deletions
+43
-71
src/components/Profile/AddProduct.js
src/components/Profile/AddProduct.js
+2
-18
src/components/Profile/AddProfile.js
src/components/Profile/AddProfile.js
+2
-10
src/components/Profile/DetailProfile.js
src/components/Profile/DetailProfile.js
+0
-6
src/components/Profile/Tracecode.js
src/components/Profile/Tracecode.js
+3
-7
src/views/IndexSections/Table.js
src/views/IndexSections/Table.js
+36
-30
No files found.
src/components/Profile/AddProduct.js
View file @
4371fd59
...
@@ -56,12 +56,6 @@ const AddProduct = () => {
...
@@ -56,12 +56,6 @@ const AddProduct = () => {
history
.
push
(
"
/profile/add
"
);
history
.
push
(
"
/profile/add
"
);
}
}
const
onHandleClickAddProductDiary
=
()
=>
{
history
.
push
({
pathname
:
"
/profile/add-product-diary
"
,
state
:
{
profileId
}
});
}
return
(
return
(
<>
<>
...
@@ -139,14 +133,9 @@ const AddProduct = () => {
...
@@ -139,14 +133,9 @@ const AddProduct = () => {
<
FormGroup
>
<
FormGroup
>
<
Label
for
=
"
product-name
"
>
M
ô
t
ả
<
/Label
>
<
Label
for
=
"
product-name
"
>
M
ô
t
ả
<
/Label
>
<
InputGroup
className
=
"
mb-4
"
>
<
InputGroup
className
=
"
mb-4
"
>
<
InputGroupAddon
addonType
=
"
prepend
"
>
<
InputGroupText
>
<
i
className
=
"
fa fa-product-hunt
"
/>
<
/InputGroupText
>
<
/InputGroupAddon
>
<
Input
<
Input
placeholder
=
"
Mô tả
"
placeholder
=
"
Mô tả
"
type
=
"
text
"
type
=
"
text
area
"
value
=
{
description
}
value
=
{
description
}
onChange
=
{(
e
)
=>
setDescription
(
e
.
target
.
value
)}
onChange
=
{(
e
)
=>
setDescription
(
e
.
target
.
value
)}
/
>
/
>
...
@@ -155,14 +144,9 @@ const AddProduct = () => {
...
@@ -155,14 +144,9 @@ const AddProduct = () => {
<
FormGroup
>
<
FormGroup
>
<
Label
for
=
"
product-name
"
>
Đ
i
ề
u
ki
ệ
n
nu
ô
i
tr
ồ
ng
<
/Label
>
<
Label
for
=
"
product-name
"
>
Đ
i
ề
u
ki
ệ
n
nu
ô
i
tr
ồ
ng
<
/Label
>
<
InputGroup
className
=
"
mb-4
"
>
<
InputGroup
className
=
"
mb-4
"
>
<
InputGroupAddon
addonType
=
"
prepend
"
>
<
InputGroupText
>
<
i
className
=
"
fa fa-product-hunt
"
/>
<
/InputGroupText
>
<
/InputGroupAddon
>
<
Input
<
Input
placeholder
=
"
Điều kiện nuôi trồng
"
placeholder
=
"
Điều kiện nuôi trồng
"
type
=
"
text
"
type
=
"
text
area
"
value
=
{
growingConditions
}
value
=
{
growingConditions
}
onChange
=
{(
e
)
=>
setGrowingConditions
(
e
.
target
.
value
)}
onChange
=
{(
e
)
=>
setGrowingConditions
(
e
.
target
.
value
)}
/
>
/
>
...
...
src/components/Profile/AddProfile.js
View file @
4371fd59
...
@@ -56,7 +56,7 @@ const AddProfile = () => {
...
@@ -56,7 +56,7 @@ const AddProfile = () => {
}
}
console
.
log
(
"
params
"
,
params
);
console
.
log
(
"
params
"
,
params
);
dummyData
.
data
.
push
(
params
);
dummyData
.
data
.
push
(
params
);
history
.
push
(
"
/
"
);
history
.
push
(
"
/
profile
"
);
setValidPhoneNumber
(
false
);
setValidPhoneNumber
(
false
);
}
else
{
}
else
{
setValidPhoneNumber
(
true
);
setValidPhoneNumber
(
true
);
...
@@ -127,23 +127,15 @@ const AddProfile = () => {
...
@@ -127,23 +127,15 @@ const AddProfile = () => {
<
FormGroup
className
=
"
mb-4
"
>
<
FormGroup
className
=
"
mb-4
"
>
<
Label
for
=
"
address
"
>
Đị
a
ch
ỉ
<
/Label
>
<
Label
for
=
"
address
"
>
Đị
a
ch
ỉ
<
/Label
>
<
InputGroup
className
=
"
mb-4
"
>
<
InputGroup
className
=
"
mb-4
"
>
<
InputGroupAddon
addonType
=
"
prepend
"
>
<
InputGroupText
>
<
i
className
=
"
fa fa-location-arrow
"
/>
<
/InputGroupText
>
<
/InputGroupAddon
>
<
Input
<
Input
placeholder
=
"
Địa chỉ
"
placeholder
=
"
Địa chỉ
"
type
=
"
text
"
type
=
"
text
area
"
value
=
{
profileAddress
}
value
=
{
profileAddress
}
onChange
=
{(
e
)
=>
setProfileAddress
(
e
.
target
.
value
)}
onChange
=
{(
e
)
=>
setProfileAddress
(
e
.
target
.
value
)}
/
>
/
>
<
/InputGroup
>
<
/InputGroup
>
<
/FormGroup
>
<
/FormGroup
>
<
FormGroup
row
>
<
FormGroup
row
>
{
/* <Col>
<Label for="file-logo" sm={2}>Logo</Label>
</Col> */
}
<
Col
sm
=
{
10
}
>
<
Col
sm
=
{
10
}
>
<
Input
type
=
"
file
"
name
=
"
file
"
id
=
"
file-logo
"
/>
<
Input
type
=
"
file
"
name
=
"
file
"
id
=
"
file-logo
"
/>
<
FormText
color
=
"
muted
"
>
<
FormText
color
=
"
muted
"
>
...
...
src/components/Profile/DetailProfile.js
View file @
4371fd59
...
@@ -67,13 +67,8 @@ const DetailProfile = (props) => {
...
@@ -67,13 +67,8 @@ const DetailProfile = (props) => {
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
<
Row
className
=
"
row-grid
"
>
<
Row
className
=
"
row-grid
"
>
{
/* <div className="icon icon-lg icon-shape icon-shape-warning shadow rounded-circle mb-5">
<i className="ni ni-settings" />
</div> */
}
{
data
.
profile_product
&&
data
.
profile_product
.
length
>
0
?
data
.
profile_product
.
map
(
product
=>
{
{
data
.
profile_product
&&
data
.
profile_product
.
length
>
0
?
data
.
profile_product
.
map
(
product
=>
{
const
onHandleTraceCode
=
()
=>
{
const
onHandleTraceCode
=
()
=>
{
console
.
log
(
"
product
"
,
product
);
console
.
log
(
"
click
"
);
history
.
push
({
history
.
push
({
pathname
:
`/trace-code/
${
product
.
trace_code
}
`
,
pathname
:
`/trace-code/
${
product
.
trace_code
}
`
,
state
:
{
product
}
state
:
{
product
}
...
@@ -87,7 +82,6 @@ const DetailProfile = (props) => {
...
@@ -87,7 +82,6 @@ const DetailProfile = (props) => {
<
div
className
=
"
d-flex justify-content-around
"
>
<
div
className
=
"
d-flex justify-content-around
"
>
<
QRCode
<
QRCode
size
=
{
250
}
size
=
{
250
}
// fgColor="#7f0000"
includeMargin
includeMargin
value
=
{
`http://trace.aqbits.net/trace-code/
${
product
.
trace_code
}
`
}
value
=
{
`http://trace.aqbits.net/trace-code/
${
product
.
trace_code
}
`
}
imageSettings
=
{{
imageSettings
=
{{
...
...
src/components/Profile/Tracecode.js
View file @
4371fd59
...
@@ -12,24 +12,20 @@ import MainBanner from "components/Generals/MainBanner.js";
...
@@ -12,24 +12,20 @@ import MainBanner from "components/Generals/MainBanner.js";
import
DemoNavbar
from
"
components/Navbars/DemoNavbar.js
"
;
import
DemoNavbar
from
"
components/Navbars/DemoNavbar.js
"
;
import
SimpleFooter
from
"
components/Footers/SimpleFooter.js
"
;
import
SimpleFooter
from
"
components/Footers/SimpleFooter.js
"
;
import
{
formatDateTime
}
from
'
../../constans/index.js
'
;
import
{
formatDateTime
}
from
'
../../constans/index.js
'
;
import
dummyData
from
'
../../data/index.json
'
;
const
Tracecode
=
()
=>
{
const
Tracecode
=
()
=>
{
const
[
plainTabs
,
setPlainTabs
]
=
useState
(
1
);
const
[
plainTabs
,
setPlainTabs
]
=
useState
(
1
);
const
history
=
useHistory
();
let
state
=
{
...
history
.
location
.
state
};
const
product
=
state
.
product
;
const
toggleNavs
=
(
e
,
index
)
=>
{
const
toggleNavs
=
(
e
,
index
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
setPlainTabs
(
index
);
setPlainTabs
(
index
);
};
};
const
history
=
useHistory
();
let
state
=
{
...
history
.
location
.
state
};
const
product
=
state
.
product
;
const
renderProductInfo
=
(
product
)
=>
{
const
renderProductInfo
=
(
product
)
=>
{
// let product = dummyData.data[0].profile_product;
// product = product[0];
return
(
return
(
<>
<>
<
section
className
=
"
section bg-secondary
"
>
<
section
className
=
"
section bg-secondary
"
>
...
...
src/views/IndexSections/Table.js
View file @
4371fd59
...
@@ -174,12 +174,7 @@ export const ProductTable = (props) => {
...
@@ -174,12 +174,7 @@ export const ProductTable = (props) => {
console
.
log
(
"
props
"
,
props
);
console
.
log
(
"
props
"
,
props
);
const
onHandleClickAdd
=
()
=>
{
history
.
push
(
"
/profile/add
"
);
};
const
onHandleClickEdit
=
(
productId
)
=>
{
const
onHandleClickEdit
=
(
productId
)
=>
{
console
.
log
(
"
productId
"
,
productId
);
let
detailProduct
=
props
.
listProduct
.
filter
(
item
=>
item
.
product_id
===
productId
);
let
detailProduct
=
props
.
listProduct
.
filter
(
item
=>
item
.
product_id
===
productId
);
history
.
push
({
history
.
push
({
pathname
:
"
/profile/add-product
"
,
pathname
:
"
/profile/add-product
"
,
...
@@ -191,7 +186,7 @@ export const ProductTable = (props) => {
...
@@ -191,7 +186,7 @@ export const ProductTable = (props) => {
// dispatch(props.onDeleteProfile(profileId));
// dispatch(props.onDeleteProfile(profileId));
}
}
const
onHandleClickAdd
Product
=
()
=>
{
const
onHandleClickAdd
=
()
=>
{
history
.
push
({
history
.
push
({
pathname
:
"
/profile/add-product
"
,
pathname
:
"
/profile/add-product
"
,
// state: { profileId }
// state: { profileId }
...
@@ -249,7 +244,7 @@ export const ProductTable = (props) => {
...
@@ -249,7 +244,7 @@ export const ProductTable = (props) => {
<
DropdownItem
onClick
=
{()
=>
onHandleClickEdit
(
product_id
)}
>
<
DropdownItem
onClick
=
{()
=>
onHandleClickEdit
(
product_id
)}
>
<
i
className
=
"
fa fa-pencil mr-3
"
/>
{
"
Sửa
"
}
<
i
className
=
"
fa fa-pencil mr-3
"
/>
{
"
Sửa
"
}
<
/DropdownItem
>
<
/DropdownItem
>
<
DropdownItem
className
=
"
text-danger
"
onClick
=
{()
=>
console
.
log
(
'
This will fire!
'
)}
>
<
DropdownItem
className
=
"
text-danger
"
onClick
=
{()
=>
onHandleClickDelete
(
product_id
)}
>
<
i
className
=
"
fa fa-trash mr-3
"
/>
{
"
Xóa
"
}
<
i
className
=
"
fa fa-trash mr-3
"
/>
{
"
Xóa
"
}
<
/DropdownItem
>
<
/DropdownItem
>
<
/DropdownMenu
>
<
/DropdownMenu
>
...
@@ -268,7 +263,7 @@ export const ProductTable = (props) => {
...
@@ -268,7 +263,7 @@ export const ProductTable = (props) => {
<
h5
className
=
"
mb-3
"
>
{
"
Danh sách sản phẩm
"
}
<
/h5
>
<
h5
className
=
"
mb-3
"
>
{
"
Danh sách sản phẩm
"
}
<
/h5
>
<
/Col
>
<
/Col
>
<
Col
className
=
"
text-right
"
>
<
Col
className
=
"
text-right
"
>
<
Button
className
=
"
btn-1 ml-1
"
color
=
"
success
"
size
=
"
sm
"
type
=
"
button
"
onClick
=
{()
=>
onHandleClickAdd
Product
()}
>
{
"
Thêm mới sản phẩm
"
}
<
/Button
>
<
Button
className
=
"
btn-1 ml-1
"
color
=
"
success
"
size
=
"
sm
"
type
=
"
button
"
onClick
=
{()
=>
onHandleClickAdd
()}
>
{
"
Thêm mới sản phẩm
"
}
<
/Button
>
<
/Col
>
<
/Col
>
<
/Row
>
<
/Row
>
<
/CardHeader
>
<
/CardHeader
>
...
@@ -327,23 +322,29 @@ export const ProductDiaryTable = (props) => {
...
@@ -327,23 +322,29 @@ export const ProductDiaryTable = (props) => {
const
[
modal
,
setModal
]
=
useState
(
false
);
const
[
modal
,
setModal
]
=
useState
(
false
);
const
[
company
,
setCompany
]
=
useState
(
""
);
const
[
company
,
setCompany
]
=
useState
(
""
);
const
[
description
,
setDescription
]
=
useState
(
""
);
const
[
description
,
setDescription
]
=
useState
(
""
);
const
[
createDate
,
setCreateDate
]
=
useState
(
""
);
const
history
=
useHistory
();
const
history
=
useHistory
();
// const dispatch = useDispatch();
// const dispatch = useDispatch();
console
.
log
(
"
props
"
,
props
);
const
toggleModal
=
(
id
)
=>
{
const
toggle
=
()
=>
setModal
(
!
modal
);
const
onHandleClickEdit
=
(
id
)
=>
{
console
.
log
(
"
id
"
,
id
);
let
detailProductDiary
=
props
.
listProductDiary
.
filter
(
item
=>
item
.
id
===
id
);
let
detailProductDiary
=
props
.
listProductDiary
.
filter
(
item
=>
item
.
id
===
id
);
history
.
push
({
if
(
detailProductDiary
.
length
>
0
){
// pathname: "/profile/add-product",
setCompany
(
detailProductDiary
[
0
].
company
);
state
:
{
id
,
detailProductDiary
}
setDescription
(
detailProductDiary
[
0
].
description
);
});
setCreateDate
(
profileFormatDateTime
(
detailProductDiary
[
0
].
date
))
}
else
{
setCompany
(
""
);
setDescription
(
""
);
}
setModal
(
!
modal
);
};
const
onHandleClickAdd
=
()
=>
{
}
}
const
onHandleClickDelete
=
(
profileI
d
)
=>
{
const
onHandleClickDelete
=
(
i
d
)
=>
{
// dispatch(props.onDeleteProfile(profileId));
// dispatch(props.onDeleteProfile(profileId));
}
}
...
@@ -389,10 +390,10 @@ export const ProductDiaryTable = (props) => {
...
@@ -389,10 +390,10 @@ export const ProductDiaryTable = (props) => {
<
i
className
=
"
fa fa-ellipsis-h
"
/>
<
i
className
=
"
fa fa-ellipsis-h
"
/>
<
/DropdownToggle
>
<
/DropdownToggle
>
<
DropdownMenu
>
<
DropdownMenu
>
<
DropdownItem
onClick
=
{()
=>
toggle
(
)}
>
<
DropdownItem
onClick
=
{()
=>
toggle
Modal
(
id
)}
>
<
i
className
=
"
fa fa-pencil mr-3
"
/>
{
"
Sửa
"
}
<
i
className
=
"
fa fa-pencil mr-3
"
/>
{
"
Sửa
"
}
<
/DropdownItem
>
<
/DropdownItem
>
<
DropdownItem
className
=
"
text-danger
"
onClick
=
{()
=>
console
.
log
(
'
This will fire!
'
)}
>
<
DropdownItem
className
=
"
text-danger
"
onClick
=
{()
=>
onHandleClickDelete
(
id
)}
>
<
i
className
=
"
fa fa-trash mr-3
"
/>
{
"
Xóa
"
}
<
i
className
=
"
fa fa-trash mr-3
"
/>
{
"
Xóa
"
}
<
/DropdownItem
>
<
/DropdownItem
>
<
/DropdownMenu
>
<
/DropdownMenu
>
...
@@ -412,9 +413,9 @@ export const ProductDiaryTable = (props) => {
...
@@ -412,9 +413,9 @@ export const ProductDiaryTable = (props) => {
<
/Col
>
<
/Col
>
<
Col
className
=
"
text-right
"
>
<
Col
className
=
"
text-right
"
>
<
div
>
<
div
>
<
Button
className
=
"
btn-1 ml-1
"
color
=
"
success
"
size
=
"
sm
"
type
=
"
button
"
onClick
=
{()
=>
toggle
()}
>
{
"
Tạo mới nhật kí
"
}
<
/Button
>
<
Button
className
=
"
btn-1 ml-1
"
color
=
"
success
"
size
=
"
sm
"
type
=
"
button
"
onClick
=
{()
=>
toggle
Modal
()}
>
{
"
Tạo mới nhật kí
"
}
<
/Button
>
<
Modal
isOpen
=
{
modal
}
toggle
=
{
toggle
}
>
<
Modal
isOpen
=
{
modal
}
toggle
=
{
()
=>
toggleModal
()
}
>
<
ModalHeader
toggle
=
{
toggle
}
>
Th
ê
m
nh
ậ
t
k
í
<
/ModalHeader
>
<
ModalHeader
toggle
=
{
()
=>
toggleModal
()}
>
{
company
?
"
Sửa nhật kí
"
:
"
Thêm nhật kí
"
}
<
/ModalHeader
>
<
ModalBody
>
<
ModalBody
>
<
Form
>
<
Form
>
<
FormGroup
>
<
FormGroup
>
...
@@ -436,11 +437,6 @@ export const ProductDiaryTable = (props) => {
...
@@ -436,11 +437,6 @@ export const ProductDiaryTable = (props) => {
<
FormGroup
>
<
FormGroup
>
<
Label
for
=
"
diary-description
"
>
M
ô
t
ả
<
/Label
>
<
Label
for
=
"
diary-description
"
>
M
ô
t
ả
<
/Label
>
<
InputGroup
className
=
"
mb-4
"
>
<
InputGroup
className
=
"
mb-4
"
>
{
/* <InputGroupAddon addonType="prepend">
<InputGroupText>
<i className="fa fa-book" />
</InputGroupText>
</InputGroupAddon> */
}
<
Input
<
Input
placeholder
=
"
Mô tả
"
placeholder
=
"
Mô tả
"
type
=
"
textarea
"
type
=
"
textarea
"
...
@@ -449,11 +445,21 @@ export const ProductDiaryTable = (props) => {
...
@@ -449,11 +445,21 @@ export const ProductDiaryTable = (props) => {
/
>
/
>
<
/InputGroup
>
<
/InputGroup
>
<
/FormGroup
>
<
/FormGroup
>
{
company
?
<
FormGroup
>
<
Label
for
=
"
diary-date
"
>
Th
ờ
i
gian
t
ạ
o
<
/Label
>
<
InputGroup
className
=
"
mb-4
"
>
<
Input
placeholder
=
"
Thời gian tạo
"
type
=
"
text
"
value
=
{
createDate
}
disabled
/>
<
/InputGroup
>
<
/FormGroup> : <div></
div
>
}
<
/Form
>
<
/Form
>
<
/ModalBody
>
<
/ModalBody
>
<
ModalFooter
>
<
ModalFooter
>
<
Button
color
=
"
primary
"
onClick
=
{
toggle
}
>
Th
ê
m
<
/Button
>
<
Button
color
=
"
primary
"
size
=
"
sm
"
onClick
=
{
onHandleClickAdd
}
>
{
company
?
"
Sửa
"
:
"
Thêm mới
"
}
<
/Button
>
{
/* <Button color="secondary" onClick={toggle}>Quay lại</Button> */
}
<
/ModalFooter
>
<
/ModalFooter
>
<
/Modal
>
<
/Modal
>
<
/div
>
<
/div
>
...
...
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