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