var $url="/common/material/layerWord",$urlUpload=$apiUrl+"/common/material/layerWord/actions/upload?siteId="+utils.getQueryInt("siteId"),data=utils.init({uploadList:[],form:{siteId:utils.getQueryInt("siteId"),isClearFormat:!0,isFirstLineIndent:!0,isClearFontSize:!0,isClearFontFamily:!0,isClearImages:!1,files:[]}}),methods={btnSubmitClick:function(){var e=this;if(0===this.form.files.length)return utils.error("请选择需要导入的Word文件！"),!1;utils.loading(this,!0),$api.post($url,this.form).then(function(e){var i=e.data;parent.$vue.insertHtml(i.value),utils.closeLayer()}).catch(function(e){utils.error(e)}).then(function(){utils.loading(e,!1)})},btnCancelClick:function(){utils.closeLayer()},uploadBefore:e=>!!/(\.docx)$/i.exec(e.name)||(utils.error("文件只能是以.docx结尾的 Word 格式，请选择有效的文件上传!"),!1),uploadProgress:function(){utils.loading(this,!0)},uploadRemove(e){if(e.response){var i=this.form.files.findIndex(function(i){return i.fileName==e.response.name});this.form.files.splice(i,1)}},uploadSuccess:function(e){this.form.files.push({fileName:e.fileName,title:e.title}),utils.loading(this,!1)},uploadError:function(e){utils.loading(this,!1);var i=JSON.parse(e.message);utils.error(i.message)}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.pageLoad=!0}});