Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
a5f26e75
Commit
a5f26e75
authored
Sep 29, 2020
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理完成教师的功能
parent
a2130725
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
264 additions
and
90 deletions
+264
-90
index.js
src/api/school/index.js
+23
-0
teacher-form.vue
src/components/school/teacher-form.vue
+187
-16
MainLayout.vue
src/layouts/MainLayout.vue
+3
-3
manager.vue
src/pages/school/manager.vue
+3
-1
teacher.vue
src/pages/school/teacher.vue
+40
-69
app.js
src/store/modules/app.js
+8
-1
No files found.
src/api/school/index.js
View file @
a5f26e75
...
...
@@ -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
src/components/school/teacher-form.vue
View file @
a5f26e75
This diff is collapsed.
Click to expand it.
src/layouts/MainLayout.vue
View file @
a5f26e75
...
...
@@ -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
({
...
...
src/pages/school/manager.vue
View file @
a5f26e75
...
...
@@ -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
...
...
src/pages/school/teacher.vue
View file @
a5f26e75
...
...
@@ -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=
"
init
Obj(null)"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
icon=
"add"
label=
"新增教师"
@
click=
"
add
Obj(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=
"
init
Obj(props.value)"
/>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-family:perfectFont"
label=
"编辑"
@
click=
"
add
Obj(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
>
...
...
src/store/modules/app.js
View file @
a5f26e75
...
...
@@ -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
)
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment