var J=Object.defineProperty,K=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var M=(o,e,l)=>e in o?J(o,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):o[e]=l,C=(o,e)=>{for(var l in e||(e={}))W.call(e,l)&&M(o,l,e[l]);if(Y)for(var l of Y(e))X.call(e,l)&&M(o,l,e[l]);return o},E=(o,e)=>K(o,Q(e));var h=(o,e,l)=>new Promise((w,b)=>{var f=i=>{try{y(l.next(i))}catch(u){b(u)}},p=i=>{try{y(l.throw(i))}catch(u){b(u)}},y=i=>i.done?w(i.value):Promise.resolve(i.value).then(f,p);y((l=l.apply(o,e)).next())});import{D as T,d as ee,r as v,a as te,j as s,o as k,h as R,w as a,e as t,k as Z,c as V,F as ae,b as L,f as U,$ as le,E as oe,T as se}from"./index-90c78f99.js";import{h as ne,a as ie,f as de}from"./uploadAction-50b8a6f7.js";const re=o=>T.get("/api/v1/app/visit/statistics/page",o),ce=o=>T.delete("/api/v1/app/visit/statistics/delete",o),pe={key:0,class:"text-success"},ue={key:1,class:"text-danger"},me=["onClick"],_e=["onClick"],fe=L("a",{class:"btn text-primary"},"导入",-1),ke=ee({__name:"index",setup(o){const e=v({visitDate:void 0,imported:void 0}),l=[{type:"index",label:"序号",width:80},{label:"文件名称",prop:"fileName",key:"fileName"},{label:"关联日期",prop:"visitDate",key:"visitDate"},{label:"导入状态",slot:"imported",key:"imported"},{label:"导入时间",prop:"updateOn",key:"updateOn"},{label:"添加人",prop:"updateUser",key:"updateUser"},{label:"操作",slot:"action",key:"action",width:120,fixed:"right"}],w=v(),b=v(),f=v(),p=(...d)=>h(this,[...d],function*(_=f.value.pageParams){const r=yield re(E(C(C({},e.value),_),{type:u.value===1?"ZLB":"ZZD"}));w.value=r.data&&r.data.records||[],b.value=r.data&&r.data.total||0}),y=()=>{f.value.pageNumber=1,p()},i=()=>{f.value.pageNumber=1,e.value={visitDate:void 0,imported:void 0},p()},u=v(1),$=()=>{i()},x=v({file:[]}),O=_=>{le.confirm("确认删除该数据吗?","提示！",{type:"warning"}).then(()=>h(this,null,function*(){yield ce({id:_.id}),oe.success("删除成功！"),p()}))},j=_=>h(this,null,function*(){const d=yield se({fileId:_.fileId}),r=URL.createObjectURL(d),m=document.createElement("a");m.style.display="none",m.href=r,m.download=_.fileName,document.body.appendChild(m),m.click(),document.body.removeChild(m),window.URL.revokeObjectURL(r)});return te(()=>{p()}),(_,d)=>{const r=s("page-title"),m=s("el-date-picker"),g=s("el-form-item"),D=s("el-col"),N=s("el-option"),I=s("el-select"),B=s("el-button"),G=s("el-row"),P=s("el-form"),F=s("el-tab-pane"),S=s("el-tabs"),q=s("el-upload"),z=s("table-list"),A=s("el-card"),H=s("views");return k(),R(H,null,{default:a(()=>[t(r),t(P,{class:"search mb-16",model:e.value,"label-suffix":":"},{default:a(()=>[t(G,{gutter:24},{default:a(()=>[t(D,{span:6},{default:a(()=>[t(g,{label:"关联日期"},{default:a(()=>[t(m,{modelValue:e.value.visitDate,"onUpdate:modelValue":d[0]||(d[0]=n=>e.value.visitDate=n),"value-format":"YYYY-MM-DD",format:"YYYY-MM-DD",type:"date",placeholder:"请选择"},null,8,["modelValue"])]),_:1})]),_:1}),t(D,{span:6},{default:a(()=>[t(g,{label:"导入状态"},{default:a(()=>[t(I,{modelValue:e.value.imported,"onUpdate:modelValue":d[1]||(d[1]=n=>e.value.imported=n)},{default:a(()=>[t(N,{label:"已导入",value:!0}),t(N,{label:"未导入",value:!1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),t(D,{span:12},{default:a(()=>[t(g,{class:"search_btn"},{default:a(()=>[t(B,{type:"primary",onClick:y},{default:a(()=>[Z("搜索")]),_:1}),t(B,{onClick:i},{default:a(()=>[Z("重置")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),t(A,{class:"my-card tab-card",shadow:"never"},{header:a(()=>[t(S,{modelValue:u.value,"onUpdate:modelValue":d[2]||(d[2]=n=>u.value=n),onTabChange:$},{default:a(()=>[t(F,{label:"浙里办",name:1}),t(F,{label:"浙政钉",name:2})]),_:1},8,["modelValue"])]),default:a(()=>[t(z,{ref_key:"tableListRef",ref:f,column:l,data:w.value,total:b.value,onGetTableData:p},{imported:a(({scope:n})=>[n.row.imported?(k(),V("span",pe,"已导入")):(k(),V("span",ue,"未导入"))]),action:a(({scope:n})=>[n.row.imported?(k(),V(ae,{key:0},[L("a",{class:"btn text-primary mr-24",onClick:c=>j(n.row)}," 下载 ",8,me),L("a",{class:"btn text-danger",onClick:c=>O(n.row)}," 删除 ",8,_e)],64)):(k(),R(q,{key:1,"file-list":x.value.file,"onUpdate:fileList":d[3]||(d[3]=c=>x.value.file=c),action:`/kb/api/v1/app/visit/statistics/import?type=${u.value===1?"ZLB":"ZZD"}&visitDate=${n.row.visitDate}`,"on-success":c=>U(ne)(c,x.value.file,!1,p),"on-error":c=>U(ie)(c),"before-upload":c=>U(de)(c,{types:["xls","xlsx"]}),accept:".xlsx,.xls","show-file-list":!1},{default:a(()=>[fe]),_:2},1032,["file-list","action","on-success","on-error","before-upload"]))]),_:1},8,["data","total"])]),_:1})]),_:1})}}});export{ke as default};
