Skip to content

Commit

Permalink
회원 검색 기능 추가 수정, 게시글 조회시 추천 수 조회 기능 동작 로직 누락 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yhlee002 committed Jul 22, 2024
1 parent 6ca3e9c commit 998b0ef
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
17 changes: 10 additions & 7 deletions src/components/admin/AdminUserComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,16 @@ watch(searchOption, async (newVal, oldVal) => {
sortingResult(columns, list);
}, {deep: true});
// function changeSearchOptions(options, list) {
// for (let key in options) {
// if (options[key] !== 'ALL') {
// list.value = list.filter(item => item[key] === options[key]);
// }
// }
// }
watch(searchCondition, async (newVal, oldVal) => {
if (!keyword.value) return;
changeModalShow(false);
const list = await getUserList(newVal, searchCondition.value, keyword.value);
const columns = getSortingColumns(sorting.value);
sortingResult(columns, list);
})
function changeSortingType(name) {
const current = sorting.value[name];
Expand Down
10 changes: 5 additions & 5 deletions src/components/board/BoardItemComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ const recommendedCnt = ref(0);
if (props.category === 'boards') {
// 로그인 유저가 해당 글을 추천했는지 조회
getRecommendedByCurrentUser();
getRecommendedCount();
// 댓글 조회
await commentStore.getCommentsByBoard(board.id, commentStore.currentPage);
}
watch(recommended, async (newVal) => {
Expand Down Expand Up @@ -67,17 +70,14 @@ if (millisecond / 1000 < 60) {
}
writeTime += '';
// get comments
await commentStore.getCommentsByBoard(board.id, commentStore.currentPage);
async function submitComment() {
if (userStore.checkLogin()) {
const input = document.getElementById('commentInput');
const value = input.value;
const value = input.innerHTML;
if (value) {
const result = await commentStore.saveComment(board.id, userStore.user.memNo, value);
if (result.data) {
input.value = '';
input.innerHTML = '';
await commentStore.getCommentsByBoard(board.id, commentStore.currentPage, 20);
}
} else {
Expand Down
8 changes: 5 additions & 3 deletions src/components/fragment/HeaderComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {useUserStore} from '@/stores/user.js';
import Logo from "@/components/fragment/LogoComponent.vue";
import NoProfileImageComponent from "@/components/icon/NoProfileImageComponent.vue";
import UserImageComponent from "@/components/icon/UserImageComponent.vue";
const userStore = useUserStore();
userStore.getCurrentUser();
Expand Down Expand Up @@ -44,9 +45,10 @@ async function logout() {
<div class="user-image-box" v-if="userStore.isAuthenticated">
<!-- profile image -->
<img class="profile_image" v-if="userStore.profileImage"
:src="userStore.profileImage" alt="user profile image"/>
<NoProfileImageComponent v-if="!userStore.profileImage" :role="userStore.isAdmin ? 'ROLE_ADMIN' : 'ROLE_USER'"></NoProfileImageComponent>
<!-- <img class="profile_image" v-if="userStore.profileImage"-->
<!-- :src="userStore.profileImage" alt="user profile image"/>-->
<!-- <NoProfileImageComponent v-if="!userStore.profileImage" :role="userStore.isAdmin ? 'ROLE_ADMIN' : 'ROLE_USER'"></NoProfileImageComponent>-->
<UserImageComponent :profileImage="userStore.profileImage" :role="userStore.role"></UserImageComponent>
<span class="userbox-text" v-if="userStore.user != null">{{ userStore.user.name }}
<span v-if="userStore.user.role ==='ROLE_ADMIN'" style="color: #c6c6c6; font-size: 0.8rem">(관리자)</span>
</span>
Expand Down

0 comments on commit 998b0ef

Please sign in to comment.