You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
7.6 KiB
1 lines
7.6 KiB
webpackJsonp([81],{Sq2b:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=a("mvHQ"),n=a.n(r),s=a("Xxa5"),i=a.n(s),o=a("exGp"),c=a.n(o),l=a("Dd8w"),m=a.n(l),u=a("NYxO"),p=a("PJh5"),h=a.n(p),d={data:function(){return{statusText:{1:{type:"info",text:"未审核"},2:{type:"",text:"审核通过"},3:{type:"danger",text:"已驳回"}},pickerOptions:{disabledDate:function(t){return t.getTime()>1e3*(h()(h()(Date.now()).format("YYYY-MM-DD")).unix()+86400-1)}},searchForm:{page:1,limit:10,status:0,start_time:"",end_time:"",user_name:""},loading:!1,tableData:[],total:0,count:{}}},created:function(){this.getTableDataList(1)},computed:m()({},Object(u.d)({routesItem:function(t){return t.routes}})),methods:{resetForm:function(t){this.$refs[t].resetFields(),this.getTableDataList(1)},handleSizeChange:function(t){this.searchForm.limit=t,this.handleCurrentChange(1)},handleCurrentChange:function(t){this.searchForm.page=t,this.getTableDataList()},toChange:function(t){var e=this;return c()(i.a.mark(function a(){return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e.searchForm.status=t,e.getTableDataList(1);case 2:case"end":return a.stop()}},a,e)}))()},getTableDataList:function(t){var e=this;return c()(i.a.mark(function a(){var r,s,o,c,l,m,u,p,h,d;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t&&(e.searchForm.page=1),e.tableData=[],e.loading=!0,r=JSON.parse(n()(e.searchForm)),(s=r.start_time)&&s.length>0?(r.start_time=s[0]/1e3,r.end_time=s[1]/1e3):(r.start_time="",r.end_time=""),-1===r.status&&(r.is_update=1,delete r.status),a.next=9,e.$api.dynamic.commentList(r);case 9:if(o=a.sent,c=o.code,l=o.data,e.loading=!1,200===c){a.next=15;break}return a.abrupt("return");case 15:m=l.all,u=l.nopass,p=l.ing,h=l.pass,d=l.total,e.tableData=l.data,e.total=d,e.count={all:m,nopass:u,ing:p,pass:h};case 19:case"end":return a.stop()}},a,e)}))()},confirmDel:function(t,e){var a=this;this.$confirm("你确认要"+{"-1":"删除",2:"通过",3:"驳回"}[e]+"评论吗?",this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){a.updateItem(t,e)}).catch(function(){})},updateItem:function(t,e){var a=this;return c()(i.a.mark(function r(){var n;return i.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:n=-1===e?"commentDel":"commentCheck",a.$api.dynamic[n]({id:t,status:e}).then(function(t){if(200===t.code)a.$message.success(a.$t(-1===e?"tips.successDel":"tips.successOper")),-1===e&&(a.searchForm.page=a.searchForm.page<Math.ceil((a.total-1)/a.searchForm.limit)?a.searchForm.page:Math.ceil((a.total-1)/a.searchForm.limit)),a.getTableDataList();else{if(-1===e)return;a.getTableDataList()}});case 2:case"end":return r.stop()}},r,a)}))()}},filters:{handleTime:function(t,e){return 1===e?h()(1e3*t).format("YYYY-MM-DD"):2===e?h()(1e3*t).format("HH:mm:ss"):h()(1e3*t).format("YYYY-MM-DD HH:mm:ss")}}},f={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"lb-dynamic-comment"},[a("top-nav"),t._v(" "),a("div",{staticClass:"page-main"},[a("el-row",{staticClass:"page-top-operate"},[a("el-button",{attrs:{type:0===t.searchForm.status?"primary":"",plain:"",size:"medium"},on:{click:function(e){return t.toChange(0)}}},[t._v("全部("+t._s(t.count.all||0)+")")]),t._v(" "),a("el-button",{attrs:{type:1===t.searchForm.status?"primary":"",plain:"",size:"medium"},on:{click:function(e){return t.toChange(1)}}},[t._v("未审核("+t._s(t.count.ing||0)+")")]),t._v(" "),a("el-button",{attrs:{type:2===t.searchForm.status?"primary":"",plain:"",size:"medium"},on:{click:function(e){return t.toChange(2)}}},[t._v("审核通过("+t._s(t.count.pass||0)+")")]),t._v(" "),a("el-button",{attrs:{type:3===t.searchForm.status?"primary":"",plain:"",size:"medium"},on:{click:function(e){return t.toChange(3)}}},[t._v("已驳回("+t._s(t.count.nopass||0)+")")])],1),t._v(" "),a("el-row",{staticClass:"page-search-form"},[a("el-form",{ref:"searchForm",attrs:{inline:!0,model:t.searchForm},nativeOn:{submit:function(t){t.preventDefault()}}},[a("el-form-item",{attrs:{label:"输入查询",prop:"user_name"}},[a("el-input",{attrs:{placeholder:"请输入用户姓名"},model:{value:t.searchForm.user_name,callback:function(e){t.$set(t.searchForm,"user_name",e)},expression:"searchForm.user_name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"评论时间",prop:"start_time"}},[a("el-date-picker",{attrs:{type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"timestamp","picker-options":t.pickerOptions,"default-time":["00:00:00","23:59:59"]},on:{change:function(e){return t.getTableDataList(1)}},model:{value:t.searchForm.start_time,callback:function(e){t.$set(t.searchForm,"start_time",e)},expression:"searchForm.start_time"}})],1),t._v(" "),a("el-form-item",[a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.getTableDataList(1)}}},[t._v(t._s(t.$t("action.search")))]),t._v(" "),a("lb-button",{staticStyle:{"margin-right":"5px"},attrs:{size:"medium",icon:"el-icon-refresh-left"},on:{click:function(e){return t.resetForm("searchForm")}}},[t._v(t._s(t.$t("action.reset")))])],1)],1)],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,"header-cell-style":{background:"#f5f7fa",color:"#606266"}}},[a("el-table-column",{attrs:{prop:"nickName",label:"评论用户",width:"200",fixed:""}}),t._v(" "),a("el-table-column",{attrs:{prop:"text",label:"评论内容","min-width":"400"}}),t._v(" "),a("el-table-column",{attrs:{prop:"create_time",label:"评论时间","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("p",[t._v(t._s(t._f("handleTime")(e.row.create_time,1)))]),t._v(" "),a("p",[t._v(t._s(t._f("handleTime")(e.row.create_time,2)))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"status",label:"状态","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-tag",{attrs:{type:t.statusText[e.row.status].type}},[t._v("\n "+t._s(t.statusText[e.row.status].text)+"\n ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"table-operate"},[1===e.row.status?a("block",[a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:t.$route.name+"-pass",expression:"`${$route.name}-pass`"}],attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(a){return t.confirmDel(e.row.id,2)}}},[t._v("通过")]),t._v(" "),a("lb-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:t.$route.name+"-reject",expression:"`${$route.name}-reject`"}],attrs:{size:"mini",plain:"",type:"warning"},on:{click:function(a){return t.confirmDel(e.row.id,3)}}},[t._v("驳回")])],1):t._e(),t._v(" "),a("lb-button",{directives:[{name:"show",rawName:"v-show",value:1!==e.row.status,expression:"scope.row.status !== 1"},{name:"hasPermi",rawName:"v-hasPermi",value:t.$route.name+"-delete",expression:"`${$route.name}-delete`"}],attrs:{size:"mini",plain:"",type:"danger"},on:{click:function(a){return t.confirmDel(e.row.id,-1)}}},[t._v(t._s(t.$t("action.delete")))])],1)]}}])})],1),t._v(" "),a("lb-page",{attrs:{batch:!1,page:t.searchForm.page,pageSize:t.searchForm.limit,total:t.total},on:{handleSizeChange:t.handleSizeChange,handleCurrentChange:t.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var _=a("VU/8")(d,f,!1,function(t){a("jnxm")},"data-v-396a780b",null);e.default=_.exports},jnxm:function(t,e){}}); |