Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform-ui
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
youjj
cloud-platform-ui
Commits
24782dec
Commit
24782dec
authored
Dec 13, 2019
by
guoyou
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://113.105.137.151:22280/youjj/cloud-platform-ui
into base-modify
parents
6a9c0de8
5a84e47e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
162 additions
and
128 deletions
+162
-128
index.vue
src/views/appManagement/selectedActivities/index.vue
+162
-128
No files found.
src/views/appManagement/selectedActivities/index.vue
View file @
24782dec
<
template
>
<div
class=
"app-container calendar-list-container"
v-loading
.
body=
"showLoadingBody"
>
<div
class=
"filter-container"
ref=
"filter-container"
>
<el-form
ref=
"queryForm"
:inline=
"inline"
:model=
"listQuery"
label-width=
"60px"
>
<el-row>
<el-col
:span=
"6"
>
<el-form-item
label=
"描述"
>
<el-input
v-model
.
number=
"listQuery.activitiesName"
placeholder=
"请输入描述"
></el-input>
</el-form-item>
</el-col>
<el-button
class=
"filter-item"
type=
"primary"
v-waves
icon=
"search"
@
click=
"handleFilter"
>
搜索
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
style=
"float: right;"
@
click=
"handleCreate"
>
+ 添加弹窗
</el-button>
</el-row>
</el-form>
<el-form
ref=
"queryForm"
:inline=
"inline"
:model=
"listQuery"
label-width=
"60px"
>
<el-row>
<el-col
:span=
"6"
>
<el-form-item
label=
"描述"
>
<el-input
v-model
.
number=
"listQuery.activitiesName"
placeholder=
"请输入描述"
></el-input>
</el-form-item>
</el-col>
<el-button
class=
"filter-item"
type=
"primary"
v-waves
icon=
"search"
@
click=
"handleFilter"
>
搜索
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
style=
"float: right;"
@
click=
"handleCreate"
>
+ 添加弹窗
</el-button>
</el-row>
</el-form>
</div>
<el-table
:key=
'tableKey'
:data=
"list"
border
fit
highlight-current-row
style=
"width: 100%"
>
...
...
@@ -24,11 +24,21 @@
<span>
{{
scope
.
row
.
name
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"300"
align=
"center"
label=
"跳转链接"
>
<el-table-column
width=
"300"
align=
"center"
label=
"
安卓
跳转链接"
>
<
template
scope=
"scope"
>
<span>
{{
scope
.
row
.
url
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"300"
align=
"center"
label=
"苹果跳转链接"
>
<
template
scope=
"scope"
>
<span>
{{
scope
.
row
.
iosUrl
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"300"
align=
"center"
label=
"小程序跳转链接"
>
<
template
scope=
"scope"
>
<span>
{{
scope
.
row
.
purl
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"300"
align=
"center"
label=
"banner图片"
>
<
template
scope=
"scope"
>
<img
:src=
"scope.row.picture"
style=
"width:100%;max-height:100px;"
>
...
...
@@ -45,17 +55,25 @@
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"状态"
>
<
template
scope=
"scope"
>
<
template
scope=
"scope"
>
<span
v-if=
"scope.row.status==1"
>
上架
</span>
<span
v-if=
"scope.row.status==2"
>
下架
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
width=
"150"
label=
"操作"
fixed=
"right"
>
<
template
scope=
"scope"
>
<el-button
size=
"small"
class=
"el-button el-button--text el-button--small"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
size=
"small"
class=
"el-button el-button--text el-button--small"
@
click=
"handleDown(scope.row)"
v-show=
"scope.row.status==1"
>
下架
</el-button>
<el-button
size=
"small"
class=
"el-button el-button--text el-button--small"
@
click=
"handleUp(scope.row)"
v-show=
"scope.row.status==2"
>
上架
</el-button>
<el-button
class=
"el-button el-button--text el-button--small"
size=
"small"
@
click=
"deleteHandler(scope.row)"
style=
"color:red;"
v-show=
"scope.row.status==2"
>
删除
</el-button>
<el-button
size=
"small"
class=
"el-button el-button--text el-button--small"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
size=
"small"
class=
"el-button el-button--text el-button--small"
@
click=
"handleDown(scope.row)"
v-show=
"scope.row.status==1"
>
下架
</el-button>
<el-button
size=
"small"
class=
"el-button el-button--text el-button--small"
@
click=
"handleUp(scope.row)"
v-show=
"scope.row.status==2"
>
上架
</el-button>
<el-button
class=
"el-button el-button--text el-button--small"
size=
"small"
@
click=
"deleteHandler(scope.row)"
style=
"color:red;"
v-show=
"scope.row.status==2"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -70,19 +88,23 @@
<el-form-item
label=
"描述"
prop=
"name"
>
<el-input
v-model=
"form.name"
placeholder=
"请输入描述"
></el-input>
</el-form-item>
<el-form-item
label=
"上架时间"
>
<el-radio-group
v-model=
"form.up_name"
size=
"medium"
>
<el-radio-button
label=
"不限"
></el-radio-button>
<el-radio-button
label=
"自定义"
></el-radio-button>
</el-radio-group>
<div
style=
"display:inline-block"
v-show=
"form.up_name=='自定义'"
>
<el-date-picker
v-model=
"form.starTimeStr"
type =
"datetime"
placeholder =
"开始时间"
value-format=
" yyyy-MM-dd HH:mm"
format=
"yyyy-MM-dd HH:mm"
:picker-options=
"pickerOptionsStart"
></el-date-picker>
<span>
-
</span>
<el-date-picker
v-model=
"form.endTimeStr"
type =
"datetime"
placeholder =
"结束时间"
value-format=
" yyyy-MM-dd HH:mm"
format=
"yyyy-MM-dd HH:mm"
:picker-options=
"pickerOptionsEnd"
></el-date-picker>
</div>
<el-form-item
label=
"上架时间"
>
<el-radio-group
v-model=
"form.up_name"
size=
"medium"
>
<el-radio-button
label=
"不限"
></el-radio-button>
<el-radio-button
label=
"自定义"
></el-radio-button>
</el-radio-group>
<div
style=
"display:inline-block"
v-show=
"form.up_name=='自定义'"
>
<el-date-picker
v-model=
"form.starTimeStr"
type=
"datetime"
placeholder=
"开始时间"
value-format=
" yyyy-MM-dd HH:mm"
format=
"yyyy-MM-dd HH:mm"
:picker-options=
"pickerOptionsStart"
></el-date-picker>
<span>
-
</span>
<el-date-picker
v-model=
"form.endTimeStr"
type=
"datetime"
placeholder=
"结束时间"
value-format=
" yyyy-MM-dd HH:mm"
format=
"yyyy-MM-dd HH:mm"
:picker-options=
"pickerOptionsEnd"
></el-date-picker>
</div>
</el-form-item>
<el-form-item
label=
"排序"
prop=
"sort"
>
<el-input
v-model=
"form.sort"
placeholder=
"请输入排序"
></el-input>
<el-input
v-model=
"form.sort"
placeholder=
"请输入排序"
></el-input>
</el-form-item>
<el-form-item
label=
"图片"
prop=
"picture"
:style=
"{display:'block'}"
>
<el-upload
...
...
@@ -91,13 +113,21 @@
:show-file-list=
"false"
:headers=
"getHeaderWithToken"
:on-success=
"handleAvatarSuccess"
>
<img
v-if=
"$utils.isString(form.picture) && !$utils.isEmpty(form.picture)"
:src=
"form.picture"
style=
"width:200px;max-height:200px;"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:100px;height: 100px;vertical-align: middle;"
></i>
<img
v-if=
"$utils.isString(form.picture) && !$utils.isEmpty(form.picture)"
:src=
"form.picture"
style=
"width:200px;max-height:200px;"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
style=
"lineHeight:100px;width:100px;height: 100px;vertical-align: middle;"
></i>
</el-upload>
</el-form-item>
<el-form-item
label=
"跳转链接"
prop=
"url"
>
<el-form-item
label=
"
安卓
跳转链接"
prop=
"url"
>
<el-input
v-model=
"form.url"
placeholder=
"请输入跳转链接"
></el-input>
</el-form-item>
<el-form-item
label=
"苹果跳转链接"
prop=
"url"
>
<el-input
v-model=
"form.iosUrl"
placeholder=
"请输入跳转链接"
></el-input>
</el-form-item>
<el-form-item
label=
"小程序跳转链接"
prop=
"url"
>
<el-input
v-model=
"form.purl"
placeholder=
"请输入跳转链接"
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancelHandel"
>
取 消
</el-button>
...
...
@@ -152,19 +182,21 @@
},
data
()
{
return
{
tableKey
:
0
,
tableKey
:
0
,
modalTitle
:
"创建"
,
BASE_API
:
process
.
env
.
BASE_API
,
bannerDialogVisible
:
false
,
//添加、编辑弹框
showLoadingBody
:
false
,
form
:
{
name
:
""
,
up_name
:
'自定义'
,
starTimeStr
:
''
,
endTimeStr
:
''
,
sort
:
''
,
picture
:
''
,
url
:
''
,
up_name
:
'自定义'
,
starTimeStr
:
''
,
endTimeStr
:
''
,
sort
:
''
,
picture
:
''
,
url
:
''
,
iosUrl
:
''
,
purl
:
''
,
},
listQuery
:
{
page
:
1
,
...
...
@@ -174,10 +206,10 @@
},
rules
:
{
name
:
{
type
:
'string'
,
required
:
true
,
message
:
'请输入弹窗描述'
,
trigger
:
'blur'
type
:
'string'
,
required
:
true
,
message
:
'请输入弹窗描述'
,
trigger
:
'blur'
},
picture
:
{
type
:
'string'
,
...
...
@@ -190,7 +222,7 @@
message
:
'请输入链接'
,
trigger
:
'blur'
},
sort
:{
sort
:
{
required
:
true
,
message
:
'请输入排序'
}
...
...
@@ -201,12 +233,12 @@
}
},
pickerOptionsEnd
:
{
disabledDate
:
time
=>
{
const
beginDateVal
=
new
Date
(
this
.
form
.
starTimeStr
).
getTime
()
if
(
beginDateVal
)
{
return
time
.
getTime
()
<
beginDateVal
-
8.64e7
}
disabledDate
:
time
=>
{
const
beginDateVal
=
new
Date
(
this
.
form
.
starTimeStr
).
getTime
()
if
(
beginDateVal
)
{
return
time
.
getTime
()
<
beginDateVal
-
8.64e7
}
}
},
list
:
null
,
total
:
null
,
...
...
@@ -261,15 +293,15 @@
this
.
cleanForm
();
getObj
(
row
.
id
).
then
(
response
=>
{
var
item
=
response
.
data
;
item
.
up_name
=
item
.
timeType
==
0
?
'不限'
:
item
.
timeType
==
1
?
'自定义'
:
''
;
if
(
item
.
startTime
>
0
&&
item
.
timeType
==
1
)
{
item
.
up_name
=
item
.
timeType
==
0
?
'不限'
:
item
.
timeType
==
1
?
'自定义'
:
''
;
if
(
item
.
startTime
>
0
&&
item
.
timeType
==
1
)
{
item
.
starTimeStr
=
getYMD_hm
(
item
.
startTime
);
}
else
{
}
else
{
item
.
starTimeStr
=
''
;
}
if
(
item
.
endTime
>
0
&&
item
.
timeType
==
1
)
{
if
(
item
.
endTime
>
0
&&
item
.
timeType
==
1
)
{
item
.
endTimeStr
=
getYMD_hm
(
item
.
endTime
);
}
else
{
}
else
{
item
.
endTimeStr
=
''
;
}
this
.
form
=
item
;
...
...
@@ -280,23 +312,23 @@
/**
* 弹框-取消
* */
cancelHandel
(){
cancelHandel
()
{
this
.
cleanForm
();
this
.
bannerDialogVisible
=
false
;
},
/**
* 清空表单
* */
/**
* 清空表单
* */
cleanForm
()
{
this
.
form
=
{
name
:
""
,
up_name
:
'自定义'
,
starTimeStr
:
''
,
endTimeStr
:
''
,
sort
:
''
,
picture
:
''
,
url
:
''
,
sort
:
0
,
up_name
:
'自定义'
,
starTimeStr
:
''
,
endTimeStr
:
''
,
sort
:
''
,
picture
:
''
,
url
:
''
,
sort
:
0
,
}
},
/**
...
...
@@ -309,7 +341,7 @@
let
listRs
=
undefined
;
if
(
!
this
.
$utils
.
isEmpty
(
response
.
data
.
list
)
&&
this
.
$utils
.
isInteger
(
response
.
data
.
total
))
{
listRs
=
response
.
data
.
list
;
response
.
data
.
list
.
map
(
function
(
item
)
{
response
.
data
.
list
.
map
(
function
(
item
)
{
item
.
crtTimeStr
=
timestamp2Date
(
item
.
crtTime
);
item
.
visible2
=
false
;
});
...
...
@@ -328,42 +360,42 @@
const
set
=
this
.
$refs
;
set
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
that
.
form
.
up_name
==
'自定义'
){
that
.
form
.
timeType
=
1
;
that
.
form
.
startTime
=
new
Date
(
this
.
form
.
starTimeStr
).
getTime
();
that
.
form
.
endTime
=
new
Date
(
this
.
form
.
endTimeStr
).
getTime
();
if
(
new
Date
(
this
.
form
.
endTimeStr
).
getTime
()
<
new
Date
(
this
.
form
.
starTimeStr
).
getTime
()){
this
.
$notify
({
title
:
'警告'
,
message
:
'结束时间不能小于起始时间'
,
type
:
'warning'
,
duration
:
2000
});
return
false
;
if
(
that
.
form
.
up_name
==
'自定义'
)
{
that
.
form
.
timeType
=
1
;
that
.
form
.
startTime
=
new
Date
(
this
.
form
.
starTimeStr
).
getTime
();
that
.
form
.
endTime
=
new
Date
(
this
.
form
.
endTimeStr
).
getTime
();
if
(
new
Date
(
this
.
form
.
endTimeStr
).
getTime
()
<
new
Date
(
this
.
form
.
starTimeStr
).
getTime
())
{
this
.
$notify
({
title
:
'警告'
,
message
:
'结束时间不能小于起始时间'
,
type
:
'warning'
,
duration
:
2000
});
return
false
;
}
}
else
{
that
.
form
.
timeType
=
0
;
}
}
else
{
that
.
form
.
timeType
=
0
;
}
that
.
form
.
status
=
2
;
that
.
form
.
status
=
2
;
addObj
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
bannerDialogVisible
=
false
;
this
.
$notify
({
title
:
'成功'
,
message
:
'创建成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
getList
();
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
if
(
response
.
status
===
200
)
{
this
.
bannerDialogVisible
=
false
;
this
.
$notify
({
title
:
'成功'
,
message
:
'创建成功'
,
type
:
'success'
,
duration
:
2000
});
this
.
getList
();
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
}
else
{
return
false
;
}
...
...
@@ -376,12 +408,13 @@
let
that
=
this
;
const
set
=
this
.
$refs
;
set
[
formName
].
validate
(
valid
=>
{
debugger
if
(
valid
)
{
if
(
that
.
form
.
up_name
==
'自定义'
)
{
that
.
form
.
timeType
=
1
;
if
(
that
.
form
.
up_name
==
'自定义'
)
{
that
.
form
.
timeType
=
1
;
that
.
form
.
startTime
=
new
Date
(
this
.
form
.
starTimeStr
).
getTime
();
that
.
form
.
endTime
=
new
Date
(
this
.
form
.
endTimeStr
).
getTime
();
if
(
new
Date
(
this
.
form
.
endTimeStr
).
getTime
()
<
new
Date
(
this
.
form
.
starTimeStr
).
getTime
())
{
if
(
new
Date
(
this
.
form
.
endTimeStr
).
getTime
()
<
new
Date
(
this
.
form
.
starTimeStr
).
getTime
())
{
this
.
$notify
({
title
:
'警告'
,
message
:
'结束时间不能小于起始时间'
,
...
...
@@ -390,9 +423,10 @@
});
return
false
;
}
}
else
{
that
.
form
.
timeType
=
0
;
}
else
{
that
.
form
.
timeType
=
0
;
}
debugger
editObj
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
this
.
bannerDialogVisible
=
false
;
...
...
@@ -417,10 +451,10 @@
}
});
},
/**
/**
* 上架
* */
handleUp
(
row
){
handleUp
(
row
)
{
this
.
form
=
{};
this
.
form
.
id
=
row
.
id
;
this
.
form
.
status
=
1
;
...
...
@@ -434,20 +468,20 @@
type
:
'success'
,
duration
:
2000
});
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
* 下架
* */
handleDown
(
row
){
handleDown
(
row
)
{
this
.
form
=
{};
this
.
form
.
id
=
row
.
id
;
this
.
form
.
status
=
2
;
...
...
@@ -461,14 +495,14 @@
type
:
'success'
,
duration
:
2000
});
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
}
else
{
this
.
$notify
({
title
:
'失败'
,
message
:
rsCode
.
msg
[
response
.
code
]
?
rsCode
.
msg
[
response
.
code
]
:
'操作失败!'
,
type
:
'error'
,
duration
:
2000
});
}
});
},
/**
...
...
@@ -493,11 +527,11 @@
this
.
form
.
picture
=
res
.
data
;
this
.
showLoadingBody
=
false
;
},
/**
* 操作-删除
* */
deleteHandler
(
row
)
{
this
.
$confirm
(
'确定删除吗?'
,
'提示'
,
{
/**
* 操作-删除
* */
deleteHandler
(
row
)
{
this
.
$confirm
(
'确定删除吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
...
...
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