jichoi / lms_front star
박민혁 박민혁 08-19
240819 박민혁 선생님 화면 수정
@01bbbd0a5ccfc84cd18ea4ae218a671433d13cf7
client/views/Login.vue
--- client/views/Login.vue
+++ client/views/Login.vue
@@ -212,6 +212,10 @@
                     else if (roles.includes("TEACHER")) {
                      vm.goToPage('Board');
                     } 
+                    // 부모님은 Main으로 접근할 수 없음
+                    else if (roles.includes("PARENT")) {
+                     vm.goToPage('Main_p');
+                    } 
                 } 
             }).catch(error => {
                 console.error(error);
client/views/pages/teacher/QuestionDetail.vue
--- client/views/pages/teacher/QuestionDetail.vue
+++ client/views/pages/teacher/QuestionDetail.vue
@@ -2,159 +2,160 @@
     <div class="title-box flex justify-between mb40">
         <p class="title">문제 조회</p>
     </div>
-    <div class="board-wrap">
-        <div class="tab-box" >
-            <label class="mr20 title1">
-               <input type="radio" v-model="selectedTab" value="tab1" />
-               문제 유형 (일반형)
-            </label>
-            <label class="mr20 title1">
-               <input type="radio" v-model="selectedTab" value="tab2" />
-               문제 유형 (O,X형)
-            </label>
-            <label class="mr20 title1">
-               <input type="radio" v-model="selectedTab" value="tab3" />
-               문제 유형 (연결형)
-            </label>
-            <label class="mr20 title1">
-               <input type="radio" v-model="selectedTab" value="tab4" />
-               문제 유형 (다중 정답형)
-            </label>
-        </div>
-        <hr>
-       <div class="gd-col2 " >
-            <div class="flex align-center mb20">
-                <label for="" class="title2">카테고리</label>
-                <select v-model="selectedSearchOption" class="mr10 data-wrap">
-                    <option value="bbsTtl">제목</option>
-                    <option value="bbsCnt">내용</option>
-                    <option value="userNm">작성자</option>
-                    <option value="bbsCls">카테고리</option>
-                </select>
+    <div class="content-t">
+        <div class="board-wrap">
+            <div class="tab-box">
+                <label class="mr20 title1">
+                    <input type="radio" v-model="selectedTab" value="tab1" />
+                    문제 유형 (일반형)
+                </label>
+                <label class="mr20 title1">
+                    <input type="radio" v-model="selectedTab" value="tab2" />
+                    문제 유형 (O,X형)
+                </label>
+                <label class="mr20 title1">
+                    <input type="radio" v-model="selectedTab" value="tab3" />
+                    문제 유형 (연결형)
+                </label>
+                <label class="mr20 title1">
+                    <input type="radio" v-model="selectedTab" value="tab4" />
+                    문제 유형 (다중 정답형)
+                </label>
             </div>
-            <div class="flex align-center mb20">
-                <label for="" class="title2">문제 유형</label>
-                <select v-model="selectedSearchOption" class="mr10 data-wrap">
-                    <option value="bbsTtl">제목</option>
-                    <option value="bbsCnt">내용</option>
-                    <option value="userNm">작성자</option>
-                    <option value="bbsCls">카테고리</option>
-                </select>
-            </div>
-            <div class="flex align-center">
-                <label for="" class="title2">지문</label>
-                <select v-model="selectedSearchOption" class="mr10 data-wrap">
-                    <option value="bbsTtl">제목</option>
-                    <option value="bbsCnt">내용</option>
-                    <option value="userNm">작성자</option>
-                    <option value="bbsCls">카테고리</option>
-                </select>
-            </div>
-            <div class="flex align-center">
-                <label for="" class="title2">문제 지표</label>
-                <select v-model="selectedSearchOption" class="mr10 data-wrap">
-                    <option value="bbsTtl">제목</option>
-                    <option value="bbsCnt">내용</option>
-                    <option value="userNm">작성자</option>
-                    <option value="bbsCls">카테고리</option>
-                </select>
-            </div>
-       </div>
-        <div class="flex align-center mb20 mt40">
-            <label for="" class="title2">문제 배점</label>
-            <input type="text" class="data-wrap">
-        </div>
-
-        <div class="flex align-center mb20">
-            <label for="" class="title2">내용</label>
-            <textarea name="" id="" class="data-wrap"></textarea>
-        </div>
-        <div class="flex align-center mb20">
-            <label for="" class="title2">힌트</label>
-            <input type="text" class="data-wrap">
-        </div>
-        <div class="flex align-center mb20">
-            <label for="" class="title2">첨부파일</label>
-            <input type="file" ref="fileInput" @change="handleFileUpload" />
-        </div>
-        <hr>
-        <div v-if="selectedTab === 'tab1'">
-            <div class="flex align-center mb20">
-                <label for="" class="title2">답1</label>
-                <input type="text" class="data-wrap">
-            </div>
-            <div class="flex align-center mb20">
-                <label for="" class="title2">답2</label>
-                <input type="text" class="data-wrap">
-            </div>
-            <div class="flex align-center mb20">
-                <label for="" class="title2">답3</label>
-                <input type="text" class="data-wrap">
-            </div>
-            <div class="flex align-center mb20">
-                <label for="" class="title2">답4</label>
-                <input type="text" class="data-wrap">
-            </div>
-            <div class="flex align-center mb20">
-                <label for="" class="title2">해설</label>
-                <textarea name="" id="" class="data-wrap"></textarea>
-            </div>
-        </div>
-       <div v-else-if="selectedTab === 'tab2'">
-            <div class="flex align-center mb20">
-                <label for="" class="title2">답</label>
+            <hr>
+            <div class="gd-col2 ">
+                <div class="flex align-center mb20">
+                    <label for="" class="title2">카테고리</label>
                     <select v-model="selectedSearchOption" class="mr10 data-wrap">
-                            <option value="bbsTtl">O</option>
-                            <option value="bbsCnt">X</option>
-                        </select>
-            </div>
-            <div class="flex align-center mb20">
-                <label for="" class="title2">해설</label>
-                <textarea name="" id="" class="data-wrap"></textarea>
-            </div>
-       </div>
-       <div v-else-if="selectedTab === 'tab3'">
-            <div class="gd-col2 " >
-                <div class="flex align-center mb20 mr40" >
-                    <label for="" class="title2">문제1</label>
-                    <input type="text" class="data-wrap">
+                        <option value="bbsTtl">제목</option>
+                        <option value="bbsCnt">내용</option>
+                        <option value="userNm">작성자</option>
+                        <option value="bbsCls">카테고리</option>
+                    </select>
                 </div>
                 <div class="flex align-center mb20">
-                    <label for="" class="title2">답1</label>
-                    <input type="text" class="data-wrap">
+                    <label for="" class="title2">문제 유형</label>
+                    <select v-model="selectedSearchOption" class="mr10 data-wrap">
+                        <option value="bbsTtl">제목</option>
+                        <option value="bbsCnt">내용</option>
+                        <option value="userNm">작성자</option>
+                        <option value="bbsCls">카테고리</option>
+                    </select>
                 </div>
-                <div class="flex align-center mb20 mr40">
-                    <label for="" class="title2">문제2</label>
+                <div class="flex align-center">
+                    <label for="" class="title2">지문</label>
+                    <select v-model="selectedSearchOption" class="mr10 data-wrap">
+                        <option value="bbsTtl">제목</option>
+                        <option value="bbsCnt">내용</option>
+                        <option value="userNm">작성자</option>
+                        <option value="bbsCls">카테고리</option>
+                    </select>
+                </div>
+                <div class="flex align-center">
+                    <label for="" class="title2">문제 지표</label>
+                    <select v-model="selectedSearchOption" class="mr10 data-wrap">
+                        <option value="bbsTtl">제목</option>
+                        <option value="bbsCnt">내용</option>
+                        <option value="userNm">작성자</option>
+                        <option value="bbsCls">카테고리</option>
+                    </select>
+                </div>
+            </div>
+            <div class="flex align-center mb20 mt40">
+                <label for="" class="title2">문제 배점</label>
+                <input type="text" class="data-wrap">
+            </div>
+
+            <div class="flex align-center mb20">
+                <label for="" class="title2">내용</label>
+                <textarea name="" id="" class="data-wrap"></textarea>
+            </div>
+            <div class="flex align-center mb20">
+                <label for="" class="title2">힌트</label>
+                <input type="text" class="data-wrap">
+            </div>
+            <div class="flex align-center mb20">
+                <label for="" class="title2">첨부파일</label>
+                <input type="file" ref="fileInput" @change="handleFileUpload" />
+            </div>
+            <hr>
+            <div v-if="selectedTab === 'tab1'">
+                <div class="flex align-center mb20">
+                    <label for="" class="title2">답1</label>
                     <input type="text" class="data-wrap">
                 </div>
                 <div class="flex align-center mb20">
                     <label for="" class="title2">답2</label>
                     <input type="text" class="data-wrap">
                 </div>
-                <div class="flex align-center mb20 mr40">
-                    <label for="" class="title2">문제3</label>
-                    <input type="text" class="data-wrap">
-                </div>
-                <div class="flex align-center mb20 ">
+                <div class="flex align-center mb20">
                     <label for="" class="title2">답3</label>
-                    <input type="text" class="data-wrap">
-                </div>
-                <div class="flex align-center mb20 mr40">
-                    <label for="" class="title2">문제4</label>
                     <input type="text" class="data-wrap">
                 </div>
                 <div class="flex align-center mb20">
                     <label for="" class="title2">답4</label>
                     <input type="text" class="data-wrap">
                 </div>
+                <div class="flex align-center mb20">
+                    <label for="" class="title2">해설</label>
+                    <textarea name="" id="" class="data-wrap"></textarea>
+                </div>
             </div>
-            <div class="flex align-center mb20">
-                <label for="" class="title2">해설</label>
-                <textarea name="" id="" class="data-wrap"></textarea>
+            <div v-else-if="selectedTab === 'tab2'">
+                <div class="flex align-center mb20">
+                    <label for="" class="title2">답</label>
+                    <select v-model="selectedSearchOption" class="mr10 data-wrap">
+                        <option value="bbsTtl">O</option>
+                        <option value="bbsCnt">X</option>
+                    </select>
+                </div>
+                <div class="flex align-center mb20">
+                    <label for="" class="title2">해설</label>
+                    <textarea name="" id="" class="data-wrap"></textarea>
+                </div>
             </div>
-       </div>
-       <div v-else-if="selectedTab === 'tab4'">
-                <div class="flex align-center mb20 mr40" >
+            <div v-else-if="selectedTab === 'tab3'">
+                <div class="gd-col2 ">
+                    <div class="flex align-center mb20 mr40">
+                        <label for="" class="title2">문제1</label>
+                        <input type="text" class="data-wrap">
+                    </div>
+                    <div class="flex align-center mb20">
+                        <label for="" class="title2">답1</label>
+                        <input type="text" class="data-wrap">
+                    </div>
+                    <div class="flex align-center mb20 mr40">
+                        <label for="" class="title2">문제2</label>
+                        <input type="text" class="data-wrap">
+                    </div>
+                    <div class="flex align-center mb20">
+                        <label for="" class="title2">답2</label>
+                        <input type="text" class="data-wrap">
+                    </div>
+                    <div class="flex align-center mb20 mr40">
+                        <label for="" class="title2">문제3</label>
+                        <input type="text" class="data-wrap">
+                    </div>
+                    <div class="flex align-center mb20 ">
+                        <label for="" class="title2">답3</label>
+                        <input type="text" class="data-wrap">
+                    </div>
+                    <div class="flex align-center mb20 mr40">
+                        <label for="" class="title2">문제4</label>
+                        <input type="text" class="data-wrap">
+                    </div>
+                    <div class="flex align-center mb20">
+                        <label for="" class="title2">답4</label>
+                        <input type="text" class="data-wrap">
+                    </div>
+                </div>
+                <div class="flex align-center mb20">
+                    <label for="" class="title2">해설</label>
+                    <textarea name="" id="" class="data-wrap"></textarea>
+                </div>
+            </div>
+            <div v-else-if="selectedTab === 'tab4'">
+                <div class="flex align-center mb20 mr40">
                     <label for="" class="title2">문제1</label>
                     <input type="text" class="data-wrap">
                     <input type="checkbox" class="ui-checkbox ml30">
@@ -174,24 +175,25 @@
                     <input type="text" class="data-wrap">
                     <input type="checkbox" class="ui-checkbox ml30">
                 </div>
-            <div class="flex align-center mb20">
-                <label for="" class="title2">해설</label>
-                <textarea name="" id="" class="data-wrap"></textarea>
+                <div class="flex align-center mb20">
+                    <label for="" class="title2">해설</label>
+                    <textarea name="" id="" class="data-wrap"></textarea>
+                </div>
             </div>
-       </div>
-       
-    </div>
-    <div class="flex justify-between mt50">
-        <button type="button" title="글쓰기" class="new-btn" @click="goToPage('QuestionList')">
-            목록
-        </button>
-        <div class="flex">
-            <button type="button" title="글쓰기" class="new-btn mr10">
-                삭제
+
+        </div>
+        <div class="flex justify-between mt50">
+            <button type="button" title="글쓰기" class="new-btn" @click="goToPage('QuestionList')">
+                목록
             </button>
-            <button type="button" title="글쓰기" class="new-btn">
-                수정
-            </button>
+            <div class="flex">
+                <button type="button" title="글쓰기" class="new-btn mr10">
+                    삭제
+                </button>
+                <button type="button" title="글쓰기" class="new-btn">
+                    수정
+                </button>
+            </div>
         </div>
     </div>
 </template>
@@ -206,12 +208,39 @@
         return {
             mdiMagnify: mdiMagnify,
             selectedTab: 'tab1',
+            prblm: {},
+            dataList: [],
+            problemDetail: [],
         }
     },
     methods: {
         goToPage(page) {
             this.$router.push({ name: page });
         },
+        problemSearch() {
+            const vm = this;
+            vm.prblm = JSON.parse(sessionStorage.getItem("selectQuestionList"));
+            axios({
+                url: "problem/problemInfo.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    prblmId: vm.prblm.prblmId,
+                },
+            })
+                .then(function (res) {
+                    console.log("problem - response : ", res.data);
+                    vm.dataList = res.data.problem;
+                    vm.problemDetail = res.data.problemDetail;
+
+                })
+                .catch(function (error) {
+                    console.log("problem - error : ", error);
+                });
+        },
+
     },
     watch: {
 
@@ -223,10 +252,13 @@
         SvgIcon
     },
     mounted() {
-        console.log('Main2 mounted');
+        this.problemSearch();
     }
 }
 </script>
 <style scoped>
