From 8449c028f93eee46e7e415074628fe945b029950 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Tue, 7 May 2019 09:34:16 +0400 Subject: [PATCH] partially paper view --- build.gradle | 1 + .../paper/controller/PaperRestController.java | 17 +++ src/main/resources/static/js/app-config.js | 10 +- src/main/resources/static/js/app.js | 3 + src/main/resources/static/papers/paper.vue | 108 ++++++++++++++++++ 5 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/static/papers/paper.vue diff --git a/build.gradle b/build.gradle index 494eebf..c5804ae 100644 --- a/build.gradle +++ b/build.gradle @@ -118,6 +118,7 @@ dependencies { compile group: 'org.webjars', name: 'font-awesome', version: '4.7.0' compile group: 'org.webjars', name: 'bootstrap', version: '4.1.3' + compile group: 'org.webjars', name: 'bootstrap-select', version: '1.13.8' compile group: 'org.webjars.npm', name: 'vue', version: '2.6.9' compile group: 'org.webjars.npm', name: 'vuex', version: '3.1.0' compile group: 'org.webjars.npm', name: 'vue-router', version: '3.0.2' diff --git a/src/main/java/ru/ulstu/paper/controller/PaperRestController.java b/src/main/java/ru/ulstu/paper/controller/PaperRestController.java index 9ad5310..3df2e93 100644 --- a/src/main/java/ru/ulstu/paper/controller/PaperRestController.java +++ b/src/main/java/ru/ulstu/paper/controller/PaperRestController.java @@ -10,10 +10,12 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import ru.ulstu.configuration.Constants; import ru.ulstu.core.model.response.Response; +import ru.ulstu.paper.model.Paper; import ru.ulstu.paper.model.PaperDto; import ru.ulstu.paper.model.PaperListDto; import ru.ulstu.paper.model.ReferenceDto; import ru.ulstu.paper.service.PaperService; +import ru.ulstu.user.model.User; import javax.validation.Valid; import java.io.IOException; @@ -77,4 +79,19 @@ public class PaperRestController { public Response getFormattedReference(@RequestBody @Valid ReferenceDto referenceDto) { return new Response<>(paperService.getFormattedReference(referenceDto)); } + + @GetMapping("/allAuthors") + public Response> getAllAuthors() { + return new Response<>(paperService.getPaperAuthors()); + } + + @GetMapping("/allTypes") + public Response> getPaperTypes() { + return new Response<>(paperService.getPaperTypes()); + } + + @GetMapping("/allStatuses") + public Response> getPaperStatuses() { + return new Response<>(paperService.getPaperStatuses()); + } } diff --git a/src/main/resources/static/js/app-config.js b/src/main/resources/static/js/app-config.js index 3488b6e..e735e56 100644 --- a/src/main/resources/static/js/app-config.js +++ b/src/main/resources/static/js/app-config.js @@ -20,6 +20,10 @@ var makeIntegration = basePath + "/make-integration"; var paperList = basePath + "/papers"; var paperDashboard = basePath + "/papers/dashboard"; + var paper = basePath + "/papers"; + var allPaperAuthors = basePath + "/papers/allAuthors"; + var allPaperTypes = basePath + "/papers/allTypes"; + var allPaperStatuses = basePath + "/papers/allStatuses"; return { version: appVersion, @@ -28,6 +32,10 @@ tables: getTables, integration: makeIntegration, paperList: paperList, - paperDashboard: paperDashboard + paperDashboard: paperDashboard, + paper: paper, + allPaperAuthors: allPaperAuthors, + allPaperTypes: allPaperTypes, + allPaperStatuses: allPaperStatuses }; }); \ No newline at end of file diff --git a/src/main/resources/static/js/app.js b/src/main/resources/static/js/app.js index 8cfb1ad..890f70f 100644 --- a/src/main/resources/static/js/app.js +++ b/src/main/resources/static/js/app.js @@ -11,6 +11,9 @@ var router = new VueRouter({ { path: "/papers/papers", component: httpVueLoaderEx("/papers/paper-list.vue", "PaperList") }, + { + path: "/papers/paper", component: httpVueLoaderEx("/papers/paper.vue", "PaperEdit") + }, { path: "/papers/dashboard", component: httpVueLoaderEx("/papers/paper-dashboard.vue", "PaperDashboard") }, diff --git a/src/main/resources/static/papers/paper.vue b/src/main/resources/static/papers/paper.vue new file mode 100644 index 0000000..677619f --- /dev/null +++ b/src/main/resources/static/papers/paper.vue @@ -0,0 +1,108 @@ + + + \ No newline at end of file