選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

6 行
8.5KB

  1. import{d as me,O as _e,C as ve,B as Y,x as he,y as ye,r as u,o as we,c,e as _,f as h,h as d,i as n,g as y,F as H,H as M,R as Ce,k as C,G as Ie,n as De,j as V,u as m,t as ke,aF as Se,A as G,L as xe,ad as Te,ae as K,aG as Ve,aE as Pe,q as $e}from"./index.69f54c6b.js";import{S as je,p as z}from"./seal.acfc49d4.js";import{h as Oe,i as Be,f as be,c as J,b as qe,e as Re}from"./uploadAction.50e5c0fe.js";const Le={class:"footerPage"},Ue={id:"signContainer",class:"sign_content h-full"},Ae=["id","onDrop"],Ee=["id"],Fe={key:0},Ne=["id","onDragstart","onDragend"],Xe=["src"],Ye=["onClick"];const He={class:"footer"},Me={class:"el-upload__tip"},Ge={class:"flex justify-center"},Ke=me({name:"stamp"}),et=Object.assign(Ke,{setup(ze){const W=_e(()=>import("./pdf.worker.entry.f19ddaea.js").then(t=>t.p),[]),I=ve(Y.userStore).userInfo,{proxy:w}=$e(),r=he(),D=ye(),Q=Y.dictStore.uploadUrl,Je=u([{src:je}]),B=u(0),P=u({loadType:"url",title:r.query.filename,docValue:""}),k=u(!1),R=u(!1),L=u(),U=async()=>{var l,o;const t=await Se({projectId:r.query.projectId,auditOpinion:((l=g.value)==null?void 0:l.comment)||void 0});R.value=((o=t.data)==null?void 0:o.isCommit)||!1;const e=await G({fileId:t.data.fileId});L.value=t.data.fileId;const a=URL.createObjectURL(e);P.value.docValue=a,A(P.value)},A=t=>{z.exports.GlobalWorkerOptions.workerSrc=W;const e=t.loadType,a=t.docValue;let l=null;if(e==="byBase64"){var o=a,f=Z(o);l=f}else l=a;var j=z.exports.getDocument(l);j.promise.then(function(p){B.value=p.numPages,xe(()=>{E(p,1)})},function(p){console.error(p)})},E=(t,e)=>{t&&t.getPage(e).then(function(a){const o=a.getViewport({scale:2}),f=document.getElementById("pageCanvas_"+e),j=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:j,viewport:o}),e<B.value&&E(t,e+1)})},Z=t=>{t=t.replace(/[\r\n]/g,"");var e=window.atob(t),a=e.length,l=new Uint8Array(new ArrayBuffer(a));for(let o=0;o<a;o++)l[o]=e.charCodeAt(o);return l},F=t=>{S.value.splice(t,1)},S=u([]),ee=(t,e,a)=>{var l;if(console.log("start"),k.value||((l=S.value)==null?void 0:l.length)&&a)w.$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)}},te=(t,e)=>{console.log("end"),e>=0&&F(e)},ae=t=>{console.log("enter")},oe=t=>{t.preventDefault(),t.stopPropagation(),console.log("over")},se=t=>{console.log("leave")},le=(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",S.value.push(a),console.log(a,"\u5370\u7AE0\u7B7E\u7F72\u76F8\u5173\u4FE1\u606F")}},N=u(),g=u({attachments:[]}),ne={comment:[{required:!0,message:"\u8BF7\u8F93\u5165\u610F\u89C1",trigger:"blur"}]};u(!1);const re=u(!1),ie=async t=>{!t||await t.validate(async e=>{if(e){const a={instanceId:r.query.instanceId,projectId:r.query.projectId,taskId:r.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 Te(a)).data==="TASKID_ERROR"?(w.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),D.push({name:"waitMeToHandle"})):(U(),w.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),re.value=!1)}})},b=u(!1),de=async()=>{b.value=!0;let t={posPage:6,posX:487,posY:540};if(r.query.instName==="\u9879\u76EE\u9884\u5BA1\u5BA1\u6279\u6D41\u7A0B"&&(I.value.empPosUnitCode===q.value?t={posPage:6,posX:487,posY:540}:I.value.empPosUnitCode===$.value&&(t={posPage:6,posX:487,posY:380})),console.log(I.value.empPosUnitCode),console.log($.value),console.log(I.value.empPosUnitCode===$.value),console.log(t),r.query.instName==="\u9879\u76EE\u9884\u5BA1\u5BA1\u6279\u6D41\u7A0B"&&I.value.empPosUnitCode!==q.value&&!v.value.isHigherSuperOrg)(await K({instanceId:r.query.instanceId,projectId:r.query.projectId,projectCode:r.query.projectCode,taskId:r.query.taskId,action:"PASS"})).data==="TASKID_ERROR"?(w.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),D.push({name:"waitMeToHandle"})):(w.$message.success("\u7B7E\u7F72\u6210\u529F\uFF01"),D.go(-1));else{const e=await Ve({...t,notSealedFileId:L.value,projectId:r.query.projectId*1,signType:1}),a=await G({fileId:e.data}),l=URL.createObjectURL(a);P.value.docValue=l,A(P.value),b.value=!1,k.value=!0,(await K({instanceId:r.query.instanceId,projectId:r.query.projectId,projectCode:r.query.projectCode,taskId:r.query.taskId,action:"PASS"})).data==="TASKID_ERROR"&&(w.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),D.push({name:"waitMeToHandle"}))}},v=u({}),q=u(),$=u(),ue=async()=>{const t=await Pe(r.query.projectId);v.value=t.data,q.value=v.value.isSuperOrg?v.value.superOrgCode:v.value.buildOrgCode,$.value=v.value.isHigherSuperOrg?v.value.higherSuperOrgCode:""};return we(()=>{U(),ue()}),(t,e)=>{const a=c("CircleClose"),l=c("el-icon"),o=c("el-col"),f=c("el-popover"),j=c("el-card"),p=c("el-row"),ce=c("el-input"),X=c("el-form-item"),x=c("el-button"),pe=c("el-upload"),ge=c("el-form"),fe=c("el-dialog");return _(),h("div",Le,[d(p,{gutter:8,class:De(`h-full overflow-hidden ${k.value,""}`)},{default:n(()=>[d(o,{span:24,class:"h-full"},{default:n(()=>[y("div",Ue,[(_(!0),h(H,null,M(B.value,s=>(_(),h("div",{id:`pageView_${s}`,key:s,class:"pageView",onDragenter:e[0]||(e[0]=i=>ae(i)),onDragover:e[1]||(e[1]=i=>oe(i)),onDragleave:e[2]||(e[2]=i=>se(i)),onDrop:i=>le(i,s)},[y("canvas",{id:`pageCanvas_${s}`,class:"pageCanvas"},null,8,Ee),k.value?C("",!0):(_(),h("div",Fe,[S.value.length>0?(_(!0),h(H,{key:0},M(S.value,(i,T)=>(_(),h("div",{key:T},[i.posPage===s?(_(),h("div",{key:0,id:`drag${i.id}`,class:"sealView",draggable:"true",style:Ce(`
  2. width: ${i.width}px;
  3. height: ${i.height}px;
  4. left: ${i.left}px;
  5. top: ${i.top}px;`),onDragstart:O=>ee(O,i,0),onDragend:O=>te(O,T)},[y("img",{src:i.src,style:{width:"100%",height:"100%"}},null,8,Xe),y("p",{class:"sealDel",onClick:O=>F(T)},[d(l,null,{default:n(()=>[d(a)]),_:1})],8,Ye)],44,Ne)):C("",!0)]))),128)):C("",!0)]))],40,Ae))),128))])]),_:1}),C("",!0)]),_:1},8,["class"]),C("",!0),y("div",He,[k.value?C("",!0):(_(),Ie(x,{key:0,type:"primary",loading:b.value,onClick:de},{default:n(()=>e[17]||(e[17]=[V(" \u786E\u8BA4\u76D6\u7AE0 ")])),_:1},8,["loading"])),d(x,{onClick:e[8]||(e[8]=s=>m(D).go(-1))},{default:n(()=>e[18]||(e[18]=[V("\u8FD4\u56DE")])),_:1})]),d(fe,{"model-value":!R.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:n(()=>[y("div",Ge,[d(x,{class:"ml-22",type:"primary",onClick:e[11]||(e[11]=s=>ie(N.value))},{default:n(()=>e[20]||(e[20]=[V(" \u63D0\u4EA4 ")])),_:1}),d(x,{onClick:e[12]||(e[12]=s=>t.$router.go(-1))},{default:n(()=>e[21]||(e[21]=[V(" \u8FD4\u56DE ")])),_:1})])]),default:n(()=>[d(ge,{ref_key:"formRef",ref:N,model:g.value,rules:ne,"label-width":"auto","label-suffix":":"},{default:n(()=>[d(p,null,{default:n(()=>[d(o,{span:24},{default:n(()=>[d(X,{label:"\u5BA1\u6838\u610F\u89C1",prop:"comment"},{default:n(()=>[d(ce,{modelValue:g.value.comment,"onUpdate:modelValue":e[9]||(e[9]=s=>g.value.comment=s),maxlength:"200",placeholder:"\u8BF7\u8F93\u5165","show-word-limit":"",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1}),d(o,{span:24},{default:n(()=>[d(X,{label:"\u9644\u4EF6",prop:"files"},{default:n(()=>[d(pe,{"file-list":g.value.attachments,"onUpdate:fileList":e[10]||(e[10]=s=>g.value.attachments=s),class:"w-full",action:m(Q),"on-success":s=>m(Oe)(s,g.value.attachments),"on-error":m(Be),"before-upload":s=>m(be)(s,{types:m(J)}),accept:m(J).map(s=>`.${s}`).join(","),multiple:"",limit:10,"on-preview":m(qe)},{tip:n(()=>[y("div",Me,"\u652F\u6301"+ke(m(Re))+"\u6587\u4EF6",1)]),default:n(()=>[d(x,{type:"primary",class:"mr-4"},{default:n(()=>e[19]||(e[19]=[V("\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{et as default};