var $url="/common/editor/layerWord",data=utils.init({attributeName:utils.getQueryString("attributeName"),uploadList:[],form:{siteId:utils.getQueryInt("siteId"),isClearFormat:!0,isFirstLineIndent:!0,isClearFontSize:!0,isClearFontFamily:!0,isClearImages:!1,files:[]},uploadUrl:null}),methods={apiSubmit:function(){var i=this;utils.loading(this,!0),$api.post($url,this.form).then(function(t){var e=t.data;parent.$vue.insertEditor(i.attributeName,e.value),utils.closeLayer()}).catch(function(i){utils.error(i)}).then(function(){utils.loading(i,!1)})},btnSubmitClick:function(){if(0===this.form.files.length)return utils.error("请选择需要导入的Word文件！");this.apiSubmit()},btnCancelClick:function(){utils.closeLayer()},uploadBefore:i=>!!/(\.docx)$/i.exec(i.name)||(utils.error("文件只能是以.docx结尾的 Word 格式，请选择有效的文件上传!"),!1),uploadProgress:function(){utils.loading(this,!0)},uploadRemove(i){if(i.response){var t=this.form.files.findIndex(function(t){return t.fileName==i.response.name});this.form.files.splice(t,1)}},uploadSuccess:function(i){this.form.files.push({fileName:i.fileName,title:i.title}),utils.loading(this,!1)},uploadError:function(i){utils.loading(this,!1);var t=JSON.parse(i.message);utils.error(t.message)}},$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)}});