import{ai as M,r as u,j as R,h as H,a as S,by as T,b5 as p,bI as W,a2 as Y,A as $,M as C,m as o}from"./index-037de6e8.js";import{_ as F}from"./form.vue_vue_type_script_setup_true_lang-3a2000fd.js";import{g as O}from"./system-f771600d.js";import{u as _}from"./hooks-d72fa58b.js";import"./index-a487377f.js";function P(){const n=M({name:"",status:null}),m=u(),l=u([]),i=u(!0),{tagStyle:r}=_(),d=[{label:"部门名称",prop:"name",width:180,align:"left"},{label:"排序",prop:"sort",minWidth:70},{label:"状态",prop:"status",minWidth:100,cellRenderer:({row:a,props:e})=>H(S("el-tag"),{size:e.size,style:r.value(a.status)},{default:()=>[a.status===1?"启用":"停用"]})},{label:"创建时间",minWidth:200,prop:"createTime",formatter:({createTime:a})=>T(a).format("YYYY-MM-DD HH:mm:ss")},{label:"备注",prop:"remark",minWidth:320},{label:"操作",fixed:"right",width:160,slot:"operation"}];function h(a){}function g(a){a&&(a.resetFields(),s())}async function s(){i.value=!0;const{data:a}=await O();let e=a;p(n.name)||(e=e.filter(t=>t.name.includes(n.name))),p(n.status)||(e=e.filter(t=>t.status===n.status)),l.value=W(e),setTimeout(()=>{i.value=!1},500)}function c(a){if(!a||!a.length)return;const e=[];for(let t=0;tC(F,{ref:m}),beforeSure:(t,{options:v})=>{const y=m.value.getRef(),I=v.props.formInline;function f(){o(`您${a}了部门名称为${I.name}的这条数据`,{type:"success"}),t(),s()}y.validate(k=>{k&&f()})}})}function D(a){o(`您删除了部门名称为${a.name}的这条数据`,{type:"success"}),s()}return R(()=>{s()}),{form:n,loading:i,columns:d,dataList:l,onSearch:s,resetForm:g,openDialog:b,handleDelete:D,handleSelectionChange:h}}export{P as useDept};