TenantPackageForm-b4aaa328.js 4.7 KB

1
  1. import{d as J,B as X,r as o,f as Y,o as h,j as g,w as t,i as s,a,m as f,D as Z,c as z,F as G,C as Q,t as W,R as V,dY as $,X as ee,I as ae,E as le,ai as te,aj as se,s as ue,cZ as re,J as oe,q as de,M as ne,__tla as me}from"./index-1e808f2e.js";import{_ as ce,__tla as _e}from"./Dialog-f44f9d78.js";import{E as ie,__tla as pe}from"./el-card-03b3588b.js";import{a as fe,D as ve,__tla as he}from"./dict-a31cb4ba.js";import{C as U}from"./constants-e43f22dd.js";import{d as ye,h as ke}from"./tree-fd3a041e.js";import{a as ge,c as Ve,u as be,__tla as Ce}from"./index-95c7dfd0.js";import{g as xe,__tla as we}from"./index-e7765947.js";import{u as Ee,__tla as Ie}from"./useMessage-5f9e8917.js";import{_ as Ue}from"./_plugin-vue_export-helper-1b428a4d.js";let N,Ne=Promise.all([(()=>{try{return me}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return he}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return we}catch{}})(),(()=>{try{return Ie}catch{}})()]).then(async()=>{N=Ue(J({name:"SystemTenantPackageForm",__name:"TenantPackageForm",emits:["success"],setup(qe,{expose:q,emit:F}){const{t:y}=X(),b=Ee(),m=o(!1),C=o(""),c=o(!1),x=o(""),r=o({id:null,name:null,remark:null,menuIds:[],status:U.ENABLE}),S=Y({name:[{required:!0,message:"\u5957\u9910\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],menuIds:[{required:!0,message:"\u5173\u8054\u7684\u83DC\u5355\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),v=o(),k=o([]),_=o(!1),n=o(),p=o(!1);q({open:async(u,e)=>{if(m.value=!0,C.value=y("action."+u),x.value=u,B(),k.value=ke(await xe()),e){c.value=!0;try{const d=await ge(e);r.value=d,d.menuIds.forEach(i=>{n.value.setChecked(i,!0,!1)})}finally{c.value=!1}}}});const T=F,A=async()=>{if(v&&await v.value.validate()){c.value=!0;try{const u=r.value;u.menuIds=[...n.value.getCheckedKeys(!1),...n.value.getHalfCheckedKeys()],x.value==="create"?(await Ve(u),b.success(y("common.createSuccess"))):(await be(u),b.success(y("common.updateSuccess"))),m.value=!1,T("success")}finally{c.value=!1}}},B=()=>{var u,e;p.value=!1,_.value=!1,r.value={id:null,name:null,remark:null,menuIds:[],status:U.ENABLE},(u=n.value)==null||u.setCheckedNodes([]),(e=v.value)==null||e.resetFields()},M=()=>{n.value.setCheckedNodes(p.value?k.value:[])},R=()=>{var e;const u=(e=n.value)==null?void 0:e.store.nodesMap;for(let d in u)u[d].expanded!==_.value&&(u[d].expanded=_.value)};return(u,e)=>{const d=ee,i=ae,w=le,D=te,H=se,K=ue,E=re,P=ie,j=oe,I=de,L=ce,O=ne;return h(),g(L,{modelValue:a(m),"onUpdate:modelValue":e[6]||(e[6]=l=>V(m)?m.value=l:null),title:a(C)},{footer:t(()=>[s(I,{disabled:a(c),type:"primary",onClick:A},{default:t(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),s(I,{onClick:e[5]||(e[5]=l=>m.value=!1)},{default:t(()=>[f("\u53D6 \u6D88")]),_:1})]),default:t(()=>[Z((h(),g(j,{ref_key:"formRef",ref:v,model:a(r),rules:a(S),"label-width":"80px"},{default:t(()=>[s(K,{gutter:30},{default:t(()=>[s(w,{span:"12"},{default:t(()=>[s(i,{label:"\u5957\u9910\u540D",prop:"name"},{default:t(()=>[s(d,{modelValue:a(r).name,"onUpdate:modelValue":e[0]||(e[0]=l=>a(r).name=l),placeholder:"\u8BF7\u8F93\u5165\u5957\u9910\u540D"},null,8,["modelValue"])]),_:1})]),_:1}),s(w,{span:"12"},{default:t(()=>[s(i,{label:"\u72B6\u6001",prop:"status"},{default:t(()=>[s(H,{modelValue:a(r).status,"onUpdate:modelValue":e[1]||(e[1]=l=>a(r).status=l)},{default:t(()=>[(h(!0),z(G,null,Q(a(fe)(a(ve).COMMON_STATUS),l=>(h(),g(D,{key:l.value,label:l.value},{default:t(()=>[f(W(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),s(i,{label:"\u83DC\u5355\u6743\u9650"},{default:t(()=>[s(P,{class:"cardHeight"},{header:t(()=>[f(" \u5168\u9009/\u5168\u4E0D\u9009: "),s(E,{modelValue:a(p),"onUpdate:modelValue":e[2]||(e[2]=l=>V(p)?p.value=l:null),"active-text":"\u662F","inactive-text":"\u5426","inline-prompt":"",onChange:M},null,8,["modelValue"]),f(" \u5168\u90E8\u5C55\u5F00/\u6298\u53E0: "),s(E,{modelValue:a(_),"onUpdate:modelValue":e[3]||(e[3]=l=>V(_)?_.value=l:null),"active-text":"\u5C55\u5F00","inactive-text":"\u6298\u53E0","inline-prompt":"",onChange:R},null,8,["modelValue"])]),default:t(()=>[s(a($),{ref_key:"treeRef",ref:n,data:a(k),props:a(ye),"empty-text":"\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u5019","node-key":"id","show-checkbox":""},null,8,["data","props"])]),_:1})]),_:1}),s(i,{label:"\u5907\u6CE8",prop:"remark"},{default:t(()=>[s(d,{modelValue:a(r).remark,"onUpdate:modelValue":e[4]||(e[4]=l=>a(r).remark=l),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[O,a(c)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-b7585667"]])});export{Ne as __tla,N as default};