Browse Source

党群1+1 话题列表增加置顶和取消置顶操作

feature/syp_points
liuchuang 5 years ago
parent
commit
204770970c
  1. 38
      src/views/modules/partygroup/partytopic-list.vue
  2. 2
      src/views/modules/sys/role-add-or-update.vue

38
src/views/modules/partygroup/partytopic-list.vue

@ -48,16 +48,19 @@
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column label="序号" type="index" show-overflow-tooltip align="center" width="50"></el-table-column>
<el-table-column prop="nickname" label="发言人" header-align="center" align="center" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="createdTime" label="时间" header-align="center" align="center" width="180"></el-table-column>
<el-table-column prop="createdTime" label="时间" header-align="center" align="center" width="160"></el-table-column>
<el-table-column prop="topicContent" label="话题内容" header-align="center" align="center" min-width="300" show-overflow-tooltip></el-table-column>
<el-table-column prop="commentNum" label="评论数" header-align="center" align="center" width="70"></el-table-column>
<el-table-column prop="browseNum" label="浏览数" header-align="center" align="center" width="70"></el-table-column>
<el-table-column prop="supportNum" label="点赞数" header-align="center" align="center" width="70"></el-table-column>
<el-table-column prop="topFlag" label="置顶状态" header-align="center" align="center" width="100" :formatter="topFlagFormat"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text" size="small" @click="look(scope.row.id)">{{ $t('look') }}</el-button>
<el-button v-if="scope.row.state !== 20" type="text" size="small" @click="close(scope.row.id)">{{ $t('close') }}</el-button>
<el-button type="text" size="small" v-if="scope.row.state ===20" :disabled="true">已关闭</el-button>
<el-button v-if="scope.row.state !== 20 && scope.row.topFlag === '0'" type="text" size="small" @click="top(scope.row.id, '1')">{{ '置顶' }}</el-button>
<el-button v-if="scope.row.state !== 20 && scope.row.topFlag === '1'" type="text" size="small" @click="top(scope.row.id, '0')">{{ '取消置顶' }}</el-button>
</template>
</el-table-column>
</el-table>
@ -187,6 +190,39 @@ export default {
}
this.options = res.data.options
}).catch(() => {})
},
topFlagFormat: function (row, column) {
let topFlag = row.topFlag
if (topFlag === '0') {
return '未置顶'
} else if (topFlag === '1') {
return '已置顶'
}
},
top (id, topFlag) {
let title = '置顶'
if (topFlag === '0') {
title = '取消置顶'
}
this.$confirm(this.$t('prompt.info', { 'handle': title }), this.$t(title), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http['post']('/partyGroup/partytopic/top', { 'topicId': id, 'topFlag': topFlag }).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
}
})
this.getDataList()
}).catch(() => {})
}).catch(() => {})
}
}
}

2
src/views/modules/sys/role-add-or-update.vue

@ -124,7 +124,7 @@ export default {
appMenuList: [],
categoryList: [],
roleTypeList: [],
analysisMenuList:[],
analysisMenuList: [],
dataForm: {
id: '',
name: '',

Loading…
Cancel
Save