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
9483849d
Commit
9483849d
authored
Sep 10, 2018
by
王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
课程管理bug&..
parent
edb86fab
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
151 additions
and
112 deletions
+151
-112
index.js
config/index.js
+2
-2
index.html
index.html
+1
-0
dialog.vue
src/components/lesson/dialog.vue
+140
-107
index.vue
src/components/lesson/index.vue
+1
-1
index.vue
src/components/periods/index.vue
+2
-0
newDialog.vue
src/components/periods/newDialog.vue
+3
-1
dialog.vue
src/components/single/dialog.vue
+2
-1
No files found.
config/index.js
View file @
9483849d
...
...
@@ -12,8 +12,8 @@ module.exports = {
//本地代理设置
proxyTable
:
{
'/api'
:
{
//
target: 'http://local.base-api.sing.com', // 接口的域名
target
:
'http://wechat.test.singsingenglish.com/'
,
target
:
'http://local.base-api.sing.com'
,
// 接口的域名
//
target: 'http://wechat.test.singsingenglish.com/',
changeOrigin
:
true
,
// 如果接口跨域,需要进行这个参数配置
}
},
...
...
index.html
View file @
9483849d
...
...
@@ -3,6 +3,7 @@
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<meta
name=
"referrer"
content=
"never"
>
<link
rel=
"stylesheet"
href=
"https://at.alicdn.com/t/font_746649_7dsnjecwkpg.css"
>
<title>
singsing-new-admin
</title>
</head>
...
...
src/components/lesson/dialog.vue
View file @
9483849d
...
...
@@ -29,6 +29,8 @@
<el-option
label=
"日课"
:value=
"1"
></el-option>
</el-select>
</el-form-item>
<el-row>
<el-col
:span=
"10"
>
<el-form-item
label=
"选择课程"
>
<el-cascader
clearable
...
...
@@ -41,15 +43,19 @@
>
</el-cascader>
</el-form-item>
<el-form-item
label=
"已选课程"
>
<el-row>
<el-col
:span=
"12"
class=
"selected-block"
v-for=
"data in selectedLessonList"
:key=
"data.id"
>
<div
class=
"selected-block"
v-for=
"(data, index) in selectedLessonList"
:key=
"index"
>
<el-card
shadow=
"always"
>
{{
data
.
name
}}
<el-button
type=
"danger"
icon=
"el-icon-close"
@
click=
"delLesson(data)"
circle
size=
"mini"
style=
"float: right;padding: 3px"
></el-button>
<div
class=
"move"
>
<el-button
type=
"text"
class=
"button"
v-if=
"index !== 0"
@
click=
"moveItem(index-1,index)"
>
上移
</el-button>
<el-button
type=
"text"
class=
"button"
v-if=
"index !== selectedLessonList.length - 1"
@
click=
"moveItem(index,index+1)"
>
下移
</el-button>
</div>
</el-card>
</el-col>
</el-row>
</div>
</el-form-item>
</el-col>
<el-col
:span=
"10"
>
<el-form-item
label=
"选择盒子"
>
<el-cascader
clearable
...
...
@@ -62,15 +68,19 @@
>
</el-cascader>
</el-form-item>
<el-form-item
label=
"已选盒子"
>
<el-row>
<el-col
:span=
"12"
class=
"selected-block"
v-for=
"data in selectedBoxList"
:key=
"data.id"
>
<div
class=
"selected-block"
v-for=
"(data,index) in selectedBoxList"
:key=
"data.id"
>
<el-card
shadow=
"always"
>
{{
data
.
name
}}
<el-button
type=
"danger"
icon=
"el-icon-close"
@
click=
"delBox(data)"
circle
size=
"mini"
style=
"float: right;padding: 3px"
></el-button>
<div
class=
"move"
>
<el-button
type=
"text"
class=
"button"
v-if=
"index !== 0"
@
click=
"moveBox(index-1, index)"
>
上移
</el-button>
<el-button
type=
"text"
class=
"button"
v-if=
"index !== selectedBoxList.length - 1"
@
click=
"moveBox(index, index+1)"
>
下移
</el-button>
</div>
</el-card>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
v-if=
"dialogObj.type !== 2"
>
<el-button
@
click=
"dialogObj.show = false"
>
取 消
</el-button>
...
...
@@ -144,7 +154,6 @@
})
},
selectLesson
(
data
){
console
.
log
(
'selectLesson'
,
data
,
this
.
showLessonList
)
let
select
=
this
.
showLessonList
.
find
(
i
=>
{
return
i
.
id
===
data
[
0
]});
if
(
select
.
children
)
{
select
=
select
.
children
.
find
(
i
=>
{
return
i
.
id
===
data
[
1
]});
...
...
@@ -176,16 +185,17 @@
},
sub
(){
console
.
log
(
'this.form.item_category_ids'
,
this
.
form
.
item_category_ids
)
console
.
log
(
'this.form.text_category_ids'
,
this
.
form
.
text_category_ids
)
this
.
selectedBoxList
.
forEach
(
i
=>
{
this
.
form
.
item_category_ids
.
push
(
i
.
id
)})
;
this
.
selectedLessonList
.
forEach
(
i
=>
{
this
.
form
.
text_category_i
ds
.
push
(
i
.
id
)});
this
.
form
.
text_category_ids
=
this
.
form
.
text_category_ids
.
toString
(
);
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
let
itemIds
=
[];
let
textIds
=
[]
;
this
.
selectedBoxList
.
forEach
(
i
=>
{
itemI
ds
.
push
(
i
.
id
)});
this
.
selectedLessonList
.
forEach
(
i
=>
{
textIds
.
push
(
i
.
id
)}
);
if
(
this
.
imageList
[
0
]){
this
.
form
.
cover
=
this
.
imageList
[
0
].
url
;
this
.
form
.
cover
=
this
.
imageList
[
0
].
name
;
}
this
.
form
.
item_category_ids
=
this
.
form
.
item_category_ids
.
toString
();
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
let
json
=
this
.
form
;
json
.
item_category_ids
=
itemIds
.
toString
();
json
.
text_category_ids
=
textIds
.
toString
();
if
(
valid
){
if
(
!
this
.
form
.
cover
)
{
this
.
$message
({
...
...
@@ -194,14 +204,14 @@
});
return
}
if
(
!
this
.
form
.
text_category_ids
)
{
if
(
!
json
.
text_category_ids
)
{
this
.
$message
({
type
:
'error'
,
message
:
'请选择课程!'
});
return
}
if
(
!
this
.
form
.
item_category_ids
)
{
if
(
!
json
.
item_category_ids
)
{
this
.
$message
({
type
:
'error'
,
message
:
'请选择盒子!'
...
...
@@ -212,7 +222,7 @@
case
1
:
// this.$refs['form'].validate((valid) => {
// if(valid){
editLessonApi
(
this
.
dialogObj
.
id
,
this
.
form
).
then
(
res
=>
{
editLessonApi
(
this
.
dialogObj
.
id
,
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功!'
...
...
@@ -227,7 +237,7 @@
console
.
log
(
this
.
form
);
// this.$refs['form'].validate((valid) => {
// if(valid){
addLessonApi
(
this
.
form
).
then
(
res
=>
{
addLessonApi
(
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'新增成功!'
...
...
@@ -251,9 +261,7 @@
});
getCategoryApi
().
then
(
res
=>
{
this
.
lessonList
=
res
;
console
.
log
(
'res getCategoryApi'
,
res
)
this
.
showLessonList
=
JSON
.
parse
(
JSON
.
stringify
(
res
))
});
switch
(
this
.
dialogObj
.
type
){
case
0
:
this
.
form
=
{
...
...
@@ -269,30 +277,30 @@
this
.
selectedBoxList
=
[];
break
;
case
1
:
getLessonDetailApi
(
this
.
dialogObj
.
id
).
then
(
res
=>
{
getLessonDetailApi
(
this
.
dialogObj
.
id
).
then
(
resL
=>
{
this
.
form
=
{
title
:
res
.
title
,
type
:
res
.
type
,
title
:
resL
.
title
,
type
:
resL
.
type
,
text_category_ids
:[],
item_category_ids
:[],
cover
:
''
,
};
this
.
imageList
=
[{
name
:
res
.
cover
,
url
:
res
.
cover
}];
this
.
imageList
=
[{
name
:
resL
.
cover
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
resL
.
cover
}];
this
.
uploadShow
=
false
;
this
.
selectedLessonList
=
[];
this
.
selectedBoxList
=
[];
if
(
res
.
type
===
0
){
res
.
detail
[
'0'
].
forEach
(
i
=>
{
if
(
resL
.
type
===
0
){
resL
.
detail
[
'0'
].
forEach
(
i
=>
{
this
.
selectLesson
([
i
.
pid
,
i
.
id
])
});
}
else
if
(
res
.
type
===
1
){
res
.
detail
[
'1'
].
forEach
(
t
=>
{
}
else
if
(
resL
.
type
===
1
){
resL
.
detail
[
'1'
].
forEach
(
t
=>
{
let
x
=
this
.
showLessonList
.
find
(
i
=>
{
return
i
.
children
.
find
(
j
=>
{
return
j
.
id
===
t
.
pid
})})
this
.
selectLesson
([
x
.
id
,
t
.
pid
,
t
.
id
])
})
}
if
(
res
.
detail
[
'2'
]){
res
.
detail
[
'2'
].
forEach
(
i
=>
{
if
(
resL
.
detail
[
'2'
]){
resL
.
detail
[
'2'
].
forEach
(
i
=>
{
this
.
selectBox
([
i
.
id
])
});
}
...
...
@@ -314,6 +322,7 @@
// });
break
}
});
},
beforeAvatarUpload
(){
this
.
uploadShow
=
false
...
...
@@ -331,19 +340,37 @@
this
.
form
.
cover
=
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
;
this
.
imageList
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
};
})
},
moveBox
(
first
,
second
){
let
list
=
this
.
selectedBoxList
;
let
oFirst
=
list
[
first
];
let
oSecond
=
list
[
second
];
this
.
selectedBoxList
.
splice
(
first
,
1
,
oSecond
);
this
.
selectedBoxList
.
splice
(
second
,
1
,
oFirst
);
},
moveItem
(
first
,
second
){
console
.
log
(
'moveItem'
,
first
,
second
);
let
list
=
this
.
selectedLessonList
;
let
oFirst
=
list
[
first
];
let
oSecond
=
list
[
second
];
this
.
selectedLessonList
.
splice
(
first
,
1
,
oSecond
);
this
.
selectedLessonList
.
splice
(
second
,
1
,
oFirst
);
}
},
watch
:{
dialogObj
(){
// dialogObj(){
// this.initDialog()
// }
},
mounted
(){
this
.
initDialog
()
}
}
}
</
script
>
<
style
scoped
lang=
"less"
>
.el-col{
height: 50px;
/*height: 50px;*/
text-align: center;
margin-bottom: 20px;
line-height: 40px;
...
...
@@ -368,6 +395,12 @@
margin: 0;
text-align: left;
}
.move {
display: flex;
flex-flow: row;
justify-content: flex-end;
align-items: center;
}
</
style
>
<
style
>
.disabled
.el-upload--picture-card
{
...
...
src/components/lesson/index.vue
View file @
9483849d
...
...
@@ -72,7 +72,7 @@
</el-table-column>
</el-table>
<page
:total=
"total"
v-model=
"nowPage"
/>
<dialog-com
:dialogObj=
"dialogObj"
@
changeShow=
"changeShow"
@
reflash=
"getUser"
/>
<dialog-com
v-if=
"dialogObj.show"
:dialogObj=
"dialogObj"
@
changeShow=
"changeShow"
@
reflash=
"getUser"
/>
</div>
</template>
...
...
src/components/periods/index.vue
View file @
9483849d
...
...
@@ -183,6 +183,8 @@
onAdd
(){
this
.
newDialog
.
form
.
id
=
''
;
this
.
newDialog
.
start_num
=
''
;
this
.
newDialog
.
form
.
goods_id
=
''
;
this
.
newDialog
.
form
.
title
=
''
;
this
.
newDialog
.
form
.
start_at
=
''
;
this
.
newDialog
.
form
.
rest_week_day
=
[];
this
.
newDialog
.
form
.
teacher_ids
=
[];
...
...
src/components/periods/newDialog.vue
View file @
9483849d
...
...
@@ -26,7 +26,7 @@
<el-input
v-model=
"form.title"
></el-input>
</el-form-item>
<el-form-item
label=
"开始主题"
prop=
"start_num"
>
<el-select
v-model=
"form.start_num"
placeholder=
"请选择"
>
<el-select
v-model=
"form.start_num"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in itemOptions"
:key=
"item.id"
...
...
@@ -215,6 +215,8 @@
})
},
getLessonDetail
(
id
){
console
.
log
(
'getLessonDetail'
,
id
);
this
.
form
.
start_num
=
''
getLessonDetailApi
(
id
,{}).
then
((
res
)
=>
{
this
.
itemOptions
=
res
.
detail
[
res
.
type
]
})
...
...
src/components/single/dialog.vue
View file @
9483849d
...
...
@@ -171,7 +171,8 @@
this
.
form
=
{
name
:
res
.
name
,
num
:
res
.
num
,
cover
:
res
.
cover
cover
:
res
.
cover
,
category_name
:
res
.
category_name
};
if
(
this
.
form
.
cover
&&
this
.
form
.
cover
!==
''
){
this
.
imageList
=
[{
name
:
res
.
cover
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
cover
}];
...
...
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