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
41585dec
Commit
41585dec
authored
Feb 15, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rs category
parent
189df397
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
86 deletions
+126
-86
index.vue
pages/categories/index.vue
+110
-80
index.vue
pages/products/index.vue
+16
-6
No files found.
pages/categories/index.vue
View file @
41585dec
...
...
@@ -17,6 +17,7 @@
</v-card-title>
<v-card-text>
<v-container>
<v-form
ref=
"formEdit"
>
<v-row>
<v-col
cols=
"12"
>
<v-text-field
...
...
@@ -70,6 +71,8 @@
item-value=
"id"
selected-color=
"primary"
selection-type=
"independent"
@
update:open=
"onOpen"
@
input=
"selectCategory"
/>
</v-card-text>
</v-card>
...
...
@@ -99,6 +102,7 @@
/>
</v-col>
</v-row>
</v-form>
</v-container>
<small>
*indicates required field
</small>
</v-card-text>
...
...
@@ -212,7 +216,7 @@
item-value=
"id"
selected-color=
"primary"
selection-type=
"independent"
:rule=
"singleRules"
:rule
s
=
"singleRules"
/>
</v-card-text>
</v-card>
...
...
@@ -448,8 +452,7 @@ export default {
],
nameRules
:
[
v
=>
!!
v
||
'
Name is required
'
,
v
=>
(
v
&&
v
.
length
<=
255
)
||
'
Name must be less than 255 characters
'
v
=>
(
v
&&
v
.
length
<=
255
)
||
'
Name must be less than 255 characters
'
],
requiredRules
:
[
v
=>
!!
v
||
'
This field is required
'
],
numberRules
:
[
...
...
@@ -478,6 +481,20 @@ export default {
},
dialogDelete
(
val
)
{
val
||
this
.
closeDelete
()
},
eParentId
:
function
()
{
if
(
this
.
eParentId
.
length
>
1
)
{
this
.
$toast
.
error
(
'
please chose 1 -___-!
'
,
{
duration
:
3000
})
}
},
parent_id
:
function
()
{
if
(
this
.
parent_id
.
length
>
1
)
{
this
.
$toast
.
error
(
'
please chose 1 -___-!
'
,
{
duration
:
3000
})
}
}
},
created
()
{
...
...
@@ -573,9 +590,7 @@ export default {
this
.
$axios
.
post
(
'
/categories/
'
,
fd
,
{
headers
:
{
Authorization
:
`Bearer
${
this
.
$auth
.
$storage
.
getUniversal
(
'
token
'
)}
`
Authorization
:
`Bearer
${
this
.
$auth
.
$storage
.
getUniversal
(
'
token
'
)}
`
}
})
.
then
((
response
)
=>
{
...
...
@@ -691,6 +706,21 @@ export default {
},
clearFile () {
this.file = null
},
onOpen (e) {
if (!this.__initial) {
this.__initial = true
return
}
// this.eParentId.length = 0
console.log('toggle arrow clicked', e)
},
selectCategory (e) {
console.log(e[0])
console.log(this.eParentId)
// this.eParentId.length = 0
// this.eParentId.push(e[0])
}
}
}
...
...
pages/products/index.vue
View file @
41585dec
...
...
@@ -128,8 +128,6 @@
<v-row>
<v-col
cols=
"12"
sm=
"6"
md=
"4"
>
<v-text-field
v-model=
"eName"
...
...
@@ -178,10 +176,17 @@
</v-col>
<v-col
v-if=
"files"
cols=
"12"
>
<v-col
v-for=
"(image, index) in files"
:key=
"index"
cols=
"12"
>
<v-img
:src=
"image"
contain
/>
<v-img
:src=
"image"
contain
height=
"100px"
width=
"150px"
display:flex
/>
</v-col>
</v-col>
<v-col
v-for=
"(imageEdit, index) in eImages"
:key=
"index"
cols=
"12"
text-align=
" left"
style=
"display:flex"
>
<v-img
contain
height=
"100px"
width=
"150px"
:src=
"imageEdit"
/>
</v-col>
<!-- <v-img v-if="typeof eImages === 'string'" :src="eImages" /> -->
<v-col
cols=
"12"
>
<v-btn
class=
"mx-2"
...
...
@@ -345,8 +350,6 @@
<v-row>
<v-col
cols=
"12"
sm=
"6"
md=
"4"
>
<v-text-field
v-model=
"name"
...
...
@@ -835,6 +838,7 @@ export default {
this
.
eStock
=
item
.
stock
this
.
eDescription
=
item
.
description
this
.
eVariants
=
item
.
variants
this
.
eImages
=
item
.
images
this
.
editedIndex
=
this
.
products
.
indexOf
(
item
)
console
.
log
(
item
.
variants
)
this
.
dialog3
=
true
...
...
@@ -955,3 +959,9 @@ export default {
}
}
</
script
>
<
style
>
img
{
width
:
100px
;
height
:
150px
;
}
</
style
>
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