|
- var le=Object.defineProperty,oe=Object.defineProperties;var se=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var ne=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;var z=(s,t,l)=>t in s?le(s,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[t]=l,E=(s,t)=>{for(var l in t||(t={}))ne.call(t,l)&&z(s,l,t[l]);if(A)for(var l of A(t))re.call(t,l)&&z(s,l,t[l]);return s},O=(s,t)=>oe(s,se(t));var w=(s,t,l)=>new Promise((n,x)=>{var k=d=>{try{p(l.next(d))}catch(h){x(h)}},N=d=>{try{p(l.throw(d))}catch(h){x(h)}},p=d=>d.done?n(d.value):Promise.resolve(d.value).then(k,N);p((l=l.apply(s,t)).next())});import{l as ie,d as ce,c as ue,a as de}from"./userManage.5b561293.js";import{u as me}from"./useTreeSelectData.6c457bb0.js";import{_ as pe,d as _e,y as U,r as b,x as fe,a as ve,o as we,R as he,u as be,f as u,g as B,c as D,e,w as a,v as g,F as ge,q as ye,n as xe,b as y,p as ke,h as S,O as Ne,J as Ce,L as Ve,i as Be}from"./index.a7edfbd5.js";import Se from"./userDialog.aae98438.js";import"./companyManage.e46026ed.js";import"./projectManage.7dd61071.js";import"./uploadAction.d4782c23.js";const Ee=s=>(Ce("data-v-c573daeb"),s=s(),Ve(),s),De={class:"userManage"},Te=S("\u67E5\u8BE2"),$e=S("\u91CD\u7F6E"),Ie={class:"flex justify-between items-center"},Le=Ee(()=>y("span",null,"\u7528\u6237\u5217\u8868",-1)),Pe=S(" \u6CE8\u518C\u5BA1\u6838 "),Ae=S(" \u65B0\u589E\u7528\u6237 "),ze=["onClick"],Oe=["onClick"],Ue=["onClick"],Re=_e({name:"userManage"}),Me=Object.assign(Re,{setup(s){const{proxy:t}=Be(),l=U.userStore.userBaseInfo,n=b({}),{cascaderProps:x}=me(),{roleList:k}=fe(U.dictStore),N=b([]),p=b(),d=b(0),h=[{label:"\u5E8F\u53F7",type:"index",width:"80"},{label:"\u7528\u6237\u59D3\u540D",key:"realName",prop:"realName",minWidth:"180",showOverflowTooltip:!0},{label:"\u6240\u5C5E\u4F01\u4E1A",key:"companyName",prop:"companyName",minWidth:"180",showOverflowTooltip:!0},{label:"\u6240\u5C5E\u533A\u57DF",key:"regionDisplayName",prop:"regionDisplayName",minWidth:"180",showOverflowTooltip:!0},{label:"\u624B\u673A\u53F7",key:"phoneNo",prop:"phoneNo",width:"180"},{label:"\u7528\u6237\u89D2\u8272",key:"realName",render:i=>{var r,m;return Ne("span",(m=(r=k.value.find(c=>c.key===i.role))==null?void 0:r.name)!=null?m:"-")},width:"120"},{label:"\u72B6\u6001",slot:"accountStatus",key:"accountStatus",width:"100"},{label:"\u521B\u5EFA\u65F6\u95F4",key:"createTime",prop:"createTime",width:"180"},{label:"\u64CD\u4F5C",key:"action",slot:"action",width:"160",fixed:"right"}],T=b([]),_=(...r)=>w(this,[...r],function*(i=p.value.pageParams){var c,f;const m=yield ie(O(E(E({},i),n.value),{role:n.value.role?n.value.role:void 0,regionCode:(f=(c=n.value)==null?void 0:c.regionCode)==null?void 0:f.at(-1)}));d.value=m.data.total,T.value=m.data.records}),R=()=>{_()},M=()=>{n.value={},p.value.pageParams.pageNumber=1,p.value.pageParams.pageSize=10,_()},v=ve({visible:!1,rowData:void 0}),F=()=>{v.visible=!0,v.rowData=void 0},W=i=>{v.visible=!0,v.rowData=i},j=i=>{t.$messageBox.confirm("\u662F\u5426\u5220\u9664\u8BE5\u7528\u6237?","\u63D0\u793A\uFF01",{type:"warning"}).then(()=>w(this,null,function*(){yield ce({id:i.userId}),t.$message.success("\u5220\u9664\u6210\u529F\uFF01"),yield _()}))},q=i=>{v.visible=!1,i&&_()},G=i=>{t.$messageBox.prompt("\u8BF7\u8F93\u5165\u4F60\u9700\u8981\u4FEE\u6539\u7684\u5BC6\u7801","\u4FEE\u6539\u5BC6\u7801",{confirmButtonText:"\u63D0\u4EA4",cancelButtonText:"\u53D6\u6D88",inputPattern:/^[a-zA-Z0-9]{6,10}$/,inputErrorMessage:"\u8BF7\u8F93\u51656-10\u4F4D\u5927\u5C0F\u5199\u5B57\u6BCD\u6216\u6570\u5B57"}).then(m=>w(this,[m],function*({value:r}){yield ue({userId:i.userId,password:r}),t.$message.success("\u4FEE\u6539\u6210\u529F\uFF01"),yield _()}))},J=({userId:i,accountStatus:r})=>new Promise(m=>{const c=r==="ENABLE"?"\u505C\u7528":"\u542F\u7528";t.$messageBox.confirm(`\u786E\u8BA4${c}\u8BE5\u7528\u6237\u5417?`,"\u63D0\u793A\uFF01",{type:"warning"}).then(()=>w(this,null,function*(){yield de({userId:i,accountStatus:r==="ENABLE"?"DISABLE":"ENABLE"}),t.$message.success(`${c}\u6210\u529F\uFF01`),_(),m(!0)}))});we(()=>w(this,null,function*(){N.value=(yield he()).data,yield _()}));const Z=be();function H(){Z.push({name:"registerExamine"})}return(i,r)=>{const m=u("el-input"),c=u("el-form-item"),f=u("el-col"),K=u("el-cascader"),Q=u("el-option"),X=u("el-select"),C=u("el-button"),Y=u("el-row"),ee=u("el-form"),$=u("el-card"),ae=u("el-switch"),te=u("table-list");return B(),D("div",De,[e($,{shadow:"never",class:"search mb-16"},{default:a(()=>[e(ee,{"label-suffix":":",model:n.value,size:"small"},{default:a(()=>[e(Y,{gutter:16},{default:a(()=>[e(f,{span:7},{default:a(()=>[e(c,{label:"\u7528\u6237\u59D3\u540D"},{default:a(()=>[e(m,{modelValue:n.value.realName,"onUpdate:modelValue":r[0]||(r[0]=o=>n.value.realName=o),maxlength:"10",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(f,{span:7},{default:a(()=>[e(c,{label:"\u6240\u5C5E\u4F01\u4E1A"},{default:a(()=>[e(m,{modelValue:n.value.companyName,"onUpdate:modelValue":r[1]||(r[1]=o=>n.value.companyName=o),maxlength:"10",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),e(f,{span:10,class:"mb-16"},{default:a(()=>[e(c,{label:"\u6240\u5C5E\u533A\u57DF"},{default:a(()=>[e(K,{modelValue:n.value.regionCode,"onUpdate:modelValue":r[2]||(r[2]=o=>n.value.regionCode=o),props:g(x),options:N.value,clearable:"",class:"w-full"},null,8,["modelValue","props","options"])]),_:1})]),_:1}),e(f,{span:8},{default:a(()=>[e(c,{label:"\u7528\u6237\u89D2\u8272"},{default:a(()=>[e(X,{modelValue:n.value.role,"onUpdate:modelValue":r[3]||(r[3]=o=>n.value.role=o),clearable:"",placeholder:"\u8BF7\u9009\u62E9",class:"w-full"},{default:a(()=>[(B(!0),D(ge,null,ye(g(k),o=>(B(),xe(Q,{key:o.key,label:o.name,value:o.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(f,{span:16},{default:a(()=>[e(c,{class:"btn"},{default:a(()=>[e(C,{type:"primary",onClick:R},{default:a(()=>[Te]),_:1}),e(C,{type:"info",onClick:M},{default:a(()=>[$e]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e($,{shadow:"never"},{header:a(()=>[y("div",Ie,[Le,y("span",null,[e(C,{type:"primary",size:"small",onClick:H},{default:a(()=>[Pe]),_:1}),e(C,{type:"primary",icon:"Plus",size:"small",onClick:F},{default:a(()=>[Ae]),_:1})])])]),default:a(()=>[e(te,{ref_key:"tableListRef",ref:p,column:h,data:T.value,total:d.value,onGetTableData:_},{accountStatus:a(({scope:o})=>[e(ae,{modelValue:o.row.accountStatus,"onUpdate:modelValue":V=>o.row.accountStatus=V,size:"small","inline-prompt":"","active-value":"ENABLE","inactive-value":"DISABLE","active-text":"\u542F\u7528","inactive-text":"\u505C\u7528",style:{"--el-switch-on-color":"#4ecb74","--el-switch-off-color":"#f5222d"},"before-change":()=>J(o.row)},null,8,["modelValue","onUpdate:modelValue","before-change"])]),action:a(({scope:o})=>{var V,I,L;return[y("a",{class:"text-primary",onClick:P=>W(o.row)},"\u7F16\u8F91",8,ze),((V=g(l))==null?void 0:V.role)==="super_admin"||((I=g(l))==null?void 0:I.role)==="enterprise_admin"||((L=g(l))==null?void 0:L.role)==="regional_general_manager"?(B(),D("a",{key:0,class:"text-primary",onClick:P=>G(o.row)}," \u4FEE\u6539\u5BC6\u7801 ",8,Oe)):ke("",!0),y("a",{class:"text-danger",onClick:P=>j(o.row)},"\u5220\u9664",8,Ue)]}),_:1},8,["data","total"])]),_:1}),e(Se,{visible:v.visible,data:v.rowData,onClose:q},null,8,["visible","data"])])}}}),Ke=pe(Me,[["__scopeId","data-v-c573daeb"]]);export{Ke as default};
|