Commit a5f26e75 authored by 罗超's avatar 罗超

处理完成教师的功能

parent a2130725
...@@ -12,6 +12,18 @@ export function getSchoolPage(data) { ...@@ -12,6 +12,18 @@ export function getSchoolPage(data) {
}) })
} }
/**
* 获取学校列表
*
*/
export function getSchoolDropdown(data) {
return request({
url: '/user/GetSchoolList',
method: 'post',
data
})
}
/** /**
* 获取学校分页列表 * 获取学校分页列表
* *
...@@ -33,4 +45,15 @@ export function getTeacherPage(data) { ...@@ -33,4 +45,15 @@ export function getTeacherPage(data) {
method: 'post', method: 'post',
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 { ...@@ -238,8 +238,8 @@ export default {
}, },
mounted() { mounted() {
let i = 0 let i = 0
if (lockr.get("current_navs")) { if (sessionStorage.getItem("current_navs")) {
i = lockr.get("current_navs") i = sessionStorage.getItem("current_navs")
} }
this.tab = `navs_${i}` this.tab = `navs_${i}`
if (this.userInfo && this.userInfo.MenuList) { if (this.userInfo && this.userInfo.MenuList) {
...@@ -261,7 +261,7 @@ export default { ...@@ -261,7 +261,7 @@ export default {
}, },
setNavs(val) { setNavs(val) {
//防止页面数据丢失 //防止页面数据丢失
lockr.set("current_navs", val) sessionStorage.setItem("current_navs", val)
this.tab = `navs_${val}` this.tab = `navs_${val}`
this.secondNavs = this.userInfo.MenuList[val].SubList this.secondNavs = this.userInfo.MenuList[val].SubList
this.$router.push({ this.$router.push({
......
...@@ -230,7 +230,7 @@ export default { ...@@ -230,7 +230,7 @@ export default {
}, },
changePage(val) { changePage(val) {
this.msg.Status = this.StatusTemp ? this.StatusTemp.value : '-1' this.msg.Status = this.StatusTemp ? this.StatusTemp.value : '-1'
this.msg.pageIndex = 1 this.msg.pageIndex = val
this.loading = true this.loading = true
this.getSchool() this.getSchool()
}, },
...@@ -272,6 +272,8 @@ export default { ...@@ -272,6 +272,8 @@ export default {
} }
this.getSchool() this.getSchool()
this.closeSaveForm() this.closeSaveForm()
}).catch(() => {
this.saveLoading = false
}) })
} else { } else {
this.saveLoading = false this.saveLoading = false
......
...@@ -18,15 +18,15 @@ ...@@ -18,15 +18,15 @@
<div class="page-option"> <div class="page-option">
<!-- 原则上不能操作过三个按钮,建议不要使用查询按钮,增加用户操作次数 --> <!-- 原则上不能操作过三个按钮,建议不要使用查询按钮,增加用户操作次数 -->
<!-- <q-btn color="primary" outline label="立即查询" /> --> <!-- <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-btn-dropdown outline color="dark" label="更多">
<q-list> <q-list>
<q-item clickable v-close-popup @click="onItemClick"> <q-item clickable v-close-popup>
<q-item-section> <q-item-section>
<q-item-label>批量导入</q-item-label> <q-item-label>批量导入</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-close-popup @click="onItemClick"> <q-item clickable v-close-popup>
<q-item-section> <q-item-section>
<q-item-label>批量导出</q-item-label> <q-item-label>批量导出</q-item-label>
</q-item-section> </q-item-section>
...@@ -71,11 +71,11 @@ ...@@ -71,11 +71,11 @@
</template> </template>
<template v-slot:body-cell-optioned="props"> <template v-slot:body-cell-optioned="props">
<q-td :props="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> </q-td>
</template> </template>
</q-table> </q-table>
<teacher-form v-if="persistent" :save-obj="objOption" @close="closeSaveForm" @success=""></teacher-form>
</div> </div>
</div> </div>
</template> </template>
...@@ -84,10 +84,14 @@ ...@@ -84,10 +84,14 @@
import { import {
getTeacherPage getTeacherPage
} from '../../api/school/index' } from '../../api/school/index'
import teacherForm from '../../components/school/teacher-form'
export default { export default {
meta: { meta: {
title: "教师管理" title: "教师管理"
}, },
components: {
teacherForm
},
data() { data() {
return { return {
currentUrl: "", currentUrl: "",
...@@ -207,8 +211,7 @@ export default { ...@@ -207,8 +211,7 @@ export default {
}, },
pageCount: 0, pageCount: 0,
persistent: false, persistent: false,
objOption: {}, objOption: null
saveLoading: false
} }
}, },
mounted() { mounted() {
...@@ -216,40 +219,10 @@ export default { ...@@ -216,40 +219,10 @@ export default {
this.getTeacher() this.getTeacher()
}, },
methods: { 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() { resetSearch() {
this.pageIndex = 1 this.pageIndex = 1
//this.pageCount = 0 //this.pageCount = 0
this.loading = true this.loading = true
this.msg.Status = this.StatusTemp ? this.StatusTemp.value : '-1'
this.getTeacher() this.getTeacher()
}, },
changePage(val) { changePage(val) {
...@@ -268,40 +241,38 @@ export default { ...@@ -268,40 +241,38 @@ export default {
this.loading = false 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() { closeSaveForm() {
this.persistent = false 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> </script>
......
...@@ -4,7 +4,8 @@ import Lockr from 'lockr' ...@@ -4,7 +4,8 @@ import Lockr from 'lockr'
const app = { const app = {
state: { state: {
logo: '', logo: '',
name: '' name: '',
currentNavs: 0
}, },
mutations: { mutations: {
...@@ -13,6 +14,9 @@ const app = { ...@@ -13,6 +14,9 @@ const app = {
}, },
SET_APPNAME: (state, name) => { SET_APPNAME: (state, name) => {
state.name = name state.name = name
},
SET_CURRENTNAVS: (state, nav) => {
state.currentNavs = nav
} }
}, },
...@@ -25,6 +29,9 @@ const app = { ...@@ -25,6 +29,9 @@ const app = {
commit('SET_APPLOGO', GroupLogo) commit('SET_APPLOGO', GroupLogo)
Lockr.set('systemLogo', GroupName) Lockr.set('systemLogo', GroupName)
Lockr.set('systemName', GroupLogo) 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