12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-62d5b74b"],{"129d":function(t,e,a){"use strict";a("a210")},"6ccb":function(t,e,a){"use strict";a("d351")},9973:function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-pagination",{attrs:{background:"","page-size":t.page_size?t.page_size:20,"current-page":t.current,"page-sizes":[10,20,30,40,50,60,70,80,90,100],layout:"total,sizes,prev, pager, next",total:t.total},on:{"current-change":t.getData,"size-change":t.handleSizeChange}})},s=[],l={data:function(){return{page:1}},props:{total:"",page_size:"",current:""},methods:{getData:function(t){this.page=t,this.$emit("pageChange")},handleSizeChange:function(t){this.$emit("pageChange",t)}},created:function(){}},n=l,o=(a("129d"),a("5d22")),r=Object(o["a"])(n,i,s,!1,null,null,null);e["a"]=r.exports},"9f0f":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("section",[t._m(0),a("div",{staticClass:"content"},[a("div",{staticClass:"filter"},[a("el-form",{attrs:{size:"small","label-width":"70px",inline:!0,"label-position":"left"}},[a("el-form-item",{attrs:{label:""}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入Banner图标题"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.search}},[t._v("搜索")])],1),a("el-form-item",{staticStyle:{float:"right"}},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dialogVisible=!0,t.dialogTitle="新增Banner图"}}},[t._v("新增Banner图")])],1)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"table",staticStyle:{width:"100%"},attrs:{data:t.list,height:"50vh",border:"","default-expand-all":"","row-key":"id"}},[a("el-table-column",{attrs:{prop:"name",label:"Banner标题"}}),a("el-table-column",{attrs:{label:"Banner图"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("img",{attrs:{src:t.row.img,alt:"",width:"220",height:"80"}})]}}])}),a("el-table-column",{attrs:{prop:"is_active",label:"是否开启"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{model:{value:e.row.is_active,callback:function(a){t.$set(e.row,"is_active",a)},expression:"scope.row.is_active"}})]}}])}),a("el-table-column",{attrs:{prop:"is_active",label:"是否跳转"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{model:{value:e.row.is_jump,callback:function(a){t.$set(e.row,"is_jump",a)},expression:"scope.row.is_jump"}})]}}])}),a("el-table-column",{attrs:{prop:"url",label:"跳转链接"}}),a("el-table-column",{attrs:{prop:"zip",width:"150",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{staticClass:"edit",attrs:{type:"text"},on:{click:function(a){return t.edit(e.row.id)}}},[t._v("编辑")]),a("el-button",{staticClass:"del",attrs:{type:"text"},on:{click:function(a){return t.del(e.row.id)}}},[t._v("删除")])]}}])})],1),a("Page",{ref:"pageButton",attrs:{current:t.form.page,page_size:t.form.page_size,total:t.total},on:{pageChange:t.gopage}})],1),a("el-dialog",{attrs:{title:t.dialogTitle,"close-on-click-modal":!1,visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-form",{staticClass:"preview",attrs:{size:"small",inline:!1,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"Banner标题"}},[a("el-input",{model:{value:t.form1.name,callback:function(e){t.$set(t.form1,"name",e)},expression:"form1.name"}})],1),a("el-form-item",{attrs:{label:"封面图:"}},[a("el-upload",{staticClass:"avatar-uploader",attrs:{action:"/api/admin/uploadfile","show-file-list":!1,"on-success":t.handleAvatarSuccess}},[t.form1.img?a("img",{staticClass:"avatar",attrs:{src:t.form1.img}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),a("span",{staticStyle:{"font-size":"12px",color:"#999999"}},[t._v("建议图片尺寸为:210*160")])],1),a("el-form-item",{attrs:{label:"是否开启"}},[a("el-radio",{attrs:{label:1},model:{value:t.form1.is_active,callback:function(e){t.$set(t.form1,"is_active",e)},expression:"form1.is_active"}},[t._v("是")]),a("el-radio",{attrs:{label:0},model:{value:t.form1.is_active,callback:function(e){t.$set(t.form1,"is_active",e)},expression:"form1.is_active"}},[t._v("否")])],1),a("el-form-item",{attrs:{label:"是否跳转"}},[a("el-radio",{attrs:{label:1},model:{value:t.form1.is_jump,callback:function(e){t.$set(t.form1,"is_jump",e)},expression:"form1.is_jump"}},[t._v("是")]),a("el-radio",{attrs:{label:0},model:{value:t.form1.is_jump,callback:function(e){t.$set(t.form1,"is_jump",e)},expression:"form1.is_jump"}},[t._v("否")])],1),a("el-form-item",{attrs:{label:"跳转地址"}},[a("el-input",{attrs:{placeholder:"请输入跳转地址"},model:{value:t.form1.url,callback:function(e){t.$set(t.form1,"url",e)},expression:"form1.url"}})],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.save}},[t._v("确 定")])],1)],1)],1)},s=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[a("span",[t._v("系统管理>")]),t._v("Banner图管理")])}],l=a("9973"),n={components:{Page:l["a"]},data:function(){return{form:{name:"",page:1,page_size:20},form1:{is_active:1,is_jump:0,img:""},total:1,list:[{name:"2333"}],loading:!1,input:"",dialogVisible:!1,dialogTitle:"",defaultProps:{},data:[],selected:[]}},methods:{handleAvatarSuccess:function(t,e){this.form1.img=e.response.data,this.$set(this.form1,"img",e.response.data)},search:function(){this.form;this.getData()},getData:function(){var t=this,e=this.form;this.loading=!0,this.$api.getBannersList(e).then((function(e){var a=e.data.data.list;t.list=a,t.total=e.data.data.total,t.loading=!1}))},gopage:function(t){t&&(this.form.page_size=t),this.form.page=this.$refs.pageButton.page,this.getData()},edit:function(t){var e=this;this.$api.getBanners({id:t}).then((function(t){e.form1=t.data.data,e.dialogVisible=!0}))},del:function(t){var e=this;this.$confirm("确定删除吗","提示",{type:"warning"}).then((function(){e.$api.delBanners({id:t}).then((function(t){e.$message({message:"删除成功",type:"success"}),e.getData()}))}))},save:function(){var t=this,e=this.form1;e.id?this.$api.updateBanners(e).then((function(e){0==e.data.code?(t.$message({type:"success",message:"保存成功!"}),t.getData()):t.$message.error("失败!")})):this.$api.addBanners(e).then((function(e){0==e.data.code?(t.$message({type:"success",message:"保存成功!"}),t.getData()):t.$message.error("失败!")})),this.dialogVisible=!1}},created:function(){this.getData()}},o=n,r=(a("6ccb"),a("5d22")),c=Object(r["a"])(o,i,s,!1,null,"31df3ce9",null);e["default"]=c.exports},a210:function(t,e,a){},d351:function(t,e,a){}}]);
- //# sourceMappingURL=chunk-62d5b74b.ea891e47.js.map
|