Merge branch 'main' into login
This commit is contained in:
commit
4d8c0ff9f8
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "front",
|
||||
"version": "0.0.0",
|
||||
"version": "0.0.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "front",
|
||||
"version": "0.0.0",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@fullcalendar/core": "^6.1.15",
|
||||
"@fullcalendar/daygrid": "^6.1.15",
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
</span>
|
||||
</h5>
|
||||
<!-- 본문 -->
|
||||
<p class="card-text str_wrap">{{ content }}</p>
|
||||
<div class="card-text str_wrap" v-html="$common.contentToHtml(content)"></div>
|
||||
<!-- 날짜 -->
|
||||
<div class="d-flex justify-content-between">
|
||||
<small class="text-muted">{{ formattedDate }}</small>
|
||||
|
||||
@ -43,6 +43,18 @@
|
||||
<div class="text-truncate">Board</div>
|
||||
</RouterLink>
|
||||
</li>
|
||||
<li class="menu-item" :class="$route.path.includes('/wordDict') ? 'active' : ''">
|
||||
<RouterLink class="menu-link" to="/wordDict">
|
||||
<i class="menu-icon icon-base bx bx-book-open"></i>
|
||||
<div class="text-truncate">wordDict</div>
|
||||
</RouterLink>
|
||||
</li>
|
||||
<li class="menu-item" :class="$route.path.includes('/voteboard') ? 'active' : ''">
|
||||
<RouterLink class="menu-link" to="/voteboard">
|
||||
<i class="menu-icon icon-base bx bx-box"></i>
|
||||
<div class="text-truncate">voteboard</div>
|
||||
</RouterLink>
|
||||
</li>
|
||||
<li class="menu-item" :class="$route.path.includes('/vacation') ? 'active' : ''">
|
||||
<RouterLink class="menu-link" to="/vacation">
|
||||
<i class="menu-icon tf-icons bx bx-calendar"></i>
|
||||
|
||||
@ -11,7 +11,9 @@
|
||||
<div class="card-body">
|
||||
<h5 class="mb-4">{{ boardTitle }}</h5>
|
||||
<!-- HTML 콘텐츠 렌더링 -->
|
||||
<div class="board-content text-body" style="line-height: 1.6;" v-html="convertedContent"></div>
|
||||
<div class="board-content text-body" style="line-height: 1.6;" v-html="$common.contentToHtml(boardContent)">
|
||||
|
||||
</div>
|
||||
<!-- 첨부파일 목록 -->
|
||||
<ul v-if="attachments.length" class="attachments mt-4 list-unstyled">
|
||||
<li v-for="(attachment, index) in attachments" :key="index" class="mb-2">
|
||||
@ -40,7 +42,6 @@ import { ref, onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import axios from '@api';
|
||||
import Quill from 'quill';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
// 게시물 데이터 상태
|
||||
const profileName = ref('익명 사용자');
|
||||
@ -72,20 +73,6 @@ const fetchBoardDetails = async () => {
|
||||
boardTitle.value = boardDetail.title || '제목 없음';
|
||||
boardContent.value = boardDetail.content || '';
|
||||
|
||||
// Quill을 사용하여 Delta 데이터를 HTML로 변환
|
||||
if (boardContent.value) {
|
||||
try {
|
||||
const quillContainer = document.createElement('div');
|
||||
const quillInstance = new Quill(quillContainer);
|
||||
quillInstance.setContents(JSON.parse(boardContent.value));
|
||||
convertedContent.value = DOMPurify.sanitize(quillContainer.innerHTML);
|
||||
} catch (parseError) {
|
||||
console.error('Delta 데이터 변환 오류:', parseError);
|
||||
convertedContent.value = '내용을 표시할 수 없습니다.';
|
||||
}
|
||||
} else {
|
||||
convertedContent.value = '내용 없음';
|
||||
}
|
||||
|
||||
attachments.value = data.attachments || [];
|
||||
comments.value = data.comments || [];
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
import QEditor from '@c/editor/QEditor.vue';
|
||||
import FormInput from '@c/input/FormInput.vue';
|
||||
import FormFile from '@c/input/FormFile.vue';
|
||||
import { ref } from 'vue';
|
||||
import { getCurrentInstance, ref } from 'vue';
|
||||
import router from '@/router';
|
||||
import axios from '@api';
|
||||
|
||||
@ -100,6 +100,9 @@ const passwordAlert = ref(false);
|
||||
const contentAlert = ref(false);
|
||||
const attachFilesAlert = ref(false);
|
||||
|
||||
const { appContext } = getCurrentInstance();
|
||||
const $common = appContext.config.globalProperties.$common; // $common에 접근
|
||||
|
||||
const goList = () => {
|
||||
router.push('/board');
|
||||
};
|
||||
@ -116,7 +119,7 @@ const write = async () => {
|
||||
try {
|
||||
const boardData = {
|
||||
LOCBRDTTL: title.value,
|
||||
LOCBRDCON: content.value,
|
||||
LOCBRDCON: $common.deltaAsJson(content.value),
|
||||
LOCBRDPWD: category.value === 1 ? password.value : null,
|
||||
LOCBRDTYP: category.value === 1 ? 'S' : 'F',
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user