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
73d96168
Commit
73d96168
authored
Oct 13, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增页面
parent
802ac429
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
370 additions
and
62 deletions
+370
-62
index.js
src/api/course/index.js
+49
-0
category-form.vue
src/components/course/category-form.vue
+150
-0
catagory.vue
src/pages/course/catagory.vue
+108
-0
menu.vue
src/pages/system/menu.vue
+4
-6
role.vue
src/pages/system/role.vue
+4
-6
routes.js
src/router/routes.js
+55
-50
No files found.
src/api/course/index.js
0 → 100644
View file @
73d96168
import
request
from
'../../utils/request'
/**
* 获取课程分页列表
* @param {JSON参数} data
*/
export
function
queryCourseCategoryPage
(
data
)
{
return
request
({
url
:
'/Course/GetCourseCategoryPageList'
,
method
:
'post'
,
data
})
}
/**
* 获取课程分类树形列表
*/
export
function
queryCourseCategoryTree
(
data
)
{
return
request
({
url
:
'/Course/GetCourseCategoryTree'
,
method
:
'post'
,
data
})
}
/**
* 根据编号获取课程分类信息
*/
export
function
queryCourseCategoryInfo
(
data
)
{
return
request
({
url
:
'/Course/GetCourseCategory'
,
method
:
'post'
,
data
})
}
/**
* 保存课程分类
* @param {JSON参数} data
*/
export
function
saveCourseCategoryInfo
(
data
)
{
return
request
({
url
:
'/Course/SetCourseCategory'
,
method
:
'post'
,
data
})
}
src/components/course/category-form.vue
0 → 100644
View file @
73d96168
<
template
>
<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
.
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=
"50"
:dense=
"false"
v-model=
"objOption.CateName"
ref=
"CateName"
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.SortNum"
ref=
"SortNum"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"排序"
/>
<div
class=
"col-12 q-pr-lg q-pb-lg q-pt-lg"
>
<q-toggle
size=
"md"
label=
"状态"
color=
"primary"
:false-value=
"1"
:true-value=
"0"
v-model=
"objOption.Status"
title=
"注意:关闭后,分类将无法正常使用."
/>
</div>
<div
class=
"col-12 q-pr-lg q-pb-lg q-pt-lg"
>
上级分类:
<div
class=
"q-pa-md q-gutter-sm"
>
<q-tree
v-if=
"isShow"
style=
"max-width:300px;"
:nodes=
"TreeCategoryList"
node-key=
"CateId"
label-key=
"CateName"
children-key=
"ChildList"
tick-strategy=
"strict"
:default-expand-all=
"true"
no-connectors
:ticked
.
sync=
"chooseCategroyArray"
>
</q-tree>
</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=
"saveCategory"
/>
</q-card-actions>
</q-card>
</q-dialog>
</
template
>
<
script
>
import
{
queryCourseCategoryTree
,
queryCourseCategoryInfo
,
saveCourseCategoryInfo
}
from
'../../api/course/index'
export
default
{
props
:
{
saveObj
:
{
type
:
Object
,
default
:
null
}
},
data
()
{
return
{
isShow
:
false
,
persistent
:
true
,
objOption
:
{
CateId
:
0
,
//分类编号
ParentId
:
0
,
//父级编号
CateName
:
""
,
//分类名称
SortNum
:
0
,
//排序
Status
:
0
,
//状态(0-正常,1-禁用)},
},
optionTitle
:
""
,
//树形课程分类列表
TreeCategoryList
:
[],
saveLoading
:
false
,
chooseCategroyArray
:
[],
}
},
mounted
()
{
this
.
getCategoryTreeList
();
this
.
initObj
()
},
methods
:
{
//获取树形课程分类列表
getCategoryTreeList
()
{
this
.
TreeCategoryList
=
[];
var
qMsg
=
{}
queryCourseCategoryTree
(
qMsg
).
then
(
res
=>
{
this
.
TreeCategoryList
=
res
.
Data
;
this
.
isShow
=
true
;
})
},
//初始化表单
initObj
()
{
if
(
this
.
saveObj
&&
this
.
saveObj
.
CateId
>
0
)
{
queryCourseCategoryInfo
({
CateId
:
this
.
saveObj
.
CateId
}).
then
(
res
=>
{
this
.
objOption
.
CateId
=
res
.
Data
.
CateId
;
this
.
objOption
.
ParentId
=
res
.
Data
.
ParentId
;
this
.
objOption
.
CateName
=
res
.
Data
.
CateName
;
this
.
objOption
.
SortNum
=
res
.
Data
.
SortNum
;
this
.
objOption
.
Status
=
res
.
Data
.
Status
;
if
(
res
.
Data
.
ParentId
&&
res
.
Data
.
ParentId
>
0
)
{
this
.
chooseCategroyArray
.
push
(
res
.
Data
.
ParentId
);
}
})
this
.
optionTitle
=
"修改课程分类信息"
}
else
{
this
.
optionTitle
=
"新增课程分类"
this
.
objOption
.
CateId
=
0
;
this
.
objOption
.
ParentId
=
0
;
this
.
objOption
.
CateName
=
""
;
this
.
objOption
.
SortNum
=
0
;
this
.
objOption
.
Status
=
0
;
}
},
//关闭弹窗
closeSaveForm
()
{
this
.
$emit
(
'close'
)
this
.
persistent
=
false
},
//保存菜单
saveCategory
()
{
var
tempKeys
=
""
;
if
(
this
.
chooseCategroyArray
&&
this
.
chooseCategroyArray
.
length
>
0
)
{
this
.
chooseCategroyArray
.
forEach
(
item
=>
{
this
.
saveObj
.
ParentId
=
item
;
})
}
this
.
saveLoading
=
true
saveCourseCategoryInfo
(
this
.
objOption
).
then
(
res
=>
{
this
.
saveLoading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'数据保存成功!'
,
position
:
'top'
})
this
.
$emit
(
"success"
)
this
.
closeSaveForm
()
}).
catch
(()
=>
{
this
.
saveLoading
=
false
})
}
},
watch
:
{
chooseCategroyArray
:
function
(
val
,
oldval
)
{
if
(
this
.
chooseCategroyArray
.
length
>
1
)
{
var
end
=
this
.
chooseCategroyArray
[
this
.
chooseCategroyArray
.
length
-
1
];
var
tempArray
=
[];
tempArray
.
push
(
end
);
this
.
chooseCategroyArray
=
tempArray
;
}
}
}
}
</
script
>
src/pages/course/catagory.vue
0 → 100644
View file @
73d96168
<
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
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>
</div>
</div>
<div
class=
"page-option"
>
<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>
</div>
</div>
</template>
<
script
>
import
{
queryCourseCategoryTree
}
from
'../../api/course/index'
import
categoryForm
from
'../../components/course/category-form'
export
default
{
meta
:
{
title
:
"课程分类"
},
components
:
{
categoryForm
,
},
data
()
{
return
{
currentUrl
:
""
,
data
:
[],
keyWords
:
''
,
isShowCategory
:
false
,
isShow
:
false
,
categoryObj
:
{},
}
},
mounted
()
{
this
.
currentUrl
=
this
.
$route
.
path
this
.
getcoursecategorytree
()
},
methods
:
{
//搜索分类
myFilterMethod
(
node
,
filter
)
{
return
node
.
CateName
&&
node
.
CateName
.
indexOf
(
filter
)
>
-
1
;
},
//重置搜索关键词
resetFilter
()
{
this
.
keyWords
=
''
this
.
$refs
.
filter
.
focus
()
},
//刷新页面
refreshPage
()
{
this
.
getcoursecategorytree
();
},
//获取课程分类树形结构
getcoursecategorytree
()
{
this
.
isShow
=
false
;
queryCourseCategoryTree
({}).
then
(
res
=>
{
this
.
isShow
=
true
;
this
.
data
=
res
.
Data
;
})
},
//新增修改角色
EditMenu
(
obj
)
{
if
(
obj
)
{
this
.
categoryObj
=
obj
}
else
{
this
.
categoryObj
=
null
}
this
.
isShowCategory
=
true
;
},
//关闭弹窗
closeCagegoryForm
()
{
this
.
isShowCategory
=
false
}
}
}
</
script
>
<
style
lang=
"sass"
>
@import
url('~assets/css/table.sass');
</
style
>
src/pages/system/menu.vue
View file @
73d96168
...
...
@@ -46,7 +46,7 @@
</q-td>
</
template
>
</q-table>
<menu-form
v-if=
"
persistent_menu
"
:save-obj=
"menuObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
<menu-form
v-if=
"
isShowMenuForm
"
:save-obj=
"menuObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
</menu-form>
</div>
</div>
...
...
@@ -160,9 +160,8 @@
Status
:
"-1"
,
},
pageCount
:
0
,
persistent_menu
:
false
,
isShowMenuForm
:
false
,
menuObjOption
:
null
,
persistentExamine_menu
:
false
}
},
mounted
()
{
...
...
@@ -216,12 +215,11 @@
}
else
{
this
.
menuObjOption
=
null
}
this
.
persistent_menu
=
true
this
.
isShowMenuForm
=
true
},
//关闭弹窗
closeMenuSaveForm
()
{
this
.
persistent_menu
=
false
this
.
persistentExamine_menu
=
false
this
.
isShowMenuForm
=
false
}
}
}
...
...
src/pages/system/role.vue
View file @
73d96168
...
...
@@ -34,7 +34,7 @@
</q-td>
</
template
>
</q-table>
<role-form
v-if=
"
persistent_role
"
:save-obj=
"roleObjOption"
@
close=
"closeroleSaveForm"
@
success=
"refreshPage"
>
<role-form
v-if=
"
isShowRoleForm
"
:save-obj=
"roleObjOption"
@
close=
"closeroleSaveForm"
@
success=
"refreshPage"
>
</role-form>
</div>
</div>
...
...
@@ -121,9 +121,8 @@
Status
:
"-1"
,
},
pageCount
:
0
,
persistent_role
:
false
,
isShowRoleForm
:
false
,
roleObjOption
:
null
,
persistentExamine_role
:
false
}
},
mounted
()
{
...
...
@@ -168,12 +167,11 @@
}
else
{
this
.
roleObjOption
=
null
}
this
.
persistent_role
=
true
this
.
isShowRoleForm
=
true
},
//关闭弹窗
closeroleSaveForm
()
{
this
.
persistent_role
=
false
this
.
persistentExamine_role
=
false
this
.
isShowRoleForm
=
false
}
}
}
...
...
src/router/routes.js
View file @
73d96168
const
routes
=
[{
path
:
"/"
,
path
:
"/"
,
component
:
()
=>
import
(
"pages/user/login.vue"
)
},
{
path
:
"/login"
,
component
:
()
=>
import
(
"pages/user/login.vue"
)
},
{
path
:
"/home"
,
component
:
()
=>
import
(
"layouts/MainLayout.vue"
),
children
:
[{
path
:
""
,
component
:
()
=>
import
(
"pages/user/login
.vue"
)
},
{
path
:
"/
login
"
,
import
(
"pages/Index
.vue"
)
},
{
path
:
"/
school/manager
"
,
component
:
()
=>
import
(
"pages/user/login
.vue"
)
},
{
path
:
"/
home
"
,
import
(
"pages/school/manager
.vue"
)
},
{
path
:
"/
school/teacher
"
,
component
:
()
=>
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"
)
},
{
path
:
"/system/menu"
,
component
:
()
=>
import
(
"pages/system/menu.vue"
)
},
{
path
:
"/system/role"
,
component
:
()
=>
import
(
"pages/system/role.vue"
)
},
{
path
:
"/test"
,
component
:
()
=>
import
(
"pages/test.vue"
)
},
]
},
// Always leave this as last one,
// but you can also remove it
{
path
:
"*"
,
import
(
"pages/school/teacher.vue"
)
},
{
path
:
"/system/menu"
,
//菜单管理
component
:
()
=>
import
(
"pages/system/menu.vue"
)
},
{
path
:
"/system/role"
,
//角色管理
component
:
()
=>
import
(
"pages/system/role.vue"
)
},
{
path
:
"/course/catagory"
,
//课程分类
component
:
()
=>
import
(
"pages/Error404.vue"
)
}
import
(
"pages/course/catagory.vue"
)
},
{
path
:
"/test"
,
//API测试
component
:
()
=>
import
(
"pages/test.vue"
)
},
]
},
// Always leave this as last one,
// but you can also remove it
{
path
:
"*"
,
component
:
()
=>
import
(
"pages/Error404.vue"
)
}
];
export
default
routes
;
\ No newline at end of file
export
default
routes
;
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