Files
HJGL_DS/HJGL_DS/FineUIPro.Web/HJGL/JoinMarking/assets/main-Bwn31GA9.js
T
2026-05-20 16:22:55 +08:00

2 lines
39 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as e,r as t,w as n,c as l,o as a,a as o,b as i,t as s,d as r,v as u,e as d,n as c,f as p,g as v,h as f,i as m,j as g,k as y,P as x,l as b,m as h,p as w}from"./styles-CHbyqSHU.js";import"./pdfjs-HfNT2Y4W.js";import"./pdf-lib-D5zKcp81.js";const S={key:0,class:"annotation-detail-panel"},k={class:"panel-header"},C={class:"detail-content"},A={class:"detail-row"},F={class:"label-preview"},V={class:"detail-row"},P={class:"detail-row"},U={class:"detail-row"},D={class:"detail-row"},z={class:"detail-row"},E={key:0,class:"detail-row"},I={key:1,class:"detail-row"},R={class:"detail-row"},N={class:"detail-row readonly"},j={class:"detail-row readonly"},O={style:{"margin-top":"16px","padding-top":"12px","border-top":"1px solid #e5e7eb"}},T={style:{display:"flex","flex-direction":"column",gap:"8px"}},$={style:{display:"none",gap:"8px","flex-wrap":"wrap"}},B={style:{display:"none",gap:"8px","flex-wrap":"wrap"}},L={style:{display:"flex","align-items":"center",gap:"6px"}},J={style:{border:"1px solid #bae6fd","border-radius":"6px",padding:"10px 10px 8px",background:"#f0f9ff"}},_={style:{display:"flex","flex-direction":"column",gap:"6px"}},M={width:"28",height:"28",viewBox:"0 0 28 28",style:{"flex-shrink":"0"}},X={width:"28",height:"28",viewBox:"0 0 28 28",style:{"flex-shrink":"0"}},Y={width:"28",height:"28",viewBox:"0 0 28 28",style:{"flex-shrink":"0"}},W={style:{display:"flex","flex-direction":"column",gap:"10px","margin-bottom":"12px"}},Z={style:{display:"flex","flex-direction":"column",gap:"6px"}},q={style:{display:"flex","align-items":"center",gap:"8px"}},G={style:{display:"flex","align-items":"center",gap:"8px"}},H={style:{display:"flex","align-items":"center",gap:"8px"}},K={style:{display:"flex","align-items":"center",gap:"8px"}},Q={style:{display:"flex","align-items":"center",gap:"8px"}},ee={style:{display:"flex","align-items":"center",gap:"8px","flex-wrap":"wrap"}},te={style:{display:"flex","align-items":"center",gap:"8px","flex-wrap":"wrap"}},ne={style:{display:"none","flex-direction":"column","margin-top":"24px","padding-top":"16px","border-top":"1px solid #e5e7eb"}},le={style:{"margin-bottom":"12px"}},ae={style:{"margin-bottom":"12px"}},oe=e({__name:"LeftPanel",props:{autoAnnotating:{type:Boolean,default:!1},selectedAnnotation:{type:Object,default:null},selectedAnnotationPage:{type:Number,default:null},selectedAnnotationIndex:{type:Number,default:null},annotationsJson:{type:String,default:"{}"},initialCsvData:{type:String,default:""}},emits:["file-selected","open-pdf","save-pdf-editable","saveas-pdf-editable","save-pdf-final","export-csv","export-json","import-annotations","import-csv","import-image","undo-annotation","clear-page-annotations","delete-selected-annotation","apply-settings","update-annotation","delete-annotation","deselect-annotation","load-pdf-url","renumber-page-annotations","auto-annotate-page"],setup(e,{emit:m}){const g=e,y=m,x=t(0),b=t(""),h=t(""),w=t(10),oe=t(!1),ie=t(""),se=t(""),re=t("");function ue(){if(!g.selectedAnnotation)return;const e={...g.selectedAnnotation,displayValue:x.value,settings:{...g.selectedAnnotation.settings,prefix:b.value,suffix:h.value,fontSize:w.value},completed:oe.value,completedTime:oe.value?ie.value:"",completedBy:oe.value?se.value:"",note:re.value};y("update-annotation",e)}function de(){confirm("确定要删除这个标注吗?")&&y("delete-annotation")}n(()=>g.selectedAnnotation,e=>{e&&(x.value=e.displayValue||0,b.value=e.settings?.prefix??"",h.value=e.settings?.suffix??"",w.value=e.settings?.fontSize??10,oe.value=e.completed||!1,ie.value=e.completedTime||"",se.value=e.completedBy||"",re.value=e.note||"")},{immediate:!0,deep:!0});const ce=t(null),pe=t(null),ve=t(null),fe=t(null),me=t(1),ge=t(1),ye=t(""),xe=t(""),be=t("hexagon"),he=t(10),we=t("none"),Se=t("circle-outline"),ke=t(!0),Ce=t(80),Ae=t("测试数据A,测试数据B,测试数据C,测试数据D,测试数据E\n13213213,13213213,13213213,13213213,13213213\n312321312,312321312,312321312,312321312,312321312\n611429411,611429411,611429411,611429411,611429411\n910537510,910537510,910537510,910537510,910537510\n1209645609,1209645609,1209645609,1209645609,1209645609\n1508753708,1508753708,1508753708,1508753708,1508753708\n1807861807,1807861807,1807861807,1807861807,1807861807\n2106969906,2106969906,2106969906,2106969906,2106969906\n2406078005,2406078005,2406078005,2406078005,2406078005\n2705186104,2705186104,2705186104,2705186104,2705186104\n3004294203,3004294203,3004294203,3004294203,3004294203\n3303402302,3303402302,3303402302,3303402302,3303402302\n3602510401,3602510401,3602510401,3602510401,3602510401\n3901618500,3901618500,3901618500,3901618500,3901618500\n4200726599,4200726599,4200726599,4200726599,4200726599\n4499834698,4499834698,4499834698,4499834698,4499834698\n4798942797,4798942797,4798942797,4798942797,4798942797\n5098050896,5098050896,5098050896,5098050896,5098050896\n5397158995,5397158995,5397158995,5397158995,5397158995\n5696267094,5696267094,5696267094,5696267094,5696267094\n5995375193,5995375193,5995375193,5995375193,5995375193\n6294483292,6294483292,6294483292,6294483292,6294483292\n6593591391,6593591391,6593591391,6593591391,6593591391"),Fe=t(""),Ve=t("{}"),Pe=t(!1),Ue=t(""),De=t("");n(()=>g.annotationsJson,e=>{e&&(Ve.value=e)},{immediate:!0}),n(()=>g.initialCsvData,e=>{e&&e.trim()&&(Ae.value=e,console.log("CSV table data updated from props:",e.substring(0,100)+"..."))},{immediate:!0}),n(Ve,e=>{try{const t=document.getElementById("hdworkRecord");t&&(t.value=e||"{}",console.log("Synced JSON data to workRecord-inputEl:",e?.substring(0,100)+"..."))}catch(t){console.warn("Error syncing to workRecord-inputEl:",t)}},{immediate:!0});let ze=null;function Ee(e){const t=e.target.files&&e.target.files[0];t&&y("file-selected",t)}function Ie(){ce.value&&(ce.value.value="",ce.value.click()),y("open-pdf")}async function Re(){if(Fe.value&&Ve.value.trim()){Pe.value=!0,Ue.value="";try{let t;try{t=JSON.parse(Ve.value)}catch(e){throw new Error("JSON 格式错误: "+e.message)}const n=await async function(e,t){try{const n=await fetch("http://localhost:8000/api/pdf/process",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e,pdfPath:t,timestamp:(new Date).toISOString()})});if(!n.ok)throw new Error(`API Error: ${n.status} ${n.statusText}`);return await n.json()}catch(n){throw console.error("API call failed:",n),n}}(t,Fe.value);Ue.value="提交成功!",De.value="success",console.log("API Response:",n)}catch(t){Ue.value="错误: "+(t.message||"网络请求失败"),De.value="error",console.error("Submit failed:",t)}finally{Pe.value=!1}}}function Ne(){confirm("确定要清除本页所有标注吗?此操作不可撤销。")&&y("clear-page-annotations")}function je(){y("export-csv")}function Oe(){y("export-json")}function Te(){pe.value&&(pe.value.value="",pe.value.click())}function $e(){ve.value&&(ve.value.value="",ve.value.click())}function Be(e){const t=e.target.files&&e.target.files[0];t&&y("import-annotations",t)}function Le(e){const t=e.target.files&&e.target.files[0];t&&y("import-csv",t)}function Je(){fe.value&&(fe.value.value="",fe.value.click())}function _e(e){const t=e.target.files&&e.target.files[0];t&&y("import-image",{file:t,size:Ce.value})}async function Me(e){if(e&&e.trim())try{const t=await fetch(e);if(!t.ok)throw new Error(`获取失败: ${t.status}`);const n=await t.blob(),l=new FileReader;l.onload=e=>{const t=e.target.result;console.log("图片加载成功,大小:",t.length,"字节"),y("import-image",{file:null,imageData:t,size:400})},l.onerror=()=>{throw new Error("读取图片数据失败")},l.readAsDataURL(n)}catch(t){console.error("导入图片错误:",t),alert("导入图片失败: "+t.message)}else alert("图片URL为空")}async function Xe(){const e=document.getElementById("imgurl1");if(!e)return void alert("未找到 imgurl1 元素");const t=e.value?.trim();t?await Me(t):alert("imgurl1 的值为空")}async function Ye(){const e=document.getElementById("imgurl2");if(!e)return void alert("未找到 imgurl2 元素");const t=e.value?.trim();t?await Me(t):alert("imgurl2 的值为空")}async function We(){const e=Ae.value.trim();if(e)try{console.log("开始生成表格图片,CSV 数据:",e.substring(0,100));const{imageUrl:t,width:n}=await async function(e){return new Promise((t,n)=>{try{const n=e.trim().split("\n").map(e=>e.split(",").map(e=>e.trim()));if(0===n.length)throw new Error("CSV 数据为空");const l=document.createElement("canvas").getContext("2d"),a=12,o=12,i=35,s=30,r=15,u=15,d=r+u;l.font=`${o}px Arial`;const c=n[0].length,p=new Array(c).fill(0);for(const e of n)e.forEach((e,t)=>{const n=l.measureText(String(e)).width;p[t]=Math.max(p[t],n+2*a)});const v=60;for(let e=0;e<p.length;e++)p[e]=Math.max(p[e],v);const f=p.reduce((e,t)=>e+t,0),m=f+d,g=i+n.length*s+2,y=document.createElement("canvas"),x=y.getContext("2d");y.width=m,y.height=g,x.fillStyle="#ffffff",x.fillRect(0,0,m,g),x.font=`${o}px Arial`,x.textAlign="center",x.textBaseline="middle",x.strokeStyle="#000000",x.lineWidth=1,x.fillStyle="#334155",x.fillRect(r,0,f,i);const b=[r];for(let e=0;e<c;e++)b.push(b[e]+p[e]);x.fillStyle="#ffffff",n[0].forEach((e,t)=>{const n=b[t]+p[t]/2,l=i/2;x.fillText(e,n,l)});for(let e=1;e<n.length;e++){const t=n[e],l=i+(e-1)*s;e%2==0&&(x.fillStyle="#f3f4f6",x.fillRect(r,l,f,s)),x.fillStyle="#000000",t.forEach((e,t)=>{const n=b[t]+p[t]/2,a=l+s/2;x.fillText(String(e),n,a)})}x.strokeStyle="#d1d5db",x.lineWidth=.5;for(let e=0;e<=c;e++){const t=b[e];x.beginPath(),x.moveTo(t,0),x.lineTo(t,g),x.stroke()}for(let e=0;e<=n.length;e++){const t=(0===e?0:i)+e*s;x.beginPath(),x.moveTo(r,t),x.lineTo(m-u,t),x.stroke()}t({imageUrl:y.toDataURL("image/png"),width:m})}catch(l){n(l)}})}(e);console.log("表格图片生成成功,大小:",t.length,"字节,宽度:",n),y("import-image",{file:null,imageData:t,size:n})}catch(t){console.error("生成表格图片错误:",t),alert("生成表格图片失败: "+t.message)}else alert("请先输入 CSV 数据")}return n(Fe,(e,t)=>{ze&&clearTimeout(ze),e&&e.trim()&&(ze=setTimeout(()=>{const t=e.trim();(t.startsWith("http://")||t.startsWith("https://"))&&y("load-pdf-url",t)},500))},{immediate:!0}),n([me,ge,ye,xe,he,we,Se],()=>{y("apply-settings",{startNumber:me.value,increment:ge.value,prefix:ye.value,suffix:xe.value,fontSize:he.value,borderStyle:we.value,annotationStyle:Se.value,highDpi:!!ke.value})}),(t,n)=>(a(),l("div",null,[e.selectedAnnotation?(a(),l("div",S,[i("div",k,[n[30]||(n[30]=i("h3",{style:{margin:"0","font-size":"14px"}},"标注详情",-1)),i("div",{class:"btn close-btn",onClick:n[0]||(n[0]=e=>y("deselect-annotation")),title:"关闭"},"×")]),i("div",C,[i("div",A,[n[31]||(n[31]=i("label",null,"标签内容:",-1)),i("div",F,s(b.value)+s(x.value)+s(h.value),1)]),i("div",V,[n[32]||(n[32]=i("label",null,"编号:",-1)),r(i("input",{"onUpdate:modelValue":n[1]||(n[1]=e=>x.value=e),type:"number",min:"0",class:"detail-input"},null,512),[[u,x.value,void 0,{number:!0}]])]),i("div",P,[n[33]||(n[33]=i("label",null,"前缀:",-1)),r(i("input",{"onUpdate:modelValue":n[2]||(n[2]=e=>b.value=e),type:"text",class:"detail-input"},null,512),[[u,b.value]])]),i("div",U,[n[34]||(n[34]=i("label",null,"后缀:",-1)),r(i("input",{"onUpdate:modelValue":n[3]||(n[3]=e=>h.value=e),type:"text",class:"detail-input"},null,512),[[u,h.value]])]),i("div",D,[n[35]||(n[35]=i("label",null,"字体大小:",-1)),r(i("input",{"onUpdate:modelValue":n[4]||(n[4]=e=>w.value=e),type:"number",min:"6",max:"72",class:"detail-input"},null,512),[[u,w.value,void 0,{number:!0}]])]),n[43]||(n[43]=i("div",{class:"detail-divider"},null,-1)),i("div",z,[n[37]||(n[37]=i("label",null,"状态:",-1)),r(i("select",{"onUpdate:modelValue":n[5]||(n[5]=e=>oe.value=e),class:"detail-input"},[...n[36]||(n[36]=[i("option",{value:!1},"未完成",-1),i("option",{value:!0},"已完成",-1)])],512),[[d,oe.value]])]),oe.value?(a(),l("div",E,[n[38]||(n[38]=i("label",null,"完成时间:",-1)),r(i("input",{"onUpdate:modelValue":n[6]||(n[6]=e=>ie.value=e),type:"datetime-local",class:"detail-input"},null,512),[[u,ie.value]])])):o("",!0),oe.value?(a(),l("div",I,[n[39]||(n[39]=i("label",null,"完成人:",-1)),r(i("input",{"onUpdate:modelValue":n[7]||(n[7]=e=>se.value=e),type:"text",placeholder:"输入完成人姓名",class:"detail-input"},null,512),[[u,se.value]])])):o("",!0),i("div",R,[n[40]||(n[40]=i("label",null,"备注:",-1)),r(i("textarea",{"onUpdate:modelValue":n[8]||(n[8]=e=>re.value=e),placeholder:"添加备注...",class:"detail-textarea"},null,512),[[u,re.value]])]),i("div",N,[n[41]||(n[41]=i("label",null,"页码:",-1)),i("span",null,"第 "+s(e.selectedAnnotationPage)+" 页",1)]),i("div",j,[n[42]||(n[42]=i("label",null,"位置:",-1)),i("span",null,"X: "+s(Math.round(e.selectedAnnotation.x))+", Y: "+s(Math.round(e.selectedAnnotation.y)),1)]),i("div",{class:"detail-actions"},[i("div",{class:"btn btn-primary",onClick:ue},"保存修改"),i("div",{class:"btn btn-danger",onClick:de},"删除标注")])])])):o("",!0),i("div",O,[n[53]||(n[53]=i("h3",{style:{margin:"0 0 12px 0"}},"设置",-1)),i("div",T,[i("input",{ref_key:"fileInput",ref:ce,type:"file",accept:"application/pdf",onChange:Ee,style:{display:"none"}},null,544),i("input",{ref_key:"jsonInput",ref:pe,type:"file",accept:"application/json,.json",onChange:Be,style:{display:"none"}},null,544),i("input",{ref_key:"csvInput",ref:ve,type:"file",accept:"text/csv,.csv",onChange:Le,style:{display:"none"}},null,544),i("input",{ref_key:"imageInput",ref:fe,type:"file",accept:"image/*",onChange:_e,style:{display:"none"}},null,544),i("div",$,[i("div",{class:"btn btn-primary",onClick:Ie},"打开PDF"),i("div",{class:"btn btn-primary",onClick:n[9]||(n[9]=e=>y("save-pdf-editable"))},"保存PDF"),i("div",{class:"btn btn-secondary",onClick:je},"导出CSV"),i("div",{class:"btn btn-secondary",onClick:Oe},"导出JSON"),i("div",{class:"btn btn-secondary",onClick:Te},"导入JSON"),i("div",{class:"btn btn-secondary",onClick:$e},"导入CSV")]),i("div",B,[n[44]||(n[44]=i("label",{style:{display:"block","font-size":"12px","margin-bottom":"4px",color:"#6b7280"}},"CSV 表格数据",-1)),r(i("textarea",{"onUpdate:modelValue":n[10]||(n[10]=e=>Ae.value=e),placeholder:"粘贴或输入CSV数据",style:{width:"100%",height:"80px",padding:"6px",border:"1px solid #d1d5db","border-radius":"4px","font-size":"12px","font-family":"monospace",resize:"vertical"}},null,512),[[u,Ae.value]])]),i("div",{style:{"margin-bottom":"8px"}},[i("div",{class:"btn btn-secondary",onClick:We,style:{width:"100%"}},"图表导入")]),i("div",L,[r(i("input",{"onUpdate:modelValue":n[11]||(n[11]=e=>Ce.value=e),type:"number",min:"30",max:"300",style:{display:"none",width:"60px",padding:"4px 6px",border:"1px solid #d1d5db","border-radius":"4px","font-size":"12px"},placeholder:"大小",title:"图片默认大小(px)"},null,512),[[u,Ce.value,void 0,{number:!0}]]),i("div",{class:"btn btn-secondary",onClick:Je,style:{flex:"1"}},"导入图片")]),i("div",{style:{display:"flex",gap:"6px"}},[i("div",{class:"btn btn-secondary",onClick:Xe,style:{flex:"1"}},"图片导入1"),i("div",{class:"btn btn-secondary",onClick:Ye,style:{flex:"1"}},"图片导入2")]),i("div",{class:"btn btn-secondary",onClick:n[12]||(n[12]=e=>y("undo-annotation"))},"撤销上一标注"),i("div",J,[n[51]||(n[51]=i("div",{style:{"font-size":"13px","font-weight":"600",color:"#0369a1","margin-bottom":"8px"}},"焊缝自动标注",-1)),i("div",{class:"btn",onClick:n[13]||(n[13]=e=>!g.autoAnnotating&&y("auto-annotate-page",be.value)),style:c({width:"100%",background:g.autoAnnotating?"#7dd3fc":"#0ea5e9",color:"#fff",marginBottom:"10px",cursor:g.autoAnnotating?"not-allowed":"pointer",opacity:g.autoAnnotating?.8:1,border:"none",borderRadius:"4px",padding:"8px"})},s(g.autoAnnotating?"検测中…":"自动标注本页"),5),n[52]||(n[52]=i("div",{style:{"font-size":"12px",color:"#6b7280","margin-bottom":"6px"}},"焊口样式:",-1)),i("div",_,[i("label",{style:c([{display:"flex","align-items":"center",gap:"8px",cursor:"pointer",padding:"4px 6px","border-radius":"4px"},"hexagon"===be.value?"background:#e0f2fe;border:1px solid #0ea5e9":"border:1px solid transparent"])},[r(i("input",{type:"radio",value:"hexagon","onUpdate:modelValue":n[14]||(n[14]=e=>be.value=e),style:{margin:"0"}},null,512),[[p,be.value]]),(a(),l("svg",M,[...n[45]||(n[45]=[i("polygon",{points:"14,2 25,8 25,20 14,26 3,20 3,8",fill:"#334155",stroke:"#334155","stroke-width":"1"},null,-1),i("text",{x:"14",y:"18","text-anchor":"middle",fill:"#fff","font-size":"10","font-weight":"bold"},"1",-1)])])),n[46]||(n[46]=i("span",{style:{"font-size":"13px"}},"6边型",-1))],4),i("label",{style:c([{display:"flex","align-items":"center",gap:"8px",cursor:"pointer",padding:"4px 6px","border-radius":"4px"},"hexagon-outline"===be.value?"background:#e0f2fe;border:1px solid #0ea5e9":"border:1px solid transparent"])},[r(i("input",{type:"radio",value:"hexagon-outline","onUpdate:modelValue":n[15]||(n[15]=e=>be.value=e),style:{margin:"0"}},null,512),[[p,be.value]]),(a(),l("svg",X,[...n[47]||(n[47]=[i("polygon",{points:"14,2 25,8 25,20 14,26 3,20 3,8",fill:"#fff",stroke:"#334155","stroke-width":"2"},null,-1),i("text",{x:"14",y:"18","text-anchor":"middle",fill:"#334155","font-size":"10","font-weight":"bold"},"1",-1)])])),n[48]||(n[48]=i("span",{style:{"font-size":"13px"}},"空心6边型",-1))],4),i("label",{style:c([{display:"flex","align-items":"center",gap:"8px",cursor:"pointer",padding:"4px 6px","border-radius":"4px"},"circle"===be.value?"background:#e0f2fe;border:1px solid #0ea5e9":"border:1px solid transparent"])},[r(i("input",{type:"radio",value:"circle","onUpdate:modelValue":n[16]||(n[16]=e=>be.value=e),style:{margin:"0"}},null,512),[[p,be.value]]),(a(),l("svg",Y,[...n[49]||(n[49]=[i("circle",{cx:"14",cy:"14",r:"12",fill:"#334155",stroke:"#334155","stroke-width":"1"},null,-1),i("text",{x:"14",y:"18","text-anchor":"middle",fill:"#fff","font-size":"10","font-weight":"bold"},"1",-1)])])),n[50]||(n[50]=i("span",{style:{"font-size":"13px"}},"圆形",-1))],4)])]),i("div",{class:"btn btn-primary",onClick:n[17]||(n[17]=e=>y("renumber-page-annotations")),style:{background:"#0ea5e9",color:"#fff"}},"按设置重新标注"),i("div",{class:"btn btn-danger",onClick:Ne},"清除本页标注")])]),i("div",W,[i("div",Z,[i("div",q,[n[54]||(n[54]=i("label",{style:{"min-width":"70px"}},"起始编号:",-1)),r(i("input",{"onUpdate:modelValue":n[18]||(n[18]=e=>me.value=e),type:"number",min:"0",style:{flex:"1"}},null,512),[[u,me.value,void 0,{number:!0}]])]),i("div",G,[n[55]||(n[55]=i("label",{style:{"min-width":"70px"}},"增量:",-1)),r(i("input",{"onUpdate:modelValue":n[19]||(n[19]=e=>ge.value=e),type:"number",min:"1",style:{flex:"1"}},null,512),[[u,ge.value,void 0,{number:!0}]])]),i("div",H,[n[56]||(n[56]=i("label",{style:{"min-width":"70px"}},"前缀:",-1)),r(i("input",{"onUpdate:modelValue":n[20]||(n[20]=e=>ye.value=e),type:"text",style:{flex:"1"}},null,512),[[u,ye.value]])]),i("div",K,[n[57]||(n[57]=i("label",{style:{"min-width":"70px"}},"后缀:",-1)),r(i("input",{"onUpdate:modelValue":n[21]||(n[21]=e=>xe.value=e),type:"text",style:{flex:"1"}},null,512),[[u,xe.value]])]),i("div",Q,[n[58]||(n[58]=i("label",{style:{"min-width":"70px"}},"字体大小:",-1)),r(i("input",{"onUpdate:modelValue":n[22]||(n[22]=e=>he.value=e),type:"number",min:"6",max:"72",step:"1",style:{width:"120px"}},null,512),[[u,he.value,void 0,{number:!0}]])]),i("div",ee,[n[61]||(n[61]=i("label",{style:{"min-width":"70px"}},"边框样式:",-1)),i("label",null,[r(i("input",{type:"radio",value:"none","onUpdate:modelValue":n[23]||(n[23]=e=>we.value=e)},null,512),[[p,we.value]]),n[59]||(n[59]=v(" 无",-1))]),i("label",null,[r(i("input",{type:"radio",value:"rect","onUpdate:modelValue":n[24]||(n[24]=e=>we.value=e)},null,512),[[p,we.value]]),n[60]||(n[60]=v(" 矩形",-1))])]),i("div",te,[n[65]||(n[65]=i("label",{style:{"min-width":"70px"}},"标注样式:",-1)),i("label",null,[r(i("input",{type:"radio",value:"circle-outline","onUpdate:modelValue":n[25]||(n[25]=e=>Se.value=e)},null,512),[[p,Se.value]]),n[62]||(n[62]=v(" 圆圈",-1))]),i("label",null,[r(i("input",{type:"radio",value:"arrow","onUpdate:modelValue":n[26]||(n[26]=e=>Se.value=e)},null,512),[[p,Se.value]]),n[63]||(n[63]=v(" 箭头",-1))]),i("label",null,[r(i("input",{type:"radio",value:"dot","onUpdate:modelValue":n[27]||(n[27]=e=>Se.value=e)},null,512),[[p,Se.value]]),n[64]||(n[64]=v(" 圆点",-1))])])])]),i("div",ne,[n[68]||(n[68]=i("h4",{style:{margin:"0 0 12px 0"}},"网络接口",-1)),i("div",le,[n[66]||(n[66]=i("label",{style:{display:"block","font-size":"12px","margin-bottom":"4px",color:"#6b7280"}},"PDF 目录路径",-1)),r(i("input",{"onUpdate:modelValue":n[28]||(n[28]=e=>Fe.value=e),type:"text",placeholder:"/path/to/pdf",style:{width:"100%",padding:"6px",border:"1px solid #d1d5db","border-radius":"4px","font-size":"12px"}},null,512),[[u,Fe.value]])]),i("div",ae,[n[67]||(n[67]=i("label",{style:{display:"block","font-size":"12px","margin-bottom":"4px",color:"#6b7280"}},"数据 (JSON)",-1)),r(i("textarea",{"onUpdate:modelValue":n[29]||(n[29]=e=>Ve.value=e),placeholder:'{"key":"value"}',style:{width:"100%",height:"100px",padding:"6px",border:"1px solid #d1d5db","border-radius":"4px","font-size":"12px","font-family":"monospace",resize:"vertical"}},null,512),[[u,Ve.value]])]),i("div",{class:f(["btn",{disabled:!Fe.value||!Ve.value}]),onClick:Re,style:{width:"100%",padding:"8px",background:"#3b82f6",color:"white",border:"none","border-radius":"4px",cursor:"pointer","font-size":"14px"}},s(Pe.value?"提交中...":"提交数据"),3),Ue.value?(a(),l("div",{key:0,style:c({marginTop:"8px",padding:"8px",borderRadius:"4px",fontSize:"12px",color:"success"===De.value?"#10b981":"#ef4444",background:"success"===De.value?"#d1fae5":"#fee2e2"})},s(Ue.value),5)):o("",!0)])]))}},[["__scopeId","data-v-bd4e31be"]]);function ie(e){const t=[];let n="",l=!1;for(let a=0;a<e.length;a++){const o=e[a],i=e[a+1];'"'===o?l&&'"'===i?(n+='"',a++):l=!l:","!==o||l?n+=o:(t.push(n.trim()),n="")}return t.push(n.trim()),t}const se={class:"container"},re={class:"left"},ue={class:"right"},de={class:"controls"},ce=["disabled"],pe={style:{"min-width":"54px","text-align":"center"}},ve=["max"],fe={style:{"margin-left":"4px"}},me={key:0,style:{display:"flex","align-items":"center",gap:"12px","margin-left":"8px","font-size":"12px",color:"#6b7280"}},ge={class:"viewer"},ye="http://localhost:8000/api/weld";w({__name:"App",setup(e){const d=t(null),p=t(null),w=t(0),S=t(1),k=t(1),C=t(!1),A=t(null),F=t(""),V=t(""),P=t({}),U=t("{}"),D=t(""),z=t(null),E=t(null),I=t(null);function R(e){e?(z.value={...e.annotation},E.value=e.page,I.value=e.index):(z.value=null,E.value=null,I.value=null),W()}function N(e){A.value&&null!==E.value&&null!==I.value&&(A.value.updateAnnotation(E.value,I.value,e),z.value={...e},B("标注已更新"),W())}function j(){A.value&&null!==E.value&&null!==I.value&&(A.value.deleteAnnotation(E.value,I.value),z.value=null,E.value=null,I.value=null,B("标注已删除"),W())}function O(){z.value=null,E.value=null,I.value=null,A.value&&A.value.clearSelection()}const T=t({show:!1,message:"",type:"success"});let $=null;function B(e,t="success"){T.value={show:!0,message:e,type:t},clearTimeout($),$=setTimeout(()=>{T.value.show=!1},2500)}let L=null;const J=t(null),_=t(100),M=t(1),X=m(()=>{const e=null!==J.value?J.value:M.value;return Math.round(100*e)}),Y=m(()=>{if(!A.value)return 0;const e=A.value.getAnnotations();let t=0;for(const n in e)t+=e[n].length;return t});function W(){if(A.value&&F.value)try{const e=A.value.getAnnotations();U.value=function(e,t,n){const l={version:"1.0",exportDate:(new Date).toISOString(),sourceFile:n,globalSettings:t,annotations:{}};for(const a in e){const n=e[a];Array.isArray(n)&&n.length>0&&(l.annotations[a]=n.map(e=>{const n=e.settings?.prefix??t.prefix??"",l=e.settings?.suffix??t.suffix??"",a=n+e.displayValue+l;return{x:e.x,y:e.y,x2:e.x2,y2:e.y2,displayValue:e.displayValue,label:a,style:e.style,annotationStyle:e.annotationStyle}}))}return JSON.stringify(l,null,2)}(e,{startNumber:ee.value,increment:te.value,prefix:ne.value,suffix:le.value,fontSize:ae.value,borderStyle:K.value,annotationStyle:Q.value},F.value)}catch(e){console.error("Failed to generate annotations JSON:",e)}else U.value="{}"}function Z(e){d.value=e,F.value=e.name,S.value=1,k.value=1,J.value=1,_.value=100;const t=new FileReader;t.onload=e=>{L=e.target.result},t.readAsArrayBuffer(e),async function(e){ke.value="vector";try{const t=new FormData;t.append("pdf",e);const n=await fetch(`${ye}/pdf-type`,{method:"POST",body:t});if(n.ok){const e=await n.json();ke.value=e.type||"vector"}}catch(t){console.warn("PDF类型检测失败,使用默认矢量模式:",t)}}(e)}function q(e){p.value=e.pdf,w.value=e.numPages,S.value=1,k.value=1}function G(e){M.value=e}function H(e){J.value=e,_.value=Math.round(100*e)}const K=t("none"),Q=t("circle-outline"),ee=t(1),te=t(1),ne=t(""),le=t(""),ae=t(10);function xe(e){K.value=e.borderStyle,Q.value=e.annotationStyle,ee.value=e.startNumber,te.value=e.increment,ne.value=e.prefix,le.value=e.suffix,ae.value=e.fontSize,B("设置已应用")}function be(){J.value=+_.value/100}function he(){A.value&&(A.value.clearCurrentPageAnnotations(),W())}function we(){A.value&&(A.value.renumberCurrentPageAnnotations(ee.value,te.value,ne.value,le.value,ae.value),W(),B("本页焊口编号已重新设置"))}const Se=t(!1),ke=t("vector");async function Ce(e){if(d.value){Se.value=!0;try{let t;t="hexagon"===e?"vector"===ke.value?"detect-vector-hexagon-2":"detect-solid-hexagon":"hexagon-outline"===e?"detect-vector":"circle"===e?"detect-vector-circle":"detect-vector-hexagon-2";const n=new FormData;n.append("pdf",d.value),n.append("page",String(S.value)),"detect"===t&&(n.append("sensitivity","70"),n.append("min_size","20"),n.append("dpi","100"));const l=await fetch(`${ye}/${t}`,{method:"POST",body:n});if(!l.ok){const e=await l.json().catch(()=>({detail:l.statusText}));throw new Error(e.detail||l.statusText)}const{welds:a}=await l.json();if(!a||0===a.length)return void B("未检测到焊口","error");let o=ee.value-te.value;if(A.value){const e=A.value.getAnnotations();for(const t in e)for(const n of e[t])n.displayValue>o&&(o=n.displayValue)}const i=a.map((e,t)=>{const n=e.r||8,l=Math.max(2*n,20),a=o+(t+1)*te.value;return{x:e.x+l,y:e.y-l,x2:e.x,y2:e.y,displayValue:a,text:ne.value+a+le.value,style:K.value,annotationStyle:Q.value,settings:{prefix:ne.value,suffix:le.value,startNumber:ee.value,increment:te.value,fontSize:ae.value}}});A.value&&(A.value.addAnnotationsToPage(S.value,i),W(),B(`已自动标注 ${a.length} 个焊口`))}catch(t){console.error("自动标注失败:",t),B("自动标注失败: "+t.message,"error")}finally{Se.value=!1}}else B("请先打开PDF文件","error")}function Ae(){A.value&&(A.value.undoLastAnnotation(),W())}async function Fe(){if(L&&A.value)try{const e=A.value.getAnnotations(),t=A.value.getPageRotations(),n=await b(L,e,P.value,{startNumber:ee.value,increment:te.value,prefix:ne.value,suffix:le.value,fontSize:ae.value,borderStyle:K.value,annotationStyle:Q.value},t);h(n,`annotated_${Date.now()}.pdf`),B("PDF已生成并下载")}catch(e){console.error("Failed to generate PDF:",e),B("生成PDF失败: "+e.message,"error")}else B("请先打开PDF文件","error")}async function Ve(){if(L&&A.value)try{const e=A.value.getAnnotations(),t=A.value.getPageRotations(),n=await b(L,e,P.value,{startNumber:ee.value,increment:te.value,prefix:ne.value,suffix:le.value,fontSize:ae.value,borderStyle:K.value,annotationStyle:Q.value},t);h(n,`final_${Date.now()}.pdf`),B("PDF已生成并下载")}catch(e){console.error("Failed to generate PDF:",e),B("生成PDF失败: "+e.message,"error")}else B("请先打开PDF文件","error")}function Pe(){if(A.value&&F.value)try{!function(e,t,n){const{startNumber:l,increment:a,prefix:o,suffix:i}=t,s=[];s.push(["页码","标签","显示值","标签X坐标","标签Y坐标","指向X坐标","指向Y坐标","边框样式","标注样式","字体大小","前缀","后缀","起始值","增量"]);for(const p in e){const t=e[p];Array.isArray(t)&&t.forEach(e=>{const t=e.settings?.prefix??o,n=e.settings?.suffix??i,r=e.settings?.startNumber??l,u=e.settings?.increment??a,d=e.settings?.fontSize??10,c=t+e.displayValue+n;s.push([p,c,e.displayValue,Math.round(1e3*e.x)/1e3,Math.round(1e3*e.y)/1e3,void 0!==e.x2?Math.round(1e3*e.x2)/1e3:"",void 0!==e.y2?Math.round(1e3*e.y2)/1e3:"",e.style||"none",e.annotationStyle||"arrow",d,t,n,r,u])})}const r=s.map(e=>e.map(e=>{const t=String(e);return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t}).join(",")).join("\n"),u=new Blob(["\ufeff"+r],{type:"text/csv;charset=utf-8;"}),d=document.createElement("a"),c=URL.createObjectURL(u);d.href=c,d.download=`${n.replace(/\.[^.]+$/,"")}_annotations.csv`,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(c)}(A.value.getAnnotations(),{startNumber:ee.value,increment:te.value,prefix:ne.value,suffix:le.value},F.value),B("CSV数据已导出")}catch(e){console.error("Failed to export CSV:",e),B("导出CSV失败: "+e.message,"error")}else B("请先打开PDF文件","error")}function Ue(){if(A.value&&F.value)try{!function(e,t,n){const l={version:"1.0",exportDate:(new Date).toISOString(),sourceFile:n,globalSettings:t,annotations:{}};for(const r in e){const n=e[r];Array.isArray(n)&&n.length>0&&(l.annotations[r]=n.map(e=>{const n=e.settings?.prefix??t.prefix??"",l=e.settings?.suffix??t.suffix??"",a=n+e.displayValue+l;return{x:e.x,y:e.y,x2:e.x2,y2:e.y2,displayValue:e.displayValue,label:a,style:e.style,annotationStyle:e.annotationStyle}}))}const a=JSON.stringify(l,null,2),o=new Blob([a],{type:"application/json;charset=utf-8;"}),i=document.createElement("a"),s=URL.createObjectURL(o);i.href=s,i.download=`${n.replace(/\.[^.]+$/,"")}_annotations.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)}(A.value.getAnnotations(),{startNumber:ee.value,increment:te.value,prefix:ne.value,suffix:le.value,fontSize:ae.value,borderStyle:K.value,annotationStyle:Q.value},F.value),B("JSON数据已导出(可用于还原标注)")}catch(e){console.error("Failed to export JSON:",e),B("导出JSON失败: "+e.message,"error")}else B("请先打开PDF文件","error")}async function De(e){if(e)try{const t=await async function(e){return new Promise((t,n)=>{const l=new FileReader;l.onload=e=>{try{const n=JSON.parse(e.target.result);if(!n.annotations||!n.globalSettings)throw new Error("无效的标注数据格式");t({annotations:n.annotations,settings:n.globalSettings,sourceFile:n.sourceFile,version:n.version})}catch(l){n(new Error("解析JSON文件失败: "+l.message))}},l.onerror=()=>{n(new Error("读取文件失败"))},l.readAsText(e)})}(e);if(!window.confirm(`确定要导入标注数据吗?\n来源文件: ${t.sourceFile||"未知"}\n版本: ${t.version||"未知"}\n当前标注将被覆盖。`))return;A.value&&(A.value.setAnnotations(t.annotations),t.settings&&(ee.value=t.settings.startNumber||1,te.value=t.settings.increment||1,ne.value=t.settings.prefix||"",le.value=t.settings.suffix||"",ae.value=t.settings.fontSize||10,K.value=t.settings.borderStyle||"none",Q.value=t.settings.annotationStyle||"circle-outline"),B("标注数据导入成功"),W())}catch(t){console.error("Failed to import annotations:",t),B("导入失败: "+t.message,"error")}}async function ze(e){if(e)try{const t=await async function(e){return new Promise((t,n)=>{const l=new FileReader;l.onload=l=>{try{const n=l.target.result.trim().split("\n");if(n.length<2)throw new Error("CSV文件内容不足,至少需要标题行和数据行");const a=ie(n[0]),o=["页码","标签X坐标","标签Y坐标"];for(const e of o)if(!a.includes(e))throw new Error(`缺少必要的列: ${e}`);const i={};let s={startNumber:1,increment:1,prefix:"",suffix:"",fontSize:10,borderStyle:"none",annotationStyle:"arrow"};for(let e=1;e<n.length;e++){const t=ie(n[e]);if(0===t.length||t.every(e=>!e))continue;const l={};for(let e=0;e<a.length;e++)l[a[e]]=t[e]||"";const o=l["页码"]?.trim();if(!o)continue;const r=parseFloat(l["标签X坐标"]),u=parseFloat(l["标签Y坐标"]),d=l["指向X坐标"]?parseFloat(l["指向X坐标"]):void 0,c=l["指向Y坐标"]?parseFloat(l["指向Y坐标"]):void 0;if(isNaN(r)||isNaN(u))throw new Error(`${e+1}行: 坐标格式错误`);const p=l["显示值"]?parseInt(l["显示值"]):0,v=l["边框样式"]?.trim()||"none",f=l["标注样式"]?.trim()||"arrow",m=l["字体大小"]?parseInt(l["字体大小"]):10,g=l["前缀"]?.trim()||"",y=l["后缀"]?.trim()||"",x=l["起始值"]?parseInt(l["起始值"]):1,b=l["增量"]?parseInt(l["增量"]):1;1===e&&(s={startNumber:x,increment:b,prefix:g,suffix:y,fontSize:m,borderStyle:v,annotationStyle:f});const h={x:r,y:u,displayValue:p,style:v,annotationStyle:f,settings:{prefix:g,suffix:y,fontSize:m,startNumber:x,increment:b}};void 0===d||void 0===c||isNaN(d)||isNaN(c)||(h.x2=d,h.y2=c),i[o]||(i[o]=[]),i[o].push(h)}if(0===Object.keys(i).length)throw new Error("CSV文件中没有有效的标注数据");t({annotations:i,settings:s,sourceFile:e.name,version:"1.0"})}catch(a){n(new Error("解析CSV文件失败: "+a.message))}},l.onerror=()=>{n(new Error("读取文件失败"))},l.readAsText(e,"utf-8")})}(e);if(!window.confirm(`确定要导入CSV标注数据吗?\n来源文件: ${t.sourceFile||"未知"}\n当前标注将被覆盖。`))return;A.value&&(A.value.setAnnotations(t.annotations),t.settings&&(ee.value=t.settings.startNumber||1,te.value=t.settings.increment||1,ne.value=t.settings.prefix||"",le.value=t.settings.suffix||"",ae.value=t.settings.fontSize||10,K.value=t.settings.borderStyle||"none",Q.value=t.settings.annotationStyle||"circle-outline"),B("CSV标注数据导入成功"),W())}catch(t){console.error("Failed to import CSV:",t),B("导入CSV失败: "+t.message,"error")}}function Ee(e){const t=S.value;P.value[t]||(P.value[t]=[]),P.value[t].push(e),A.value&&A.value.setImages(P.value),B("图片已放置")}function Ie(){B("已取消图片放置")}function Re(e){P.value[e.page]=e.images,B("图片已删除")}async function Ne(e){const t=e?.file,n=e?.size||80,l=e?.imageData;try{if(l)return A.value?(A.value.setTemporaryImage(l,n),void B("点击PDF上要放置表格的位置, 按ESC取消")):void B("请先加载PDF","error");if(!t)return void B("请先选择图片文件","error");const e=new FileReader;e.onload=e=>{const t=e.target.result;A.value?(A.value.setTemporaryImage(t,n),B("点击PDF上要放置图片的位置, 按ESC取消")):B("请先加载PDF","error")},e.readAsDataURL(t)}catch(a){console.error("Failed to import image:",a),B("导入图片失败: "+a.message,"error")}}function je(){let e=V.value;if(!e){const t=document.getElementById("hdpdfurl");t&&t.value&&(e=t.value.trim())}if(!e&&d.value&&(e=URL.createObjectURL(d.value)),e){let t=`/viewer.html?url=${encodeURIComponent(e)}`;const n=document.getElementById("imgurl1"),l=document.getElementById("imgurl2");n&&n.value&&n.value.trim()&&(t+=`&imgurl1=${encodeURIComponent(n.value.trim())}`),l&&l.value&&l.value.trim()&&(t+=`&imgurl2=${encodeURIComponent(l.value.trim())}`),window.open(t,"_blank")}else B("未找到PDF地址","error")}async function Oe(e){if(e){V.value=e,B("正在加载在线PDF...");try{const n=await fetch(e);if(!n.ok)throw new Error(`加载失败: ${n.status} ${n.statusText}`);const l=await n.arrayBuffer(),a=new Blob([l],{type:"application/pdf"});let o="online.pdf";try{const t=new URL(e).pathname.split("/"),n=t[t.length-1];n&&n.includes(".pdf")&&(o=decodeURIComponent(n))}catch(t){}const i=new File([a],o,{type:"application/pdf"});L=l,d.value=i,F.value=o,S.value=1,k.value=1,J.value=1,_.value=100,B("PDF加载成功")}catch(n){console.error("Failed to load PDF from URL:",n),B("加载PDF失败: "+n.message,"error")}}}return g(()=>{try{const e=document.getElementById("hdpdfurl");if(e&&"string"==typeof e.value&&e.value.trim()){const t=e.value.trim();V.value=t,console.log("Found pdfUrl element, loading PDF from:",t),Oe(t)}const t=document.getElementById("hdjoinInfo");if(t&&"string"==typeof t.value&&t.value.trim()){const e=t.value.trim();console.log("Found workRecord element, setting CSV data:",e.substring(0,100)+"..."),D.value=e}}catch(e){console.warn("Error checking for elements:",e)}}),n(S,e=>{}),(e,t)=>(a(),l("div",se,[T.value.show?(a(),l("div",{key:0,style:c({position:"fixed",top:"20px",right:"20px",padding:"12px 16px",background:"success"===T.value.type?"#d1fae5":"#fee2e2",color:"success"===T.value.type?"#065f46":"#991b1b",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",zIndex:9999,animation:"slideIn 0.3s ease-out",fontSize:"14px",fontWeight:"500"})},s(T.value.message),5)):o("",!0),i("div",re,[y(oe,{"selected-annotation":z.value,"selected-annotation-page":E.value,"selected-annotation-index":I.value,"annotations-json":U.value,"initial-csv-data":D.value,"auto-annotating":Se.value,onFileSelected:Z,onApplySettings:xe,onClearPageAnnotations:he,onRenumberPageAnnotations:we,onAutoAnnotatePage:Ce,onUndoAnnotation:Ae,onSavePdfEditable:Fe,onSavePdfFinal:Ve,onExportCsv:Pe,onExportJson:Ue,onImportAnnotations:De,onImportCsv:ze,onImportImage:Ne,onUpdateAnnotation:N,onDeleteAnnotation:j,onDeselectAnnotation:O,onLoadPdfUrl:Oe},null,8,["selected-annotation","selected-annotation-page","selected-annotation-index","annotations-json","initial-csv-data","auto-annotating"])]),i("div",ue,[i("div",de,[i("div",{onClick:t[0]||(t[0]=e=>C.value=!C.value),style:c({background:C.value?"#334155":"#e2e8f0",color:C.value?"white":"#475569",padding:"6px 12px",borderRadius:"4px",cursor:"pointer",userSelect:"none",fontSize:"14px"})},"标注模式"+s(C.value?":开":":关"),5),t[10]||(t[10]=i("div",{style:{width:"1px",background:"#e5e7eb",height:"24px",margin:"0 8px"}},null,-1)),i("div",{class:f(["btn",{disabled:!p.value||S.value<=1}]),onClick:t[1]||(t[1]=e=>!(!p.value||S.value<=1)&&void(S.value>1&&(S.value--,k.value=S.value)))},"上一页",2),i("div",{class:f(["btn",{disabled:!p.value||S.value>=w.value}]),onClick:t[2]||(t[2]=e=>!(!p.value||S.value>=w.value)&&void(S.value<w.value&&(S.value++,k.value=S.value)))},"下一页",2),t[11]||(t[11]=i("div",{style:{width:"1px",background:"#e5e7eb",height:"24px",margin:"0 8px"}},null,-1)),i("div",{class:f(["btn",{disabled:!p.value}]),onClick:t[3]||(t[3]=e=>!p.value||(null===J.value&&(J.value=M.value),J.value=Math.max(.5,+(J.value/1.2).toFixed(2)),void(_.value=Math.round(100*J.value))))},"-",2),i("div",{class:f(["btn",{disabled:!p.value}]),onClick:t[4]||(t[4]=e=>!p.value||(null===J.value&&(J.value=M.value),J.value=Math.min(3,+(1.2*J.value).toFixed(2)),void(_.value=Math.round(100*J.value))))},"+",2),r(i("input",{"onUpdate:modelValue":t[5]||(t[5]=e=>_.value=e),onInput:be,type:"range",min:"50",max:"300",style:{width:"140px"},disabled:!p.value},null,40,ce),[[u,_.value,void 0,{number:!0}]]),i("div",pe,s(X.value)+"%",1),t[12]||(t[12]=i("div",{style:{width:"1px",background:"#e5e7eb",height:"24px",margin:"0 8px"}},null,-1)),t[13]||(t[13]=i("div",{style:{"margin-left":"8px"}},"第",-1)),r(i("input",{type:"number","onUpdate:modelValue":t[6]||(t[6]=e=>k.value=e),min:1,max:w.value,style:{width:"80px","margin-left":"4px"}},null,8,ve),[[u,k.value,void 0,{number:!0}]]),i("div",{class:f(["btn",{disabled:!p.value}]),onClick:t[7]||(t[7]=e=>!p.value||void(k.value>=1&&k.value<=w.value&&(S.value=k.value)))},"跳转",2),i("div",fe,"/ "+s(w.value||0)+" 页",1),t[14]||(t[14]=i("div",{style:{width:"1px",background:"#e5e7eb",height:"24px",margin:"0 8px"}},null,-1)),F.value?(a(),l("div",me,[i("div",null,[t[8]||(t[8]=i("strong",null,"文件:",-1)),v(" "+s(F.value),1)]),i("div",null,[t[9]||(t[9]=i("strong",null,"标签:",-1)),v(" "+s(Y.value),1)])])):o("",!0),t[15]||(t[15]=i("div",{style:{flex:"1"}},null,-1)),i("div",{class:"btn",onClick:je,title:"在新窗口中打开纯PDF预览"},"PDF预览")]),i("div",ge,[y(x,{file:d.value,page:S.value,scale:J.value,"annotation-mode":C.value,"border-style":K.value,"annotation-style":Q.value,"start-number":ee.value,increment:te.value,prefix:ne.value,suffix:le.value,"font-size":ae.value,ref_key:"pdfViewerRef",ref:A,onLoaded:q,onScaleChanged:G,onWheelZoom:H,onPlaceImage:Ee,onAnnotationSelected:R,onImagePlacingCancelled:Ie,onImageDeleted:Re,onAnnotationChanged:W},null,8,["file","page","scale","annotation-mode","border-style","annotation-style","start-number","increment","prefix","suffix","font-size"])])])]))}}).mount("#app");