|
@@ -69,10 +69,11 @@
|
|
|
<template slot-scope="scope">{{ scope.row.msg_top === 1 ? '是' : '否' }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="创建时间" prop="created_at" min-width="160"></el-table-column>
|
|
|
- <el-table-column label="操作" width="150">
|
|
|
+ <el-table-column label="操作" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
|
|
|
<el-button type="text" @click="msgTop(scope.row)" v-if="scope.row.msg_top === 0">置顶</el-button>
|
|
|
+ <el-button type="text" @click="msgRelease(scope.row)" v-if="scope.row.msg_status === 0">发布</el-button>
|
|
|
<el-button type="text" @click="del(scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -142,6 +143,18 @@ export default {
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
},
|
|
|
+ msgRelease(row) {
|
|
|
+ this.$confirm('确定要发布吗', '确认', {
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ const data = await this.$fetch('/api/admin/msg/publish', { id: row.id })
|
|
|
+ if (data.code === 200) {
|
|
|
+ this.$message.success('发布成功')
|
|
|
+ this.init()
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
del(row) {
|
|
|
this.$confirm('确定要删除吗', '确认', {
|
|
|
type: 'warning'
|