Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

2 linhas
7.1KB

  1. var ae=Object.defineProperty,te=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var O=(s,a,l)=>a in s?ae(s,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[a]=l,S=(s,a)=>{for(var l in a||(a={}))oe.call(a,l)&&O(s,l,a[l]);if(A)for(var l of A(a))se.call(a,l)&&O(s,l,a[l]);return s},U=(s,a)=>te(s,le(a));var w=(s,a,l)=>new Promise((n,y)=>{var k=d=>{try{p(l.next(d))}catch(b){y(b)}},x=d=>{try{p(l.throw(d))}catch(b){y(b)}},p=d=>d.done?n(d.value):Promise.resolve(d.value).then(k,x);p((l=l.apply(s,a)).next())});import{l as ne,d as re,c as ie,a as ce}from"./userManage.384d8c0f.js";import{u as ue}from"./useTreeSelectData.58a8ac6c.js";import{_ as de,d as me,y as z,r as h,x as pe,a as _e,o as fe,R as ve,f as u,g as V,c as D,e,w as t,v as g,F as we,q as be,n as he,b as C,p as ge,h as T,O as ye,J as ke,L as xe,i as Ne}from"./index.32194486.js";import Ve from"./userDialog.47beb35a.js";import"./companyManage.74199cee.js";import"./projectManage.b222baef.js";import"./uploadAction.25c9789a.js";const Ce=s=>(ke("data-v-00e66cb5"),s=s(),xe(),s),Be={class:"userManage"},Se=T("\u67E5\u8BE2"),De=T("\u91CD\u7F6E"),Te={class:"flex justify-between items-center"},$e=Ce(()=>C("span",null,"\u7528\u6237\u5217\u8868",-1)),Ee=T(" \u65B0\u589E\u7528\u6237 "),Ie=["onClick"],Le=["onClick"],Pe=["onClick"],Ae=me({name:"userManage"}),Oe=Object.assign(Ae,{setup(s){const{proxy:a}=Ne(),l=z.userStore.userBaseInfo,n=h({}),{cascaderProps:y}=ue(),{roleList:k}=pe(z.dictStore),x=h([]),p=h(),d=h(0),b=[{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 ye("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"}],$=h([]),_=(...r)=>w(this,[...r],function*(i=p.value.pageParams){var c,f;const m=yield ne(U(S(S({},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,$.value=m.data.records}),M=()=>{_()},R=()=>{n.value={},p.value.pageParams.pageNumber=1,p.value.pageParams.pageSize=10,_()},v=_e({visible:!1,rowData:void 0}),F=()=>{v.visible=!0,v.rowData=void 0},W=i=>{v.visible=!0,v.rowData=i},j=i=>{a.$messageBox.confirm("\u662F\u5426\u5220\u9664\u8BE5\u7528\u6237?","\u63D0\u793A\uFF01",{type:"warning"}).then(()=>w(this,null,function*(){yield re({id:i.userId}),a.$message.success("\u5220\u9664\u6210\u529F\uFF01"),yield _()}))},q=i=>{v.visible=!1,i&&_()},G=i=>{a.$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 ie({userId:i.userId,password:r}),a.$message.success("\u4FEE\u6539\u6210\u529F\uFF01"),yield _()}))},J=({userId:i,accountStatus:r})=>new Promise(m=>{const c=r==="ENABLE"?"\u505C\u7528":"\u542F\u7528";a.$messageBox.confirm(`\u786E\u8BA4${c}\u8BE5\u7528\u6237\u5417?`,"\u63D0\u793A\uFF01",{type:"warning"}).then(()=>w(this,null,function*(){yield ce({userId:i,accountStatus:r==="ENABLE"?"DISABLE":"ENABLE"}),a.$message.success(`${c}\u6210\u529F\uFF01`),_(),m(!0)}))});return fe(()=>w(this,null,function*(){x.value=(yield ve()).data,yield _()})),(i,r)=>{const m=u("el-input"),c=u("el-form-item"),f=u("el-col"),Z=u("el-cascader"),H=u("el-option"),K=u("el-select"),B=u("el-button"),Q=u("el-row"),X=u("el-form"),E=u("el-card"),Y=u("el-switch"),ee=u("table-list");return V(),D("div",Be,[e(E,{shadow:"never",class:"search mb-16"},{default:t(()=>[e(X,{"label-suffix":":",model:n.value,size:"small"},{default:t(()=>[e(Q,{gutter:16},{default:t(()=>[e(f,{span:7},{default:t(()=>[e(c,{label:"\u7528\u6237\u59D3\u540D"},{default:t(()=>[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:t(()=>[e(c,{label:"\u6240\u5C5E\u4F01\u4E1A"},{default:t(()=>[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:t(()=>[e(c,{label:"\u6240\u5C5E\u533A\u57DF"},{default:t(()=>[e(Z,{modelValue:n.value.regionCode,"onUpdate:modelValue":r[2]||(r[2]=o=>n.value.regionCode=o),props:g(y),options:x.value,clearable:"",class:"w-full"},null,8,["modelValue","props","options"])]),_:1})]),_:1}),e(f,{span:8},{default:t(()=>[e(c,{label:"\u7528\u6237\u89D2\u8272"},{default:t(()=>[e(K,{modelValue:n.value.role,"onUpdate:modelValue":r[3]||(r[3]=o=>n.value.role=o),clearable:"",placeholder:"\u8BF7\u9009\u62E9",class:"w-full"},{default:t(()=>[(V(!0),D(we,null,be(g(k),o=>(V(),he(H,{key:o.key,label:o.name,value:o.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(f,{span:16},{default:t(()=>[e(c,{class:"btn"},{default:t(()=>[e(B,{type:"primary",onClick:M},{default:t(()=>[Se]),_:1}),e(B,{type:"info",onClick:R},{default:t(()=>[De]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(E,{shadow:"never"},{header:t(()=>[C("div",Te,[$e,e(B,{type:"primary",icon:"Plus",size:"small",onClick:F},{default:t(()=>[Ee]),_:1})])]),default:t(()=>[e(ee,{ref_key:"tableListRef",ref:p,column:b,data:$.value,total:d.value,onGetTableData:_},{accountStatus:t(({scope:o})=>[e(Y,{modelValue:o.row.accountStatus,"onUpdate:modelValue":N=>o.row.accountStatus=N,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:t(({scope:o})=>{var N,I,L;return[C("a",{class:"text-primary",onClick:P=>W(o.row)},"\u7F16\u8F91",8,Ie),((N=g(l))==null?void 0:N.role)==="super_admin"||((I=g(l))==null?void 0:I.role)==="enterprise_admin"||((L=g(l))==null?void 0:L.role)==="regional_general_manager"?(V(),D("a",{key:0,class:"text-primary",onClick:P=>G(o.row)}," \u4FEE\u6539\u5BC6\u7801 ",8,Le)):ge("",!0),C("a",{class:"text-danger",onClick:P=>j(o.row)},"\u5220\u9664",8,Pe)]}),_:1},8,["data","total"])]),_:1}),e(Ve,{visible:v.visible,data:v.rowData,onClose:q},null,8,["visible","data"])])}}}),Ge=de(Oe,[["__scopeId","data-v-00e66cb5"]]);export{Ge as default};