feat(character-banner): 배너 등록 언어 선택 추가

- 배너 등록/수정 다이얼로그에 언어 선택(ko/ja/en) UI를 추가
This commit is contained in:
Yu Sung
2026-04-02 15:47:14 +09:00
parent 97b832fd2e
commit 1fc619dfd0
2 changed files with 32 additions and 8 deletions

View File

@@ -115,9 +115,10 @@ async function createCharacterBanner(bannerData) {
// 이미지 FormData에 추가 // 이미지 FormData에 추가
if (bannerData.image) formData.append('image', bannerData.image) if (bannerData.image) formData.append('image', bannerData.image)
// 캐릭터 ID를 JSON 문자열로 변환하여 request 필드에 추가 // 캐릭터 ID와 언어 코드를 JSON 문자열로 변환하여 request 필드에 추가
const requestData = { const requestData = {
characterId: bannerData.characterId characterId: bannerData.characterId,
lang: bannerData.lang
} }
formData.append('request', JSON.stringify(requestData)) formData.append('request', JSON.stringify(requestData))

View File

@@ -184,6 +184,19 @@
</v-alert> </v-alert>
</v-col> </v-col>
</v-row> </v-row>
<v-row>
<v-col cols="12">
<v-select
v-model="bannerForm.lang"
:items="languageOptions"
label="언어 선택"
item-text="text"
item-value="value"
:disabled="isEdit"
outlined
/>
</v-col>
</v-row>
<v-row v-if="selectedCharacter"> <v-row v-if="selectedCharacter">
<v-col cols="12"> <v-col cols="12">
<v-alert <v-alert
@@ -302,8 +315,14 @@ export default {
image: null, image: null,
imageUrl: '', imageUrl: '',
characterId: null, characterId: null,
bannerId: null bannerId: null,
lang: null
}, },
languageOptions: [
{ text: '한국어', value: 'ko' },
{ text: '일본어', value: 'ja' },
{ text: '영어', value: 'en' }
],
imageRules: [ imageRules: [
v => !!v || this.isEdit || '이미지를 선택하세요' v => !!v || this.isEdit || '이미지를 선택하세요'
] ]
@@ -312,7 +331,7 @@ export default {
computed: { computed: {
isFormValid() { isFormValid() {
return (this.bannerForm.image || (this.isEdit && this.bannerForm.imageUrl)) && this.selectedCharacter; return (this.bannerForm.image || (this.isEdit && this.bannerForm.imageUrl)) && this.selectedCharacter && this.bannerForm.lang;
} }
}, },
@@ -393,7 +412,8 @@ export default {
image: null, image: null,
imageUrl: '', imageUrl: '',
characterId: null, characterId: null,
bannerId: null bannerId: null,
lang: null
}; };
this.previewImage = null; this.previewImage = null;
this.searchKeyword = ''; this.searchKeyword = '';
@@ -414,7 +434,8 @@ export default {
image: null, image: null,
imageUrl: banner.imageUrl, imageUrl: banner.imageUrl,
characterId: banner.characterId, characterId: banner.characterId,
bannerId: banner.id bannerId: banner.id,
lang: banner.lang || banner.language || null
}; };
this.previewImage = null; this.previewImage = null;
this.searchKeyword = ''; this.searchKeyword = '';
@@ -430,7 +451,8 @@ export default {
image: null, image: null,
imageUrl: '', imageUrl: '',
characterId: null, characterId: null,
bannerId: null bannerId: null,
lang: null
}; };
this.previewImage = null; this.previewImage = null;
this.searchKeyword = ''; this.searchKeyword = '';
@@ -501,7 +523,8 @@ export default {
// 배너 추가 // 배너 추가
const response = await createCharacterBanner({ const response = await createCharacterBanner({
image: this.bannerForm.image, image: this.bannerForm.image,
characterId: this.selectedCharacter.id characterId: this.selectedCharacter.id,
lang: this.bannerForm.lang
}); });
if (response && response.status === 200 && response.data && response.data.success === true) { if (response && response.status === 200 && response.data && response.data.success === true) {
this.notifySuccess('배너가 추가되었습니다.'); this.notifySuccess('배너가 추가되었습니다.');