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
4458daf1
Commit
4458daf1
authored
Oct 16, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
7601d90b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
120 additions
and
77 deletions
+120
-77
index.js
src/api/course/index.js
+29
-7
ext-editor.vue
src/components/common/ext-editor.vue
+15
-5
select-tree.vue
src/components/common/select-tree.vue
+6
-7
course-form.vue
src/components/course/course-form.vue
+7
-3
teachplan-form.vue
src/components/course/teachplan-form.vue
+51
-41
course.vue
src/pages/course/course.vue
+2
-1
teachplan.vue
src/pages/course/teachplan.vue
+10
-13
No files found.
src/api/course/index.js
View file @
4458daf1
...
...
@@ -135,11 +135,33 @@ export function updateCourseTeacher(data) {
* 获取课程教案分页
* @param {JSON对象} data
*/
export
function
queryTeachPlanPage
(
data
)
{
return
request
({
url
:
"/Course/GetCourseTeachPlanPage"
,
method
:
'post'
,
data
})
export
function
queryTeachPlanPage
(
data
)
{
return
request
({
url
:
"/Course/GetCourseTeachPlanPage"
,
method
:
'post'
,
data
})
}
/**
* 获取课程教案信息
*/
export
function
queryTeachPlanInfo
(
data
)
{
return
request
({
url
:
"/Course/GetTeachPlan"
,
method
:
'post'
,
data
})
}
/**
* 保存课程教案
* @param {JSON数据} data
*/
export
function
saveTeachPlanInfo
(
data
)
{
return
request
({
url
:
"/Course/SetTeachPlan"
,
method
:
'post'
,
data
})
}
src/components/common/editor.vue
→
src/components/common/e
xt-e
ditor.vue
View file @
4458daf1
<
template
>
<q-editor
:toolbar=
"toolbar"
:fonts=
"fonts"
v-model=
"
defaul
tMsg"
:class=
"classStr"
:definitions=
"
{bold: {label: 'Bold', icon: null, tip: 'My bold tooltip'}}" />
<q-editor
:toolbar=
"toolbar"
:fonts=
"fonts"
v-model=
"
edi
tMsg"
:class=
"classStr"
:definitions=
"
{bold: {label: 'Bold', icon: null, tip: 'My bold tooltip'}}"
@input="getEditorValue"
/>
</
template
>
<
script
>
import
{
...
...
@@ -8,7 +8,7 @@
}
from
'../../api/common/common'
export
default
{
props
:
{
//
树形结构列表
//
默认数据
defaultMsg
:
{
type
:
String
,
default
:
""
...
...
@@ -20,17 +20,28 @@
},
data
()
{
return
{
editMsg
:
""
,
toolbar
:
[],
fonts
:
{},
}
},
watch
:
{
defaultMsg
:
{
handler
(
newValue
)
{
this
.
editMsg
=
this
.
defaultMsg
;
},
immediate
:
true
}
},
mounted
()
{
this
.
initToolBar
();
},
methods
:
{
//获取编辑器值
getEditorValue
()
{
this
.
$emit
(
'getEditValue'
,
this
.
editMsg
);
},
//初始化配置
initToolBar
()
{
this
.
toolbar
=
[
[{
...
...
@@ -98,7 +109,6 @@
];
this
.
fonts
=
getFontConfig
();
},
}
}
...
...
src/components/common/select-tree.vue
View file @
4458daf1
...
...
@@ -42,7 +42,6 @@
defaultArray
:
{
type
:
Array
,
required
:
true
,
},
//节点Key
nodeKey
:
{
...
...
@@ -95,9 +94,9 @@
}
this
.
setTreeCheckNode
()
},
defaultArray
(
val
)
{
if
(
val
)
{
if
(
this
.
defaultArray
&&
Array
.
isArray
(
this
.
defaultArray
)
&&
this
.
defaultArray
.
length
>
0
)
{
defaultArray
:
{
handler
(
newValue
)
{
if
(
this
.
defaultArray
&&
this
.
defaultArray
.
length
>
0
)
{
this
.
defaultArray
.
forEach
(
item
=>
{
if
(
item
!=
''
)
{
if
(
this
.
multiple
)
{
...
...
@@ -109,11 +108,11 @@
})
}
this
.
setTreeCheckNode
();
}
},
immediate
:
true
}
},
mounted
()
{
},
mounted
()
{},
methods
:
{
//全选
checkAll
()
{
...
...
src/components/course/course-form.vue
View file @
4458daf1
...
...
@@ -22,7 +22,7 @@
</div>
<div
class=
"text-caption q-my-md q-px-xs text-grey-6"
>
课程介绍
</div>
<e
ditor
:defaultMsg=
"objOption.CourseIntro"
classStr=
"col-12"
></
editor>
<e
xt-editor
:defaultMsg=
"objOption.CourseIntro"
classStr=
"col-12"
@
getEditValue=
"getEditValue"
></ext-
editor>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
...
...
@@ -45,11 +45,11 @@
UploadSelfFile
}
from
'../../api/common/common'
import
selectTree
from
'../common/select-tree'
import
e
ditor
from
'../common/
editor'
import
e
xtEditor
from
'../common/ext-
editor'
export
default
{
components
:
{
selectTree
,
editor
,
e
xtE
ditor
,
},
props
:
{
saveObj
:
{
...
...
@@ -78,6 +78,10 @@
this
.
initObj
()
},
methods
:
{
//获取编辑器值
getEditValue
(
obj
)
{
this
.
objOption
.
CourseIntro
=
obj
;
},
getChild
(
obj
)
{
this
.
objOption
.
CateId
=
obj
;
},
...
...
src/components/course/teachplan-form.vue
View file @
4458daf1
...
...
@@ -7,18 +7,21 @@
<q-card-section
class=
"q-pt-none scroll"
style=
"max-height: 70vh"
>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
教案信息
</div>
<div
class=
"row wrap"
>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.
CourseName"
ref=
"Course
Name"
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.
PlanName"
ref=
"Plan
Name"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"教案名称"
:rules=
"[val => !!val || '请填写教案名称']"
/>
<!--
<div
class=
"col-6 q-pb-lg upload-assiatant-box"
>
<q-uploader
:style=
"
{backgroundImage:'url(' + objOption.CoverImg + ')'}" flat hide-upload-btn max-files="1"
label="课程封面" :max-file-size="512*1024" accept=".jpg, image/*" :factory="uploadFile" auto-upload>
</q-uploader>
</div>
-->
</div>
<editor
:defaultMsg=
"objOption.CourseIntro"
classStr=
"col-12"
>
</editor>
<div
class=
"text-caption q-my-md q-px-xs text-grey-6"
>
课前
</div>
<ext-editor
:defaultMsg=
"objOption.ClassBefore"
classStr=
"col-12"
@
getEditValue=
"getEditValue1"
>
</ext-editor>
<div
class=
"text-caption q-my-md q-px-xs text-grey-6"
>
课中
</div>
<ext-editor
:defaultMsg=
"objOption.ClassIn"
classStr=
"col-12"
@
getEditValue=
"getEditValue2"
>
</ext-editor>
<div
class=
"text-caption q-my-md q-px-xs text-grey-6"
>
课后
</div>
<ext-editor
:defaultMsg=
"objOption.ClassAfter"
classStr=
"col-12"
@
getEditValue=
"getEditValue3"
>
</ext-editor>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
...
...
@@ -32,15 +35,14 @@
<
script
>
import
{
queryCourseCategoryTree
,
saveCourseInfo
,
queryCourseInfo
,
queryTeachPlanInfo
,
saveTeachPlanInfo
}
from
'../../api/course/index'
import
e
ditor
from
'../common/
editor'
import
e
xtEditor
from
'../common/ext-
editor'
export
default
{
components
:
{
editor
e
xtE
ditor
},
props
:
{
saveObj
:
{
...
...
@@ -53,18 +55,17 @@
persistent
:
true
,
objOption
:
{
PlanId
:
0
,
//教案编号
CourseId
:
0
,
//课程编辑
CourseId
:
0
,
//课程编辑
PlanName
:
""
,
//教案名称
ClassBefore
:
""
,
//课前
ClassIn
:
""
,
//课中
ClassAfter
:
""
,
//课后
ParentPlanId
:
0
,
//父级节点编号
SourceUrl
:
""
,
//源文件路径
PlanFileExtension
:
""
,
//文件后缀名
PlanNodeType
:
0
,
//节点类型(0-文件,1-文件夹)
ExtUrl
:
""
,
//上传生成文件路径
Remark
:
""
,
//备注
CateId
:
0
,
//课程编号
ClassAfter
:
""
,
//课后
ParentPlanId
:
0
,
//父级节点编号
SourceUrl
:
""
,
//源文件路径
PlanFileExtension
:
""
,
//文件后缀名
PlanNodeType
:
0
,
//节点类型(0-文件,1-文件夹)
ExtUrl
:
""
,
//上传生成文件路径
Remark
:
""
,
//备注
},
optionTitle
:
""
,
saveCourseLoading
:
false
,
...
...
@@ -75,6 +76,15 @@
this
.
initObj
()
},
methods
:
{
getEditValue1
(
obj
)
{
this
.
objOption
.
ClassBefore
=
obj
;
},
getEditValue2
(
obj
)
{
this
.
objOption
.
ClassIn
=
obj
;
},
getEditValue3
(
obj
)
{
this
.
objOption
.
ClassAfter
=
obj
;
},
uploadFile
(
files
)
{
UploadSelfFile
(
'course'
,
files
[
0
],
res
=>
{
if
(
res
.
resultCode
==
1
)
{
...
...
@@ -82,28 +92,28 @@
}
})
},
//初始化表单
initObj
()
{
if
(
this
.
saveObj
&&
this
.
saveObj
.
Course
Id
>
0
)
{
query
Course
Info
({
CourseId
:
this
.
saveObj
.
Course
Id
if
(
this
.
saveObj
&&
this
.
saveObj
.
Plan
Id
>
0
)
{
query
TeachPlan
Info
({
PlanId
:
this
.
saveObj
.
Plan
Id
}).
then
(
res
=>
{
this
.
objOption
.
PlanName
=
res
.
Data
.
PlanName
;
this
.
objOption
.
PlanId
=
res
.
Data
.
PlanId
;
this
.
objOption
.
CourseId
=
res
.
Data
.
CourseId
;
this
.
objOption
.
CoverImg
=
res
.
Data
.
CoverImg
;
this
.
objOption
.
CourseName
=
res
.
Data
.
CourseName
;
this
.
objOption
.
CourseIntro
=
res
.
Data
.
CourseIntro
;
this
.
objOption
.
CateId
=
res
.
Data
.
CateId
;
this
.
returnString
=
res
.
Data
.
CateId
;
this
.
objOption
.
ClassBefore
=
res
.
Data
.
ClassBefore
;
this
.
objOption
.
ClassIn
=
res
.
Data
.
ClassIn
;
this
.
objOption
.
ClassAfter
=
res
.
Data
.
ClassAfter
;
this
.
objOption
.
ParentPlanId
=
res
.
Data
.
ParentPlanId
;
this
.
objOption
.
SourceUrl
=
res
.
Data
.
SourceUrl
;
this
.
objOption
.
PlanFileExtension
=
res
.
Data
.
PlanFileExtension
;
this
.
objOption
.
PlanNodeType
=
res
.
Data
.
PlanNodeType
;
this
.
objOption
.
ExtUrl
=
res
.
Data
.
ExtUrl
;
this
.
objOption
.
Remark
=
res
.
Data
.
Remark
;
})
this
.
optionTitle
=
"修改
课程
信息"
this
.
optionTitle
=
"修改
教案
信息"
}
else
{
this
.
optionTitle
=
"新增课程"
this
.
objOption
.
CourseId
=
0
;
this
.
objOption
.
CoverImg
=
""
;
this
.
objOption
.
CourseName
=
""
;
this
.
objOption
.
CourseIntro
=
""
;
this
.
objOption
.
CateId
=
0
;
this
.
optionTitle
=
"新增教案"
}
},
//关闭弹窗
...
...
@@ -114,7 +124,7 @@
//保存菜单
saveCourse
()
{
this
.
saveCourseLoading
=
true
save
Course
Info
(
this
.
objOption
).
then
(
res
=>
{
save
TeachPlan
Info
(
this
.
objOption
).
then
(
res
=>
{
this
.
saveCourseLoading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
...
...
src/pages/course/course.vue
View file @
4458daf1
...
...
@@ -53,7 +53,8 @@
</q-td>
</
template
>
</q-table>
<course-form
v-if=
"isShowCourseForm"
:save-obj=
"courseObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
<course-form
v-if=
"isShowCourseForm"
:save-obj=
"courseObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
</course-form>
</div>
</div>
...
...
src/pages/course/teachplan.vue
View file @
4458daf1
...
...
@@ -53,7 +53,8 @@
</q-td>
</
template
>
</q-table>
<teachplan-form
v-if=
"isShowMenuForm"
:save-obj=
"menuObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
<teachplan-form
v-if=
"IsShowTeachForm"
:save-obj=
"teachPlanObj"
@
close=
"closeTeachSaveForm"
@
success=
"refreshPage"
>
</teachplan-form>
</div>
</div>
...
...
@@ -88,7 +89,6 @@
align
:
'left'
,
field
:
row
=>
row
.
PlanName
},
{
name
:
'CreateByName'
,
label
:
'创建人'
,
...
...
@@ -121,12 +121,9 @@
rowsPerPage
:
12
,
CourseId
:
1
,
},
//课程分类树形列表
TreeCategoryList
:
[],
returnString
:
""
,
//返回字符串
pageCount
:
0
,
isShowMenu
Form
:
false
,
menuObjOption
:
null
,
IsShowTeach
Form
:
false
,
teachPlanObj
:
null
,
}
},
mounted
()
{
...
...
@@ -157,21 +154,21 @@
},
//刷新页面
refreshPage
()
{
this
.
isShowMenu
Form
=
false
;
this
.
IsShowTeach
Form
=
false
;
this
.
getteachplanList
();
},
//新增修改菜单
EditTeachPlan
(
obj
)
{
if
(
obj
)
{
this
.
menuObjOption
=
obj
this
.
teachPlanObj
=
obj
}
else
{
this
.
menuObjOption
=
null
this
.
teachPlanObj
=
null
}
this
.
isShowMenu
Form
=
true
this
.
IsShowTeach
Form
=
true
},
//关闭弹窗
close
Menu
SaveForm
()
{
this
.
isShowMenu
Form
=
false
close
Teach
SaveForm
()
{
this
.
IsShowTeach
Form
=
false
}
}
}
...
...
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