챗봇 캐릭터 등록시 리전 선택 기능 추가
This commit is contained in:
@@ -109,11 +109,11 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- 성별 -->
|
||||
<!-- 성별 & 리전 -->
|
||||
<v-row>
|
||||
<v-col
|
||||
cols="12"
|
||||
md="6"
|
||||
md="4"
|
||||
>
|
||||
<v-select
|
||||
v-model="character.gender"
|
||||
@@ -124,10 +124,35 @@
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
cols="12"
|
||||
md="4"
|
||||
>
|
||||
<v-select
|
||||
v-if="!isEdit"
|
||||
v-model="character.region"
|
||||
:items="regionOptions"
|
||||
item-text="text"
|
||||
item-value="value"
|
||||
label="리전"
|
||||
outlined
|
||||
dense
|
||||
/>
|
||||
<v-text-field
|
||||
v-else
|
||||
:value="regionDisplayText"
|
||||
label="리전"
|
||||
readonly
|
||||
outlined
|
||||
dense
|
||||
background-color="grey lighten-4"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<!-- 나이 -->
|
||||
<v-col
|
||||
cols="12"
|
||||
md="6"
|
||||
md="4"
|
||||
>
|
||||
<v-text-field
|
||||
v-model="character.age"
|
||||
@@ -1116,6 +1141,7 @@ export default {
|
||||
speechStyle: '',
|
||||
appearance: '',
|
||||
systemPrompt: '',
|
||||
region: 'KR',
|
||||
tags: [],
|
||||
memories: [],
|
||||
relationships: [],
|
||||
@@ -1150,6 +1176,10 @@ export default {
|
||||
'ISTJ', 'ISFJ', 'ESTJ', 'ESFJ',
|
||||
'ISTP', 'ISFP', 'ESTP', 'ESFP'
|
||||
],
|
||||
regionOptions: [
|
||||
{ text: '한국', value: 'KR' },
|
||||
{ text: '일본', value: 'JP' }
|
||||
],
|
||||
typeOptions: ['Clone', 'Character'],
|
||||
systemPromptRules: [
|
||||
v => (this.isEdit ? true : (!!v && v.trim().length > 0) || '시스템 프롬프트를 입력하세요')
|
||||
@@ -1197,6 +1227,10 @@ export default {
|
||||
const hasNonIdField = Object.keys(changed || {}).some(k => k !== 'id');
|
||||
const imageChanged = !!this.character.image; // 새 이미지 선택 여부
|
||||
return !(hasNonIdField || imageChanged);
|
||||
},
|
||||
regionDisplayText() {
|
||||
const option = this.regionOptions.find(opt => opt.value === this.character.region);
|
||||
return option ? option.text : this.character.region;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1569,9 +1603,12 @@ export default {
|
||||
const result = { ...data };
|
||||
// 기본값 보정
|
||||
if (result.originalWorkId == null) result.originalWorkId = null;
|
||||
// 리전 정보가 없는 경우 기본값 KR 설정
|
||||
if (!result.region) result.region = 'KR';
|
||||
|
||||
const simpleFields = [
|
||||
'name', 'systemPrompt', 'description', 'age', 'gender', 'mbti',
|
||||
'characterType', 'speechPattern', 'speechStyle', 'appearance', 'imageUrl'
|
||||
'characterType', 'speechPattern', 'speechStyle', 'appearance', 'imageUrl', 'region'
|
||||
];
|
||||
simpleFields.forEach(f => {
|
||||
if (result[f] == null) result[f] = '';
|
||||
@@ -1595,6 +1632,7 @@ export default {
|
||||
speechPattern: this.character.speechPattern,
|
||||
speechStyle: this.character.speechStyle,
|
||||
appearance: this.character.appearance,
|
||||
region: this.character.region,
|
||||
tags: this.character.tags || [],
|
||||
hobbies: this.character.hobbies || [],
|
||||
values: this.character.values || [],
|
||||
@@ -1615,7 +1653,7 @@ export default {
|
||||
// 기본 필드 비교
|
||||
const simpleFields = [
|
||||
'name', 'description', 'age', 'gender', 'mbti', 'characterType', 'originalWorkId',
|
||||
'speechPattern', 'speechStyle', 'isActive'
|
||||
'speechPattern', 'speechStyle', 'isActive', 'region'
|
||||
];
|
||||
|
||||
simpleFields.forEach(field => {
|
||||
|
||||
@@ -79,6 +79,9 @@
|
||||
<th class="text-center">
|
||||
태그
|
||||
</th>
|
||||
<th class="text-center">
|
||||
리전
|
||||
</th>
|
||||
<th class="text-center">
|
||||
등록일
|
||||
</th>
|
||||
@@ -150,6 +153,7 @@
|
||||
</div>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<td>{{ getRegionText(item.region) }}</td>
|
||||
<td>{{ item.createdAt }}</td>
|
||||
<td>{{ item.updatedAt || '-' }}</td>
|
||||
<td>
|
||||
@@ -284,7 +288,11 @@ export default {
|
||||
total_page: 0,
|
||||
characters: [],
|
||||
selected_character: {},
|
||||
searchTerm: ''
|
||||
searchTerm: '',
|
||||
regionOptions: [
|
||||
{ text: '한국', value: 'KR' },
|
||||
{ text: '일본', value: 'JP' }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -301,6 +309,11 @@ export default {
|
||||
this.$dialog.notify.success(message)
|
||||
},
|
||||
|
||||
getRegionText(region) {
|
||||
if (!region) return '-';
|
||||
const option = this.regionOptions.find(opt => opt.value === region);
|
||||
return option ? option.text : region;
|
||||
},
|
||||
|
||||
showDetailDialog(item, type) {
|
||||
this.selected_character = item;
|
||||
|
||||
Reference in New Issue
Block a user