Merge branch 'main' into project-list

This commit is contained in:
yoon 2025-02-20 09:21:58 +09:00
commit 0aab690dc7
3 changed files with 14 additions and 7 deletions

View File

@ -87,7 +87,7 @@ const localCateList = ref([...props.cateList]);
const selectedCategory = ref('');
// cateList emit
const emit = defineEmits(['update:cateList']);
const emit = defineEmits(['update:cateList','refreshWordList']);
//
const isWriteVisible = ref(false);
@ -126,6 +126,7 @@ const addCategory = (data) => {
}
}
//
const editWord = (data) => {
console.log('📌 수정할 데이터:', data);
@ -142,15 +143,15 @@ const editWord = (data) => {
axios.patch('worddict/updateWord', {
WRDDICSEQ: data.id,
WRDDICCAT: 600104,
WRDDICCAT: data.category,
WRDDICTTL: data.title,
WRDDICRIK: $common.deltaAsJson(data.content),
WRDDICCON: $common.deltaAsJson(data.content),
})
.then((res) => {
if (res.data.data === '1') {
if (res.data.data === 1) {
toastStore.onToast('✅ 용어가 수정되었습니다.', 's');
isWriteVisible.value = false; //
// getwordList(); //
isWriteVisible.value = false;
emit('refreshWordList');
} else {
console.warn('⚠️ 서버 응답이 예상과 다릅니다:', res.data);
toastStore.onToast('용어 수정이 정상적으로 처리되지 않았습니다.', 'e');

View File

@ -73,6 +73,11 @@ const addCategoryAlert = ref(false);
//
const selectCategory = ref('');
//
const selectedCategory = computed(() =>
selectCategory.value === '' ? props.formValue : selectCategory.value
);
const props = defineProps({
dataList: {
type: Array,
@ -133,7 +138,7 @@ const saveWord = () => {
const wordData = {
id: props.NumValue || null,
title: wordTitle.value,
category: selectCategory.value,
category: selectedCategory.value,
content: content.value,
};

View File

@ -49,6 +49,7 @@
:key="item.WRDDICSEQ"
:item="item"
:cateList="cateList"
@refreshWordList="getwordList"
/>
</ul>