2 lines
4.1 KiB
JavaScript
2 lines
4.1 KiB
JavaScript
import{m as h,s as F,r as g,aT as M,b as O,n as x,bs as W,b2 as X,p as r,q as Y,t,v as a,u as s,aV as j,a2 as u,x as H,L as E,y as f,G as J,A as N,aW as Q,aX as Z,b3 as ee,b4 as te,ae,aY as le,b5 as ne,b6 as oe,b7 as se,b8 as ue}from"./.pnpm.1b0299fb.js";import{f as ie,b as de}from"./index.689cfa31.js";import{_ as re}from"./edit.vue_vue_type_script_setup_true_lang.f15dfd76.js";import{e as pe,f as me}from"./department.f007a27f.js";import"./@vueuse.72d44d91.js";import"./lodash.c3b66c05.js";import"./@vue.9d708d7c.js";import"./index.6c48d0ba.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.abac7546.js";import"./useDictOptions.e9843f63.js";const fe={class:"department"},ce=h({name:"department"}),Be=h({...ce,setup(_e){const B=F(),c=F(),D=F();let y=!1;const k=g(!1),C=g([]),p=M({status:"",name:""}),v=g(!1),m=async()=>{k.value=!0,C.value=await pe(p),k.value=!1},A=()=>{var l;(l=D.value)==null||l.resetFields(),m()},V=async l=>{var e,o;v.value=!0,await x(),l&&((e=c.value)==null||e.setFormData({pid:l})),(o=c.value)==null||o.open("add")},P=async l=>{var e,o;v.value=!0,await x(),(e=c.value)==null||e.open("edit"),(o=c.value)==null||o.getDetail(l)},S=async l=>{await ie.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await me({id:l}),m()},R=()=>{y=!y,$(C.value,y)},$=(l,e=!0)=>{var o;for(const i in l)(o=B.value)==null||o.toggleRowExpansion(l[i],e),l[i].children&&$(l[i].children,e)};return O(async()=>{await m(),x(()=>{R()})}),(l,e)=>{const o=Q,i=Z,w=ee,q=te,d=ae,I=le,T=ne,K=de,_=oe,U=W,z=se,b=X("perms"),G=ue;return r(),Y("div",fe,[t(T,{class:"!border-none",shadow:"never"},{default:a(()=>[t(I,{ref_key:"formRef",ref:D,class:"mb-[-16px]",model:s(p),inline:!0},{default:a(()=>[t(i,{label:"\u90E8\u95E8\u540D\u79F0",prop:"name"},{default:a(()=>[t(o,{class:"w-[280px]",modelValue:s(p).name,"onUpdate:modelValue":e[0]||(e[0]=n=>s(p).name=n),clearable:"",onKeyup:j(m,["enter"])},null,8,["modelValue"])]),_:1}),t(i,{label:"\u90E8\u95E8\u72B6\u6001",prop:"status"},{default:a(()=>[t(q,{class:"w-[280px]",modelValue:s(p).status,"onUpdate:modelValue":e[1]||(e[1]=n=>s(p).status=n)},{default:a(()=>[t(w,{label:"\u5168\u90E8",value:""}),t(w,{label:"\u6B63\u5E38",value:"1"}),t(w,{label:"\u505C\u7528",value:"0"})]),_:1},8,["modelValue"])]),_:1}),t(i,null,{default:a(()=>[t(d,{type:"primary",onClick:m},{default:a(()=>e[4]||(e[4]=[u("\u67E5\u8BE2")])),_:1}),t(d,{onClick:A},{default:a(()=>e[5]||(e[5]=[u("\u91CD\u7F6E")])),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),t(T,{class:"!border-none mt-4",shadow:"never"},{default:a(()=>[H("div",null,[E((r(),f(d,{type:"primary",onClick:e[2]||(e[2]=n=>V())},{icon:a(()=>[t(K,{name:"el-icon-Plus"})]),default:a(()=>[e[6]||(e[6]=u(" \u65B0\u589E "))]),_:1})),[[b,["dept.dept/add"]]]),t(d,{onClick:R},{default:a(()=>e[7]||(e[7]=[u(" \u5C55\u5F00/\u6298\u53E0 ")])),_:1})]),E((r(),f(z,{ref_key:"tableRef",ref:B,class:"mt-4",size:"large",data:s(C),"row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}},{default:a(()=>[t(_,{label:"\u90E8\u95E8\u540D\u79F0",prop:"name","min-width":"150","show-overflow-tooltip":""}),t(_,{label:"\u90E8\u95E8\u72B6\u6001",prop:"status","min-width":"100"},{default:a(({row:n})=>[t(U,{class:"ml-2",type:n.status?"":"danger"},{default:a(()=>[u(J(n.status_desc),1)]),_:2},1032,["type"])]),_:1}),t(_,{label:"\u6392\u5E8F",prop:"sort","min-width":"100"}),t(_,{label:"\u66F4\u65B0\u65F6\u95F4",prop:"update_time","min-width":"180"}),t(_,{label:"\u64CD\u4F5C",width:"160",fixed:"right"},{default:a(({row:n})=>[E((r(),f(d,{type:"primary",link:"",onClick:L=>V(n.id)},{default:a(()=>e[8]||(e[8]=[u(" \u65B0\u589E ")])),_:2},1032,["onClick"])),[[b,["dept.dept/add"]]]),E((r(),f(d,{type:"primary",link:"",onClick:L=>P(n)},{default:a(()=>e[9]||(e[9]=[u(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[b,["dept.dept/edit"]]]),n.pid!==0?E((r(),f(d,{key:0,type:"danger",link:"",onClick:L=>S(n.id)},{default:a(()=>e[10]||(e[10]=[u(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[b,["dept.dept/delete"]]]):N("",!0)]),_:1})]),_:1},8,["data"])),[[G,s(k)]])]),_:1}),s(v)?(r(),f(re,{key:0,ref_key:"editRef",ref:c,onSuccess:m,onClose:e[3]||(e[3]=n=>v.value=!1)},null,512)):N("",!0)])}}});export{Be as default};
|