Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
6f0ebe3e
Commit
6f0ebe3e
authored
Nov 17, 2018
by
Junling Bu
Browse files
chore[litemall-admin]: 管理后台基于的vue-element-admin框架更新至3.9.3
parent
cffdc561
Changes
156
Hide whitespace changes
Inline
Side-by-side
litemall-admin/src/views/promotion/ad.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入广告标题"
v-model=
"listQuery.name"
>
<el-input
v-model=
"listQuery.name"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入广告标题"
/>
</el-input>
<el-input
v-model=
"listQuery.content"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入广告内容"
/>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入广告内容"
v-model=
"listQuery.content"
>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
:loading=
"downloadLoading"
>
导出
</el-button>
<el-button
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading
"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table
v-loading=
"listLoading"
:data=
"list"
size=
"small
"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
label=
"广告ID"
prop=
"id"
sortable
/>
<el-table-column
align=
"center"
label=
"广告ID"
prop=
"id"
sortable
>
<el-table-column
align=
"center"
label=
"广告标题"
prop=
"name"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"广告标题"
prop=
"name"
>
<el-table-column
align=
"center"
label=
"广告内容"
prop=
"content"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"广告内容"
prop=
"content"
>
</el-table-column>
<el-table-column
align=
"center"
label=
"广告图片"
prop=
"url"
>
<el-table-column
align=
"center"
label=
"广告图片"
prop=
"url"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<img
:src=
"scope.row.url"
width=
"80"
v-if=
"scope.row.url"
/
>
<img
v-if=
"scope.row.url"
:src=
"scope.row.url"
width=
"80"
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"广告位置"
prop=
"position"
>
<el-table-column
align=
"center"
label=
"广告位置"
prop=
"position"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"活动链接"
prop=
"link"
>
<el-table-column
align=
"center"
label=
"活动链接"
prop=
"link"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"是否启用"
prop=
"enabled"
>
<el-table-column
align=
"center"
label=
"是否启用"
prop=
"enabled"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
...
@@ -46,48 +38,40 @@
...
@@ -46,48 +38,40 @@
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
class-name=
"small-padding fixed-width"
>
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
<!-- 添加或修改对话框 -->
<!-- 添加或修改对话框 -->
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-form
:rules=
"rules"
ref=
"dataForm
"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'
width: 400px; margin-left:50px;
'
>
<el-form
ref=
"dataForm"
:rules=
"rules
"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
"
width: 400px; margin-left:50px;
"
>
<el-form-item
label=
"广告标题"
prop=
"name"
>
<el-form-item
label=
"广告标题"
prop=
"name"
>
<el-input
v-model=
"dataForm.name"
></el-input
>
<el-input
v-model=
"dataForm.name"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"广告内容"
prop=
"content"
>
<el-form-item
label=
"广告内容"
prop=
"content"
>
<el-input
v-model=
"dataForm.content"
></el-input
>
<el-input
v-model=
"dataForm.content"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"广告图片"
prop=
"url"
>
<el-form-item
label=
"广告图片"
prop=
"url"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false
"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadUrl"
>
<el-upload
:headers=
"headers"
:action=
"uploadPath"
:show-file-list=
"false"
:on-success=
"uploadUrl"
class=
"avatar-uploader"
list-type=
"picture-card
"
accept=
".jpg,.jpeg,.png,.gif"
>
<img
v-if=
"dataForm.url"
:src=
"dataForm.url"
class=
"avatar"
>
<img
v-if=
"dataForm.url"
:src=
"dataForm.url"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
/
>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"广告位置"
prop=
"position"
>
<el-form-item
label=
"广告位置"
prop=
"position"
>
<el-select
v-model=
"dataForm.position"
placeholder=
"请选择"
>
<el-select
v-model=
"dataForm.position"
placeholder=
"请选择"
>
<el-option
label=
"首页"
:value=
"1"
>
<el-option
:value=
"1"
label=
"首页"
/>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"活动链接"
prop=
"link"
>
<el-form-item
label=
"活动链接"
prop=
"link"
>
<el-input
v-model=
"dataForm.link"
></el-input
>
<el-input
v-model=
"dataForm.link"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"是否启用"
prop=
"enabled"
>
<el-form-item
label=
"是否启用"
prop=
"enabled"
>
<el-select
v-model=
"dataForm.enabled"
placeholder=
"请选择"
>
<el-select
v-model=
"dataForm.enabled"
placeholder=
"请选择"
>
<el-option
label=
"启用"
:value=
"true"
>
<el-option
:value=
"true"
label=
"启用"
/>
</el-option>
<el-option
:value=
"false"
label=
"不启用"
/>
<el-option
label=
"不启用"
:value=
"false"
>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -102,45 +86,40 @@
...
@@ -102,45 +86,40 @@
</template>
</template>
<
style
>
<
style
>
.avatar-uploader
.el-upload
{
.avatar-uploader
.el-upload
{
border
:
1px
dashed
#d9d9d9
;
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
border-radius
:
6px
;
cursor
:
pointer
;
cursor
:
pointer
;
position
:
relative
;
position
:
relative
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.avatar-uploader
.el-upload
:hover
{
.avatar-uploader
.el-upload
:hover
{
border-color
:
#20a0ff
;
border-color
:
#20a0ff
;
}
}
.avatar-uploader-icon
{
.avatar-uploader-icon
{
font-size
:
28px
;
font-size
:
28px
;
color
:
#8c939d
;
color
:
#8c939d
;
width
:
120px
;
width
:
120px
;
height
:
120px
;
height
:
120px
;
line-height
:
120px
;
line-height
:
120px
;
text-align
:
center
;
text-align
:
center
;
}
}
.avatar
{
.avatar
{
width
:
120px
;
width
:
120px
;
height
:
120px
;
height
:
120px
;
display
:
block
;
display
:
block
;
}
}
</
style
>
</
style
>
<
script
>
<
script
>
import
{
listAd
,
createAd
,
updateAd
,
deleteAd
}
from
'
@/api/ad
'
import
{
listAd
,
createAd
,
updateAd
,
deleteAd
}
from
'
@/api/ad
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
import
{
getToken
}
from
'
@/utils/auth
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
export
default
{
export
default
{
name
:
'
Ad
'
,
name
:
'
Ad
'
,
computed
:
{
components
:
{
Pagination
},
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
data
()
{
return
{
return
{
uploadPath
,
uploadPath
,
...
@@ -171,41 +150,46 @@ export default {
...
@@ -171,41 +150,46 @@ export default {
create
:
'
创建
'
create
:
'
创建
'
},
},
rules
:
{
rules
:
{
name
:
[{
required
:
true
,
message
:
'
广告标题不能为空
'
,
trigger
:
'
blur
'
}],
name
:
[
content
:
[{
required
:
true
,
message
:
'
广告内容不能为空
'
,
trigger
:
'
blur
'
}],
{
required
:
true
,
message
:
'
广告标题不能为空
'
,
trigger
:
'
blur
'
}
],
content
:
[
{
required
:
true
,
message
:
'
广告内容不能为空
'
,
trigger
:
'
blur
'
}
],
url
:
[{
required
:
true
,
message
:
'
广告链接不能为空
'
,
trigger
:
'
blur
'
}]
url
:
[{
required
:
true
,
message
:
'
广告链接不能为空
'
,
trigger
:
'
blur
'
}]
},
},
downloadLoading
:
false
downloadLoading
:
false
}
}
},
},
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
created
()
{
created
()
{
this
.
getList
()
this
.
getList
()
},
},
methods
:
{
methods
:
{
getList
()
{
getList
()
{
this
.
listLoading
=
true
this
.
listLoading
=
true
listAd
(
this
.
listQuery
).
then
(
response
=>
{
listAd
(
this
.
listQuery
)
this
.
list
=
response
.
data
.
data
.
items
.
then
(
response
=>
{
this
.
total
=
response
.
data
.
data
.
total
this
.
list
=
response
.
data
.
data
.
items
this
.
listLoading
=
false
this
.
total
=
response
.
data
.
data
.
total
}).
catch
(()
=>
{
this
.
listLoading
=
false
this
.
list
=
[]
})
this
.
total
=
0
.
catch
(()
=>
{
this
.
listLoading
=
false
this
.
list
=
[]
})
this
.
total
=
0
this
.
listLoading
=
false
})
},
},
handleFilter
()
{
handleFilter
()
{
this
.
listQuery
.
page
=
1
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
resetForm
()
{
resetForm
()
{
this
.
dataForm
=
{
this
.
dataForm
=
{
id
:
undefined
,
id
:
undefined
,
...
@@ -229,21 +213,23 @@ export default {
...
@@ -229,21 +213,23 @@ export default {
this
.
dataForm
.
url
=
response
.
data
.
url
this
.
dataForm
.
url
=
response
.
data
.
url
},
},
createData
()
{
createData
()
{
this
.
$refs
[
'
dataForm
'
].
validate
(
(
valid
)
=>
{
this
.
$refs
[
'
dataForm
'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
createAd
(
this
.
dataForm
).
then
(
response
=>
{
createAd
(
this
.
dataForm
)
this
.
list
.
unshift
(
response
.
data
.
data
)
.
then
(
response
=>
{
this
.
dialogFormVisible
=
false
this
.
list
.
unshift
(
response
.
data
.
data
)
this
.
$notify
.
success
({
this
.
dialogFormVisible
=
false
title
:
'
成功
'
,
this
.
$notify
.
success
({
message
:
'
创建成功
'
title
:
'
成功
'
,
message
:
'
创建成功
'
})
})
})
}).
catch
(
response
=>
{
.
catch
(
response
=>
{
this
.
$notify
.
error
({
this
.
$notify
.
error
({
title
:
'
失败
'
,
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
message
:
response
.
data
.
errmsg
})
})
})
})
}
}
})
})
},
},
...
@@ -256,50 +242,70 @@ export default {
...
@@ -256,50 +242,70 @@ export default {
})
})
},
},
updateData
()
{
updateData
()
{
this
.
$refs
[
'
dataForm
'
].
validate
(
(
valid
)
=>
{
this
.
$refs
[
'
dataForm
'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
updateAd
(
this
.
dataForm
).
then
(()
=>
{
updateAd
(
this
.
dataForm
)
for
(
const
v
of
this
.
list
)
{
.
then
(()
=>
{
if
(
v
.
id
===
this
.
dataForm
.
id
)
{
for
(
const
v
of
this
.
list
)
{
const
index
=
this
.
list
.
indexOf
(
v
)
if
(
v
.
id
===
this
.
dataForm
.
id
)
{
this
.
list
.
splice
(
index
,
1
,
this
.
dataForm
)
const
index
=
this
.
list
.
indexOf
(
v
)
break
this
.
list
.
splice
(
index
,
1
,
this
.
dataForm
)
break
}
}
}
}
this
.
dialogFormVisible
=
false
this
.
dialogFormVisible
=
false
this
.
$notify
.
success
({
this
.
$notify
.
success
({
title
:
'
成功
'
,
title
:
'
成功
'
,
message
:
'
更新广告
成功
'
message
:
'
更新广告成功
'
})
})
})
}).
catch
(
response
=>
{
.
catch
(
response
=>
{
this
.
$notify
.
error
({
this
.
$notify
.
error
({
title
:
'
失败
'
,
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
message
:
response
.
data
.
errmsg
})
})
})
})
}
}
})
})
},
},
handleDelete
(
row
)
{
handleDelete
(
row
)
{
deleteAd
(
row
).
then
(
response
=>
{
deleteAd
(
row
)
this
.
$notify
.
success
({
.
then
(
response
=>
{
title
:
'
成功
'
,
this
.
$notify
.
success
({
message
:
'
删除成功
'
title
:
'
成功
'
,
message
:
'
删除成功
'
})
const
index
=
this
.
list
.
indexOf
(
row
)
this
.
list
.
splice
(
index
,
1
)
})
})
const
index
=
this
.
list
.
indexOf
(
row
)
.
catch
(
response
=>
{
this
.
list
.
splice
(
index
,
1
)
this
.
$notify
.
error
({
}).
catch
(
response
=>
{
title
:
'
失败
'
,
this
.
$notify
.
error
({
message
:
response
.
data
.
errmsg
title
:
'
失败
'
,
})
message
:
response
.
data
.
errmsg
})
})
})
},
},
handleDownload
()
{
handleDownload
()
{
this
.
downloadLoading
=
true
this
.
downloadLoading
=
true
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
const
tHeader
=
[
'
广告ID
'
,
'
广告标题
'
,
'
广告内容
'
,
'
广告图片
'
,
'
广告位置
'
,
'
活动链接
'
,
'
是否启用
'
]
const
tHeader
=
[
const
filterVal
=
[
'
id
'
,
'
name
'
,
'
content
'
,
'
url
'
,
'
postion
'
,
'
link
'
,
'
enabled
'
]
'
广告ID
'
,
'
广告标题
'
,
'
广告内容
'
,
'
广告图片
'
,
'
广告位置
'
,
'
活动链接
'
,
'
是否启用
'
]
const
filterVal
=
[
'
id
'
,
'
name
'
,
'
content
'
,
'
url
'
,
'
postion
'
,
'
link
'
,
'
enabled
'
]
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
广告信息
'
)
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
广告信息
'
)
this
.
downloadLoading
=
false
this
.
downloadLoading
=
false
})
})
...
...
litemall-admin/src/views/promotion/grouponActivity.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入商品编号"
v-model=
"listQuery.goodsId"
>
<el-input
v-model=
"listQuery.goodsId"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入商品编号"
/>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
:loading=
"downloadLoading"
icon=
"el-icon-download"
<el-button
@
click=
"handleDownload"
>
导出
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading"
element-loading-text=
"正在查询中。。。"
border
fit
<el-table
highlight-current-row
>
v-loading=
"listLoading"
:data=
"list"
size=
"small"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
type=
"expand"
>
<el-table-column
type=
"expand"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-table
:data=
"scope.row.subGroupons"
border
style=
"width: 100%"
>
<el-table
:data=
"scope.row.subGroupons"
border
style=
"width: 100%"
>
<el-table-column
align=
"center"
label=
"订单ID"
prop=
"orderId"
>
<el-table-column
align=
"center"
label=
"订单ID"
prop=
"orderId"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"用户ID"
prop=
"userId"
/>
<el-table-column
align=
"center"
label=
"用户ID"
prop=
"userId"
>
</el-table-column>
</el-table>
</el-table>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"订单ID"
prop=
"groupon.orderId"
>
<el-table-column
align=
"center"
label=
"订单ID"
prop=
"groupon.orderId"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"用户ID"
prop=
"groupon.userId"
>
<el-table-column
align=
"center"
label=
"用户ID"
prop=
"groupon.userId"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"参与人数"
prop=
"subGroupons.length"
>
<el-table-column
align=
"center"
label=
"参与人数"
prop=
"subGroupons.length"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"团购折扣"
prop=
"rules.discount"
>
<el-table-column
align=
"center"
label=
"团购折扣"
prop=
"rules.discount"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"团购要求"
prop=
"rules.discountMember"
>
<el-table-column
align=
"center"
label=
"团购要求"
prop=
"rules.discountMember"
/>
</el-table-column>
<el-table-column
align=
"center"
property=
"iconUrl"
label=
"分享图片"
>
<el-table-column
align=
"center"
property=
"iconUrl"
label=
"分享图片"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<img
:src=
"scope.row.groupon.shareUrl"
width=
"40"
/
>
<img
:src=
"scope.row.groupon.shareUrl"
width=
"40"
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"开始时间"
prop=
"rules.addTime"
>
<el-table-column
align=
"center"
label=
"开始时间"
prop=
"rules.addTime"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"结束时间"
prop=
"rules.expireTime"
>
<el-table-column
align=
"center"
label=
"结束时间"
prop=
"rules.expireTime"
/>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
<el-tooltip
placement=
"top"
content=
"返回顶部"
>
<el-tooltip
placement=
"top"
content=
"返回顶部"
>
<back-to-top
:visibility
H
eight=
"100"
></back-to-top
>
<back-to-top
:visibility
-h
eight=
"100"
/
>
</el-tooltip>
</el-tooltip>
</div>
</div>
...
@@ -92,66 +85,59 @@
...
@@ -92,66 +85,59 @@
</
style
>
</
style
>
<
script
>
<
script
>
import
{
listRecord
}
from
'
@/api/groupon
'
import
{
listRecord
}
from
'
@/api/groupon
'
import
BackToTop
from
'
@/components/BackToTop
'
import
BackToTop
from
'
@/components/BackToTop
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
export
default
{
name
:
'
GrouponActivity
'
,
export
default
{
components
:
{
BackToTop
},
name
:
'
GrouponActivity
'
,
data
()
{
components
:
{
BackToTop
,
Pagination
},
return
{
data
()
{
list
:
[],
return
{
total
:
0
,
list
:
[],
listLoading
:
true
,
total
:
0
,
listQuery
:
{
listLoading
:
true
,
page
:
1
,
listQuery
:
{
limit
:
20
,
page
:
1
,
goodsId
:
undefined
,
limit
:
20
,
sort
:
'
add_time
'
,
goodsId
:
undefined
,
order
:
'
desc
'
sort
:
'
add_time
'
,
},
order
:
'
desc
'
goodsDetail
:
''
,
},
detailDialogVisible
:
false
,
goodsDetail
:
''
,
downloadLoading
:
false
detailDialogVisible
:
false
,
}
downloadLoading
:
false
}
},
created
()
{
this
.
getList
()
},
methods
:
{
getList
()
{
this
.
listLoading
=
true
listRecord
(
this
.
listQuery
).
then
(
response
=>
{
this
.
list
=
response
.
data
.
data
.
items
this
.
total
=
response
.
data
.
data
.
total
this
.
listLoading
=
false
}).
catch
(()
=>
{
this
.
list
=
[]
this
.
total
=
0
this
.
listLoading
=
false
})
},
},
created
()
{
handleFilter
()
{
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
methods
:
{
handleDownload
()
{
getList
()
{
this
.
downloadLoading
=
true
this
.
listLoading
=
true
listRecord
(
this
.
listQuery
).
then
(
response
=>
{
this
.
list
=
response
.
data
.
data
.
items
this
.
total
=
response
.
data
.
data
.
total
this
.
listLoading
=
false
}).
catch
(()
=>
{
this
.
list
=
[]
this
.
total
=
0
this
.
listLoading
=
false
})
},
handleFilter
()
{
this
.
listQuery
.
page
=
1
this
.
getList
()
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
handleDownload
()
{
this
.
downloadLoading
=
true
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
const
tHeader
=
[
'
商品ID
'
,
'
名称
'
,
'
首页主图
'
,
'
折扣
'
,
'
人数要求
'
,
'
活动开始时间
'
,
'
活动结束时间
'
]
const
tHeader
=
[
'
商品ID
'
,
'
名称
'
,
'
首页主图
'
,
'
折扣
'
,
'
人数要求
'
,
'
活动开始时间
'
,
'
活动结束时间
'
]
const
filterVal
=
[
'
id
'
,
'
name
'
,
'
pic_url
'
,
'
discount
'
,
'
discountMember
'
,
'
addTime
'
,
'
expireTime
'
]
const
filterVal
=
[
'
id
'
,
'
name
'
,
'
pic_url
'
,
'
discount
'
,
'
discountMember
'
,
'
addTime
'
,
'
expireTime
'
]
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
商品信息
'
)
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
商品信息
'
)
this
.
downloadLoading
=
false
this
.
downloadLoading
=
false
})
})
}
}
}
}
}
}
</
script
>
</
script
>
litemall-admin/src/views/promotion/grouponRule.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入商品编号"
v-model=
"listQuery.goodsId"
>
<el-input
v-model=
"listQuery.goodsId"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入商品编号"
/>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
@
click=
"handleCreate"
icon=
"el-icon-edit"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
:loading=
"downloadLoading"
icon=
"el-icon-download"
<el-button
@
click=
"handleDownload"
>
导出
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading"
element-loading-text=
"正在查询中。。。"
border
fit
<el-table
highlight-current-row
>
v-loading=
"listLoading"
<el-table-column
align=
"center"
label=
"商品ID"
prop=
"goodsId"
>
:data=
"list"
</el-table-column>
size=
"small"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
label=
"商品ID"
prop=
"goodsId"
/>
<el-table-column
align=
"center"
min-width=
"100"
label=
"名称"
prop=
"goodsName"
>
<el-table-column
align=
"center"
min-width=
"100"
label=
"名称"
prop=
"goodsName"
/>
</el-table-column>
<el-table-column
align=
"center"
property=
"picUrl"
label=
"图片"
>
<el-table-column
align=
"center"
property=
"picUrl"
label=
"图片"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<img
:src=
"scope.row.picUrl"
width=
"40"
/
>
<img
:src=
"scope.row.picUrl"
width=
"40"
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"团购优惠"
prop=
"discount"
>
<el-table-column
align=
"center"
label=
"团购优惠"
prop=
"discount"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"团购要求"
prop=
"discountMember"
>
<el-table-column
align=
"center"
label=
"团购要求"
prop=
"discountMember"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"开始时间"
prop=
"addTime"
>
<el-table-column
align=
"center"
label=
"开始时间"
prop=
"addTime"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"结束时间"
prop=
"expireTime"
>
<el-table-column
align=
"center"
label=
"结束时间"
prop=
"expireTime"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
class-name=
"small-padding fixed-width"
>
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
...
@@ -49,21 +52,29 @@
...
@@ -49,21 +52,29 @@
<!-- 添加或修改对话框 -->
<!-- 添加或修改对话框 -->
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-form
:rules=
"rules"
ref=
"dataForm"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
<el-form
style=
'width: 400px; margin-left:50px;'
>
ref=
"dataForm"
:rules=
"rules"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
"width: 400px; margin-left:50px;"
>
<el-form-item
label=
"商品ID"
prop=
"goodsId"
>
<el-form-item
label=
"商品ID"
prop=
"goodsId"
>
<el-input
v-model=
"dataForm.goodsId"
></el-input
>
<el-input
v-model=
"dataForm.goodsId"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"团购折扣"
prop=
"discount"
>
<el-form-item
label=
"团购折扣"
prop=
"discount"
>
<el-input
v-model=
"dataForm.discount"
></el-input
>
<el-input
v-model=
"dataForm.discount"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"团购人数要求"
prop=
"discountMember"
>
<el-form-item
label=
"团购人数要求"
prop=
"discountMember"
>
<el-input
v-model=
"dataForm.discountMember"
></el-input
>
<el-input
v-model=
"dataForm.discountMember"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"过期时间"
prop=
"expireTime"
>
<el-form-item
label=
"过期时间"
prop=
"expireTime"
>
<el-date-picker
v-model=
"dataForm.expireTime"
type=
"datetime"
placeholder=
"选择日期"
<el-date-picker
value-format=
"yyyy-MM-dd HH:mm:ss"
>
v-model=
"dataForm.expireTime"
</el-date-picker>
type=
"datetime"
placeholder=
"选择日期"
value-format=
"yyyy-MM-dd HH:mm:ss"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
@@ -73,181 +84,167 @@
...
@@ -73,181 +84,167 @@
</div>
</div>
</el-dialog>
</el-dialog>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
<el-tooltip
placement=
"top"
content=
"返回顶部"
>
<el-tooltip
placement=
"top"
content=
"返回顶部"
>
<back-to-top
:visibility
H
eight=
"100"
></back-to-top
>
<back-to-top
:visibility
-h
eight=
"100"
/
>
</el-tooltip>
</el-tooltip>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
listGroupon
,
publishGroupon
,
deleteGroupon
,
editGroupon
}
from
'
@/api/groupon
'
import
{
listGroupon
,
publishGroupon
,
deleteGroupon
,
editGroupon
}
from
'
@/api/groupon
'
import
BackToTop
from
'
@/components/BackToTop
'
import
BackToTop
from
'
@/components/BackToTop
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
export
default
{
export
default
{
name
:
'
GrouponRule
'
,
name
:
'
GrouponRule
'
,
components
:
{
BackToTop
},
components
:
{
BackToTop
,
Pagination
},
data
()
{
data
()
{
return
{
return
{
list
:
[],
list
:
[],
total
:
0
,
total
:
0
,
listLoading
:
true
,
listLoading
:
true
,
listQuery
:
{
listQuery
:
{
page
:
1
,
page
:
1
,
limit
:
20
,
limit
:
20
,
goodsId
:
undefined
,
goodsId
:
undefined
,
sort
:
'
add_time
'
,
sort
:
'
add_time
'
,
order
:
'
desc
'
order
:
'
desc
'
},
},
downloadLoading
:
false
,
downloadLoading
:
false
,
dataForm
:
{
dataForm
:
{
id
:
undefined
,
id
:
undefined
,
goodsId
:
''
,
goodsId
:
''
,
discount
:
''
,
discount
:
''
,
discountMember
:
''
,
discountMember
:
''
,
expireTime
:
undefined
expireTime
:
undefined
},
},
dialogFormVisible
:
false
,
dialogFormVisible
:
false
,
dialogStatus
:
''
,
dialogStatus
:
''
,
textMap
:
{
textMap
:
{
update
:
'
编辑
'
,
update
:
'
编辑
'
,
create
:
'
创建
'
create
:
'
创建
'
},
},
rules
:
{
rules
:
{
goodsId
:
[{
required
:
true
,
message
:
'
商品不能为空
'
,
trigger
:
'
blur
'
}]
goodsId
:
[{
required
:
true
,
message
:
'
商品不能为空
'
,
trigger
:
'
blur
'
}]
}
}
}
}
},
created
()
{
this
.
getList
()
},
methods
:
{
getList
()
{
this
.
listLoading
=
true
listGroupon
(
this
.
listQuery
).
then
(
response
=>
{
this
.
list
=
response
.
data
.
data
.
items
this
.
total
=
response
.
data
.
data
.
total
this
.
listLoading
=
false
}).
catch
(()
=>
{
this
.
list
=
[]
this
.
total
=
0
this
.
listLoading
=
false
})
},
},
created
()
{
handleFilter
()
{
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
methods
:
{
resetForm
()
{
getList
()
{
this
.
dataForm
=
{
this
.
listLoading
=
true
id
:
undefined
,
listGroupon
(
this
.
listQuery
).
then
(
response
=>
{
goodsId
:
''
,
this
.
list
=
response
.
data
.
data
.
items
discount
:
''
,
this
.
total
=
response
.
data
.
data
.
total
discountMember
:
''
,
this
.
listLoading
=
false
expireTime
:
undefined
}).
catch
(()
=>
{
}
this
.
list
=
[]
},
this
.
total
=
0
handleCreate
()
{
this
.
listLoading
=
false
this
.
resetForm
()
})
this
.
dialogStatus
=
'
create
'
},
this
.
dialogFormVisible
=
true
handleFilter
()
{
this
.
$nextTick
(()
=>
{
this
.
listQuery
.
page
=
1
this
.
$refs
[
'
dataForm
'
].
clearValidate
()
this
.
getList
()
})
},
},
handleSizeChange
(
val
)
{
createData
()
{
this
.
listQuery
.
limit
=
val
this
.
$refs
[
'
dataForm
'
].
validate
((
valid
)
=>
{
this
.
getList
()
if
(
valid
)
{
},
publishGroupon
(
this
.
dataForm
).
then
(
response
=>
{
handleCurrentChange
(
val
)
{
this
.
list
.
unshift
(
response
.
data
.
data
)
this
.
listQuery
.
page
=
val
this
.
dialogFormVisible
=
false
this
.
getList
()
this
.
$notify
.
success
({
},
title
:
'
成功
'
,
resetForm
()
{
message
:
'
创建团购规则成功
'
this
.
dataForm
=
{
id
:
undefined
,
goodsId
:
''
,
discount
:
''
,
discountMember
:
''
,
expireTime
:
undefined
}
},
handleCreate
()
{
this
.
resetForm
()
this
.
dialogStatus
=
'
create
'
this
.
dialogFormVisible
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
dataForm
'
].
clearValidate
()
})
},
createData
()
{
this
.
$refs
[
'
dataForm
'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
publishGroupon
(
this
.
dataForm
).
then
(
response
=>
{
this
.
list
.
unshift
(
response
.
data
.
data
)
this
.
dialogFormVisible
=
false
this
.
$notify
.
success
({
title
:
'
成功
'
,
message
:
'
创建团购规则成功
'
})
}).
catch
(
response
=>
{
this
.
$notify
.
error
({
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
})
})
})
}
}).
catch
(
response
=>
{
})
this
.
$notify
.
error
({
},
title
:
'
失败
'
,
handleUpdate
(
row
)
{
message
:
response
.
data
.
errmsg
this
.
dataForm
=
Object
.
assign
({},
row
)
this
.
dialogStatus
=
'
update
'
this
.
dialogFormVisible
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
dataForm
'
].
clearValidate
()
})
},
updateData
()
{
this
.
$refs
[
'
dataForm
'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
editGroupon
(
this
.
dataForm
).
then
(()
=>
{
for
(
const
v
of
this
.
list
)
{
if
(
v
.
id
===
this
.
dataForm
.
id
)
{
const
index
=
this
.
list
.
indexOf
(
v
)
this
.
list
.
splice
(
index
,
1
,
this
.
dataForm
)
break
}
}
this
.
dialogFormVisible
=
false
this
.
$notify
.
success
({
title
:
'
成功
'
,
message
:
'
更新团购规则成功
'
})
}).
catch
(
response
=>
{
this
.
$notify
.
error
({
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
})
})
})
}
})
},
handleDelete
(
row
)
{
deleteGroupon
(
row
).
then
(
response
=>
{
this
.
$notify
.
success
({
title
:
'
成功
'
,
message
:
'
删除团购规则成功
'
})
})
const
index
=
this
.
list
.
indexOf
(
row
)
}
this
.
list
.
splice
(
index
,
1
)
})
}).
catch
(
response
=>
{
},
this
.
$notify
.
error
({
handleUpdate
(
row
)
{
title
:
'
失败
'
,
this
.
dataForm
=
Object
.
assign
({},
row
)
message
:
response
.
data
.
errmsg
this
.
dialogStatus
=
'
update
'
this
.
dialogFormVisible
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
dataForm
'
].
clearValidate
()
})
},
updateData
()
{
this
.
$refs
[
'
dataForm
'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
editGroupon
(
this
.
dataForm
).
then
(()
=>
{
for
(
const
v
of
this
.
list
)
{
if
(
v
.
id
===
this
.
dataForm
.
id
)
{
const
index
=
this
.
list
.
indexOf
(
v
)
this
.
list
.
splice
(
index
,
1
,
this
.
dataForm
)
break
}
}
this
.
dialogFormVisible
=
false
this
.
$notify
.
success
({
title
:
'
成功
'
,
message
:
'
更新团购规则成功
'
})
}).
catch
(
response
=>
{
this
.
$notify
.
error
({
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
})
})
})
}
})
},
handleDelete
(
row
)
{
deleteGroupon
(
row
).
then
(
response
=>
{
this
.
$notify
.
success
({
title
:
'
成功
'
,
message
:
'
删除团购规则成功
'
})
})
},
const
index
=
this
.
list
.
indexOf
(
row
)
handleDownload
()
{
this
.
list
.
splice
(
index
,
1
)
this
.
downloadLoading
=
true
}).
catch
(
response
=>
{
this
.
$notify
.
error
({
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
})
})
},
handleDownload
()
{
this
.
downloadLoading
=
true
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
const
tHeader
=
[
'
商品ID
'
,
'
名称
'
,
'
首页主图
'
,
'
折扣
'
,
'
人数要求
'
,
'
活动开始时间
'
,
'
活动结束时间
'
]
const
tHeader
=
[
'
商品ID
'
,
'
名称
'
,
'
首页主图
'
,
'
折扣
'
,
'
人数要求
'
,
'
活动开始时间
'
,
'
活动结束时间
'
]
const
filterVal
=
[
'
id
'
,
'
name
'
,
'
pic_url
'
,
'
discount
'
,
'
discountMember
'
,
'
addTime
'
,
'
expireTime
'
]
const
filterVal
=
[
'
id
'
,
'
name
'
,
'
pic_url
'
,
'
discount
'
,
'
discountMember
'
,
'
addTime
'
,
'
expireTime
'
]
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
商品信息
'
)
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
商品信息
'
)
this
.
downloadLoading
=
false
this
.
downloadLoading
=
false
})
})
}
}
}
}
}
}
</
script
>
</
script
>
litemall-admin/src/views/promotion/topic.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入专题标题"
v-model=
"listQuery.title"
>
<el-input
v-model=
"listQuery.title"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入专题标题"
/>
</el-input>
<el-input
v-model=
"listQuery.subtitle"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入专题子标题"
/>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入专题子标题"
v-model=
"listQuery.subtitle"
>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
:loading=
"downloadLoading"
>
导出
</el-button>
<el-button
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table
v-loading=
"listLoading"
:data=
"list"
size=
"small"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
label=
"专题标题"
prop=
"title"
>
<el-table-column
align=
"center"
label=
"专题标题"
prop=
"title"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"专题子标题"
min-width=
"200"
prop=
"subtitle"
>
<el-table-column
align=
"center"
label=
"专题子标题"
min-width=
"200"
prop=
"subtitle"
/>
</el-table-column>
<el-table-column
align=
"center"
property=
"picUrl"
label=
"图片"
>
<el-table-column
align=
"center"
property=
"picUrl"
label=
"图片"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<img
:src=
"scope.row.picUrl"
width=
"80"
/
>
<img
:src=
"scope.row.picUrl"
width=
"80"
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"专题详情"
prop=
"content"
>
<el-table-column
align=
"center"
label=
"专题详情"
prop=
"content"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-dialog
title=
"专题详情"
:visible.sync=
"contentDialogVisible"
>
<el-dialog
:visible.sync=
"contentDialogVisible"
title=
"专题详情"
>
<div
v-html=
"contentDetail"
></div
>
<div
v-html=
"contentDetail"
/
>
</el-dialog>
</el-dialog>
<el-button
type=
"primary"
size=
"mini"
@
click=
"showContent(scope.row.content)"
>
查看
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"showContent(scope.row.content)"
>
查看
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"底价"
prop=
"price"
>
<el-table-column
align=
"center"
label=
"底价"
prop=
"price"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"阅读数量"
prop=
"readCount"
>
<el-table-column
align=
"center"
label=
"阅读数量"
prop=
"readCount"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
min-width=
"200"
class-name=
"small-padding fixed-width"
>
<el-table-column
align=
"center"
label=
"操作"
min-width=
"200"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
<el-tooltip
placement=
"top"
content=
"返回顶部"
>
<el-tooltip
placement=
"top"
content=
"返回顶部"
>
<back-to-top
:visibility
H
eight=
"100"
></back-to-top
>
<back-to-top
:visibility
-h
eight=
"100"
/
>
</el-tooltip>
</el-tooltip>
<!-- 添加或修改对话框 -->
<!-- 添加或修改对话框 -->
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-form
:rules=
"rules"
ref=
"dataForm
"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'
width: 400px; margin-left:50px;
'
>
<el-form
ref=
"dataForm"
:rules=
"rules
"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
"
width: 400px; margin-left:50px;
"
>
<el-form-item
label=
"专题标题"
prop=
"title"
>
<el-form-item
label=
"专题标题"
prop=
"title"
>
<el-input
v-model=
"dataForm.title"
></el-input
>
<el-input
v-model=
"dataForm.title"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"专题子标题"
prop=
"subtitle"
>
<el-form-item
label=
"专题子标题"
prop=
"subtitle"
>
<el-input
v-model=
"dataForm.subtitle"
></el-input
>
<el-input
v-model=
"dataForm.subtitle"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"专题图片"
prop=
"picUrl"
>
<el-form-item
label=
"专题图片"
prop=
"picUrl"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
"uploadPath"
list-type=
"picture-card"
:show-file-list=
"false
"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadPicUrl"
>
<el-upload
:headers=
"headers"
:action=
"uploadPath"
:show-file-list=
"false"
:on-success=
"uploadPicUrl"
class=
"avatar-uploader"
list-type=
"picture-card
"
accept=
".jpg,.jpeg,.png,.gif"
>
<img
v-if=
"dataForm.picUrl"
:src=
"dataForm.picUrl"
class=
"avatar"
>
<img
v-if=
"dataForm.picUrl"
:src=
"dataForm.picUrl"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
/
>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
<el-form-item
style=
"width: 700px;"
label=
"专题内容"
>
<el-form-item
style=
"width: 700px;"
label=
"专题内容"
>
<editor
:init=
"editorInit"
v-model=
"dataForm.content"
></editor
>
<editor
:init=
"editorInit"
v-model=
"dataForm.content"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"商品低价"
prop=
"price"
>
<el-form-item
label=
"商品低价"
prop=
"price"
>
<el-input
v-model=
"dataForm.price"
></el-input
>
<el-input
v-model=
"dataForm.price"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"阅读量"
prop=
"readCount"
>
<el-form-item
label=
"阅读量"
prop=
"readCount"
>
<el-input
v-model=
"dataForm.readCount"
></el-input
>
<el-input
v-model=
"dataForm.readCount"
/
>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
@@ -96,32 +85,32 @@
...
@@ -96,32 +85,32 @@
</template>
</template>
<
style
>
<
style
>
.el-dialog
{
.el-dialog
{
width
:
800px
;
width
:
800px
;
}
}
.avatar-uploader
.el-upload
{
.avatar-uploader
.el-upload
{
border
:
1px
dashed
#d9d9d9
;
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
border-radius
:
6px
;
cursor
:
pointer
;
cursor
:
pointer
;
position
:
relative
;
position
:
relative
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.avatar-uploader
.el-upload
:hover
{
.avatar-uploader
.el-upload
:hover
{
border-color
:
#20a0ff
;
border-color
:
#20a0ff
;
}
}
.avatar-uploader-icon
{
.avatar-uploader-icon
{
font-size
:
28px
;
font-size
:
28px
;
color
:
#8c939d
;
color
:
#8c939d
;
width
:
120px
;
width
:
120px
;
height
:
120px
;
height
:
120px
;
line-height
:
120px
;
line-height
:
120px
;
text-align
:
center
;
text-align
:
center
;
}
}
.avatar
{
.avatar
{
width
:
120px
;
width
:
120px
;
height
:
120px
;
height
:
120px
;
display
:
block
;
display
:
block
;
}
}
</
style
>
</
style
>
<
script
>
<
script
>
...
@@ -129,18 +118,12 @@ import { listTopic, createTopic, updateTopic, deleteTopic } from '@/api/topic'
...
@@ -129,18 +118,12 @@ import { listTopic, createTopic, updateTopic, deleteTopic } from '@/api/topic'
import
{
createStorage
,
uploadPath
}
from
'
@/api/storage
'
import
{
createStorage
,
uploadPath
}
from
'
@/api/storage
'
import
BackToTop
from
'
@/components/BackToTop
'
import
BackToTop
from
'
@/components/BackToTop
'
import
Editor
from
'
@tinymce/tinymce-vue
'
import
Editor
from
'
@tinymce/tinymce-vue
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
import
{
getToken
}
from
'
@/utils/auth
'
import
{
getToken
}
from
'
@/utils/auth
'
export
default
{
export
default
{
name
:
'
Topic
'
,
name
:
'
Topic
'
,
components
:
{
BackToTop
,
Editor
},
components
:
{
BackToTop
,
Editor
,
Pagination
},
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
data
()
{
return
{
return
{
uploadPath
,
uploadPath
,
...
@@ -174,56 +157,70 @@ export default {
...
@@ -174,56 +157,70 @@ export default {
create
:
'
创建
'
create
:
'
创建
'
},
},
rules
:
{
rules
:
{
title
:
[{
required
:
true
,
message
:
'
专题标题不能为空
'
,
trigger
:
'
blur
'
}],
title
:
[
subtitle
:
[{
required
:
true
,
message
:
'
专题子标题不能为空
'
,
trigger
:
'
blur
'
}],
{
required
:
true
,
message
:
'
专题标题不能为空
'
,
trigger
:
'
blur
'
}
content
:
[{
required
:
true
,
message
:
'
专题内容不能为空
'
,
trigger
:
'
blur
'
}]
],
subtitle
:
[
{
required
:
true
,
message
:
'
专题子标题不能为空
'
,
trigger
:
'
blur
'
}
],
content
:
[
{
required
:
true
,
message
:
'
专题内容不能为空
'
,
trigger
:
'
blur
'
}
]
},
},
downloadLoading
:
false
,
downloadLoading
:
false
,
editorInit
:
{
editorInit
:
{
language
:
'
zh_CN
'
,
language
:
'
zh_CN
'
,
convert_urls
:
false
,
convert_urls
:
false
,
plugins
:
[
'
advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools importcss insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount
'
],
plugins
:
[
toolbar
:
[
'
searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample
'
,
'
hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen
'
],
'
advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools importcss insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount
'
],
toolbar
:
[
'
searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample
'
,
'
hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen
'
],
images_upload_handler
:
function
(
blobInfo
,
success
,
failure
)
{
images_upload_handler
:
function
(
blobInfo
,
success
,
failure
)
{
const
formData
=
new
FormData
()
const
formData
=
new
FormData
()
formData
.
append
(
'
file
'
,
blobInfo
.
blob
())
formData
.
append
(
'
file
'
,
blobInfo
.
blob
())
createStorage
(
formData
).
then
(
res
=>
{
createStorage
(
formData
)
success
(
res
.
data
.
data
.
url
)
.
then
(
res
=>
{
}).
catch
(()
=>
{
success
(
res
.
data
.
data
.
url
)
failure
(
'
上传失败,请重新上传
'
)
})
})
.
catch
(()
=>
{
failure
(
'
上传失败,请重新上传
'
)
})
}
}
}
}
}
}
},
},
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
created
()
{
created
()
{
this
.
getList
()
this
.
getList
()
},
},
methods
:
{
methods
:
{
getList
()
{
getList
()
{
this
.
listLoading
=
true
this
.
listLoading
=
true
listTopic
(
this
.
listQuery
).
then
(
response
=>
{
listTopic
(
this
.
listQuery
)
this
.
list
=
response
.
data
.
data
.
items
.
then
(
response
=>
{
this
.
total
=
response
.
data
.
data
.
total
this
.
list
=
response
.
data
.
data
.
items
this
.
listLoading
=
false
this
.
total
=
response
.
data
.
data
.
total
}).
catch
(()
=>
{
this
.
listLoading
=
false
this
.
list
=
[]
})
this
.
total
=
0
.
catch
(()
=>
{
this
.
listLoading
=
false
this
.
list
=
[]
})
this
.
total
=
0
this
.
listLoading
=
false
})
},
},
handleFilter
()
{
handleFilter
()
{
this
.
listQuery
.
page
=
1
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
resetForm
()
{
resetForm
()
{
this
.
dataForm
=
{
this
.
dataForm
=
{
id
:
undefined
,
id
:
undefined
,
...
@@ -248,21 +245,23 @@ export default {
...
@@ -248,21 +245,23 @@ export default {
this
.
dataForm
.
picUrl
=
response
.
data
.
url
this
.
dataForm
.
picUrl
=
response
.
data
.
url
},
},
createData
()
{
createData
()
{
this
.
$refs
[
'
dataForm
'
].
validate
(
(
valid
)
=>
{
this
.
$refs
[
'
dataForm
'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
createTopic
(
this
.
dataForm
).
then
(
response
=>
{
createTopic
(
this
.
dataForm
)
this
.
list
.
unshift
(
response
.
data
.
data
)
.
then
(
response
=>
{
this
.
dialogFormVisible
=
false
this
.
list
.
unshift
(
response
.
data
.
data
)
this
.
$notify
.
success
({
this
.
dialogFormVisible
=
false
title
:
'
成功
'
,
this
.
$notify
.
success
({
message
:
'
创建专题成功
'
title
:
'
成功
'
,
message
:
'
创建专题成功
'
})
})
})
}).
catch
(
response
=>
{
.
catch
(
response
=>
{
this
.
$notify
.
error
({
this
.
$notify
.
error
({
title
:
'
失败
'
,
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
message
:
response
.
data
.
errmsg
})
})
})
})
}
}
})
})
},
},
...
@@ -279,50 +278,72 @@ export default {
...
@@ -279,50 +278,72 @@ export default {
})
})
},
},
updateData
()
{
updateData
()
{
this
.
$refs
[
'
dataForm
'
].
validate
(
(
valid
)
=>
{
this
.
$refs
[
'
dataForm
'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
updateTopic
(
this
.
dataForm
).
then
(()
=>
{
updateTopic
(
this
.
dataForm
)
for
(
const
v
of
this
.
list
)
{
.
then
(()
=>
{
if
(
v
.
id
===
this
.
dataForm
.
id
)
{
for
(
const
v
of
this
.
list
)
{
const
index
=
this
.
list
.
indexOf
(
v
)
if
(
v
.
id
===
this
.
dataForm
.
id
)
{
this
.
list
.
splice
(
index
,
1
,
this
.
dataForm
)
const
index
=
this
.
list
.
indexOf
(
v
)
break
this
.
list
.
splice
(
index
,
1
,
this
.
dataForm
)
break
}
}
}
}
this
.
dialogFormVisible
=
false
this
.
dialogFormVisible
=
false
this
.
$notify
.
success
({
this
.
$notify
.
success
({
title
:
'
成功
'
,
title
:
'
成功
'
,
message
:
'
更新专题
成功
'
message
:
'
更新专题成功
'
})
})
})
}).
catch
(
response
=>
{
.
catch
(
response
=>
{
this
.
$notify
.
error
({
this
.
$notify
.
error
({
title
:
'
失败
'
,
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
message
:
response
.
data
.
errmsg
})
})
})
})
}
}
})
})
},
},
handleDelete
(
row
)
{
handleDelete
(
row
)
{
deleteTopic
(
row
).
then
(
response
=>
{
deleteTopic
(
row
)
this
.
$notify
.
success
({
.
then
(
response
=>
{
title
:
'
成功
'
,
this
.
$notify
.
success
({
message
:
'
删除专题成功
'
title
:
'
成功
'
,
message
:
'
删除专题成功
'
})
const
index
=
this
.
list
.
indexOf
(
row
)
this
.
list
.
splice
(
index
,
1
)
})
})
const
index
=
this
.
list
.
indexOf
(
row
)
.
catch
(
response
=>
{
this
.
list
.
splice
(
index
,
1
)
this
.
$notify
.
error
({
}).
catch
(
response
=>
{
title
:
'
失败
'
,
this
.
$notify
.
error
({
message
:
response
.
data
.
errmsg
title
:
'
失败
'
,
})
message
:
response
.
data
.
errmsg
})
})
})
},
},
handleDownload
()
{
handleDownload
()
{
this
.
downloadLoading
=
true
this
.
downloadLoading
=
true
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
const
tHeader
=
[
'
专题ID
'
,
'
专题标题
'
,
'
专题子标题
'
,
'
专题内容
'
,
'
专题图片
'
,
'
商品低价
'
,
'
阅读量
'
,
'
专题商品
'
]
const
tHeader
=
[
const
filterVal
=
[
'
id
'
,
'
title
'
,
'
subtitle
'
,
'
content
'
,
'
picUrl
'
,
'
price
'
,
'
readCount
'
,
'
goods
'
]
'
专题ID
'
,
'
专题标题
'
,
'
专题子标题
'
,
'
专题内容
'
,
'
专题图片
'
,
'
商品低价
'
,
'
阅读量
'
,
'
专题商品
'
]
const
filterVal
=
[
'
id
'
,
'
title
'
,
'
subtitle
'
,
'
content
'
,
'
picUrl
'
,
'
price
'
,
'
readCount
'
,
'
goods
'
]
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
专题信息
'
)
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
专题信息
'
)
this
.
downloadLoading
=
false
this
.
downloadLoading
=
false
})
})
...
...
litemall-admin/src/views/redirect/index.vue
0 → 100644
View file @
6f0ebe3e
<
script
>
export
default
{
beforeCreate
()
{
const
{
params
,
query
}
=
this
.
$route
const
{
path
}
=
params
this
.
$router
.
replace
({
path
:
'
/
'
+
path
,
query
})
},
render
:
function
(
h
)
{
return
h
()
// avoid warning message
}
}
</
script
>
litemall-admin/src/views/stat/goods.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<ve-line
:extend=
"chartExtend"
:data=
"chartData"
:settings=
"chartSettings"
></ve-line
>
<ve-line
:extend=
"chartExtend"
:data=
"chartData"
:settings=
"chartSettings"
/
>
</div>
</div>
</
template
>
</
template
>
...
@@ -34,4 +34,4 @@ export default {
...
@@ -34,4 +34,4 @@ export default {
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
litemall-admin/src/views/stat/order.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<ve-line
:extend=
"chartExtend"
:data=
"chartData"
:settings=
"chartSettings"
></ve-line
>
<ve-line
:extend=
"chartExtend"
:data=
"chartData"
:settings=
"chartSettings"
/
>
</div>
</div>
</
template
>
</
template
>
...
@@ -34,4 +34,4 @@ export default {
...
@@ -34,4 +34,4 @@ export default {
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
litemall-admin/src/views/stat/user.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<ve-histogram
:extend=
"chartExtend"
:data=
"chartData"
:settings=
"chartSettings"
></ve-histogram
>
<ve-histogram
:extend=
"chartExtend"
:data=
"chartData"
:settings=
"chartSettings"
/
>
</div>
</div>
</
template
>
</
template
>
...
@@ -35,4 +35,4 @@ export default {
...
@@ -35,4 +35,4 @@ export default {
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
litemall-admin/src/views/sys/admin.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入管理员名称"
v-model=
"listQuery.username"
>
<el-input
v-model=
"listQuery.username"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入管理员名称"
/>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
@
click=
"handleCreate
"
icon=
"el-icon-edit
"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
:loading=
"downloadLoading"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
<el-button
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table
v-loading=
"listLoading"
:data=
"list"
size=
"small"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
label=
"管理员ID"
prop=
"id"
sortable
>
<el-table-column
align=
"center"
label=
"管理员ID"
prop=
"id"
sortable
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"管理员名称"
prop=
"username"
>
<el-table-column
align=
"center"
label=
"管理员名称"
prop=
"username"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"管理员头像"
prop=
"avatar"
>
<el-table-column
align=
"center"
label=
"管理员头像"
prop=
"avatar"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<img
:src=
"scope.row.avatar"
width=
"40"
v-if=
"scope.row.avatar"
/
>
<img
v-if=
"scope.row.avatar"
:src=
"scope.row.avatar"
width=
"40"
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
class-name=
"small-padding fixed-width"
>
<el-table-column
align=
"center"
label=
"操作"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
<!-- 添加或修改对话框 -->
<!-- 添加或修改对话框 -->
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-form
:rules=
"rules"
ref=
"dataForm
"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'
width: 400px; margin-left:50px;
'
>
<el-form
ref=
"dataForm"
:rules=
"rules
"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
"
width: 400px; margin-left:50px;
"
>
<el-form-item
label=
"管理员名称"
prop=
"username"
>
<el-form-item
label=
"管理员名称"
prop=
"username"
>
<el-input
v-model=
"dataForm.username"
></el-input
>
<el-input
v-model=
"dataForm.username"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"管理员密码"
prop=
"password"
>
<el-form-item
label=
"管理员密码"
prop=
"password"
>
<el-input
type=
"password"
v-model=
"dataForm.password"
auto-complete=
"off"
></el-input
>
<el-input
v-model=
"dataForm.password"
type=
"password"
auto-complete=
"off"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"管理员头像"
prop=
"avatar"
>
<el-form-item
label=
"管理员头像"
prop=
"avatar"
>
<el-upload
class=
"avatar-uploader"
:headers=
"headers"
:action=
"uploadPath"
list-type=
"picture-c
ar
d
"
:show-file-list=
"false
"
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"uploadAvatar"
>
<el-upload
:headers=
"headers"
:action=
"uploadPath"
:show-file-list=
"false"
:on-success=
"uploadAvat
ar"
class=
"avatar-uploader"
list-type=
"picture-card
"
accept=
".jpg,.jpeg,.png,.gif"
>
<img
v-if=
"dataForm.avatar"
:src=
"dataForm.avatar"
class=
"avatar"
>
<img
v-if=
"dataForm.avatar"
:src=
"dataForm.avatar"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
/
>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -66,45 +58,40 @@
...
@@ -66,45 +58,40 @@
</template>
</template>
<
style
>
<
style
>
.avatar-uploader
.el-upload
{
.avatar-uploader
.el-upload
{
border
:
1px
dashed
#d9d9d9
;
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
border-radius
:
6px
;
cursor
:
pointer
;
cursor
:
pointer
;
position
:
relative
;
position
:
relative
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.avatar-uploader
.el-upload
:hover
{
.avatar-uploader
.el-upload
:hover
{
border-color
:
#20a0ff
;
border-color
:
#20a0ff
;
}
}
.avatar-uploader-icon
{
.avatar-uploader-icon
{
font-size
:
28px
;
font-size
:
28px
;
color
:
#8c939d
;
color
:
#8c939d
;
width
:
120px
;
width
:
120px
;
height
:
120px
;
height
:
120px
;
line-height
:
120px
;
line-height
:
120px
;
text-align
:
center
;
text-align
:
center
;
}
}
.avatar
{
.avatar
{
width
:
120px
;
width
:
120px
;
height
:
120px
;
height
:
120px
;
display
:
block
;
display
:
block
;
}
}
</
style
>
</
style
>
<
script
>
<
script
>
import
{
listAdmin
,
createAdmin
,
updateAdmin
,
deleteAdmin
}
from
'
@/api/admin
'
import
{
listAdmin
,
createAdmin
,
updateAdmin
,
deleteAdmin
}
from
'
@/api/admin
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
uploadPath
}
from
'
@/api/storage
'
import
{
getToken
}
from
'
@/utils/auth
'
import
{
getToken
}
from
'
@/utils/auth
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
export
default
{
export
default
{
name
:
'
Admin
'
,
name
:
'
Admin
'
,
computed
:
{
components
:
{
Pagination
},
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
data
()
{
data
()
{
return
{
return
{
uploadPath
,
uploadPath
,
...
@@ -131,40 +118,43 @@ export default {
...
@@ -131,40 +118,43 @@ export default {
create
:
'
创建
'
create
:
'
创建
'
},
},
rules
:
{
rules
:
{
username
:
[{
required
:
true
,
message
:
'
管理员名称不能为空
'
,
trigger
:
'
blur
'
}],
username
:
[
{
required
:
true
,
message
:
'
管理员名称不能为空
'
,
trigger
:
'
blur
'
}
],
password
:
[{
required
:
true
,
message
:
'
密码不能为空
'
,
trigger
:
'
blur
'
}]
password
:
[{
required
:
true
,
message
:
'
密码不能为空
'
,
trigger
:
'
blur
'
}]
},
},
downloadLoading
:
false
downloadLoading
:
false
}
}
},
},
computed
:
{
headers
()
{
return
{
'
Admin-Token
'
:
getToken
()
}
}
},
created
()
{
created
()
{
this
.
getList
()
this
.
getList
()
},
},
methods
:
{
methods
:
{
getList
()
{
getList
()
{
this
.
listLoading
=
true
this
.
listLoading
=
true
listAdmin
(
this
.
listQuery
).
then
(
response
=>
{
listAdmin
(
this
.
listQuery
)
this
.
list
=
response
.
data
.
data
.
items
.
then
(
response
=>
{
this
.
total
=
response
.
data
.
data
.
total
this
.
list
=
response
.
data
.
data
.
items
this
.
listLoading
=
false
this
.
total
=
response
.
data
.
data
.
total
}).
catch
(()
=>
{
this
.
listLoading
=
false
this
.
list
=
[]
})
this
.
total
=
0
.
catch
(()
=>
{
this
.
listLoading
=
false
this
.
list
=
[]
})
this
.
total
=
0
this
.
listLoading
=
false
})
},
},
handleFilter
()
{
handleFilter
()
{
this
.
listQuery
.
page
=
1
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
resetForm
()
{
resetForm
()
{
this
.
dataForm
=
{
this
.
dataForm
=
{
id
:
undefined
,
id
:
undefined
,
...
@@ -185,21 +175,23 @@ export default {
...
@@ -185,21 +175,23 @@ export default {
})
})
},
},
createData
()
{
createData
()
{
this
.
$refs
[
'
dataForm
'
].
validate
(
(
valid
)
=>
{
this
.
$refs
[
'
dataForm
'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
createAdmin
(
this
.
dataForm
).
then
(
response
=>
{
createAdmin
(
this
.
dataForm
)
this
.
list
.
unshift
(
response
.
data
.
data
)
.
then
(
response
=>
{
this
.
dialogFormVisible
=
false
this
.
list
.
unshift
(
response
.
data
.
data
)
this
.
$notify
.
success
({
this
.
dialogFormVisible
=
false
title
:
'
成功
'
,
this
.
$notify
.
success
({
message
:
'
添加管理员成功
'
title
:
'
成功
'
,
message
:
'
添加管理员成功
'
})
})
})
}).
catch
(
response
=>
{
.
catch
(
response
=>
{
this
.
$notify
.
error
({
this
.
$notify
.
error
({
title
:
'
失败
'
,
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
message
:
response
.
data
.
errmsg
})
})
})
})
}
}
})
})
},
},
...
@@ -212,51 +204,60 @@ export default {
...
@@ -212,51 +204,60 @@ export default {
})
})
},
},
updateData
()
{
updateData
()
{
this
.
$refs
[
'
dataForm
'
].
validate
(
(
valid
)
=>
{
this
.
$refs
[
'
dataForm
'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
updateAdmin
(
this
.
dataForm
).
then
(()
=>
{
updateAdmin
(
this
.
dataForm
)
for
(
const
v
of
this
.
list
)
{
.
then
(()
=>
{
if
(
v
.
id
===
this
.
dataForm
.
id
)
{
for
(
const
v
of
this
.
list
)
{
const
index
=
this
.
list
.
indexOf
(
v
)
if
(
v
.
id
===
this
.
dataForm
.
id
)
{
this
.
list
.
splice
(
index
,
1
,
this
.
dataForm
)
const
index
=
this
.
list
.
indexOf
(
v
)
break
this
.
list
.
splice
(
index
,
1
,
this
.
dataForm
)
break
}
}
}
}
this
.
dialogFormVisible
=
false
this
.
dialogFormVisible
=
false
this
.
$notify
.
success
({
this
.
$notify
.
success
({
title
:
'
成功
'
,
title
:
'
成功
'
,
message
:
'
更新管理员
成功
'
message
:
'
更新管理员成功
'
})
})
})
}).
catch
(
response
=>
{
.
catch
(
response
=>
{
this
.
$notify
.
error
({
this
.
$notify
.
error
({
title
:
'
失败
'
,
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
message
:
response
.
data
.
errmsg
})
})
})
})
}
}
})
})
},
},
handleDelete
(
row
)
{
handleDelete
(
row
)
{
deleteAdmin
(
row
).
then
(
response
=>
{
deleteAdmin
(
row
)
this
.
$notify
.
success
({
.
then
(
response
=>
{
title
:
'
成功
'
,
this
.
$notify
.
success
({
message
:
'
删除管理员成功
'
title
:
'
成功
'
,
message
:
'
删除管理员成功
'
})
const
index
=
this
.
list
.
indexOf
(
row
)
this
.
list
.
splice
(
index
,
1
)
})
})
const
index
=
this
.
list
.
indexOf
(
row
)
.
catch
(
response
=>
{
this
.
list
.
splice
(
index
,
1
)
this
.
$notify
.
error
({
}).
catch
(
response
=>
{
title
:
'
失败
'
,
this
.
$notify
.
error
({
message
:
response
.
data
.
errmsg
title
:
'
失败
'
,
})
message
:
response
.
data
.
errmsg
})
})
})
},
},
handleDownload
()
{
handleDownload
()
{
this
.
downloadLoading
=
true
this
.
downloadLoading
=
true
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
const
tHeader
=
[
'
管理员ID
'
,
'
管理员名称
'
,
'
管理员头像
'
]
const
tHeader
=
[
'
管理员ID
'
,
'
管理员名称
'
,
'
管理员头像
'
]
const
filterVal
=
[
'
id
'
,
'
username
'
,
'
avatar
'
]
const
filterVal
=
[
'
id
'
,
'
username
'
,
'
avatar
'
]
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
管理员信息
'
)
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
管理员信息
'
)
this
.
downloadLoading
=
false
this
.
downloadLoading
=
false
})
})
}
}
...
...
litemall-admin/src/views/sys/os.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入对象KEY"
v-model=
"listQuery.key"
>
<el-input
v-model=
"listQuery.key"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入对象KEY"
/>
</el-input>
<el-input
v-model=
"listQuery.name"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入对象名称"
/>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入对象名称"
v-model=
"listQuery.name"
>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
@
click=
"handleCreate"
icon=
"el-icon-edit"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
:loading=
"downloadLoading"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading
"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table
v-loading=
"listLoading"
:data=
"list"
size=
"small
"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
label=
"对象KEY"
prop=
"key"
>
<el-table-column
align=
"center"
label=
"对象KEY"
prop=
"key"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"对象名称"
prop=
"name"
>
<el-table-column
align=
"center"
label=
"对象名称"
prop=
"name"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"对象类型"
prop=
"type"
/>
<el-table-column
align=
"center"
label=
"对象类型"
prop=
"type"
>
</el-table-column>
<el-table-column
align=
"center"
label=
"对象大小"
prop=
"size"
>
<el-table-column
align=
"center"
label=
"对象大小"
prop=
"size"
/>
</el-table-column>
<el-table-column
align=
"center"
property=
"url"
label=
"图片"
>
<el-table-column
align=
"center"
property=
"url"
label=
"图片"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<img
:src=
"scope.row.url"
width=
"40"
/
>
<img
:src=
"scope.row.url"
width=
"40"
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"图片链接"
prop=
"url"
>
<el-table-column
align=
"center"
label=
"图片链接"
prop=
"url"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
class-name=
"small-padding fixed-width"
>
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
<!-- 添加对话框 -->
<!-- 添加对话框 -->
<el-dialog
title=
"上传对象"
:visible.sync=
"createDialogVisible"
>
<el-dialog
:visible.sync=
"createDialogVisible"
title=
"上传对象"
>
<el-upload
action=
"#"
list-type=
"picture"
:show-file-list=
"false"
:limit=
"1"
:http-request=
"handleUpload"
>
<el-upload
:show-file-list=
"false"
:limit=
"1"
:http-request=
"handleUpload"
action=
"#"
list-type=
"picture"
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
</el-upload>
</el-upload>
</el-dialog>
</el-dialog>
<!-- 修改对话框 -->
<!-- 修改对话框 -->
<el-dialog
title=
"修改对象名称"
:visible.sync=
"updateDialogVisible"
>
<el-dialog
:visible.sync=
"updateDialogVisible"
title=
"修改对象名称"
>
<el-form
:rules=
"rules"
ref=
"dataForm
"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'
width: 400px; margin-left:50px;
'
>
<el-form
ref=
"dataForm"
:rules=
"rules
"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
"
width: 400px; margin-left:50px;
"
>
<el-form-item
label=
"对象名称"
prop=
"name"
>
<el-form-item
label=
"对象名称"
prop=
"name"
>
<el-input
v-model=
"dataForm.name"
></el-input
>
<el-input
v-model=
"dataForm.name"
/
>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
@@ -76,9 +64,11 @@
...
@@ -76,9 +64,11 @@
<
script
>
<
script
>
import
{
listStorage
,
createStorage
,
updateStorage
,
deleteStorage
}
from
'
@/api/storage
'
import
{
listStorage
,
createStorage
,
updateStorage
,
deleteStorage
}
from
'
@/api/storage
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
export
default
{
export
default
{
name
:
'
Storage
'
,
name
:
'
Storage
'
,
components
:
{
Pagination
},
data
()
{
data
()
{
return
{
return
{
list
:
null
,
list
:
null
,
...
@@ -124,14 +114,6 @@ export default {
...
@@ -124,14 +114,6 @@ export default {
this
.
listQuery
.
page
=
1
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
resetForm
()
{
resetForm
()
{
this
.
dataForm
=
{
this
.
dataForm
=
{
id
:
undefined
,
id
:
undefined
,
...
...
litemall-admin/src/views/user/address.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户ID"
v-model=
"listQuery.userId"
>
<el-input
v-model=
"listQuery.userId"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户ID"
/>
</el-input>
<el-input
v-model=
"listQuery.name"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入收货人名称"
/>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入收货人名称"
v-model=
"listQuery.name"
>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
:loading=
"downloadLoading"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
<el-button
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table
v-loading=
"listLoading"
:data=
"list"
size=
"small"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
width=
"100px"
label=
"地址ID"
prop=
"id"
sortable
>
<el-table-column
align=
"center"
width=
"100px"
label=
"地址ID"
prop=
"id"
sortable
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"用户ID"
prop=
"userId"
>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"用户ID"
prop=
"userId"
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"收货人名称"
prop=
"name"
>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"收货人名称"
prop=
"name"
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"手机号码"
prop=
"mobile"
/>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"手机号码"
prop=
"mobile"
>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"300px"
label=
"地址"
prop=
"address"
>
<el-table-column
align=
"center"
min-width=
"300px"
label=
"地址"
prop=
"address"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
province
+
scope
.
row
.
city
+
scope
.
row
.
area
+
scope
.
row
.
address
}}
{{
scope
.
row
.
province
+
scope
.
row
.
city
+
scope
.
row
.
area
+
scope
.
row
.
address
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"80px"
label=
"默认"
prop=
"isDefault"
>
<el-table-column
align=
"center"
min-width=
"80px"
label=
"默认"
prop=
"isDefault"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
isDefault
?
'
是
'
:
'
否
'
}}
{{
scope
.
row
.
isDefault
?
'
是
'
:
'
否
'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
listAddress
}
from
'
@/api/user
'
import
{
listAddress
}
from
'
@/api/user
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
export
default
{
export
default
{
name
:
'
UserAddress
'
,
name
:
'
UserAddress
'
,
components
:
{
Pagination
},
data
()
{
data
()
{
return
{
return
{
list
:
null
,
list
:
null
,
...
@@ -90,14 +81,6 @@ export default {
...
@@ -90,14 +81,6 @@ export default {
this
.
listQuery
.
page
=
1
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
handleDownload
()
{
handleDownload
()
{
this
.
downloadLoading
=
true
this
.
downloadLoading
=
true
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
...
@@ -109,4 +92,4 @@ export default {
...
@@ -109,4 +92,4 @@ export default {
}
}
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
litemall-admin/src/views/user/collect.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户ID"
v-model=
"listQuery.userId"
>
<el-input
v-model=
"listQuery.userId"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户ID"
/>
</el-input>
<el-input
v-model=
"listQuery.valueId"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入商品ID"
/>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入商品ID"
v-model=
"listQuery.valueId"
>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
:loading=
"downloadLoading"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
<el-button
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table
v-loading=
"listLoading"
:data=
"list"
size=
"small"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
width=
"100px"
label=
"收藏ID"
prop=
"id"
sortable
>
<el-table-column
align=
"center"
width=
"100px"
label=
"收藏ID"
prop=
"id"
sortable
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"用户ID"
prop=
"userId"
>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"用户ID"
prop=
"userId"
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"商品ID"
prop=
"valueId"
>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"商品ID"
prop=
"valueId"
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"添加时间"
prop=
"addTime"
/>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"添加时间"
prop=
"addTime"
>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
listCollect
}
from
'
@/api/user
'
import
{
listCollect
}
from
'
@/api/user
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
export
default
{
export
default
{
name
:
'
Collect
'
,
name
:
'
Collect
'
,
components
:
{
Pagination
},
data
()
{
data
()
{
return
{
return
{
list
:
null
,
list
:
null
,
...
@@ -78,14 +69,6 @@ export default {
...
@@ -78,14 +69,6 @@ export default {
this
.
listQuery
.
page
=
1
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
resetForm
()
{
resetForm
()
{
this
.
dataForm
=
{
this
.
dataForm
=
{
id
:
undefined
,
id
:
undefined
,
...
...
litemall-admin/src/views/user/feedback.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户名"
v-model=
"listQuery.username"
>
<el-input
v-model=
"listQuery.username"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户名"
/>
</el-input>
<el-input
v-model=
"listQuery.id"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入反馈ID"
/>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入反馈ID"
v-model=
"listQuery.id"
>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
:loading=
"downloadLoading"
>
导出
</el-button>
<el-button
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading
"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table
v-loading=
"listLoading"
:data=
"list"
size=
"small
"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
label=
"反馈ID"
prop=
"id"
>
<el-table-column
align=
"center"
label=
"反馈ID"
prop=
"id"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"用户名"
prop=
"username"
>
<el-table-column
align=
"center"
label=
"用户名"
prop=
"username"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"手机号码"
prop=
"mobile"
>
<el-table-column
align=
"center"
label=
"手机号码"
prop=
"mobile"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"反馈类型"
prop=
"feedType"
>
<el-table-column
align=
"center"
label=
"反馈类型"
prop=
"feedType"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"反馈内容"
prop=
"content"
>
<el-table-column
align=
"center"
label=
"反馈内容"
prop=
"content"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"反馈图片"
prop=
"picUrls"
>
<el-table-column
align=
"center"
label=
"反馈图片"
prop=
"picUrls"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<img
v-for=
"item in scope.row.picUrls"
:key=
"item"
:src=
"item"
width=
"40"
/
>
<img
v-for=
"item in scope.row.picUrls"
:key=
"item"
:src=
"item"
width=
"40"
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"时间"
prop=
"addTime"
>
<el-table-column
align=
"center"
label=
"时间"
prop=
"addTime"
/>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
listFeedback
}
from
'
@/api/user
'
import
{
listFeedback
}
from
'
@/api/user
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
export
default
{
export
default
{
name
:
'
Feedback
'
,
name
:
'
Feedback
'
,
components
:
{
Pagination
},
data
()
{
data
()
{
return
{
return
{
list
:
undefined
,
list
:
undefined
,
...
@@ -90,14 +79,6 @@ export default {
...
@@ -90,14 +79,6 @@ export default {
this
.
listQuery
.
page
=
1
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
handleDownload
()
{
handleDownload
()
{
this
.
downloadLoading
=
true
this
.
downloadLoading
=
true
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
...
...
litemall-admin/src/views/user/footprint.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户ID"
v-model=
"listQuery.userId"
>
<el-input
v-model=
"listQuery.userId"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户ID"
/>
</el-input>
<el-input
v-model=
"listQuery.goodsId"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入商品ID"
/>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入商品ID"
v-model=
"listQuery.goodsId"
>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
:loading=
"downloadLoading"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
<el-button
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table
v-loading=
"listLoading"
:data=
"list"
size=
"small"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
width=
"100px"
label=
"足迹ID"
prop=
"id"
sortable
>
<el-table-column
align=
"center"
width=
"100px"
label=
"足迹ID"
prop=
"id"
sortable
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"用户ID"
prop=
"userId"
>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"用户ID"
prop=
"userId"
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"商品ID"
prop=
"goodsId"
>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"商品ID"
prop=
"goodsId"
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"添加时间"
prop=
"addTime"
/>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"添加时间"
prop=
"addTime"
>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
listFootprint
}
from
'
@/api/user
'
import
{
listFootprint
}
from
'
@/api/user
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
export
default
{
export
default
{
name
:
'
FootPrint
'
,
name
:
'
FootPrint
'
,
components
:
{
Pagination
},
data
()
{
data
()
{
return
{
return
{
list
:
null
,
list
:
null
,
...
@@ -64,34 +55,33 @@ export default {
...
@@ -64,34 +55,33 @@ export default {
methods
:
{
methods
:
{
getList
()
{
getList
()
{
this
.
listLoading
=
true
this
.
listLoading
=
true
listFootprint
(
this
.
listQuery
).
then
(
response
=>
{
listFootprint
(
this
.
listQuery
)
this
.
list
=
response
.
data
.
data
.
items
.
then
(
response
=>
{
this
.
total
=
response
.
data
.
data
.
total
this
.
list
=
response
.
data
.
data
.
items
this
.
listLoading
=
false
this
.
total
=
response
.
data
.
data
.
total
}).
catch
(()
=>
{
this
.
listLoading
=
false
this
.
list
=
[]
})
this
.
total
=
0
.
catch
(()
=>
{
this
.
listLoading
=
false
this
.
list
=
[]
})
this
.
total
=
0
this
.
listLoading
=
false
})
},
},
handleFilter
()
{
handleFilter
()
{
this
.
listQuery
.
page
=
1
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
handleDownload
()
{
handleDownload
()
{
this
.
downloadLoading
=
true
this
.
downloadLoading
=
true
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
const
tHeader
=
[
'
用户ID
'
,
'
商品ID
'
,
'
添加时间
'
]
const
tHeader
=
[
'
用户ID
'
,
'
商品ID
'
,
'
添加时间
'
]
const
filterVal
=
[
'
userId
'
,
'
goodsId
'
,
'
addTime
'
]
const
filterVal
=
[
'
userId
'
,
'
goodsId
'
,
'
addTime
'
]
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
用户收藏信息
'
)
excel
.
export_json_to_excel2
(
tHeader
,
this
.
list
,
filterVal
,
'
用户收藏信息
'
)
this
.
downloadLoading
=
false
this
.
downloadLoading
=
false
})
})
}
}
...
...
litemall-admin/src/views/user/history.vue
View file @
6f0ebe3e
...
@@ -3,43 +3,35 @@
...
@@ -3,43 +3,35 @@
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户ID"
v-model=
"listQuery.userId"
>
<el-input
v-model=
"listQuery.userId"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户ID"
/>
</el-input>
<el-input
v-model=
"listQuery.keyword"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入搜索历史关键字"
/>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入搜索历史关键字"
v-model=
"listQuery.keyword"
>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
:loading=
"downloadLoading"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
<el-button
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table
v-loading=
"listLoading"
:data=
"list"
size=
"small"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
width=
"100px"
label=
"搜索ID"
prop=
"id"
sortable
>
<el-table-column
align=
"center"
width=
"100px"
label=
"搜索ID"
prop=
"id"
sortable
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"用户ID"
prop=
"userId"
>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"用户ID"
prop=
"userId"
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"关键字"
prop=
"keyword"
>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"关键字"
prop=
"keyword"
/>
</el-table-column>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"添加时间"
prop=
"addTime"
>
<el-table-column
align=
"center"
min-width=
"100px"
label=
"添加时间"
prop=
"addTime"
/>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
listHistory
}
from
'
@/api/user
'
import
{
listHistory
}
from
'
@/api/user
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
export
default
{
export
default
{
name
:
'
History
'
,
name
:
'
History
'
,
components
:
{
Pagination
},
data
()
{
data
()
{
return
{
return
{
list
:
null
,
list
:
null
,
...
@@ -62,28 +54,22 @@ export default {
...
@@ -62,28 +54,22 @@ export default {
methods
:
{
methods
:
{
getList
()
{
getList
()
{
this
.
listLoading
=
true
this
.
listLoading
=
true
listHistory
(
this
.
listQuery
).
then
(
response
=>
{
listHistory
(
this
.
listQuery
)
this
.
list
=
response
.
data
.
data
.
items
.
then
(
response
=>
{
this
.
total
=
response
.
data
.
data
.
total
this
.
list
=
response
.
data
.
data
.
items
this
.
listLoading
=
false
this
.
total
=
response
.
data
.
data
.
total
}).
catch
(()
=>
{
this
.
listLoading
=
false
this
.
list
=
[]
})
this
.
total
=
0
.
catch
(()
=>
{
this
.
listLoading
=
false
this
.
list
=
[]
})
this
.
total
=
0
this
.
listLoading
=
false
})
},
},
handleFilter
()
{
handleFilter
()
{
this
.
listQuery
.
page
=
1
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
handleDownload
()
{
handleDownload
()
{
this
.
downloadLoading
=
true
this
.
downloadLoading
=
true
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
import
(
'
@/vendor/Export2Excel
'
).
then
(
excel
=>
{
...
...
litemall-admin/src/views/user/user.vue
View file @
6f0ebe3e
<
template
>
<
template
>
<div
class=
"app-container
calendar-list-container
"
>
<div
class=
"app-container"
>
<!-- 查询和其他操作 -->
<!-- 查询和其他操作 -->
<div
class=
"filter-container"
>
<div
class=
"filter-container"
>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户名"
v-model=
"listQuery.username"
>
<el-input
v-model=
"listQuery.username"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入用户名"
/>
</el-input>
<el-input
v-model=
"listQuery.mobile"
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入手机号"
/>
<el-input
clearable
class=
"filter-item"
style=
"width: 200px;"
placeholder=
"请输入手机号"
v-model=
"listQuery.mobile"
>
</el-input>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
查找
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
@
click=
"handleCreate
"
icon=
"el-icon-edit
"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
添加
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
:loading=
"downloadLoading"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
<el-button
:loading=
"downloadLoading"
class=
"filter-item"
type=
"primary"
icon=
"el-icon-download"
@
click=
"handleDownload"
>
导出
</el-button>
</div>
</div>
<!-- 查询结果 -->
<!-- 查询结果 -->
<el-table
size=
"small"
:data=
"list"
v-loading=
"listLoading"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table
v-loading=
"listLoading"
:data=
"list"
size=
"small"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
align=
"center"
width=
"100px"
label=
"用户ID"
prop=
"id"
sortable
>
<el-table-column
align=
"center"
width=
"100px"
label=
"用户ID"
prop=
"id"
sortable
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"用户名"
prop=
"username"
>
<el-table-column
align=
"center"
label=
"用户名"
prop=
"username"
/>
</el-table-column>
<el-table-column
align=
"center"
label=
"手机号码"
prop=
"mobile"
/>
<el-table-column
align=
"center"
label=
"手机号码"
prop=
"mobile"
>
</el-table-column>
<el-table-column
align=
"center"
label=
"性别"
prop=
"gender"
>
<el-table-column
align=
"center"
label=
"性别"
prop=
"gender"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-tag
>
{{
genderDic
[
scope
.
row
.
gender
]
}}
</el-tag>
<el-tag
>
{{
genderDic
[
scope
.
row
.
gender
]
}}
</el-tag>
</
template
>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"生日"
prop=
"birthday"
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"生日"
prop=
"birthday"
/>
<el-table-column
align=
"center"
label=
"用户等级"
prop=
"userLevel"
>
<el-table-column
align=
"center"
label=
"用户等级"
prop=
"userLevel"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-tag
>
{{
levelDic
[
scope
.
row
.
userLevel
]
}}
</el-tag>
<el-tag
>
{{
levelDic
[
scope
.
row
.
userLevel
]
}}
</el-tag>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"状态"
prop=
"status"
>
<el-table-column
align=
"center"
label=
"状态"
prop=
"status"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-tag>
{{
statusDic
[
scope
.
row
.
status
]
}}
</el-tag>
<el-tag>
{{
statusDic
[
scope
.
row
.
status
]
}}
</el-tag>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
class-name=
"small-padding fixed-width"
>
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<!-- 分页 -->
<pagination
v-show=
"total>0"
:total=
"total"
:page.sync=
"listQuery.page"
:limit.sync=
"listQuery.limit"
@
pagination=
"getList"
/>
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listQuery.page"
:page-sizes=
"[10,20,30,50]"
:page-size=
"listQuery.limit"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
</div>
<!-- 添加或修改对话框 -->
<!-- 添加或修改对话框 -->
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-form
:rules=
"rules"
ref=
"dataForm
"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
'
width: 400px; margin-left:50px;
'
>
<el-form
ref=
"dataForm"
:rules=
"rules
"
:model=
"dataForm"
status-icon
label-position=
"left"
label-width=
"100px"
style=
"
width: 400px; margin-left:50px;
"
>
<el-form-item
label=
"用户名"
prop=
"username"
>
<el-form-item
label=
"用户名"
prop=
"username"
>
<el-input
v-model=
"dataForm.username"
></el-input
>
<el-input
v-model=
"dataForm.username"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"手机号码"
prop=
"mobile"
>
<el-form-item
label=
"手机号码"
prop=
"mobile"
>
<el-input
v-model=
"dataForm.mobile"
></el-input
>
<el-input
v-model=
"dataForm.mobile"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"密码"
prop=
"password"
>
<el-form-item
label=
"密码"
prop=
"password"
>
<el-input
type=
"password"
v-model=
"dataForm.password"
auto-complete=
"off"
></el-input
>
<el-input
v-model=
"dataForm.password"
type=
"password"
auto-complete=
"off"
/
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"性别"
prop=
"gender"
>
<el-form-item
label=
"性别"
prop=
"gender"
>
<el-select
v-model=
"dataForm.gender"
>
<el-select
v-model=
"dataForm.gender"
>
<el-option
label=
"未知"
:value=
"0"
>
<el-option
:value=
"0"
label=
"未知"
/>
</el-option>
<el-option
:value=
"1"
label=
"男"
/>
<el-option
label=
"男"
:value=
"1"
>
<el-option
:value=
"2"
label=
"女"
/>
</el-option>
<el-option
label=
"女"
:value=
"2"
>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"生日"
prop=
"birthday"
>
<el-form-item
label=
"生日"
prop=
"birthday"
>
<el-date-picker
v-model=
"dataForm.birthday"
type=
"date"
value-format=
"yyyy-MM-dd"
>
<el-date-picker
v-model=
"dataForm.birthday"
type=
"date"
value-format=
"yyyy-MM-dd"
/>
</el-date-picker>
</el-form-item>
</el-form-item>
<el-form-item
label=
"用户等级"
prop=
"userLevel"
>
<el-form-item
label=
"用户等级"
prop=
"userLevel"
>
<el-select
v-model=
"dataForm.userLevel"
>
<el-select
v-model=
"dataForm.userLevel"
>
<el-option
label=
"普通用户"
:value=
"0"
>
<el-option
:value=
"0"
label=
"普通用户"
/>
</el-option>
<el-option
:value=
"1"
label=
"VIP用户"
/>
<el-option
label=
"VIP用户"
:value=
"1"
>
<el-option
:value=
"2"
label=
"高级VIP用户"
/>
</el-option>
<el-option
label=
"高级VIP用户"
:value=
"2"
>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"dataForm.status"
>
<el-select
v-model=
"dataForm.status"
>
<el-option
label=
"可用"
:value=
"0"
>
<el-option
:value=
"0"
label=
"可用"
/>
</el-option>
<el-option
:value=
"1"
label=
"禁用"
/>
<el-option
label=
"禁用"
:value=
"1"
>
<el-option
:value=
"2"
label=
"注销"
/>
</el-option>
<el-option
label=
"注销"
:value=
"2"
>
</el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -118,9 +97,11 @@
...
@@ -118,9 +97,11 @@
<
script
>
<
script
>
import
{
fetchList
,
createUser
,
updateUser
}
from
'
@/api/user
'
import
{
fetchList
,
createUser
,
updateUser
}
from
'
@/api/user
'
import
Pagination
from
'
@/components/Pagination
'
// Secondary package based on el-pagination
export
default
{
export
default
{
name
:
'
User
'
,
name
:
'
User
'
,
components
:
{
Pagination
},
data
()
{
data
()
{
return
{
return
{
list
:
null
,
list
:
null
,
...
@@ -181,14 +162,6 @@ export default {
...
@@ -181,14 +162,6 @@ export default {
this
.
listQuery
.
page
=
1
this
.
listQuery
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
resetForm
()
{
resetForm
()
{
this
.
dataForm
=
{
this
.
dataForm
=
{
id
:
undefined
,
id
:
undefined
,
...
...
Prev
1
…
4
5
6
7
8
Next
Write
Preview
Supports
Markdown
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