import{a5 as C,b as N,ah as m,e as $,l as k,c as w,v as g,x as i,p as l,q as p,n as t,ai as f,o as S,P as d,aj as Y,u as E,S as G,D as T}from"./index.8d733f79.js";import{g as z,d as M}from"./deviceGroup.8eaffc4c.js";const j={class:"page-content"},q={class:"page-title"},x={style:{display:"flex","justify-content":"space-between","margin-bottom":"20px"}},B=C({name:"deviceGroupList"}),I=Object.assign(B,{setup(L){const{t:h,locale:P}=N(),{proxy:y}=T(),c=E(),n=m({total:0,tableData:[],columns:[{prop:"groupName",label:"groupName"},{prop:"dataAuthName",label:"dataAuth"},{prop:"watchEndTime",label:"watchTime",formatter:e=>`${f(e.watchStartTime).format("YYYY-MM-DD")} - ${f(e.watchEndTime).format("YYYY-MM-DD")}`},{label:"action",type:"action",width:180,fixed:"right"}]}),s=m({name:"",pageNo:1,pageSize:10});$(()=>{u()});async function u(){const e=await z(s);n.total=e.data.totalElements,n.tableData=e.data.content}const b=()=>{c.push({path:"/sysConfig/deviceGroup/edit"})},D=e=>{c.push({path:"/sysConfig/deviceGroup/edit",query:{id:e.id}})},_=e=>{y.$modal.confirm(h("confirmDelete")).then(()=>{M({id:e.id}).then(a=>{G.success(a.msg),u()})}).catch(()=>{})};return(e,a)=>{const r=k;return S(),w("div",j,[g("div",q,i(e.$t("deviceGroup")),1),g("div",x,[l(r,{type:"primary",onClick:b},{default:p(()=>[d(i(e.$t("addGroup")),1)]),_:1}),l(r,{onClick:a[0]||(a[0]=o=>t(c).push("/"))},{default:p(()=>[d(i(e.$t("quitConfig")),1)]),_:1})]),l(t(Y),{class:"f-h",columns:t(n).columns,tableData:t(n).tableData,total:t(n).total,pageNum:t(s).pageNo,"onUpdate:pageNum":a[1]||(a[1]=o=>t(s).pageNo=o),pageSize:t(s).pageSize,"onUpdate:pageSize":a[2]||(a[2]=o=>t(s).pageSize=o),onPagination:u},{action:p(({scope:o})=>[l(r,{link:"",type:"primary",onClick:v=>D(o.row)},{default:p(()=>[d(i(e.$t("edit")),1)]),_:2},1032,["onClick"]),l(r,{link:"",type:"danger",onClick:v=>_(o.row),disabled:o.row.groupType===2},{default:p(()=>[d(i(e.$t("delete")),1)]),_:2},1032,["onClick","disabled"])]),_:1},8,["columns","tableData","total","pageNum","pageSize"])])}}});export{I as default};
