jichoi / lms_front star
intern03 2024-08-14 c4aecb1 240814 홍아랑 헤더 알림 팝업 css 수정 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
220
221
<template>
  <div class="header flex justify-end">
    <img src="../../resources/img/setting.png" alt="" />
    <div class="notice" @click="buttonSearch">
      <img src="../../resources/img/icon2.png" alt="" />
      <p>{{ unCheck }}</p>
    </div>
    <img src="../../resources/img/img03.png" alt="" />
    <div class="popup-wrap" v-show="searchOpen">
      <div class="popup-box">
        <div class="flex mb10 justify-between">
          <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>
        <article
          class="flex justify-between mt20"
          v-for="(item, index) in dataList"
          :key="item.id"
          :class="{ 'selected-row': selectedRow == item.dataList }"
        >
          <img
            style="width: fit-content"
            src="../../resources/img/img200_13p.png"
            alt=""
          />
          <p class="title1 ml20" style="width: 60%">{{ item.bbsTtl }}</p>
          <button
            @click="buttonSearch2(item)"
            type="button"
            title=""
            class="new-btn"
          >
             
          </button>
        </article>
        <article
          class="table-pagination flex justify-center align-center mb20 mt30"
          style="gap: 10px"
        >
          <button @click="previousPage" :disabled="page === 1"></button>
          <button class="selected-btn">{{ page }}</button>
          <button @click="nextPage" :disabled="page === totalPages">
            
          </button>
        </article>
      </div>
    </div>
    <div class="popup-wrap popup2" v-show="searchOpen2">
      <div class="popup-box">
        <div class="flex mb10 justify-between">
          <p class="popup-title">  </p>
          <button type="button" class="popup-close-btn" @click="closeBtn2">
            <svg-icon
              type="mdi"
              :path="mdiWindowClose"
              class="close-btn"
            ></svg-icon>
          </button>
        </div>
        <div class="board-wrap">
          <div class="flex align-center">
            <label for="" class="title2">{{ boardData.bbsTtl }}</label>
          </div>
          <hr />
          <textarea readonly name="" id="">{{ boardData.bbsCnt }}</textarea>
        </div>
        <div class="flex justify-center mt20">
          <button type="button" title="" class="new-btn" @click="closeBtn2">
            
          </button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import SvgIcon from "@jamescoyle/vue-icon";
import { mdiMagnify, mdiWindowClose } from "@mdi/js";
import axios from "axios";
export default {
  data() {
    return {
      mdiWindowClose: mdiWindowClose,
      showModal: false,
      searchOpen: false,
      searchOpen2: false,
      //  
      dataList: [],
      totalBoard: null,
      selectedRow: "",
      unCheck: null,
      boardData: [],
      //  
      page: 1,
      pageSize: 2,
      totalpages: null,
      //  
      userId: "USID_000000000000002",
      stdId: "",
    };
  },
  methods: {
    closeModal() {
      this.showModal = false;
    },
    buttonSearch() {
      this.searchOpen = true;
    },
    buttonSearch2(item) {
      const vm = this;
      this.searchOpen2 = true;
      this.boardData = item;
      axios({
        url: "/board/boardStudentCheck.json",
        method: "post",
        headers: {
          "Content-Type": "application/json; charset=UTF-8",
        },
        data: {
          bbsId: item.bbsId,
          stdId: vm.stdId,
        },
      })
        .then(function (res) {
          vm.boardList();
        })
        .catch(function (error) {
          console.log("result - error : ", error);
        });
    },
    closeBtn() {
      this.searchOpen = false;
    },
    closeBtn2() {
      this.searchOpen2 = false;
    },
    //  
    boardList() {
      const vm = this;
      axios({
        url: "/board/boardStudentList.json",
        method: "post",
        headers: {
          "Content-Type": "application/json; charset=UTF-8",
        },
        data: { page: vm.page, pageSize: vm.pageSize, userId: vm.userId },
      })
        .then(function (res) {
          vm.dataList = res.data.result[0].boardClass[0].board;
          vm.userNm = res.data.result[0].userNm;
          vm.userId = res.data.result[0].userId;
          vm.unCheck = res.data.unCheck;
          vm.stdId =
            res.data.result[0].boardClass[0].board[0].boardStudent[0].stdId;
          vm.totalBoard = res.data.totalBoard;
          vm.totalPages = Math.ceil(vm.totalBoard / vm.pageSize);
        })
        .catch(function (error) {
          console.log("result - error : ", error);
          alert("  ");
        });
    },
    previousPage() {
      if (this.page > 1) {
        this.page -= 1;
        this.boardList();
      }
    },
    nextPage() {
      if (this.page < this.totalPages) {
        this.page += 1;
        this.boardList();
      }
    },
  },
  watch: {},
  computed: {},
  components: {
    SvgIcon,
  },
  mounted() {
    console.log("Header mounted");
    this.boardList();
  },
};
</script>
<style scoped>
.popup-wrap {
  position: fixed;
  background-color: transparent;
  width: fit-content;
  height: fit-content;
  z-index: 10;
}
.popup-box {
  top: 300px;
  left: 62%;
}
.popup2 .popup-box {
  top: 450px;
  left: 38%;
}
</style>
X