text: webpackJsonp([7],{"9aX8":function(e,t){},Cc6w:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o("vLgD"),l={plugslist:function(e,t){return i.a._post("/admin/plus.plus/index",e,t)},getplugs:function(e,t){return i.a._get("/admin/plus.plus/add",e,t)},addplugs:function(e,t){return i.a._post("/admin/plus.plus/add",e,t)},editplugs:function(e,t){return i.a._post("/admin/plus.plus/edit",e,t)},deleteplugs:function(e,t){return i.a._post("/admin/plus.plus/delete",e,t)},updatePlugsStatus:function(e,t){return i.a._post("/admin/plus.plus/updateStatus",e,t)},updatePlugsRecom:function(e,t){return i.a._post("/admin/plus.plus/updateRecom",e,t)}},a={data:function(){return{categoryList:[],formLabelWidth:"120px",dialogVisible:!1,loading:!1}},props:["open_edit","form"],created:function(){this.dialogVisible=this.open_edit,this.getCategoryList()},methods:{getCategoryList:function(){var e=this;l.plugslist({},!0).then(function(t){e.loading=!1,e.categoryList=t.data.accessList}).catch(function(e){})},editPlugs:function(){var e=this,t=this.form;e.$refs.form.validate(function(o){o&&(e.loading=!0,l.editplugs(t,!0).then(function(t){e.loading=!1,e.$message({message:"恭喜你，修改成功",type:"success"}),e.dialogFormVisible(!0)}).catch(function(e){}))})},dialogFormVisible:function(e){e?this.$emit("closeDialog",{type:"success",openDialog:!1}):this.$emit("closeDialog",{type:"error",openDialog:!1})}}},s={render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("el-dialog",{attrs:{title:"编辑插件",visible:e.dialogVisible,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){e.dialogVisible=t},close:e.dialogFormVisible}},[o("el-form",{ref:"form",attrs:{size:"small",model:e.form}},[o("el-form-item",{attrs:{label:"插件名称","label-width":e.formLabelWidth,rules:[{required:!0,message:" "}],prop:"plus_name"}},[o("el-input",{attrs:{autocomplete:"off",placeholder:"请输入插件名称"},model:{value:e.form.plus_name,callback:function(t){e.$set(e.form,"plus_name",t)},expression:"form.plus_name"}})],1),e._v(" "),o("el-form-item",{attrs:{label:"插件描述","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off",placeholder:"请输入插件描述"},model:{value:e.form.desc,callback:function(t){e.$set(e.form,"desc",t)},expression:"form.desc"}})],1),e._v(" "),o("el-form-item",{attrs:{label:"ico图标","label-width":e.formLabelWidth,rules:[{required:!0,message:" "}],prop:"ico"}},[o("el-input",{attrs:{autocomplete:"off",placeholder:"请输入图标名名称"},model:{value:e.form.ico,callback:function(t){e.$set(e.form,"ico",t)},expression:"form.ico"}})],1),e._v(" "),o("el-form-item",{attrs:{label:"插件分类","label-width":e.formLabelWidth}},[o("el-select",{attrs:{placeholder:"请选择分类"},model:{value:e.form.parent_id,callback:function(t){e.$set(e.form,"parent_id",t)},expression:"form.parent_id"}},[o("el-option",{attrs:{label:"顶级分类",value:0}}),e._v(" "),e._l(e.categoryList,function(e,t){return o("el-option",{key:t,attrs:{label:e.plus_name,value:e.plus_id}})})],2)],1),e._v(" "),o("el-form-item",{attrs:{label:"插件URL","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off",placeholder:"例如：index/index"},model:{value:e.form.url,callback:function(t){e.$set(e.form,"url",t)},expression:"form.url"}})],1),e._v(" "),o("el-form-item",{attrs:{label:"排序","label-width":e.formLabelWidth,rules:[{required:!0,message:" "}],prop:"sort"}},[o("el-input",{attrs:{placeholder:"请输入数字"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1)],1),e._v(" "),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:e.dialogFormVisible}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:e.editPlugs}},[e._v("确 定")])],1)],1)},staticRenderFns:[]};var n=o("VU/8")(a,s,!1,function(e){o("aTov")},null,null).exports,c={data:function(){return{form:{status:0,srot:1,plus_name:"",desc:"",ico:"",url:"index/index",sort:1},categoryList:[],srot:"1",radio:"1",formLabelWidth:"120px",dialogVisible:!1,loading:!0}},props:{open_add:Boolean,curModel:Object},created:function(){this.dialogVisible=this.open_add,this.getCategoryList()},methods:{getCategoryList:function(){var e=this,t={plus_category_id:e.curModel.plus_category_id};l.getplugs(t,!0).then(function(t){e.loading=!1,e.categoryList=t.data.accessList}).catch(function(t){e.loading=!1})},addClick:function(e){var t=this,o={access_id:e.access_id,plus_category_id:t.curModel.plus_category_id};l.addplugs(o,!0).then(function(e){t.loading=!1,1==e.code?(t.$message({message:"恭喜你，添加成功",type:"success"}),t.dialogFormVisible(!0)):(t.loading=!1,t.$message.error("错了哦，这是一条错误消息"))}).catch(function(e){t.loading=!1})},dialogFormVisible:function(e){e?this.$emit("closeDialog",{type:"success",openDialog:!1}):this.$emit("closeDialog",{type:"error",openDialog:!1})}}},r={render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("el-dialog",{attrs:{title:"添加插件",visible:e.dialogVisible,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){e.dialogVisible=t},close:e.dialogFormVisible}},[o("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{size:"small",data:e.categoryList,border:""}},[o("el-table-column",{attrs:{prop:"name",label:"名称"}}),e._v(" "),o("el-table-column",{attrs:{prop:"name",label:"操作",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-button",{attrs:{size:"small"},on:{click:function(o){return e.addClick(t.row)}}},[e._v("添加")])]}}])})],1)],1)},staticRenderFns:[]};var d=o("VU/8")(c,r,!1,function(e){o("9aX8")},null,null).exports,u={data:function(){return{form:{plus_name:""},formLabelWidth:"120px",dialogVisible:!1,loading:!1}},props:["open_type"],created:function(){this.dialogVisible=this.open_type},methods:{addClick:function(){var e=this,t=this.form;e.$refs.form.validate(function(o){o&&(e.loading=!0,l.addplugs(t,!0).then(function(t){e.loading=!1,1==t.code?(e.$message({message:"恭喜你，添加成功",type:"success"}),e.dialogFormVisible(!0)):(e.loading=!1,e.$message.error("错了哦，这是一条错误消息"))}).catch(function(t){e.loading=!1}))})},dialogFormVisible:function(e){e?this.$emit("closeDialog",{type:"success",openDialog:!1}):this.$emit("closeDialog",{type:"error",openDialog:!1})}}},p={render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("el-dialog",{attrs:{title:"添加类别",visible:e.dialogVisible,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){e.dialogVisible=t},close:e.dialogFormVisible}},[o("el-form",{ref:"form",attrs:{size:"small",model:e.form}},[o("el-form-item",{attrs:{label:"类别名称","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off",placeholder:"请输入类别名称"},model:{value:e.form.plus_name,callback:function(t){e.$set(e.form,"plus_name",t)},expression:"form.plus_name"}})],1)],1),e._v(" "),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:e.dialogFormVisible}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:function(t){return e.addClick()}}},[e._v("确 定")])],1)],1)},staticRenderFns:[]};var f=o("VU/8")(u,p,!1,function(e){o("kxOm")},null,null).exports,m=o("aFVK"),g={components:{Edit:n,Add:d,Type:f},data:function(){return{loading:!0,tableData:[],totalDataNumber:0,open_add:!1,open_edit:!1,open_type:!1,curModel:{}}},created:function(){this.getData()},methods:{getData:function(){var e=this;l.plugslist({},!0).then(function(t){e.loading=!1,e.tableData=t.data.accessList,e.totalDataNumber=t.data.list.total}).catch(function(t){e.loading=!1})},addType:function(){this.open_type=!0},statusChange:function(e,t){var o=this;o.loading=!0,l.updatePlugsStatus({plus_id:t.plus_id},!0).then(function(i){o.loading=!1,t.status=e}).catch(function(i){o.loading=!1,t.status=!e})},recomChange:function(e,t){var o=this;o.loading=!0,l.updatePlugsRecom({plus_id:t.plus_id},!0).then(function(i){o.loading=!1,t.is_recom=e,console.log(t)}).catch(function(i){o.loading=!1,t.is_recom=!e})},addClick:function(e){this.curModel=e,this.open_add=!0},editClick:function(e){this.userModel=Object(m.a)(e),this.open_edit=!0},closeDialogFunc:function(e,t){"type"==t&&(this.open_type=e.openDialog,"success"==e.type&&this.tableData.push({plus_name:"新类别"})),"add"==t&&(this.open_add=e.openDialog,"success"==e.type&&this.getData()),"edit"==t&&(this.open_edit=e.openDialog,"success"==e.type&&this.getData())},deleteClick:function(e){var t=this;t.$confirm("删除后不可恢复，确认删除该记录吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.loading=!0,l.deleteplugs({plus_id:e.access_id},!0).then(function(e){1==e.code&&(t.loading=!1,t.$message({message:e.msg,type:"success"}),t.getData())}).catch(function(e){t.loading=!1})}).catch(function(){})},hasIcon:function(e){return null!=e&&e.length>0?e:"icon-chajian1"}}},_={render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"plus-container"},[o("div",{staticClass:"common-level-rail"}),e._v(" "),e._l(e.tableData,function(t,i){return o("div",{key:i,staticClass:"mb16"},[o("div",{staticClass:"common-form d-s-c"},[o("span",[e._v(e._s(t.name))])]),e._v(" "),o("div",{staticClass:"plus-list"},[e._l(t.children,function(t,i){return o("div",{key:i,staticClass:"item"},[o("div",{staticClass:"item-box pr"},[o("a",{staticClass:"close-btn",attrs:{href:"javascript:void(0);"},on:{click:function(o){return e.deleteClick(t)}}},[o("i",{staticClass:"el-icon-error f20"})]),e._v(" "),o("a",[o("span",{staticClass:"iconfont icon",class:e.hasIcon(t.icon)}),e._v(" "),o("div",{staticClass:"ml10"},[o("h3",[e._v(e._s(t.name))]),e._v(" "),o("p",[e._v(e._s(t.remark))])])])])])}),e._v(" "),o("div",{staticClass:"item"},[o("div",{staticClass:"d-s-c mt10"},[o("div",{staticClass:"add-item-box d-c-c",on:{click:function(o){return e.addClick(t)}}},[o("i",{staticClass:"el-icon-plus"})]),e._v(" "),e._m(0,!0)])])],2)])}),e._v(" "),e.open_type?o("Type",{attrs:{open_type:e.open_type},on:{closeDialog:function(t){return e.closeDialogFunc(t,"type")}}}):e._e(),e._v(" "),e.open_add?o("Add",{attrs:{open_add:e.open_add,curModel:e.curModel},on:{closeDialog:function(t){return e.closeDialogFunc(t,"add")}}}):e._e(),e._v(" "),e.open_edit?o("Edit",{attrs:{open_edit:e.open_edit,curModel:e.curModel},on:{closeDialog:function(t){return e.closeDialogFunc(t,"edit")}}}):e._e()],2)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ml10"},[t("p",{staticClass:"f14 gray9"},[this._v("添加插件到此类别下")])])}]};var h=o("VU/8")(g,_,!1,function(e){o("Dt3X")},null,null);t.default=h.exports},Dt3X:function(e,t){},aTov:function(e,t){},kxOm:function(e,t){}});
  //# sourceMappingURL=7.e1e41922db58714c4ca4.js.map