용어집수정정

This commit is contained in:
khj0414 2025-03-17 10:24:41 +09:00
parent c51da7f56d
commit 4258881d4b
4 changed files with 70 additions and 68 deletions

View File

@ -19,9 +19,6 @@
@focusout="$emit('focusout', modelValue)" @focusout="$emit('focusout', modelValue)"
@input="handleInput" @input="handleInput"
/> />
<div v-if="isBtn" class="ms-2">
<slot name="append"></slot>
</div>
</div> </div>
<div class="invalid-feedback" :class="isAlert ? 'd-block' : ''">{{ title }} 확인해주세요.</div> <div class="invalid-feedback" :class="isAlert ? 'd-block' : ''">{{ title }} 확인해주세요.</div>
<div class="invalid-feedback" :class="isCateAlert ? 'd-block' : ''">카테고리 중복입니다.</div> <div class="invalid-feedback" :class="isCateAlert ? 'd-block' : ''">카테고리 중복입니다.</div>

View File

@ -10,6 +10,9 @@
{{ isCommon ? item.label : item }} {{ isCommon ? item.label : item }}
</option> </option>
</select> </select>
<div v-if="isBtn" class="ms-2">
<slot name="append"></slot>
</div>
<div v-if="isColor && selected" <div v-if="isColor && selected"
class="w-px-40 h-px-30" class="w-px-40 h-px-30"
@ -70,6 +73,11 @@ const props = defineProps({
default: true, default: true,
required: false, required: false,
}, },
isBtn: {
type: Boolean,
default: false,
required: false,
},
isCommon: { isCommon: {
type: Boolean, type: Boolean,
default: false, default: false,

View File

@ -1,8 +1,6 @@
<template> <template>
<div> <div>
<div class="row"> <FormSelect class="me-5"
<div class="col-10">
<FormSelect
name="cate" name="cate"
title="카테고리" title="카테고리"
:data="dataList" :data="dataList"
@ -12,27 +10,22 @@
:value="formValue" :value="formValue"
:is-essential="false" :is-essential="false"
/> />
</div> <div v-if="!isDisabled" class="add-btn">
<div class="col-2" v-if="!isDisabled">
<PlusBtn @click="toggleInput"/> <PlusBtn @click="toggleInput"/>
</div> </div>
</div> </div>
<div class="row" v-if="showInput"> <div v-if="showInput">
<div class="col-10"> <FormInput class="me-5"
<FormInput
ref="categoryInputRef" ref="categoryInputRef"
title="새 카테고리" title="새 카테고리"
name="카테고리" name="카테고리"
@update:modelValue="addCategory = $event" @update:modelValue="addCategory = $event"
:is-cate-alert="addCategoryAlert" :is-cate-alert="addCategoryAlert"
@focusout="handleCategoryFocusout(addCategory)" @focusout="handleCategoryFocusout(addCategory)"
/> />
</div> </div>
</div> <FormInput class="me-5"
</div>
<div class="dict-w">
<FormInput
title="용어" title="용어"
type="text" type="text"
name="word" name="word"
@ -43,9 +36,8 @@
:disabled="isDisabled" :disabled="isDisabled"
@keyup="ValidHandler('title')" @keyup="ValidHandler('title')"
/> />
</div>
<div> <div>
<QEditor @keyup="ValidHandler('content')" @update:data="handleContentUpdate" @update:imageUrls="imageUrls = $event" :is-alert="wordContentAlert" :initialData="contentValue"/> <QEditor class="" @keyup="ValidHandler('content')" @update:data="handleContentUpdate" @update:imageUrls="imageUrls = $event" :is-alert="wordContentAlert" :initialData="contentValue"/>
<div class="text-end mt-5"> <div class="text-end mt-5">
<button class="btn btn-primary" @click="saveWord"> <button class="btn btn-primary" @click="saveWord">
<i class="bx bx-check"></i> <i class="bx bx-check"></i>
@ -188,8 +180,9 @@ const saveWord = () => {
// focusout // focusout
const handleCategoryFocusout = (value) => { const handleCategoryFocusout = (value) => {
const valueTrim = value.trim();
const valueTrim = value.trim();
if(value){
const existingCategory = props.dataList.find(item => item.label === valueTrim); const existingCategory = props.dataList.find(item => item.label === valueTrim);
// //
@ -219,6 +212,7 @@ const handleCategoryFocusout = (value) => {
} else { } else {
addCategoryAlert.value = false; addCategoryAlert.value = false;
} }
}
}; };
@ -234,4 +228,9 @@ const handleCategoryFocusout = (value) => {
margin-top: 2.5rem margin-top: 2.5rem
} }
} }
.add-btn {
position: absolute;
right: 0.7rem;
top: 1.2rem;
}
</style> </style>

View File

@ -19,12 +19,10 @@
<!-- 용어 리스트 컨텐츠 --> <!-- 용어 리스트 컨텐츠 -->
<div class="flex-grow-1"> <div class="flex-grow-1">
<!-- 작성 --> <!-- 작성 -->
<div v-if="writeStore.isItemActive(999999)" class="ms-3 card p-5"> <div v-if="writeStore.isItemActive(999999)" class="ms-3 card p-5 mb-2">
<DictWrite @close="writeStore.closeAll()" :dataList="cateList" @addWord="addWord"/> <DictWrite @close="writeStore.closeAll()" :dataList="cateList" @addWord="addWord"/>
</div> </div>
<!-- 용어 리스트 --> <!-- 용어 리스트 -->
<div> <div>
<!-- 로딩 중일 --> <!-- 로딩 중일 -->