var msSecurityStrategyConfigFormVm=new Vue({el:"#msSecurityStrategyConfigForm",data:function(){return{msConfig:{},entity:{id:GetQueryString("id")||"",strategyName:"",sys:{id:""},userName:"",userPassword:"",encryptPassword:"",headerName:""},pageToken:"",pageDictMap:{},editType:GetQueryString("editType"),msSysList:[],sysLoading:!1,rules:{service:[{required:!0,validator:function(e,t,i){t.serviceName&&t.id?i():i(new Error("服务不能为空"))},message:"服务不能为空",trigger:"change"}],userName:[{required:!0,message:"用户名不能为空",trigger:"change"},{max:100,message:"长度不能超过 100 个字符",trigger:"change"}],userPassword:[{required:!0,message:"用户密码不能为空",trigger:"change"},{max:50,message:"长度不能超过 50 个字符",trigger:"change"}],headerName:[{required:!0,message:"头参数名称不能为空",trigger:"change"},{max:50,message:"长度不能超过 50 个字符",trigger:"change"}]}}},computed:{urlPrefix:function(){return this.msConfig.gatewayRoute+this.msConfig.adminPath+"/platman/msSecurityStrategyConfig"},requestPrefix:function(){return this.msConfig.gatewayRoute+this.msConfig.adminPath}},methods:{initFormData:function(){var e,i,r=this,t=this.entity.id;t&&(e=r.urlPrefix+"/getMsSecurityStrategyConfigList?id="+t,i="获取安全策略信息",axios.get(e).then(function(e){var t=getDataFromAxiosResponse(e,i);t.list&&t.list[0]&&(r.entity=t.list[0])}).catch(function(e){axiosErrorTips(e,i+"异常")}),this.getSysListByUser(""))},handleSysParamFocus:function(){this.getSysListByUser("")},getSysListByUser:function(e){var t=this,i=t.requestPrefix+"/platman/msSystemAdmin/listSystemByCurrentUser?sysName="+e,r="获取系统列表";t.sysLoading=!0,axios.get(i).then(function(e){t.sysLoading=!1,t.msSysList=getDataFromAxiosResponse(e,r).data}).catch(function(e){axiosErrorTips(e,r+"异常")})}},created:function(){var e=this;e.msConfig=(new ProjectConfig).platmanServiceConfig,checkPagePermission(e.urlPrefix+"/checkMsSecurityStrategyConfigFormPermission"),e.initFormData()},mounted:function(){var t=this;window.doSubmit=function(r){return t.$refs.msSecurityStrategyConfigForm.validate(function(e){if(e){var i="保存安全策略信息";return axios.post(t.urlPrefix+"/save",t.entity).then(function(e){var t=getDataFromAxiosResponse(e,i);t&&"success"===t.type&&r(t)}).catch(function(e){axiosErrorTips(e,i+"异常")}),!1}direwolfCommonTips("error","内容填写有误,请修改后再提交")}),!1}}});