删除旧版本

master
王元梓 2 years ago
parent bfc6dce051
commit 9136ea64c4

@ -1,225 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!-- 页面meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
<!-- 引入样式 -->
<link rel="stylesheet" href="../plugins/elementui/index.css">
<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="../css/style.css">
</head>
<body class="hold-transition">
<div id="app">
<div class="content-header">
<h1>用户模块<small>评测成绩</small></h1>
<el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>用户模块</el-breadcrumb-item>
<el-breadcrumb-item>评测成绩</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="app-container">
<div class="box">
<div class="filter-container">
</div>
<el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row>
<el-table-column type="index" align="center" label="序号"></el-table-column>
<el-table-column prop="biaoshi" label="标识" align="center"></el-table-column>
<el-table-column prop="fen" label="分数" align="center"></el-table-column>
<el-table-column prop="guo" label="结果" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">详情</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script>
var vue = new Vue({
el: '#app',
data:{
pagination: {//分页相关模型数据
currentPage: 1,//当前页码
pageSize:10,//每页显示的记录数
total:0,//总记录数
queryString:""//查询条件
},
dataList: [],//当前页要展示的分页列表数据
formData: {},//表单数据
dialogFormVisible: false,//增加表单是否可见
dialogFormVisible4Edit:false,//编辑表单是否可见
rules: {//校验规则
username: [{ required: true, message: '用户名为必填项', trigger: 'blur' }],
password: [{ required: true, message: '密码为必填项', trigger: 'blur' }],
type:[{ required: true, message: '角色为必选项', trigger: 'blur' }],
idCard:[{ required: true, message: '身份证号必填项', trigger: 'blur' }]
},
options: [{
value: 1,
label: '用户'
},
{
value: 0,
label: '管理员'
}]
},
//钩子函数VUE对象初始化完成后自动执行
created(){
this.findPage();
},
methods:{
//编辑
handleEdit() {
//表单校验
this.$refs['dataEditForm'].validate((valid)=>{
if(valid){
//表单校验通过,发送请求
axios.put("/user/Update",this.formData).then((response)=> {
this.dialogFormVisible4Edit = false;
this.$message({
message: "修改成功",
type: 'success'
});
}).finally(()=> {
//重新发送请求查询分页数据
this.findPage();
});
}else{
//表单校验失败
this.$message.error("表单数据校验失败");
return false;
}
});
},
//添加
handleAdd () {
//校验表单输入项是否合法
this.$refs['dataAddForm'].validate((valid) => {
if (valid) {
this.formData.status="拉黑";
//表单数据校验通过发送ajax请求将表单数据提交到后台
axios.post("/user/Save",this.formData).then((response)=> {
//隐藏新增窗口
this.dialogFormVisible = false;
this.$message({
message: "添加成功",
type: 'success'
});
}).finally(()=> {
this.findPage();
});
} else {
this.$message.error("表单数据校验失败");
return false;
}
});
},
// 重置表单
resetForm() {
this.formData = {};
},
// 弹出添加窗口
handleCreate() {
this.resetForm();
this.dialogFormVisible = true;
},
// 弹出编辑窗口
handleUpdate(row) {
localStorage.setItem("biaoshi",row.biaoshi);
window.parent.document.getElementById("f").src="allDetails.html";
},
//切换页码
handleCurrentChange(currentPage) {
//currentPage为切换后的页码
this.pagination.currentPage = currentPage;
this.findPage();
},
//切换每页显示条数
handleSizeChange(pageSize){
this.pagination.pageSize =pageSize;
this.findPage();
},
// 删除
handleDelete(row) {
//alert(row.id);
this.$confirm("确认删除吗?","提示",{type:'warning'}).then(()=>{
//点击确定按钮时只需此处代码
//alert('用户点击的是确定按钮');
axios.delete("/user/Delete/" + row.id).then((res)=> {
this.$message({
message: "删除成功",
type: 'success'
});
//调用分页,获取最新分页数据
this.findPage();
});
});
},
//分页查询
findPage() {
let userId=localStorage.getItem("userId");
//请求后台
axios.get("/ut/selectAll/"+userId).then((response)=> {
this.dataList = response.data;
});
},
c(row)
{
axios.get("/user/findById/" + row.id).then((res)=>{
this.formData=res.data;
if(this.formData.status=="拉黑")
{
this.formData.status="已拉黑"
}
else
{
this.formData.status="拉黑"
}
axios.put("/user/Update",this.formData).then((response)=> {
}).finally(()=> {
//重新发送请求查询分页数据
this.findPage();
});
});
}
}
})
</script>
</html>

@ -1,216 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!-- 页面meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>心理测评系统</title>
<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
<!-- 引入样式 -->
<link rel="stylesheet" href="../plugins/elementui/index.css">
<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="../css/style.css">
</head>
<body class="hold-transition">
<div id="app">
<div class="content-header">
<h1>用户模块<small>测试</small></h1>
<el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>用户模块</el-breadcrumb-item>
<el-breadcrumb-item>测试</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="app-container">
<div class="box">
<div style="width: 80%;margin: 0 auto">
<div v-for="item in dataList">
<h3><span>{{item.xuhao}}:</span>{{item.them}}<span style="margin-left: 10px">分数:{{item.fen}}分</span></h3>
<el-radio-group v-model="item.da">
<el-radio :label="item.one">A:{{item.one}}</el-radio>
<el-radio :label="item.two">B:{{item.two}}</el-radio>
<el-radio :label="item.three">C:{{item.three}}</el-radio>
<el-radio :label="item.four">D:{{item.four}}</el-radio>
</el-radio-group>
<hr>
</div>
<el-button type="primary" @click="handleAdd()">提交</el-button>
</div>
</div>
</div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script>
var vue = new Vue({
el: '#app',
data:{
pagination: {//分页相关模型数据
currentPage: 1,//当前页码
pageSize:10,//每页显示的记录数
total:0,//总记录数
queryString:""//查询条件
},
dataList: [],//当前页要展示的分页列表数据
formData: {},//表单数据
dialogFormVisible: false,//增加表单是否可见
dialogFormVisible4Edit:false,//编辑表单是否可见
rules: {//校验规则
xuhao: [{ required: true, message: '题号为必填项', trigger: 'blur' }],
them: [{ required: true, message: '题目为必填项', trigger: 'blur' }],
one:[{ required: true, message: '选项A为必填项', trigger: 'blur' }],
two:[{ required: true, message: '选项B为必填项', trigger: 'blur' }],
three:[{ required: true, message: '选项C为必填项', trigger: 'blur' }],
four:[{ required: true, message: '选项D为必填项', trigger: 'blur' }],
ok:[{ required: true, message: '正确答案为必填项', trigger: 'blur' }],
},
options: [{
value: 1,
label: '用户'
},
{
value: 0,
label: '管理员'
}]
},
//钩子函数VUE对象初始化完成后自动执行
created(){
this.findPage();
},
methods:{
//编辑
handleEdit() {
//表单校验
this.$refs['dataEditForm'].validate((valid)=>{
if(valid){
//表单校验通过,发送请求
axios.put("/timu/Update",this.formData).then((response)=> {
this.dialogFormVisible4Edit = false;
this.$message({
message: "修改成功",
type: 'success'
});
}).finally(()=> {
//重新发送请求查询分页数据
this.findPage();
});
}else{
//表单校验失败
this.$message.error("表单数据校验失败");
return false;
}
});
},
//添加
handleAdd () {
let ji=0;
let userId=localStorage.getItem("userId");
this.dataList.forEach(function (e) {
if(e.da==null)
{
ji++;
}
});
if(ji>0)
{
this.$message.error("还存在未填写的题目");
}
else
{
this.dataList.forEach(function (e) {
e.userId=userId;
})
//表单数据校验通过发送ajax请求将表单数据提交到后台
axios.post("/ut/Save",this.dataList).then((response)=> {
//隐藏新增窗口
this.dialogFormVisible = false;
this.$message({
message: "答题成功",
type: 'success'
});
}).finally(()=> {
this.dataList.forEach(function (e) {
e.da=null;
})
});
}
},
// 重置表单
resetForm() {
this.formData = {};
},
// 弹出添加窗口
handleCreate() {
this.resetForm();
this.dialogFormVisible = true;
},
// 弹出编辑窗口
handleUpdate(row) {
//发送请求获取检查项信息
axios.get("/timu/findById/" + row.id).then((res)=>{
//设置编辑窗口属性dialogFormVisible4Edit为true表示显示
this.dialogFormVisible4Edit = true;
//为模型数据设置值基于VUE双向数据绑定回显到页面
this.formData = res.data;
});
},
//切换页码
handleCurrentChange(currentPage) {
//currentPage为切换后的页码
this.pagination.currentPage = currentPage;
this.findPage();
},
//切换每页显示条数
handleSizeChange(pageSize){
this.pagination.pageSize =pageSize;
this.findPage();
},
// 删除
handleDelete(row) {
//alert(row.id);
this.$confirm("确认删除吗?","提示",{type:'warning'}).then(()=>{
//点击确定按钮时只需此处代码
//alert('用户点击的是确定按钮');
axios.delete("/timu/Delete/" + row.id).then((res)=> {
this.$message({
message: "删除成功",
type: 'success'
});
//调用分页,获取最新分页数据
this.findPage();
});
});
},
//分页查询
findPage() {
axios.get("/timu/selectAll").then((response)=> {
this.dataList = response.data;
});
},
}
})
</script>
</html>

