var $url="/settings/sitesChangeRoot",data=utils.init({pageTitle:null,root:!1,directories:null,files:null,siteName:null,checkAllDirectories:!1,checkAllFiles:!1,form:{siteId:utils.getQueryInt("siteId"),siteDir:"",checkedDirectories:[],checkedFiles:[],isMoveFiles:!0}}),methods={apiGet:function(){var e=this;$api.get($url,{params:{siteId:this.form.siteId}}).then(function(i){var t=i.data;e.site=t.site,e.directories=t.directories,e.files=t.files,e.siteName=t.site.siteName,e.pageTitle=e.site.root?"转移到子目录":"转移到根目录",e.root=e.site.root}).catch(function(e){utils.error(e)}).then(function(){utils.loading(e,!1)})},apiSubmit:function(){var e=this;utils.loading(this,!0),$api.post($url,this.form).then(function(i){i.data;e.$notify.success({title:"成功",message:"站点成功"+e.pageTitle}),setTimeout(function(){location.href=utils.getSettingsUrl("sites")},1500)}).catch(function(e){utils.error(e)}).then(function(){utils.loading(e,!1)})},handleCheckAllDirectoriesChange(e){this.form.checkedDirectories=e?this.directories:[],this.checkAllDirectories=e},handleCheckedDirectoriesChange(e){this.checkAllDirectories=this.form.checkedDirectories.length===this.directories.length},handleCheckAllFilesChange(e){this.form.checkedFiles=e?this.files:[],this.checkAllFiles=e},handleCheckedFilesChange(e){this.checkAllFiles=this.form.checkedFiles.length===this.files.length},btnSubmitClick:function(){var e=this;this.$refs.form.validate(function(i){i&&e.apiSubmit()})}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiGet()}});