PostForm-555a93e0.js 4.0 KB

1
  1. import{d as M,h as O,r as m,e as T,o as p,q as v,w as t,f as e,a,m as k,v as z,c as D,F as H,n as I,N as R,U as j,z as G,E as J,i as K,x as Q,y as W,C as X,B as Y,H as Z,__tla as $}from"./index-2eab2d23.js";import{_ as ee,__tla as ae}from"./Dialog-c2716df6.js";import{a as le,D as te,__tla as se}from"./dict-1ad71b6f.js";import{C as w}from"./constants-40f13f5e.js";import{a as re,c as ue,u as oe,__tla as de}from"./index-2402488f.js";import{u as me,__tla as ce}from"./useMessage-171aa63e.js";import{_ as ne}from"./_plugin-vue_export-helper-1b428a4d.js";let U,_e=Promise.all([(()=>{try{return $}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ce}catch{}})()]).then(async()=>{U=ne(M({name:"SystemPostForm",__name:"PostForm",emits:["success"],setup(ie,{expose:q,emit:x}){const{t:f}=O(),y=me(),o=m(!1),V=m(""),d=m(!1),h=m(""),r=m({id:void 0,name:"",code:"",sort:0,status:w.ENABLE,remark:""}),E=T({name:[{required:!0,message:"\u5C97\u4F4D\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],code:[{required:!0,message:"\u5C97\u4F4D\u7F16\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],status:[{required:!0,message:"\u5C97\u4F4D\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],remark:[{required:!1,message:"\u5C97\u4F4D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),n=m();q({open:async(u,l)=>{if(o.value=!0,V.value=f("action."+u),h.value=u,F(),l){d.value=!0;try{r.value=await re(l)}finally{d.value=!1}}}});const S=x,C=async()=>{if(n&&await n.value.validate()){d.value=!0;try{const u=r.value;h.value==="create"?(await ue(u),y.success(f("common.createSuccess"))):(await oe(u),y.success(f("common.updateSuccess"))),o.value=!1,S("success")}finally{d.value=!1}}},F=()=>{var u;r.value={id:void 0,name:"",code:"",sort:void 0,status:w.ENABLE,remark:""},(u=n.value)==null||u.resetFields()};return(u,l)=>{const _=j,c=G,i=J,g=K,N=Q,A=W,B=X,b=Y,P=ee,L=Z;return p(),v(P,{modelValue:a(o),"onUpdate:modelValue":l[6]||(l[6]=s=>R(o)?o.value=s:null),title:a(V),width:"700"},{footer:t(()=>[e(b,{disabled:a(d),type:"primary",onClick:C},{default:t(()=>[k("\u786E \u5B9A")]),_:1},8,["disabled"]),e(b,{onClick:l[5]||(l[5]=s=>o.value=!1)},{default:t(()=>[k("\u53D6 \u6D88")]),_:1})]),default:t(()=>[z((p(),v(B,{ref_key:"formRef",ref:n,model:a(r),rules:a(E),"label-width":"80px"},{default:t(()=>[e(g,{gutter:30},{default:t(()=>[e(i,{span:"12"},{default:t(()=>[e(c,{label:"\u5C97\u4F4D\u6807\u9898",prop:"name"},{default:t(()=>[e(_,{modelValue:a(r).name,"onUpdate:modelValue":l[0]||(l[0]=s=>a(r).name=s),placeholder:"\u8BF7\u8F93\u5165\u5C97\u4F4D\u6807\u9898"},null,8,["modelValue"])]),_:1})]),_:1}),e(i,{span:"12"},{default:t(()=>[e(c,{label:"\u5C97\u4F4D\u7F16\u7801",prop:"code"},{default:t(()=>[e(_,{modelValue:a(r).code,"onUpdate:modelValue":l[1]||(l[1]=s=>a(r).code=s),placeholder:"\u8BF7\u8F93\u5165\u5C97\u4F4D\u7F16\u7801"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(g,{gutter:30},{default:t(()=>[e(i,{span:"12"},{default:t(()=>[e(c,{label:"\u5C97\u4F4D\u987A\u5E8F",prop:"sort"},{default:t(()=>[e(_,{modelValue:a(r).sort,"onUpdate:modelValue":l[2]||(l[2]=s=>a(r).sort=s),placeholder:"\u8BF7\u8F93\u5165\u5C97\u4F4D\u987A\u5E8F"},null,8,["modelValue"])]),_:1})]),_:1}),e(i,{span:"12"},{default:t(()=>[e(c,{label:"\u72B6\u6001",prop:"status"},{default:t(()=>[e(A,{modelValue:a(r).status,"onUpdate:modelValue":l[3]||(l[3]=s=>a(r).status=s),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:t(()=>[(p(!0),D(H,null,I(a(le)(a(te).COMMON_STATUS),s=>(p(),v(N,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(c,{label:"\u5907\u6CE8",prop:"remark"},{default:t(()=>[e(_,{style:{width:"580px"},modelValue:a(r).remark,"onUpdate:modelValue":l[4]||(l[4]=s=>a(r).remark=s),placeholder:"\u8BF7\u8F93\u5907\u6CE8",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[L,a(d)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-bae2f81c"]])});export{_e as __tla,U as default};