t용어집수정정

This commit is contained in:
khj0414 2025-02-14 12:16:24 +09:00
parent e14af4de3d
commit 8e438ff900

View File

@ -61,7 +61,7 @@
</template>
<script setup>
import { ref, watchEffect, computed, onMounted, getCurrentInstance } from 'vue';
import { ref, watchEffect, computed, onMounted, getCurrentInstance, toRaw } from 'vue';
import axios from '@api';
import SearchBar from '@c/search/SearchBar.vue';
import WriteButton from '@c/button/WriteBtn.vue';
@ -159,25 +159,16 @@
//
const addCategory = (data) =>{
const lastCategory = cateList.value[cateList.value.length - 1];
const newValue = lastCategory ? parseInt(lastCategory.CMNCODVAL) + 1 : 600101;
console.log('lastCategory',lastCategory)
console.log('newValue',newValue)
const newValue = lastCategory ? lastCategory.value + 1 : 600101;
axios.post('worddict/insertCategory',{
CMNCODNAM: data
}).then(res => {
if(res.data.data == '1'){
console.log('res.data.data',res.data.data)
toastStore.onToast('카테고리가 추가 등록 되었습니다.', 's');
const newCategory = { CMNCODNAM: data, CMNCODVAL: newValue.toString() };
console.log('newCategory',newCategory)
cateList.value.unshift(newCategory.CMNCODNAM);
const newCategory = { label: data, value: newValue };
cateList.value.unshift(newCategory);
selectCategory.value = newCategory.CMNCODVAL;
console.log(' selectCategory.value', selectCategory.value)
}
})
}