You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
2.3 KiB
JavaScript

var m=(u,l,o)=>new Promise((s,r)=>{var p=a=>{try{e(o.next(a))}catch(n){r(n)}},c=a=>{try{e(o.throw(a))}catch(n){r(n)}},e=a=>a.done?s(a.value):Promise.resolve(a.value).then(p,c);e((o=o.apply(u,l)).next())});import{a as M,B as y}from"./index-fya05jI8.js";import{u as B,_ as C}from"./useForm-fILnWqWp.js";import"./BasicForm.vue_vue_type_style_index_0_lang-D499EpF5.js";import"./componentMap-zBHKqdNc.js";import{m as S}from"./tenant.data-vv67jHtk.js";import{t as F,a as I,b as R}from"./index-B8FmQvAc.js";import{p as T}from"./index-D2fYO58r.js";import{u as N}from"./tenant-DDCG_OE9.js";import{d as P,f as x,c as A,_ as L,a8 as O,a9 as U,k as V,u as i,ad as $}from"./vue-aEZWZQSa.js";import"./entry/index-C2Ijy48E-1723706691540.js";import"./antd-BY-1PcYE.js";import"./useWindowSizeFn-CjdUjzGl.js";import"./FormItem.vue_vue_type_script_lang-CKJUw6EQ.js";import"./helper-D0Efh3UP.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-CVQ-sEzT.js";import"./index-DVy1eUzr.js";import"./useSortable-Bra4jKJL.js";import"./download-Cu3oizbN.js";import"./useLoading-C2GeNIUj.js";import"./copyTextToClipboard-BBFF3Y3I.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./style-apcQnL4e.js";import"./rules-Boel_RXz.js";const pa=P({name:"TenantModal",__name:"TenantModal",emits:["register","reload"],setup(u,{emit:l}){const o=l,s=x(!1),r=A(()=>s.value?"编辑租户":"新增租户"),[p,{closeModal:c,modalLoading:e}]=M(t=>m(this,null,function*(){e(!0);const{record:d,update:g}=t;if(s.value=g,g&&d){const v=yield F(d.id);yield _(v)}yield a(),e(!1)}));function a(){return m(this,null,function*(){const t=yield T();yield h({field:"packageId",componentProps:{fieldNames:{label:"packageName",value:"packageId"},options:t,disabled:s.value}})})}const[n,{setFieldsValue:_,validate:w,resetForm:f,updateSchema:h}]=B({labelWidth:80,name:"tenant_modal",showActionButtonGroup:!1,baseColProps:{span:24},schemas:S}),{initTenant:k}=N();function b(){return m(this,null,function*(){try{e(!0);const t=yield w();i(s)?yield I(t):yield R(t),yield k(),f(),o("reload",c)}catch(t){}finally{e(!1)}})}return(t,d)=>(L(),O(i(y),$(t.$attrs,{title:r.value,width:600,onRegister:i(p),onOk:b,onCancel:i(f)}),{default:U(()=>[V(i(C),{onRegister:i(n)},null,8,["onRegister"])]),_:1},16,["title","onRegister","onCancel"]))}});export{pa as default};