|
@@ -8,16 +8,16 @@
|
|
|
clearable
|
|
|
class="mt-10">
|
|
|
<el-form-item label="标题:">
|
|
|
- <el-input v-model="searchForm.lunbo_name" placeholder="请输入标题" clearable></el-input>
|
|
|
+ <el-input v-model="searchForm.msg_title" placeholder="请输入标题" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态:">
|
|
|
<el-select
|
|
|
- v-model="searchForm.lunbo_status"
|
|
|
+ v-model="searchForm.msg_status"
|
|
|
filterable
|
|
|
clearable
|
|
|
placeholder="请选择状态">
|
|
|
<el-option
|
|
|
- v-for="item in arrLunboStatus"
|
|
|
+ v-for="item in arrMsgStatus"
|
|
|
:key="item.value"
|
|
|
:label="item.name"
|
|
|
:value="item.value">
|
|
@@ -54,19 +54,25 @@
|
|
|
class="marginT-10 order-table"
|
|
|
border
|
|
|
:max-height="vheight">
|
|
|
- <el-table-column label="标题" prop="lunbo_name" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column label="内容" prop="lunbo_img_url" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column label="状态" prop="lunbo_status">
|
|
|
+ <el-table-column label="标题" prop="msg_title" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column label="内容" prop="msg_content" min-width="200" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- <p>{{ getLunboStatusText(scope.row.lunbo_status) }}</p>
|
|
|
+ <p v-html="scope.row.msg_content"></p>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="发布时间" prop="created_at" min-width="160"></el-table-column>
|
|
|
- <el-table-column label="操作" width="240">
|
|
|
+ <el-table-column label="状态" prop="msg_status">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <p>{{ getMsgStatusText(scope.row.msg_status) }}</p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="置顶" prop="msg_top">
|
|
|
+ <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">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
|
|
|
- <el-button type="text" @click="edit(scope.row)">发布通知</el-button>
|
|
|
- <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="del(scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -92,7 +98,7 @@
|
|
|
<script>
|
|
|
import page from '@/mixin/page'
|
|
|
import detail from './details'
|
|
|
-// TODO 缺列表、发布、编辑(含置顶)、删除接口
|
|
|
+
|
|
|
export default {
|
|
|
mixins: [page],
|
|
|
components: {
|
|
@@ -107,15 +113,12 @@ export default {
|
|
|
time: [],
|
|
|
searchForm: {},
|
|
|
tableData: [],
|
|
|
- tableUrl: '/api/admin/tlunbo/list'
|
|
|
+ tableUrl: '/api/admin/msg/list'
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- arrLunboStatus() {
|
|
|
- return this.$store.state.common.arrLunboStatus
|
|
|
- },
|
|
|
- arrLunboLinkType() {
|
|
|
- return this.$store.state.common.arrLunboLinkType
|
|
|
+ arrMsgStatus() {
|
|
|
+ return this.$store.state.common.arrMsgStatus
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -127,11 +130,23 @@ export default {
|
|
|
this.detailsDialog.exData = row
|
|
|
this.detailsDialog.show = true
|
|
|
},
|
|
|
+ msgTop(row) {
|
|
|
+ this.$confirm('确定要置顶吗', '确认', {
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ const data = await this.$fetch('/api/admin/msg/top', { id: row.id })
|
|
|
+ if (data.code === 200) {
|
|
|
+ this.$message.success('置顶成功')
|
|
|
+ this.init()
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
del(row) {
|
|
|
this.$confirm('确定要删除吗', '确认', {
|
|
|
type: 'warning'
|
|
|
}).then(async () => {
|
|
|
- const data = await this.$fetch('/api/admin/tlunbo/delete', { id: row.id })
|
|
|
+ const data = await this.$fetch('/api/admin/msg/delete', { id: row.id })
|
|
|
if (data.code === 200) {
|
|
|
this.$message.success('删除成功')
|
|
|
this.init()
|
|
@@ -139,15 +154,8 @@ export default {
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
},
|
|
|
- getLunboStatusText(value) {
|
|
|
- const temp = this.arrLunboStatus.filter(item => item.value === value)
|
|
|
- if (temp.length > 0) {
|
|
|
- return temp[0].name
|
|
|
- }
|
|
|
- return ''
|
|
|
- },
|
|
|
- getLunboLinkTypeText(value) {
|
|
|
- const temp = this.arrLunboLinkType.filter(item => item.value === value)
|
|
|
+ getMsgStatusText(value) {
|
|
|
+ const temp = this.arrMsgStatus.filter(item => item.value === value)
|
|
|
if (temp.length > 0) {
|
|
|
return temp[0].name
|
|
|
}
|