diff --git a/cockpit/charts.js b/cockpit/charts.js
deleted file mode 100644
index 5084897..0000000
--- a/cockpit/charts.js
+++ /dev/null
@@ -1,363 +0,0 @@
-$(document).ready(function(){
- function loadFilesystemInfo(){
- $("#filesystemchart").removeAttr("_echarts_instance_");
- var myChart = echarts.init(document.getElementById("filesystemchart"), "dark");
- $.get('getFileSystemUsageAction', function (data) {
- data = data.data;
- if(typeof data.data == "string"){
- data = window.eval("("+data.data+")");
- }
- var source1 = ['product'];
- var source2 = ['未使用(GB)'];
- var source3 = ['已使用(GB)'];
- var seriesS = [];
- var left = 21, top = 30;
- for(var m = 0; m < data.length; m++){
- var fser = data[m];
- source1.push(fser.devName);
- source2.push(fser.Free);
- source3.push(fser.Used);
- seriesS.push({
- name: fser.devName,
- type: 'pie',
- radius: 20,
- center: [left+'%', top+'%'],
- encode: {
- itemName: 'product',
- value: fser.devName
- }
- });
- if(m!=0 && m % 2 == 0){
- left = 21;
- }else{
- left += 30;
- }
- if(m!=0 && m % 2 == 0){
- top += 45;
- }
- }
- myChart.setOption({
- backgroundColor:"",
- color: ['#009688','#1E9FFF'],
- legend: {},
- tooltip: {},
- dataset: {
- source: [source1,source2,source3]
- },
- series: seriesS
- });
- delete data;
- setTimeout(loadFilesystemInfo, 60 * 60 * 1000);
- });
- }
- loadFilesystemInfo();
- function loadserverNetInfo(){
- $("#netInfochart").removeAttr("_echarts_instance_");
- var myChart = echarts.init(document.getElementById("netInfochart"), "dark");
- var netoption = {
- backgroundColor:"",
- color: ['#2acff9'],
- title: {
- textStyle: {
- fontWeight: 'normal',
- color: '#666'
- },
- x: 'center',
- text: '',
- subtext: '收发数据包'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: {
- type: 'value',
- boundaryGap: [0, 0.01]
- },
- yAxis: {
- type: 'category',
- data: ['接收','发送']
- },
- series: [
- {
- name: '总字包数',
- type: 'bar',
- data: [0, 0]
- }
- ]
- };
- myChart.setOption(netoption);
- $.get('getNetInterfaceStatAction', function (data) {
- data = data.data;
- if(typeof data.data == "string"){
- data = window.eval("("+data.data+")");
- }
- myChart.setOption({
- series: [{
- data: [data.rxPackets,data.txPackets]
- }]
- });
- delete data;
- setTimeout(loadserverNetInfo, 60 * 1000);
- });
- }
- loadserverNetInfo();
- var cpuUpxChart,cpuLineChart,memLineChart;
- var cpudata = {x:[],y:[]}, memdata = {x:[],y:[]};
- function initCPUMemCharts(){
- $("#CPUuxpInfochart").removeAttr("_echarts_instance_");
- cpuUpxChart = echarts.init(document.getElementById("CPUuxpInfochart"), "dark");
- $("#CPUlineInfochart").removeAttr("_echarts_instance_");
- cpuLineChart = echarts.init(document.getElementById("CPUlineInfochart"), "dark");
- $("#MemlineInfochart").removeAttr("_echarts_instance_");
- memLineChart = echarts.init(document.getElementById("MemlineInfochart"), "dark");
- }
- initCPUMemCharts();
- function refreshMonitorInfo(){
- var cpuusxp,memusxp;
- $.ajax({
- type : "post",
- async : false,
- url : "getCPUPercAction",
- success : function(data, textStatus) {
- try {
- if (data.data) {
- data = window["eval"]("(" + data.data.data + ")");
- } else {
- data = {};
- }
- var usedpex = data.usedpex||0;
- var now = new Date();
- if(cpudata.x.length>60){
- cpudata.x.shift();
- cpudata.y.shift();
- }
- cpudata.x.push(now.getMinutes()+"′"+now.getSeconds()+"″");
- cpudata.y.push(usedpex);
- cpuLineChart.setOption({
- backgroundColor:"",
- color: ['#1E9FFF'],
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- animation: false
- }
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: cpudata.x
- },
- yAxis: {
- type: 'value',
- boundaryGap: [0, '100%'],
- splitLine: {
- show: false
- }
- },
- series: [{
- data: cpudata.y,
- type: 'line',
- smooth: true,
- showSymbol: false,
- hoverAnimation: true,
- areaStyle: {}
- }]
- });
- cpuusxp = usedpex;
- } catch (e) {
- }
- delete data;
- }
- });
- $.ajax({
- type : "post",
- async : false,
- url : "getMemoryInfoAction",
- success : function(data, textStatus) {
- try {
- if (data.data) {
- data = window["eval"]("(" + data.data.data + ")");
- } else {
- data = {};
- }
- var usedpex = data.usedpex||0;
- var now = new Date();
- if(memdata.x.length>10){
- memdata.x.shift();
- memdata.y.shift();
- }
- memdata.x.push(now.getMinutes()+"′"+now.getSeconds()+"″");
- memdata.y.push(usedpex);
- memLineChart.setOption({
- backgroundColor:"",
- color: ['#009688'],
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- animation: false
- }
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: memdata.x
- },
- yAxis: {
- type: 'value',
- boundaryGap: [0, '100%'],
- splitLine: {
- show: false
- }
- },
- series: [{
- data: memdata.y,
- type: 'line',
- smooth: true,
- showSymbol: false,
- hoverAnimation: true,
- areaStyle: {}
- }]
- });
- memusxp = usedpex;
- } catch (e) {
- }
- delete data;
- }
- });
- cpuUpxChart.setOption({
- backgroundColor:"",
- tooltip : {
- formatter: "{a}
{b} : {c}%"
- },
- series: [
- {
- name: '当前使用率',
- type: 'gauge',
- center : ['50%', '35%'], // 默认全局居中
- radius: '50%',
- axisLine: { // 坐标轴线
- lineStyle: { // 属性lineStyle控制线条样式
- color: [[0.09, 'lime'],[0.82, '#1e90ff'],[1, '#ff4500']],
- width: 3,
- shadowColor : '#fff', //默认透明
- shadowBlur: 10
- }
- },
- axisLabel: { // 坐标轴小标记
- textStyle: { // 属性lineStyle控制线条样式
- fontWeight: 'bolder',
- color: '#fff',
- shadowColor : '#fff', //默认透明
- shadowBlur: 10
- }
- },
- axisTick: { // 坐标轴小标记
- length :15, // 属性length控制线长
- lineStyle: { // 属性lineStyle控制线条样式
- color: 'auto',
- shadowColor : '#fff', //默认透明
- shadowBlur: 10
- }
- },
- splitLine: { // 分隔线
- length :25, // 属性length控制线长
- lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
- width:3,
- color: '#fff',
- shadowColor : '#fff', //默认透明
- shadowBlur: 10
- }
- },
- pointer: { // 分隔线
- shadowColor : '#fff', //默认透明
- shadowBlur: 5
- },
- title : {
- textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- fontWeight: 'bolder',
- fontSize: 20,
- fontStyle: 'italic',
- color: '#fff',
- shadowColor : '#fff', //默认透明
- shadowBlur: 10
- }
- },
- detail: {formatter:'{value}%'},
- data: [{value: cpuusxp, name: 'CPU使用率'}]
- },
- {
- name:'当前使用率',
- type:'gauge',
- center : ['50%', '75%'], // 默认全局居中
- radius : '40%',
- axisLine: { // 坐标轴线
- lineStyle: { // 属性lineStyle控制线条样式
- color: [[0.29, 'lime'],[0.86, '#1e90ff'],[1, '#ff4500']],
- width: 2,
- shadowColor : '#fff', //默认透明
- shadowBlur: 10
- }
- },
- axisLabel: { // 坐标轴小标记
- textStyle: { // 属性lineStyle控制线条样式
- fontWeight: 'bolder',
- color: '#fff',
- shadowColor : '#fff', //默认透明
- shadowBlur: 10
- }
- },
- axisTick: { // 坐标轴小标记
- length :12, // 属性length控制线长
- lineStyle: { // 属性lineStyle控制线条样式
- color: 'auto',
- shadowColor : '#fff', //默认透明
- shadowBlur: 10
- }
- },
- splitLine: { // 分隔线
- length :20, // 属性length控制线长
- lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式
- width:3,
- color: '#fff',
- shadowColor : '#fff', //默认透明
- shadowBlur: 10
- }
- },
- pointer: {
- width:5,
- shadowColor : '#fff', //默认透明
- shadowBlur: 5
- },
- title : {
- offsetCenter: [0, '-30%'], // x, y,单位px
- textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- fontWeight: 'bolder',
- fontStyle: 'italic',
- color: '#fff',
- shadowColor : '#fff', //默认透明
- shadowBlur: 10
- }
- },
- detail: {formatter:'{value}%'},
- data:[{value: memusxp, name: '内存使用率'}]
- }
- ]
- });
- setTimeout(refreshMonitorInfo,1000);
- }
- refreshMonitorInfo();
- $(window).resize(function(){
- loadFilesystemInfo();
- loadserverNetInfo();
- initCPUMemCharts();
- });
-});
\ No newline at end of file
diff --git a/cockpit/show.html b/cockpit/show.html
deleted file mode 100644
index f0966bd..0000000
--- a/cockpit/show.html
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
- 监控舱
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/cockpit/show.js b/cockpit/show.js
deleted file mode 100644
index e8aa00e..0000000
--- a/cockpit/show.js
+++ /dev/null
@@ -1,55 +0,0 @@
-var togofullScreen = function(othis) {
- var SCREEN_FULL = 'layui-icon-screen-full', SCREEN_REST = 'layui-icon-screen-restore', iconElem = $(
- othis).children("i");
-
- if (iconElem.hasClass(SCREEN_FULL)) {
- fullScreen();
- iconElem.addClass(SCREEN_REST).removeClass(SCREEN_FULL);
- } else {
- exitScreen();
- iconElem.addClass(SCREEN_FULL).removeClass(SCREEN_REST);
- }
-};
-function fullScreen() {
- var ele = document.documentElement, reqFullScreen = ele.requestFullScreen
- || ele.webkitRequestFullScreen || ele.mozRequestFullScreen
- || ele.msRequestFullscreen;
- if (typeof reqFullScreen !== 'undefined' && reqFullScreen) {
- reqFullScreen.call(ele);
- }
- ;
-}
-function exitScreen() {
- var ele = document.documentElement
- if (document.exitFullscreen) {
- document.exitFullscreen();
- } else if (document.mozCancelFullScreen) {
- document.mozCancelFullScreen();
- } else if (document.webkitCancelFullScreen) {
- document.webkitCancelFullScreen();
- } else if (document.msExitFullscreen) {
- document.msExitFullscreen();
- }
-}
-$(document).ready(function() {
- $("#top").bind("mouseout", function() {
- $("#screenbar").hide();
- });
- $("#top").bind("mouseover", function() {
- $("#screenbar").show();
- });
- $("#screenbar").hide();
- $("iframe").each(function() {
- var win = this.contentWindow;
- $(win.document).css("overflow", "hidden");
- });
- $(window).resize(function() {
- var tpcenter = $(".top-center");
- var lheight = tpcenter.parent().height();
- tpcenter.css("line-height", lheight + "px");
- tpcenter.css("font-size", (lheight * 36 / 60) + "px");
- $(".p15").each(function() {
- $(this).css("font-size", ($(this).height() * 15 / 46) + "px");
- });
- });
-});
\ No newline at end of file
diff --git a/config/index.js b/config/index.js
index 542ca57..7c8d836 100644
--- a/config/index.js
+++ b/config/index.js
@@ -12,7 +12,7 @@ module.exports = {
assetsPublicPath: '/',
proxyTable: {
'/api': {
- target: 'http://10.10.18.131:7007',
+ target: 'http://127.0.0.1:7007',
pathRewrite: {
'^/api': '/api'
}
diff --git a/home/TrafficMonitoring.echt b/home/TrafficMonitoring.echt
deleted file mode 100644
index 30395e5..0000000
--- a/home/TrafficMonitoring.echt
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
- {
- title: {
- textStyle: {
- fontWeight: 'normal',
- color: '#666'
- },
- x: 'center',
- text: '服务器网络信息',
- subtext: '收发数据包'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: {
- type: 'value',
- boundaryGap: [0, 0.01]
- },
- yAxis: {
- type: 'category',
- data: ['接收','发送']
- },
- series: [
- {
- name: '总字包数',
- type: 'bar',
- data: [0, 0]
- }
- ]
- }
-
-
-
\ No newline at end of file
diff --git a/home/console.html b/home/console.html
deleted file mode 100644
index 4df89a9..0000000
--- a/home/console.html
+++ /dev/null
@@ -1,192 +0,0 @@
-
-
-
-
- layuiAdmin 控制台主页一
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/home/console.js b/home/console.js
deleted file mode 100644
index d8aee77..0000000
--- a/home/console.js
+++ /dev/null
@@ -1,126 +0,0 @@
-//待办事项
-function loadTopTip() {
- $.ajax({
- type : "post",
- async : true,
- url : "getWaitTaskAction",//待办任务
- success : function(result, textStatus) {
- if (result.count) {
- $("#taskCount").text(result.count);
- }
- delete result;
- },
- error : function() {
- // 请求出错处理
- }
- });
- $.ajax({
- type : "post",
- async : true,
- url : "getPortalNotesAction",//通知
- success : function(result, textStatus) {
- var news = result.data;
- if (typeof news.data == "string") {
- news.data = window.eval("(" + news.data + ")");
- }
- $("#notesCount").text(news.data.length);
- delete news;
- delete result;
- },
- error : function() {
- // 请求出错处理
- }
- });
- $.ajax({
- type : "post",
- async : true,
- url : "loadNewsAction",//新闻
- success : function(result, textStatus) {
- var news = result.data;
- if (typeof news.data == "string") {
- news.data = window.eval("(" + news.data + ")");
- }
- $("#newsCount").text(news.data.length);
- delete news;
- delete result;
- },
- error : function() {
- // 请求出错处理
- }
- });
- $.ajax({
- type : "post",
- async : true,
- url : "getPortalBofoAction",//发帖
- success : function(result, textStatus) {
- var news = result.data;
- if (typeof news.data == "string") {
- news.data = window.eval("(" + news.data + ")");
- }
- $("#topicCount").text(news.data.length);
- delete news;
- delete result;
- },
- error : function() {
- // 请求出错处理
- }
- });
- setTimeout(loadTopTip, 60 * 1000);
-}
-loadTopTip();
-
-//实时监控
-function refreshMonitorInfo(){
- $.ajax({
- type : "post",
- async : true,
- url : "getCPUPercAction",
- success : function(data, textStatus) {
- try {
- if (data.data) {
- data = window["eval"]("(" + data.data.data + ")");
- } else {
- data = {};
- }
- var usedpex = data.usedpex||0;
- if(usedpex<30){
- $("#cpuprs").attr("class","layui-progress-bar");
- }else if(usedpex<80){
- $("#cpuprs").attr("class","layui-progress-bar layui-bg-blue");
- }else{
- $("#cpuprs").attr("class","layui-progress-bar layui-bg-red");
- }
- layui.element.progress("progress-cpuprs",usedpex+"%");
- } catch (e) {
- }
- delete data;
- }
- });
- $.ajax({
- type : "post",
- async : true,
- url : "getMemoryInfoAction",
- success : function(data, textStatus) {
- try {
- if (data.data) {
- data = window["eval"]("(" + data.data.data + ")");
- } else {
- data = {};
- }
- var usedpex = data.usedpex||0;
- if(usedpex<50){
- $("#memprs").attr("class","layui-progress-bar");
- }else if(usedpex<80){
- $("#memprs").attr("class","layui-progress-bar layui-bg-blue");
- }else{
- $("#memprs").attr("class","layui-progress-bar layui-bg-red");
- }
- layui.element.progress("progress-memprs",usedpex+"%");
- } catch (e) {
- }
- delete data;
- }
- });
- setTimeout(refreshMonitorInfo,1000);
-}
-refreshMonitorInfo();
\ No newline at end of file
diff --git a/home/filesystem.echt b/home/filesystem.echt
deleted file mode 100644
index c67f4a7..0000000
--- a/home/filesystem.echt
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
- {
- // 默认色板
- color: [
- '#009688','#1E9FFF','#5FB878','#FFB980','#D87A80',
- '#8d98b3','#e5cf0d','#97b552','#95706d','#dc69aa',
- '#07a2a4','#9a7fd1','#588dd5','#f5994e','#c05050',
- '#59678c','#c9ab00','#7eb00a','#6f5553','#c14089'
- ],
- title:{
- textStyle: {
- fontWeight: 'normal',
- color: '#666' // 主标题文字颜色
- },
- text: '服务器存储信息',
- x: 'left'
- },
- legend: {},
- tooltip: {},
- dataset: {
- source: [
- ['product', 'disk1', 'disk2'],
- ['未使用(GB)', 41.1, 30.4],
- ['已使用(GB)', 86.5, 92.1]
- ]
- },
- series: [{
- name: 'C:',
- type: 'pie',
- radius: 60,
- center: ['15%', '30%'],
- encode: {
- itemName: 'product',
- value: 'disk1'
- }
- }, {
- name: 'D:',
- type: 'pie',
- radius: 60,
- center: ['45%', '30%'],
- encode: {
- itemName: 'product',
- value: 'disk2'
- }
- }]
-}
-
-
-
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 5f92c17..da46e9c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -4212,7 +4212,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"aproba": {
"version": "1.2.0",
@@ -4627,7 +4628,8 @@
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -4683,6 +4685,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -4726,12 +4729,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
}
}
},
diff --git a/src/assets/css/elementUI.css b/src/assets/css/elementUI.css
index a1332a7..8272425 100644
--- a/src/assets/css/elementUI.css
+++ b/src/assets/css/elementUI.css
@@ -63,8 +63,25 @@ padding: 0;
.el-upload-dragger {
width: 100%;
}
-
+.el-table td,
+.el-table th {
+ padding: 0;
+ height: 40px;
+}
.el-tabs__item {
width: 180px;
text-align: center
+}
+
+.addMoreData {
+ margin: 20px 0;
+}
+.tooltip {
+ font-size: 18px;
+ cursor: pointer;
+ color: #409eff;
+}
+
+.addBtn {
+ margin-bottom: 20px;
}
\ No newline at end of file
diff --git a/src/assets/css/reset.css b/src/assets/css/reset.css
index d3538c4..d24d1ff 100644
--- a/src/assets/css/reset.css
+++ b/src/assets/css/reset.css
@@ -73,4 +73,9 @@ table {
}
.all-page {
height: 100%;
+}
+
+.FormType {
+ font-weight: bold;
+ color: #409eff;
}
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index 5ca3a46..8e29ab9 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,47 +1,27 @@
import Vue from 'vue'
import ElementUI from 'element-ui'
import VueRouter from 'vue-router'
-import store from './store'
import App from './App'
import router from './router'
import echarts from 'echarts'
-import axios from 'axios'
import Vuex from 'vuex'
-import './utils/Axios'
import 'element-ui/lib/theme-chalk/index.css'
import 'css/reset.css'
import 'css/table.css'
import 'css/elementUI.css'
+import './utils/Axios'
+import './router/permission'
Vue.use(VueRouter)
Vue.use(ElementUI)
Vue.use(Vuex)
Vue.prototype.$echarts = echarts
-
Vue.config.productionTip = false
-// 路由拦截器
-router.beforeEach(({meta, path}, from, next) => {
- if(!localStorage.getItem('token') && path !== '/login') {
- return next({ path: '/login' })
- } else {
- next()
- }
- // let { auth = true } = meta // 该路由是否需要登录
- // let $user = JSON.parse(sessionStorage.getItem('$user')) || {}
- // let isLogin = Boolean($user.auth) // true 用户已登录 false 用户未登录
- // if (!auth && !isLogin && path !== '/login') {
- // return next({ path: '/login' })
- // } else {
- // next()
- // }
-})
-
let vm = new Vue({
el: '#app',
router,
- store,
render: h => h(App)
})
Vue.use({vm})
diff --git a/src/router/index.js b/src/router/index.js
index 3e6c05a..ef8abcf 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -11,6 +11,11 @@ Vue.use(Router)
export default new Router({
mode: 'history',
routes: [
+ {
+ path: '/',
+ name: 'home',
+ redirect: '/admin'
+ },
{
path: '/login',
name: 'login',
diff --git a/src/router/permission.js b/src/router/permission.js
new file mode 100644
index 0000000..8768bca
--- /dev/null
+++ b/src/router/permission.js
@@ -0,0 +1,32 @@
+import router from './index'
+
+// 路由拦截器
+router.beforeEach((to, from, next) => {
+ // 未登录
+ if (!localStorage.getItem('token') && to.path !== '/login') {
+ return next({ path: '/login' })
+ }
+ if (localStorage.getItem('token') && to.path === '/login') {
+ // 登录了跳转 login
+ if (localStorage.getItem('scope') === 6) {
+ // student
+ next({ path: '/student' })
+ } else {
+ // admin
+ next({ path: '/admin' })
+ }
+ }
+ // 已登录
+ if (localStorage.getItem('token')) {
+ let scope = Number(localStorage.getItem('scope'))
+ let routePath = to.path.split('/')[1]
+ if (routePath === 'student' && scope !== 6) {
+ next({ path: '/admin' })
+ }
+ if (routePath === 'admin' && scope === 6) {
+ next({ path: '/student' })
+ }
+ }
+ // 已经登录
+ next()
+})
diff --git a/src/router/siderPath.js b/src/router/siderPath.js
index 99fb0e2..89368ab 100644
--- a/src/router/siderPath.js
+++ b/src/router/siderPath.js
@@ -12,11 +12,22 @@ export default [
component: Main,
redirect: 'charts/index',
children: [
+ {
+ path: 'index',
+ name: 'index',
+ meta: {
+ name: '学校信息统计',
+ level: 1,
+ auth: false
+ },
+ component: () => import('@/views/admin/info/index.vue')
+ },
{
path: 'index',
name: 'index',
meta: {
name: '学院信息统计',
+ level: 2,
auth: false
},
component: () => import('@/views/admin/info/index.vue')
@@ -26,6 +37,7 @@ export default [
name: 'cmajor',
meta: {
name: '专业信息统计',
+ level: 2,
auth: false
},
component: () => import('@/views/admin/info/index.vue')
@@ -35,6 +47,7 @@ export default [
name: 'cedit',
meta: {
name: '基本信息管理',
+ level: 3,
auth: false
},
component: () => import('@/views/admin/info/index.vue')
@@ -57,6 +70,7 @@ export default [
name: 'icollege',
meta: {
name: '学院信息',
+ level: 2,
auth: false
},
component: () => import('@/views/admin/info/index.vue')
@@ -66,6 +80,7 @@ export default [
name: 'imajor',
meta: {
name: '专业信息',
+ level: 2,
auth: false
},
component: () => import('@/views/admin/info/index.vue')
@@ -75,6 +90,7 @@ export default [
name: 'iclass',
meta: {
name: '班级信息',
+ level: 3,
auth: false
},
component: () => import('@/views/admin/info/index.vue')
@@ -84,6 +100,7 @@ export default [
name: 'istudents',
meta: {
name: '学生信息',
+ level: 3,
auth: false
},
component: () => import('@/views/admin/info/index.vue')
@@ -186,7 +203,7 @@ export default [
path: 'rall',
name: 'rall',
meta: {
- name: '全院综测成绩',
+ name: '学院综测成绩',
level: 2,
auth: false
},
@@ -212,6 +229,7 @@ export default [
icon: 'iconfont icon-manager',
auth: false
},
+ redirect: '/admin',
component: Main,
children: [
{
@@ -222,37 +240,37 @@ export default [
level: 1,
auth: false
},
- component: () => import('@/views/admin/info/index.vue')
+ component: () => import('@/views/admin/manager/mschool/mschool.vue')
},
{
- path: 'mcollege',
- name: 'mcollege',
+ path: 'mfaculty',
+ name: 'mfaculty',
meta: {
name: '学院管理员',
- level: 1,
+ level: 2,
auth: false
},
- component: () => import('@/views/admin/info/index.vue')
+ component: () => import('@/views/admin/manager/mfaculty/mfaculty.vue')
},
{
path: 'mclass',
name: 'mclass',
meta: {
name: '班级管理员',
- level: 1,
+ level: 3,
auth: false
},
- component: () => import('@/views/admin/info/index.vue')
+ component: () => import('@/views/admin/manager/mclass/mclass.vue')
},
{
- path: 'mevaluator',
- name: 'mevaluator',
+ path: 'mmember',
+ name: 'mmember',
meta: {
name: '审议评分小组成员',
- level: 1,
+ level: 3,
auth: false
},
- component: () => import('@/views/admin/info/index.vue')
+ component: () => import('@/views/admin/manager/mmember/mmember.vue')
},
{
path: 'msystem',
@@ -262,7 +280,7 @@ export default [
level: 1,
auth: false
},
- component: () => import('@/views/admin/info/index.vue')
+ component: () => import('@/views/admin/manager/msystem/msystem.vue')
}
]
}
@@ -290,4 +308,4 @@ export default [
// }
// return hidden
// console.log(hidden)
-// }
\ No newline at end of file
+// }
diff --git a/src/router/stuPath.js b/src/router/stuPath.js
index 4f8cb3b..21a1dfe 100644
--- a/src/router/stuPath.js
+++ b/src/router/stuPath.js
@@ -86,7 +86,7 @@ export default [
auth: false
},
component: () => import('@/views/students/evaluation/components/techinovation.vue')
- },
+ }
]
},
{
diff --git a/src/store/index.js b/src/store/index.js
deleted file mode 100644
index d1e48f3..0000000
--- a/src/store/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-import user from './user.js'
-
-Vue.use(Vuex)
-
-export default new Vuex.Store({
- modules: {
- user
- },
- strict: process.env.NODE_ENV !== 'production' // 在非生产环境下,使用严格模式
-})
diff --git a/src/store/user.js b/src/store/user.js
deleted file mode 100644
index 099fac4..0000000
--- a/src/store/user.js
+++ /dev/null
@@ -1,34 +0,0 @@
-const state = {
- user: JSON.parse(sessionStorage.getItem('$user')) || {} // 保存用户登录后的基本信息
-}
-
-const getters = {
- // 获取登录信息
- getUser: state => {
- return state.user
- }
-}
-
-const actions = {
- setUser ({ commit }, item) { commit('setUser', item) }
-}
-
-const mutations = {
- // 设置登录信息
- setUser (state, item) {
- state.user = item
- sessionStorage.setItem('$user', JSON.stringify(state.user))
- },
- // 注销登录
- clearUser (state) {
- state.user = {}
- sessionStorage.setItem('$user', JSON.stringify(state.user))
- }
-}
-
-export default {
- state,
- getters,
- actions,
- mutations
-}
diff --git a/src/utils/Axios.js b/src/utils/Axios.js
index 5501866..81d11ce 100644
--- a/src/utils/Axios.js
+++ b/src/utils/Axios.js
@@ -25,12 +25,21 @@ error => {
// 全局回复拦截
axios.interceptors.response.use(res => {
if (res.status === 200 && res.data.code === 2000) {
+ res.data.messages.forEach(element => {
+ Message({
+ showClose: true,
+ message: element,
+ type: 'success'
+ })
+ })
return res.data
} else if (res.dsata && res.data.code !== 2000) {
- Message({
- showClose: true,
- message: res.data.message,
- type: 'warning'
+ res.data.messages.forEach(element => {
+ Message({
+ showClose: true,
+ message: element,
+ type: 'warning'
+ })
})
return Promise.reject(res.data)
}
@@ -38,7 +47,6 @@ axios.interceptors.response.use(res => {
error => {
let status = error.response.status
if (status === 401) {
- localStorage.removeItem('token')
error.response.data.messages.forEach(element => {
Message({
duration: 0,
@@ -47,11 +55,11 @@ error => {
type: 'error'
})
})
- this.$router.push('/login')
+ localStorage.clear()
+ this.$router.push({ path: '/login' })
} else if (status === 404) {
- this.$router.push('/error/404')
+ this.$router.push('/error/500')
} else if (status === 500) {
- localStorage.removeItem('token')
error.response.data.messages.forEach(element => {
Message({
duration: 0,
@@ -60,14 +68,13 @@ error => {
type: 'error'
})
})
- // this.$router.push('/error/500')
+ this.$router.push('/error/500')
} else if (status === 402) {
Message({
showClose: true,
message: '已登录,请不要重复操作',
type: 'error'
})
- this.$router.push('/home')
} else {
/*
* status不在指定内容中时,将服务器端返回信息通过element-ui的错误信息提示进行提示
@@ -75,7 +82,7 @@ error => {
*/
Message({
showClose: true,
- message: error.response.data.message,
+ message: error.response.data.messages,
type: 'error'
})
}
diff --git a/src/views/admin/layout/components/aside.vue b/src/views/admin/layout/components/aside.vue
index f7e617d..e03bafd 100644
--- a/src/views/admin/layout/components/aside.vue
+++ b/src/views/admin/layout/components/aside.vue
@@ -7,9 +7,11 @@
{{items.meta.name}}
-
- {{child.meta.name}}
-
+
+
+ {{child.meta.name}}
+
+
@@ -31,31 +33,24 @@ export default {
}
},
methods: {
- getBoolean (num) {
- // num: 1 2 3
- // level 1 2 3
- // scope 1 2 3 4 5
-
- let scope = this.scope
- let hidden = null
- let level = null
- if (scope < 5) {
- if(scope == 1 || scope == 4) {
- level = 1
- } else if (scope == 2) {
- level = 2
- } else if (scope == 3) {
- level = 3
- }
- if (level > num) {
- hidden = false // 隐藏
- } else {
- hidden = true
- }
- } else {
- hidden = false
+ getBoolean (level) {
+ let scope = Number(localStorage.getItem('scope'))
+ // 学校管理员可以查看所有栏目
+ if (scope === 1) {
+ return true
+ }
+ // 学院管理员可以查看学院及一下的所有栏目
+ if (scope === 2 && level !== 1 && level !== 4 && level !== 6) {
+ return true
+ }
+ // 班级管理员只能查看班级和班级测评单元信息
+ if (scope === 3 && (level === 3 || level === 5)) {
+ return true
+ }
+ if (scope === 5 && level === 5) {
+ return true
}
- return hidden
+ return false
}
},
props: {
diff --git a/src/views/admin/layout/components/user.vue b/src/views/admin/layout/components/user.vue
index e7a9fbc..0c5aea7 100644
--- a/src/views/admin/layout/components/user.vue
+++ b/src/views/admin/layout/components/user.vue
@@ -7,7 +7,9 @@
个人信息
- 注 销
+
+ 退 出
+
@@ -22,14 +24,24 @@ export default {
},
methods: {
teaLogout () {
- this.$axios
- .post('/api/zongce/admin/loginout', {
- Authorization: this.Authorization
- })
- .then(res => {
- this.$router.push({ path: '/login' })
- })
- .catch(res => {})
+ if (localStorage.getItem('scope') && Number(localStorage.getItem('scope')) === 6) {
+ this.loginOut('/api/zongce/student/loginout')
+ } else {
+ this.loginOut('/api/zongce/admin/loginout')
+ }
+ },
+ loginOut (uri) {
+ this.$axios.post(uri)
+ .then(res => {
+ localStorage.removeItem('token')
+ localStorage.removeItem('scope')
+ this.$router.push({ path: '/login' })
+ })
+ .catch(res => {
+ localStorage.removeItem('token')
+ localStorage.removeItem('scope')
+ this.$router.push({ path: '/login' })
+ })
}
}
}
diff --git a/src/views/admin/manager/mclass/mclass.vue b/src/views/admin/manager/mclass/mclass.vue
new file mode 100644
index 0000000..40d2a33
--- /dev/null
+++ b/src/views/admin/manager/mclass/mclass.vue
@@ -0,0 +1,196 @@
+
+
+
+
+ 添加班级管理员
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查看
+ 编辑
+ 删除
+
+
+
+
+
+
+ 学校管理员
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/admin/manager/mfaculty/mfaculty.vue b/src/views/admin/manager/mfaculty/mfaculty.vue
new file mode 100644
index 0000000..587e5ef
--- /dev/null
+++ b/src/views/admin/manager/mfaculty/mfaculty.vue
@@ -0,0 +1,153 @@
+
+
+ 添加学院管理员
+
+
+
+
+
+
+
+
+
+
+
+ 查看
+ 编辑
+ 删除
+
+
+
+
+
+
+ 学校管理员
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/admin/manager/mmember/mmember.vue b/src/views/admin/manager/mmember/mmember.vue
new file mode 100644
index 0000000..9b9af24
--- /dev/null
+++ b/src/views/admin/manager/mmember/mmember.vue
@@ -0,0 +1,3 @@
+
+ 测评单元成员
+
diff --git a/src/views/admin/manager/mschool/mschool.vue b/src/views/admin/manager/mschool/mschool.vue
new file mode 100644
index 0000000..754a5b9
--- /dev/null
+++ b/src/views/admin/manager/mschool/mschool.vue
@@ -0,0 +1,153 @@
+
+
+ 添加学校管理员
+
+
+
+
+
+
+
+
+
+
+
+ 查看
+ 编辑
+ 删除
+
+
+
+
+
+
+ 学校管理员
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/admin/manager/msystem/msystem.vue b/src/views/admin/manager/msystem/msystem.vue
new file mode 100644
index 0000000..b6ee614
--- /dev/null
+++ b/src/views/admin/manager/msystem/msystem.vue
@@ -0,0 +1,3 @@
+
+ 系统管理员
+
diff --git a/src/views/common/buss.js b/src/views/common/buss.js
index f9ef51b..8853b4d 100644
--- a/src/views/common/buss.js
+++ b/src/views/common/buss.js
@@ -1,2 +1,3 @@
import Vue from 'vue'
-export default new Vue()
\ No newline at end of file
+
+export default new Vue()
diff --git a/src/views/login/login.vue b/src/views/login/login.vue
index c27ec56..e75ee4b 100644
--- a/src/views/login/login.vue
+++ b/src/views/login/login.vue
@@ -36,12 +36,10 @@
- 云南师范大学 © 2018 - 极客范技术支持
+ 云南师范大学 © 2018 - 极客范技术支持
diff --git a/src/views/students/evaluation/components/bodybase.vue b/src/views/students/evaluation/components/bodybase.vue
index fb7aaaf..c45b3b3 100644
--- a/src/views/students/evaluation/components/bodybase.vue
+++ b/src/views/students/evaluation/components/bodybase.vue
@@ -12,31 +12,101 @@
出勤情况 |
体育锻炼态度 |
军训 |
- 扣分 |
- 扣分原因 |
+
| 体育课出勤 |
体育活动出勤 |
- ① | ② | ③ |
+
+
+ ①
+
+ |
+
+
+ ②
+
+ |
+
+
+ ③
+
+ |
- | 1 |
- 2 |
- 3 |
- 4 |
- 5 |
- 6 |
- 7 |
- 8 |
- 9 |
- 10 |
- 11 |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+ 添加定量考评数据
+
+
+
+
+
+
+
+
+
+
+
+
+ 将证明文件拖到此处,或点击上传
+ 只能上传jpg/png文件,且不超过500kb
+
+
+
+
返回上一步
- 提交并下一步
+ 提交并下一步
@@ -46,21 +116,47 @@ export default {
name: 'StudentBodyBase',
data () {
return {
- bodyBaseForm: {},
+ number1: [20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0],
+ number2: [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0],
+ number3: [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0],
+ number4: [5, 4, 3, 2, 1, 0],
+ bodyBaseForm: {
+ 1: '',
+ 2: '',
+ 3: '',
+ 4: '',
+ 5: '',
+ 6: '',
+ 7: '',
+ 8: '',
+ 9: ''
+ },
+ MoreData: false,
+ moreDataUpdate: {},
active: 2
}
},
methods: {
prevent () {
Bus.$emit('val', this.active - 2)
- if (this.active > 6) this.active = 0;
- this.$router.push({ path: 'moralitybase'})
+ if (this.active > 6) this.active = 0
+ this.$router.push({ path: 'moralitybase' })
},
- next () {
+ nextStep () {
Bus.$emit('val', this.active)
Bus.$emit('finishAct', this.active)
- if (this.active > 6) this.active = 0;
- this.$router.push({ path: 'moralityimprove'})
+ if (this.active > 6) this.active = 0
+ this.$router.push({ path: 'moralityimprove' })
+ },
+ showMoreData () {
+ this.MoreData = true
+ },
+ beforeupload (file) {
+ console.log(file)
+ console.log(file.name)
+ },
+ submitData () {
+ this.MoreData = false
}
}
}
diff --git a/src/views/students/evaluation/components/moralitybase.vue b/src/views/students/evaluation/components/moralitybase.vue
index 6d1e27c..1d6a76e 100644
--- a/src/views/students/evaluation/components/moralitybase.vue
+++ b/src/views/students/evaluation/components/moralitybase.vue
@@ -1,5 +1,5 @@
-
+
| 基础性素质 |
@@ -12,16 +12,38 @@
个人品质 |
人际关系 |
劳动表现 |
-
- | 1 |
- 2 |
- 3 |
- 4 |
- 5 |
- 6 |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
添加定量考评数据
@@ -29,7 +51,6 @@
-
@@ -42,22 +63,13 @@
只能上传jpg/png文件,且不超过500kb
-
- 提交并下一步
+ 提交并下一步
@@ -67,18 +79,28 @@ export default {
name: 'StudentMoralityBase',
data () {
return {
- moralityBbaseForm: {},
+ number1: [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0],
+ number2: [20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0],
+ baseDataForm: {
+ political: '0',
+ compliance: '0',
+ morality: '0',
+ quality: '0',
+ relationship: '0',
+ performance: '0'
+ },
moreDataUpdate: {},
active: 1,
MoreData: false
}
},
methods: {
- next () {
+ nextStep () {
Bus.$emit('val', this.active)
Bus.$emit('finishAct', this.active)
- if (this.active > 6) this.active = 0;
- this.$router.push({ path: 'bodybase'})
+ if (this.active > 6) this.active = 0
+ this.$router.push({ path: 'bodybase' })
+ console.log(this.baseDataForm)
},
showMoreData () {
this.MoreData = true
@@ -96,14 +118,7 @@ export default {
-
diff --git a/src/views/students/evaluation/components/moralityimprove.vue b/src/views/students/evaluation/components/moralityimprove.vue
index 57da4fc..f35a3b8 100644
--- a/src/views/students/evaluation/components/moralityimprove.vue
+++ b/src/views/students/evaluation/components/moralityimprove.vue
@@ -43,15 +43,15 @@ export default {
methods: {
prevent () {
Bus.$emit('val', this.active - 2)
- if (this.active > 6) this.active = 0;
- this.$router.push({ path: 'bodybase'})
+ if (this.active > 6) this.active = 0
+ this.$router.push({ path: 'bodybase' })
},
next () {
Bus.$emit('val', this.active)
Bus.$emit('finishAct', this.active)
- if (this.active > 6) this.active = 0;
- this.$router.push({ path: 'societypractice'})
+ if (this.active > 6) this.active = 0
+ this.$router.push({ path: 'societypractice' })
}
}
}
-
\ No newline at end of file
+
diff --git a/src/views/students/evaluation/components/professionalcomprehensive.vue b/src/views/students/evaluation/components/professionalcomprehensive.vue
index e176d63..309d5f6 100644
--- a/src/views/students/evaluation/components/professionalcomprehensive.vue
+++ b/src/views/students/evaluation/components/professionalcomprehensive.vue
@@ -53,8 +53,8 @@ export default {
methods: {
prevent () {
Bus.$emit('val', this.active - 2)
- if (this.active > 7) this.active = 0;
- this.$router.push({ path: 'techinovation'})
+ if (this.active > 7) this.active = 0
+ this.$router.push({ path: 'techinovation' })
},
next () {
Bus.$emit('val', this.active)
@@ -64,7 +64,7 @@ export default {
cancelButtonText: '关闭',
type: 'success'
}).then(() => {
- this.$router.push({ path: '/student/evaluation/evaluationresult'})
+ this.$router.push({ path: '/student/evaluation/evaluationresult' })
}).catch(() => {})
}
}
diff --git a/src/views/students/evaluation/components/societypractice.vue b/src/views/students/evaluation/components/societypractice.vue
index 393ca81..b888467 100644
--- a/src/views/students/evaluation/components/societypractice.vue
+++ b/src/views/students/evaluation/components/societypractice.vue
@@ -41,14 +41,14 @@ export default {
methods: {
prevent () {
Bus.$emit('val', this.active - 2)
- if (this.active > 6) this.active = 0;
- this.$router.push({ path: 'moralityimprove'})
+ if (this.active > 6) this.active = 0
+ this.$router.push({ path: 'moralityimprove' })
},
next () {
Bus.$emit('val', this.active)
Bus.$emit('finishAct', this.active)
- if (this.active > 6) this.active = 0;
- this.$router.push({ path: 'techinovation'})
+ if (this.active > 6) this.active = 0
+ this.$router.push({ path: 'techinovation' })
}
}
}
diff --git a/src/views/students/evaluation/components/techinovation.vue b/src/views/students/evaluation/components/techinovation.vue
index 8852b3d..364abf9 100644
--- a/src/views/students/evaluation/components/techinovation.vue
+++ b/src/views/students/evaluation/components/techinovation.vue
@@ -49,14 +49,14 @@ export default {
methods: {
prevent () {
Bus.$emit('val', this.active - 2)
- if (this.active > 6) this.active = 0;
- this.$router.push({ path: 'societypractice'})
+ if (this.active > 6) this.active = 0
+ this.$router.push({ path: 'societypractice' })
},
next () {
Bus.$emit('val', this.active)
Bus.$emit('finishAct', this.active)
- if (this.active > 6) this.active = 0;
- this.$router.push({ path: 'professionalcomprehensive'})
+ if (this.active > 6) this.active = 0
+ this.$router.push({ path: 'professionalcomprehensive' })
}
}
}
diff --git a/src/views/students/evaluation/sself.vue b/src/views/students/evaluation/sself.vue
index 3828cc9..d4cc98a 100644
--- a/src/views/students/evaluation/sself.vue
+++ b/src/views/students/evaluation/sself.vue
@@ -28,22 +28,22 @@ export default {
},
methods: {
clickSteps (index) {
- if (index == this.active) {
+ if (index === this.active) {
this.$message({
message: '警告,已经在当前步骤,不需要跳转!',
type: 'warning'
- });
+ })
} else if (index <= this.finashiActive) {
switch (index) {
- case 0: Bus.$emit('val', index); this.$router.push({ path: 'moralitybase'}); break;
- case 1: Bus.$emit('val', index); this.$router.push({ path: 'bodybase'}); break;
- case 2: Bus.$emit('val', index); this.$router.push({ path: 'moralityimprove'}); break;
- case 3: Bus.$emit('val', index); this.$router.push({ path: 'societypractice'}); break;
- case 4: Bus.$emit('val', index); this.$router.push({ path: 'techinovation'}); break;
- case 5: Bus.$emit('val', index); this.$router.push({ path: 'professionalcomprehensive'}); break;
+ case 0: Bus.$emit('val', index); this.$router.push({ path: 'moralitybase' }); break
+ case 1: Bus.$emit('val', index); this.$router.push({ path: 'bodybase' }); break
+ case 2: Bus.$emit('val', index); this.$router.push({ path: 'moralityimprove' }); break
+ case 3: Bus.$emit('val', index); this.$router.push({ path: 'societypractice' }); break
+ case 4: Bus.$emit('val', index); this.$router.push({ path: 'techinovation' }); break
+ case 5: Bus.$emit('val', index); this.$router.push({ path: 'professionalcomprehensive' }); break
}
} else {
- this.$message.error('错误,当前点击步骤之前有没完成的步骤!');
+ this.$message.error('错误,当前点击步骤之前有没完成的步骤!')
}
}
},
@@ -56,7 +56,7 @@ export default {
this.finashiActive = res
}
})
- this.$router.push({ path: 'moralitybase'})
+ this.$router.push({ path: 'moralitybase' })
}
}
diff --git a/src/views/students/layout/components/user.vue b/src/views/students/layout/components/user.vue
index 22a4c29..361c04f 100644
--- a/src/views/students/layout/components/user.vue
+++ b/src/views/students/layout/components/user.vue
@@ -7,7 +7,7 @@
个人信息
- 注 销
+ 注 销
@@ -22,19 +22,26 @@ export default {
},
methods: {
stuLoginout () {
- this.$axios
- .post('/api/zongce/student/loginout', {
- Authorization: this.Authorization
+ this.$confirm('是否要注销登录?', '警告', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
})
- .then(res => {
- Message({
- showClose: true,
- message: res.message,
- type: 'warning'
+ .then(() => {
+ this.$axios
+ .post('/api/zongce/student/loginout')
+ .then(res => {
+ localStorage.clear()
+ this.$router.push({ path: '/login' })
+ })
+ .catch(res => {})
+ })
+ .catch(() => {
+ this.$message({
+ message: '取消注销',
+ type: 'warning'
+ })
})
- this.$router.push({ path: '/login' })
- })
- .catch(res => {})
}
}
}