Author SHA1 Message Date
jieun 1ed458a9c1 Add confirmation dialog to Subject save 2026-10-20 20:08:37 +09:00
jieun 3da5840e8b Improve Subject Vue list and pagination 2026-10-20 20:02:36 +09:00
3 changed files with 14 additions and 3 deletions

No files matched your search

@@ -70,7 +70,14 @@ export default defineComponent({
created(): void {}, created(): void {},
methods: { methods: {
save(): void { save(): void {
const message = this.subject.id ? '이 과목의 수정 내용을 저장하시겠습니까?' : '새 과목을 등록하시겠습니까?';
if (!window.confirm(message)) {
return;
}
this.isSaving = true; this.isSaving = true;
if (this.subject.id) { if (this.subject.id) {
this.subjectService() this.subjectService()
.update(this.subject) .update(this.subject)
@@ -13,7 +13,7 @@ export default defineComponent({
const subjectService = inject('subjectService', () => new SubjectService()); const subjectService = inject('subjectService', () => new SubjectService());
const alertService = inject('alertService', () => useAlertService(), true); const alertService = inject('alertService', () => useAlertService(), true);
const itemsPerPage = ref(20); const itemsPerPage = ref(10);
const queryCount: Ref<number> = ref(null); const queryCount: Ref<number> = ref(null);
const page: Ref<number> = ref(1); const page: Ref<number> = ref(1);
const propOrder = ref('id'); const propOrder = ref('id');
@@ -52,7 +52,7 @@
<td> <td>
<router-link :to="{ name: 'SubjectView', params: { subjectId: subject.id } }">{{ subject.id }}</router-link> <router-link :to="{ name: 'SubjectView', params: { subjectId: subject.id } }">{{ subject.id }}</router-link>
</td> </td>
<td>{{ subject.name }}</td> <td>📘{{ subject.name }}</td>
<td>{{ subject.description }}</td> <td>{{ subject.description }}</td>
<td>{{ subject.active }}</td> <td>{{ subject.active }}</td>
<td class="text-end"> <td class="text-end">
@@ -106,7 +106,11 @@
<jhi-item-count :page="page" :total="queryCount" :items-per-page="itemsPerPage"></jhi-item-count> <jhi-item-count :page="page" :total="queryCount" :items-per-page="itemsPerPage"></jhi-item-count>
</div> </div>
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">
<b-pagination size="md" :total-rows="totalItems" v-model="page" :per-page="itemsPerPage"></b-pagination> <p>전체 과목 수: {{ totalItems }}개</p>
</div>
<div class="d-flex justify-content-center">
<b-pagination :total-rows="totalItems" v-model="page" :per-page="itemsPerPage"></b-pagination>
</div> </div>
</div> </div>
</div> </div>