(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-565a0e46"],{"20af":function(t,e,a){"use strict";a("ce51")},"6a3f":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("div",{staticClass:"app-container"},[a("div",{staticClass:"app-form margin-top levelEdit"},[a("el-form",{ref:"dataForm",attrs:{rules:t.rules,model:t.form,"label-position":"right","label-width":"200px"}},[a("div",{staticClass:"app-form-group"},[a("div",{staticClass:"app-form-ti"},[t._v("基础设置")]),a("div",{staticClass:"padding-top-lg"},[a("el-form-item",{attrs:{label:"角色名称",prop:"name"}},[a("el-input",{staticClass:"form-input",model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"角色说明",prop:"content"}},[a("el-input",{staticClass:"form-input",model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1),a("el-form-item",{attrs:{label:"角色权限",prop:"rule"}},[a("div",{staticClass:"flex padding-left-sm"},[a("el-checkbox",{model:{value:t.selected_all,callback:function(e){t.selected_all=e},expression:"selected_all"}},[t._v("选中全部")]),a("el-checkbox",{model:{value:t.setexpand_all,callback:function(e){t.setexpand_all=e},expression:"setexpand_all"}},[t._v("展开全部")])],1),a("el-tree",{key:t.treeKey,ref:"tree",staticClass:"permission-tree",attrs:{"default-expand-all":t.expand_all,"default-checked-keys":t.form.auth_content,"check-strictly":t.checkStrictly,data:t.authList,props:t.defaultProps,"show-checkbox":"","node-key":"id"}})],1)],1)]),a("div",{staticClass:"padding-xl flex justify-center"},[a("el-button",{on:{click:t.onBack}},[t._v("返回")]),a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submit()}}},[t._v("提交")])],1)])],1),a("copyright")],1)},s=[],n=a("7f70"),l=a("8327"),o={name:"LevelEdit",data:function(){return{checkStrictly:!1,authList:[],defaultProps:{children:"childlist",label:"name"},rules:{name:[{required:!0,message:"请输入角色名称",trigger:"blur"}]},form:{name:"",auth_content:[],content:""},id:"",is_submit:!1,selected_all:!1,expand_all:!1,setexpand_all:!1,treeKey:"0"}},watch:{selected_all:function(t,e){!1===t?this.$refs.tree.setCheckedKeys([]):this.$refs.tree.setCheckedNodes(this.authList)},setexpand_all:function(t,e){this.expand_all=t,this.treeKey=Date.now()}},computed:Object(n["a"])({},Object(l["b"])(["config"])),created:function(){this.id=this.$route.query.id,this.init()},methods:{onBack:function(){this.$router.go(-1)},change:function(t){this.$forceUpdate()},init:function(){var t=this;this.api.get("auth/roleDetail",{id:this.id}).then((function(e){1==e.code&&(e.data.info&&(t.form=e.data.info),t.authList=e.data.authlist)})),setTimeout((function(){t.expand_all=!0}),3e3)},submit:function(){var t=this;this.form,this.$refs["dataForm"].validate((function(e){if(e){var a=t.$refs.tree.getCheckedKeys();if(t.form.auth_content=a,t.is_submit)return;t.is_submit=!0,t.api.post("auth/rolePost",Object(n["a"])({id:t.id},t.form)).then((function(e){t.is_submit=!1,1==e.code?(t.$util.success(e.message),t.onBack()):t.$util.error(e.message)})).catch((function(){t.is_submit=!1}))}}))},resetForm:function(){this.form={name:"",auth_content:[],content:""}}}},c=o,r=(a("20af"),a("3d7a")),u=Object(r["a"])(c,i,s,!1,null,null,null);e["default"]=u.exports},ce51:function(t,e,a){}}]);