var et=Object.defineProperty;var F=Object.getOwnPropertySymbols;var at=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable;var Y=(i,a,t)=>a in i?et(i,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[a]=t,z=(i,a)=>{for(var t in a||(a={}))at.call(a,t)&&Y(i,t,a[t]);if(F)for(var t of F(a))ot.call(a,t)&&Y(i,t,a[t]);return i};var S=(i,a,t)=>new Promise((b,k)=>{var x=r=>{try{v(t.next(r))}catch(p){k(p)}},L=r=>{try{v(t.throw(r))}catch(p){k(p)}},v=r=>r.done?b(r.value):Promise.resolve(r.value).then(x,L);v((t=t.apply(i,a)).next())});import{u as nt,f as N,g as O}from"./index-2a45336b.js";import{a as h,b as s,o as d,k as f,e as o,w as e,u as m,F as A,D as V,c as $,E as D,G as w,d as ct,i as st,aa as it}from"./ant-design-vue-710243d9.js";import{u as rt}from"./usePagination-7442a465.js";import"./useEnum-4e87ed86.js";import"./tinymce-3184e0f1.js";import"./echarts-ca5d9323.js";import"./cropper-47c8e461.js";import"./lodash-es-7cb071db.js";import"./qrcode-bec2257a.js";import"./jschardet-bd496279.js";const lt={key:0},ut={key:1},dt={key:1},xt=Object.assign({name:"activityOrder"},{__name:"index",setup(i){nt();const a=h(!1),t=h([]),b=h(1),k=[{title:"活动名称",dataIndex:"activityName"},{title:"客户姓名",dataIndex:"customerName"},{title:"联系方式",dataIndex:"customerPhone"},{title:"报名时间",dataIndex:"createdAt",width:150,align:"center"}],x=h([]),{listData:L,loading:v,showLoading:r,hideLoading:p,paginationState:y,resetPagination:P,searchFormData:g}=rt();h(),C(),H();function H(){return S(this,null,function*(){try{r();const{success:n,data:c}=yield N.activity.getProjectList({pageSize:99,current:1}).catch(()=>{throw new Error});p(),O("http.code.success")===n&&(x.value=c.map(l=>({id:l.id,title:l.title})))}catch(n){p()}})}function C(){return S(this,null,function*(){try{r();const{pageSize:n,current:c}=y,{success:l,data:u,total:E}=yield N.activity.getActivityList(z({pageSize:n,current:c},g.value)).catch(()=>{throw new Error});p(),O("http.code.success")===l&&(L.value=u,y.total=E)}catch(n){p()}})}function M({current:n,pageSize:c}){y.current=n,y.pageSize=c,C()}function T(){P(),C()}function G(){return S(this,null,function*(){try{const n=g.value.activityId;if(!n){it.warning("请选择活动");return}const c=yield N.activity.exportFile({activityId:n});console.log(c);const l=window.URL.createObjectURL(new Blob([c])),u=document.createElement("a");u.href=l,u.setAttribute("download","filename.xlsx"),document.body.appendChild(u),u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(l)}catch(n){}})}function q(){g.value={},P(),C()}return(n,c)=>{const l=s("a-select-option"),u=s("a-select"),E=s("a-form-item"),U=s("a-col"),j=s("a-button"),J=s("a-space"),R=s("a-row"),K=s("a-form"),Q=s("x-search-bar"),W=s("a-table"),X=s("a-card"),Z=s("a-image"),tt=s("a-modal");return d(),f(A,null,[o(Q,{class:"mb-8-2"},{default:e(({gutter:_,colSpan:B})=>[o(K,{model:m(g),layout:"inline"},{default:e(()=>[o(R,{gutter:12},{default:e(()=>[o(U,{span:12},{default:e(()=>[o(E,{label:"活动名称",name:"name"},{default:e(()=>[o(u,{value:m(g).activityId,"onUpdate:value":c[0]||(c[0]=I=>m(g).activityId=I)},{default:e(()=>[(d(!0),f(A,null,V(x.value,I=>(d(),$(l,{value:I.id},{default:e(()=>[D(w(I.title),1)]),_:2},1032,["value"]))),256))]),_:1},8,["value"])]),_:1})]),_:1}),o(U,{class:"align-right",span:12},{default:e(()=>[o(J,null,{default:e(()=>[o(j,{onClick:G},{default:e(()=>[D("导出文件")]),_:1}),o(j,{onClick:q},{default:e(()=>[D(w(n.$t("button.reset")),1)]),_:1}),o(j,{ghost:"",type:"primary",onClick:T},{default:e(()=>[D(w(n.$t("button.search")),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),o(R,{gutter:8,wrap:!1},{default:e(()=>[o(U,{flex:"auto"},{default:e(()=>[o(X,{type:"flex"},{default:e(()=>[o(W,{columns:k,"data-source":m(L),bordered:"true",loading:m(v),pagination:m(y),scroll:{x:1e3},onChange:M},{bodyCell:e(({column:_,record:B})=>[_.dataIndex==="createdAt"?(d(),f("span",lt,w(B.createdAt&&m(ct)(B.createdAt).format("YYYY-MM-DD HH:mm")),1)):st("",!0)]),_:1},8,["data-source","loading","pagination"])]),_:1})]),_:1})]),_:1}),o(tt,{open:a.value,"onUpdate:open":c[1]||(c[1]=_=>a.value=_),title:b.value===1?"活动图片":"活动详情",onOk:c[2]||(c[2]=_=>a.value=!1)},{default:e(()=>[b.value===1?(d(),f(A,{key:0},[t.value.length>0?(d(!0),f(A,{key:0},V(t.value,_=>(d(),$(Z,{width:200,src:m(O)("http.apiBasic")+_},null,8,["src"]))),256)):(d(),f("span",ut," 暂无图片 "))],64)):(d(),f("span",dt,w(n.content),1))]),_:1},8,["open","title"])],64)}}});export{xt as default};
