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
c8b6574d
Commit
c8b6574d
authored
Jan 18, 2023
by
Le Dinh Trung
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/manage-products' into 'dev'
Feature/manage products See merge request
!6
parents
c2d2891c
1203f91e
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
642 additions
and
85 deletions
+642
-85
navigation.vue
components/navigation.vue
+0
-38
notification.vue
components/notification.vue
+0
-19
categories.vue
pages/home/categories.vue
+1
-6
products.vue
pages/home/products.vue
+629
-12
users.vue
pages/home/users.vue
+12
-10
No files found.
components/navigation.vue
deleted
100644 → 0
View file @
c2d2891c
<
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 @
c2d2891c
<
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 @
c8b6574d
...
...
@@ -25,7 +25,7 @@
/>
<label>
Parent :
</label>
<b-form-select
v-model=
"parent_id"
>
<option
v-for=
"item in categories"
:value=
"item.id"
>
<option
v-for=
"item in categories"
:value=
"item.id"
v-if=
"item.parent_id == null"
>
{{
item
.
name
}}
</option>
</b-form-select>
...
...
@@ -191,16 +191,12 @@
</template>
<
script
>
import
Nav
from
"
@/components/Nav
"
;
import
Navigation
from
"
@/components/Navigation
"
;
import
axios
from
"
axios
"
;
import
notification
from
"
@/components/Notification
"
;
import
{
BootstrapVue
,
BootstrapVueIcons
}
from
'
bootstrap-vue
'
export
default
{
layout
:
'
admin
'
,
components
:
{
Nav
},
components
:
{
Navigation
},
components
:
{
notification
},
middleware
:
[
"
web
"
],
data
:
()
=>
{
return
{
...
...
@@ -358,7 +354,6 @@ export default {
console
.
log
(
this
.
image
)
},
deleteCategory
(
ID
,
index
)
{
const
self
=
this
this
.
editedIndex
=
this
.
categories
.
indexOf
(
index
);
if
(
confirm
(
"
Do you really want to delete?
"
)){
try
{
...
...
pages/home/products.vue
View file @
c8b6574d
This diff is collapsed.
Click to expand it.
pages/home/users.vue
View file @
c8b6574d
...
...
@@ -183,8 +183,8 @@
</v-toolbar>
</template>
<
template
v-slot:item.actions=
"{ item }"
>
<v-icon
small
class=
"mr-2"
@
click=
" editUser(item
.id
);"
:id =
"item.id"
>
mdi-pencil
</v-icon>
<v-icon
small
@
click=
"deleteUser(item.id)"
:id =
"item.id"
>
mdi-delete
</v-icon>
<v-icon
small
class=
"mr-2"
@
click=
" editUser(item);"
:id =
"item.id"
>
mdi-pencil
</v-icon>
<v-icon
small
@
click=
"deleteUser(item.id
, item
)"
:id =
"item.id"
>
mdi-delete
</v-icon>
</
template
>
<
template
v-slot:no-data
>
<v-btn
color=
"primary"
@
click=
"initialize"
>
Reset
</v-btn>
...
...
@@ -194,17 +194,13 @@
</template>
<
script
>
import
Nav
from
"
@/components/Nav
"
;
import
Navigation
from
"
@/components/Navigation
"
;
import
axios
from
"
axios
"
;
import
notification
from
"
@/components/Notification
"
;
import
Toasted
from
'
vue-toasted
'
;
import
{
ModalPlugin
}
from
'
bootstrap-vue
'
;
export
default
{
layout
:
"
admin
"
,
components
:
{
Nav
},
components
:
{
Navigation
},
components
:
{
notification
},
middleware
:
[
"
web
"
],
data
:
()
=>
{
return
{
...
...
@@ -223,7 +219,7 @@ export default {
},
{
text
:
"
id
"
,
value
:
"
id
"
},
{
text
:
"
email
"
,
value
:
"
email
"
},
{
text
:
"
status
"
,
value
:
"
status
"
,
sortable
:
false
},
{
text
:
"
status
"
,
value
:
"
id
"
,
sortable
:
false
},
{
text
:
"
created_at
"
,
value
:
"
created_at
"
},
{
text
:
"
updated_at
"
,
value
:
"
updated_at
"
},
{
text
:
'
Actions
'
,
value
:
'
actions
'
,
sortable
:
false
},
...
...
@@ -346,19 +342,25 @@ export default {
});
});
},
deleteUser
(
userID
)
{
deleteUser
(
userID
,
index
)
{
this
.
editedIndex
=
this
.
users
.
indexOf
(
index
);
if
(
confirm
(
"
Do you really want to delete?
"
)){
try
{
axios
.
delete
(
`http://127.0.0.1:8000/api/users/
${
userID
}
`
)
.
then
(
response
=>
{
this
.
users
.
splice
(
this
.
editedIndex
,
1
);
})
}
catch
(
error
){
console
.
log
(
error
)
}
}
},
editUser
(
user
ID
)
{
editUser
(
user
)
{
this
.
$bvModal
.
show
(
'
modal-edit
'
);
this
.
eID
=
userID
;
this
.
eID
=
user
.
id
;
this
.
eEmail
=
user
.
email
;
this
.
eName
=
user
.
name
;
console
.
log
(
this
?.
eID
);
},
updateUser
(
userID
)
{
...
...
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