text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-42cfb197"],{"16d8":function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{attrs:{id:"main"}},[i("mavon-editor",{on:{change:t.contentChange},model:{value:t.md,callback:function(e){t.md=e},expression:"md"}})],1)},o=[],a=i("b2d8"),r=i.n(a),s=(i("64e1"),{name:"MarkdownEditor",components:{"mavon-editor":r.a.mavonEditor},props:{value:{type:String,default:""}},data:function(){return{md:this.value}},computed:{},watch:{value:function(t,e){this.md=t}},methods:{contentChange:function(t,e){this.$emit("input",t),this.$emit("content_generate",e)}}}),l=s,c=i("2877"),u=Object(c["a"])(l,n,o,!1,null,null,null);e["a"]=u.exports},"1bc4":function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-button",{staticClass:"filter-item float-right",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:t.handleCreate}},[t._v(" Add ")])],1),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.list,border:"",fit:"","highlight-current-row":""}},[i("el-table-column",{attrs:{type:"index",align:"center",label:"ID",width:"80"}}),i("el-table-column",{attrs:{width:"180px",align:"center",label:"Date"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("span",[t._v(t._s(t._f("parseTime")(e.row.create_at,"{y}-{m}-{d} {h}:{i}")))])]}}])}),i("el-table-column",{attrs:{"class-name":"status-col",label:"类别"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[t._v(" "+t._s(i.name)+" ")]}}])}),i("el-table-column",{attrs:{align:"center",label:"Actions"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(e){return t.editCategory(n)}}},[t._v(" Edit ")]),i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-delete"},on:{click:function(e){return t.deleteCategory(n)}}},[t._v(" Delete ")])]}}])})],1),i("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total > 0"}],attrs:{total:t.total,page:t.listQuery.page,limit:t.listQuery.limit},on:{"update:page":function(e){return t.$set(t.listQuery,"page",e)},"update:limit":function(e){return t.$set(t.listQuery,"limit",e)},pagination:t.getList}}),i("category-form",{attrs:{dialogFormVisible:t.dialogFormVisible,postForm:t.postForm,"is-edit":!1},on:{close:t.closeDialog,ok:t.ok}})],1)},o=[],a=i("c405"),r=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"createPost-container"},[i("el-dialog",{attrs:{title:"Shipping address",visible:t.dialogFormVisible},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[i("el-form",{attrs:{model:t.postForm}},[i("el-form-item",{attrs:{label:"Promotion name","label-width":t.formLabelWidth}},[i("el-input",{attrs:{autocomplete:"off"},model:{value:t.postForm.name,callback:function(e){t.$set(t.postForm,"name",e)},expression:"postForm.name"}})],1)],1),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:t.closeForm}},[t._v("Cancel")]),i("el-button",{attrs:{type:"primary"},on:{click:t.ok}},[t._v("Confirm")])],1)],1)],1)},s=[],l=(i("d81d"),i("16d8")),c=i("b804"),u=i("61f7"),d=i("2423"),p=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dropdown",{attrs:{"show-timeout":100,trigger:"click"}},[i("el-button",{attrs:{plain:""}},[t._v(" "+t._s(t.comment_disabled?"Comment: closed":"Comment: opened")+" "),i("i",{staticClass:"el-icon-caret-bottom el-icon--right"})]),i("el-dropdown-menu",{staticClass:"no-padding",attrs:{slot:"dropdown"},slot:"dropdown"},[i("el-dropdown-item",[i("el-radio-group",{staticStyle:{padding:"10px"},model:{value:t.comment_disabled,callback:function(e){t.comment_disabled=e},expression:"comment_disabled"}},[i("el-radio",{attrs:{label:!0}},[t._v(" Close comment ")]),i("el-radio",{attrs:{label:!1}},[t._v(" Open comment ")])],1)],1)],1)],1)},m=[],f={props:{value:{type:Boolean,default:!1}},computed:{comment_disabled:{get:function(){return this.value},set:function(t){this.$emit("input",t)}}}},h=f,g=i("2877"),b=Object(g["a"])(h,p,m,!1,null,null,null),v=(b.exports,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dropdown",{attrs:{"hide-on-click":!1,"show-timeout":100,trigger:"click"}},[i("el-button",{attrs:{plain:""}},[t._v(" Platfroms("+t._s(t.platforms.length)+") "),i("i",{staticClass:"el-icon-caret-bottom el-icon--right"})]),i("el-dropdown-menu",{staticClass:"no-border",attrs:{slot:"dropdown"},slot:"dropdown"},[i("el-checkbox-group",{staticStyle:{padding:"5px 15px"},model:{value:t.platforms,callback:function(e){t.platforms=e},expression:"platforms"}},t._l(t.platformsOptions,(function(e){return i("el-checkbox",{key:e.key,attrs:{label:e.key}},[t._v(" "+t._s(e.name)+" ")])})),1)],1)],1)}),y=[],w={props:{value:{required:!0,default:function(){return[]},type:Array}},data:function(){return{platformsOptions:[{key:"a-platform",name:"a-platform"},{key:"b-platform",name:"b-platform"},{key:"c-platform",name:"c-platform"}]}},computed:{platforms:{get:function(){return this.value},set:function(t){this.$emit("input",t)}}}},_=w,k=Object(g["a"])(_,v,y,!1,null,null,null),F=k.exports,S=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dropdown",{attrs:{"show-timeout":100,trigger:"click"}},[i("el-button",{attrs:{plain:""}},[t._v(" Link "),i("i",{staticClass:"el-icon-caret-bottom el-icon--right"})]),i("el-dropdown-menu",{staticClass:"no-padding no-border",staticStyle:{width:"400px"},attrs:{slot:"dropdown"},slot:"dropdown"},[i("el-form-item",{staticStyle:{"margin-bottom":"0px"},attrs:{"label-width":"0px",prop:"source_uri"}},[i("el-input",{attrs:{placeholder:"Please enter the content"},model:{value:t.source_uri,callback:function(e){t.source_uri=e},expression:"source_uri"}},[i("template",{slot:"prepend"},[t._v(" URL ")])],2)],1)],1)],1)},x=[],C={props:{value:{type:String,default:""}},computed:{source_uri:{get:function(){return this.value},set:function(t){this.$emit("input",t)}}}},$=C,O=Object(g["a"])($,S,x,!1,null,null,null),z=O.exports,j={components:{MarkdownEditor:l["a"],Sticky:c["a"],PlatformDropdown:F,SourceUrlDropdown:z},props:{dialogFormVisible:{type:Boolean,default:!1},isEdit:{type:Boolean,default:!1},postForm:{type:Object}},data:function(){var t=this,e=function(e,i,n){""===i?(t.$message({message:e.field+"为必传项",type:"error"}),n(new Error(e.field+"为必传项"))):n()},i=function(e,i,n){i?Object(u["d"])(i)?n():(t.$message({message:"外链url填写不正确",type:"error"}),n(new Error("外链url填写不正确"))):n()};return{loading:!1,categoryListOptions:[],rules:{image_uri:[{validator:e}],title:[{validator:e}],content_md:[{validator:e}],source_uri:[{validator:i,trigger:"blur"}]},tempRoute:{},formLabelWidth:"50"}},computed:{contentShortLength:function(){return this.postForm.content_short.length},displayTime:{get:function(){return+new Date(this.postForm.display_time)},set:function(t){this.postForm.display_time=new Date(t)}}},created:function(){if(this.isEdit){var t=this.$route.params&&this.$route.params.id;this.fetchData(t)}this.getRemoteCategory(),this.tempRoute=Object.assign({},this.$route)},methods:{fetchData:function(t){var e=this;Object(d["b"])(t).then((function(t){e.postForm=t.data,e.postForm.title,e.postForm.category=t.data.category.id,e.setTagsViewTitle(),e.setPageTitle()})).catch((function(t){console.log(t)}))},setTagsViewTitle:function(){var t="Edit Article",e=Object.assign({},this.tempRoute,{title:"".concat(t)});this.$store.dispatch("tagsView/updateVisitedView",e)},setPageTitle:function(){var t="Edit Article";document.title="".concat(t)},submitForm:function(){var t=this;this.$refs.postForm.validate((function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,t.postForm.status="published",Object(d["a"])(t.postForm).then((function(e){t.$notify({title:"成功",message:"发布文章成功",type:"success",duration:2e3}),t.$router.push("/article/list")}),(function(t){})),t.loading=!1}))},draftForm:function(){0!==this.postForm.content_md.length&&0!==this.postForm.title.length?(this.$message({message:"保存成功",type:"success",showClose:!0,duration:1e3}),this.postForm.status="draft",Object(d["a"])(this.postForm).then((function(t){console.log(t)}),(function(t){}))):this.$message({message:"请填写必要的标题和内容",type:"warning"})},getRemoteCategory:function(t){var e=this;Object(a["b"])(t).then((function(t){t.results&&(e.categoryListOptions=t.results.map((function(t){return t})))}))},content_generate:function(t){this.postForm.content=t,console.log(this.postForm)},closeForm:function(){this.$emit("close")},ok:function(){this.$emit("ok")}}},E=j,L=(i("ac40"),Object(g["a"])(E,r,s,!1,null,"d49ca5d0",null)),T=L.exports,R=i("333d"),P={components:{Pagination:R["a"],CategoryForm:T},filters:{statusFilter:function(t){var e={published:"success",draft:"info",deleted:"danger"};return e[t]}},data:function(){return{list:null,dialogFormVisible:!1,total:0,listLoading:!0,listQuery:{page:1,limit:10},postForm:{id:void 0,name:""}}},mounted:function(){},created:function(){this.getList()},methods:{getList:function(){var t=this;this.listLoading=!0,Object(a["b"])(this.listQuery).then((function(e){t.list=e.data.results,t.total=e.paginate?e.paginate.total:0,t.listLoading=!1}))},handleCreate:function(){this.dialogFormVisible=!0},closeDialog:function(){this.dialogFormVisible=!1},editCategory:function(t){console.log("======="),this.postForm=t,this.dialogFormVisible=!0},ok:function(){var t=this;this.dialogFormVisible=!1,Object(a["a"])(this.postForm).then((function(e){t.listLoading=!1,t.getList()}),(function(t){}))}}},V=P,D=(i("5ba3"),Object(g["a"])(V,n,o,!1,null,"3efeeea8",null));e["default"]=D.exports},"1c18":function(t,e,i){},2423:function(t,e,i){"use strict";i.d(e,"c",(function(){return o})),i.d(e,"b",(function(){return a})),i.d(e,"a",(function(){return r}));var n=i("b775");function o(t){return Object(n["a"])({url:"/article",method:"get",params:t})}function a(t){return Object(n["a"])({url:"/article/".concat(t),method:"get"})}function r(t){return Object(n["a"])({url:"/article",method:"post",data:t})}},"333d":function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[i("el-pagination",t._b({attrs:{background:t.background,"current-page":t.currentPage,"page-size":t.pageSize,layout:t.layout,"page-sizes":t.pageSizes,total:t.total},on:{"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.pageSize=e},"update:page-size":function(e){t.pageSize=e},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}},"el-pagination",t.$attrs,!1))],1)},o=[];i("a9e3");Math.easeInOutQuad=function(t,e,i,n){return t/=n/2,t<1?i/2*t*t+e:(t--,-i/2*(t*(t-2)-1)+e)};var a=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function r(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function l(t,e,i){var n=s(),o=t-n,l=20,c=0;e="undefined"===typeof e?500:e;var u=function t(){c+=l;var s=Math.easeInOutQuad(c,n,o,e);r(s),c<e?a(t):i&&"function"===typeof i&&i()};u()}var c={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[10,20,30,50]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(t){this.$emit("update:page",t)}},pageSize:{get:function(){return this.limit},set:function(t){this.$emit("update:limit",t)}}},methods:{handleSizeChange:function(t){this.$emit("pagination",{page:this.currentPage,limit:t}),this.autoScroll&&l(0,800)},handleCurrentChange:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&l(0,800)}}},u=c,d=(i("e498"),i("2877")),p=Object(d["a"])(u,n,o,!1,null,"6af373ef",null);e["a"]=p.exports},"5ba3":function(t,e,i){"use strict";i("7d4f")},"696f":function(t,e,i){},"7d4f":function(t,e,i){},ac40:function(t,e,i){"use strict";i("696f")},b804:function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{style:{height:t.height+"px",zIndex:t.zIndex}},[i("div",{class:t.className,style:{top:t.isSticky?t.stickyTop+"px":"",zIndex:t.zIndex,position:t.position,width:t.width,height:t.height+"px"}},[t._t("default",[i("div",[t._v("sticky")])])],2)])},o=[],a=(i("a9e3"),{name:"Sticky",props:{stickyTop:{type:Number,default:0},zIndex:{type:Number,default:1},className:{type:String,default:""}},data:function(){return{active:!1,position:"",width:void 0,height:void 0,isSticky:!1}},mounted:function(){this.height=this.$el.getBoundingClientRect().height,window.addEventListener("scroll",this.handleScroll),window.addEventListener("resize",this.handleResize)},activated:function(){this.handleScroll()},destroyed:function(){window.removeEventListener("scroll",this.handleScroll),window.removeEventListener("resize",this.handleResize)},methods:{sticky:function(){this.active||(this.position="fixed",this.active=!0,this.width=this.width+"px",this.isSticky=!0)},handleReset:function(){this.active&&this.reset()},reset:function(){this.position="",this.width="auto",this.active=!1,this.isSticky=!1},handleScroll:function(){var t=this.$el.getBoundingClientRect().width;this.width=t||"auto";var e=this.$el.getBoundingClientRect().top;e<this.stickyTop?this.sticky():this.handleReset()},handleResize:function(){this.isSticky&&(this.width=this.$el.getBoundingClientRect().width+"px")}}}),r=a,s=i("2877"),l=Object(s["a"])(r,n,o,!1,null,null,null);e["a"]=l.exports},c405:function(t,e,i){"use strict";i.d(e,"b",(function(){return o})),i.d(e,"a",(function(){return a}));var n=i("b775");function o(t){return Object(n["a"])({url:"/category",method:"get",params:t})}function a(t){return Object(n["a"])({url:"/category",method:"post",data:t})}},e498:function(t,e,i){"use strict";i("1c18")}}]);