import{s as M}from"./index-264c9d8d.js";import{b as V,s as B,g as I}from"./index-f3a8367e.js";import{s as x}from"./request-2786ead7.js";import{f as j}from"./index-6bb339c4.js";import{V as q,s as H}from"./Vue3DraggableResizable-91997a90.js";import{_ as O}from"./_plugin-vue_export-helper-c27b6911.js";import{r as t,o as w,B as Q,a as n,c as r,h as d,q as J,g as L,w as F,p as f,F as P,j as U,k as W,z as u,t as i,E as $}from"./index-ad591d72.js";import"./axios-4a70c6fc.js";const A=p=>x({url:"/api/scoreDisplay/QueryScore",method:"get",params:p});const G={class:"chipShow"},K={class:"set"},T=["src"],X={key:0},Y={key:1},Z={__name:"scoreShow",setup(p){const g=t(""),v=t(),S=t({}),k=t(null),h=t([]),o=t([]),_=t([]),R=t(""),m=t(null);let z=(a,s,e)=>{console.log(a);const{x:l,y:c}=e;o.value[s].x=l,o.value[s].y=c,R.value=a.fieldName},E=(a,s,e)=>{const{w:l,h:c}=e;o.value[s].w=l,o.value[s].h=c;let C=o.value[s].Size=o.value[s].w*.05+o.value[s].h*.35+"px";m.value[s].style.fontSize=C};w(()=>{D(),g.value=window.localStorage.getItem("lang"),V({}).then(a=>{console.log("停止读取")}),B({}).then(a=>{console.log("开始读取")})});let D=()=>{o.value=[],h.value=[],M({Category:"scoreQuery"}).then(a=>{if(console.log(a),!a.Err&&a.settings.length!=0){_.value=a.settings;let s=[];for(let e of _.value){const l=JSON.parse(e.Value);l.id=e.ID,s.push(l),h.value.push(JSON.parse(e.Value).fieldName)}o.value=s}})};t([]);const y=t("");t([]),k.value=setInterval(()=>{N()},1e3);const N=()=>{I({Num:10,Desc:1}).then(a=>{a.Records.length!=0&&(y.value=a.Records[0].ChipCode,console.log(y.value))})};Q(y,(a,s)=>{a&&(A({Epc:a}).then(e=>{console.log(e),e.Result==!1?($({message:"无成绩",type:"error"}),o.value.forEach(l=>{l.value=""})):o.value.forEach(l=>{const c=e.Data[l.fieldName];l.value=c})}),console.log(`我侦听到了Records状态的变化，当前值为${a},从而处理相关逻辑`))});const b=()=>{j({Name:"scoreQueryShow"}).then(a=>{if(console.log(a),!a.Err&&a.FileResources){S.value=a.FileResources[0];const e="data:image/jpeg;base64,"+a.FileResources[0].FileBody;v.value=e}})};return w(()=>{b(),localStorage.getItem("lang")=="zh"?document.title="成绩查询-页面展示":document.title="Chip Check-Page Show"}),(a,s)=>(n(),r("div",G,[d("div",K,[v.value?(n(),r("img",{key:0,src:v.value,alt:""},null,8,T)):J("",!0),d("div",null,[L(f(H.DraggableContainer),null,{default:F(()=>[(n(!0),r(P,null,U(o.value,(e,l)=>(n(),W(f(q),{x:e.x,y:e.y,w:e.w,h:e.h,key:l,style:{display:"flex","justify-content":"center","align-items":"center"},minW:50,minH:50,parent:!1,onResizeEnd:c=>f(E)(e,l,c),"show-file-list":!1,onDragEnd:c=>f(z)(e,l,c)},{default:F(()=>[d("div",{id:"resizable",ref_for:!0,ref_key:"www",ref:m,style:u({fontSize:e.fontSize,color:e.color})},[g.value=="zh"?(n(),r("div",X,[e.value=="M"||e.value=="F"?(n(),r("span",{key:0,style:u({fontFamily:e.fontFamily})},i(e.value=="M"?"男":"女"),5)):e.value=="男"||e.value=="女"?(n(),r("span",{key:1,style:u({fontFamily:e.fontFamily})},i(e.value=="男"?"男":"女"),5)):(n(),r("span",{key:2,style:u([{"white-space":"nowrap"},{fontFamily:e.fontFamily}])},i(e.value),5))])):(n(),r("div",Y,[e.value=="M"||e.value=="F"?(n(),r("span",{key:0,style:u({fontFamily:e.fontFamily})},i(e.value=="M"?"Male":"Female"),5)):e.value=="男"||e.value=="女"?(n(),r("span",{key:1,style:u({fontFamily:e.fontFamily})},i(e.value=="男"?"Male":"Female"),5)):(n(),r("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})])])]))}},ce=O(Z,[["__scopeId","data-v-18317428"]]);export{ce as default};
