1 |
- import{aD as f,a3 as q,_ as L,d as h,w as c,aG as O,W as $,r as i,am as j,o as p,G as D,C as t,H as G,u as r,aH as P,l as n,a as H,c as W,F as X,D as Y,M as y,L as z,b as M}from"./index.26d13061.js";const{VITE_PROXY_DOMAIN_REAL:le,VITE_PROXY_USER_REAL:Q}=q(),_=Q+"/admin/",ae=e=>f.request("post",`${_}account/list`,{data:e}),J=e=>f.request("post",`${_}role/query`,{data:e}),te=e=>f.request("post",`${_}usersave`,{data:e}),ue=e=>f.request("post",`${_}setcompanystatus`,{data:e}),oe=e=>f.request("post",`${_}menustatus`,{data:e});var v=(e=>(e[e.update=0]="update",e[e.preview=1]="preview",e[e.create=2]="create",e))(v||{});const K={class:"flex w-full justify-end"},T=h({__name:"role-modal",emits:["finance-save"],setup(e,{expose:A,emit:g}){const d=c(!1),E=c(v.create),R=c(null),{run:w,data:C,loading:N}=O({initalData:[],isList:!1}),k={nickname:"",mobile:"",roleid:""},u=c({...k}),F=c({}),x=$(()=>{const o="\u8D26\u53F7\u89D2\u8272\u8BBE\u7F6E";switch(E.value){case v.create:return"\u521B\u5EFA"+o;case v.preview:return"\u67E5\u770B"+o;default:return"\u4FEE\u6539"+o}});function I(){R.value.validate(o=>{!o||(g("finance-save",{...r(u)},r(E)),d.value=!1)})}return A({onDisplay:(o,l)=>{if(u.value={...k},d.value=!0,E.value=l,o.companyCode,w(J({})),o){const{mobile:m,nickname:s,role_id:B,id:V,companyName:b}=o;F.value=b,u.value={mobile:m,nickname:s,roleid:B,id:V}}}}),(o,l)=>{const m=i("ElInput"),s=i("ElFormItem"),B=i("ElRadio"),V=i("ElRadioGroup"),b=i("ElButton"),S=i("ElDialog"),U=j("loading");return p(),D(S,{center:"",modelValue:d.value,"onUpdate:modelValue":l[5]||(l[5]=a=>d.value=a),title:r(x),"close-on-click-modal":!1},{default:t(()=>[G((p(),D(r(P),{ref_key:"formRef",ref:R,labelWidth:"100px","label-position":"left",model:u.value,rules:{},disabled:E.value===r(v).preview},{default:t(()=>[n(s,{label:"\u771F\u5B9E\u59D3\u540D",prop:"nickname"},{default:t(()=>[n(m,{placeholder:"\u8BF7\u8F93\u5165\u771F\u5B9E\u59D3\u540D",modelValue:u.value.nickname,"onUpdate:modelValue":l[0]||(l[0]=a=>u.value.nickname=a),disabled:""},null,8,["modelValue"])]),_:1}),n(s,{label:"\u624B\u673A\u53F7",prop:"mobile"},{default:t(()=>[n(m,{placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",modelValue:u.value.mobile,"onUpdate:modelValue":l[1]||(l[1]=a=>u.value.mobile=a),disabled:""},null,8,["modelValue"])]),_:1}),F.value?(p(),D(s,{key:0,label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyName"},{default:t(()=>[n(m,{placeholder:"\u8BF7\u8F93\u5165\u4E1A\u52A1\u516C\u53F8",value:F.value,disabled:""},null,8,["value"])]),_:1})):H("v-if",!0),n(s,{label:"\u89D2\u8272",prop:"roleid"},{default:t(()=>[n(V,{modelValue:u.value.roleid,"onUpdate:modelValue":l[2]||(l[2]=a=>u.value.roleid=a)},{default:t(()=>[(p(!0),W(X,null,Y(r(C),a=>(p(),D(B,{disabled:String(a.status)==="0",key:a.id,label:a.id},{default:t(()=>[y(z(a.role_name),1)]),_:2},1032,["disabled","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),n(s,null,{default:t(()=>[M("div",K,[n(b,{type:"\u53D6\u6D88",onClick:l[3]||(l[3]=()=>d.value=!1)},{default:t(()=>[y("\u53D6\u6D88")]),_:1}),n(b,{type:"primary",onClick:l[4]||(l[4]=()=>I())},{default:t(()=>[y("\u4FDD\u5B58")]),_:1})])]),_:1})]),_:1},8,["model","disabled"])),[[U,r(N)]])]),_:1},8,["modelValue","title"])}}});var Z=L(T,[["__file","C:/Users/a/Desktop/projects/report-v3/src/views/system/accountRole/components/role-modal.vue"]]),ne=Object.freeze(Object.defineProperty({__proto__:null,default:Z},Symbol.toStringTag,{value:"Module"}));export{v as M,Z as R,oe as a,ue as b,te as c,ae as h,ne as r};
|