master
JackyMa 2 years ago
parent 19effcafb9
commit 1e9108f417

File diff suppressed because it is too large Load Diff

@ -1,5 +1,5 @@
{ {
"name": "testfront", "name": "front",
"version": "1.0.0", "version": "1.0.0",
"description": "A Vue.js project", "description": "A Vue.js project",
"author": "", "author": "",
@ -15,10 +15,11 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.27.2", "axios": "^0.27.2",
"element-ui": "^2.15.9", "element-ui": "^2.15.7",
"vue": "^2.5.2", "vue": "^2.5.2",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vuex": "^3.6.2" "vuex": "^3.6.2",
"xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^7.1.2", "autoprefixer": "^7.1.2",
@ -59,6 +60,8 @@
"postcss-loader": "^2.0.8", "postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1", "postcss-url": "^7.2.1",
"rimraf": "^2.6.0", "rimraf": "^2.6.0",
"sass": "^1.53.0",
"sass-loader": "^7.3.1",
"selenium-server": "^3.0.1", "selenium-server": "^3.0.1",
"semver": "^5.3.0", "semver": "^5.3.0",
"shelljs": "^0.7.6", "shelljs": "^0.7.6",

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

@ -47,7 +47,7 @@ export default {
// var data = this.loginForm // var data = this.loginForm
_this.$store.commit('login', _this.loginForm) _this.$store.commit('login', _this.loginForm)
var path = this.$route.query.redirect var path = this.$route.query.redirect
this.$router.replace({path: path === '/login' || path === undefined ? '/index' : path}) this.$router.replace({path: path === '/login' || path === undefined ? '/home' : path})
} }
}) })
.catch(failResponse => { .catch(failResponse => {

@ -1,88 +0,0 @@
<template>
<el-table :data="tableData"
style="width: 100%"
stripe>
<el-table-column prop="name" label="部门" size="medium" align="center"></el-table-column>
<el-table-column prop="establish" label="成立日期" align="center"></el-table-column>
<el-table-column prop="head" label="负责人" align="center"></el-table-column>
<el-table-column prop="chief" label="人员总数" align="center"></el-table-column>
<el-table-column prop="incumbent" label="在位人员数" align="center"></el-table-column>
<el-table-column prop="departure" label="离位人员数" align="center"></el-table-column>
<el-table-column prop="state" label="战备状态" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<!--
slot-scope作用域插槽可以获取表格数据
scope代表表格数据可以通过scope.row来获取表格当前行数据scope不是固定写法
-->
<template slot-scope="scope">
<el-button type="text" size="medium" @click="handleUpdate(scope.row)"></el-button>
<el-button type="text" size="medium" @click="handleDelete(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
</template>
<script>
export default {
name: "Combatants",
data() {
return {
tableData: [{
name: '作战部', establish: '', head: '', chief: '', incumbent: '', departure: '', state: ''
}, {
name: '航空部', establish: '', head: '', chief: '', incumbent: '', departure: '', state: ''
}, {
name: '航海部', establish: '', head: '', chief: '', incumbent: '', departure: '', state: ''
}, {
name: '武器部', establish: '', head: '', chief: '', incumbent: '', departure: '', state: ''
}, {
name: '轮机部', establish: '', head: '', chief: '', incumbent: '', departure: '', state: ''
}, {
name: '医务部', establish: '', head: '', chief: '', incumbent: '', departure: '', state: ''
}, {
name: '供应部', establish: '', head: '', chief: '', incumbent: '', departure: '', state: ''
}, {
name: '安全部', establish: '', head: '', chief: '', incumbent: '', departure: '', state: ''
}, {
name: '维修部', establish: '', head: '', chief: '', incumbent: '', departure: '', state: ''
}],
responseResult: []
}
},
mounted() {
this.getCombatants()
},
methods: {
getCombatants () {
this.$axios
.post('/combatants', {
request: 'init'
})
.then(response => {
if (response !== null){
this.responseResult = response.data
console.log(JSON.parse(JSON.stringify(this.responseResult)))
this.responseResult = JSON.parse(JSON.stringify(this.responseResult))
for (let i = 0; i < this.responseResult.length; i++){
for (let j = 0; j < this.tableData.length; j++){
if(this.responseResult.at(i).name === this.tableData.at(j).name){
this.tableData.at(j).establish = this.responseResult.at(i).establish
this.tableData.at(j).head = this.responseResult.at(i).head
this.tableData.at(j).chief = this.responseResult.at(i).chief
this.tableData.at(j).departure = this.responseResult.at(i).departure
this.tableData.at(j).incumbent = this.responseResult.at(i).incumbent
this.tableData.at(j).state = this.responseResult.at(i).state
break
}
}
}
}
})
}
}
}
</script>
<style scoped>
</style>

@ -1,28 +0,0 @@
<template>
<el-container>
<el-aside style="width: 200px;margin-top: 20px">
<switch></switch>
<SideMenu></SideMenu>
</el-aside>
<el-main>
<Combatants class="combatants-area"></Combatants>
</el-main>
</el-container>
</template>
<script>
import SideMenu from "./SideMenu";
import Combatants from "./Combatants";
export default {
name: "CombatantsIndex",
components: {SideMenu, Combatants}
}
</script>
<style scoped>
.combatants-area {
width: 990px;
margin-left: auto;
margin-right: auto;
}
</style>

@ -1,65 +0,0 @@
<template>
<el-menu
class="categories"
default-active="0"
select="handleSelect"
active-text-color="red">
<el-menu-item index="0">
<i class="el-icon-menu"></i>
<span slot="title">部总览</span>
</el-menu-item>
<el-menu-item index="1">
<i class="el-icon-menu"></i>
<span slot="title">作战部</span>
</el-menu-item>
<el-menu-item index="2">
<i class="el-icon-menu"></i>
<span slot="title">航空部</span>
</el-menu-item>
<el-menu-item index="3">
<i class="el-icon-menu"></i>
<span slot="title">航海部</span>
</el-menu-item>
<el-menu-item index="4">
<i class="el-icon-menu"></i>
<span slot="title">武器部</span>
</el-menu-item>
<el-menu-item index="5">
<i class="el-icon-menu"></i>
<span slot="title">轮机部</span>
</el-menu-item>
<el-menu-item index="6">
<i class="el-icon-menu"></i>
<span slot="title">医务部</span>
</el-menu-item>
<el-menu-item index="7">
<i class="el-icon-menu"></i>
<span slot="title">供应部</span>
</el-menu-item>
<el-menu-item index="8">
<i class="el-icon-menu"></i>
<span slot="title">安全部</span>
</el-menu-item>
<el-menu-item index="9">
<i class="el-icon-menu"></i>
<span slot="title">维修部</span>
</el-menu-item>
</el-menu>
</template>
<script>
export default {
name: 'SideMenu'
}
</script>
<style scoped>
.categories {
position: fixed;
margin-left: 50%;
left: -900px;
top: 100px;
width: 150px;
}
</style>

@ -1,44 +1,167 @@
<template> <template>
<div class="wrapper">
<!-- 页面头部部分 -->
<div class="header">
<div class="logo">学员综合评定管理系统</div>
<!-- 水平一级菜单 -->
<div style="float:left;">
<el-menu <el-menu
:default-active="'/index'"
router
mode="horizontal" mode="horizontal"
background-color="white" text-color="#000000"
text-color="#222" active-text-color="#3989fa"
active-text-color="red" :default-active="toIndex"
style="min-width: 1300px"> @select="handleSelect">
<el-menu-item v-for="(item,i) in navList" :key="i" :index="item.name"> <el-menu-item v-for="(item, index) in itemList" :index="item.path" :key="index">
{{ item.navItem }} <span slot="title">{{ item.title }}</span>
</el-menu-item> </el-menu-item>
<a href="#nowhere" style="color: #222;float: right;padding: 20px;">更多功能</a>
<i class="el-icon-menu" style="float:right;font-size: 45px;color: #222;padding-top: 8px"></i>
<span style="position: absolute;padding-top: 20px;right: 43%;font-size: 20px;font-weight: bold">White Jotter - Your Mind Palace</span>
</el-menu> </el-menu>
</div>
<div class="header-right">
<div class="header-user-con">
<!-- 切换主题 -->
<div @click="handleChangeStyle()">
<el-tooltip content="切换主题" placement="bottom">
<i :class="globalTheme ? 'el-icon-moon' : 'el-icon-sunny'"></i>
</el-tooltip>
</div>
<!-- 用户头像 -->
<div class="user-avator">
<img src="../../assets/img/img.jpg"/>
</div>
<!-- 用户名下拉菜单 -->
<el-dropdown class="user-name" trigger="click" @command="handleCommand">
<span class="el-dropdown-link"> {{ username }} <i class="el-icon-caret-bottom"></i></span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item disabled>修改密码</el-dropdown-item>
<el-dropdown-item command="loginout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</div>
<!-- 页面左侧二级菜单栏和主体内容区域部分 -->
<el-main>
</el-main>
</div>
</template> </template>
<script> <script>
export default { export default {
name: 'NavMenu', data(){
data () { return{
return { itemList: [ //
navList: [ { path: '/home', title: '首页' },
{name: '/index', navItem: '首页'}, { path: '/personal', title: '个人中心' },
{name: '/combatants', navItem: '作战人员'}, { path: '/overview', title: '排名总览' },
{name: '/weaponry', navItem: '武器装备'}, { path: '/result', title: '结果公示' },
{name: '/admin', navItem: '管理中心'} { path: '/permission', title: '管理员权限' },
] ],
globalTheme: false,
}
},
computed: {
username(){
return localStorage.getItem('ms_username') || '';
},
toIndex(){ //
return '/' + this.$route.path.split('/')[1];
},
},
created() {
this.globalTheme = JSON.parse(localStorage.getItem('global_theme'));
bus.$emit('global_theme', this.globalTheme); // globalTheme
},
methods: {
handleSelect(path){ //
this.$router.push({
path: path
});
},
handleCommand(command){ //
if(command == 'loginout'){
localStorage.removeItem('ms_username');
this.$router.push({
path: '/Login'
});
}
},
handleChangeStyle(){ //
this.globalTheme = !this.globalTheme;
localStorage.setItem('global_theme', this.globalTheme); // globalTheme
bus.$emit('global_theme', this.globalTheme); // globalTheme
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
a{ .wrapper {
text-decoration: none; width: 100%;
height: 100%;
background: #f0f0f0;
} }
.header {
span { position: relative;
pointer-events: none; box-sizing: border-box;
width: 100%;
height: 20px;
font-size: 22px;
}
.header .logo {
float: left;
margin-left: 50px;
margin-top: 15px;
height: 29px;
width: 220px;
vertical-align: middle;
}
/* --------------- 用户头像区域的样式 ---------------- */
.header-right {
float: right;
padding-right: 50px;
}
.header-user-con {
display: flex;
align-items: center;
justify-content: center;
height: 60px;
}
.user-avator {
margin-left: 20px;
}
.user-avator img {
display: block;
width: 40px;
height: 40px;
border-radius: 50%;
}
.user-name {
margin-left: 10px;
}
.el-dropdown-link {
cursor: pointer;
}
.el-dropdown-menu__item {
text-align: center;
}
/* --------------- 水平一级菜单栏的样式--------------------- */
.el-menu.el-menu--horizontal {
border-bottom: none !important;
float: left;
margin-left: 50px;
background: transparent;
}
.el-menu--horizontal > .el-menu-item.is-active {
/* border-bottom: 2px solid #3989fa;
color: #3989fa; */
font-weight: bold;
}
.el-menu--horizontal > .el-menu-item {
font-size: 16px;
margin: 0 15px;
} }
</style> </style>

@ -0,0 +1,78 @@
<template>
<!-- 左侧二级菜单栏的组件封装 -->
<div class="sidebar">
<el-menu
class="sidebar-el-menu"
:default-active="toIndex"
background-color="#fff"
text-color="#000000"
router>
<el-menu-item v-for="(item, index) in itemList" :key="index" :index="item.path">
<!-- 需要图标的在 item 对象中加上属性 icon -->
<!-- <i :class="item.icon"></i> -->
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</el-menu>
</div>
</template>
<script>
export default {
props: {
itemList: {
type: Array,
default: () => []
}
},
data(){
return {
}
},
computed: {
toIndex(){ //
return this.$route.path.split('/')[2];
}
},
methods:{
},
}
</script>
<style lang="scss" scoped>
/* 左侧菜单栏定位和位置大小设定 */
.sidebar {
display: block;
position: absolute;
left: 0;
top: 60px;
bottom: 0;
overflow-y: scroll;
}
.sidebar::-webkit-scrollbar {
width: 0;
}
.sidebar-el-menu {
width: 160px;
}
.sidebar > ul {
height: 100%;
}
/* 左侧二级菜单项的样式 */
.el-menu-item{
font-size: 14px !important;
padding-left: 15px !important;
}
/* 左侧二级菜单选中时的样式 */
.el-menu-item.is-active {
color: white !important;
background: #3989fa !important;
}
.el-menu-item, .el-submenu__title {
height: 50px !important;
line-height: 50px !important;
}
</style>

@ -1,6 +1,18 @@
<template> <template>
<div> <!-- 左侧二级菜单栏的组件封装 -->
Hello World! <div class="sidebar">
<el-menu
class="sidebar-el-menu"
:default-active="toIndex"
background-color="#fff"
text-color="#000000"
router>
<el-menu-item v-for="(item, index) in itemList" :key="index" :index="item.path">
<!-- 需要图标的在 item 对象中加上属性 icon -->
<!-- <i :class="item.icon"></i> -->
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</el-menu>
</div> </div>
</template> </template>

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "Horizontal"
}
</script>
<style scoped>
</style>

@ -0,0 +1,33 @@
<template>
<div>
<!-- 一级菜单下面所拥有的二级菜单 -->
<el-aside>
<SideMenu :itemList='itemList'></SideMenu>
</el-aside>
<!-- 以及二级菜单所对应的页面 -->
<el-main>
<router-view></router-view>
</el-main>
</div>
</template>
<script>
import SideMenu from '../../common/SideMenu';
export default {
components: {
SideMenu
},
data(){
return{
itemList: [
{ path: 'unit', title: '队内排名' },
{ path: 'profession', title: '专业排名' },
{ path: 'horizontal', title: '横向对比' },
{ path: 'vertical', title: '纵向对比' },
]
}
}
}
</script>

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "Profession"
}
</script>
<style scoped>
</style>

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "Unit"
}
</script>
<style scoped>
</style>

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "Vertical"
}
</script>
<style scoped>
</style>

@ -0,0 +1,30 @@
<template>
<div>
<!-- 一级菜单下面所拥有的二级菜单 -->
<el-aside>
<SideMenu :itemList='itemList'></SideMenu>
</el-aside>
<!-- 以及二级菜单所对应的页面 -->
<el-main>
<router-view></router-view>
</el-main>
</div>
</template>
<script>
import SideMenu from '../../common/SideMenu';
export default {
components: {
SideMenu
},
data(){
return{
itemList: [
{ path: 'intake', title: '数据导入' },
]
}
}
}
</script>

@ -0,0 +1,114 @@
<template>
<div style="margin-left: 160px">
<div class="buttonBox">
<el-upload
action=""
accept=".xlsx, .xls"
:auto-upload="false"
:show-file-list="false"
:on-change="handle"
>
<el-button type="primary" slot="trigger">选取EXCEL文件</el-button>
<el-button type="danger" @click="postDatatoServer"></el-button>
</el-upload>
</div>
<el-table :data="tableData" border style="width: 100%">
<el-table-column prop="username" label="姓名" width="160" align="center"></el-table-column>
<el-table-column prop="parentclass" label="大类" width="200" align="center"></el-table-column>
<el-table-column prop="childclass" label="小类" width="160" align="center"></el-table-column>
<el-table-column prop="subpoint" label="小点" width="140" align="center"></el-table-column>
<el-table-column prop="scoringelement" label="依据" align="center"></el-table-column>
<el-table-column prop="awardtime" label="时间" width="160" align="center"></el-table-column>
<el-table-column prop="score" label="得分" width="140" align="center"></el-table-column>
</el-table>
</div>
</template>
<script>
import * as xlsx from 'xlsx'
import { readFile } from '../../../utils/xlsx'
let postData = null
export default {
name: "IntakeData",
data() {
return {
tableData: [],
}
},
mounted() {
},
methods: {
async handle(ev) {
let file = ev.raw;
if (!file) return;
let data = await readFile(file);
let workbook = xlsx.read(data, {type:"binary"}),
worksheet = workbook.Sheets[workbook.SheetNames[0]];
data = xlsx.utils.sheet_to_json(worksheet);
/**
* 修改 Json key
*/
data = JSON.parse(JSON.stringify(data).replace(/姓名/g, 'username'));
data = JSON.parse(JSON.stringify(data).replace(/小类合计/g, 'childscore'));
data = JSON.parse(JSON.stringify(data).replace(/大类合计/g, 'parentscore'));
data = JSON.parse(JSON.stringify(data).replace(/大类/g, 'parentclass'));
data = JSON.parse(JSON.stringify(data).replace(/小类/g, 'childclass'));
data = JSON.parse(JSON.stringify(data).replace(/小点/g, 'subpoint'));
data = JSON.parse(JSON.stringify(data).replace(/依据/g, 'scoringelement'));
data = JSON.parse(JSON.stringify(data).replace(/时间/g, 'awardtime'));
data = JSON.parse(JSON.stringify(data).replace(/得分/g, 'score'));
/**
* 展示 Excel 内容
*/
this.tableData = data;
/**
* 修改 Json 中部分 value 值以适配服务端
*/
/*
data = JSON.parse(JSON.stringify(data).replace(/课程考核成绩/g, '1'));
data = JSON.parse(JSON.stringify(data).replace(/平时综合表现/g, '2'));
data = JSON.parse(JSON.stringify(data).replace(/毕业联考成绩/g, '3'));
data = JSON.parse(JSON.stringify(data).replace(/思想政治/g, '21'));
data = JSON.parse(JSON.stringify(data).replace(/军人气质/g, '22'));
data = JSON.parse(JSON.stringify(data).replace(/领导管理起评分/g, '230'));
data = JSON.parse(JSON.stringify(data).replace(/担任骨干/g, '231'));
data = JSON.parse(JSON.stringify(data).replace(/组织活动/g, '232'));
data = JSON.parse(JSON.stringify(data).replace(/扣分项/g, '233'));
data = JSON.parse(JSON.stringify(data).replace(/领导管理/g, '23'));
data = JSON.parse(JSON.stringify(data).replace(/团队意识起评分/g, '240'));
data = JSON.parse(JSON.stringify(data).replace(/参加集体活动/g, '241'));
data = JSON.parse(JSON.stringify(data).replace(/团队意识/g, '24'));
data = JSON.parse(JSON.stringify(data).replace(/学科竞赛/g, '251'));
data = JSON.parse(JSON.stringify(data).replace(/发表文章/g, '252'));
data = JSON.parse(JSON.stringify(data).replace(/科技成果/g, '253'));
data = JSON.parse(JSON.stringify(data).replace(/文体特长/g, '254'));
data = JSON.parse(JSON.stringify(data).replace(/实践创新/g, '25'));
data = JSON.parse(JSON.stringify(data).replace(/表彰奖励/g, '26'));
data = JSON.parse(JSON.stringify(data).replace(/作风纪律/g, '27'));
*/
postData = JSON.stringify(data)
console.log(postData)
},
postDatatoServer() {
this.$axios
.post('permission', {
postData
})
.then(response => {
if (response !== null){
console.log("success")
}
})
}
},
}
</script>
<style scoped>
</style>

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "Analysis"
}
</script>
<style scoped>
</style>

@ -0,0 +1,34 @@
<template>
<div>
<!-- 一级菜单下面所拥有的二级菜单 -->
<el-aside>
<SideMenu :itemList='itemList'></SideMenu>
</el-aside>
<!-- 以及二级菜单所对应的页面-->
<el-main>
<router-view></router-view>
</el-main>
</div>
</template>
<script>
import SideMenu from '../../common/SideMenu';
export default {
components: {
SideMenu
},
data(){
return{
itemList: [
{ path: 'information', title: '个人信息' },
{ path: 'statistics', title: '得分统计' },
{ path: 'analysis', title: '数据分析' },
{ path: 'rules', title: '评定细则' },
]
}
}
}
</script>

@ -0,0 +1,48 @@
<template>
<div style="margin-left: 160px">
<div style="width:14%;height: 130px;border-radius: 100px;display:inline-block;">
<img
style="width:100%;height: 100%;border-radius: 100px"
src="/static/temporary/headpic.jpg"
class="image"
>
</div>
<br>
<br>
<el-descriptions :column="3" data="data" border>
<el-descriptions-item label='姓名' labelStyle="width: 90px" contentStyle="width: 250px" v-model="name" >{{name}}</el-descriptions-item>
<el-descriptions-item label="性别" labelStyle="width: 90px" contentStyle="width: 250px" v-model="email" ></el-descriptions-item>
<el-descriptions-item label="民族" labelStyle="width: 90px" contentStyle="width: 250px" v-model="level" ></el-descriptions-item>
<el-descriptions-item label="出生年月" labelStyle="width: 90px" contentStyle="width: 250px" v-model="motto" ></el-descriptions-item>
<el-descriptions-item label="籍贯" labelStyle="width: 90px" contentStyle="width: 250px" v-model="city" ></el-descriptions-item>
<el-descriptions-item label="政治面貌" labelStyle="width: 90px" contentStyle="width: 250px" v-model="city" ></el-descriptions-item>
<el-descriptions-item label="年级" labelStyle="width: 90px" contentStyle="width: 250px" v-model="nj"></el-descriptions-item>
<el-descriptions-item label="专业" labelStyle="width: 90px" contentStyle="width: 250px" v-model="nj"></el-descriptions-item>
<el-descriptions-item label="邮箱" labelStyle="width: 90px" contentStyle="width: 250px" v-model="yx"></el-descriptions-item>
<el-descriptions-item label="个性签名" labelStyle="width: 90px" contentStyle="width: 250px" v-model="yx"></el-descriptions-item>
</el-descriptions>
</div>
</template>
<script>
import SideMenu from "../../common/SideMenu";
export default {
name: "Information",
components: {
SideMenu
},
data(){
return{
}
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,23 @@
<template>
<el-descriptions title="用户信息">
<el-descriptions-item label="用户名">kooriookami</el-descriptions-item>
<el-descriptions-item label="手机号">18100000000</el-descriptions-item>
<el-descriptions-item label="居住地">苏州市</el-descriptions-item>
<el-descriptions-item label="备注">
<el-tag size="small">学校</el-tag>
</el-descriptions-item>
<el-descriptions-item label="联系地址"
>江苏省苏州市吴中区吴中大道 1188 </el-descriptions-item
>
</el-descriptions>
</template>
<script>
export default {
name: "Rules"
}
</script>
<style scoped>
</style>

@ -0,0 +1,132 @@
<template>
<div style="margin-left: 160px">
<el-table :data="tableData" :span-method="objectSpanMethod" border style="width: 100%">
<el-table-column prop="parentclass" label="大类" width="180" align="center"></el-table-column>
<el-table-column prop="childclass" label="小类" width="140" align="center"></el-table-column>
<el-table-column prop="subpoint" label="小点" width="140" align="center"></el-table-column>
<el-table-column prop="scoringelement" label="依据" align="center"></el-table-column>
<el-table-column prop="awardtime" label="时间" width="160" align="center"></el-table-column>
<el-table-column prop="score" label="得分" width="100" align="center"></el-table-column>
<el-table-column prop="childscore" label="小类合计" width="100" align="center"></el-table-column>
<el-table-column prop="parentscore" label="大类合计" width="100" align="center"></el-table-column>
</el-table>
</div>
</template>
<script>
import store from '../../../store'
let Datas = []
let pcArr = []
let ccArr = []
let subArr = []
let pos = 0
export default {
name: "Statistics",
data() {
return {
tableData: [],
responseResult: []
}
},
mounted() {
this.getData();
this.getMergeLists()
},
methods: {
getData() {
this.$axios
.post('/personal/statistics', {
username: store.state.user.username
})
.then(response => {
if (response !== null){
this.responseResult = response.data
console.log(JSON.parse(JSON.stringify(this.responseResult)))
this.responseResult = JSON.parse(JSON.stringify(this.responseResult))
this.tableData = this.responseResult
Datas = this.responseResult
}
})
},
getMergeLists() {
pcArr = []; pos = 0;
for(let i = 0; i < Datas.length; i++) {
if (i === 0) {
pcArr.push(1);
} else {
if (Datas.at(i).parentclass === Datas.at(i - 1).parentclass) {
pcArr[pos] += 1;
pcArr.push(0);
} else {
pcArr.push(1);
pos = i;
}
}
}
console.log(pcArr)
ccArr = []; pos = 0;
for(let i = 0; i < Datas.length; i++) {
if (i === 0) {
ccArr.push(1);
} else {
if (Datas.at(i).childclass === Datas.at(i - 1).childclass) {
ccArr[pos] += 1;
ccArr.push(0);
} else {
ccArr.push(1);
pos = i;
}
}
}
console.log(ccArr)
subArr = []; pos = 0;
for(let i = 0; i < Datas.length; i++) {
if (i === 0) {
subArr.push(1);
} else {
if (Datas.at(i).subpoint === Datas.at(i - 1).subpoint) {
subArr[pos] += 1;
subArr.push(0);
} else {
subArr.push(1);
pos = i;
}
}
}
console.log(subArr)
},
objectSpanMethod({ row, column, rowIndex, columnIndex }){
if ( columnIndex === 0 || columnIndex === 7) {
const _row = pcArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col,
}
}
if ( columnIndex === 1 || columnIndex === 6) {
const _row = ccArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col,
}
}
if ( columnIndex === 2) {
const _row = subArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col,
}
}
}
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "Advice"
}
</script>
<style scoped>
</style>

@ -0,0 +1,31 @@
<template>
<div>
<!-- 一级菜单下面所拥有的二级菜单 -->
<el-aside>
<SideMenu :itemList='itemList'></SideMenu>
</el-aside>
<!-- 以及二级菜单所对应的页面 -->
<el-main>
<router-view></router-view>
</el-main>
</div>
</template>
<script>
import SideMenu from '../../common/SideMenu';
export default {
components: {
SideMenu
},
data(){
return{
itemList: [
{ path: 'rank', title: '评定结果' },
{ path: 'advice', title: '意见反馈' },
]
}
}
}
</script>

@ -0,0 +1,11 @@
<script>
export default {
name: "Rank"
}
</script>
<style scoped>
</style>

@ -4,7 +4,6 @@ import Router from 'vue-router'
import AppIndex from '../components/home/AppIndex' import AppIndex from '../components/home/AppIndex'
import Login from '../components/Login' import Login from '../components/Login'
import Home from "../components/Home" import Home from "../components/Home"
import CombatantsIndex from "../components/combatants/CombatantsIndex";
Vue.use(Router) Vue.use(Router)
@ -26,24 +25,100 @@ export default new Router({
path: '/home', path: '/home',
name: 'Home', name: 'Home',
component: Home, component: Home,
redirect: '/index',
children: [ children: [
{ {
path: '/index', path: '/home',
name: 'AppIndex', name: 'AppIndex',
component: AppIndex, component: AppIndex,
meta: { meta: {
// 在需要拦截的路由中加一条元数据,设置一个 requireAuth 字段
requireAuth: true requireAuth: true
} }
}, },
{ {
path: '/combatants', path: '/personal',
name: 'Combatants', name: 'PersonalCenter',
component: CombatantsIndex, component: () => import('../components/page/personal/Index'),
meta: { meta: {
requireAuth: true requireAuth: true
},
redirect: '/personal/information',
children: [
{
path: 'information',
name: 'Information',
component: () => import('../components/page/personal/Information'),
},
{
path: 'statistics',
component: () => import('../components/page/personal/Statistics')
},
{
path: 'analysis',
component: () => import('../components/page/personal/Analysis')
},
{
path: 'rules',
component: () => import('../components/page/personal/Rules')
} }
]
},
{
path: '/overview',
name: 'OverviewData',
component: () => import('../components/page/overview/Index'),
meta: {
requireAuth: true
},
redirect: '/overview/unit',
children: [
{
path: 'unit',
component: () => import('../components/page/overview/Unit')
},
{
path: 'profession',
component: () => import('../components/page/overview/Profession')
},
{
path: 'horizontal',
component: () => import('../components/page/overview/Horizontal')
},
{
path: 'vertical',
component: () => import('../components/page/overview/Vertical')
}
]
},
{
path: '/result',
name: 'Result',
component: () => import('../components/page/result/Index'),
meta: {
requireAuth: true
},
redirect: '/result/rank',
children: [
{
path: 'rank',
component: () => import('../components/page/result/Rank')
},
{
path: 'advice',
component: () => import('../components/page/result/Advice')
}
]
},
{
path: '/permission',
name: 'Permission',
component: () => import('../components/page/permission/Index'),
redirect: '/permission/intake',
children: [
{
path: 'intake',
component: () => import('../components/page/permission/IntakeData')
}
]
} }
] ]
}, },

@ -0,0 +1,39 @@
<script>
export default {
name: "xlsx"
}
export function readFile(file){
return new Promise(resolve => {
let reader = new FileReader();
reader.readAsBinaryString(file);
reader.onload = ev => {
resolve(ev.target.result);
}
})
}
export function getMergeLists(data, key){
let Arr = [], pos = 0;
for(let i = 0; i < data.length; i++){
if (i === 0){
Arr.push(1);
} else{
if(data.at(i).key === data.at(i-1).key){
Arr[pos] += 1;
Arr.push(0);
} else{
Arr.push(1);
pos = i;
}
}
}
return Arr;
}
</script>
<style scoped>
</style>

@ -13,9 +13,15 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>2.3.7.RELEASE</spring-boot.version> <spring-boot.version>2.3.7.RELEASE</spring-boot.version>
<fastjson_version>2.0.10</fastjson_version>
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson_version}</version>
</dependency>
<dependency> <dependency>
<groupId>net.sf.json-lib</groupId> <groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId> <artifactId>json-lib</artifactId>

@ -34,9 +34,9 @@ public class ConnectDB {
try try
{ {
//根据实际情况变化 //根据实际情况变化
String dbUrl = "jdbc:mysql://localhost:3306/aircraft"; String dbUrl = "jdbc:mysql://localhost:3306/iams?serverTimezone=GMT";
String dbUser = "JackyMa"; String dbUser = "root";
String dbPass = "`1"; String dbPass = "root";
conn = DriverManager.getConnection(dbUrl, dbUser, dbPass);//注意是三个参数 conn = DriverManager.getConnection(dbUrl, dbUser, dbPass);//注意是三个参数
} }
catch (SQLException e) catch (SQLException e)
@ -50,11 +50,11 @@ public class ConnectDB {
public String loginSystem(String loginname) public String loginSystem(String loginname)
{ {
String sql = "select * from aircraft.user where username = ?"; String sql = "select * from iams.user where username = ?";
String username = ""; String username = "";
String password = ""; String password = "";
System.out.println(loginname);
try try
{ {
preparedStatement = conn.prepareStatement(sql); preparedStatement = conn.prepareStatement(sql);

@ -46,7 +46,7 @@ public class LoginController {
ConnectDB connectDB = new ConnectDB(); ConnectDB connectDB = new ConnectDB();
String pwd = connectDB.loginSystem(username); String pwd = connectDB.loginSystem(username);
System.out.println(pwd);
if (!pwd.equals(password)) { if (!pwd.equals(password)) {
String message = "账号密码错误"; String message = "账号密码错误";
System.out.println(message); System.out.println(message);

@ -46,7 +46,7 @@ public class LoginInterceptor implements HandlerInterceptor {
String page = uri; String page = uri;
if(begingWith(page, requireAuthPages)){ if(begingWith(page, requireAuthPages)){
String username = (String) session.getAttribute("user"); String username = (String) session.getAttribute("user");
System.out.println(username);
if(username==null) { if(username==null) {
httpServletResponse.sendRedirect("login"); httpServletResponse.sendRedirect("login");
return false; return false;

@ -12,19 +12,11 @@ public class User {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
int id;
String username; String username;
String password; String password;
int usertype;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUsername() { public String getUsername() {
return username; return username;
} }

@ -0,0 +1,26 @@
package com.example.demo.page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@CrossOrigin
@ResponseBody
public class UserData {
@Autowired
JdbcTemplate jdbcTemplate = new JdbcTemplate();
@PostMapping(value = "/personal/statistics")
public List<Map<String, Object>> getData(@RequestBody Map<String,Object> data){
System.out.println(data);
String name = (String) data.get("username");
System.out.println(name);
String sql = "select * from userscoreinfo where username = ?";
return jdbcTemplate.queryForList(sql, name);
}
}

@ -0,0 +1,89 @@
package com.example.demo.page.data;
public class DataNode {
/**
* 55.25%
*/
public static final int CourseAssessmentGrades = 1;
/**
* 29.75%
*/
public static final int ComprehensivePerformance = 2;
/**
* 15%
*/
public static final int GraduationJJTResults = 3;
/**
* 10
*/
public static final int Politics = 21;
/**
* 10
*/
public static final int Temperament = 22;
/**
* 20
*/
public static final int Leadership = 23;
/**
* 5
*/
public static final int LeadershipStartScore = 230;
/**
* 12
*/
public static final int LeadershipBackbone = 231;
/**
* 3
*/
public static final int LeadershipOrganization = 232;
/**
* 2
*/
public static final int LeadershipDeductScore = 233;
/**
* 10
*/
public static final int Teamwork = 24;
/**
* 3
*/
public static final int TeamworkStartScore = 240;
/**
* 7
*/
public static final int TeamworkJoinGroupActivities = 241;
/**
* 20
*/
public static final int Innovation = 25;
/**
* 10
*/
public static final int InnovationContest = 251;
/**
* 10
*/
public static final int InnovationArticles = 252;
/**
* 10
*/
public static final int InnovationAchievement = 253;
/**
* 10
*/
public static final int InnovationSpecialty = 254;
/**
* 20
*/
public static final int Award = 26;
/**
* 10
*/
public static final int Discipline = 27;
}

@ -0,0 +1,37 @@
package com.example.demo.page.data;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@CrossOrigin
@ResponseBody
public class ImportData {
@Autowired
JdbcTemplate jdbcTemplate = new JdbcTemplate();
@PostMapping(value = "/permission")
public List<Map<String, Object>> getData(@RequestBody Map<String,Object> postData){
JSONArray Datas = JSONArray.parseArray(postData.get("postData").toString());
for ( int i = 0; i< Datas.size(); i++){
JSONObject data = Datas.getJSONObject(i);
System.out.println(data);
String sql = "insert into userscoreinfo (username,parentclass,childclass,subpoint,scoringelement," +
"awardtime,score) values (?,?,?,?,?,?,?)";
jdbcTemplate.update(sql, data.get("username"), data.get("parentclass"), data.get("childclass"),
data.get("subpoint"), data.get("scoringelement"), data.get("awardtime"), data.get("score"));
}
return null;
}
}

@ -1,10 +1,10 @@
spring: spring:
datasource: datasource:
url: 'jdbc:mysql://localhost:3306/aircraft?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true' url: 'jdbc:mysql://localhost:3306/iams?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&allowMultiQueries=true'
#为了防止中文乱码在URL中默认添加了?useUnicode=true&characterEncoding=UTF-8来使用UTF8编码 #为了防止中文乱码在URL中默认添加了?useUnicode=true&characterEncoding=UTF-8来使用UTF8编码
#&allowMultiQueries=true表示支持批量更新因为我的电脑时区紊乱无法启动项目因此需要加&serverTimezone=GMT%2B8 #&allowMultiQueries=true表示支持批量更新因为我的电脑时区紊乱无法启动项目因此需要加&serverTimezone=GMT%2B8
username: 'JackyMa' username: 'root'
password: '`1' password: 'root'
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
jpa: jpa:
hibernate: hibernate:

Loading…
Cancel
Save