Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quasar-web-base
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Nguyễn Hải Sơn
quasar-web-base
Commits
a4742087
Commit
a4742087
authored
May 04, 2021
by
Võ Quang Thành Đạt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update artist page
parent
75c1c8f5
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
568 additions
and
58 deletions
+568
-58
configurations.example.ts
src/assets/configurations.example.ts
+5
-0
type.ts
src/assets/type.ts
+33
-0
CompositionComponent.vue
src/components/CompositionComponent.vue
+9
-16
NewArtistDialog.ts
...tist-information/add-new-artist-dialog/NewArtistDialog.ts
+123
-0
index.vue
...onents/artist-information/add-new-artist-dialog/index.vue
+285
-0
index.ts
src/i18n/vi/index.ts
+6
-0
MainLayout.vue
src/layouts/MainLayout.vue
+1
-0
Index.vue
src/pages/Index.vue
+4
-10
updateInformationArtist.ts
...ges/cap-nhat-thong-tin-nghe-sy/updateInformationArtist.ts
+4
-4
customer.ts
src/pages/khach-hang/customer.ts
+2
-2
artist.ts
src/pages/nghe-sy/artist.ts
+76
-7
index.vue
src/pages/nghe-sy/index.vue
+11
-2
User.ts
src/pages/nguoi-dung/User.ts
+6
-14
index.vue
src/pages/nguoi-dung/index.vue
+3
-3
No files found.
src/assets/configurations.example.ts
View file @
a4742087
...
@@ -34,4 +34,9 @@ export enum API_PATHS {
...
@@ -34,4 +34,9 @@ export enum API_PATHS {
updateUser
=
'/user/update'
,
updateUser
=
'/user/update'
,
getListUnits
=
'/unit/list'
,
getListUnits
=
'/unit/list'
,
getListArtists
=
'/artist'
,
getListArtists
=
'/artist'
,
getFieldOptions
=
'/field'
,
getNationalityOptions
=
'/nationality'
,
getArtistLevelOptions
=
'/artistLevel'
,
getQualificationOptions
=
'/qualification'
,
getWorkOptions
=
'/work'
,
}
}
src/assets/type.ts
View file @
a4742087
...
@@ -49,3 +49,36 @@ export type ArtistInfoType = {
...
@@ -49,3 +49,36 @@ export type ArtistInfoType = {
instagram
:
string
|
null
;
instagram
:
string
|
null
;
whatsapp
:
string
|
null
;
whatsapp
:
string
|
null
;
};
};
export
type
FieldType
=
{
id
:
number
;
name
:
string
;
status
:
number
;
description
:
string
|
null
;
numIndex
:
number
;
};
export
type
NationalityType
=
{
id
:
number
;
name
:
string
;
status
:
number
;
numIndex
:
number
;
};
export
type
ArtistLevelType
=
{
id
:
number
;
name
:
string
;
status
:
number
;
artistLevel
:
number
;
description
:
string
|
null
;
};
export
type
QualificationType
=
{
id
:
number
;
name
:
string
;
status
:
number
;
numIndex
:
number
;
};
export
type
WorkType
=
{
id
:
number
;
name
:
string
;
status
:
number
;
numIndex
:
number
;
};
src/components/CompositionComponent.vue
View file @
a4742087
<
template
>
<
template
>
<div>
<div>
<p>
{{
title
}}
</p>
<
!--
<
p>
{{
title
}}
</p>
<ul>
<ul>
<li
v-for=
"todo in todos"
:key=
"todo.id"
@
click=
"increment"
>
<li
v-for=
"todo in todos"
:key=
"todo.id"
@
click=
"increment"
>
{{
todo
.
id
}}
-
{{
todo
.
content
}}
{{
todo
.
id
}}
-
{{
todo
.
content
}}
...
@@ -8,25 +8,18 @@
...
@@ -8,25 +8,18 @@
</ul>
</ul>
<p>
Count:
{{
todoCount
}}
/
{{
meta
.
totalCount
}}
</p>
<p>
Count:
{{
todoCount
}}
/
{{
meta
.
totalCount
}}
</p>
<p>
Active:
{{
active
?
'yes'
:
'no'
}}
</p>
<p>
Active:
{{
active
?
'yes'
:
'no'
}}
</p>
<p>
Clicks on todos:
{{
clickCount
}}
</p>
<p>
Clicks on todos:
{{
clickCount
}}
</p>
-->
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
import
{
defineComponent
,
PropType
,
computed
,
ref
,
toRef
,
Ref
}
from
'vue'
;
defineComponent
,
PropType
,
computed
,
ref
,
toRef
,
Ref
,
}
from
'vue'
;
import
{
Todo
,
Meta
}
from
'./models'
;
import
{
Todo
,
Meta
}
from
'./models'
;
function
useClickCount
()
{
function
useClickCount
()
{
const
clickCount
=
ref
(
0
);
const
clickCount
=
ref
(
0
);
function
increment
()
{
function
increment
()
{
clickCount
.
value
+=
1
clickCount
.
value
+=
1
;
return
clickCount
.
value
;
return
clickCount
.
value
;
}
}
...
@@ -43,19 +36,19 @@ export default defineComponent({
...
@@ -43,19 +36,19 @@ export default defineComponent({
props
:
{
props
:
{
title
:
{
title
:
{
type
:
String
,
type
:
String
,
required
:
true
required
:
true
,
},
},
todos
:
{
todos
:
{
type
:
Array
as
PropType
<
Todo
[]
>
,
type
:
Array
as
PropType
<
Todo
[]
>
,
default
:
()
=>
[]
default
:
()
=>
[]
,
},
},
meta
:
{
meta
:
{
type
:
Object
as
PropType
<
Meta
>
,
type
:
Object
as
PropType
<
Meta
>
,
required
:
true
required
:
true
,
},
},
active
:
{
active
:
{
type
:
Boolean
type
:
Boolean
,
}
}
,
},
},
setup
(
props
)
{
setup
(
props
)
{
return
{
...
useClickCount
(),
...
useDisplayTodo
(
toRef
(
props
,
'todos'
))
};
return
{
...
useClickCount
(),
...
useDisplayTodo
(
toRef
(
props
,
'todos'
))
};
...
...
src/components/artist-information/add-new-artist-dialog/NewArtistDialog.ts
0 → 100644
View file @
a4742087
import
{
defineComponent
}
from
'vue'
;
import
{
i18n
}
from
'src/boot/i18n'
;
import
{
isEmail
}
from
'../../../boot/functions'
;
import
{
isMobilePhone
}
from
'../../../boot/functions'
;
export
default
defineComponent
({
props
:
{
isOpenNewArtistDialog
:
{
type
:
Boolean
,
required
:
true
,
},
artistCode
:
{
type
:
String
,
required
:
true
},
fullName
:
{
type
:
String
,
required
:
true
},
artistName
:
{
type
:
String
,
required
:
true
},
birthday
:
{
type
:
String
,
required
:
true
},
sex
:
{
type
:
Number
,
required
:
true
},
nationality
:
{
type
:
String
,
required
:
true
},
status
:
{
type
:
Number
,
required
:
true
},
address
:
{
type
:
String
,
required
:
true
},
field
:
{
type
:
String
,
required
:
true
},
work
:
{
type
:
String
,
required
:
true
},
qualification
:
{
type
:
String
,
required
:
true
},
artistLevel
:
{
type
:
String
,
required
:
true
},
phoneNumber
:
{
type
:
String
,
required
:
true
},
email
:
{
type
:
String
,
required
:
true
},
facebook
:
{
type
:
String
,
required
:
true
},
facebookMessage
:
{
type
:
String
,
required
:
true
},
instagram
:
{
type
:
String
,
required
:
true
},
whatsapp
:
{
type
:
String
,
required
:
true
},
},
setup
()
{
const
userNameRules
=
[
(
val
?:
string
)
=>
(
val
&&
val
.
trim
().
length
)
||
i18n
.
global
.
t
(
'customer.validateMessages.requireUserName'
),
];
const
customerNameRules
=
[
(
val
?:
string
)
=>
(
val
&&
val
.
trim
().
length
)
||
i18n
.
global
.
t
(
'customer.validateMessages.requireCustomerName'
),
];
const
businessNameRules
=
[
(
val
?:
string
)
=>
(
val
&&
val
.
trim
().
length
)
||
i18n
.
global
.
t
(
'customer.validateMessages.requireBusinessName'
),
];
const
taxCodeRules
=
[
(
val
?:
number
)
=>
val
!==
undefined
||
i18n
.
global
.
t
(
'customer.validateMessages.requireTaxCode'
),
];
const
phoneRules
=
[
(
val
?:
string
)
=>
(
val
&&
val
.
trim
().
length
)
||
i18n
.
global
.
t
(
'customer.validateMessages.requirePhone'
),
(
val
:
string
)
=>
isMobilePhone
(
val
)
||
i18n
.
global
.
t
(
'customer.validateMessages.isPhone'
),
];
const
emailRules
=
[
(
val
?:
string
)
=>
(
val
&&
val
.
trim
().
length
)
||
i18n
.
global
.
t
(
'customer.validateMessages.requireEmail'
),
(
val
:
string
)
=>
isEmail
(
val
)
||
i18n
.
global
.
t
(
'customer.validateMessages.isEmail'
),
];
const
addressRules
=
[
(
val
?:
string
)
=>
(
val
&&
val
.
trim
().
length
)
||
i18n
.
global
.
t
(
'customer.validateMessages.requireAddress'
),
];
const
businessTypeRules
=
[
(
val
?:
number
)
=>
val
!==
undefined
||
i18n
.
global
.
t
(
'customer.validateMessages.requireBusinessType'
),
];
const
ratingsRules
=
[
(
val
?:
number
)
=>
val
!==
undefined
||
i18n
.
global
.
t
(
'customer.validateMessages.requireRatings'
),
];
const
representativeRules
=
[
(
val
?:
string
)
=>
(
val
&&
val
.
trim
().
length
)
||
i18n
.
global
.
t
(
'customer.validateMessages.requireRepresentative'
),
];
const
positionRules
=
[
(
val
?:
string
)
=>
(
val
&&
val
.
trim
().
length
)
||
i18n
.
global
.
t
(
'customer.validateMessages.requiredPosition'
),
];
return
{
userNameRules
,
customerNameRules
,
businessNameRules
,
taxCodeRules
,
emailRules
,
ratingsRules
,
addressRules
,
businessTypeRules
,
representativeRules
,
positionRules
,
phoneRules
,
};
},
emits
:
[
'update:isOpenNewArtistDialog'
,
'click:CloseBtn'
,
'update:userName'
,
'update:customerName'
,
'update:businessName'
,
'update:taxCode'
,
'update:email'
,
'update:ratings'
,
'update:address'
,
'update:businessType'
,
'update:representative'
,
'update:position'
,
'update:phone'
,
'update:status'
,
'addNewCustomer'
,
],
});
src/components/artist-information/add-new-artist-dialog/index.vue
0 → 100644
View file @
a4742087
<
template
>
<q-dialog
persistent
:model-value=
"isOpenNewArtistDialog"
@
update:model-value=
"$emit('update:isOpenNewArtistDialog', $event)"
>
<q-card
style=
"min-width: 900px"
bordered
>
<q-form
greedy
@
submit
.
prevent=
"$emit('addNewCustomer')"
>
<q-card-section>
<q-item>
<q-item-section>
<q-item-label
class=
"text-h6 text-weight-regular"
>
{{
$t
(
'artist.dialogLabel.title.addArtist'
)
}}
</q-item-label>
</q-item-section>
</q-item>
</q-card-section>
<q-separator
/>
<q-card-section>
<div
class=
"row q-col-gutter-sm"
>
<div
class=
"col-6"
>
<q-input
:model-value=
"artistCode"
@
update:model-value=
"$emit('update:businessName', $event)"
:label=
"
$t('artist.artistInformation.titleDataField.artistCode')
"
type=
"text"
class=
"q-my-sm"
outlined
:rules=
"businessNameRules"
hide-bottom-space
clearable
></q-input>
<q-input
:model-value=
"fullName"
@
update:model-value=
"$emit('update:userName', $event)"
:label=
"$t('artist.artistInformation.titleDataField.fullName')"
:rules=
"userNameRules"
hide-bottom-space
type=
"text"
class=
"q-my-sm"
outlined
clearable
></q-input>
<q-input
:model-value=
"artistName"
@
update:model-value=
"$emit('update:customerName', $event)"
:label=
"
$t('artist.artistInformation.titleDataField.artistName')
"
type=
"text"
class=
"q-my-sm"
outlined
:rules=
"customerNameRules"
hide-bottom-space
clearable
></q-input>
<q-input
:model-value=
"birthday"
@
update:model-value=
"$emit('update:customerName', $event)"
:label=
"$t('artist.artistInformation.titleDataField.birthday')"
type=
"text"
class=
"q-my-sm"
outlined
:rules=
"customerNameRules"
hide-bottom-space
clearable
></q-input>
<q-input
:model-value=
"email"
@
update:model-value=
"$emit('update:customerName', $event)"
:label=
"$t('artist.artistInformation.titleDataField.email')"
type=
"text"
class=
"q-my-sm"
outlined
:rules=
"customerNameRules"
hide-bottom-space
clearable
></q-input>
<q-input
:model-value=
"facebook"
@
update:model-value=
"$emit('update:customerName', $event)"
:label=
"$t('artist.artistInformation.titleDataField.facebook')"
type=
"text"
class=
"q-my-sm"
outlined
:rules=
"customerNameRules"
hide-bottom-space
clearable
></q-input>
<q-input
:model-value=
"facebookMessage"
@
update:model-value=
"$emit('update:customerName', $event)"
:label=
"
$t('artist.artistInformation.titleDataField.facebookMessage')
"
type=
"text"
class=
"q-my-sm"
outlined
:rules=
"customerNameRules"
hide-bottom-space
clearable
></q-input>
<q-input
:model-value=
"instagram"
@
update:model-value=
"$emit('update:customerName', $event)"
:label=
"$t('artist.artistInformation.titleDataField.instagram')"
type=
"text"
class=
"q-my-sm"
outlined
:rules=
"customerNameRules"
hide-bottom-space
clearable
></q-input>
<q-input
:model-value=
"whatsapp"
@
update:model-value=
"$emit('update:customerName', $event)"
:label=
"$t('artist.artistInformation.titleDataField.whatsapp')"
type=
"text"
class=
"q-my-sm"
outlined
:rules=
"customerNameRules"
hide-bottom-space
clearable
></q-input>
</div>
<div
class=
"col-6"
>
<q-input
:model-value=
"address"
@
update:model-value=
"$emit('update:customerName', $event)"
:label=
"$t('artist.artistInformation.titleDataField.address')"
type=
"text"
class=
"q-my-sm"
outlined
:rules=
"customerNameRules"
hide-bottom-space
clearable
></q-input>
<q-input
:model-value=
"phoneNumber"
@
update:model-value=
"$emit('update:customerName', $event)"
:label=
"
$t('artist.artistInformation.titleDataField.phoneNumber')
"
type=
"text"
class=
"q-my-sm"
outlined
:rules=
"customerNameRules"
hide-bottom-space
clearable
></q-input>
<q-select
:model-value=
"sex"
@
update:model-value=
"$emit('update:businessType', $event)"
:label=
"$t('artist.artistInformation.titleDataField.sex')"
:rules=
"businessTypeRules"
emit-value
map-options
option-value=
"id"
option-label=
"text"
type=
"text"
class=
"q-my-sm"
outlined
hide-bottom-space
clearable
></q-select>
<q-select
:model-value=
"nationality"
@
update:model-value=
"$emit('update:businessType', $event)"
:label=
"
$t('artist.artistInformation.titleDataField.nationality')
"
:rules=
"businessTypeRules"
emit-value
map-options
option-value=
"id"
option-label=
"text"
type=
"text"
class=
"q-my-sm"
outlined
hide-bottom-space
clearable
></q-select>
<q-select
:model-value=
"field"
@
update:model-value=
"$emit('update:businessType', $event)"
:label=
"$t('artist.artistInformation.titleDataField.field')"
:rules=
"businessTypeRules"
emit-value
map-options
option-value=
"id"
option-label=
"text"
type=
"text"
class=
"q-my-sm"
outlined
hide-bottom-space
clearable
></q-select>
<q-select
:model-value=
"work"
@
update:model-value=
"$emit('update:businessType', $event)"
:label=
"$t('artist.artistInformation.titleDataField.work')"
:rules=
"businessTypeRules"
emit-value
map-options
option-value=
"id"
option-label=
"text"
type=
"text"
class=
"q-my-sm"
outlined
hide-bottom-space
clearable
></q-select>
<q-select
:model-value=
"qualification"
@
update:model-value=
"$emit('update:businessType', $event)"
:label=
"
$t('artist.artistInformation.titleDataField.qualification')
"
:rules=
"businessTypeRules"
emit-value
map-options
option-value=
"id"
option-label=
"text"
type=
"text"
class=
"q-my-sm"
outlined
hide-bottom-space
clearable
></q-select>
<q-select
:model-value=
"artistLevel"
@
update:model-value=
"$emit('update:businessType', $event)"
:label=
"
$t('artist.artistInformation.titleDataField.artistLevel')
"
:rules=
"businessTypeRules"
emit-value
map-options
option-value=
"id"
option-label=
"text"
type=
"text"
class=
"q-my-sm"
outlined
hide-bottom-space
clearable
></q-select>
<div
style=
"padding-top: 13px; padding-left: 12px"
>
<span
class=
"text-body1"
>
{{
$t
(
'artist.artistInformation.titleDataField.status'
)
}}
</span
><q-toggle
:model-value=
"status"
@
update:model-value=
"$emit('update:status', $event)"
/>
</div>
</div>
</div>
</q-card-section>
<q-card-actions
align=
"right"
>
<q-btn
color=
"grey"
no-caps
style=
"width: 90px"
:label=
"$t('customer.crudActions.cancel')"
@
click=
"$emit('click:CloseBtn')"
/>
<q-btn
type=
"submit"
color=
"primary"
no-caps
style=
"width: 90px"
:label=
"$t('customer.crudActions.save')"
/>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</
template
>
<
script
lang=
"ts"
src=
"./NewArtistDialog.ts"
></
script
>
src/i18n/vi/index.ts
View file @
a4742087
...
@@ -235,6 +235,12 @@ export default {
...
@@ -235,6 +235,12 @@ export default {
artistLevel
:
'Xếp hạng'
,
artistLevel
:
'Xếp hạng'
,
action
:
'Chức năng'
,
action
:
'Chức năng'
,
},
},
dialogLabel
:
{
title
:
{
addArtist
:
'Thêm mới nghệ sỹ'
,
updateArtist
:
'Cập nhật nghệ sỹ'
,
},
},
artistInformation
:
{
artistInformation
:
{
tabLabel
:
{
tabLabel
:
{
personalInformation
:
'Thông tin cá nhân'
,
personalInformation
:
'Thông tin cá nhân'
,
...
...
src/layouts/MainLayout.vue
View file @
a4742087
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
fit=
"contain"
fit=
"contain"
:ratio=
"16 / 9"
:ratio=
"16 / 9"
/></q-toolbar-title>
/></q-toolbar-title>
<q-btn
flat
round
dense
icon=
"mdi-account-circle-outline"
/>
</q-toolbar>
</q-toolbar>
</q-header>
</q-header>
...
...
src/pages/Index.vue
View file @
a4742087
<
template
>
<
template
>
<q-page
class=
"row items-center justify-evenly"
>
<q-page
class=
"row items-center justify-evenly"
>
<example-component
<q-btn
color=
"primary"
@
click=
"$store.dispatch('authentication/logOut')"
title=
"Example component"
>
Logout
</q-btn
active
:todos=
"todos"
:meta=
"meta"
>
>
</example-component>
<q-btn
@
click=
"$store.dispatch('authentication/logOut')"
>
Logout
</q-btn>
</q-page>
</q-page>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Todo
,
Meta
}
from
'../components/models'
;
import
{
Todo
,
Meta
}
from
'../components/models'
;
import
ExampleComponent
from
'../components/CompositionComponent.vue'
;
import
{
defineComponent
,
ref
}
from
'vue'
;
import
{
defineComponent
,
ref
}
from
'vue'
;
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'PageIndex'
,
name
:
'PageIndex'
,
components
:
{
ExampleComponent
},
setup
()
{
setup
()
{
const
todos
=
ref
<
Todo
[]
>
([
const
todos
=
ref
<
Todo
[]
>
([
{
{
...
...
src/pages/cap-nhat-thong-tin-nghe-sy/updateInformationArtist.ts
View file @
a4742087
// import { route } from 'quasar/wrappers';
// import { route } from 'quasar/wrappers';
import
{
api
}
from
'src/boot/axios'
;
//
import { api } from 'src/boot/axios';
import
router
from
'src/router'
;
//
import router from 'src/router';
import
routes
from
'src/router/routes'
;
//
import routes from 'src/router/routes';
// import router from 'src/router';
// import router from 'src/router';
import
{
defineComponent
,
onMounted
,
Ref
,
ref
}
from
'vue'
;
import
{
defineComponent
,
onMounted
,
Ref
,
ref
}
from
'vue'
;
import
PersonalInformation
from
'../../components/artist-information/personal-information/index.vue'
;
import
PersonalInformation
from
'../../components/artist-information/personal-information/index.vue'
;
import
VabAccount
from
'../../components/artist-information/VAB-account/index.vue'
;
import
VabAccount
from
'../../components/artist-information/VAB-account/index.vue'
;
import
BankAccount
from
'../../components/artist-information/bank-account/index.vue'
;
import
BankAccount
from
'../../components/artist-information/bank-account/index.vue'
;
import
HotProduct
from
'../../components/artist-information/hot-product/index.vue'
;
import
HotProduct
from
'../../components/artist-information/hot-product/index.vue'
;
import
{
useRoute
}
from
'vue-router'
;
//
import { useRoute } from 'vue-router';
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
components
:
{
...
...
src/pages/khach-hang/customer.ts
View file @
a4742087
...
@@ -220,7 +220,7 @@ export default defineComponent({
...
@@ -220,7 +220,7 @@ export default defineComponent({
try
{
try
{
}
catch
(
error
)
{}
}
catch
(
error
)
{}
};
};
const
getDetailCustomer
=
(
id
:
number
)
=>
{
const
getDetailCustomer
=
()
=>
{
// gọi api chi tiết cần có id để lấy value cho từng customer
// gọi api chi tiết cần có id để lấy value cho từng customer
// const response = (await api({
// const response = (await api({
// url: ...,
// url: ...,
...
@@ -239,7 +239,7 @@ export default defineComponent({
...
@@ -239,7 +239,7 @@ export default defineComponent({
const
openUpdateCustomerDialog
=
(
id
:
number
)
=>
{
const
openUpdateCustomerDialog
=
(
id
:
number
)
=>
{
showDialogUpdate
.
value
=
true
;
showDialogUpdate
.
value
=
true
;
console
.
log
(
id
,
'iddd'
);
console
.
log
(
id
,
'iddd'
);
void
getDetailCustomer
(
id
);
void
getDetailCustomer
();
};
};
//Bấm nút lưu ở dialog update thì gọi api cập nhật trong hàm updateCustomer
//Bấm nút lưu ở dialog update thì gọi api cập nhật trong hàm updateCustomer
...
...
src/pages/nghe-sy/artist.ts
View file @
a4742087
import
{
i18n
}
from
'src/boot/i18n'
;
import
{
i18n
}
from
'src/boot/i18n'
;
import
{
defineComponent
,
onMounted
,
ref
,
Ref
}
from
'vue'
;
import
{
defineComponent
,
onMounted
,
ref
,
Ref
}
from
'vue'
;
import
{
PaginationResponse
,
ArtistInfoType
}
from
'src/assets/type'
;
import
{
PaginationResponse
,
ArtistInfoType
,
FieldType
,
NationalityType
,
ArtistLevelType
,
QualificationType
,
WorkType
,
}
from
'src/assets/type'
;
import
Pagination
from
'components/pagination/index.vue'
;
import
Pagination
from
'components/pagination/index.vue'
;
import
AddNewArtistDialog
from
'components/artist-information/add-new-artist-dialog/index.vue'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
API_PATHS
,
config
}
from
'src/assets/configurations'
;
import
{
API_PATHS
,
config
}
from
'src/assets/configurations'
;
import
{
AxiosResponse
}
from
'axios'
;
import
{
AxiosResponse
}
from
'axios'
;
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
components
:
{
Pagination
,
Pagination
,
AddNewArtistDialog
,
},
},
setup
()
{
setup
()
{
const
dataTest
=
ref
([]);
const
userTableColumnsArtist
=
[
const
userTableColumnsArtist
=
[
{
{
required
:
true
,
required
:
true
,
...
@@ -105,10 +114,7 @@ export default defineComponent({
...
@@ -105,10 +114,7 @@ export default defineComponent({
const
pageSize
=
ref
(
20
);
const
pageSize
=
ref
(
20
);
const
totalPage
=
ref
(
10
);
const
totalPage
=
ref
(
10
);
const
fullNameKeyword
=
ref
(
''
);
const
fullNameKeyword
=
ref
(
''
);
const
fieldOptions
=
ref
([
const
fieldOptions
:
Ref
<
FieldType
[]
>
=
ref
([]);
{
id
:
1
,
text
:
'Thể thao'
},
{
id
:
2
,
text
:
'Âm nhạc'
},
]);
const
fieldSelected
:
Ref
<
number
|
undefined
>
=
ref
();
const
fieldSelected
:
Ref
<
number
|
undefined
>
=
ref
();
const
professionOptions
=
ref
([
const
professionOptions
=
ref
([
{
id
:
1
,
text
:
'Chuyên nghiệp'
},
{
id
:
1
,
text
:
'Chuyên nghiệp'
},
...
@@ -121,6 +127,27 @@ export default defineComponent({
...
@@ -121,6 +127,27 @@ export default defineComponent({
]);
]);
const
artistLevelSelected
:
Ref
<
number
|
undefined
>
=
ref
();
const
artistLevelSelected
:
Ref
<
number
|
undefined
>
=
ref
();
const
isOpenNewArtistDialog
=
ref
(
false
);
const
id
:
Ref
<
number
>
=
ref
(
0
);
const
artistCode
:
Ref
<
string
>
=
ref
(
''
);
const
fullName
:
Ref
<
string
>
=
ref
(
''
);
const
artistName
:
Ref
<
string
|
undefined
>
=
ref
();
const
birthday
:
Ref
<
string
|
undefined
>
=
ref
();
const
sex
:
Ref
<
number
|
undefined
>
=
ref
();
const
nationality
:
Ref
<
string
|
undefined
>
=
ref
();
const
address
:
Ref
<
string
|
undefined
>
=
ref
();
const
status
:
Ref
<
number
>
=
ref
(
1
);
const
field
:
Ref
<
string
|
undefined
>
=
ref
();
const
work
:
Ref
<
string
|
undefined
>
=
ref
();
const
qualification
:
Ref
<
string
|
undefined
>
=
ref
();
const
artistLevel
:
Ref
<
string
|
undefined
>
=
ref
();
const
phoneNumber
:
Ref
<
string
|
undefined
>
=
ref
();
const
email
:
Ref
<
string
|
undefined
>
=
ref
();
const
facebook
:
Ref
<
string
|
undefined
>
=
ref
();
const
facebookMessage
:
Ref
<
string
|
undefined
>
=
ref
();
const
instagram
:
Ref
<
string
|
undefined
>
=
ref
();
const
whatsapp
:
Ref
<
string
|
undefined
>
=
ref
();
const
getListArtists
=
async
()
=>
{
const
getListArtists
=
async
()
=>
{
try
{
try
{
const
response
=
(
await
api
({
const
response
=
(
await
api
({
...
@@ -156,8 +183,30 @@ export default defineComponent({
...
@@ -156,8 +183,30 @@ export default defineComponent({
pageIndex
.
value
=
1
;
pageIndex
.
value
=
1
;
void
getListArtists
();
void
getListArtists
();
};
};
const
getFieldOptions
=
async
()
=>
{
const
response
=
(
await
api
({
url
:
API_PATHS
.
getFieldOptions
,
method
:
'GET'
,
params
:
{},
}))
as
AxiosResponse
<
BaseResponseBody
<
FieldType
[]
>>
;
if
(
response
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
fieldOptions
.
value
=
response
.
data
.
data
;
}
};
// const getNationalityOptions = async () => {
// const response = (await api({
// url: API_PATHS.getFieldOptions,
// method: 'GET',
// params: {},
// })) as AxiosResponse<BaseResponseBody<NationalityType[]>>;
// if (response.data.error.code === config.API_RES_CODE.OK.code) {
// fieldOptions.value = response.data.data;
// }
// };
onMounted
(()
=>
{
onMounted
(()
=>
{
void
getListArtists
();
void
getListArtists
();
void
getFieldOptions
();
});
});
return
{
return
{
userTableColumnsArtist
,
userTableColumnsArtist
,
...
@@ -165,8 +214,27 @@ export default defineComponent({
...
@@ -165,8 +214,27 @@ export default defineComponent({
getListArtists
,
getListArtists
,
pageIndex
,
pageIndex
,
pageSize
,
pageSize
,
isOpenNewArtistDialog
,
id
,
artistCode
,
fullName
,
artistName
,
birthday
,
sex
,
nationality
,
address
,
status
,
field
,
work
,
qualification
,
artistLevel
,
phoneNumber
,
email
,
facebook
,
facebookMessage
,
instagram
,
whatsapp
,
filterListArtist
,
filterListArtist
,
dataTest
,
totalPage
,
totalPage
,
changePageSize
,
changePageSize
,
fullNameKeyword
,
fullNameKeyword
,
...
@@ -176,6 +244,7 @@ export default defineComponent({
...
@@ -176,6 +244,7 @@ export default defineComponent({
professionOptions
,
professionOptions
,
artistLevelSelected
,
artistLevelSelected
,
artistLevelOptions
,
artistLevelOptions
,
getFieldOptions
,
};
};
},
},
});
});
src/pages/nghe-sy/index.vue
View file @
a4742087
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<q-select
<q-select
v-model=
"fieldSelected"
v-model=
"fieldSelected"
:options=
"fieldOptions"
:options=
"fieldOptions"
option-label=
"
text
"
option-label=
"
name
"
option-value=
"id"
option-value=
"id"
label=
"Lĩnh vực"
label=
"Lĩnh vực"
dense
dense
...
@@ -52,7 +52,12 @@
...
@@ -52,7 +52,12 @@
</q-btn>
</q-btn>
</div>
</div>
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
<q-btn
color=
"primary"
no-caps
:label=
"$t('crudActions.add')"
></q-btn>
<q-btn
color=
"primary"
no-caps
:label=
"$t('crudActions.add')"
@
click=
"isOpenNewArtistDialog = true"
></q-btn>
</div>
</div>
<div
class=
"col-12 q-mt-sm"
>
<div
class=
"col-12 q-mt-sm"
>
...
@@ -94,6 +99,10 @@
...
@@ -94,6 +99,10 @@
@
update:currentPage=
"getListArtists"
@
update:currentPage=
"getListArtists"
/>
/>
</div>
</div>
<AddNewArtistDialog
v-model:is-open-new-artist-dialog=
"isOpenNewArtistDialog"
@
click:CloseBtn=
"isOpenNewArtistDialog = false"
></AddNewArtistDialog>
</div>
</div>
</div>
</div>
</template>
</template>
...
...
src/pages/nguoi-dung/User.ts
View file @
a4742087
...
@@ -205,9 +205,7 @@ export default defineComponent({
...
@@ -205,9 +205,7 @@ export default defineComponent({
}
catch
(
error
)
{}
}
catch
(
error
)
{}
};
};
const
confirmDeleteUser
=
(
item
:
any
)
=>
{
const
confirmDeleteUser
=
(
userId
:
number
)
=>
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
Dialog
.
create
({
Dialog
.
create
({
title
:
i18n
.
global
.
t
(
title
:
i18n
.
global
.
t
(
'userPage.confirmActionsTitle.confirmDeleteUserTitle'
'userPage.confirmActionsTitle.confirmDeleteUserTitle'
...
@@ -220,8 +218,7 @@ export default defineComponent({
...
@@ -220,8 +218,7 @@ export default defineComponent({
),
),
color
:
'negative'
,
color
:
'negative'
,
}).
onOk
(()
=>
{
}).
onOk
(()
=>
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
void
deleteUser
(
userId
);
void
deleteUser
(
item
.
row
.
id
);
});
});
};
};
...
@@ -245,10 +242,7 @@ export default defineComponent({
...
@@ -245,10 +242,7 @@ export default defineComponent({
}
catch
(
error
)
{}
}
catch
(
error
)
{}
};
};
const
confirmResetPassword
=
(
item
:
any
)
=>
{
const
confirmResetPassword
=
(
userId
:
number
)
=>
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
console
.
log
(
item
,
'item'
);
Dialog
.
create
({
Dialog
.
create
({
title
:
i18n
.
global
.
t
(
title
:
i18n
.
global
.
t
(
'userPage.confirmActionsTitle.confirmDeleteUserTitle'
'userPage.confirmActionsTitle.confirmDeleteUserTitle'
...
@@ -261,8 +255,7 @@ export default defineComponent({
...
@@ -261,8 +255,7 @@ export default defineComponent({
),
),
color
:
'negative'
,
color
:
'negative'
,
}).
onOk
(()
=>
{
}).
onOk
(()
=>
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
void
resetPassword
(
userId
);
void
resetPassword
(
item
.
row
.
id
);
});
});
};
};
...
@@ -288,10 +281,9 @@ export default defineComponent({
...
@@ -288,10 +281,9 @@ export default defineComponent({
}
catch
(
error
)
{}
}
catch
(
error
)
{}
};
};
const
showDialogUpdateUser
=
(
item
:
any
)
=>
{
const
showDialogUpdateUser
=
(
userId
:
number
)
=>
{
showDialogUpdate
.
value
=
true
;
showDialogUpdate
.
value
=
true
;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
void
getUserDetail
(
userId
);
void
getUserDetail
(
item
.
row
.
id
);
};
};
const
getUserDetail
=
async
(
userId
:
number
)
=>
{
const
getUserDetail
=
async
(
userId
:
number
)
=>
{
...
...
src/pages/nguoi-dung/index.vue
View file @
a4742087
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
round
round
color=
"primary"
color=
"primary"
icon=
"mdi-account-edit-outline"
icon=
"mdi-account-edit-outline"
@
click=
"showDialogUpdateUser(item)"
@
click=
"showDialogUpdateUser(item
.row.id
)"
>
>
<q-tooltip
:offset=
"[20, 10]"
>
{{
<q-tooltip
:offset=
"[20, 10]"
>
{{
$t
(
'userPage.toolTipMessage.updateUserInfo'
)
$t
(
'userPage.toolTipMessage.updateUserInfo'
)
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
round
round
color=
"primary"
color=
"primary"
icon=
"mdi-account-convert-outline"
icon=
"mdi-account-convert-outline"
@
click=
"confirmResetPassword(item)"
@
click=
"confirmResetPassword(item
.row.id
)"
>
>
<q-tooltip
:offset=
"[20, 10]"
>
{{
<q-tooltip
:offset=
"[20, 10]"
>
{{
$t
(
'userPage.toolTipMessage.resetPassword'
)
$t
(
'userPage.toolTipMessage.resetPassword'
)
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
round
round
color=
"primary"
color=
"primary"
icon=
"delete"
icon=
"delete"
@
click=
"confirmDeleteUser(item)"
@
click=
"confirmDeleteUser(item
.row.id
)"
>
>
<q-tooltip
:offset=
"[20, 10]"
>
{{
<q-tooltip
:offset=
"[20, 10]"
>
{{
$t
(
'userPage.toolTipMessage.deleteUser'
)
$t
(
'userPage.toolTipMessage.deleteUser'
)
...
...
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