1 |
- import{d as N,i as L,r as m,f as M,o as p,x as v,w as t,g as e,a,n as w,y as O,c as T,F as j,v as G,P as I,W as J,B as R,E as W,j as H,z as K,A as Q,G as X,D as Y,J as Z,_ as $,__tla as ee}from"./index-3fb48822.js";import{_ as ae,__tla as le}from"./Dialog-7d4425a0.js";import{a as te,D as se,__tla as re}from"./dict-51415be4.js";import{C as k}from"./constants-637baed6.js";import{a as ue,c as oe,u as de,__tla as me}from"./index-3acbc6ed.js";import{u as ne,__tla as ce}from"./useMessage-b6c78c26.js";let x,_e=Promise.all([(()=>{try{return ee}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return ce}catch{}})()]).then(async()=>{x=$(N({name:"SystemPostForm",__name:"PostForm",emits:["success"],setup(ie,{expose:U,emit:F}){const{t:f}=L(),y=ne(),o=m(!1),V=m(""),d=m(!1),g=m(""),r=m({id:void 0,name:"",code:"",sort:0,status:k.ENABLE,remark:""}),P=M({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"}]}),c=m();U({open:async(u,l)=>{if(o.value=!0,V.value=f("action."+u),g.value=u,A(),l){d.value=!0;try{r.value=await ue(l)}finally{d.value=!1}}}});const S=F,q=async()=>{if(c&&await c.value.validate()){d.value=!0;try{const u=r.value;g.value==="create"?(await oe(u),y.success(f("common.createSuccess"))):(await de(u),y.success(f("common.updateSuccess"))),o.value=!1,S("success")}finally{d.value=!1}}},A=()=>{var u;r.value={id:void 0,name:"",code:"",sort:void 0,status:k.ENABLE,remark:""},(u=c.value)==null||u.resetFields()};return(u,l)=>{const _=J,n=R,i=W,h=H,C=K,E=Q,D=X,b=Y,z=ae,B=Z;return p(),v(z,{modelValue:a(o),"onUpdate:modelValue":l[6]||(l[6]=s=>I(o)?o.value=s:null),title:a(V),width:"700"},{footer:t(()=>[e(b,{disabled:a(d),type:"primary",onClick:q},{default:t(()=>[w("\u786E \u5B9A")]),_:1},8,["disabled"]),e(b,{onClick:l[5]||(l[5]=s=>o.value=!1)},{default:t(()=>[w("\u53D6 \u6D88")]),_:1})]),default:t(()=>[O((p(),v(D,{ref_key:"formRef",ref:c,model:a(r),rules:a(P),"label-width":"80px"},{default:t(()=>[e(h,{gutter:30},{default:t(()=>[e(i,{span:"12"},{default:t(()=>[e(n,{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(n,{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(h,{gutter:30},{default:t(()=>[e(i,{span:"12"},{default:t(()=>[e(n,{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(n,{label:"\u72B6\u6001",prop:"status"},{default:t(()=>[e(E,{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),T(j,null,G(a(te)(a(se).COMMON_STATUS),s=>(p(),v(C,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(n,{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"])),[[B,a(d)]])]),_:1},8,["modelValue","title"])}}}),[["__scopeId","data-v-45096547"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/post/PostForm.vue"]])});export{_e as __tla,x as default};
|