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