猎羽广告

index.BO8D4vLu.js 10KB

12
  1. import{E as e,m as a,n as t,v as l,G as i,k as s,t as r,r as o,H as d,o as n,w as u,x as p,y as m}from"../element-plus/element-plus.DqqeXZzT.js";import{o as c,c as v,a as f,d as h,Y as _,r as g,i as y,n as b,J as x,K as w,L as j,T as k,U as M,a9 as L,h as C,ah as I,Q as V,u as N,R as T,S as R,a2 as $,ba as z,b8 as S}from"../@vue/@vue.lccsL1Mu.js";import{p as D,T as F}from"../tableInfo/tableInfo.DCb2GEsc.js";import{A as B}from"../api/api.BtQEnbVN.js";import{_ as H}from"../_popconfirm/_popconfirm.C2WlUwAw.js";import{D as W}from"../_dialog/_dialog.ium6sOk7.js";import{I as A}from"../_input/_input.DPT4C86A.js";import{S as O}from"../_select/_select.DVQW4rAo.js";import{g as U,_ as E}from"../../assets/index-DYMYfyXS.js";import"../lodash-es/lodash-es.LxYfApIs.js";import"../async-validator/async-validator.DSgsWN2H.js";import"../@vueuse/@vueuse.D2YafqsA.js";import"../dayjs/dayjs.D4rZQhfm.js";import"../axios/axios.CUN3se9v.js";import"../@ctrl/@ctrl.D2oWfImC.js";import"../@popperjs/@popperjs.D3lHDW-0.js";import"../escape-html/escape-html.J6B7JOz4.js";import"../normalize-wheel-es/normalize-wheel-es.Erkn7R64.js";import"../caret-top/caret-top.BxG-YGIs.js";import"../question-filled/question-filled.CpBGPdbF.js";import"../vue-router/vue-router.D86bYXwF.js";import"../pinia/pinia.DodrAXQg.js";import"../vue-demi/vue-demi.Dq6ymT-8.js";import"../pinia-plugin-persist/pinia-plugin-persist.Cjrd7Wf_.js";import"../@element-plus/@element-plus.BWbqilIf.js";import"../echarts/echarts.C_nC9ACL.js";import"../tslib/tslib.DduEQve-.js";import"../zrender/zrender.XYf_pgl8.js";const J={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em"},q=[f("path",{fill:"currentColor",d:"M176 416a112 112 0 1 1 0 224a112 112 0 0 1 0-224zm336 0a112 112 0 1 1 0 224a112 112 0 0 1 0-224zm336 0a112 112 0 1 1 0 224a112 112 0 0 1 0-224z"},null,-1)];const K={name:"ep-more-filled",render:function(e,a){return c(),v("svg",J,q)}},Y={class:"dialogBox"},G={class:"flex tMar20"},P=f("span",{class:"spanTitle f14",style:{width:"80px"}},"上级部门",-1),Q=h({__name:"addDepartment",emits:["init"],setup(i,{expose:s,emit:r}){const{proxy:o}=C();o.$NumberHandle;const d=_({treeList:[],editId:"",title:"添加部门"}),n=g(""),u=g(),p=g(!1),m=async()=>{if(""==u.value.value)return void e.error("名称为必填项");p.value=!0;let a=B.depart_add;const t=_({pid:n.value,name:u.value.value});d.editId&&(t.id=d.editId,a=B.depart_edit);let l=await o.$http.post(a,t);p.value=!1,l&&"0"==l.errNo?(l.rst,h.value=!1,r("init")):e.error(l.errMsg)},h=g(!1);return s({switchShow:(a,t)=>{h.value=a,a&&b((async()=>{u.value.value="",n.value="",d.editId="",await(async()=>{let a=await o.$http.get(B.depart_list);a&&"0"==a.errNo?d.treeList=a.rst.map((e=>({id:e.id,name:e.name}))):e.error(a.errMsg)})(),t?.id&&(d.editId=t?.id,u.value.value=t.name,n.value=t.pid,d.title="编辑部门")}))}}),y((()=>{b((()=>{}))})),(e,i)=>{const s=a,r=t,o=l;return c(),x(W,{ref:"DialogRef_editType",dialogVisible:h.value,onConfirm:m,onClose:i[1]||(i[1]=e=>h.value=!1),width:"500px","dialog-title":d.title},{content:w((()=>[j((c(),v("div",Y,[k(A,{ref_key:"nameRef",ref:u,spanTitleWidth:"80px",title:"部门",haveTag:!0,haverMar15:!1},null,512),f("div",G,[P,k(r,{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=e=>n.value=e),clearable:"",placeholder:"请选择",style:{flex:"1"}},{default:w((()=>[(c(!0),v(M,null,L(d.treeList,(e=>(c(),x(s,{key:e.id,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])])),[[o,p.value]])])),_:1},8,["dialogVisible","dialog-title"])}}}),X={class:"dialogBox"},Z={class:"flex tMar20"},ee=f("span",{class:"spanTitle f14",style:{width:"80px"}},"部门",-1),ae=h({__name:"addMember",emits:["init"],setup(a,{expose:t,emit:s}){const{proxy:r}=C();r.$NumberHandle;const o=g(),d={children:"childs",label:"name"},n=_({teamList:[],limitList:[],departList:[],editId:-1,treeValue:""}),u=_({value:0,name:"是否为投手",EgName:"is_promoter",haveNotes:!1,list:[{name:"否",value:0},{name:"是",value:1}]}),p=g(),m=g();g();const h=g(),M=g(),L=g(),I=g(!1),V=async()=>{if(""==p.value.value)return void e.error("名称为必填项");I.value=!0;const a=_({username:p.value.value,password:m.value.value,department_id:n.treeValue+"",role_id:h.value.value,is_promoter:M.value.value,team_id:L.value?.value});let t=B.user_add;n.editId>0&&(t=B.user_edit,a.id=n.editId);let l=await r.$http.post(t,a);I.value=!1,l&&"0"==l.errNo?(l.rst,N.value=!1,s("init")):e.error(l.errMsg)},N=g(!1);return t({switchShow:(a,t)=>{if(N.value=a,a){try{o.value=JSON.parse(U("userInfo"))}catch(l){}b((()=>{(async()=>{try{n.teamList=JSON.parse(U("teamList"))}catch(l){}})(),(async()=>{let a=await r.$http.get(B.limit_list);a&&"0"==a.errNo?n.limitList=a.rst:e.error(a.errMsg)})(),(async()=>{let a=await r.$http.get(B.depart_list);if(a&&"0"==a.errNo){let e=a.rst;n.departList=e}else e.error(a.errMsg)})(),t.id?(n.editId=t.id,p.value.value=t.username,m.value.value="",n.treeValue=t.department_id,h.value.value=t.role_id,M.value.value=t.is_promoter,L.value&&(L.value.value=t.team_id)):(n.editId=-1,p.value.value="",m.value.value="",n.treeValue="",h.value.value="",M.value.value=0,L.value&&(L.value.value=o.value?.team_id))}))}}}),y((()=>{b((()=>{}))})),(e,a)=>{const t=i,s=l;return c(),x(W,{ref:"DialogRef_editType",dialogVisible:N.value,onConfirm:V,onClose:a[1]||(a[1]=e=>N.value=!1),width:"500px","dialog-title":"添加人员"},{content:w((()=>[j((c(),v("div",X,[k(A,{ref_key:"nameRef",ref:p,spanTitleWidth:"80px",title:"用户名",haveTag:!0},null,512),k(A,{ref_key:"psdRef",ref:m,spanTitleWidth:"80px",class:"tMar20",title:"密码",haveTag:!0},null,512),k(O,{ref_key:"teamRef",ref:L,spanTitleWidth:"80px",class:"tMar20",clearFlag:!0,disableFlag:!(o.value.userAuth<=10),title:"团队",optObj:{k:"id",la:"name",val:"id"},options:n.teamList},null,8,["disableFlag","options"]),f("div",Z,[ee,k(t,{modelValue:n.treeValue,"onUpdate:modelValue":a[0]||(a[0]=e=>n.treeValue=e),filterable:"","check-strictly":!0,"highlight-current":!0,props:d,"node-key":"id",data:n.departList,"render-after-expand":!1},null,8,["modelValue","data"])]),k(O,{ref_key:"ideaManRef",ref:h,spanTitleWidth:"80px",class:"tMar20",clearFlag:!0,title:"权限",optObj:{k:"id",la:"name",val:"id"},options:n.limitList},null,8,["options"]),k(O,{ref_key:"isPromoterRef",ref:M,spanTitleWidth:"80px",class:"tMar20",clearFlag:!0,title:"是否为投手",optObj:{k:"value",la:"name",val:"value"},options:u.list},null,8,["options"])])),[[s,I.value]])])),_:1},8,["dialogVisible"])}}}),te=e=>(z("data-v-6350f6d8"),e=e(),S(),e),le={class:"albumBox flex"},ie={class:"albumTree"},se={class:"title flex"},re=T("添加部门"),oe=te((()=>f("div",{class:"companyBox"},"北京酷炫网络技术股份有限公司",-1))),de={class:"treeBox"},ne={style:{color:"#161E46"}},ue=T("编辑"),pe=T("删除"),me={class:"albumContent"},ce={class:"title flex"},ve=T("新增成员"),fe={key:0,class:"lMar10 c-666 f12"},he=T("已选部门: "),_e={class:"contentBox tMar10"},ge={class:"text-center"},ye=["onClick"],be=te((()=>f("span",{class:"pointer lMar10 c-red"},"删除",-1))),xe=E(h({__name:"index",setup(a){const{proxy:t}=C();t.$NumberHandle;const i={children:"childs",label:"name"},h=g(),L=_({hightLightFlag:!0,treeList:[],treeId:0,accStatusList:[]}),z=g(""),S=_({id:"",name:""});g(1),g(20);const W=g(!1),A=g(!1),O=_([{name:"用户名",column:"username"},{name:"部门",column:"department"},{name:"权限",column:"role"},{name:"操作",column:"operate",slotFlag:!0}]),{tableInfo:E,tableListRef:J,total:q}=D(O),Y=g(),G=g(),P=()=>{b((()=>{Y.value.switchShow(!0)}))},X=(e,a)=>{"edit"==e?b((()=>{Y.value.switchShow(!0,a?.data?.id?a?.data:a?.data?.childs[0])})):"dele"==e&&Z(a?.data?.id||a?.data?.childs[0]?.id)},Z=async a=>{A.value=!0;const l=_({id:a});let i=await t.$http.post(B.depart_dele,l);i&&"0"==i.errNo?(i.rst,xe()):(A.value=!1,e.error(i.errMsg))},ee=e=>{b((()=>{G.value.switchShow(!0,e)}))},te=e=>{e?.id?(S.id=e?.id,S.name=e?.name):(S.id="",S.name=""),we()},xe=async()=>{A.value=!0;let a=await t.$http.get(B.depart_list);if(A.value=!1,a&&"0"==a.errNo){let e=a.rst;L.treeList=e}else e.error(a.errMsg)},we=async()=>{W.value=!0;const a=_({keyword:z.value,department_id:S.id});let l=await t.$http.get(B.user_list,a);if(W.value=!1,l&&"0"==l.errNo){let e=l.rst;E.tableList=e}else e.error(l.errMsg)};return y((()=>{b((async()=>{await xe(),await we()}))})),(a,_)=>{const g=s,y=K,b=n,C=u,D=p,O=m,Z=r,je=o,ke=d,Me=l;return c(),v(M,null,[f("div",le,[f("div",ie,[f("div",se,[k(g,{type:"primary",plain:"",onClick:P},{default:w((()=>[re])),_:1})]),oe,j((c(),v("div",de,[k(Z,{ref_key:"treeRef",ref:h,onNodeClick:te,data:L.treeList,props:i,"node-key":"id","expand-on-click-node":!1,"highlight-current":!0},{default:w((({node:e})=>[f("span",ne,R(e.label),1),f("div",{class:"lMarauto f14 rMar10",onClick:_[0]||(_[0]=$((()=>{}),["stop"]))},[k(O,{size:"default"},{dropdown:w((()=>[k(D,null,{default:w((()=>[k(C,{onClick:a=>X("edit",e)},{default:w((()=>[ue])),_:2},1032,["onClick"]),k(C,{onClick:a=>X("dele",e)},{default:w((()=>[pe])),_:2},1032,["onClick"])])),_:2},1024)])),default:w((()=>[k(b,{color:"#96969D"},{default:w((()=>[k(y)])),_:1})])),_:2},1024)])])),_:1},8,["data"])])),[[Me,A.value]])]),f("div",me,[f("div",ce,[k(g,{type:"primary",size:"default",onClick:ee},{default:w((()=>[ve])),_:1}),k(je,{class:"lMar10",modelValue:z.value,"onUpdate:modelValue":_[1]||(_[1]=e=>z.value=e),placeholder:"成员名称",clearable:"",onClear:_[2]||(_[2]=e=>we()),onKeyup:_[3]||(_[3]=I((e=>we()),["enter"])),style:{width:"200px"}},null,8,["modelValue"]),S.name?(c(),v("div",fe,[he,k(ke,{closable:"",onClose:_[4]||(_[4]=e=>te({}))},{default:w((()=>[T(R(S.name),1)])),_:1})])):V("",!0)]),j((c(),v("div",_e,[k(F,{ref_key:"tableListRef",ref:J,tableData:N(E).tableList,descol:N(E).descolList,total:N(q),immobilizationHeight:"calc(100vh - 160px)",tableHeight:"calc(100vh - 160px)",onInit:xe},{operate:w((a=>[f("div",ge,[f("span",{class:"operate_text lMar8",onClick:e=>ee(a.row)},"编辑",8,ye),1!=a.row.id&&N(U)("admin_id")!=a.row.id?(c(),x(H,{key:"dele",onConfirm:l=>(async a=>{W.value=!0;let l=await t.$http.post(B.user_dele,{id:a.id});W.value=!1,l&&"0"==l.errNo?we():e.error(l.errMsg)})(a.row),slotFlag:!0},{con:w((()=>[be])),_:2},1032,["onConfirm"])):V("",!0)])])),_:1},8,["tableData","descol","total"])])),[[Me,W.value]])])]),k(Q,{ref_key:"AddDepartmentRef",ref:Y,onInit:xe},null,512),k(ae,{ref_key:"AddMemberRef",ref:G,onInit:we},null,512)],64)}}}),[["__scopeId","data-v-6350f6d8"]]);export{xe as default};