import{a1 as s,_ as a,u as e,J as t,q as i,c as o,w as l,b$ as r,c0 as n,i as c,o as h,C as u,D as d,F as f,A as m,t as g,v as p,H as _,E as y,G as j,x}from"./index-DL8B2Mxu.js";import{_ as k}from"./u-icon.CLOPtL2B.js";import{r as v}from"./uni-app.es.BSVEa1f2.js";import{r as z}from"./resources.DipqUmnN.js";import{_ as D}from"./_plugin-vue_export-helper.BCo6x5W8.js";const T=D({data:()=>({value:"",list:[],organizeList:[],majorType:"",icon:z.message.nodata,oldVal:"",show:!0}),onLoad(a){this.majorType=a.majorType,this.getUserOrganizes(this.majorType);let e="Organize"===this.majorType?"我的组织":"我的岗位";s({title:e})},methods:{getUserOrganizes(s){("Organize"===s?r:n)().then((s=>{let a=s.data||[];a.length!==[]?(this.organizeList=JSON.parse(JSON.stringify(a)),this.list=this.organizeList,this.list.map((s=>{if(s.isDefault)return this.value=s.id,void(this.oldVal=s.id)})),this.show=this.list.length>0):this.show=this.list.length>0}))},clickRadio(s,a){s.isDefault||this.change(s,a)},change(s,a){this.value=s.id,this.list.map(((s,e)=>{s.isDefault=!1,a===e&&(s.isDefault=!0)})),this.changeMajor(s.id,this.majorType)},changeMajor(s,e){a({majorId:s,majorType:e}).then((a=>{200===a.code&&(this.value=s,this.$u.toast("修改成功"),setTimeout((()=>this.getCurrentUser()),1e3))})).catch((()=>{this.value=this.oldVal}))},getCurrentUser(){e().getCurrentUser().then((()=>{t()}))}}},[["render",function(s,a,e,t,r,n){const z=_,D=v(i("u-icon"),k),T=c,O=y;return h(),o(T,{class:"page_v u-flex-col"},{default:l((()=>[r.show?(h(!0),u(f,{key:0},d(r.list,((s,a)=>(h(),o(T,{class:j(["lists_box",s.isDefault?"active":""]),key:a,onClick:e=>n.clickRadio(s,a)},{default:l((()=>[s.isDefault?(h(),o(T,{key:0,class:"icon-checked-box"},{default:l((()=>[g(z,null,{default:l((()=>[p(x("Organize"===r.majorType?"默认":"主岗"),1)])),_:1}),g(T,{class:"icon-checked"},{default:l((()=>[g(D,{name:"checkbox-mark",color:"#fff",size:"28"})])),_:1})])),_:1})):m("",!0),g(T,{class:"list_inner"},{default:l((()=>[g(z,{class:j(["icon-ym","Organize"===r.majorType?"icon-ym-organization":"icon-ym-wf-outgoingApply"])},null,8,["class"]),g(z,{class:"txt"},{default:l((()=>[p(x(s.fullName),1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["class","onClick"])))),128)):m("",!0),r.show?m("",!0):(h(),o(T,{key:1,class:"notData-box u-flex-col"},{default:l((()=>[g(T,{class:"u-flex-col notData-inner"},{default:l((()=>[g(O,{src:r.icon,mode:"",class:"iconImg"},null,8,["src"]),g(z,{class:"notData-inner-text"},{default:l((()=>[p("暂无数据")])),_:1})])),_:1})])),_:1}))])),_:1})}],["__scopeId","data-v-59a607d5"]]);export{T as default};
