webpackJsonp([41],{"4TG+":function(t,i,s){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var e={render:function(){var t=this,i=t.$createElement,s=t._self._c||i;return s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"permission_big_div",attrs:{"element-loading-text":"拼命加载中","element-loading-spinner":"el-icon-loading"}},[s("div",{staticClass:"content"},[t._m(0),t._v(" "),s("table",{staticClass:"table"},[t._m(1),t._v(" "),t._l(t.routeList,function(i){return s("tr",{key:i.id},[s("td",[t._v(t._s(i.id))]),t._v(" "),s("td",[t._v(t._s(i.name))]),t._v(" "),s("td",[t._v(t._s(i.route))]),t._v(" "),s("td",[t._v(t._s(i.updated_at))]),t._v(" "),s("td",[t._v(t._s(i.auths&&i.auths.name?i.auths.name:""))]),t._v(" "),s("td",[s("button",{staticClass:"edit",on:{click:function(s){return t.editPermissionEvent({id:i.id,auth_id:i.auths&&i.auths.id?i.auths.id:"",parent_id:i.auths&&i.auths.parent_id?i.auths.parent_id:""})}}},[t._v("编辑")])])])})],2),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],staticClass:"bottom pagingBottom"},[s("span",{directives:[{name:"show",rawName:"v-show",value:t.total,expression:"total"}],staticClass:"total"},[t._v("共"+t._s(t.total)+"条结果")]),t._v(" "),s("el-pagination",{attrs:{background:"","current-page":t.page,"page-size":t.pageInfoSize,layout:"prev, pager, next ",total:t.total},on:{"current-change":t.handleCurrentChange}})],1)]),t._v(" "),s("el-dialog",{staticClass:"dialog",attrs:{title:"设置权限模块",visible:t.setUpFlag,width:"60%"},on:{"update:visible":function(i){t.setUpFlag=i}}},[s("div",{staticClass:"dialog"},[s("div",{staticClass:"dialogBox"},[s("label",{staticClass:"label_div"},[t._v("权限模块:")]),t._v(" "),s("el-select",{staticStyle:{"margin-left":"20px"},attrs:{size:"mini",placeholder:"请选择"},model:{value:t.big_id,callback:function(i){t.big_id=i},expression:"big_id"}},t._l(t.big_list,function(t){return s("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1),t._v(" "),s("div",{staticClass:"dialogBox"},[s("label",{staticClass:"label_div",staticStyle:{"vertical-align":"top"}},[t._v("权限下级模块:")]),t._v(" "),0==t.small_list.length?s("div",{staticStyle:{display:"inline-block","margin-left":"20px",color:"#999","font-size":"13px"}},[t._v("暂无数据")]):t._e(),t._v(" "),s("el-radio-group",{staticStyle:{width:"70%"},model:{value:t.small_id,callback:function(i){t.small_id=i},expression:"small_id"}},t._l(t.small_list,function(i,e){return s("el-radio",{key:e,staticStyle:{"margin-bottom":"10px"},attrs:{label:i.id}},[t._v(t._s(i.name))])}),1)],1)]),t._v(" "),s("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{size:"mini"},on:{click:function(i){t.setUpFlag=!1}}},[t._v("取 消")]),t._v(" "),0!=t.small_list.length?s("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(i){return t.setRouteAuth()}}},[t._v("确 定")]):t._e()],1)])],1)},staticRenderFns:[function(){var t=this.$createElement,i=this._self._c||t;return i("div",{staticClass:"permisssion_hint"},[i("i",{staticClass:"el-icon-warning"}),this._v(" "),i("span",[this._v("此表为全部权限分类表,请找相关开发人员进行操作,自行操作无效!")])])},function(){var t=this.$createElement,i=this._self._c||t;return i("tr",[i("th",[this._v("ID")]),i("th",[this._v("分类名称")]),i("th",[this._v("route")]),i("th",[this._v("更新时间")]),i("th",[this._v("分配到权限模块")]),i("th",[this._v("操作")])])}]};var a=s("C7Lr")({data:function(){return{loading:!1,page:1,total:0,pageInfoSize:0,routeList:[],setUpFlag:!1,big_list:[],big_id:"",small_list:[],small_id:"",route_id:""}},created:function(){this.getAllList()},methods:{smallPermissions:function(t){var i=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.authsList,{params:{parent_id:t}}).then(function(t){t=t.data,i.loading=!1,0==t.errno&&t?(i.small_list=t.rst,i.small_id&&-1==i.small_list.map(function(t){return t.id}).indexOf(i.small_id)&&(i.small_id="")):i.$message({message:t.err,type:"warning"})}).catch(function(t){i.loading=!1})},bigPermissions:function(){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.authsList,{params:{}}).then(function(i){i=i.data,t.loading=!1,0==i.errno&&i?(t.big_list=i.rst,t.big_id&&-1==t.big_list.map(function(t){return t.id}).indexOf(t.big_id)&&(t.big_id="")):t.$message({message:i.err,type:"warning"})}).catch(function(i){t.loading=!1})},getAllList:function(){var t=this,i=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.routeList,{params:{page:1}}).then(function(s){s=s.data,i.loading=!1,s&&0==s.errno?t.routeList=s.rst.data:i.$message({message:s.err,type:"warning"})}).catch(function(t){i.loading=!1})},editPermissionEvent:function(t){var i=t.id,s=t.auth_id,e=t.parent_id;this.bigPermissions(),this.setUpFlag=!0,this.route_id=i,this.big_id=e||"",this.small_id=s||""},setRouteAuth:function(){var t=this;""!=this.route_id&&(""!=this.small_id?this.$axios.post(this.URL.BASEURL+this.URL.setRouteAuth,{route_id:this.route_id,auth_id:this.small_id}).then(function(i){(i=i.data)&&0==i.errno?(t.setUpFlag=!1,t.$message({message:"设置成功",type:"success"}),t.getAllList()):t.$message({message:i.err,type:"warning"})}).catch(function(t){}):this.$message({message:"请选择权限模块",type:"warning"}))},handleCurrentChange:function(t){this.permissions(t)}},watch:{big_id:function(){this.big_id&&this.smallPermissions(this.big_id)},setUpFlag:function(){this.setUpFlag||(this.small_list=[],this.small_id="",this.big_id="")}}},e,!1,function(t){s("GuVe")},"data-v-f3395dfe",null);i.default=a.exports},GuVe:function(t,i){}});