(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4bcad545"],{"0857":function(t,e,i){"use strict";i("a0e0");var a=i("a013"),s=i("f425"),n=i("dad2"),r="toString",o=/./[r],l=function(t){i("e5ef")(RegExp.prototype,r,t,!0)};i("b6f1")(function(){return"/a/b"!=o.call({source:"a",flags:"b"})})?l(function(){var t=a(this);return"/".concat(t.source,"/","flags"in t?t.flags:!n&&t instanceof RegExp?s.call(t):void 0)}):o.name!=r&&l(function(){return o.call(this)})},6009:function(t,e,i){},6768:function(t,e,i){"use strict";var a=i("6009"),s=i.n(a);s.a},a0e0:function(t,e,i){i("dad2")&&"g"!=/./g.flags&&i("ddf7").f(RegExp.prototype,"flags",{configurable:!0,get:i("f425")})},efb5:function(t,e,i){"use strict";i.r(e);var a,s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-dialog",{attrs:{persistent:"","max-width":"800px","min-height":"500px"},model:{value:t.thisValue,callback:function(e){t.thisValue=e},expression:"thisValue"}},[i("v-card",[i("v-toolbar",{attrs:{id:"core-toolbar",color:"dark",prominent:""}},[i("div",{staticClass:"v-toolbar-title"},[i("v-toolbar-title",{staticClass:"white--text font-weight-light"},[t._v(t._s(t.thisUser.role_name)+"的权限")])],1),i("v-spacer"),i("v-toolbar-items",[i("v-btn",{attrs:{icon:"",dark:""},on:{click:function(e){t.thisValue=!1}}},[i("v-icon",[t._v("el-icon-close")])],1)],1)],1),i("v-layout",{attrs:{"justify-center":"","align-center":""}},[i("v-flex",{attrs:{xs6:"",md6:"",lg6:"",sm6:""}},[i("v-card-text",[i("v-treeview",{attrs:{items:t.items,"selected-color":"green","open-on-click":"",selectable:"","return-object":""},model:{value:t.selection,callback:function(e){t.selection=e},expression:"selection"}})],1)],1),i("v-divider",{attrs:{vertical:""}}),i("v-flex",{attrs:{xs12:"",md6:"",lg6:"",sm12:""}},[i("v-card-text",[0===t.selection.length?i("div",{key:"title",staticClass:"title font-weight-light grey--text pa-4 text-center"},[t._v("为"+t._s(t.thisUser.role_name)+"添加一些权限")]):t._e(),i("v-scroll-x-transition",{attrs:{group:"","hide-on-leave":""}},t._l(t.selection,function(e,a){return i("v-chip",{key:a,staticClass:"ma-1",attrs:{color:"grey",dark:"",small:""}},[i("v-icon",{attrs:{left:"",small:""}},[t._v("mdi-beer")]),t._v("\n              "+t._s(e.name)+"\n            ")],1)}),1)],1)],1)],1),i("v-divider"),i("v-card-actions",{staticClass:"justify-space-between"},[i("v-btn",{attrs:{color:"gray darken-1"},on:{click:function(e){t.selection=[]}}},[t._v("清空权限")]),i("v-btn",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"white--text",attrs:{color:"dark darken-1",depressed:""},on:{click:t.submit}},[t._v("\n        保存\n      ")])],1)],1)],1)},n=[],r=(i("0857"),{props:{value:{type:Boolean,required:!0,default:!1},user:{type:Object,required:!0,default:{id:"",role_name:"XX"}}},data:function(){return{thisValue:this.value,loading:!1,thisUser:this.user,auth:[],isLoading:!1,selection:[],items:[],selData:[]}},watch:{value:function(t){this.thisValue=t},thisValue:function(t){this.$emit("change",t)},user:function(t){this.thisUser=t,this.getAuth(),this.getOwnData()}},mounted:function(){a=this},methods:{getAuth:function(){this.$post("authority/list",{},function(t){if(0==t.errno){a.auth=t.data;var e=[];for(var i in t.data)for(var s in e.push({id:t.data[i].id+"_",name:t.data[i].cate_name,children:[]}),t.data[i].authority)e[i].children.push({id:t.data[i].authority[s].id,name:t.data[i].authority[s].auth_name});a.items=[{id:"q1",name:"全部权限",children:e}]}})},getOwnData:function(){this.$post("authority/own",{role_id:this.thisUser.id},function(t){0===t.errno&&(a.selData=JSON.parse(JSON.stringify(t.data)),a.selection=JSON.parse(JSON.stringify(t.data)))})},filterNewAuth:function(){if(this.selection.length>this.selData.length){var t=[];for(var e in this.selection){var i=-1;for(var a in this.selData)this.selection[e].id==this.selData[a].id&&(i=a);-1==i&&"number"==typeof this.selection[e].id&&t.push({auth_id:this.selection[e].id,role_id:this.thisUser.id})}return t.length>0&&{arr:t,type:"give"}}if(this.selection.length<this.selData.length){var s=[];for(var n in this.selData){var r=-1;for(var o in this.selection)this.selection[o].id==this.selData[n].id&&(r=o);-1==r&&"number"==typeof this.selection[n].id&&s.push(this.selection[n].id)}return s.length>0&&{arr:s,type:"del"}}return!1},submit:function(){var t=this.filterNewAuth();t&&(this.loading=!0,this.$post("authority/"+t.type,{array:"del"==t.type?t.arr.toString():JSON.stringify(t.arr),role_id:this.thisUser.id},function(t){a.loading=!1,0==t.errno&&(a.$message({showClose:!0,message:t.errmsg,type:"success"}),a.thisValue=!1,a.$emit("changemsg",t))}))}}}),o=r,l=(i("6768"),i("6691")),c=Object(l["a"])(o,s,n,!1,null,null,null);e["default"]=c.exports}}]);
//# sourceMappingURL=chunk-4bcad545.7072a1b7.js.map