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
5b0c67dc
Commit
5b0c67dc
authored
Jan 16, 2023
by
vietanh-0511
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update categories
parent
9201a8ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
15 deletions
+22
-15
categories.vue
pages/home/categories.vue
+22
-15
No files found.
pages/home/categories.vue
View file @
5b0c67dc
...
@@ -64,20 +64,21 @@
...
@@ -64,20 +64,21 @@
v-model=
"eName"
v-model=
"eName"
max=
"255"
max=
"255"
min=
"1"
min=
"1"
value=
"this?.eName"
/>
/>
<label>
Parent ID :
</label>
<label>
Parent :
</label>
<input
<b-form-select
v-model=
"eParentId"
>
type=
"text"
<option
v-for=
"item in categories"
:value=
"item.id"
:key=
"item.id"
>
class=
"form-control mb-2"
{{item.name}}
placeholder=
"Parent ID"
</option>
v-model=
"eParent_id"
</b-form-select>
/>
<label>
Ordering :
</label>
<label>
Ordering :
</label>
<input
<input
type=
"text"
type=
"text"
class=
"form-control mb-2"
class=
"form-control mb-2"
placeholder=
"Ordering"
placeholder=
"Ordering"
v-model=
"eOrdering"
v-model=
"eOrdering"
value=
"this?.eOrdering"
/>
/>
<!-- <b-form-select v-model="selected" :options="options"></b-form-select> -->
<!-- <b-form-select v-model="selected" :options="options"></b-form-select> -->
<label>
Image :
</label>
<label>
Image :
</label>
...
@@ -178,7 +179,7 @@
...
@@ -178,7 +179,7 @@
</v-toolbar>
</v-toolbar>
</template>
</template>
<
template
v-slot:item.actions=
"{ item }"
>
<
template
v-slot:item.actions=
"{ item }"
>
<v-icon
small
class=
"mr-2"
@
click=
"
editCategory(item.id
)"
:id =
"item.id"
>
mdi-pencil
</v-icon>
<v-icon
small
class=
"mr-2"
@
click=
"
editCategory(item
)"
:id =
"item.id"
>
mdi-pencil
</v-icon>
<v-icon
small
@
click=
"deleteCategory(item.id,item)"
:id =
"item.id"
>
mdi-delete
</v-icon>
<v-icon
small
@
click=
"deleteCategory(item.id,item)"
:id =
"item.id"
>
mdi-delete
</v-icon>
</
template
>
</
template
>
<
template
v-slot:no-data
>
<
template
v-slot:no-data
>
...
@@ -229,7 +230,7 @@ export default {
...
@@ -229,7 +230,7 @@ export default {
eID
:
''
,
eID
:
''
,
eName
:
''
,
eName
:
''
,
eOrdering
:
''
,
eOrdering
:
''
,
eParent
_id
:
''
,
eParent
Id
:
null
,
eImage
:
null
,
eImage
:
null
,
message
:
[],
message
:
[],
editedIndex
:
-
1
,
editedIndex
:
-
1
,
...
@@ -326,7 +327,7 @@ export default {
...
@@ -326,7 +327,7 @@ export default {
name
:
this
.
name
,
name
:
this
.
name
,
ordering
:
this
.
ordering
,
ordering
:
this
.
ordering
,
parent_id
:
this
.
parent_id
,
parent_id
:
this
.
parent_id
,
image
:
image
,
image
s
:
image
,
},
{
},
{
headers
:
{
headers
:
{
"
Content-Type
"
:
"
multipart/form-data
"
,
"
Content-Type
"
:
"
multipart/form-data
"
,
...
@@ -377,13 +378,19 @@ export default {
...
@@ -377,13 +378,19 @@ export default {
getID
(
item
)
{
getID
(
item
)
{
console
.
log
(
this
.
categories
.
indexOf
(
item
))
console
.
log
(
this
.
categories
.
indexOf
(
item
))
},
},
editCategory
(
userID
)
{
editCategory
(
item
)
{
this
.
$bvModal
.
show
(
'
modal-edit
'
);
this
.
$bvModal
.
show
(
'
modal-edit
'
);
this
.
eID
=
userID
;
this
.
eID
=
item
.
id
;
this
.
eName
=
item
.
name
,
this
.
eOrdering
=
item
.
ordering
,
this
.
eParentId
=
item
.
parent_id
,
this
.
eImage
=
item
.
images
,
console
.
log
(
this
?.
eID
);
console
.
log
(
this
?.
eID
);
console
.
log
(
this
.
eName
);
console
.
log
(
item
);
},
},
updateCategory
(
userID
)
{
updateCategory
(
userID
)
{
const
set
=
new
Set
([
this
.
eImage
]);
const
image
=
Array
.
from
(
set
);
const
self
=
this
const
self
=
this
console
.
log
(
this
.
eName
);
console
.
log
(
this
.
eName
);
console
.
log
(
this
.
eOrdering
);
console
.
log
(
this
.
eOrdering
);
...
@@ -393,8 +400,8 @@ export default {
...
@@ -393,8 +400,8 @@ export default {
.
post
(
`http://127.0.0.1:8000/api/categories/update/
${
this
?.
eID
}
`,{
.
post
(
`http://127.0.0.1:8000/api/categories/update/
${
this
?.
eID
}
`,{
name: this.eName,
name: this.eName,
ordering: this.eOrdering,
ordering: this.eOrdering,
parent_id: this.eParent
_i
d,
parent_id: this.eParent
I
d,
image
: this.eI
mage }, {
image
s: i
mage }, {
headers: {
headers: {
"Content-Type": "multipart/form-data",
"Content-Type": "multipart/form-data",
"Authorization": this.$auth.$storage.getUniversal("token")
"Authorization": this.$auth.$storage.getUniversal("token")
...
...
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