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
b327cbbe
Commit
b327cbbe
authored
Sep 25, 2020
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增教师管理
parent
670b8ddf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
323 additions
and
117 deletions
+323
-117
MainLayout.vue
src/layouts/MainLayout.vue
+1
-1
school.vue
src/pages/school/school.vue
+0
-80
teacher.vue
src/pages/school/teacher.vue
+286
-0
routes.js
src/router/routes.js
+36
-36
No files found.
src/layouts/MainLayout.vue
View file @
b327cbbe
...
...
@@ -132,7 +132,7 @@
<div
class=
"column items-center"
>
<q-avatar
size=
"72px"
>
<img
src=
"https://cdn.quasar.dev/img/boy-avatar.png
"
>
<img
:src=
"userInfo.UserIcon
"
>
</q-avatar>
<div
class=
"text-subtitle1 q-mt-md q-mb-xs"
>
{{userInfo.AccountName}}
</div>
...
...
src/pages/school/school.vue
deleted
100644 → 0
View file @
670b8ddf
<
template
>
<div
class=
"school"
>
</div>
</
template
>
<
script
>
export
default
{
meta
:
{
title
:
'登录 - 麦子教育系统'
,
},
data
()
{
return
{
DataList
:
[],
total
:
0
,
};
},
created
()
{
},
mounted
()
{
this
.
TestApi
();
//this.getschool();
},
watch
:
{
$route
:
{
handler
:
function
(
route
)
{
this
.
redirect
=
route
.
query
&&
route
.
query
.
redirect
},
immediate
:
true
}
},
methods
:
{
getschool
()
{
this
.
$store
.
dispatch
(
'GetSchoolPage'
,
{
pageIndex
:
1
,
pageSize
:
10
})
.
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
DataList
=
res
.
Data
.
PageData
;
this
.
total
=
res
.
Data
.
Count
}
})
.
catch
(()
=>
{
})
},
TestApi
()
{
var
cmdStr
=
"/Public"
;
var
data
=
{}
cmdStr
+=
"/RemoveRole"
//RemoveAssist
data
=
{
RoleId
:
9
,
};
this
.
$store
.
dispatch
(
'TestWebApi'
,
{
cmdStr
,
data
})
.
then
(
res
=>
{
console
.
log
(
"res"
,
res
);
})
.
catch
(()
=>
{
})
}
},
};
</
script
>
<
style
scoped
>
</
style
>
src/pages/school/teacher.vue
0 → 100644
View file @
b327cbbe
<
template
>
<div
class=
"page-body"
>
<div
class=
"page-search row items-center"
>
<div
class=
"col row wrap q-mr-lg q-col-gutter-md"
>
<div
class=
"col-3"
>
<q-input
@
change=
"resetSearch"
clearable
standout=
"bg-primary text-white"
v-model=
"msg.SName"
label=
"校区名称"
/>
</div>
<div
class=
"col-3"
>
<q-select
@
input=
"resetSearch"
standout=
"bg-primary text-white"
v-model=
"StatusTemp"
:options=
"StatusOpts"
option-value=
"value"
option-label=
"label"
label=
"校区状态"
/>
</div>
</div>
<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-dropdown
outline
color=
"dark"
label=
"更多"
>
<q-list>
<q-item
clickable
v-close-popup
@
click=
"onItemClick"
>
<!--
<q-item-section
side
>
<q-icon
name=
"style"
/>
</q-item-section>
-->
<q-item-section>
<q-item-label>
导出
</q-item-label>
</q-item-section>
</q-item>
<q-item
clickable
v-close-popup
@
click=
"onItemClick"
>
<q-item-section>
<q-item-label>
导入
</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div>
<div
class=
"page-content"
>
<q-table
:pagination=
"msg"
:loading=
"loading"
no-data-label=
"暂无相关数据"
flat
class=
"sticky-column-table"
separator=
"none"
title=
"校区信息"
:data=
"data"
:columns=
"columns"
row-key=
"name"
>
<template
v-slot:body-cell-Status=
"props"
>
<q-td
:props=
"props"
>
<q-badge
:color=
"props.value==1?'negative':'primary'"
:label=
"props.value==1?'关闭':'正常'"
/>
</q-td>
</
template
>
<
template
v-slot:body-cell-Remark=
"props"
>
<q-td
:props=
"props"
>
<q-badge
color=
"grey-3 text-grey-10"
:label=
"props.value"
/>
</q-td>
</
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-td>
</
template
>
<
template
v-slot:bottom
>
<q-pagination
class=
"full-width justify-end"
v-model=
"msg.pageIndex"
color=
"primary"
:max=
"pageCount"
:input=
"true"
@
input=
"changePage"
/>
</
template
>
</q-table>
<q-dialog
v-model=
"persistent"
content-class=
"bg-grey-1"
persistent
transition-show=
"scale"
transition-hide=
"scale"
>
<q-card
style=
"width: 800px;max-width:900px;"
>
<q-card-section>
<div
class=
"text-h6"
>
{{objOption.SId==0?'新增校区':'修改校区'}}
</div>
</q-card-section>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
基本资料
</div>
<q-card-section
class=
"q-pt-none"
>
<div
class=
"row wrap"
>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.SName"
ref=
"SName"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"校区名称"
:rules=
"[val => !!val || '请填写校区名称']"
/>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.SAddress"
ref=
"SAddress"
class=
"col-6 q-pb-lg"
label=
"校区地址"
:rules=
"[val => !!val || '请填写校区地址']"
/>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.SLinkMan"
ref=
"SLinkMan"
class=
"col-6 q-pr-lg q-pb-lg "
label=
"校区联系人"
:rules=
"[val => !!val || '请填写校区联系人']"
/>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.SLinkTel"
ref=
"SLinkTel"
class=
"col-6 q-pb-lg"
label=
"校区联系电话"
:rules=
"[val => !!val || '请填写校区联系电话']"
/>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.Remark"
class=
"col-6 q-pb-lg q-pr-lg"
label=
"校区备注"
/>
<div
class=
"col-6"
>
<q-toggle
size=
"md"
label=
"校区状态"
color=
"primary"
:false-value=
"1"
:true-value=
"0"
v-model=
"objOption.Status"
/>
<div
class=
"text-grey-6 text-caption"
>
注意:关闭校区后,所有下属教师、学生将无法继续使用系统
</div>
</div>
</div>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
label=
"取消"
color=
"dark"
style=
"font-weight:400 !important"
@
click=
"closeSaveForm"
/>
<q-btn
label=
"立即提交"
color=
"accent q-px-md"
style=
"font-weight:400 !important"
:loading=
"saveLoading"
@
click=
"saveSchool"
/>
</q-card-actions>
</q-card>
</q-dialog>
</div>
</div>
</template>
<
script
>
import
{
getSchoolPage
,
saveSchool
}
from
'../../api/school/index'
export
default
{
meta
:
{
title
:
"教师管理"
},
data
()
{
return
{
currentUrl
:
""
,
columns
:
[{
name
:
'SName'
,
required
:
true
,
label
:
'公司名称'
,
align
:
'left'
,
field
:
row
=>
row
.
SName
,
format
:
val
=>
`
${
val
}
`
,
sortable
:
true
},
{
name
:
'GroupName'
,
label
:
'所属机构'
,
field
:
'GroupName'
,
align
:
'left'
,
sortable
:
true
},
{
name
:
'SLinkMan'
,
label
:
'负责人'
,
field
:
'SLinkMan'
,
align
:
'left'
,
sortable
:
true
},
{
name
:
'SLinkTel'
,
label
:
'负责人电话'
,
align
:
'left'
,
field
:
'SLinkTel'
},
{
name
:
'Status'
,
label
:
'状态'
,
align
:
'left'
,
field
:
'Status'
},
{
name
:
'CreateByName'
,
label
:
'创建人'
,
align
:
'left'
,
field
:
'CreateByName'
},
{
name
:
'CreateTimeStr'
,
label
:
'建立时间'
,
align
:
'left'
,
field
:
'CreateTimeStr'
},
{
name
:
'Remark'
,
label
:
'备注'
,
align
:
'left'
,
field
:
'Remark'
},
{
name
:
'optioned'
,
label
:
'操作'
,
field
:
'SId'
},
],
data
:
[],
loading
:
true
,
StatusOpts
:
[{
label
:
'全部'
,
value
:
'-1'
},
{
label
:
'开启'
,
value
:
'0'
},
{
label
:
'关闭'
,
value
:
'1'
}
],
msg
:
{
pageIndex
:
1
,
pageSize
:
13
,
rowsPerPage
:
13
,
SName
:
""
,
Status
:
'-1'
},
StatusTemp
:
{},
pageCount
:
0
,
persistent
:
false
,
objOption
:
{},
saveLoading
:
false
}
},
created
()
{
this
.
StatusTemp
=
this
.
StatusOpts
[
0
]
},
mounted
()
{
this
.
currentUrl
=
this
.
$route
.
path
this
.
getSchool
()
},
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
.
getSchool
()
},
changePage
(
val
)
{
this
.
msg
.
Status
=
this
.
StatusTemp
?
this
.
StatusTemp
.
value
:
'-1'
this
.
msg
.
pageIndex
=
1
this
.
loading
=
true
this
.
getSchool
()
},
getSchool
()
{
getSchoolPage
(
this
.
msg
).
then
(
res
=>
{
this
.
loading
=
false
this
.
data
=
res
.
Data
.
PageData
this
.
pageCount
=
res
.
Data
.
PageCount
}).
catch
(()
=>
{
this
.
loading
=
false
})
},
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
>
<
style
lang=
"sass"
>
@import
url('~assets/css/table.sass');
</
style
>
src/router/routes.js
View file @
b327cbbe
const
routes
=
[{
path
:
'/'
,
component
:
()
=>
import
(
'pages/user/login.vue'
)
},
{
path
:
'/login'
,
component
:
()
=>
import
(
'pages/user/login.vue'
)
},
{
path
:
'/home'
,
component
:
()
=>
import
(
'layouts/MainLayout.vue'
),
children
:
[{
path
:
''
,
path
:
"/"
,
component
:
()
=>
import
(
'pages/Index.vue'
)
},
{
path
:
'/school/manager'
,
import
(
"pages/user/login.vue"
)
},
{
path
:
"/login"
,
component
:
()
=>
import
(
'pages/school/manager.vue'
)
},
{
path
:
'/school'
,
import
(
"pages/user/login.vue"
)
},
{
path
:
"/home"
,
component
:
()
=>
import
(
'pages/school/school.vue'
)
},
]
},
import
(
"layouts/MainLayout.vue"
),
children
:
[{
path
:
""
,
component
:
()
=>
import
(
"pages/Index.vue"
)
},
{
path
:
"/school/manager"
,
component
:
()
=>
import
(
"pages/school/manager.vue"
)
},
{
path
:
"/school/teacher"
,
component
:
()
=>
import
(
"pages/school/teacher.vue"
)
},
]
},
// Always leave this as last one,
// but you can also remove it
{
path
:
'*'
,
component
:
()
=>
import
(
'pages/Error404.vue'
)
}
]
// Always leave this as last one,
// but you can also remove it
{
path
:
"*"
,
component
:
()
=>
import
(
"pages/Error404.vue"
)
}
]
;
export
default
routes
export
default
routes
;
\ No newline at end of file
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