"use strict";const e=require("../../common/vendor.js"),t=require("../../api/systemIndustry.js"),n={setup(){const n=e.ref(""),r=e.ref(0),s=e.ref("category-0"),a=e.ref("");let c=[],o=!1,i=null;const l=e.getCurrentInstance(),d=e.ref([]),u=e.computed((()=>{if(!n.value)return[];const e=n.value.toLowerCase(),t=[];return d.value.forEach((n=>{n.sections.forEach((n=>{n.children.forEach((n=>{n.toLowerCase().includes(e)&&t.push(n)}))}))})),t}));e.onLoad((n=>{let c="";n&&n.selected&&(a.value=decodeURIComponent(n.selected),c=a.value),e.index.setNavigationBarTitle({title:"选择职位名称"}),(async n=>{try{e.index.showLoading({title:"加载中..."});const[a,c]=await Promise.all([t.listIndustry(),t.listIndustrySkill()]);if(200===a.code&&200===c.code){const e=a.rows||a.data||[],t=c.rows||c.data||[],o=e.filter((e=>0==e.parentId||!e.parentId)).map((n=>{const r=e.filter((e=>e.parentId==n.industryId)).map((e=>{const n=t.filter((t=>t.industryId==e.industryId)).map((e=>e.skillName));return{name:e.industryName,id:e.industryId,children:n}}));return{name:n.industryName,id:n.industryId,sections:r}}));if(d.value=o,n)for(let a=0;a{h()}),500)}}catch(a){console.error("加载职位结构失败",a),e.index.showToast({title:"加载职位失败",icon:"none"})}finally{e.index.hideLoading()}})(c)}));const h=()=>{e.index.createSelectorQuery().in(l.proxy).selectAll(".category-wrapper").boundingClientRect((e=>{if(e&&e.length>0){let t=0;c=e.map((e=>{let n=t;return t+=e.height,n}))}})).exec()};return{searchQuery:n,activeIndex:r,scrollIntoId:s,currentSelected:a,positionData:d,searchResults:u,selectMenu:e=>{r.value=e,s.value="category-"+e,o=!0,clearTimeout(i),i=setTimeout((()=>{o=!1}),600)},selectPosition:t=>{e.index.$emit("select_position",t),e.index.navigateBack()},onRightScroll:e=>{if(o||0===c.length)return;const t=e.detail.scrollTop;let n=0;for(let r=0;r=c[r]-15;r++)n=r;r.value!==n&&(r.value=n)}}}};const r=e._export_sfc(n,[["render",function(t,n,r,s,a,c){return e.e({a:t.searchQuery,b:e.o((e=>t.searchQuery=e.detail.value)),c:!t.searchQuery},t.searchQuery?e.e({h:t.searchResults.length>0},t.searchResults.length>0?{i:e.f(t.searchResults,((n,r,s)=>({a:e.t(n),b:e.n(n===t.currentSelected?"selected":""),c:r,d:e.o((e=>t.selectPosition(n)),r)})))}:{}):{d:e.f(t.positionData,((n,r,s)=>e.e({a:e.t(n.name),b:t.activeIndex===r},(t.activeIndex,{}),{c:r,d:e.n(t.activeIndex===r?"active":""),e:e.o((e=>t.selectMenu(r)),r)}))),e:e.f(t.positionData,((n,r,s)=>({a:e.f(n.sections,((n,r,s)=>({a:e.t(n.name),b:e.f(n.children,((n,r,s)=>({a:e.t(n),b:e.n(n===t.currentSelected?"selected":""),c:r,d:e.o((e=>t.selectPosition(n)),r)}))),c:"sub-"+r}))),b:"wrapper-"+r,c:"category-"+r}))),f:t.scrollIntoId,g:e.o(((...e)=>t.onRightScroll&&t.onRightScroll(...e)))})}],["__scopeId","data-v-41cb5d18"]]);wx.createPage(r);