jichoi / calendar star
최정임 최정임 02-03
250203 최정임
@23051f8ff929cbe030145ebda216da49c77bbd03
client/views/pages/Manager/DeptList.vue
--- client/views/pages/Manager/DeptList.vue
+++ client/views/pages/Manager/DeptList.vue
@@ -1,14 +1,140 @@
 <template>
-    <div class="services">
-      <h1>Our Services</h1>
-      <p>We provide web development and design services.</p>
-    </div>
-  </template>
-  
-  <script>
-  </script>
-  
-  <style scoped>
+  <div class="pagetitle">
+    <h1>부서관리</h1>
+  </div>
+  <!-- End Page Title -->
+  <section class="section">
+    <div class="row">
 
-  </style>
-  
(파일 끝에 줄바꿈 문자 없음)
+
+      <div class="col-lg-12">
+        <div class="card">
+          <div class="card-body">
+            <h5 class="card-title">부서관리</h5>
+            <div class="d-flex pb-3 justify-content-end ">
+
+              <div class="d-flex justify-content-end ">
+                <button type="button" class="btn btn-outline-secondary" @click="registerLeave">
+                  등록
+                </button>
+                <button type="button" class="btn btn-outline-success" @click="saveChanges">
+                  저장
+                </button>
+                <button type="button" class="btn btn-outline-danger" @click="deletePending">
+                  삭제
+                </button>
+              </div>
+
+            </div>
+            <!-- Table  -->
+            <table id="myTable" class="table datatable table-hover">
+              <!-- 동적으로 <th> 생성 -->
+              <thead>
+                <tr>
+                  <th>No </th>
+                  <th>부서명</th>
+                  <th>인원</th>
+                </tr>
+              </thead>
+              <!-- 동적으로 <td> 생성 -->
+              <tbody>
+                <tr v-for="(item, index) in ChuljangData" :key="item.startDate + index">
+  <td>
+    <div class="form-check">
+      <label class="form-check-label" for="acceptTerms">{{ index + 1 }}</label>
+      <input v-model="item.acceptTerms" class="form-check-input" type="checkbox" />
+    </div>
+  </td>
+  <td><input type="text" v-model="item.deptNM" /></td>
+  <td><input type="text" v-model="item.member" /></td>
+    
+</tr>
+              </tbody>
+            </table>
+
+            <!-- End Table -->
+          </div>
+        </div>
+      </div>
+    </div>
+  </section>
+</template>
+
+<script>
+import { DataTable } from 'simple-datatables'
+export default {
+  data() {
+    return {
+      // 데이터 초기화
+      years: [2023, 2024, 2025], // 연도 목록
+      months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], // 월 목록
+      selectedYear: '',
+      selectedMonth: '',
+      ChuljangData: [
+      { startDate: '', endDate: '', where: '대구', purpose: '',  acceptTerms: false },
+      { startDate: '', endDate: '', where: '경산', acceptTerms: false },
+        // 더 많은 데이터 추가...
+      ],
+      filteredData: [],
+    };
+  },
+  computed: {
+
+  },
+  methods: {
+    
+    registerLeave() {
+      console.log("등록 버튼 클릭됨");
+
+      // Vue의 반응성 문제를 피하기 위해, 새로운 객체를 추가합니다.
+      this.ChuljangData = [
+        ...this.ChuljangData,
+        { startDate: '', endDate: '', where: '', acceptTerms: false }
+      ];
+
+      console.log(this.ChuljangData); // 배열 상태 출력
+    },
+    saveChanges() {
+      console.log("저장된 데이터:", this.ChuljangData);
+      alert("저장되었습니다.");
+    },
+    deletePending() {
+    // 선택된 항목만 필터링하여 삭제
+    const selectedItems = this.ChuljangData.filter(item => item.acceptTerms);
+
+    // 승인된 항목이 없으면 삭제 진행
+    if (selectedItems.length > 0) {
+      this.ChuljangData = this.ChuljangData.filter(item => !item.acceptTerms);
+      alert(`${selectedItems.length}개의 항목이 삭제되었습니다.`);
+    } else {
+      alert("선택된 항목이 없습니다.");
+    }
+  },
+    // 날짜 필터 적용
+    filterData() {
+      this.filteredData = this.ChuljangData.filter(item => {
+        const itemYear = new Date(item.startDate).getFullYear();
+        const itemMonth = new Date(item.startDate).getMonth() + 1; // 월은 0부터 시작하므로 1을 더해줍니다.
+
+        return (
+          (!this.selectedYear || itemYear === parseInt(this.selectedYear)) &&
+          (!this.selectedMonth || itemMonth === parseInt(this.selectedMonth))
+        );
+      });
+    },
+
+    // 페이지 변경
+    changePage(page) {
+      this.currentPage = page;
+    },
+  },
+  mounted() {
+    
+    // 처음에는 모든 데이터를 표시
+    this.filteredData = this.ChuljangData;
+  
+  },
+};
+</script>
+
+<style scoped></style>
client/views/pages/Manager/EmployeeList.vue
--- client/views/pages/Manager/EmployeeList.vue
+++ client/views/pages/Manager/EmployeeList.vue
@@ -1,20 +1,134 @@
 <template>
