From 472a1900a1b91ebecd4698f3e3b34841e252d334 Mon Sep 17 00:00:00 2001 From: Danila_Mochalov Date: Tue, 4 Apr 2023 00:41:27 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BD=D1=82.=20=D0=A0=D0=B0?= =?UTF-8?q?=D1=81=D1=81=D0=B2=D0=B5=D1=82.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/AbiturMain.vue | 64 +++++- abitur_list_client/src/components/Request.vue | 204 +++++++++++++++++- abitur_list_client/src/main.js | 7 + 3 files changed, 267 insertions(+), 8 deletions(-) diff --git a/abitur_list_client/src/components/AbiturMain.vue b/abitur_list_client/src/components/AbiturMain.vue index 72968a2..2481551 100644 --- a/abitur_list_client/src/components/AbiturMain.vue +++ b/abitur_list_client/src/components/AbiturMain.vue @@ -22,7 +22,7 @@ - +

Добавить результат

@@ -54,15 +54,14 @@ Дата: {{ request['date']}}

- - -

- +

+
@@ -142,6 +141,61 @@ export default { window.location.reload() }, + onRequestButtonClick(requestId) { + this.$router.push( + { + name: "Request", + params: { + requestId: requestId + } + } + ); + }, + + async createNewRequest() { + const axios = require('axios'); + + var requestId = 0; + + let data = JSON.stringify({ + "abitur_id": this.abiturId, + "education_form_id": 2, + "specialization_id": 2 + }); + + let config = { + method: 'post', + maxBodyLength: Infinity, + url: 'http://127.0.0.1:8080/api/request', + headers: { + 'Content-Type': 'application/json' + }, + data : data + }; + + await axios.request(config) + .then((response) => { + requestId = response.data['id'] + }) + .catch((error) => { + console.log(error); + }); + + this.$router.push( + { + name: "Request", + params: { + requestId: requestId + } + } + ); + }, + + async deleteRequest(requestId) { + await axios.delete('http://127.0.0.1:8080/api/request/' + requestId) + window.location.reload() + }, + async refresh() { var response = (await axios.get('http://127.0.0.1:8080/api/examresult/abitur/' + this.abiturId)).data this.examResults = response diff --git a/abitur_list_client/src/components/Request.vue b/abitur_list_client/src/components/Request.vue index a6cbbba..c07a74d 100644 --- a/abitur_list_client/src/components/Request.vue +++ b/abitur_list_client/src/components/Request.vue @@ -1,11 +1,209 @@