-.ui-checkbox{width: 30px; height: 30px;}
+.ui-checkbox {
+    width: 30px;
+    height: 30px;
+}
 </style>
client/views/pages/teacher/QuestionList.vue
--- client/views/pages/teacher/QuestionList.vue
+++ client/views/pages/teacher/QuestionList.vue
@@ -1,16 +1,25 @@
 <template>
     <div class="title-box flex justify-between mb40">
         <p class="title">문제</p>
-        <select name="" id="">
-            <option value="">A교재</option>
+        <select name="" id="" v-model="selectedBook" @change="fetchUnits">
+            <option value="" disabled>교재를 선택하세요</option>
+            <option v-for="book in books" :key="book.book_id" :value="book.book_id">
+                {{ book.book_nm }}
+            </option>
         </select>
     </div>
+    <div class="content-t">
+
     <label for="" class="title2">단원</label>
-        <div class="unit-pagination flex mt10 mb20" style="gap: 10px;">
-            <button @click="selectUnit('UNIT_000000000000001')" :class="{ 'selected-btn': selectedUnitId === 'UNIT_000000000000001' }">1</button>
-            <button @click="selectUnit('UNIT_000000000000002')" :class="{ 'selected-btn': selectedUnitId === 'UNIT_000000000000002' }">2</button>
-            <button @click="selectUnit('UNIT_000000000000003')" :class="{ 'selected-btn': selectedUnitId === 'UNIT_000000000000003' }">3</button>
-        </div>
+    <div class="unit-pagination flex mt10 mb20" style="gap: 10px;">
+        <button 
+            v-for="(unit, index) in units" 
+            :key="index" 
+            :class="{ 'selected-btn': selectedUnitId === unit.unitId }"
+            @click="selectUnit(unit.unitId)">
+            {{ unit.unitName }}
+        </button>
+    </div>
     <div class="search-wrap flex justify-end mb20">
         <select name="" id="" class="mr10 data-wrap" v-model="searchOption">
             <option value="">전체</option>
