chunk-ccb05846.8a963c6a.js 5.2 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ccb05846"],{"080d":function(t,e,a){},db69:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[a("div",{staticClass:"search_box"},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.addFolder(0)}}},[t._v("添加文件")])],1),a("div",{staticClass:"table_box"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"listTable",staticStyle:{width:"100%"},attrs:{"header-cell-style":{background:"#f8fbfc"},border:"",stripe:"",data:t.list,height:t.tableHeight+"px","cell-style":{padding:"10px 0"}}},[a("el-table-column",{attrs:{label:"序号",type:"index",width:"50",align:"center",index:function(e){return t.params.page_size*(t.params.page_index-1)+e+1}}}),a("el-table-column",{attrs:{label:"评论人",prop:"status",align:"center",width:"180","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[t._v(" "+t._s(a.user&&a.user.nickname)+" ")]}}])}),a("el-table-column",{attrs:{label:"评论内容",prop:"content",align:"center","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"时间",prop:"updated_at",align:"center"}}),a("el-table-column",{attrs:{label:"状态",prop:"status",width:"80",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[a("el-tag",{attrs:{type:1===i.is_audit?"success":"danger"}},[t._v(t._s(1===i.is_audit?"显示":"隐藏"))])]}}])}),a("el-table-column",{attrs:{label:"操作",prop:"status",width:"150",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.handleDisable(i)}}},[t._v(t._s(0===i.is_audit?"显示":"隐藏"))]),a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.handleDetail(i)}}},[t._v("详情")])]}}])})],1)],1),a("el-dialog",{attrs:{title:"添加文件",visible:t.dialogVisible,width:"35%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-form",{attrs:{model:t.folder}},[a("el-form-item",{attrs:{label:"文件名称:","label-width":"120px",required:""}},[a("el-input",{attrs:{placeholder:"请输入文件名称"},model:{value:t.folder.name,callback:function(e){t.$set(t.folder,"name",e)},expression:"folder.name"}})],1),a("el-form-item",{attrs:{label:"排序:","label-width":"120px",required:""}},[a("el-input",{attrs:{placeholder:"数字越大越靠上",type:"number"},model:{value:t.folder.sort,callback:function(e){t.$set(t.folder,"sort",e)},expression:"folder.sort"}})],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.handleFolder(0)}}},[t._v("添 加")])],1)],1),a("div",{staticClass:"batch-container"},[a("pagination",{attrs:{total:t.totalPage,limit:t.params.page_size,page:t.params.page_index},on:{pagination:t.changePagination,"update:limit":t.changePagination}})],1)],1)},n=[],s=(a("b0c0"),a("d3b7"),a("b775")),l=function(t){return Object(s["a"])({url:"/cate/addCate",method:"post",data:t})},o={name:"CommntList",filters:{getStatus:function(t){return 1===t}},data:function(){return{total:0,loading:!1,dialogFormVisible:!1,form:{},params:{page_index:1,page_size:20,type:0},folder:{name:"",sort:"",pid:0},list:[],totalPage:0,tableHeight:0,detail:"",showDetail:!1,dialogVisible:!1}},created:function(){this.getList()},mounted:function(){var t=this;this.$nextTick((function(){t.tableHeight=document.getElementsByClassName("table_box")[0].offsetHeight}))},methods:{addFolder:function(){this.dialogVisible=!0,this.folder={name:"",sort:"",pid:0}},handleFolder:function(t){var e=this,a=this.folder,i=a.name,n=a.sort;a.pid;return i?n?void l(this.folder).then((function(t){200==t.status_code?(e.$$message.success("添加成功"),e.dialogVisible=!1):e.$$message.success("添加失败")})):(this.$message.warning("排序不能为空"),!1):(this.$message.warning("文件名称不能为空"),!1)},handleDetail:function(t){this.detail=t,this.showDetail=!0},handleDisable:function(t){var e=this,a=t.id,i=t.is_audit,n=0==i?"显示":"隐藏";this.$confirm("确认要".concat(n,"该评论内容"),{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(t){authComment({comment_id:a}).then((function(t){200===t.status_code?(e.getList(),e.$message.success("已".concat(n,"该评论内容")),e.showDetail=!1):e.$message.error("设置失败")}))}))},getList:function(){var t=this;getCommentList(this.params).then((function(e){200===e.status_code?(t.list=e.data.list,t.totalPage=e.data.total):t.$message.error(e.msg||"获取评论列表失败")})).catch((function(t){})).finally((function(e){t.loading=!1}))},handleSearch:function(t){this.params.search_name?(this.loading=!0,!t&&(this.page=1),this.getList()):(this.page=1,this.created())},changePagination:function(t){var e=t.page,a=t.limit;this.params.page_size=a,this.params.page_index=e,this.getList()}}},r=o,c=(a("eaf1"),a("2877")),d=Object(c["a"])(r,i,n,!1,null,"8e5cab96",null);e["default"]=d.exports},eaf1:function(t,e,a){"use strict";a("080d")}}]);