용어집 등록
This commit is contained in:
parent
8427dce4cc
commit
8fd19938ba
@ -1,39 +1,49 @@
|
||||
<template>
|
||||
<div class="d-flex">
|
||||
<FormSelect
|
||||
name="cate"
|
||||
title="카테고리"
|
||||
:data="formattedDataList"
|
||||
:is-common="true"
|
||||
@update:data="selectCategory = $event"
|
||||
@change="onChange"
|
||||
/>
|
||||
|
||||
<PlusBtn @click="toggleInput"/>
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-10">
|
||||
<FormSelect
|
||||
name="cate"
|
||||
title="카테고리 선택"
|
||||
:data="formattedDataList"
|
||||
:is-common="true"
|
||||
@update:data="selectCategory = $event"
|
||||
@change="onChange"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-2 btn-margin">
|
||||
<PlusBtn @click="toggleInput"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex" v-if="showInput">
|
||||
<FormInput :isLabel="false" title="카테고리" name="카테고리" @update:modelValue="addCategory = $event" :is-alert="addCategoryAlert"/>
|
||||
<button class="btn btn-primary" @click="saveInput">
|
||||
<i class="bx bx-check"></i>
|
||||
</button>
|
||||
<div class="row" v-if="showInput">
|
||||
<div class="col-10">
|
||||
<FormInput title="카테고리 입력" name="카테고리" @update:modelValue="addCategory = $event" :is-alert="addCategoryAlert"/>
|
||||
</div>
|
||||
<div class="col-2 btn-margin">
|
||||
<button class="btn btn-primary btn-icon" @click="saveInput">
|
||||
<i class="bx bx-check"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="dict-w">
|
||||
<FormInput
|
||||
title="용어"
|
||||
type="text"
|
||||
name="word"
|
||||
:is-essential="true"
|
||||
:is-alert="wordTitleAlert"
|
||||
@update:modelValue="wordTitle = $event"
|
||||
/>
|
||||
title="용어"
|
||||
type="text"
|
||||
name="word"
|
||||
:is-essential="true"
|
||||
:is-alert="wordTitleAlert"
|
||||
@update:modelValue="wordTitle = $event"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<QEditor @update:data="content = $event" @update:imageUrls="imageUrls = $event" :is-alert="wordContentAlert" />
|
||||
<button class="btn btn-primary" @click="saveWord">
|
||||
<i class="bx bx-check"></i>
|
||||
</button>
|
||||
<button @click="$emit('close')">취소</button>
|
||||
<div class="text-end mt-5">
|
||||
<button class="btn btn-primary" @click="saveWord">
|
||||
<i class="bx bx-check"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -124,3 +134,15 @@ const saveWord = () => {
|
||||
emit('addWord', wordData);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dict-w {
|
||||
width: 83%;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.btn-margin {
|
||||
margin-top: 2.5rem
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -172,7 +172,7 @@
|
||||
}).then(res => {
|
||||
if(res.data.data == '1'){
|
||||
toastStore.onToast('카테고리가 추가 등록 되었습니다.', 's');
|
||||
const newCategory = { CMNCODNAM: data, CMNCODVAL: newValue.toString() }; // Assuming CMNCODVAL is the same as CMNCODNAM
|
||||
const newCategory = { CMNCODNAM: data, CMNCODVAL: newValue.toString() };
|
||||
cateList.value.unshift(newCategory);
|
||||
selectCategory.value = newCategory.CMNCODVAL;
|
||||
}
|
||||
@ -181,10 +181,6 @@
|
||||
//용어 등록
|
||||
const addWord = (wordData) => {
|
||||
|
||||
// console.log('단어 추가됨:', wordData.category); // WRDDICCAT
|
||||
// console.log('단어 추가됨:', wordData.content); // WRDDICCON
|
||||
// console.log('단어 추가됨:', wordData.title); // WRDDICTTL
|
||||
|
||||
axios.post('worddict/insertWord',{
|
||||
WRDDICCAT : wordData.category,
|
||||
WRDDICTTL : wordData.title,
|
||||
@ -192,10 +188,8 @@
|
||||
}).then(res => {
|
||||
if(res.data.data == '1'){
|
||||
toastStore.onToast('용어가 등록 되었습니다.', 's');
|
||||
isWriteVisible.value = false
|
||||
// const newCategory = { CMNCODNAM: data, CMNCODVAL: newValue.toString() };
|
||||
// cateList.value.unshift(newCategory);
|
||||
// selectCategory.value = newCategory.CMNCODVAL;
|
||||
isWriteVisible.value = false;
|
||||
getwordList();
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user