Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
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
new-sing
admin-base
Commits
d25e3bd0
Commit
d25e3bd0
authored
Sep 17, 2018
by
王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
期数列表标题链接到班级
parent
d219f747
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
17 deletions
+32
-17
index.js
config/index.js
+2
-2
index.vue
src/components/class/index.vue
+25
-11
index.vue
src/components/periods/index.vue
+5
-4
No files found.
config/index.js
View file @
d25e3bd0
...
@@ -12,8 +12,8 @@ module.exports = {
...
@@ -12,8 +12,8 @@ module.exports = {
//本地代理设置
//本地代理设置
proxyTable
:
{
proxyTable
:
{
'/api'
:
{
'/api'
:
{
target
:
'http://local.base-api.sing.com'
,
// 接口的域名
//
target: 'http://local.base-api.sing.com', // 接口的域名
//
target: 'http://wechat.test.singsingenglish.com/',
target
:
'http://wechat.test.singsingenglish.com/'
,
changeOrigin
:
true
,
// 如果接口跨域,需要进行这个参数配置
changeOrigin
:
true
,
// 如果接口跨域,需要进行这个参数配置
}
}
},
},
...
...
src/components/class/index.vue
View file @
d25e3bd0
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
:props=
"
{value:'id',label:'name'}"
:props=
"
{value:'id',label:'name'}"
@active-item-change="handleItemChange"
@active-item-change="handleItemChange"
@change="changePeriods"
@change="changePeriods"
v-model="selectedGoods"
>
>
</el-cascader>
</el-cascader>
</el-form-item>
</el-form-item>
...
@@ -110,6 +111,7 @@
...
@@ -110,6 +111,7 @@
type
:
0
,
type
:
0
,
id
:
0
id
:
0
},
},
selectedGoods
:
[]
}
}
},
},
components
:{
components
:{
...
@@ -118,25 +120,37 @@
...
@@ -118,25 +120,37 @@
page
page
},
},
mounted
(){
mounted
(){
this
.
initPage
()
this
.
initPage
();
},
},
methods
:{
methods
:{
initQuery
(){
let
_query
=
this
.
$route
.
query
;
if
(
_query
&&
_query
.
goods_id
&&
_query
.
periods_id
)
{
this
.
selectedGoods
=
[
parseInt
(
_query
.
goods_id
),
parseInt
(
_query
.
periods_id
)];
getPeriodsApi
({
goods_id
:
this
.
selectedGoods
[
0
]}).
then
(
res
=>
{
res
.
list
.
forEach
(
i
=>
{
i
.
name
=
i
.
title
});
this
.
goodsList
.
find
(
i
=>
{
return
i
.
id
===
this
.
selectedGoods
[
0
]}).
children
=
res
.
list
let
nowGoods
=
this
.
goodsList
.
find
(
i
=>
{
return
i
.
id
===
this
.
selectedGoods
[
0
]});
this
.
periods
=
nowGoods
.
children
.
find
(
i
=>
{
return
i
.
id
===
this
.
selectedGoods
[
1
]});
this
.
teacher_id
=
''
;
this
.
getClassList
()
})
}
else
{
getPeriodsApi
({
goods_id
:
this
.
goodsList
[
0
].
id
}).
then
(
res
=>
{
res
.
list
.
forEach
(
i
=>
{
i
.
name
=
i
.
title
});
this
.
goodsList
[
0
].
children
=
res
.
list
;
this
.
periods
=
res
.
list
[
0
]
})
}
},
initPage
(){
initPage
(){
getGoodsListApi
().
then
(
res
=>
{
getGoodsListApi
().
then
(
res
=>
{
res
.
list
.
forEach
(
i
=>
{
res
.
list
.
forEach
(
i
=>
{
i
.
children
=
[];
i
.
children
=
[];
});
});
this
.
goodsList
=
res
.
list
;
this
.
goodsList
=
res
.
list
;
if
(
!
this
.
periods
)
{
this
.
initQuery
();
getPeriodsApi
({
goods_id
:
this
.
goodsList
[
0
].
id
}).
then
(
res
=>
{
res
.
list
.
forEach
(
i
=>
{
i
.
name
=
i
.
title
});
this
.
goodsList
[
0
].
children
=
res
.
list
;
this
.
periods
=
res
.
list
[
0
]
})
}
if
(
this
.
periods
){
getClassListApi
()
}
});
});
},
},
showUser
(
data
){
showUser
(
data
){
...
...
src/components/periods/index.vue
View file @
d25e3bd0
...
@@ -36,13 +36,14 @@
...
@@ -36,13 +36,14 @@
<el-table
<el-table
:data=
"periodList"
:data=
"periodList"
style=
"width: 100%"
>
style=
"width: 100%"
>
<el-table-column
prop=
"id"
label=
"期数ID"
>
</el-table-column>
<el-table-column
<el-table-column
prop=
"title"
prop=
"title"
label=
"期数标题"
>
label=
"期数标题"
>
<template
slot-scope=
"scope"
>
<router-link
:to=
"
{name:'class', query: { goods_id: scope.row.goods_id, periods_id: scope.row.id}}" >
{{
scope
.
row
.
title
}}
</router-link>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
prop=
"goods_name"
prop=
"goods_name"
...
...
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