var $url="/cms/contents/contentsLayerWord",data=utils.init({checkedLevels:null,form:{siteId:utils.getQueryInt("siteId"),channelId:utils.getQueryInt("channelId"),isFirstLineTitle:!1,isFirstLineRemove:!0,isClearFormat:!0,isFirstLineIndent:!0,isClearFontSize:!0,isClearFontFamily:!0,isClearImages:!1,checkedLevel:null,files:[]},uploadUrl:null,uploadList:[]}),methods={apiGet:function(){var e=this;utils.loading(this,!0),$api.get($url,{params:{siteId:this.form.siteId,channelId:this.form.channelId}}).then(function(i){var t=i.data;e.checkedLevels=t.checkedLevels,e.form.checkedLevel=t.checkedLevel}).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;utils.closeLayer(),parent.$vue.apiList(e.form.channelId,1,"Word导入成功！",!0)}).catch(function(e){utils.error(e)}).then(function(){utils.loading(e,!1)})},btnSubmitClick:function(){if(0===this.form.files.length)return utils.error("请选择需要导入的Word文件！");this.apiSubmit()},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.apiGet(),this.uploadUrl=$apiUrl+$url+"/actions/upload?siteId="+this.form.siteId+"&channelId="+this.form.channelId}});