1 |
- var serviceCode_serviceNameJson={},msSecurityStrategyConfigFormVm=new Vue({el:"#msSecurityStrategyConfigForm",data:function(){return{entity:{id:GetQueryString("id"),sysParamCode:GetQueryString("sysParamCode"),sysParamValue:"",application:"",profile:"",label:"",appId:"1"},editType:GetQueryString("editType"),sysId:GetQueryString("sysId"),applicationSelect:[],profileSelect:["dev","test","prod"],labelSelect:["master","test"],rules:{application:[{required:!0,message:"服务名称不能为空",trigger:"change"},{max:100,message:"长度不能超过 50 个字符",trigger:"change"}],profile:[{required:!0,message:"环境不能为空",trigger:"change"},{max:50,message:"长度不能超过 50 个字符",trigger:"change"}],label:[{required:!0,message:"分支不能为空",trigger:"change"},{max:50,message:"长度不能超过 50 个字符",trigger:"change"}],sysParamCode:[{required:!0,message:"配置项不能为空",trigger:"change"},{max:50,message:"长度不能超过 50 个字符",trigger:"change"}],sysParamValue:[{required:!0,message:"参数值不能为空",trigger:"change"},{max:50,message:"长度不能超过 50 个字符",trigger:"change"}]},urlPrefixSys:commonConfig.sysBackendContext}},created:function(){var e=this;e.msConfig=(new ProjectConfig).platmanServiceConfig,checkPagePermission(e.urlPrefixSys+"/sys/sysParam/checkSysParamFormPermission"),e.initFormData()},computed:{urlPrefix:function(){return this.msConfig.gatewayRoute+this.msConfig.adminPath}},methods:{initFormData:function(){var s=this,e=s.urlPrefix+"/platman/msServiceInfo/getAllMsServiceInfoServiceCodeAndServiceNameBySysId?sysId="+s.sysId;axiosRequest(e,"获取服务列表").then(function(e){for(var r in s.applicationSelect=e)serviceCode_serviceNameJson[e[r].serviceCode]=e[r].serviceName;s.getSystemBySysParamCode()})},getSystemBySysParamCode:function(){var e,r=this,s=r.entity.sysParamCode;s&&(e=r.urlPrefixSys+"/sys/sysParam/getSysParamList?sysParamCode="+s,axiosRequest(e,"获取配置项信息").then(function(e){e.list&&e.list[0]&&(r.entity=e.list[0],r.entity.application=r.entity.application.toUpperCase())}))}},mounted:function(){var s=this;window.doSubmit=function(r){return s.$refs.msSecurityStrategyConfigForm.validate(function(e){return e?(axiosRequest(s.urlPrefixSys+"/sys/sysParam/save","保存配置项信息","POST",s.entity).then(function(e){e&&"success"===e.type&&r(e)}),!1):void direwolfCommonTips("error","内容填写有误,请修改后再提交")}),!1}}});
|