import{l as k,aK as x,aJ as V,r as o,m as s,p,F as b,a7 as g,u as t,M as u,a8 as h,O as f,S as m,n as C,T as w}from"./vue-chunks-DyZSmvoe.js";import{p as M,d as B,b as E,n as I}from"./element-plus-DNKe9-lk.js";const T={class:"flex flex-wrap"},R=k({__name:"message",props:x({formModel:{type:Object,default:()=>({})},onchange:{type:Function,default:()=>{}}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(v){let e=V(v,"modelValue");const l=o(""),n=o(!1),r=o(),y=d=>{e.value.splice(e.value.indexOf(d),1)},_=()=>{n.value=!0,C(()=>{r.value.input.focus()})},i=()=>{if(l.value){if(e.value.includes(l.value)){E.error("关键词已经存在");return}e.value=[...e.value,l.value]}n.value=!1,l.value=""};return(d,c)=>(s(),p("div",T,[(s(!0),p(b,null,g(t(e),a=>(s(),u(t(I),{key:a,closable:"",size:"large",class:"mr-4 mb-3","disable-transitions":!1,onClose:F=>y(a)},{default:f(()=>[m(w(a),1)]),_:2},1032,["onClose"]))),128)),n.value?(s(),u(t(M),{key:0,ref_key:"InputRef",ref:r,modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=a=>l.value=a),class:"mb-3",style:{width:"114px"},onKeyup:h(i,["enter"]),onBlur:i},null,8,["modelValue"])):(s(),u(t(B),{key:1,class:"button-new-tag",onClick:_},{default:f(()=>[m(" + 添加关键词 ")]),_:1}))]))}});export{R as _};
