import{_ as k}from"./form.vue_vue_type_script_setup_true_lang-f7f23899.js";import{a8 as c,as as I,f as R,t as H}from"./index-fa5d6b3f.js";import{m as p}from"./message-6f31e976.js";import{g as M}from"./system-75614cde.js";import{u as S}from"./hooks-2777bcf3.js";import"./index-47090b5c.js";function O(){const n=Vue.reactive({name:"",status:null}),u=Vue.ref(),l=Vue.ref([]),i=Vue.ref(!0),{tagStyle:r}=S(),o=[{label:"部门名称",prop:"name",width:180,align:"left"},{label:"排序",prop:"sort",minWidth:70},{label:"状态",prop:"status",minWidth:100,cellRenderer:({row:t,props:e})=>Vue.createVNode(Vue.resolveComponent("el-tag"),{size:e.size,style:r.value(t.status)},{default:()=>[t.status===1?"启用":"停用"]})},{label:"创建时间",minWidth:200,prop:"createTime",formatter:({createTime:t})=>dayjs(t).format("YYYY-MM-DD HH:mm:ss")},{label:"备注",prop:"remark",minWidth:320},{label:"操作",fixed:"right",width:160,slot:"operation"}];function d(t){}function h(t){t&&(t.resetFields(),s())}async function s(){i.value=!0;const{data:t}=await M();let e=t;c(n.name)||(e=e.filter(a=>a.name.includes(n.name))),c(n.status)||(e=e.filter(a=>a.status===n.status)),l.value=I(e),setTimeout(()=>{i.value=!1},500)}function m(t){if(!t||!t.length)return;const e=[];for(let a=0;aVue.h(k,{ref:u}),beforeSure:(a,{options:b})=>{const v=u.value.getRef(),V=b.props.formInline;function f(){p(`您${t}了部门名称为${V.name}的这条数据`,{type:"success"}),a(),s()}v.validate(y=>{y&&f()})}})}function D(t){p(`您删除了部门名称为${t.name}的这条数据`,{type:"success"}),s()}return Vue.onMounted(()=>{s()}),{form:n,loading:i,columns:o,dataList:l,onSearch:s,resetForm:h,openDialog:g,handleDelete:D,handleSelectionChange:d}}export{O as useDept};