text: (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-fa06"],{"8roc":function(t,e,i){"use strict";var o=i("cY0d");i.n(o).a},"D+s9":function(t,e,i){"use strict";i.d(e,"d",function(){return r}),i.d(e,"a",function(){return a}),i.d(e,"b",function(){return s}),i.d(e,"c",function(){return l});var o=i("bNJ/"),n=i("8SHQ");function r(){return Object(o.a)({url:n.a.PathPermissionTree,method:"get"})}function a(t){return Object(o.a)({url:"/permission",method:"post",data:t})}function s(t){var e={id:t};return Object(o.a)({url:"/permission",method:"delete",data:e})}function l(t){return Object(o.a)({url:"/permission",method:"put",data:t})}},FTJi:function(t,e,i){"use strict";i.r(e);var o=i("D+s9"),n=i("cCY5"),r=i.n(n),a=(i("VCwm"),{name:"Form",components:{TreeSelect:r.a},props:{permissions:{type:Array,required:!0},isAdd:{type:Boolean,required:!0},sup_this:{type:Object,default:null}},data:function(){return{loading:!1,dialog:!1,form:{name:"",alias:"",pid:0},rules:{name:[{required:!0,message:this.$t("placeholder.name"),trigger:"blur"}],alias:[{required:!0,message:this.$t("placeholder.alias"),trigger:"blur"}]}}},methods:{cancel:function(){this.resetForm()},doSubmit:function(){var t=this;this.$refs.form.validate(function(e){if(!e)return!1;t.loading=!0,t.isAdd?t.doAdd():t.doEdit()})},doAdd:function(){var t=this;Object(o.a)(this.form).then(function(e){t.resetForm(),t.$notify({title:"添加成功",type:"success",duration:1500}),t.loading=!1,setTimeout(function(){t.$parent.$parent.init(),t.$parent.$parent.getPermissions()},200)}).catch(function(e){t.loading=!1,console.log(e.msg)})},doEdit:function(){var t=this;Object(o.c)(this.form).then(function(e){t.resetForm(),t.$notify({title:"修改成功",type:"success",duration:1500}),t.loading=!1,setTimeout(function(){t.sup_this.init(),t.sup_this.getPermissions()},200)}).catch(function(e){t.loading=!1,console.log(e.msg)})},resetForm:function(){this.dialog=!1,this.$refs.form.resetFields(),this.form={name:"",alias:"",pid:0}}}}),s=(i("8roc"),i("KHd+")),l=Object(s.a)(a,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{attrs:{"append-to-body":!0,visible:t.dialog,title:t.isAdd?t.$t("actions.add"):t.$t("actions.edit"),width:"500px"},on:{"update:visible":function(e){t.dialog=e}}},[i("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,size:"small","label-width":"80px"}},[i("el-form-item",{attrs:{label:t.$t("table.name"),prop:"name"}},[i("el-input",{staticStyle:{width:"360px"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),t._v(" "),i("el-form-item",{attrs:{label:t.$t("table.alias"),prop:"alias"}},[i("el-input",{staticStyle:{width:"360px"},model:{value:t.form.alias,callback:function(e){t.$set(t.form,"alias",e)},expression:"form.alias"}})],1),t._v(" "),i("el-form-item",{staticStyle:{"margin-bottom":"0px"},attrs:{label:t.$t("table.sup_dir")}},[i("TreeSelect",{staticStyle:{width:"360px"},attrs:{options:t.permissions,placeholder:t.$t("placeholder.sup_dir")},model:{value:t.form.pid,callback:function(e){t.$set(t.form,"pid",e)},expression:"form.pid"}})],1)],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"text"},on:{click:t.cancel}},[t._v(t._s(t.$t("actions.cancel")))]),t._v(" "),i("el-button",{attrs:{loading:t.loading,type:"primary"},on:{click:t.doSubmit}},[t._v(t._s(t.$t("actions.confirm")))])],1)],1)},[],!1,null,"af511422",null);l.options.__file="form.vue";e.default=l.exports},cY0d:function(t,e,i){}}]);