Skip to content

Commit

Permalink
Merge pull request #20 from hw-coconote/feat/HC-6
Browse files Browse the repository at this point in the history
feat/HC-6 워크스페이스별 섹션, 채널 목록 조회 기능 추가
  • Loading branch information
jsangmin99 authored Oct 2, 2024
2 parents 007be27 + d4c9f81 commit 8dc2754
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 11 deletions.
7 changes: 6 additions & 1 deletion src/components/basic/CommonTopMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@
class="inline"
style="font-size:0.9rem"
></v-select>
</v-col>
</v-col>
<v-col cols="auto">
<v-btn type="submit">이동</v-btn>
</v-col>
<v-col cols="auto">
<v-btn icon @click="createWorkspace">
<v-icon>mdi-plus</v-icon>
</v-btn>
</v-col>
</v-row>
</v-form>

Expand Down
42 changes: 32 additions & 10 deletions src/components/basic/InnerRelatedMenuHome.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
<template>
<v-navigation-drawer permanent class="innerSubMenu" :absolute="false" >
<h1>코코노트 동아리</h1>
<h1>워크스페이스 이름 들어가야 함</h1>
<v-icon>mdi-cog</v-icon>
<div>
{{ workspaceName }}<v-icon v-if="!workspaceUser">mdi-cogs</v-icon>
</div>
<!-- <h1>{{ workspaceName }} <v-icon>mdi-cog</v-icon></h1> -->
<v-list v-for="section in workspaceInfo" :key="section.sectionId">
<v-list-subheader class="section-title">
<v-icon icon="mdi-menu-right" />{{ section.sectionName }}
</v-list-subheader>
<v-list-item v-for="channel in section.channelList" :key="channel.channelId"
:title= "channel.channelName"
value="1"
@click="goToThread('1', '공지채널')"
:class="{ 'selected-item': selectedMenuId == '1' }"
value="channel.channelId"
@click="goToThread('channel.channelId', 'channel.channelName')"
:class="{ 'selected-item': selectedMenuId == 'channel.channelId' }"
class="channel-item"
></v-list-item>
><template v-slot:prepend>
<v-icon>{{ channel.isPublic ? 'mdi-pound' : 'mdi-lock' }}</v-icon>
<span>{{ channel.channelName }}</span>
</template>
</v-list-item>
<v-list-item @click="createChannel">
<template v-slot:prepend>
<v-icon>mdi-plus</v-icon>
<span>새 채널 생성</span>
</template>
</v-list-item>
</v-list>
<div>
<v-icon @click="createSection">mdi-plus</v-icon>새 섹션 생성
</div>

</v-navigation-drawer>
</template>

Expand Down Expand Up @@ -44,6 +58,7 @@ export default {
// 선택된 메뉴를 저장할 변수
// selectedMenuId: "1", // 기본값으로 일단 1번 선택
workspaceInfo: {},
workspaceName: "",
};
},
methods: {
Expand All @@ -58,12 +73,19 @@ export default {
async fetchWorkspaceInfo() {
try {
const token = "eyJhbGciOiJIUzM4NCJ9.eyJzdWIiOiJtaW5qaTIyNzZAZ21haWwuY29tIiwiaWF0IjoxNzI3ODM0NTQ0LCJleHAiOjE3Mjg0MzkzNDR9.l3yDcj9uMg1iT_71PTeihdjUgp974t-Oz_ucZnmOQHF-i4d7la7X1MOY-WCNPaQx";
const response = await axios.get(`${process.env.VUE_APP_API_BASE_URL}/workspace/detail/${this.selectedValue}`, {
const wsList = await axios.get(`${process.env.VUE_APP_API_BASE_URL}/workspace/list`, {
headers: {
'Authorization': `Bearer ${token}` // 토큰을 헤더에 추가
}
});
const wsDetail = await axios.get(`${process.env.VUE_APP_API_BASE_URL}/workspace/detail/${this.selectedValue}`, {
headers: {
'Authorization': `Bearer ${token}` // 토큰을 헤더에 추가
}
});
this.workspaceInfo = response.data.result;
this.workspaceName = wsList.data.result[this.selectedValue -1].name;
this.workspaceInfo = wsDetail.data.result;
} catch (e) {
console.log(e);
}
Expand Down
27 changes: 27 additions & 0 deletions src/components/basic/InnerRelatedMenuMember.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
</template>

<script>
import axios from "axios";
export default {
props: {
selectedValue: {
Expand All @@ -23,6 +25,31 @@ export default {
},
name: "InnerRelatedMenuMember",
components: {},
updated() {
this.fetchWorkspaceInfo();
},
data() {
return {
workspaceInfo: {},
workspaceName: "",
};
},
methods: {
async fetchWorkspaceInfo() {
try {
const token = "eyJhbGciOiJIUzM4NCJ9.eyJzdWIiOiJtaW5qaTIyNzZAZ21haWwuY29tIiwiaWF0IjoxNzI3ODM0NTQ0LCJleHAiOjE3Mjg0MzkzNDR9.l3yDcj9uMg1iT_71PTeihdjUgp974t-Oz_ucZnmOQHF-i4d7la7X1MOY-WCNPaQx";
const wsList = await axios.get(`${process.env.VUE_APP_API_BASE_URL}/workspace/list`, {
headers: {
'Authorization': `Bearer ${token}` // 토큰을 헤더에 추가
}
});
this.workspaceName = wsList.data.result[this.selectedValue -1].name;
} catch (e) {
console.log(e);
}
},
},
};
</script>

Expand Down

0 comments on commit 8dc2754

Please sign in to comment.