1 |
- import{d as A,n as B,r as d,f as H,o as n,l as f,w as s,i as r,a as e,j as y,C as L,c as M,F as O,k as R,t as j,y as z,U as J,H as K,ag as P,ah as X,K as G,J as I,N as Q,_ as W,__tla as Y}from"./index-af173888.js";import{_ as Z,__tla as $}from"./Dialog-987c90a1.js";import{a as ee,D as ae,__tla as le}from"./dict-093d1dfa.js";import{a as te,c as se,u as re,__tla as ue}from"./dict.type-51edc0d0.js";import{C as g}from"./constants-a3c69b57.js";import{u as oe,__tla as me}from"./useMessage-170c1b43.js";let k,de=Promise.all([(()=>{try{return Y}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return me}catch{}})()]).then(async()=>{k=W(A({name:"SystemDictTypeForm",__name:"DictTypeForm",emits:["success"],setup(ie,{expose:U,emit:w}){const{t:_}=B(),v=oe(),o=d(!1),V=d(""),m=d(!1),b=d(""),t=d({id:void 0,name:"",type:"",status:g.ENABLE,remark:""}),C=H({name:[{required:!0,message:"\u5B57\u5178\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],type:[{required:!0,message:"\u5B57\u5178\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}]}),i=d();U({open:async(u,a)=>{if(o.value=!0,V.value=_("action."+u),b.value=u,S(),a){m.value=!0;try{t.value=await te(a)}finally{m.value=!1}}}});const D=w,F=async()=>{if(i&&await i.value.validate()){m.value=!0;try{const u=t.value;b.value==="create"?(await se(u),v.success(_("common.createSuccess"))):(await re(u),v.success(_("common.updateSuccess"))),o.value=!1,D("success")}finally{m.value=!1}}},S=()=>{var u;t.value={id:void 0,type:"",name:"",status:g.ENABLE,remark:""},(u=i.value)==null||u.resetFields()};return(u,a)=>{const p=J,c=K,T=P,x=X,E=G,h=I,N=Z,q=Q;return n(),f(N,{modelValue:e(o),"onUpdate:modelValue":a[5]||(a[5]=l=>z(o)?o.value=l:null),title:e(V)},{footer:s(()=>[r(h,{disabled:e(m),type:"primary",onClick:F},{default:s(()=>[y("\u786E \u5B9A")]),_:1},8,["disabled"]),r(h,{onClick:a[4]||(a[4]=l=>o.value=!1)},{default:s(()=>[y("\u53D6 \u6D88")]),_:1})]),default:s(()=>[L((n(),f(E,{ref_key:"formRef",ref:i,model:e(t),rules:e(C),"label-width":"80px"},{default:s(()=>[r(c,{label:"\u5B57\u5178\u540D\u79F0",prop:"name"},{default:s(()=>[r(p,{modelValue:e(t).name,"onUpdate:modelValue":a[0]||(a[0]=l=>e(t).name=l),placeholder:"\u8BF7\u8F93\u5165\u5B57\u5178\u540D\u79F0"},null,8,["modelValue"])]),_:1}),r(c,{label:"\u5B57\u5178\u7C7B\u578B",prop:"type"},{default:s(()=>[r(p,{modelValue:e(t).type,"onUpdate:modelValue":a[1]||(a[1]=l=>e(t).type=l),disabled:e(t).id!==void 0,placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u540D\u79F0"},null,8,["modelValue","disabled"])]),_:1}),r(c,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[r(x,{modelValue:e(t).status,"onUpdate:modelValue":a[2]||(a[2]=l=>e(t).status=l)},{default:s(()=>[(n(!0),M(O,null,R(e(ee)(e(ae).COMMON_STATUS),l=>(n(),f(T,{key:l.value,label:l.value},{default:s(()=>[y(j(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),r(c,{label:"\u5907\u6CE8",prop:"remark"},{default:s(()=>[r(p,{modelValue:e(t).remark,"onUpdate:modelValue":a[3]||(a[3]=l=>e(t).remark=l),placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[q,e(m)]])]),_:1},8,["modelValue","title"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/system/dict/DictTypeForm.vue"]])});export{de as __tla,k as default};
|