import{a2 as e,r as a,e as l,Q as t,f as s,g as c,o as i,h as n,w as o,i as r,j as u,t as p,a as d,k as b,F as m,l as f,N as _,A as h,x as L,z as D,y as k,a1 as y,S as g}from"./index-WeUkftbp.js";import{_ as N}from"./uni-popup.CI1Fmu1z.js";import{f as j}from"./customer.C_v9K5hM.js";import{_ as x}from"./_plugin-vue_export-helper.BCo6x5W8.js";const v=x({__name:"selectedLabel",props:{typeData:{type:Object,default:()=>[]},title:{type:String,default:""}},emits:["changeItem"],setup(x,{expose:v,emit:C}){const I=x,{typeData:O,title:w}=e(I),z=C,Q=a(null);a(1);const S=l({listData:[],selectLabelData:[],selectLabelName:[]});t((e=>{A()}));const A=()=>{j().then((e=>{S.listData=e.data.list}))},F=()=>{S.selectLabelData=[],S.selectLabelName=[],Q.value.close()},K=()=>{S.selectLabelData.length>0&&(S.selectLabelData=[],S.selectLabelName=[],z("resetLabel"),z("changeItem",[],S.selectLabelName)),F()},P=()=>{if(S.selectLabelData.length<=0)return L.error("至少选择一个"+w.value),!1;z("changeItem",S.selectLabelData,S.selectLabelName),F()};return v({popupOpen:(e,a)=>{Q.value.open(),e&&(S.selectLabelData=e),a&&(S.selectLabelName=a)}}),(e,a)=>{const l=D,t=k,L=y,j=g,x=s(c("uni-popup"),N);return i(),n(l,null,{default:o((()=>[r(x,{ref_key:"popupRef",ref:Q,type:"bottom","mask-click":!1},{default:o((()=>[r(l,{class:"slider"},{default:o((()=>[r(l,{class:"share-header"},{default:o((()=>[r(l,{class:"share-title"},{default:o((()=>[u(p(d(w)),1)])),_:1}),r(l,{onClick:F,class:"iconfont icon-shenpizhongxin-jujue"})])),_:1}),r(l,{class:"slider-laber"},{default:o((()=>[r(j,{"scroll-y":"true",style:{width:"100%",height:"100%"}},{default:o((()=>[(i(!0),b(m,null,f(S.listData,((e,a)=>(i(),n(l,{key:a},{default:o((()=>[e.children.length>0?(i(),n(t,{key:0,class:"text"},{default:o((()=>[u(p(e.name),1)])),_:2},1024)):_("",!0),r(l,{class:"slider-laber-item plr10"},{default:o((()=>[(i(!0),b(m,null,f(e.children,((e,a)=>(i(),n(L,{class:h(["laber-item-button line1",S.selectLabelData.includes(e.id)?"active":""]),key:"list"+a,onClick:a=>(e=>{const a=S.selectLabelData.indexOf(e.id);a>-1?(S.selectLabelData.splice(a,1),S.selectLabelName.splice(a,1)):(S.selectLabelData.push(e.id),S.selectLabelName.push(e.name))})(e)},{default:o((()=>[r(t,{class:"title line1"},{default:o((()=>[u(p(e.name),1)])),_:2},1024)])),_:2},1032,["class","onClick"])))),128))])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1}),r(l,{class:"slider-laber-bottom"},{default:o((()=>[r(L,{class:"reset laber-bottom",onClick:K},{default:o((()=>[u("重置")])),_:1}),r(L,{class:"laber-bottom confirm",onClick:P},{default:o((()=>[u("确认")])),_:1})])),_:1})])),_:1})])),_:1},512)])),_:1})}}},[["__scopeId","data-v-3b42e69f"]]);export{v as s};