@@ -39,7 +48,7 @@
                 <tr v-for="(problem, index) in problems" :key="problem.prblmId" @click="[goToPage('QuestionDetail', selectQuestionList(problem))]">
                     <td>{{ (currentPage - 1) * 10 + index + 1 }}</td>
                     <td>{{ problem.prblmExpln }}</td>
-                    <td>{{ problem.prblmTypeId }}</td>
+                    <td>{{ problem.prblmTypeNm }}</td>
                     <td>{{ problem.prblmScr }}</td>
                     <td>{{ problem.userId }}</td>
                     <td>{{ problem.regDt}}</td>
@@ -48,13 +57,13 @@
         </table>
         <article class="table-pagination flex justify-center align-center mb20 mt30" style="gap: 10px;">
             <button @click="changePage(currentPage - 1)" :disabled="currentPage === 1">
-                <img src="../../../resources/img/btn27_90t_normal.png" alt="">
+                <img src="../../../resources/img/btn27_90t_normal.png" alt="Previous">
             </button>
-            <button :class="{ 'selected-btn': currentPage === 1 }" @click="changePage(1)">1</button>
-            <button :class="{ 'selected-btn': currentPage === 2 }" @click="changePage(2)">2</button>
-            <button :class="{ 'selected-btn': currentPage === 3 }" @click="changePage(3)">3</button>
+            <button v-for="page in paginationButtons" :key="page" @click="changePage(page)" :class="{ 'selected-btn': currentPage === page }">
+                {{ page }}
+            </button>
             <button @click="changePage(currentPage + 1)" :disabled="currentPage === totalPages">
