import{d as a,r as e,aa as t,a as s,b as l,h as i,k as u,c as n,w as c,j as p,t as o,l as r,e as v,M as d,N as g,I as m,_}from"./index-d052b22f-1780912037814v=1.0.0.js";import{t as y,a as b,b as f}from"./common-0c693521-1780912037814v=1.0.0.js";import{b as k,g as T}from"./project-4a4cab5b-1780912037814v=1.0.0.js";import{g as w}from"./tagManage-f59df07c-1780912037814v=1.0.0.js";import{g as h}from"./fileManage-70ddefc0-1780912037814v=1.0.0.js";const j={class:"app-container"},x={class:"flex-export-data"},L=_(a({__name:"index",props:{taskName:String,taskOption:Object},setup(a){const _=a,k=e(""),T=e(0),w=e(0),h=e(0),L=e(1);t((()=>{clearTimeout(h.value)}));const z=()=>{O()},C=async()=>{var a;const e={task_name:_.taskName,task_id:w.value,...null==(a=_.taskOption)?void 0:a.param},{data:t}=await f(e);L.value=t.status,1===t.status?(t.completed.path&&(k.value="https://qmjs.ynsport.cn/zwapi"+t.completed.path),0!==h.value&&m({title:"温馨提示",message:"导出完成！",type:"success"})):(2===t.status?(T.value=parseFloat(t.processing.rate),w.value=t.processing.task_id):3===t.status&&(T.value=0,w.value=t.waiting.task_id),h.value=window.setTimeout(C,3e3))},N=async()=>{const a={task_id:w.value};await y(a),m({title:"温馨提示",message:"导出任务取消成功！",type:"success"}),clearTimeout(h.value),C()},O=async()=>{var a;const e={task_name:_.taskName,...null==(a=_.taskOption)?void 0:a.param},{data:t}=await b(e);w.value=t.task_id,C()},E=()=>{const a=document.createElement("a");a.href=k.value,a.download="exportData",a.click()};return(a,e)=>{const t=s("el-button"),m=s("el-progress"),_=s("el-col");return l(),i("div",j,[u("div",x,[2!==L.value?(l(),n(t,{key:0,disabled:3===L.value,onClick:z},{default:c((()=>[p(o(3!==L.value?"导出":"等待中"),1)])),_:1},8,["disabled"])):r("v-if",!0),2===L.value?(l(),n(_,{key:1,span:8,class:"fr ml-20",align:"right"},{default:c((()=>[v(m,{percentage:T.value,class:"el-progress"},null,8,["percentage"])])),_:1})):r("v-if",!0),1!==L.value?(l(),n(t,{key:2,class:"ml-20",onClick:N},{default:c((()=>e[0]||(e[0]=[p(" 取消 ")]))),_:1})):r("v-if",!0),d(v(t,{onClick:E},{default:c((()=>e[1]||(e[1]=[p("下载数据")]))),_:1},512),[[g,1===L.value&&""!==k.value]])])])}}}),[["__scopeId","data-v-353bc09b"]]),z=()=>{const a=e([{label:"待确认",value:"0",tagType:"info"},{label:"草稿",value:"1",tagType:"info"},{label:"审核中",value:"2",tagType:"warning"},{label:"通过",value:"3",tagType:"success"},{label:"驳回",value:"4",tagType:"danger"},{label:"通过",value:"5",tagType:"success"},{label:"审核中",value:"7",tagType:"info"},{label:"通过",value:"8",tagType:"success"}]),t=e([{label:"待确认",value:"0",tagType:"info"},{label:"草稿",value:"1",tagType:"info"},{label:"审核中",value:"2",tagType:"warning"},{label:"通过",value:"3",tagType:"success"},{label:"驳回",value:"4",tagType:"danger"},{label:"通过",value:"5",tagType:"success"},{label:"审核中",value:"7",tagType:"info"},{label:"通过",value:"8",tagType:"success"}]);w({page:1,size:999,is_show_tag_id:1,type:"project_tags"}).then((a=>{}));return{statusList:a,listStatusList:t,getProjectList:async(a,e)=>{let t=[],s=await k({});return 200===s.code&&s.data.map((a=>{t.push({label:a.name,value:a.type_id})})),t},getChanelList:async()=>{let a=[],e=await T({page:1,size:999});return 200===e.code&&e.data.list.map((e=>{a.push({label:e.name,value:e.fund_channel_id})})),a},getTagGroupSpecialList:async()=>{let a=[],e=await w({page:1,size:999,is_show_tag_id:1,type:"project_tags"});return 200===e.code&&(e.data.list.forEach((a=>{a.tag_id_str=a.name,a.tag_id=a.tag_group_id})),a=e.data.list),a},getFileList:async()=>{let a=[],e=await h({page:1,size:999});return 200===e.code&&e.data.list.map((e=>{a.push({label:e.name,value:e.file_type_id})})),a}}};export{L as E,z as u};