@ -1,15 +0,0 @@
package com.service;
import com.domain.fenduan;
import com.untils.PageResult;
import java.util.List;
public interface fenduanService {
public int insert(fenduan fenduan);
public int delete(int id);
public int edit(fenduan fenduan);
public fenduan findById(int id);
public List<fenduan> selectAll();
}

@ -1,582 +0,0 @@
html,body {
/* overflow-y: scroll; */
margin: 0;
}
a {
color: #3c8dbc;
text-decoration:none;
}
/* new style */
.skin-purple .main-sidebar {
background: #fff;
}
.skin-purple .main-header .logo:hover {
background: #0abdfe;
}
.skin-purple .main-header .navbar .sidebar-toggle:hover {
/* background: #0abdfe; */
}
.skin-purple .main-header {
min-height: 70px;
padding: 0;
}
.skin-purple .main-header .logo {
height: 50px;
/* background: #0abdfe; */
float: left;
padding: 20px 0 0 15px;
/* width: 230px; */
}
.skin-purple .main-header .navbar {
height: 70px;
background: linear-gradient(to right, #0abdfe, #67f0e0);
/* margin-left: 230px; */
}
.winfo{margin-left: 230px;}
.skin-purple .main-header .sidebar-toggle {
display: inline-block;
padding: 24px 15px;
color: #fff;
}
.skin-purple .main-sidebar {
padding-top: 75px;
}
.sidebar-menu > li {
line-height: 1.8
}
.skin-purple .sidebar-menu > li > a {
font-size: 16px;
color: #666
}
.skin-purple .sidebar-menu>li:hover>a,
.skin-purple .sidebar-menu>li.active>a {
background: transparent;
color: #666;
border-left-color: transparent
}
.skin-purple .treeview-menu>li>a:hover {
color: #fff
}
.skin-purple .sidebar-menu>li>.treeview-menu {
background: #fff;
}
.sidebar-menu .treeview-menu > li > a {
font-size: 16px;
padding-left: 35px;
color: #999
}
.sidebar-menu .treeview-menu > li:hover {
background: #0abdfe;
}
@media (min-width: 768px) {
.skin-purple .navbar-nav>li>a
{
padding-top: 25px;
padding-bottom: 25px;
}
}
.modal-body .nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover {
color: #0abdfe
}
.modal-body .nav-tabs>li>a {
color: #555
}
.bg-olive {
background-color: #0abdfe !important;
}
.dataTable .btn[class*='bg-']:hover {
box-shadow: none
}
.btn-primary {
background: #0abdfe;
border-color: #0abdfe;
}
.box-body .nav>li>a {
color: #666
}
.box-body .nav>li.active>a {
color: #0abdfe;
}
/* tab 1*/
.double {
line-height: 58px;
}
.title .glyphicon{
padding: 3px;
font-size: 13px;
border-radius: 8px;
color: #fff;
}
.data span.arrowup {
color: #d88918;
}
.data span.arrowdown {
color: #6bb10a;
}
.item-blue .glyphicon{
background-color: #39a9ea;
}
.item-green {
line-height: 58px;
}
.item-green .glyphicon{
background-color: #6bb10a;
line-height: 12px;
}
.item-orange .glyphicon{
background-color:#d88918;
}
.item-red .glyphicon{
background-color: #f14f4f;
}
.chart .chart-box {
margin: 10px;
}
/* 数据表格label */
.content-wrapper .data-type {
/*width: 90%;*/
margin: 10px 5px;
border:1px solid #d4d4d4;
border-radius: 2px;
}
.data-type .title,
.data-type .data {
padding: 3px 12px;
border-top: 1px solid #d4d4d4;
overflow: hidden;
height: 42px;
}
.data-type .title {
line-height: 34px;
border-right: 1px solid #d4d4d4;
}
.data-type .data:last-child{
border-right: 0;
}
.data-type .title{
text-align: center;
background: #ececec;
}
.data-type .data .line{
vertical-align: middle;
overflow: hidden;
padding-bottom: 10px;
padding-top: 10px;
}
/* label行高度 */
.data-type .data > label {
line-height:36px;
}
.data-type .data > .form-group {
line-height:36px;
}
.data-type .data.text {
line-height:36px;
}
/* label行分隔符 */
.data-type .data.border-right {
border-right: 1px solid #d4d4d4;
}
/* 表格双倍高度 */
.data-type .title.rowHeight2x,
.data-type .data.rowHeight2x {
height:84px;
}
.data-type .title.rowHeight2x ,
.data-type .data.rowHeight2x.text {
line-height:78px;
}
/*.data-type .data.rowHeight2x > label {
line-height:78px;
}*/
.data-type .title.editer,
.data-type .data.editer {
height:320px;
}
.data-type .title.editer {
line-height:300px;
}
/*清除parding*/
.padding-clear {
padding-right: 0px;
padding-left: 0px;
}
/* 文件上传 */
/*a upload */
.a-upload {
padding: 4px 10px;
height: 35px;
line-height: 25px;
position: relative;
cursor: pointer;
color: #888;
background: #fafafa;
border: 1px solid #ddd;
border-radius: 4px;
overflow: hidden;
display: inline-block;
*display: inline;
*zoom: 1
}
.a-upload input {
position: absolute;
font-size: 100px;
right: 0;
top: 0;
opacity: 0;
filter: alpha(opacity=0);
cursor: pointer
}
.a-upload:hover {
color: #444;
background: #eee;
border-color: #ccc;
text-decoration: none
}
/* 医疗 */
.search-box {
display: inline-block
}
.input-sm {
height: 32px;
}
.btn-create {
margin-left: 10px;
background-color: #0abdfe;
border-color: #0abdfe;
color: #fff;
}
.btn-create:hover,
.btn-create:active,
.btn-create:focus
{
color: #fff;
}
.pagination {
margin: 0
}
.medical-modal {
position:absolute;
top:0%;
left:0%;
display:none;
background:rgba(0,0,0,0.3);
width:100%;
height:100%;
position:fixed;
z-index:9999
}
.medical-modal .content {
position: absolute;
left: 35%;
top: 25%;
border-radius: 8px;
width: 30%;
height: 40%;
background-color: #fff;
}
.pageitems, .jump {
margin-left: 15px;
display: inline-block;
}
.jumppage {
width: 30px;
text-align: center
}
@media (min-width: 768px) {
.subscribe .modal-dialog {
width: 900px;
margin: 30px auto;
}
}
.checklist {
margin-top: 10px;
}
.checklist .input-group {
margin-bottom: 10px;
}
.modal-page {
margin-top: 20px;
font-size: 12px;
}
.modal-page .form-control {
font-size: 12px;
padding: 0;
height: 26px;
}
.table-check {
margin: 0;
display: inline-block;
margin-right: 4px;
}
.daterange {
margin:10px 10px 0;
}
.daterange .input-group .form-control {
width: 20%;
}
.chart-title {
font-size: 16px;
font-weight: normal;
text-align: center;
}
.diaocha {
line-height: 2
}
.diaocha h5{
color: #f98d45;
background: #f5f7f9;
line-height: 2;
padding-left: 15px;
}
.diaocha div {
padding: 0 20px;
border-bottom: 1px solid #dce1e7;
}
.diaocha div h5 {
color: #555;
background: transparent;
padding-left: 0;
}
.diaocha label {
font-weight: normal;
}
.diaocha .form-group {
margin-left: 0;
margin-right: 0;
}
.diaocha .options label {
margin-right: 10px;
}
.tizhi button{
margin-right: 15px;
}
.innerform {
margin-top: 20px;
}
.fa-search {
cursor: pointer
}
.line {
margin-top: 10px;
}
input[type=radio]:focus {
outline: none
}
input[type="radio"]{
appearance: none;
-webkit-appearance: none;
outline: none;
display:none
}
label input[type="radio"] {
content: "\a0";
display: inline-block;
vertical-align: middle;
font-size: 16px;
width: 15px;
height: 15px;
margin-right: .4em;
border-radius: 50%;
border: 1px solid #c7c6c6;
line-height: 1;
margin-top: -1px;
}
label input[type="radio"]:checked {
border: 3px solid #0abdfe;
}
.right-menu {
float: right;
padding: 18px 30px 0 0;
color: #fff;
}
.el-dropdown{color: #fff;}
.avatar-wrapper img{width: 30px;height: 30px;border-radius: 15px;vertical-align: middle}
.el-popper[x-placement^=bottom]{margin-top: 30px;}
.el-dropdown-menu__item--divided{margin: 0;border:0 none;border-bottom: 1px solid #ebeef5}
.help{
padding: 0 10px;
}
.help .fa{ margin-right: 5px;}
.el-main{
background: #ecf0f5;
}
.el-menu{border: 0 none;}
.main{
height: 100vh;
min-width: 800px;
min-height: 600px;
overflow: hidden;
}
.main aside{
overflow: visible;
height: 100%;
}
.main aside.isClossTab{
width: 100%;
height: 60px;
cursor: pointer;
font-size: 25px;
text-align: center;
line-height: 60px;
font-weight: bold;
border-right: 1px solid #807c7c;
box-sizing: border-box;
}
.main aside .menu{
width: 100%;
border-right:0;
}
.el-menu .fa{
vertical-align: middle;
margin-right: 5px;
width: 24px;
text-align: center;
font-size: 18px;
}
.el-menu-item a{
color: #303133
}
.el-menu-item:hover,.el-menu-item.is-active {
color: #fff;
background: #0abdfe;
}
.el-menu-item:hover a,.el-menu-item.is-active a{
color: #fff;
}
.el-submenu__title:hover{background: none;}
.main-footer {
background: #fff;
padding: 15px 0;
color: #444;
}
/* title */
.content-header {
position: relative;
padding: 15px 15px 0 15px;
/* margin-top: 70px; */
}
.content-header > h1 {
margin: 0;
font-size: 24px;
font-weight: normal;
}
.content-header > h1 > small {
font-size: 15px;
display: inline-block;
padding-left: 4px;
font-weight: 300;
}
.content-header > .breadcrumb {
float: right;
background: transparent;
margin-top: 0;
margin-bottom: 0;
font-size: 12px;
padding: 7px 5px;
position: absolute;
top: 20px;
right: 10px;
border-radius: 2px;
}
/* */
.app-container{
background: #fff;
margin: 15px 30px 15px 15px;
}
.pagiantion{
text-align: right;
padding: 15px;
}
.box {
position: relative;
border-radius: 3px;
background: #ffffff;
border-top: 3px solid #3c8dbc;
padding: 10px;
margin-bottom: 20px;
width: 100%;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
.filter-container{
padding:10px 0 15px 0;
}
.main-container{margin-top: 70px;}
.filter-container .el-button,.filter-container .el-input__inner{
padding: 0 15px;
height: 34px;
line-height: 34px;
}
.el-aside{overflow: hidden;}
.el-submenu .el-menu-item a{
display: block;
height: 50px;
}
.el-menu--collapse .el-submenu__icon-arrow{ display: none}
/* .el-container{position: relative;} */
/* foot */
.el-footer{
position: absolute;
left: 180px;
right: 0px;
bottom: -80px;
}
.boxMain .el-upload--text{
position:static;
}
.boxMain >div{
display: inline-block;
}
.excelTitle{
text-align: center;
overflow: hidden;
line-height: 40px;
}
.excelTitle .el-button{
float: left;
}
.excelTime{
padding: 10px 0;
text-align: right;
}
.exceTable{
width: 100%;
border-right: 1px solid #e6e6e6;
border-bottom: 1px solid #e6e6e6;
font-size: 14px;
color: #333;
}
.exceTable tr,.exceTable td{
border-left: 1px solid #e6e6e6;
border-top: 1px solid #e6e6e6;
height: 40px;
line-height: 40px;
padding: 0 10px;
}
.exceTable .headBody{
text-align: center;
font-weight: 700;
font-size: 14px;
}
.tabletrBg{
background: #fcfcfc;
text-align: right;
}
.textCenter{
text-align: center
}
.checkScrol{
height: 277px;
overflow-y:scroll; ;
}

@ -1,15 +0,0 @@
package com.service;
import com.domain.timu;
import com.untils.PageResult;
import java.util.List;
public interface timuService {
public PageResult SelectPage(timu timu, int size, int current);
public int insert(timu timu);
public int delete(int id);
public int edit(timu timu);
public timu findById(int id);
public List<timu> selectAll();
}

@ -1,334 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!-- 页面meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>火车票销售系统</title>
<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
<!-- 引入样式 -->
<link rel="stylesheet" href="../plugins/elementui/index.css">
<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="../css/style.css">
</head>
<body class="hold-transition">
<div id="app">
<div class="content-header">
<h1>管理员模块<small>用户管理</small></h1>
<el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>管理员模块</el-breadcrumb-item>
<el-breadcrumb-item>用户管理</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="app-container">
<div class="box">
<div class="filter-container">
<el-input placeholder="用户名" v-model="pagination.queryString" style="width: 200px;" class="filter-item"></el-input>
<el-button @click="findPage()" class="dalfBut">查询</el-button>
<el-button type="primary" class="butT" @click="handleCreate()">新建</el-button>
</div>
<el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row>
<el-table-column type="index" align="center" label="序号"></el-table-column>
<el-table-column prop="username" label="用户名" align="center"></el-table-column>
<el-table-column prop="password" label="密码" align="center"></el-table-column>
<el-table-column label="角色" align="center">
<template slot-scope="scope">
<span>{{ scope.row.type == '0' ? '管理员' : '用户'}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
<el-button size="mini" type="danger" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination-container">
<el-pagination
class="pagiantion"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pagination.currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="pagination.pageSize"
layout="total, sizes,prev, pager, next, jumper"
:total="pagination.total">
</el-pagination>
</div>
<!-- 新增标签弹层 -->
<div class="add-form">
<el-dialog title="新增用户" :visible.sync="dialogFormVisible">
<el-form ref="dataAddForm" :model="formData" :rules="rules" label-position="right" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="用户名" prop="username">
<el-input v-model="formData.username"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="密码" prop="password">
<el-input v-model="formData.password"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="角色" prop="type">
<el-select v-model="formData.type" placeholder="请选择角色">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="handleAdd()">确定</el-button>
</div>
</el-dialog>
</div>
<!-- 编辑标签弹层 -->
<div class="add-form">
<el-dialog title="编辑用户" :visible.sync="dialogFormVisible4Edit">
<el-form ref="dataEditForm" :model="formData" :rules="rules" label-position="right" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="用户名" prop="username">
<el-input v-model="formData.username"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="密码" prop="password">
<el-input v-model="formData.password"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="角色" prop="type">
<el-select v-model="formData.type" placeholder="请选择角色">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible4Edit = false">取消</el-button>
<el-button type="primary" @click="handleEdit()">确定</el-button>
</div>
</el-dialog>
</div>
</div>
</div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script>
var vue = new Vue({
el: '#app',
data:{
pagination: {//分页相关模型数据
currentPage: 1,//当前页码
pageSize:10,//每页显示的记录数
total:0,//总记录数
queryString:""//查询条件
},
dataList: [],//当前页要展示的分页列表数据
formData: {},//表单数据
dialogFormVisible: false,//增加表单是否可见
dialogFormVisible4Edit:false,//编辑表单是否可见
rules: {//校验规则
username: [{ required: true, message: '用户名为必填项', trigger: 'blur' }],
password: [{ required: true, message: '密码为必填项', trigger: 'blur' }],
type:[{ required: true, message: '角色为必选项', trigger: 'blur' }],
idCard:[{ required: true, message: '身份证号必填项', trigger: 'blur' }]
},
options: [{
value: 1,
label: '用户'
},
{
value: 0,
label: '管理员'
}]
},
//钩子函数VUE对象初始化完成后自动执行
created(){
this.findPage();
},
methods:{
//编辑
handleEdit() {
//表单校验
this.$refs['dataEditForm'].validate((valid)=>{
if(valid){
//表单校验通过,发送请求
axios.put("/user/Update",this.formData).then((response)=> {
this.dialogFormVisible4Edit = false;
this.$message({
message: "修改成功",
type: 'success'
});
}).finally(()=> {
//重新发送请求查询分页数据
this.findPage();
});
}else{
//表单校验失败
this.$message.error("表单数据校验失败");
return false;
}
});
},
//添加
handleAdd () {
//校验表单输入项是否合法
this.$refs['dataAddForm'].validate((valid) => {
if (valid) {
this.formData.status="拉黑";
//表单数据校验通过发送ajax请求将表单数据提交到后台
axios.post("/user/Save",this.formData).then((response)=> {
//隐藏新增窗口
this.dialogFormVisible = false;
this.$message({
message: "添加成功",
type: 'success'
});
}).finally(()=> {
this.findPage();
});
} else {
this.$message.error("表单数据校验失败");
return false;
}
});
},
// 重置表单
resetForm() {
this.formData = {};
},
// 弹出添加窗口
handleCreate() {
this.resetForm();
this.dialogFormVisible = true;
},
// 弹出编辑窗口
handleUpdate(row) {
//发送请求获取检查项信息
axios.get("/user/findById/" + row.id).then((res)=>{
//设置编辑窗口属性dialogFormVisible4Edit为true表示显示
this.dialogFormVisible4Edit = true;
//为模型数据设置值基于VUE双向数据绑定回显到页面
this.formData = res.data;
});
},
//切换页码
handleCurrentChange(currentPage) {
//currentPage为切换后的页码
this.pagination.currentPage = currentPage;
this.findPage();
},
//切换每页显示条数
handleSizeChange(pageSize){
this.pagination.pageSize =pageSize;
this.findPage();
},
// 删除
handleDelete(row) {
//alert(row.id);
this.$confirm("确认删除吗?","提示",{type:'warning'}).then(()=>{
//点击确定按钮时只需此处代码
//alert('用户点击的是确定按钮');
axios.delete("/user/Delete/" + row.id).then((res)=> {
this.$message({
message: "删除成功",
type: 'success'
});
//调用分页,获取最新分页数据
this.findPage();
});
});
},
//分页查询
findPage() {
//分页参数
// var param = {
// // currentPage:this.pagination.currentPage,//页码
// // pageSize:this.pagination.pageSize,//每页显示的记录数
// username:this.pagination.queryString//查询条件
// };
param="?username="+this.pagination.queryString;//查询条件
//请求后台
axios.get("/user/SelectPage/"+this.pagination.pageSize+"/"+this.pagination.currentPage+param).then((response)=> {
this.dataList = response.data.rows;
this.dataList.forEach(function (e) {
e.h="拉黑";
})
this.pagination.total = response.data.total;
});
},
c(row)
{
axios.get("/user/findById/" + row.id).then((res)=>{
this.formData=res.data;
if(this.formData.status=="拉黑")
{
this.formData.status="已拉黑"
}
else
{
this.formData.status="拉黑"
}
axios.put("/user/Update",this.formData).then((response)=> {
}).finally(()=> {
//重新发送请求查询分页数据
this.findPage();
});
});
}
}
})
</script>
</html>

@ -1,18 +0,0 @@
package com.service;
import com.domain.user;
import com.untils.PageResult;
import java.util.List;
public interface userService {
public PageResult SelectPage(user user, int size, int current);
public PageResult SelectPageStudent(user user, int size, int current);
public int insert(user user);
public int delete(int id);
public int edit(user user);
public user findById(int id);
public user login(user user);
public user selectByUserName(String username);
public List<user> selectAllByStudent();
}

@ -1,22 +0,0 @@
package com.service;
import com.domain.all;
import com.domain.ut;
import com.untils.PageResult;
import java.util.List;
public interface utService {
public PageResult SelectPage(ut ut, int size, int current);
public int insert(ut ut);
public int delete(int id);
public int edit(ut ut);
public ut findById(int id);
public List<all> selectAll(int userId);
public List<all> selectAll1();
public List<ut> selectDetails(String biaoshi);
}

@ -1,150 +0,0 @@
package com.service.Imple;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dao.UserDao;
import com.domain.all;
import com.domain.fenduan;
import com.domain.ut;
import com.domain.ut;
import com.service.utService;
import com.untils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@Service
public class utServiceImple implements utService {
@Autowired
private com.dao.utDao utDao;
@Autowired
private com.dao.fenduanDao fenduanDao;
@Autowired
private UserDao userDao;
@Override
public PageResult SelectPage(ut ut, int size, int current) {
try
{
IPage page=new Page(current,size);
QueryWrapper<ut> queryWrapper = new QueryWrapper<ut>();
queryWrapper.like("them",ut.getThem());
queryWrapper.orderByAsc("xuhao");
page=utDao.selectPage(page, queryWrapper);
while(true)
{
if(page.getRecords().size()==0&&current>=1)
{
page=new Page(current--,size);
page=utDao.selectPage(page, queryWrapper);
}
else
{
break;
}
}
return new PageResult(page.getTotal(),page.getRecords());
}
catch (Exception e)
{
return null;
}
}
@Override
public int insert(ut ut) {
int i=55;
if((!ut.getDa().equals(ut.getOk())))
{
ut.setFen(0);
}
return utDao.insert(ut);
}
@Override
public int delete(int id) {
return utDao.deleteById(id);
}
@Override
public int edit(ut ut) {
return utDao.updateById(ut);
}
@Override
public ut findById(int id) {
return utDao.selectById(id);
}
@Override
public List<all> selectAll(int userId) {
QueryWrapper<ut> queryWrapper = new QueryWrapper<ut>();
queryWrapper.eq("userId",userId);
queryWrapper.select("sum(fen) as fen,biaoshi");
queryWrapper.groupBy("biaoshi");
List<Map<String, Object>> list=utDao.selectMaps(queryWrapper);
List<all> list1=new ArrayList<>();
for (Map item:list)
{
all a=new all(userId,item.get("biaoshi").toString(),Double.parseDouble(item.get("fen").toString()));
double fen=Double.parseDouble(item.get("fen").toString());
QueryWrapper<fenduan> queryWrapper1 = new QueryWrapper<fenduan>();
queryWrapper1.ge("end",fen).le("start",fen);
fenduan f=fenduanDao.selectOne(queryWrapper1);
a.setGuo(f.getGuo());
list1.add(a);
}
return list1;
}
@Override
public List<ut> selectDetails(String biaoshi) {
QueryWrapper<ut> queryWrapper = new QueryWrapper<ut>();
queryWrapper.eq("biaoshi",biaoshi);
return utDao.selectList(queryWrapper);
}
@Override
public List<all> selectAll1() {
QueryWrapper<ut> queryWrapper = new QueryWrapper<ut>();
queryWrapper.select("sum(fen) as fen,userId,biaoshi");
queryWrapper.groupBy("userId").groupBy("biaoshi");
List<Map<String, Object>> list=utDao.selectMaps(queryWrapper);
List<all> list1=new ArrayList<>();
for (Map item:list)
{
all a=new all(Integer.parseInt(item.get("userId").toString()),item.get("biaoshi").toString(),Double.parseDouble(item.get("fen").toString()));
double fen=Double.parseDouble(item.get("fen").toString());
QueryWrapper<fenduan> queryWrapper1 = new QueryWrapper<fenduan>();
queryWrapper1.ge("end",fen).le("start",fen);
fenduan f=fenduanDao.selectOne(queryWrapper1);
a.setGuo(f.getGuo());
String username= userDao.selectById(item.get("userId").toString()).getUsername();
a.setUsername(username);
list1.add(a);
}
return list1;
}
}

@ -1,226 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!-- 页面meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
<!-- 引入样式 -->
<link rel="stylesheet" href="../plugins/elementui/index.css">
<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="../css/style.css">
</head>
<body class="hold-transition">
<div id="app">
<div class="content-header">
<h1>管理员模块<small>评测成绩</small></h1>
<el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>管理员模块</el-breadcrumb-item>
<el-breadcrumb-item>评测成绩</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="app-container">
<div class="box">
<div class="filter-container">
</div>
<el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row>
<el-table-column type="index" align="center" label="序号"></el-table-column>
<el-table-column prop="userId" label="userId" align="center"></el-table-column>
<el-table-column prop="username" label="用户名" align="center"></el-table-column>
<el-table-column prop="biaoshi" label="标识" align="center"></el-table-column>
<el-table-column prop="fen" label="分数" align="center"></el-table-column>
<el-table-column prop="guo" label="结果" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">详情</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script>
var vue = new Vue({
el: '#app',
data:{
pagination: {//分页相关模型数据
currentPage: 1,//当前页码
pageSize:10,//每页显示的记录数
total:0,//总记录数
queryString:""//查询条件
},
dataList: [],//当前页要展示的分页列表数据
formData: {},//表单数据
dialogFormVisible: false,//增加表单是否可见
dialogFormVisible4Edit:false,//编辑表单是否可见
rules: {//校验规则
username: [{ required: true, message: '用户名为必填项', trigger: 'blur' }],
password: [{ required: true, message: '密码为必填项', trigger: 'blur' }],
type:[{ required: true, message: '角色为必选项', trigger: 'blur' }],
idCard:[{ required: true, message: '身份证号必填项', trigger: 'blur' }]
},
options: [{
value: 1,
label: '用户'
},
{
value: 0,
label: '管理员'
}]
},
//钩子函数VUE对象初始化完成后自动执行
created(){
this.findPage();
},
methods:{
//编辑
handleEdit() {
//表单校验
this.$refs['dataEditForm'].validate((valid)=>{
if(valid){
//表单校验通过,发送请求
axios.put("/user/Update",this.formData).then((response)=> {
this.dialogFormVisible4Edit = false;
this.$message({
message: "修改成功",
type: 'success'
});
}).finally(()=> {
//重新发送请求查询分页数据
this.findPage();
});
}else{
//表单校验失败
this.$message.error("表单数据校验失败");
return false;
}
});
},
//添加
handleAdd () {
//校验表单输入项是否合法
this.$refs['dataAddForm'].validate((valid) => {
if (valid) {
this.formData.status="拉黑";
//表单数据校验通过发送ajax请求将表单数据提交到后台
axios.post("/user/Save",this.formData).then((response)=> {
//隐藏新增窗口
this.dialogFormVisible = false;
this.$message({
message: "添加成功",
type: 'success'
});
}).finally(()=> {
this.findPage();
});
} else {
this.$message.error("表单数据校验失败");
return false;
}
});
},
// 重置表单
resetForm() {
this.formData = {};
},
// 弹出添加窗口
handleCreate() {
this.resetForm();
this.dialogFormVisible = true;
},
// 弹出编辑窗口
handleUpdate(row) {
localStorage.setItem("biaoshi",row.biaoshi);
window.parent.document.getElementById("f").src="allDetails.html";
},
//切换页码
handleCurrentChange(currentPage) {
//currentPage为切换后的页码
this.pagination.currentPage = currentPage;
this.findPage();
},
//切换每页显示条数
handleSizeChange(pageSize){
this.pagination.pageSize =pageSize;
this.findPage();
},
// 删除
handleDelete(row) {
//alert(row.id);
this.$confirm("确认删除吗?","提示",{type:'warning'}).then(()=>{
//点击确定按钮时只需此处代码
//alert('用户点击的是确定按钮');
axios.delete("/user/Delete/" + row.id).then((res)=> {
this.$message({
message: "删除成功",
type: 'success'
});
//调用分页,获取最新分页数据
this.findPage();
});
});
},
//分页查询
findPage() {
axios.get("/ut/selectAll1").then((response)=> {
this.dataList = response.data;
});
},
c(row)
{
axios.get("/user/findById/" + row.id).then((res)=>{
this.formData=res.data;
if(this.formData.status=="拉黑")
{
this.formData.status="已拉黑"
}
else
{
this.formData.status="拉黑"
}
axios.put("/user/Update",this.formData).then((response)=> {
}).finally(()=> {
//重新发送请求查询分页数据
this.findPage();
});
});
}
}
})
</script>
</html>

@ -1,55 +0,0 @@
package com.controller;
import com.domain.fenduan;
import com.untils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/fenduan")
public class fenduanController {
@Autowired
public com.service.fenduanService fenduanService;
@PostMapping("/Save")
public int Save(@RequestBody fenduan fenduan)
{
return fenduanService.insert(fenduan);
}
@DeleteMapping("/Delete/{id}")
public int Delete(@PathVariable Integer id)
{
return fenduanService.delete(id);
}
@GetMapping("/findById/{id}")
public fenduan findById(@PathVariable Integer id)
{
return fenduanService.findById(id);
}
@PutMapping("/Update")
public int Update(@RequestBody fenduan fenduan)
{
return fenduanService.edit(fenduan);
}
@GetMapping("/selectAll")
public List<fenduan> selectAll()
{
return fenduanService.selectAll();
}
}

@ -1,147 +0,0 @@
html,body {
/* overflow-y: scroll; */
margin: 0;
}
.login-container .input{
display: inline-block;
height: 47px;
width: 85%;
}
.login-container .input input {
background: transparent;
border: 0px;
-webkit-appearance: none;
border-radius: 0px;
padding: 12px 5px 12px 0;
height: 47px;
}
.login-container .el-form-item {
border: 1px solid #DCDFE6;
background: #fff;
border-radius: 5px;
color: #454545;
}
.login-container .el-button--medium{
height: 50px;
line-height: 20px;
font-size: 22px;
}
.login-container .loginBox{
height: 100%;
width: 100%;
background: url('./../img/logingBg.png') no-repeat 100% 100%;
position: relative;
}
.login-container .loginBox .el-form-item__content{
line-height: initial;
}
.login-container form {
position: absolute;
left: 20%;
top: 50%;
width: 520px;
padding: 35px 35px 15px 35px;
margin: -200px 0 0 0;
background:#f5f5f5;
}
.login-container .tips {
font-size: 14px;
/* // color: #fff; */
margin-bottom: 10px;
/* span {
&:first-of-type {
margin-right: 16px;
}
} */
}
.login-container .svg-container {
padding: 6px 5px 6px 15px;
color: #889aa4;
vertical-align: middle;
width: 30px;
display: inline-block;
/* &_login {
font-size: 20px;
} */
}
.login-container .title-container {
position: relative;
}
.login-container .title-container .title {
font-size: 26px;
/* // font-weight: 400; */
color: #333;
margin: 0px auto 40px auto;
text-align: center;
font-weight: bold;
}
.login-container .title-container .set-language {
/* // color: #fff; */
position: absolute;
top: 5px;
right: 0px;
}
.login-container {
position: fixed;
height: 100%;
width: 100%;
background-color: #2d3a4b;
background: url('./../img/bg.jpg');
-moz-background-size: 100% 100%;
background-size: 100% 100%;
background-repeat: no-repeat;
}
.login-container .show-pwd {
position: absolute;
right: 10px;
top: 7px;
font-size: 16px;
color: #889aa4;
cursor: pointer;
user-select: none;
}
.login-container .thirdparty-button {
position: absolute;
right: 35px;
bottom: 28px;
}
.logoInfo{
padding-bottom:35px;
text-align: center;
}
.logoInfo span{
font-size: 22px;
padding: 0 10px;
display: inline-block;
}
.logoInfo .logo{
background: url(../img/loginLogo.png) no-repeat;
display:inline-block;
width: 200px;
height: 30px;
display: inline-block;
vertical-align: middle;
}
.tipInfo{font-size: 12px;}
.tipInfo span{
color: #66b1ff;
padding: 0 5px;
}
.tipInfo .el-checkbox{
margin: 0;
}
.svg-container span{
width: 22px;
height: 22px;
display: inline-block;
}
.svg-container .user{
background: url(../img/user.png) no-repeat 0 50%;
}
.svg-container .username{
background: url(../img/pwd.png) no-repeat 0 50%;
}

@ -1,119 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录</title>
<!-- 引入样式 -->
<link rel="stylesheet" href="../plugins/elementui/index.css" type="text/css">
<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css" type="text/css">
<link rel="stylesheet" href="../css/style.css" type="text/css">
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
</head>
<body style='background: url("../img/background.svg") #f0f2f5 no-repeat 50%;background-size: 100%; padding: -20px 0 144px;
position: relative;'>
<div style="margin: 200px 500px" id="app">
<el-form ref="dataAddForm" :rules="rules" label-position="right" label-width="100px" :model="formData" >
<el-row>
<el-col>
<h2 style="margin-left: 110px">心理测评系统</h2>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="用户名" prop="username">
<el-input placeholder="请输入用户名" style="width: 200px;" v-model="formData.username" placeholder="请输入用户名" type="text"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="密码" prop="password">
<el-input placeholder="请输入密码" style="width: 200px;" v-model="formData.password" type="password" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="add()" style="margin-left: 100px">登录</el-button>
<a href="regist.html" style="margin-left: 60px">前往注册</a>
</div>
</div>
</body>
</html>
<script>
var vue = new Vue({
el: '#app',
data: {
username:"",
password:"",
formData:{},
rules: {//校验规则
username: [{ required: true, message: '用户名为必填项', trigger: 'blur' }],
password: [{ required: true, message: '密码为必填项', trigger: 'blur' }],
idCard: [{ required: true, message: '身份证必填项', trigger: 'blur' }],
},
}
,methods:{
add()
{
//校验表单输入项是否合法
this.$refs['dataAddForm'].validate((valid) => {
if (valid) {
var k={
username:this.formData.username,
password:this.formData.password
};
//表单数据校验通过发送ajax请求将表单数据提交到后台
// axios.post("/login",k).then((response)=> {
//
// // this.$message({
// // message: "登录成功",
// // type: 'success'
// // });
// alert(response.data())
// })
$.ajax({
url:"/login",
type:"POST",
async:false,
dataType:"json",
data:{
username:this.formData.username,
password:this.formData.password
},
success: function (res) {
if(res=="登录成功")
{
window.location.href="main.html";
return;
}
else
{
alert("用户名或者密码错误");
}
}
})
} else {
alert("表单数据校验失败");
return false;
}
});
}
}
});
</script>

@ -1,245 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>心理测评系统</title>
<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
<!-- 引入样式 -->
<link rel="stylesheet" href="../plugins/elementui/index.css">
<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="../css/style.css">
<!-- 引入组件库 -->
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<style type="text/css">
.el-main{
position: absolute;
top: 70px;
bottom: 0px;
left: 200px;
right: 10px;
padding: 0;
}
</style>
</head>
<body class="hold-transition skin-purple sidebar-mini">
<div id="app">
<el-container>
<el-header class="main-header" style="height:70px;">
<nav class="navbar navbar-static-top" :class=''>
<!-- Logo -->
<a href="#" class="logo" style="text-align:center;">
<span>心理测评系统</span>
</a>
<input type="image" src="../img/展开.svg" style="width: 30px;position: absolute;top:15px;left: 160px" style="" @click="q"/>
<div class="right-menu">
<el-dropdown class="avatar-container right-menu-item" trigger="click">
<div class="avatar-wrapper">
欢迎你:{{username}}
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item divided>
<span style="display:block;"><a href="/logout">退出</a></span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</nav>
</el-header>
<el-container>
<el-menu :collapse="isCollapse" class="el-menu-vertical-demo" >
<el-submenu v-for="menu in menuList" :index="menu.path">
<template slot="title">
<i class="fa" :class="menu.icon"></i>
<span slot="title"> {{menu.title}}</span>
</template>
<template v-for="child in menu.children">
<el-menu-item :index="child.path">
<a :href="child.linkUrl" target="right" @click="add(child)">{{child.title}}</a>
</el-menu-item>
</template>
</el-submenu>
</el-menu>
<div style="width: 100%">
<el-tag @click="table">桌面</el-tag>
<el-tag
v-for="tag in tags"
:key="tag.name"
@click="t(tag.s)"
>
{{tag.name}}
</el-tag>
<iframe name="right" width="100%" height="600px" frameborder="0" src="table.html" id="f"></iframe>
</div>
</el-container>
</el-container>
</div>
</body>
<script>
new Vue({
el: '#app',
data: {
username: null,//用户名
menuList: [ ],
isCollapse:true,
tags: [
]
},
created() {
axios.get("/user/getUsername").then((response)=>{
this.username=response.data;
localStorage.setItem("username",this.username);
}).finally(()=>{
axios.get("/user/getByUserId?username="+this.username).then((response)=>{
localStorage.setItem("userId",response.data)
});
axios.get("/user/getByUserName?username="+this.username).then((response)=>{
localStorage.setItem("t",response.data);
if(response.data==0)
{
this.menuList=[{
"path": "1",
"title": "管理员模块",
"icon": "fa-dashboard",
"children": [
{
"path": "/1-1",
"title": "个人账号",
"linkUrl": "user1.html",
"children": []
},
{
"path": "/1-2",
"title": "用户管理",
"linkUrl": "user.html",
"children": []
},
{
"path": "/1-3",
"title": "题目管理",
"linkUrl": "timu.html",
"children": []
},
{
"path": "/1-4",
"title": "测评分析",
"linkUrl": "fenduan.html",
"children": []
},
{
"path": "/1-5",
"title": "测评结果",
"linkUrl": "all1.html",
"children": []
}
]
}]
}
else {
this.menuList=[{
"path": "1",
"title": "用户模块",
"icon": "fa-dashboard",
"children": [
{
"path": "/1-1",
"title": "个人账号",
"linkUrl": "user1.html",
"children": []
},
{
"path": "/1-2",
"title": "测试",
"linkUrl": "ceshi.html",
"children": []
},
{
"path": "/1-3",
"title": "评测成绩",
"linkUrl": "all.html",
"children": []
}
]
}]
}
});
});
},
methods:{
q()
{
this.isCollapse=!this.isCollapse;
},
table()
{
document.getElementById("f").src="table.html";
},
t(value)
{
document.getElementById("f").src=value;
},
add(child)
{
var f={name:child.title,s:child.linkUrl};
this.tags=[];
this.tags.push(f);
},
}
});
$(function() {
var wd = 200;
$(".el-main").css('width', $('body').width() - wd + 'px');
});
</script>
</html>
<style>
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 200px;
min-height: 400px;
}
</style>

@ -1,60 +0,0 @@
package com.controller;
import com.domain.timu;
import com.service.timuService;
import com.untils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/timu")
public class timuController {
@Autowired
public com.service.timuService timuService;
@PostMapping("/Save")
public int Save(@RequestBody timu timu)
{
return timuService.insert(timu);
}
@DeleteMapping("/Delete/{id}")
public int Delete(@PathVariable Integer id)
{
return timuService.delete(id);
}
@GetMapping("/SelectPage/{size}/{current}")
public PageResult selectPage(@PathVariable Integer size, @PathVariable Integer current, timu timu)
{
return timuService.SelectPage(timu,size,current);
}
@GetMapping("/findById/{id}")
public timu findById(@PathVariable Integer id)
{
return timuService.findById(id);
}
@PutMapping("/Update")
public int Update(@RequestBody timu timu)
{
return timuService.edit(timu);
}
@GetMapping("/selectAll")
public List<timu> selectAll()
{
return timuService.selectAll();
}
}

@ -1,96 +0,0 @@
package com.controller;
import com.domain.user;
import com.service.userService;
import com.untils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/user")
public class userController {
@Autowired
public userService userService;
@PostMapping("/Save")
public int Save(@RequestBody user user)
{
return userService.insert(user);
}
@DeleteMapping("/Delete/{id}")
public int Delete(@PathVariable Integer id)
{
return userService.delete(id);
}
@PutMapping("/Update")
public int Update(@RequestBody user user)
{
return userService.edit(user);
}
@GetMapping("/SelectPage/{size}/{current}")
public PageResult selectPage(@PathVariable Integer size, @PathVariable Integer current,user user)
{
return userService.SelectPage(user,size,current);
}
@GetMapping("/SelectPageStudent/{size}/{current}")
public PageResult selectPageStudent(@PathVariable Integer size, @PathVariable Integer current,user user)
{
return userService.SelectPageStudent(user,size,current);
}
@GetMapping("/findById/{id}")
public user findById(@PathVariable Integer id)
{
return userService.findById(id);
}
@PostMapping("/login")
public Boolean login(@RequestBody user user)
{
user user1= userService.login(user);
if (user1==null)
{
return false;
}
else
{
return true;
}
}
//获取当前登录用户的用户名
@GetMapping("/getUsername")
public String getUsername(){
org.springframework.security.core.userdetails.User user =
(org.springframework.security.core.userdetails.User)
SecurityContextHolder.getContext().getAuthentication().getPrincipal();
return user.getUsername();
}
@GetMapping("/getByUserName")
public int getByUserName(String username){
return userService.selectByUserName(username).getType();
}
@GetMapping("/getByUserId")
public int getByUserId(String username){
return userService.selectByUserName(username).getId();
}
}

@ -1,85 +0,0 @@
package com.controller;
import com.domain.all;
import com.domain.ut;
import com.untils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.UUID;
@RestController
@RequestMapping("/ut")
public class utController {
@Autowired
public com.service.utService utService;
@PostMapping("/Save")
public int Save(@RequestBody List<ut> uts)
{
UUID uuid = UUID.randomUUID();
for (ut item:uts)
{
item.setBiaoshi(uuid.toString());
utService.insert(item);
}
return 1;
}
@DeleteMapping("/Delete/{id}")
public int Delete(@PathVariable Integer id)
{
return utService.delete(id);
}
@GetMapping("/SelectPage/{size}/{current}")
public PageResult selectPage(@PathVariable Integer size, @PathVariable Integer current, ut ut)
{
return utService.SelectPage(ut,size,current);
}
@GetMapping("/findById/{id}")
public ut findById(@PathVariable Integer id)
{
return utService.findById(id);
}
@PutMapping("/Update")
public int Update(@RequestBody ut ut)
{
return utService.edit(ut);
}
@GetMapping("/selectAll/{userId}")
public List<all> selectAll(@PathVariable int userId)
{
return utService.selectAll(userId);
}
@GetMapping("/selectAll1")
public List<all> selectAll1()
{
return utService.selectAll1();
}
@GetMapping("/selectDetails/{biaoshi}")
public List<ut> selectDetails(@PathVariable String biaoshi) {
return utService.selectDetails(biaoshi);
}
}

@ -1,133 +0,0 @@
/*
SQLyog Ultimate v12.08 (64 bit)
MySQL - 8.0.26 : Database - xinli
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`xinli` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `xinli`;
/*Table structure for table `fenduan` */
DROP TABLE IF EXISTS `fenduan`;
CREATE TABLE `fenduan` (
`id` int NOT NULL AUTO_INCREMENT,
`start` double DEFAULT NULL,
`end` double DEFAULT NULL,
`guo` varchar(500) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb3;
/*Data for the table `fenduan` */
insert into `fenduan`(`id`,`start`,`end`,`guo`) values (9,0,59,'抑郁'),(10,60,85,'正常'),(11,85,100,'精神非常好');
/*Table structure for table `liaotian` */
DROP TABLE IF EXISTS `liaotian`;
CREATE TABLE `liaotian` (
`id` int NOT NULL AUTO_INCREMENT,
`one` int DEFAULT NULL,
`two` int DEFAULT NULL,
`content` longtext,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb3;
/*Data for the table `liaotian` */
insert into `liaotian`(`id`,`one`,`two`,`content`) values (17,6,7,'<div style=\"margin-top: 10px\">李丽说:无奈</div><div style=\"margin-top: 10px\">李丽说:好累啊</div><div style=\"margin-top: 10px\">孙策说:去你的</div>');
/*Table structure for table `mokuai` */
DROP TABLE IF EXISTS `mokuai`;
CREATE TABLE `mokuai` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(200) DEFAULT NULL,
`quanzhon` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3;
/*Data for the table `mokuai` */
insert into `mokuai`(`id`,`name`,`quanzhon`) values (3,'第一模块','30'),(4,'第二模块','30'),(5,'第三模块','30');
/*Table structure for table `timu` */
DROP TABLE IF EXISTS `timu`;
CREATE TABLE `timu` (
`id` int NOT NULL AUTO_INCREMENT,
`xuhao` int DEFAULT NULL,
`them` varchar(200) DEFAULT NULL,
`one` varchar(200) DEFAULT NULL,
`two` varchar(200) DEFAULT NULL,
`three` varchar(200) DEFAULT NULL,
`four` varchar(200) DEFAULT NULL,
`ok` varchar(200) DEFAULT NULL,
`fen` double DEFAULT NULL,
`da` varchar(200) DEFAULT NULL,
`mokuaiId` int DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb3;
/*Data for the table `timu` */
insert into `timu`(`id`,`xuhao`,`them`,`one`,`two`,`three`,`four`,`ok`,`fen`,`da`,`mokuaiId`) values (8,1,'童年','快乐','悲伤','兴奋','优秀','快乐',20,NULL,3),(9,2,'成年','压抑','忧郁','失败','成功','成功',10,NULL,3),(10,1,'吃饭','爱吃','厌食','暴饮暴食','正常就餐','正常就餐',20,NULL,4),(11,2,'睡觉','嗜睡','失眠','正常','压抑','正常',30,NULL,4),(12,1,'自我评价','正常','神经','快乐','失败','快乐',10,NULL,5),(13,2,'未来规划','努力生活','混吃等死','积极向上','好好学习','积极向上',10,NULL,5);
/*Table structure for table `user` */
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int NOT NULL AUTO_INCREMENT,
`username` varchar(200) DEFAULT NULL,
`password` varchar(200) DEFAULT NULL,
`type` int DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3;
/*Data for the table `user` */
insert into `user`(`id`,`username`,`password`,`type`) values (1,'admin','123',0),(6,'李丽','123',1),(7,'孙策','123',1),(8,'李云','123',1);
/*Table structure for table `ut` */
DROP TABLE IF EXISTS `ut`;
CREATE TABLE `ut` (
`id` int NOT NULL AUTO_INCREMENT,
`userId` int DEFAULT NULL,
`xuhao` int DEFAULT NULL,
`them` varchar(200) DEFAULT NULL,
`one` varchar(200) DEFAULT NULL,
`two` varchar(200) DEFAULT NULL,
`three` varchar(200) DEFAULT NULL,
`four` varchar(200) DEFAULT NULL,
`ok` varchar(200) DEFAULT NULL,
`da` varchar(200) DEFAULT NULL,
`fen` double DEFAULT NULL,
`mokuaiId` int DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=142 DEFAULT CHARSET=utf8mb3;
/*Data for the table `ut` */
insert into `ut`(`id`,`userId`,`xuhao`,`them`,`one`,`two`,`three`,`four`,`ok`,`da`,`fen`,`mokuaiId`) values (118,7,1,'童年','快乐','悲伤','兴奋','优秀','快乐','快乐',20,3),(119,7,2,'成年','压抑','忧郁','失败','成功','成功','压抑',0,3),(120,7,1,'吃饭','爱吃','厌食','暴饮暴食','正常就餐','正常就餐','正常就餐',20,4),(121,7,2,'睡觉','嗜睡','失眠','正常','压抑','正常','正常',30,4),(122,7,1,'自我评价','正常','神经','快乐','失败','快乐','正常',0,5),(123,7,2,'未来规划','努力生活','混吃等死','积极向上','好好学习','积极向上','努力生活',0,5),(130,8,1,'童年','快乐','悲伤','兴奋','优秀','快乐','快乐',20,3),(131,8,2,'成年','压抑','忧郁','失败','成功','成功','成功',10,3),(132,8,1,'吃饭','爱吃','厌食','暴饮暴食','正常就餐','正常就餐','正常就餐',20,4),(133,8,2,'睡觉','嗜睡','失眠','正常','压抑','正常','正常',30,4),(134,8,1,'自我评价','正常','神经','快乐','失败','快乐','快乐',10,5),(135,8,2,'未来规划','努力生活','混吃等死','积极向上','好好学习','积极向上','积极向上',10,5),(136,6,1,'童年','快乐','悲伤','兴奋','优秀','快乐','快乐',20,3),(137,6,2,'成年','压抑','忧郁','失败','成功','成功','失败',0,3),(138,6,1,'吃饭','爱吃','厌食','暴饮暴食','正常就餐','正常就餐','暴饮暴食',0,4),(139,6,2,'睡觉','嗜睡','失眠','正常','压抑','正常','正常',30,4),(140,6,1,'自我评价','正常','神经','快乐','失败','快乐','神经',0,5),(141,6,2,'未来规划','努力生活','混吃等死','积极向上','好好学习','积极向上','努力生活',0,5);
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

@ -1,51 +0,0 @@
package com.config;
import com.domain.user;
import com.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collection;
@Service
public class UserService implements UserDetailsService {
@Autowired
public com.service.userService userService;
@Autowired(required = false)
private PasswordEncoder passwordEncoder;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
// 根据用户查询用户信息
//User user = userMapper.findByUsername(username); //查询数据库
// user user = new user(1, username, "123456", 1);//注意:这里我就是用来测试的,实际应该从数据库中获取
user user=userService.selectByUserName(username);
if (user != null) {
// 根据用户查询用户对应权限
Collection<GrantedAuthority> authorities = new ArrayList<>();
/* //查询登录用户所拥有的角色
List<Role> list = RoleMapper.findByUserId(userId);
for (Role role : list) {
GrantedAuthority authority = new SimpleGrantedAuthority("ROLE_"+role.getRoleName());
authorities.add(authority);
}
*/
//创建一个授权对象
GrantedAuthority authority = new SimpleGrantedAuthority("ROLE_ADMIN"); //注意:这里我就是用来测试的,实际应该从数据库中获取
authorities.add(authority);
return new org.springframework.security.core.userdetails.User(
user.getUsername(),
// 因为数据库是明文,所以这里需加密密码
passwordEncoder.encode(user.getPassword()),
authorities);
}
return null;
}
}

@ -1,96 +0,0 @@
package com.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
public UserDetailsService getUserService() {
return new UserService();
}
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(getUserService()).passwordEncoder(passwordEncoder());
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers( "/pages/login.html","/img/*","/plugins/**","/css/*","/js/*","/dist/**","/pages/regist.html","/user/Save").permitAll()// 无需认证
.anyRequest().authenticated() // 所有请求都需要验证
.and()
.headers().frameOptions().disable()
.and()
.formLogin() // 使用默认的登录页面
.loginPage("/pages/login.html")// 指定指定要的登录页面
.loginProcessingUrl("/login")// 处理认证路径的请求
//认证成功后的跳转页面 默认是get方式提交 自定义成功页面post方式提交
//在 controller中处理时要注意
// .defaultSuccessUrl("/pages/main.html")
// .failureForwardUrl("/pages/error.html")
.successHandler(new SimpleUrlAuthenticationSuccessHandler() {
@Override
public void onAuthenticationSuccess(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) throws IOException, ServletException {
httpServletResponse.setContentType("application/json;charset=utf-8");
ServletOutputStream out = httpServletResponse.getOutputStream();
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.writeValue(out, "登录成功");
out.flush();
out.close();
}
}).failureHandler(new SimpleUrlAuthenticationFailureHandler() {
@Override
public void onAuthenticationFailure(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException {
httpServletResponse.setContentType("application/json;charset=utf-8");
ServletOutputStream out = httpServletResponse.getOutputStream();
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.writeValue(out, "登录失败");
out.flush();
out.close();
}
})
.and()
//开启cookie保存用户数据
// .rememberMe()
//设置cookie有效期
// .tokenValiditySeconds(60 * 60 * 24 * 7) //有效期一周
//设置cookie的私钥
// .key("")
// .and()
.logout()
.logoutUrl("/logout")
.logoutSuccessUrl("/pages/login.html")
// .invalidateHttpSession(true)
.and()
// .headers().frameOptions().disable().and()
.csrf().disable() //关闭跨域保护
.sessionManagement()
.maximumSessions(1);// 同一用户 只允许一个在线 自动踢出在线用户
}
}

@ -1,234 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!-- 页面meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
<!-- 引入样式 -->
<link rel="stylesheet" href="../plugins/elementui/index.css">
<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="../css/style.css">
</head>
<body class="hold-transition">
<div id="app">
<div class="content-header">
<h1>用户模块<small>评测成绩</small></h1>
<el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>用户模块</el-breadcrumb-item>
<el-breadcrumb-item>评测成绩</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="app-container">
<div class="box">
<div class="filter-container">
</div>
<el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row>
<el-table-column type="index" align="center" label="序号"></el-table-column>
<el-table-column prop="fen" label="分数" align="center"></el-table-column>
<el-table-column prop="guo" label="结果" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">详情</el-button>
<el-button type="primary" size="mini" @click="handleUpdate1(scope.row)">匹配</el-button>
<el-button type="primary" size="mini" @click="handleUpdate2(scope.row)">定位医院</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script>
var vue = new Vue({
el: '#app',
data:{
pagination: {//分页相关模型数据
currentPage: 1,//当前页码
pageSize:10,//每页显示的记录数
total:0,//总记录数
queryString:""//查询条件
},
dataList: [],//当前页要展示的分页列表数据
formData: {},//表单数据
dialogFormVisible: false,//增加表单是否可见
dialogFormVisible4Edit:false,//编辑表单是否可见
rules: {//校验规则
username: [{ required: true, message: '用户名为必填项', trigger: 'blur' }],
password: [{ required: true, message: '密码为必填项', trigger: 'blur' }],
type:[{ required: true, message: '角色为必选项', trigger: 'blur' }],
idCard:[{ required: true, message: '身份证号必填项', trigger: 'blur' }]
},
options: [{
value: 1,
label: '用户'
},
{
value: 0,
label: '管理员'
}]
},
//钩子函数VUE对象初始化完成后自动执行
created(){
this.findPage();
},
methods:{
//编辑
handleEdit() {
//表单校验
this.$refs['dataEditForm'].validate((valid)=>{
if(valid){
//表单校验通过,发送请求
axios.put("/user/Update",this.formData).then((response)=> {
this.dialogFormVisible4Edit = false;
this.$message({
message: "修改成功",
type: 'success'
});
}).finally(()=> {
//重新发送请求查询分页数据
this.findPage();
});
}else{
//表单校验失败
this.$message.error("表单数据校验失败");
return false;
}
});
},
//添加
handleAdd () {
//校验表单输入项是否合法
this.$refs['dataAddForm'].validate((valid) => {
if (valid) {
this.formData.status="拉黑";
//表单数据校验通过发送ajax请求将表单数据提交到后台
axios.post("/user/Save",this.formData).then((response)=> {
//隐藏新增窗口
this.dialogFormVisible = false;
this.$message({
message: "添加成功",
type: 'success'
});
}).finally(()=> {
this.findPage();
});
} else {
this.$message.error("表单数据校验失败");
return false;
}
});
},
// 重置表单
resetForm() {
this.formData = {};
},
// 弹出添加窗口
handleCreate() {
this.resetForm();
this.dialogFormVisible = true;
},
// 弹出编辑窗口
handleUpdate(row) {
localStorage.setItem("userId",row.userId);
window.parent.document.getElementById("f").src="allm.html";
},
handleUpdate1(row) {
localStorage.setItem("userId",row.userId);
window.parent.document.getElementById("f").src="pipei.html";
},
handleUpdate2(row) {
localStorage.setItem("userId",row.userId);
window.parent.document.getElementById("f").src="map.html";
},
//切换页码
handleCurrentChange(currentPage) {
//currentPage为切换后的页码
this.pagination.currentPage = currentPage;
this.findPage();
},
//切换每页显示条数
handleSizeChange(pageSize){
this.pagination.pageSize =pageSize;
this.findPage();
},
// 删除
handleDelete(row) {
//alert(row.id);
this.$confirm("确认删除吗?","提示",{type:'warning'}).then(()=>{
//点击确定按钮时只需此处代码
//alert('用户点击的是确定按钮');
axios.delete("/user/Delete/" + row.id).then((res)=> {
this.$message({
message: "删除成功",
type: 'success'
});
//调用分页,获取最新分页数据
this.findPage();
});
});
},
//分页查询
findPage() {
let userId=localStorage.getItem("userId");
//请求后台
axios.get("/ut/selectAll/"+userId).then((response)=> {
this.dataList = response.data;
});
},
c(row)
{
axios.get("/user/findById/" + row.id).then((res)=>{
this.formData=res.data;
if(this.formData.status=="拉黑")
{
this.formData.status="已拉黑"
}
else
{
this.formData.status="拉黑"
}
axios.put("/user/Update",this.formData).then((response)=> {
}).finally(()=> {
//重新发送请求查询分页数据
this.findPage();
});
});
}
}
})
</script>
</html>

@ -1,54 +0,0 @@
package com.controller;
import com.domain.fenduan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/fenduan")
public class fenduanController {
@Autowired
public com.service.fenduanService fenduanService;
@PostMapping("/Save")
public int Save(@RequestBody fenduan fenduan)
{
return fenduanService.insert(fenduan);
}
@DeleteMapping("/Delete/{id}")
public int Delete(@PathVariable Integer id)
{
return fenduanService.delete(id);
}
@GetMapping("/findById/{id}")
public fenduan findById(@PathVariable Integer id)
{
return fenduanService.findById(id);
}
@PutMapping("/Update")
public int Update(@RequestBody fenduan fenduan)
{
return fenduanService.edit(fenduan);
}
@GetMapping("/selectAll")
public List<fenduan> selectAll()
{
return fenduanService.selectAll();
}
}

@ -1,14 +0,0 @@
package com.service;
import com.domain.fenduan;
import java.util.List;
public interface fenduanService {
public int insert(fenduan fenduan);
public int delete(int id);
public int edit(fenduan fenduan);
public fenduan findById(int id);
public List<fenduan> selectAll();
}

@ -1,136 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" name="viewport">
<title>登录</title>
<link rel="stylesheet" href="../dist/modules/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="../dist/modules/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="../dist/modules/fontawesome/web-fonts-with-css/css/fontawesome-all.min.css">
<link rel="stylesheet" href="../dist/css/demo.css">
<link rel="stylesheet" href="../dist/css/style.css">
<!-- 引入样式 -->
<link rel="stylesheet" href="../plugins/elementui/index.css" type="text/css">
<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css" type="text/css">
<link rel="stylesheet" href="../css/style.css" type="text/css">
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
</head>
<body>
<div id="app">
<section class="section">
<div class="container mt-5">
<div class="row">
<div class="col-12 col-sm-8 offset-sm-2 col-md-6 offset-md-3 col-lg-6 offset-lg-3 col-xl-4 offset-xl-4">
<div class="login-brand">
心理测评
</div>
<div class="card card-primary">
<div class="card-header"><h4>登录</h4></div>
<div class="card-body">
<div class="needs-validation" novalidate="">
<div class="form-group">
<label for="name">账号</label>
<input id="name" type="text" class="form-control" v-model="username" tabindex="1" required autofocus>
<div class="invalid-feedback">
Please fill in your email
</div>
</div>
<div class="form-group">
<label for="password" class="d-block">密码
</label>
<input id="password" type="password" class="form-control" v-model="password" tabindex="2" required>
<div class="invalid-feedback">
please fill in your password
</div>
</div>
<div class="form-group">
<button class="btn btn-primary btn-block" tabindex="4" @click="add()">
登录
</button>
<label for="password" class="d-block">
<div class="float-right">
<a href="regist.html">
前往注册?
</a>
</div>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</body>
</html>
<script>
var vue = new Vue({
el: '#app',
data: {
username:"",
password:"",
formData:{},
rules: {//校验规则
username: [{ required: true, message: '用户名为必填项', trigger: 'blur' }],
password: [{ required: true, message: '密码为必填项', trigger: 'blur' }],
idCard: [{ required: true, message: '身份证必填项', trigger: 'blur' }],
},
}
,methods:{
add()
{
if(this.username.trim()==""||this.password.trim()=="")
{
alert("请输入用户名和密码");
return
}
$.ajax({
url:"/login",
type:"POST",
async:false,
dataType:"json",
data:{
username:this.username,
password:this.password
},
success: function (res) {
if(res=="登录成功")
{
window.location.href="main.html";
return;
}
else
{
alert("用户名或者密码错误");
}
}
})
}
}
});
</script>

@ -1,18 +0,0 @@
package com.config;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class myConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor()
{
MybatisPlusInterceptor mybatisPlusInterceptor=new MybatisPlusInterceptor();
mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
return mybatisPlusInterceptor;
}
}

@ -1,140 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>lianghaoshiming</groupId>
<artifactId>exerciesManage</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>exerciesManage</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>2.3.7.RELEASE</spring-boot.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
<version>7.2.7</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.1.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.7.RELEASE</version>
<configuration>
<mainClass>com.AutographApplication</mainClass>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -1,227 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!-- 页面meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>火车票销售系统</title>
<meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
<!-- 引入样式 -->
<link rel="stylesheet" href="../plugins/elementui/index.css">
<link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="../css/style.css">
</head>
<body class="hold-transition">
<div id="app">
<div class="content-header">
<h1>个人模块<small>账号管理</small></h1>
<el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>个人模块</el-breadcrumb-item>
<el-breadcrumb-item>账号管理</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="app-container">
<div class="box">
<el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row>
<el-table-column type="index" align="center" label="序号"></el-table-column>
<el-table-column prop="username" label="用户名" align="center"></el-table-column>
<el-table-column prop="password" label="密码" align="center"></el-table-column>
<el-table-column label="角色" align="center">
<template slot-scope="scope">
<!-- <span>{{ scope.row.type == '0' ? '管理员' : '学生'}}</span>-->
<span>{{ scope.row.type == '0' ? '管理员' : '用户'}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<!-- 编辑标签弹层 -->
<div class="add-form">
<el-dialog title="修改" :visible.sync="dialogFormVisible4Edit">
<el-form ref="dataEditForm" :model="formData" :rules="rules" label-position="right" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="用户名" prop="username">
<el-input v-model="formData.username"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="密码" prop="password">
<el-input v-model="formData.password"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible4Edit = false">取消</el-button>
<el-button type="primary" @click="handleEdit()">确定</el-button>
</div>
</el-dialog>
</div>
</div>
</div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script>
var vue = new Vue({
el: '#app',
data:{
pagination: {//分页相关模型数据
currentPage: 1,//当前页码
pageSize:10,//每页显示的记录数
total:0,//总记录数
queryString:""//查询条件
},
dataList: [],//当前页要展示的分页列表数据
formData: {},//表单数据
dialogFormVisible: false,//增加表单是否可见
dialogFormVisible4Edit:false,//编辑表单是否可见
rules: {//校验规则
username: [{ required: true, message: '用户名为必填项', trigger: 'blur' }],
password: [{ required: true, message: '密码为必填项', trigger: 'blur' }],
type:[{ required: true, message: '角色为必选项', trigger: 'blur' }],
idCard:[{ required: true, message: '身份证号必填项', trigger: 'blur' }]
},
options: [{
value: 1,
label: '用户'
},
{
value: 0,
label: '管理员'
}]
},
//钩子函数VUE对象初始化完成后自动执行
created(){
this.findPage();
},
methods:{
//编辑
handleEdit() {
//表单校验
this.$refs['dataEditForm'].validate((valid)=>{
if(valid){
//表单校验通过,发送请求
axios.put("/user/Update",this.formData).then((response)=> {
this.dialogFormVisible4Edit = false;
this.$message({
message: "修改成功",
type: 'success'
});
}).finally(()=> {
//重新发送请求查询分页数据
this.findPage();
});
}else{
//表单校验失败
this.$message.error("表单数据校验失败");
return false;
}
});
},
//添加
handleAdd () {
//校验表单输入项是否合法
this.$refs['dataAddForm'].validate((valid) => {
if (valid) {
//表单数据校验通过发送ajax请求将表单数据提交到后台
axios.post("/user/Save",this.formData).then((response)=> {
//隐藏新增窗口
this.dialogFormVisible = false;
this.$message({
message: "添加成功",
type: 'success'
});
}).finally(()=> {
this.findPage();
});
} else {
this.$message.error("表单数据校验失败");
return false;
}
});
},
// 重置表单
resetForm() {
this.formData = {};
},
// 弹出添加窗口
handleCreate() {
this.resetForm();
this.dialogFormVisible = true;
},
// 弹出编辑窗口
handleUpdate(row) {
//发送请求获取检查项信息
axios.get("/user/findById/" + row.id).then((res)=>{
//设置编辑窗口属性dialogFormVisible4Edit为true表示显示
this.dialogFormVisible4Edit = true;
//为模型数据设置值基于VUE双向数据绑定回显到页面
this.formData = res.data;
});
},
//切换页码
handleCurrentChange(currentPage) {
//currentPage为切换后的页码
this.pagination.currentPage = currentPage;
this.findPage();
},
//切换每页显示条数
handleSizeChange(pageSize){
this.pagination.pageSize =pageSize;
this.findPage();
},
// 删除
handleDelete(row) {
//alert(row.id);
this.$confirm("确认删除吗?","提示",{type:'warning'}).then(()=>{
//点击确定按钮时只需此处代码
//alert('用户点击的是确定按钮');
axios.delete("/user/Delete/" + row.id).then((res)=> {
this.$message({
message: "删除成功",
type: 'success'
});
//调用分页,获取最新分页数据
this.findPage();
});
});
},
//分页查询
findPage() {
let userId=localStorage.getItem("userId");
this.dataList=[];
axios.get("/user/findById/" + userId).then((res)=>{
this.formData = res.data;
this.dataList.push(this.formData);
});
}
}
})
</script>
</html>
Loading…
Cancel
Save