Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

6 rindas
7.4KB

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