Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 023bbc60d9 |
15
README.md
15
README.md
@ -1,35 +1,30 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
# student-information-sys-front
|
# student-information-sys-front
|
||||||
|
|
||||||
学生信息管理系统的前端工程。
|
学生信息管理系统的前端工程。
|
||||||
============================
|
=======
|
||||||
|
|
||||||
# student-information-sys
|
# student-information-sys
|
||||||
|
|
||||||
## Project setup
|
## Project setup
|
||||||
|
|
||||||
```
|
```
|
||||||
pnpm install
|
pnpm install
|
||||||
```
|
```
|
||||||
|
|
||||||
### Compiles and hot-reloads for development
|
### Compiles and hot-reloads for development
|
||||||
|
|
||||||
```
|
```
|
||||||
pnpm run serve
|
pnpm run serve
|
||||||
```
|
```
|
||||||
|
|
||||||
### Compiles and minifies for production
|
### Compiles and minifies for production
|
||||||
|
|
||||||
```
|
```
|
||||||
pnpm run build
|
pnpm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
### Lints and fixes files
|
### Lints and fixes files
|
||||||
|
|
||||||
```
|
```
|
||||||
pnpm run lint
|
pnpm run lint
|
||||||
```
|
```
|
||||||
|
|
||||||
### 后端接口配置
|
### Customize configuration
|
||||||
|
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||||
修改文件src/apiConfig.js中的apiUrl,空字符串表示前后端位于同一台服务器。
|
>>>>>>> 5ea95bc (init)
|
||||||
|
|||||||
@ -12,8 +12,7 @@
|
|||||||
"element-ui": "^2.15.14",
|
"element-ui": "^2.15.14",
|
||||||
"jquery": "^3.7.1",
|
"jquery": "^3.7.1",
|
||||||
"vue": "^2.6.14",
|
"vue": "^2.6.14",
|
||||||
"vue-router": "^3.5.1",
|
"vue-router": "^3.5.1"
|
||||||
"vuex": "^3.6.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.12.16",
|
"@babel/core": "^7.12.16",
|
||||||
@ -21,7 +20,6 @@
|
|||||||
"@vue/cli-plugin-babel": "~5.0.0",
|
"@vue/cli-plugin-babel": "~5.0.0",
|
||||||
"@vue/cli-plugin-eslint": "~5.0.0",
|
"@vue/cli-plugin-eslint": "~5.0.0",
|
||||||
"@vue/cli-plugin-router": "~5.0.0",
|
"@vue/cli-plugin-router": "~5.0.0",
|
||||||
"@vue/cli-plugin-vuex": "~5.0.0",
|
|
||||||
"@vue/cli-service": "~5.0.0",
|
"@vue/cli-service": "~5.0.0",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-plugin-vue": "^8.0.3",
|
"eslint-plugin-vue": "^8.0.3",
|
||||||
|
|||||||
@ -23,9 +23,6 @@ importers:
|
|||||||
vue-router:
|
vue-router:
|
||||||
specifier: ^3.5.1
|
specifier: ^3.5.1
|
||||||
version: 3.6.5(vue@2.7.16)
|
version: 3.6.5(vue@2.7.16)
|
||||||
vuex:
|
|
||||||
specifier: ^3.6.2
|
|
||||||
version: 3.6.2(vue@2.7.16)
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@babel/core':
|
'@babel/core':
|
||||||
specifier: ^7.12.16
|
specifier: ^7.12.16
|
||||||
@ -42,9 +39,6 @@ importers:
|
|||||||
'@vue/cli-plugin-router':
|
'@vue/cli-plugin-router':
|
||||||
specifier: ~5.0.0
|
specifier: ~5.0.0
|
||||||
version: 5.0.8(@vue/cli-service@5.0.8(@vue/compiler-sfc@3.5.13)(lodash@4.17.21)(vue-template-compiler@2.7.16)(vue@2.7.16)(webpack-sources@3.2.3))
|
version: 5.0.8(@vue/cli-service@5.0.8(@vue/compiler-sfc@3.5.13)(lodash@4.17.21)(vue-template-compiler@2.7.16)(vue@2.7.16)(webpack-sources@3.2.3))
|
||||||
'@vue/cli-plugin-vuex':
|
|
||||||
specifier: ~5.0.0
|
|
||||||
version: 5.0.8(@vue/cli-service@5.0.8(@vue/compiler-sfc@3.5.13)(lodash@4.17.21)(vue-template-compiler@2.7.16)(vue@2.7.16)(webpack-sources@3.2.3))
|
|
||||||
'@vue/cli-service':
|
'@vue/cli-service':
|
||||||
specifier: ~5.0.0
|
specifier: ~5.0.0
|
||||||
version: 5.0.8(@vue/compiler-sfc@3.5.13)(lodash@4.17.21)(vue-template-compiler@2.7.16)(vue@2.7.16)(webpack-sources@3.2.3)
|
version: 5.0.8(@vue/compiler-sfc@3.5.13)(lodash@4.17.21)(vue-template-compiler@2.7.16)(vue@2.7.16)(webpack-sources@3.2.3)
|
||||||
@ -3623,11 +3617,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==}
|
resolution: {integrity: sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==}
|
||||||
deprecated: Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.
|
deprecated: Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.
|
||||||
|
|
||||||
vuex@3.6.2:
|
|
||||||
resolution: {integrity: sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==}
|
|
||||||
peerDependencies:
|
|
||||||
vue: ^2.0.0
|
|
||||||
|
|
||||||
watchpack@2.4.2:
|
watchpack@2.4.2:
|
||||||
resolution: {integrity: sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==}
|
resolution: {integrity: sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==}
|
||||||
engines: {node: '>=10.13.0'}
|
engines: {node: '>=10.13.0'}
|
||||||
@ -7761,10 +7750,6 @@ snapshots:
|
|||||||
'@vue/compiler-sfc': 2.7.16
|
'@vue/compiler-sfc': 2.7.16
|
||||||
csstype: 3.1.3
|
csstype: 3.1.3
|
||||||
|
|
||||||
vuex@3.6.2(vue@2.7.16):
|
|
||||||
dependencies:
|
|
||||||
vue: 2.7.16
|
|
||||||
|
|
||||||
watchpack@2.4.2:
|
watchpack@2.4.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
glob-to-regexp: 0.4.1
|
glob-to-regexp: 0.4.1
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 4.2 KiB |
60
src/App.vue
60
src/App.vue
@ -22,22 +22,12 @@
|
|||||||
<span slot="title">课程信息</span>
|
<span slot="title">课程信息</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link to="course">
|
<router-link to="teacher">
|
||||||
<el-menu-item index="3">
|
<el-menu-item index="3">
|
||||||
<i class="el-icon-menu"></i>
|
|
||||||
<span slot="title">课程信息</span>
|
|
||||||
</el-menu-item>
|
|
||||||
</router-link>
|
|
||||||
<router-link to="score">
|
|
||||||
<el-menu-item index="4">
|
|
||||||
<i class="el-icon-s-management"></i>
|
<i class="el-icon-s-management"></i>
|
||||||
<span slot="title">学分信息</span>
|
<span slot="title">教师信息</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</router-link>
|
</router-link>
|
||||||
<el-menu-item index="5" @click="logout">
|
|
||||||
<i class="el-icon-s-management"></i>
|
|
||||||
<span slot="title">退出登录</span>
|
|
||||||
</el-menu-item>
|
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
<el-container>
|
<el-container>
|
||||||
@ -56,57 +46,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import $ from 'jquery'
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
login: this.loginCheck()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loginCheck(){
|
|
||||||
const jwt = localStorage.getItem('user');
|
|
||||||
if (!jwt) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const parts = jwt.split('.');
|
|
||||||
if (parts.length !== 3) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const payload = JSON.parse(atob(parts[1]));
|
|
||||||
if (payload.exp) {
|
|
||||||
return (new Date(payload.exp) > new Date() / 1000);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
logout(){
|
|
||||||
this.$confirm(
|
|
||||||
"确定要退出登录吗?",
|
|
||||||
'提示',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
localStorage.removeItem('user');
|
|
||||||
this.login = false;
|
|
||||||
if (this.$route.name !== "login") {
|
|
||||||
this.$router.push("login");
|
|
||||||
}
|
|
||||||
$.ajax({
|
|
||||||
url: this.$apiUrl + "/userAction/logout",
|
|
||||||
method: "GET",
|
|
||||||
});
|
|
||||||
}).catch(() => {
|
|
||||||
this.$message({
|
|
||||||
type: 'info',
|
|
||||||
message: '取消退出',
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted:()=>{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
export default {
|
export default {
|
||||||
install(Vue) {
|
install(Vue) {
|
||||||
Vue.prototype.$apiUrl = '';
|
Vue.prototype.$apiUrl = 'http://localhost:8080/learn02_war_exploded';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -9,14 +9,11 @@ Vue.use(ElementUI);
|
|||||||
|
|
||||||
//引入配置作为插件
|
//引入配置作为插件
|
||||||
import apiConfig from './apiConfig';
|
import apiConfig from './apiConfig';
|
||||||
|
|
||||||
import store from './store'
|
|
||||||
Vue.use(apiConfig);
|
Vue.use(apiConfig);
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
router,
|
router,
|
||||||
store,
|
|
||||||
render: h => h(App)
|
render: h => h(App)
|
||||||
}).$mount('#app')
|
}).$mount('#app')
|
||||||
|
|||||||
@ -7,37 +7,13 @@ Vue.use(VueRouter)
|
|||||||
const routes = [
|
const routes = [
|
||||||
// {
|
// {
|
||||||
// path: '/',
|
// path: '/',
|
||||||
// name: 'home',
|
// name: 'root',
|
||||||
// component: () => import('../App.vue')
|
// component: () => import('../App.vue')
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
path: '/course',
|
path: '/course',
|
||||||
name: 'course',
|
name: 'course',
|
||||||
component: () => import('../views/course/CourseList.vue'),
|
component: () => import('../views/course/CourseList.vue')
|
||||||
meta: { requiresAuth: true }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/login',
|
|
||||||
name: 'login',
|
|
||||||
component: () => import('../views/login/loginView.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/student',
|
|
||||||
name: 'student',
|
|
||||||
component: () => import('../views/student/studentList.vue'),
|
|
||||||
meta: { requiresAuth: true }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/teacher',
|
|
||||||
name: 'teacher',
|
|
||||||
component: () => import('../views/teacher/teacherList.vue'),
|
|
||||||
meta: { requiresAuth: true }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/score',
|
|
||||||
name: 'score',
|
|
||||||
component: () => import('../views/score/scoreView.vue'),
|
|
||||||
// meta: { requiresAuth: true }
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -45,33 +21,4 @@ const router = new VueRouter({
|
|||||||
routes
|
routes
|
||||||
})
|
})
|
||||||
|
|
||||||
function JwtExpireCheck(jwt) {
|
|
||||||
if(!jwt){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const parts = jwt.split('.');
|
|
||||||
if (parts.length !== 3) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const payload = JSON.parse(atob(parts[1]));
|
|
||||||
if (payload.exp) {
|
|
||||||
return (new Date(payload.exp)>new Date()/1000) ;
|
|
||||||
}
|
|
||||||
throw new Error('No expiration time found in JWT payload');
|
|
||||||
}
|
|
||||||
|
|
||||||
import $ from 'jquery'
|
|
||||||
router.beforeEach((to, _, next) => {
|
|
||||||
const isLoggedIn = localStorage.getItem('user');
|
|
||||||
if (!to.meta.requiresAuth || JwtExpireCheck(isLoggedIn)) {
|
|
||||||
$.ajaxSetup({
|
|
||||||
headers: { 'token': isLoggedIn }
|
|
||||||
});
|
|
||||||
next();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
next({ path: '/login', query: { redirect: to.name } });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
import Vuex from 'vuex'
|
|
||||||
|
|
||||||
Vue.use(Vuex)
|
|
||||||
|
|
||||||
export default new Vuex.Store({
|
|
||||||
state: {
|
|
||||||
},
|
|
||||||
getters: {
|
|
||||||
},
|
|
||||||
mutations: {
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
},
|
|
||||||
modules: {
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="about">
|
|
||||||
<h1>This is an about page</h1>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="home">
|
|
||||||
<img alt="Vue logo" src="../assets/logo.png">
|
|
||||||
<HelloWorld msg="Welcome to Your Vue.js App"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// @ is an alias to /src
|
|
||||||
import HelloWorld from '@/components/HelloWorld.vue'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'HomeView',
|
|
||||||
components: {
|
|
||||||
HelloWorld
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="">
|
||||||
<!-- 查询表单 -->
|
<!-- 查询表单 -->
|
||||||
<el-form :inline="true" :model="courseSearchForm">
|
<el-form :inline="true" :model="courseSearchForm" class="demo-form-inline">
|
||||||
<el-form-item label="课程名称">
|
<el-form-item label="课程名称">
|
||||||
<el-input v-model="courseSearchForm.courseName" placeholder="课程名称"></el-input>
|
<el-input v-model="courseSearchForm.courseName" placeholder="课程名称"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
<el-button type="success" @click="courseAdd">添加</el-button>
|
<el-button type="success" @click="courseAdd">添加</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<br><br><hr>
|
<br><br>
|
||||||
|
|
||||||
<!-- 课程表格 -->
|
<!-- 课程表格 -->
|
||||||
<el-table :data="courseList.data">
|
<el-table :data="courseList.data">
|
||||||
@ -111,13 +111,13 @@
|
|||||||
|
|
||||||
<!-- 添加弹出框 -->
|
<!-- 添加弹出框 -->
|
||||||
<el-dialog title="添加课程" :visible.sync="courseAddDialogVisible">
|
<el-dialog title="添加课程" :visible.sync="courseAddDialogVisible">
|
||||||
<el-form :model="courseEditForm" :rules="courseRules">
|
<el-form :model="courseEditForm">
|
||||||
<el-form-item label="课程名称" prop="name">
|
<el-form-item label="课程名称">
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-input v-model="courseEditForm.name" placeholder="课程名称" width="200px"></el-input>
|
<el-input v-model="courseEditForm.name" placeholder="课程名称" width="200px"></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="课程性质" prop="type">
|
<el-form-item label="课程性质">
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-select v-model="courseEditForm.type" placeholder="课程性质">
|
<el-select v-model="courseEditForm.type" placeholder="课程性质">
|
||||||
<el-option v-for="(courseType, index) in courseTypes" :key="courseType" :label="courseType"
|
<el-option v-for="(courseType, index) in courseTypes" :key="courseType" :label="courseType"
|
||||||
@ -125,17 +125,17 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="课程学分" prop="credit">
|
<el-form-item label="课程学分">
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-input-number v-model.number="courseEditForm.credit" step="0.5"></el-input-number>
|
<el-input-number v-model="courseEditForm.credit"></el-input-number>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="课程年级" prop="grade">
|
<el-form-item label="课程年级">
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-input v-model.number="courseEditForm.grade" placeholder="课程年级"></el-input>
|
<el-input v-model="courseEditForm.grade" placeholder="课程年级"></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="课程专业" prop="major">
|
<el-form-item label="课程专业">
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-select v-model="courseEditForm.major" placeholder="课程专业">
|
<el-select v-model="courseEditForm.major" placeholder="课程专业">
|
||||||
<el-option v-for="(courseMajor, index) in courseMajors" :key="courseMajor"
|
<el-option v-for="(courseMajor, index) in courseMajors" :key="courseMajor"
|
||||||
@ -143,7 +143,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="课程备注" prop="detail">
|
<el-form-item label="课程备注">
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-input type="textarea" autosize placeholder="备注内容" v-model="courseEditForm.detail">
|
<el-input type="textarea" autosize placeholder="备注内容" v-model="courseEditForm.detail">
|
||||||
</el-input>
|
</el-input>
|
||||||
@ -151,7 +151,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="courseAddDialogVisible = false">取 消</el-button>
|
<el-button @click="courseEditDialogVisible = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="courseAddSubmit()">确 定</el-button>
|
<el-button type="primary" @click="courseAddSubmit()">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -184,29 +184,6 @@ export default {
|
|||||||
courseEditDialogVisible: false,
|
courseEditDialogVisible: false,
|
||||||
courseEditForm: { id: -1, name: "", type: "", credit: "", grade: "", major: "", detail: "" },
|
courseEditForm: { id: -1, name: "", type: "", credit: "", grade: "", major: "", detail: "" },
|
||||||
courseAddDialogVisible: false,
|
courseAddDialogVisible: false,
|
||||||
courseRules:{
|
|
||||||
name:[
|
|
||||||
{ required: true, message: '请输入课程名称', trigger: 'blur' },
|
|
||||||
{ min: 4, max: 25, message: '长度在 4 到 25 个字符', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
type: [
|
|
||||||
{ required: true, message: '课程性质不能为空' },
|
|
||||||
],
|
|
||||||
credit:[
|
|
||||||
{ required: true, message: '课程学分不能为空' },
|
|
||||||
{ type: 'number', message: 'invalid' }
|
|
||||||
],
|
|
||||||
grade:[
|
|
||||||
{ required: true, message: '课程年级不能为空' },
|
|
||||||
{ type: 'number', message: 'invalid' }
|
|
||||||
],
|
|
||||||
major:[
|
|
||||||
{ required: true, message: '课程专业不能为空' },
|
|
||||||
],
|
|
||||||
detail:[
|
|
||||||
{ max: 200, message: '长度应小于 200 个字符', trigger: 'blur' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -238,7 +215,7 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: this.$apiUrl + "/courseAction/edit",
|
url: this.$apiUrl + "/courseAction/update",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: this.courseEditForm,
|
data: this.courseEditForm,
|
||||||
success: (data) => {
|
success: (data) => {
|
||||||
@ -297,7 +274,7 @@ export default {
|
|||||||
message: '添加成功',
|
message: '添加成功',
|
||||||
showClose: true
|
showClose: true
|
||||||
});
|
});
|
||||||
this.courseAddDialogVisible = false;
|
this.courseEditDialogVisible = false;
|
||||||
}
|
}
|
||||||
this.courseListGet();
|
this.courseListGet();
|
||||||
},
|
},
|
||||||
@ -361,18 +338,17 @@ export default {
|
|||||||
},
|
},
|
||||||
courseListGet() {
|
courseListGet() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: this.$apiUrl + "/courseAction/get",
|
url: this.$apiUrl + "/courseAction/list",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
data: {
|
data: {
|
||||||
page: this.courseList.page,
|
page: this.courseList.page,
|
||||||
pageSize: this.courseList.pageSize,
|
pageSize: this.courseList.pageSize,
|
||||||
keyword: this.courseSearchForm.courseName,
|
keyword: this.courseSearchForm.courseName,
|
||||||
type: this.courseSearchForm.courseType
|
courseType: this.courseSearchForm.courseType
|
||||||
},
|
},
|
||||||
success: (data) => {
|
success: (data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.courseList.data = data.data;
|
this.courseList = data;
|
||||||
this.courseList.total = data.count;
|
|
||||||
},
|
},
|
||||||
error: (xhr) => {
|
error: (xhr) => {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
@ -1,73 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<div class="login-card">
|
|
||||||
<el-form ref="form" :model="loginform" label-width="80px">
|
|
||||||
<el-form-item label="用户名">
|
|
||||||
<el-input v-model="loginform.username"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="密码">
|
|
||||||
<el-input type="password" v-model="loginform.password"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="login">登录</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import $ from 'jquery'
|
|
||||||
export default {
|
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
loginform: {
|
|
||||||
username: '',
|
|
||||||
password: ''
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
login(){
|
|
||||||
$.ajax({
|
|
||||||
url: this.$apiUrl + "/userAction/login",
|
|
||||||
method: 'POST',
|
|
||||||
data: this.loginform,
|
|
||||||
success:(data)=> {
|
|
||||||
if(data.success){
|
|
||||||
localStorage.setItem('user', data.data);
|
|
||||||
$.ajaxSetup({
|
|
||||||
headers: { 'token': data.data }
|
|
||||||
});
|
|
||||||
if (this.$route.query.redirect){
|
|
||||||
this.$router.push({ name: this.$route.query.redirect });
|
|
||||||
}else{
|
|
||||||
this.$router.push("student");
|
|
||||||
}
|
|
||||||
|
|
||||||
}else{
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '登录失败,' + data.msg,
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error:(xhr)=>{
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '登录失败,code=' + xhr.status,
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted(){
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-tabs v-model="activeName" @tab-click="changeTab">
|
|
||||||
<el-tab-pane label="学生成绩" name="stu">
|
|
||||||
<!-- 查询表单 -->
|
|
||||||
<el-row :gutter="30">
|
|
||||||
<el-col :span="8"><el-input v-model="studentCode" placeholder="学号"></el-input></el-col>
|
|
||||||
<el-col :span="3"><el-button type="primary" @click="searchByStu">查询</el-button></el-col>
|
|
||||||
</el-row>
|
|
||||||
<br><br>
|
|
||||||
<!-- 查询结果集 -->
|
|
||||||
<el-descriptions title="查询结果:">
|
|
||||||
<el-descriptions-item label="学生姓名">{{ studentScore.name }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="学号">{{ studentScore.code }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="学分">{{ studentScore.score }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="课程数">{{ studentScore.count }}</el-descriptions-item>
|
|
||||||
</el-descriptions>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="课程成绩" name="cou">
|
|
||||||
<!-- 查询表单 -->
|
|
||||||
<el-row :gutter="30">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-select v-model="couresSearchId" multiple filterable remote reserve-keyword placeholder="请输入关键词"
|
|
||||||
:remote-method="remoteMethod" :loading="loading">
|
|
||||||
<el-option v-for="item in options" :key="item.value" :label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="3"><el-button type="primary" @click="searchByStu">查询</el-button></el-col>
|
|
||||||
</el-row>
|
|
||||||
<br><br>
|
|
||||||
<!-- 查询结果集 -->
|
|
||||||
<el-table :data="scoreList"></el-table>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import $ from 'jquery'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
activeName: "stu",
|
|
||||||
studentCode: '',
|
|
||||||
studentScore: {name:'',code:'',score:'',count:0},
|
|
||||||
scoreList:{},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleClick(tab, event) {
|
|
||||||
console.log(tab, event);
|
|
||||||
},
|
|
||||||
searchByStu(){
|
|
||||||
$.ajax({
|
|
||||||
url: this.$apiUrl + "/scoreAction/getByStu",
|
|
||||||
method: "GET",
|
|
||||||
data: {studentCode: this.studentCode},
|
|
||||||
success:(data)=>{
|
|
||||||
if (data.success){
|
|
||||||
this.studentScore.code = this.studentCode;
|
|
||||||
this.studentScore.name = data.msg;
|
|
||||||
this.studentScore.score = data.data;
|
|
||||||
this.studentScore.count = data.count;
|
|
||||||
} else{
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '查询失败',
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: (xhr) => {
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '请求数据失败,code=' + xhr.status,
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
searchByCou(){},
|
|
||||||
},
|
|
||||||
mounted(){},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@ -1,370 +0,0 @@
|
|||||||
<!-- studentList.vue -->
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<br>
|
|
||||||
<!-- 查询表单 -->
|
|
||||||
<el-form :inline="true" :model="studentSearchForm">
|
|
||||||
<el-form-item label="姓名">
|
|
||||||
<el-input v-model="studentSearchForm.name" placeholder="姓名"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="学号">
|
|
||||||
<el-input v-model="studentSearchForm.code" placeholder="学号"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="性别">
|
|
||||||
<el-select v-model="studentSearchForm.sex" placeholder="性别">
|
|
||||||
<el-option label="男" value=0></el-option>
|
|
||||||
<el-option label="女" value=1></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<br>
|
|
||||||
<el-form-item label="年级">
|
|
||||||
<el-input v-model="studentSearchForm.grade" placeholder="年级"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="专业">
|
|
||||||
<el-select v-model="studentSearchForm.major">
|
|
||||||
<el-option v-for="(major, index) in majors" :key="major" :label="major" :value="index + 1"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="筛选操作">
|
|
||||||
<el-button type="primary" @click="studentListGet">查询</el-button>
|
|
||||||
<el-button plain @click="studentSearchClear">清除</el-button>
|
|
||||||
<el-button type="success" @click="studentAdd" style="float: right;">添加</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<br>
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<!-- 学生表格 -->
|
|
||||||
<el-table :data="studentList.data">
|
|
||||||
<el-table-column prop="name" label="姓名"></el-table-column>
|
|
||||||
<el-table-column prop="code" label="学号" width="150px"></el-table-column>
|
|
||||||
<el-table-column prop="grade" label="年级" width="80px"></el-table-column>
|
|
||||||
<el-table-column label="性别" width="50px">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div v-if="scope.row.sex == 0">男</div>
|
|
||||||
<div v-else>女</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="专业" width="120px">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div>{{ majors[scope.row.major - 1] }}</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="备注" width="50px">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-popover trigger="click" placement="left">
|
|
||||||
<div style="max-width: 320px;">
|
|
||||||
<p v-if="scope.row.detail.length > 0">{{ scope.row.detail }}</p>
|
|
||||||
<p v-else>没有备注信息</p>
|
|
||||||
</div>
|
|
||||||
<i class="el-icon-info" slot="reference"></i>
|
|
||||||
</el-popover>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="180px">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div>
|
|
||||||
<el-button size="mini" type="primary" @click="studentEdit(scope.row)">编辑</el-button>
|
|
||||||
<el-button size="mini" type="danger" @click="studentDelete(scope.row)">删除</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<!-- 分页器 -->
|
|
||||||
<el-pagination background layout="sizes, prev, pager, next" @size-change="handleSizeChange"
|
|
||||||
@current-change="handleCurrentChange" :total="studentList.total">
|
|
||||||
</el-pagination>
|
|
||||||
|
|
||||||
<el-dialog title="编辑学生" :visible.sync="studentEditDialogVisible">
|
|
||||||
<el-form :model="studentEditForm" label-position="top">
|
|
||||||
<el-row :gutter="25">
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="姓名">
|
|
||||||
<el-input v-model="studentEditForm.name" placeholder="姓名"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="学号">
|
|
||||||
<el-input v-model="studentEditForm.code" placeholder="学号"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="25">
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="性别">
|
|
||||||
<el-select v-model="studentEditForm.sex" placeholder="性别">
|
|
||||||
<el-option label="男" :value=0></el-option>
|
|
||||||
<el-option label="女" :value=1></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="年级">
|
|
||||||
<el-input v-model="studentEditForm.grade" placeholder="年级"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-form-item label="专业">
|
|
||||||
<el-select v-model="studentEditForm.major">
|
|
||||||
<el-option v-for="(major, index) in majors" :key="major" :label="major" :value="index + 1"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注">
|
|
||||||
<el-input type="textarea" v-model="studentEditForm.detail" placeholder="备注"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="studentEditDialogVisible = false">取 消</el-button>
|
|
||||||
<el-button type="primary" @click="studentSubmit()">确 定</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import $ from 'jquery'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
studentSearchForm: {
|
|
||||||
name: '',
|
|
||||||
code: '',
|
|
||||||
sex: '',
|
|
||||||
grade: '',
|
|
||||||
},
|
|
||||||
majors: ['软件工程', '空间信息', '大数据'],
|
|
||||||
studentList: {
|
|
||||||
data: [{
|
|
||||||
id: 1,
|
|
||||||
name: '测试数据',
|
|
||||||
code: '1111111111',
|
|
||||||
sex: 1,
|
|
||||||
grade: 2023,
|
|
||||||
major: 1,
|
|
||||||
detail: '测试数据'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
page: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
total: 0
|
|
||||||
},
|
|
||||||
studentEditDialogVisible: false,
|
|
||||||
studentEditForm: {id: -1, code: '', name: '', sex: '', grade: '', major: '', detail: ''},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
studentListGet() {
|
|
||||||
$.ajax({
|
|
||||||
url: this.$apiUrl + "/studentAction/get",
|
|
||||||
metthod: "POST",
|
|
||||||
data: {
|
|
||||||
name: this.studentSearchForm.name,
|
|
||||||
code: this.studentSearchForm.code,
|
|
||||||
sex: (this.studentSearchForm.sex % 1 !== 0 || this.studentSearchForm.sex === '' ? -1 : this.studentSearchForm.sex),
|
|
||||||
grade: (this.studentSearchForm.grade % 1 !== 0 || this.studentSearchForm.grade === '' ? -1 : parseInt(this.studentSearchForm.grade)),
|
|
||||||
major: (this.studentSearchForm.major % 1 !== 0 || this.studentSearchForm.major === '' ? -1 : parseInt(this.studentSearchForm.major)),
|
|
||||||
page: this.studentList.page,
|
|
||||||
pageSize: this.studentList.pageSize
|
|
||||||
},
|
|
||||||
success: (data) => {
|
|
||||||
console.log(data);
|
|
||||||
if (data.success) {
|
|
||||||
this.studentList.data = data.data;
|
|
||||||
this.studentList.total = data.count;
|
|
||||||
} else if (data.msg === 'not login') {
|
|
||||||
localStorage.removeItem('user');
|
|
||||||
this.$router.push("/login")
|
|
||||||
} else {
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '请求数据失败,' + data.msg,
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: (xhr) => {
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '请求数据失败,code=' + xhr.status,
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
studentSearchClear() {
|
|
||||||
this.studentSearchForm = {
|
|
||||||
name: '',
|
|
||||||
code: '',
|
|
||||||
sex: '',
|
|
||||||
grade: '',
|
|
||||||
major: '',
|
|
||||||
};
|
|
||||||
this.studentListGet();
|
|
||||||
},
|
|
||||||
studentEdit(student) { console.log('编辑学生:', student)
|
|
||||||
this.studentEditDialogVisible = true;
|
|
||||||
this.studentEditForm = student;
|
|
||||||
},
|
|
||||||
studentDelete(student) {
|
|
||||||
this.$confirm(
|
|
||||||
'确定要删除学生'+student.name+'吗?',
|
|
||||||
'提示',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}
|
|
||||||
).then(()=>{
|
|
||||||
$.ajax({
|
|
||||||
url: this.$apiUrl + "/studentAction/delete",
|
|
||||||
method: 'POST',
|
|
||||||
data: student,
|
|
||||||
success: (data)=>{
|
|
||||||
if (data.success){
|
|
||||||
this.$message({
|
|
||||||
type: 'success',
|
|
||||||
message: '删除成功',
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
this.studentListGet();
|
|
||||||
}else{
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '删除失败',
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error:(xhr)=>{
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '请求数据失败,code=' + xhr.status,
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).catch(()=>{
|
|
||||||
this.$message({
|
|
||||||
type: 'info',
|
|
||||||
message: '取消删除',
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleSizeChange(val) {
|
|
||||||
this.studentList.pageSize = val;
|
|
||||||
this.studentList.page = 1;
|
|
||||||
this.studentListGet();
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
this.studentList.page = val;
|
|
||||||
this.studentListGet();
|
|
||||||
},
|
|
||||||
studentAdd(){
|
|
||||||
this.studentEditForm = { id: -1, code: '', name: '', sex: '', grade: '', major: '', detail: '' };
|
|
||||||
this.studentEditDialogVisible = true;
|
|
||||||
},
|
|
||||||
studentSubmit(){
|
|
||||||
if(this.studentEditForm.id===-1){
|
|
||||||
this.$confirm(
|
|
||||||
"确定要添加学生"+this.studentEditForm.name+"吗?",
|
|
||||||
'提示',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}
|
|
||||||
).then(()=>{
|
|
||||||
$.ajax({
|
|
||||||
url: this.$apiUrl + '/studentAction/add',
|
|
||||||
method: "POST",
|
|
||||||
data: this.studentEditForm,
|
|
||||||
success: (data) => {
|
|
||||||
if (data.success) {
|
|
||||||
this.$message({
|
|
||||||
type: 'success',
|
|
||||||
message: '保存成功',
|
|
||||||
showClose: true,
|
|
||||||
});
|
|
||||||
this.studentEditDialogVisible = false;
|
|
||||||
this.studentListGet();
|
|
||||||
} else {
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: data.msg,
|
|
||||||
showClose: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: (xhr) => {
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '请求数据失败,code=' + xhr.status,
|
|
||||||
showClose: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).catch(()=>{
|
|
||||||
this.$message({
|
|
||||||
type: 'info',
|
|
||||||
message: '取消添加',
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}else{
|
|
||||||
this.$confirm(
|
|
||||||
"确定要修改学生" + this.studentEditForm.name + "吗?",
|
|
||||||
'提示',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
$.ajax({
|
|
||||||
url: this.$apiUrl + '/studentAction/edit',
|
|
||||||
method: "POST",
|
|
||||||
data: this.studentEditForm,
|
|
||||||
success: (data) => {
|
|
||||||
if (data.success) {
|
|
||||||
this.$message({
|
|
||||||
type: 'success',
|
|
||||||
message: '修改成功',
|
|
||||||
showClose: true,
|
|
||||||
});
|
|
||||||
this.studentEditDialogVisible = false;
|
|
||||||
this.studentListGet();
|
|
||||||
} else {
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: data.msg,
|
|
||||||
showClose: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: (xhr) => {
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: '请求数据失败,code=' + xhr.status,
|
|
||||||
showClose: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).catch(() => {
|
|
||||||
this.$message({
|
|
||||||
type: 'info',
|
|
||||||
message: '取消保存',
|
|
||||||
showClose: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted(){
|
|
||||||
this.studentListGet();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div><h1>尚未完成</h1></div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
Loading…
Reference in New Issue
Block a user