Merge branch 'wordDict'
This commit is contained in:
commit
e14af4de3d
@ -5,7 +5,7 @@
|
|||||||
<FormSelect
|
<FormSelect
|
||||||
name="cate"
|
name="cate"
|
||||||
title="카테고리 선택"
|
title="카테고리 선택"
|
||||||
:data="formattedDataList"
|
:data="dataList"
|
||||||
:is-common="true"
|
:is-common="true"
|
||||||
@update:data="selectCategory = $event"
|
@update:data="selectCategory = $event"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
@ -79,12 +79,12 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 데이터 포맷 수정
|
// 데이터 포맷 수정
|
||||||
const formattedDataList = computed(() =>
|
// const formattedDataList = computed(() =>
|
||||||
props.dataList.map(item => ({
|
// props.dataList.map(item => ({
|
||||||
label: item.CMNCODNAM,
|
// label: item.CMNCODNAM,
|
||||||
value: item.CMNCODVAL
|
// value: item.CMNCODVAL
|
||||||
}))
|
// }))
|
||||||
);
|
// );
|
||||||
|
|
||||||
// 카테고리 입력 창
|
// 카테고리 입력 창
|
||||||
const showInput = ref(false);
|
const showInput = ref(false);
|
||||||
|
|||||||
@ -45,9 +45,9 @@
|
|||||||
<!-- 단어 목록 -->
|
<!-- 단어 목록 -->
|
||||||
<ul v-if="total > 0" class="px-0 list-unstyled">
|
<ul v-if="total > 0" class="px-0 list-unstyled">
|
||||||
<DictCard
|
<DictCard
|
||||||
v-for="item in wordList"
|
v-for="item in wordList"
|
||||||
:key="item.WRDDICSEQ"
|
:key="item.WRDDICSEQ"
|
||||||
:item="item"
|
:item="item"
|
||||||
/>
|
/>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -69,7 +69,7 @@
|
|||||||
import DictCard from '@/components/wordDict/DictCard.vue';
|
import DictCard from '@/components/wordDict/DictCard.vue';
|
||||||
import DictWrite from '@/components/wordDict/DictWrite.vue';
|
import DictWrite from '@/components/wordDict/DictWrite.vue';
|
||||||
import DictAlphabetFilter from '@/components/wordDict/DictAlphabetFilter.vue';
|
import DictAlphabetFilter from '@/components/wordDict/DictAlphabetFilter.vue';
|
||||||
import commonApi from '@/common/commonApi'
|
import commonApi from '@/common/commonApi';
|
||||||
import { useToastStore } from '@s/toastStore';
|
import { useToastStore } from '@s/toastStore';
|
||||||
|
|
||||||
const { appContext } = getCurrentInstance();
|
const { appContext } = getCurrentInstance();
|
||||||
@ -88,8 +88,12 @@
|
|||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
|
|
||||||
// 카테고리
|
// 카테고리
|
||||||
const { cateList } = commonApi();
|
const { cateList } = commonApi({
|
||||||
|
loadCateList: true
|
||||||
|
});
|
||||||
const selectedCategory = ref('');
|
const selectedCategory = ref('');
|
||||||
|
const selectCategory = ref('');
|
||||||
|
|
||||||
|
|
||||||
//선택된 알파벳
|
//선택된 알파벳
|
||||||
const selectedAlphabet = ref('');
|
const selectedAlphabet = ref('');
|
||||||
@ -156,15 +160,24 @@
|
|||||||
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 ? parseInt(lastCategory.CMNCODVAL) + 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 = { CMNCODNAM: data, CMNCODVAL: newValue.toString() };
|
||||||
cateList.value.unshift(newCategory);
|
console.log('newCategory',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