import{d as X,Q as Y,J as Z,r as o,A as $,b as j,a1 as E,o as p,c as A,k as a,B as e,a as s,F,i as G,a3 as H,N as M,g as i,O as u,P as y,D as K,h as L,aF as aa,a7 as ea,S as la,$ as sa,R as ta,U as ra,V as oa,W as pa,X as ua,Y as da,Z as na}from"./index-BP6bNRoi.js";import{_ as ia}from"./DictTag.vue_vue_type_script_lang-DwXPHgid.js";import{_ as ma}from"./ContentWrap.vue_vue_type_script_setup_true_lang-CR_2gECF.js";import{d as ca}from"./formatTime-DwR9f7DP.js";import{h as fa}from"./tree-BBZY150N.js";import{b as _a,d as ya}from"./index-BdNokKwC.js";import{_ as va}from"./DeptForm.vue_vue_type_script_setup_true_lang-BniUbzt4.js";import{g as ba}from"./index-vFgEqmZu.js";import"./color-DXkOL5Tu.js";import"./el-card-bU92WWV4.js";import"./Dialog.vue_vue_type_style_index_0_lang-DFckl8Er.js";import"./el-tree-select-pYALMRc9.js";import"./constants-CuOBQ73z.js";const ka=X({name:"SystemDept",__name:"index",setup(wa){const h=Y(),{t:P}=Z(),v=o(!0),g=o(),r=$({pageNo:1,pageSize:100,name:void 0,status:void 0}),S=o(),b=o(!0),k=o(!0),V=o([]),m=async()=>{v.value=!0;try{const c=await _a(r);g.value=fa(c)}finally{v.value=!1}},R=()=>{k.value=!1,b.value=!b.value,aa(()=>{k.value=!0})},U=()=>{m()},q=()=>{r.pageNo=1,S.value.resetFields(),U()},N=o(),O=(c,t)=>{N.value.open(c,t)};return j(async()=>{await m(),V.value=await ba()}),(c,t)=>{const z=ea,w=la,D=sa,B=ta,f=ra,d=oa,I=pa,T=ma,n=ua,J=ia,Q=da,x=E("hasPermi"),W=na;return p(),A(F,null,[a(T,null,{default:e(()=>[a(I,{class:"-mb-15px",model:s(r),ref_key:"queryFormRef",ref:S,inline:!0,"label-width":"68px"},{default:e(()=>[a(w,{label:"\u90E8\u95E8\u540D\u79F0",prop:"name"},{default:e(()=>[a(z,{modelValue:s(r).name,"onUpdate:modelValue":t[0]||(t[0]=l=>s(r).name=l),placeholder:"\u8BF7\u8F93\u5165\u90E8\u95E8\u540D\u79F0",clearable:"",class:"!w-240px"},null,8,["modelValue"])]),_:1}),a(w,{label:"\u90E8\u95E8\u72B6\u6001",prop:"status"},{default:e(()=>[a(B,{modelValue:s(r).status,"onUpdate:modelValue":t[1]||(t[1]=l=>s(r).status=l),placeholder:"\u8BF7\u9009\u62E9\u90E8\u95E8\u72B6\u6001",clearable:"",class:"!w-240px"},{default:e(()=>[(p(!0),A(F,null,G(s(H)(s(M).COMMON_STATUS),l=>(p(),i(D,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(w,null,{default:e(()=>[a(d,{onClick:U},{default:e(()=>[a(f,{icon:"ep:search",class:"mr-5px"}),u(" \u641C\u7D22")]),_:1}),a(d,{onClick:q},{default:e(()=>[a(f,{icon:"ep:refresh",class:"mr-5px"}),u(" \u91CD\u7F6E")]),_:1}),y((p(),i(d,{type:"primary",plain:"",onClick:t[2]||(t[2]=l=>O("create"))},{default:e(()=>[a(f,{icon:"ep:plus",class:"mr-5px"}),u(" \u65B0\u589E ")]),_:1})),[[x,["system:dept:create"]]]),a(d,{type:"danger",plain:"",onClick:R},{default:e(()=>[a(f,{icon:"ep:sort",class:"mr-5px"}),u(" \u5C55\u5F00/\u6298\u53E0 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a(T,null,{default:e(()=>[s(k)?y((p(),i(Q,{key:0,data:s(g),"row-key":"id","default-expand-all":s(b)},{default:e(()=>[a(n,{prop:"name",label:"\u90E8\u95E8\u540D\u79F0"}),a(n,{prop:"leader",label:"\u8D1F\u8D23\u4EBA"},{default:e(l=>{var _;return[u(K((_=s(V).find(C=>C.id===l.row.leaderUserId))==null?void 0:_.nickname),1)]}),_:1}),a(n,{prop:"sort",label:"\u6392\u5E8F"}),a(n,{prop:"status",label:"\u72B6\u6001"},{default:e(l=>[a(J,{type:s(M).COMMON_STATUS,value:l.row.status},null,8,["type","value"])]),_:1}),a(n,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",width:"180",formatter:s(ca)},null,8,["formatter"]),a(n,{label:"\u64CD\u4F5C",align:"center"},{default:e(l=>[y((p(),i(d,{link:"",type:"primary",onClick:_=>O("update",l.row.id)},{default:e(()=>[u(" \u4FEE\u6539 ")]),_:2},1032,["onClick"])),[[x,["system:dept:update"]]]),y((p(),i(d,{link:"",type:"danger",onClick:_=>(async C=>{try{await h.delConfirm(),await ya(C),h.success(P("common.delSuccess")),await m()}catch{}})(l.row.id)},{default:e(()=>[u(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[x,["system:dept:delete"]]])]),_:1})]),_:1},8,["data","default-expand-all"])),[[W,s(v)]]):L("",!0)]),_:1}),a(va,{ref_key:"formRef",ref:N,onSuccess:m},null,512)],64)}}});export{ka as default};
|