update

parent fc9bde04
...@@ -7,7 +7,15 @@ export type PaginationResponse<DataType> = { ...@@ -7,7 +7,15 @@ export type PaginationResponse<DataType> = {
endIndex: number; endIndex: number;
data: DataType[]; data: DataType[];
}; };
export type FileUploadType = {
byteSize: number;
createTime: string;
fileName: string;
filePath: string;
folder: string;
id: number;
isDeleted: number;
};
export type UserObject = { export type UserObject = {
id: number; id: number;
userName: string; userName: string;
......
...@@ -76,7 +76,7 @@ export default defineComponent({ ...@@ -76,7 +76,7 @@ export default defineComponent({
]; ];
const birthdayRules = [ const birthdayRules = [
(val?: string) => (val?: string) =>
val !== undefined || (val && val.trim().length) ||
i18n.global.t( i18n.global.t(
'artist.artistInformation.validateMessages.requireBirthday' 'artist.artistInformation.validateMessages.requireBirthday'
), ),
...@@ -147,9 +147,9 @@ export default defineComponent({ ...@@ -147,9 +147,9 @@ export default defineComponent({
context.emit('deleteAvatar'); context.emit('deleteAvatar');
}; };
const selectDatePicker = (value: string) => { const selectDatePicker = (value: string) => {
context.emit('UpdateBirtday', fomatDatePicker(value)); context.emit('UpdateBirtday', formatDatePicker(value));
}; };
const fomatDatePicker = (value: string) => { const formatDatePicker = (value: string) => {
return moment(value).format('DD/MM/YYYY'); return moment(value).format('DD/MM/YYYY');
}; };
const openDialog: Ref<boolean> = ref(false); const openDialog: Ref<boolean> = ref(false);
...@@ -183,7 +183,7 @@ export default defineComponent({ ...@@ -183,7 +183,7 @@ export default defineComponent({
deleteAvatar, deleteAvatar,
BirthdayDatePicker, BirthdayDatePicker,
selectDatePicker, selectDatePicker,
fomatDatePicker, formatDatePicker,
openDialog, openDialog,
onOKClick, onOKClick,
onCancelClick, onCancelClick,
......
// app global css in SCSS form // app global css in SCSS form
.sticky-header-table {
// / height or max-height is important /
max-height: calc(100vh - 11rem);
.q-table__top,
.q-table__bottom,
thead tr:first-child th {
// / bg color is important for th; just specify one /
background-color: #c1f4cd;
}
thead tr th {
position: sticky;
z-index: 1;
}
thead tr:first-child th {
top: 0;
}
// / this is when the loading indicator appears /
&.q-table--loading thead tr:last-child th {
// / height of all previous header rows /
top: 48px;
}
}
\ No newline at end of file
...@@ -34,6 +34,7 @@ import { ...@@ -34,6 +34,7 @@ import {
SchedulesType, SchedulesType,
CardBankType, CardBankType,
TypeCardType, TypeCardType,
FileUploadType,
} from 'src/assets/type'; } from 'src/assets/type';
export type AvatarType = { export type AvatarType = {
...@@ -90,7 +91,7 @@ export default defineComponent({ ...@@ -90,7 +91,7 @@ export default defineComponent({
const artistCode: Ref<string> = ref(''); const artistCode: Ref<string> = ref('');
const fullName: Ref<string> = ref(''); const fullName: Ref<string> = ref('');
const artistName: Ref<string | null | undefined> = ref(); const artistName: Ref<string | null | undefined> = ref();
const birthday: Ref<string | null | undefined> = ref('29/04/2021'); const birthday: Ref<string | null> = ref(null);
const sex: Ref<number | undefined> = ref(); const sex: Ref<number | undefined> = ref();
const nationality: Ref<NationalityType | null> = ref(null); const nationality: Ref<NationalityType | null> = ref(null);
const qualification: Ref<QualificationType | null> = ref(null); const qualification: Ref<QualificationType | null> = ref(null);
...@@ -142,7 +143,7 @@ export default defineComponent({ ...@@ -142,7 +143,7 @@ export default defineComponent({
birthday.value = moment( birthday.value = moment(
ArtistInformation.birthday, ArtistInformation.birthday,
'DD/MM/YYYY HH:mm:ss' 'DD/MM/YYYY HH:mm:ss'
).format('YYYY-MM-DD'); ).format('DD/MM/YYYY');
address.value = ArtistInformation.address; address.value = ArtistInformation.address;
status.value = ArtistInformation.status; status.value = ArtistInformation.status;
phoneNumber.value = ArtistInformation.phoneNumber; phoneNumber.value = ArtistInformation.phoneNumber;
...@@ -342,7 +343,7 @@ export default defineComponent({ ...@@ -342,7 +343,7 @@ export default defineComponent({
DataUpdateHotProduct.value = value; DataUpdateHotProduct.value = value;
}; };
const setAvatar = (value: BannerType) => { const setAvatar = (value: BannerType) => {
console.log(value); console.log(value, 'avatarFile');
avatarFile.value = value.file as File; avatarFile.value = value.file as File;
avatar.value = value.url as string; avatar.value = value.url as string;
}; };
...@@ -397,21 +398,29 @@ export default defineComponent({ ...@@ -397,21 +398,29 @@ export default defineComponent({
stories.value.splice(idx, 1); stories.value.splice(idx, 1);
}); });
}; };
// const callApiUploadImage = async (file: File) => {
// try {
// const response = await api({
// url: API_PATHS.uploadImage,
// method: 'GET',
// params: {},
// });
// } catch (error) {}
// };
const UpdateBirtday = (value: string) => { const UpdateBirtday = (value: string) => {
// console.log(value); // console.log(value);
console.log(value, 'birthdayyyy');
birthday.value = value; birthday.value = value;
}; };
// const callApiUploadImage = async (file: File) => {
// try {
// const bodyFormData = new FormData();
// bodyFormData.append('file', file);
// const response = (await api({
// headers: { 'Content-Type': 'multipart/form-data' },
// url: 'http://cms.vab.xteldev.com/file/upload',
// method: 'POST',
// data: bodyFormData,
// })) as AxiosResponse<BaseResponseBody<FileUploadType>>;
// if (response.data.error.code === config.API_RES_CODE.OK.code) {
// }
// } catch (error) {}
// };
const updateInformationArtist = async () => { const updateInformationArtist = async () => {
try { try {
// await callApiUploadImage(avatarFile.value as File);
const response = (await api({ const response = (await api({
url: API_PATHS.updateArtist, url: API_PATHS.updateArtist,
method: 'POST', method: 'POST',
...@@ -420,7 +429,7 @@ export default defineComponent({ ...@@ -420,7 +429,7 @@ export default defineComponent({
avatar: avatar.value, avatar: avatar.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,
......
...@@ -67,7 +67,9 @@ ...@@ -67,7 +67,9 @@
:no-data-label="$t('emptyData')" :no-data-label="$t('emptyData')"
row-key="name" row-key="name"
separator="cell" separator="cell"
:pagination="{ rowsPerPage: pageSize }"
hide-pagination hide-pagination
class="sticky-header-table"
> >
<template v-slot:body-cell-STT="item"> <template v-slot:body-cell-STT="item">
<q-td style="padding: 0; height: 100%"> <q-td style="padding: 0; height: 100%">
......
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