Browse Source

待处理项目和已结案项目增加置顶功能

feature/syp_points
liuchuang 5 years ago
parent
commit
fd597a434c
  1. 36
      src/views/modules/events/item-deal-list.vue
  2. 36
      src/views/modules/events/item-end-list.vue

36
src/views/modules/events/item-deal-list.vue

@ -123,6 +123,7 @@
header-align="center" header-align="center"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column prop="topFlag" label="置顶状态" header-align="center" align="center" width="100" :formatter="topFlagFormat"></el-table-column>
<el-table-column <el-table-column
:label="$t('handle')" :label="$t('handle')"
fixed="right" fixed="right"
@ -138,6 +139,8 @@
@click="dealAction(scope.row.id)" @click="dealAction(scope.row.id)"
>{{ $t('deal') }}</el-button >{{ $t('deal') }}</el-button
> >
<el-button v-if="scope.row.topFlag === '0'" type="text" size="small" @click="top(scope.row.id, '1')">{{ '置顶' }}</el-button>
<el-button v-if="scope.row.topFlag === '1'" type="text" size="small" @click="top(scope.row.id, '0')">{{ '取消置顶' }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -249,6 +252,39 @@ export default {
this.options = res.data.options this.options = res.data.options
}) })
.catch(() => {}) .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']('/events/item/top', { 'itemId': 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(() => {})
} }
} }
} }

36
src/views/modules/events/item-end-list.vue

@ -130,6 +130,7 @@
width="65" width="65"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column prop="topFlag" label="置顶状态" header-align="center" align="center" width="100" :formatter="topFlagFormat"></el-table-column>
<el-table-column <el-table-column
:label="$t('handle')" :label="$t('handle')"
fixed="right" fixed="right"
@ -145,6 +146,8 @@
@click="detailAction1(scope.row.id)" @click="detailAction1(scope.row.id)"
>{{ $t('look') }}</el-button >{{ $t('look') }}</el-button
> >
<el-button v-if="scope.row.topFlag === '0'" type="text" size="small" @click="top(scope.row.id, '1')">{{ '置顶' }}</el-button>
<el-button v-if="scope.row.topFlag === '1'" type="text" size="small" @click="top(scope.row.id, '0')">{{ '取消置顶' }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -255,6 +258,39 @@ export default {
this.options = res.data.options this.options = res.data.options
}) })
.catch(() => {}) .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']('/events/item/top', { 'itemId': 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(() => {})
} }
} }
} }

Loading…
Cancel
Save