"use strict";const e=require("../../common/vendor.js"),t=require("../../api/systemIndustry.js"),n={setup(){const n=e.ref([]),a=e.ref("");e.onLoad((d=>{let r="";d&&d.selected&&(a.value=decodeURIComponent(d.selected),r=a.value),e.index.setNavigationBarTitle({title:"选择行业"}),(async a=>{try{e.index.showLoading({title:"加载中..."});const[d]=await Promise.all([t.listIndustry()]);if(200===d.code){const e=d.rows||d.data||[],t=e.filter((e=>0==e.parentId||!e.parentId)).map((t=>{const n=e.filter((e=>e.parentId==t.industryId)).map((e=>e.industryName));return{name:t.industryName,expanded:!1,children:n}}));if(a){const e=a.split("-");e.length>0&&t.forEach((t=>{t.expanded=t.name===e[0]}))}else t.length>0&&(t[0].expanded=!0);n.value=t}}catch(d){console.error("加载行业数据失败",d),e.index.showToast({title:"加载行业数据失败",icon:"none"})}finally{e.index.hideLoading()}})(r)}));return{industryData:n,currentIndustry:a,toggleCategory:e=>{n.value[e].expanded=!n.value[e].expanded},selectIndustry:(t,n)=>{const d=`${t}-${n}`;a.value=d,e.index.$emit("select_industry",d),e.index.navigateBack()}}}};const a=e._export_sfc(n,[["render",function(t,n,a,d,r,s){return{a:e.f(t.industryData,((n,a,d)=>e.e({a:e.t(n.name),b:e.n(n.expanded?"expanded":""),c:e.o((e=>t.toggleCategory(a)),a),d:n.expanded},n.expanded?{e:e.f(n.children,((a,d,r)=>({a:e.t(a),b:d,c:e.n(t.currentIndustry===n.name+"-"+a?"active":""),d:e.o((e=>t.selectIndustry(n.name,a)),d)})))}:{},{f:a})))}}],["__scopeId","data-v-dddee891"]]);wx.createPage(a);