var $url="/settings/sitesUrl",data=utils.init({pageType:null,sites:null,editPanel:!1,editForm:null,editLoading:!1,editRules:{separatedWebUrl:[{required:!0,message:"独立部署站点访问地址",trigger:"blur"}],assetsDir:[{required:!0,message:"上传文件存储文件夹",trigger:"blur"}],separatedAssetsUrl:[{required:!0,message:"独立部署上传文件访问地址",trigger:"blur"}],separatedApiUrl:[{required:!0,message:"独立部署API访问地址",trigger:"blur"}]}}),methods={apiGet:function(){var e=this;$api.get($url).then(function(t){var i=t.data;e.sites=i.sites}).catch(function(e){utils.error(e)}).then(function(){utils.loading(e,!1)})},btnEditClick:function(e){var t=e;this.editForm={siteId:t.id,siteName:t.siteName,isSeparatedWeb:t.isSeparatedWeb,separatedWebUrl:t.separatedWebUrl,isSeparatedAssets:t.isSeparatedAssets,assetsDir:t.assetsDir,separatedAssetsUrl:t.separatedAssetsUrl,isSeparatedApi:t.isSeparatedApi,separatedApiUrl:t.separatedApiUrl},this.editPanel=!0},btnEditCancelClick:function(){this.editPanel=!1,this.editLoading=!1},btnEditSubmitClick:function(){var e=this;this.$refs.editForm.validate(function(t){t&&(e.editLoading=!0,e.apiEdit())})},apiEdit:function(){var e=this;$api.put($url,this.editForm).then(function(t){var i=t.data;e.sites=i.sites,e.editPanel=!1}).catch(function(e){utils.error(e)}).then(function(){e.editLoading=!1})}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiGet()}});