2 lines
5.0 KiB
JavaScript
2 lines
5.0 KiB
JavaScript
import{$ as z,C as J,D as Q,J as Z,K as j,w as G,F as H,L as W,M as X,N as Y,O as ee}from"./element-plus.91c68cc0.js";import{f as te,b as oe}from"./index.e9c2eb26.js";import{d as K,s as F,r as g,Z as ae,i as le,n as x,ap as ne,o as p,c as se,U as t,L as o,u as s,aa as ie,R as i,a as re,M as E,K as f,S as ue,Q as T}from"./@vue.76ce7aa3.js";import{_ as pe}from"./edit.vue_vue_type_script_setup_true_lang.6889a3f4.js";import{e as me,f as de}from"./department.44e4f986.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.4e6d2a38.js";import"./axios.cffda5ac.js";import"./jspdf.6c61b9d3.js";import"./fflate.0418c72f.js";import"./vue-router.10bd5b90.js";import"./pinia.f3529286.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";import"./index.d78ce335.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.cf0d972e.js";import"./useDictOptions.3b9f7ea9.js";const fe={class:"department"},ce=K({name:"department"}),tt=K({...ce,setup(_e){const B=F(),c=F(),D=F();let k=!1;const C=g(!1),b=g([]),m=ae({status:"",name:""}),v=g(!1),d=async()=>{C.value=!0,b.value=await me(m),C.value=!1},S=()=>{var a;(a=D.value)==null||a.resetFields(),d()},V=async a=>{var e,n;v.value=!0,await x(),a&&((e=c.value)==null||e.setFormData({pid:a})),(n=c.value)==null||n.open("add")},h=async a=>{var e,n;v.value=!0,await x(),(e=c.value)==null||e.open("edit"),(n=c.value)==null||n.getDetail(a)},M=async a=>{await te.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await de({id:a}),d()},R=()=>{k=!k,$(b.value,k)},$=(a,e=!0)=>{var n;for(const r in a)(n=B.value)==null||n.toggleRowExpansion(a[r],e),a[r].children&&$(a[r].children,e)};return le(async()=>{await d(),x(()=>{R()})}),(a,e)=>{const n=J,r=Q,w=Z,P=j,u=G,U=H,L=W,A=oe,_=X,I=z,O=Y,y=ne("perms"),q=ee;return p(),se("div",fe,[t(L,{class:"!border-none",shadow:"never"},{default:o(()=>[t(U,{ref_key:"formRef",ref:D,class:"mb-[-16px]",model:s(m),inline:!0},{default:o(()=>[t(r,{label:"\u90E8\u95E8\u540D\u79F0",prop:"name"},{default:o(()=>[t(n,{class:"w-[280px]",modelValue:s(m).name,"onUpdate:modelValue":e[0]||(e[0]=l=>s(m).name=l),clearable:"",onKeyup:ie(d,["enter"])},null,8,["modelValue"])]),_:1}),t(r,{label:"\u90E8\u95E8\u72B6\u6001",prop:"status"},{default:o(()=>[t(P,{class:"w-[280px]",modelValue:s(m).status,"onUpdate:modelValue":e[1]||(e[1]=l=>s(m).status=l)},{default:o(()=>[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(r,null,{default:o(()=>[t(u,{type:"primary",onClick:d},{default:o(()=>e[4]||(e[4]=[i("\u67E5\u8BE2")])),_:1}),t(u,{onClick:S},{default:o(()=>e[5]||(e[5]=[i("\u91CD\u7F6E")])),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),t(L,{class:"!border-none mt-4",shadow:"never"},{default:o(()=>[re("div",null,[E((p(),f(u,{type:"primary",onClick:e[2]||(e[2]=l=>V())},{icon:o(()=>[t(A,{name:"el-icon-Plus"})]),default:o(()=>[e[6]||(e[6]=i(" \u65B0\u589E "))]),_:1})),[[y,["dept.dept/add"]]]),t(u,{onClick:R},{default:o(()=>e[7]||(e[7]=[i(" \u5C55\u5F00/\u6298\u53E0 ")])),_:1})]),E((p(),f(O,{ref_key:"tableRef",ref:B,class:"mt-4",size:"large",data:s(b),"row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}},{default:o(()=>[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:o(({row:l})=>[t(I,{class:"ml-2",type:l.status?"":"danger"},{default:o(()=>[i(ue(l.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:o(({row:l})=>[E((p(),f(u,{type:"primary",link:"",onClick:N=>V(l.id)},{default:o(()=>e[8]||(e[8]=[i(" \u65B0\u589E ")])),_:2},1032,["onClick"])),[[y,["dept.dept/add"]]]),E((p(),f(u,{type:"primary",link:"",onClick:N=>h(l)},{default:o(()=>e[9]||(e[9]=[i(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[y,["dept.dept/edit"]]]),l.pid!==0?E((p(),f(u,{key:0,type:"danger",link:"",onClick:N=>M(l.id)},{default:o(()=>e[10]||(e[10]=[i(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[y,["dept.dept/delete"]]]):T("",!0)]),_:1})]),_:1},8,["data"])),[[q,s(C)]])]),_:1}),s(v)?(p(),f(pe,{key:0,ref_key:"editRef",ref:c,onSuccess:d,onClose:e[3]||(e[3]=l=>v.value=!1)},null,512)):T("",!0)])}}});export{tt as default};
|