-                <img src="../../../resources/img/btn28_90t_normal.png" alt="">
+                <img src="../../../resources/img/btn28_90t_normal.png" alt="Next">
             </button>
         </article>
         <div class="flex justify-end ">
@@ -62,6 +71,7 @@
                 등록
             </button>
         </div>
+    </div>
     </div>
 </template>
 
@@ -75,11 +85,15 @@
         return {
             mdiMagnify: mdiMagnify,
             problems: [],
+            units: [], 
+            books: [],
             currentPage: 1,
-            totalPages: 3,
+            pageSize: 10,
+            totalPosts: 0,
             searchOption: '',
             searchKeyword: '',
-            selectedUnitId: 'UNIT_000000000000001'
+            selectedUnitId: '',
+            selectedBook: "", 
         }
     },
     methods: {
@@ -104,8 +118,8 @@
             sessionStorage.setItem("selectQuestionList", JSON.stringify(item));
         },
         selectUnit(unitId) {
-        this.selectedUnitId = unitId; // 선택된 단원 ID 설정
-        this.fetchProblems(1); // 첫 페이지로 문제 목록 새로 고침
+            this.selectedUnitId = unitId; // 선택된 단원 ID 설정
+            this.fetchProblems(1); // 첫 페이지로 문제 목록 새로 고침
         },
         async fetchProblems(page = 1) {
             try {
@@ -116,7 +130,9 @@
                     pageSize: 10,
                     startIndex: (page - 1) * 10
                 });
-                this.problems = response.data;
+                this.problems = response.data.problems;
+                this.totalPosts = response.data.totalProblem;
+
                 this.currentPage = page;
             } catch (error) {
                 console.error('문제 목록을 불러오는 중 오류가 발생했습니다.', error);
@@ -129,18 +145,79 @@
         },
         searchProblems() {
             this.fetchProblems(1);
-        }
+        },
+        fetchBooks() {
+            axios({
+                url: "/book/findAll.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+            })
+                .then(response => {
+                    console.log(response.data)
+                    this.books = response.data;  
+                })
+                .catch(error => {
+                    console.error("fetchBooks - error: ", error);
+                    alert("교재 목록을 불러오는 중 오류가 발생했습니다.");
+                });
+        },
+        fetchUnits() {
+            if (!this.selectedBook) return; 
+
+            axios({
+                url: "/unit/unitList.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    "bookId": this.selectedBook
+                },
+            })
+                .then(response => {
+                    console.log(response.data)
+                    this.units = response.data; 
+                })
+                .catch(error => {
+                    console.error("fetchUnits - error: ", error);
+                    alert("단원 목록을 불러오는 중 오류가 발생했습니다.");
+                });
+        },
+
     },
     watch: {
     },
     computed: {
+        totalPages() {
+            return Math.ceil(this.totalPosts / this.pageSize);
+        },
+        paginationButtons() {
+            let start = Math.max(0, this.currentPage - 2);
+            let end = Math.min(start + 5, this.totalPages);
+
+            if (end - start < 5) {
+                start = Math.max(0, end - 5);
+            }
+
+            return Array.from({ length: end - start }, (_, i) => start + i + 1);
+        },
+
+        startIndex() {
+            return this.currentPage * this.itemsPerPage;
+        }
+
     },
     components: {
         SvgIcon
     },
     mounted() {
-        console.log('Main2 mounted');
+        this.selectedUnitId = this.$route.query.unit_id || '';
+        this.selectedBook = this.$route.query.book_id || '';
+        this.fetchBooks();
         this.fetchProblems();
+        this.fetchUnits();
     }
 }
 </script>
client/views/pages/teacher/TextBookDetail.vue
--- client/views/pages/teacher/TextBookDetail.vue
+++ client/views/pages/teacher/TextBookDetail.vue
@@ -1,179 +1,209 @@
 <template>
     <div class="title-box flex justify-between mb40">
-    <p class="title">{{ bookDetails ? bookDetails.book_nm : 'Loading...' }}</p>
-  </div>
-    <label for="" class="title1">단원</label>
+        <p class="title">{{ bookDetails ? bookDetails.book_nm : 'Loading...' }}</p>
+    </div>
+    <div class="content-t">
+
+        <label for="" class="title1">단원</label>
         <div class="unit-pagination flex mt10" style="gap: 10px;">
