import{d as T,Q as G,r as o,x as K,o as m,A as _,B as s,f as u,a,E as f,k as Q,c as w,F as S,R as U,G as Z,a2 as j,a8 as z,V as H,as as I,at as P,S as J,U as X,W as Y,K as $,Z as ee,__tla as ae}from"./index-92ad187a.js";import{_ as le,__tla as te}from"./Dialog-44c9fa34.js";import{a as se,D as ue,__tla as re}from"./dict-221f3e01.js";import{g as oe,a as de,c as ie,u as me,__tla as ne}from"./index-546c0e4c.js";import{C as k}from"./constants-c811e5ff.js";import{u as ce,__tla as _e}from"./useMessage-d9788660.js";let E,pe=Promise.all([(()=>{try{return ae}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return ne}catch{}})(),(()=>{try{return _e}catch{}})()]).then(async()=>{E=T({name:"SystemSensitiveWordForm",__name:"SensitiveWordForm",emits:["success"],setup(fe,{expose:x,emit:A}){const{t:p}=G(),v=ce(),d=o(!1),y=o(""),i=o(!1),b=o(""),t=o({id:void 0,name:"",status:k.ENABLE,description:"",tags:[]}),C=K({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(),V=o([]);x({open:async(r,l)=>{if(d.value=!0,y.value=p("action."+r),b.value=r,M(),l){i.value=!0;try{t.value=await oe(l)}finally{i.value=!1}}V.value=await de()}});const F=A,B=async()=>{if(n&&await n.value.validate()){i.value=!0;try{const r=t.value;b.value==="create"?(await ie(r),v.success(p("common.createSuccess"))):(await me(r),v.success(p("common.updateSuccess"))),d.value=!1,F("success")}finally{i.value=!1}}},M=()=>{var r;t.value={id:void 0,name:"",status:k.ENABLE,description:"",tags:[]},(r=n.value)==null||r.resetFields()};return(r,l)=>{const g=z,c=H,N=I,W=P,q=J,D=X,L=Y,h=$,O=le,R=ee;return m(),_(O,{modelValue:a(d),"onUpdate:modelValue":l[5]||(l[5]=e=>j(d)?d.value=e:null),title:a(y)},{footer:s(()=>[u(h,{disabled:a(i),type:"primary",onClick:B},{default:s(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),u(h,{onClick:l[4]||(l[4]=e=>d.value=!1)},{default:s(()=>[f("\u53D6 \u6D88")]),_:1})]),default:s(()=>[Q((m(),_(L,{ref_key:"formRef",ref:n,model:a(t),rules:a(C),"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(W,{modelValue:a(t).status,"onUpdate:modelValue":l[1]||(l[1]=e=>a(t).status=e)},{default:s(()=>[(m(!0),w(S,null,U(a(se)(a(ue).COMMON_STATUS),e=>(m(),_(N,{key:e.value,label:e.value},{default:s(()=>[f(Z(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(D,{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,U(a(V),e=>(m(),_(q,{key:e,label:e,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[R,a(i)]])]),_:1},8,["modelValue","title"])}}})});export{E as _,pe as __tla};
