text: var e=Object.defineProperty,t=Object.defineProperties,o=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(t,o,r)=>o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r,n=(e,t,o)=>new Promise(((r,s)=>{var i=e=>{try{n(o.next(e))}catch(t){s(t)}},a=e=>{try{n(o.throw(e))}catch(t){s(t)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,a);n((o=o.apply(e,t)).next())}));import{_ as d,a as l}from"./useModal.14f2a57c.js";import{_ as c}from"./BasicForm.d23c40e0.js";import{u as p}from"./useForm.a6964f79.js";import{a as m}from"./group.data.549198fa.js";import{e as u}from"./account.f18c97e9.js";import{b as f}from"./group.57a3aeb6.js";import{k as j,bt as b,r as g,u as v,f as h,K as y,o as x,n as O,Q as w,q as F,N as M}from"./vendor.56d2c57f.js";import"./index.407e4786.js";import"./useWindowSizeFn.d0559e60.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import"./CountdownInput.3d5d9047.js";import"./uuid.c53863e7.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              */import"./download.dd3a6468.js";import"./StrengthMeter.ca48504f.js";var S=j({name:"SetAccountModal",components:{BasicModal:d,BasicForm:c,Select:b},emits:["success","register"],setup(e,{emit:d}){const c=g(!0),j=g([]),[b,{setFieldsValue:y,updateSchema:x,resetFields:O,validate:w}]=p({labelWidth:100,schemas:m,showActionButtonGroup:!1,actionColOptions:{span:23}}),[F,{setModalProps:M,closeModal:S}]=l((e=>n(this,null,(function*(){O(),M({confirmLoading:!1,title:"给组【"+e.record.name+"("+e.record.sn+")】分配用户"}),c.value=!!(null==e?void 0:e.isUpdate);const n=yield u();if(n.forEach((e=>{e.label=e.realName+"("+e.username+")",e.value=e.id})),j.value=n,v(c)){let n=e.record.users||[];n=n.map((e=>e.id)),y((d=((e,t)=>{for(var o in t||(t={}))s.call(t,o)&&a(e,o,t[o]);if(r)for(var o of r(t))i.call(t,o)&&a(e,o,t[o]);return e})({},e.record),t(d,o({users:n}))))}var d}))));return{registerModal:F,registerForm:b,getTitle:h((()=>v(c)?"修改":"新增")),accountOptions:j,handleSubmit:function(){return n(this,null,(function*(){try{M({confirmLoading:!0});const e=yield w();e.users=e.users.map((e=>({id:e}))),e.groupId=e.id,delete e.id,yield f(e),S(),d("success")}finally{M({confirmLoading:!1})}}))}}}});S.render=function(e,t,o,r,s,i){const a=y("Select"),n=y("BasicForm"),d=y("BasicModal");return x(),O(d,M(e.$attrs,{onRegister:e.registerModal,title:e.getTitle,onOk:e.handleSubmit}),{default:w((()=>[F(n,{onRegister:e.registerForm},{users:w((({model:t,field:o})=>[F(a,{value:t[o],"onUpdate:value":e=>t[o]=e,mode:"multiple",style:{width:"100%"},placeholder:"请选择用户","option-label-prop":"label",options:e.accountOptions},null,8,["value","onUpdate:value","options"])])),_:1},8,["onRegister"])])),_:1},16,["onRegister","title","onOk"])};export default S;
  