var D=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var x=(a,d)=>{var i={};for(var e in a)R.call(a,e)&&d.indexOf(e)<0&&(i[e]=a[e]);if(a!=null&&D)for(var e of D(a))d.indexOf(e)<0&&N.call(a,e)&&(i[e]=a[e]);return i};import{u as P,B as $}from"./useTable-e949a6b7.js";import{T as j}from"./useForm-baba730a.js";import{S as O,j as V,_ as A}from"./index.js";import{N as H,j as h}from"./antd-0679333d.js";import{r as z,s as E}from"./deviceApi-260fcde9.js";import{u as F}from"./index-679d8a0a.js";import{D as K,c as U,s as C}from"./drawer-dcc643f2.js";import{d as W,o as G,a6 as L,Z as S,_ as Z,$ as Y,k as p,u as c,a5 as b,l as q,G as J,a4 as Q,a8 as X}from"./vue-72a104e4.js";import"./index-8a6826ba.js";import"./useWindowSizeFn-1db11f4f.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-3ca69a78.js";const ee={class:"header"},te=W({__name:"index",setup(a){const[d,{openDrawer:i}]=F(),[e,{reload:v}]=P({api:t=>E(w(t)),columns:U,formConfig:{labelWidth:0,schemas:C,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,rowKey:t=>t.id,actionColumn:{width:180,title:"操作",dataIndex:"action",fixed:void 0}});G(()=>{WebViewService.setIsLoading(!1).then(()=>{})});const w=t=>{const g=t,{pageNum:n,pageSize:u,field:f="id",order:m="descend"}=g,I=x(g,["pageNum","pageSize","field","order"]),s={pageNum:n,pageSize:u,orderByClause:`${f} ${m==="descend"?"desc":"asc"}`};return Object.keys(I).forEach(_=>{const l=C.find(M=>M.field===_),o=t[_],r=_;l?o!==void 0&&o!==""&&(l.component==="Input"?s[r]=`%${o.trim()}%`:["Select","ApiSelect","ApiTreeSelect"].includes(l.component)?s[r]=V(o)?o.value:o:l.component==="RangePicker"?(s[`${r}From`]=h(o[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),s[`${r}To`]=h(o[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):l.component==="DatePicker"?s[r]=h(o).format(l.componentProps.format||"YYYY-MM-DD"):s[r]=o):s[r]=o}),s},y=()=>{i(!0,{isUpdate:!1})},T=t=>{i(!0,{record:t,isUpdate:!0})},k=t=>{z(t.id).then(n=>{v()})},B=()=>{v()};return(t,n)=>{const u=L("a-button");return S(),Z("div",null,[Y("div",ee,[p(c(O),{size:"19",name:"list"}),n[0]||(n[0]=Y("div",{class:"title"},"设备列表",-1))]),p(c($),{onRegister:c(e)},{toolbar:b(()=>[p(u,{type:"primary",onClick:y,icon:q(c(H))},{default:b(()=>n[1]||(n[1]=[J("新增")])),_:1},8,["icon"])]),bodyCell:b(({column:f,record:m})=>[f.dataIndex==="action"?(S(),Q(c(j),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:T.bind(null,m),divider:!0},{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:k.bind(null,m),placement:"topRight"}}]},null,8,["actions"])):X("",!0)]),_:1},8,["onRegister"]),p(K,{onRegister:c(d),onSuccess:B},null,8,["onRegister"])])}}});const he=A(te,[["__scopeId","data-v-56d2e6a3"]]);export{he as default};
