TenantForm-e9b39ec8.js 7.3 KB

1
  1. import{az as f,d as X,P as $,r as p,x as ee,o as m,C as g,A as a,f as e,a as t,D as y,k as ae,c as q,F as N,Q as I,a2 as M,E as le,a1 as te,a8 as ue,U as de,H as oe,R as se,S as re,K as ie,bP as ne,I as me,as as pe,at as ce,V as _e,J as be,Y as fe,__tla as ge}from"./index-1f518666.js";import{_ as ve,__tla as we}from"./Dialog-4c960d8c.js";import{a as Ve,D as ye,__tla as he}from"./dict-167d9193.js";import{C as S}from"./constants-c811e5ff.js";import{g as ke,__tla as xe}from"./index-001dc5aa.js";import{u as Ue,__tla as Te}from"./useMessage-633c11d2.js";import{_ as Ce}from"./_plugin-vue_export-helper-1b428a4d.js";let h,E,P,A,F,qe=Promise.all([(()=>{try{return ge}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return he}catch{}})(),(()=>{try{return xe}catch{}})(),(()=>{try{return Te}catch{}})()]).then(async()=>{let o;F=c=>f.get({url:"/system/tenant/page",params:c}),P=c=>f.delete({url:"/system/tenant/delete?id="+c}),A=c=>f.download({url:"/system/tenant/export-excel",params:c}),o=100,h=Ce(X({name:"SystemTenantForm",__name:"TenantForm",emits:["success"],setup(c,{expose:O,emit:D}){const{t:V}=$(),k=Ue(),_=p(!1),x=p(""),b=p(!1),U=p(""),d=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}),z=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([]);O({open:async(i,l)=>{if(_.value=!0,x.value=V("action."+i),U.value=i,j(),l){b.value=!0;try{d.value=await(n=>f.get({url:"/system/tenant/get?id="+n}))(l)}finally{b.value=!1}}T.value=await ke()}});const L=D,R=async()=>{if(w&&await w.value.validate()){b.value=!0;try{const i=d.value;U.value==="create"?(await(l=>f.post({url:"/system/tenant/create",data:l}))(i),k.success(V("common.createSuccess"))):(await(l=>f.put({url:"/system/tenant/update",data:l}))(i),k.success(V("common.updateSuccess"))),_.value=!1,L("success")}finally{b.value=!1}}},j=()=>{var i;d.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=ue,s=de,r=oe,B=se,J=re,v=ie,H=ne,K=me,Q=pe,W=ce,Y=_e,C=be,Z=ve,G=fe;return m(),g(Z,{modelValue:t(_),"onUpdate:modelValue":l[11]||(l[11]=u=>te(_)?_.value=u:null),title:t(x),width:"50%"},{footer:a(()=>[e(C,{disabled:t(b),type:"primary",onClick:R},{default:a(()=>[y("\u786E \u5B9A")]),_:1},8,["disabled"]),e(C,{onClick:l[10]||(l[10]=u=>_.value=!1)},{default:a(()=>[y("\u53D6 \u6D88")]),_:1})]),default:a(()=>[ae((m(),g(Y,{ref_key:"formRef",ref:w,model:t(d),rules:t(z),"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(d).name,"onUpdate:modelValue":l[0]||(l[0]=u=>t(d).name=u),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(J,{modelValue:t(d).packageId,"onUpdate:modelValue":l[1]||(l[1]=u=>t(d).packageId=u),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u54C1\u724C\u65B9\u5957\u9910"},{default:a(()=>[(m(!0),q(N,null,I(t(T),u=>(m(),g(B,{key:u.id,label:u.name,value:u.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(d).contactName,"onUpdate:modelValue":l[2]||(l[2]=u=>t(d).contactName=u),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(d).contactMobile,"onUpdate:modelValue":l[3]||(l[3]=u=>t(d).contactMobile=u),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(d).id===void 0?(m(),g(s,{key:0,label:"\u7528\u6237\u540D\u79F0","label-width":o,prop:"username"},{default:a(()=>[e(n,{modelValue:t(d).username,"onUpdate:modelValue":l[4]||(l[4]=u=>t(d).username=u),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u79F0"},null,8,["modelValue"])]),_:1})):M("",!0)]),_:1}),e(r,{span:"12"},{default:a(()=>[t(d).id===void 0?(m(),g(s,{key:0,label:"\u7528\u6237\u5BC6\u7801","label-width":o,prop:"password"},{default:a(()=>[e(n,{modelValue:t(d).password,"onUpdate:modelValue":l[5]||(l[5]=u=>t(d).password=u),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u5BC6\u7801","show-password":"",type:"password"},null,8,["modelValue"])]),_:1})):M("",!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(H,{modelValue:t(d).accountCount,"onUpdate:modelValue":l[6]||(l[6]=u=>t(d).accountCount=u),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(K,{style:{width:"200px"},modelValue:t(d).expireTime,"onUpdate:modelValue":l[7]||(l[7]=u=>t(d).expireTime=u),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(d).website,"onUpdate:modelValue":l[8]||(l[8]=u=>t(d).website=u),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(W,{modelValue:t(d).status,"onUpdate:modelValue":l[9]||(l[9]=u=>t(d).status=u)},{default:a(()=>[(m(!0),q(N,null,I(t(Ve)(t(ye).COMMON_STATUS),u=>(m(),g(Q,{key:u.value,label:u.value},{default:a(()=>[y(le(u.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])),[[G,t(b)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-9b8dbaf1"]]),E=Object.freeze(Object.defineProperty({__proto__:null,default:h},Symbol.toStringTag,{value:"Module"}))});export{h as T,qe as __tla,E as a,P as d,A as e,F as g};