import{d as G,n as m,L as K,a3 as M,P as $,r as s,b as C,o as F,c as q,e,j as l,w as h,i as g,f as I,g as r,h as v,K as u,S as B,a5 as z,a6 as H,_ as J}from"./index-4789ca0a.js";import{T as R}from"./index-296c76cc.js";const U=b=>(z("data-v-7561a474"),b=b(),H(),b),Q={class:"form-container"},X=U(()=>r("div",null,[r("b",null,"近距离 Wi-Fi 范围"),v("：覆盖范围和发射功耗小，是最佳电池续航方案。"),r("br"),r("b",null,"中距离 Wi-Fi 范围"),v("：覆盖范围和发射功耗是设备支持能力的一半，正常耗电。"),r("br"),r("b",null,"远距离 Wi-Fi 范围"),v("：设备最大发射功耗和覆盖范围，如果一直有终端接入，耗电会增加，减少电池续航。 ")],-1)),Y=U(()=>r("div",null,[r("b",null,"休眠时间"),v("：当在指定的时间内无 Wi-Fi 连接时，Wi-Fi 功能将会停用，系统会转入休眠模式以节省电量。 ")],-1)),Z=G({name:"NetSwitch",__name:"index",setup(b){const x=m(["1"]),V=m(),w=K();let o=m(!0);const t=M({wifi:"",sleep:""});let _=m(""),f=m("");$(()=>{const n=w.state.NetInfo.wifi_coverage,a=w.state.NetInfo.Sleep_interval,i=n=="long_mode"?"远距离 Wi-Fi 范围":n=="medium_mode"?"中距离 Wi-Fi 范围":"近距离 Wi-Fi 范围 - 最佳电池续航";a!=""&&n!=""&&(f.value==a&&o.value==!0&&(o.value=!1),_.value==i&&o.value==!0&&(o.value=!1)),t&&t.wifi==""&&t.sleep==""&&n!=""&&a!=""&&(t.wifi=_.value=i,t.sleep=f.value=a,t.wifi!=""&&t.sleep!=""&&(o.value=!1))});function D(n){switch(n){case"远距离 Wi-Fi 范围":return"long_mode";case"中距离 Wi-Fi 范围":return"medium_mode";case"近距离 Wi-Fi 范围 - 最佳电池续航":return"short_mode";default:return""}}const L=n=>{n&&(n.clearValidate(),n.validate(a=>{if(a){if(t.wifi==_.value&&t.sleep==f.value){u("未修改内容",{type:"warning"});return}t.wifi!=_.value&&(_.value=t.wifi,o.value=!0,B({goformId:"SET_WIFI_COVERAGE",wifi_coverage:D(t.wifi)}).then(i=>{w.state.NetInfo.imei="",i.result=="success"?u("成功发送请求",{type:"success"}):(o.value=!1,u("操作失败",{type:"error"}))}).catch(i=>{o.value=!1,u("请求失败",{type:"error"})})),t.sleep!=f.value&&(f.value=t.sleep,o.value=!0,B({goformId:"SET_WIFI_SLEEP_INFO",sysIdleTimeToSleep:t.sleep}).then(i=>{w.state.NetInfo.imei="",i.result=="success"?u("成功发送请求",{type:"success"}):(o.value=!1,u("操作失败",{type:"error"}))}).catch(i=>{o.value=!1,u("请求失败",{type:"error"})}))}else return u("请检查表单内容",{type:"error"}),!1}))};return(n,a)=>{const i=s("el-row"),N=s("el-radio-group"),y=s("el-form-item"),W=s("el-radio"),p=s("el-col"),d=s("el-option"),O=s("el-select"),S=s("el-button"),P=s("el-form"),T=s("el-card"),E=s("el-collapse-item"),j=s("el-collapse"),A=C("loading"),k=C("motion");return F(),q("div",null,[e(i,{gutter:24},{default:l(()=>[h((F(),g(p,{xs:24,sm:24,md:16,lg:16,xl:16,class:"mb-[5px]",initial:{opacity:0,y:100},enter:{opacity:1,y:0,transition:{delay:200}}},{default:l(()=>[h((F(),g(T,{shadow:"never"},{header:l(()=>[e(I(R),{className:"type-it1",values:["Wi-Fi 性能设置"],cursor:!1,speed:60})]),default:l(()=>[r("div",Q,[e(P,{ref_key:"ruleFormRef",ref:V,model:t,"status-icon":"","label-width":"120px",class:"demo-ruleForm","label-position":"left"},{default:l(()=>[e(y,{label:"Wi-Fi 覆盖范围"},{default:l(()=>[e(N,null,{default:l(()=>[e(i)]),_:1})]),_:1}),e(y,{label:"","label-width":"0"},{default:l(()=>[e(N,{modelValue:t.wifi,"onUpdate:modelValue":a[0]||(a[0]=c=>t.wifi=c)},{default:l(()=>[e(i,null,{default:l(()=>[e(p,null,{default:l(()=>[e(W,{border:"",label:"近距离 Wi-Fi 范围 - 最佳电池续航"})]),_:1}),e(p,null,{default:l(()=>[e(W,{border:"",label:"中距离 Wi-Fi 范围"})]),_:1}),e(p,null,{default:l(()=>[e(W,{border:"",label:"远距离 Wi-Fi 范围"})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(y,{label:"Wi-Fi 休眠时间设置",prop:"sleep","label-width":"140"},{default:l(()=>[e(O,{modelValue:t.sleep,"onUpdate:modelValue":a[1]||(a[1]=c=>t.sleep=c),"fit-input-width":!0,style:{width:"100%"}},{default:l(()=>[e(d,{label:"从不休眠",value:"-1"}),e(d,{label:"5分钟",value:"5"}),e(d,{label:"10分钟",value:"10"}),e(d,{label:"20分钟",value:"20"}),e(d,{label:"30分钟",value:"30"}),e(d,{label:"1小时",value:"60"}),e(d,{label:"2小时",value:"120"})]),_:1},8,["modelValue"])]),_:1}),e(y,{class:"form-buttons"},{default:l(()=>[e(S,{type:"primary",onClick:a[2]||(a[2]=c=>L(V.value))},{default:l(()=>[v("应用")]),_:1})]),_:1}),e(S,{style:{visibility:"hidden"}})]),_:1},8,["model"])])]),_:1})),[[A,I(o)]])]),_:1})),[[k]]),h((F(),g(p,{xs:24,sm:24,md:8,lg:8,xl:8,class:"mb-[5px]",initial:{opacity:0,y:100},enter:{opacity:1,y:0,transition:{delay:200}}},{default:l(()=>[e(T,{shadow:"never"},{header:l(()=>[e(I(R),{className:"type-it2",values:["Wi-Fi 性能设置帮助"],cursor:!1,speed:60})]),default:l(()=>[e(j,{modelValue:x.value,"onUpdate:modelValue":a[3]||(a[3]=c=>x.value=c)},{default:l(()=>[e(E,{title:"Wi-Fi 范围",name:"1"},{default:l(()=>[X]),_:1}),e(E,{title:"休眠时间",name:"2"},{default:l(()=>[Y]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})),[[k]])]),_:1})])}}});const te=J(Z,[["__scopeId","data-v-7561a474"]]);export{te as default};
