Потихоньку добавлю фронт
This commit is contained in:
parent
b25ef9f3eb
commit
db321f5899
BIN
data.mv.db
BIN
data.mv.db
Binary file not shown.
@ -1,8 +1,69 @@
|
||||
<template>
|
||||
|
||||
<div class="add_student_button">
|
||||
<button id="add_btn" type="submit" data-bs-toggle="modal" data-bs-target="#addModal">Добавить студента</button>
|
||||
</div>
|
||||
<table class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ФИО</th>
|
||||
<th>Дата рождения</th>
|
||||
<th>Группа</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(student, index) in students" :key="index">
|
||||
<td>{{ student.name }}</td>
|
||||
<td>{{ student.birthDate }}</td>
|
||||
<td><button class="buttonUpdate" @click="openModal(student)" data-bs-toggle="modal" data-bs-target="#exampleModal"></button></td>
|
||||
<td><button class="buttonRemove" @click="deleteUser(student)"></button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="modal" ref="addModal" id="addModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Добавить студента</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Имя</label>
|
||||
<input type="text" class="form-control" id="name">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="birthDate" class="form-label">Дата рождения</label>
|
||||
<input type="date" class="form-control" id="birthDate">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="group" class="form-label">Группа</label>
|
||||
<input type="text" class="form-control" id="group">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
|
||||
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Сохранить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
name: "",
|
||||
birthDate: ""
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
addUser(){
|
||||
fetch('')
|
||||
.then(response => response.text())
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
@ -1,8 +1,56 @@
|
||||
<template>
|
||||
|
||||
<div class="add_student_button">
|
||||
<button id="add_btn" type="submit" data-bs-toggle="modal" data-bs-target="#addModal">Добавить предмет</button>
|
||||
</div>
|
||||
<table class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название предмета</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(subject, index) in subjects" :key="index">
|
||||
<td>{{ subject.name }}</td>
|
||||
<td><button class="buttonUpdate" @click="openModal(subject)" data-bs-toggle="modal" data-bs-target="#exampleModal"></button></td>
|
||||
<td><button class="buttonRemove" @click="deleteUser(subject)"></button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="modal" ref="addModal" id="addModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Добавить пердмет</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Название</label>
|
||||
<input type="text" class="form-control" id="name">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
|
||||
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Сохранить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
name: ""
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
addSubject(){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
Loading…
Reference in New Issue
Block a user