|
- import{N as M}from"./index-be0b3801.js";import{z as V,_ as G,a as O,r as g,o as J,b as n,c as s,d as r,f as a,h as l,e as i,i as k,L as N,F as x,H as K,t as z,k as Q,s as W}from"./index-dd5fae99.js";const X=p=>V.get("/api/v1/file-manage/project-file/list",{params:p}),Y=p=>V.post(`/api/v1/file-manage/project-file/want-read/${p}`),Z=p=>V.post(`/api/v1/file-manage/project-file/download/${p}`,void 0,{responseType:"blob"});const ee={class:"flex"},te={class:"card-list-item"},ae=["onClick"],le={key:1,class:"mb-8"},oe={class:"info"},se={class:"value"},ne={class:"flex justify-between"},re={key:1},ie={class:"text-center"},de={key:0,class:"text-success"},ue={key:1,class:"text-danger"},ce={key:2},pe=Q({name:"projectArchives"}),me=Object.assign(pe,{setup(p){const{proxy:S}=W(),c=O({projectName:"",buildOrgName:""}),j=g([]),d=O({pageNumber:1,pageSize:10}),m=async()=>{const o=await X({...d,...c});j.value=o.data.records,$.value=o.data.total},$=g(0),B=()=>{m()},D=()=>{c.projectName=void 0,c.buildOrgName=void 0,m()},L=o=>{d.pageSize=o,d.pageNumber=1,m()},T=o=>{d.pageNumber=o,m()},I=o=>{S.$messageBox.confirm(`申请借阅《${o.projectName}》项目档案`,"确定借阅吗?",{type:"warning"}).then(async()=>{await Y(o.id),S.$message.success("申请成功!"),await m()})},A=async o=>{v.value=!0,_.value="",f.value=0,C.value=setInterval(()=>{f.value<99?f.value++:clearInterval(C.value)},30);try{const e=await Z(o);f.value=100,_.value="success",clearInterval(C.value);const y=URL.createObjectURL(e),u=document.createElement("a");u.style.display="none",u.href=y,document.body.appendChild(u),u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(y),setTimeout(()=>{v.value=!1},500)}catch{clearTimeout(C.value),_.value="exception",setTimeout(()=>{v.value=!1},500)}},C=g(null),v=g(!1),f=g(0),_=g();return J(()=>{m()}),(o,e)=>{const y=n("el-input"),u=n("el-form-item"),w=n("el-col"),b=n("el-button"),R=n("el-row"),P=n("el-form"),U=n("el-card"),F=n("el-divider"),q=n("el-pagination"),E=n("el-progress"),H=n("el-dialog");return s(),r(x,null,[a(U,{class:"w-full search"},{default:l(()=>[a(P,{model:c,size:"small","label-suffix":":"},{default:l(()=>[a(R,{gutter:16},{default:l(()=>[a(w,{span:8},{default:l(()=>[a(u,{label:"项目名称"},{default:l(()=>[a(y,{modelValue:c.projectName,"onUpdate:modelValue":e[0]||(e[0]=t=>c.projectName=t),maxlength:"50",placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),a(w,{span:8},{default:l(()=>[a(u,{label:"项目单位"},{default:l(()=>[a(y,{modelValue:c.buildOrgName,"onUpdate:modelValue":e[1]||(e[1]=t=>c.buildOrgName=t),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),a(w,{span:8},{default:l(()=>[a(u,{class:"btn"},{default:l(()=>[i("div",ee,[a(b,{type:"primary",onClick:B},{default:l(()=>e[5]||(e[5]=[k("查询")])),_:1}),a(b,{onClick:D},{default:l(()=>e[6]||(e[6]=[k("重置")])),_:1})])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a(U,{class:"w-full mt-8"},{header:l(()=>e[7]||(e[7]=[i("div",{class:"flex justify-between"},[i("span",null,"列表")],-1)])),default:l(()=>[j.value.length?(s(),N(R,{key:0,gutter:24,class:"card-list"},{default:l(()=>[(s(!0),r(x,null,K(j.value,t=>(s(),N(w,{key:t.id,sm:12,lg:8,xl:6,class:"mb-24"},{default:l(()=>[i("div",te,[t.canRead?(s(),r("a",{key:0,class:"title",onClick:h=>o.$router.push({name:"projectArchiveDetail",query:{id:t.id}})},z(t.projectName),9,ae)):(s(),r("div",le,z(t.projectName),1)),i("div",oe,[i("div",null,[e[8]||(e[8]=i("span",{class:"label"},"项目编号:",-1)),i("span",se,z(t.pojectCode),1)])]),a(F),i("div",ne,[t.canRead?(s(),r(x,{key:1},[a(b,{icon:"view",type:"primary",onClick:h=>o.$router.push({name:"projectArchiveDetail",query:{id:t.id}})},{default:l(()=>e[10]||(e[10]=[k("查看")])),_:2},1032,["onClick"]),a(b,{icon:"download",onClick:h=>A(t.id)},{default:l(()=>e[11]||(e[11]=[k("下载")])),_:2},1032,["onClick"])],64)):(s(),r(x,{key:0},[t.canApplyBorrow?(s(),N(b,{key:0,icon:"reading",plain:"",type:"primary",onClick:h=>I(t)},{default:l(()=>e[9]||(e[9]=[k("申请借阅")])),_:2},1032,["onClick"])):(s(),r("span",re,"申请借阅审批中"))],64))])])]),_:2},1024))),128))]),_:1})):(s(),N(M,{key:1})),a(q,{currentPage:d.pageNumber,"onUpdate:currentPage":e[2]||(e[2]=t=>d.pageNumber=t),"page-size":d.pageSize,"onUpdate:pageSize":e[3]||(e[3]=t=>d.pageSize=t),background:"","page-sizes":d.pageSizes,layout:"total, sizes, prev, pager, next",total:$.value,onSizeChange:L,onCurrentChange:T},null,8,["currentPage","page-size","page-sizes","total"])]),_:1}),a(H,{modelValue:v.value,"onUpdate:modelValue":e[4]||(e[4]=t=>v.value=t),"show-close":!1},{default:l(()=>[i("div",ie,[_.value==="success"?(s(),r("p",de,"下载成功!")):_.value==="exception"?(s(),r("p",ue,"下载失败!")):(s(),r("p",ce,"资源处理中,请耐心等待...")),a(E,{type:"circle",percentage:f.value,status:_.value,class:"mt-8"},null,8,["percentage","status"])])]),_:1},8,["modelValue"])],64)}}}),ve=G(me,[["__scopeId","data-v-9682319c"]]);export{ve as default};
|