TenantForm-662babfb.js 7.3 KB

1
  1. import{ap as f,d as Y,h as $,r as p,e as ee,o as m,q as g,w as a,f as e,a as t,m as h,v as ae,c as q,F as N,n as M,O as I,t as le,N as te,U as de,z as ue,E as oe,x as se,y as re,i as ie,bb as ne,A as me,ag as pe,ah as ce,C as _e,B as be,H as fe,__tla as ge}from"./index-2eab2d23.js";import{_ as ve,__tla as we}from"./Dialog-c2716df6.js";import{a as Ve,D as he,__tla as ye}from"./dict-1ad71b6f.js";import{C as S}from"./constants-40f13f5e.js";import{g as xe,__tla as ke}from"./index-7dbbcc8f.js";import{u as Ue,__tla as Te}from"./useMessage-171aa63e.js";import{_ as Ce}from"./_plugin-vue_export-helper-1b428a4d.js";let y,E,O,A,F,qe=Promise.all([(()=>{try{return ge}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return ke}catch{}})(),(()=>{try{return Te}catch{}})()]).then(async()=>{let o;F=c=>f.get({url:"/system/tenant/page",params:c}),O=c=>f.delete({url:"/system/tenant/delete?id="+c}),A=c=>f.download({url:"/system/tenant/export-excel",params:c}),o=100,y=Ce(Y({name:"SystemTenantForm",__name:"TenantForm",emits:["success"],setup(c,{expose:z,emit:B}){const{t:V}=$(),x=Ue(),_=p(!1),k=p(""),b=p(!1),U=p(""),u=p({id:void 0,name:void 0,packageId:void 0,contactName:void 0,contactMobile:void 0,accountCount:void 0,expireTime:void 0,website:void 0,status:S.ENABLE,username:void 0,password:void 0}),D=ee({name:[{required:!0,message:"\u79DF\u6237\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],packageId:[{required:!0,message:"\u79DF\u6237\u5957\u9910\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],contactName:[{required:!0,message:"\u8054\u7CFB\u4EBA\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u79DF\u6237\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],accountCount:[{required:!0,message:"\u8D26\u53F7\u989D\u5EA6\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],expireTime:[{required:!0,message:"\u8FC7\u671F\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],website:[{required:!0,message:"\u7ED1\u5B9A\u57DF\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],username:[{required:!0,message:"\u7528\u6237\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],password:[{required:!0,message:"\u7528\u6237\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),w=p(),T=p([]);z({open:async(i,l)=>{if(_.value=!0,k.value=V("action."+i),U.value=i,L(),l){b.value=!0;try{u.value=await(n=>f.get({url:"/system/tenant/get?id="+n}))(l)}finally{b.value=!1}}T.value=await xe()}});const j=B,H=async()=>{if(w&&await w.value.validate()){b.value=!0;try{const i=u.value;U.value==="create"?(await(l=>f.post({url:"/system/tenant/create",data:l}))(i),x.success(V("common.createSuccess"))):(await(l=>f.put({url:"/system/tenant/update",data:l}))(i),x.success(V("common.updateSuccess"))),_.value=!1,j("success")}finally{b.value=!1}}},L=()=>{var i;u.value={id:void 0,name:void 0,packageId:void 0,contactName:void 0,contactMobile:void 0,accountCount:void 0,expireTime:void 0,website:void 0,status:S.ENABLE,username:void 0,password:void 0},(i=w.value)==null||i.resetFields()};return(i,l)=>{const n=de,s=ue,r=oe,P=se,R=re,v=ie,K=ne,X=me,Z=pe,G=ce,J=_e,C=be,Q=ve,W=fe;return m(),g(Q,{modelValue:t(_),"onUpdate:modelValue":l[11]||(l[11]=d=>te(_)?_.value=d:null),title:t(k),width:"50%"},{footer:a(()=>[e(C,{disabled:t(b),type:"primary",onClick:H},{default:a(()=>[h("\u786E \u5B9A")]),_:1},8,["disabled"]),e(C,{onClick:l[10]||(l[10]=d=>_.value=!1)},{default:a(()=>[h("\u53D6 \u6D88")]),_:1})]),default:a(()=>[ae((m(),g(J,{ref_key:"formRef",ref:w,model:t(u),rules:t(D),"label-width":"80px"},{default:a(()=>[e(v,{gutter:30},{default:a(()=>[e(r,{span:"12"},{default:a(()=>[e(s,{label:"\u54C1\u724C\u65B9","label-width":o,prop:"name"},{default:a(()=>[e(n,{modelValue:t(u).name,"onUpdate:modelValue":l[0]||(l[0]=d=>t(u).name=d),placeholder:"\u8BF7\u8F93\u5165\u54C1\u724C\u65B9"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:"12"},{default:a(()=>[e(s,{label:"\u54C1\u724C\u65B9\u5957\u9910","label-width":o,prop:"packageId"},{default:a(()=>[e(R,{modelValue:t(u).packageId,"onUpdate:modelValue":l[1]||(l[1]=d=>t(u).packageId=d),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u54C1\u724C\u65B9\u5957\u9910"},{default:a(()=>[(m(!0),q(N,null,M(t(T),d=>(m(),g(P,{key:d.id,label:d.name,value:d.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(v,{gutter:30},{default:a(()=>[e(r,{span:"12"},{default:a(()=>[e(s,{label:"\u8054\u7CFB\u4EBA","label-width":o,prop:"contactName"},{default:a(()=>[e(n,{modelValue:t(u).contactName,"onUpdate:modelValue":l[2]||(l[2]=d=>t(u).contactName=d),placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:"12"},{default:a(()=>[e(s,{label:"\u8054\u7CFB\u624B\u673A","label-width":o,prop:"contactMobile"},{default:a(()=>[e(n,{modelValue:t(u).contactMobile,"onUpdate:modelValue":l[3]||(l[3]=d=>t(u).contactMobile=d),placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u624B\u673A"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(v,{gutter:30},{default:a(()=>[e(r,{span:"12"},{default:a(()=>[t(u).id===void 0?(m(),g(s,{key:0,label:"\u7528\u6237\u540D\u79F0","label-width":o,prop:"username"},{default:a(()=>[e(n,{modelValue:t(u).username,"onUpdate:modelValue":l[4]||(l[4]=d=>t(u).username=d),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u79F0"},null,8,["modelValue"])]),_:1})):I("",!0)]),_:1}),e(r,{span:"12"},{default:a(()=>[t(u).id===void 0?(m(),g(s,{key:0,label:"\u7528\u6237\u5BC6\u7801","label-width":o,prop:"password"},{default:a(()=>[e(n,{modelValue:t(u).password,"onUpdate:modelValue":l[5]||(l[5]=d=>t(u).password=d),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u5BC6\u7801","show-password":"",type:"password"},null,8,["modelValue"])]),_:1})):I("",!0)]),_:1})]),_:1}),e(v,{gutter:30},{default:a(()=>[e(r,{span:"12"},{default:a(()=>[e(s,{label:"\u8D26\u53F7\u989D\u5EA6","label-width":o,prop:"accountCount"},{default:a(()=>[e(K,{modelValue:t(u).accountCount,"onUpdate:modelValue":l[6]||(l[6]=d=>t(u).accountCount=d),min:0,"controls-position":"right",placeholder:"\u8BF7\u8F93\u5165\u8D26\u53F7\u989D\u5EA6"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:"12"},{default:a(()=>[e(s,{label:"\u8FC7\u671F\u65F6\u95F4","label-width":o,prop:"expireTime"},{default:a(()=>[e(X,{style:{width:"200px"},modelValue:t(u).expireTime,"onUpdate:modelValue":l[7]||(l[7]=d=>t(u).expireTime=d),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u8FC7\u671F\u65F6\u95F4",type:"date","value-format":"x"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(v,{gutter:30},{default:a(()=>[e(r,{span:"12"},{default:a(()=>[e(s,{label:"\u7ED1\u5B9A\u57DF\u540D","label-width":o,prop:"website"},{default:a(()=>[e(n,{modelValue:t(u).website,"onUpdate:modelValue":l[8]||(l[8]=d=>t(u).website=d),placeholder:"\u8BF7\u8F93\u5165\u7ED1\u5B9A\u57DF\u540D"},null,8,["modelValue"])]),_:1})]),_:1}),e(r,{span:"12"},{default:a(()=>[e(s,{label:"\u54C1\u724C\u65B9\u72B6\u6001","label-width":o,class:"item",prop:"status"},{default:a(()=>[e(G,{modelValue:t(u).status,"onUpdate:modelValue":l[9]||(l[9]=d=>t(u).status=d)},{default:a(()=>[(m(!0),q(N,null,M(t(Ve)(t(he).COMMON_STATUS),d=>(m(),g(Z,{key:d.value,label:d.value},{default:a(()=>[h(le(d.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])),[[W,t(b)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-9b8dbaf1"]]),E=Object.freeze(Object.defineProperty({__proto__:null,default:y},Symbol.toStringTag,{value:"Module"}))});export{y as T,qe as __tla,E as a,O as d,A as e,F as g};