jichoi / lms_front star
File name
Commit message
Commit date
File name
Commit message
Commit date
PsHooN7979 2024-08-09 656a8ba 240809 박세훈 ClassDetail 화면 게시판 화면 연결 UNIX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<template>
  <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
            v-for="(item, index) in dataList"
            :key="item.id"
            :class="{ 'selected-row': selectedRow == item.dataList }"
            @click="[goToPage('noticeDetail'), selectBoardList(item)]"
          >
            <td>{{ totalPosts - index }}</td>
            <td>{{ item.bbsTtl }}</td>
            <td>{{ item.bbsCls }}</td>
            <td>{{ userNm }}</td>
            <td>{{ item.bbsTm.substr(0, 16) }}</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="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>
</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 axios from "axios";
export default {
  data() {
    return {
      mdiMagnify: mdiMagnify,
      mdilArrowRight: mdilArrowRight,
      timer: "00:00",
      progress: 20,
      //        
      selectedClassId: this.$route.query.sclsId,
      //  
      dataList: [],
      totalPosts: 0,
      selectedRow: "",
      bbsTm: "",
      // 
      currentPage: 0,
      itemsPerPage: 5,
      //  
      sclsId: "",
    };
  },
  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 = "?";
      }
      if (confirm(message)) {
        this.goBack();
      }
    },
    //  
    boardList() {
      const vm = this;
      axios({
        url: "/board/findAll.json",
        method: "post",
        headers: {
          "Content-Type": "application/json; charset=UTF-8",
        },
        data: {
          page: vm.currentPage + 1,
          pageSize: vm.itemsPerPage,
          sclsId: vm.selectedClassId,
        },
      })
        .then(function (res) {
          console.log("dataList - response : ", res.data);
          vm.dataList = res.data.result[0].boardClass[0].board;
          vm.userNm = res.data.result[0].userNm;
          vm.userId = res.data.result[0].userId;
          vm.totalPosts = res.data.totalBoard;
          console.log(vm.userId);
        })
        .catch(function (error) {
          console.log("result - error : ", error);
        });
    },
    setClassId() {
      sessionStorage.setItem("sclsId", JSON.stringify(this.selectedClassId));
      sessionStorage.removeItem("selectedBoardList");
      sessionStorage.removeItem("file");
      this.boardList();
    },
    //    
    selectBoardList(item) {
      sessionStorage.setItem("selectedBoardList", JSON.stringify(item));
    },
  },
  watch: {},
  computed: {},
  components: {
    SvgIcon,
    ProgressBar,
  },
  mounted() {
    console.log("Main2 mounted");
    //console.log(`  sclsId(  : ${this.selectedClassId}`);
    this.setClassId();
  },
};
</script>
X