Merge branch 'main' into project-list

This commit is contained in:
yoon 2025-02-10 16:08:45 +09:00
commit 8fcc702d9b
3 changed files with 79 additions and 46 deletions

View File

@ -74,9 +74,9 @@ const router = useRouter();
// Props // Props
const props = defineProps({ const props = defineProps({
boardId: { boardId: {
type: Number, type: Number,
required: true required: true
}, },
profileName: { profileName: {
type: String, type: String,
@ -125,7 +125,7 @@ const handleEdit = () => {
// router.push({ name: 'BoardEdit', params: { id: boardId } }); // router.push({ name: 'BoardEdit', params: { id: boardId } });
if (props.unknown) { if (props.unknown) {
togglePassword('edit'); togglePassword('edit');
} else { } else {
router.push({ name: 'BoardEdit', params: { id: 100 } }); // router.push({ name: 'BoardEdit', params: { id: 100 } }); //
} }
@ -151,16 +151,33 @@ const togglePassword = (button) => {
}; };
// //
const handlePasswordSubmit = () => { const handlePasswordSubmit = async () => {
isPassword.value = false; isPassword.value = false;
lastClickedButton.value = null; lastClickedButton.value = null;
console.log('비밀번호:', password.value); console.log('비밀번호:', password.value);
console.log(props.boardId)
try {
const requestData = {
LOCBRDPWD: password.value,
LOCBRDSEQ: 288
}
// router.push({ name: 'BoardEdit', params: { id: props.boardId } }); // console.log(requestData)
const postResponse = await axios.post(`board/${props.boardId}/password`, requestData);
console.log('post결과:', postResponse.data)
// if (response.data.code === 200 && response.data.data === true) {
// console.log(""); //
// } else {
// console.log(" .");
// }
} catch (error) {
console.error('비밀번호 확인 중 오류 발생:', error);
}
}; };
const deletePost = async () => { const deletePost = async () => {

View File

@ -1,39 +1,49 @@
<template> <template>
<div class="d-flex"> <div>
<FormSelect <div class="row">
name="cate" <div class="col-10">
title="카테고리" <FormSelect
:data="formattedDataList" name="cate"
:is-common="true" title="카테고리 선택"
@update:data="selectCategory = $event" :data="formattedDataList"
@change="onChange" :is-common="true"
/> @update:data="selectCategory = $event"
@change="onChange"
<PlusBtn @click="toggleInput"/> />
</div>
<div class="col-2 btn-margin">
<PlusBtn @click="toggleInput"/>
</div>
</div>
<div class="d-flex" v-if="showInput"> <div class="row" v-if="showInput">
<FormInput :isLabel="false" title="카테고리" name="카테고리" @update:modelValue="addCategory = $event" :is-alert="addCategoryAlert"/> <div class="col-10">
<button class="btn btn-primary" @click="saveInput"> <FormInput title="카테고리 입력" name="카테고리" @update:modelValue="addCategory = $event" :is-alert="addCategoryAlert"/>
<i class="bx bx-check"></i> </div>
</button> <div class="col-2 btn-margin">
<button class="btn btn-primary btn-icon" @click="saveInput">
<i class="bx bx-check"></i>
</button>
</div>
</div> </div>
</div> </div>
<div> <div class="dict-w">
<FormInput <FormInput
title="용어" title="용어"
type="text" type="text"
name="word" name="word"
:is-essential="true" :is-essential="true"
:is-alert="wordTitleAlert" :is-alert="wordTitleAlert"
@update:modelValue="wordTitle = $event" @update:modelValue="wordTitle = $event"
/> />
</div> </div>
<div> <div>
<QEditor @update:data="content = $event" @update:imageUrls="imageUrls = $event" :is-alert="wordContentAlert" /> <QEditor @update:data="content = $event" @update:imageUrls="imageUrls = $event" :is-alert="wordContentAlert" />
<button class="btn btn-primary" @click="saveWord"> <div class="text-end mt-5">
<i class="bx bx-check"></i> <button class="btn btn-primary" @click="saveWord">
</button> <i class="bx bx-check"></i>
<button @click="$emit('close')">취소</button> </button>
</div>
</div> </div>
</template> </template>
@ -124,3 +134,15 @@ const saveWord = () => {
emit('addWord', wordData); emit('addWord', wordData);
}; };
</script> </script>
<style scoped>
.dict-w {
width: 83%;
}
@media (max-width: 768px) {
.btn-margin {
margin-top: 2.5rem
}
}
</style>

View File

@ -172,7 +172,7 @@
}).then(res => { }).then(res => {
if(res.data.data == '1'){ if(res.data.data == '1'){
toastStore.onToast('카테고리가 추가 등록 되었습니다.', 's'); toastStore.onToast('카테고리가 추가 등록 되었습니다.', 's');
const newCategory = { CMNCODNAM: data, CMNCODVAL: newValue.toString() }; // Assuming CMNCODVAL is the same as CMNCODNAM const newCategory = { CMNCODNAM: data, CMNCODVAL: newValue.toString() };
cateList.value.unshift(newCategory); cateList.value.unshift(newCategory);
selectCategory.value = newCategory.CMNCODVAL; selectCategory.value = newCategory.CMNCODVAL;
} }
@ -181,10 +181,6 @@
// //
const addWord = (wordData) => { const addWord = (wordData) => {
// console.log(' :', wordData.category); // WRDDICCAT
// console.log(' :', wordData.content); // WRDDICCON
// console.log(' :', wordData.title); // WRDDICTTL
axios.post('worddict/insertWord',{ axios.post('worddict/insertWord',{
WRDDICCAT : wordData.category, WRDDICCAT : wordData.category,
WRDDICTTL : wordData.title, WRDDICTTL : wordData.title,
@ -192,10 +188,8 @@
}).then(res => { }).then(res => {
if(res.data.data == '1'){ if(res.data.data == '1'){
toastStore.onToast('용어가 등록 되었습니다.', 's'); toastStore.onToast('용어가 등록 되었습니다.', 's');
isWriteVisible.value = false isWriteVisible.value = false;
// const newCategory = { CMNCODNAM: data, CMNCODVAL: newValue.toString() }; getwordList();
// cateList.value.unshift(newCategory);
// selectCategory.value = newCategory.CMNCODVAL;
} }
}) })
}; };