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
8522efa2
Commit
8522efa2
authored
Oct 20, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
8b52d12e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
37 deletions
+39
-37
teacher-form.vue
src/components/school/teacher/teacher-form.vue
+36
-34
teacher.vue
src/pages/school/teacher.vue
+3
-3
No files found.
src/components/school/teacher/teacher-form.vue
View file @
8522efa2
...
...
@@ -10,8 +10,9 @@
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.TeacherName"
ref=
"TeacherName"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"教师名称"
:rules=
"[val => !!val || '请填写教师姓名']"
/>
<q-select
filled
stack-label
option-value=
"SId"
option-label=
"SName"
v-model=
"objOption.School_Id"
ref=
"School_Id"
:options=
"schoolList"
label=
"所属校区"
:dense=
"false"
class=
"col-6 q-pb-lg"
:rules=
"[val => !!val || '请选择所属校区']"
/>
ref=
"School_Id"
:options=
"schoolList"
label=
"所属校区"
:dense=
"false"
class=
"col-6 q-pb-lg"
emit-value
map-options
:rules=
"[val => !!val || '请选择所属校区']"
/>
<q-input
type=
"tel"
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"objOption.TeacherTel"
ref=
"TeacherTel"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"联系电话"
:rules=
"[val => !!val || '请填写教师联系电话']"
/>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"objOption.TeacherSay"
ref=
"TeacherSay"
...
...
@@ -21,8 +22,6 @@
:style=
"
{'background-image':'url(' + objOption.TeacherHead + ')'}" max-files="1" hide-upload-btn
@rejected="onRejected" label="教师头像" :max-file-size="512*1024" accept=".jpg, image/*" auto-upload
:factory="uploadFile" no-thumbnails @added="getType(1)">
<template
v-slot:list=
"scope"
>
</
template
>
</q-uploader>
</div>
<div
class=
"col-6 q-pb-lg"
>
...
...
@@ -30,8 +29,6 @@
:style=
"
{'background-image':'url(' + objOption.TeacherIcon + ')'}" max-files="1" hide-upload-btn
@rejected="onRejected" label="教师形象照" :max-file-size="512*1024" accept=".jpg, image/*" auto-upload
:factory="uploadFile" no-thumbnails @added="getType(2)">
<
template
v-slot:list=
"scope"
>
</
template
>
</q-uploader>
</div>
<ext-editor
:defaultMsg=
"objOption.TeacherIntro"
classStr=
"col-12"
@
getEditValue=
"getEditValue"
></ext-editor>
...
...
@@ -95,7 +92,20 @@
data
()
{
return
{
persistent
:
true
,
objOption
:
{},
objOption
:
{
TId
:
0
,
School_Id
:
''
,
TeacherName
:
""
,
TeacherTel
:
''
,
TeacherHead
:
''
,
TeacherIcon
:
''
,
TeacherSay
:
''
,
TeacherIntro
:
''
,
IsShow
:
1
,
IsRecommend
:
0
,
SortNum
:
1
,
TeachTag
:
""
},
optionTitle
:
""
,
schoolList
:
[],
uploadType
:
0
,
...
...
@@ -104,8 +114,10 @@
tags
:
[],
}
},
moun
ted
()
{
crea
ted
()
{
this
.
getSchool
()
},
mounted
()
{
this
.
initObj
()
},
methods
:
{
...
...
@@ -119,25 +131,23 @@
initObj
()
{
if
(
this
.
saveObj
)
{
this
.
optionTitle
=
"修改教师信息"
this
.
objOption
=
this
.
saveObj
this
.
objOption
.
TId
=
this
.
saveObj
.
TId
;
this
.
objOption
.
School_Id
=
this
.
saveObj
.
School_Id
;
this
.
objOption
.
TeacherName
=
this
.
saveObj
.
TeacherName
;
this
.
objOption
.
TeacherTel
=
this
.
saveObj
.
TeacherTel
;
this
.
objOption
.
TeacherHead
=
this
.
saveObj
.
TeacherHead
;
this
.
objOption
.
TeacherIcon
=
this
.
saveObj
.
TeacherIcon
;
this
.
objOption
.
TeacherSay
=
this
.
saveObj
.
TeacherSay
;
this
.
objOption
.
TeacherIntro
=
this
.
saveObj
.
TeacherIntro
;
this
.
objOption
.
IsShow
=
this
.
saveObj
.
IsShow
;
this
.
objOption
.
IsRecommend
=
this
.
saveObj
.
IsRecommend
;
this
.
objOption
.
SortNum
=
this
.
saveObj
.
SortNum
;
this
.
objOption
.
TeachTag
=
this
.
saveObj
.
TeachTag
;
if
(
this
.
objOption
.
TeachTag
&&
this
.
objOption
.
TeachTag
.
length
>
0
)
{
this
.
tags
=
JSON
.
parse
(
this
.
objOption
.
TeachTag
)
}
}
else
{
this
.
optionTitle
=
"新增教师"
this
.
objOption
=
{
TId
:
0
,
School_Id
:
''
,
TeacherName
:
""
,
TeacherTel
:
''
,
TeacherHead
:
''
,
TeacherIcon
:
''
,
TeacherSay
:
''
,
TeacherIntro
:
''
,
IsShow
:
1
,
IsRecommend
:
0
,
SortNum
:
1
}
}
},
removeTag
(
i
)
{
...
...
@@ -145,14 +155,9 @@
},
getSchool
()
{
getSchoolDropdown
({}).
then
(
res
=>
{
this
.
schoolList
=
res
.
Data
if
(
this
.
objOption
.
School_Id
!=
''
)
{
this
.
objOption
.
School_Id
=
this
.
schoolList
.
filter
(
x
=>
{
if
(
this
.
objOption
.
School_Id
==
x
.
SId
)
{
return
x
}
})[
0
]
}
this
.
schoolList
=
res
.
Data
;
console
.
log
(
"this.schoolList"
,
this
.
schoolList
);
this
.
$forceUpdate
();
})
},
onRejected
(
rejectedEntries
)
{
...
...
@@ -188,7 +193,6 @@
this
.
$refs
.
School_Id
.
validate
()
this
.
$refs
.
TeacherName
.
validate
()
this
.
$refs
.
TeacherTel
.
validate
()
let
tempSchool
=
null
if
(
!
this
.
$refs
.
School_Id
.
hasError
&&
!
this
.
$refs
.
TeacherName
.
hasError
&&
...
...
@@ -201,8 +205,6 @@
err_msg
=
"请上传用户头像"
}
if
(
err_msg
==
""
)
{
tempSchool
=
this
.
objOption
.
School_Id
this
.
objOption
.
School_Id
=
this
.
objOption
.
School_Id
.
SId
this
.
objOption
.
TeachTag
=
JSON
.
stringify
(
this
.
tags
)
saveTeacher
(
this
.
objOption
).
then
(
res
=>
{
this
.
saveLoading
=
false
...
...
@@ -217,7 +219,7 @@
this
.
closeSaveForm
()
}).
catch
(()
=>
{
this
.
saveLoading
=
false
this
.
objOption
.
School_Id
=
tempSchool
})
}
else
{
this
.
$q
.
notify
({
...
...
src/pages/school/teacher.vue
View file @
8522efa2
...
...
@@ -48,7 +48,7 @@
<q-badge
:color=
"props.value==0?'negative':'primary'"
:label=
"props.value==0?'隐藏':'显示'"
/>
</q-td>
</
template
>
<
template
v-slot:body-cell-Teacher
Icon
=
"props"
>
<
template
v-slot:body-cell-Teacher
Head
=
"props"
>
<q-td
:props=
"props"
>
<q-avatar
size=
"md"
>
<img
:src=
"props.value"
/>
...
...
@@ -140,9 +140,9 @@
return
{
currentUrl
:
""
,
columns
:
[{
name
:
'Teacher
Icon
'
,
name
:
'Teacher
Head
'
,
label
:
''
,
field
:
'Teacher
Icon
'
,
field
:
'Teacher
Head
'
,
align
:
'left'
,
},
{
...
...
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