var C=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var S=(a,p)=>{var i={};for(var o in a)O.call(a,o)&&p.indexOf(o)<0&&(i[o]=a[o]);if(a!=null&&C)for(var o of C(a))p.indexOf(o)<0&&z.call(a,o)&&(i[o]=a[o]);return i};import{j as G,k as L,l as W,m as Z}from"./index.js";import{u as q,B as J}from"./useTable-f8594a7b.js";import{T as Q}from"./useForm-322569b9.js";import{N as X,P as ee,j as v}from"./antd-fb8ca017.js";import{r as te,b as oe,s as ne,c as se,a as x}from"./schema-0ccd7140.js";import{u as ae}from"./index-922f0b14.js";import{_ as re}from"./drawer.vue_vue_type_script_setup_true_lang-17aa6ae1.js";import{d as ie,f as le,a6 as ce,n as de,Z as m,_ as E,k as _,a5 as c,u as s,F as me,$ as Y,a0 as ue,G as N,a4 as y,a8 as V,m as fe}from"./vue-08ef39cb.js";import"./index-9a268806.js";import"./useWindowSizeFn-40274562.js";import"./onMountedOrActivated-4630d53b.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-bf4926ca.js";const pe={key:1},xe=ie({name:"AUTH_DATA_EVENT",__name:"index",setup(a){const{createMessage:p}=W(),{hasPermission:i}=G(),o=L(),u=le([]),B=e=>{u.value=e.filter(t=>typeof t!="undefined")},[H,{openDrawer:k}]=ae(),[P,{reload:D,setSelectedRowKeys:g}]=q({title:"事件明细表",api:e=>ne(R(e)),columns:se,formConfig:{labelWidth:120,schemas:x,showAdvancedButton:!1},rowSelection:{type:"checkbox",onChange:B},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,rowKey:e=>e.id,actionColumn:{width:170,title:"操作",dataIndex:"action",fixed:"right"}}),R=e=>{const w=e,{pageNum:t,pageSize:h,field:A="id",order:T="descend"}=w,f=S(w,["pageNum","pageSize","field","order"]),r={pageNum:t,pageSize:h,orderByClause:`${A} ${T==="descend"?"desc":"asc"}`};return Object.keys(f).forEach(b=>{const d=x.find(K=>K.field===b),n=e[b],l=b;d?n!==void 0&&n!==""&&(d.component==="Input"?r[l]=`%${n.trim()}%`:["Select","ApiSelect","ApiTreeSelect"].includes(d.component)?r[l]=Z(n)?n.value:n:d.component==="RangePicker"?(r[`${l}From`]=v(n[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),r[`${l}To`]=v(n[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):d.component==="DatePicker"?r[l]=v(n).format(d.componentProps.format||"YYYY-MM-DD"):r[l]=n):r[l]=n}),r},M=()=>{k(!0,{isUpdate:!1})},$=e=>{k(!0,{record:e,isUpdate:!0})},U=e=>{te(e.id).then(t=>{D(),g([])})},j=()=>{if(u.value.length===0){p.error("当前未选中任何项目！");return}oe(u.value).then(e=>{D(),g([])})},F=()=>{D()},I=e=>{o("/data/event/detail/"+e.id)};return(e,t)=>{const h=ce("a-button"),A=de("auth");return m(),E("div",null,[_(s(J),{onRegister:s(P)},{headerTop:c(()=>[_(s(X),{type:"info","show-icon":""},{message:c(()=>[u.value.length>0?(m(),E(me,{key:0},[Y("span",null,"已选中"+ue(u.value.length)+"条记录",1),_(h,{type:"link",onClick:t[0]||(t[0]=T=>s(g)([])),size:"small"},{default:c(()=>t[1]||(t[1]=[N("清空")])),_:1}),s(i)("AUTH_DATA_EVENT:DELETE")?(m(),y(s(ee),{key:0,class:"ml-4",title:"确定要全部删除吗？","ok-text":"是","cancel-text":"否",onConfirm:j},{default:c(()=>t[2]||(t[2]=[Y("a",{href:"#",class:"text-red-500"},"删除",-1)])),_:1})):V("",!0)],64)):(m(),E("span",pe,"未选中任何项目"))]),_:1})]),toolbar:c(()=>[fe((m(),y(h,{type:"primary",onClick:M},{default:c(()=>t[3]||(t[3]=[N(" 新增")])),_:1})),[[A,"AUTH_DATA_EVENT:ADD"]])]),bodyCell:c(({column:T,record:f})=>[T.dataIndex==="action"?(m(),y(s(Q),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:$.bind(null,f),ifShow:s(i)("AUTH_DATA_EVENT:EDIT"),divider:!0},{label:"详情",icon:"ant-design:eye-outlined",onClick:I.bind(null,f),divider:!0}],dropDownActions:[{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:U.bind(null,f),placement:"topRight"},ifShow:s(i)("AUTH_DATA_EVENT:DELETE")}]},null,8,["actions","dropDownActions"])):V("",!0)]),_:1},8,["onRegister"]),_(re,{onRegister:s(H),onSuccess:F},null,8,["onRegister"])])}}});export{xe as default};
