text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a7ac0f66"],{"1eba":function(t,e,n){},2423:function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"d",(function(){return l}));var a=n("b775");function s(t){return Object(a["a"])({url:"/article/list",method:"get",params:t})}function r(t){return Object(a["a"])({url:"/article/pv",method:"get",params:{pv:t}})}function i(t){return Object(a["a"])({url:"/article/create",method:"post",data:t})}function l(t){return Object(a["a"])({url:"/article/update",method:"post",data:t})}},"74b3":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],ref:"dragTable",staticStyle:{width:"100%"},attrs:{data:t.list,"row-key":"id",border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{align:"center",label:"ID",width:"65"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("span",[t._v(t._s(a.id))])]}}])}),t._v(" "),n("el-table-column",{attrs:{width:"180px",align:"center",label:"Date"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("span",[t._v(t._s(t._f("parseTime")(a.timestamp,"{y}-{m}-{d} {h}:{i}")))])]}}])}),t._v(" "),n("el-table-column",{attrs:{"min-width":"300px",label:"Title"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("span",[t._v(t._s(a.title))])]}}])}),t._v(" "),n("el-table-column",{attrs:{width:"110px",align:"center",label:"Author"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("span",[t._v(t._s(a.author))])]}}])}),t._v(" "),n("el-table-column",{attrs:{width:"100px",label:"Importance"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return t._l(+a.importance,(function(t){return n("svg-icon",{key:t,staticClass:"icon-star",attrs:{"icon-class":"star"}})}))}}])}),t._v(" "),n("el-table-column",{attrs:{align:"center",label:"Readings",width:"95"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("span",[t._v(t._s(a.pageviews))])]}}])}),t._v(" "),n("el-table-column",{attrs:{"class-name":"status-col",label:"Status",width:"110"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("el-tag",{attrs:{type:t._f("statusFilter")(a.status)}},[t._v("\n          "+t._s(a.status)+"\n        ")])]}}])}),t._v(" "),n("el-table-column",{attrs:{align:"center",label:"Drag",width:"80"},scopedSlots:t._u([{key:"default",fn:function(t){return[n("svg-icon",{staticClass:"drag-handler",attrs:{"icon-class":"drag"}})]}}])})],1),t._v(" "),n("div",{staticClass:"show-d"},[n("el-tag",[t._v("The default order :")]),t._v(" "+t._s(t.oldList)+"\n  ")],1),t._v(" "),n("div",{staticClass:"show-d"},[n("el-tag",[t._v("The after dragging order :")]),t._v(" "+t._s(t.newList)+"\n  ")],1)],1)},s=[],r=(n("96cf"),n("3b8d")),i=n("2423"),l=n("53fe"),o=n.n(l),u={name:"DragTable",filters:{statusFilter:function(t){var e={published:"success",draft:"info",deleted:"danger"};return e[t]}},data:function(){return{list:null,total:null,listLoading:!0,listQuery:{page:1,limit:10},sortable:null,oldList:[],newList:[]}},created:function(){this.getList()},methods:{getList:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,a=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.listLoading=!0,t.next=3,Object(i["b"])(this.listQuery);case 3:e=t.sent,n=e.data,this.list=n.items,this.total=n.total,this.listLoading=!1,this.oldList=this.list.map((function(t){return t.id})),this.newList=this.oldList.slice(),this.$nextTick((function(){a.setSort()}));case 11:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),setSort:function(){var t=this,e=this.$refs.dragTable.$el.querySelectorAll(".el-table__body-wrapper > table > tbody")[0];this.sortable=o.a.create(e,{ghostClass:"sortable-ghost",setData:function(t){t.setData("Text","")},onEnd:function(e){var n=t.list.splice(e.oldIndex,1)[0];t.list.splice(e.newIndex,0,n);var a=t.newList.splice(e.oldIndex,1)[0];t.newList.splice(e.newIndex,0,a)}})}}},c=u,d=(n("775f"),n("8121"),n("2877")),f=Object(d["a"])(c,a,s,!1,null,"5a77e163",null);e["default"]=f.exports},"775f":function(t,e,n){"use strict";var a=n("edd0"),s=n.n(a);s.a},8121:function(t,e,n){"use strict";var a=n("1eba"),s=n.n(a);s.a},edd0:function(t,e,n){}}]);