-            <button class="selected-btn">1</button>
-            <button>2</button>
-            <button>3</button>
-            <button ><svg-icon type="mdi" :path="mdiPlus" style=" padding-top: 6px; width: 30px; height: 30px;"></svg-icon></button>
+            <button v-for="unit in units" :key="unit.unitId" @click="selectUnit(unit.unitId)"
+                :class="{ 'selected-btn': selectedUnitId === unit.unitId }">
+                {{ unit.unitName }}
+            </button>
+            <button><svg-icon type="mdi" :path="mdiPlus" @click="buttonSearch"
+                    style=" padding-top: 6px; width: 30px; height: 30px;"></svg-icon></button>
         </div>
-    <div class="board-wrap mt30">
-        <div class="mb20 ">
-            <div class="flex justify-between mb30 align-center">
-                <label for="" class="title1">지문</label>
-                <div class="look-btn flex align-center" @click="goToPage('TextList')">
-                    <p>자세히 보기 </p>
-                    <svg-icon type="mdi" :path="mdilArrowRight" class=" ml10"></svg-icon>
+        <div class="board-wrap mt30">
+            <div class="mb20 ">
+                <div class="flex justify-between mb30 align-center">
+                    <label for="" class="title1">지문</label>
+                    <div class="look-btn flex align-center" @click="goToPage('TextList')">
+                        <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 v-for="(post, index) in posts" :key="index" class="post">
+                                <td>{{ index }}</td>
+                                <td>{{ post.textTtl.slice(0, 20) }}{{ post.textTtl.length > 20 ? '...' : '' }}</td>
+                                <td>{{ post.textCnt.slice(0, 20) }}{{ post.textCnt.length > 20 ? '...' : '' }}</td>
+                                <td>{{ post.userId }}</td>
+                                <td>{{ post.regDt }}</td>
+                            </tr>
+                        </tbody>
+                    </table>
                 </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>
-        <hr>
-        <div class="mb20" >
-            <div class="flex justify-between mb30 align-center">
-                <label for="" class="title1">문제</label>
-                <div class="look-btn flex align-center" @click="goToPage('QuestionList')">
-                    <p>자세히 보기 </p>
-                    <svg-icon type="mdi" :path="mdilArrowRight" class=" ml10"></svg-icon>
+            <hr>
+            <div class="mb20">
+                <div class="flex justify-between mb30 align-center">
+                    <label for="" class="title1">문제</label>
+                    <div class="look-btn flex align-center" @click="goToPage('QuestionList')">
+                        <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>
+                            <td>등록일</td>
+                        </thead>
+                        <tbody>
+                            <tr v-for="(quiz, index) in quizs" :key="index" class="post">
+                                <td>{{ index }}</td>
+                                <td>{{ quiz.prblmExpln.slice(0, 20) }}{{ quiz.prblmExpln.length > 20 ? '...' : '' }}
+                                </td>
+                                <td>{{ quiz.prblmTypeNm }}</td>
+                                <td>{{ quiz.prblmScr }}</td>
+                                <td>{{ quiz.userId }}</td>
+                                <td>{{ quiz.regDt }}</td>
+                            </tr>
+                        </tbody>
+                    </table>
                 </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>
-        <hr>
-        <div class="mb20" >
-            <div class="flex justify-between mb30 align-center">
-                <label for="" class="title1">단어</label>
-                <div class="look-btn flex align-center" @click="goToPage('VocaList')">
-                    <p>자세히 보기 </p>
-                    <svg-icon type="mdi" :path="mdilArrowRight" class=" ml10"></svg-icon>
+            <hr>
+            <div class="mb20">
+                <div class="flex justify-between mb30 align-center">
+                    <label for="" class="title1">단어</label>
+                    <div class="look-btn flex align-center" @click="goToPage('VocaList')">
+                        <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 v-for="(wordBook, index) in dataList" :key="wordBook.wdBookId">
+                                <td>{{ index }}</td>
+                                <td>{{ wordBook.textTtl }}</td>
+                                <td>{{ wordBook.wordsPreview }}</td>
+                                <td>{{ wordBook.userNm }}</td>
+                            </tr>
+                        </tbody>
+                    </table>
                 </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>
-        <hr>
-        <div class="mb20" >
-            <div class="flex justify-between mb30 align-center">
-                <label for="" class="title1">중간 평가</label>
-                <div class="look-btn flex align-center" @click="goToPage('ExamList')">
-                    <p>자세히 보기 </p>
-                    <svg-icon type="mdi" :path="mdilArrowRight" class=" ml10"></svg-icon>
+            <hr>
+            <div class="mb20">
+                <div class="flex justify-between mb30 align-center">
+                    <label for="" class="title1">중간 평가</label>
+                    <div class="look-btn flex align-center" @click="goToPage('ExamList')">
+                        <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="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>
-        <hr>
-        <div >
-            <div class="flex justify-between mb30 align-center">
-                <label for="" class="title1">최종 평가</label>
-                <div class="look-btn flex align-center" @click="goToPage('ExamList')">
-                    <p>자세히 보기 </p>
-                    <svg-icon type="mdi" :path="mdilArrowRight" class=" ml10"></svg-icon>
+            <hr>
+            <div>
+                <div class="flex justify-between mb30 align-center">
+                    <label for="" class="title1">최종 평가</label>
+                    <div class="look-btn flex align-center" @click="goToPage('ExamList')">
+                        <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="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-end mt30" style="gap: 10px;">
+            <button type="button" title="" class="new-btn" @click="goToPage('RoadMap')">
+                로드맵
+            </button>
+            <button type="button" title="" class="new-btn" @click="showConfirm('delete')">
+                삭제
+            </button>
         </div>
     </div>
