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
41a1b884
Commit
41a1b884
authored
Sep 13, 2018
by
王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单品盒子修改
parent
5d96b1c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
19 deletions
+97
-19
boxDialog.vue
src/components/box/boxDialog.vue
+18
-3
boxTypeList.vue
src/components/box/boxTypeList.vue
+4
-4
dialog.vue
src/components/single/dialog.vue
+75
-12
No files found.
src/components/box/boxDialog.vue
View file @
41a1b884
...
...
@@ -44,12 +44,26 @@
<el-row>
<el-col
:span=
"12"
>
<el-form-item
prop=
"title"
label=
"最小等级"
>
<el-input-number
v-model=
"form.min_level"
></el-input-number>
<el-select
v-model=
"form.min_level"
placeholder=
"请选择"
clearable
>
<el-option
v-for=
"item in levelOption"
:key=
"item"
:label=
"item"
:value=
"item"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
prop=
"title"
label=
"最大等级"
>
<el-input-number
v-model=
"form.max_level"
></el-input-number>
<el-select
v-model=
"form.max_level"
placeholder=
"请选择"
clearable
>
<el-option
v-for=
"item in levelOption"
:key=
"item"
:label=
"item"
:value=
"item"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -104,7 +118,8 @@
max_age
:
0
,
min_level
:
0
,
max_level
:
0
}
},
levelOption
:
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
]
}
},
mounted
(){
...
...
src/components/box/boxTypeList.vue
View file @
41a1b884
...
...
@@ -6,8 +6,8 @@
</div>
<el-card
class=
"box-card"
>
<div
slot=
"header"
>
<span>
盒子类型
</span>
<el-button
style=
"float: right; padding: 3px 0;"
@
click=
"onAddType"
type=
"text"
v-if=
"!$store.state.readonly"
>
新增
类型
</el-button>
<span>
主题类别
</span>
<el-button
style=
"float: right; padding: 3px 0;"
@
click=
"onAddType"
type=
"text"
v-if=
"!$store.state.readonly"
>
新增
</el-button>
</div>
<el-card
v-for=
"o in list"
shadow=
"hover"
:key=
"o.id"
:class=
"
{text:true,'now-card':o.id === nowId}">
<div
class=
"name"
@
click=
"changeCateGory(o.id)"
>
...
...
@@ -20,10 +20,10 @@
</div>
</el-card>
</el-card>
<el-dialog
title=
"
新增盒子
"
:visible
.
sync=
"dialogVisible"
:modal=
"false"
v-if=
"!$store.state.readonly"
>
<el-dialog
title=
"
主题类别
"
:visible
.
sync=
"dialogVisible"
:modal=
"false"
v-if=
"!$store.state.readonly"
>
<el-form
label-width=
"100px"
>
<el-form-item
label=
"名称"
>
<el-input
v-model=
"form.name"
></el-input>
<el-input
v-model=
"form.name"
placeholder=
"规则:课程类别-主题-教具"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
...
...
src/components/single/dialog.vue
View file @
41a1b884
...
...
@@ -6,16 +6,16 @@
:visible
.
sync=
"show"
width=
"800px"
>
<div
v-loading=
"loading"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
>
<el-form
ref=
"form"
:model=
"form"
>
<el-row>
<el-col
:span=
"4"
><label>
单品名称
</label></el-col>
<el-col
:span=
"8"
>
<el-form-item
prop=
"name"
>
<el-input
v-model=
"form.name"
></el-input>
<el-form-item>
<el-input
v-model=
"form.name"
placeholder=
"规则:主题名+单品名"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"4"
>
<label>
数量
</label>
<label>
库存
数量
</label>
</el-col>
<el-col
:span=
"8"
>
<el-form-item>
...
...
@@ -27,9 +27,27 @@
<el-col
:span=
"4"
>
<label>
分类
</label>
</el-col>
<el-col
:span=
"
8
"
>
<el-col
:span=
"
20
"
>
<el-form-item>
<el-input
v-model=
"form.category_name"
></el-input>
<el-tag
:key=
"tagIndex"
v-for=
"(tag,tagIndex) in form.category_name"
closable
:disable-transitions=
"false"
@
close=
"handleClose(tag)"
>
{{
tag
}}
</el-tag>
<el-input
class=
"input-new-tag"
v-if=
"inputVisible"
v-model=
"inputValue"
ref=
"saveTagInput"
size=
"small"
@
keyup
.
enter
.
native=
"handleInputConfirm"
@
blur=
"handleInputConfirm"
>
</el-input>
<el-button
v-else
class=
"button-new-tag"
size=
"small"
@
click=
"showInput"
>
+ 新增
</el-button>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -82,19 +100,43 @@
rules
:
{
},
inputVisible
:
false
,
inputValue
:
''
,
teacherDetail
:
{}
}
},
methods
:{
handleClose
(
tag
)
{
this
.
form
.
category_name
.
splice
(
this
.
form
.
category_name
.
indexOf
(
tag
),
1
);
},
showInput
()
{
this
.
inputVisible
=
true
;
this
.
$nextTick
(
_
=>
{
this
.
$refs
.
saveTagInput
.
$refs
.
input
.
focus
();
});
},
handleInputConfirm
()
{
let
inputValue
=
this
.
inputValue
;
if
(
inputValue
)
{
this
.
form
.
category_name
.
push
(
inputValue
);
}
this
.
inputVisible
=
false
;
this
.
inputValue
=
''
;
},
sub
(){
switch
(
this
.
dialogObj
.
type
){
case
0
:
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
){
if
(
this
.
imageList
.
length
>
0
){
console
.
log
(
'this.imageList'
,
this
.
imageList
)
this
.
form
.
cover
=
this
.
imageList
[
0
].
name
;
}
addSingleApi
(
this
.
form
).
then
(()
=>
{
let
json
=
this
.
form
;
json
.
category_name
=
json
.
category_name
.
join
(
','
)
addSingleApi
(
json
).
then
(()
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功!'
...
...
@@ -108,11 +150,16 @@
case
1
:
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
){
this
.
form
.
cover
=
this
.
imageList
[
0
].
name
;
editSingleApi
(
this
.
id
,
this
.
form
).
then
(()
=>
{
console
.
log
(
'this.imageList'
,
this
.
imageList
)
if
(
this
.
imageList
.
length
>
0
){
this
.
form
.
cover
=
this
.
imageList
[
0
].
name
;
}
let
json
=
this
.
form
;
json
.
category_name
=
json
.
category_name
.
join
(
','
)
editSingleApi
(
this
.
id
,
json
).
then
(()
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'
新增
成功!'
message
:
'
修改
成功!'
});
this
.
$emit
(
"reflash"
);
this
.
show
=
false
;
...
...
@@ -156,7 +203,8 @@
this
.
form
=
{
name
:
''
,
num
:
0
,
cover
:
''
cover
:
''
,
category_name
:
[]
};
this
.
uploadShow
=
true
;
this
.
loading
=
false
;
...
...
@@ -172,7 +220,7 @@
name
:
res
.
name
,
num
:
res
.
num
,
cover
:
res
.
cover
,
category_name
:
res
.
category_name
category_name
:
res
.
category_name
?
res
.
category_name
.
split
(
','
)
:
[]
};
if
(
this
.
form
.
cover
&&
this
.
form
.
cover
!==
''
){
this
.
imageList
=
[{
name
:
res
.
cover
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
cover
}];
...
...
@@ -226,5 +274,20 @@
.disabled
.el-upload--picture-card
{
display
:
none
!important
;
}
.el-tag
+
.el-tag
{
margin-left
:
10px
;
}
.button-new-tag
{
margin-left
:
10px
;
height
:
32px
;
line-height
:
30px
;
padding-top
:
0
;
padding-bottom
:
0
;
}
.input-new-tag
{
width
:
90px
;
margin-left
:
10px
;
vertical-align
:
bottom
;
}
</
style
>
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