ErrorCodeForm-e9e7ae89.js 3.5 KB

1
  1. import{aA as i,d as O,P as J,r as p,x as M,o as h,C as w,A as s,f as o,a,D as x,k as R,a2 as T,a9 as W,V as Z,W as B,J as G,Z as H,_ as I,__tla as K}from"./index-54aa57d8.js";import{_ as L,__tla as Q}from"./Dialog-7bb778a5.js";import{u as X,__tla as Y}from"./useMessage-f56cafbb.js";let v,C,N,S,U,$=Promise.all([(()=>{try{return K}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return Y}catch{}})()]).then(async()=>{U=d=>i.get({url:"/system/error-code/page",params:d}),N=d=>i.delete({url:"/system/error-code/delete?id="+d}),S=d=>i.download({url:"/system/error-code/export-excel",params:d}),v=I(O({name:"SystemErrorCodeForm",__name:"ErrorCodeForm",emits:["success"],setup(d,{expose:k,emit:E}){const{t:f}=J(),y=X(),u=p(!1),g=p(""),m=p(!1),b=p(""),l=p({id:void 0,code:void 0,applicationName:"",message:"",memo:""}),F=M({applicationName:[{required:!0,message:"\u5E94\u7528\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],code:[{required:!0,message:"\u9519\u8BEF\u7801\u7F16\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],message:[{required:!0,message:"\u9519\u8BEF\u7801\u63D0\u793A\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),n=p();k({open:async(t,e)=>{if(u.value=!0,g.value=f("action."+t),b.value=t,j(),e){m.value=!0;try{l.value=await(c=>i.get({url:"/system/error-code/get?id="+c}))(e)}finally{m.value=!1}}}});const q=E,z=async()=>{if(n&&await n.value.validate()){m.value=!0;try{const t=l.value;b.value==="create"?(await(e=>i.post({url:"/system/error-code/create",data:e}))(t),y.success(f("common.createSuccess"))):(await(e=>i.put({url:"/system/error-code/update",data:e}))(t),y.success(f("common.updateSuccess"))),u.value=!1,q("success")}finally{m.value=!1}}},j=()=>{var t;l.value={id:void 0,applicationName:"",code:void 0,message:"",memo:""},(t=n.value)==null||t.resetFields()};return(t,e)=>{const c=W,_=Z,P=B,V=G,A=L,D=H;return h(),w(A,{modelValue:a(u),"onUpdate:modelValue":e[5]||(e[5]=r=>T(u)?u.value=r:null),title:a(g)},{footer:s(()=>[o(V,{disabled:a(m),type:"primary",onClick:z},{default:s(()=>[x("\u786E \u5B9A")]),_:1},8,["disabled"]),o(V,{onClick:e[4]||(e[4]=r=>u.value=!1)},{default:s(()=>[x("\u53D6 \u6D88")]),_:1})]),default:s(()=>[R((h(),w(P,{ref_key:"formRef",ref:n,model:a(l),rules:a(F),"label-width":"100px"},{default:s(()=>[o(_,{label:"\u5E94\u7528\u540D",prop:"applicationName"},{default:s(()=>[o(c,{modelValue:a(l).applicationName,"onUpdate:modelValue":e[0]||(e[0]=r=>a(l).applicationName=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5E94\u7528\u540D"},null,8,["modelValue"])]),_:1}),o(_,{label:"\u9519\u8BEF\u7801\u7F16\u7801",prop:"code"},{default:s(()=>[o(c,{modelValue:a(l).code,"onUpdate:modelValue":e[1]||(e[1]=r=>a(l).code=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u9519\u8BEF\u7801\u7F16\u7801"},null,8,["modelValue"])]),_:1}),o(_,{label:"\u9519\u8BEF\u7801\u63D0\u793A",prop:"message"},{default:s(()=>[o(c,{modelValue:a(l).message,"onUpdate:modelValue":e[2]||(e[2]=r=>a(l).message=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u9519\u8BEF\u7801\u63D0\u793A"},null,8,["modelValue"])]),_:1}),o(_,{label:"\u5907\u6CE8",prop:"memo"},{default:s(()=>[o(c,{modelValue:a(l).memo,"onUpdate:modelValue":e[3]||(e[3]=r=>a(l).memo=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[D,a(m)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/errorCode/ErrorCodeForm.vue"]]),C=Object.freeze(Object.defineProperty({__proto__:null,default:v},Symbol.toStringTag,{value:"Module"}))});export{v as E,$ as __tla,C as a,N as d,S as e,U as g};