SensitiveWordForm-5b839b8e.js 3.4 KB

1
  1. import{d as T,h as j,r as o,e as I,o as m,v as _,w as s,f as u,a,n as f,x as R,c as w,F as S,q as x,t as G,O as H,V as J,A as K,ah as P,ai as X,y as Q,z as Y,D as Z,C as $,I as ee,_ as ae,__tla as le}from"./index-8e30b17f.js";import{_ as te,__tla as se}from"./Dialog-9917188a.js";import{a as ue,D as re,__tla as oe}from"./dict-500f7ec9.js";import{g as ie,a as de,c as me,u as ne,__tla as ce}from"./index-f82b37e9.js";import{C}from"./constants-40f13f5e.js";import{u as _e,__tla as pe}from"./useMessage-ee50bd51.js";let U,fe=Promise.all([(()=>{try{return le}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ce}catch{}})(),(()=>{try{return pe}catch{}})()]).then(async()=>{U=ae(T({name:"SystemSensitiveWordForm",__name:"SensitiveWordForm",emits:["success"],setup(ve,{expose:k,emit:A}){const{t:p}=j(),v=_e(),i=o(!1),y=o(""),d=o(!1),V=o(""),t=o({id:void 0,name:"",status:C.ENABLE,description:"",tags:[]}),E=I({name:[{required:!0,message:"\u654F\u611F\u8BCD\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],tags:[{required:!0,message:"\u6807\u7B7E\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),n=o(),b=o([]);k({open:async(r,l)=>{if(i.value=!0,y.value=p("action."+r),V.value=r,D(),l){d.value=!0;try{t.value=await ie(l)}finally{d.value=!1}}b.value=await de()}});const F=A,W=async()=>{if(n&&await n.value.validate()){d.value=!0;try{const r=t.value;V.value==="create"?(await me(r),v.success(p("common.createSuccess"))):(await ne(r),v.success(p("common.updateSuccess"))),i.value=!1,F("success")}finally{d.value=!1}}},D=()=>{var r;t.value={id:void 0,name:"",status:C.ENABLE,description:"",tags:[]},(r=n.value)==null||r.resetFields()};return(r,l)=>{const g=J,c=K,O=P,q=X,z=Q,M=Y,N=Z,h=$,B=te,L=ee;return m(),_(B,{modelValue:a(i),"onUpdate:modelValue":l[5]||(l[5]=e=>H(i)?i.value=e:null),title:a(y)},{footer:s(()=>[u(h,{disabled:a(d),type:"primary",onClick:W},{default:s(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),u(h,{onClick:l[4]||(l[4]=e=>i.value=!1)},{default:s(()=>[f("\u53D6 \u6D88")]),_:1})]),default:s(()=>[R((m(),_(N,{ref_key:"formRef",ref:n,model:a(t),rules:a(E),"label-width":"80px"},{default:s(()=>[u(c,{label:"\u654F\u611F\u8BCD",prop:"name"},{default:s(()=>[u(g,{modelValue:a(t).name,"onUpdate:modelValue":l[0]||(l[0]=e=>a(t).name=e),placeholder:"\u8BF7\u8F93\u5165\u654F\u611F\u8BCD"},null,8,["modelValue"])]),_:1}),u(c,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[u(q,{modelValue:a(t).status,"onUpdate:modelValue":l[1]||(l[1]=e=>a(t).status=e)},{default:s(()=>[(m(!0),w(S,null,x(a(ue)(a(re).COMMON_STATUS),e=>(m(),_(O,{key:e.value,label:e.value},{default:s(()=>[f(G(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(c,{label:"\u5907\u6CE8",prop:"description"},{default:s(()=>[u(g,{modelValue:a(t).description,"onUpdate:modelValue":l[2]||(l[2]=e=>a(t).description=e),placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9"},null,8,["modelValue"])]),_:1}),u(c,{label:"\u6807\u7B7E",prop:"tags"},{default:s(()=>[u(M,{modelValue:a(t).tags,"onUpdate:modelValue":l[3]||(l[3]=e=>a(t).tags=e),"allow-create":"",filterable:"",multiple:"",placeholder:"\u8BF7\u9009\u62E9\u6587\u7AE0\u6807\u7B7E",style:{width:"380px"}},{default:s(()=>[(m(!0),w(S,null,x(a(b),e=>(m(),_(z,{key:e,label:e,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[L,a(d)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/sensitiveWord/SensitiveWordForm.vue"]])});export{fe as __tla,U as default};