update

parent 49c03dc8
...@@ -20,6 +20,7 @@ export const config = { ...@@ -20,6 +20,7 @@ export const config = {
export enum API_PATHS { export enum API_PATHS {
login = '/user/login', login = '/user/login',
getUserGroups = '/group/get_list', getUserGroups = '/group/get_list',
getListPages = '/user/page/list', getListPages = '/user/page/list',
getListGroupUsers = '/user/group/list', getListGroupUsers = '/user/group/list',
...@@ -38,6 +39,7 @@ export enum API_PATHS { ...@@ -38,6 +39,7 @@ export enum API_PATHS {
getFieldOptions = '/field', getFieldOptions = '/field',
getNationalityOptions = '/nationality', getNationalityOptions = '/nationality',
getProvinceOptions = '/common/province', getProvinceOptions = '/common/province',
getMusicTypeOptions= '/common/musicType',
getArtistLevelOptions = '/artistLevel', getArtistLevelOptions = '/artistLevel',
getQualificationOptions = '/qualification', getQualificationOptions = '/qualification',
getWorkOptions = '/work', getWorkOptions = '/work',
......
import { type } from "os";
export type PaginationResponse<DataType> = { export type PaginationResponse<DataType> = {
pageIndex: null | number; pageIndex: null | number;
pageSize: null | number; pageSize: null | number;
...@@ -76,11 +78,19 @@ export type ArtistInfoType = { ...@@ -76,11 +78,19 @@ export type ArtistInfoType = {
favoriteScore: number; favoriteScore: number;
}; };
export type ProvinceType = { export type ProvinceType = {
nam: string, name: string,
fullname: string, fullname: string,
code: string, code: string,
level: string, level: string,
}; };
export type MusicType = {
id:number,
name: string,
status: number,
code: string,
numIndex: number,
};
export type FieldType = { export type FieldType = {
id: number; id: number;
name: string; name: string;
......
...@@ -23,8 +23,9 @@ export default defineComponent({ ...@@ -23,8 +23,9 @@ export default defineComponent({
sex: { type: Number, required: true }, sex: { type: Number, required: true },
nationality: { type: Object as PropType<NationalityType>, required: true }, nationality: { type: Object as PropType<NationalityType>, required: true },
status: { type: Number, required: true }, status: { type: Number, required: true },
address: { type: String, required: true }, address: { type: String ,required: true },
fields: { type: Object as PropType<FieldType>, required: true }, fields: { type: Object as PropType<FieldType>, required: true },
musics: {type: String, required: true },
works: { type: Number, required: true }, works: { type: Number, required: true },
qualification: { type: Number, required: true }, qualification: { type: Number, required: true },
artistLevel: { type: Number, required: true }, artistLevel: { type: Number, required: true },
...@@ -43,6 +44,7 @@ export default defineComponent({ ...@@ -43,6 +44,7 @@ export default defineComponent({
professionOptions: { type: Array, required: true }, professionOptions: { type: Array, required: true },
artistLevelOptions: { type: Array, required: true }, artistLevelOptions: { type: Array, required: true },
workOptions: { type: Array, required: true }, workOptions: { type: Array, required: true },
musicOptions: { type:Array, required: true},
favoriteScore: { type: Number, required: true }, favoriteScore: { type: Number, required: true },
artistCodeRules: { type: Boolean, required: true }, artistCodeRules: { type: Boolean, required: true },
fullNameRules: { type: Boolean, required: true }, fullNameRules: { type: Boolean, required: true },
...@@ -56,6 +58,7 @@ export default defineComponent({ ...@@ -56,6 +58,7 @@ export default defineComponent({
sexRules: { type: Boolean, required: true }, sexRules: { type: Boolean, required: true },
nationalityRules: { type: Boolean, required: true }, nationalityRules: { type: Boolean, required: true },
fieldRules: { type: Boolean, required: true }, fieldRules: { type: Boolean, required: true },
musicsRules: { type: Boolean, required: true },
workRules: { type: Boolean, required: true }, workRules: { type: Boolean, required: true },
qualificationRules: { type: Boolean, required: true }, qualificationRules: { type: Boolean, required: true },
artistLevelRules: { type: Boolean, required: true }, artistLevelRules: { type: Boolean, required: true },
...@@ -207,6 +210,7 @@ export default defineComponent({ ...@@ -207,6 +210,7 @@ export default defineComponent({
'update:mnFbmess', 'update:mnFbmess',
'update:mnIns', 'update:mnIns',
'update:mnWhatsapp', 'update:mnWhatsapp',
'update:musics',
'addNewArtist', 'addNewArtist',
'SetAvatar', 'SetAvatar',
'deleteAvatar', 'deleteAvatar',
......
...@@ -282,16 +282,21 @@ ...@@ -282,16 +282,21 @@
{{ $t('artist.artistInformation.titleDataField.type') }} {{ $t('artist.artistInformation.titleDataField.type') }}
<span style="color: red">*</span> <span style="color: red">*</span>
</div> </div>
<!-- :model-value="types"
@update:model-value="$emit('update:types', $event)" <!-- :error="musicsRules"
:error="typeRules" :error-message="errorMessTypes" -->
:error-message="errorMessTypes"
:options="typeOptions" -->
<div class="col-8"> <div class="col-8">
<q-select <q-select
:model-value="musics"
@update:model-value="$emit('update:musics', $event)"
:options="musicOptions"
multiple
map-options map-options
option-value="id" option-value="id"
option-label="name" option-label="name"
type="text"
class="q-my-sm" class="q-my-sm"
outlined outlined
hide-bottom-space hide-bottom-space
......
...@@ -35,18 +35,18 @@ ...@@ -35,18 +35,18 @@
clearable clearable
></q-select> ></q-select>
</div> </div>
<!-- <div class="col-2" dense outlined> <div class="col-2" dense outlined>
<q-select <q-select
v-model="artistLevelSelected" v-model="provinceSelected"
:options="artistLevelOptions" :options="provinceOptions"
option-label="name" option-label="fullName"
option-value="id" option-value="name"
dense dense
outlined outlined
label="Xếp hạng" label="Địa chỉ"
clearable clearable
></q-select> ></q-select>
</div> --> </div>
<div class="col-auto"> <div class="col-auto">
<q-btn <q-btn
color="primary" color="primary"
...@@ -191,6 +191,8 @@ import { ...@@ -191,6 +191,8 @@ import {
ArtistLevelType, ArtistLevelType,
QualificationType, QualificationType,
WorkType, WorkType,
ProvinceType,
MusicType
} from 'src/assets/type'; } from 'src/assets/type';
import Pagination from 'components/pagination/index.vue'; import Pagination from 'components/pagination/index.vue';
...@@ -319,10 +321,13 @@ export default defineComponent({ ...@@ -319,10 +321,13 @@ export default defineComponent({
const nationalityOptions: Ref<NationalityType[]> = ref([]); const nationalityOptions: Ref<NationalityType[]> = ref([]);
const professionOptions: Ref<QualificationType[]> = ref([]); const professionOptions: Ref<QualificationType[]> = ref([]);
const artistLevelOptions: Ref<ArtistLevelType[]> = ref([]); const artistLevelOptions: Ref<ArtistLevelType[]> = ref([]);
const provinceOptions: Ref<ProvinceType[]> = ref([]);
const musicOptions: Ref<MusicType[]> = ref([]);
const workOptions: Ref<WorkType[]> = ref([]); const workOptions: Ref<WorkType[]> = ref([]);
const fieldSelected: Ref<FieldType | null> = ref(null); const fieldSelected: Ref<FieldType | null> = ref(null);
const professionSelected: Ref<QualificationType | null> = ref(null); const professionSelected: Ref<QualificationType | null> = ref(null);
const artistLevelSelected: Ref<ArtistLevelType | null> = ref(null); const artistLevelSelected: Ref<ArtistLevelType | null> = ref(null);
const provinceSelected: Ref<ProvinceType | null> = ref(null);
const isOpenNewArtistDialog = ref(false); const isOpenNewArtistDialog = ref(false);
const id: Ref<number> = ref(0); const id: Ref<number> = ref(0);
const artistCode: Ref<string> = ref(''); const artistCode: Ref<string> = ref('');
...@@ -364,7 +369,7 @@ export default defineComponent({ ...@@ -364,7 +369,7 @@ export default defineComponent({
name: fullNameKeyword.value, name: fullNameKeyword.value,
field: fieldSelected.value?.id, field: fieldSelected.value?.id,
qualification: professionSelected.value?.id, qualification: professionSelected.value?.id,
artistLevel: artistLevelSelected.value?.id, address: provinceSelected.value?.name
}, },
})) as AxiosResponse< })) as AxiosResponse<
BaseResponseBody<PaginationResponse<ArtistInfoType>> BaseResponseBody<PaginationResponse<ArtistInfoType>>
...@@ -400,7 +405,8 @@ export default defineComponent({ ...@@ -400,7 +405,8 @@ export default defineComponent({
} }
}; };
/// xếp hạng
const getArtistLevelOptions = async () => { const getArtistLevelOptions = async () => {
const response = (await api({ const response = (await api({
url: API_PATHS.getArtistLevelOptions, url: API_PATHS.getArtistLevelOptions,
...@@ -411,6 +417,34 @@ export default defineComponent({ ...@@ -411,6 +417,34 @@ export default defineComponent({
artistLevelOptions.value = response.data.data; artistLevelOptions.value = response.data.data;
} }
}; };
// thể loại
const getMusicTypeOptions = async () => {
const response = (await api ({
url: API_PATHS.getMusicTypeOptions,
method: 'GET',
params: {},
})) as AxiosResponse<BaseResponseBody<MusicType[]>>;
if(response.data.error.code === config.API_RES_CODE.OK.code) {
musicOptions.value = response.data.data
}
};
const getProvinceOptions = async () => {
const response = (await api ({
url : API_PATHS.getProvinceOptions,
method: 'GET',
params: {},
})) as AxiosResponse<BaseResponseBody<ProvinceType[]>>;
if(response.data.error.code === config.API_RES_CODE.OK.code){
provinceOptions.value = response.data.data
}
}
const getQualificationOptions = async () => { const getQualificationOptions = async () => {
const response = (await api({ const response = (await api({
url: API_PATHS.getQualificationOptions, url: API_PATHS.getQualificationOptions,
...@@ -475,6 +509,8 @@ export default defineComponent({ ...@@ -475,6 +509,8 @@ export default defineComponent({
void getArtistLevelOptions(); void getArtistLevelOptions();
void getQualificationOptions(); void getQualificationOptions();
void getWorkOptions(); void getWorkOptions();
void getProvinceOptions();
void getMusicTypeOptions();
}); });
return { return {
...@@ -521,11 +557,16 @@ export default defineComponent({ ...@@ -521,11 +557,16 @@ export default defineComponent({
professionSelected, professionSelected,
professionOptions, professionOptions,
artistLevelSelected, artistLevelSelected,
provinceSelected,
artistLevelOptions, artistLevelOptions,
provinceOptions,
getProvinceOptions,
getMusicTypeOptions,
getFieldOptions, getFieldOptions,
nationalityOptions, nationalityOptions,
getNationalityOptions, getNationalityOptions,
workOptions, workOptions,
musicOptions,
getArtistLevelOptions, getArtistLevelOptions,
getQualificationOptions, getQualificationOptions,
getWorkOptions, getWorkOptions,
......
...@@ -26,6 +26,7 @@ import { ...@@ -26,6 +26,7 @@ import {
ArtistLevelType, ArtistLevelType,
QualificationType, QualificationType,
WorkType, WorkType,
MusicType,
BankAccountType, BankAccountType,
ProductType, ProductType,
BannerType, BannerType,
...@@ -34,7 +35,7 @@ import { ...@@ -34,7 +35,7 @@ import {
CardBankType, CardBankType,
TypeCardType, TypeCardType,
FileUploadType, FileUploadType,
ProvinceType ProvinceType,
} from 'src/assets/type'; } from 'src/assets/type';
export type AvatarType = { export type AvatarType = {
...@@ -81,6 +82,7 @@ export default defineComponent({ ...@@ -81,6 +82,7 @@ export default defineComponent({
const cardBankOptions: Ref<CardBankType[]> = ref([]); const cardBankOptions: Ref<CardBankType[]> = ref([]);
const typeBankOptions: Ref<TypeCardType[]> = ref([]); const typeBankOptions: Ref<TypeCardType[]> = ref([]);
const workOptions: Ref<WorkType[]> = ref([]); const workOptions: Ref<WorkType[]> = ref([]);
const musicOptions: Ref<MusicType[]>= ref([]);
const provinceOptions:Ref<ProvinceType[]> = ref([]); const provinceOptions:Ref<ProvinceType[]> = ref([]);
const sexOptions = ref([ const sexOptions = ref([
{ id: 1, name: 'Nam' }, { id: 1, name: 'Nam' },
...@@ -111,9 +113,10 @@ export default defineComponent({ ...@@ -111,9 +113,10 @@ export default defineComponent({
const mnEmail: Ref<string | null> = ref(null); const mnEmail: Ref<string | null> = ref(null);
const qualification: Ref<QualificationType | null> = ref(null); const qualification: Ref<QualificationType | null> = ref(null);
const artistLevel: Ref<ArtistLevelType | null> = ref(null); const artistLevel: Ref<ArtistLevelType | null> = ref(null);
const address: Ref<string | null> = ref(null); const address: Ref<ProvinceType | null> = ref(null);
const status: Ref<number> = ref(1); const status: Ref<number> = ref(1);
const fields: Ref<FieldType | null> = ref(null); const fields: Ref<FieldType | null> = ref(null);
const musics: Ref<MusicType | null> = ref(null);
const works: Ref<WorkType[]> = ref([]); const works: Ref<WorkType[]> = ref([]);
const phoneNumber: Ref<string | null> = ref(null); const phoneNumber: Ref<string | null> = ref(null);
const email: Ref<string | null> = ref(null); const email: Ref<string | null> = ref(null);
...@@ -162,6 +165,7 @@ export default defineComponent({ ...@@ -162,6 +165,7 @@ export default defineComponent({
const nationalityRules = ref(false); const nationalityRules = ref(false);
const fieldRules = ref(false); const fieldRules = ref(false);
const workRules = ref(false); const workRules = ref(false);
const musicRules = ref(false);
const qualificationRules = ref(false); const qualificationRules = ref(false);
const artistLevelRules = ref(false); const artistLevelRules = ref(false);
const errorMessEmail = ref( const errorMessEmail = ref(
...@@ -235,7 +239,7 @@ export default defineComponent({ ...@@ -235,7 +239,7 @@ export default defineComponent({
} }
); );
watch( watch(
() => address.value, () => address,
(value) => { (value) => {
if (value) { if (value) {
addressRules.value = false; addressRules.value = false;
...@@ -298,6 +302,14 @@ export default defineComponent({ ...@@ -298,6 +302,14 @@ export default defineComponent({
} }
} }
); );
watch(
() => musics.value,
(value) => {
if(value) {
musicRules.value = false;
}
}
);
watch( watch(
() => qualification.value, () => qualification.value,
(value) => { (value) => {
...@@ -344,7 +356,6 @@ export default defineComponent({ ...@@ -344,7 +356,6 @@ export default defineComponent({
params: {}, params: {},
})) as AxiosResponse<BaseResponseBody<ProvinceType[]>>; })) as AxiosResponse<BaseResponseBody<ProvinceType[]>>;
if(response.data.error.code === config.API_RES_CODE.OK.code){ if(response.data.error.code === config.API_RES_CODE.OK.code){
provinceOptions.value = response.data.data provinceOptions.value = response.data.data
} }
} }
...@@ -381,6 +392,20 @@ export default defineComponent({ ...@@ -381,6 +392,20 @@ export default defineComponent({
workOptions.value = response.data.data; workOptions.value = response.data.data;
} }
}; };
// thể loại
const getMusicTypeOptions = async () => {
const response = (await api ({
url: API_PATHS.getMusicTypeOptions,
method: 'GET',
params: {},
})) as AxiosResponse<BaseResponseBody<MusicType[]>>;
if(response.data.error.code === config.API_RES_CODE.OK.code) {
musicOptions.value = response.data.data
}
};
const getBankOptions = async () => { const getBankOptions = async () => {
const response = (await api({ const response = (await api({
url: API_PATHS.bankOptions, url: API_PATHS.bankOptions,
...@@ -765,14 +790,15 @@ export default defineComponent({ ...@@ -765,14 +790,15 @@ export default defineComponent({
url: API_PATHS.addArtist, url: API_PATHS.addArtist,
method: 'POST', method: 'POST',
data: { data: {
musicTypeDto:musics.value ,
id: route.params.id, id: route.params.id,
avatar: avatarUploaded.value, avatar: avatarUploaded.value,
artistCode: artistCode.value, artistCode: artistCode.value,
artistName: artistName.value, artistName: artistName.value,
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
birthday: birthday.value + ' 00:00:00', birthday: birthday.value + '00:00:00',
sex: sex.value, sex: sex.value,
address: address.value, address: address.value?.name,
phoneNumber: phoneNumber.value, phoneNumber: phoneNumber.value,
email: email.value, email: email.value,
facebook: facebook.value, facebook: facebook.value,
...@@ -841,6 +867,7 @@ export default defineComponent({ ...@@ -841,6 +867,7 @@ export default defineComponent({
void getBankOptions(); void getBankOptions();
void getTypeCardOptions(); void getTypeCardOptions();
void getProvinceOptions(); void getProvinceOptions();
void getMusicTypeOptions()
}); });
return { return {
hidden_img, hidden_img,
...@@ -857,6 +884,8 @@ export default defineComponent({ ...@@ -857,6 +884,8 @@ export default defineComponent({
status, status,
fields, fields,
works, works,
musics,
qualification, qualification,
artistLevel, artistLevel,
phoneNumber, phoneNumber,
...@@ -884,6 +913,8 @@ export default defineComponent({ ...@@ -884,6 +913,8 @@ export default defineComponent({
professionOptions, professionOptions,
artistLevelOptions, artistLevelOptions,
workOptions, workOptions,
musicOptions,
getFieldOptions, getFieldOptions,
getNationalityOptions, getNationalityOptions,
getArtistLevelOptions, getArtistLevelOptions,
...@@ -947,6 +978,7 @@ export default defineComponent({ ...@@ -947,6 +978,7 @@ export default defineComponent({
nationalityRules, nationalityRules,
fieldRules, fieldRules,
workRules, workRules,
musicRules,
qualificationRules, qualificationRules,
artistLevelRules, artistLevelRules,
errorMessEmail, errorMessEmail,
...@@ -956,6 +988,7 @@ export default defineComponent({ ...@@ -956,6 +988,7 @@ export default defineComponent({
check_infoBooking, check_infoBooking,
getProvinceOptions, getProvinceOptions,
provinceOptions, provinceOptions,
getMusicTypeOptions,
}; };
}, },
}); });
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
v-model:status="status" v-model:status="status"
v-model:address="address" v-model:address="address"
v-model:fields="fields" v-model:fields="fields"
v-model:musics="musics"
v-model:works="works" v-model:works="works"
v-model:qualification="qualification" v-model:qualification="qualification"
v-model:artist-level="artistLevel" v-model:artist-level="artistLevel"
...@@ -89,6 +90,7 @@ ...@@ -89,6 +90,7 @@
:profession-options="professionOptions" :profession-options="professionOptions"
:artist-level-options="artistLevelOptions" :artist-level-options="artistLevelOptions"
:work-options="workOptions" :work-options="workOptions"
:music-options="musicOptions"
@SetAvatar="setAvatar($event)" @SetAvatar="setAvatar($event)"
@deleteAvatar="deleteAvatar" @deleteAvatar="deleteAvatar"
@UpdateBirtday="UpdateBirtday($event)" @UpdateBirtday="UpdateBirtday($event)"
......
This diff is collapsed.
...@@ -7,10 +7,12 @@ export enum Pages { ...@@ -7,10 +7,12 @@ export enum Pages {
cmsUser = 'nguoi-dung', cmsUser = 'nguoi-dung',
managingUnit = 'don-vi-chu-quan', managingUnit = 'don-vi-chu-quan',
artist = 'nghe-sy', artist = 'nghe-sy',
informationArtist = 'cap-nhat-thong-tin-nghe-sy', informationArtist = 'cap-nhat-thong-tin-nghe-sy',
customer = 'khach-hang', customer = 'khach-hang',
addArtist = 'them-nghe-sy', addArtist = 'them-nghe-sy',
customerRank = 'xep-hang-khach-hang', customerRank = 'xep-hang-khach-hang',
artistRank = 'Xep-hang-nghi-sy',
field = 'linh-vuc-hoat-dong', field = 'linh-vuc-hoat-dong',
post = 'bai-viet', post = 'bai-viet',
postCategory = 'danh-muc-bai-viet', postCategory = 'danh-muc-bai-viet',
...@@ -70,6 +72,11 @@ const routes: RouteRecordRaw[] = [ ...@@ -70,6 +72,11 @@ const routes: RouteRecordRaw[] = [
component: () => import('pages/them-nghe-sy/index.vue'), component: () => import('pages/them-nghe-sy/index.vue'),
name: Pages.addArtist, name: Pages.addArtist,
}, },
{
path: '/xep-hang-nghe-sy',
component: () => import('pages/xep-hang-nghe-sy/index.vue'),
name:Pages.artistRank
},
{ {
path: '/khach-hang', path: '/khach-hang',
component: () => import('pages/khach-hang/index.vue'), component: () => import('pages/khach-hang/index.vue'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment