发表于: 2020-03-06 22:02:34

1 1506



今天完成的事情:

1.推进任务


明天计划的事情:

1.推进任务

遇到的问题和收获:

完善一下按钮

<el-button type="primary" @click="handleClick(scope.row)" size="small">
   {{scope.row.status===1?'上线':'下线'}}
</el-button>


//修改article的上架/下架(status
handleClick(row) {
   console.log(row);
   this.$confirm(row.status === 1 ? '是否行上线操作' : '是否行下线操作' + '?', '提示', {
       confirmButtonText: '',
       cancelButtonText: '取消',
       type: 'warning'
   }).then(() => {
       this.$http({
           method: 'put',
           url: '/api/a/u/article/status',
           data: this.$qs.stringify({
               id: row.id,
               status: row.status === 1 ? 2 : 1
           })
       }).then(res => {
           console.log(res);
           if (res.data.code === 0) {
               console.log(res);
               this.$message.success('操作成功')
               //求刷新列表
               this.getArticleList()
           }
       })
   }).catch(() => {
       this.$message({
           type: 'info',
           message: '已取消'
       });
   })
}

执行请求上下线的接口




返回列表 返回列表
评论

    分享到