aeca3ff.js 3.2 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[63],{745:function(t,e,r){"use strict";r.r(e);var n=r(7),o=(r(40),{data:function(){return{list:[]}},mounted:function(){this.getList()},methods:{getList:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$post("/api/admin/nav/list");case 2:(r=e.sent)&&1===r.status&&(t.list=r.data.list||[]);case 4:case"end":return e.stop()}}),e)})))()},del:function(t){var e=this;return Object(n.a)(regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.$post("/api/admin/nav/del",{id:t});case 2:(n=r.sent)&&1===n.status&&(e.$message({type:"success",message:"操作成功!"}),e.getList());case 4:case"end":return r.stop()}}),r)})))()},status:function(t,e){var r=this;return Object(n.a)(regeneratorRuntime.mark((function n(){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,r.$post("/api/admin/nav/status",{status:e,id:t});case 2:(o=n.sent)&&1===o.status&&(r.$message({type:"success",message:"操作成功!"}),r.getList());case 4:case"end":return n.stop()}}),n)})))()},add:function(){return Object(n.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))()}}}),c=r(4),component=Object(c.a)(o,(function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",[e("el-button",{staticStyle:{"margin-top":"15px","margin-right":"30px",float:"left"},attrs:{type:"primary"},on:{click:function(e){return t.$router.push({path:"/main/nav_add",query:{id:0}})}}},[t._v("添加二级页")]),t._v(" "),e("div",{staticStyle:{clear:"both"}}),t._v(" "),e("div",{staticStyle:{"margin-bottom":"15px"}}),t._v(" "),e("div",[e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.list,border:""}},[e("el-table-column",{attrs:{prop:"title",label:"标题"}}),t._v(" "),e("el-table-column",{attrs:{prop:"order",label:"排序"}}),t._v(" "),e("el-table-column",{attrs:{prop:"status",label:"状态"},scopedSlots:t._u([{key:"default",fn:function(r){return[1==r.row.status?e("span",[t._v("已启用")]):t._e(),t._v(" "),2==r.row.status?e("span",{staticStyle:{color:"red"}},[t._v("已禁用")]):t._e()]}}])}),t._v(" "),e("el-table-column",{attrs:{prop:"addtime",label:"添加时间"}}),t._v(" "),e("el-table-column",{attrs:{prop:"ctrontorl",label:"操作",width:"320px"},scopedSlots:t._u([{key:"default",fn:function(r){return[e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.del(r.row.id)}}},[t._v("删除")]),t._v(" "),e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.$router.push({path:"/main/nav_add",query:{id:r.row.id}})}}},[t._v("编辑")]),t._v(" "),1==r.row.status?e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.status(r.row.id,r.row.status)}}},[t._v("下架")]):t._e(),t._v(" "),2==r.row.status?e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.status(r.row.id,r.row.status)}}},[t._v("上架")]):t._e()]}}])})],1)],1)],1)}),[],!1,null,null,null);e.default=component.exports}}]);