|
- import{d as ce,O as ue,x as pe,y as fe,B as ge,r as c,o as _e,c as u,e as m,f as v,h as r,i as l,g as y,F as E,H as U,R as me,k as h,G as ve,n as ye,j as x,u as g,t as he,A as N,L as we,ad as De,ae as ke,q as Ce}from"./index.88314652.js";import{S as xe,p as X}from"./seal.664a42ae.js";import{a as Ie}from"./projectStore.93a92252.js";import{h as Ve,i as Se,f as $e,c as Y,b as Be,e as Te}from"./uploadAction.a771741b.js";import{g as be}from"./selfEvaluationSure.7a46a9ba.js";const je={class:"footerPage"},qe={id:"signContainer",class:"sign_content h-full"},Pe=["id","onDrop"],Re=["id"],Le={key:0},Oe=["id","onDragstart","onDragend"],Ae=["src"],Fe=["onClick"];const Ee={class:"footer"},Ue={class:"el-upload__tip"},Ne={class:"flex justify-center"},Xe=ce({name:"stamp"}),We=Object.assign(Xe,{setup(Ye){const z=ue(()=>import("./pdf.worker.entry.f19ddaea.js").then(t=>t.p),[]),{proxy:I}=Ce(),d=pe(),B=fe(),G=ge.dictStore.uploadUrl,ze=c([{src:xe}]),T=c(0),V=c({loadType:"url",title:d.query.filename,docValue:""}),w=c(!1),b=c(!1),q=c(),P=async()=>{const t=await N({fileId:d.query.fileId});q.value=d.query.fileId;const e=URL.createObjectURL(t);V.value.docValue=e,R(V.value)},R=t=>{X.exports.GlobalWorkerOptions.workerSrc=z;const e=t.loadType,a=t.docValue;let i=null;if(e==="byBase64"){var o=a,f=J(o);i=f}else i=a;var S=X.exports.getDocument(i);S.promise.then(function(p){T.value=p.numPages,we(()=>{L(p,1)})},function(p){console.error(p)})},L=(t,e)=>{t&&t.getPage(e).then(function(a){const o=a.getViewport({scale:2}),f=document.getElementById("pageCanvas_"+e),S=f.getContext("2d");f.width=2380,f.height=3368,f.style.width=1190+"px";var p=document.getElementById("pageView_"+e);p.style.height=o.height/2+"px",p.style.width=o.width/2+"px",a.render({canvasContext:S,viewport:o}),e<T.value&&L(t,e+1)})},J=t=>{t=t.replace(/[\r\n]/g,"");var e=window.atob(t),a=e.length,i=new Uint8Array(new ArrayBuffer(a));for(let o=0;o<a;o++)i[o]=e.charCodeAt(o);return i},O=t=>{D.value.splice(t,1)},D=c([]),K=(t,e,a)=>{var i;if(console.log("start"),w.value||((i=D.value)==null?void 0:i.length)&&a)I.$message.warning("\u8BF7\u52FF\u91CD\u590D\u76D6\u7AE0\uFF01");else{const f=Object.assign({posX:0,posY:0},e);t.dataTransfer.setData("Text",JSON.stringify(f)),t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(t.target,62,62)}},H=(t,e)=>{console.log("end"),e>=0&&O(e)},M=t=>{console.log("enter")},W=t=>{t.preventDefault(),t.stopPropagation(),console.log("over")},Q=t=>{console.log("leave")},Z=(t,e)=>{if(t.preventDefault(),t.stopPropagation(),console.log("drop"),t.dataTransfer.getData("Text")){const a=JSON.parse(t.dataTransfer.getData("Text"));a.posX=t.offsetX,a.posY=842-t.offsetY,a.posPage=e,a.width=a.width||124,a.height=a.height||124,a.id="seal_"+Date.parse(new Date),a.left=t.offsetX-a.width/2,a.top=t.offsetY-a.height/2,a.fileUrl="222",D.value.push(a),console.log(a,"\u5370\u7AE0\u7B7E\u7F72\u76F8\u5173\u4FE1\u606F")}},A=c(),_=c({attachments:[]}),ee={comment:[{required:!0,message:"\u8BF7\u8F93\u5165\u610F\u89C1",trigger:"blur"}]};c(!1);const te=c(!1),ae=async t=>{!t||await t.validate(async e=>{if(e){const a={instanceId:d.query.instanceId,projectId:d.query.projectId,taskId:d.query.taskId,action:"PASS",auditInfo:{text:_.value.comment,attachments:_.value.attachments.map(o=>({fileId:o.response.data.id,fileName:o.response.data.originalFileName}))}};(await De(a)).data==="TASKID_ERROR"?(I.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),B.go(-1)):(P(),b.value=!0,I.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),te.value=!1)}})},j=c(!1),oe=async()=>{j.value=!0;const e=await be({...{posPage:1,posX:230,posY:680},notSealedFileId:q.value,appraisalId:d.query.appraisalId,projectCode:d.query.projectCode,signType:1}),a=await N({fileId:e.data}),i=URL.createObjectURL(a);V.value.docValue=i,R(V.value),j.value=!1,w.value=!0,(await ke({instanceId:d.query.instanceId,projectId:d.query.projectId,projectCode:d.query.projectCode,taskId:d.query.taskId,action:"PASS"})).data==="TASKID_ERROR"&&(I.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),B.go(-1))},se=c({}),le=async()=>{const t=await Ie(d.query.projectCode);se.value=t.data};return _e(()=>{b.value=d.query.isCommit==="true",P(),le()}),(t,e)=>{const a=u("CircleClose"),i=u("el-icon"),o=u("el-col"),f=u("el-popover"),S=u("el-card"),p=u("el-row"),ne=u("el-input"),F=u("el-form-item"),k=u("el-button"),re=u("el-upload"),ie=u("el-form"),de=u("el-dialog");return m(),v("div",je,[r(p,{gutter:8,class:ye(`h-full overflow-hidden ${w.value,""}`)},{default:l(()=>[r(o,{span:24,class:"h-full"},{default:l(()=>[y("div",qe,[(m(!0),v(E,null,U(T.value,s=>(m(),v("div",{id:`pageView_${s}`,key:s,class:"pageView",onDragenter:e[0]||(e[0]=n=>M(n)),onDragover:e[1]||(e[1]=n=>W(n)),onDragleave:e[2]||(e[2]=n=>Q(n)),onDrop:n=>Z(n,s)},[y("canvas",{id:`pageCanvas_${s}`,class:"pageCanvas"},null,8,Re),w.value?h("",!0):(m(),v("div",Le,[D.value.length>0?(m(!0),v(E,{key:0},U(D.value,(n,C)=>(m(),v("div",{key:C},[n.posPage===s?(m(),v("div",{key:0,id:`drag${n.id}`,class:"sealView",draggable:"true",style:me(`
- width: ${n.width}px;
- height: ${n.height}px;
- left: ${n.left}px;
- top: ${n.top}px;`),onDragstart:$=>K($,n,0),onDragend:$=>H($,C)},[y("img",{src:n.src,style:{width:"100%",height:"100%"}},null,8,Ae),y("p",{class:"sealDel",onClick:$=>O(C)},[r(i,null,{default:l(()=>[r(a)]),_:1})],8,Fe)],44,Oe)):h("",!0)]))),128)):h("",!0)]))],40,Pe))),128))])]),_:1}),h("",!0)]),_:1},8,["class"]),h("",!0),y("div",Ee,[w.value?h("",!0):(m(),ve(k,{key:0,type:"primary",loading:j.value,onClick:oe},{default:l(()=>e[17]||(e[17]=[x(" \u786E\u8BA4\u76D6\u7AE0 ")])),_:1},8,["loading"])),r(k,{onClick:e[8]||(e[8]=s=>g(B).go(-1))},{default:l(()=>e[18]||(e[18]=[x("\u8FD4\u56DE")])),_:1})]),r(de,{"model-value":!b.value,title:"\u586B\u5199\u5BA1\u6838\u610F\u89C1",width:"600px","destroy-on-close":"","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{footer:l(()=>[y("div",Ne,[r(k,{class:"ml-22",type:"primary",onClick:e[11]||(e[11]=s=>ae(A.value))},{default:l(()=>e[20]||(e[20]=[x(" \u63D0\u4EA4 ")])),_:1}),r(k,{onClick:e[12]||(e[12]=s=>t.$router.go(-1))},{default:l(()=>e[21]||(e[21]=[x(" \u8FD4\u56DE ")])),_:1})])]),default:l(()=>[r(ie,{ref_key:"formRef",ref:A,model:_.value,rules:ee,"label-width":"auto","label-suffix":":"},{default:l(()=>[r(p,null,{default:l(()=>[r(o,{span:24},{default:l(()=>[r(F,{label:"\u5BA1\u6838\u610F\u89C1",prop:"comment"},{default:l(()=>[r(ne,{modelValue:_.value.comment,"onUpdate:modelValue":e[9]||(e[9]=s=>_.value.comment=s),maxlength:"200",placeholder:"\u8BF7\u8F93\u5165","show-word-limit":"",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1}),r(o,{span:24},{default:l(()=>[r(F,{label:"\u9644\u4EF6",prop:"files"},{default:l(()=>[r(re,{"file-list":_.value.attachments,"onUpdate:fileList":e[10]||(e[10]=s=>_.value.attachments=s),class:"w-full",action:g(G),"on-success":s=>g(Ve)(s,_.value.attachments),"on-error":g(Se),"before-upload":s=>g($e)(s,{types:g(Y)}),accept:g(Y).map(s=>`.${s}`).join(","),multiple:"",limit:10,"on-preview":g(Be)},{tip:l(()=>[y("div",Ue,"\u652F\u6301"+he(g(Te))+"\u6587\u4EF6",1)]),default:l(()=>[r(k,{type:"primary",class:"mr-4"},{default:l(()=>e[19]||(e[19]=[x("\u4E0A\u4F20\u9644\u4EF6")])),_:1})]),_:1},8,["file-list","action","on-success","on-error","before-upload","accept","on-preview"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])])}}});export{We as default};
|