import{s as B,g as P}from"./index-f3a8367e.js";import{c as x,g as j}from"./index-7e3b9e04.js";import{s as H}from"./index-264c9d8d.js";import{f as O}from"./index-6bb339c4.js";import{V as q,s as A}from"./Vue3DraggableResizable-91997a90.js";import{_ as J}from"./_plugin-vue_export-helper-c27b6911.js";import{r as s,o as F,a as t,c as n,h as v,q as L,g as U,w as S,p,E as W,F as G,j as K,k as Q,z as i,t as u}from"./index-ad591d72.js";import"./request-2786ead7.js";import"./axios-4a70c6fc.js";const T={class:"chipShow"},X={class:"set"},Y=["src"],Z={key:0},$={key:1},ee={__name:"chipShow",setup(ae){const h=s(""),f=s(),k=s({}),z=s(null),d=s([]),o=s([]),g=s([]),E=s(""),y=s(null);let N=(a,l,e)=>{console.log(a);const{x:r,y:c}=e;o.value[l].x=r,o.value[l].y=c,E.value=a.fieldName},R=(a,l,e)=>{const{w:r,h:c}=e;o.value[l].w=r,o.value[l].h=c;let I=o.value[l].Size=o.value[l].w*.05+o.value[l].h*.35+"px";y.value[l].style.fontSize=I};F(()=>{D(),h.value=window.localStorage.getItem("lang")});let D=()=>{o.value=[],d.value=[],H({Category:"chipCheck"}).then(a=>{if(console.log(a),!a.Err&&a.settings.length!=0){g.value=a.settings;let l=[];for(let e of g.value){const r=JSON.parse(e.Value);r.id=e.ID,l.push(r),d.value.push(JSON.parse(e.Value).fieldName)}o.value=l}})};const b=s([]),_=s(""),m=s([]);z.value=setInterval(()=>{w()},1e3),setInterval(()=>{B({}).then(a=>{})},100);const C=()=>{j().then(a=>{a.Err?W({message:a.Err,grouping:!0,type:"error"}):b.value=a.Participants})},w=()=>{P({Num:10,Desc:1}).then(a=>{a.Records.length!=0&&(_.value=a.Records[0].ChipCode,V())})},V=()=>{x({Field:"chip_code",Value:_.value}).then(a=>{a.Participants.length!=0&&(console.log(a.Participants),m.value=a.Participants,o.value.forEach(l=>{const e=m.value[0][l.fieldName];l.value=e}))})},M=()=>{O({Name:"chipChickShow"}).then(a=>{if(console.log(a),!a.Err&&a.FileResources){k.value=a.FileResources[0];const e="data:image/jpeg;base64,"+a.FileResources[0].FileBody;f.value=e}})};return F(()=>{C(),w(),M(),localStorage.getItem("lang")=="zh"?document.title="芯片检测-页面展示":document.title="Chip Check-Page Show"}),(a,l)=>(t(),n("div",T,[v("div",X,[f.value?(t(),n("img",{key:0,src:f.value,alt:""},null,8,Y)):L("",!0),v("div",null,[U(p(A.DraggableContainer),null,{default:S(()=>[(t(!0),n(G,null,K(o.value,(e,r)=>(t(),Q(p(q),{x:e.x,y:e.y,w:e.w,h:e.h,key:r,style:{display:"flex","justify-content":"center","align-items":"center"},minW:50,minH:50,parent:!1,onResizeEnd:c=>p(R)(e,r,c),"show-file-list":!1,onDragEnd:c=>p(N)(e,r,c)},{default:S(()=>[v("div",{id:"resizable",ref_for:!0,ref_key:"www",ref:y,style:i({fontSize:e.fontSize,color:e.color})},[h.value=="zh"?(t(),n("div",Z,[e.value=="M"||e.value=="F"?(t(),n("span",{key:0,style:i({fontFamily:e.fontFamily})},u(e.value=="M"?"男":"女"),5)):e.value=="男"||e.value=="女"?(t(),n("span",{key:1,style:i({fontFamily:e.fontFamily})},u(e.value=="男"?"男":"女"),5)):(t(),n("span",{key:2,style:i([{"white-space":"nowrap"},{fontFamily:e.fontFamily}])},u(e.value),5))])):(t(),n("div",$,[e.value=="M"||e.value=="F"?(t(),n("span",{key:0,style:i({fontFamily:e.fontFamily})},u(e.value=="M"?"Male":"Female"),5)):e.value=="男"||e.value=="女"?(t(),n("span",{key:1,style:i({fontFamily:e.fontFamily})},u(e.value=="男"?"Male":"Female"),5)):(t(),n("span",{key:2,style:i([{"white-space":"nowrap"},{fontFamily:e.fontFamily}])},u(e.value),5))]))],4)]),_:2},1032,["x","y","w","h","onResizeEnd","onDragEnd"]))),128))]),_:1})])])]))}},pe=J(ee,[["__scopeId","data-v-ecb5178f"]]);export{pe as default};
