Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
K
kiaisoft_tuananh_nuxt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TTS Tran Viet Anh
kiaisoft_tuananh_nuxt
Commits
fd2529b3
Commit
fd2529b3
authored
Jan 18, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove
parent
e9fccad2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
109 deletions
+28
-109
navigation.vue
components/navigation.vue
+0
-38
notification.vue
components/notification.vue
+0
-19
categories.vue
pages/home/categories.vue
+0
-4
products.vue
pages/home/products.vue
+28
-44
users.vue
pages/home/users.vue
+0
-4
No files found.
components/navigation.vue
deleted
100644 → 0
View file @
e9fccad2
<
template
>
<v-card
class=
"mx-auto"
height=
"400"
width=
"256"
>
<v-navigation-drawer
class=
"deep-purple accent-4"
dark
permanent
>
<v-list>
<v-list-item
v-for=
"item in items"
:key=
"item.title"
link
>
<v-list-item-icon>
<v-icon>
{{
item
.
icon
}}
</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>
{{
item
.
title
}}
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
<template
v-slot:append
>
<div
class=
"pa-2"
>
<v-btn
block
>
Logout
</v-btn>
</div>
</
template
>
</v-navigation-drawer>
</v-card>
</template>
<
script
>
export
default
{
name
:
"
navigation
"
,
data
()
{
return
{
items
:
[
{
title
:
"
Dashboard
"
,
icon
:
"
mdi-view-dashboard
"
},
{
title
:
"
Account
"
,
icon
:
"
mdi-account-box
"
},
{
title
:
"
Admin
"
,
icon
:
"
mdi-gavel
"
},
],
};
},
};
</
script
>
components/notification.vue
deleted
100644 → 0
View file @
e9fccad2
<
template
>
<div
class=
"notification is-danger bg-danger"
>
{{
message
}}
</div>
</
template
>
<
style
>
.notification
{
padding
:
11px
;
margin
:
10px
0px
;
}
</
style
>
<
script
>
export
default
{
name
:
"
Notification
"
,
props
:
[
"
message
"
],
};
</
script
>
pages/home/categories.vue
View file @
fd2529b3
...
@@ -191,16 +191,12 @@
...
@@ -191,16 +191,12 @@
</template>
</template>
<
script
>
<
script
>
import
Nav
from
"
@/components/Nav
"
;
import
Nav
from
"
@/components/Nav
"
;
import
Navigation
from
"
@/components/Navigation
"
;
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
notification
from
"
@/components/Notification
"
;
import
{
BootstrapVue
,
BootstrapVueIcons
}
from
'
bootstrap-vue
'
import
{
BootstrapVue
,
BootstrapVueIcons
}
from
'
bootstrap-vue
'
export
default
{
export
default
{
layout
:
'
admin
'
,
layout
:
'
admin
'
,
components
:
{
Nav
},
components
:
{
Nav
},
components
:
{
Navigation
},
components
:
{
notification
},
middleware
:
[
"
web
"
],
middleware
:
[
"
web
"
],
data
:
()
=>
{
data
:
()
=>
{
return
{
return
{
...
...
pages/home/products.vue
View file @
fd2529b3
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
v-model=
"name"
v-model=
"name"
max=
"255"
max=
"255"
min=
"1"
min=
"1"
:state=
"nameState"
trim
trim
>
>
</b-form-input>
</b-form-input>
...
@@ -109,7 +108,7 @@
...
@@ -109,7 +108,7 @@
</div>
</div>
<template
#modal-footer
>
<template
#modal-footer
>
<button
v-b-modal
.
modal-close_visit
@
click=
"$bvModal.hide('modal-create')"
class=
"btn btn-danger btn-sm m-1"
>
Close
</button>
<button
v-b-modal
.
modal-close_visit
@
click=
"$bvModal.hide('modal-create')"
class=
"btn btn-danger btn-sm m-1"
>
Close
</button>
<button
@
click=
"
getInfo(); createProduct();
"
v-b-modal
.
modal-close_visit
class=
"btn btn-success btn-sm m-1"
>
Submit
</button>
<button
@
click=
"
createProduct()
"
v-b-modal
.
modal-close_visit
class=
"btn btn-success btn-sm m-1"
>
Submit
</button>
</
template
>
</
template
>
</b-modal>
</b-modal>
<!-- modal-show -->
<!-- modal-show -->
...
@@ -132,7 +131,6 @@
...
@@ -132,7 +131,6 @@
size=
"sm"
size=
"sm"
disabled
disabled
/>
/>
<label>
Price :
</label>
<label>
Price :
</label>
<input
<input
type=
"text"
type=
"text"
...
@@ -213,7 +211,6 @@
...
@@ -213,7 +211,6 @@
{{item.name}}
{{item.name}}
</option>
</option>
</b-form-select>
</b-form-select>
<label>
Price :
</label>
<label>
Price :
</label>
<input
<input
type=
"text"
type=
"text"
...
@@ -308,7 +305,7 @@
...
@@ -308,7 +305,7 @@
<
template
v-slot:item.actions=
"{ item }"
>
<
template
v-slot:item.actions=
"{ item }"
>
<v-icon
small
@
click=
"editProduct(item)"
:id =
"item.id"
>
mdi-pencil
</v-icon>
<v-icon
small
@
click=
"editProduct(item)"
:id =
"item.id"
>
mdi-pencil
</v-icon>
<v-icon
small
@
click=
"deleteProduct(item.id,item)"
:id =
"item.id"
>
mdi-delete
</v-icon>
<v-icon
small
@
click=
"deleteProduct(item.id,item)"
:id =
"item.id"
>
mdi-delete
</v-icon>
<v-icon
small
@
click=
"showProduct(item)
;
"
:id =
"item.id"
>
mdi-account-details
</v-icon>
<v-icon
small
@
click=
"showProduct(item)"
:id =
"item.id"
>
mdi-account-details
</v-icon>
</
template
>
</
template
>
<
template
v-slot:no-data
>
<
template
v-slot:no-data
>
<v-btn
color=
"primary"
@
click=
"initialize"
>
Reset
</v-btn>
<v-btn
color=
"primary"
@
click=
"initialize"
>
Reset
</v-btn>
...
@@ -319,19 +316,14 @@
...
@@ -319,19 +316,14 @@
</template>
</template>
<
script
>
<
script
>
import
CreateProductModal
from
"
../../components/CreateProductModal
"
;
import
Nav
from
"
@/components/Nav
"
;
import
Nav
from
"
@/components/Nav
"
;
import
Navigation
from
"
@/components/Navigation
"
;
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
notification
from
"
@/components/Notification
"
;
export
default
{
export
default
{
layout
:
'
admin
'
,
layout
:
'
admin
'
,
name
:
"
App
"
,
name
:
"
App
"
,
components
:
{
components
:
{
CreateProductModal
,
Nav
,
Nav
,
Navigation
,
},
},
middleware
:
[
"
web
"
],
middleware
:
[
"
web
"
],
data
:
()
=>
{
data
:
()
=>
{
...
@@ -419,7 +411,7 @@ export default {
...
@@ -419,7 +411,7 @@ export default {
},
},
computed
:
{
computed
:
{
formTitle
()
{
formTitle
()
{
return
this
.
editedIndex
===
-
1
?
"
New Item
"
:
"
Edit Item
"
;
return
this
.
editedIndex
===
-
1
?
"
New Item
"
:
"
Edit Item
"
},
},
nameState
()
{
nameState
()
{
return
this
.
name
.
length
>
2
?
true
:
false
return
this
.
name
.
length
>
2
?
true
:
false
...
@@ -427,23 +419,23 @@ export default {
...
@@ -427,23 +419,23 @@ export default {
},
},
watch
:
{
watch
:
{
dialog
(
val
)
{
dialog
(
val
)
{
val
||
this
.
close
()
;
val
||
this
.
close
()
},
},
dialogDelete
(
val
)
{
dialogDelete
(
val
)
{
val
||
this
.
closeDelete
()
;
val
||
this
.
closeDelete
()
},
},
},
},
created
()
{
created
()
{
this
.
initialize
()
;
this
.
initialize
()
,
this
.
getProducts
()
;
this
.
getProducts
()
,
this
.
getCategories
()
;
this
.
getCategories
()
},
},
methods
:
{
methods
:
{
initialize
()
{
initialize
()
{
this
.
products
=
[]
;
this
.
products
=
[]
,
this
.
product
=
[]
;
this
.
product
=
[]
,
this
.
categories
=
[]
;
this
.
categories
=
[]
,
this
.
sName
=
''
;
this
.
sName
=
''
,
this
.
sCategoryId
=
''
,
this
.
sCategoryId
=
''
,
this
.
sPrice
=
''
,
this
.
sPrice
=
''
,
this
.
sDescription
=
''
,
this
.
sDescription
=
''
,
...
@@ -459,9 +451,9 @@ export default {
...
@@ -459,9 +451,9 @@ export default {
];
];
},
},
editItem
(
item
)
{
editItem
(
item
)
{
this
.
editedIndex
=
this
.
products
.
indexOf
(
item
)
;
this
.
editedIndex
=
this
.
products
.
indexOf
(
item
)
this
.
editedItem
=
Object
.
assign
({},
item
)
;
this
.
editedItem
=
Object
.
assign
({},
item
)
this
.
dialog
=
true
;
this
.
dialog
=
true
},
},
deleteItem
(
item
)
{
deleteItem
(
item
)
{
this
.
editedIndex
=
this
.
products
.
indexOf
(
item
);
this
.
editedIndex
=
this
.
products
.
indexOf
(
item
);
...
@@ -470,20 +462,20 @@ export default {
...
@@ -470,20 +462,20 @@ export default {
},
},
deleteItemConfirm
()
{
deleteItemConfirm
()
{
this
.
products
.
splice
(
this
.
editedIndex
,
1
);
this
.
products
.
splice
(
this
.
editedIndex
,
1
);
this
.
closeDelete
()
;
this
.
closeDelete
()
},
},
close
()
{
close
()
{
this
.
dialog
=
false
;
this
.
dialog
=
false
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
editedItem
=
Object
.
assign
({},
this
.
defaultItem
)
;
this
.
editedItem
=
Object
.
assign
({},
this
.
defaultItem
)
this
.
editedIndex
=
-
1
;
this
.
editedIndex
=
-
1
});
});
},
},
closeDelete
()
{
closeDelete
()
{
this
.
dialogDelete
=
false
;
this
.
dialogDelete
=
false
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
editedItem
=
Object
.
assign
({},
this
.
defaultItem
);
this
.
editedItem
=
Object
.
assign
({},
this
.
defaultItem
);
this
.
editedIndex
=
-
1
;
this
.
editedIndex
=
-
1
});
});
},
},
save
()
{
save
()
{
...
@@ -492,7 +484,7 @@ export default {
...
@@ -492,7 +484,7 @@ export default {
}
else
{
}
else
{
this
.
products
.
push
(
this
.
editedItem
);
this
.
products
.
push
(
this
.
editedItem
);
}
}
this
.
close
()
;
this
.
close
()
},
},
getCategories
()
{
getCategories
()
{
axios
axios
...
@@ -540,8 +532,8 @@ export default {
...
@@ -540,8 +532,8 @@ export default {
this
.
message
=
errors
.
response
.
data
.
message
;
this
.
message
=
errors
.
response
.
data
.
message
;
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,{
self
.
$toast
.
error
(
'
something went wrong while trying create!
'
,{
duration
:
3000
duration
:
3000
})
;
})
})
;
})
},
},
deleteProduct
(
ID
,
index
)
{
deleteProduct
(
ID
,
index
)
{
const
self
=
this
;
const
self
=
this
;
...
@@ -562,7 +554,7 @@ export default {
...
@@ -562,7 +554,7 @@ export default {
}
}
},
},
async
showProduct
(
item
)
{
async
showProduct
(
item
)
{
const
ID
=
item
.
id
;
const
ID
=
item
.
id
try
{
try
{
const
resp
=
await
fetch
(
`http://127.0.0.1:8000/api/products/
${
ID
}
`
,
{
const
resp
=
await
fetch
(
`http://127.0.0.1:8000/api/products/
${
ID
}
`
,
{
method
:
"
GET
"
,
method
:
"
GET
"
,
...
@@ -598,7 +590,7 @@ export default {
...
@@ -598,7 +590,7 @@ export default {
this
.
eVariants
=
item
.
variants
this
.
eVariants
=
item
.
variants
},
},
updateProduct
(
ID
)
{
updateProduct
(
ID
)
{
const
self
=
this
;
const
self
=
this
try
{
try
{
axios
axios
.
post
(
`http://127.0.0.1:8000/api/products/update/
${
this
?.
eId
}
`,{
.
post
(
`http://127.0.0.1:8000/api/products/update/
${
this
?.
eId
}
`,{
...
@@ -639,19 +631,11 @@ export default {
...
@@ -639,19 +631,11 @@ export default {
});
});
},
},
remove(index) {
remove(index) {
this.variants.splice(index, 1)
;
this.variants.splice(index, 1)
},
},
removeVariant(index) {
removeVariant(index) {
this.eVariants.splice(index, 1)
;
this.eVariants.splice(index, 1)
},
},
getInfo() {
console.log(this.name)
console.log(this.price)
console.log(this.category_id)
console.log(this.stock)
console.log(this.images)
console.log(this.variants)
}
},
},
};
};
</
script
>
</
script
>
...
...
pages/home/users.vue
View file @
fd2529b3
...
@@ -194,17 +194,13 @@
...
@@ -194,17 +194,13 @@
</template>
</template>
<
script
>
<
script
>
import
Nav
from
"
@/components/Nav
"
;
import
Nav
from
"
@/components/Nav
"
;
import
Navigation
from
"
@/components/Navigation
"
;
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
notification
from
"
@/components/Notification
"
;
import
Toasted
from
'
vue-toasted
'
;
import
Toasted
from
'
vue-toasted
'
;
import
{
ModalPlugin
}
from
'
bootstrap-vue
'
;
import
{
ModalPlugin
}
from
'
bootstrap-vue
'
;
export
default
{
export
default
{
layout
:
"
admin
"
,
layout
:
"
admin
"
,
components
:
{
Nav
},
components
:
{
Nav
},
components
:
{
Navigation
},
components
:
{
notification
},
middleware
:
[
"
web
"
],
middleware
:
[
"
web
"
],
data
:
()
=>
{
data
:
()
=>
{
return
{
return
{
...
...
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