import{a2 as e,r as a,e as t,c as l,Q as s,f as c,g as i,o as n,h as r,w as o,i as u,j as d,t as m,a as p,k as b,F as f,l as _,A as h,x as L,z as k,y as g,a1 as y,S as D}from"./index-DXvjTqMr.js";import{_ as v}from"./uni-popup.BpvJsdxE.js";import{_ as j}from"./_plugin-vue_export-helper.BCo6x5W8.js";const N=[{name:"异常",id:1},{name:"迟到",id:2},{name:"严重迟到",id:3},{name:"早退",id:4},{name:"缺卡",id:5},{name:"旷工",id:6},{name:"外勤卡",id:7},{name:"异常外勤",id:8}],x=[{name:"工作日加班",id:1},{name:"休息日加班",id:2},{name:"节假日加班",id:3}],C=e=>{const a={2:"迟到",3:"严重迟到",4:"早退",5:"晚到缺卡",6:"早退缺卡",7:"缺卡"};return e.filter((e=>a[e])).map((e=>a[e])).join(", ")},I=e=>{const a={1:"外勤",2:"地点异常"};return e.filter((e=>a[e])).map((e=>a[e])).join(", ")},w=e=>{let a;switch(e){case 0:a="正常";break;case 1:a="异常";break;case 2:a="迟到";break;case 3:a="严重迟到";break;case 4:a="早退";break;case 5:a="缺卡";break;case 6:a="旷工";break;case 7:a="外勤卡";break;case 8:a="异常外勤"}return a},O=j({__name:"selectedLabel",props:{typeData:{type:Object,default:()=>[]},title:{type:String,default:""},type:{type:String,default:""}},emits:["changeItem"],setup(j,{expose:C,emit:I}){const w=j,{typeData:O,title:S,type:z}=e(w),Q=I,A=a(null);a(1);const F=t({listData:N,selectLabelData:[],selectLabelName:[]}),P=l((()=>0==z.value||1==z.value?N:3==z.value?x:void 0));s((e=>{}));const R=()=>{F.selectLabelData=[],A.value.close()},q=()=>{F.selectLabelData.length>0&&(F.selectLabelName=[],Q("changeItem",[],F.selectLabelName)),Q("changeItem",[],F.selectLabelName),R()},B=()=>{if(F.selectLabelData.length<=0)return L.error("至少选择一个"+S.value),!1;Q("changeItem",F.selectLabelData,F.selectLabelName),R()};return C({popupOpen:(e,a)=>{A.value.open(),e&&(F.selectLabelData=e),a&&(F.selectLabelName=a)}}),(e,a)=>{const t=k,l=g,s=y,L=D,j=c(i("uni-popup"),v);return n(),r(t,null,{default:o((()=>[u(j,{ref_key:"popupRef",ref:A,type:"bottom","mask-click":!1},{default:o((()=>[u(t,{class:"slider"},{default:o((()=>[u(t,{class:"share-header"},{default:o((()=>[u(t,{class:"share-title"},{default:o((()=>[d(m(p(S)),1)])),_:1}),u(t,{onClick:R,class:"iconfont icon-shenpizhongxin-jujue"})])),_:1}),u(t,{class:"slider-laber"},{default:o((()=>[u(L,{"scroll-y":"true",style:{width:"100%",height:"100%"}},{default:o((()=>[u(t,null,{default:o((()=>[u(t,{class:"slider-laber-item plr10"},{default:o((()=>[(n(!0),b(f,null,_(p(P),((e,a)=>(n(),r(s,{class:h(["laber-item-button line1",F.selectLabelData.includes(e.id)?"active":""]),key:"list"+a,onClick:a=>(e=>{const a=F.selectLabelData.indexOf(e.id);a>-1?(F.selectLabelData.splice(a,1),F.selectLabelName.splice(a,1)):(F.selectLabelData.push(e.id),F.selectLabelName.push(e.name))})(e)},{default:o((()=>[u(l,{class:"title line1"},{default:o((()=>[d(m(e.name),1)])),_:2},1024)])),_:2},1032,["class","onClick"])))),128))])),_:1})])),_:1})])),_:1})])),_:1}),u(t,{class:"slider-laber-bottom"},{default:o((()=>[u(s,{class:"reset laber-bottom",onClick:q},{default:o((()=>[d("重置")])),_:1}),u(s,{class:"laber-bottom confirm",onClick:B},{default:o((()=>[d("确认")])),_:1})])),_:1})])),_:1})])),_:1},512)])),_:1})}}},[["__scopeId","data-v-d9be1164"]]);export{I as a,C as g,O as s,w as t};
