|
- var we=Object.defineProperty,De=Object.defineProperties;var Ie=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var ke=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable;var M=(f,u,l)=>u in f?we(f,u,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[u]=l,G=(f,u)=>{for(var l in u||(u={}))ke.call(u,l)&&M(f,l,u[l]);if(z)for(var l of z(u))Ce.call(u,l)&&M(f,l,u[l]);return f},Q=(f,u)=>De(f,Ie(u));var S=(f,u,l)=>new Promise((s,x)=>{var j=_=>{try{I(l.next(_))}catch(v){x(v)}},N=_=>{try{I(l.throw(_))}catch(v){x(v)}},I=_=>_.done?s(_.value):Promise.resolve(_.value).then(j,N);I((l=l.apply(f,u)).next())});import{_ as xe,d as Se,Q as Ve,u as Te,A as $e,D as qe,r as p,o as be,e as g,f as D,g as k,k as c,l as r,h as C,F as W,J as H,X as Be,i as V,I as Pe,n as je,m as b,t as Z,j as y,B as ee,ag as Ae,C as R,N as L,ah as Ee,ai as Fe,p as Re}from"./index.11dc4694.js";import{S as Le,p as ae}from"./seal.10cc9a60.js";import{a as Ne}from"./projectStore.913d3819.js";import{h as Oe,i as Ue,f as Xe,c as te,b as Ye,e as Je}from"./uploadAction.c865409e.js";import{g as Ke}from"./selfEvaluationSure.ce0f0388.js";const ze={class:"footerPage"},Me={id:"signContainer",class:"sign_content h-full"},Ge=["id","onDrop"],Qe=["id"],We={key:0},He=["id","onDragstart","onDragend"],Ze=["src"],ea=["onClick"];const aa={class:"footer"},ta={class:"el-upload__tip"},oa={class:"flex justify-center"},sa=Se({name:"stamp"}),la=Object.assign(sa,{setup(f){const u=Ve(()=>import("./pdf.worker.entry.f19ddaea.js").then(e=>e.p),[]),{proxy:l}=Re(),s=Te(),x=$e(),j=qe.dictStore.uploadUrl,N=p([{src:Le}]),I=p(0),_=p({loadType:"url",title:s.query.fileName,docValue:""}),v=p(!1),A=p(!1),E=p(),O=()=>S(this,null,function*(){let e;if(s.query.appraisalAuditType==="2"){const t=yield ee({fileId:s.query.fileId}),i=new File([t],s.query.fileName.replace(/\.[^/.]+$/,".pdf")||"\u6574\u6539\u8BA1\u5212\u76D6\u7AE0\u6587\u4EF6.pdf",{type:"application/pdf"}),o=new FormData;o.append("file",i);const m=yield Ae(o);e=yield R({fileId:m.data.id}),E.value=m.data.id}else e=yield R({fileId:s.query.fileId}),E.value=s.query.fileId;const a=URL.createObjectURL(e);_.value.docValue=a,yield L(),U(_.value)}),U=e=>{ae.exports.GlobalWorkerOptions.workerSrc=u;const a=e.loadType,t=e.docValue;let i=null;if(a==="byBase64"){var o=t,m=oe(o);i=m}else i=t;var B=ae.exports.getDocument(i);B.promise.then(function(h){I.value=h.numPages,L(()=>{X(h,1)})},function(h){console.error(h)})},X=(e,a)=>{e&&e.getPage(a).then(function(t){const o=t.getViewport({scale:2}),m=document.getElementById("pageCanvas_"+a),B=m.getContext("2d");m.width=2380,m.height=3368,m.style.width=1190+"px";var h=document.getElementById("pageView_"+a);h.style.height=o.height/2+"px",h.style.width=o.width/2+"px",t.render({canvasContext:B,viewport:o}),a<I.value&&X(e,a+1)})},oe=e=>{e=e.replace(/[\r\n]/g,"");var a=window.atob(e),t=a.length,i=new Uint8Array(new ArrayBuffer(t));for(let o=0;o<t;o++)i[o]=a.charCodeAt(o);return i},Y=e=>{T.value.splice(e,1)},T=p([]),se=(e,a,t)=>{var i;if(console.log("start"),v.value||((i=T.value)==null?void 0:i.length)&&t)l.$message.warning("\u8BF7\u52FF\u91CD\u590D\u76D6\u7AE0\uFF01");else{const m=Object.assign({posX:0,posY:0},a);e.dataTransfer.setData("Text",JSON.stringify(m)),e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(e.target,62,62)}},le=(e,a)=>{console.log("end"),a>=0&&Y(a)},ne=e=>{console.log("enter")},re=e=>{e.preventDefault(),e.stopPropagation(),console.log("over")},ie=e=>{console.log("leave")},de=(e,a)=>{if(e.preventDefault(),e.stopPropagation(),console.log("drop"),e.dataTransfer.getData("Text")){const t=JSON.parse(e.dataTransfer.getData("Text"));t.posX=e.offsetX,t.posY=842-e.offsetY,t.posPage=a,t.width=t.width||124,t.height=t.height||124,t.id="seal_"+Date.parse(new Date),t.left=e.offsetX-t.width/2,t.top=e.offsetY-t.height/2,t.fileUrl="222",T.value.push(t),console.log(t,"\u5370\u7AE0\u7B7E\u7F72\u76F8\u5173\u4FE1\u606F")}},J=p(),w=p({attachments:[],comment:"\u540C\u610F"}),ce={comment:[{required:!0,message:"\u8BF7\u8F93\u5165\u610F\u89C1",trigger:"blur"}]};p(!1);const ue=p(!1),pe=e=>S(this,null,function*(){!e||(yield e.validate(a=>S(this,null,function*(){if(a){const t={instanceId:s.query.instanceId,projectId:s.query.projectId,taskId:s.query.taskId,action:"PASS",auditInfo:{text:w.value.comment,attachments:w.value.attachments.map(o=>({fileId:o.response.data.id,fileName:o.response.data.originalFileName}))}};(yield Ee(t)).data==="TASKID_ERROR"?(l.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),x.go(-1)):(O(),A.value=!0,l.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),ue.value=!1)}})))}),F=p(!1),fe=()=>S(this,null,function*(){F.value=!0;let e={posPage:1,posX:230,posY:400};s.query.appraisalAuditType==="2"&&(e={posPage:1,posX:480,posY:400});const a=yield Ke(Q(G({},e),{notSealedFileId:E.value,appraisalId:s.query.appraisalId,projectCode:s.query.projectCode,signType:1}));let t;s.query.appraisalAuditType==="2"?t=yield ee({fileId:a.data}):t=yield R({fileId:a.data});const i=URL.createObjectURL(t);_.value.docValue=i,yield L(),U(_.value),F.value=!1,v.value=!0,(yield Fe({instanceId:s.query.instanceId,projectId:s.query.projectId,projectCode:s.query.projectCode,taskId:s.query.taskId,action:"PASS"})).data==="TASKID_ERROR"&&(l.$message.warning("\u5F53\u524D\u5BA1\u6279\u4EFB\u52A1\u6709\u53D8\u52A8\uFF0C\u8BF7\u8FD4\u56DE\u5F85\u6211\u5904\u7406\u5217\u8868\uFF01"),x.push({name:"selfEvaluationSure",query:{tab:"2"}}))}),_e=p({}),me=()=>S(this,null,function*(){const e=yield Ne(s.query.projectCode);_e.value=e.data});return be(()=>{A.value=s.query.isCommit==="true",O(),me()}),(e,a)=>{const t=g("CircleClose"),i=g("el-icon"),o=g("el-col"),m=g("el-popover"),B=g("el-card"),h=g("el-row"),ge=g("el-input"),K=g("el-form-item"),$=g("el-button"),ve=g("el-upload"),he=g("el-form"),ye=g("el-dialog");return D(),k("div",ze,[c(h,{gutter:8,class:je(`h-full overflow-hidden ${v.value,""}`)},{default:r(()=>[c(o,{span:24,class:"h-full"},{default:r(()=>[C("div",Me,[(D(!0),k(W,null,H(I.value,n=>(D(),k("div",{id:`pageView_${n}`,key:n,class:"pageView",onDragenter:a[0]||(a[0]=d=>ne(d)),onDragover:a[1]||(a[1]=d=>re(d)),onDragleave:a[2]||(a[2]=d=>ie(d)),onDrop:d=>de(d,n)},[C("canvas",{id:`pageCanvas_${n}`,class:"pageCanvas"},null,8,Qe),v.value?V("v-if",!0):(D(),k("div",We,[T.value.length>0?(D(!0),k(W,{key:0},H(T.value,(d,q)=>(D(),k("div",{key:q},[d.posPage===n?(D(),k("div",{key:0,id:`drag${d.id}`,class:"sealView",draggable:"true",style:Be(`
- width: ${d.width}px;
- height: ${d.height}px;
- left: ${d.left}px;
- top: ${d.top}px;`),onDragstart:P=>se(P,d,0),onDragend:P=>le(P,q)},[C("img",{src:d.src,style:{width:"100%",height:"100%"}},null,8,Ze),C("p",{class:"sealDel",onClick:P=>Y(q)},[c(i,null,{default:r(()=>[c(t)]),_:1})],8,ea)],44,He)):V("v-if",!0)]))),128)):V("v-if",!0)]))],40,Ge))),128))])]),_:1}),V("v-if",!0)]),_:1},8,["class"]),V("v-if",!0),C("div",aa,[v.value?V("v-if",!0):(D(),Pe($,{key:0,type:"primary",loading:F.value,onClick:fe},{default:r(()=>[b(" \u786E\u8BA4\u76D6\u7AE0 ")]),_:1},8,["loading"])),c($,{onClick:a[8]||(a[8]=n=>y(x).push({name:"selfEvaluationSure",query:{tab:"2"}}))},{default:r(()=>[b(Z(v.value?"\u5B8C\u6210":"\u8FD4\u56DE"),1)]),_:1})]),c(ye,{"model-value":!A.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:r(()=>[C("div",oa,[c($,{class:"ml-22",type:"primary",onClick:a[11]||(a[11]=n=>pe(J.value))},{default:r(()=>[b(" \u63D0\u4EA4 ")]),_:1}),c($,{onClick:a[12]||(a[12]=n=>e.$router.go(-1))},{default:r(()=>[b(" \u8FD4\u56DE ")]),_:1})])]),default:r(()=>[c(he,{ref_key:"formRef",ref:J,model:w.value,rules:ce,"label-width":"auto","label-suffix":":"},{default:r(()=>[c(h,null,{default:r(()=>[c(o,{span:24},{default:r(()=>[c(K,{label:"\u5BA1\u6838\u610F\u89C1",prop:"comment"},{default:r(()=>[c(ge,{modelValue:w.value.comment,"onUpdate:modelValue":a[9]||(a[9]=n=>w.value.comment=n),maxlength:"200",placeholder:"\u8BF7\u8F93\u5165","show-word-limit":"",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1}),c(o,{span:24},{default:r(()=>[c(K,{label:"\u9644\u4EF6",prop:"files"},{default:r(()=>[c(ve,{"file-list":w.value.attachments,"onUpdate:fileList":a[10]||(a[10]=n=>w.value.attachments=n),class:"w-full",action:y(j),"on-success":n=>y(Oe)(n,w.value.attachments),"on-error":y(Ue),"before-upload":n=>y(Xe)(n,{types:y(te)}),accept:y(te).map(n=>`.${n}`).join(","),multiple:"",limit:10,"on-preview":y(Ye)},{tip:r(()=>[C("div",ta,"\u652F\u6301"+Z(y(Je))+"\u6587\u4EF6",1)]),default:r(()=>[c($,{type:"primary",class:"mr-4"},{default:r(()=>[b("\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"])])}}}),pa=xe(la,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/pages/performanceEvaluation/selfEvaluationSure/stamp/index.vue"]]);export{pa as default};
|