t용어집수정정
This commit is contained in:
parent
e14af4de3d
commit
8e438ff900
@ -61,7 +61,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watchEffect, computed, onMounted, getCurrentInstance } from 'vue';
|
import { ref, watchEffect, computed, onMounted, getCurrentInstance, toRaw } from 'vue';
|
||||||
import axios from '@api';
|
import axios from '@api';
|
||||||
import SearchBar from '@c/search/SearchBar.vue';
|
import SearchBar from '@c/search/SearchBar.vue';
|
||||||
import WriteButton from '@c/button/WriteBtn.vue';
|
import WriteButton from '@c/button/WriteBtn.vue';
|
||||||
@ -159,25 +159,16 @@
|
|||||||
//카테고리 등록
|
//카테고리 등록
|
||||||
const addCategory = (data) =>{
|
const addCategory = (data) =>{
|
||||||
const lastCategory = cateList.value[cateList.value.length - 1];
|
const lastCategory = cateList.value[cateList.value.length - 1];
|
||||||
const newValue = lastCategory ? parseInt(lastCategory.CMNCODVAL) + 1 : 600101;
|
const newValue = lastCategory ? lastCategory.value + 1 : 600101;
|
||||||
console.log('lastCategory',lastCategory)
|
|
||||||
console.log('newValue',newValue)
|
|
||||||
|
|
||||||
|
|
||||||
axios.post('worddict/insertCategory',{
|
axios.post('worddict/insertCategory',{
|
||||||
CMNCODNAM: data
|
CMNCODNAM: data
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if(res.data.data == '1'){
|
if(res.data.data == '1'){
|
||||||
console.log('res.data.data',res.data.data)
|
|
||||||
|
|
||||||
toastStore.onToast('카테고리가 추가 등록 되었습니다.', 's');
|
toastStore.onToast('카테고리가 추가 등록 되었습니다.', 's');
|
||||||
const newCategory = { CMNCODNAM: data, CMNCODVAL: newValue.toString() };
|
const newCategory = { label: data, value: newValue };
|
||||||
console.log('newCategory',newCategory)
|
cateList.value.unshift(newCategory);
|
||||||
|
|
||||||
cateList.value.unshift(newCategory.CMNCODNAM);
|
|
||||||
selectCategory.value = newCategory.CMNCODVAL;
|
selectCategory.value = newCategory.CMNCODVAL;
|
||||||
console.log(' selectCategory.value', selectCategory.value)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user