Skip to content

Commit

Permalink
Merge pull request #23 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 8dc2754 + 44db016 commit 2df7dbf
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 5 deletions.
16 changes: 14 additions & 2 deletions src/components/basic/CommonTopMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<v-btn type="submit">이동</v-btn>
</v-col>
<v-col cols="auto">
<v-btn icon @click="createWorkspace">
<v-btn icon @click="showWorkspaceModal">
<v-icon>mdi-plus</v-icon>
</v-btn>
</v-col>
Expand All @@ -32,19 +32,27 @@

</template>
</v-app-bar>
<CreateWorkspaceModal
v-model = "createWorkspace"
@update:dialog="createWorkspace = $event"
>
</CreateWorkspaceModal>
</template>

<script>
import axios from "axios";
import CreateWorkspaceModal from '@/components/createSpaces/CreateWorkspaceModal.vue';
export default {
name: "CommonTopMenu",
components: {
CreateWorkspaceModal
},
data() {
return {
items: [],
selectedValue: null,
createWorkspace:false,
};
},
created() {
Expand All @@ -67,7 +75,11 @@ export default {
},
emitSelected() {
this.$emit('selected', this.selectedValue);
}
},
showWorkspaceModal() {
this.createWorkspace = true;
console.log(this.createWorkspace);
}
}
};
</script>
Expand Down
9 changes: 6 additions & 3 deletions src/components/basic/InnerRelatedMenuHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,26 @@
</v-list-item>
</v-list>
<div>
<v-icon @click="createSection">mdi-plus</v-icon>새 섹션 생성
<v-icon @click="showSectionModal">mdi-plus</v-icon>새 섹션 생성
</div>

</v-navigation-drawer>

</template>

<script>
import axios from "axios";
import { mapActions } from "vuex";
export default {
props: {
selectedValue: {
type: Number,
}
},
name: "InnerRelatedMenuHome",
components: {},
components: {
},
created() {
// this.selectedMenuId = this.$store.getters.getChannelId;
// this.selectedMenuId = this.selectedMenuId != null ? this.selectedMenuId : "l"; // 기본값으로 일단 1번 선택
Expand All @@ -59,6 +61,7 @@ export default {
// selectedMenuId: "1", // 기본값으로 일단 1번 선택
workspaceInfo: {},
workspaceName: "",
};
},
methods: {
Expand Down
Empty file.
Empty file.
61 changes: 61 additions & 0 deletions src/components/createSpaces/CreateWorkspaceModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<template>
<v-dialog max-width="500px">
<v-card>
<v-card-title class="text-h5 text-center">
워크스페이스 생성하기 </v-card-title
><br />
<v-card-text>
<v-form @submit.prevent="createWorkspace">
<v-text-field
label="name"
v-model="name"
required
>
</v-text-field>
<v-text-field
label="wsInfo"
v-model="wsInfo"
required
>
</v-text-field>
<v-btn type="submit" color="blue">완료</v-btn>
<v-btn color="grey" @click="closeModal">닫기</v-btn>
</v-form>
</v-card-text>
</v-card>
</v-dialog>
</template>

<script>
import axios from 'axios'
export default {
data() {
return {
name:"",
wsInfo:"",
}
},
methods: {
async createWorkspace() {
const body = {
name:this.name,
wsInfo:this.wsInfo,
}
try {
const token = "eyJhbGciOiJIUzM4NCJ9.eyJzdWIiOiJtaW5qaTIyNzZAZ21haWwuY29tIiwiaWF0IjoxNzI3ODM0NTQ0LCJleHAiOjE3Mjg0MzkzNDR9.l3yDcj9uMg1iT_71PTeihdjUgp974t-Oz_ucZnmOQHF-i4d7la7X1MOY-WCNPaQx";
await axios.post(`${process.env.VUE_APP_API_BASE_URL}/workspace/create`, body, {
headers: {
'Authorization': `Bearer ${token}` // 토큰을 헤더에 추가
}
});
this.$emit('update:dialog', false);
} catch(e) {
console.log(e);
}
},
closeModal() {
this.$emit('update:dialog', false);
}
}
}
</script>

0 comments on commit 2df7dbf

Please sign in to comment.