完成管理员主页的数据读取
This commit is contained in:
@@ -1,12 +1,15 @@
|
|||||||
package com.fjy.spring.controller;
|
package com.fjy.spring.controller;
|
||||||
|
|
||||||
|
import com.fjy.spring.domain.VFeedBack;
|
||||||
|
import com.fjy.spring.domain.VLog;
|
||||||
import com.fjy.spring.domain.VWorkDetail;
|
import com.fjy.spring.domain.VWorkDetail;
|
||||||
import com.fjy.spring.enums.ResultEnum;
|
import com.fjy.spring.enums.ResultEnum;
|
||||||
import com.fjy.spring.exception.UserException;
|
import com.fjy.spring.exception.UserException;
|
||||||
|
import com.fjy.spring.service.FeedBackService;
|
||||||
|
import com.fjy.spring.service.LogService;
|
||||||
import com.fjy.spring.service.WorkDetailService;
|
import com.fjy.spring.service.WorkDetailService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -17,6 +20,12 @@ public class DataController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private WorkDetailService workDetailService;
|
private WorkDetailService workDetailService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LogService logService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FeedBackService feedBackService;
|
||||||
|
|
||||||
@GetMapping("/home/findAllHomework")
|
@GetMapping("/home/findAllHomework")
|
||||||
public List<VWorkDetail> findAllHomework(){
|
public List<VWorkDetail> findAllHomework(){
|
||||||
List<VWorkDetail> homeworks = workDetailService.findAll();
|
List<VWorkDetail> homeworks = workDetailService.findAll();
|
||||||
@@ -26,4 +35,24 @@ public class DataController {
|
|||||||
new UserException(ResultEnum.EMPTY_DATA);
|
new UserException(ResultEnum.EMPTY_DATA);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/home/findvlog")
|
||||||
|
public List<VLog> findlog(){
|
||||||
|
List<VLog> vlogs = logService.findvlog();
|
||||||
|
if (vlogs!=null){
|
||||||
|
return vlogs;
|
||||||
|
}
|
||||||
|
new UserException(ResultEnum.EMPTY_DATA);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/home/findvfeedback")
|
||||||
|
public List<VFeedBack> findAllVFeedback(){
|
||||||
|
List<VFeedBack> feedBacks = feedBackService.findAllVFeedback();
|
||||||
|
if (feedBacks!=null){
|
||||||
|
return feedBacks;
|
||||||
|
}
|
||||||
|
new UserException(ResultEnum.EMPTY_DATA);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ public class NavController {
|
|||||||
return "/home/about";
|
return "/home/about";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = {"/admin"})
|
||||||
|
public String toAdminPage(){
|
||||||
|
return "/home/admin";
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping(value = {"/home/user"})
|
@GetMapping(value = {"/home/user"})
|
||||||
public String toUserPage(){
|
public String toUserPage(){
|
||||||
return "/home/user";
|
return "/home/user";
|
||||||
|
|||||||
56
src/main/java/com/fjy/spring/domain/VFeedBack.java
Normal file
56
src/main/java/com/fjy/spring/domain/VFeedBack.java
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
package com.fjy.spring.domain;
|
||||||
|
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
import org.hibernate.annotations.Subselect;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Subselect("SELECT * FROM v_feedback")
|
||||||
|
public class VFeedBack {
|
||||||
|
@Id
|
||||||
|
@Column(name = "feedbackid")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Column(name = "colname")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@Column(name = "feedbackcontent")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@Column(name = "issuetime")
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
}
|
||||||
62
src/main/java/com/fjy/spring/domain/VLog.java
Normal file
62
src/main/java/com/fjy/spring/domain/VLog.java
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
package com.fjy.spring.domain;
|
||||||
|
|
||||||
|
import org.hibernate.annotations.Immutable;
|
||||||
|
import org.hibernate.annotations.Subselect;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Immutable
|
||||||
|
@Subselect("SELECT *FROM v_log LIMIT 0, 20")
|
||||||
|
public class VLog {
|
||||||
|
@Id
|
||||||
|
private Integer logid;
|
||||||
|
|
||||||
|
private String colname;
|
||||||
|
|
||||||
|
private String coltime;
|
||||||
|
|
||||||
|
private String colip;
|
||||||
|
|
||||||
|
private String colheader;
|
||||||
|
|
||||||
|
public Integer getLogid() {
|
||||||
|
return logid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLogid(Integer logid) {
|
||||||
|
this.logid = logid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColname() {
|
||||||
|
return colname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColname(String colname) {
|
||||||
|
this.colname = colname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColtime() {
|
||||||
|
return coltime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColtime(String coltime) {
|
||||||
|
this.coltime = coltime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColip() {
|
||||||
|
return colip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColip(String colip) {
|
||||||
|
this.colip = colip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColheader() {
|
||||||
|
return colheader;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColheader(String colheader) {
|
||||||
|
this.colheader = colheader;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@ import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
|
|||||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
@Configuration
|
/*@Configuration*/
|
||||||
public class WebAppConfig implements WebMvcConfigurer {
|
public class WebAppConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.fjy.spring.repository;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fjy.spring.domain.VFeedBack;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
|
||||||
|
public interface VFeedBackRepository extends JpaRepository<VFeedBack,Integer> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.fjy.spring.repository;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fjy.spring.domain.VLog;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface VLogRepository extends JpaRepository<VLog,Integer> {
|
||||||
|
}
|
||||||
@@ -1,17 +1,24 @@
|
|||||||
package com.fjy.spring.service;
|
package com.fjy.spring.service;
|
||||||
|
|
||||||
import com.fjy.spring.domain.TbFeedBack;
|
import com.fjy.spring.domain.TbFeedBack;
|
||||||
|
import com.fjy.spring.domain.VFeedBack;
|
||||||
import com.fjy.spring.enums.ResultEnum;
|
import com.fjy.spring.enums.ResultEnum;
|
||||||
import com.fjy.spring.exception.UserException;
|
import com.fjy.spring.exception.UserException;
|
||||||
import com.fjy.spring.repository.TbFeedBackRepository;
|
import com.fjy.spring.repository.TbFeedBackRepository;
|
||||||
|
import com.fjy.spring.repository.VFeedBackRepository;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class FeedBackService {
|
public class FeedBackService {
|
||||||
@Autowired
|
@Autowired
|
||||||
TbFeedBackRepository feedBackRepository;
|
TbFeedBackRepository feedBackRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
VFeedBackRepository vFeedBackRepository;
|
||||||
|
|
||||||
public boolean addContent(TbFeedBack feedBack){
|
public boolean addContent(TbFeedBack feedBack){
|
||||||
TbFeedBack feed=feedBackRepository.save(feedBack);
|
TbFeedBack feed=feedBackRepository.save(feedBack);
|
||||||
if (feed!=null){
|
if (feed!=null){
|
||||||
@@ -20,4 +27,8 @@ public class FeedBackService {
|
|||||||
new UserException(ResultEnum.ADD_ERROR);
|
new UserException(ResultEnum.ADD_ERROR);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<VFeedBack> findAllVFeedback(){
|
||||||
|
return vFeedBackRepository.findAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,27 @@
|
|||||||
package com.fjy.spring.service;
|
package com.fjy.spring.service;
|
||||||
|
|
||||||
import com.fjy.spring.domain.TbLog;
|
import com.fjy.spring.domain.TbLog;
|
||||||
|
import com.fjy.spring.domain.VLog;
|
||||||
import com.fjy.spring.repository.TbLogRepository;
|
import com.fjy.spring.repository.TbLogRepository;
|
||||||
|
import com.fjy.spring.repository.VLogRepository;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class LogService {
|
public class LogService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private TbLogRepository tbLogRepository;
|
private TbLogRepository tbLogRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VLogRepository vLogRepository;
|
||||||
|
|
||||||
public void addLogRec(TbLog tbLog){
|
public void addLogRec(TbLog tbLog){
|
||||||
tbLogRepository.save(tbLog);
|
tbLogRepository.save(tbLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<VLog> findvlog(){
|
||||||
|
return vLogRepository.findAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,45 +7,70 @@ var Main = {
|
|||||||
},
|
},
|
||||||
feedbackData:[
|
feedbackData:[
|
||||||
{
|
{
|
||||||
content:'bug',
|
id: 68,
|
||||||
time:'2018-2-3',
|
username: "root",
|
||||||
username:'root'
|
content: "Fred",
|
||||||
|
time: "2018-02-08 10:14:11"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 71,
|
||||||
|
username: "root",
|
||||||
|
content: "1234214",
|
||||||
|
time: "2018-02-08 10:30:38"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 72,
|
||||||
|
username: "root",
|
||||||
|
content: "afsdas",
|
||||||
|
time: "2018-02-08 10:31:22"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 73,
|
||||||
|
username: "root",
|
||||||
|
content: "反馈",
|
||||||
|
time: "2018-02-08 10:35:18"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
logData:[
|
logData:[
|
||||||
{
|
{
|
||||||
ip:'127.0.0.1',
|
logid: 55,
|
||||||
header:'bug',
|
colname: "root",
|
||||||
time:'2018-2-3',
|
coltime: "2018-02-06 11:35:56.0",
|
||||||
username:'root'
|
colip: "0:0:0:0:0:0:0:1",
|
||||||
|
colheader: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ip:'127.0.0.1',
|
logid: 58,
|
||||||
header:'bug',
|
colname: "root",
|
||||||
time:'2018-2-3',
|
coltime: "2018-02-06 11:40:41.0",
|
||||||
username:'root'
|
colip: "0:0:0:0:0:0:0:1",
|
||||||
},
|
colheader: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
|
||||||
{
|
|
||||||
ip:'127.0.0.1',
|
|
||||||
header:'bug',
|
|
||||||
time:'2018-2-3',
|
|
||||||
username:'root'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ip:'127.0.0.1',
|
|
||||||
header:'bug',
|
|
||||||
time:'2018-2-3',
|
|
||||||
username:'root'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ip:'127.0.0.1',
|
|
||||||
header:'bug',
|
|
||||||
time:'2018-2-3',
|
|
||||||
username:'root'
|
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
var that = this;
|
||||||
|
axios.get('http://localhost:8080/cms/home/findvlog')
|
||||||
|
.then(function (response) {
|
||||||
|
console.log(response.data);
|
||||||
|
that.logData = response.data;
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
axios.get('http://localhost:8080/cms/home/findvfeedback')
|
||||||
|
.then(function (response) {
|
||||||
|
console.log(response.data);
|
||||||
|
that.feedbackData = response.data;
|
||||||
|
//that.limitTime = response.data;
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
ClickToJump(targe){
|
ClickToJump(targe){
|
||||||
window.location.href="http://localhost:8080/cms/" + targe;
|
window.location.href="http://localhost:8080/cms/" + targe;
|
||||||
|
|||||||
125
src/main/resources/static/js/user.js
Normal file
125
src/main/resources/static/js/user.js
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
var Main = {
|
||||||
|
data() {
|
||||||
|
var checkName = (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
return callback(new Error('用户名不能为空'));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var checkNo = (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
return callback(new Error('学号不能为空'));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var checkRealName = (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
return callback(new Error('真实姓名不能为空'));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var validatePass = (rule, value, callback) => {
|
||||||
|
if (value === '') {
|
||||||
|
callback(new Error('请输入密码'));
|
||||||
|
} else {
|
||||||
|
if (this.ruleForm2.checkPass !== '') {
|
||||||
|
this.$refs.ruleForm2.validateField('checkPass');
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var validatePass2 = (rule, value, callback) => {
|
||||||
|
if (value === '') {
|
||||||
|
callback(new Error('请再次输入密码'));
|
||||||
|
} else if (value !== this.ruleForm2.colpassword) {
|
||||||
|
callback(new Error('两次输入密码不一致!'));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
activeIndex: '1',
|
||||||
|
ruleForm2: {
|
||||||
|
colname: '',
|
||||||
|
colpassword: '',
|
||||||
|
checkPass:'',
|
||||||
|
colstudentno: '',
|
||||||
|
colrealname: '',
|
||||||
|
colemail: ''
|
||||||
|
},
|
||||||
|
rules2: {
|
||||||
|
colpassword: [
|
||||||
|
{required: true,validator: validatePass, trigger: 'blur'}
|
||||||
|
],
|
||||||
|
checkPass: [
|
||||||
|
{required: true,validator: validatePass2, trigger: 'blur'}
|
||||||
|
],
|
||||||
|
colstudentno: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
validator: checkNo,
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
colrealname: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
validator: checkRealName,
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
colname: [
|
||||||
|
{required: true,validator: checkName, trigger: 'blur'}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
tableHomeworkData: [
|
||||||
|
{
|
||||||
|
workid: 1,
|
||||||
|
colfileid: 56,
|
||||||
|
workname: "实验报告",
|
||||||
|
worktime: "2018-02-06 20:44:08.0",
|
||||||
|
colfilename: "2018 服务器装机.xlsx",
|
||||||
|
coursename: "信息安全",
|
||||||
|
workremark: "3000字以上",
|
||||||
|
workfolder: "第一次作业"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
workid: 1,
|
||||||
|
colfileid: 56,
|
||||||
|
workname: "实验报告2",
|
||||||
|
worktime: "2018-02-08 20:44:08.0",
|
||||||
|
colfilename: "2018 服务器装机.xlsx",
|
||||||
|
coursename: "决策支持系统",
|
||||||
|
workremark: "3000字以上",
|
||||||
|
workfolder: "第一次作业"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
submitForm(formName) {
|
||||||
|
this.$refs[formName].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
alert('submit!');
|
||||||
|
} else {
|
||||||
|
console.log('error submit!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
resetForm(formName) {
|
||||||
|
this.$refs[formName].resetFields();
|
||||||
|
},
|
||||||
|
handleClick(tab, event) {
|
||||||
|
console.log(tab, event);
|
||||||
|
},
|
||||||
|
ClickToJump(targe){
|
||||||
|
window.location.href="http://localhost:8080/cms/" + targe;
|
||||||
|
},
|
||||||
|
handleSelect(key, keyPath) {
|
||||||
|
console.log(key, keyPath);
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
console.log('submit!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var Ctor = Vue.extend(Main)
|
||||||
|
new Ctor().$mount('#app')
|
||||||
@@ -1,57 +1,19 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
|
||||||
<html>
|
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||||
<head>
|
xmlns:th="http://www.thymeleaf.org">
|
||||||
<meta charset="UTF-8">
|
<head th:include="dist/thymeleaf/common_head :: header('管理员主页')">
|
||||||
<title>后台</title>
|
|
||||||
<!--
|
|
||||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
|
||||||
-->
|
|
||||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
|
||||||
<!--<link rel="stylesheet" href="https://unpkg.com/element-ui@2.1.0/lib/theme-chalk/display.css">-->
|
|
||||||
<link rel="stylesheet" href="../../static/css/style.css">
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<!-- 先引入 Vue -->
|
<div th:insert="~{dist/thymeleaf/common_head :: #body_js}"></div>
|
||||||
<script src="https://unpkg.com/vue/dist/vue.js"></script>
|
|
||||||
<!-- 引入组件库 -->
|
|
||||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
|
||||||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header th:include="dist/thymeleaf/layout :: header"></el-header>
|
||||||
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
|
|
||||||
<el-menu-item index="1">首页</el-menu-item>
|
|
||||||
<el-submenu index="2">
|
|
||||||
<template slot="title">个人中心</template>
|
|
||||||
<el-menu-item index="2-1">选项1</el-menu-item>
|
|
||||||
<el-menu-item index="2-2">选项2</el-menu-item>
|
|
||||||
<el-menu-item index="2-3">选项3</el-menu-item>
|
|
||||||
</el-submenu>
|
|
||||||
<el-menu-item index="3" @click="ClickToJump('about')">关于</el-menu-item>
|
|
||||||
<el-menu-item index="4" @click="ClickToJump('feedback')">意见反馈</el-menu-item>
|
|
||||||
<el-menu-item index="5"><a href="login.jsp">登出</a></el-menu-item>
|
|
||||||
</el-menu>
|
|
||||||
</el-header>
|
|
||||||
<el-main>
|
<el-main>
|
||||||
<el-col :md="4" :lg="4" :xl="4" class="hidden-sm-and-down">
|
<el-col :md="4" :lg="4" :xl="4" class="hidden-sm-and-down">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-card class="box-card">
|
<el-card th:include="dist/thymeleaf/layout :: userbox"></el-card>
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<span>用户名</span><br>
|
|
||||||
<span>学号</span>
|
|
||||||
</div>
|
|
||||||
<div class="item">
|
|
||||||
<el-button type="text" @click="ClickToJump('home')">首页</el-button>
|
|
||||||
<br>
|
|
||||||
<el-button type="text" @click="ClickToJump('user')">个人中心</el-button>
|
|
||||||
<br>
|
|
||||||
<el-button type="text" @click="ClickToJump('about')">关于</el-button>
|
|
||||||
<br>
|
|
||||||
<el-button type="text" @click="ClickToJump('feedback')">意见反馈</el-button>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
@@ -87,13 +49,13 @@
|
|||||||
<span>近期登陆日志</span><br>
|
<span>近期登陆日志</span><br>
|
||||||
<template>
|
<template>
|
||||||
<el-table :data="logData" height="300" :default-sort="{prop: 'time', order: 'descending'}">
|
<el-table :data="logData" height="300" :default-sort="{prop: 'time', order: 'descending'}">
|
||||||
<el-table-column prop="username" label="用户名" sortable>
|
<el-table-column prop="colname" label="用户名" sortable>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="header" label="请求头" sortable>
|
<el-table-column prop="coltime" label="时间" sortable>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="time" label="时间" sortable>
|
<el-table-column prop="colip" label="ip地址" sortable>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="ip" label="ip地址" sortable>
|
<el-table-column prop="colheader" label="请求头" sortable>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</template>
|
</template>
|
||||||
@@ -108,7 +70,7 @@
|
|||||||
<span>用户反馈</span>
|
<span>用户反馈</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text item">
|
<div class="text item">
|
||||||
<el-table :data="feedbackData" style="width: 100%"
|
<el-table :data="feedbackData" style="width: 100%" height="300"
|
||||||
:default-sort="{prop: 'time', order: 'descending'}">
|
:default-sort="{prop: 'time', order: 'descending'}">
|
||||||
<el-table-column prop="content" label="内容" sortable>
|
<el-table-column prop="content" label="内容" sortable>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -124,15 +86,11 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-main>
|
</el-main>
|
||||||
<el-footer>
|
<el-footer th:include="dist/thymeleaf/layout :: footer"></el-footer>
|
||||||
<div class="footer">
|
|
||||||
© 2018 作业提交系统
|
|
||||||
</div>
|
|
||||||
</el-footer>
|
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-container>
|
</el-container>
|
||||||
</div>
|
</div>
|
||||||
<script src="../../static/js/admin.js"></script>
|
<script th:src="@{js/admin.js}"></script>
|
||||||
<script src="../../static/js/msg.js"></script>
|
<script th:src="@{js/msg.js}"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -263,7 +263,6 @@
|
|||||||
<span style="color: red"> 功能未完成</span>
|
<span style="color: red"> 功能未完成</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text item">
|
<div class="text item">
|
||||||
|
|
||||||
<el-table :data="tableHomeworkData" style="width: 100%"
|
<el-table :data="tableHomeworkData" style="width: 100%"
|
||||||
:default-sort="{prop: 'coursename', order: 'descending'}">
|
:default-sort="{prop: 'coursename', order: 'descending'}">
|
||||||
<el-table-column prop="coursename" label="科目" sortable width="180">
|
<el-table-column prop="coursename" label="科目" sortable width="180">
|
||||||
@@ -274,16 +273,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!--<span>{{ limitTime[0].coursename }}{{ limitTime[0].workname }}</span><br>
|
|
||||||
距离提交日期还有<span> {{ limitTime[0].time }}</span>天-->
|
|
||||||
</div>
|
</div>
|
||||||
<!--<template>
|
</el-card>
|
||||||
<el-table :data="tableData2" style="width: 100%">
|
|
||||||
<el-table-column prop="date" label="作业提交倒计时">
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</template>-->
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -309,10 +300,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-main>
|
</el-main>
|
||||||
<el-footer>
|
<el-footer th:include="dist/thymeleaf/layout :: footer"></el-footer>
|
||||||
<div class="footer">
|
|
||||||
© 2018 作业提交系统
|
|
||||||
</div></el-footer>
|
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-container>
|
</el-container>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
154
src/main/resources/templates/home/user.html
Normal file
154
src/main/resources/templates/home/user.html
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>个人中心</title>
|
||||||
|
<!--
|
||||||
|
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||||
|
-->
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||||
|
<!--<link rel="stylesheet" href="https://unpkg.com/element-ui@2.1.0/lib/theme-chalk/display.css">-->
|
||||||
|
<link rel="stylesheet" href="../../static/css/style.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<!-- 先引入 Vue -->
|
||||||
|
<script src="https://unpkg.com/vue/dist/vue.js"></script>
|
||||||
|
<!-- 引入组件库 -->
|
||||||
|
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||||
|
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
||||||
|
<div id="app">
|
||||||
|
<el-container>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
|
||||||
|
<el-menu-item index="1">首页</el-menu-item>
|
||||||
|
<el-submenu index="2">
|
||||||
|
<template slot="title">个人中心</template>
|
||||||
|
<el-menu-item index="2-1">选项1</el-menu-item>
|
||||||
|
<el-menu-item index="2-2">选项2</el-menu-item>
|
||||||
|
<el-menu-item index="2-3">选项3</el-menu-item>
|
||||||
|
</el-submenu>
|
||||||
|
<el-menu-item index="3" @click="ClickToJump('about')">关于</el-menu-item>
|
||||||
|
<el-menu-item index="4" @click="ClickToJump('feedback')">意见反馈</el-menu-item>
|
||||||
|
<el-menu-item index="5"><a href="login.jsp">登出</a></el-menu-item>
|
||||||
|
</el-menu>
|
||||||
|
</el-header>
|
||||||
|
<el-main>
|
||||||
|
<el-col :md="4" :lg="4" :xl="4" class="hidden-sm-and-down">
|
||||||
|
<el-row>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>用户名</span><br>
|
||||||
|
<span>学号</span>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<el-button type="text" @click="ClickToJump('home')">首页</el-button>
|
||||||
|
<br>
|
||||||
|
<el-button type="text" @click="ClickToJump('user')">个人中心</el-button>
|
||||||
|
<br>
|
||||||
|
<el-button type="text" @click="ClickToJump('about')">关于</el-button>
|
||||||
|
<br>
|
||||||
|
<el-button type="text" @click="ClickToJump('feedback')">意见反馈</el-button>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="13" :lg="13" :xl="13" :sm="18" :xs="23" :offset="1">
|
||||||
|
<el-row>
|
||||||
|
<h4>修改信息</h4>
|
||||||
|
<el-form
|
||||||
|
:model="ruleForm2" status-icon :rules="rules2" ref="ruleForm2"
|
||||||
|
label-width="100px" class="demo-ruleForm"
|
||||||
|
action="/cms/register/doregister"
|
||||||
|
method="POST" name="register">
|
||||||
|
<el-form-item label="用户名"
|
||||||
|
prop="colname">
|
||||||
|
<el-input
|
||||||
|
v-model="ruleForm2.colname" name="colname"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="密码" prop="colpassword">
|
||||||
|
<el-input type="password"
|
||||||
|
v-model="ruleForm2.colpassword" auto-complete="off" name="colpassword"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="确认密码" prop="checkPass">
|
||||||
|
<el-input
|
||||||
|
type="password" v-model="ruleForm2.checkPass"
|
||||||
|
auto-complete="off" name="checkPass"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="colemail" label="邮箱"
|
||||||
|
:rules="[
|
||||||
|
{ required: true, message: '请输入邮箱地址', trigger: 'blur' },
|
||||||
|
{ type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur,change' }
|
||||||
|
]">
|
||||||
|
<el-input v-model="ruleForm2.colemail" name="colemail"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="学号"
|
||||||
|
prop="colstudentno">
|
||||||
|
<el-input
|
||||||
|
v-model="ruleForm2.colstudentno" name="colstudentno"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="真实姓名"
|
||||||
|
prop="colrealname">
|
||||||
|
<el-input
|
||||||
|
v-model="ruleForm2.colrealname" name="colrealname"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary"
|
||||||
|
native-type="submit">提交
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="resetForm('ruleForm2')">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="5" :lg="5" :sm="5" :xl="5" class="hidden-xs-only" :offset="1">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="grid-content">
|
||||||
|
<el-card class="box-card hidden-xs-only">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>作业提交倒计时</span>
|
||||||
|
<span style="color: red"> 功能未完成</span>
|
||||||
|
</div>
|
||||||
|
<div class="text item">
|
||||||
|
<el-table :data="tableHomeworkData" style="width: 100%"
|
||||||
|
:default-sort="{prop: 'coursename', order: 'descending'}">
|
||||||
|
<el-table-column prop="coursename" label="科目" sortable width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="倒计时" sortable>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{limitTime(scope.row)}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-card class="box-card hidden-xs-only">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>公告</span>
|
||||||
|
</div>
|
||||||
|
<div v-for="o in 4" :key="o" class="text item">
|
||||||
|
{{'公告内容 ' + o }}
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-main>
|
||||||
|
<el-footer>
|
||||||
|
<div class="footer">
|
||||||
|
© 2018 作业提交系统
|
||||||
|
</div>
|
||||||
|
</el-footer>
|
||||||
|
</el-container>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
<script src="../../static/js/user.js"></script>
|
||||||
|
<script src="../../static/js/msg.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user