import{a5 as D,b as P,r as _,ah as N,e as U,S as v,j as w,k as z,l as j,m as q,bv as B,c as F,v as I,p as a,q as n,n as t,s as R,o as A,P as d,x as i,aj as L,u as M}from"./index.8d733f79.js";import{E as T}from"./el-input-number.60463ef8.js";import{s as G,e as O}from"./deviceGroup.8eaffc4c.js";import"./index.28f6da25.js";const H={class:"page-content"},J={style:{display:"flex","justify-content":"space-between"}},K={class:"dialog-footer"},Q=D({name:"deviceGroupList"}),te=Object.assign(Q,{setup(W){const{t:y}=P(),h=M(),g=_(),p=N({total:0,tableData:[],columns:[{prop:"factoryName",label:"factoryName"},{prop:"factoryId",label:"factoryId"},{prop:"ultimateNum",label:"sensorNum",formatter:e=>`${y("flagShipV")}\uFF1A${e.ultimateNum||0}\uFF0C${y("standardV")}\uFF1A${e.standardNum||0}`},{label:"action",type:"action",width:180,fixed:"right"}]}),s=N({factoryId:"",factoryName:"",pageNo:1,pageSize:10}),r=_(!1),u=N({ultimateNum:null,standardNum:null});U(()=>{f()});async function f(){if(s.factoryId&&!/^\d+$/.test(s.factoryId)){v.error("\u5DE5\u5382ID\u8BF7\u8F93\u5165\u6570\u5B57");return}const e=await G(s);p.total=e.data.totalElements,p.tableData=e.data.content}const k=()=>{var e;(e=g.value)==null||e.resetFields(),f()},S=e=>{r.value=!0,u.ultimateNum=e.ultimateNum||0,u.standardNum=e.standardNum||0,u.id=e.id},C=()=>{O(u).then(e=>{v.success(e.msg),r.value=!1,f()})};return(e,l)=>{const b=w,c=z,m=j,$=q,V=T,E=B;return A(),F("div",H,[I("div",J,[a($,{ref_key:"formRef",ref:g,model:t(s),inline:!0},{default:n(()=>[a(c,{label:e.$t("factoryName"),prop:"factoryName"},{default:n(()=>[a(b,{modelValue:t(s).factoryName,"onUpdate:modelValue":l[0]||(l[0]=o=>t(s).factoryName=o),placeholder:e.$t("factoryNameP"),maxlength:"20",style:{width:"236px"}},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a(c,{label:e.$t("factoryId"),prop:"factoryId"},{default:n(()=>[a(b,{modelValue:t(s).factoryId,"onUpdate:modelValue":l[1]||(l[1]=o=>t(s).factoryId=o),placeholder:e.$t("factoryIdP"),maxlength:"20",style:{width:"236px"}},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a(c,null,{default:n(()=>[a(m,{type:"primary",onClick:f},{default:n(()=>[d(i(e.$t("query")),1)]),_:1}),a(m,{onClick:k},{default:n(()=>[d(i(e.$t("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"]),a(m,{onClick:l[2]||(l[2]=o=>t(h).push("/"))},{default:n(()=>[d(i(e.$t("quitConfig")),1)]),_:1})]),a(t(L),{class:"f-h",columns:t(p).columns,tableData:t(p).tableData,total:t(p).total,pageNum:t(s).pageNo,"onUpdate:pageNum":l[3]||(l[3]=o=>t(s).pageNo=o),pageSize:t(s).pageSize,"onUpdate:pageSize":l[4]||(l[4]=o=>t(s).pageSize=o),onPagination:f},{action:n(({scope:o})=>[a(m,{link:"",type:"primary",onClick:X=>S(o.row)},{default:n(()=>[d(i(e.$t("sensorNum")),1)]),_:2},1032,["onClick"])]),_:1},8,["columns","tableData","total","pageNum","pageSize"]),a(E,{title:e.$t("sensorNum"),modelValue:t(r),"onUpdate:modelValue":l[8]||(l[8]=o=>R(r)?r.value=o:null),width:"420px","align-center":""},{footer:n(()=>[I("div",K,[a(m,{onClick:l[7]||(l[7]=o=>r.value=!1)},{default:n(()=>[d(i(e.$t("cancel")),1)]),_:1}),a(m,{type:"primary",onClick:C},{default:n(()=>[d(i(e.$t("confirm")),1)]),_:1})])]),default:n(()=>[a($,{model:t(u),"label-position":"top"},{default:n(()=>[a(c,{label:e.$t("flagShipNum"),prop:"ultimateNum"},{default:n(()=>[a(V,{class:"input-number",modelValue:t(u).ultimateNum,"onUpdate:modelValue":l[5]||(l[5]=o=>t(u).ultimateNum=o),placeholder:e.$t("flagShipNumP"),precision:0,min:0,max:99999,controls:!1},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a(c,{label:e.$t("standardNum"),prop:"standardNum"},{default:n(()=>[a(V,{class:"input-number",modelValue:t(u).standardNum,"onUpdate:modelValue":l[6]||(l[6]=o=>t(u).standardNum=o),placeholder:e.$t("standardNumP"),precision:0,min:0,max:99999,controls:!1},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])])}}});export{te as default};
