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
e1b0ccd6
Commit
e1b0ccd6
authored
Oct 16, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增页面
parent
1249f642
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
453 additions
and
16 deletions
+453
-16
index.js
src/api/course/index.js
+13
-0
editor.vue
src/components/common/editor.vue
+105
-0
select-tree.vue
src/components/common/select-tree.vue
+1
-1
category-form.vue
src/components/course/category-form.vue
+1
-1
course-form.vue
src/components/course/course-form.vue
+1
-1
teachplan-form.vue
src/components/course/teachplan-form.vue
+135
-0
role-form.vue
src/components/system/role-form.vue
+1
-1
course.vue
src/pages/course/course.vue
+8
-12
teachplan.vue
src/pages/course/teachplan.vue
+183
-0
routes.js
src/router/routes.js
+5
-0
No files found.
src/api/course/index.js
View file @
e1b0ccd6
...
...
@@ -130,3 +130,16 @@ export function updateCourseTeacher(data) {
data
})
}
/**
* 获取课程教案分页
* @param {JSON对象} data
*/
export
function
queryTeachPlanPage
(
data
)
{
return
request
({
url
:
"/Course/GetCourseTeachPlanPage"
,
method
:
'post'
,
data
})
}
src/components/common/editor.vue
0 → 100644
View file @
e1b0ccd6
<
template
>
<q-editor
:toolbar=
"toolbar"
:fonts=
"fonts"
v-model=
"defaultMsg"
:class=
"classStr"
:definitions=
"
{bold: {label: 'Bold', icon: null, tip: 'My bold tooltip'}}" />
</
template
>
<
script
>
import
{
getFontConfig
,
}
from
'../../api/common/common'
export
default
{
props
:
{
//树形结构列表
defaultMsg
:
{
type
:
String
,
default
:
""
},
classStr
:
{
type
:
String
,
default
:
""
}
},
data
()
{
return
{
toolbar
:
[],
fonts
:
{},
}
},
watch
:
{
},
mounted
()
{
this
.
initToolBar
();
},
methods
:
{
initToolBar
()
{
this
.
toolbar
=
[
[{
label
:
'对齐'
,
icon
:
this
.
$q
.
iconSet
.
editor
.
align
,
fixedLabel
:
true
,
list
:
'only-icons'
,
options
:
[
'left'
,
'center'
,
'right'
,
'justify'
]
}],
[
'bold'
,
'italic'
,
'strike'
,
'underline'
,
'subscript'
,
'superscript'
],
[{
label
:
'格式'
,
icon
:
this
.
$q
.
iconSet
.
editor
.
formatting
,
list
:
'no-icons'
,
fixedLabel
:
true
,
fixedIcon
:
true
,
options
:
[
'p'
,
'h1'
,
'h2'
,
'h3'
,
'h4'
,
'h5'
,
'h6'
,
'code'
]
},
{
label
:
'字号'
,
icon
:
this
.
$q
.
iconSet
.
editor
.
fontSize
,
fixedLabel
:
true
,
fixedIcon
:
true
,
list
:
'no-icons'
,
options
:
[
'size-1'
,
'size-2'
,
'size-3'
,
'size-4'
,
'size-5'
,
'size-6'
,
'size-7'
]
},
{
label
:
'字体'
,
icon
:
this
.
$q
.
iconSet
.
editor
.
font
,
fixedLabel
:
true
,
fixedIcon
:
true
,
list
:
'no-icons'
,
options
:
[
'default_font'
,
'arial'
,
'arial_black'
,
'comic_sans'
,
'courier_new'
,
'impact'
,
'lucida_grande'
,
'times_new_roman'
,
'verdana'
]
},
'removeFormat'
],
[
'ordered'
,
'outdent'
,
'indent'
],
];
this
.
fonts
=
getFontConfig
();
},
}
}
</
script
>
src/components/common/select-tree.vue
View file @
e1b0ccd6
...
...
@@ -6,7 +6,7 @@
<q-btn
round
dense
flat
icon=
"search"
/>
</
template
>
</q-input>
<q-card
style=
"width:100%;position:absolute;z-index:
99999
;background:#fff;border:1px solid rgba(0, 0, 0, 0.12);"
>
<q-card
style=
"width:100%;position:absolute;z-index:
100
;background:#fff;border:1px solid rgba(0, 0, 0, 0.12);"
>
<q-btn-group
push
v-if=
"isShowSelect"
:spread=
"true"
>
<q-btn
v-if=
"multiple"
push
label=
"全选"
@
click=
"checkAll()"
/>
<q-btn
push
label=
"清空"
@
click=
"clearMsg()"
/>
...
...
src/components/course/category-form.vue
View file @
e1b0ccd6
...
...
@@ -2,7 +2,7 @@
<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
.
Menu
Id
==
0
?
'新增课程分类信息'
:
'修改课程分类信息'
}}
</div>
<div
class=
"text-h6"
>
{{
objOption
.
Cate
Id
==
0
?
'新增课程分类信息'
:
'修改课程分类信息'
}}
</div>
</q-card-section>
<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>
...
...
src/components/course/course-form.vue
View file @
e1b0ccd6
...
...
@@ -2,7 +2,7 @@
<q-dialog
v-model=
"persistent"
persistent
transition-show=
"scale"
transition-hide=
"scale"
>
<q-card
style=
"width: 800px;max-width:900px;"
>
<q-card-section>
<div
class=
"text-h6"
>
{{
objOption
.
Menu
Id
==
0
?
'新增课程信息'
:
'修改课程信息'
}}
</div>
<div
class=
"text-h6"
>
{{
objOption
.
Course
Id
==
0
?
'新增课程信息'
:
'修改课程信息'
}}
</div>
</q-card-section>
<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>
...
...
src/components/course/teachplan-form.vue
0 → 100644
View file @
e1b0ccd6
<
template
>
<q-dialog
v-model=
"persistent"
persistent
transition-show=
"scale"
transition-hide=
"scale"
>
<q-card
style=
"width: 800px;max-width:900px;"
>
<q-card-section>
<div
class=
"text-h6"
>
{{
objOption
.
MenuId
==
0
?
'新增教案信息'
:
'修改教案信息'
}}
</div>
</q-card-section>
<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=
"CourseName"
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>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
label=
"取消"
color=
"dark"
style=
"font-weight:400 !important"
@
click=
"closeCourseForm"
/>
<q-btn
label=
"立即提交"
color=
"accent q-px-md"
style=
"font-weight:400 !important"
:loading=
"saveCourseLoading"
@
click=
"saveCourse"
/>
</q-card-actions>
</q-card>
</q-dialog>
</
template
>
<
script
>
import
{
queryCourseCategoryTree
,
saveCourseInfo
,
queryCourseInfo
,
}
from
'../../api/course/index'
import
editor
from
'../common/editor'
export
default
{
components
:
{
editor
},
props
:
{
saveObj
:
{
type
:
Object
,
default
:
null
}
},
data
()
{
return
{
persistent
:
true
,
objOption
:
{
PlanId
:
0
,
//教案编号
CourseId
:
0
,
//课程编辑
PlanName
:
""
,
//教案名称
ClassBefore
:
""
,
//课前
ClassIn
:
""
,
//课中
ClassAfter
:
""
,
//课后
ParentPlanId
:
0
,
//父级节点编号
SourceUrl
:
""
,
//源文件路径
PlanFileExtension
:
""
,
//文件后缀名
PlanNodeType
:
0
,
//节点类型(0-文件,1-文件夹)
ExtUrl
:
""
,
//上传生成文件路径
Remark
:
""
,
//备注
CateId
:
0
,
//课程编号
},
optionTitle
:
""
,
saveCourseLoading
:
false
,
TreeCategoryList
:
[],
//课程分类树形列表
}
},
mounted
()
{
this
.
initObj
()
},
methods
:
{
uploadFile
(
files
)
{
UploadSelfFile
(
'course'
,
files
[
0
],
res
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
objOption
.
CoverImg
=
res
.
FileUrl
;
}
})
},
//初始化表单
initObj
()
{
if
(
this
.
saveObj
&&
this
.
saveObj
.
CourseId
>
0
)
{
queryCourseInfo
({
CourseId
:
this
.
saveObj
.
CourseId
}).
then
(
res
=>
{
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
.
optionTitle
=
"修改课程信息"
}
else
{
this
.
optionTitle
=
"新增课程"
this
.
objOption
.
CourseId
=
0
;
this
.
objOption
.
CoverImg
=
""
;
this
.
objOption
.
CourseName
=
""
;
this
.
objOption
.
CourseIntro
=
""
;
this
.
objOption
.
CateId
=
0
;
}
},
//关闭弹窗
closeCourseForm
()
{
this
.
$emit
(
'close'
)
this
.
persistent
=
false
},
//保存菜单
saveCourse
()
{
this
.
saveCourseLoading
=
true
saveCourseInfo
(
this
.
objOption
).
then
(
res
=>
{
this
.
saveCourseLoading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'数据保存成功!'
,
position
:
'top'
})
this
.
$emit
(
"success"
)
this
.
closeSaveForm
()
}).
catch
(()
=>
{
this
.
saveCourseLoading
=
false
})
}
},
}
</
script
>
src/components/system/role-form.vue
View file @
e1b0ccd6
...
...
@@ -2,7 +2,7 @@
<q-dialog
v-model=
"persistent"
persistent
transition-show=
"scale"
transition-hide=
"scale"
>
<q-card
style=
"width: 800px;max-width:900px;"
>
<q-card-section>
<div
class=
"text-h6"
>
{{
objOption
.
Menu
Id
==
0
?
'新增角色信息'
:
'修改角色信息'
}}
</div>
<div
class=
"text-h6"
>
{{
objOption
.
Role
Id
==
0
?
'新增角色信息'
:
'修改角色信息'
}}
</div>
</q-card-section>
<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>
...
...
src/pages/course/course.vue
View file @
e1b0ccd6
...
...
@@ -53,7 +53,7 @@
</q-td>
</
template
>
</q-table>
<course-form
v-if=
"isShow
MenuForm"
:save-obj=
"menu
ObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
<course-form
v-if=
"isShow
CourseForm"
:save-obj=
"course
ObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
</course-form>
</div>
</div>
...
...
@@ -147,10 +147,6 @@
value
:
'1'
}
],
//菜单等级
MenuLevelOpts
:
[],
//菜单类型
MenuTypeOpts
:
[],
msg
:
{
pageIndex
:
1
,
pageSize
:
12
,
...
...
@@ -163,8 +159,8 @@
TreeCategoryList
:
[],
returnString
:
""
,
//返回字符串
pageCount
:
0
,
isShow
Menu
Form
:
false
,
menu
ObjOption
:
null
,
isShow
Course
Form
:
false
,
course
ObjOption
:
null
,
}
},
mounted
()
{
...
...
@@ -218,21 +214,21 @@
},
//刷新页面
refreshPage
()
{
this
.
isShow
Menu
Form
=
false
;
this
.
isShow
Course
Form
=
false
;
this
.
getcourselist
();
},
//新增修改菜单
EditCourse
(
obj
)
{
if
(
obj
)
{
this
.
menu
ObjOption
=
obj
this
.
course
ObjOption
=
obj
}
else
{
this
.
menu
ObjOption
=
null
this
.
course
ObjOption
=
null
}
this
.
isShow
Menu
Form
=
true
this
.
isShow
Course
Form
=
true
},
//关闭弹窗
closeMenuSaveForm
()
{
this
.
isShow
Menu
Form
=
false
this
.
isShow
Course
Form
=
false
}
}
}
...
...
src/pages/course/teachplan.vue
0 → 100644
View file @
e1b0ccd6
<
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>
<div
class=
"page-option"
>
<q-btn-dropdown
outline
color=
"dark"
label=
"添加教案"
>
<q-list>
<q-item
clickable
v-close-popup
>
<q-item-section>
<q-item-label
@
click=
"EditTeachPlan(null)"
>
新增教案
</q-item-label>
</q-item-section>
</q-item>
<q-item
clickable
v-close-popup
>
<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-tow-column-table"
separator=
"none"
title=
"课程信息"
:data=
"data"
:columns=
"columns"
row-key=
"name"
>
<template
v-slot:body-cell-CoverImg=
"props"
>
<q-td
:props=
"props"
>
<q-avatar
square
size=
"100px"
>
<img
:src=
"props.value"
/>
</q-avatar>
</q-td>
</
template
>
<
template
v-slot:body-cell-CourseIntro=
"props"
>
<q-td
:props=
"props"
>
<span
v-html=
"props.value"
></span>
</q-td>
</
template
>
<
template
v-slot:body-cell-Status=
"props"
>
<q-td
:props=
"props"
>
<q-badge
:color=
"props.value==1?'negative':'primary'"
:label=
"props.value==0?'正常':'禁用'"
/>
</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
>
<
template
v-slot:body-cell-optioned=
"props"
>
<q-td
:props=
"props"
>
<q-btn
flat
size=
"xs"
icon=
"iconfont icon-shanchu"
color=
"accent"
style=
"font-weight:400"
label=
"删除"
@
click=
"EditTeachPlan(props.row)"
></q-btn>
<q-btn
flat
size=
"xs"
icon=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"编辑"
@
click=
"EditTeachPlan(props.row)"
/>
</q-td>
</
template
>
</q-table>
<teachplan-form
v-if=
"isShowMenuForm"
:save-obj=
"menuObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
</teachplan-form>
</div>
</div>
</template>
<
script
>
import
{
queryTeachPlanPage
,
}
from
'../../api/course/index'
import
teachplanForm
from
'../../components/course/teachplan-form'
export
default
{
meta
:
{
title
:
"教案管理"
},
components
:
{
teachplanForm
,
},
data
()
{
return
{
currentUrl
:
""
,
columns
:
[{
name
:
'PlanId'
,
label
:
'教案编号'
,
field
:
'PlanId'
,
align
:
'left'
},
{
name
:
'PlanName'
,
required
:
true
,
label
:
'教案名称'
,
align
:
'left'
,
field
:
row
=>
row
.
PlanName
},
{
name
:
'CreateByName'
,
label
:
'创建人'
,
field
:
'CreateByName'
,
align
:
'left'
},
{
name
:
'UpdateTimeStr'
,
label
:
'更新时间'
,
field
:
'UpdateTimeStr'
,
align
:
'left'
},
{
name
:
'Status'
,
label
:
'状态'
,
align
:
'left'
,
field
:
'Status'
},
{
name
:
'optioned'
,
label
:
'操作'
,
field
:
'PlanId'
}
],
data
:
[],
loading
:
true
,
msg
:
{
pageIndex
:
1
,
pageSize
:
12
,
rowsPerPage
:
12
,
CourseId
:
1
,
},
//课程分类树形列表
TreeCategoryList
:
[],
returnString
:
""
,
//返回字符串
pageCount
:
0
,
isShowMenuForm
:
false
,
menuObjOption
:
null
,
}
},
mounted
()
{
this
.
currentUrl
=
this
.
$route
.
path
this
.
getteachplanList
();
},
methods
:
{
//重新查询
resetSearch
()
{
this
.
msg
.
pageIndex
=
1
;
this
.
getteachplanList
();
},
//翻页
changePage
(
val
)
{
this
.
msg
.
pageIndex
=
val
;
this
.
getteachplanList
()
},
//获取菜单分页列表
getteachplanList
()
{
this
.
loading
=
true
;
queryTeachPlanPage
(
this
.
msg
).
then
(
res
=>
{
this
.
loading
=
false
this
.
data
=
res
.
Data
.
PageData
this
.
pageCount
=
res
.
Data
.
PageCount
}).
catch
(()
=>
{
this
.
loading
=
false
})
},
//刷新页面
refreshPage
()
{
this
.
isShowMenuForm
=
false
;
this
.
getteachplanList
();
},
//新增修改菜单
EditTeachPlan
(
obj
)
{
if
(
obj
)
{
this
.
menuObjOption
=
obj
}
else
{
this
.
menuObjOption
=
null
}
this
.
isShowMenuForm
=
true
},
//关闭弹窗
closeMenuSaveForm
()
{
this
.
isShowMenuForm
=
false
}
}
}
</
script
>
<
style
lang=
"sass"
>
@import
url('~assets/css/table.sass');
</
style
>
src/router/routes.js
View file @
e1b0ccd6
...
...
@@ -52,6 +52,11 @@ const routes = [{
component
:
()
=>
import
(
"pages/course/course.vue"
)
},
{
path
:
"/course/teachplan"
,
//教案管理
component
:
()
=>
import
(
"pages/course/teachplan.vue"
)
},
{
path
:
"/test"
,
//API测试
component
:
()
=>
...
...
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