Commit a5f26e75 authored by 罗超's avatar 罗超

处理完成教师的功能

parent a2130725
......@@ -12,6 +12,18 @@ export function getSchoolPage(data) {
})
}
/**
* 获取学校列表
*
*/
export function getSchoolDropdown(data) {
return request({
url: '/user/GetSchoolList',
method: 'post',
data
})
}
/**
* 获取学校分页列表
*
......@@ -34,3 +46,14 @@ export function getTeacherPage(data) {
data
})
}
/**
* 保存教师信息
*/
export function saveTeacher(data) {
return request({
url: '/user/SetTeacher',
method: 'post',
data
})
}
\ No newline at end of file
This diff is collapsed.
......@@ -238,8 +238,8 @@ export default {
},
mounted() {
let i = 0
if (lockr.get("current_navs")) {
i = lockr.get("current_navs")
if (sessionStorage.getItem("current_navs")) {
i = sessionStorage.getItem("current_navs")
}
this.tab = `navs_${i}`
if (this.userInfo && this.userInfo.MenuList) {
......@@ -261,7 +261,7 @@ export default {
},
setNavs(val) {
//防止页面数据丢失
lockr.set("current_navs", val)
sessionStorage.setItem("current_navs", val)
this.tab = `navs_${val}`
this.secondNavs = this.userInfo.MenuList[val].SubList
this.$router.push({
......
......@@ -230,7 +230,7 @@ export default {
},
changePage(val) {
this.msg.Status = this.StatusTemp ? this.StatusTemp.value : '-1'
this.msg.pageIndex = 1
this.msg.pageIndex = val
this.loading = true
this.getSchool()
},
......@@ -272,6 +272,8 @@ export default {
}
this.getSchool()
this.closeSaveForm()
}).catch(() => {
this.saveLoading = false
})
} else {
this.saveLoading = false
......
......@@ -18,15 +18,15 @@
<div class="page-option">
<!-- 原则上不能操作过三个按钮,建议不要使用查询按钮,增加用户操作次数 -->
<!-- <q-btn color="primary" outline label="立即查询" /> -->
<q-btn color="accent" class="q-mr-md" icon="add" label="新增教师" @click="initObj(null)" />
<q-btn color="accent" class="q-mr-md" icon="add" label="新增教师" @click="addObj(null)" />
<q-btn-dropdown outline color="dark" label="更多">
<q-list>
<q-item clickable v-close-popup @click="onItemClick">
<q-item clickable v-close-popup>
<q-item-section>
<q-item-label>批量导入</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="onItemClick">
<q-item clickable v-close-popup>
<q-item-section>
<q-item-label>批量导出</q-item-label>
</q-item-section>
......@@ -71,11 +71,11 @@
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-family:perfectFont" label="编辑" @click="initObj(props.value)" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-family:perfectFont" label="编辑" @click="addObj(props.value)" />
</q-td>
</template>
</q-table>
<teacher-form v-if="persistent" :save-obj="objOption" @close="closeSaveForm" @success=""></teacher-form>
</div>
</div>
</template>
......@@ -84,10 +84,14 @@
import {
getTeacherPage
} from '../../api/school/index'
import teacherForm from '../../components/school/teacher-form'
export default {
meta: {
title: "教师管理"
},
components: {
teacherForm
},
data() {
return {
currentUrl: "",
......@@ -207,8 +211,7 @@ export default {
},
pageCount: 0,
persistent: false,
objOption: {},
saveLoading: false
objOption: null
}
},
mounted() {
......@@ -216,40 +219,10 @@ export default {
this.getTeacher()
},
methods: {
onItemClick() {
},
initObj(id) {
if (id) {
let obj = this.data.filter(x => {
if (x.SId == id) {
return x
}
return false
})
console.log(obj)
this.objOption = obj[0]
} else {
this.objOption = {
SId: 0,
SName: "",
SAddress: "",
SLinkMan: "",
SLinkTel: "",
SDomain: "",
SLogo: "",
Remark: "",
Status: '0'
}
}
console.log(this.objOption)
this.persistent = true
},
resetSearch() {
this.pageIndex = 1
//this.pageCount = 0
this.loading = true
this.msg.Status = this.StatusTemp ? this.StatusTemp.value : '-1'
this.getTeacher()
},
changePage(val) {
......@@ -268,40 +241,38 @@ export default {
this.loading = false
})
},
addAfterQuery() {
if (!this.objOption) {
this.msg = {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
TeacherName: "",
TeacherTel: "",
AuditStatus: "-1",
IsShow: "-1"
}
}
this.getTeacher()
},
addObj(id) {
if (id) {
let obj = this.data.filter(x => {
if (x.TId == id) {
return x
}
return false
})
this.objOption = obj[0]
} else {
this.objOption = null
}
this.persistent = true
},
closeSaveForm() {
this.persistent = false
},
// saveSchool() {
// this.saveLoading = true
// this.$refs.SName.validate()
// this.$refs.SAddress.validate()
// this.$refs.SLinkMan.validate()
// this.$refs.SLinkTel.validate()
// if (
// !this.$refs.SName.hasError &&
// !this.$refs.SAddress.hasError &&
// !this.$refs.SLinkMan.hasError &&
// !this.$refs.SLinkTel.hasError
// ) {
// saveSchool(this.objOption).then(res => {
// this.saveLoading = false
// this.$q.notify({
// icon: 'iconfont icon-chenggong',
// color: 'accent',
// timeout: 2000,
// message: '数据保存成功!',
// position: 'top'
// })
// if (this.objOption.SId == 0) {
// this.msg.pageIndex = 1
// }
// this.getSchool()
// this.closeSaveForm()
// })
// } else {
// this.saveLoading = false
// }
// }
}
},
}
</script>
......
......@@ -4,7 +4,8 @@ import Lockr from 'lockr'
const app = {
state: {
logo: '',
name: ''
name: '',
currentNavs: 0
},
mutations: {
......@@ -13,6 +14,9 @@ const app = {
},
SET_APPNAME: (state, name) => {
state.name = name
},
SET_CURRENTNAVS: (state, nav) => {
state.currentNavs = nav
}
},
......@@ -25,6 +29,9 @@ const app = {
commit('SET_APPLOGO', GroupLogo)
Lockr.set('systemLogo', GroupName)
Lockr.set('systemName', GroupLogo)
},
SystemNavsChange({ commit }, nav) {
commit('SET_CURRENTNAVS', nav)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment