import{d as me,n as g,aA as ve,L as ye,t as he,m as be,M as D,K as o,S as z,a3 as ge,r as f,b as q,o as _,c as O,i as m,j as a,w as y,e as l,f as c,g as u,h as p,F as P,v as Q,ai as X,z as x}from"./index-4789ca0a.js";import{T as V}from"./index-296c76cc.js";import{E}from"./el-message-box-ecaf3f80.js";const xe={class:"form-container"},we={class:"card-header"},ke={class:"type-it-container"},Be={class:"button-container"},Te={class:"form-container"},Ce={class:"card-header"},Ve={class:"type-it-container"},Ee={class:"button-container"},Ae={class:"form-container"},Ie={class:"card-header"},Ge={class:"type-it-container"},Ne={class:"button-container"},Le={class:"form-container"},Se={class:"card-header"},Ue={class:"type-it-container"},De={class:"form-container"},Oe=me({name:"Band",__name:"Band",setup(ze){const H=g(),W=g(),w=g([]),F=g(!1);let i=g(!0),r=g(!0);const{height:J}=ve(),k=ye(),s=g({lock:"",arfrcn:"",pci:""});he(()=>{var e;F.value=((e=be())==null?void 0:e.is_r186x)??!1,F.value==!0?ce():Y()});const I=g({All_4G:"0",All_23G:"0"});function Y(){D("cmd=set_band_list").then(e=>{W.value=e.set_band_list.split(","),D("cmd=get_support_band").then(t=>{H.value=t,w.value=Object.entries(t).map(([d,v],h)=>({value:d,checked:W.value.includes(d),isdisabled:v,name:ne(d),type:d.includes("LTEB")?"4G":"2/3G"})),i.value=!1}).catch(t=>{i.value=!1})}).catch(e=>{i.value=!1}),r.value=!1,G()}function ee(){E.confirm("你确定要执行该操作吗？",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}).then(()=>{z({goformId:"REBOOT_DEVICE"}).then(e=>{e.result=="success"&&o("成功发送请求",{type:"success"})}).catch(e=>{o("请求失败",{type:"error"})})}).catch(()=>{o("取消执行",{type:"info"})})}async function G(){r.value=!0,A("AT+ZLTELC?").then(e=>{r.value=!1;let t=e.result.match(/(\d+)/gi);t.length==3&&(s.value.lock=t[0],s.value.arfrcn=t[1]==65535?"":t[1],s.value.pci=t[2]==65535?"":t[2])}).catch(e=>{r.value=!1,o("小区信息请求失败",{type:"error"})})}async function te(){E.confirm("你确定要执行该操作吗？",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}).then(async()=>{r.value=!0,await A("AT+ZLTELC=0,65535,65535").then(async e=>{r.value=!1,K(e.result)?(o("解锁成功",{type:"success"}),await R(),await G()):o("解锁失败",{type:"error"})}).catch(e=>{r.value=!1,o("请求失败",{type:"error"})})}).catch(()=>{})}function le(){let e="AT+ZLTELC=1";if(parseInt(s.value.arfrcn)>=1&&parseInt(s.value.arfrcn)<=65535&&s.value.arfrcn!="")e=e+","+s.value.arfrcn;else return o("请输入正确的频点",{type:"error"});if(parseInt(s.value.pci)>=1&&parseInt(s.value.pci)<=65535||s.value.pci=="")s.value.pci!=""&&(e=e+","+s.value.pci);else return o("请输入正确的小区",{type:"error"});E.confirm("你确定要执行该操作吗？",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}).then(async()=>{r.value=!0,await A(e).then(async t=>{K(t.result)?(r.value=!1,o("锁定成功",{type:"success"}),await R(),await G()):(r.value=!1,o("锁定失败",{type:"error"}))}).catch(t=>{r.value=!1,o("请求失败",{type:"error"})})}).catch(()=>{o("取消应用",{type:"info"})})}function ae(){E.confirm("你确定要执行该操作吗？",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}).then(async()=>{await R(),await G()}).catch(()=>{o("取消执行",{type:"info"})})}async function R(){r.value=!0,A("AT+CFUN=0").then(e=>{e.result.includes("OK")?A("AT+CFUN=1").then(t=>{r.value=!1,t.result.includes("OK")?o("热重载成功",{type:"success"}):o("热重载失败",{type:"error"})}).catch(t=>{r.value=!1,o("请求失败",{type:"error"})}):(r.value=!1,o("热重载失败",{type:"error"}))}).catch(e=>{r.value=!1,o("请求失败",{type:"error"})})}async function A(e){return z({goformId:"EXECUTE_AT_COMMAND",at_cmd:e})}function K(e){return e.includes("OK")}function ne(e){return e.includes("LTEB")?e.replace(/LTEB/g,"LTE Band"):e.includes("WB")?e.replace(/WB/g,"WCDMA BAND"):e.includes("WB")?e.replace(/WB/g,"WCDMA BAND"):e}function j(e){try{return w.value.filter(t=>t.type===e)}catch{return[]}}function oe(e){try{w.value.forEach(t=>{t.type==="4G"&&t.isdisabled==="1"&&(t.checked=e)})}catch{}}function se(e){try{w.value.forEach(t=>{t.type==="2/3G"&&t.isdisabled==="1"&&(t.checked=e)})}catch{}}function re(){let e=[];for(let d=0;d<w.value.length;d++){const v=w.value[d];v.checked==!0&&e.push(v.value)}const t=e.join(",");E.confirm("该操作会自动重启设备才能完成设置，是否继续执行该操作？",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}).then(()=>{i.value=!0,z({band_list:t,goformId:"GOFORM_SET_BAND"}).then(d=>{d.result=="success"?(i.value=!1,o("成功发送请求",{type:"success"})):(o("操作失败",{type:"error"}),i.value=!1)}).catch(d=>{o("请求失败",{type:"error"}),i.value=!1})}).catch(()=>{o("取消应用",{type:"info"})})}const b=ge({lte_band:"",work_lte_band:"149,0,0,0,160,1,0,0"});function ce(){D("cmd=lte_band%2Ccell_id%2Cping_google&multi_data=1").then(e=>{b.lte_band=e.lte_band,D("cmd=work_lte_band&multi_data=1").then(t=>{b.work_lte_band=t.work_lte_band.slice(0,-2),i.value=!1}).catch(t=>{i.value=!1})}).catch(e=>{i.value=!1})}function ie(){E.confirm("该操作会自动重启设备才能完成设置，是否继续执行该操作？",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}).then(()=>{i.value=!0,z({ping_google:"no",goformId:"SET_FREQ_BAND",work_lte_band:b.work_lte_band}).then(e=>{i.value=!1,o("成功发送请求",{type:"success"})}).catch(e=>{i.value=!1,o("成功发送请求",{type:"success"})})}).catch(()=>{o("取消应用",{type:"info"})})}function Z(e){return e?e>0?"-"+e+" dBm":e+" dBm":""}function ue(e){return e?e>0&&e!=255?"-"+e+" dB":e==255?e:e+" dB":""}return(e,t)=>{const d=f("el-input"),v=f("el-form-item"),h=f("el-option"),de=f("el-select"),B=f("el-button"),_e=f("el-form"),T=f("el-card"),N=f("el-col"),$=f("el-row"),L=f("el-checkbox"),C=f("el-descriptions-item"),fe=f("el-descriptions"),pe=f("el-scrollbar"),S=q("loading"),U=q("motion");return _(),O("div",null,[F.value?(_(),m($,{key:0,gutter:24},{default:a(()=>[y((_(),m(N,{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:a(()=>[y((_(),m(T,{shadow:"never"},{header:a(()=>[l(c(V),{className:"type-it1",values:["频段选择"],cursor:!1,speed:60})]),default:a(()=>[u("div",xe,[l(_e,{ref:"ruleFormRef",model:b,"status-icon":"",class:"demo-ruleForm","label-position":"left"},{default:a(()=>[l(v,{label:"当前频段",prop:"lte_band"},{default:a(()=>[l(d,{modelValue:b.lte_band,"onUpdate:modelValue":t[0]||(t[0]=n=>b.lte_band=n),type:"text",autocomplete:"off",disabled:""},null,8,["modelValue"])]),_:1}),l(v,{label:"选择频段",prop:"work_lte_band"},{default:a(()=>[l(de,{modelValue:b.work_lte_band,"onUpdate:modelValue":t[1]||(t[1]=n=>b.work_lte_band=n),"fit-input-width":!0,style:{width:"100%"}},{default:a(()=>[l(h,{value:"1,0,0,0,0,0,0,0",label:"1"}),l(h,{value:"4,0,0,0,0,0,0,0",label:"3"}),l(h,{value:"16,0,0,0,0,0,0,0",label:"5"}),l(h,{value:"128,0,0,0,0,0,0,0",label:"8"}),l(h,{value:"0,0,0,0,32,0,0,0",label:"38"}),l(h,{value:"0,0,0,0,128,0,0,0",label:"40"}),l(h,{value:"0,0,0,0,0,1,0,0",label:"41"}),l(h,{value:"149,0,0,0,160,1,0,0",label:"1/3/5/8/38/40/41"})]),_:1},8,["modelValue"])]),_:1}),l(v,{class:"form-buttons"},{default:a(()=>[l(B,{type:"primary",onClick:t[2]||(t[2]=n=>ie()),style:{width:"100%"}},{default:a(()=>[p("应用")]),_:1})]),_:1})]),_:1},8,["model"])])]),_:1})),[[S,c(i)]])]),_:1})),[[U]]),y((_(),m(N,{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:a(()=>[l(T,{shadow:"never"},{header:a(()=>[l(c(V),{className:"type-it2",values:["设置说明"],cursor:!1,speed:60})]),default:a(()=>[p(" 此设置用于锁定指定的频段 ")]),_:1})]),_:1})),[[U]])]),_:1})):(_(),m($,{key:1,gutter:24},{default:a(()=>[y((_(),m(N,{xs:24,sm:24,md:12,lg:12,xl:12,class:"mb-[5px]",initial:{opacity:0,y:100},enter:{opacity:1,y:0,transition:{delay:200}}},{default:a(()=>[y((_(),m(T,{shadow:"never"},{header:a(()=>[u("div",we,[u("div",ke,[l(c(V),{className:"type-it1",values:["4G频段选择"],cursor:!1,speed:60})]),u("div",Be,[l(L,{modelValue:I.value.All_4G,"onUpdate:modelValue":t[3]||(t[3]=n=>I.value.All_4G=n),onChange:oe,label:"4G全选",border:""},null,8,["modelValue"])])])]),default:a(()=>[u("div",Te,[(_(!0),O(P,null,Q(j("4G"),n=>y((_(),m(L,{style:{"margin-top":"5px"},key:n.name,modelValue:n.checked,"onUpdate:modelValue":M=>n.checked=M,label:n.name,size:"large",border:"",disabled:n.isdisabled=="0"},null,8,["modelValue","onUpdate:modelValue","label","disabled"])),[[X,n.isdisabled!="0"]])),128))])]),_:1})),[[S,c(i)]]),y((_(),m(T,{shadow:"never",style:{"margin-top":"5px"}},{header:a(()=>[u("div",Ce,[u("div",Ve,[l(c(V),{className:"type-it2",values:["2/3G频段选择"],cursor:!1,speed:60})]),u("div",Ee,[l(L,{modelValue:I.value.All_23G,"onUpdate:modelValue":t[4]||(t[4]=n=>I.value.All_23G=n),onChange:se,label:"2/3G全选",border:""},null,8,["modelValue"])])])]),default:a(()=>[u("div",Ae,[(_(!0),O(P,null,Q(j("2/3G"),n=>y((_(),m(L,{style:{"margin-top":"5px"},key:n.name,modelValue:n.checked,"onUpdate:modelValue":M=>n.checked=M,label:n.name,size:"large",border:"",disabled:n.isdisabled=="0"},null,8,["modelValue","onUpdate:modelValue","label","disabled"])),[[X,n.isdisabled!="0"]])),128))]),l(B,{type:"primary",style:{"margin-top":"15px",width:"100%"},onClick:t[5]||(t[5]=n=>re())},{default:a(()=>[p("应用")]),_:1})]),_:1})),[[S,c(i)]])]),_:1})),[[U]]),y((_(),m(N,{xs:24,sm:24,md:12,lg:12,xl:12,class:"mb-[5px]",initial:{opacity:0,y:100},enter:{opacity:1,y:0,transition:{delay:200}}},{default:a(()=>[y((_(),m(T,{shadow:"never"},{header:a(()=>[u("div",Ie,[u("div",Ge,[l(c(V),{className:"type-it3",values:["锁定小区"],cursor:!1,speed:60})]),u("div",Ne,[l(B,{onClick:ee,type:"danger"},{default:a(()=>[p("重启")]),_:1}),l(B,{onClick:ae,type:"warning"},{default:a(()=>[p("热重载")]),_:1}),l(B,{disabled:s.value.lock=="0",onClick:te,type:"primary"},{default:a(()=>[p(x(s.value.lock=="0"?"未锁定":"解锁"),1)]),_:1},8,["disabled"])])])]),default:a(()=>[u("div",Le,[l(v,{label:"频点"},{default:a(()=>[l(d,{type:"text",modelValue:s.value.arfrcn,"onUpdate:modelValue":t[6]||(t[6]=n=>s.value.arfrcn=n),modelModifiers:{number:!0},autocomplete:"off",style:{width:"85%"}},null,8,["modelValue"])]),_:1}),l(v,{label:"小区"},{default:a(()=>[l(d,{type:"text",modelValue:s.value.pci,"onUpdate:modelValue":t[7]||(t[7]=n=>s.value.pci=n),modelModifiers:{number:!0},autocomplete:"off",style:{width:"85%"}},null,8,["modelValue"])]),_:1})]),l(B,{type:"primary",style:{"margin-top":"15px",width:"100%"},onClick:le},{default:a(()=>[p("应用")]),_:1})]),_:1})),[[S,c(r)]]),l(T,{shadow:"never",style:{"margin-top":"5px"}},{header:a(()=>[u("div",Se,[u("div",Ue,[l(c(V),{className:"type-it4",values:["小区信息"],cursor:!1,speed:60})])])]),default:a(()=>[u("div",De,[l(pe,{height:`calc(${c(J)}px - 35vh - 340px)`},{default:a(()=>[l(fe,{direction:"vertical",column:3,border:"",size:"default"},{default:a(()=>[l(C,{label:"RSRP",span:1},{default:a(()=>[p(x(Z(c(k).state.Signal.rssi)),1)]),_:1}),l(C,{label:"RSRQ",span:1},{default:a(()=>[p(x(ue(c(k).state.CellInfo.detail_cell_rsrq)),1)]),_:1}),l(C,{label:"RSSI",span:1},{default:a(()=>[p(x(Z(c(k).state.CellInfo.detail_cell_rssi)),1)]),_:1}),l(C,{label:"PCI",span:1},{default:a(()=>[p(x(c(k).state.CellInfo.detail_cell_pci),1)]),_:1}),l(C,{label:"SINR",span:1},{default:a(()=>[p(x(c(k).state.CellInfo.detail_cell_sinr),1)]),_:1}),l(C,{label:"CELLID",span:1},{default:a(()=>[p(x(c(k).state.CellInfo.detail_cell_id),1)]),_:1})]),_:1})]),_:1},8,["height"])])]),_:1})]),_:1})),[[U]])]),_:1}))])}}});export{Oe as default};
