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
5343e18b
Commit
5343e18b
authored
Oct 14, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
dd1ea82b
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
177 additions
and
51 deletions
+177
-51
permission.js
src/boot/permission.js
+0
-3
tree.vue
src/components/common/tree.vue
+130
-0
assistant-form.vue
src/components/school/assistant/assistant-form.vue
+0
-2
teacher-form.vue
src/components/school/teacher/teacher-form.vue
+0
-2
MainLayout.vue
src/layouts/MainLayout.vue
+0
-1
course.vue
src/pages/course/course.vue
+47
-35
assistant.vue
src/pages/school/assistant.vue
+0
-1
manager.vue
src/pages/school/manager.vue
+0
-3
teacher.vue
src/pages/school/teacher.vue
+0
-1
permission.js
src/store/modules/permission.js
+0
-1
user.js
src/store/modules/user.js
+0
-1
request.js
src/utils/request.js
+0
-1
No files found.
src/boot/permission.js
View file @
5343e18b
...
...
@@ -9,7 +9,6 @@ LoadingBar.setDefaults({
});
let
loadAsyncRouter
=
false
;
const
whiteList
=
[
"/login"
,
"/"
];
// 不重定向白名单
console
.
log
(
router
)
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
localStorage
.
setItem
(
"routerBefore"
,
from
.
path
);
LoadingBar
.
start
();
...
...
@@ -25,7 +24,6 @@ router.beforeEach((to, from, next) => {
if
(
!
loadAsyncRouter
)
{
// 判断当前用户是否获取权限
loadAsyncRouter
=
true
;
console
.
log
(
store
.
getters
.
allAuth
)
if
(
store
.
getters
.
allAuth
)
{
store
.
dispatch
(
"GenerateRoutes"
,
store
.
getters
.
allAuth
).
then
(()
=>
{
// 根据auths权限生成可访问的路由表
...
...
@@ -86,7 +84,6 @@ router.beforeEach((to, from, next) => {
}
}
}
else
{
console
.
log
(
to
.
path
)
if
(
whiteList
.
indexOf
(
to
.
path
)
!==
-
1
)
{
next
();
}
else
{
...
...
src/components/common/tree.vue
0 → 100644
View file @
5343e18b
<
template
>
<q-card
style=
"width: 360px;"
>
<q-select
ref=
"select"
v-model=
"chooseArray"
size=
"small"
:clearable=
"true"
:multiple=
"multiple"
:label=
"tipText"
@
click
.
native=
"isShowSelect = !isShowSelect"
option-value=
"value"
option-label=
"label"
:options=
"options"
:dense=
"false"
>
</q-select>
<q-tree
v-if=
"isShowSelect"
style=
"width:100%;height:250px;overflow-y: scroll;position:absolute;z-index:99999;background:#fff;border:1px solid rgba(0, 0, 0, 0.12);"
:nodes=
"treeData"
:node-key=
"nodeKey"
:label-key=
"labelKey"
:children-key=
"childrenKey"
tick-strategy=
"strict"
:default-expand-all=
"defaultExpandAll"
no-connectors
:ticked
.
sync=
"chooseArray"
>
</q-tree>
</q-card>
</
template
>
<
script
>
export
default
{
props
:
{
//树形结构列表
treeData
:
{
type
:
Array
,
required
:
true
},
//是否默认展开
defaultExpandAll
:
{
type
:
Boolean
,
default
:
false
},
//是否多选
multiple
:
{
type
:
Boolean
,
default
:
false
},
//返回类型
id
:
[
String
,
Array
],
//节点Key
nodeKey
:
{
type
:
String
,
default
:
'id'
},
//节点名称
labelKey
:
{
type
:
String
,
default
:
'name'
},
//子节点名称
childrenKey
:
{
type
:
String
,
default
:
'children'
},
//下拉框提示信息
tipText
:
{
type
:
String
,
default
:
'请选择'
}
},
data
()
{
return
{
//是否显示树状选择器
isShowSelect
:
false
,
options
:
[],
showValueTmp
:
''
,
defaultProps
:
{
children
:
'children'
,
label
:
'label'
},
chooseArray
:
[]
}
},
watch
:
{
isShowSelect
(
val
)
{
// 隐藏select自带的下拉框
this
.
$refs
.
select
.
blur
();
if
(
val
)
{
// 下拉面板展开-选中节点-展开节点
this
.
setTreeCheckNode
(
this
.
chooseArray
);
}
},
chooseArray
(
val
)
{
if
(
this
.
multiple
)
{
this
.
$emit
(
'update:id'
,
this
.
chooseArray
)
}
else
{
this
.
$emit
(
'update:id'
,
this
.
chooseArray
[
0
])
}
this
.
setTreeCheckNode
()
}
},
mounted
()
{
// 把传进来的参数转成数组处理
if
(
this
.
multiple
&&
Array
.
isArray
(
this
.
id
))
{
this
.
chooseArray
=
this
.
id
}
else
{
this
.
chooseArray
.
push
(
this
.
id
)
}
this
.
setTreeCheckNode
();
},
methods
:
{
//设置节点下拉框选择
setTreeCheckNode
()
{
this
.
options
=
[]
this
.
chooseArray
.
forEach
(
id
=>
{
if
(
id
!=
''
)
{
var
tempStr
=
this
.
findTreeNode
(
this
.
treeData
,
id
)
this
.
options
.
push
({
value
:
id
,
label
:
tempStr
});
console
.
log
(
"this.options"
,
this
.
options
)
}
})
},
//递归查询树形节点
findTreeNode
(
tree
,
id
)
{
if
(
tree
&&
tree
.
length
>
0
)
{
console
.
log
(
"111"
)
for
(
var
i
=
0
;
i
<
tree
.
length
;
i
++
)
{
console
.
log
(
"222"
)
if
(
tree
[
i
][
this
.
nodeKey
]
===
id
)
{
console
.
log
(
"tree"
,
tree
[
i
][
this
.
nodeKey
]);
console
.
log
(
"id"
,
id
);
return
tree
[
i
][
this
.
labelKey
]
}
else
if
(
tree
[
i
][
this
.
childrenKey
]
!=
null
&&
tree
[
i
][
this
.
childrenKey
].
length
>
0
)
{
return
this
.
findTreeNode
(
tree
[
i
][
this
.
childrenKey
],
id
)
}
}
}
return
""
;
},
}
}
</
script
>
src/components/school/assistant/assistant-form.vue
View file @
5343e18b
...
...
@@ -155,13 +155,11 @@ export default {
getSchoolDropdown
({}).
then
(
res
=>
{
this
.
schoolList
=
res
.
Data
if
(
this
.
objOption
.
School_Id
!=
''
)
{
console
.
log
(
this
.
objOption
)
this
.
objOption
.
School_Id
=
this
.
schoolList
.
filter
(
x
=>
{
if
(
this
.
objOption
.
School_Id
==
x
.
SId
)
{
return
x
}
})[
0
]
console
.
log
(
this
.
objOption
)
}
})
},
...
...
src/components/school/teacher/teacher-form.vue
View file @
5343e18b
...
...
@@ -193,13 +193,11 @@ export default {
getSchoolDropdown
({}).
then
(
res
=>
{
this
.
schoolList
=
res
.
Data
if
(
this
.
objOption
.
School_Id
!=
''
)
{
console
.
log
(
this
.
objOption
)
this
.
objOption
.
School_Id
=
this
.
schoolList
.
filter
(
x
=>
{
if
(
this
.
objOption
.
School_Id
==
x
.
SId
)
{
return
x
}
})[
0
]
console
.
log
(
this
.
objOption
)
}
})
},
...
...
src/layouts/MainLayout.vue
View file @
5343e18b
...
...
@@ -224,7 +224,6 @@ export default {
if
(
newVal
&&
newVal
.
MenuList
)
{
this
.
secondNavs
=
newVal
.
MenuList
.
length
>
0
?
newVal
.
MenuList
[
i
].
SubList
:
[]
}
console
.
log
(
this
.
secondNavs
)
},
immediate
:
true
}
...
...
src/pages/course/course.vue
View file @
5343e18b
...
...
@@ -7,12 +7,8 @@
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=
"菜单等级"
/>
<select-tree
v-if=
"TreeCategoryList&&TreeCategoryList.length>0"
:treeData=
'TreeCategoryList'
:id
.
sync=
"returnString"
nodeKey=
"CateId"
labelKey=
"CateName"
childrenKey=
"ChildList"
></select-tree>
</div>
<div
class=
"col-3"
>
<q-select
@
input=
"resetSearch"
standout=
"bg-primary text-white"
v-model=
"msg.Status"
:options=
"ShowOpts"
...
...
@@ -26,6 +22,13 @@
<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-Status=
"props"
>
<q-td
:props=
"props"
>
<q-badge
:color=
"props.value==1?'negative':'primary'"
:label=
"props.value==0?'正常':'禁用'"
/>
...
...
@@ -50,60 +53,57 @@
<
script
>
import
{
queryCoursePage
queryCoursePage
,
queryCourseCategoryTree
,
}
from
'../../api/course/index'
import
courseForm
from
'../../components/course/course-form'
import
selectTree
from
'../../components/common/tree'
export
default
{
meta
:
{
title
:
"
菜单
管理"
title
:
"
课程
管理"
},
components
:
{
courseForm
,
selectTree
},
data
()
{
return
{
currentUrl
:
""
,
columns
:
[{
name
:
'
Menu
Id'
,
label
:
'
菜单
编号'
,
field
:
'
Menu
Id'
,
name
:
'
Course
Id'
,
label
:
'
课程
编号'
,
field
:
'
Course
Id'
,
align
:
'left'
},
{
name
:
'
Menu
Name'
,
name
:
'
Course
Name'
,
required
:
true
,
label
:
'
菜单
名称'
,
label
:
'
课程
名称'
,
align
:
'left'
,
field
:
row
=>
row
.
MenuName
},
{
name
:
'MenuUrl'
,
label
:
'菜单地址'
,
field
:
'MenuUrl'
,
align
:
'left'
field
:
row
=>
row
.
CourseName
},
{
name
:
'
MenuTypeStr
'
,
label
:
'
菜单类型
'
,
field
:
'
MenuTypeStr
'
,
name
:
'
CateName
'
,
label
:
'
所属分类
'
,
field
:
'
CateName
'
,
align
:
'left'
},
{
name
:
'
MenuLevel
'
,
label
:
'
菜单等级
'
,
field
:
'
MenuLevel
'
,
name
:
'
CoverImg
'
,
label
:
'
课程封面
'
,
field
:
'
CoverImg
'
,
align
:
'left'
},
{
name
:
'
MenuIcon
'
,
label
:
'
图标
'
,
field
:
'
MenuIcon
'
,
name
:
'
CourseIntro
'
,
label
:
'
课程介绍
'
,
field
:
'
CourseIntro
'
,
align
:
'left'
},
{
name
:
'
SortNum
'
,
label
:
'
排序
'
,
field
:
'
SortNum
'
,
name
:
'
CreateByName
'
,
label
:
'
创建人
'
,
field
:
'
CreateByName
'
,
align
:
'left'
},
{
...
...
@@ -121,7 +121,7 @@
{
name
:
'optioned'
,
label
:
'操作'
,
field
:
'
Menu
Id'
field
:
'
Course
Id'
}
],
data
:
[],
...
...
@@ -153,16 +153,29 @@
MenuType
:
-
1
,
Status
:
"-1"
,
},
//课程分类树形列表
TreeCategoryList
:
[],
returnString
:
""
,
//返回字符串
pageCount
:
0
,
isShowMenuForm
:
false
,
menuObjOption
:
null
,
}
},
mounted
()
{
this
.
getCategorytree
();
this
.
currentUrl
=
this
.
$route
.
path
this
.
getcourselist
()
this
.
getcourselist
()
;
},
methods
:
{
getCategorytree
()
{
this
.
TreeCategoryList
=
[];
var
qMsg
=
{}
queryCourseCategoryTree
(
qMsg
).
then
(
res
=>
{
this
.
TreeCategoryList
=
res
.
Data
;
})
},
//重新查询
resetSearch
()
{
this
.
msg
.
pageIndex
=
1
;
...
...
@@ -179,7 +192,6 @@
queryCoursePage
(
this
.
msg
).
then
(
res
=>
{
this
.
loading
=
false
this
.
data
=
res
.
Data
.
PageData
console
.
log
(
"this.data"
,
this
.
data
);
this
.
pageCount
=
res
.
Data
.
PageCount
}).
catch
(()
=>
{
this
.
loading
=
false
...
...
src/pages/school/assistant.vue
View file @
5343e18b
...
...
@@ -318,7 +318,6 @@ export default {
this
.
loading
=
false
this
.
data
=
res
.
Data
.
PageData
this
.
pageCount
=
res
.
Data
.
PageCount
console
.
log
(
this
.
data
)
}).
catch
(()
=>
{
this
.
loading
=
false
})
...
...
src/pages/school/manager.vue
View file @
5343e18b
...
...
@@ -203,7 +203,6 @@ export default {
}
return
false
})
console
.
log
(
obj
)
this
.
objOption
=
obj
[
0
]
}
else
{
this
.
objOption
=
{
...
...
@@ -218,12 +217,10 @@ export default {
Status
:
'0'
}
}
console
.
log
(
this
.
objOption
)
this
.
persistent
=
true
},
resetSearch
()
{
this
.
pageIndex
=
1
//this.pageCount = 0
this
.
loading
=
true
this
.
msg
.
Status
=
this
.
StatusTemp
?
this
.
StatusTemp
.
value
:
'-1'
this
.
getSchool
()
...
...
src/pages/school/teacher.vue
View file @
5343e18b
...
...
@@ -367,7 +367,6 @@ export default {
this
.
loading
=
false
this
.
data
=
res
.
Data
.
PageData
this
.
pageCount
=
res
.
Data
.
PageCount
console
.
log
(
this
.
data
)
}).
catch
(()
=>
{
this
.
loading
=
false
})
...
...
src/store/modules/permission.js
View file @
5343e18b
...
...
@@ -72,7 +72,6 @@ const permission = {
},
data
)
{
return
new
Promise
(
resolve
=>
{
// TODO 实现权限验证
console
.
log
(
'测试进入'
)
resolve
()
})
}
...
...
src/store/modules/user.js
View file @
5343e18b
...
...
@@ -42,7 +42,6 @@ const user = {
resolve
(
data
);
})
.
catch
(
error
=>
{
console
.
log
(
error
)
reject
(
error
);
});
});
...
...
src/utils/request.js
View file @
5343e18b
...
...
@@ -14,7 +14,6 @@ const service = axios.create({
// request拦截器
service
.
interceptors
.
request
.
use
(
config
=>
{
console
.
log
(
config
.
headers
)
const
flag
=
config
.
headers
[
"Content-Type"
]
&&
config
.
headers
[
"Content-Type"
].
indexOf
(
"application/json"
)
!==
-
1
;
...
...
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