halo/src/main/resources/admin/js/chunk-5bf599cc.6555f060.js

1 line
9.4 KiB
Java

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5bf599cc"],{"81a6":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=this,a=e.$createElement,n=e._self._c||a;return n("div",{staticClass:"page-header-index-wide"},[n("a-row",[n("a-col",{attrs:{span:24}},[n("a-card",{attrs:{bordered:!1}},[n("div",{staticClass:"table-page-search-wrapper"},[n("a-form",{attrs:{layout:"inline"}},[n("a-row",{attrs:{gutter:48}},[n("a-col",{attrs:{md:6,sm:24}},[n("a-form-item",{attrs:{label:"关键词"}},[n("a-input",{model:{value:e.queryParam.keyword,callback:function(t){e.$set(e.queryParam,"keyword",t)},expression:"queryParam.keyword"}})],1)],1),n("a-col",{attrs:{md:6,sm:24}},[n("a-form-item",{attrs:{label:"状态"}},[n("a-select",{attrs:{placeholder:"请选择状态"}},[n("a-select-option",{attrs:{value:"1"}},[e._v("公开")]),n("a-select-option",{attrs:{value:"0"}},[e._v("私密")])],1)],1)],1),n("a-col",{attrs:{md:6,sm:24}},[n("span",{staticClass:"table-page-search-submitButtons"},[n("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.loadJournals(!0)}}},[e._v("查询")]),n("a-button",{staticStyle:{"margin-left":"8px"},on:{click:e.resetParam}},[e._v("重置")])],1)])],1)],1)],1),n("div",{staticClass:"table-operator"},[n("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.handleNew}},[e._v("写日志")])],1),n("a-divider"),n("div",{staticStyle:{"margin-top":"15px"}},[n("a-list",{attrs:{itemLayout:"vertical",pagination:!1,dataSource:e.journals,loading:e.listLoading},scopedSlots:e._u([{key:"renderItem",fn:function(t,a){return n("a-list-item",{key:a},[n("template",{slot:"actions"},[n("span",[n("a",{attrs:{href:"javascript:void(0);"}},[n("a-icon",{staticStyle:{"margin-right":"8px"},attrs:{type:"like-o"}}),e._v(e._s(t.likes)+"\n ")],1)]),n("span",[n("a",{attrs:{href:"javascript:void(0);"},on:{click:function(a){return e.handleCommentShow(t)}}},[n("a-icon",{staticStyle:{"margin-right":"8px"},attrs:{type:"message"}}),e._v(e._s(t.commentCount)+"\n ")],1)])]),n("template",{slot:"extra"},[n("a",{attrs:{href:"javascript:void(0);"},on:{click:function(a){return e.handleEdit(t)}}},[e._v("编辑")]),n("a-divider",{attrs:{type:"vertical"}}),n("a-popconfirm",{attrs:{title:"你确定要删除这条日志?",okText:"确定",cancelText:"取消"},on:{confirm:function(a){return e.handleDelete(t.id)}}},[n("a",{attrs:{href:"javascript:void(0);"}},[e._v("删除")])])],1),n("a-list-item-meta",{attrs:{description:t.content}},[n("span",{attrs:{slot:"title"},slot:"title"},[e._v(e._s(e._f("moment")(t.createTime)))]),n("a-avatar",{attrs:{slot:"avatar",size:"large",src:e.user.avatar},slot:"avatar"})],1)],2)}}])},[n("div",{staticClass:"page-wrapper"},[n("a-pagination",{staticClass:"pagination",attrs:{total:e.pagination.total,defaultPageSize:e.pagination.size,pageSizeOptions:["1","2","5","10","20","50","100"],showSizeChanger:""},on:{showSizeChange:e.onPaginationChange,change:e.onPaginationChange}})],1)])],1)],1)],1)],1),n("a-modal",{model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[n("template",{slot:"title"},[e._v("\n "+e._s(e.title)+" "),n("a-tooltip",{attrs:{slot:"action",title:"只能输入250字"},slot:"action"},[n("a-icon",{attrs:{type:"info-circle-o"}})],1)],1),n("template",{slot:"footer"},[n("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.createOrUpdateJournal}},[e._v("\n 发布\n ")])],1),n("a-form",{attrs:{layout:"vertical"}},[n("a-form-item",[n("a-input",{attrs:{type:"textarea",autosize:{minRows:8}},model:{value:e.journal.content,callback:function(t){e.$set(e.journal,"content",t)},expression:"journal.content"}})],1)],1)],2),e.selectComment?n("a-modal",{attrs:{title:"回复给:"+e.selectComment.author},model:{value:e.selectCommentVisible,callback:function(t){e.selectCommentVisible=t},expression:"selectCommentVisible"}},[n("template",{slot:"footer"},[n("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.handleReplyComment}},[e._v("\n 回复\n ")])],1),n("a-form",{attrs:{layout:"vertical"}},[n("a-form-item",[n("a-input",{attrs:{type:"textarea",autosize:{minRows:8}},model:{value:e.replyComment.content,callback:function(t){e.$set(e.replyComment,"content",t)},expression:"replyComment.content"}})],1)],1)],2):e._e(),n("a-drawer",{attrs:{title:"评论列表",width:e.isMobile()?"100%":"460",closable:"",visible:e.commentVisiable,destroyOnClose:""},on:{close:function(){return t.commentVisiable=!1}}},[n("a-row",{attrs:{type:"flex",align:"middle"}},[n("a-col",{attrs:{span:24}},[n("a-comment",[n("a-avatar",{attrs:{slot:"avatar",src:e.user.avatar,alt:e.user.nickname},slot:"avatar"}),n("p",{attrs:{slot:"content"},slot:"content"},[e._v(e._s(e.journal.content))]),n("span",{attrs:{slot:"datetime"},slot:"datetime"},[e._v(e._s(e._f("moment")(e.journal.createTime)))])],1)],1),n("a-divider"),n("a-col",{attrs:{span:24}},e._l(e.comments,function(t,a){return n("journal-comment-tree",{key:a,attrs:{comment:t},on:{reply:e.handleCommentReplyClick,delete:e.handleCommentDelete}})}),1)],1)],1)],1)},o=[],i=(a("b745"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("a-comment",[a("span",{attrs:{slot:"actions"},on:{click:t.handleReplyClick},slot:"actions"},[t._v("回复")]),a("a-popconfirm",{attrs:{slot:"actions",title:"你确定要永久删除该评论?",okText:"确定",cancelText:"取消"},on:{confirm:t.handleDeleteClick},slot:"actions"},[a("span",[t._v("删除")])]),a("a",{attrs:{slot:"author"},slot:"author"},[t._v(" "+t._s(t.comment.author)+" ")]),a("a-avatar",{attrs:{slot:"avatar",src:t.avatar,alt:t.comment.author},slot:"avatar"}),a("p",{attrs:{slot:"content"},slot:"content"},[t._v(t._s(t.comment.content))]),t.comment.children?t._l(t.comment.children,function(e,n){return a("journal-comment-tree",{key:n,attrs:{comment:e},on:{reply:t.handleSubReply,delete:t.handleSubDelete}})}):t._e()],2)],1)}),s=[],r={name:"JournalCommentTree",props:{comment:{type:Object,required:!1,default:null}},computed:{avatar:function(){return"//cn.gravatar.com/avatar/".concat(this.comment.gravatarMd5,"/?s=256&d=mp")}},methods:{handleReplyClick:function(){this.$emit("reply",this.comment)},handleSubReply:function(t){this.$emit("reply",t)},handleDeleteClick:function(){this.$emit("delete",this.comment)},handleSubDelete:function(t){this.$emit("delete",t)}}},l=r,c=a("17cc"),m=Object(c["a"])(l,i,s,!1,null,null,null),u=m.exports,d=a("ac0d"),p=a("d8fc"),h=a("9efd"),f="/api/admin/journals/comments",v={create:function(t){return Object(h["a"])({url:f,data:t,method:"post"})},delete:function(t){return Object(h["a"])({url:"".concat(f,"/").concat(t),method:"delete"})}},y=v,g=a("c24f"),b={mixins:[d["a"],d["b"]],components:{JournalCommentTree:u},data:function(){return{title:"发表",listLoading:!1,visible:!1,commentVisiable:!1,selectCommentVisible:!1,pagination:{page:1,size:10,sort:null},queryParam:{page:0,size:10,sort:null,keyword:null},journals:[],comments:[],journal:{},selectComment:null,replyComment:{},user:{}}},created:function(){this.loadJournals(),this.loadUser()},methods:{loadJournals:function(t){var e=this;this.queryParam.page=this.pagination.page-1,this.queryParam.size=this.pagination.size,this.queryParam.sort=this.pagination.sort,t&&(this.queryParam.page=0),this.listLoading=!0,p["a"].query(this.queryParam).then(function(t){e.journals=t.data.data.content,e.pagination.total=t.data.data.total,e.listLoading=!1})},loadUser:function(){var t=this;g["a"].getProfile().then(function(e){t.user=e.data.data})},handleNew:function(){this.title="新建",this.visible=!0,this.journal={}},handleEdit:function(t){this.title="编辑",this.journal=t,this.visible=!0},handleDelete:function(t){var e=this;p["a"].delete(t).then(function(t){e.$message.success("删除成功!"),e.loadJournals()})},handleCommentShow:function(t){var e=this;this.journal=t,p["a"].commentTree(this.journal.id).then(function(t){e.comments=t.data.data.content,e.commentVisiable=!0})},handleCommentReplyClick:function(t){this.selectComment=t,this.selectCommentVisible=!0,this.replyComment.parentId=t.id,this.replyComment.postId=this.journal.id},handleReplyComment:function(){var t=this;y.create(this.replyComment).then(function(e){t.$message.success("回复成功!"),t.replyComment={},t.selectComment={},t.selectCommentVisible=!1,t.handleCommentShow(t.journal)})},handleCommentDelete:function(t){var e=this;y.delete(t.id).then(function(t){e.$message.success("删除成功!"),e.handleCommentShow(e.journal)})},createOrUpdateJournal:function(){var t=this;this.journal.id?p["a"].update(this.journal.id,this.journal).then(function(e){t.$message.success("更新成功!"),t.loadJournals()}):p["a"].create(this.journal).then(function(e){t.$message.success("发表成功!"),t.loadJournals()}),this.visible=!1},onPaginationChange:function(t,e){this.$log.debug("Current: ".concat(t,", PageSize: ").concat(e)),this.pagination.page=t,this.pagination.size=e,this.loadJournals()},resetParam:function(){this.queryParam.keyword=null,this.loadJournals()}}},C=b,_=Object(c["a"])(C,n,o,!1,null,null,null);e["default"]=_.exports},d8fc:function(t,e,a){"use strict";var n=a("9efd"),o="/api/admin/journals",i={query:function(t){return Object(n["a"])({url:o,params:t,method:"get"})},create:function(t){return Object(n["a"])({url:o,data:t,method:"post"})},update:function(t,e){return Object(n["a"])({url:"".concat(o,"/").concat(t),data:e,method:"put"})},delete:function(t){return Object(n["a"])({url:"".concat(o,"/").concat(t),method:"delete"})},commentTree:function(t){return Object(n["a"])({url:"".concat(o,"/").concat(t,"/comments/tree_view"),method:"get"})}};e["a"]=i}}]);