jichoi / lms_front star
PsHooN7979 08-09
240809 박세훈 반 아이디 세션 스토리지로 전달기능 추가
@22fc379acf4ea671be86a6fa7c8bce6a1a21f77a
client/views/pages/teacher/Board.vue
--- client/views/pages/teacher/Board.vue
+++ client/views/pages/teacher/Board.vue
@@ -44,7 +44,7 @@
           <td>{{ item.bbsTtl }}</td>
           <td>{{ item.bbsCls }}</td>
           <td>{{ userNm }}</td>
-          <td>{{ item.bbsTm }}</td>
+          <td>{{ item.bbsTm.substr(0, 16) }}</td>
         </tr>
       </tbody>
     </table>
@@ -94,13 +94,14 @@
       dataList: [],
       totalPosts: 0,
       selectedRow: "",
+      bbsTm: "",
 
       // 페이징
       currentPage: 0,
       itemsPerPage: 8,
 
       // 반 아이디 (추후 세션에서 받는걸로 수정)
-      sclsId: "1",
+      sclsId: "",
       classList: [],
 
       userId: "",
@@ -133,6 +134,7 @@
     // 게시글 전체 조회
     boardList() {
       const vm = this;
+      vm.sclsId = JSON.parse(sessionStorage.getItem("sclsId"));
       axios({
         url: "/board/findAll.json",
         method: "post",
@@ -155,6 +157,7 @@
           vm.selectClass();
           sessionStorage.removeItem("selectedBoardList");
           sessionStorage.removeItem("file");
+
           console.log(vm.userId);
         })
         .catch(function (error) {
@@ -168,9 +171,6 @@
     },
 
     // 반 아이디 세션에 저장
-    setClassId() {
-      sessionStorage.setItem("sclsId", JSON.stringify(this.sclsId));
-    },
 
     // 게시글 검색
     boardDataSearch() {
client/views/pages/teacher/ClassDetail.vue
--- client/views/pages/teacher/ClassDetail.vue
+++ client/views/pages/teacher/ClassDetail.vue
@@ -1,153 +1,161 @@
 <template>
-    <div class="title-box flex justify-between mb40">
-        <p class="title">반 관리</p>
+  <div class="title-box flex justify-between mb40">
+    <p class="title">반 관리</p>
+  </div>
+  <div class="wrap mb30">
+    <div class="flex justify-between mb30 align-center">
+      <label for="" class="title1">학습 현황</label>
+      <div class="look-btn flex align-center" @click="goToPage('Board')">
+        <p>자세히 보기</p>
+        <svg-icon type="mdi" :path="mdilArrowRight" class="ml10"></svg-icon>
+      </div>
+    </div>
+    <div class="table-wrap">
+      <table>
+        <thead>
+          <td>No.</td>
+          <td>제목</td>
+          <td>내용</td>
+          <td>작성자</td>
+          <td>등록일</td>
+        </thead>
+        <tbody>
+          <tr>
+            <td></td>
+            <td></td>
+            <td></td>
+            <td></td>
+            <td></td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+  </div>
+  <div class="flex justify-between" style="gap: 30px">
+    <div class="wrap mb30">
+      <div class="flex justify-between mb30 align-center">
+        <label for="" class="title1">학생 목록</label>
+        <div class="look-btn align-center flex">
+          <p>자세히 보기</p>
+          <svg-icon type="mdi" :path="mdilArrowRight" class="ml10"></svg-icon>
+        </div>
+      </div>
+      <div class="table-wrap">
+        <table>
+          <thead>
+            <td>No.</td>
+            <td>이름</td>
+            <td>학년</td>
+            <td>반</td>
+          </thead>
+          <tbody>
+            <tr>
+              <td></td>
+              <td></td>
+              <td></td>
+              <td></td>
+            </tr>
+          </tbody>
+        </table>
+      </div>
     </div>
     <div class="wrap mb30">
-        <div class="flex justify-between mb30 align-center">
-            <label for="" class="title1">학습 현황</label>
-            <div class="look-btn flex align-center">
-                <p>자세히 보기 </p>
-                <svg-icon type="mdi" :path="mdilArrowRight" class=" ml10"></svg-icon>
+      <div class="flex justify-between mb30 align-center">
+        <label for="" class="title1">책 </label>
+        <div class="align-center flex look-btn">
+          <p>자세히 보기</p>
+          <svg-icon type="mdi" :path="mdilArrowRight" class="ml10"></svg-icon>
+        </div>
+      </div>
+      <div class="flex" style="gap: 50px">
+        <div class="textbook">
+          <div class="box" style="gap: 10px"></div>
+          <div class="text">
+            <p class="title1" style="color: #fff">A 교재</p>
+            <div
+              class="btnGroup mt15 flex align-center justify-end"
+              style="gap: 10px"
+            >
+              <button>수정</button>
+              <p>&#124;</p>
+              <button @click="showConfirm('delete')">삭제</button>
             </div>
+          </div>
         </div>
-        <div class="table-wrap">
-            <table>
-                <thead>
-                    <td>No.</td>
-                    <td>제목</td>
-                    <td>내용</td>
-                    <td>작성자</td>
-                    <td>등록일</td>
-                </thead>
-                <tbody>
-                    <tr>
-                        <td></td>
-                        <td></td>
-                        <td></td>
-                        <td></td>
-                        <td></td>
-                    </tr>
-                </tbody>
-            </table>
+        <div class="textbook">
+          <div class="box" style="gap: 10px"></div>
+          <div class="text">
+            <p class="title1" style="color: #fff">A 교재</p>
+            <div
+              class="btnGroup mt15 flex align-center justify-end"
+              style="gap: 10px"
+            >
+              <button>수정</button>
+              <p>&#124;</p>
+              <button @click="showConfirm('delete')">삭제</button>
+            </div>
+          </div>
         </div>
+      </div>
     </div>
-    <div class="flex justify-between" style="gap: 30px;">
-        <div class="wrap mb30">
-            <div class="flex justify-between mb30 align-center">
-                <label for="" class="title1">학생 목록</label>
-                <div class="look-btn align-center flex">
-                    <p>자세히 보기 </p>
-                    <svg-icon type="mdi" :path="mdilArrowRight" class=" ml10"></svg-icon>
-                </div>
-            </div>
-            <div class="table-wrap">
-                <table>
-                    <thead>
-                        <td>No.</td>
-                        <td>이름</td>
-                        <td>학년</td>
-                        <td>반</td>
-                    </thead>
-                    <tbody>
-                        <tr>
-                            <td></td>
-                            <td></td>
-                            <td></td>
-                            <td></td>
-                        </tr>
-                    </tbody>
-                </table>
-            </div>
-        </div>
-        <div class="wrap mb30">
-            <div class="flex justify-between mb30 align-center">
-                <label for="" class="title1">책 </label>
-                <div class="align-center flex look-btn"><p>자세히 보기 </p><svg-icon type="mdi" :path="mdilArrowRight" class=" ml10"></svg-icon></div>
-            </div>
-            <div  class=" flex " style="gap: 50px;">
-                <div class="textbook">
-                    <div class="box " style="gap: 10px;">
-                    </div>
-                    <div class="text ">
-                        <p class="title1" style="color: #fff;">A 교재</p>
-                        <div class="btnGroup mt15 flex align-center justify-end" style="gap: 10px;">
-                            <button>수정</button><p>&#124;</p>
-                            <button @click="showConfirm('delete')">삭제</button>
-                        </div>
-                    </div>
-                </div>
-                <div class="textbook">
-                    <div class="box " style="gap: 10px;">
-                    </div>
-                    <div class="text ">
-                        <p class="title1" style="color: #fff;">A 교재</p>
-                        <div class="btnGroup mt15 flex align-center justify-end" style="gap: 10px;">
-                            <button>수정</button><p>&#124;</p>
-                            <button @click="showConfirm('delete')">삭제</button>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
+  </div>
 </template>
 
 <script>
-import SvgIcon from '@jamescoyle/vue-icon';
-import { mdiMagnify,  } from '@mdi/js';
-import { mdilArrowRight } from '@mdi/light-js';
-import ProgressBar from '../../component/ProgressBar.vue';
-
+import SvgIcon from "@jamescoyle/vue-icon";
+import { mdiMagnify } from "@mdi/js";
+import { mdilArrowRight } from "@mdi/light-js";
+import ProgressBar from "../../component/ProgressBar.vue";
 
 export default {
-    data() {
-        return {
-            mdiMagnify: mdiMagnify,
-            mdilArrowRight: mdilArrowRight,
-            timer: "00:00",
-            progress: 20,
+  data() {
+    return {
+      mdiMagnify: mdiMagnify,
+      mdilArrowRight: mdilArrowRight,
+      timer: "00:00",
+      progress: 20,
 
-            // 교사 홈페이지에서 쿼리 파라미터로부터 전달받은 선택된 반의 아이디
-            selectedClassId : this.$route.query.sclsId 
-        }
+      // 교사 홈페이지에서 쿼리 파라미터로부터 전달받은 선택된 반의 아이디
+      selectedClassId: this.$route.query.sclsId,
+    };
+  },
+  methods: {
+    goToPage(page) {
+      this.$router.push({ name: page });
     },
-    methods: {
-        goToPage(page) {
-            this.$router.push({ name: page });
-        },
-        increaseProgress() {
-            if (this.progress < 100) {
-                this.progress += 10;
-            }
-        },
-        showConfirm(type) {
-            let message = '';
-            if (type === 'cancel') {
-                message = '삭제하시겠습니까?';
-            } else if (type === 'reset') {
-                message = '초기화하시겠습니까?';
-            } else if (type === 'save') {
-                message = '등록하시겠습니까?';
-            }
+    increaseProgress() {
+      if (this.progress < 100) {
+        this.progress += 10;
+      }
+    },
+    showConfirm(type) {
+      let message = "";
+      if (type === "cancel") {
+        message = "삭제하시겠습니까?";
+      } else if (type === "reset") {
+        message = "초기화하시겠습니까?";
+      } else if (type === "save") {
+        message = "등록하시겠습니까?";
+      }
 
-            if (confirm(message)) {
-                this.goBack();
-            }
-        },
+      if (confirm(message)) {
+        this.goBack();
+      }
     },
-    watch: {
-
+    setClassId() {
+      sessionStorage.setItem("sclsId", JSON.stringify(this.selectedClassId));
     },
-    computed: {
-
-    },
-    components: {
-        SvgIcon,
-        ProgressBar
-    },
-    mounted() {
-        console.log('Main2 mounted');
-        //console.log(`반 페이지 sclsId(반 아이디) 확인 : ${this.selectedClassId}`);
-    }
-}
-</script>
(파일 끝에 줄바꿈 문자 없음)
+  },
+  watch: {},
+  computed: {},
+  components: {
+    SvgIcon,
+    ProgressBar,
+  },
+  mounted() {
+    console.log("Main2 mounted");
+    //console.log(`반 페이지 sclsId(반 아이디) 확인 : ${this.selectedClassId}`);
+    this.setClassId();
+  },
+};
+</script>
client/views/pages/teacher/Home.vue
--- client/views/pages/teacher/Home.vue
+++ client/views/pages/teacher/Home.vue
@@ -1,268 +1,289 @@
 <template>
-    <div class="title-box flex justify-between mb40">
-        <p class="title">홈</p>
-    </div>
-    <div class="content-t">
-        <div class=" flex " style="gap: 50px;" :style="{flexWrap: 'wrap'}">
-            <div class="class" v-for="classItem in classesList" :key="classItem.sclsId">
-                <div class="box gd-col2" style="gap: 10px;" @click="goToPage('ClassDetail', classItem.sclsId)">
-                    <div><img src="../../../resources/img/img176_82t.png" alt=""></div>
-                    <div><img src="../../../resources/img/img176_82t.png" alt=""></div>
-                    <div><img src="../../../resources/img/img176_82t.png" alt=""></div>
-                    <div><img src="../../../resources/img/img176_82t.png" alt=""></div>
-                </div>
-                <div class="text flex justify-between mt20">
-                    <p class="title1">{{ classItem.sclsNm }}</p>
-                    <span class="member">{{ classItem. studentCount}}</span>
-                </div>
-                <div class="btnGroup mt15 flex align-center justify-end" style="gap: 10px;">
-                    <button @click="editModeModal(classItem.sclsId)">수정</button>
-                    <p>&#124;</p>
-                    <button @click="deleteClass(classItem.sclsId)">삭제</button>
-                </div>
-            </div>
-            <div class="textbook-add">
-                <button @click="addModeModal"><img src="../../../resources/img/btn32_98t_normal.png" alt=""></button>
-
-            </div>
-            <!-- 팝업창 -->
-            <div v-show="searchOpen" class="popup-wrap">
-                <div class="popup-box ">
-                    <div class="flex justify-between mb30">
-                        <p class="popup-title">반 이름</p>
-                        <button type="button" class="popup-close-btn" @click="closeBtn">
-                            <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon>
-
-                        </button>
-                    </div>
-                    <div class="search-wrap mb30">
-                        <input type="text" v-model="createClassName"  class="data-wrap" placeholder="">
-                        <!-- <button type="button" >
+  <div class="title-box flex justify-between mb40">
+    <p class="title">홈</p>
+  </div>
+  <div class="content-t">
+    <div class="flex" style="gap: 50px" :style="{ flexWrap: 'wrap' }">
+      <div
+        class="class"
+        v-for="classItem in classesList"
+        :key="classItem.sclsId"
+      >
+        <div
+          class="box gd-col2"
+          style="gap: 10px"
+          @click="goToPage('ClassDetail', classItem.sclsId)"
+        >
+          <div><img src="../../../resources/img/img176_82t.png" alt="" /></div>
+          <div><img src="../../../resources/img/img176_82t.png" alt="" /></div>
+          <div><img src="../../../resources/img/img176_82t.png" alt="" /></div>
+          <div><img src="../../../resources/img/img176_82t.png" alt="" /></div>
+        </div>
+        <div class="text flex justify-between mt20">
+          <p class="title1">{{ classItem.sclsNm }}</p>
+          <span class="member">{{ classItem.studentCount }}</span>
+        </div>
+        <div
+          class="btnGroup mt15 flex align-center justify-end"
+          style="gap: 10px"
+        >
+          <button @click="editModeModal(classItem.sclsId)">수정</button>
+          <p>&#124;</p>
+          <button @click="deleteClass(classItem.sclsId)">삭제</button>
+        </div>
+      </div>
+      <div class="textbook-add">
+        <button @click="addModeModal">
+          <img src="../../../resources/img/btn32_98t_normal.png" alt="" />
+        </button>
+      </div>
+      <!-- 팝업창 -->
+      <div v-show="searchOpen" class="popup-wrap">
+        <div class="popup-box">
+          <div class="flex justify-between mb30">
+            <p class="popup-title">반 이름</p>
+            <button type="button" class="popup-close-btn" @click="closeBtn">
+              <svg-icon
+                type="mdi"
+                :path="mdiWindowClose"
+                class="close-btn"
+              ></svg-icon>
+            </button>
+          </div>
+          <div class="search-wrap mb30">
+            <input
+              type="text"
+              v-model="createClassName"
+              class="data-wrap"
+              placeholder=""
+            />
+            <!-- <button type="button" >
                             <img src="../../../resources/img/look_t.png" alt="">
                         </button> -->
-                    </div>
-                    <div class="flex justify-center ">
-                        <button type="button" title="글쓰기" class="new-btn mr10" @click="closeBtn">
-                            취소
-                        </button>
-                        <button type="button" title="등록" class="new-btn" @click="isEditMode ? updateClass() : insertClass()">
-                            {{ isEditMode ? '수정' : '등록' }}
-                        </button>
-                    </div>
-                </div>
-            </div>
+          </div>
+          <div class="flex justify-center">
+            <button
+              type="button"
+              title="글쓰기"
+              class="new-btn mr10"
+              @click="closeBtn"
+            >
+              취소
+            </button>
+            <button
+              type="button"
+              title="등록"
+              class="new-btn"
+              @click="isEditMode ? updateClass() : insertClass()"
+            >
+              {{ isEditMode ? "수정" : "등록" }}
+            </button>
+          </div>
         </div>
+      </div>
     </div>
+  </div>
 </template>
 
 <script>
-import axios from 'axios';
-import SvgIcon from '@jamescoyle/vue-icon';
-import { mdiMagnify, mdiWindowClose } from '@mdi/js';
+import axios from "axios";
+import SvgIcon from "@jamescoyle/vue-icon";
+import { mdiMagnify, mdiWindowClose } from "@mdi/js";
 export default {
-    data() {
-        return {
-            mdiWindowClose: mdiWindowClose,
-            showModal: false,
-            searchOpen: false,
+  data() {
+    return {
+      mdiWindowClose: mdiWindowClose,
+      showModal: false,
+      searchOpen: false,
 
-            classesList : [], // 불러온 반 정보
-            user_id : '2', //유저 아이디 : 현재는 고정
-            createClassName : "", // 생성 또는 수정할 반 이름
+      classesList: [], // 불러온 반 정보
+      user_id: "2", //유저 아이디 : 현재는 고정
+      createClassName: "", // 생성 또는 수정할 반 이름
 
-            isEditMode: false, // 추가 모드인지 수정 모드인지 구분하는 변수
-            current_editId : '', // 현재 수정할 반 id
-        }
+      isEditMode: false, // 추가 모드인지 수정 모드인지 구분하는 변수
+      current_editId: "", // 현재 수정할 반 id
+    };
+  },
+  methods: {
+    goToPage(page, sclsId) {
+      //console.log(`sclsId : ${sclsId}`); // 쿼리 확인
+      this.$router.push({ name: page, query: { sclsId: sclsId } });
     },
-    methods: {
-       
-        goToPage(page, sclsId) {
-            //console.log(`sclsId : ${sclsId}`); // 쿼리 확인
-            this.$router.push({ name: page , query : {sclsId : sclsId}});
-        },
-        closeModal() {
-            this.showModal = false;
-        },
-        editModeModal(sclsId) {
-            this.searchOpen = true;
-            this.isEditMode = true; // 수정 모드로 설정
-            this.current_editId = sclsId
-        },
-        addModeModal() {
-            this.searchOpen = true;
-            this.isEditMode = false; // 추가 모드로 설정
-        },
-        closeBtn() {
-            this.searchOpen = false;
-            this.createClassName = ""; // 팝업 닫을 때 반 이름 초기화
+    closeModal() {
+      this.showModal = false;
+    },
+    editModeModal(sclsId) {
+      this.searchOpen = true;
+      this.isEditMode = true; // 수정 모드로 설정
+      this.current_editId = sclsId;
+    },
+    addModeModal() {
+      this.searchOpen = true;
+      this.isEditMode = false; // 추가 모드로 설정
+    },
+    closeBtn() {
+      this.searchOpen = false;
+      this.createClassName = ""; // 팝업 닫을 때 반 이름 초기화
+    },
+    showConfirm(type, callback) {
+      let message = "";
+      if (type === "delete") {
+        message = "삭제하시겠습니까?";
+      } else if (type === "reset") {
+        message = "초기화하시겠습니까?";
+      } else if (type === "save") {
+        message = "등록하시겠습니까?";
+      } else if (type === "edit") {
+        message = "수정하시겠습니까?";
+      }
 
+      if (confirm(message)) {
+        if (callback) callback(); // 콜백 함수 호출
+      }
+    },
+    // 조회
+    selectClass() {
+      sessionStorage.removeItem("sclsId");
+      axios({
+        url: "/classes/selectClass.json",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json; charset=UTF-8",
         },
-        showConfirm(type, callback) {
-            let message = '';
-            if (type === 'delete') {
-                message = '삭제하시겠습니까?';
-            } else if (type === 'reset') {
-                message = '초기화하시겠습니까?';
-            } else if (type === 'save') {
-                message = '등록하시겠습니까?';
-            } else if (type === 'edit'){
-                message = '수정하시겠습니까?';
-            }
-
-
-            if (confirm(message)) {
-                if (callback) callback(); // 콜백 함수 호출
-            }
+        data: {
+          userId: this.user_id,
         },
-        // 조회
-        selectClass() {
-            axios({
-                url: "/classes/selectClass.json",
-                method: "post",
-                headers: {
-                    "Content-Type": "application/json; charset=UTF-8",
-                },
-                data: {
-                    userId: this.user_id
-                },
-            })
+      })
+        .then((res) => {
+          if (res.data.status === "success") {
+            console.log("classesList - response(조회) : ", res.data.data);
+            this.classesList = res.data.data;
+          } else {
+            console.log("조회에 실패했습니다: ", res.data);
+            alert("조회에 실패했습니다.");
+          }
+        })
+        .catch((err) => {
+          console.log("classesList - error(조회) : ", err);
+          alert("조회에 오류가 발생했습니다.");
+        });
+    },
+    // 추가
+    insertClass() {
+      if (this.createClassName.trim() === "") {
+        alert("반 이름을 입력해주세요");
+      } else {
+        this.showConfirm("save", () => {
+          axios({
+            url: "/classes/insertClass.json",
+            method: "post",
+            headers: {
+              "Content-Type": "application/json; charset=UTF-8",
+            },
+            data: {
+              userId: this.user_id,
+              sclsNm: this.createClassName,
+            },
+          })
             .then((res) => {
-                if (res.data.status === "success") {
-                    console.log("classesList - response(조회) : ", res.data.data);
-                    this.classesList = res.data.data;
-                } else {
-                    console.log("조회에 실패했습니다: ", res.data);
-                    alert("조회에 실패했습니다.");
-                }
+              if (res.data.status === "success") {
+                console.log("classesList - response(추가) : ", res.data.data);
+                this.selectClass();
+                this.createClassName = ""; // 반 이름 초기화
+                this.closeBtn(); // 생성 모달 닫기
+              } else {
+                console.log("추가에 실패했습니다: ", res.data);
+                alert("추가에 실패했습니다.");
+              }
             })
             .catch((err) => {
-                console.log("classesList - error(조회) : ", err);
-                alert("조회에 오류가 발생했습니다.");
+              console.log("classesList - error(추가) : ", err);
+              alert("추가에 오류가 발생했습니다.");
             });
-        },
-        // 추가
-        insertClass() {
-            if(this.createClassName.trim() === ""){
-                alert("반 이름을 입력해주세요");
+        });
+      }
+    },
+    // 삭제
+    deleteClass(sclsId) {
+      this.showConfirm("delete", () => {
+        axios({
+          url: "/classes/deleteClass.json",
+          method: "post",
+          headers: {
+            "Content-Type": "application/json; charset=UTF-8",
+          },
+          data: {
+            sclsId: sclsId,
+          },
+        })
+          .then((res) => {
+            if (res.data.status === "success") {
+              console.log("classesList - response(삭제) : ", res.data.data);
+              this.selectClass();
+            } else {
+              console.log("삭제에 실패했습니다: ", res.data);
+              alert("삭제에 실패했습니다.");
             }
-            else{
-                this.showConfirm('save', () => {
-                axios({
-                    url: "/classes/insertClass.json",
-                    method: "post",
-                    headers: {
-                        "Content-Type": "application/json; charset=UTF-8",
-                    },
-                    data: {
-                        userId: this.user_id,
-                        sclsNm: this.createClassName
-                    },
-                })
-                    .then((res) => {
-                        if (res.data.status === "success") {
-                            console.log("classesList - response(추가) : ", res.data.data);
-                            this.selectClass();
-                            this.createClassName = ""; // 반 이름 초기화
-                            this.closeBtn(); // 생성 모달 닫기
-                        } else {
-                            console.log("추가에 실패했습니다: ", res.data);
-                            alert("추가에 실패했습니다.");
-                        }
-                    })
-                    .catch((err) => {
-                        console.log("classesList - error(추가) : ", err);
-                        alert("추가에 오류가 발생했습니다.");
-                    });
-                });
-            }
-            
-        },
-        // 삭제
-        deleteClass(sclsId) {
-            this.showConfirm('delete', () => {
-                axios({
-                    url: "/classes/deleteClass.json",
-                    method: "post",
-                    headers: {
-                        "Content-Type": "application/json; charset=UTF-8",
-                    },
-                    data: {
-                        sclsId: sclsId
-                    },
-                })
-                .then((res) => {
-                    if (res.data.status === "success") {
-                        console.log("classesList - response(삭제) : ", res.data.data);
-                        this.selectClass();
-                    } else {
-                        console.log("삭제에 실패했습니다: ", res.data);
-                        alert("삭제에 실패했습니다.");
-                    }
-                })
-                .catch((err) => {
-                    console.log("classesList - error(삭제) : ", err);
-                    alert("삭제에 오류가 발생했습니다.");
-                });
+          })
+          .catch((err) => {
+            console.log("classesList - error(삭제) : ", err);
+            alert("삭제에 오류가 발생했습니다.");
+          });
+      });
+    },
+    // 수정
+    updateClass() {
+      if (this.createClassName.trim() === "") {
+        alert("반 이름을 입력해주세요");
+      } else {
+        this.showConfirm("edit", () => {
+          axios({
+            url: "/classes/updateClass.json",
+            method: "post",
+            headers: {
+              "Content-Type": "application/json; charset=UTF-8",
+            },
+            data: {
+              sclsId: this.current_editId,
+              sclsNm: this.createClassName,
+            },
+          })
+            .then((res) => {
+              if (res.data.status === "success") {
+                console.log("classesList - response(수정) : ", res.data.data);
+                this.selectClass();
+                this.createClassName = ""; // 반 이름 초기화
+                this.current_editId = ""; // 반 Id 초기화
+                this.closeBtn(); // 팝업 닫기
+              } else {
+                console.log("수정에 실패했습니다: ", res.data);
+                alert("수정에 실패했습니다.");
+              }
+            })
+            .catch((err) => {
+              console.log("classesList - error(수정) : ", err);
+              alert("수정에 오류가 발생했습니다.");
             });
-        },
-        // 수정
-        updateClass() {
-            if(this.createClassName.trim() === ""){
-                alert("반 이름을 입력해주세요");
-            }
-            else{
-                this.showConfirm('edit', () => {
-                    axios({
-                        url: "/classes/updateClass.json",
-                        method: "post",
-                        headers: {
-                            "Content-Type": "application/json; charset=UTF-8",
-                        },
-                        data: {
-                            sclsId: this.current_editId,
-                            sclsNm: this.createClassName
-                        },
-                    })
-                    .then((res) => {
-                        if (res.data.status === "success") {
-                            console.log("classesList - response(수정) : ", res.data.data);
-                            this.selectClass();
-                            this.createClassName = ""; // 반 이름 초기화
-                            this.current_editId = ""; // 반 Id 초기화
-                            this.closeBtn(); // 팝업 닫기
-                        } else {
-                            console.log("수정에 실패했습니다: ", res.data);
-                            alert("수정에 실패했습니다.");
-                        }
-                    })
-                    .catch((err) => {
-                        console.log("classesList - error(수정) : ", err);
-                        alert("수정에 오류가 발생했습니다.");
-                    });
-                });
-            }
-        }
+        });
+      }
     },
-    watch: {
-
-    },
-    computed: {
-
-    },
-    components: {
-        SvgIcon
-    },
-    mounted() {
-        console.log('Main2 mounted');
-        this.selectClass();
-    }
-}
+  },
+  watch: {},
+  computed: {},
+  components: {
+    SvgIcon,
+  },
+  mounted() {
+    console.log("Main2 mounted");
+    this.selectClass();
+  },
+};
 </script>
 
 <style>
 .content-t {
-    flex-wrap: wrap; 
-    height: 90%;
-    overflow-y: scroll;
+  flex-wrap: wrap;
+  height: 90%;
+  overflow-y: scroll;
 }
-</style>
(파일 끝에 줄바꿈 문자 없음)
+</style>
client/views/pages/teacher/noticeDetail.vue
--- client/views/pages/teacher/noticeDetail.vue
+++ client/views/pages/teacher/noticeDetail.vue
@@ -75,6 +75,7 @@
       content: "",
       category: "",
       file: "",
+      time: "",
       user: "",
     };
   },
@@ -94,6 +95,7 @@
       vm.title = vm.dataList.bbsTtl;
       vm.content = vm.dataList.bbsCnt;
       vm.category = vm.dataList.bbsCls;
+      vm.time = vm.dataList.bbsTm;
     },
 
     findFile() {
Add a comment
List