text: webpackJsonp([5],{O5oG:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("m40h"),i={name:"addRecommend-list",mixins:[n("vsZy").a],data:function(){return{showDialog:!1,form:{name:""},formRule:{name:[{required:!0,message:"请输入分类名",trigger:"blur"}]},inputValue:""}},methods:{handelAdd:function(){this.form.name="",this.showDialog=!0},onSubmit:function(){var e=this;this.$refs.cateForm.validate(function(t){if(!t)return!1;Object(a.b)(e.form).then(function(t){e.$message({message:t.msg,type:"success"}),e._getData(),e.showDialog=!1})})},handleEdit:function(e,t){var n=this;Object(a.f)(t).then(function(e){n.$message({message:e.msg,type:"success"}),t.old_name=t.name,t.edit=!1})},handleCancel:function(e){e.edit=!1,e.name=e.old_name},handleDel:function(e,t){var n=this;this.$confirm("是否确定删除该分类","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(a.d)({id:t.id}).then(function(t){n.$message({message:"删除成功",type:"success"}),n.list.splice(e,1)})})},_getData:function(){var e=this;Object(a.g)().then(function(t){t.data.map(function(e){e.edit=!1,e.old_name=e.name}),e.list=t.data,e.table_loading=!1}).catch(function(t){e.table_loading=!0})}}},o={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("p",{staticClass:"page-title"},[e._v("推荐位置管理(请勿随意添加)")]),e._v(" "),n("div",{staticClass:"filter-container"},[n("el-button",{staticClass:"filter-item",attrs:{type:"primary",plain:""},on:{click:function(t){e.handelAdd()}}},[e._v("添加推荐位置")])],1),e._v(" "),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.table_loading,expression:"table_loading"}],attrs:{"element-loading-text":"加载中...",border:"",fit:"","highlight-current-row":"",data:e.list}},[n("el-table-column",{attrs:{label:"ID",prop:"id",align:"center",width:"60px"}}),e._v(" "),n("el-table-column",{attrs:{align:"center",label:"分类名"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.edit?n("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:t.row.name,callback:function(n){e.$set(t.row,"name",n)},expression:"scope.row.name"}}):n("span",[e._v(e._s(t.row.name))])]}}])}),e._v(" "),n("el-table-column",{attrs:{align:"center",label:"操作",width:"400px"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.edit?n("el-button",{attrs:{icon:"el-icon-refresh",size:"mini",type:"warning"},on:{click:function(n){e.handleCancel(t.row)}}},[e._v("取消\n                ")]):e._e(),e._v(" "),t.row.edit?n("el-button",{attrs:{icon:"el-icon-circle-check-outline",size:"mini",type:"success"},on:{click:function(n){e.handleEdit(t.$index,t.row)}}},[e._v("保存\n                ")]):n("el-button",{attrs:{size:"mini",type:"primary",icon:"el-icon-edit"},on:{click:function(e){t.row.edit=!t.row.edit}}},[e._v("编辑\n                ")]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"danger",icon:"el-icon-close"},on:{click:function(n){e.handleDel(t.$index,t.row)}}},[e._v("删除\n                ")])]}}])})],1),e._v(" "),n("el-dialog",{attrs:{visible:e.showDialog,title:"添加推荐位",width:"30%"},on:{"update:visible":function(t){e.showDialog=t}}},[n("el-form",{ref:"cateForm",attrs:{model:e.form,"status-icon":"","label-width":"100px",rules:e.formRule},nativeOn:{submit:function(e){e.preventDefault()}}},[n("el-form-item",{attrs:{label:"推荐位名",prop:"name"}},[n("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),e._v(" "),n("el-form-item",[n("div",{staticStyle:{float:"right"}},[n("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("提交")])],1)])],1)],1)],1)},staticRenderFns:[]};var c=n("VU/8")(i,o,!1,function(e){n("uCTT")},"data-v-769ac09a",null);t.default=c.exports},m40h:function(e,t,n){"use strict";t.g=function(){return Object(a.a)({url:"Recommend/index"})},t.b=function(e){return Object(a.a)({url:"Recommend/addRecommendList",method:"post",data:e})},t.f=function(e){return Object(a.a)({url:"Recommend/editRecommendList",method:"post",data:e})},t.d=function(e){return Object(a.a)({url:"Recommend/delRecommendList",method:"post",data:e})},t.h=function(e){return Object(a.a)({url:"Recommend/content",method:"get",params:e})},t.a=function(e){return Object(a.a)({url:"Recommend/addRecommendContent",method:"post",data:e})},t.e=function(e){return Object(a.a)({url:"Recommend/editRecommendContent",method:"post",data:e})},t.c=function(e){return Object(a.a)({url:"Recommend/delRecommendContent",method:"post",data:e})};var a=n("vLgD")},uCTT:function(e,t){}});