-    <!-- <div class="flex justify-end mt30" style="gap: 10px;">
-        <button type="button" title="" class="new-btn" @click="goToPage('RoadMap')">
-            로드맵
-        </button>
-        <button type="button" title="" class="new-btn" @click="showConfirm('delete')">
-            삭제
-        </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" class="data-wrap" v-model="newUnitName" placeholder="단원 이름을 입력하세요">
+            </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="insertUnit()">
+                생성
+              </button>
+            </div>
+          </div>
+        </div>
+
 </template>
 
 <script>
 import SvgIcon from '@jamescoyle/vue-icon';
-import { mdiMagnify, mdiPlus } from '@mdi/js';
+import { mdiMagnify, mdiPlus, mdiWindowClose } from '@mdi/js';
 import { mdilArrowRight } from '@mdi/light-js';
+
 import ProgressBar from '../../component/ProgressBar.vue';
 import axios from 'axios';
 
@@ -183,14 +213,65 @@
             mdiPlus: mdiPlus,
             mdiMagnify: mdiMagnify,
             mdilArrowRight: mdilArrowRight,
-            selectedBookId: this.$route.query.book_Id,
+            mdiWindowClose: mdiWindowClose,
+
+            selectedBookId: this.$route.query.book_id,
             bookDetails: null,
+            units: [],
+            posts: [],
+            quizs: [],
+            dataList: [],
+            totalPosts: [],
+            selectedUnitId: null, // 선택된 단원 ID 저장 변수
+            selectedUnitName: '', // 선택된 단원의 이름 저장 변수
+
+            searchOpen: false,
+            newUnitName: '',
+
         };
     },
     methods: {
+        // 페이지 이동
         goToPage(page) {
-            this.$router.push({ name: page });
+            this.$router.push({ name: page, query: { unit_id: this.selectedUnitId, book_id: this.$route.query.book_id } });
         },
+        // 단원 팝업
+        buttonSearch() {
+            this.searchOpen = true;
+        },
+        closeBtn() {
+            this.searchOpen = false;
+            this.newUnitName = '';
+        },
+
+        // 단원 추가 생성
+        insertUnit() {
+            if(this.newUnitName === ''){
+                alert("이름을 입력해주세요!");
+                return;
+            }
+
+            axios({
+                url: "/unit/insertUnit.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    bookId: this.$route.query.book_id,
+                    unitName: this.newUnitName,
+                }
+            })
+                .then(response => {
+                    this.findUnit();
+                    this.closeBtn();
+                })
+                .catch(error => {
+                    console.error('Error creating book:', error);
+                });
+        },
+
+
         fetchBookDetails() {
             axios({
                 url: "/book/find.json",
@@ -202,18 +283,168 @@
                     book_id: this.$route.query.book_id
                 }
             })
