Commit 367acd13 by shj

历史预算到预算明细页面的跳转,导航栏的统一

parent e26e6e7d
......@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
......@@ -184,6 +185,18 @@ public class BudgetHandler {
return modelAndView;
}
@RequestMapping("/Detail/{budgetId}")
public ModelAndView budgetDetailById(@PathVariable("budgetId") Long budgetId,HttpServletRequest request, HttpServletResponse response) {
if (budgetId == null) return new ModelAndView("/");
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("/budgetDetail.jsp");
modelAndView.addObject("budget", retrieveBudget(budgetId.toString()));
Cookie sessionID = CookieUtil.getCookieByName(request.getCookies(), "sessionID");
sessionID.setValue(budgetId.toString());
response.addCookie(sessionID);
return modelAndView;
}
@RequestMapping("/HistoryPage")
public ModelAndView historyPage(HttpServletRequest request,HttpServletResponse response){
ModelAndView modelAndView=new ModelAndView();
......
......@@ -11,4 +11,5 @@ public class CookieUtil {
}
return null;
}
}
......@@ -54,16 +54,12 @@
<div>
<ul class="nav navbar-nav">
<li><a href="${pageContext.request.contextPath}/">创建预算</a></li>
<li class="active">
<a href="#">
修改预算
</a>
</li>
<li><a href="${pageContext.request.contextPath}/Budget/HistoryPage">历史预算</a></li>
<li class="active"><a href="${pageContext.request.contextPath}/Budget/Detail" >修改预算</a></li>
<li><a href="${pageContext.request.contextPath}/Rule/">修改规则</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/Download">导出最新预算</a></li>
<li><a href="${pageContext.request.contextPath}/Test">测试</a></li>
<li><a href="${pageContext.request.contextPath}/Logout">注销</a></li>
</ul>
</div>
</div>
......
......@@ -44,10 +44,12 @@
<div>
<ul class="nav navbar-nav">
<li><a href="${pageContext.request.contextPath}/">创建预算</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/Detail">修改预算</a></li>
<li class="active"><a href="${pageContext.request.contextPath}/Budget/HistoryPage">历史预算</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/Detail" >修改预算</a></li>
<li><a href="${pageContext.request.contextPath}/Rule/">修改规则</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/Download">导出最新预算</a></li>
<li class="active"><a href="#">测试</a></li>
<li><a href="${pageContext.request.contextPath}/Test">测试</a></li>
<li><a href="${pageContext.request.contextPath}/Logout">注销</a></li>
</ul>
</div>
</div>
......@@ -55,7 +57,11 @@
<div id="budgetList">
<ul>
<li v-for="budget in budgetList"><a href="#">{{budget.id}}, {{budget.date}}</a></li>
<li v-for="budget in budgetList">
<a v-bind:href="'${pageContext.request.contextPath}/Budget/Detail/'+budget.id">
{{budget.id}},创建时间:{{budget.date}}
</a>
</li>
</ul>
</div>
......@@ -77,6 +83,8 @@
console.log(error)
}
)
},
detail:function (budget) {
}
}
})
......
......@@ -34,19 +34,13 @@
</div>
<div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">创建预算</a></li>
<li>
<a href="${pageContext.request.contextPath}/Budget/Detail" >
修改预算
</a>
</li>
<li class="active"><a href="${pageContext.request.contextPath}/">创建预算</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/HistoryPage">历史预算</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/Detail" >修改预算</a></li>
<li><a href="${pageContext.request.contextPath}/Rule/">修改规则</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/Download">导出最新预算</a></li>
<li><a href="${pageContext.request.contextPath}/Test">测试</a></li>
<li><a href="${pageContext.request.contextPath}/Logout">注销</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/HistoryPage">历史预算</a></li>
</ul>
</div>
</div>
......
......@@ -45,16 +45,12 @@
<div>
<ul class="nav navbar-nav">
<li><a href="${pageContext.request.contextPath}/">创建预算</a></li>
<li>
<a href="${pageContext.request.contextPath}/Budget/Detail">
修改预算
</a>
</li>
<li class="active"><a href="#">修改规则</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/HistoryPage">历史预算</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/Detail" >修改预算</a></li>
<li class="active"><a href="${pageContext.request.contextPath}/Rule/">修改规则</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/Download">导出最新预算</a></li>
<li><a href="${pageContext.request.contextPath}/Test">测试</a></li>
<li><a href="${pageContext.request.contextPath}/Logout">注销</a></li>
</ul>
</div>
</div>
......
......@@ -46,10 +46,12 @@
<div>
<ul class="nav navbar-nav">
<li><a href="${pageContext.request.contextPath}/">创建预算</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/Detail">修改预算</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/HistoryPage">历史预算</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/Detail" >修改预算</a></li>
<li><a href="${pageContext.request.contextPath}/Rule/">修改规则</a></li>
<li><a href="${pageContext.request.contextPath}/Budget/Download">导出最新预算</a></li>
<li class="active"><a href="#">测试</a></li>
<li class="active"><a href="${pageContext.request.contextPath}/Test">测试</a></li>
<li><a href="${pageContext.request.contextPath}/Logout">注销</a></li>
</ul>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment