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
27e880a4
Commit
27e880a4
authored
Oct 13, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增页面
parent
5eb64b6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
181 additions
and
55 deletions
+181
-55
course-form.vue
src/components/course/course-form.vue
+0
-0
course.vue
src/pages/course/course.vue
+176
-55
routes.js
src/router/routes.js
+5
-0
No files found.
src/components/course/course.vue
→
src/components/course/course
-form
.vue
View file @
27e880a4
File moved
src/pages/course/course.vue
View file @
27e880a4
...
...
@@ -3,100 +3,221 @@
<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
ref=
"filter"
filled
v-model=
"keyWords"
label=
"分类名称"
>
<template
v-slot:append
>
<q-icon
v-if=
"keyWords !== ''"
name=
"clear"
class=
"cursor-pointer"
@
click=
"resetFilter"
/>
</
template
>
</q-input>
<q-input
@
change=
"resetSearch"
clearable
standout=
"bg-primary text-white"
v-model=
"msg.MenuName"
label=
"菜单名称"
/>
</div>
<div
class=
"col-3"
>
<q-input
@
change=
"resetSearch"
clearable
standout=
"bg-primary text-white"
v-model=
"msg.MenuUrl"
label=
"菜单地址"
/>
</div>
<div
class=
"col-3"
>
<q-select
@
input=
"resetSearch"
standout=
"bg-primary text-white"
v-model=
"msg.MenuType"
:options=
"MenuTypeOpts"
emit-value
map-options
label=
"菜单类型"
/>
</div>
<div
class=
"col-3"
>
<q-select
@
input=
"resetSearch"
standout=
"bg-primary text-white"
v-model=
"msg.MenuLevel"
:options=
"MenuLevelOpts"
emit-value
map-options
label=
"菜单等级"
/>
</div>
<div
class=
"col-3"
>
<q-select
@
input=
"resetSearch"
standout=
"bg-primary text-white"
v-model=
"msg.Status"
:options=
"ShowOpts"
emit-value
map-options
label=
"状态"
/>
</div>
</div>
<div
class=
"page-option"
>
<q-btn
color=
"accent"
class=
"q-mr-md"
icon=
"add"
label=
"新增
分类
"
@
click=
"EditMenu(null)"
/>
<q-btn
color=
"accent"
class=
"q-mr-md"
icon=
"add"
label=
"新增
菜单
"
@
click=
"EditMenu(null)"
/>
</div>
</div>
<div
class=
"page-content"
>
<div
class=
"q-pa-md q-gutter-sm"
>
<q-tree
v-if=
"isShow"
:nodes=
"data"
node-key=
"CateId"
label-key=
"CateName"
children-key=
"ChildList"
:filter=
"keyWords"
:filter-method=
"myFilterMethod"
default-expand-all
no-results-label=
"暂无相关数据"
>
<
template
v-slot:default-header=
"prop"
>
<div
class=
"row items-center"
>
<div
class=
"text-weight-bold text-primary"
>
{{
prop
.
node
.
CateName
}}
</div>
<template
v-if=
"prop.node.ChildList && prop.node.ChildList.length>0"
>
<q-btn
round
icon=
"add"
size=
"xs"
@
click=
"EditMenu(null)"
/>
</
template
>
<q-btn
round
icon=
"edit"
size=
"xs"
@
click=
"EditMenu(prop.node)"
/>
</div>
</template>
</q-tree>
</div>
<category-form
v-if=
"isShowCategory"
:save-obj=
"categoryObj"
@
close=
"closeCagegoryForm"
@
success=
"refreshPage"
>
</category-form>
<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-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=
"edit"
color=
"accent"
style=
"font-weight:400"
label=
"编辑"
@
click=
"EditMenu(props.row)"
/>
</q-td>
</
template
>
</q-table>
<course-form
v-if=
"isShowMenuForm"
:save-obj=
"menuObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
</course-form>
</div>
</div>
</template>
<
script
>
import
{
queryCourse
CategoryTree
queryCourse
Page
}
from
'../../api/course/index'
import
c
ategoryForm
from
'../../components/course/category
-form'
import
c
ourseForm
from
'../../components/course/course
-form'
export
default
{
meta
:
{
title
:
"
课程分类
"
title
:
"
菜单管理
"
},
components
:
{
c
ategory
Form
,
c
ourse
Form
,
},
data
()
{
return
{
currentUrl
:
""
,
columns
:
[{
name
:
'MenuId'
,
label
:
'菜单编号'
,
field
:
'MenuId'
,
align
:
'left'
},
{
name
:
'MenuName'
,
required
:
true
,
label
:
'菜单名称'
,
align
:
'left'
,
field
:
row
=>
row
.
MenuName
},
{
name
:
'MenuUrl'
,
label
:
'菜单地址'
,
field
:
'MenuUrl'
,
align
:
'left'
},
{
name
:
'MenuTypeStr'
,
label
:
'菜单类型'
,
field
:
'MenuTypeStr'
,
align
:
'left'
},
{
name
:
'MenuLevel'
,
label
:
'菜单等级'
,
field
:
'MenuLevel'
,
align
:
'left'
},
{
name
:
'MenuIcon'
,
label
:
'图标'
,
field
:
'MenuIcon'
,
align
:
'left'
},
{
name
:
'SortNum'
,
label
:
'排序'
,
field
:
'SortNum'
,
align
:
'left'
},
{
name
:
'CreateTimeStr'
,
label
:
'创建时间'
,
field
:
'CreateTimeStr'
,
align
:
'left'
},
{
name
:
'Status'
,
label
:
'状态'
,
align
:
'left'
,
field
:
'Status'
},
{
name
:
'optioned'
,
label
:
'操作'
,
field
:
'MenuId'
}
],
data
:
[],
keyWords
:
''
,
isShowCategory
:
false
,
isShow
:
false
,
categoryObj
:
{},
loading
:
true
,
ShowOpts
:
[{
label
:
'全部'
,
value
:
'-1'
},
{
label
:
'正常'
,
value
:
'0'
},
{
label
:
'删除'
,
value
:
'1'
}
],
//菜单等级
MenuLevelOpts
:
[],
//菜单类型
MenuTypeOpts
:
[],
msg
:
{
pageIndex
:
1
,
pageSize
:
12
,
rowsPerPage
:
12
,
MenuName
:
""
,
MenuUrl
:
""
,
MenuLevel
:
-
1
,
MenuType
:
-
1
,
Status
:
"-1"
,
},
pageCount
:
0
,
isShowMenuForm
:
false
,
menuObjOption
:
null
,
}
},
mounted
()
{
this
.
initData
();
this
.
currentUrl
=
this
.
$route
.
path
this
.
getcourse
categorytree
()
this
.
getcourse
list
()
},
methods
:
{
//搜索分类
myFilterMethod
(
node
,
filter
)
{
return
node
.
CateName
&&
node
.
CateName
.
indexOf
(
filter
)
>
-
1
;
//初始化下拉框
initData
()
{
this
.
MenuTypeOpts
=
getMenuTypeList
();
this
.
MenuLevelOpts
=
getMenuLevelList
();
},
//重
置搜索关键词
reset
Filter
()
{
this
.
keyWords
=
''
this
.
$refs
.
filter
.
focus
()
//重
新查询
reset
Search
()
{
this
.
msg
.
pageIndex
=
1
;
this
.
getcourselist
();
},
//刷新页面
refreshPage
()
{
this
.
getcoursecategorytree
();
//翻页
changePage
(
val
)
{
this
.
msg
.
pageIndex
=
val
;
this
.
getcourselist
()
},
//获取课程分类树形结构
getcoursecategorytree
()
{
this
.
isShow
=
false
;
queryCourseCategoryTree
({}).
then
(
res
=>
{
this
.
isShow
=
true
;
this
.
data
=
res
.
Data
;
//获取菜单分页列表
getcourselist
()
{
this
.
loading
=
true
;
queryCoursePage
(
this
.
msg
).
then
(
res
=>
{
this
.
loading
=
false
this
.
data
=
res
.
Data
.
PageData
this
.
pageCount
=
res
.
Data
.
PageCount
}).
catch
(()
=>
{
this
.
loading
=
false
})
},
//新增修改角色
//刷新页面
refreshPage
()
{
if
(
!
this
.
menuObjOption
)
{
this
.
msg
.
pageIndex
=
1
;
this
.
msg
.
MenuName
=
""
;
this
.
msg
.
MenuUrl
=
""
;
this
.
msg
.
MenuLevel
=
-
1
;
this
.
msg
.
MenuType
=
-
1
;
this
.
msg
.
Status
=
"-1"
;
}
this
.
getmenulist
()
},
//新增修改菜单
EditMenu
(
obj
)
{
if
(
obj
)
{
this
.
categoryObj
=
obj
this
.
menuObjOption
=
obj
}
else
{
this
.
categoryObj
=
null
this
.
menuObjOption
=
null
}
this
.
isShow
Category
=
true
;
this
.
isShow
MenuForm
=
true
},
//关闭弹窗
close
Cagegory
Form
()
{
this
.
isShow
Category
=
false
close
MenuSave
Form
()
{
this
.
isShow
MenuForm
=
false
}
}
}
...
...
src/router/routes.js
View file @
27e880a4
...
...
@@ -47,6 +47,11 @@ const routes = [{
component
:
()
=>
import
(
"pages/course/catagory.vue"
)
},
{
path
:
"/course/course"
,
//课程管理
component
:
()
=>
import
(
"pages/course/course.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