chunk-a433791c.6468d9a8.js 5.6 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a433791c"],{be10: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:"content"},[n("div",{staticClass:"search_box flexS"},[n("el-select",{attrs:{placeholder:"轮播图状态"},on:{change:function(e){return t.list()}},model:{value:t.listQuery.status,callback:function(e){t.$set(t.listQuery,"status",e)},expression:"listQuery.status"}},t._l(t.statusOption,(function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),t._v(" "),n("el-button",{staticStyle:{"margin-left":"15px"},attrs:{type:"primary"},on:{click:function(e){return t.editBanner(0)}}},[t._v("添加")])],1),t._v(" "),n("div",{directives:[{name:"loading",rawName:"v-loading.fullscreen.lock",value:t.loadingFull,expression:"loadingFull",modifiers:{fullscreen:!0,lock:!0}}]}),t._v(" "),n("div",{staticClass:"table_box"},[n("el-table",{staticClass:"tableBorder",attrs:{data:t.tableList,"header-cell-style":{background:"#f8fbfc"},border:"",stripe:""}},[n("el-table-column",{attrs:{prop:"sort",label:"排序",align:"center",width:"80px"}}),t._v(" "),n("el-table-column",{attrs:{prop:"title",label:"标题",align:"center"}}),t._v(" "),n("el-table-column",{attrs:{label:"轮播图",align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){var e=t.row;return[n("el-image",{attrs:{src:e.img,"preview-src-list":[e.img]}})]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"轮播图状态",align:"center",width:"100px"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("el-tag",{attrs:{type:0===a.status?"info":"success"}},[t._v(t._s(0===a.status?"隐藏":"显示"))])]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("el-button",{attrs:{type:"text"},on:{click:function(e){return t.handleOpera(a.status,a.id)}}},[t._v(t._s(0===a.status?"显示":"隐藏"))]),t._v(" "),n("el-button",{attrs:{type:"text"},on:{click:function(e){return t.editBanner(1,a.id)}}},[t._v("编辑")]),t._v(" "),n("el-button",{attrs:{type:"text"},on:{click:function(e){return t.handleDel(a.id)}}},[t._v("删除")])]}}])})],1)],1),t._v(" "),n("pagination",{attrs:{total:t.tableTotal,limit:t.listQuery.page_size,page:t.listQuery.page_index},on:{pagination:t.changePagination,"update:limit":t.changePagination}})],1)},r=[],i=n("c7eb"),s=(n("96cf"),n("1da1")),l=n("dd48"),u={data:function(){return{loadingFull:!1,listQuery:{page_index:1,page_size:10,status:0},tableList:[],tableTotal:0,statusOption:[{value:0,label:"全部"},{value:1,label:"显示"},{value:2,label:"隐藏"}]}},created:function(){this.list()},methods:{list:function(){var t=Object(s["a"])(Object(i["a"])().mark((function t(){var e,n,a,r,s,u=this;return Object(i["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loadingFull=!0,e=this.listQuery,n=e.page_index,a=e.page_size,r=e.status,s="",s=0===r?"all":2===r?0:1,t.next=6,Object(l["f"])({page_index:n,page_size:a,status:s}).then((function(t){u.loadingFull=!1,200===t.code?(u.tableList=t.data.list,u.tableTotal=t.data.total):u.$message.error(t.message)})).catch((function(t){u.loadingFull=!1}));case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),editBanner:function(t,e){0===t?window.localStorage.removeItem("bannerId"):window.localStorage.setItem("bannerId",e),this.$router.push({name:"system_edit_banner"})},handleOpera:function(t,e){var n=this;this.$confirm("确定要".concat(0===t?"显示":"隐藏","当前轮播图吗?"),"确认提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){n.changeStatus(t,e)})).catch((function(){n.$message({type:"info",message:"已取消"})}))},changeStatus:function(t,e){var n=this;Object(l["b"])({id:e}).then((function(e){200===e.code?(n.$message.success("".concat(0===t?"显示":"隐藏","成功")),n.list()):n.$message.error(e.message)}))},handleDel:function(t){var e=this;this.$confirm("确定要删除当前轮播图吗?","删除确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.delBanner(t)})).catch((function(){e.$message({type:"info",message:"已取消删除"})}))},delBanner:function(t){var e=this;Object(l["c"])({id:t}).then((function(t){200===t.code?(e.$message.success("删除成功"),e.list()):e.$message.error(t.message||"删除失败")}))},changePagination:function(t){var e=t.page,n=t.limit;this.listQuery.page_size=n,this.listQuery.page_index=e,this.list()}}},c=u,o=(n("fbbb"),n("2877")),d=Object(o["a"])(c,a,r,!1,null,"7d310f1c",null);e["default"]=d.exports},dd48:function(t,e,n){"use strict";n.d(e,"f",(function(){return r})),n.d(e,"e",(function(){return i})),n.d(e,"g",(function(){return s})),n.d(e,"a",(function(){return l})),n.d(e,"d",(function(){return u})),n.d(e,"c",(function(){return c})),n.d(e,"b",(function(){return o}));var a=n("b775");function r(t){return Object(a["a"])({url:"/banner/getBannerList",method:"get",params:t})}function i(t){return Object(a["a"])({url:"/banner/getBannerDetail",method:"get",params:t})}function s(t){return Object(a["a"])({url:"/banner/uploadBannerImg",method:"post",data:t})}function l(t){return Object(a["a"])({url:"/banner/addBanner",method:"post",data:t})}function u(t){return Object(a["a"])({url:"/banner/editBanner",method:"post",data:t})}function c(t){return Object(a["a"])({url:"/banner/deleteBanner",method:"post",data:t})}function o(t){return Object(a["a"])({url:"/banner/changeStatus",method:"post",data:t})}},e0a0:function(t,e,n){},fbbb:function(t,e,n){"use strict";n("e0a0")}}]);