t용어집수정정
This commit is contained in:
parent
e14af4de3d
commit
8e438ff900
@ -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)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user