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
4.8 KiB
JavaScript

var f=(b,d,t)=>new Promise((h,y)=>{var g=r=>{try{c(t.next(r))}catch(u){y(u)}},m=r=>{try{c(t.throw(r))}catch(u){y(u)}},c=r=>r.done?h(r.value):Promise.resolve(r.value).then(g,m);c((t=t.apply(b,d)).next())});import{P as Y}from"./index-DUrcXr1R.js";import{_ as N}from"./index-CKN9oMgI.js";import{c as B,d as V,e as k}from"./index-APXg5Z6_.js";import{d as L}from"./index-B12iIcai.js";import{u as K,_ as A}from"./useTable-Bbyr2JHM.js";import{_ as F}from"./index-BYFe0x3M.js";import{bh as U,aP as G,I as C,_ as W}from"./entry/index-CruxN-Hs-1723019140439.js";import{b as z}from"./download-BageIVpd.js";import{f as j,c as q}from"./post.data-dwEtZg5i.js";import{_ as H}from"./PostDrawer.vue_vue_type_script_setup_true_lang-Dbe2DIGe.js";import{u as J}from"./index-Bv3AVfz1.js";import{ao as O,ap as E,y as Q,au as T,a5 as X}from"./antd-BY-1PcYE.js";import{d as Z,f as S,r as ee,o as te,aa as ae,n as oe,_ as l,a8 as _,a9 as a,k as i,u as e,ad as se,$ as P,ak as re,al as ie,m as w,G as D,ac as ne}from"./vue-aEZWZQSa.js";import"./useContentViewHeight-DllDxCXH.js";import"./useWindowSizeFn--jCT5E3A.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./useForm-CdUGloRq.js";import"./FormItem.vue_vue_type_script_lang-B_ueKfdL.js";import"./componentMap-uxp1OCze.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-D6-xDLMZ.js";import"./copyTextToClipboard-BBFF3Y3I.js";import"./index-B6biQger.js";import"./style-Bwlk8Loa.js";import"./helper-CuUont7-.js";import"./BasicForm.vue_vue_type_style_index_0_lang-C-Cj0P69.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-CSRkxIlp.js";import"./useLoading-C0EEZ3ab.js";import"./dictEnum-DeC8h6ZR.js";import"./dict-B_9qLt7l.js";import"./useRender-CuBarcLn.js";import"./index-VnRLIvr7.js";import"./useSize-Cq2xbXH4.js";const le={key:1,class:"mt-5"},me=Z({name:"User",__name:"index",setup(b){const d=S(""),t=ee({tree:[],selectDeptId:[]}),h=S(!0);function y(){return f(this,null,function*(){yield m()})}te(()=>f(this,null,function*(){const o=yield L();U(o,s=>{s.icon="el:group"}),t.tree=o,h.value=!1}));const[g,{reload:m,selected:c,multipleRemove:r}]=K({rowSelection:{type:"checkbox"},title:"岗位列表",showIndexColumn:!1,api:B,rowKey:"postId",useSearchForm:!0,formConfig:{schemas:j,name:"post",baseColProps:{xs:24,sm:24,md:24,lg:6},labelWidth:100,resetFunc:()=>f(this,null,function*(){t.selectDeptId=[],d.value="",yield m()}),fieldMapToTime:[["createTime",["params[beginTime]","params[endTime]"],["YYYY-MM-DD 00:00:00","YYYY-MM-DD 23:59:59"]]]},columns:q,beforeFetch(o){return t.selectDeptId.length===1&&(o.belongDeptId=t.selectDeptId[0]),o},actionColumn:{width:220,title:"操作",key:"action",fixed:"right"}}),[u,{openDrawer:x}]=J();function R(o){x(!0,{update:!0,record:o})}function $(){x(!0,{update:!1})}function M(o){return f(this,null,function*(){yield k([o.postId]),yield m()})}return(o,s)=>{const I=ae("a-button"),v=oe("auth");return l(),_(e(Y),{dense:""},{default:a(()=>[i(e(O),null,{default:a(()=>[i(e(E),se({xs:24,sm:24,md:24,lg:4},{class:"h-[calc(100vh-80px)]"}),{default:a(()=>[i(e(Q),{active:!0,paragraph:{rows:8},loading:h.value},{default:a(()=>[t.tree.length?(l(),_(e(N),{key:0,fieldNames:{title:"label",key:"id"},"tree-data":t.tree,showLine:{showLeafIcon:!1},search:!0,searchValue:d.value,"onUpdate:searchValue":s[0]||(s[0]=n=>d.value=n),defaultExpandAll:"",onSelect:y,selectedKeys:t.selectDeptId,"onUpdate:selectedKeys":s[1]||(s[1]=n=>t.selectDeptId=n)},null,8,["tree-data","searchValue","selectedKeys"])):(l(),P("div",le,[i(e(T),{image:e(T).PRESENTED_IMAGE_SIMPLE,description:"无部门数据"},null,8,["image"])]))]),_:1},8,["loading"])]),_:1},16),i(e(E),re(ie({xs:24,sm:24,md:24,lg:20})),{default:a(()=>[i(e(A),{onRegister:e(g)},{toolbar:a(()=>[i(e(X),{class:"<sm:hidden"},{default:a(()=>[w((l(),P("div",null,[i(e(G),{placement:"left",title:"确认导出表格吗?",onConfirm:s[2]||(s[2]=n=>e(z)(e(V),"岗位数据"))},{default:a(()=>[D("导出")]),_:1})])),[[v,"system:post:export"]]),w((l(),_(I,{class:"<sm:hidden",type:"primary",danger:"",onClick:s[3]||(s[3]=n=>e(r)(e(k))),disabled:!e(c)},{default:a(()=>[D("删除")]),_:1},8,["disabled"])),[[v,"system:post:remove"]]),w((l(),_(I,{type:"primary",onClick:$},{default:a(()=>[D("新增")]),_:1})),[[v,"system:post:add"]])]),_:1})]),bodyCell:a(({column:n,record:p})=>[n.key==="action"?(l(),_(e(F),{key:0,stopButtonPropagation:"",dropDownBtnDisplay:"",actions:[{label:"修改",icon:e(C).EDIT,type:"primary",ghost:!0,auth:"system:user:edit",ifShow:p.userId!==1,onClick:R.bind(null,p)},{label:"删除",icon:e(C).DELETE,type:"primary",danger:!0,ghost:!0,auth:"system:user:remove",ifShow:p.userId!==1,popConfirm:{placement:"left",title:`是否删除用户[${p.userName}]-${p.nickName}?`,confirm:M.bind(null,p)}}]},null,8,["actions"])):ne("",!0)]),_:1},8,["onRegister"])]),_:1},16)]),_:1}),i(H,{onRegister:e(u),onReload:e(m)},null,8,["onRegister","onReload"])]),_:1})}}}),We=W(me,[["__scopeId","data-v-9af6a592"]]);export{We as default};