jichoi / calendar star
류윤주 류윤주 07-22
250722 류윤주 수정
@5fa62fb09bc0f94fc42640c48e285f3a5b3b1b8c
client/resources/scss/admin/content.scss
--- client/resources/scss/admin/content.scss
+++ client/resources/scss/admin/content.scss
@@ -50,16 +50,18 @@
 
 }
 
-.sidemenu {
-    width: 350px;
+.side-content{
+    width: 400px;
+    height: 100%;
+    @include flex-layout(flex, flex-start, space-between, column);
     margin-right: 20px;
-
-    .myinfo {
-        text-align: center;
-        padding: 25px 20px 20px 20px;
-        margin-bottom: 20px;
-        border-radius: 20px;
-        background: linear-gradient(to bottom, #1F3F99, #3354CE);
+        .myinfo {
+            width: 100%;
+            text-align: center;
+            padding: 25px 20px 20px 20px;
+            margin-bottom: 20px;
+            border-radius: 20px;
+            background: linear-gradient(to bottom, #1F3F99, #3354CE);
 
         .name-box {
             margin-bottom: 30px;
@@ -247,78 +249,15 @@
 
     }
 
-    .menu-box {
-        summary {
-            cursor: pointer;
-            border: 1px solid #213F9A;
-            color: #000;
-            display: flex;
-            justify-content: space-between;
-            font-size: 17px;
-            text-align: left;
-            padding: 10px 15px;
-            border-radius: 10px;
-
-            .icon {
-                display: none;
-            }
-        }
-
-        margin-top: 20px;
-
-        ul {
-            padding: 10px 10px 0px 10px;
-        }
-
-        li {
-            margin-bottom: 10px;
-
-            a {
-                display: flex;
-                justify-content: space-between;
-                width: 100%;
-            }
-
-
-        }
-    }
-    .menu-box.danil{
-        a{display: block;
-            cursor: pointer;
-            border: 1px solid #213F9A;
-            color: #000;
-           
-            font-size: 17px;
-            text-align: left;
-            padding: 10px 15px;
-            border-radius: 10px;
-            margin-bottom: 10px;
-            li{
-                display: flex;
-                justify-content: space-between;
-                margin-bottom: 0px;
-                .icon {
-                    display: none;
-                }
-            }
-        }
-        a.active-link{
-            background: #213F9A;
-            li{
-                p{
-                    color: #fff;
-                }
-                .icon {
-                    display: block;
-                }
-            }
-        }
-    }
-    .boxs {
+        .boxs {
         background-color: #fff;
         border-radius: 20px;
         padding: 20px;
         margin-bottom: 20px;
+
+        &:last-child {
+            margin-bottom: 0;
+        }
 
         .box {
             display: flex;
@@ -442,6 +381,82 @@
 
     }
 
+}
+
+.sidemenu {
+    width: 350px;
+    margin-right: 20px;
+
+
+
+    .menu-box {
+        summary {
+            cursor: pointer;
+            border: 1px solid #213F9A;
+            color: #000;
+            display: flex;
+            justify-content: space-between;
+            font-size: 17px;
+            text-align: left;
+            padding: 10px 15px;
+            border-radius: 10px;
+
+            .icon {
+                display: none;
+            }
+        }
+
+        margin-top: 20px;
+
+        ul {
+            padding: 10px 10px 0px 10px;
+        }
+
+        li {
+            margin-bottom: 10px;
+
+            a {
+                display: flex;
+                justify-content: space-between;
+                width: 100%;
+            }
+
+
+        }
+    }
+    .menu-box.danil{
+        a{display: block;
+            cursor: pointer;
+            border: 1px solid #213F9A;
+            color: #000;
+           
+            font-size: 17px;
+            text-align: left;
+            padding: 10px 15px;
+            border-radius: 10px;
+            margin-bottom: 10px;
+            li{
+                display: flex;
+                justify-content: space-between;
+                margin-bottom: 0px;
+                .icon {
+                    display: none;
+                }
+            }
+        }
+        a.active-link{
+            background: #213F9A;
+            li{
+                p{
+                    color: #fff;
+                }
+                .icon {
+                    display: block;
+                }
+            }
+        }
+    }
+
     .router-link-active p {
         color: #213F9A;
         /* 원하는 색상으로 변경 */
@@ -538,6 +553,7 @@
 
         .blue-box {
             width: 550px;
+            height: calc(100% - 46px);
             background-color: #D7DCF1;
             border-radius: 10px;
             padding: 32px;
@@ -1477,4 +1493,13 @@
     mark {
         background-color: transparent;
     }
+}
+
+.schedule-zone{
+    @include flex-layout(flex, stretch);
+    height: calc(100% - 311px);
+    gap: 4rem;
+    .fc-direction-ltr{
+        width: 550px;
+    }
 }
(파일 끝에 줄바꿈 문자 없음)
client/resources/scss/admin/layout.scss
--- client/resources/scss/admin/layout.scss
+++ client/resources/scss/admin/layout.scss
@@ -32,6 +32,12 @@
 .container{height: 100%; padding: 2rem; background-color: #EFF1FA;}
 .main-wrap{
     display: flex;
+    height: calc(100% - 60px);
     .sidemenu{flex-shrink: 0;}
-    .content{width: 100%; padding: 30px; background-color: #fff; border-radius: 20px;}
+    .content{
+        width: 100%;
+        padding: 30px; 
+        background-color: #fff; 
+        border-radius: 20px;
+    }
 }
(파일 끝에 줄바꿈 문자 없음)
client/resources/scss/common/base/_reset.scss
--- client/resources/scss/common/base/_reset.scss
+++ client/resources/scss/common/base/_reset.scss
@@ -18,6 +18,11 @@
 	font-size: var(--#{$prefix}fz-body-md);
 	overflow-x: hidden;
 }
+
+#root{
+	width: 100%;
+	height: 100%;
+}
 *:focus {
 	@include focus();
 }
client/views/component/GoogleCalendar.vue
--- client/views/component/GoogleCalendar.vue
+++ client/views/component/GoogleCalendar.vue
@@ -1,114 +1,113 @@
 <template>
-    <div>
-      <FullCalendar  :options="calendarOptions" />
-    </div>
-  </template>
-  
-  <script>
-  import { ref, onMounted } from 'vue';
-  import FullCalendar from '@fullcalendar/vue3';
-  import dayGridPlugin from '@fullcalendar/daygrid';
+  <FullCalendar :options="calendarOptions" />
+</template>
 
+<script>
+import FullCalendar from '@fullcalendar/vue3'
+import dayGridPlugin from '@fullcalendar/daygrid'
 
-  
-  // gapi 스크립트 로드 함수
-  function loadGapiScript() {
-    return new Promise((resolve, reject) => {
-      const script = document.createElement('script');
-      script.src = 'https://apis.google.com/js/api.js';
-      script.onload = resolve; // 로드 성공
-      script.onerror = reject; // 로드 실패
-      document.head.appendChild(script);
-    });
-  }
-  
-  export default {
-    name: 'GoogleCalendar',
-    components: {
-      FullCalendar
-    },
-    setup() {
-      const events = ref([]);
-      const calendarOptions = ref({
+// gapi 스크립트 로드 함수
+function loadGapiScript() {
+  return new Promise((resolve, reject) => {
+    const script = document.createElement('script');
+    script.src = 'https://apis.google.com/js/api.js';
+    script.onload = resolve;
+    script.onerror = reject;
+    document.head.appendChild(script);
+  });
+}
+
+export default {
+  name: 'GoogleCalendar',
+  components: {
+    FullCalendar
+  },
+  data() {
+    return {
+      events: [],
+      calendarOptions: {
         plugins: [dayGridPlugin],
         initialView: 'dayGridMonth',
         events: [],
+        locale: 'ko',
         titleFormat: {
-  year: 'numeric',
-  month: '2-digit'
-},
-      locale: 'ko', // 한국어로 설정
-      headerToolbar: {
-        left: 'prev,next today',
-        center: 'title',
-        right: 'dayGridMonth,dayGridWeek,dayGridDay'
-      },
-      buttonText: {
-        today: '오늘',
-        month: '월',
-        week: '주',
-        day: '일'
-      },
-      showNonCurrentDates: false,
-      fixedWeekCount: false, 
-      });
-
-      const loadClient = () => {
+          year: 'numeric',
+          month: '2-digit'
+        },
+        headerToolbar: {
+          left: 'prev,next today',
+          center: 'title',
+          right: 'dayGridMonth,dayGridWeek,dayGridDay'
+        },
+        buttonText: {
+          today: '오늘',
+          month: '월',
+          week: '주',
+          day: '일'
+        },
+        showNonCurrentDates: false,
+        fixedWeekCount: false
+      }
+    }
+  },
+  mounted() {
+    this.initGoogleApi();
+  },
+  methods: {
+    async initGoogleApi() {
+      try {
+        await loadGapiScript();
         if (window.gapi) {
-          window.gapi.client.init({
-            apiKey: 'AIzaSyCNthSbTXgMrCG_dbuIhnk9BEVlp0ME5gM', // 공개 캘린더에 접근하기 위한 API Key
-            discoveryDocs: ['https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest'],
-          }).then(() => {
-            loadCalendarEvents();  // 공개 캘린더 이벤트 불러오기
-          }).catch(error => {
-            console.error('Error initializing gapi client:', error);
-          });
+          window.gapi.load('client', this.loadClient);
         } else {
-          console.error('gapi is not defined');
+          console.error('gapi is not defined after loading script');
         }
-      };
-  
-      const loadCalendarEvents = () => {
-        window.gapi.client.calendar.events.list({
-          calendarId: 'ko.south_korea#holiday@group.v.calendar.google.com', // 공개 캘린더 ID
-          timeMin: new Date().toISOString(), // 현재 시점 이후의 이벤트 가져오기
-          showDeleted: false,
-          singleEvents: true,
-          orderBy: 'startTime',
-        }).then((response) => {
-          events.value = response.result.items;
-          calendarOptions.value.events = events.value.map(event => ({
-            title: event.summary,
-            start: event.start.dateTime || event.start.date,
-            end: event.end.dateTime || event.end.date
-          }));
-        }).catch(error => {
-          console.error('Error loading calendar events:', error);
-        });
-      };
-  
-      onMounted(async () => {
-        try {
-          await loadGapiScript();
-          if (window.gapi) {
-            window.gapi.load('client', loadClient);
-          } else {
-            console.error('gapi is not defined after loading script');
-          }
-        } catch (error) {
-          console.error('Error loading gapi script:', error);
-        }
-      });
-  
-      return {
-        calendarOptions
-      };
+      } catch (error) {
+        console.error('Error loading gapi script:', error);
+      }
     },
-  };
-  </script>
-  
-  <style scoped>
-  .fc .fc-daygrid-day-frame {
+    loadClient() {
+      window.gapi.client.init({
+        apiKey: 'AIzaSyCNthSbTXgMrCG_dbuIhnk9BEVlp0ME5gM',
+        discoveryDocs: ['https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest'],
+      }).then(() => {
+        this.loadCalendarEvents();
+      }).catch(error => {
+        console.error('Error initializing gapi client:', error);
+      });
+    },
+    loadCalendarEvents() {
+      window.gapi.client.calendar.events.list({
+        calendarId: 'ko.south_korea#holiday@group.v.calendar.google.com',
+        timeMin: new Date().toISOString(),
+        showDeleted: false,
+        singleEvents: true,
+        orderBy: 'startTime',
+      }).then((response) => {
+        this.events = response.result.items;
+        this.calendarOptions.events = this.events.map(event => ({
+          title: event.summary,
+          start: event.start.dateTime || event.start.date,
+          end: event.end.dateTime || event.end.date
+        }));
+      }).catch(error => {
+        console.error('Error loading calendar events:', error);
+      });
+    }
+  }
+}
+</script>
+
+<style scoped>
+::v-deep(.fc .fc-daygrid-day-frame) {
   background-color: #fff !important;
 }
-</style>
(파일 끝에 줄바꿈 문자 없음)
+
+::v-deep(.fc-icon-chevron-right::before),
+::v-deep(.fc-icon-chevron-left::before) {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
+</style>
client/views/pages/main/Main.vue
--- client/views/pages/main/Main.vue
+++ client/views/pages/main/Main.vue
@@ -1,5 +1,5 @@
 <template>
-    <div class="sidemenu">
+    <div class="side-content">
         <div class="myinfo">
             <div class="name-box">
                 <div class="img-area">
@@ -86,7 +86,7 @@
             </div>
             <div class="boxs" style="width: 100%;">
                 <div class="title">
-                    <h2>오늘의 주요 </h2>
+                    <h2>프로젝트 현황</h2>
                     <div class="sub">더보기<img :src="moreicon" alt=""></div>
                 </div>
                 <div class="board tbl-wrap">
@@ -107,7 +107,15 @@
                 </div>
             </div>
         </div>
-        <GoogleCalendar />
+        <div class="schedule-zone">
+            <GoogleCalendar />
+            <div class="boxs">
+                <div class="title">
+                    <h2>오늘의 주요 일정</h2>
+                    <!-- <div class="sub">더보기<img :src="moreicon" alt=""></div> -->
+                </div>
+            </div>
+        </div>
     </div>
 </template>
 
 
client/views/pages/main/Main2.vue (deleted)
--- client/views/pages/main/Main2.vue
@@ -1,24 +0,0 @@
-<template>
-    <div>Main2.vue</div>
-</template>
-
-<script>
-export default {
-    data () {
-        return {
-        }
-    },
-    methods: {
-
-    },
-    watch: {
-
-    },
-    computed: {
-
-    },
-    mounted() {
-        console.log('Main2 mounted');
-    }
-}
-</script>(파일 끝에 줄바꿈 문자 없음)
Add a comment
List