var $url="/common/editor/layerFile",data=utils.init({attributeName:utils.getQueryString("attributeName"),form:{siteId:utils.getQueryInt("siteId"),type:"upload",files:[],fileName:"",fileUrl:"",isAutoPlay:!1},uploadUrl:null}),methods={btnSubmitClick:function(){if(0===!this.form.files.length)return utils.error("请上传需要插入的附件文件！"),!1;for(var e=0;e<this.form.files.length;e++){var i=this.form.files[e];parent.$vue.insertEditor(this.attributeName,'<a href="'+i.fileUrl+'" target="_blank">'+i.fileName+"</a><br />")}utils.closeLayer()},btnCancelClick:function(){utils.closeLayer()},uploadProgress:function(){utils.loading(this,!0)},uploadFileSuccess:function(e){this.form.files.push({fileName:e.name,fileUrl:e.url}),utils.loading(this,!1)},uploadError:function(e){utils.loading(this,!1);var i=JSON.parse(e.message);utils.error(i.message)},uploadRemove(e){if(e.response){var i=_.findIndex(this.form.files,function(i){return i.fileName===e.response.name});this.form.files.splice(i,1)}}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.uploadUrl=$apiUrl+$url+"/actions/upload?siteId="+this.form.siteId,utils.loading(this,!1)}});