-    <div class="contact">
-      <h1>Contact Us</h1>
-      <p>If you have any questions, feel free to reach out to us.</p>
+  <div class="pagetitle">
+    <h1>직원관리</h1>
+  </div>
+  <!-- End Page Title -->
+  <section class="section">
+    <div class="row">
+
+
+      <div class="col-lg-12">
+        <div class="card">
+          <div class="card-body">
+            <h5 class="card-title">직원관리</h5>
+            <div class="d-flex pb-3 justify-content-between">
+              <div class="datatable-search d-flex gap-1 ">
+                <div class="">
+                  <select class="form-select " v-model="selectedDept">
+                    <option value="" >이름</option>
+                    <option v-for="dept in depts" :key="dept" :value="dept">{{ dept }}</option>
+                  </select>
+                </div>
+                <div class="search-bar d-flex gap-2">
+              <form class="search-form d-flex  align-items-center" method="POST" action="#"
+                @submit.prevent="updateMember">
+                <input type="text" v-model="searchQuery" name="query" placeholder="Search" title="Enter search keyword">
+                <button type="submit" title="Search"><i class="bi bi-search"></i></button>
+              </form>
+            </div>
+                <button type="button" class="btn btn-outline-secondary"
+                  @click="filterData">조회</button>
+
+              </div>
+              <div class="d-flex justify-content-end ">
+                <!-- <button type="button" class="btn btn-outline-secondary" @click="registerLeave">
+                  등록
+                </button>
+                <button type="button" class="btn btn-outline-success" @click="saveChanges">
+                  저장
+                </button> -->
+                <button type="button" class="btn btn-outline-danger" @click="deletePending">
+                  삭제
+                </button>
+              </div>
+
+            </div>
+            <!-- Table  -->
+            <table id="myTable" class="table datatable table-hover">
+              <!-- 동적으로 <th> 생성 -->
+              <thead>
+                <tr>
+                  <th>No </th>
+                  <th>이름</th>
+                  <th>부서</th>
+                  <th>직급</th>
+                  <th>이메일</th>
+                </tr>
+              </thead>
+              <!-- 동적으로 <td> 생성 -->
+              <tbody>
+                <tr v-for="(item, index) in ChuljangData" :key="item.startDate + index">
+  <td>
+    <div class="form-check">
+      <label class="form-check-label" for="acceptTerms">{{ index + 1 }}</label>
+      <input v-model="item.acceptTerms" class="form-check-input" type="checkbox" />
     </div>