-            .then(response => {
-                console.log('Book details:', response.data);
-                this.bookDetails = response.data;
+                .then(response => {
+                    console.log('Book details:', response.data);
+                    this.bookDetails = response.data;
+                })
+                .catch(error => {
+                    console.error('Error fetching book details:', error);
+                });
+        },
+
+        // 책 아이디에 맞춘 단원 가져오기
+        findUnit() {
+            axios({
+                url: "/unit/unitList.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    bookId: this.$route.query.book_id
+                }
             })
-            .catch(error => {
-                console.error('Error fetching book details:', error);
-            });
-        }
+                .then(response => {
+                    console.log('Book details:', response.data);
+                    this.units = response.data;
+                    this.selectedUnitId = this.units[0].unitId;
+                    this.findText();
+                    this.findProblem();
+                    this.findWord();
+
+                })
+                .catch(error => {
+                    console.error('Error selectUnit details:', error);
+                });
+        },
+
+        // 단원을 선택했을 때 호출되는 메서드
+        selectUnit(unitId) {
+            this.selectedUnitId = unitId;
+            const selectedUnit = this.units.find(unit => unit.unitId === unitId);
+            this.selectedUnitName = selectedUnit ? selectedUnit.unitName : '';
+            this.findText();
+            this.findProblem();
+            this.findWord();
+        },
+
+        // 지문 정보 5개 정도 가져오기
+        findText() {
+            axios({
+                url: "/text/textSearch.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    "pageSize": 5,
+                    "startIndex": 0,
+                    "unitId": this.selectedUnitId
+                },
+            })
+                .then(response => {
+                    this.posts = response.data.list;
+                })
+                .catch(error => {
+                    console.error("fetchData - error: ", error);
+                    alert("검색 중 오류가 발생했습니다.");
+                });
+        },
+
+        // 문제 정보 5개 정도 가져오기
+        findProblem() {
+            axios({
+                url: "/problem/problemList.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    "pageSize": 5,
+                    "startIndex": 0,
+                    "unitId": this.selectedUnitId
+                },
+            })
+                .then(response => {
+
+                    this.quizs = response.data.problems;
+                })
+                .catch(error => {
+                    console.error("fetchData - error: ", error);
+                    alert("검색 중 오류가 발생했습니다.");
+                });
+        },
+
+        // 단어장 단어 5개 정도 조회
+        findWord() {
+            const vm = this;
+            axios({
+                url: "/wordbook/findByUnitId.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    "unitId": vm.selectedUnitId,
+                    "page": 1,
+                    "pageSize": 5
+                },
+            })
+                .then(function (response) {
+                    const wordBooks = response.data.wordBooks;
+                    vm.totalPosts = response.data.totalWordBooks;
+
+                    // 지문 제목 및 단어 목록 가져오기
+                    const fetchDataPromises = wordBooks.map(wordBook => {
+                        const textTitlePromise = axios.post("/text/selectOneText.json", {
+                            textId: wordBook.textId
+                        }).then(textResponse => {
+                            wordBook.textTtl = textResponse.data[0].text_ttl;
+                        }).catch(error => {
+                            console.error(`${wordBook.textId}으로 지문 제목 가져오기 실패: `, error);
+                            wordBook.textTtl = '제목값없음'; // 오류 시 기본값 설정
+                        });
+
+                        const wordsPromise = axios.post("/word/getWordsByBookId.json", {
+                            wdBookId: wordBook.wdBookId
+                        }).then(wordsResponse => {
+                            const words = wordsResponse.data.map(word => word.wdNm);
+                            wordBook.wordsPreview = vm.generateWordsPreview(words);
+                        }).catch(error => {
+                            console.error(`${wordBook.wdBookId}으로 단어 목록 가져오기 실패: `, error);
+                            wordBook.wordsPreview = '단어값없음'; // 오류 시 기본값 설정
+                        });
+
+                        return Promise.all([textTitlePromise, wordsPromise]);
+                    });
+
+                    // 모든 데이터 가져오기 작업이 완료되면 dataList에 데이터 설정
+                    Promise.all(fetchDataPromises).then(() => {
+                        vm.dataList = wordBooks;
+                    });
+                })
+                .catch(function (error) {
+                    console.log("dataList - error: ", error);
+                    alert("단어장 목록 조회에 오류가 발생했습니다.");
+                });
+        },
+        // 단어 목록 생략 String 생성 메서드
+        generateWordsPreview(words) {
+            const maxLength = 20; // 최대 표시 길이 설정
+            const wordString = words.join(', ');
+
+            if (wordString.length > maxLength) {
+                return wordString.substring(0, maxLength) + '...';
+            } else {
+                return wordString;
+            }
+        },
+
     },
     mounted() {
         console.log('Mounted with book_id:', this.$route.query.book_id);
         this.fetchBookDetails();
+        this.findUnit();
     },
     components: {
         SvgIcon,
client/views/pages/teacher/TextDetail.vue
--- client/views/pages/teacher/TextDetail.vue
+++ client/views/pages/teacher/TextDetail.vue
@@ -33,13 +33,13 @@
             <label v-else for="" class="title2 flex align-center ml20" style="display: flex; width: 20rem;">교재:&nbsp;
                 <p class="title2">{{ post.bookName }}</p>
             </label>
-                <select v-if="isEditing" name="" id="" v-model="post.unitId" class="ml20">
-                    <option value="" disabled>단원을 선택하세요</option>
-                    <option v-for="unit in units" :key="unit.unitId" :value="unit.unitId">
-                        {{ unit.unitName }}
-                    </option>
-                </select>
-            <label v-else  for="" class="title2 flex align-center ml20"
+            <select v-if="isEditing" name="" id="" v-model="post.unitId" class="ml20">
+                <option value="" disabled>단원을 선택하세요</option>
+                <option v-for="unit in units" :key="unit.unitId" :value="unit.unitId">
+                    {{ unit.unitName }}
+                </option>
+            </select>
+            <label v-else for="" class="title2 flex align-center ml20"
                 style="display: flex; width: 20rem; text-align: right;">단원:&nbsp;
                 <p class="title2">{{ post.unitName }}</p>
             </label>
@@ -50,6 +50,12 @@
             <textarea v-if="isEditing" v-model="post.textCnt" class="data-wrap"></textarea>
             <p v-else class="data-wrap">{{ post.textCnt }}</p>
         </div>
+        <hr>
+        <div class="flex align-center">
+            <label for="" class="title2">첨부파일</label>
+            <label for="" class="title2" v-if="file">{{ file.fileNm }}</label>
+        </div>
+
     </div>
     <div class="flex justify-between mt50">
         <button type="button" title="목록으로" class="new-btn" @click="goToPage('TextList')">
@@ -83,11 +89,13 @@
                 textTypeId: "",
                 bookId: "",
                 unitId: "",
-                bookName: "",  
-                unitName: ""
+                bookName: "",
+                unitName: "",
+                fileMngId: "",
             },
-            books: [],  
-            units: [], 
+            books: [],
+            units: [],
+            file: {},
             isEditing: false
         };
     },
@@ -126,6 +134,8 @@
                         this.post.unitId = response.data[0].unit_id;
                         this.post.bookName = response.data[0].book_name;
                         this.post.unitName = response.data[0].unit_name;
+                        this.post.fileMngId = response.data[0].file_mng_id;
+                        this.findFile();
                     } else {
                         this.error = "Failed to fetch post details.";
                     }
@@ -135,6 +145,29 @@
                     this.error = "Failed to fetch post details.";
                 });
         },
