ConfigForm-75f2053e.js 4.0 KB

1
  1. import{d as N,h as O,r as i,e as S,o as _,v as f,w as u,f as t,a as e,n as v,x as j,c as z,F as B,q as E,t as G,O as H,V as L,A as M,ah as P,ai as T,D as X,C as J,I as K,_ as Q,__tla as W}from"./index-11e4820e.js";import{_ as Y,__tla as Z}from"./Dialog-bbfaf85c.js";import{g as $,D as ee,__tla as ae}from"./dict-4072dcec.js";import{g as le,c as re,u as te,__tla as ue}from"./index-741ddc62.js";import{u as se,__tla as oe}from"./useMessage-06ddf735.js";let k,de=Promise.all([(()=>{try{return W}catch{}})(),(()=>{try{return Z}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return oe}catch{}})()]).then(async()=>{k=Q(N({name:"InfraConfigForm",__name:"ConfigForm",emits:["success"],setup(me,{expose:h,emit:w}){const{t:p}=O(),y=se(),o=i(!1),g=i(""),d=i(!1),b=i(""),r=i({id:void 0,category:"",name:"",key:"",value:"",visible:!0,remark:""}),U=S({category:[{required:!0,message:"\u53C2\u6570\u5206\u7C7B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u53C2\u6570\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],key:[{required:!0,message:"\u53C2\u6570\u952E\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],value:[{required:!0,message:"\u53C2\u6570\u952E\u503C\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],visible:[{required:!0,message:"\u662F\u5426\u53EF\u89C1\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),c=i();h({open:async(s,a)=>{if(o.value=!0,g.value=p("action."+s),b.value=s,q(),a){d.value=!0;try{r.value=await le(a)}finally{d.value=!1}}}});const C=w,F=async()=>{if(c&&await c.value.validate()){d.value=!0;try{const s=r.value;b.value==="create"?(await re(s),y.success(p("common.createSuccess"))):(await te(s),y.success(p("common.updateSuccess"))),o.value=!1,C("success")}finally{d.value=!1}}},q=()=>{var s;r.value={id:void 0,category:"",name:"",key:"",value:"",visible:!0,remark:""},(s=c.value)==null||s.resetFields()};return(s,a)=>{const n=L,m=M,x=P,I=T,D=X,V=J,R=Y,A=K;return _(),f(R,{modelValue:e(o),"onUpdate:modelValue":a[7]||(a[7]=l=>H(o)?o.value=l:null),title:e(g)},{footer:u(()=>[t(V,{disabled:e(d),type:"primary",onClick:F},{default:u(()=>[v("\u786E \u5B9A")]),_:1},8,["disabled"]),t(V,{onClick:a[6]||(a[6]=l=>o.value=!1)},{default:u(()=>[v("\u53D6 \u6D88")]),_:1})]),default:u(()=>[j((_(),f(D,{ref_key:"formRef",ref:c,model:e(r),rules:e(U),"label-width":"80px"},{default:u(()=>[t(m,{label:"\u53C2\u6570\u5206\u7C7B",prop:"category"},{default:u(()=>[t(n,{modelValue:e(r).category,"onUpdate:modelValue":a[0]||(a[0]=l=>e(r).category=l),placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u5206\u7C7B"},null,8,["modelValue"])]),_:1}),t(m,{label:"\u53C2\u6570\u540D\u79F0",prop:"name"},{default:u(()=>[t(n,{modelValue:e(r).name,"onUpdate:modelValue":a[1]||(a[1]=l=>e(r).name=l),placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u540D\u79F0"},null,8,["modelValue"])]),_:1}),t(m,{label:"\u53C2\u6570\u952E\u540D",prop:"key"},{default:u(()=>[t(n,{modelValue:e(r).key,"onUpdate:modelValue":a[2]||(a[2]=l=>e(r).key=l),placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u952E\u540D"},null,8,["modelValue"])]),_:1}),t(m,{label:"\u53C2\u6570\u952E\u503C",prop:"value"},{default:u(()=>[t(n,{modelValue:e(r).value,"onUpdate:modelValue":a[3]||(a[3]=l=>e(r).value=l),placeholder:"\u8BF7\u8F93\u5165\u53C2\u6570\u952E\u503C"},null,8,["modelValue"])]),_:1}),t(m,{label:"\u662F\u5426\u53EF\u89C1",prop:"visible"},{default:u(()=>[t(I,{modelValue:e(r).visible,"onUpdate:modelValue":a[4]||(a[4]=l=>e(r).visible=l)},{default:u(()=>[(_(!0),z(B,null,E(e($)(e(ee).INFRA_BOOLEAN_STRING),l=>(_(),f(x,{key:l.value,label:l.value},{default:u(()=>[v(G(l.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(m,{label:"\u5907\u6CE8",prop:"remark"},{default:u(()=>[t(n,{modelValue:e(r).remark,"onUpdate:modelValue":a[5]||(a[5]=l=>e(r).remark=l),placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[A,e(d)]])]),_:1},8,["modelValue","title"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/infra/config/ConfigForm.vue"]])});export{de as __tla,k as default};