import{s as A,a as T,b as I}from"./index-264c9d8d.js";import{b as U,c as R,f as H}from"./index-6bb339c4.js";import{r as a,b as q,o as C,E as c,f as w,a as y,c as E,h as i,q as L,g as p,w as h,p as m,t as r,F as W,j as G,k as K,z as Q,i as j}from"./index-ad591d72.js";import{V as X,s as Y}from"./Vue3DraggableResizable-91997a90.js";import{_ as ee}from"./_plugin-vue_export-helper-c27b6911.js";import"./request-2786ead7.js";import"./axios-4a70c6fc.js";const oe={class:"chipShow"},te={class:"set"},le=["src"],ae={style:{display:"flex","align-items":"center"}},se={style:{"font-size":"13px",position:"absolute",right:"20px",bottom:"14px","z-index":"22",color:"#41363675"}},ne={__name:"chipSetting",setup(re){const _=a("http://localhost:8809/api/fileResource/upload");a(100),a(100);const f=a(),S=a({}),B=q();a(),a("#000000"),a("");const u=a({Value:""}),Z=()=>{console.log(u.value.Value),I({Category:"zoneAutoCheckZone",Name:"zone",Value:u.value.Value,ID:u.value.ID}).then(e=>{e.Err?c({message:e.Err,grouping:!0,type:"error"}):console.log(e)})},N=a([]),s=a([]),V=a([]),x=a(""),F=a(null),g=a({});let O=(e,o,t)=>{console.log(111);const{x:n,y:d}=t;s.value[o].x=n,s.value[o].y=d,s.value[o].value=e.fieldName,x.value=e.fieldName,b()},$=(e,o,t)=>{const{w:n,h:d}=t;s.value[o].w=n,s.value[o].h=d;let l=s.value[o].fontSize=s.value[o].w*.25+s.value[o].h*.35+"px";F.value[o].style.fontSize=l},b=()=>{if(console.log(s.value),s.value.length!=0)for(let e of s.value){let o=JSON.stringify(e);console.log(o),I({Category:"zoneCheck",Name:e.fieldName,Value:o,ID:e.id}).then(t=>{t.Err?c({message:t.Err,grouping:!0,type:"error"}):console.log(t)})}};C(()=>{J()});let J=()=>{s.value=[],N.value=[],A({Category:"zoneCheck"}).then(e=>{if(!e.Err&&e.settings.length!=0){V.value=e.settings;for(let o of V.value){const t=JSON.parse(o.Value);t.id=o.ID,s.value.push(t),N.value.push(JSON.parse(o.Value).fieldName)}}}),A({Category:"zoneAutoCheckZone"}).then(e=>{!e.Err&&e.settings.length!=0?u.value=e.settings[0]:e.settings.length==0&&T({Category:"zoneAutoCheckZone",Name:"zone",Value:"A",Description:"zone check start zone setting"}).then(o=>{o.Err?c({message:o.Err,grouping:!0,type:"error"}):console.log(o)})})};const D=a(null),M=e=>(console.log(e),_.value=_.value+"?TargetPath=dist/img/zoneAutoCheckShow.jpg",!0),P=(e,o)=>{console.log(e),e.Result==!0&&(f.value?(console.log(S.value.ID),U({Name:S.value.Name}).then(t=>{console.log(t),v(),t.Err?c({message:t.Err,grouping:!0,type:"error"}):R({Name:"zoneAutoCheckShow",FilePath:"dist/img/zoneAutoCheckShow.jpg",FileName:"dist/img/zoneAutoCheckShow.jpg"}).then(n=>{console.log(n),n.Err?c({message:n.Err,grouping:!0,type:"error"}):(v(),D.value.clearFiles(),B.go(0))})})):R({Name:"zoneAutoCheckShow",FilePath:"dist/img/zoneAutoCheckShow.jpg",FileName:"dist/img/zoneAutoCheckShow.jpg"}).then(t=>{console.log(t),t.Err?c({message:t.Err,grouping:!0,type:"error"}):(v(),clearFiles())}))},v=()=>{H({Name:"zoneAutoCheckShow"}).then(e=>{if(console.log(e),e.FileResources){S.value=e.FileResources[0];const t="data:image/jpeg;base64,"+e.FileResources[0].FileBody;f.value=t}})};return C(()=>{v(),localStorage.getItem("lang")=="zh"?document.title="分区检录-页面设置":document.title="Zone Check-Page Set"}),C(()=>{g.value=JSON.parse(window.localStorage.getItem("version"))}),(e,o)=>{const t=w("el-button"),n=w("el-upload"),d=w("el-input");return y(),E("div",oe,[i("div",te,[f.value?(y(),E("img",{key:0,src:f.value,alt:""},null,8,le)):L("",!0),i("div",null,[p(m(Y.DraggableContainer),null,{default:h(()=>[(y(!0),E(W,null,G(s.value,(l,z)=>(y(),K(m(X),{x:l.x,y:l.y,w:l.w,h:l.h,key:z,style:{display:"flex","justify-content":"center","align-items":"center"},minW:50,minH:50,parent:!1,onResizeEnd:k=>m($)(l,z,k),onDragEnd:k=>m(O)(l,z,k)},{default:h(()=>[i("div",{id:"resizable",ref_for:!0,ref_key:"www",ref:F,style:Q({fontSize:l.fontSize,color:l.color,fontFamily:l.fontFamily})},r(l.fieldName),5)]),_:2},1032,["x","y","w","h","onResizeEnd","onDragEnd"]))),128))]),_:1})])]),i("div",{class:"settings",onClick:o[1]||(o[1]=(...l)=>e.handleMouseClick&&e.handleMouseClick(...l))},[i("div",ae,[p(n,{ref_key:"upload",ref:D,data:e.uploadData,name:"File",class:"upload-demo",action:_.value,limit:1,"on-exceed":e.handleExceed,"auto-upload":!0,"on-success":P,"show-file-list":!1,"before-upload":M},{trigger:h(()=>[i("div",null,[p(t,null,{default:h(()=>[j(r(e.$t("chipSet.image")),1)]),_:1})])]),_:1},8,["data","action","on-exceed"]),p(d,{class:"normal",style:{"margin-left":"10px","margin-right":"10px",width:"140px"},modelValue:u.value.Value,"onUpdate:modelValue":o[0]||(o[0]=l=>u.value.Value=l),placeholder:e.$t("participants.StartZone"),onBlur:Z},null,8,["modelValue","placeholder"]),p(t,{onClick:m(b)},{default:h(()=>[j(r(e.$t("chipSet.Save")),1)]),_:1},8,["onClick"])])]),i("div",se,r(e.$t("home.version"))+"："+r(g.value.version)+"."+r(g.value.branch)+"."+r(g.value.commitId)+"   "+r(e.$t("home.compileTime"))+"："+r(g.value.buildDateTime),1)])}}},me=ee(ne,[["__scopeId","data-v-00503ff2"]]);export{me as default};