+
+        findFile() {
+            const vm = this;
+            axios({
+                url: "/file/find.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    file_mng_id: vm.post.fileMngId,
+                },
+            })
+                .then(function (res) {
+                    console.log("fileInfo - response : ", res.data.list[0]);
+                    vm.file = res.data.list[0];
+                    sessionStorage.setItem("file", JSON.stringify(vm.file));
+                })
+                .catch(function (error) {
+                    console.log("result - error : ", error);
+                });
+        },
+
         dataInsert() {
             this.newPost = {
                 textId: this.post.textId,
@@ -168,6 +201,7 @@
             } else {
                 this.isEditing = true;
                 this.fetchBooks();
+                this.fetchUnits();
             }
         },
         deletePost() {
@@ -192,7 +226,7 @@
                 }
             })
                 .then(response => {
-                    this.books = response.data;  
+                    this.books = response.data;
                 })
                 .catch(error => {
                     console.error("fetchBooks - error:", error);
@@ -200,7 +234,7 @@
                 });
         },
         fetchUnits() {
-            if (!this.post.bookId) return;  
+            if (!this.post.bookId) return;
 
             axios.post("/unit/unitList.json", { bookId: this.post.bookId }, {
                 headers: {
@@ -208,7 +242,7 @@
                 }
             })
                 .then(response => {
-                    this.units = response.data;  
+                    this.units = response.data;
                 })
                 .catch(error => {
                     console.error("fetchUnits - error:", error);
@@ -225,5 +259,4 @@
 };
 </script>
 
-<style scoped> 
-</style>
+<style scoped></style>
client/views/pages/teacher/TextInsert.vue
--- client/views/pages/teacher/TextInsert.vue
+++ client/views/pages/teacher/TextInsert.vue
@@ -1,4 +1,3 @@
-
 <template>
     <div class="title-box flex justify-between mb40">
         <p class="title">지문 등록</p>
@@ -41,6 +40,12 @@
             <label for="" class="title2">스크립트</label>
             <textarea name="" id="" class="data-wrap" v-model="newData.textCnt"></textarea>
         </div>
+        <hr>
+        <div class="flex align-center ">
+            <label for="file" class="title2">첨부파일</label>
+            <input type="file" ref="fileInput" @change="handleFileUpload" multiple />
+        </div>
+
     </div>
     <div class="flex justify-between mt50">
         <button type="button" title="글쓰기" class="new-btn" @click="goToPage('TextList')">
@@ -58,6 +63,7 @@
 import axios from "axios";
 import SvgIcon from '@jamescoyle/vue-icon';
 import { mdiMagnify } from '@mdi/js';
+import store from '../AppStore';
 
 
 export default {
@@ -76,20 +82,28 @@
                 textCnt: "",
                 textUrl: "",
                 textTypeId: "",
-                //fileMngId:"",
-                // userId:"".
+                fileMngId: "",
+                userId: "",
                 bookId: "",
                 unitId: ""
             },
-            books: [],  
-            units: [],  
+            books: [],
+            units: [],
+
+            file: "",
+            selectedFiles: [],
         }
     },
     methods: {
         goToPage(page) {
             this.$router.push({ name: page });
-        }, fetchPostDetail() {
-            const textId = this.$route.query.textId
+        },
+        handleFileUpload(e) {
+            this.selectedFiles = e.target.files;
+        },
+
+        fetchPostDetail() {
+            const textId = this.$route.query.textId;
             axios({
                 url: `/text/selectOneText.json`,
                 method: "post",
@@ -112,8 +126,31 @@
                     console.error("Error fetching post detail:", error);
                     this.error = "Failed to fetch post details.";
                 });
-        }, dataInsert() {
+        },
+        async dataInsert() {
             const vm = this;
+
+            if (this.selectedFiles && this.selectedFiles.length > 0) {
+                // 파일 업로드
+                const formData = new FormData();
+                for (let i = 0; i < this.selectedFiles.length; i++) {
+                    formData.append("files", this.selectedFiles[i]);
+                }
+
+                const fileUploadResponse = await axios.post(
+                    "/file/upload.json",
+                    formData,
+                    {
+                        headers: {
+                            "Content-Type": "multipart/form-data",
+                        },
+                    }
+                );
+
+                // 업로드 후 파일 매니지 아이디 호출
+                vm.newData.fileMngId = fileUploadResponse.data.fileMngId;
+            }
+
             axios({
                 url: "/text/insertText.json",
                 method: "post",
@@ -174,7 +211,7 @@
             })
                 .then(response => {
                     console.log(response.data)
-                    this.books = response.data;  
+                    this.books = response.data;
                 })
                 .catch(error => {
                     console.error("fetchBooks - error: ", error);
@@ -182,7 +219,7 @@
                 });
         },
         fetchUnits() {
-            if (!this.newData.bookId) return;  
+            if (!this.newData.bookId) return;
 
             axios({
                 url: "/unit/unitList.json",
@@ -196,7 +233,7 @@
             })
                 .then(response => {
                     console.log(response.data)
-                    this.units = response.data;  
+                    this.units = response.data;
                 })
                 .catch(error => {
                     console.error("fetchUnits - error: ", error);
@@ -215,7 +252,16 @@
     },
     mounted() {
         this.fetchPostDetail();
-        this.fetchBooks();  
+
+        this.newData.bookId = this.$route.query.book_id;
+        this.newData.unitId = this.$route.query.unit_id;
+
+        this.newData.userId = store.getters.getUserInfo.userId;
+
+        this.fetchBooks();
+        this.fetchUnits();
+
+
         console.log('Main2 mounted');
     }
 }
client/views/pages/teacher/TextList.vue
--- client/views/pages/teacher/TextList.vue
+++ client/views/pages/teacher/TextList.vue
@@ -2,12 +2,14 @@
     <div class="title-box flex justify-between mb40 myplan">
         <p class="title">지문</p>
         <select name="" id="" v-model="selectedBook" @change="fetchUnits">
-            <option value="" disabled>교재를 선택하세요</option>
+            <option value="" disabled selected>교재를 선택하세요</option>
             <option v-for="book in books" :key="book.book_id" :value="book.book_id">
                 {{ book.book_nm }}
             </option>
         </select>
     </div>
+    <div class="content-t">
+
     <label for="" class="title2">단원</label>
     <div class="unit-pagination flex mt10 mb20" style="gap: 10px;">
         <button 
@@ -68,6 +70,7 @@
             </button>
         </div>
     </div>
+</div>
 </template>
 
 <script>
@@ -101,7 +104,7 @@
     },
     methods: {
         goToPage(page, textId) {
-            this.$router.push({ name: page, query: { textId } });
+            this.$router.push({ name: page, query: { textId, unit_id: this.selectedUnit, book_id: this.selectedBook  } });
         },
         showConfirm(type) {
             let message = '';
@@ -219,8 +222,11 @@
         SvgIcon
     },
     mounted() {
+        this.selectedUnit = this.$route.query.unit_id || '';
+        this.selectedBook = this.$route.query.book_id || '';
         this.fetchBooks(); // Fetch books when the component is mounted
         this.fetchData(); // Fetch data for the default view
+        this.fetchUnits();
     }
 };
 </script>
Add a comment
List