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
Show 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 = () => {
history
.
push
(
"
/profile/add
"
);
}
const
onHandleClickAddProductDiary
=
()
=>
{
history
.
push
({
pathname
:
"
/profile/add-product-diary
"
,
state
:
{
profileId
}
});
}
return
(
<>
...
...
@@ -139,14 +133,9 @@ const AddProduct = () => {
<
FormGroup
>
<
Label
for
=
"
product-name
"
>
M
ô
t
ả
<
/Label
>
<
InputGroup
className
=
"
mb-4
"
>
<
InputGroupAddon
addonType
=
"
prepend
"
>
<
InputGroupText
>
<
i
className
=
"
fa fa-product-hunt
"
/>
<
/InputGroupText
>
<
/InputGroupAddon
>
<
Input
placeholder
=
"
Mô tả
"
type
=
"
text
"
type
=
"
text
area
"
value
=
{
description
}
onChange
=
{(
e
)
=>
setDescription
(
e
.
target
.
value
)}
/
>
...
...
@@ -155,14 +144,9 @@ const AddProduct = () => {
<
FormGroup
>
<
Label
for
=
"
product-name
"
>
Đ
i
ề
u
ki
ệ
n
nu
ô
i
tr
ồ
ng
<
/Label
>
<
InputGroup
className
=
"
mb-4
"
>
<
InputGroupAddon
addonType
=
"
prepend
"
>
<
InputGroupText
>
<
i
className
=
"
fa fa-product-hunt
"
/>
<
/InputGroupText
>
<
/InputGroupAddon
>
<
Input
placeholder
=
"
Điều kiện nuôi trồng
"
type
=
"
text
"
type
=
"
text
area
"
value
=
{
growingConditions
}
onChange
=
{(
e
)
=>
setGrowingConditions
(
e
.
target
.
value
)}
/
>
...
...
src/components/Profile/AddProfile.js
View file @
4371fd59
...
...
@@ -56,7 +56,7 @@ const AddProfile = () => {
}
console
.
log
(
"
params
"
,
params
);
dummyData
.
data
.
push
(
params
);
history
.
push
(
"
/
"
);
history
.
push
(
"
/
profile
"
);
setValidPhoneNumber
(
false
);
}
else
{
setValidPhoneNumber
(
true
);
...
...
@@ -127,23 +127,15 @@ const AddProfile = () => {
<
FormGroup
className
=
"
mb-4
"
>
<
Label
for
=
"
address
"
>
Đị
a
ch
ỉ
<
/Label
>
<
InputGroup
className
=
"
mb-4
"
>
<
InputGroupAddon
addonType
=
"
prepend
"
>
<
InputGroupText
>
<
i
className
=
"
fa fa-location-arrow
"
/>
<
/InputGroupText
>
<
/InputGroupAddon
>
<
Input
placeholder
=
"
Địa chỉ
"
type
=
"
text
"
type
=
"
text
area
"
value
=
{
profileAddress
}
onChange
=
{(
e
)
=>
setProfileAddress
(
e
.
target
.
value
)}
/
>
<
/InputGroup
>
<
/FormGroup
>
<
FormGroup
row
>
{
/* <Col>
<Label for="file-logo" sm={2}>Logo</Label>
</Col> */
}
<
Col
sm
=
{
10
}
>
<
Input
type
=
"
file
"
name
=
"
file
"
id
=
"
file-logo
"
/>
<
FormText
color
=
"
muted
"
>
...
...
src/components/Profile/DetailProfile.js
View file @
4371fd59
...
...
@@ -67,13 +67,8 @@ const DetailProfile = (props) => {
<
/Col
>
<
/Row
>
<
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
=>
{
const
onHandleTraceCode
=
()
=>
{
console
.
log
(
"
product
"
,
product
);
console
.
log
(
"
click
"
);
history
.
push
({
pathname
:
`/trace-code/
${
product
.
trace_code
}
`
,
state
:
{
product
}
...
...
@@ -87,7 +82,6 @@ const DetailProfile = (props) => {
<
div
className
=
"
d-flex justify-content-around
"
>
<
QRCode
size
=
{
250
}
// fgColor="#7f0000"
includeMargin
value
=
{
`http://trace.aqbits.net/trace-code/
${
product
.
trace_code
}
`
}
imageSettings
=
{{
...
...
src/components/Profile/Tracecode.js
View file @
4371fd59
...
...
@@ -12,24 +12,20 @@ import MainBanner from "components/Generals/MainBanner.js";
import
DemoNavbar
from
"
components/Navbars/DemoNavbar.js
"
;
import
SimpleFooter
from
"
components/Footers/SimpleFooter.js
"
;
import
{
formatDateTime
}
from
'
../../constans/index.js
'
;
import
dummyData
from
'
../../data/index.json
'
;
const
Tracecode
=
()
=>
{
const
[
plainTabs
,
setPlainTabs
]
=
useState
(
1
);
const
history
=
useHistory
();
let
state
=
{
...
history
.
location
.
state
};
const
product
=
state
.
product
;
const
toggleNavs
=
(
e
,
index
)
=>
{
e
.
preventDefault
();
setPlainTabs
(
index
);
};
const
history
=
useHistory
();
let
state
=
{
...
history
.
location
.
state
};
const
product
=
state
.
product
;
const
renderProductInfo
=
(
product
)
=>
{
// let product = dummyData.data[0].profile_product;
// product = product[0];
return
(
<>
<
section
className
=
"
section bg-secondary
"
>
...
...
src/views/IndexSections/Table.js
View file @
4371fd59
...
...
@@ -174,12 +174,7 @@ export const ProductTable = (props) => {
console
.
log
(
"
props
"
,
props
);
const
onHandleClickAdd
=
()
=>
{
history
.
push
(
"
/profile/add
"
);
};
const
onHandleClickEdit
=
(
productId
)
=>
{
console
.
log
(
"
productId
"
,
productId
);
let
detailProduct
=
props
.
listProduct
.
filter
(
item
=>
item
.
product_id
===
productId
);
history
.
push
({
pathname
:
"
/profile/add-product
"
,
...
...
@@ -191,7 +186,7 @@ export const ProductTable = (props) => {
// dispatch(props.onDeleteProfile(profileId));
}
const
onHandleClickAdd
Product
=
()
=>
{
const
onHandleClickAdd
=
()
=>
{
history
.
push
({
pathname
:
"
/profile/add-product
"
,
// state: { profileId }
...
...
@@ -249,7 +244,7 @@ export const ProductTable = (props) => {
<
DropdownItem
onClick
=
{()
=>
onHandleClickEdit
(
product_id
)}
>
<
i
className
=
"
fa fa-pencil mr-3
"
/>
{
"
Sửa
"
}
<
/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
"
}
<
/DropdownItem
>
<
/DropdownMenu
>
...
...
@@ -268,7 +263,7 @@ export const ProductTable = (props) => {
<
h5
className
=
"
mb-3
"
>
{
"
Danh sách sản phẩm
"
}
<
/h5
>
<
/Col
>
<
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
>
<
/Row
>
<
/CardHeader
>
...
...
@@ -327,23 +322,29 @@ export const ProductDiaryTable = (props) => {
const
[
modal
,
setModal
]
=
useState
(
false
);
const
[
company
,
setCompany
]
=
useState
(
""
);
const
[
description
,
setDescription
]
=
useState
(
""
);
const
[
createDate
,
setCreateDate
]
=
useState
(
""
);
const
history
=
useHistory
();
// const dispatch = useDispatch();
console
.
log
(
"
props
"
,
props
);
const
toggle
=
()
=>
setModal
(
!
modal
);
const
onHandleClickEdit
=
(
id
)
=>
{
console
.
log
(
"
id
"
,
id
);
const
toggleModal
=
(
id
)
=>
{
let
detailProductDiary
=
props
.
listProductDiary
.
filter
(
item
=>
item
.
id
===
id
);
history
.
push
({
// pathname: "/profile/add-product",
state
:
{
id
,
detailProductDiary
}
});
if
(
detailProductDiary
.
length
>
0
){
setCompany
(
detailProductDiary
[
0
].
company
);
setDescription
(
detailProductDiary
[
0
].
description
);
setCreateDate
(
profileFormatDateTime
(
detailProductDiary
[
0
].
date
))
}
else
{
setCompany
(
""
);
setDescription
(
""
);
}
setModal
(
!
modal
);
};
const
onHandleClickDelete
=
(
profileId
)
=>
{
const
onHandleClickAdd
=
()
=>
{
}
const
onHandleClickDelete
=
(
id
)
=>
{
// dispatch(props.onDeleteProfile(profileId));
}
...
...
@@ -389,10 +390,10 @@ export const ProductDiaryTable = (props) => {
<
i
className
=
"
fa fa-ellipsis-h
"
/>
<
/DropdownToggle
>
<
DropdownMenu
>
<
DropdownItem
onClick
=
{()
=>
toggle
(
)}
>
<
DropdownItem
onClick
=
{()
=>
toggle
Modal
(
id
)}
>
<
i
className
=
"
fa fa-pencil mr-3
"
/>
{
"
Sửa
"
}
<
/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
"
}
<
/DropdownItem
>
<
/DropdownMenu
>
...
...
@@ -412,9 +413,9 @@ export const ProductDiaryTable = (props) => {
<
/Col
>
<
Col
className
=
"
text-right
"
>
<
div
>
<
Button
className
=
"
btn-1 ml-1
"
color
=
"
success
"
size
=
"
sm
"
type
=
"
button
"
onClick
=
{()
=>
toggle
()}
>
{
"
Tạo mới nhật kí
"
}
<
/Button
>
<
Modal
isOpen
=
{
modal
}
toggle
=
{
toggle
}
>
<
ModalHeader
toggle
=
{
toggle
}
>
Th
ê
m
nh
ậ
t
k
í
<
/ModalHeader
>
<
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
=
{
()
=>
toggleModal
()
}
>
<
ModalHeader
toggle
=
{
()
=>
toggleModal
()}
>
{
company
?
"
Sửa nhật kí
"
:
"
Thêm nhật kí
"
}
<
/ModalHeader
>
<
ModalBody
>
<
Form
>
<
FormGroup
>
...
...
@@ -436,11 +437,6 @@ export const ProductDiaryTable = (props) => {
<
FormGroup
>
<
Label
for
=
"
diary-description
"
>
M
ô
t
ả
<
/Label
>
<
InputGroup
className
=
"
mb-4
"
>
{
/* <InputGroupAddon addonType="prepend">
<InputGroupText>
<i className="fa fa-book" />
</InputGroupText>
</InputGroupAddon> */
}
<
Input
placeholder
=
"
Mô tả
"
type
=
"
textarea
"
...
...
@@ -449,11 +445,21 @@ export const ProductDiaryTable = (props) => {
/
>
<
/InputGroup
>
<
/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
>
<
/ModalBody
>
<
ModalFooter
>
<
Button
color
=
"
primary
"
onClick
=
{
toggle
}
>
Th
ê
m
<
/Button
>
{
/* <Button color="secondary" onClick={toggle}>Quay lại</Button> */
}
<
Button
color
=
"
primary
"
size
=
"
sm
"
onClick
=
{
onHandleClickAdd
}
>
{
company
?
"
Sửa
"
:
"
Thêm mới
"
}
<
/Button
>
<
/ModalFooter
>
<
/Modal
>
<
/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