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