Ваша заявка:
-
Дата: {{ this.request['date'].slice(0,10) }}
+
Дата: {{ this.request['date'].slice(0,10) ?? ''}}
Специализация:
Форма обучения:
@@ -29,10 +29,10 @@
-
- Предмет: {{ result['title']}}
+ Предмет: {{ result['title'] ?? ''}}
- Результат: {{ result['result']}}
+ Результат: {{ result['result'] ?? ''}}
-
Добавить результат к заявке
-
+
Добавить ваши результаты к заявке
+
+
+
+
+ {{res['title'] ?? '' }}: {{ res['result'] ?? '' }} баллов
+
+
+
@@ -105,14 +113,14 @@ export default {
window.location.reload()
},
- async addResultToRequest() {
+ async addResultToRequest(res) {
const axios = require('axios');
console.log('Save new result')
console.log(this.requestId)
- console.log(this.selectedExamResult)
+ console.log(res)
var request_result_pairs = (await axios.get('http://127.0.0.1:8080/api/request_examresult/' + this.requestId)).data
for (const pair of request_result_pairs) {
- if (pair['request_id'] == this.requestId && pair['exam_result_id']==this.selectedExamResult['id']) {
+ if (pair['request_id'] == this.requestId && pair['exam_result_id']==res['id']) {
return;
}
}
@@ -120,7 +128,7 @@ export default {
let data = JSON.stringify({
"request_id": this.requestId,
- "exam_result_id": this.selectedExamResult['id']
+ "exam_result_id": res['id']
});
let config = {
@@ -181,28 +189,45 @@ export default {
}
},
- async beforeMount() {
+ async created() {
// получаем заявку
this.requestId = this.$route.params.requestId
- this.request = (await axios.get('http://127.0.0.1:8080/api/request/' + this.requestId)).data[0]
+ console.log(this.requestId)
+ this.request = (await axios.get('http://127.0.0.1:8080/api/request/' + this.requestId)).data
+ console.log(this.request)
// получаем ее специализацию и форму обучения
this.educationForm = (await axios.get('http://127.0.0.1:8080/api/educationform/' + this.request['education_form_id'])).data
- console.log(this.educationForm)
+ //console.log(this.educationForm)
this.specialization = (await axios.get('http://127.0.0.1:8080/api/specialization/' + this.request['specialization_id'])).data
console.log(this.specialization)
//получаем закрепленные за заявкой результаты
var request_result_pairs = (await axios.get('http://127.0.0.1:8080/api/request_examresult/' + this.requestId)).data
- var results = []
for(const pair of request_result_pairs) {
- console.log(pair)
- results.push((await axios.get('http://127.0.0.1:8080/api/examresult/' + pair['exam_result_id'])).data)
+ //console.log(pair)
+ this.results.push((await axios.get('http://127.0.0.1:8080/api/examresult/' + pair['exam_result_id'])).data)
}
- this.results = results
+ // console.log(this.results)
//получаем все результаты абитуриента
- this.allResults = (await axios.get('http://127.0.0.1:8080/api/examresult/abitur/' + this.request['abitur_id'])).data
+ var allResults = (await axios.get('http://127.0.0.1:8080/api/examresult/abitur/' + this.request['abitur_id'])).data
+ //console.log(allResults)
+ //
+
+ var flag = true;
+ for (const allRes of allResults) {
+ flag = true;
+ for(const res of this.results) {
+ if (allRes['id'] == res['id'])
+ flag = false
+ }
+ if (flag) {
+ this.allResults.push(allRes)
+ }
+ }
+
// получаем все формы обучения и специализации
this.specializations = (await axios.get('http://127.0.0.1:8080/api/specialization')).data
this.forms = (await axios.get('http://127.0.0.1:8080/api/educationform')).data
+
}
}
diff --git a/abitur_list_client/src/components/TestPage.vue b/abitur_list_client/src/components/TestPage.vue
new file mode 100644
index 0000000..8d613c5
--- /dev/null
+++ b/abitur_list_client/src/components/TestPage.vue
@@ -0,0 +1,195 @@
+
+
+
Страница с отчетами и прочими приколами
+
+
Приколы
+
+
{{deleteAllMessage}}
+
+
+
Средний балл по специализации
+
+
+
YOUR DESTINY: {{destiny}}
+
+
+
+
+
{{magicMessage}}
+
+
+
+
+
\ No newline at end of file
diff --git a/abitur_list_client/src/main.js b/abitur_list_client/src/main.js
index f7f1196..5e877ff 100644
--- a/abitur_list_client/src/main.js
+++ b/abitur_list_client/src/main.js
@@ -5,6 +5,8 @@ import { createRouter, createWebHistory } from "vue-router"
import Auth from './components/Auth'
import AbiturMain from './components/AbiturMain'
import Request from './components/Request'
+import Test from './components/TestPage'
+import Enter from './components/Enter'
const routes = [
{
@@ -23,6 +25,16 @@ const routes = [
name: 'Request',
component: Request,
props: true
+ },
+ {
+ path:'/test',
+ component: Test,
+ name: 'Test'
+ },
+ {
+ path:'/enter',
+ component: Enter,
+ name: 'Enter'
}
]