DictTypeForm-a77265dc.js 3.5 KB

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