import{_ as I,b as N,u as A,a as P,ah as y,e as z,o as f,c as _,p as o,q as s,P as u,x as l,n as a,t as g,aj as E,l as L,k as q,m as x,D as B}from"./index.8d733f79.js";import{i as M,j as O,k as V}from"./systemLink.0379a9eb.js";import j from"./addAddress.d96cdcd4.js";const F={class:"apiParams_wrap"},T={key:0,style:{color:"red"}},U={key:1},G={__name:"opcAddressList",setup(H){const{t:h}=N(),{proxy:d}=B(),k=A(),C=P(),i=y({total:0,tableData:[],columns:[{prop:"opcServer",label:"address"},{prop:"status",label:"linkStatus",type:"status"},{label:"action",type:"action",width:300,fixed:"right"}]}),r=y({factoryId:C.query.factoryId||"",pageNo:1,pageSize:10});z(()=>{c()});async function c(){const e=await M(r);i.total=e.data.totalElements,i.tableData=e.data.content}const $=()=>{d.$refs.addAddressRef.showModal()},b=e=>{d.$refs.addAddressRef.showModal(e)},v=e=>{d.$modal.confirm(h("confirmDelete")).then(()=>{O(e.id).then(n=>{d.$modal.msgSuccess(n.msg),c()})}).catch(()=>{})},w=e=>{V(e.id).then(n=>{d.$modal.msgSuccess(n.msg),c()})},S=e=>{k.push({path:"/system/factory/opcPointList",query:{factoryId:e.factoryId,addressId:e.id}})};return(e,n)=>{const p=L,D=q,R=x;return f(),_("div",F,[o(R,{ref:"formRef",model:a(r),inline:!0,"label-width":"68px"},{default:s(()=>[o(D,null,{default:s(()=>[o(p,{type:"primary",onClick:$},{default:s(()=>[u(l(e.$t("add")),1)]),_:1})]),_:1})]),_:1},8,["model"]),o(a(E),{class:"f-h",ref:"tableRef",columns:a(i).columns,tableData:a(i).tableData,total:a(i).total,pageNum:a(r).pageNo,"onUpdate:pageNum":n[0]||(n[0]=t=>a(r).pageNo=t),pageSize:a(r).pageSize,"onUpdate:pageSize":n[1]||(n[1]=t=>a(r).pageSize=t),onPagination:c},{status:s(({scope:t})=>[t.row.status==="0"?(f(),_("span",T,l(e.$t("notConnected")),1)):g("",!0),t.row.status==="1"?(f(),_("span",U,l(e.$t("connected")),1)):g("",!0)]),action:s(({scope:t})=>[o(p,{link:"",type:"primary",onClick:m=>w(t.row)},{default:s(()=>[u(l(e.$t("reConn")),1)]),_:2},1032,["onClick"]),o(p,{link:"",type:"primary",onClick:m=>S(t.row)},{default:s(()=>[u(l(e.$t("opcPointConfig")),1)]),_:2},1032,["onClick"]),o(p,{link:"",type:"primary",onClick:m=>b(t.row)},{default:s(()=>[u(l(e.$t("edit")),1)]),_:2},1032,["onClick"]),o(p,{link:"",type:"danger",onClick:m=>v(t.row)},{default:s(()=>[u(l(e.$t("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["columns","tableData","total","pageNum","pageSize"]),o(a(j),{ref:"addAddressRef",onRefesh:c},null,512)])}}},W=I(G,[["__scopeId","data-v-4b899a66"]]);export{W as default};
