chunk-7a8911e6.da146884.js 4.3 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7a8911e6"],{2423:function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return r})),n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return s})),n.d(e,"e",(function(){return c}));var i=n("b775");function a(t){return Object(i["a"])({url:"/vue-element-admin/article/list",method:"get",params:t})}function r(t){return Object(i["a"])({url:"/vue-element-admin/article/detail",method:"get",params:{id:t}})}function l(t){return Object(i["a"])({url:"/vue-element-admin/article/pv",method:"get",params:{pv:t}})}function s(t){return Object(i["a"])({url:"/vue-element-admin/article/create",method:"post",data:t})}function c(t){return Object(i["a"])({url:"/vue-element-admin/article/update",method:"post",data:t})}},6151:function(t,e,n){},9968:function(t,e,n){"use strict";n.r(e);var i=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"}],staticStyle:{width:"100%"},attrs:{data:t.list,border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{align:"center",label:"ID",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[n("span",[t._v(t._s(i.id))])]}}])}),n("el-table-column",{attrs:{width:"180px",align:"center",label:"Date"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[n("span",[t._v(t._s(t._f("parseTime")(i.timestamp,"{y}-{m}-{d} {h}:{i}")))])]}}])}),n("el-table-column",{attrs:{width:"120px",align:"center",label:"Author"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[n("span",[t._v(t._s(i.author))])]}}])}),n("el-table-column",{attrs:{width:"100px",label:"Importance"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return t._l(+i.importance,(function(t){return n("svg-icon",{key:t,staticClass:"meta-item__icon",attrs:{"icon-class":"star"}})}))}}])}),n("el-table-column",{attrs:{"class-name":"status-col",label:"Status",width:"110"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[n("el-tag",{attrs:{type:t._f("statusFilter")(i.status)}},[t._v(" "+t._s(i.status)+" ")])]}}])}),n("el-table-column",{attrs:{"min-width":"300px",label:"Title"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[i.edit?[n("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:i.title,callback:function(e){t.$set(i,"title",e)},expression:"row.title"}}),n("el-button",{staticClass:"cancel-btn",attrs:{size:"small",icon:"el-icon-refresh",type:"warning"},on:{click:function(e){return t.cancelEdit(i)}}},[t._v(" cancel ")])]:n("span",[t._v(t._s(i.title))])]}}])}),n("el-table-column",{attrs:{align:"center",label:"Actions",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[i.edit?n("el-button",{attrs:{type:"success",size:"small",icon:"el-icon-circle-check-outline"},on:{click:function(e){return t.confirmEdit(i)}}},[t._v(" Ok ")]):n("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(t){i.edit=!i.edit}}},[t._v(" Edit ")])]}}])})],1)],1)},a=[],r=(n("d81d"),n("96cf"),n("1da1")),l=n("2423"),s={name:"InlineEditTable",filters:{statusFilter:function(t){var e={published:"success",draft:"info",deleted:"danger"};return e[t]}},data:function(){return{list:null,listLoading:!0,listQuery:{page:1,limit:10}}},created:function(){this.getList()},methods:{getList:function(){var t=this;return Object(r["a"])(regeneratorRuntime.mark((function e(){var n,i,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.listLoading=!0,e.next=3,Object(l["c"])(t.listQuery);case 3:n=e.sent,i=n.data,a=i.items,t.list=a.map((function(e){return t.$set(e,"edit",!1),e.originalTitle=e.title,e})),t.listLoading=!1;case 8:case"end":return e.stop()}}),e)})))()},cancelEdit:function(t){t.title=t.originalTitle,t.edit=!1,this.$message({message:"The title has been restored to the original value",type:"warning"})},confirmEdit:function(t){t.edit=!1,t.originalTitle=t.title,this.$message({message:"The title has been edited",type:"success"})}}},c=s,u=(n("ca89"),n("2877")),o=Object(u["a"])(c,i,a,!1,null,"15b0fc52",null);e["default"]=o.exports},ca89:function(t,e,n){"use strict";var i=n("6151"),a=n.n(i);a.a}}]);