2 lines
3.5 KiB
JavaScript
2 lines
3.5 KiB
JavaScript
import{s as o,n as c}from"./index-2b234fd0.js";const l={data(){return{state:1,list:[],reason:"",columns:[{colKey:"tweet",title:"帖子标题",align:"center"},{colKey:"content",title:"评论内容",align:"center"},{colKey:"member_info",title:"发布者",align:"center"},{colKey:"createtime",title:"评论时间",align:"center"},{colKey:"status",title:"状态",align:"center"},{colKey:"select",title:"操作",width:200}],pagination:{page:1,size:10,total:0}}},mounted(){typeof o.state.user.association=="object"?this.association=o.state.user.association:this.association=JSON.parse(o.state.user.association);var t=this.$route.name.slice(-1);this.state=t,this.getList()},methods:{tabIndexChange(t){this.state=t,this.pagination.page=1,this.list=[],this.getList()},review(t,a){console.log(t),this.$request.post("/tweet_comments/review",{id:t.id,status:a,reason:this.reason,member_id:t.member_id}).then(e=>{e.code==1?(this.$message.success(e.msg),this.getList()):this.$message.error(e.msg),console.log(e)}).catch(e=>{console.log(e)})},del(t){console.log(t),this.$request.post("/tweets/destroy",{id:t.id}).then(a=>{a.code==1?(this.$message.success("删除成功!"),this.pagination.page=1,this.getList()):this.$message.error(a.msg),console.log(a)}).catch(a=>{console.log(a)})},onCurrentChange(t){this.pagination.page=t,this.getList()},getList(){this.$request.post("/tweet_comments/index",{state:this.state,page:this.pagination.page,size:this.pagination.size}).then(t=>{console.log(t),t.code==1&&(this.list=t.data.paginator.data,this.pagination.total=t.data.count)}).catch(t=>{console.log(t)})}}};var g=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("t-card",{attrs:{title:"青企圈评论列表",bordered:!1}},[e("div",{staticClass:"form-step-container"},[e("t-table",{attrs:{rowKey:"index",data:t.list,columns:t.columns,stripe:!1,bordered:!1,hover:!0,size:"large","table-layout":"auto",cellEmptyContent:"-",pagination:t.pagination},scopedSlots:t._u([{key:"tweet",fn:function(n){var s=n.row;return[e("div",[t._v(t._s(s.tweet==null?"-":s.tweet.title))])]}},{key:"member_info",fn:function(n){var s=n.row;return[e("div",[t._v(t._s(s.member.nikename))])]}},{key:"status",fn:function(n){var s=n.row;return[s.status==1?e("t-tag",{attrs:{theme:"primary"}},[t._v("待审核")]):t._e(),s.status==2?e("t-tag",{attrs:{theme:"success"}},[t._v("已发布")]):t._e(),s.status==3?e("t-tag",{attrs:{theme:"danger"}},[t._v("已拒绝")]):t._e()]}},{key:"select",fn:function(n){var s=n.row;return[e("t-space",{attrs:{size:0}},[s.status==1?e("t-popconfirm",{attrs:{content:"确定要审核通过吗?"},on:{confirm:function(i){return t.review(s,1)}}},[e("t-button",{attrs:{theme:"primary"}},[t._v("通过")])],1):t._e(),s.status==1?e("t-popconfirm",{attrs:{theme:"danger"},on:{confirm:function(i){return t.review(s,2)}}},[e("template",{slot:"content"},[e("p",{staticClass:"title"},[t._v("拒绝理由")]),e("p",{staticClass:"describe",staticStyle:{"margin-top":"10px"}},[e("t-input",{attrs:{placeholder:"请输入拒绝理由"},model:{value:t.reason,callback:function(i){t.reason=i},expression:"reason"}})],1)]),e("t-button",{staticStyle:{margin:"0px 10px"},attrs:{theme:"warning"}},[t._v("拒绝")])],2):t._e()],1)]}}])}),e("div",{staticStyle:{"margin-top":"30px"}},[e("t-pagination",{attrs:{total:t.pagination.total,"page-size":t.pagination.size,showPageSize:!1},on:{"current-change":t.onCurrentChange}})],1)],1)])},u=[];const r={};var m=c(l,g,u,!1,p,null,null,null);function p(t){for(let a in r)this[a]=r[a]}const _=function(){return m.exports}();export{_ as default};
|