This commit is contained in:
parent
b07df17864
commit
b1eea22b78
|
@ -24,68 +24,114 @@ import AbsentRegister from "../views/AbsentRegister.vue";
|
|||
|
||||
// 创建路由实例
|
||||
const routes = [
|
||||
{
|
||||
{
|
||||
path: '/systemAdmin',
|
||||
name: '系统管理员',
|
||||
component: SystemAdmin,
|
||||
redirect: '/dormitoryAdminAdd',
|
||||
children:[
|
||||
{
|
||||
path: '/dormitoryAdminManager',
|
||||
name: '宿管管理',
|
||||
component: DormitoryAdminManager
|
||||
},
|
||||
{
|
||||
path: '/dormitoryAdminAdd',
|
||||
name: '添加宿舍',
|
||||
component: DormitoryAdminAdd
|
||||
}/* ,
|
||||
{
|
||||
path: '/dormitoryAdminUpdate',
|
||||
name: '修改宿舍',
|
||||
component: DormitoryAdminUpdate
|
||||
},
|
||||
{
|
||||
path: '/studentAdd',
|
||||
name: '添加学生',
|
||||
component: StudentAdd
|
||||
},
|
||||
{
|
||||
path: '/studentManager',
|
||||
name: '学生管理',
|
||||
component: StudentManager
|
||||
},
|
||||
{
|
||||
path: '/studentUpdate',
|
||||
name: '修改学生',
|
||||
component: StudentUpdate
|
||||
},
|
||||
{
|
||||
path: '/buildingAdd',
|
||||
name: '添加楼宇',
|
||||
component: BuildingAdd
|
||||
},
|
||||
{
|
||||
path: '/buildingManager',
|
||||
name: '楼宇管理',
|
||||
component: BuildingManager
|
||||
},
|
||||
{
|
||||
path: '/buildingUpdate',
|
||||
name: '修改楼宇',
|
||||
component: BuildingUpdate
|
||||
},
|
||||
{
|
||||
path: '/dormitoryAdd',
|
||||
name: '添加宿舍',
|
||||
component: DormitoryAdd
|
||||
},
|
||||
{
|
||||
path: '/dormitoryManager',
|
||||
name: '宿舍管理',
|
||||
component: DormitoryManager
|
||||
},
|
||||
{
|
||||
path: '/dormitoryUpdate',
|
||||
name: '修改宿舍',
|
||||
component: DormitoryUpdate
|
||||
},
|
||||
{
|
||||
path: '/moveoutRegister',
|
||||
name: '迁出登记',
|
||||
component: MoveoutRegister
|
||||
},
|
||||
{
|
||||
path: '/moveoutRecord',
|
||||
name: '迁出记录',
|
||||
component: MoveRecord
|
||||
},
|
||||
{
|
||||
path: '/absentRecord',
|
||||
name: '缺寝记录',
|
||||
component: AbsentRecord
|
||||
}*/
|
||||
]
|
||||
},
|
||||
/* {
|
||||
path: '/dormitoryAdmin',
|
||||
name: 'DormitoryAdmin', // 通常使用驼峰命名或下划线分隔,避免使用空格和特殊字符
|
||||
name: '宿舍管理员',
|
||||
component: DormitoryAdmin,
|
||||
redirect: '/dormitoryAdmin/absentRegister', // 注意路径的修改,使用相对路径
|
||||
children: [
|
||||
redirect: '/absentRegister',
|
||||
children:[
|
||||
{
|
||||
path: 'absentRecord2', // 去掉前导斜杠
|
||||
name: 'AbsentRecord2',
|
||||
path: '/absentRecord2',
|
||||
name: '缺寝记录',
|
||||
component: AbsentRecord
|
||||
},
|
||||
{
|
||||
path: 'absentRegister',
|
||||
name: 'AbsentRegister',
|
||||
path: '/absentRegister',
|
||||
name: '缺寝登记',
|
||||
component: AbsentRegister
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/systemAdmin',
|
||||
name: 'SystemAdmin',
|
||||
component: SystemAdmin,
|
||||
redirect: '/systemAdmin/dormitoryAdminAdd', // 注意路径的修改,使用相对路径
|
||||
children: [
|
||||
// 注意:确保路径是唯一的,避免重复,例如 '/dormitoryAdminAdd' 在这里和上面已经作为重定向使用过,需要更改
|
||||
{
|
||||
path: 'dormitoryAdminManager',
|
||||
name: 'DormitoryAdminManager',
|
||||
component: DormitoryAdminManager
|
||||
},
|
||||
{
|
||||
path: 'dormitoryAdminAddNew', // 修改路径以避免冲突
|
||||
name: 'AddDormitoryAdmin', // 修改名称以更清晰地表达意图
|
||||
component: DormitoryAdminAdd
|
||||
},
|
||||
// ... 其他子路由,确保路径唯一
|
||||
{
|
||||
path: 'moveoutRegister',
|
||||
name: 'MoveoutRegister',
|
||||
component: MoveoutRegister
|
||||
},
|
||||
// 注意:'absentRecord' 已经作为 '/dormitoryAdmin' 的子路由存在,不需要再次添加
|
||||
// {
|
||||
// path: '/absentRecord',
|
||||
// name: 'AbsentRecord',
|
||||
// component: AbsentRecord
|
||||
// }
|
||||
// 其他子路由...
|
||||
]
|
||||
// 注意:由于路径冲突和冗余,我已经注释掉了一些重复的或冲突的路由配置
|
||||
},
|
||||
]
|
||||
}, */
|
||||
|
||||
{
|
||||
path: '/login',
|
||||
name: 'Login',
|
||||
name: '登录',
|
||||
component: Login
|
||||
},
|
||||
// 如果需要,可以添加其他顶级路由或重定向
|
||||
// {
|
||||
// path: '/',
|
||||
// redirect: '/login' // 例如,将根路径重定向到登录页面
|
||||
// }
|
||||
];
|
||||
}
|
||||
]
|
||||
|
||||
// 创建并导出路由实例
|
||||
const router = createRouter({
|
||||
|
|
|
@ -70,6 +70,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -101,7 +102,7 @@
|
|||
if (valid) {
|
||||
const _this = this
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/absent/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/absent/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -112,13 +113,13 @@
|
|||
page(currentPage){
|
||||
const _this = this
|
||||
if(_this.ruleForm.value == ''){
|
||||
axios.get('http://localhost:8181/absent/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/absent/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
} else {
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/absent/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/absent/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -128,7 +129,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/absent/list/1/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/absent/list/1/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -82,7 +83,7 @@
|
|||
},
|
||||
dormitoryChange(){
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/absent/findStudentByDormitoryId/'+_this.ruleForm.dormitoryId).then(function (resp) {
|
||||
axios.get('http://localhost:8080/absent/findStudentByDormitoryId/'+_this.ruleForm.dormitoryId).then(function (resp) {
|
||||
_this.studentList = resp.data.data
|
||||
_this.ruleForm.studentId = ''
|
||||
})
|
||||
|
@ -94,7 +95,7 @@
|
|||
let admin = _this.$store.state.admin
|
||||
_this.ruleForm.dormitoryAdminId = admin.id
|
||||
console.log(_this.ruleForm)
|
||||
axios.post('http://localhost:8181/absent/save',_this.ruleForm).then(function (resp) {
|
||||
axios.post('http://localhost:8080/absent/save',_this.ruleForm).then(function (resp) {
|
||||
if(resp.data.code == 0){
|
||||
_this.$alert('缺寝登记成功', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -113,7 +114,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/absent/buildingList').then(function (resp) {
|
||||
axios.get('http://localhost:8080/absent/buildingList').then(function (resp) {
|
||||
_this.buildingList = resp.data.data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -50,7 +51,7 @@
|
|||
const _this = this
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.post('http://localhost:8181/building/save',_this.ruleForm).then(function (resp) {
|
||||
axios.post('http://localhost:8080/building/save',_this.ruleForm).then(function (resp) {
|
||||
if(resp.data.code == 0){
|
||||
_this.$alert(_this.ruleForm.name+'添加成功', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -69,7 +70,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/dormitoryAdmin/list').then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitoryAdmin/list').then(function (resp) {
|
||||
_this.dormitoryAdminList = resp.data.data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -97,7 +98,7 @@
|
|||
if (valid) {
|
||||
const _this = this
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/building/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/building/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -108,13 +109,13 @@
|
|||
page(currentPage){
|
||||
const _this = this
|
||||
if(_this.ruleForm.value == ''){
|
||||
axios.get('http://localhost:8181/building/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/building/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
} else {
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/building/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/building/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -131,7 +132,7 @@
|
|||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.delete('http://localhost:8181/building/deleteById/'+row.id).then(function (resp) {
|
||||
axios.delete('http://localhost:8080/building/deleteById/'+row.id).then(function (resp) {
|
||||
if(resp.data.code==0){
|
||||
_this.$alert('【'+row.name+'】已删除', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -146,7 +147,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/building/list/1/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/building/list/1/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -53,7 +54,7 @@
|
|||
const _this = this
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.put('http://localhost:8181/building/update',_this.ruleForm).then(function (resp) {
|
||||
axios.put('http://localhost:8080/building/update',_this.ruleForm).then(function (resp) {
|
||||
if(resp.data.code == 0){
|
||||
_this.$alert(_this.ruleForm.name+'修改成功', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -72,10 +73,10 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/dormitoryAdmin/list').then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitoryAdmin/list').then(function (resp) {
|
||||
_this.dormitoryAdminList = resp.data.data
|
||||
})
|
||||
axios.get('http://localhost:8181/building/findById/'+_this.$route.query.id).then(function (resp) {
|
||||
axios.get('http://localhost:8080/building/findById/'+_this.$route.query.id).then(function (resp) {
|
||||
_this.ruleForm = resp.data.data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -62,7 +63,7 @@
|
|||
const _this = this
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.post('http://localhost:8181/dormitory/save',_this.ruleForm).then(function (resp) {
|
||||
axios.post('http://localhost:8080/dormitory/save',_this.ruleForm).then(function (resp) {
|
||||
if(resp.data.code == 0){
|
||||
_this.$alert(_this.ruleForm.name+'添加成功', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -81,7 +82,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/building/list').then(function (resp) {
|
||||
axios.get('http://localhost:8080/building/list').then(function (resp) {
|
||||
_this.buildingList = resp.data.data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default{
|
||||
methods: {
|
||||
logout(){
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -63,7 +64,7 @@
|
|||
const _this = this
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.post('http://localhost:8181/dormitoryAdmin/save',_this.ruleForm).then(function (resp) {
|
||||
axios.post('http://localhost:8080/dormitoryAdmin/save',_this.ruleForm).then(function (resp) {
|
||||
if(resp.data.code == 0){
|
||||
_this.$alert(_this.ruleForm.username+'添加成功', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -108,7 +109,7 @@
|
|||
if (valid) {
|
||||
const _this = this
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/dormitoryAdmin/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitoryAdmin/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -118,13 +119,13 @@
|
|||
page(currentPage){
|
||||
const _this = this
|
||||
if(_this.ruleForm.value == ''){
|
||||
axios.get('http://localhost:8181/dormitoryAdmin/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitoryAdmin/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
} else {
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/dormitoryAdmin/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitoryAdmin/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -140,7 +141,7 @@
|
|||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.delete('http://localhost:8181/dormitoryAdmin/deleteById/'+row.id).then(function (resp) {
|
||||
axios.delete('http://localhost:8080/dormitoryAdmin/deleteById/'+row.id).then(function (resp) {
|
||||
if(resp.data.code==0){
|
||||
_this.$alert('【'+row.username+'】已删除', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -155,7 +156,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/dormitoryAdmin/list/1/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitoryAdmin/list/1/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -66,7 +67,7 @@
|
|||
const _this = this
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.put('http://localhost:8181/dormitoryAdmin/update',_this.ruleForm).then(function (resp) {
|
||||
axios.put('http://localhost:8080/dormitoryAdmin/update',_this.ruleForm).then(function (resp) {
|
||||
if(resp.data.code == 0){
|
||||
_this.$alert(_this.ruleForm.username+'修改成功', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -85,7 +86,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/dormitoryAdmin/findById/'+_this.$route.query.id).then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitoryAdmin/findById/'+_this.$route.query.id).then(function (resp) {
|
||||
_this.ruleForm = resp.data.data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -107,7 +108,7 @@
|
|||
if (valid) {
|
||||
const _this = this
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/dormitory/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitory/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -118,13 +119,13 @@
|
|||
page(currentPage){
|
||||
const _this = this
|
||||
if(_this.ruleForm.value == ''){
|
||||
axios.get('http://localhost:8181/dormitory/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitory/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
} else {
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/dormitory/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitory/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -141,7 +142,7 @@
|
|||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.delete('http://localhost:8181/dormitory/deleteById/'+row.id).then(function (resp) {
|
||||
axios.delete('http://localhost:8080/dormitory/deleteById/'+row.id).then(function (resp) {
|
||||
if(resp.data.code==0){
|
||||
_this.$alert('【'+row.name+'】已删除', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -156,7 +157,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/dormitory/list/1/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitory/list/1/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -52,7 +53,7 @@
|
|||
const _this = this
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.put('http://localhost:8181/dormitory/update',_this.ruleForm).then(function (resp) {
|
||||
axios.put('http://localhost:8080/dormitory/update',_this.ruleForm).then(function (resp) {
|
||||
if(resp.data.code == 0){
|
||||
_this.$alert(_this.ruleForm.name+'修改成功', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -71,7 +72,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/dormitory/findById/'+_this.$route.query.id).then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitory/findById/'+_this.$route.query.id).then(function (resp) {
|
||||
_this.ruleForm = resp.data.data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
logining: false,
|
||||
ruleForm: {
|
||||
username: 'admin1',
|
||||
password: '123123'
|
||||
password: '123456'
|
||||
},
|
||||
type: 'systemAdmin',
|
||||
rules: {
|
||||
|
@ -20,13 +20,15 @@
|
|||
handleSubmit(){
|
||||
console.log(this.ruleForm)
|
||||
console.log(this.type)
|
||||
/* this.$refs.ruleForm.validate((valid) => {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if(valid){
|
||||
this.logining = true
|
||||
let _this = this
|
||||
if(_this.type == 'dormitoryAdmin'){
|
||||
axios.get('http://localhost:8181/dormitoryAdmin/login', {params:_this.ruleForm}).then(function (resp) {
|
||||
_this.logining = false
|
||||
axios.get('http://localhost:8080/dormitoryAdmin/login', {params:_this.ruleForm}).then(function (resp) {
|
||||
console.log(resp)
|
||||
|
||||
_this.logining = false
|
||||
if(resp.data.code == -1){
|
||||
_this.$alert('用户名不存在', '提示', {
|
||||
confirmButtonText: '确定'
|
||||
|
@ -40,13 +42,16 @@
|
|||
if(resp.data.code == 0){
|
||||
//跳转到SystemAdmin
|
||||
//展示当前登录用户信息
|
||||
_this.$alert('宿舍管理员登录成功!','提示',{
|
||||
confirmButtonText:'确定'
|
||||
})
|
||||
localStorage.setItem('dormitoryAdmin', JSON.stringify(resp.data.data));
|
||||
_this.$router.replace({path: '/dormitoryAdmin'})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
if(_this.type == 'systemAdmin'){
|
||||
axios.get('http://localhost:8181/systemAdmin/login', {params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/systemAdmin/login', {params:_this.ruleForm}).then(function (resp) {
|
||||
_this.logining = false
|
||||
if(resp.data.code == -1){
|
||||
_this.$alert('用户名不存在', '提示', {
|
||||
|
@ -61,13 +66,16 @@
|
|||
if(resp.data.code == 0){
|
||||
//跳转到SystemAdmin
|
||||
//展示当前登录用户信息
|
||||
_this.$alert('系统管理员登录成功!','提示',{
|
||||
confirmButtonText:'确定'
|
||||
})
|
||||
localStorage.setItem('systemAdmin', JSON.stringify(resp.data.data));
|
||||
_this.$router.replace({path: '/systemAdmin'})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}) */
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -91,7 +92,7 @@
|
|||
if (valid) {
|
||||
const _this = this
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/moveout/moveoutSearch',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/moveout/moveoutSearch',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -102,13 +103,13 @@
|
|||
page(currentPage){
|
||||
const _this = this
|
||||
if(_this.ruleForm.value == ''){
|
||||
axios.get('http://localhost:8181/moveout/moveoutList/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/moveout/moveoutList/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
} else {
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/moveout/moveoutSearch',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/moveout/moveoutSearch',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -118,7 +119,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/moveout/moveoutList/1/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/moveout/moveoutList/1/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -109,7 +110,7 @@
|
|||
if (valid) {
|
||||
const _this = this
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/moveout/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/moveout/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -120,13 +121,13 @@
|
|||
page(currentPage){
|
||||
const _this = this
|
||||
if(_this.ruleForm.value == ''){
|
||||
axios.get('http://localhost:8181/moveout/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/moveout/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
} else {
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/moveout/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/moveout/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -146,7 +147,7 @@
|
|||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.put('http://localhost:8181/moveout/moveout/'+row.id+"/"+value).then(function (resp) {
|
||||
axios.put('http://localhost:8080/moveout/moveout/'+row.id+"/"+value).then(function (resp) {
|
||||
if(resp.data.code == 0){
|
||||
_this.$alert('【'+row.name+'】已迁出', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -162,7 +163,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/moveout/list/1/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/moveout/list/1/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -62,7 +63,7 @@
|
|||
const _this = this
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.post('http://localhost:8181/student/save',_this.ruleForm).then(function (resp) {
|
||||
axios.post('http://localhost:8080/student/save',_this.ruleForm).then(function (resp) {
|
||||
if(resp.data.code == 0){
|
||||
_this.$alert(_this.ruleForm.name+'添加成功', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -81,7 +82,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/dormitory/availableList').then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitory/availableList').then(function (resp) {
|
||||
_this.dormitoryList = resp.data.data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -112,7 +113,7 @@
|
|||
if (valid) {
|
||||
const _this = this
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/student/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/student/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -123,13 +124,13 @@
|
|||
page(currentPage){
|
||||
const _this = this
|
||||
if(_this.ruleForm.value == ''){
|
||||
axios.get('http://localhost:8181/student/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/student/list/'+currentPage+'/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
} else {
|
||||
_this.ruleForm.page = _this.currentPage
|
||||
axios.get('http://localhost:8181/student/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
axios.get('http://localhost:8080/student/search',{params:_this.ruleForm}).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
@ -146,7 +147,7 @@
|
|||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.delete('http://localhost:8181/student/deleteById/'+row.id).then(function (resp) {
|
||||
axios.delete('http://localhost:8080/student/deleteById/'+row.id).then(function (resp) {
|
||||
if(resp.data.code==0){
|
||||
_this.$alert('【'+row.name+'】已删除', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -161,7 +162,7 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/student/list/1/'+_this.pageSize).then(function (resp) {
|
||||
axios.get('http://localhost:8080/student/list/1/'+_this.pageSize).then(function (resp) {
|
||||
_this.tableData = resp.data.data.data
|
||||
_this.total = resp.data.data.total
|
||||
})
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -65,7 +66,7 @@
|
|||
const _this = this
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.put('http://localhost:8181/student/update',_this.ruleForm).then(function (resp) {
|
||||
axios.put('http://localhost:8080/student/update',_this.ruleForm).then(function (resp) {
|
||||
if(resp.data.code == 0){
|
||||
_this.$alert(_this.ruleForm.name+'修改成功', '', {
|
||||
confirmButtonText: '确定',
|
||||
|
@ -84,10 +85,10 @@
|
|||
},
|
||||
created() {
|
||||
const _this = this
|
||||
axios.get('http://localhost:8181/dormitory/availableList').then(function (resp) {
|
||||
axios.get('http://localhost:8080/dormitory/availableList').then(function (resp) {
|
||||
_this.dormitoryList = resp.data.data
|
||||
})
|
||||
axios.get('http://localhost:8181/student/findById/'+_this.$route.query.id).then(function (resp) {
|
||||
axios.get('http://localhost:8080/student/findById/'+_this.$route.query.id).then(function (resp) {
|
||||
_this.ruleForm = resp.data.data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,14 +3,21 @@
|
|||
<el-header class="home_header">
|
||||
<div class="home_title">DORMS宿舍管理系统-系统管理员</div>
|
||||
<div class="home_userinfoContainer">
|
||||
<el-dropdown>
|
||||
<!-- <el-dropdown>
|
||||
<span class="el-dropdown-link home_userinfo">
|
||||
{{admin.name}}<i class="el-icon-arrow-down el-icon--right home_userinfo"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-dropdown> -->
|
||||
|
||||
<el-menu>
|
||||
<el-sub-menu index="2">
|
||||
<template #title>{{admin.name}}</template>
|
||||
<el-menu-item index="2-1" @click.native="logout">退出登录</el-menu-item>
|
||||
</el-sub-menu>
|
||||
</el-menu>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-container>
|
||||
|
@ -18,45 +25,65 @@
|
|||
<el-aside class="home_aside" width="200px">
|
||||
|
||||
<el-menu router>
|
||||
<el-submenu index="1">
|
||||
<template slot="title"><i class="el-icon-s-platform"></i>宿管模块</template>
|
||||
<!-- <el-sub-menu index="1">
|
||||
<template #title>
|
||||
<el-icon style="width: 1em;height: 1em;"><Platform /></el-icon>
|
||||
<span>宿管模块</span>
|
||||
</template>
|
||||
<el-menu-item index="1-1">添加宿管</el-menu-item>
|
||||
<el-menu-item index="1-2">宿管管理</el-menu-item>
|
||||
</el-sub-menu> -->
|
||||
<el-sub-menu index="1">
|
||||
<template #title>
|
||||
<el-icon style="width: 1em;height: 1em;"><Platform /></el-icon>
|
||||
<span>宿管模块</span>
|
||||
</template>
|
||||
<el-menu-item index="/dormitoryAdminAdd" :class="$route.path=='/dormitoryAdminAdd'?'is-active':''">
|
||||
<i class="el-icon-folder-add"></i>添加宿管
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/dormitoryAdminManager" :class="$route.path=='/dormitoryAdminManager'?'is-active':''">
|
||||
<i class="el-icon-document-copy"></i>宿管管理
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-sub-menu>
|
||||
|
||||
<el-submenu index="2">
|
||||
<template slot="title"><i class="el-icon-user-solid"></i>学生模块</template>
|
||||
<el-sub-menu index="2">
|
||||
<template #title>
|
||||
<el-icon style="width: 1em;height: 1em;"><Platform /></el-icon>
|
||||
<span>学生模块</span>
|
||||
</template>
|
||||
<el-menu-item index="/studentAdd" :class="$route.path=='/studentAdd'?'is-active':''">
|
||||
<i class="el-icon-folder-add"></i>添加学生
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/studentManager">
|
||||
<i class="el-icon-document-copy"></i>学生管理
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
|
||||
<el-submenu index="3">
|
||||
<template slot="title"><i class="el-icon-s-grid"></i>楼宇模块</template>
|
||||
</el-sub-menu>
|
||||
|
||||
<el-sub-menu index="3">
|
||||
<template #title>
|
||||
<el-icon style="width: 1em;height: 1em;"><Platform /></el-icon>
|
||||
<span>楼宇模块</span>
|
||||
</template>
|
||||
<el-menu-item index="/buildingAdd">
|
||||
<i class="el-icon-folder-add"></i>添加楼宇
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/buildingManager">
|
||||
<i class="el-icon-document-copy"></i>楼宇管理
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-sub-menu>
|
||||
|
||||
<el-submenu index="4">
|
||||
<template slot="title"><i class="el-icon-s-home"></i>宿舍模块</template>
|
||||
<el-sub-menu index="4">
|
||||
<template #title>
|
||||
<el-icon style="width: 1em;height: 1em;"><Platform /></el-icon>
|
||||
<span>宿舍模块</span>
|
||||
</template>
|
||||
<el-menu-item index="/dormitoryAdd">
|
||||
<i class="el-icon-folder-add"></i>添加宿舍
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/dormitoryManager">
|
||||
<i class="el-icon-document-copy"></i>宿舍管理
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-sub-menu>
|
||||
|
||||
<el-menu-item index="/moveoutRegister">
|
||||
<i class="el-icon-s-unfold"></i>
|
||||
|
@ -78,13 +105,17 @@
|
|||
|
||||
<el-container>
|
||||
<el-main>
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<!-- <el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item v-text="this.$router.currentRoute.name"></el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</el-breadcrumb> -->
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item v-text="this.$route.name"></el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<router-view></router-view>
|
||||
</el-main>
|
||||
<el-footer class="home_footer">2022 © DORMS</el-footer>
|
||||
<el-footer class="home_footer">宿舍管理系统</el-footer>
|
||||
</el-container>
|
||||
|
||||
</el-container>
|
||||
|
|
Loading…
Reference in New Issue