parent
7614aa0d70
commit
4cbbdf88f6
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -0,0 +1,19 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="PyPackageRequirementsInspection" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="ignoredPackages">
|
||||
<value>
|
||||
<list size="0" />
|
||||
</value>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoredIdentifiers">
|
||||
<list>
|
||||
<option value="NetworkAnalog.test.createPyCore" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/EduSystemFront.iml" filepath="$PROJECT_DIR$/.idea/EduSystemFront.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="a7b16338-e02b-4c72-ae80-f67f6a090b4f" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/front/src/components/login.vue" beforeDir="false" afterPath="$PROJECT_DIR$/front/src/components/login.vue" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/front/src/plugins/axios.js" beforeDir="false" afterPath="$PROJECT_DIR$/front/src/plugins/axios.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/front/src/router/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/front/src/router/index.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/front/src/views/student/studentInfo.vue" beforeDir="false" afterPath="$PROJECT_DIR$/front/src/views/student/studentInfo.vue" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/front/src/views/teacher/home.vue" beforeDir="false" afterPath="$PROJECT_DIR$/front/src/views/teacher/home.vue" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/front/src/views/teacher/teacherInfo.vue" beforeDir="false" afterPath="$PROJECT_DIR$/front/src/views/teacher/teacherInfo.vue" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="MarkdownSettingsMigration">
|
||||
<option name="stateVersion" value="1" />
|
||||
</component>
|
||||
<component name="ProjectId" id="2V5wYC5KIYNo5p6HmfzXLGOIx17" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"WebServerToolWindowFactoryState": "false",
|
||||
"last_opened_file_path": "D:/头哥/教务管理系统/EduSystem",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="a7b16338-e02b-4c72-ae80-f67f6a090b4f" name="Changes" comment="" />
|
||||
<created>1694139293678</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1694139293678</updated>
|
||||
<workItem from="1694139294790" duration="8000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
</project>
|
@ -1,13 +1,313 @@
|
||||
<template>
|
||||
<h1>学生管理</h1>
|
||||
<div>
|
||||
<el-card class="box-card">
|
||||
<el-form ref="form" :model="form" label-width="80px" size="mini" class="demo-form-inline" :inline="true">
|
||||
<el-form-item label="学号">
|
||||
<el-input v-model="form.sid" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="form.name" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group v-model="form.sex" size="medium" >
|
||||
<el-radio border label="男" icon="el-icon-female"></el-radio>
|
||||
<el-radio border label="女" icon="el-icon-male"></el-radio>
|
||||
<el-radio border label="" icon="el-icon-male">无</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级">
|
||||
<el-input v-model="form.class_name" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="年级">
|
||||
<el-input v-model="form.grade" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="专业">
|
||||
<el-input v-model="form.major" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" @click="search">查询</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="dialog = !dialog;isAdd=true">新增学生</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 10px;">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="学号"
|
||||
width="80">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-time"></i>
|
||||
<span style="margin-left: 10px">{{ scope.row.pk }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="姓名"
|
||||
width="120">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag size="medium">{{ scope.row.fields.name }}</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="用户名"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.fields.username }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="密码"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.fields.password }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="性别"
|
||||
width="80">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.fields.sex }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="年级"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.fields.grade }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="班级"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.fields.class_name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="专业"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ scope.row.fields.major }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
style="text-align: center;margin-top: 10px;"
|
||||
hide-on-single-page
|
||||
background
|
||||
:current-page="currentPage"
|
||||
:page-size="10"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="prev, pager, next, total"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
<el-drawer
|
||||
:title="isAdd ? '新增':'编辑'"
|
||||
:before-close="handleClose"
|
||||
:visible.sync="dialog"
|
||||
direction="rtl"
|
||||
custom-class="demo-drawer"
|
||||
ref="drawer"
|
||||
>
|
||||
<div class="demo-drawer__content">
|
||||
<el-form ref="addForm" :model="addForm" label-width="80px" size="mini">
|
||||
<el-form-item label="学号" >
|
||||
<el-input v-model="addForm.sid" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="账号">
|
||||
<el-input v-model="addForm.username" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码">
|
||||
<el-input v-model="addForm.password" type="password"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="addForm.name" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group v-model="addForm.sex" size="medium" >
|
||||
<el-radio border label="男" icon="el-icon-female"></el-radio>
|
||||
<el-radio border label="女" icon="el-icon-male"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="班级">
|
||||
<el-input v-model="addForm.class_name" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="年级">
|
||||
<el-input v-model="addForm.grade" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="专业">
|
||||
<el-input v-model="addForm.major" ></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="demo-drawer__footer">
|
||||
<el-button @click="cancelForm">取 消</el-button>
|
||||
<el-button type="primary" @click="$refs.drawer.closeDrawer()" :loading="loading">{{ loading ? '提交中 ...' : "保存" }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentPage: 1,
|
||||
total: 0,
|
||||
isAdd: true,
|
||||
dialog: false,
|
||||
loading: false,
|
||||
title: "新增学生",
|
||||
tableData: [{
|
||||
sid: "",
|
||||
username: "",
|
||||
password: "",
|
||||
name: "",
|
||||
sex: "",
|
||||
grade: "",
|
||||
class_name: "",
|
||||
major: ""
|
||||
}],
|
||||
form: {
|
||||
sid: '',
|
||||
name: '',
|
||||
sex: '',
|
||||
grade: '',
|
||||
class_name: '',
|
||||
major: '',
|
||||
},
|
||||
addForm: {
|
||||
sid: "",
|
||||
username: '',
|
||||
password: '',
|
||||
name: '',
|
||||
sex: '男',
|
||||
grade: '',
|
||||
class_name: '',
|
||||
major: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleEdit(index, row) {
|
||||
console.log(row)
|
||||
this.addForm = new Object(row.fields)
|
||||
this.addForm.sid = row.pk
|
||||
this.dialog = true
|
||||
this.isAdd = false
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将永久删除该学生, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.get("http://127.0.0.1:8000/student/delete?sid=" + row.pk).then(resp => {
|
||||
if (resp.data.code === 0){
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.data.message
|
||||
});
|
||||
this.getAllStudent()
|
||||
}else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: resp.data.message
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
},
|
||||
handleCurrentChange(val){
|
||||
this.currentPage = val
|
||||
this.getAllStudent()
|
||||
},
|
||||
getAllStudent() {
|
||||
axios.post("http://127.0.0.1:8000/student/search?currentPage="+this.currentPage+"&pageSize=10", this.form).then(resp => {
|
||||
if (resp.data.code === 0) {
|
||||
this.total = resp.data.pageTotal
|
||||
this.tableData = resp.data.data
|
||||
}
|
||||
})
|
||||
},
|
||||
search(){
|
||||
this.getAllStudent()
|
||||
},
|
||||
handleClose(done) {
|
||||
if (this.loading) {
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定要提交表单吗?')
|
||||
.then(_ => {
|
||||
this.loading = true;
|
||||
this.timer = setTimeout(() => {
|
||||
done();
|
||||
axios.post(this.addForm.sid === '' ? "http://127.0.0.1:8000/student/add" : "http://127.0.0.1:8000/student/", this.addForm).then(resp => {
|
||||
if(resp.data.code === 0){
|
||||
this.$message({message: resp.data.message, type: "sucess"})
|
||||
this.getAllStudent()
|
||||
this.loading = false
|
||||
this.addForm = {
|
||||
sid: "",
|
||||
username: '',
|
||||
password: '',
|
||||
name: '',
|
||||
sex: '男',
|
||||
grade: '',
|
||||
class_name: '',
|
||||
major: '',
|
||||
}
|
||||
}else{
|
||||
this.$message({message: resp.data.message, type: "error"})
|
||||
}
|
||||
})
|
||||
}, 1000);
|
||||
})
|
||||
.catch(_ => {});
|
||||
console.log("close")
|
||||
},
|
||||
cancelForm() {
|
||||
this.loading = false;
|
||||
this.dialog = false;
|
||||
this.addForm = {
|
||||
sid: "",
|
||||
username: '',
|
||||
password: '',
|
||||
name: '',
|
||||
sex: '男',
|
||||
grade: '',
|
||||
class_name: '',
|
||||
major: '',
|
||||
}
|
||||
clearTimeout(this.timer);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getAllStudent()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
Loading…
Reference in new issue