Commit 31591ff3 authored by Tình Trương's avatar Tình Trương

update

parent 48ee2463
...@@ -5,23 +5,6 @@ import { isMobilePhone } from '../../../boot/functions'; ...@@ -5,23 +5,6 @@ import { isMobilePhone } from '../../../boot/functions';
import AddNewArtistDialog from 'components/managingunits/add-new-managingunits-dialog/add-new-artist-dialog/index.vue' import AddNewArtistDialog from 'components/managingunits/add-new-managingunits-dialog/add-new-artist-dialog/index.vue'
import UpdateNewArtistDialog from 'components/managingunits/update-new-managingunits-dialog/update-new-artist-dialog/index.vue' import UpdateNewArtistDialog from 'components/managingunits/update-new-managingunits-dialog/update-new-artist-dialog/index.vue'
export type ArtistAddInfoType = {
id: number;
nameAdd: string | null;
myedityAdd: string | null;
timeAdd: string | null;
fieldsAdd: number;
statusAdd: number;
};
export type ArtistUpdateInfoType = {
id: number;
nameUpdate: string | null;
myedityUpdate: string | null;
timeUpdate: string | null;
fieldsUpdate: number;
statusUpdate: number;
};
export default defineComponent({ export default defineComponent({
components: { components: {
AddNewArtistDialog, AddNewArtistDialog,
...@@ -98,7 +81,7 @@ export default defineComponent({ ...@@ -98,7 +81,7 @@ export default defineComponent({
i18n.global.t('managingUnit.validateMessages.requireAddress'), i18n.global.t('managingUnit.validateMessages.requireAddress'),
]; ];
const nameAdd: Ref<string | undefined> = ref() const nameAdd: Ref<number | undefined> = ref()
const myedityAdd: Ref<string | undefined> = ref() const myedityAdd: Ref<string | undefined> = ref()
const fieldsAdd: Ref<number | undefined> = ref(); const fieldsAdd: Ref<number | undefined> = ref();
const statusAdd: Ref<boolean | number> = ref(true); const statusAdd: Ref<boolean | number> = ref(true);
...@@ -106,9 +89,14 @@ export default defineComponent({ ...@@ -106,9 +89,14 @@ export default defineComponent({
const fieldsAddOptions = ref([ const fieldsAddOptions = ref([
{ id: 1, text: 'Giải trí' }, { id: 1, text: 'Giải trí' },
{ id: 2, text: 'Âm nhạc' }, { id: 2, text: 'Âm nhạc' },
{ id: 1, text: 'Thể thao' }, { id: 3, text: 'Thể thao' },
]);
const nameAddOptions = ref([
{ id: 1, text: 'Ưng Hoàng Phúc' },
{ id: 2, text: 'Nguyễn Tùng Dương' },
{ id: 3, text: 'Nguyễn Sơn Tùng' },
]); ]);
const nameUpdate: Ref<string | undefined> = ref() const nameUpdate: Ref<number | undefined> = ref()
const myedityUpdate: Ref<string | undefined> = ref() const myedityUpdate: Ref<string | undefined> = ref()
const fieldsUpdate: Ref<number | undefined> = ref(); const fieldsUpdate: Ref<number | undefined> = ref();
const statusUpdate: Ref<boolean | number> = ref(true); const statusUpdate: Ref<boolean | number> = ref(true);
...@@ -116,7 +104,12 @@ export default defineComponent({ ...@@ -116,7 +104,12 @@ export default defineComponent({
const fieldsUpdateOptions = ref([ const fieldsUpdateOptions = ref([
{ id: 1, text: 'Giải trí' }, { id: 1, text: 'Giải trí' },
{ id: 2, text: 'Âm nhạc' }, { id: 2, text: 'Âm nhạc' },
{ id: 1, text: 'Thể thao' }, { id: 3, text: 'Thể thao' },
]);
const nameUpdateOptions = ref([
{ id: 1, text: 'Ưng Hoàng Phúc' },
{ id: 2, text: 'Nguyễn Tùng Dương' },
{ id: 3, text: 'Nguyễn Sơn Tùng' },
]); ]);
return { return {
nameUpdate, nameUpdate,
...@@ -124,6 +117,7 @@ export default defineComponent({ ...@@ -124,6 +117,7 @@ export default defineComponent({
statusUpdate, statusUpdate,
fieldsUpdate, fieldsUpdate,
timeUpdate, timeUpdate,
nameUpdateOptions,
fieldsUpdateOptions, fieldsUpdateOptions,
openAddArtistDialog, openAddArtistDialog,
addNewManagingUnitsArtist, addNewManagingUnitsArtist,
...@@ -142,6 +136,7 @@ export default defineComponent({ ...@@ -142,6 +136,7 @@ export default defineComponent({
timeAdd, timeAdd,
statusAdd, statusAdd,
fieldsAddOptions, fieldsAddOptions,
nameAddOptions,
}; };
}, },
emits: [ emits: [
......
...@@ -7,6 +7,7 @@ export default defineComponent({ ...@@ -7,6 +7,7 @@ export default defineComponent({
type: Boolean, type: Boolean,
required: true, required: true,
}, },
nameAddOptions: {type: Array, required: true},
fieldsAddOptions: {type: Array, required: true}, fieldsAddOptions: {type: Array, required: true},
fieldsAdd: { type: Number, required: true}, fieldsAdd: { type: Number, required: true},
nameAdd: { type: String, required: true }, nameAdd: { type: String, required: true },
...@@ -16,8 +17,8 @@ export default defineComponent({ ...@@ -16,8 +17,8 @@ export default defineComponent({
}, },
setup() { setup() {
const nameAddRules = [ const nameAddRules = [
(val?: string) => (val?: number) =>
(val && val.trim().length) || val !== undefined ||
i18n.global.t('managingUnitAdd.validateMessages.requireNameAdd'), i18n.global.t('managingUnitAdd.validateMessages.requireNameAdd'),
]; ];
const myedityAddRules = [ const myedityAddRules = [
......
...@@ -20,27 +20,29 @@ ...@@ -20,27 +20,29 @@
<q-card-section> <q-card-section>
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-6"> <div class="col-6">
<q-input <q-select
:model-value="nameAdd" :model-value="nameAdd"
@update:model-value="$emit('update:nameAdd', $event)" @update:model-value="$emit('update:nameAdd', $event)"
:label="$t('managingUnitAdd.dialogLabel.fieldLabels.nameAdd')" :label="$t('managingUnitAdd.dialogLabel.fieldLabels.nameAdd')"
:options="nameAddOptions"
:rules="nameAddRules" :rules="nameAddRules"
hide-bottom-space hide-bottom-space
type="text" emit-value
map-options
option-value="id"
option-label="text"
class="q-my-sm" class="q-my-sm"
outlined outlined
clearable clearable
></q-input> ></q-select>
<q-input <q-input
:model-value="myedityAdd" :model-value="timeAdd"
@update:model-value="$emit('update:myedityAdd', $event)" @update:model-value="$emit('update:timeAdd', $event)"
:label=" :label="$t('managingUnitAdd.dialogLabel.fieldLabels.timeAdd')"
$t('managingUnitAdd.dialogLabel.fieldLabels.myedityAdd')
"
type="text"
class="q-my-sm" class="q-my-sm"
type="text"
outlined outlined
:rules="myedityAddRules" :rules="timeAddRules"
hide-bottom-space hide-bottom-space
clearable clearable
></q-input> ></q-input>
......
...@@ -144,6 +144,7 @@ ...@@ -144,6 +144,7 @@
v-model:time-add="timeAdd" v-model:time-add="timeAdd"
v-model:status-add="statusAdd" v-model:status-add="statusAdd"
:fields-add-options="fieldsAddOptions" :fields-add-options="fieldsAddOptions"
:name-add-options="nameAddOptions"
@click:CloseBtn="openAddArtistDialog = false" @click:CloseBtn="openAddArtistDialog = false"
@addNewManagingUnitsArtist="addNewManagingUnitsArtist" @addNewManagingUnitsArtist="addNewManagingUnitsArtist"
/> />
...@@ -156,6 +157,7 @@ ...@@ -156,6 +157,7 @@
v-model:time-update="timeUpdate" v-model:time-update="timeUpdate"
v-model:status-update="statusUpdate" v-model:status-update="statusUpdate"
:fields-update-options="fieldsUpdateOptions" :fields-update-options="fieldsUpdateOptions"
:name-update-options="nameUpdateOptions"
@click:CloseBtn="openUpdateArtistDialog = false" @click:CloseBtn="openUpdateArtistDialog = false"
@updateNewManagingUnitsArtist="updateNewManagingUnitsArtist" @updateNewManagingUnitsArtist="updateNewManagingUnitsArtist"
/> />
......
...@@ -7,6 +7,7 @@ export default defineComponent({ ...@@ -7,6 +7,7 @@ export default defineComponent({
type: Boolean, type: Boolean,
required: true, required: true,
}, },
nameUpdateOptions: {type: Array, required: true},
fieldsUpdateOptions: {type: Array, required: true}, fieldsUpdateOptions: {type: Array, required: true},
fieldsUpdate: { type: Number, required: true}, fieldsUpdate: { type: Number, required: true},
nameUpdate: { type: String, required: true }, nameUpdate: { type: String, required: true },
...@@ -16,8 +17,8 @@ export default defineComponent({ ...@@ -16,8 +17,8 @@ export default defineComponent({
}, },
setup() { setup() {
const nameUpdateRules = [ const nameUpdateRules = [
(val?: string) => (val?: number) =>
(val && val.trim().length) || val !== undefined ||
i18n.global.t('managingUnitAdd.validateMessages.requireNameUpdate'), i18n.global.t('managingUnitAdd.validateMessages.requireNameUpdate'),
]; ];
const myedityUpdateRules = [ const myedityUpdateRules = [
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<q-card-section> <q-card-section>
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-6"> <div class="col-6">
<q-input <q-select
:model-value="nameUpdate" :model-value="nameUpdate"
@update:model-value="$emit('update:nameUpdate', $event)" @update:model-value="$emit('update:nameUpdate', $event)"
:label=" :label="
...@@ -28,11 +28,15 @@ ...@@ -28,11 +28,15 @@
" "
:rules="nameUpdateRules" :rules="nameUpdateRules"
hide-bottom-space hide-bottom-space
type="text" :options="nameUpdateOptions"
emit-value
map-options
option-value="id"
option-label="text"
class="q-my-sm" class="q-my-sm"
outlined outlined
clearable clearable
></q-input> ></q-select>
<q-input <q-input
:model-value="timeUpdate" :model-value="timeUpdate"
@update:model-value="$emit('update:timeUpdate', $event)" @update:model-value="$emit('update:timeUpdate', $event)"
...@@ -66,15 +70,15 @@ ...@@ -66,15 +70,15 @@
clearable clearable
></q-select> ></q-select>
<q-input <q-input
:model-value="myedityUpdate" :model-value="timeUpdate"
@update:model-value="$emit('update:myedityUpdate', $event)" @update:model-value="$emit('update:timeUpdate', $event)"
:label=" :label="
$t('managingUnitAdd.dialogLabel.fieldLabels.myedityUpdate') $t('managingUnitAdd.dialogLabel.fieldLabels.timeUpdate')
" "
type="text"
class="q-my-sm" class="q-my-sm"
type="text"
outlined outlined
:rules="myedityUpdateRules" :rules="timeUpdateRules"
hide-bottom-space hide-bottom-space
clearable clearable
></q-input> ></q-input>
......
...@@ -5,24 +5,6 @@ import { isMobilePhone } from '../../../boot/functions'; ...@@ -5,24 +5,6 @@ import { isMobilePhone } from '../../../boot/functions';
import NewArtistDialog from 'components/managingunits/update-new-managingunits-dialog/add-new-artist-dialog/index.vue' import NewArtistDialog from 'components/managingunits/update-new-managingunits-dialog/add-new-artist-dialog/index.vue'
import UpdateNewArtistDialog from 'components/managingunits/update-new-managingunits-dialog/update-new-artist-dialog/index.vue' import UpdateNewArtistDialog from 'components/managingunits/update-new-managingunits-dialog/update-new-artist-dialog/index.vue'
export type ArtistUpdateInfoType = {
id: number;
nameAdd: string | null;
myedityAdd: string | null;
timeAdd: string | null;
fieldsAdd: number;
statusAdd: number;
};
export type ArtistUpdateUpdateInfoType = {
id: number;
nameUpdate: string | null;
myedityUpdate: string | null;
timeUpdate: string | null;
fieldsUpdate: number;
statusUpdate: number;
};
export default defineComponent({ export default defineComponent({
components: { components: {
NewArtistDialog, NewArtistDialog,
......
...@@ -207,7 +207,7 @@ export default { ...@@ -207,7 +207,7 @@ export default {
AddmanagingUnit: 'Thêm nghệ sỹ', AddmanagingUnit: 'Thêm nghệ sỹ',
tableColumns: { tableColumns: {
sttAdd: 'STT', sttAdd: 'STT',
nameAdd: 'Tên đơn vị', nameAdd: 'Tên Nghệ sỹ',
myedityAdd: 'Nghệ danh', myedityAdd: 'Nghệ danh',
fieldsAdd: 'Lĩnh vực', fieldsAdd: 'Lĩnh vực',
timeAdd: 'Thời gian hợp đồng', timeAdd: 'Thời gian hợp đồng',
...@@ -229,11 +229,11 @@ export default { ...@@ -229,11 +229,11 @@ export default {
update: 'Cập nhật nghệ sỹ', update: 'Cập nhật nghệ sỹ',
}, },
fieldLabels: { fieldLabels: {
nameAdd: 'Tên đơn vị *', nameAdd: 'Tên nghệ sỹ *',
myedityAdd: 'Nghệ danh *', myedityAdd: 'Nghệ danh *',
fieldsAdd: 'Lĩnh vực *', fieldsAdd: 'Lĩnh vực *',
timeAdd: 'Thời gian hợp đồng *', timeAdd: 'Thời gian hợp đồng *',
nameUpdate: 'Tên đơn vị *', nameUpdate: 'Tên nghệ sỹ *',
myedityUpdate: 'Nghệ danh *', myedityUpdate: 'Nghệ danh *',
fieldsUpdate: 'Lĩnh vực *', fieldsUpdate: 'Lĩnh vực *',
timeUpdate: 'Thời gian hợp đồng *', timeUpdate: 'Thời gian hợp đồng *',
...@@ -249,11 +249,11 @@ export default { ...@@ -249,11 +249,11 @@ export default {
cancel: 'Đóng', cancel: 'Đóng',
}, },
validateMessages: { validateMessages: {
requireNameAdd: 'Vui lòng nhập Tên đơn vị', requireNameAdd: 'Vui lòng chọn Tên nghệ sỹ',
requireMyedityAdd: 'Vui lòng nhập Nghệ danh', requireMyedityAdd: 'Vui lòng nhập Nghệ danh',
requireFieldsAdd: 'Vui lòng chọn Lĩnh vực', requireFieldsAdd: 'Vui lòng chọn Lĩnh vực',
requireTimeAdd: 'Vui lòng nhập Thời gian', requireTimeAdd: 'Vui lòng nhập Thời gian',
requireNameUpdate: 'Vui lòng nhập Tên đơn vị', requireNameUpdate: 'Vui lòng chọn Tên nghệ sỹ',
requireMyedityUpdate: 'Vui lòng nhập Nghệ danh', requireMyedityUpdate: 'Vui lòng nhập Nghệ danh',
requireFieldsUpdate: 'Vui lòng chọn Lĩnh vực', requireFieldsUpdate: 'Vui lòng chọn Lĩnh vực',
requireTimeUpdate: 'Vui lòng nhập Thời gian', requireTimeUpdate: 'Vui lòng nhập Thời gian',
......
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