|
@@ -4,20 +4,11 @@
|
|
|
<div class="filter-container">
|
|
|
<div class="filter-control">
|
|
|
<span>图片标题:</span>
|
|
|
- <el-input
|
|
|
- v-model="listQuery.imageTitle"
|
|
|
- placeholder="图片标题"
|
|
|
- @keyup.enter.native="getList"
|
|
|
- />
|
|
|
+ <el-input v-model="listQuery.imageTitle" placeholder="图片标题" @keyup.enter.native="getList" />
|
|
|
</div>
|
|
|
<div class="filter-control">
|
|
|
<span>审核状态:</span>
|
|
|
- <el-select
|
|
|
- v-model="listQuery.auditStatus"
|
|
|
- placeholder="审核状态"
|
|
|
- clearable
|
|
|
- @change="getList"
|
|
|
- >
|
|
|
+ <el-select v-model="listQuery.auditStatus" placeholder="审核状态" clearable @change="getList">
|
|
|
<el-option label="全部" value="" />
|
|
|
<el-option label="待审核" :value="2" />
|
|
|
<el-option label="审核通过" :value="1" />
|
|
@@ -26,12 +17,7 @@
|
|
|
</div>
|
|
|
<div class="filter-control">
|
|
|
<span>上线状态:</span>
|
|
|
- <el-select
|
|
|
- v-model="listQuery.status"
|
|
|
- placeholder="上线状态"
|
|
|
- clearable
|
|
|
- @change="getList"
|
|
|
- >
|
|
|
+ <el-select v-model="listQuery.status" placeholder="上线状态" clearable @change="getList">
|
|
|
<el-option label="全部" value="" />
|
|
|
<el-option label="已上线" :value="1" />
|
|
|
<el-option label="待上线" :value="2" />
|
|
@@ -40,11 +26,7 @@
|
|
|
</div>
|
|
|
<div class="filter-control">
|
|
|
<permission-button type="primary" @click="getList">查询</permission-button>
|
|
|
- <permission-button
|
|
|
- icon="icon-tianjia iconfont"
|
|
|
- type="primary"
|
|
|
- @click="$_navigationTo(`image-edit?type=add`)"
|
|
|
- >添加图片</permission-button>
|
|
|
+ <permission-button type="primary" @click="$_navigationTo(`image-edit?type=add`)">添加图片</permission-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 搜索区域END -->
|
|
@@ -68,16 +50,10 @@
|
|
|
<!-- 未通过原因展示 -->
|
|
|
<template v-if="row.auditStatus === 0">
|
|
|
<!-- <span class="status danger">审核未通过 </span> -->
|
|
|
- <el-popover
|
|
|
- placement="top-start"
|
|
|
- title="审核说明"
|
|
|
- width="400"
|
|
|
- trigger="hover"
|
|
|
- :content="row.invalidReason"
|
|
|
- >
|
|
|
+ <el-popover placement="top-start" title="审核说明" width="400" trigger="hover" :content="row.invalidReason">
|
|
|
<el-tag slot="reference" size="small" type="danger" class="reason">
|
|
|
<span>审核未通过</span>
|
|
|
- <span class="el-icon-question status danger " />
|
|
|
+ <span class="el-icon-question status danger" />
|
|
|
</el-tag>
|
|
|
</el-popover>
|
|
|
<!-- 未通过原因展示END -->
|
|
@@ -85,37 +61,53 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="上线状态" width="160px" align="center">
|
|
|
- <template slot-scope="{row}">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
<!-- 只有审核通过了才能操作上下线 auditStatus :审核状态 -->
|
|
|
<template v-if="row.auditStatus === 1">
|
|
|
<template v-if="row.status === 0">
|
|
|
- <span style="margin-right:10px;" class="status danger">已下线</span>
|
|
|
+ <span style="margin-right: 10px" class="status danger">已下线</span>
|
|
|
<permission-button type="primary" size="mini" @click="handleChangeStatus(row)">上线</permission-button>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <span style="margin-right:10px;" class="status success ">已上线</span>
|
|
|
+ <span style="margin-right: 10px" class="status success">已上线</span>
|
|
|
<permission-button type="info" size="mini" plain @click="handleChangeStatus(row)">下线</permission-button>
|
|
|
</template>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<!-- <el-tag type="warning">待上线</el-tag> -->
|
|
|
- <span style="margin-right:10px;" class="status warning">待上线</span>
|
|
|
+ <span style="margin-right: 10px" class="status warning">待上线</span>
|
|
|
</template>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="创建时间" width="160px" align="center">
|
|
|
- <template slot-scope="{row}">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
{{ row.createTime | formatTime }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="180px" align="center">
|
|
|
- <template slot-scope="{row}">
|
|
|
- <permission-button type="primary" size="mini" style="margin-right:5px" @click="$_navigationTo(`image-edit?type=edit&imageId=${row.imageId}`)">编辑</permission-button>
|
|
|
- <permission-button type="danger" size="mini" style="margin-right:5px" @click="handleRemoveImage(row)">删除</permission-button>
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <permission-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ style="margin-right: 5px"
|
|
|
+ @click="$_navigationTo(`image-edit?type=edit&imageId=${row.imageId}`)"
|
|
|
+ >编辑</permission-button>
|
|
|
+ <permission-button
|
|
|
+ type="danger"
|
|
|
+ size="mini"
|
|
|
+ style="margin-right: 5px"
|
|
|
+ @click="handleRemoveImage(row)"
|
|
|
+ >删除</permission-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList(listQuery)" />
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="listQuery.pageNum"
|
|
|
+ :limit.sync="listQuery.pageSize"
|
|
|
+ @pagination="getList(listQuery)"
|
|
|
+ />
|
|
|
<!-- 表格区域END -->
|
|
|
</div>
|
|
|
</template>
|
|
@@ -155,7 +147,7 @@ export default {
|
|
|
this.listLoading = true
|
|
|
this.listQuery.authUserId = this.authUserId
|
|
|
getImageList(this.listQuery)
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
console.log(res)
|
|
|
if (res.code !== 0) return
|
|
|
this.list = res.data.list
|
|
@@ -176,12 +168,11 @@ export default {
|
|
|
this.$message.info('已取消操作')
|
|
|
})
|
|
|
if (text !== 'confirm') return
|
|
|
- removeImage({ imageId: row.imageId })
|
|
|
- .then(res => {
|
|
|
- if (res.code !== 0) return
|
|
|
- this.$message.success(res.data)
|
|
|
- this.getList(this.listQuery)
|
|
|
- })
|
|
|
+ removeImage({ imageId: row.imageId }).then((res) => {
|
|
|
+ if (res.code !== 0) return
|
|
|
+ this.$message.success(res.data)
|
|
|
+ this.getList(this.listQuery)
|
|
|
+ })
|
|
|
},
|
|
|
// 状态改变
|
|
|
handleChangeStatus(item) {
|
|
@@ -195,19 +186,22 @@ export default {
|
|
|
imageId: item.imageId,
|
|
|
status: item.status === 1 ? 0 : 1
|
|
|
}
|
|
|
- changeImageStatus(params).then(res => {
|
|
|
- // this.$message.success(res.data)
|
|
|
- this.$message({
|
|
|
- message: res.data,
|
|
|
- duration: 500,
|
|
|
- type: 'success'
|
|
|
+ changeImageStatus(params)
|
|
|
+ .then((res) => {
|
|
|
+ // this.$message.success(res.data)
|
|
|
+ this.$message({
|
|
|
+ message: res.data,
|
|
|
+ duration: 500,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.listLoading = false
|
|
|
})
|
|
|
- this.getList()
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- }).finally(() => {
|
|
|
- this.listLoading = false
|
|
|
- })
|
|
|
},
|
|
|
indexMethod(index) {
|
|
|
return index + this.listQuery.pageSize * (this.listQuery.pageNum - 1) + 1
|
|
@@ -220,7 +214,7 @@ export default {
|
|
|
.el-table .cell {
|
|
|
overflow: visible;
|
|
|
}
|
|
|
-.el-badge{
|
|
|
+.el-badge {
|
|
|
margin: 0 6px;
|
|
|
}
|
|
|
</style>
|