partially paper view

This commit is contained in:
Anton Romanov 2019-05-07 09:34:16 +04:00
parent 7c1b87c126
commit 8449c028f9
5 changed files with 138 additions and 1 deletions

View File

@ -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'

View File

@ -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<String> getFormattedReference(@RequestBody @Valid ReferenceDto referenceDto) {
return new Response<>(paperService.getFormattedReference(referenceDto));
}
@GetMapping("/allAuthors")
public Response<List<User>> getAllAuthors() {
return new Response<>(paperService.getPaperAuthors());
}
@GetMapping("/allTypes")
public Response<List<Paper.PaperType>> getPaperTypes() {
return new Response<>(paperService.getPaperTypes());
}
@GetMapping("/allStatuses")
public Response<List<Paper.PaperStatus>> getPaperStatuses() {
return new Response<>(paperService.getPaperStatuses());
}
}

View File

@ -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
};
});

View File

@ -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")
},

View File

@ -0,0 +1,108 @@
<template>
<div>
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading text-uppercase">Редактирование статьи</h2>
<paper-navigation>
</paper-navigation>
</div>
</div>
<hr/>
<div class="row">
<div class="col-lg-12">
<form name="paperform" id="paper-form" method="post"
action="/papers/paper">
<div class="row">
<div class="col-md-7 col-sm-12">
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<a class="nav-item nav-link active" id="nav-main-tab" data-toggle="tab"
href="#nav-main" role="tab" aria-controls="nav-main"
aria-selected="true">Статья</a>
<a class="nav-item nav-link" id="nav-latex-tab" data-toggle="tab"
href="#nav-latex" role="tab" aria-controls="nav-latex"
aria-selected="false">Latex</a>
</div>
</nav>
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-main" role="tabpanel"
aria-labelledby="nav-main-tab">
<div class="form-group">
<label for="title">Название:</label>
<input class="form-control" id="title" type="text"
placeholder="Название статьи"/>
</div>
<div class="form-group">
<label for="type">Тип статьи:</label>
<select class="form-control" id="type">
<option v-for="type in allTypes" value="type">{{ type }}
</option>
</select>
</div>
<div class="form-group">
<label for="status">Статус:</label>
<select class="form-control" id="status">
<option v-for="status in allStatuses" value="status">{{status}}
</option>
</select>
</div>
<div class="form-group">
<label for="comment">Комментарий:</label>
<textarea class="form-control" rows="5" id="comment"></textarea>
</div>
<div class="form-group">
<label for="title">Ссылка на сайт конференции:</label>
<input class="form-control" id="url" type="text"
placeholder="Url"/>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</template>
<script>
module.exports = {
components: {
"paper-navigation": httpVueLoaderEx("/papers/paper-navigation.vue")
},
data: function () {
return {
allAuthors: [],
allTypes: [],
allStatuses: []
};
},
mounted: function () {
var self = this;
axiosEx.get(
appConfig.paper + "/65537",
function (data) {
self.paper = data;
});
axiosEx.get(
appConfig.allPaperAuthors,
function (data) {
self.allAuthors = data;
});
axiosEx.get(
appConfig.allPaperTypes,
function (data) {
self.allTypes = data;
});
axiosEx.get(
appConfig.allPaperStatuses,
function (data) {
self.allStatuses = data;
});
}
}
</script>