import{s as l,t as d}from"./index.DLhCD1Qz.js";import{_}from"./yb_admin_plugin.DNFUAscl.js";import{aL as s,u as e,v as m,F as c,aX as g,au as u,bb as h,t as f}from"./@vue.Da0bZ210.js";import"./vue.Bj6dTZYa.js";import"./@element-plus.pQhr8KT1.js";import"./echarts.Dms41JYJ.js";import"./tslib.BDyQ-Jie.js";import"./zrender.BueMfJu3.js";import"./axios.BjtuyMK1.js";import"./pinia.Tngw-S_5.js";import"./vue-router.DaVMGKLh.js";import"./element-plus.DC208N5p.js";import"./lodash-es.DVGGNlzX.js";import"./@vueuse.BhH-hw9p.js";import"./async-validator.9PlIezaS.js";import"./@popperjs.C5az9QE8.js";import"./@ctrl.C4Rzlq_k.js";import"./dayjs.BLMYetss.js";import"./memoize-one.BdPwpGay.js";import"./normalize-wheel-es.BQoi3Ox2.js";import"./@floating-ui.DCXYYTka.js";import"./vue-i18n.C7BagGww.js";import"./@intlify.TnaUIxGf.js";import"./moment.C5S46NFB.js";const k={title:"客户标签",name:"Tag",props:{edit:{type:Object,default:()=>({id:0})}},data(){return{customer_tags:[],total_tags:[]}},created(){this.handleTagsData()},methods:{handleTagsData(){d(this.edit.id.id).then(t=>{this.customer_tags=t.data.customer_tags,this.total_tags=t.data.total_tags})},handleTagSelect(t){this.customer_tags.includes(t)?this.customer_tags.map((i,r)=>{i===t&&this.customer_tags.splice(r,1)}):this.customer_tags.push(t)},onSubmit(){l({id:this.edit.id.id,customer_tags:this.customer_tags}).then(t=>{this.$baseMessage("保存成功"),this.callBack&&this.callBack()})}}},v={class:"row"},x={class:"auto_tag",style:{display:"flex","flex-wrap":"wrap","margin-top":"10px"}},y=["onClick"],b={key:0,style:{"text-align":"center","margin-top":"100px"}};function B(t,i,r,T,a,n){return s(),e(c,null,[m("div",v,[m("div",x,[(s(!0),e(c,null,g(a.total_tags,(o,p)=>(s(),e("div",{key:p,class:u(["tag",a.customer_tags.includes(o.id)?"active":""]),onClick:C=>n.handleTagSelect(o.id)},h(o.name),11,y))),128))])]),a.total_tags.length==0?(s(),e("div",b,"请先添加客户标签后操作")):f("",!0)],64)}const W=_(k,[["render",B],["__scopeId","data-v-41ed44ab"]]);export{W as default};
