2 lines
2.5 KiB
JavaScript
2 lines
2.5 KiB
JavaScript
import{_ as e,a0 as t,v as s,x as a,o as c,a as l,w as i,k as o,j as n,b as r,F as h,r as d,d as u,y as f,z as p,I as y,J as k,K as g,l as m,S as b}from"./index-BoIbtAZO.js";import{_}from"./uni-icons.SM4XIXQc.js";const x=e({name:"expected-station",data:()=>({leftValue:{},rightValue:[],stationCateLog:0,copyTree:[]}),props:{station:{type:Array,default:[]},search:{type:Boolean,default:!0},max:{type:Number,default:5}},created(){this.copyTree=this.station,this.copyTree.length&&(this.leftValue=this.copyTree[0],this.rightValue=this.copyTree[0].children)},watch:{station(e){this.copyTree=this.station,this.copyTree.length&&(this.leftValue=this.copyTree[0],this.rightValue=this.copyTree[0].children)}},methods:{changeStationLog(e){this.leftValue=e,this.rightValue=e.children},addItem(e){let s=[],a=0;for(const t of this.copyTree)for(const e of t.children)for(const t of e.children)t.checked&&a++;for(const c of this.copyTree){c.checkednumber=0;for(const l of c.children)for(const i of l.children){if(i.id===e.id){if(!i.checked&&a>=5){t({title:"最多选择5个职位",icon:"none"});continue}i.checked=!i.checked}i.checked&&(s.push(`${i.id}`),c.checkednumber++)}}s=s.join(","),this.$emit("onChange",s)}}},[["render",function(e,t,x,T,V,C){const j=s(a("uni-icons"),_),w=g,I=m,L=b;return c(),l(I,{class:"expected-station"},{default:i((()=>[x.search?(c(),l(I,{key:0,class:"sex-search"},{default:i((()=>[o(j,{class:"iconsearch",type:"search",size:"20"}),o(w,{class:"uni-input searchinput","confirm-type":"search"})])),_:1})):n("",!0),o(I,{class:"sex-content"},{default:i((()=>[o(L,{"show-scrollbar":!1,"scroll-y":!0,class:"sex-content-left"},{default:i((()=>[(c(!0),r(h,null,d(V.copyTree,(e=>(c(),l(I,{key:e.id,class:u(["left-list-btn",{"left-list-btned":e.id===V.leftValue.id}]),onClick:t=>C.changeStationLog(e)},{default:i((()=>[f(p(e.label)+" ",1),y(o(I,{class:"positionNum"},{default:i((()=>[f(p(e.checkednumber),1)])),_:2},1536),[[k,e.checkednumber]])])),_:2},1032,["class","onClick"])))),128))])),_:1}),o(L,{"show-scrollbar":!1,"scroll-y":!0,class:"sex-content-right"},{default:i((()=>[(c(!0),r(h,null,d(V.rightValue,(e=>(c(),l(I,{key:e.id},{default:i((()=>[o(I,{class:"secondary-title"},{default:i((()=>[f(p(e.label),1)])),_:2},1024),o(I,{class:"grid-sex"},{default:i((()=>[(c(!0),r(h,null,d(e.children,(e=>(c(),l(I,{key:e.id,class:u([{"sex-right-btned":e.checked},"sex-right-btn"]),onClick:t=>C.addItem(e)},{default:i((()=>[f(p(e.label),1)])),_:2},1032,["class","onClick"])))),128))])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-efd19bad"]]);export{x as _};
|