@@ -190,7 +163,7 @@
- 태그를 입력하고 엔터를 누르면 추가됩니다.
+ 태그를 입력하고 엔터 또는 스페이스바를 누르면 추가됩니다. (50자 이내, 최대 20개, 띄어쓰기 불가)
@@ -218,19 +191,6 @@
-
-
-
-
-
-
-
@@ -249,10 +209,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -275,6 +267,314 @@
+
+
+
+
+
+ 인물 관계
+
+
+
+
+
+
+
+
+
+
+ 추가
+
+
+
+
+
+
+
+
+
+
+
+ {{ relationship }}
+
+
+
+
+ 삭제
+
+
+
+
+
+ 인물 관계가 없습니다. 위 입력창에서 인물 관계를 추가해주세요. (최대 10개)
+
+
+
+
+
+
+
+
+
+
+ 취미 목록
+
+
+
+
+
+
+
+
+
+
+ 추가
+
+
+
+
+
+
+
+
+
+
+
+ {{ hobby }}
+
+
+
+
+ 삭제
+
+
+
+
+
+ 취미가 없습니다. 위 입력창에서 취미를 추가해주세요. (최대 10개)
+
+
+
+
+
+
+
+
+
+
+ 가치관 목록
+
+
+
+
+
+
+
+
+
+
+ 추가
+
+
+
+
+
+
+
+
+
+
+
+ {{ value }}
+
+
+
+
+ 삭제
+
+
+
+
+
+ 가치관이 없습니다. 위 입력창에서 가치관을 추가해주세요. (최대 10개)
+
+
+
+
+
+
+
+
+
+
+ 목표
+
+
+
+
+
+
+
+
+
+
+ 추가
+
+
+
+
+
+
+
+
+
+
+
+ {{ goal }}
+
+
+
+
+ 삭제
+
+
+
+
+
+ 목표가 없습니다. 위 입력창에서 목표를 추가해주세요. (최대 10개)
+
+
+
+
+
@@ -402,10 +702,17 @@ export default {
isFormValid: false,
isEdit: false,
previewImage: null,
- birthDateMenu: false,
newMemory: '',
+ newRelationship: '',
+ newHobby: '',
+ newValue: '',
+ newGoal: '',
tags: [],
memories: [],
+ relationships: [],
+ hobbies: [],
+ values: [],
+ goals: [],
character: {
id: null,
name: '',
@@ -415,17 +722,25 @@ export default {
isActive: true,
createdAt: '',
gender: '',
- birthDate: null,
+ age: '',
mbti: '',
- ageRestricted: false,
worldView: '',
relationships: '',
personality: '',
speechPattern: '',
+ conversationStyle: '',
+ appearance: '',
systemPrompt: '',
tags: [],
memories: []
},
+ ageRules: [
+ v => !!v || '나이를 입력하세요',
+ v => (v && !isNaN(v) && parseInt(v) >= 0) || '유효한 나이를 입력하세요'
+ ],
+ tagRules: [
+ v => v.length <= 20 || '태그는 최대 20개까지 등록 가능합니다'
+ ],
nameRules: [
v => !!v || '이름을 입력하세요',
v => (v && v.trim().length > 0) || '이름을 입력하세요'
@@ -448,10 +763,6 @@ export default {
},
computed: {
- formattedBirthDate() {
- if (!this.character.birthDate) return '';
- return this.character.birthDate;
- }
},
watch: {
@@ -487,6 +798,13 @@ export default {
this.$router.push('/character');
},
+ validateNumberInput() {
+ // 숫자만 입력 가능하도록 처리
+ if (this.character.age && isNaN(this.character.age)) {
+ this.character.age = this.character.age.replace(/[^0-9]/g, '');
+ }
+ },
+
createImagePreview(file) {
if (!file) return;
@@ -500,10 +818,21 @@ export default {
addTag() {
const lastTag = this.tags[this.tags.length - 1];
if (lastTag && typeof lastTag === 'string' && lastTag.trim()) {
- this.tags.splice(this.tags.length - 1, 1, lastTag.trim());
- this.$nextTick(() => {
- this.tags.push('');
- });
+ // 띄어쓰기 제거 및 50자 제한
+ let processedTag = lastTag.trim().replace(/\s+/g, '');
+ if (processedTag.length > 50) {
+ processedTag = processedTag.substring(0, 50);
+ }
+
+ // 태그 개수 제한 (20개)
+ if (this.tags.length <= 20) {
+ this.tags.splice(this.tags.length - 1, 1, processedTag);
+ this.$nextTick(() => {
+ this.tags.push('');
+ });
+ } else {
+ this.notifyError('태그는 최대 20개까지 등록 가능합니다.');
+ }
}
},
@@ -513,7 +842,7 @@ export default {
addMemory() {
if (this.newMemory.trim()) {
- this.memories.push(this.newMemory.trim());
+ this.memories.unshift(this.newMemory.trim());
this.newMemory = '';
}
},
@@ -522,6 +851,86 @@ export default {
this.memories.splice(index, 1);
},
+ addRelationship() {
+ if (this.newRelationship.trim()) {
+ if (this.relationships.length >= 10) {
+ this.notifyError('인물 관계는 최대 10개까지 등록 가능합니다.');
+ return;
+ }
+
+ if (this.newRelationship.length > 200) {
+ this.newRelationship = this.newRelationship.substring(0, 200);
+ }
+
+ this.relationships.unshift(this.newRelationship.trim());
+ this.newRelationship = '';
+ }
+ },
+
+ removeRelationship(index) {
+ this.relationships.splice(index, 1);
+ },
+
+ addHobby() {
+ if (this.newHobby.trim()) {
+ if (this.hobbies.length >= 10) {
+ this.notifyError('취미는 최대 10개까지 등록 가능합니다.');
+ return;
+ }
+
+ if (this.newHobby.length > 100) {
+ this.newHobby = this.newHobby.substring(0, 100);
+ }
+
+ this.hobbies.unshift(this.newHobby.trim());
+ this.newHobby = '';
+ }
+ },
+
+ removeHobby(index) {
+ this.hobbies.splice(index, 1);
+ },
+
+ addValue() {
+ if (this.newValue.trim()) {
+ if (this.values.length >= 10) {
+ this.notifyError('가치관은 최대 10개까지 등록 가능합니다.');
+ return;
+ }
+
+ if (this.newValue.length > 100) {
+ this.newValue = this.newValue.substring(0, 100);
+ }
+
+ this.values.unshift(this.newValue.trim());
+ this.newValue = '';
+ }
+ },
+
+ removeValue(index) {
+ this.values.splice(index, 1);
+ },
+
+ addGoal() {
+ if (this.newGoal.trim()) {
+ if (this.goals.length >= 10) {
+ this.notifyError('목표는 최대 10개까지 등록 가능합니다.');
+ return;
+ }
+
+ if (this.newGoal.length > 200) {
+ this.newGoal = this.newGoal.substring(0, 200);
+ }
+
+ this.goals.unshift(this.newGoal.trim());
+ this.newGoal = '';
+ }
+ },
+
+ removeGoal(index) {
+ this.goals.splice(index, 1);
+ },
+
async loadCharacter(id) {
this.isLoading = true;
try {
@@ -538,9 +947,13 @@ export default {
image: null // 파일 입력은 초기화
};
- // 태그와 메모리 설정
+ // 태그, 메모리, 인물관계, 취미, 가치관, 목표 설정
this.tags = data.tags || [];
this.memories = data.memories || [];
+ this.relationships = data.relationships || [];
+ this.hobbies = data.hobbies || [];
+ this.values = data.values || [];
+ this.goals = data.goals || [];
} else {
this.notifyError('캐릭터 정보를 불러올 수 없습니다.');
}
@@ -563,9 +976,13 @@ export default {
this.isLoading = true;
try {
- // 태그와 메모리 데이터 설정
+ // 태그, 메모리, 인물관계, 취미, 가치관, 목표 데이터 설정
this.character.tags = this.tags.filter(tag => tag && typeof tag === 'string' && tag.trim());
this.character.memories = [...this.memories];
+ this.character.relationships = [...this.relationships];
+ this.character.hobbies = [...this.hobbies];
+ this.character.values = [...this.values];
+ this.character.goals = [...this.goals];
let response;