-  </template>
+  </td>
+  <td><input type="text" v-model="item.name" /></td>
+  <td><input type="text" v-model="item.dept" /></td>
+  <td><input type="text" v-model="item.level" /></td>
+  <td><input type="text" v-model="item.email" /></td>
+</tr>
+              </tbody>
+            </table>
+
+            <!-- End Table -->
+          </div>
+        </div>
+      </div>
+    </div>
+  </section>
+</template>
+
+<script>
+import { DataTable } from 'simple-datatables'
+export default {
+  data() {
+    return {
+      // 데이터 초기화
+      depts: [2023, 2024, 2025], // 연도 목록
+      levels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], // 월 목록
+      selectedDept: '',
+      selectedlevel: '',
+      ChuljangData: [
+      { startDate: '', endDate: '', where: '대구', purpose: '',  acceptTerms: false },
+      { startDate: '', endDate: '', where: '경산', acceptTerms: false },
+        // 더 많은 데이터 추가...
+      ],
+      filteredData: [],
+    };
+  },
+  computed: {
+
+  },
+  methods: {
+    
+   
+    deletePending() {
+    // 선택된 항목만 필터링하여 삭제
+    const selectedItems = this.ChuljangData.filter(item => item.acceptTerms);
+
+    // 승인된 항목이 없으면 삭제 진행
+    if (selectedItems.length > 0) {
+      this.ChuljangData = this.ChuljangData.filter(item => !item.acceptTerms);
+      alert(`${selectedItems.length}개의 항목이 삭제되었습니다.`);
+    } else {
+      alert("선택된 항목이 없습니다.");
+    }
+  },
+   
+    // 페이지 변경
+    changePage(page) {
+      this.currentPage = page;
+    },
+  },
+  mounted() {
+    
+    // 처음에는 모든 데이터를 표시
+    this.filteredData = this.ChuljangData;
   
-  <script>
-  export default {
-    name: 'ContactPage',
-  }
-  </script>
-  
-  <style scoped>
-  .contact {
-    text-align: center;
-    margin-top: 50px;
-  }
-  </style>
-  
(파일 끝에 줄바꿈 문자 없음)
+  },
+};
+</script>
+
+<style scoped></style>
client/views/pages/User/Join.vue
--- client/views/pages/User/Join.vue
+++ client/views/pages/User/Join.vue
@@ -26,12 +26,23 @@
                 <input  v-model="name" type="text" name="name" class="form-control" id="yourName" required>
                 <div class="invalid-feedback">이름을 입력해주세요.</div>
               </div>
-
               <div class="col-12">
-                <label for="yourUsername" class="form-label">Email</label>
+            <label for="yourdept" class="form-label">부서</label>
+            <select v-model="dept" id="inputState" class="form-select">
+              <option selected></option>
+              <option></option>
+            </select>
+          </div>
+          <div class="col-12">
+                <label for="yourlevel" class="form-label">직급</label>
+                <input  v-model="level" type="text" name="name" class="form-control" id="yourlevel" required>
+                <div class="invalid-feedback">직급을 입력해주세요.</div>
+              </div>
+              <div class="col-12">
+                <label for="youremail" class="form-label">Email</label>
                 <div class="input-group has-validation">
                   <span class="input-group-text" id="inputGroupPrepend">@</span>
-                  <input  v-model="email" type="text" name="username" class="form-control" id="yourUsername" required>
+                  <input  v-model="email" type="text" name="username" class="form-control" id="youremail" required>
                   <div class="invalid-feedback">회사 이메일을 입력해주세요.</div>
                 </div>
               </div>
@@ -76,6 +87,8 @@
       name: '',
       email: '',
       password: '',
+      dept: '',
+      level: '',
       acceptTerms: false,
       formSubmitted: false,
       logo: "/client/resources/img/logo_t.png", // 경로를 Vue 프로젝트 구조에 맞게 설정
@@ -85,7 +98,7 @@
     handleRegister() {
       this.formSubmitted = true; 
       // 이메일과 비밀번호가 빈 값이 아니어야 한다
-      if (this.email && this.password && this.name && this.acceptTerms) {
+      if (this.email && this.password && this.name && this.acceptTerms && this.dept && this.level) {
         // 로컬 스토리지에 회원가입 정보 저장
         const userData = {
           name: this.name,
Add a comment
List