text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-023c3c8c"],{5475:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData}},[e._l(e.tableLabel,(function(t,a){return n("div",{key:a},["iconURL"!==a?n("el-table-column",{key:a,attrs:{label:t,prop:a}}):e._e(),"iconURL"===a?n("el-table-column",{key:a,attrs:{label:t,prop:a},scopedSlots:e._u([{key:"default",fn:function(e){var t=e.row;return[n("img",{attrs:{src:t.iconURL}})]}}],null,!0)}):e._e()],1)})),e.isShow?n("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.$index,r=t.row;return[n("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.handleEdit(a,r)}}},[e._v("编辑")]),n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.handleDelete(a,r)}}},[e._v("删除")])]}}],null,!1,2224063575)}):e._e()],2)],1)},r=[],l={props:{tableLabel:{type:Object,default:function(){return{}}},tableData:{type:Array,default:function(){return{}}},isShow:{type:Boolean,default:!0}},data:function(){return{}},computed:{},methods:{handleEdit:function(e,t){this.$emit("edit",t)},handleDelete:function(e,t){this.$emit("delete",t)}}},c=l,i=n("2877"),u=Object(i["a"])(c,a,r,!1,null,"0fde963c",null);t["a"]=u.exports},"5f50":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("self-table",{attrs:{tableData:e.tableData,tableLabel:e.tableLabel},on:{delete:e.handleDelete,edit:e.handleEdit}})],1)},r=[],l=(n("d81d"),n("96cf"),n("1da1")),c=n("5475"),i={components:{selfTable:c["a"]},data:function(){return{tableData:[],tableLabel:{title:"文章标题",_id:"id",date:"发布时间"}}},mounted:function(){this.fetch()},methods:{fetch:function(){var e=this;return Object(l["a"])(regeneratorRuntime.mark((function t(){var n,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$http.get("/crud/articles/list");case 2:n=t.sent,a=n.data.data.map((function(t){return t.date=e.$dayjs(t.date).format("YYYY/MM/DD"),t})),e.tableData=a;case 5:case"end":return t.stop()}}),t)})))()},handleEdit:function(e){var t=e._id;this.$router.push("/articles/edit/".concat(t))},handleDelete:function(e){var t=this,n=e._id;this.$confirm("是否删除该文章?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(l["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$http.delete("/crud/articles/".concat(n));case 2:t.$message({type:"success",message:"删除成功!"}),t.fetch();case 4:case"end":return e.stop()}}),e)})))).catch((function(){t.$message({type:"info",message:"已取消删除"})}))}}},u=i,o=n("2877"),s=Object(o["a"])(u,a,r,!1,null,"26d6072f",null);t["default"]=s.exports}}]);
  //# sourceMappingURL=chunk-023c3c8c.d8d4f034.js.map