1 |
- import{d as z,h as B,r as m,e as H,o as _,x as f,w as t,f as u,a as e,y,z as L,c as M,F as O,v as G,t as K,l as X,R as j,C as I,E as P,i as J,ad as Q,ae as W,H as Y,G as Z,K as $,_ as ee,__tla as ae}from"./index-8dc1e40a.js";import{_ as le,__tla as te}from"./Dialog-41802231.js";import{a as se,D as ue,__tla as re}from"./dict-f13a3c8f.js";import{a as oe,c as de,u as me,__tla as ie}from"./dict.type-30b4b5d2.js";import{C as k}from"./constants-a1da293a.js";import{u as ne,__tla as _e}from"./useMessage-7a27dd80.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(z({name:"SystemDictTypeForm",__name:"DictTypeForm",emits:["success"],setup(pe,{expose:U,emit:x}){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:""}),E=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=m();U({open:async(r,a)=>{if(o.value=!0,V.value=c("action."+r),b.value=r,T(),a){d.value=!0;try{s.value=await oe(a)}finally{d.value=!1}}}});const F=x,S=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,F("success")}finally{d.value=!1}}},T=()=>{var r;s.value={id:void 0,type:"",name:"",status:k.ENABLE,remark:""},(r=i.value)==null||r.resetFields()};return(r,a)=>{const p=j,n=I,h=P,C=J,D=Q,q=W,A=Y,g=Z,R=le,N=$;return _(),f(R,{modelValue:e(o),"onUpdate:modelValue":a[5]||(a[5]=l=>X(o)?o.value=l:null),title:e(V)},{footer:t(()=>[u(g,{disabled:e(d),type:"primary",onClick:S},{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(()=>[L((_(),f(A,{ref_key:"formRef",ref:i,model:e(s),rules:e(E),"label-width":"80px"},{default:t(()=>[u(C,{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),M(O,null,G(e(se)(e(ue).COMMON_STATUS),l=>(_(),f(D,{key:l.value,label:l.value},{default:t(()=>[y(K(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};
|