mirror of https://github.com/go-sonic/sonic.git
You cannot 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 line
9.7 KiB
JavaScript
1 line
9.7 KiB
JavaScript
2 years ago
|
"use strict";(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[756],{58137:function(e,t,n){n.d(t,{Z:function(){return m}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-modal",{attrs:{destroyOnClose:"",title:"评论回复"},on:{close:e.onClose},scopedSlots:e._u([{key:"footer",fn:function(){return[n("ReactiveButton",{attrs:{errored:e.submitErrored,loading:e.submitting,erroredText:"回复失败",loadedText:"回复成功",text:"回复",type:"primary"},on:{callback:e.handleSubmitCallback,click:e.handleSubmit}})]},proxy:!0}]),model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[n("a-form-model",{ref:"replyCommentForm",attrs:{model:e.model,rules:e.rules,layout:"vertical"}},[n("a-form-model-item",{attrs:{prop:"content"}},[n("a-input",{ref:"contentInput",attrs:{autoSize:{minRows:8},type:"textarea"},model:{value:e.model.content,callback:function(t){e.$set(e.model,"content",t)},expression:"model.content"}})],1)],1)],1)},r=[],o=n(54288),i=(n(70315),n(12566),n(36591)),l={name:"CommentReplyModal",props:{visible:{type:Boolean,default:!0},comment:{type:Object,default:null},targetId:{type:Number,default:0},target:{type:String,required:!0,validator:function(e){return-1!==["post","sheet","journal"].indexOf(e)}}},data:function(){return{model:{},submitting:!1,submitErrored:!1,rules:{content:[{required:!0,message:"* 内容不能为空",trigger:["change"]}]}}},computed:{modalVisible:{get:function(){return this.visible},set:function(e){this.$emit("update:visible",e)}}},watch:{modalVisible:function(e){var t=this;e&&this.$nextTick((function(){t.$refs.contentInput.focus()}))}},methods:{handleSubmit:function(){var e=this;e.$refs.replyCommentForm.validate(function(){var t=(0,o.Z)(regeneratorRuntime.mark((function t(n){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=15;break}return t.prev=1,e.submitting=!0,e.model.postId=e.targetId,e.comment&&(e.model.parentId=e.comment.id),t.next=7,i.Z.comment.create("".concat(e.target,"s"),e.model);case 7:t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](1),e.submitErrored=!0;case 12:return t.prev=12,setTimeout((function(){e.submitting=!1}),400),t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[1,9,12,15]])})));return function(e){return t.apply(this,arguments)}}())},handleSubmitCallback:function(){this.submitErrored?this.submitErrored=!1:(this.model={},this.modalVisible=!1,this.$emit("succeed"))},onClose:function(){this.model={},this.modalVisible=!1}}},s=l,c=n(70739),u=(0,c.Z)(s,a,r,!1,null,null,null),m=u.exports},2756:function(e,t,n){n.d(t,{Z:function(){return b}});var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-modal",{attrs:{afterClose:e.onClose,title:e.title,width:1024,destroyOnClose:""},scopedSlots:e._u([{key:"footer",fn:function(){return[e._t("extraFooter"),n("a-button",{attrs:{type:"primary"},on:{click:function(t){e.replyModalVisible=!0}}},[e._v("创建评论")]),n("a-button",{on:{click:function(t){e.modalVisible=!1}}},[e._v("关闭")])]},proxy:!0}],null,!0),model:{value:e.modalVisible,callback:function(t){e.modalVisible=t},expression:"modalVisible"}},[n("a-list",{attrs:{loading:e.list.loading,"item-layout":"vertical"}},e._l(e.list.data,(function(t,a){return n("TargetCommentTreeNode",{key:a,attrs:{comment:t,target:e.target,"target-id":e.targetId},on:{reload:e.handleGetComments}})})),1),n("div",{staticClass:"page-wrapper"},[n("a-pagination",{staticClass:"pagination",attrs:{current:e.pagination.page,defaultPageSize:e.pagination.size,pageSizeOptions:["10","20","50","100"],total:e.pagination.total,showLessItems:"",showSizeChanger:""},on:{change:e.handlePageChange,showSizeChange:e.handlePageSizeChange}})],1),n("CommentReplyModal",{attrs:{target:e.target,"target-id":e.targetId,visible:e.replyModalVisible},on:{"update:visible":function(t){e.replyModalVisible=t},succeed:e.handleGetComments}})],1)},r=[],o=n(54288),i=(n(70315),n(12566),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-list-item",{staticClass:"!p-0"},[n("a-
|