PageSourceSearch

https://nxdai.com/static/js/index-CnjF2fnJ.js

js nxdai.com collected 2026-10-04 19:31:40 UTC 10,882 bytes, 1 lines download raw bytes

1import{a as j,e as X,k as ee,r as te,C as ne,l as L,_ as oe,c as Z,d as se,h as le,j as re}from"./index-C9iKJyqx.js";import"./store-CmFYZ7L8.js";import{M as D,aD as ae,aZ as p,a_ as K,aL as x,u as S,v as N,I as o,bJ as i,bk as f,t as P,bL as E,bB as pe,H as F,s as A,au as ie,bb as ce,bO as de,aU as G,as as ue}from"./@vue-BOuXpNqo.js";import{S as me,X as _e,E as fe}from"./@element-plus-DAJcwijz.js";import{u as Q}from"./group-CtJN2ZKX.js";import{c as O,a as k}from"./element-plus-DmifRJaV.js";import{x as be}from"./lodash-es-i1-ZyejV.js";import"./@vueuse-DNb9jgHV.js";import"./mitt-AIrHR271.js";import"./axios-DcNlVx-A.js";import"./nprogress-CpwY2hia.js";import"./dayjs-C8nBsngT.js";import"./pinia-DLd35YQW.js";import"./vue-router-DIOMwNM_.js";import"./mockjs-DpHUAGyo.js";import"./mathjs-BOzbo779.js";import"./@babel-DSKb7weK.js";import"./typed-function-Cff5vBAL.js";import"./decimal.js-CNRKZ6of.js";import"./fraction.js-D08t1C-v.js";import"./complex.js-C-TeqLDU.js";import"./javascript-natural-sort-6aLW2M_G.js";import"./seedrandom-rVQfVy3w.js";import"./escape-latex-BSER-sy7.js";import"./vue-echarts-5QjlRQbH.js";import"./echarts-B9slECZc.js";import"./tslib-BDyQ-Jie.js";import"./zrender-DjvCPfRh.js";import"./@popperjs-D_chPuIy.js";import"./@ctrl-r5W6hzzQ.js";import"./async-validator-9PlIezaS.js";import"./memoize-one-BdPwpGay.js";import"./normalize-wheel-es-BQoi3Ox2.js";import"./@floating-ui-B-WCBpf0.js";const ve={class:"dept-tree"},he={class:"dept-tree__header"},ye={class:"dept-tree__op"},ge={class:"no"},we={class:"dept-tree__node"},ke=["onClick"],xe=D({name:"dept-list"}),Ce=D({...xe,props:{drag:{type:Boolean,default:!0},level:{type:Number,default:99}},emits:["refresh","user-add"],setup(U,{emit:b}){const T=U,$=b,{service:v,browser:g}=j(),w=X(),{ViewGroup:d}=Q(),u=G([]),C=G(!1),h=G(!1);function y({data:n}){return n.parentId}function z(n,e){return e.data.parentId}async function s(){C.value=!0,h.value=!1,await v.base.sys.department.list().then(n=>{var e;u.value=ee(n),(e=d.value)!=null&&e.selected||t()}),C.value=!1}function t(n){var e;if(n||(n=u.value[0]),n){const r=n.children?te(n.children).map(l=>l.id):[];r.unshift(n.id),(e=d.value)==null||e.select(n),ue(()=>{$("refresh",{page:1,departmentIds:r})})}}function c(n){var r;const e=n.id?"update":"add";(r=w.value)==null||r.open({title:"编辑部门",width:"550px",props:{labelWidth:"100px"},items:[{label:"部门名称",prop:"name",component:{name:"el-input"},required:!0},{label:"上级部门",prop:"parentName",component:{name:"el-input",props:{disabled:!0}}},{label:"排序",prop:"orderNum",component:{name:"el-input-number",props:{"controls-position":"right",min:0,max:100}}}],form:{...n},on:{submit(l,{done:a,close:m}){v.base.sys.department[e]({id:n.id,parentId:n.parentId,name:l.name,orderNum:l.orderNum}).then(()=>{k.success(`新增部门 “${l.name}” 成功`),m(),s()}).catch(W=>{k.error(W.message),a()})}}})}function I(n){async function e(r){await v.base.sys.department.delete({ids:[n.id],deleteUser:r}).then(()=>{var l,a;((a=(l=d.value)==null?void 0:l.selected)==null?void 0:a.id)==n.id&&t(),r?k.success("删除成功"):O.confirm(`“${n.name}” 部门的用户已成功转移到 “${n.parentName}” 部门。`,"删除成功")}),s()}O.confirm(`此操作将会删除 “${n.name}” 部门的所有用户,是否确认?`,"提示",{type:"warning",confirmButtonText:"直接删除",cancelButtonText:"保留用户",distinguishCancelAndClose:!0}).then(()=>{e(!0)}).catch(r=>{r=="cancel"&&e(!1)})}
1function q(n){n?O.confirm("部门架构已发生改变,是否保存?","提示",{type:"warning"}).then(async()=>{const e=[];function r(l,a){l.forEach(m=>{m.parentId=a,e.push(m),m.children&&be(m.children)&&r(m.children,m.id)})}r(u.value,null),await v.base.sys.department.order(e.map((l,a)=>({id:l.id,parentId:l.parentId,orderNum:a}))).then(()=>{k.success("更新排序成功")}).catch(l=>{k.error(l.message)}),s(),h.value=!1}).catch(()=>null):s()}function M(n,e,r){e||(e=u.value[0]||{});const l=v.base.sys.department.permission;ne.open(n,{list:[{label:"新增",hidden:r&&r.level>=T.level||!L(l.add),callback(a){c({name:"",parentName:e.name,parentId:e.id}),a()}},{label:"编辑",hidden:!L(l.update),callback(a){c(e),a()}},{label:"删除",hidden:!e.parentId||!L(l.delete),callback(a){I(e),a()}},{label:"新增成员",hidden:!L(l.add),callback(a){$("user-add",e),a()}}]})}return ae(function(){s()}),(n,e)=>{const r=p("el-icon"),l=p("el-tooltip"),a=p("el-button"),m=p("el-tree"),W=p("el-scrollbar"),R=p("cl-form"),B=K("loading");return x(),S("div",ve,[N("div",he,[e[6]||(e[6]=N("div",null,"组织架构",-1)),N("ul",ye,[N("li",{onClick:e[0]||(e[0]=_=>s())},[o(l,{content:"刷新"},{default:i(()=>[o(r,null,{default:i(()=>[o(f(me))]),_:1})]),_:1})]),U.drag&&!f(g).isMini?(x(),S("li",{key:0,onClick:e[1]||(e[1]=_=>h.value=!0)},[o(l,{content:"拖动排序"},{default:i(()=>[o(r,null,{default:i(()=>[o(f(_e))]),_:1})]),_:1})])):P("",!0),E(N("li",ge,[o(a,{size:"small",onClick:e[2]||(e[2]=_=>q(!0))},{default:i(()=>[...e[4]||(e[4]=[F("保存",-1)])]),_:1}),o(a,{size:"small",onClick:e[3]||(e[3]=_=>q(!1))},{default:i(()=>[...e[5]||(e[5]=[F("取消",-1)])]),_:1})],512),[[pe,h.value]])])]),N("div",{class:"dept-tree__container",onContextmenu:de(M,["stop","prevent"])},[o(W,null,{default:i(()=>[E((x(),A(m,{"node-key":"id","default-expand-all":"",data:u.value,props:{label:"name"},"highlight-current":"",draggable:h.value,"allow-drag":y,"allow-drop":z,"expand-on-click-node":!1,onNodeContextmenu:M,onNodeClick:t},{default:i(({node:_,data:V})=>{var H,J;return[N("div",we,[N("span",{class:ie(["dept-tree__node-label",{"is-active":V.id==((J=(H=f(d))==null?void 0:H.selected)==null?void 0:J.id)}])},ce(_.label),3),f(g).isMini?(x(),S("span",{key:0,class:"dept-tree__node-icon",onClick:Y=>M(Y,V,_)},[o(r,null,{default:i(()=>[o(f(fe))]),_:1})],8,ke)):P("",!0)])]}),_:1},8,["data","draggable"])),[[B,C.value]])]),_:1})],32),o(R,{ref_key:"Form",ref:w},null,512)])}}}),Ie=oe(Ce,[["__scopeId","data-v-89cdde12"]]),Ne={class:"dept-move"},$e=D({name:"user-move"}),Me=D({...$e,setup(U,{expose:b}){const{service:T}=j(),$=X(),v=Z();async function g(w){var d;(d=$.value)==null||d.open({title:"部门转移",width:"500px",props:{labelWidth:"80px"},items:[{label:"选择部门",prop:"departmentId",component:{name:"cl-dept-select"}}],on:{submit(u,{done:C,close:h}){if(!u.departmentId)return k.warning("请选择部门"),C();O.confirm("转移到新部门,是否继续?","提示",{type:"warning"}).then(()=>{T.base.sys.user.move({...u,userIds:w}).then(()=>{var y;k.success("转移成功"),(y=v.value)==null||y.refresh(),h()}).catch(y=>{k.error(y.message),C()})}).catch(()=>null)}}})}return b({open:g}),(w,d)=>{const u=p("cl-form");return x(),S("div",Ne,[o(u,{ref_key:"Form",ref:$},null,512)])}}}),De=D({name:"sys-user"}),ct=D({...De,setup(U){const{service:b,refs:T,setRefs:$}=j(),{ViewGroup:v}=Q({title:"用户列表"}),g=Z({service:b.base.sys.user}),w=se({contextMenu:[],columns:[{type:"selection",width:60},{prop:"headImg",label:"头像",component:{name:"cl-avatar"}},{prop:"username",label:"用户名",minWidth:150},{prop:"name",label:"姓名",minWidth:150},{prop:"departmentName",label:"部门名称",minWidth:150},{prop:"roleName",label:"角色",headerAlign:"center",minWidth:150,dict:[],formatter(s){var t;return(t=s.roleName)==null?void 0:t.split(",")}},{prop:"status",label:"状态",minWidth:120,component:{name:"cl-switch"}},{prop:"phone",label:"手机号码",minWidth:150},{prop:"remark",label:"备注",minWidth:150},{prop:"createTime",label:"创建时间",sortable:"desc",minWidth:160},{type:"op",buttons:["slot-btn","edit","delete"],width:240}]}),d=le({dialog:{width:"800px"},items:[{prop:"headImg",label:"头像",component:{name:"cl-upload",props:{text:"选择头像"}}},{prop:"name",label:"姓名",span:12,required:!0,component:{name:"el-input"}},{prop:"username",label:"用户名",required:!0,span:12,component:{name:"el-input",props:{autocomplete:"new-password"}}},()=>{var s;return{prop:"password",label:"密码",span:12,required:((s=d.value)==null?void 0:s.mode)=="add",component:{name:"el-input",props:{type:"password",autocomplete:"new-password"}},rules:[{min:6,max:16,message:"密码长度在 6 到 16 个字符"}]}},{prop:"roleIdList",label:"角色",value:[],required:!0,component:{name:"el-select",options:[],props:{multiple:!0}}},{prop:"khh",label:"银行开户行",span:12,component:{name:"el-input"}},{prop:"bankAccount",label:"银行账户",span:12,component:{name:"el-input"}},{prop:"phone",label:"手机号码",span:12,component:{name:"el-input"}},{prop:"email",label:"邮箱",span:12,component:{name:"el-input"}},{prop:"remark",label:"备注",component:{name:"el-input",props:{type:"textarea",rows:4}}},{prop:"status",label:"状态",value:1,component:{name:"el-radio-group",options:[{label:"开启",value:1},{label:"关闭",value:0}]}}],onSubmit(s,{next:t}){var c,I;t({departmentId:(I=(c=v.value)==null?void 0:c.selected)==null?void 0:I.id,...s})},async onOpen(){b.base.sys.role.list().then(s=>{var t;(t=d.value)==null||t.setOptions("roleIdList",s.map(c=>({label:c.name||"",value:c.id})))})},plugins:[re("name")]});function u(s){var t;(t=g.value)==null||t.refresh(s)}function C({id:s}){var t;(t=g.value)==null||t.rowAppend({departmentId:s})}async function h(s){var c;let t=[];s?t=[s.id]:t=((c=w.value)==null?void 0:c.selection.map(I=>I.id))||[],T.userMove.open(t)}const y=G(!1);async function z(){var s;y.value=!0,b.base.sys.user.sync(),y.value=!1,k.success("开始同步钉钉通讯录,预计需要一分钟,请稍后"),(s=g.value)==null||s.refresh()}return(s,t)=>{const c=p("cl-refresh-btn"),I=p("cl-add-btn"),q=p("cl-multi-delete-btn"),M=p("el-button"),n=p("cl-flex1"),e=p("cl-search-key"),r=p("cl-row"),l=p("cl-table"),a=p("cl-pagination"),m=p("cl-upsert"),W=p("cl-crud"),R=p("cl-view-group"),B=K("permission");return x(),A(R,{ref_key:"ViewGroup",ref:v},{left:i(()=>[o(Ie,{onRefresh:u,onUserAdd:C})]),right:i(()=>[o(W,{ref_key:"Crud",ref:g},{default:i(()=>[o(r,null,{default:i(()=>{var _;return[o(c),o(I),o(q),E((x(),A(M,{type:"success",disabled:((_=f(w))==null?void 0:_.selection.length)==0,onClick:t[0]||(t[0]=V=>h())},{default:i(()=>[...t[2]||(t[2]=[F("转移",-1)])]),_:1},8,["disabled"])),[[B,f(b).base.sys.user.permission.move]]),E((x(),A(M,{onClick:t[1]||(t[1]=V=>z()),loading:y.value},{default:i(()=>[...t[3]||(t[3]=[F("同步",-1)])]),_:1},8,["loading"])),[[B,f(b).base.sys.user.sync]]),o(n),o(e,{placeholder:"搜索用户名、姓名"})]}),_:1}),o(r,null,{default:i(()=>[o(l,{ref_key:"Table",ref:w},{"slot-btn":i(({scope:_})=>[E((x(),A(M,{text:"",bg:"",onClick:V=>h(_.row)},{default:i(()=>[...t[4]||(t[4]=[F(" 转移 ",-1)])]),_:1},8,["onClick"])),[[B,f(b).base.sys.user.permission.move]])]),_:1},512)]),_:1}),o(r,null,{default:i(()=>[o(n),o(a)]),_:1}),o(m,{ref_key:"Upsert",ref:d},null,512),o(Me,{ref:f($)("userMove")},null,512)]),_:1},512)]),_:1},512)}}});
1export{ct as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.