master
parent
19effcafb9
commit
1e9108f417
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 97 KiB |
@ -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>
|
||||
|
@ -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>
|
@ -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>
|
@ -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,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;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue