You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
3.9 KiB
JavaScript
2 lines
3.9 KiB
JavaScript
var T=(C,u,s)=>new Promise((c,f)=>{var y=o=>{try{i(s.next(o))}catch(l){f(l)}},h=o=>{try{i(s.throw(o))}catch(l){f(l)}},i=o=>o.done?c(o.value):Promise.resolve(o.value).then(y,h);i((s=s.apply(C,u)).next())});import{P as S}from"./index-D4Z9ODzF.js";import{u as $,_ as N}from"./useTable-BYZpzJPm.js";import{_ as P}from"./index-BRqXDmQx.js";import{d as B,f as F,c as L,_ as M,a as V}from"./DeptModal.vue_vue_type_script_setup_true_lang-Bvj4loaC.js";import{u as G}from"./index-COQSZY7c.js";import{b as K,bu as O,by as W,I as b}from"./entry/index-CT2bBVPU-1724922878694.js";import{d as j,aa as q,n as z,_,a8 as g,a9 as r,k as m,u as a,ae as H,G as x,m as J,ac as Q,y as U}from"./vue-aEZWZQSa.js";import{an as X}from"./antd-BY-1PcYE.js";import"./useContentViewHeight-CLqhWZ1e.js";import"./useWindowSizeFn-BWwSyuoE.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./useForm-koea_hsc.js";import"./FormItem.vue_vue_type_script_lang-fyvFSOLP.js";import"./componentMap-CWMsMsGY.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-RC179q1_.js";import"./copyTextToClipboard-BBFF3Y3I.js";import"./style-Cslz80qp.js";import"./helper-BqaPddWo.js";import"./BasicForm.vue_vue_type_style_index_0_lang-CUDTou-T.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-CKONboZ0.js";import"./download-Dzju1Gbo.js";import"./useLoading-CR9OIhwN.js";import"./index-34hMTgp8.js";import"./dictEnum-DeC8h6ZR.js";import"./dict-CrNwQRtO.js";import"./rules-Boel_RXz.js";import"./useRender-DwBE0jb3.js";import"./index-C4J1QZTF.js";const Re=j({name:"Dept",__name:"index",setup(C){const u=K("__dept_tip_read",!1),[s,{getRawDataSource:c,expandRows:f,collapseRows:y,expandAll:h,collapseAll:i,reload:o}]=$({title:"部门列表",isTreeTable:!0,showTableSetting:!0,api:B,pagination:!1,rowKey:"deptId",afterFetch(t){const e=O(t,{id:"deptId",pid:"parentId"});return W(e),e},useSearchForm:!0,formConfig:{schemas:F,name:"dept",baseColProps:{xs:24,sm:24,md:24,lg:6}},columns:L,actionColumn:{title:"操作",key:"action",fixed:"right"}});function l(){const t=c();t instanceof Array&&(t.forEach(e=>{e.expand=!0}),U(h))}const[A,{openModal:k}]=G();function D(t){const{deptId:e}=t;k(!0,{deptId:e,update:!0})}function v(t){k(!0,{deptId:t,update:!1})}function R(t){return T(this,null,function*(){yield V(t),yield o()})}function w(t){const e=c();if(e instanceof Array)switch(t){case"expandAll":e.forEach(n=>{n.expand=!0}),h();break;case"collapseAll":e.forEach(n=>{n.expand=!1}),i();break}}function E(t){const{deptId:e}=t;t.expand===!0?(y([e]),t.expand=!1):(f([e]),t.expand=!0)}return(t,e)=>{const n=q("a-button"),I=z("auth");return _(),g(a(S),{dense:""},{default:r(()=>[m(a(N),{onRegister:a(s),onFetchSuccess:l,onRowDbClick:E},H({toolbar:r(()=>[m(n,{class:"<sm:hidden",onClick:e[1]||(e[1]=p=>w("expandAll"))},{default:r(()=>[x("展开")]),_:1}),m(n,{class:"<sm:hidden",onClick:e[2]||(e[2]=p=>w("collapseAll"))},{default:r(()=>[x("折叠")]),_:1}),J((_(),g(n,{type:"primary",onClick:e[3]||(e[3]=p=>v(100))},{default:r(()=>[x(" 新增 ")]),_:1})),[[I,"system:dept:add"]])]),bodyCell:r(({column:p,record:d})=>[p.key==="action"?(_(),g(a(P),{key:0,stopButtonPropagation:"",actions:[{label:"修改",icon:a(b).EDIT,type:"primary",ghost:!0,auth:"system:dept:edit",onClick:D.bind(null,d)},{label:"新增",icon:a(b).ADD,type:"primary",color:"success",ghost:!0,auth:"system:dept:add",onClick:v.bind(null,d.deptId)},{label:"删除",icon:a(b).DELETE,type:"primary",danger:!0,ghost:!0,auth:"system:dept:remove",ifShow:()=>d.parentId!==0,popConfirm:{title:`是否删除部门[${d.deptName}]`,placement:"left",confirm:R.bind(null,d.deptId)}}]},null,8,["actions"])):Q("",!0)]),_:2},[a(u)?void 0:{name:"headerTop",fn:r(()=>[m(a(X),{class:"h-30px",message:"提示: 双击行可展开/折叠内容",type:"info",banner:"",closable:"",onClose:e[0]||(e[0]=p=>u.value=!0)})]),key:"0"}]),1032,["onRegister"]),m(M,{onRegister:a(A),onReload:a(o)},null,8,["onRegister","onReload"])]),_:1})}}});export{Re as default};
|