(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-27546d8c"],{"22e4":function(t,s,a){},"9fc7":function(t,s,a){"use strict";a.r(s);var e=function(){var t=this,s=t._self._c;t._self._setupProxy;return s("div",{staticClass:"app-container"},[s("div",{staticClass:"flex-export-data"},[2!==t.status?s("el-button",{staticStyle:{"z-index":"100"},attrs:{size:"small",type:"primary",disabled:3===t.status},on:{click:t.handleExport}},[t._v(" "+t._s(3!==t.status?"导出":"等待中")+" ")]):t._e(),2===t.status?s("el-col",{staticClass:"fr ml-20",attrs:{span:8,align:"right"}},[s("el-progress",{staticClass:"el-progress",attrs:{percentage:t.percentage}})],1):t._e(),1!==t.status?s("el-button",{staticClass:"ml-20",attrs:{size:"small"},on:{click:t.taskDel}},[t._v(" 取消 ")]):t._e(),s("el-button",{directives:[{name:"show",rawName:"v-show",value:1===t.status&&""!==t.downLoadPath,expression:"status === 1 && downLoadPath !== ''"}],staticStyle:{"z-index":"100"},attrs:{size:"small",type:"info"},on:{click:t.handleDownLoad}},[t._v(" 下载数据 ")])],1)])},i=[],n=a("9ab4"),r=a("60a3"),c=a("f727");let o=class extends r["f"]{constructor(){super(...arguments),this.downLoadPath="",this.percentage=0,this.task_id=0,this.timer=0,this.status=1}mounted(){this.taskRateInquiry()}beforeDestroy(){clearTimeout(this.timer)}handleExport(){this.taskMissionCreate()}async taskRateInquiry(){try{this.timer&&(clearTimeout(this.timer),this.timer=null);const t={task_name:this.taskName,...this.taskOption.param},{data:s}=await Object(c["R"])(t);if(this.status=s.status,1===s.status)return s.completed&&s.completed.path&&(this.downLoadPath=PAPA_CONFIG.VUE_APP_BASE_API+s.completed.path),void(this.percentage>0&&this.$message.success("导出完成"));if(4===s.status)return void this.$message.warning("导出任务失败");2===s.status?(this.percentage=Number(s.processing.rate),this.task_id=s.processing.task_id):3===s.status&&(this.percentage=0,this.task_id=s.waiting.task_id),this.timer=window.setTimeout(()=>{this.taskRateInquiry()},3e3)}catch(t){this.$message.warning("导出任务查询失败")}}async taskDel(){await Object(c["Q"])({task_id:this.task_id}),this.$message.success("导出任务取消成功"),clearTimeout(this.timer),this.taskRateInquiry()}async taskMissionCreate(){const t={task_name:this.taskName,...this.taskOption.param};await Object(c["P"])(t),this.taskRateInquiry()}handleDownLoad(){const t=document.createElement("a");t.href=this.downLoadPath,t.download="exportData",t.click()}};Object(n["a"])([Object(r["c"])(String)],o.prototype,"taskName",void 0),Object(n["a"])([Object(r["c"])(Object)],o.prototype,"taskOption",void 0),o=Object(n["a"])([r["a"]],o);var l=o,d=l,h=(a("edca"),a("2877")),u=Object(h["a"])(d,e,i,!1,null,"cd8edbaa",null);s["default"]=u.exports},edca:function(t,s,a){"use strict";a("22e4")}}]);
//# sourceMappingURL=chunk-27546d8c.47ad6cfe.js.map