var $url="/cms/contents/contentsLayerExport",data=utils.init({columns:null,checkedLevels:null,checkedLevel:null,form:{siteId:utils.getQueryInt("siteId"),channelId:utils.getQueryInt("channelId"),channelContentIds:utils.getQueryString("channelContentIds"),exportType:"zip",isAllCheckedLevel:!0,checkedLevelKeys:[],isAllDate:!0,startDate:new Date((new Date).setDate((new Date).getDate()-30)),endDate:new Date,isAllColumns:!0,columnNames:[]}}),methods={apiGet:function(){var e=this;utils.loading(this,!0),$api.get($url,{params:{siteId:this.form.siteId,channelId:this.form.channelId}}).then(function(t){var l=t.data;e.columns=l.value,e.form.columnNames=[];for(var s=0;s<e.columns.length;s++){var n=e.columns[s];n.isList&&e.form.columnNames.push(n.attributeName)}e.checkedLevels=l.checkedLevels;for(s=0;s<e.checkedLevels.length;s++){var i=e.checkedLevels[s];e.form.checkedLevelKeys.push(i.key)}e.checkedLevel=l.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(e){var t=e.data;if(!t.isSuccess)return utils.error("没有符合条件的内容，请重新选择导出条件");window.open(t.value),utils.closeLayer()}).catch(function(e){utils.error(e)}).then(function(){utils.loading(e,!1)})},btnIsAllCheckedLevelClick:function(){if(this.isAllCheckedLevel=!this.form.isAllCheckedLevel,this.form.checkedLevelKeys=[],this.form.isAllCheckedLevel)for(var e=0;e<this.checkedLevels.length;e++){var t=this.checkedLevels[e];this.form.checkedLevelKeys.push(t.key)}},btnIsAllColumnsClick:function(){if(this.form.isAllColumns=!this.form.isAllColumns,this.form.columnNames=["Title"],this.form.isAllColumns)for(var e=0;e<this.columns.length;e++){var t=this.columns[e];this.form.columnNames.push(t.attributeName)}},btnSubmitClick:function(){if(0===this.form.checkedLevelKeys.length)return utils.error("必须至少选择一项内容状态");this.apiSubmit()},btnCancelClick:function(){utils.closeLayer()}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiGet()}});